./
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
168 / 202
83.2%
Branches:
168 / 248
67.7%
Functions:
8 / 8, 8 excl
100.0%

include/terraingen/layers/boulders/boulder.h
Line Branch Exec Source
1 // SPDX-License-Identifier: BSD-3-Clause
2
3 /// @file
4 /// @brief `Boulder`, the record of one placed boulder, `BoulderList` of many, and `ManualBoulder`,
5 /// one placed by hand.
6 #pragma once
7
8 #include "terraingen/geometry/geometry.h"
9
10 #include <array>
11 #include <cmath>
12 #include <cstddef>
13 #include <cstdint>
14 #include <initializer_list>
15 #include <limits>
16 #include <optional>
17 #include <vector>
18
19 namespace terraingen {
20
21 /// Which of its axes a boulder stands on end along, the one turned to the vertical.
22 enum class BoulderRest : std::uint8_t {
23 Face, ///< On its broadest face: its short axis up.
24 Side, ///< On a side: its intermediate axis up.
25 End, ///< On an end: its long axis up.
26 };
27
28 /// A plane that sand-laden wind has cut across a boulder's windward side: a ventifact facet.
29 /// Rock above the plane is gone.
30 struct BoulderFacet {
31 /// Direction the facet faces (upwind), radians counter-clockwise from east.
32 double azimuth = 0.0;
33 double angle = 0.0; ///< Slope of the facet from horizontal, radians, in (0, 90) deg.
34 /// Distance (m) toward `azimuth` from the boulder's center at which the facet meets the surface
35 /// the boulder stands on.
36 double reach = 0.0;
37
38 /// The facet's height (m) above that surface at east and north `offset` meters from the
39 /// boulder's center, negative beyond `reach`.
40 84695 double HeightAt(const Vec2d& offset) const {
41 84695 const double along = offset.x * std::cos(azimuth) + offset.y * std::sin(azimuth);
42 84695 return (reach - along) * std::tan(angle);
43 }
44
45 19784 bool operator==(const BoulderFacet& other) const {
46
3/12
<unknown function 45>:
✓ Branch 0 taken 19784 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 19784 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 19784 times.
✗ Branch 5 not taken.
terraingen::BoulderFacet::HeightAt(terraingen::Vec2d const&) const:
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
19784 return azimuth == other.azimuth && angle == other.angle && reach == other.reach;
47 }
48 };
49
50 /// One boulder: where it stands, how large it is and how it lies, in surface coordinates
51 /// and meters.
52 struct Boulder {
53 double x = 0.0; ///< Surface x of its center.
54 double y = 0.0; ///< Surface y of its center.
55 double diameter = 0.0; ///< Length of its long axis: its largest horizontal extent on its face.
56 /// Length of its short axis, buried part included: its full height resting on its face.
57 double height = 0.0;
58 double burial = 0.0; ///< Share of its vertical extent below the surface, in [0, 1).
59 double yaw = 0.0; ///< Rotation about the vertical, radians counter-clockwise from east.
60 double lean = 0.0; ///< Tilt of the boulder's vertical axis from the vertical, radians.
61 std::uint64_t id = 0; ///< Stable ID, keyed like crater IDs.
62 BoulderRest rest = BoulderRest::Face; ///< Which axis it stands along.
63 double tilt = 0.0; ///< Angle of its up axis from the vertical, after lean, radians.
64 double tiltAzimuth = 0.0; ///< Direction its up axis tips toward, radians from east.
65 /// Height of the ground beneath its center before any boulders, when the layer knows it.
66 std::optional<double> ground{};
67 /// Placed as a 3D model of its own rather than drawn into the heights
68 /// (`BoulderModelThreshold`).
69 bool model = false;
70 /// How worn it is, from 0 (fresh) to 1: its crater's wear for a crater block, uniform between
71 /// craters.
72 double wear = 0.0;
73 /// For a fragment, the ID of the boulder it broke from; 0 for a whole boulder.
74 std::uint64_t parent = 0;
75 std::uint32_t piece = 0; ///< For a fragment, which piece of its parent it is.
76 /// Its ventifact facets, the first `facetCount` of them (`BoulderVentifacts`).
77 std::array<BoulderFacet, 2> facets{};
78 std::uint8_t facetCount = 0; ///< How many facets it has, 0 to 2.
79 /// The seed of its shape; unset derives it from its ID, or its parent's for a fragment
80 /// (`BoulderShapeSeed`).
81 std::optional<std::uint64_t> shapeSeed{};
82
83 /// Height of the top above the surface it stands on, `height` (1 - `burial`), in meters.
84 593246 double ExposedHeight() const {
85
6/7
<unknown function 84>:
✓ Branch 0 taken 167319 times.
✓ Branch 1 taken 1 time.
✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
terraingen::BoulderFacet::HeightAt(terraingen::Vec2d const&) const:
✓ Branch 0 taken 1290 times.
✓ Branch 1 taken 5640 times.
593246 return height * (1.0 - burial);
86 }
87
88 /// `top`, a height (m) of the boulder above the surface at east and north `offset` meters from
89 /// its center, lowered to its facets and not below 0.
90 321548 double CutByFacets(const Vec2d& offset, double top) const {
91
2/2
✓ Branch 0 taken 68074 times.
✓ Branch 1 taken 321548 times.
389622 for (std::uint8_t k = 0; k < facetCount; ++k) {
92 68074 top = std::fmin(top, facets[k].HeightAt(offset));
93 }
94 321548 return std::fmax(top, 0.0);
95 }
96
97 9885 bool operator==(const Boulder& other) const {
98
2/4
✓ Branch 0 taken 9885 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 9885 times.
✗ Branch 3 not taken.
9885 return x == other.x && y == other.y && diameter == other.diameter &&
99
3/6
✓ Branch 0 taken 9885 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 9885 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 9885 times.
✗ Branch 5 not taken.
9885 height == other.height && burial == other.burial && yaw == other.yaw &&
100
4/8
✓ Branch 0 taken 9885 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 9885 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 9885 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 9885 times.
✗ Branch 7 not taken.
9885 lean == other.lean && id == other.id && rest == other.rest && tilt == other.tilt &&
101
3/6
✓ Branch 0 taken 9885 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 9885 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 9885 times.
✗ Branch 5 not taken.
19770 tiltAzimuth == other.tiltAzimuth && ground == other.ground && model == other.model &&
102
3/6
✓ Branch 0 taken 9885 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 9885 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 9885 times.
✗ Branch 5 not taken.
9885 wear == other.wear && parent == other.parent && piece == other.piece &&
103
3/6
✓ Branch 0 taken 9885 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 9885 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 9885 times.
✗ Branch 6 not taken.
19770 facets == other.facets && facetCount == other.facetCount &&
104
1/2
✓ Branch 0 taken 9885 times.
✗ Branch 1 not taken.
9885 shapeSeed == other.shapeSeed;
105 }
106 };
107
108 /// Boulders stored as one array per field, as `CraterList` stores craters, so each column can be
109 /// shared with NumPy or a GPU without copying.
110 class BoulderList {
111 public:
112 /// An empty list.
113 62488 BoulderList() = default;
114
115 /// A list of `boulders`, in order.
116 BoulderList(std::initializer_list<Boulder> boulders);
117
118 /// The number of boulders.
119 769394 std::size_t Size() const {
120
30/30
<unknown function 119>:
✓ Branch 0 taken 25634 times.
✓ Branch 1 taken 8 times.
✓ Branch 1 taken 44 times.
✓ Branch 2 taken 14172 times.
✓ Branch 3 taken 72758 times.
✓ Branch 4 taken 1 time.
✓ Branch 4 taken 2 times.
✓ Branch 4 taken 31 times.
✓ Branch 5 taken 1 time.
✓ Branch 7 taken 2 times.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 3 times.
✓ Branch 10 taken 1 time.
✓ Branch 12 taken 8633 times.
✓ Branch 13 taken 3 times.
<unknown function 45>:
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 353440 times.
✓ Branch 3 taken 1 time.
<unknown function 84>:
✓ Branch 0 taken 168707 times.
✓ Branch 1 taken 62238 times.
✓ Branch 3 taken 211 times.
✓ Branch 4 taken 6 times.
terraingen::Boulder::operator==(terraingen::Boulder const&) const:
✓ Branch 1 taken 61 times.
✓ Branch 3 taken 63162 times.
✓ Branch 4 taken 61 times.
terraingen::BoulderList::BoulderList():
✓ Branch 0 taken 115 times.
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 1 time.
terraingen::BoulderList::Size() const:
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 75 times.
769383 return m_id.size();
121 }
122
123 /// Whether the list holds no boulder.
124 6 bool Empty() const {
125
3/6
<unknown function 119>:
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
terraingen::BoulderList::BoulderList():
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
6 return m_id.empty();
126 }
127
128 /// Reserves room for `count` boulders in every column.
129 void Reserve(std::size_t count);
130
131 /// Appends a boulder.
132 void Append(const Boulder& boulder);
133
134 /// Appends every boulder of `other`, in its order.
135 void Append(const BoulderList& other);
136
137 /// The boulder at `index`.
138 /// @throws std::out_of_range if `index` >= `Size()`.
139 Boulder At(std::size_t index) const;
140
141 /// Memberwise equality, column by column.
142 bool operator==(const BoulderList& other) const;
143 1 bool operator!=(const BoulderList& other) const {
144 1 return !(*this == other);
145 }
146
147 /// Every east coordinate, in surface coordinates.
148 33 const std::vector<double>& X() const {
149
2/3
<unknown function 148>:
✗ Branch 1 not taken.
terraingen::BoulderList::BoulderList():
✓ Branch 1 taken 1 time.
terraingen::BoulderList::Size() const:
✓ Branch 1 taken 32 times.
33 return m_x;
150 }
151 /// Every north coordinate, in surface coordinates.
152 32 const std::vector<double>& Y() const {
153
1/2
<unknown function 148>:
✗ Branch 1 not taken.
terraingen::BoulderList::Size() const:
✓ Branch 1 taken 32 times.
32 return m_y;
154 }
155 /// Every diameter, in meters.
156 33 const std::vector<double>& Diameters() const {
157
2/3
<unknown function 148>:
✗ Branch 1 not taken.
terraingen::BoulderList::BoulderList():
✓ Branch 1 taken 1 time.
terraingen::BoulderList::Size() const:
✓ Branch 1 taken 32 times.
40 return m_diameter;
158 }
159 /// Every height, in meters.
160 32 const std::vector<double>& Heights() const {
161
1/2
<unknown function 148>:
✗ Branch 1 not taken.
terraingen::BoulderList::Size() const:
✓ Branch 1 taken 32 times.
32 return m_height;
162 }
163 /// Every buried share of the vertical extent, in [0, 1).
164 32 const std::vector<double>& Burials() const {
165
1/2
<unknown function 148>:
✗ Branch 1 not taken.
terraingen::BoulderList::Size() const:
✓ Branch 1 taken 32 times.
32 return m_burial;
166 }
167 /// Every yaw, in radians.
168 32 const std::vector<double>& Yaws() const {
169
1/2
<unknown function 148>:
✗ Branch 1 not taken.
terraingen::BoulderList::Size() const:
✓ Branch 1 taken 32 times.
32 return m_yaw;
170 }
171 /// Every lean, in radians.
172 32 const std::vector<double>& Leans() const {
173
1/2
<unknown function 148>:
✗ Branch 1 not taken.
terraingen::BoulderList::Size() const:
✓ Branch 1 taken 32 times.
32 return m_lean;
174 }
175 /// Every stable ID.
176 34 const std::vector<std::uint64_t>& Ids() const {
177
3/4
<unknown function 119>:
✓ Branch 1 taken 1 time.
<unknown function 148>:
✗ Branch 1 not taken.
terraingen::BoulderList::BoulderList():
✓ Branch 1 taken 1 time.
terraingen::BoulderList::Size() const:
✓ Branch 1 taken 32 times.
34 return m_id;
178 }
179 /// Every `BoulderRest` as a byte.
180 33 const std::vector<std::uint8_t>& Rests() const {
181
2/3
<unknown function 148>:
✗ Branch 1 not taken.
terraingen::BoulderList::BoulderList():
✓ Branch 1 taken 1 time.
terraingen::BoulderList::Size() const:
✓ Branch 1 taken 32 times.
33 return m_rest;
182 }
183 /// Every tilt, in radians.
184 32 const std::vector<double>& Tilts() const {
185
1/2
<unknown function 148>:
✗ Branch 1 not taken.
terraingen::BoulderList::Size() const:
✓ Branch 1 taken 32 times.
32 return m_tilt;
186 }
187 /// Every tilt azimuth, in radians.
188 32 const std::vector<double>& TiltAzimuths() const {
189
1/2
<unknown function 148>:
✗ Branch 1 not taken.
terraingen::BoulderList::Size() const:
✓ Branch 1 taken 32 times.
32 return m_tiltAzimuth;
190 }
191 /// Every ground height in meters, NaN where unknown.
192 32 const std::vector<double>& Grounds() const {
193
1/2
<unknown function 148>:
✗ Branch 1 not taken.
terraingen::BoulderList::Size() const:
✓ Branch 1 taken 32 times.
32 return m_ground;
194 }
195 /// 1 for boulders placed as 3D models, 0 for the rest.
196 33 const std::vector<std::uint8_t>& Models() const {
197
2/3
<unknown function 148>:
✗ Branch 1 not taken.
terraingen::BoulderList::BoulderList():
✓ Branch 1 taken 1 time.
terraingen::BoulderList::Size() const:
✓ Branch 1 taken 32 times.
33 return m_model;
198 }
199 /// Every wear, from 0 (fresh) to 1.
200 32 const std::vector<double>& Wears() const {
201
1/2
<unknown function 148>:
✗ Branch 1 not taken.
terraingen::BoulderList::Size() const:
✓ Branch 1 taken 32 times.
32 return m_wear;
202 }
203 /// Every parent ID, 0 for a whole boulder.
204 32 const std::vector<std::uint64_t>& Parents() const {
205
1/2
<unknown function 148>:
✗ Branch 1 not taken.
terraingen::BoulderList::Size() const:
✓ Branch 1 taken 32 times.
32 return m_parent;
206 }
207 /// Every piece index among its parent's pieces.
208 32 const std::vector<std::uint32_t>& Pieces() const {
209
1/2
<unknown function 148>:
✗ Branch 1 not taken.
terraingen::BoulderList::Size() const:
✓ Branch 1 taken 32 times.
32 return m_piece;
210 }
211 /// Every boulder's facets; the first `FacetCounts()` of each are used.
212 const std::vector<std::array<BoulderFacet, 2>>& Facets() const {
213 return m_facets;
214 }
215 /// Every boulder's number of facets in use.
216 1 const std::vector<std::uint8_t>& FacetCounts() const {
217
1/1
✓ Branch 1 taken 1 time.
1 return m_facetCount;
218 }
219 /// Every shape seed, 0 where unset (see `HasShapeSeeds`).
220 const std::vector<std::uint64_t>& ShapeSeeds() const {
221 return m_shapeSeed;
222 }
223 /// 1 where a boulder has a shape seed, 0 where it derives one from its ID.
224 1 const std::vector<std::uint8_t>& HasShapeSeeds() const {
225
1/1
✓ Branch 1 taken 1 time.
1 return m_hasShapeSeed;
226 }
227
228 private:
229 std::vector<double> m_x;
230 std::vector<double> m_y;
231 std::vector<double> m_diameter;
232 std::vector<double> m_height;
233 std::vector<double> m_burial;
234 std::vector<double> m_yaw;
235 std::vector<double> m_lean;
236 std::vector<std::uint64_t> m_id;
237 std::vector<std::uint8_t> m_rest;
238 std::vector<double> m_tilt;
239 std::vector<double> m_tiltAzimuth;
240 std::vector<double> m_ground;
241 std::vector<std::uint8_t> m_model;
242 std::vector<double> m_wear;
243 std::vector<std::uint64_t> m_parent;
244 std::vector<std::uint32_t> m_piece;
245 std::vector<std::array<BoulderFacet, 2>> m_facets;
246 std::vector<std::uint8_t> m_facetCount;
247 std::vector<std::uint64_t> m_shapeSeed;
248 std::vector<std::uint8_t> m_hasShapeSeed;
249 };
250
251 /// A boulder placed by hand: its center and size, and any of its pose and shape fixed; unset
252 /// fields are drawn as for generated boulders. Set fields by name with the chainable setters:
253 ///
254 /// ManualBoulder(0.5, 0.5, 1.8).Height(1.1).Burial(0.2).YawDegrees(30.0).Model(true)
255 struct ManualBoulder {
256 double x = 0.0; ///< Surface x of its center.
257 double y = 0.0; ///< Surface y of its center.
258 double diameter = 0.0; ///< Length of its long axis (m).
259 /// Stable ID; unset derives one from position and size (`ManualCraterId`).
260 std::optional<std::uint64_t> id{};
261 /// Vertical extent (m), buried part included; unset draws it from the pose options.
262 std::optional<double> height{};
263 std::optional<double> burial{}; ///< Buried share of the height, in [0, 1); unset draws it.
264 /// Rotation about the vertical, degrees counter-clockwise from east; unset draws it.
265 std::optional<double> yawDegrees{};
266 /// Tilt of its vertical axis from the vertical, degrees; unset draws it.
267 std::optional<double> leanDegrees{};
268 /// Angle of its up axis from the vertical after lean, degrees; unset draws it.
269 std::optional<double> tiltDegrees{};
270 /// Direction its up axis tips toward, degrees counter-clockwise from east; unset draws it.
271 std::optional<double> tiltAzimuthDegrees{};
272 std::optional<double> wear{}; ///< How worn it is, from 0 (fresh) to 1; unset draws it.
273 std::optional<BoulderRest> rest{}; ///< Which axis it stands along; unset draws it.
274 /// The seed of its shape (`GenerateBoulderShape`); unset derives it from its ID.
275 std::optional<std::uint64_t> shapeSeed{};
276 /// Whether it is a 3D model rather than relief in the heights; unset follows the layer's
277 /// `BoulderRendering::models` threshold.
278 std::optional<bool> model{};
279
280
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 13 times.
34 ManualBoulder() = default;
281 /// A boulder `length` meters long centered at surface (`centerX`, `centerY`), the rest drawn.
282 30 ManualBoulder(double centerX, double centerY, double length)
283
15/15
<unknown function 282>:
✓ Branch 1 taken 3 times.
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 13 taken 1 time.
✓ Branch 16 taken 1 time.
✓ Branch 19 taken 1 time.
✓ Branch 22 taken 1 time.
✓ Branch 25 taken 1 time.
✓ Branch 28 taken 1 time.
✓ Branch 31 taken 1 time.
terraingen::Boulder::operator==(terraingen::Boulder const&) const:
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 6 times.
30 : x(centerX), y(centerY), diameter(length) {}
284
285 /// Sets `id`; this and the setters below return the boulder for chaining.
286 1 ManualBoulder& Id(std::uint64_t value) {
287 1 id = value;
288 1 return *this;
289 }
290 /// Sets `height`.
291 8 ManualBoulder& Height(double meters) {
292
1/1
✓ Branch 1 taken 6 times.
8 height = meters;
293 8 return *this;
294 }
295 /// Sets `burial`.
296 11 ManualBoulder& Burial(double share) {
297
1/1
✓ Branch 1 taken 3 times.
11 burial = share;
298
1/1
✓ Branch 1 taken 3 times.
11 return *this;
299 }
300 /// Sets `yawDegrees`.
301 8 ManualBoulder& YawDegrees(double degrees) {
302 8 yawDegrees = degrees;
303 8 return *this;
304 }
305 /// Sets `leanDegrees`.
306 7 ManualBoulder& LeanDegrees(double degrees) {
307 7 leanDegrees = degrees;
308 7 return *this;
309 }
310 /// Sets `tiltDegrees`.
311 7 ManualBoulder& TiltDegrees(double degrees) {
312 7 tiltDegrees = degrees;
313 7 return *this;
314 }
315 /// Sets `tiltAzimuthDegrees`.
316 1 ManualBoulder& TiltAzimuthDegrees(double degrees) {
317 1 tiltAzimuthDegrees = degrees;
318 1 return *this;
319 }
320 /// Sets `wear`.
321 7 ManualBoulder& Wear(double value) {
322 7 wear = value;
323
1/1
✓ Branch 1 taken 6 times.
7 return *this;
324 }
325 /// Sets `rest`.
326 2 ManualBoulder& Rest(BoulderRest value) {
327 2 rest = value;
328 2 return *this;
329 }
330 /// Sets `shapeSeed`.
331 2 ManualBoulder& ShapeSeed(std::uint64_t value) {
332 2 shapeSeed = value;
333 2 return *this;
334 }
335 /// Sets `model`.
336 7 ManualBoulder& Model(bool value) {
337
1/1
✓ Branch 1 taken 7 times.
7 model = value;
338
1/1
✓ Branch 1 taken 7 times.
7 return *this;
339 }
340
341 /// Whether any of its lean, tilt, tilt azimuth or rest is fixed.
342 18199 bool FixesOrientation() const {
343
28/46
<unknown function 342>:
✓ Branch 0 taken 18 times.
✓ Branch 1 taken 9585 times.
✓ Branch 2 taken 18 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 18 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✓ Branch 7 taken 16 times.
✓ Branch 8 taken 8 times.
✓ Branch 9 taken 8498 times.
✓ Branch 10 taken 8 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 8 times.
✗ Branch 13 not taken.
✓ Branch 14 taken 7 times.
✓ Branch 15 taken 1 time.
terraingen::Boulder::operator==(terraingen::Boulder const&) const:
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
✓ Branch 10 taken 1 time.
✗ Branch 11 not taken.
✓ Branch 13 taken 2 times.
✓ Branch 14 taken 1 time.
✓ Branch 15 taken 2 times.
✗ Branch 16 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 3 times.
✗ Branch 20 not taken.
✓ Branch 21 taken 3 times.
✗ Branch 22 not taken.
✓ Branch 23 taken 3 times.
✗ Branch 24 not taken.
terraingen::BoulderList::BoulderList():
✓ Branch 0 taken 61 times.
✓ Branch 1 taken 2 times.
✓ Branch 2 taken 61 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 57 times.
✓ Branch 5 taken 4 times.
18181 return leanDegrees || tiltDegrees || tiltAzimuthDegrees || rest;
344 }
345
346 /// Whether any of its pose, shape or model choice is fixed.
347 84 bool FixesAny() const {
348
13/14
✓ Branch 0 taken 66 times.
✓ Branch 1 taken 18 times.
✓ Branch 2 taken 60 times.
✓ Branch 3 taken 4 times.
✓ Branch 4 taken 56 times.
✓ Branch 5 taken 4 times.
✓ Branch 6 taken 50 times.
✓ Branch 7 taken 6 times.
✓ Branch 8 taken 50 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 48 times.
✓ Branch 11 taken 2 times.
✓ Branch 12 taken 44 times.
✓ Branch 13 taken 4 times.
148 return FixesOrientation() || height || burial || yawDegrees || wear || shapeSeed || model;
349 }
350
351 10 bool operator==(const ManualBoulder& other) const {
352
3/6
✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 9 times.
✗ Branch 5 not taken.
9 return x == other.x && y == other.y && diameter == other.diameter && id == other.id &&
353
4/6
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
25 height == other.height && burial == other.burial && yawDegrees == other.yawDegrees &&
354
2/4
✓ Branch 0 taken 8 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
16 leanDegrees == other.leanDegrees && tiltDegrees == other.tiltDegrees &&
355
2/4
✓ Branch 0 taken 8 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
16 tiltAzimuthDegrees == other.tiltAzimuthDegrees && wear == other.wear &&
356
5/8
✓ Branch 0 taken 9 times.
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 8 times.
✗ Branch 7 not taken.
34 rest == other.rest && shapeSeed == other.shapeSeed && model == other.model;
357 }
358 2 bool operator!=(const ManualBoulder& other) const {
359
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 return !(*this == other);
360 }
361 };
362
363 } // namespace terraingen
364