Container class representing a field of rocks/boulders (scree, talus, or boulder field).
More...
|
| | RockField ()=default |
| | Default constructor initializing an empty rock field.
|
| | RockField (const std::vector< Rock > &rocks) |
| | Constructs a RockField from a vector of rocks.
|
| | RockField (std::vector< Rock > &&rocks) noexcept |
| | Move-constructs a RockField from a vector of rocks.
|
| | RockField (const ScatterField &field) |
| | Constructs a RockField from a base ScatterField.
|
| | RockField (ScatterField &&field) noexcept |
| | Move-constructs a RockField from a base ScatterField.
|
| | RockField (const Cloud &cloud, uint32_t class_id=0, float default_radius=HMAP_DEFAULT_ROCK_RADIUS) |
| | Constructs a RockField from a Cloud of 2D points.
|
| void | apply_power_law_distribution (float alpha=2.0f, float r_min=1e-3f, float r_max=5e-2f, uint32_t seed=0) |
| | Applies a heavy-tailed power-law (Pareto) radius distribution to all rocks.
|
| void | apply_power_law_distribution (const RockDistribution &dist, uint32_t seed=0) |
| | Applies a power-law radius distribution according to a RockDistribution definition.
|
| void | apply_slope_sorting (const Array &slope, float sorting_strength=1.0f, const BBox2D &bbox=BBox2D{}) |
| | Simulates gravitational slope sorting (scree/talus dynamics).
|
| void | simulate_physics (const Array &elevation, const Array *p_friction_map=nullptr, const RockSimulationOptions &options={}) |
| | Simulates physical movement (sliding, rolling, bouncing, and inter-rock collision avoidance) for this RockField across terrain on GPU.
|
| std::string | to_string () const override |
| | Returns a multi-line formatted summary string of the rock field.
|
| | ScatterField ()=default |
| | Default constructor initializing an empty field.
|
| | ScatterField (const std::vector< ScatterItem > &items) |
| | Constructs a ScatterField from a vector of items.
|
| | ScatterField (std::vector< ScatterItem > &&items) noexcept |
| | Move-constructs a ScatterField from a vector of items.
|
| | ScatterField (const Cloud &cloud, uint32_t class_id=0, float default_radius=HMAP_DEFAULT_SCATTER_RADIUS) |
| | Constructs a ScatterField from a Cloud of 2D points.
|
| virtual | ~ScatterField ()=default |
| ScatterItem & | at (size_t index) |
| const ScatterItem & | at (size_t index) const |
| ScatterItem & | back () |
| const ScatterItem & | back () const |
| auto | begin () noexcept |
| auto | begin () const noexcept |
| auto | cbegin () const noexcept |
| size_t | capacity () const noexcept |
| void | clear () noexcept |
| ScatterItem * | data () noexcept |
| const ScatterItem * | data () const noexcept |
| template<typename... Args> |
| ScatterItem & | emplace_back (Args &&...args) |
| bool | empty () const noexcept |
| auto | end () noexcept |
| auto | end () const noexcept |
| auto | cend () const noexcept |
| ScatterItem & | front () |
| const ScatterItem & | front () const |
| ScatterItem & | operator[] (size_t index) |
| const ScatterItem & | operator[] (size_t index) const |
| void | push_back (const ScatterItem &item) |
| void | push_back (ScatterItem &&item) |
| void | reserve (size_t new_cap) |
| size_t | size () const noexcept |
| void | densify (float default_radius=HMAP_DEFAULT_SCATTER_RADIUS) |
| | Densifies the scatter field by adding Voronoi vertices (circumcenters of Delaunay triangles).
|
| ScatterField | filter_by_class (uint32_t class_id) const |
| | Returns a new ScatterField containing only items matching the given class_id.
|
| BBox2D | get_bbox () const |
| | Computes the 2D bounding box enclosing all item positions.
|
| std::vector< uint32_t > | get_class_ids () const |
| | Returns a sorted list of unique class identifiers present in the field.
|
| std::vector< float > | get_radius () const |
| | Extracts the characteristic radius of all items.
|
| std::vector< float > | get_x () const |
| | Extracts the x-coordinate of all items.
|
| std::vector< float > | get_y () const |
| | Extracts the y-coordinate of all items.
|
| std::vector< float > | get_z () const |
| | Extracts the z-coordinate (elevation) of all items.
|
| void | perturb_positions (float dx, float dy=0.0f, uint32_t seed=0) |
| | Slightly perturbs the 2D (x, y) coordinates of scatter items.
|
| void | pack_interstitial (size_t count, const Array &density={}, float r_min=5e-4f, float r_max=2e-3f, uint32_t class_id=0, uint32_t seed=0, const UvRect &uv_rect={0.f, 1.f, 0.f, 1.f}) |
| | Packs smaller interstitial items in the voids between existing larger items without displacing existing items.
|
| void | prune_collisions () |
| | Resolves overlapping items by discarding smaller items in collision.
|
| void | prune_collisions (const ScatterField &other) |
| | Prunes items in this field that overlap with (fall within the influence radius of) items in another field.
|
| void | prune_density (const Array &density_mask, float target_ratio=0.8f, uint32_t seed=0, const UvRect &uv_rect={0.f, 1.f, 0.f, 1.f}) |
| | Prunes items in the field using density-based acceptance sampling modulated to reach an approximate target retention ratio.
|
| void | regularize_positions (size_t k_neighbors=8, float step_size=0.1f, size_t iterations=10) |
| | Relaxes/regularizes item positions using k-nearest neighbor repulsion.
|
| void | reinforce_class_clusters (size_t iterations=2, size_t k_neighbors=4, bool include_self=true) |
| | Reinforces spatial clustering of classes by iteratively assigning each item the dominant class among its nearest neighbors.
|
| void | resolve_collisions (size_t iterations=20, float tolerance=0.f, float step_size=2., size_t triangulation_substep=5) |
| | Resolves overlapping items by iteratively moving colliding items apart using Delaunay triangulation neighborhood and repulsive relaxation.
|
| void | resolve_collisions (const ScatterField &other, size_t iterations=20, float tolerance=0.f, float step_size=2.f, size_t triangulation_substep=5) |
| | Resolves collisions with another static ScatterField by pushing items in this field away from colliding items in the other field, using joint Delaunay triangulation neighborhood and repulsive relaxation.
|
| void | set_elevation_from_terrain (const Array &elevation, const UvRect &uv_rect={0.f, 1.f, 0.f, 1.f}) |
| | Sets the elevation (z-coordinate) of all items by sampling a terrain heightmap.
|
| void | shuffle_classes (float ratio=0.1f, size_t k_neighbors=4, uint32_t seed=0) |
| | Randomly shuffles class identifiers between neighboring items.
|
| Cloud | to_cloud () const |
| | Converts the field into a Cloud of 2D points (x, y) with value set to radius.
|
| Array | to_density_map (glm::ivec2 shape, float sigma=0.0f, std::optional< uint32_t > class_id=std::nullopt, bool weighted_by_area=false, const UvTile ®ion=UvTile::dummy(), ICommunicator &comm=SingleArrayComm::instance()) const |
| | Exports the local density map of the field as a 2D Array using 2D Kernel Density Estimation (Gaussian splatting / KDE).
|
| Array | to_heightmap (glm::ivec2 shape, ScatterShape shape_type=SCATTER_SHAPE_DISK, float height_radius_ratio=1.0f, std::optional< uint32_t > class_id=std::nullopt, Array *p_rock_map=nullptr, uint32_t seed=0, const UvRect &uv_rect=UvRect::unit()) const |
| | Converts the scatter field into a heightmap by representing each scattered object as a local elevation increase on GPU.
|
| void | to_csv (const std::string &fname) const |
| | Exports the items to a CSV file (x, y, z, class_id, radius).
|
| std::vector< uint8_t > | to_img_8bit (glm::ivec2 shape, const Array &background={}, const UvRect &uv_rect=UvRect::unit(), bool flip_y=false) const |
| | Renders the scatter field to an 8-bit RGB image buffer.
|
| void | to_ply (const std::string &fname) const |
| | Exports the items to a PLY file with radius and class as custom parameters.
|
| void | to_png (const std::string &fname, glm::ivec2 shape, const Array &background={}, const UvRect &uv_rect=UvRect::unit()) const |
| | Exports a visual representation of the scatter field as a PNG image.
|
Container class representing a field of rocks/boulders (scree, talus, or boulder field).