./
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
3 / 3
100.0%
Branches:
-
-%
Functions:
1 / 1, 1 excl
100.0%

include/terraingen/layers/craters/profiles/martin_parkes_dunstan.h
Line Branch Exec Source
1 // SPDX-License-Identifier: BSD-3-Clause
2
3 /// @file
4 /// @brief The simple-crater profile of Martin, Parkes and Dunstan (2014).
5 #pragma once
6
7 #include "terraingen/layers/craters/profiles/profile.h"
8
9 namespace terraingen {
10
11 /// Simple-crater profile of Martin, Parkes and Dunstan (2014): bowl, inner rim, outer rim
12 /// and ejecta polynomials joined continuously; degradation rounds the rim.
13 442 class MartinParkesDunstanProfile final : public CraterProfile {
14 public:
15 /// Reads the fresh and current rim heights and current depth of `state`;
16 /// `MartinParkesDunstanHeight` in single precision.
17 /// @throws std::invalid_argument if the state's depth is not positive or its current rim height
18 /// is negative or exceeds the fresh rim height.
19 double Height(double distance, double diameter, const CraterState& state) const override;
20
21 339857 double ReachRadii() const override {
22 339857 return 2.0;
23 }
24
25 /// The profile as the crater kernel evaluates it.
26 const CraterProfileKernel& Kernel() const {
27 return m_kernel;
28 }
29
30 private:
31 CraterProfileKernel m_kernel = [] {
32 CraterProfileKernel kernel;
33 kernel.simple = CraterProfileKind::MartinParkesDunstan;
34 return kernel;
35 }();
36 };
37
38 } // namespace terraingen
39