MeshLib Rust Docs
Loading...
Searching...
No Matches
meshlib::WatershedGraph Struct Reference
Inheritance diagram for meshlib::WatershedGraph:

Public Member Functions

auto get_height_at (v:meshlib::VertId) const -> f32
auto graph () const -> &meshlib::Graph
auto total_area () const -> f32
auto num_basins () const -> core::ffi::c_int
auto basin_info (v:meshlib::GraphVertId) const -> &meshlib::WatershedGraph_BasinInfo
auto basin_info_mut (v:meshlib::GraphVertId) -> &mut meshlib::WatershedGraph_BasinInfo
auto bd_info (e:meshlib::GraphEdgeId) const -> &meshlib::WatershedGraph_BdInfo
auto bd_info_mut (e:meshlib::GraphEdgeId) -> &mut meshlib::WatershedGraph_BdInfo
auto outside_id () const -> meshlib::GraphVertId
auto get_root_basin (v:meshlib::GraphVertId) const -> meshlib::GraphVertId
auto flows_to (v:meshlib::GraphVertId) const -> meshlib::GraphVertId
auto flows_finally_to (v:meshlib::GraphVertId, exceptOutside:Option< bool >) const -> meshlib::GraphVertId
void set_parents_to_roots ()
auto find_lowest_bd () const -> meshlib::Owned< meshlib::std_pair_MR_GraphEdgeId_float >
auto merge (v0:meshlib::GraphVertId, v1:meshlib::GraphVertId) -> meshlib::GraphVertId
auto merge_via_bd (bd:meshlib::GraphEdgeId) -> meshlib::GraphVertId
auto get_basin_faces (basin:meshlib::GraphVertId) const -> meshlib::Owned< meshlib::FaceBitSet >
auto get_all_basin_faces (joinOverflowBasins:Option< bool >) const -> meshlib::Owned< meshlib::Vector_MR_FaceBitSet_MR_GraphVertId >
auto get_basin_faces_below_level (basin:meshlib::GraphVertId, waterLevel:f32) const -> meshlib::Owned< meshlib::FaceBitSet >
auto compute_basin_volume (basin:meshlib::GraphVertId, waterLevel:f32) const -> f64
auto get_inter_basin_edges (joinOverflowBasins:Option< bool >) const -> meshlib::Owned< meshlib::UndirectedEdgeBitSet >
auto get_overflow_points () const -> meshlib::Owned< meshlib::std_vector_MR_WatershedGraph_OverflowPoint >
auto ini_basin2_tgt (joinOverflowBasins:Option< bool >) const -> meshlib::Owned< meshlib::Vector_MR_GraphVertId_MR_GraphVertId >

Static Public Member Functions

static auto construct_from_another (_other:&meshlib::WatershedGraph) -> meshlib::Owned< meshlib::WatershedGraph >
static auto construct (mesh:&meshlib::Mesh, face2basin:&meshlib::Vector_int_MR_FaceId, numBasins:core::ffi::c_int) -> meshlib::Owned< meshlib::WatershedGraph >
Static Public Member Functions inherited from meshlib::CppClass
static void destroy (ptr:*mut Self)
Static Public Member Functions inherited from meshlib::CppCopy
static auto copy (ptr:*const Self) -> *mut Self

Detailed Description

graphs representing rain basins on the mesh Generated from class MR::WatershedGraph.

Generated from class MR::WatershedGraph. Heap-allocated instances are held in Owned<WatershedGraph>.

Member Function Documentation

◆ basin_info()

auto meshlib::WatershedGraph::basin_info ( v:meshlib::GraphVertId ) const -> &meshlib::WatershedGraph_BasinInfo

returns data associated with given basin Generated from method MR::WatershedGraph::basinInfo.

Calls MR_WatershedGraph_basinInfo().

◆ basin_info_mut()

auto meshlib::WatershedGraph::basin_info_mut ( v:meshlib::GraphVertId ) -> &mut meshlib::WatershedGraph_BasinInfo

Generated from method MR::WatershedGraph::basinInfo.

Calls MR_WatershedGraph_basinInfo_mut().

◆ bd_info()

auto meshlib::WatershedGraph::bd_info ( e:meshlib::GraphEdgeId ) const -> &meshlib::WatershedGraph_BdInfo

returns data associated with given boundary between basins Generated from method MR::WatershedGraph::bdInfo.

Calls MR_WatershedGraph_bdInfo().

◆ bd_info_mut()

auto meshlib::WatershedGraph::bd_info_mut ( e:meshlib::GraphEdgeId ) -> &mut meshlib::WatershedGraph_BdInfo

Generated from method MR::WatershedGraph::bdInfo.

Calls MR_WatershedGraph_bdInfo_mut().

◆ compute_basin_volume()

auto meshlib::WatershedGraph::compute_basin_volume ( basin:meshlib::GraphVertId ,
waterLevel:f32  ) const -> f64

returns water volume in basin when its surface reaches given level, which must be in between the lowest basin level and the lowest level on basin's boundary Generated from method MR::WatershedGraph::computeBasinVolume.

Calls MR_WatershedGraph_computeBasinVolume().

◆ construct()

auto meshlib::WatershedGraph::construct ( mesh:&meshlib::Mesh ,
face2basin:&meshlib::Vector_int_MR_FaceId ,
numBasins:core::ffi::c_int  ) -> meshlib::Owned< meshlib::WatershedGraph >
static

constructs the graph from given mesh, heights in z-coordinate, and initial subdivision on basins Generated from constructor MR::WatershedGraph::WatershedGraph.

Calls MR_WatershedGraph_Construct(). The reference to the parameter mesh might be preserved in the constructed object. The reference to the parameter face2basin might be preserved in the constructed object.

◆ construct_from_another()

auto meshlib::WatershedGraph::construct_from_another ( _other:&meshlib::WatershedGraph ) -> meshlib::Owned< meshlib::WatershedGraph >
static

Generated from constructor MR::WatershedGraph::WatershedGraph.

Calls MR_WatershedGraph_ConstructFromAnother(). The reference to things referred to by the parameter _other (if any) might be preserved in the constructed object.

◆ find_lowest_bd()

auto meshlib::WatershedGraph::find_lowest_bd ( ) const -> meshlib::Owned< meshlib::std_pair_MR_GraphEdgeId_float >

finds the lowest boundary between basins and its height, which is defined as the minimal different between lowest boundary point and lowest point in a basin Generated from method MR::WatershedGraph::findLowestBd.

Calls MR_WatershedGraph_findLowestBd().

◆ flows_finally_to()

auto meshlib::WatershedGraph::flows_finally_to ( v:meshlib::GraphVertId ,
exceptOutside:Option< bool >  ) const -> meshlib::GraphVertId

returns the basin where the flow from this basin finally goes (it can be self id if the basin is not full yet);

Parameters
exceptOutsideif true then the method returns the basin that receives water flow from (v) just before outside Generated from method MR::WatershedGraph::flowsFinallyTo.

Calls MR_WatershedGraph_flowsFinallyTo().

◆ flows_to()

auto meshlib::WatershedGraph::flows_to ( v:meshlib::GraphVertId ) const -> meshlib::GraphVertId

returns the basin where the flow from this basin goes next (it can be self id if the basin is not full yet) Generated from method MR::WatershedGraph::flowsTo.

Calls MR_WatershedGraph_flowsTo().

◆ get_all_basin_faces()

auto meshlib::WatershedGraph::get_all_basin_faces ( joinOverflowBasins:Option< bool > ) const -> meshlib::Owned< meshlib::Vector_MR_FaceBitSet_MR_GraphVertId >

returns the mesh faces of each valid basin;

Parameters
joinOverflowBasinsif true then overflowing basins will be merged in the target basins (except for overflow in outside) Generated from method MR::WatershedGraph::getAllBasinFaces.

Calls MR_WatershedGraph_getAllBasinFaces().

◆ get_basin_faces()

auto meshlib::WatershedGraph::get_basin_faces ( basin:meshlib::GraphVertId ) const -> meshlib::Owned< meshlib::FaceBitSet >

returns the mesh faces of given basin Generated from method MR::WatershedGraph::getBasinFaces.

Calls MR_WatershedGraph_getBasinFaces().

◆ get_basin_faces_below_level()

auto meshlib::WatershedGraph::get_basin_faces_below_level ( basin:meshlib::GraphVertId ,
waterLevel:f32  ) const -> meshlib::Owned< meshlib::FaceBitSet >

returns the mesh faces of given basin with at least one vertex below given level Generated from method MR::WatershedGraph::getBasinFacesBelowLevel.

Calls MR_WatershedGraph_getBasinFacesBelowLevel().

◆ get_height_at()

auto meshlib::WatershedGraph::get_height_at ( v:meshlib::VertId ) const -> f32

returns height at given vertex or FLT_MAX if the vertex is invalid Generated from method MR::WatershedGraph::getHeightAt.

Calls MR_WatershedGraph_getHeightAt().

◆ get_inter_basin_edges()

auto meshlib::WatershedGraph::get_inter_basin_edges ( joinOverflowBasins:Option< bool > ) const -> meshlib::Owned< meshlib::UndirectedEdgeBitSet >

returns the mesh edges between current basins

Parameters
joinOverflowBasinsif true then overflowing basins will be merged in the target basins (except for overflow in outside) Generated from method MR::WatershedGraph::getInterBasinEdges.

Calls MR_WatershedGraph_getInterBasinEdges().

◆ get_overflow_points()

auto meshlib::WatershedGraph::get_overflow_points ( ) const -> meshlib::Owned< meshlib::std_vector_MR_WatershedGraph_OverflowPoint >

returns all overflow points in the graph Generated from method MR::WatershedGraph::getOverflowPoints.

Calls MR_WatershedGraph_getOverflowPoints().

◆ get_root_basin()

auto meshlib::WatershedGraph::get_root_basin ( v:meshlib::GraphVertId ) const -> meshlib::GraphVertId

for valid basin returns self id; for invalid basin returns the id of basin it was merged in Generated from method MR::WatershedGraph::getRootBasin.

Calls MR_WatershedGraph_getRootBasin().

◆ graph()

auto meshlib::WatershedGraph::graph ( ) const -> &meshlib::Graph

returns underlying graph where each basin is a vertex Generated from method MR::WatershedGraph::graph.

Calls MR_WatershedGraph_graph().

◆ ini_basin2_tgt()

auto meshlib::WatershedGraph::ini_basin2_tgt ( joinOverflowBasins:Option< bool > ) const -> meshlib::Owned< meshlib::Vector_MR_GraphVertId_MR_GraphVertId >

computes a map from initial basin id to a valid basin in which it was merged

Parameters
joinOverflowBasinsif true then overflowing basins will be merged in the target basins (except for overflow in outside) Generated from method MR::WatershedGraph::iniBasin2Tgt.

Calls MR_WatershedGraph_iniBasin2Tgt().

◆ merge()

auto meshlib::WatershedGraph::merge ( v0:meshlib::GraphVertId ,
v1:meshlib::GraphVertId  ) -> meshlib::GraphVertId

merges basin v1 into basin v0, v1 is deleted after that, returns v0 Generated from method MR::WatershedGraph::merge.

Calls MR_WatershedGraph_merge().

◆ merge_via_bd()

auto meshlib::WatershedGraph::merge_via_bd ( bd:meshlib::GraphEdgeId ) -> meshlib::GraphVertId

merges two basins sharing given boundary, returns remaining basin Generated from method MR::WatershedGraph::mergeViaBd.

Calls MR_WatershedGraph_mergeViaBd().

◆ num_basins()

auto meshlib::WatershedGraph::num_basins ( ) const -> core::ffi::c_int

returns the current number of basins (excluding special "outside" basin) Generated from method MR::WatershedGraph::numBasins.

Calls MR_WatershedGraph_numBasins().

◆ outside_id()

auto meshlib::WatershedGraph::outside_id ( ) const -> meshlib::GraphVertId

returns special "basin" representing outside areas of the mesh Generated from method MR::WatershedGraph::outsideId.

Calls MR_WatershedGraph_outsideId().

◆ set_parents_to_roots()

void meshlib::WatershedGraph::set_parents_to_roots ( )

replaces parent of each basin with its computed root; this speeds up following calls to getRootBasin() Generated from method MR::WatershedGraph::setParentsToRoots.

Calls MR_WatershedGraph_setParentsToRoots().

◆ total_area()

auto meshlib::WatershedGraph::total_area ( ) const -> f32

returns total precipitation area Generated from method MR::WatershedGraph::totalArea.

Calls MR_WatershedGraph_totalArea().


The documentation for this struct was generated from the following file: