include/terraingen/distribution/distribution_fields.h
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // SPDX-License-Identifier: BSD-3-Clause | ||
| 2 | |||
| 3 | /// @file | ||
| 4 | /// @brief The field lists of distribution segments and bands and the names of the published | ||
| 5 | /// distributions' variants. | ||
| 6 | #pragma once | ||
| 7 | |||
| 8 | #include "terraingen/distribution/moore.h" | ||
| 9 | #include "terraingen/distribution/piecewise_uniform.h" | ||
| 10 | #include "terraingen/distribution/power_law.h" | ||
| 11 | #include "terraingen/distribution/sp8023.h" | ||
| 12 | #include "terraingen/distribution/synthterrain.h" | ||
| 13 | #include "terraingen/util/option_fields.h" | ||
| 14 | |||
| 15 | #include <array> | ||
| 16 | |||
| 17 | namespace terraingen { | ||
| 18 | |||
| 19 | template <> struct EnumNames<MooreTerrain> { | ||
| 20 | static constexpr std::array<EnumEntry<MooreTerrain>, 4> kValues{{ | ||
| 21 | {"rough_mare", MooreTerrain::RoughMare, | ||
| 22 | "Moore's rough mare crater distribution: 10^-1 D^-2 per m^2 below 100 m, 10 D^-3 above."}, | ||
| 23 | {"smooth_mare", MooreTerrain::SmoothMare, | ||
| 24 | "Moore's smooth mare crater distribution: 10^-1 D^-2 per m^2 below 40 m, then D^-3, " | ||
| 25 | "D^-1.68 from 100 m and D^-3 from 200 m."}, | ||
| 26 | {"uplands", MooreTerrain::Uplands, | ||
| 27 | "Moore's uplands crater distribution: 10^-1 D^-2 per m^2 below 1 km, 10^2 D^-3 above."}, | ||
| 28 | {"heavily_cratered", MooreTerrain::HeavilyCratered, | ||
| 29 | "Moore's heavily cratered distribution: 10^-1 D^-2 per m^2 up to 10 km."}, | ||
| 30 | }}; | ||
| 31 | }; | ||
| 32 | |||
| 33 | template <> struct EnumNames<SpecificationCurve> { | ||
| 34 | static constexpr std::array<EnumEntry<SpecificationCurve>, 3> kValues{{ | ||
| 35 | {"minimum", SpecificationCurve::Minimum, "The model's minimum curve: the fewest boulders."}, | ||
| 36 | {"nominal", SpecificationCurve::Nominal, "The model's nominal curve."}, | ||
| 37 | {"maximum", SpecificationCurve::Maximum, "The model's maximum curve: the most boulders."}, | ||
| 38 | }}; | ||
| 39 | }; | ||
| 40 | |||
| 41 | template <> struct EnumNames<SynthterrainBoulders> { | ||
| 42 | static constexpr std::array<EnumEntry<SynthterrainBoulders>, 3> kValues{{ | ||
| 43 | {"intercrater", SynthterrainBoulders::InterCrater, | ||
| 44 | "0.0001 D^-1.75457 per m^2 with D in meters: synthetic_moon's \"low blockiness\"."}, | ||
| 45 | {"haworth", SynthterrainBoulders::Haworth, | ||
| 46 | "0.002 D^-2.6607 per m^2 with D in meters: synthetic_moon's \"high blockiness\"."}, | ||
| 47 | {"viper_specification", SynthterrainBoulders::ViperSpecification, | ||
| 48 | "0.0003 D^-2.482 per m^2 with D in meters: the VIPER Environmental Specification."}, | ||
| 49 | }}; | ||
| 50 | }; | ||
| 51 | |||
| 52 | 160 | template <typename IO> void Fields(IO& io, PowerLawSegment& segment) { | |
| 53 | 160 | io("start_m", segment.start, | |
| 54 | "Diameter in meters where this segment begins; it runs up to the next segment's start.", "m", | ||
| 55 | 160 | AtLeast(0.0)); | |
| 56 | 160 | io("coefficient", segment.coefficient, | |
| 57 | "Coefficient of N(>=D) = coefficient D^-exponent, the cumulative count per m^2 with D in " | ||
| 58 | "meters.", | ||
| 59 | 160 | "", Above(0.0)); | |
| 60 | 160 | io("exponent", segment.exponent, | |
| 61 | "Exponent of the segment's power law; larger values give relatively more small craters.", "", | ||
| 62 | 160 | Above(0.0)); | |
| 63 | 160 | } | |
| 64 | |||
| 65 | 136 | template <typename IO> void Fields(IO& io, UniformBand& band) { | |
| 66 | 136 | io("min_m", band.min, "Smallest diameter of the band in meters.", "m", Above(0.0)); | |
| 67 | 136 | io("max_m", band.max, "Largest diameter of the band in meters, above min_m.", "m", Above(0.0)); | |
| 68 | 136 | io("density", band.density, | |
| 69 | "Count per m^2 with diameters in the band, spread uniformly across it; a relative weight " | ||
| 70 | "when total is set.", | ||
| 71 | 136 | "1/m^2", AtLeast(0.0)); | |
| 72 | 136 | } | |
| 73 | |||
| 74 | } // namespace terraingen | ||
| 75 |