./
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
113 / 125
90.4%
Branches:
92 / 104
88.5%
Functions:
16 / 17, 4 excl
94.1%

include/terraingen/sources/sample_block.h
Line Branch Exec Source
1 // SPDX-License-Identifier: BSD-3-Clause
2
3 /// @file
4 /// @brief Positions a source or layer evaluates and their heights: a raster's cells or scattered
5 /// points.
6 #pragma once
7
8 #include "terraingen/geometry/geometry.h"
9 #include "terraingen/geometry/surface.h"
10 #include "terraingen/raster/cell_loops.h"
11 #include "terraingen/raster/raster.h"
12 #include "terraingen/util/span.h"
13
14 #include <cstddef>
15 #include <vector>
16
17 namespace terraingen {
18
19 /// Heights and where they are: every cell of a raster, sampled at its center, or a list of
20 /// scattered points such as wheel contacts. Sources and layers evaluate a block in one call, so a
21 /// single point and a whole grid take the same path and give the same height at the same place.
22 class SampleBlock {
23 public:
24 /// The cells of `heights`, which must outlive the block.
25 explicit SampleBlock(Raster<float>& heights);
26
27 /// The points `positions`, with their heights in step; both must outlive the block.
28 /// @throws std::invalid_argument when the two differ in length.
29 SampleBlock(Span<const Vec2d> positions, Span<float> heights);
30
31 /// The number of samples.
32 70001018 std::size_t Size() const {
33
18/18
<unknown function 32>:
✓ Branch 0 taken 4124 times.
✓ Branch 0 taken 3031441 times.
✓ Branch 0 taken 675014 times.
✓ Branch 1 taken 7 times.
✓ Branch 1 taken 2058492 times.
✓ Branch 1 taken 247549 times.
✓ Branch 2 taken 2327298 times.
✓ Branch 2 taken 5744889 times.
✓ Branch 3 taken 21358 times.
✓ Branch 3 taken 3344802 times.
✓ Branch 4 taken 362 times.
✓ Branch 5 taken 1004443 times.
✓ Branch 6 taken 76992 times.
✓ Branch 7 taken 1007405 times.
✓ Branch 8 taken 76965 times.
✓ Branch 9 taken 42998439 times.
✓ Branch 10 taken 334249 times.
terraingen::SampleBlock::Size() const:
✓ Branch 1 taken 33 times.
63885178 return m_heights.size();
34 }
35
36 /// Whether the samples are a raster's cells.
37 7179655 bool IsGrid() const {
38
5/6
<unknown function 32>:
✓ Branch 0 taken 260 times.
✓ Branch 1 taken 269224 times.
✓ Branch 2 taken 4549290 times.
✓ Branch 3 taken 1 time.
<unknown function 37>:
✗ Branch 0 not taken.
✓ Branch 1 taken 2362504 times.
7179655 return m_grid != nullptr;
39 }
40
41 /// The raster of a grid block, or null for points.
42 9912228 Raster<float>* Grid() const {
43
10/10
<unknown function 32>:
✓ Branch 0 taken 2394619 times.
✓ Branch 1 taken 100128 times.
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 701 times.
✓ Branch 3 taken 2352480 times.
✓ Branch 4 taken 1 time.
<unknown function 42>:
✓ Branch 0 taken 961 times.
✓ Branch 0 taken 322669 times.
✓ Branch 1 taken 2508648 times.
✓ Branch 1 taken 308331 times.
9911844 return m_grid;
44 }
45
46 /// The points of a point block; empty for a grid.
47 3175917 Span<const Vec2d> Points() const {
48
2/3
✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
3175917 return m_positions;
49 }
50
51 /// Every height, a grid's row by row.
52 5106066 Span<float> Heights() const {
53
3/3
<unknown function 32>:
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
<unknown function 37>:
✓ Branch 1 taken 2370559 times.
5106066 return m_heights;
54 }
55
56 /// The position of sample `i`: a cell center, or a point.
57 Vec2d Position(std::size_t i) const;
58
59 /// The position of every sample, in order.
60 std::vector<Vec2d> Positions() const;
61
62 /// The height of sample `i`.
63 19571845 float& Height(std::size_t i) const {
64 17718908 return m_heights[i];
65 }
66
67 /// Whether sample `i` holds no data: NaN, or a grid's no-data value.
68 bool IsNoData(std::size_t i) const;
69
70 /// The smallest box holding every sample: a grid's extent, or the points' bounds, which like
71 /// `PointBounds` contain their largest coordinates.
72 Bounds2d Bounds() const;
73
74 /// The feature spacing in meters: `spacing`, raised to a grid's cell spacing on `surface`.
75 double ResolvedSpacing(double spacing, const Surface& surface) const;
76
77 private:
78 Raster<float>* m_grid = nullptr;
79 Span<const Vec2d> m_positions;
80 Span<float> m_heights;
81 };
82
83 /// Sets each point of `samples` holding data, in order, to `map(height, position)`.
84 1867679 template <typename Map> void MapPoints(SampleBlock& samples, const Map& map) {
85
6/8
void terraingen::MapPoints<MapSamples_MapsCellsAndPointsHoldingData_Test::TestBody()::{lambda(float, terraingen::Vec2d const&)#1}>(terraingen::SampleBlock&, MapSamples_MapsCellsAndPointsHoldingData_Test::TestBody()::{lambda(float, terraingen::Vec2d const&)#1} const&):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
void terraingen::MapPoints<MapSamples_MapsCellsAndPointsHoldingData_Test::TestBody()::{lambda(float, terraingen::Vec2d const&)#2}>(terraingen::SampleBlock&, MapSamples_MapsCellsAndPointsHoldingData_Test::TestBody()::{lambda(float, terraingen::Vec2d const&)#2} const&):
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 1 time.
void terraingen::MapPoints<terraingen::FormulaLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, terraingen::Vec2d const&)#1}>(terraingen::SampleBlock&, terraingen::FormulaLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, terraingen::Vec2d const&)#1} const&):
✓ Branch 0 taken 1807390 times.
✓ Branch 1 taken 1867299 times.
void terraingen::MapPoints<terraingen::NoiseLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, terraingen::Vec2d const&)#1}>(terraingen::SampleBlock&, terraingen::NoiseLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, terraingen::Vec2d const&)#1} const&):
✓ Branch 0 taken 379 times.
✓ Branch 1 taken 379 times.
3675450 for (std::size_t i = 0; i < samples.Size(); ++i) {
86
5/8
void terraingen::MapPoints<MapSamples_MapsCellsAndPointsHoldingData_Test::TestBody()::{lambda(float, terraingen::Vec2d const&)#1}>(terraingen::SampleBlock&, MapSamples_MapsCellsAndPointsHoldingData_Test::TestBody()::{lambda(float, terraingen::Vec2d const&)#1} const&):
✗ Branch 1 not taken.
✗ Branch 2 not taken.
void terraingen::MapPoints<MapSamples_MapsCellsAndPointsHoldingData_Test::TestBody()::{lambda(float, terraingen::Vec2d const&)#2}>(terraingen::SampleBlock&, MapSamples_MapsCellsAndPointsHoldingData_Test::TestBody()::{lambda(float, terraingen::Vec2d const&)#2} const&):
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 1 time.
void terraingen::MapPoints<terraingen::FormulaLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, terraingen::Vec2d const&)#1}>(terraingen::SampleBlock&, terraingen::FormulaLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, terraingen::Vec2d const&)#1} const&):
✓ Branch 1 taken 1807384 times.
✓ Branch 2 taken 6 times.
void terraingen::MapPoints<terraingen::NoiseLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, terraingen::Vec2d const&)#1}>(terraingen::SampleBlock&, terraingen::NoiseLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, terraingen::Vec2d const&)#1} const&):
✓ Branch 1 taken 379 times.
✗ Branch 2 not taken.
1807771 if (!samples.IsNoData(i)) {
87 3615528 samples.Height(i) = map(samples.Height(i), samples.Position(i));
88 }
89 }
90 1867679 }
91
92 /// Sets each sample of `samples` holding data to `map(height, position)`: a grid's cells over
93 /// `threads` threads (`MapCells`), or points in order.
94 1867709 template <typename Map> void MapSamples(SampleBlock& samples, unsigned threads, const Map& map) {
95
6/8
void terraingen::MapSamples<MapSamples_MapsCellsAndPointsHoldingData_Test::TestBody()::{lambda(float, terraingen::Vec2d const&)#1}>(terraingen::SampleBlock&, unsigned int, MapSamples_MapsCellsAndPointsHoldingData_Test::TestBody()::{lambda(float, terraingen::Vec2d const&)#1} const&):
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
void terraingen::MapSamples<MapSamples_MapsCellsAndPointsHoldingData_Test::TestBody()::{lambda(float, terraingen::Vec2d const&)#2}>(terraingen::SampleBlock&, unsigned int, MapSamples_MapsCellsAndPointsHoldingData_Test::TestBody()::{lambda(float, terraingen::Vec2d const&)#2} const&):
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
void terraingen::MapSamples<terraingen::FormulaLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, terraingen::Vec2d const&)#1}>(terraingen::SampleBlock&, unsigned int, terraingen::FormulaLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, terraingen::Vec2d const&)#1} const&):
✓ Branch 0 taken 28 times.
✓ Branch 1 taken 1867299 times.
void terraingen::MapSamples<terraingen::NoiseLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, terraingen::Vec2d const&)#1}>(terraingen::SampleBlock&, unsigned int, terraingen::NoiseLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, terraingen::Vec2d const&)#1} const&):
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 379 times.
1867709 if (Raster<float>* grid = samples.Grid()) {
96 30 MapCells(*grid, threads, map);
97 30 return;
98 }
99 1867679 MapPoints(samples, map);
100 }
101
102 /// Draws features into `samples`: each sample holding data inside feature n's box is set to
103 /// `draw(height, base, position, n)`, feature by feature in order, where `base` is its height
104 /// before any feature. A grid's cells run over `threads` threads (`ForEachFeatureCell`).
105 /// @param boxes Each feature's box in `surface`'s coordinates.
106 template <typename Draw>
107 55766 void DrawFeatures(SampleBlock& samples, unsigned threads, const std::vector<Bounds2d>& boxes,
108 const Surface& surface, const Draw& draw) {
109
6/6
void terraingen::DrawFeatures<DrawFeatures_DrawsEachFeatureOverItsBoxFromTheHeightBefore_Test::TestBody()::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1}>(terraingen::SampleBlock&, unsigned int, std::vector<terraingen::Bounds2d, std::allocator<terraingen::Bounds2d> > const&, terraingen::Surface const&, DrawFeatures_DrawsEachFeatureOverItsBoxFromTheHeightBefore_Test::TestBody()::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1} const&):
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 1 time.
void terraingen::DrawFeatures<terraingen::BoulderLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1}>(terraingen::SampleBlock&, unsigned int, std::vector<terraingen::Bounds2d, std::allocator<terraingen::Bounds2d> > const&, terraingen::Surface const&, terraingen::BoulderLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1} const&):
✓ Branch 0 taken 101 times.
✓ Branch 1 taken 54123 times.
void terraingen::DrawFeatures<terraingen::SandShadowLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1}>(terraingen::SampleBlock&, unsigned int, std::vector<terraingen::Bounds2d, std::allocator<terraingen::Bounds2d> > const&, terraingen::Surface const&, terraingen::SandShadowLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1} const&):
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 1538 times.
55766 if (Raster<float>* grid = samples.Grid()) {
110 104 const Span<const float> values = static_cast<const Raster<float>&>(*grid).Values();
111
3/3
void terraingen::DrawFeatures<DrawFeatures_DrawsEachFeatureOverItsBoxFromTheHeightBefore_Test::TestBody()::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1}>(terraingen::SampleBlock&, unsigned int, std::vector<terraingen::Bounds2d, std::allocator<terraingen::Bounds2d> > const&, terraingen::Surface const&, DrawFeatures_DrawsEachFeatureOverItsBoxFromTheHeightBefore_Test::TestBody()::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1} const&):
✓ Branch 2 taken 1 time.
void terraingen::DrawFeatures<terraingen::BoulderLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1}>(terraingen::SampleBlock&, unsigned int, std::vector<terraingen::Bounds2d, std::allocator<terraingen::Bounds2d> > const&, terraingen::Surface const&, terraingen::BoulderLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1} const&):
✓ Branch 2 taken 101 times.
void terraingen::DrawFeatures<terraingen::SandShadowLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1}>(terraingen::SampleBlock&, unsigned int, std::vector<terraingen::Bounds2d, std::allocator<terraingen::Bounds2d> > const&, terraingen::Surface const&, terraingen::SandShadowLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1} const&):
✓ Branch 2 taken 2 times.
104 const std::vector<float> base(values.begin(), values.end());
112 104 const std::size_t width = grid->Width();
113
3/3
terraingen::DrawFeatures<DrawFeatures_DrawsEachFeatureOverItsBoxFromTheHeightBefore_Test::TestBody()::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1}>(terraingen::SampleBlock&, unsigned int, std::vector<terraingen::Bounds2d, std::allocator<terraingen::Bounds2d> > const&, terraingen::Surface const&, DrawFeatures_DrawsEachFeatureOverItsBoxFromTheHeightBefore_Test::TestBody()::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1} const&)::{lambda(float&, terraingen::FeatureCell const&)#1}::operator()(float&, terraingen::FeatureCell const&) const:
✓ Branch 1 taken 1 time.
terraingen::DrawFeatures<terraingen::BoulderLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1}>(terraingen::SampleBlock&, unsigned int, std::vector<terraingen::Bounds2d, std::allocator<terraingen::Bounds2d> > const&, terraingen::Surface const&, terraingen::BoulderLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1} const&)::{lambda(float&, terraingen::FeatureCell const&)#1}::operator()(float&, terraingen::FeatureCell const&) const:
✓ Branch 1 taken 101 times.
terraingen::DrawFeatures<terraingen::SandShadowLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1}>(terraingen::SampleBlock&, unsigned int, std::vector<terraingen::Bounds2d, std::allocator<terraingen::Bounds2d> > const&, terraingen::Surface const&, terraingen::SandShadowLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1} const&)::{lambda(float&, terraingen::FeatureCell const&)#1}::operator()(float&, terraingen::FeatureCell const&) const:
✓ Branch 1 taken 2 times.
104 ForEachFeatureCell(*grid, threads, boxes, surface, [&](float& cell, const FeatureCell& at) {
114
1/2
✓ Branch 0 taken 8 times.
✗ Branch 1 not taken.
288622 cell = draw(cell, base[at.row * width + at.col], at.center, at.feature);
115 });
116 return;
117 104 }
118
6/6
terraingen::DrawFeatures<DrawFeatures_DrawsEachFeatureOverItsBoxFromTheHeightBefore_Test::TestBody()::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1}>(terraingen::SampleBlock&, unsigned int, std::vector<terraingen::Bounds2d, std::allocator<terraingen::Bounds2d> > const&, terraingen::Surface const&, DrawFeatures_DrawsEachFeatureOverItsBoxFromTheHeightBefore_Test::TestBody()::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1} const&)::{lambda(float&, terraingen::FeatureCell const&)#1}::operator()(float&, terraingen::FeatureCell const&) const:
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 time.
terraingen::DrawFeatures<terraingen::BoulderLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1}>(terraingen::SampleBlock&, unsigned int, std::vector<terraingen::Bounds2d, std::allocator<terraingen::Bounds2d> > const&, terraingen::Surface const&, terraingen::BoulderLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1} const&)::{lambda(float&, terraingen::FeatureCell const&)#1}::operator()(float&, terraingen::FeatureCell const&) const:
✓ Branch 0 taken 617830 times.
✓ Branch 1 taken 54123 times.
terraingen::DrawFeatures<terraingen::SandShadowLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1}>(terraingen::SampleBlock&, unsigned int, std::vector<terraingen::Bounds2d, std::allocator<terraingen::Bounds2d> > const&, terraingen::Surface const&, terraingen::SandShadowLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1} const&)::{lambda(float&, terraingen::FeatureCell const&)#1}::operator()(float&, terraingen::FeatureCell const&) const:
✓ Branch 0 taken 1538 times.
✓ Branch 1 taken 1538 times.
675033 for (std::size_t i = 0; i < samples.Size(); ++i) {
119
5/6
terraingen::DrawFeatures<DrawFeatures_DrawsEachFeatureOverItsBoxFromTheHeightBefore_Test::TestBody()::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1}>(terraingen::SampleBlock&, unsigned int, std::vector<terraingen::Bounds2d, std::allocator<terraingen::Bounds2d> > const&, terraingen::Surface const&, DrawFeatures_DrawsEachFeatureOverItsBoxFromTheHeightBefore_Test::TestBody()::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1} const&)::{lambda(float&, terraingen::FeatureCell const&)#1}::operator()(float&, terraingen::FeatureCell const&) const:
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
terraingen::DrawFeatures<terraingen::BoulderLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1}>(terraingen::SampleBlock&, unsigned int, std::vector<terraingen::Bounds2d, std::allocator<terraingen::Bounds2d> > const&, terraingen::Surface const&, terraingen::BoulderLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1} const&)::{lambda(float&, terraingen::FeatureCell const&)#1}::operator()(float&, terraingen::FeatureCell const&) const:
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 617829 times.
terraingen::DrawFeatures<terraingen::SandShadowLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1}>(terraingen::SampleBlock&, unsigned int, std::vector<terraingen::Bounds2d, std::allocator<terraingen::Bounds2d> > const&, terraingen::Surface const&, terraingen::SandShadowLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1} const&)::{lambda(float&, terraingen::FeatureCell const&)#1}::operator()(float&, terraingen::FeatureCell const&) const:
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 1537 times.
619371 if (samples.IsNoData(i)) {
120 2 continue;
121 }
122 619369 const Vec2d p = samples.Position(i);
123 619369 const float base = samples.Height(i);
124
6/6
terraingen::DrawFeatures<DrawFeatures_DrawsEachFeatureOverItsBoxFromTheHeightBefore_Test::TestBody()::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1}>(terraingen::SampleBlock&, unsigned int, std::vector<terraingen::Bounds2d, std::allocator<terraingen::Bounds2d> > const&, terraingen::Surface const&, DrawFeatures_DrawsEachFeatureOverItsBoxFromTheHeightBefore_Test::TestBody()::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1} const&)::{lambda(float&, terraingen::FeatureCell const&)#1}::operator()(float&, terraingen::FeatureCell const&) const:
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 3 times.
terraingen::DrawFeatures<terraingen::BoulderLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1}>(terraingen::SampleBlock&, unsigned int, std::vector<terraingen::Bounds2d, std::allocator<terraingen::Bounds2d> > const&, terraingen::Surface const&, terraingen::BoulderLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1} const&)::{lambda(float&, terraingen::FeatureCell const&)#1}::operator()(float&, terraingen::FeatureCell const&) const:
✓ Branch 0 taken 1793777 times.
✓ Branch 1 taken 617829 times.
terraingen::DrawFeatures<terraingen::SandShadowLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1}>(terraingen::SampleBlock&, unsigned int, std::vector<terraingen::Bounds2d, std::allocator<terraingen::Bounds2d> > const&, terraingen::Surface const&, terraingen::SandShadowLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1} const&)::{lambda(float&, terraingen::FeatureCell const&)#1}::operator()(float&, terraingen::FeatureCell const&) const:
✓ Branch 0 taken 1216 times.
✓ Branch 1 taken 1537 times.
2414368 for (std::size_t n = 0; n < boxes.size(); ++n) {
125
6/6
terraingen::DrawFeatures<DrawFeatures_DrawsEachFeatureOverItsBoxFromTheHeightBefore_Test::TestBody()::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1}>(terraingen::SampleBlock&, unsigned int, std::vector<terraingen::Bounds2d, std::allocator<terraingen::Bounds2d> > const&, terraingen::Surface const&, DrawFeatures_DrawsEachFeatureOverItsBoxFromTheHeightBefore_Test::TestBody()::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1} const&)::{lambda(float&, terraingen::FeatureCell const&)#1}::operator()(float&, terraingen::FeatureCell const&) const:
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 3 times.
terraingen::DrawFeatures<terraingen::BoulderLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1}>(terraingen::SampleBlock&, unsigned int, std::vector<terraingen::Bounds2d, std::allocator<terraingen::Bounds2d> > const&, terraingen::Surface const&, terraingen::BoulderLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1} const&)::{lambda(float&, terraingen::FeatureCell const&)#1}::operator()(float&, terraingen::FeatureCell const&) const:
✓ Branch 0 taken 44771 times.
✓ Branch 1 taken 1749006 times.
terraingen::DrawFeatures<terraingen::SandShadowLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1}>(terraingen::SampleBlock&, unsigned int, std::vector<terraingen::Bounds2d, std::allocator<terraingen::Bounds2d> > const&, terraingen::Surface const&, terraingen::SandShadowLayer::ApplySamples(terraingen::SampleBlock&, terraingen::LayerContext const&) const::{lambda(float, float, terraingen::Vec2d const&, unsigned long)#1} const&)::{lambda(float&, terraingen::FeatureCell const&)#1}::operator()(float&, terraingen::FeatureCell const&) const:
✓ Branch 0 taken 400 times.
✓ Branch 1 taken 816 times.
1794999 if (surface.Contains(boxes[n], p)) {
126
1/2
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
45177 samples.Height(i) = draw(samples.Height(i), base, p, n);
127 }
128 }
129 }
130 }
131
132 } // namespace terraingen
133