MeshLib
 
Loading...
Searching...
No Matches
MR::FlowAggregator Class Reference

this class can track multiple flows and find in each mesh vertex the amount of water reached it More...

#include <MRAggregateFlow.h>

Classes

struct  Flows
 

Public Member Functions

MRMESH_API FlowAggregator (const Mesh &mesh, const VertScalars &heights)
 prepares the processing of given mesh with given height in each vertex
 
MRMESH_API VertScalars computeFlow (const std::vector< FlowOrigin > &starts, const OutputFlows &out={}) const
 
MRMESH_API VertScalars computeFlow (const std::vector< MeshTriPoint > &starts, const OutputFlows &out={}) const
 
MRMESH_API VertScalars computeFlow (size_t numStarts, const std::function< MeshTriPoint(size_t)> &startById, const std::function< float(size_t)> &amountById, const std::function< const FaceBitSet *(size_t)> &regionById, const OutputFlows &out={}) const
 
MRMESH_API HashMap< VertId, FlowscomputeFlowsPerBasin (const std::vector< FlowOrigin > &starts) const
 
MRMESH_API HashMap< VertId, FlowscomputeFlowsPerBasin (const std::vector< MeshTriPoint > &starts) const
 
MRMESH_API HashMap< VertId, FlowscomputeFlowsPerBasin (size_t numStarts, const std::function< MeshTriPoint(size_t)> &startById, const std::function< float(size_t)> &amountById) const
 
MRMESH_API UndirectedEdgeBitSet computeCatchmentDelineation () const
 

Detailed Description

this class can track multiple flows and find in each mesh vertex the amount of water reached it

Constructor & Destructor Documentation

◆ FlowAggregator()

MRMESH_API MR::FlowAggregator::FlowAggregator ( const Mesh & mesh,
const VertScalars & heights )

prepares the processing of given mesh with given height in each vertex

Member Function Documentation

◆ computeCatchmentDelineation()

MRMESH_API UndirectedEdgeBitSet MR::FlowAggregator::computeCatchmentDelineation ( ) const
nodiscard

finds the edges on the mesh that divides catchment basin (every triangle is attributed to the final destination point based on the path originated from its centroid)

◆ computeFlow() [1/3]

MRMESH_API VertScalars MR::FlowAggregator::computeFlow ( const std::vector< FlowOrigin > & starts,
const OutputFlows & out = {} ) const

tracks multiple flows

Parameters
startsthe origin of each flow (should be uniformly sampled over the terrain)
Returns
the flow reached each mesh vertex

◆ computeFlow() [2/3]

MRMESH_API VertScalars MR::FlowAggregator::computeFlow ( const std::vector< MeshTriPoint > & starts,
const OutputFlows & out = {} ) const

◆ computeFlow() [3/3]

MRMESH_API VertScalars MR::FlowAggregator::computeFlow ( size_t numStarts,
const std::function< MeshTriPoint(size_t)> & startById,
const std::function< float(size_t)> & amountById,
const std::function< const FaceBitSet *(size_t)> & regionById,
const OutputFlows & out = {} ) const
Parameters
startByIdcan return invalid point that will be ignored
regionByIdif given then the flow initially is limited to this region

◆ computeFlowsPerBasin() [1/3]

MRMESH_API HashMap< VertId, Flows > MR::FlowAggregator::computeFlowsPerBasin ( const std::vector< FlowOrigin > & starts) const

tracks multiple flows

Parameters
startsthe origin of each flow (should be uniformly sampled over the terrain)
Returns
the flows grouped by the final destination vertex

◆ computeFlowsPerBasin() [2/3]

MRMESH_API HashMap< VertId, Flows > MR::FlowAggregator::computeFlowsPerBasin ( const std::vector< MeshTriPoint > & starts) const

◆ computeFlowsPerBasin() [3/3]

MRMESH_API HashMap< VertId, Flows > MR::FlowAggregator::computeFlowsPerBasin ( size_t numStarts,
const std::function< MeshTriPoint(size_t)> & startById,
const std::function< float(size_t)> & amountById ) const
Parameters
startByIdcan return invalid point that will be ignored

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