TerrainGen coverage


terraingen/
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
3 / 3
100.0%
Branches:
-
-%
Functions:
2 / 2
100.0%

layers/craters/profiles/profile.h
Line Branch Exec Source
1 /// @file
2 /// @brief `CraterProfile`, a crater's height as a function of distance from its centre.
3 #pragma once
4
5 #include "terraingen/layers/craters/degradation/state.h"
6
7 namespace terraingen {
8
9 /// The topography of a crater: height relative to the pre-impact surface by distance from
10 /// the centre, for a degradation state.
11 class CraterProfile {
12 public:
13 1145 virtual ~CraterProfile() = default;
14
15 /// The height (m) relative to the surface the crater formed on, at `distance` metres from the
16 /// centre of a crater `diameter` metres rim to rim.
17 virtual double Height(double distance, double diameter, const CraterState& state) const = 0;
18
19 /// The distance in crater radii beyond which `Height` is zero.
20 virtual double ReachRadii() const = 0;
21
22 /// Whether a crater of `diameter` metres has the complex form (flat floor, terraced walls,
23 /// central peak); false by default.
24 7685105 virtual bool IsComplex(double /*diameter*/) const {
25 7685105 return false;
26 }
27 };
28
29 } // namespace terraingen
30