MeshLib Python Docs
Loading...
Searching...
No Matches
meshlib.mrmeshpy.WatershedGraph Class Reference

Classes

class  BasinInfo
 
class  BdInfo
 
class  OverflowPoint
 

Public Member Functions

None __init__ (self, Mesh mesh, Vector_int_FaceId face2basin, int numBasins)
 
None __init__ (self, WatershedGraph arg0)
 
WatershedGraph.BasinInfo basinInfo (self, GraphVertId v)
 
WatershedGraph.BasinInfo basinInfo (self, GraphVertId v)
 
WatershedGraph.BdInfo bdInfo (self, GraphEdgeId e)
 
WatershedGraph.BdInfo bdInfo (self, GraphEdgeId e)
 
float computeBasinVolume (self, GraphVertId basin, float waterLevel)
 
tuple[GraphEdgeId, float] findLowestBd (self)
 
GraphVertId flowsFinallyTo (self, GraphVertId v, bool exceptOutside=False)
 
GraphVertId flowsTo (self, GraphVertId v)
 
Vector_FaceBitSet_GraphVertId getAllBasinFaces (self, bool joinOverflowBasins=False)
 
FaceBitSet getBasinFaces (self, GraphVertId basin)
 
FaceBitSet getBasinFacesBelowLevel (self, GraphVertId basin, float waterLevel)
 
float getHeightAt (self, VertId v)
 
UndirectedEdgeBitSet getInterBasinEdges (self, bool joinOverflowBasins=False)
 
std_vector_WatershedGraph_OverflowPoint getOverflowPoints (self)
 
GraphVertId getRootBasin (self, GraphVertId v)
 
Graph graph (self)
 
Vector_GraphVertId_GraphVertId iniBasin2Tgt (self, bool joinOverflowBasins=False)
 
GraphVertId merge (self, GraphVertId v0, GraphVertId v1)
 
GraphVertId mergeViaBd (self, GraphEdgeId bd)
 
int numBasins (self)
 
GraphVertId outsideId (self)
 
None setParentsToRoots (self)
 
float totalArea (self)
 

Detailed Description

Generated from:  MR::WatershedGraph

graphs representing rain basins on the mesh

Constructor & Destructor Documentation

◆ __init__() [1/2]

None meshlib.mrmeshpy.WatershedGraph.__init__ ( self,
Mesh mesh,
Vector_int_FaceId face2basin,
int numBasins )
constructs the graph from given mesh, heights in z-coordinate, and initial subdivision on basins

◆ __init__() [2/2]

None meshlib.mrmeshpy.WatershedGraph.__init__ ( self,
WatershedGraph arg0 )
Implicit copy constructor.

Member Function Documentation

◆ basinInfo() [1/2]

WatershedGraph.BasinInfo meshlib.mrmeshpy.WatershedGraph.basinInfo ( self,
GraphVertId v )
returns data associated with given basin

◆ basinInfo() [2/2]

WatershedGraph.BasinInfo meshlib.mrmeshpy.WatershedGraph.basinInfo ( self,
GraphVertId v )

◆ bdInfo() [1/2]

WatershedGraph.BdInfo meshlib.mrmeshpy.WatershedGraph.bdInfo ( self,
GraphEdgeId e )
returns data associated with given boundary between basins

◆ bdInfo() [2/2]

WatershedGraph.BdInfo meshlib.mrmeshpy.WatershedGraph.bdInfo ( self,
GraphEdgeId e )

◆ computeBasinVolume()

float meshlib.mrmeshpy.WatershedGraph.computeBasinVolume ( self,
GraphVertId basin,
float waterLevel )
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

◆ findLowestBd()

tuple[GraphEdgeId, float] meshlib.mrmeshpy.WatershedGraph.findLowestBd ( self)
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

◆ flowsFinallyTo()

GraphVertId meshlib.mrmeshpy.WatershedGraph.flowsFinallyTo ( self,
GraphVertId v,
bool exceptOutside = False )
returns the basin where the flow from this basin finally goes (it can be self id if the basin is not full yet);
\\param exceptOutside if true then the method returns the basin that receives water flow from (v) just before outside

◆ flowsTo()

GraphVertId meshlib.mrmeshpy.WatershedGraph.flowsTo ( self,
GraphVertId v )
returns the basin where the flow from this basin goes next (it can be self id if the basin is not full yet)

◆ getAllBasinFaces()

Vector_FaceBitSet_GraphVertId meshlib.mrmeshpy.WatershedGraph.getAllBasinFaces ( self,
bool joinOverflowBasins = False )
returns the mesh faces of each valid basin;
\\param joinOverflowBasins if true then overflowing basins will be merged in the target basins (except for overflow in outside)

◆ getBasinFaces()

FaceBitSet meshlib.mrmeshpy.WatershedGraph.getBasinFaces ( self,
GraphVertId basin )
returns the mesh faces of given basin

◆ getBasinFacesBelowLevel()

FaceBitSet meshlib.mrmeshpy.WatershedGraph.getBasinFacesBelowLevel ( self,
GraphVertId basin,
float waterLevel )
returns the mesh faces of given basin with at least one vertex below given level

◆ getHeightAt()

float meshlib.mrmeshpy.WatershedGraph.getHeightAt ( self,
VertId v )
returns height at given vertex or FLT_MAX if the vertex is invalid

◆ getInterBasinEdges()

UndirectedEdgeBitSet meshlib.mrmeshpy.WatershedGraph.getInterBasinEdges ( self,
bool joinOverflowBasins = False )
returns the mesh edges between current basins
\\param joinOverflowBasins if true then overflowing basins will be merged in the target basins (except for overflow in outside)

◆ getOverflowPoints()

std_vector_WatershedGraph_OverflowPoint meshlib.mrmeshpy.WatershedGraph.getOverflowPoints ( self)
returns all overflow points in the graph

◆ getRootBasin()

GraphVertId meshlib.mrmeshpy.WatershedGraph.getRootBasin ( self,
GraphVertId v )
for valid basin returns self id; for invalid basin returns the id of basin it was merged in

◆ graph()

Graph meshlib.mrmeshpy.WatershedGraph.graph ( self)
returns underlying graph where each basin is a vertex

◆ iniBasin2Tgt()

Vector_GraphVertId_GraphVertId meshlib.mrmeshpy.WatershedGraph.iniBasin2Tgt ( self,
bool joinOverflowBasins = False )
computes a map from initial basin id to a valid basin in which it was merged
\\param joinOverflowBasins if true then overflowing basins will be merged in the target basins (except for overflow in outside)

◆ merge()

GraphVertId meshlib.mrmeshpy.WatershedGraph.merge ( self,
GraphVertId v0,
GraphVertId v1 )
merges basin v1 into basin v0, v1 is deleted after that, returns v0

◆ mergeViaBd()

GraphVertId meshlib.mrmeshpy.WatershedGraph.mergeViaBd ( self,
GraphEdgeId bd )
merges two basins sharing given boundary, returns remaining basin

◆ numBasins()

int meshlib.mrmeshpy.WatershedGraph.numBasins ( self)
returns the current number of basins (excluding special "outside" basin)

◆ outsideId()

GraphVertId meshlib.mrmeshpy.WatershedGraph.outsideId ( self)
returns special "basin" representing outside areas of the mesh

◆ setParentsToRoots()

None meshlib.mrmeshpy.WatershedGraph.setParentsToRoots ( self)
replaces parent of each basin with its computed root;
this speeds up following calls to getRootBasin()

◆ totalArea()

float meshlib.mrmeshpy.WatershedGraph.totalArea ( self)
returns total precipitation area

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