HighMap library (C++)
Loading...
Searching...
No Matches
forest.hpp
Go to the documentation of this file.
1/* Copyright (c) 2025 Otto Link. Distributed under the terms of the GNU General
2 Public License. The full license is in the file LICENSE, distributed with
3 this software. */
4
9#pragma once
10
11#include <cstddef>
12#include <cstdint>
13#include <vector>
14
18
19namespace hmap
20{
21
26class Forest : public ScatterField
27{
28public:
29 // ==========================================================================
30 // Constructors
31 // ==========================================================================
32
36 Forest() = default;
37
42 Forest(const std::vector<Tree> &trees);
43
48 Forest(std::vector<Tree> &&trees) noexcept;
49
54 Forest(const ScatterField &field);
55
60 Forest(ScatterField &&field) noexcept;
61
69 Forest(const Cloud &cloud,
70 uint32_t species_id = 0,
71 float default_radius = HMAP_DEFAULT_TREE_RADIUS);
72
83 void prune_unviable(const std::vector<Species> &species = {},
84 bool prune_collisions = true);
85
90 std::string to_string() const override;
91};
92
93} // namespace hmap
Represents a collection of unordered points in 2D space.
Definition cloud.hpp:61
Forest()=default
Default constructor initializing an empty forest.
void prune_unviable(const std::vector< Species > &species={}, bool prune_collisions=true)
Prunes unviable trees whose distance to their nearest neighbor is insufficient to meet their species'...
Definition forest.cpp:56
std::string to_string() const override
Returns a multi-line formatted summary string of the forest.
Definition forest.cpp:131
void prune_collisions()
Resolves overlapping items by discarding smaller items in collision.
Definition scatter_field.cpp:445
ScatterField()=default
Default constructor initializing an empty field.
Definition opencv.hpp:20