TerrainGen coverage


terraingen/
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
87 / 87
100.0%
Branches:
54 / 54
100.0%
Functions:
9 / 9
100.0%

config/fields/maps.h
Line Branch Exec Source
1 /// @file
2 /// @brief The JSON fields of surface fields and density maps.
3 #pragma once
4
5 #include "terraingen/config/config.h"
6 #include "terraingen/config/fields/common.h"
7
8 namespace terraingen::config {
9
10 119 template <typename IO> void Fields(IO& io, FieldSpec& field) {
11
3/3
void terraingen::config::Fields<terraingen::config::(anonymous namespace)::SchemaWriter>(terraingen::config::(anonymous namespace)::SchemaWriter&, terraingen::FieldSpec&):
✓ Branch 4 taken 9 times.
void terraingen::config::Fields<terraingen::config::Reader>(terraingen::config::Reader&, terraingen::FieldSpec&):
✓ Branch 4 taken 26 times.
void terraingen::config::Fields<terraingen::config::Writer>(terraingen::config::Writer&, terraingen::FieldSpec&):
✓ Branch 4 taken 84 times.
119 io("path", field.path,
12 "GeoTIFF read in the surface's coordinates, relative to the configuration's folder: "
13 "metres on a plane, longitude and latitude in degrees on a sphere. Empty uses value.");
14
3/3
void terraingen::config::Fields<terraingen::config::(anonymous namespace)::SchemaWriter>(terraingen::config::(anonymous namespace)::SchemaWriter&, terraingen::FieldSpec&):
✓ Branch 4 taken 9 times.
void terraingen::config::Fields<terraingen::config::Reader>(terraingen::config::Reader&, terraingen::FieldSpec&):
✓ Branch 4 taken 26 times.
void terraingen::config::Fields<terraingen::config::Writer>(terraingen::config::Writer&, terraingen::FieldSpec&):
✓ Branch 4 taken 84 times.
119 io("value", field.value, "The field everywhere when no path is given.");
15
3/3
void terraingen::config::Fields<terraingen::config::(anonymous namespace)::SchemaWriter>(terraingen::config::(anonymous namespace)::SchemaWriter&, terraingen::FieldSpec&):
✓ Branch 4 taken 9 times.
void terraingen::config::Fields<terraingen::config::Reader>(terraingen::config::Reader&, terraingen::FieldSpec&):
✓ Branch 4 taken 26 times.
void terraingen::config::Fields<terraingen::config::Writer>(terraingen::config::Writer&, terraingen::FieldSpec&):
✓ Branch 4 taken 84 times.
119 io("band", field.band, "Band of the GeoTIFF read, from 0.");
16
3/3
void terraingen::config::Fields<terraingen::config::(anonymous namespace)::SchemaWriter>(terraingen::config::(anonymous namespace)::SchemaWriter&, terraingen::FieldSpec&):
✓ Branch 4 taken 9 times.
void terraingen::config::Fields<terraingen::config::Reader>(terraingen::config::Reader&, terraingen::FieldSpec&):
✓ Branch 4 taken 26 times.
void terraingen::config::Fields<terraingen::config::Writer>(terraingen::config::Writer&, terraingen::FieldSpec&):
✓ Branch 4 taken 84 times.
119 io("method", field.method,
17 "How the GeoTIFF is interpolated: nearest or bilinear, which stay within the cells read.");
18
3/3
void terraingen::config::Fields<terraingen::config::(anonymous namespace)::SchemaWriter>(terraingen::config::(anonymous namespace)::SchemaWriter&, terraingen::FieldSpec&):
✓ Branch 4 taken 9 times.
void terraingen::config::Fields<terraingen::config::Reader>(terraingen::config::Reader&, terraingen::FieldSpec&):
✓ Branch 4 taken 26 times.
void terraingen::config::Fields<terraingen::config::Writer>(terraingen::config::Writer&, terraingen::FieldSpec&):
✓ Branch 4 taken 84 times.
119 io("scale", field.scale,
19 "Multiplies every cell, such as 0.001 for a map stored in thousandths; positive.", "",
20 119 Above(0.0));
21
3/3
void terraingen::config::Fields<terraingen::config::(anonymous namespace)::SchemaWriter>(terraingen::config::(anonymous namespace)::SchemaWriter&, terraingen::FieldSpec&):
✓ Branch 4 taken 9 times.
void terraingen::config::Fields<terraingen::config::Reader>(terraingen::config::Reader&, terraingen::FieldSpec&):
✓ Branch 4 taken 26 times.
void terraingen::config::Fields<terraingen::config::Writer>(terraingen::config::Writer&, terraingen::FieldSpec&):
✓ Branch 4 taken 84 times.
119 io("fallback", field.fallback,
22 "Value outside the GeoTIFF and where its cells are no-data or NaN; unset leaves none, and "
23 "the layer then keeps its own setting there.");
24
3/3
void terraingen::config::Fields<terraingen::config::(anonymous namespace)::SchemaWriter>(terraingen::config::(anonymous namespace)::SchemaWriter&, terraingen::FieldSpec&):
✓ Branch 4 taken 9 times.
void terraingen::config::Fields<terraingen::config::Reader>(terraingen::config::Reader&, terraingen::FieldSpec&):
✓ Branch 4 taken 26 times.
void terraingen::config::Fields<terraingen::config::Writer>(terraingen::config::Writer&, terraingen::FieldSpec&):
✓ Branch 4 taken 84 times.
119 io("periodic_longitude", field.periodicLongitude,
25 "The GeoTIFF's x is longitude repeating every 360 degrees, so a map from 0 to 360 serves "
26 "-180 to 180.");
27 119 }
28
29 47 template <typename IO> void Fields(IO& io, DensityMapSpec& map) {
30
3/3
void terraingen::config::Fields<terraingen::config::(anonymous namespace)::SchemaWriter>(terraingen::config::(anonymous namespace)::SchemaWriter&, terraingen::DensityMapSpec&):
✓ Branch 4 taken 9 times.
void terraingen::config::Fields<terraingen::config::Reader>(terraingen::config::Reader&, terraingen::DensityMapSpec&):
✓ Branch 4 taken 11 times.
void terraingen::config::Fields<terraingen::config::Writer>(terraingen::config::Writer&, terraingen::DensityMapSpec&):
✓ Branch 4 taken 27 times.
47 io("field", map.field, "The map.");
31
3/3
void terraingen::config::Fields<terraingen::config::(anonymous namespace)::SchemaWriter>(terraingen::config::(anonymous namespace)::SchemaWriter&, terraingen::DensityMapSpec&):
✓ Branch 4 taken 9 times.
void terraingen::config::Fields<terraingen::config::Reader>(terraingen::config::Reader&, terraingen::DensityMapSpec&):
✓ Branch 4 taken 11 times.
void terraingen::config::Fields<terraingen::config::Writer>(terraingen::config::Writer&, terraingen::DensityMapSpec&):
✓ Branch 4 taken 27 times.
47 io("measure", map.measure, "What the map's values measure.");
32
3/3
void terraingen::config::Fields<terraingen::config::(anonymous namespace)::SchemaWriter>(terraingen::config::(anonymous namespace)::SchemaWriter&, terraingen::DensityMapSpec&):
✓ Branch 4 taken 9 times.
void terraingen::config::Fields<terraingen::config::Reader>(terraingen::config::Reader&, terraingen::DensityMapSpec&):
✓ Branch 4 taken 11 times.
void terraingen::config::Fields<terraingen::config::Writer>(terraingen::config::Writer&, terraingen::DensityMapSpec&):
✓ Branch 4 taken 27 times.
47 io("min_diameter", map.minDiameter,
33 "Smallest diameter the map measures, in metres; positive for a count or areal fraction.",
34 "m");
35
3/3
void terraingen::config::Fields<terraingen::config::(anonymous namespace)::SchemaWriter>(terraingen::config::(anonymous namespace)::SchemaWriter&, terraingen::DensityMapSpec&):
✓ Branch 4 taken 9 times.
void terraingen::config::Fields<terraingen::config::Reader>(terraingen::config::Reader&, terraingen::DensityMapSpec&):
✓ Branch 4 taken 11 times.
void terraingen::config::Fields<terraingen::config::Writer>(terraingen::config::Writer&, terraingen::DensityMapSpec&):
✓ Branch 4 taken 27 times.
47 io("max_diameter", map.maxDiameter,
36 "Largest diameter the map measures, in metres, exclusive; unset for no limit.", "m");
37
3/3
void terraingen::config::Fields<terraingen::config::(anonymous namespace)::SchemaWriter>(terraingen::config::(anonymous namespace)::SchemaWriter&, terraingen::DensityMapSpec&):
✓ Branch 4 taken 9 times.
void terraingen::config::Fields<terraingen::config::Reader>(terraingen::config::Reader&, terraingen::DensityMapSpec&):
✓ Branch 4 taken 11 times.
void terraingen::config::Fields<terraingen::config::Writer>(terraingen::config::Writer&, terraingen::DensityMapSpec&):
✓ Branch 4 taken 27 times.
47 io("area_unit", map.areaUnit,
38 "Square metres per area unit of a count: 1 for per m^2, 1e6 for per km^2.", "m^2",
39 47 Above(0.0));
40
3/3
void terraingen::config::Fields<terraingen::config::(anonymous namespace)::SchemaWriter>(terraingen::config::(anonymous namespace)::SchemaWriter&, terraingen::DensityMapSpec&):
✓ Branch 4 taken 9 times.
void terraingen::config::Fields<terraingen::config::Reader>(terraingen::config::Reader&, terraingen::DensityMapSpec&):
✓ Branch 4 taken 11 times.
void terraingen::config::Fields<terraingen::config::Writer>(terraingen::config::Writer&, terraingen::DensityMapSpec&):
✓ Branch 4 taken 27 times.
47 io("total", map.total,
41 "The map counts every feature of its kind, including the secondaries thrown from a crater "
42 "layer's craters and the boulders a layer throws out around craters, which are taken out "
43 "of it first; off when it counts only what the layer generates.");
44 47 }
45
46 25 template <typename IO> void Fields(IO& io, SizeSlopeMapSpec& map) {
47
3/3
void terraingen::config::Fields<terraingen::config::(anonymous namespace)::SchemaWriter>(terraingen::config::(anonymous namespace)::SchemaWriter&, terraingen::SizeSlopeMapSpec&):
✓ Branch 4 taken 9 times.
void terraingen::config::Fields<terraingen::config::Reader>(terraingen::config::Reader&, terraingen::SizeSlopeMapSpec&):
✓ Branch 4 taken 4 times.
void terraingen::config::Fields<terraingen::config::Writer>(terraingen::config::Writer&, terraingen::SizeSlopeMapSpec&):
✓ Branch 4 taken 12 times.
25 io("field", map.field, "The map.");
48
3/3
void terraingen::config::Fields<terraingen::config::(anonymous namespace)::SchemaWriter>(terraingen::config::(anonymous namespace)::SchemaWriter&, terraingen::SizeSlopeMapSpec&):
✓ Branch 4 taken 9 times.
void terraingen::config::Fields<terraingen::config::Reader>(terraingen::config::Reader&, terraingen::SizeSlopeMapSpec&):
✓ Branch 4 taken 4 times.
void terraingen::config::Fields<terraingen::config::Writer>(terraingen::config::Writer&, terraingen::SizeSlopeMapSpec&):
✓ Branch 4 taken 12 times.
25 io("measure", map.measure, "What the map's values measure.");
49
3/3
void terraingen::config::Fields<terraingen::config::(anonymous namespace)::SchemaWriter>(terraingen::config::(anonymous namespace)::SchemaWriter&, terraingen::SizeSlopeMapSpec&):
✓ Branch 4 taken 9 times.
void terraingen::config::Fields<terraingen::config::Reader>(terraingen::config::Reader&, terraingen::SizeSlopeMapSpec&):
✓ Branch 4 taken 4 times.
void terraingen::config::Fields<terraingen::config::Writer>(terraingen::config::Writer&, terraingen::SizeSlopeMapSpec&):
✓ Branch 4 taken 12 times.
25 io("reference_diameter", map.referenceDiameter,
50 "Diameter D0 in metres where the local power law meets the layer's own count, as N(>=D) = "
51 "N(>=D0) (D / D0)^-alpha; for a mean diameter map, the smallest diameter averaged.",
52 25 "m", Above(0.0));
53
3/3
void terraingen::config::Fields<terraingen::config::(anonymous namespace)::SchemaWriter>(terraingen::config::(anonymous namespace)::SchemaWriter&, terraingen::SizeSlopeMapSpec&):
✓ Branch 4 taken 9 times.
void terraingen::config::Fields<terraingen::config::Reader>(terraingen::config::Reader&, terraingen::SizeSlopeMapSpec&):
✓ Branch 4 taken 4 times.
void terraingen::config::Fields<terraingen::config::Writer>(terraingen::config::Writer&, terraingen::SizeSlopeMapSpec&):
✓ Branch 4 taken 12 times.
25 io("min_exponent", map.minExponent,
54 "Smallest exponent alpha the map's values are clamped to; with the largest it bounds the "
55 "boulders drawn, so generous bounds draw more to thin.",
56 25 "", Above(0.0));
57
3/3
void terraingen::config::Fields<terraingen::config::(anonymous namespace)::SchemaWriter>(terraingen::config::(anonymous namespace)::SchemaWriter&, terraingen::SizeSlopeMapSpec&):
✓ Branch 4 taken 9 times.
void terraingen::config::Fields<terraingen::config::Reader>(terraingen::config::Reader&, terraingen::SizeSlopeMapSpec&):
✓ Branch 4 taken 4 times.
void terraingen::config::Fields<terraingen::config::Writer>(terraingen::config::Writer&, terraingen::SizeSlopeMapSpec&):
✓ Branch 4 taken 12 times.
25 io("max_exponent", map.maxExponent,
58 "Largest exponent alpha the map's values are clamped to; above the smallest.", "",
59 25 Above(0.0));
60 25 }
61
62 } // namespace terraingen::config
63