TerrainGen coverage


terraingen/
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
6 / 6
100.0%
Branches:
5 / 10
50.0%
Functions:
1 / 1, 1 excl
100.0%

layers/craters/shaping/attributes.h
Line Branch Exec Source
1 /// @file
2 /// @brief `CraterAttributes`, what a crater looks like in its current state.
3 #pragma once
4
5 #include "terraingen/layers/craters/degradation/state.h"
6 #include "terraingen/layers/craters/generation/population.h"
7 #include "terraingen/layers/craters/profiles/profile.h"
8
9 namespace terraingen {
10
11 /// What a crater looks like in its current state, for listing, labelling or placing.
12 struct CraterAttributes {
13 29 double floorDepth = 0.0; ///< Depth of the floor below the surrounding surface (m).
14 29 double rimHeight = 0.0; ///< Height of the rim crest above the surrounding surface (m).
15 29 double depthRatio = 0.0; ///< Rim-to-floor depth over diameter now.
16 /// The depth ratio now over that when fresh: 1 for a fresh crater, falling as it degrades.
17 29 double freshness = 1.0;
18 29 bool complex = false; ///< Of the complex form: a flat floor and a central peak.
19
20
5/10
✗ Branch 0 not taken.
✓ Branch 1 taken 29 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 29 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 29 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 29 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 29 times.
29 bool operator==(const CraterAttributes&) const = default;
21 };
22
23 /// The attributes of a crater in `state` (which gives the ratios) shaped by `profile` (the form).
24 ///
25 /// The floor is the profile's lowest point inside the rim and the rim crest its highest from 0.7
26 /// to 1.3 radii, both sampled every 0.01 radii.
27 CraterAttributes ComputeCraterAttributes(const Crater& crater, const CraterState& state,
28 const CraterProfile& profile);
29
30 } // namespace terraingen
31