MeshLib C++ Docs
Loading...
Searching...
No Matches
MR::WatershedGraph Class Reference

graphs representing rain basins on the mesh More...

#include <MRMesh/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

 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
float getHeightAt (VertId v) const
 returns height at given vertex or FLT_MAX if the vertex is invalid
const Graphgraph () 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 BasinInfobasinInfo (Graph::VertId v) const
 returns data associated with given basin
BasinInfobasinInfo (Graph::VertId v)
const BdInfobdInfo (Graph::EdgeId e) const
 returns data associated with given boundary between basins
BdInfobdInfo (Graph::EdgeId e)
Graph::VertId outsideId () const
 returns special "basin" representing outside areas of the mesh
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
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)
Graph::VertId flowsFinallyTo (Graph::VertId v, bool exceptOutside=false) const
void setParentsToRoots ()
std::pair< Graph::EdgeId, float > findLowestBd () const
Graph::VertId merge (Graph::VertId v0, Graph::VertId v1)
 merges basin v1 into basin v0, v1 is deleted after that, returns v0
Graph::VertId mergeViaBd (Graph::EdgeId bd)
 merges two basins sharing given boundary, returns remaining basin
FaceBitSet getBasinFaces (Graph::VertId basin) const
 returns the mesh faces of given basin
Vector< FaceBitSet, Graph::VertIdgetAllBasinFaces (bool joinOverflowBasins=false) const
FaceBitSet getBasinFacesBelowLevel (Graph::VertId basin, float waterLevel) const
 returns the mesh faces of given basin with at least one vertex below given level
double computeBasinVolume (Graph::VertId basin, float waterLevel) const
UndirectedEdgeBitSet getInterBasinEdges (bool joinOverflowBasins=false) const
std::vector< OverflowPointgetOverflowPoints () const
 returns all overflow points in the graph
Vector< Graph::VertId, Graph::VertIdiniBasin2Tgt (bool joinOverflowBasins=false) const

Detailed Description

graphs representing rain basins on the mesh


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