./
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
235 / 268
87.7%
Branches:
10 / 22
45.5%
Functions:
15 / 17
88.2%

include/terraingen/layers/bedforms_fields.h
Line Branch Exec Source
1 // SPDX-License-Identifier: BSD-3-Clause
2
3 /// @file
4 /// @brief The field lists of bedforms, sand shadows and sand fill.
5 #pragma once
6
7 #include "terraingen/layers/bedforms.h"
8 #include "terraingen/layers/layer_fields.h"
9 #include "terraingen/layers/sand_fill.h"
10 #include "terraingen/layers/sand_shadow.h"
11 #include "terraingen/util/option_fields.h"
12
13 namespace terraingen {
14
15 103 template <typename IO> void Fields(IO& io, BedformOptions& bedforms) {
16 103 io("wavelength_m", bedforms.wavelength,
17 "Crest-to-crest spacing, in meters; each field's varies from 0.8 to 1.2 times it.", "m",
18 103 Above(0.0));
19 102 io("height_m", bedforms.height,
20 "Trough-to-crest height, in meters, scaled with each field's wavelength.", "m",
21 102 AtLeast(0.0));
22
5/7
void terraingen::Fields<terraingen::(anonymous namespace)::SeedFinder>(terraingen::(anonymous namespace)::SeedFinder&, terraingen::BedformOptions&):
✗ Branch 2 not taken.
✗ Branch 3 not taken.
void terraingen::Fields<terraingen::RangeChecker>(terraingen::RangeChecker&, terraingen::BedformOptions&):
✓ Branch 2 taken 43 times.
void terraingen::Fields<terraingen::config::(anonymous namespace)::SchemaWriter>(terraingen::config::(anonymous namespace)::SchemaWriter&, terraingen::BedformOptions&):
✓ Branch 2 taken 13 times.
void terraingen::Fields<terraingen::config::Reader>(terraingen::config::Reader&, terraingen::BedformOptions&):
✓ Branch 2 taken 8 times.
void terraingen::Fields<terraingen::config::Writer>(terraingen::config::Writer&, terraingen::BedformOptions&):
✓ Branch 2 taken 34 times.
void terraingen::Fields<terraingen::python::OptionsBinder<terraingen::BedformOptions> >(terraingen::python::OptionsBinder<terraingen::BedformOptions>&, terraingen::BedformOptions&):
✓ Branch 2 taken 3 times.
101 io("wind_azimuth_deg", bedforms.windAzimuthDegrees,
23 101 WindAzimuthHelp("wind", "crests lie across it"), "deg");
24
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
101 io("azimuth_spread_deg", bedforms.azimuthSpreadDegrees,
25 "Largest difference of each field's wind from the azimuth, in degrees.", "deg",
26
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
101 AtLeast(0.0));
27 101 io("lee_fraction", bedforms.leeFraction,
28 "Share of a wavelength the lee face takes: 0.5 is symmetric, lower values give a steeper "
29 "lee face.",
30 101 "", Inside(0.0, 1.0));
31 99 io("sinuosity", bedforms.sinuosity,
32 "How far a crest wanders along its length, in wavelengths; 0 gives straight crests.", "",
33
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
99 AtLeast(0.0));
34 98 io("cover", bedforms.cover, "Share of the ground under bedform fields; 0 gives no bedforms.",
35
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
98 "", Between(0.0, 0.9));
36 97 io("field_size_m", bedforms.fieldSize, "Typical width of a bedform field, in meters.", "m",
37 97 Above(0.0));
38
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
97 io("seed", bedforms.seed,
39 "Seed of the fields and their crests; changing it gives a different layout of the same "
40 "statistics.");
41 97 ExposureFields(io, bedforms.exposure, bedforms.exposureSpacing,
42 "Leaves out fields whose centers lie on bedrock, the likelier the barer the "
43 "ground, as sand settles in lows; unset disables it.");
44 95 FadePixelFields(
45 95 io, bedforms.fade,
46 "How bedforms too fine for the sample spacing fade out, by samples per wavelength.");
47 95 SourceResolvesField(io, bedforms.sourceResolvesPixels, "bedforms", "wavelength");
48 94 }
49
50 94 template <typename IO> void Fields(IO& io, SandShadowOptions& shadows) {
51
5/5
void terraingen::Fields<terraingen::RangeChecker>(terraingen::RangeChecker&, terraingen::SandShadowOptions&):
✓ Branch 2 taken 26 times.
void terraingen::Fields<terraingen::config::(anonymous namespace)::SchemaWriter>(terraingen::config::(anonymous namespace)::SchemaWriter&, terraingen::SandShadowOptions&):
✓ Branch 2 taken 13 times.
void terraingen::Fields<terraingen::config::Reader>(terraingen::config::Reader&, terraingen::SandShadowOptions&):
✓ Branch 2 taken 12 times.
void terraingen::Fields<terraingen::config::Writer>(terraingen::config::Writer&, terraingen::SandShadowOptions&):
✓ Branch 2 taken 39 times.
void terraingen::Fields<terraingen::python::OptionsBinder<terraingen::SandShadowOptions> >(terraingen::python::OptionsBinder<terraingen::SandShadowOptions>&, terraingen::SandShadowOptions&):
✓ Branch 2 taken 3 times.
94 io("wind_azimuth_deg", shadows.windAzimuthDegrees,
52 94 WindAzimuthHelp("wind", "tails trail away from boulders along it"), "deg");
53 93 io("length_ratio", shadows.lengthRatio,
54 "Length of a tail beyond its boulder over the boulder's width; 1.1 is the reattachment "
55 "length behind a dome, and modeled shadow dunes run 1.3 to 5.6, longer in lighter "
56 "winds.",
57 93 "", Above(0.0));
58 90 io("flank_angle_deg", shadows.flankAngleDegrees,
59 "Slope of a tail's flanks, in degrees, at most the angle of repose (about 32 for dry "
60 "sand); sets the tail's height with the boulder's width.",
61 90 "deg", Inside(0.0, 90.0));
62 88 io("min_diameter_m", shadows.minDiameter, "Smallest boulder with a tail, in meters.", "m",
63 88 AtLeast(0.0));
64 87 io("cover_thickness_m", shadows.coverThickness,
65 87 "Sand depth that fully covers the ground in the material map, in meters.", "m", Above(0.0));
66 171 FadePixelFields(
67 86 io, shadows.fade,
68 "How tails behind boulders too small for the sample spacing fade out, by samples across "
69 "the boulder.");
70 85 }
71
72 74 template <typename IO> void Fields(IO& io, SandFillOptions& fill) {
73 74 io("reach_m", fill.reach,
74 "Radius in meters of the surroundings a low is measured against: two rings, at half the "
75 "reach and at the reach.",
76 74 "m", Above(0.0));
77 69 io("fill", fill.fill, "Share of a low's depth below its surroundings that sand fills.", "",
78 69 UnitInterval());
79 67 io("max_thickness_m", fill.maxThickness,
80 67 "The thickest the sand gets, in meters, approached smoothly.", "m", Above(0.0));
81 66 io("cover_thickness_m", fill.coverThickness,
82 "Sand thickness in meters from which it fully covers the ground in the material map.", "m",
83 66 Above(0.0));
84 65 }
85
86 } // namespace terraingen
87