./
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
240 / 285
84.2%
Branches:
0 / 28
0.0%
Functions:
10 / 12
83.3%

include/terraingen/layers/pavement_fields.h
Line Branch Exec Source
1 // SPDX-License-Identifier: BSD-3-Clause
2
3 /// @file
4 /// @brief The field lists of pavement and strata.
5 #pragma once
6
7 #include "terraingen/layers/layer_fields.h"
8 #include "terraingen/layers/pavement.h"
9 #include "terraingen/layers/strata.h"
10 #include "terraingen/util/option_fields.h"
11
12 namespace terraingen {
13
14
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
104 template <typename IO> void Fields(IO& io, PavementOptions& pavement) {
15
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
104 io("plate_size_m", pavement.plateSize, "Mean plate width, in meters.", "m", Above(0.0));
16 103 io("jitter", pavement.jitter,
17 "How far plate centers stray from a square lattice; 0 gives square plates.", "",
18
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
103 UnitInterval());
19 102 io("warp", pavement.warp, "Bend and roughness of the plate edges, in plate sizes.", "",
20 102 AtLeast(0.0));
21 102 io("crack_width_m", pavement.crackWidth, "Width of the cracks between plates, in meters.", "m",
22 102 Above(0.0));
23 101 io("crack_depth_m", pavement.crackDepth,
24 101 "Depth of the cracks, or height of the ridges when raised, in meters.", "m", AtLeast(0.0));
25
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
134 io("raised", pavement.raised, "Whether plates are parted by raised ridges instead of cracks.");
26 100 io("edge_rounding_m", pavement.edgeRounding,
27
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
100 "Width of the rounded shoulder beside each crack, in meters.", "m", AtLeast(0.0));
28 100 io("max_tilt_deg", pavement.maxTiltDegrees, "Largest tilt of a plate, in degrees.", "deg",
29 100 FromBelow(0.0, 90.0));
30 99 io("max_step_m", pavement.maxStep, "Largest height offset of a plate, up or down, in meters.",
31 99 "m", AtLeast(0.0));
32 99 io("octaves", pavement.octaves,
33 "Crack octaves: each finer octave splits every plate again, its cracks ending at the "
34 "plate's edges.",
35 99 "", Between(1.0, kMaxPavementOctaves));
36
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
95 io("lacunarity", pavement.lacunarity, "Plate size ratio between octaves.", "", Above(1.0));
37 94 io("gain", pavement.gain,
38 "Ratio of crack width, depth, rounding, tilt and step between octaves.", "",
39 94 AboveUpTo(0.0, 1.0));
40
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
93 io("seed", pavement.seed, "Seed of the plates.");
41 93 ExposureFields(io, pavement.exposure, pavement.exposureSpacing,
42 "Shows plates only where the ground beneath is bare bedrock, fading out over "
43 "soil; unset shows them everywhere.");
44 91 AnchorFields(io, pavement.anchor, "the plates are laid out in");
45 180 FadePixelFields(
46 90 io, pavement.fade,
47 "How plates and cracks too fine for the sample spacing fade out, by samples across them.");
48 90 }
49
50
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
227 template <typename IO> void Fields(IO& io, StrataOptions& strata) {
51
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
227 io("bed_thickness_m", strata.bedThickness, "Mean thickness of a bed, in meters.", "m",
52
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
227 Above(0.0));
53 226 io("thickness_variation", strata.thicknessVariation,
54 "How far each bed boundary strays from even spacing, in bed thicknesses.", "",
55 226 FromBelow(0.0, 1.0));
56 224 io("dip_deg", strata.dipDegrees, "Dip of the beds from horizontal, in degrees.", "deg",
57 224 FromBelow(0.0, 90.0));
58
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
222 io("dip_azimuth_deg", strata.dipAzimuthDegrees,
59 "Direction the beds dip toward, in degrees counter-clockwise from +x (local east on a "
60 "body).",
61 "deg");
62 221 io("sharpness", strata.sharpness,
63 "How sharply each bed is cut into a flat bench and a cliff; 1 leaves the ground as it is.",
64
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
221 "", AtLeast(1.0));
65
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
217 io("strength", strata.strength, "Share of the terracing applied.", "", UnitInterval());
66 216 io("cliff_share", strata.cliffShare,
67 "Share of each bed's height, at its top, laid as bedrock in the material map.", "",
68 216 AboveUpTo(0.0, 1.0));
69
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
215 io("seed", strata.seed, "Seed of the bed boundaries.");
70 215 AnchorFields(io, strata.anchor, "the dip is measured in");
71 214 io("hard_share", strata.hardShare,
72 "Share of the beds that are hard rock: hard beds form benches and cliffs of bedrock, soft "
73 "beds slopes cut at soft_sharpness without bedrock.",
74 214 "", UnitInterval());
75 213 io("soft_sharpness", strata.softSharpness,
76 "How sharply soft beds are cut into benches and slopes; 1 leaves them as they are.", "",
77 213 AtLeast(1.0));
78 212 }
79
80 } // namespace terraingen
81