graphs representing rain basins on the mesh More...
#include <MRWatershedGraph.h>
Classes | |
struct | BasinInfo |
associated with each vertex in graph More... | |
struct | BdInfo |
associated with each edge in graph More... | |
struct | OverflowPoint |
describes a point where a flow from one basin overflows into another basin More... | |
Public Member Functions | |
MRMESH_API | WatershedGraph (const Mesh &mesh, const Vector< int, FaceId > &face2basin, int numBasins) |
constructs the graph from given mesh, heights in z-coordinate, and initial subdivision on basins | |
MRMESH_API float | getHeightAt (VertId v) const |
returns height at given vertex or FLT_MAX if the vertex is invalid | |
const Graph & | graph () const |
returns underlying graph where each basin is a vertex | |
float | totalArea () const |
returns total precipitation area | |
int | numBasins () const |
returns the current number of basins (excluding special "outside" basin) | |
const BasinInfo & | basinInfo (Graph::VertId v) const |
returns data associated with given basin | |
BasinInfo & | basinInfo (Graph::VertId v) |
const BdInfo & | bdInfo (Graph::EdgeId e) const |
returns data associated with given boundary between basins | |
BdInfo & | bdInfo (Graph::EdgeId e) |
Graph::VertId | outsideId () const |
returns special "basin" representing outside areas of the mesh | |
MRMESH_API Graph::VertId | getRootBasin (Graph::VertId v) const |
for valid basin returns self id; for invalid basin returns the id of basin it was merged in | |
MRMESH_API Graph::VertId | flowsTo (Graph::VertId v) const |
returns the basin where the flow from this basin goes next (it can be self id if the basin is not full yet) | |
MRMESH_API Graph::VertId | flowsFinallyTo (Graph::VertId v, bool exceptOutside=false) const |
MRMESH_API void | setParentsToRoots () |
MRMESH_API std::pair< Graph::EdgeId, float > | findLowestBd () const |
MRMESH_API Graph::VertId | merge (Graph::VertId v0, Graph::VertId v1) |
merges basin v1 into basin v0, v1 is deleted after that, returns v0 | |
MRMESH_API Graph::VertId | mergeViaBd (Graph::EdgeId bd) |
merges two basins sharing given boundary, returns remaining basin | |
MRMESH_API FaceBitSet | getBasinFaces (Graph::VertId basin) const |
returns the mesh faces of given basin | |
MRMESH_API Vector< FaceBitSet, Graph::VertId > | getAllBasinFaces (bool joinOverflowBasins=false) const |
MRMESH_API FaceBitSet | getBasinFacesBelowLevel (Graph::VertId basin, float waterLevel) const |
returns the mesh faces of given basin with at least one vertex below given level | |
MRMESH_API double | computeBasinVolume (Graph::VertId basin, float waterLevel) const |
MRMESH_API UndirectedEdgeBitSet | getInterBasinEdges (bool joinOverflowBasins=false) const |
MRMESH_API std::vector< OverflowPoint > | getOverflowPoints () const |
returns all overflow points in the graph | |
MRMESH_API Vector< Graph::VertId, Graph::VertId > | iniBasin2Tgt (bool joinOverflowBasins=false) const |
graphs representing rain basins on the mesh
MRMESH_API MR::WatershedGraph::WatershedGraph | ( | const Mesh & | mesh, |
const Vector< int, FaceId > & | face2basin, | ||
int | numBasins ) |
constructs the graph from given mesh, heights in z-coordinate, and initial subdivision on basins
|
inlinenodiscard |
|
inlinenodiscard |
returns data associated with given basin
|
inlinenodiscard |
|
inlinenodiscard |
returns data associated with given boundary between basins
|
nodiscard |
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
|
nodiscard |
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
|
nodiscard |
returns the basin where the flow from this basin finally goes (it can be self id if the basin is not full yet);
exceptOutside | if true then the method returns the basin that receives water flow from (v) just before outside |
|
nodiscard |
returns the basin where the flow from this basin goes next (it can be self id if the basin is not full yet)
|
nodiscard |
returns the mesh faces of each valid basin;
joinOverflowBasins | if true then overflowing basins will be merged in the target basins (except for overflow in outside) |
|
nodiscard |
returns the mesh faces of given basin
|
nodiscard |
returns the mesh faces of given basin with at least one vertex below given level
|
nodiscard |
returns height at given vertex or FLT_MAX if the vertex is invalid
|
nodiscard |
returns the mesh edges between current basins
joinOverflowBasins | if true then overflowing basins will be merged in the target basins (except for overflow in outside) |
|
nodiscard |
returns all overflow points in the graph
|
nodiscard |
for valid basin returns self id; for invalid basin returns the id of basin it was merged in
|
inlinenodiscard |
returns underlying graph where each basin is a vertex
|
nodiscard |
computes a map from initial basin id to a valid basin in which it was merged
joinOverflowBasins | if true then overflowing basins will be merged in the target basins (except for overflow in outside) |
MRMESH_API Graph::VertId MR::WatershedGraph::merge | ( | Graph::VertId | v0, |
Graph::VertId | v1 ) |
merges basin v1 into basin v0, v1 is deleted after that, returns v0
MRMESH_API Graph::VertId MR::WatershedGraph::mergeViaBd | ( | Graph::EdgeId | bd | ) |
merges two basins sharing given boundary, returns remaining basin
|
inlinenodiscard |
returns the current number of basins (excluding special "outside" basin)
|
inlinenodiscard |
returns special "basin" representing outside areas of the mesh
MRMESH_API void MR::WatershedGraph::setParentsToRoots | ( | ) |
replaces parent of each basin with its computed root; this speeds up following calls to getRootBasin()
|
inlinenodiscard |
returns total precipitation area