Represents a cell-based hydrology drainage basin network on a 2D heightmap grid.
More...
#include <drainage_basin_cell_based.hpp>
|
| Array | z |
| | The heightmap array.
|
| |
| Mat< int > | outlets_mask |
| | Mask indicating outlet cells.
|
| |
| Mat< glm::ivec2 > | receivers |
| | Grid of receiver coordinates.
|
| |
| Mat< std::vector< glm::ivec2 > > | children |
| | Grid of children coordinates.
|
| |
| Mat< glm::ivec2 > | roots |
| | Grid of basin root.
|
| |
| std::unordered_map< glm::ivec2, std::vector< glm::ivec2 >, IVec2Hash > | traversals |
| |
| const glm::ivec2 | null_cell = glm::ivec2(-1, -1) |
| | Constant representing an.
|
| |
Represents a cell-based hydrology drainage basin network on a 2D heightmap grid.
This class implements hydrological flow network computations (receivers, outlets, main channels, upstream traversals) on a regular grid represented by a 2D Array.
◆ DrainageBasinCellBased() [1/2]
| hmap::DrainageBasinCellBased::DrainageBasinCellBased |
( |
| ) |
|
|
default |
◆ DrainageBasinCellBased() [2/2]
| hmap::DrainageBasinCellBased::DrainageBasinCellBased |
( |
const Array & |
z_ | ) |
|
Construct a new cell-based drainage basin using a heightmap.
- Parameters
-
| z_ | The input heightmap array. |
◆ get_z()
| const Array & hmap::DrainageBasinCellBased::get_z |
( |
| ) |
const |
Get the underlying heightmap array.
- Returns
- A const reference to the heightmap Array.
◆ compute_receivers()
| void hmap::DrainageBasinCellBased::compute_receivers |
( |
unsigned int |
seed = 0, |
|
|
float |
noise_strength = 0.f |
|
) |
| |
Compute flow receivers using standard D8, with optional noise.
- Parameters
-
| seed | Seed for random generation. |
| noise_strength | Strength of elevation noise added for stochastic flow paths. |
◆ compute_receivers_priority_flood()
| void hmap::DrainageBasinCellBased::compute_receivers_priority_flood |
( |
| ) |
|
Compute flow receivers using the priority flood routing algorithm.
◆ update_stream_tree() [1/2]
| void hmap::DrainageBasinCellBased::update_stream_tree |
( |
unsigned int |
seed, |
|
|
float |
noise_strength |
|
) |
| |
Update the stream tree stochastically.
- Parameters
-
| seed | Seed for random generation. |
| noise_strength | Strength of noise. |
◆ update_stream_tree() [2/2]
| void hmap::DrainageBasinCellBased::update_stream_tree |
( |
| ) |
|
Update the stream tree deterministically.
◆ update_traversals()
| void hmap::DrainageBasinCellBased::update_traversals |
( |
| ) |
|
Update cached traversal orders for upstream/downstream computations.
◆ get_outlets()
| std::vector< glm::ivec2 > hmap::DrainageBasinCellBased::get_outlets |
( |
| ) |
const |
Get the outlets of the basin.
- Returns
- A vector of 2D grid coordinates of the outlets.
◆ set_outlets()
| void hmap::DrainageBasinCellBased::set_outlets |
( |
const std::vector< glm::ivec2 > & |
outlet_indices | ) |
|
Set the outlets of the basin.
- Parameters
-
| outlet_indices | Vector of outlet 2D coordinates. |
◆ compute_upstream_traversals()
| std::vector< std::vector< glm::ivec2 > > hmap::DrainageBasinCellBased::compute_upstream_traversals |
( |
| ) |
|
Compute upstream traversal orders for the entire grid.
- Returns
- A vector of paths, each represented as a vector of 2D coordinates.
◆ find_subroots()
| std::pair< Mat< glm::ivec2 >, bool > hmap::DrainageBasinCellBased::find_subroots |
( |
| ) |
|
Find subroots of the flow network.
- Returns
- A pair containing a matrix of subroots and a boolean status.
◆ remove_lakes()
| void hmap::DrainageBasinCellBased::remove_lakes |
( |
const Mat< glm::ivec2 > & |
subroot | ) |
|
Remove lakes by draining local depressions.
- Parameters
-
| subroot | Matrix representing subroots. |
◆ get_main_channels()
| std::vector< std::vector< glm::ivec2 > > hmap::DrainageBasinCellBased::get_main_channels |
( |
| ) |
const |
Get the main channel paths of the flow network.
- Returns
- A vector of main channels, each represented as a vector of 2D grid coordinates.
◆ compute_response_times()
| Array hmap::DrainageBasinCellBased::compute_response_times |
( |
const Array & |
area_acc, |
|
|
const Array & |
erodibility, |
|
|
float |
m_exp |
|
) |
| const |
Compute response times of the basin cells.
- Parameters
-
| area_acc | Accumulated area array. |
| erodibility | Erodibility coefficient array. |
| m_exp | Erodibility exponent. |
- Returns
- An Array of response times.
◆ update_elevations()
| float hmap::DrainageBasinCellBased::update_elevations |
( |
const Array & |
response_times, |
|
|
float |
uplift_rate, |
|
|
const Array & |
max_slope |
|
) |
| |
Update elevations based on response times and uplift.
- Parameters
-
| response_times | Array of cell response times. |
| uplift_rate | Rate of tectonic uplift. |
| max_slope | Maximum allowed slope array. |
- Returns
- The maximum change in elevation.
◆ accumulate_area_by_outlet()
| void hmap::DrainageBasinCellBased::accumulate_area_by_outlet |
( |
Array & |
acc | ) |
const |
Accumulate contributing area down the network by outlet.
- Parameters
-
| acc | Output accumulated area array. |
◆ flow_breach()
| void hmap::DrainageBasinCellBased::flow_breach |
( |
| ) |
|
Perform flow breaching to resolve depressions.
| Array hmap::DrainageBasinCellBased::z |
◆ outlets_mask
| Mat<int> hmap::DrainageBasinCellBased::outlets_mask |
Mask indicating outlet cells.
◆ receivers
| Mat<glm::ivec2> hmap::DrainageBasinCellBased::receivers |
Grid of receiver coordinates.
◆ children
| Mat<std::vector<glm::ivec2> > hmap::DrainageBasinCellBased::children |
Grid of children coordinates.
◆ roots
| Mat<glm::ivec2> hmap::DrainageBasinCellBased::roots |
◆ traversals
| std::unordered_map<glm::ivec2, std::vector<glm::ivec2>, IVec2Hash> hmap::DrainageBasinCellBased::traversals |
◆ null_cell
| const glm::ivec2 hmap::DrainageBasinCellBased::null_cell = glm::ivec2(-1, -1) |
Constant representing an.
The documentation for this class was generated from the following files: