MeshLib C Docs
Loading...
Searching...
No Matches
MRWatershedGraph.h
Go to the documentation of this file.
1#pragma once
2
3#include <MRCMesh/MRId.h>
4#include <MRCMisc/common.h>
5#include <MRCMisc/exports.h>
6
7#include <stdbool.h>
8#include <stddef.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14typedef struct MR_FaceBitSet MR_FaceBitSet; // Defined in `#include <MRCMesh/MRBitSet.h>`.
15typedef struct MR_Graph MR_Graph; // Defined in `#include <MRCMesh/MRGraph.h>`.
16typedef struct MR_Mesh MR_Mesh; // Defined in `#include <MRCMesh/MRMesh.h>`.
17typedef struct MR_UndirectedEdgeBitSet MR_UndirectedEdgeBitSet; // Defined in `#include <MRCMesh/MRBitSet.h>`.
18typedef struct MR_Vector_MR_FaceBitSet_MR_GraphVertId MR_Vector_MR_FaceBitSet_MR_GraphVertId; // Defined in `#include <MRCMesh/MRVector.h>`.
19typedef struct MR_Vector_MR_GraphVertId_MR_GraphVertId MR_Vector_MR_GraphVertId_MR_GraphVertId; // Defined in `#include <MRCMesh/MRVector.h>`.
20typedef struct MR_Vector_int_MR_FaceId MR_Vector_int_MR_FaceId; // Defined in `#include <MRCMesh/MRVector.h>`.
21typedef struct MR_std_pair_MR_GraphEdgeId_float MR_std_pair_MR_GraphEdgeId_float; // Defined in `#include <MRCMisc/std_pair_MR_GraphEdgeId_float.h>`.
22typedef struct MR_std_vector_MR_WatershedGraph_OverflowPoint MR_std_vector_MR_WatershedGraph_OverflowPoint; // Defined in `#include <MRCMisc/std_vector_MR_WatershedGraph_OverflowPoint.h>`.
23
24
28
32
36
40
44
47
50
57
60
63
68
74
79
84
90
95
101
106
111
116
121
128
134
141
146
151
157
165
171
177
185
191
199
205
210
216
222
227
233
239
244
250
256
261
267
273
278
284
290
295
301
307
312
318
324
329
335
341
346
352
358
363
369
373
378
381
384
389
392
395
401
407
412
417
423
428
434
438
443
447
450
453
458
461
464
470
471// mesh vertex on the boundary of full basin and the other where it overflows
476
477// mesh vertex on the boundary of full basin and the other where it overflows
481
482// mesh vertex on the boundary of full basin and the other where it overflows
487
492
496
501
502// basin where the flow from v goes
507
508// basin where the flow from v goes
512
513// basin where the flow from v goes
518
522
527
531
534
537
542
545
548
554
555#ifdef __cplusplus
556} // extern "C"
557#endif
struct MR_FaceBitSet MR_FaceBitSet
Definition MRAABBTreeBase.h:24
struct MR_UndirectedEdgeBitSet MR_UndirectedEdgeBitSet
Definition MRAABBTreeBase.h:28
struct MR_Vector_MR_GraphVertId_MR_GraphVertId MR_Vector_MR_GraphVertId_MR_GraphVertId
Definition MRBitSet.h:32
struct MR_Mesh MR_Mesh
Definition MRCtm.h:12
struct MR_Graph MR_Graph
Definition MRGraph.h:24
struct MR_WatershedGraph MR_WatershedGraph
Definition MRPrecipitationSimulator.h:13
struct MR_Vector_int_MR_FaceId MR_Vector_int_MR_FaceId
std::vector<T>-like container that requires specific indexing type,
Definition MRVector.h:465
struct MR_Vector_MR_FaceBitSet_MR_GraphVertId MR_Vector_MR_FaceBitSet_MR_GraphVertId
std::vector<T>-like container that requires specific indexing type,
Definition MRVector.h:474
struct MR_WatershedGraph_BdInfo MR_WatershedGraph_BdInfo
Definition MRVector.h:40
struct MR_WatershedGraph_BasinInfo MR_WatershedGraph_BasinInfo
Definition MRVector.h:39
MRC_API float * MR_WatershedGraph_BasinInfo_GetMutable_area(MR_WatershedGraph_BasinInfo *_this)
MRC_API const float * MR_WatershedGraph_BasinInfo_Get_lastMergeVolume(const MR_WatershedGraph_BasinInfo *_this)
MRC_API MR_WatershedGraph_OverflowPoint * MR_WatershedGraph_OverflowPoint_OffsetMutablePtr(MR_WatershedGraph_OverflowPoint *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_WatershedGraph_OverflowPoint * MR_WatershedGraph_OverflowPoint_ConstructFromAnother(const MR_WatershedGraph_OverflowPoint *_other)
MRC_API const MR_Graph * MR_WatershedGraph_graph(const MR_WatershedGraph *_this)
MRC_API void MR_WatershedGraph_BasinInfo_Set_lastMergeVolume(MR_WatershedGraph_BasinInfo *_this, float value)
MRC_API float * MR_WatershedGraph_BasinInfo_GetMutable_lastMergeLevel(MR_WatershedGraph_BasinInfo *_this)
MRC_API void MR_WatershedGraph_OverflowPoint_Set_fullBasin(MR_WatershedGraph_OverflowPoint *_this, MR_GraphVertId value)
MRC_API MR_GraphVertId MR_WatershedGraph_getRootBasin(const MR_WatershedGraph *_this, MR_GraphVertId v)
MRC_API MR_Vector_MR_GraphVertId_MR_GraphVertId * MR_WatershedGraph_iniBasin2Tgt(const MR_WatershedGraph *_this, const bool *joinOverflowBasins)
MRC_API const MR_GraphVertId * MR_WatershedGraph_OverflowPoint_Get_overflowTo(const MR_WatershedGraph_OverflowPoint *_this)
MRC_API void MR_WatershedGraph_BdInfo_Destroy(const MR_WatershedGraph_BdInfo *_this)
Destroys a heap-allocated instance of MR_WatershedGraph_BdInfo. Does nothing if the pointer is null.
MRC_API MR_WatershedGraph_BdInfo * MR_WatershedGraph_BdInfo_DefaultConstruct(void)
MRC_API void MR_WatershedGraph_BasinInfo_Set_accVolume(MR_WatershedGraph_BasinInfo *_this, float value)
MRC_API MR_WatershedGraph_BasinInfo * MR_WatershedGraph_BasinInfo_ConstructFromAnother(const MR_WatershedGraph_BasinInfo *_other)
MRC_API const MR_WatershedGraph_BasinInfo * MR_WatershedGraph_basinInfo_const(const MR_WatershedGraph *_this, MR_GraphVertId v)
MRC_API void MR_WatershedGraph_BasinInfo_Set_overflowVia(MR_WatershedGraph_BasinInfo *_this, MR_GraphEdgeId value)
MRC_API MR_WatershedGraph_BdInfo * MR_WatershedGraph_BdInfo_ConstructFrom(MR_VertId lowestVert)
MRC_API void MR_WatershedGraph_BasinInfo_Set_lowestLevel(MR_WatershedGraph_BasinInfo *_this, float value)
MRC_API MR_WatershedGraph_BdInfo * MR_WatershedGraph_bdInfo(MR_WatershedGraph *_this, MR_GraphEdgeId e)
MRC_API const MR_WatershedGraph_OverflowPoint * MR_WatershedGraph_OverflowPoint_OffsetPtr(const MR_WatershedGraph_OverflowPoint *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API float * MR_WatershedGraph_BasinInfo_GetMutable_lowestLevel(MR_WatershedGraph_BasinInfo *_this)
MRC_API const float * MR_WatershedGraph_BasinInfo_Get_lowestLevel(const MR_WatershedGraph_BasinInfo *_this)
MRC_API MR_Vector_MR_FaceBitSet_MR_GraphVertId * MR_WatershedGraph_getAllBasinFaces(const MR_WatershedGraph *_this, const bool *joinOverflowBasins)
MRC_API const MR_VertId * MR_WatershedGraph_BasinInfo_Get_lowestVert(const MR_WatershedGraph_BasinInfo *_this)
MRC_API void MR_WatershedGraph_setParentsToRoots(MR_WatershedGraph *_this)
MRC_API void MR_WatershedGraph_BasinInfo_Destroy(const MR_WatershedGraph_BasinInfo *_this)
Destroys a heap-allocated instance of MR_WatershedGraph_BasinInfo. Does nothing if the pointer is nul...
MRC_API MR_WatershedGraph_BasinInfo * MR_WatershedGraph_basinInfo(MR_WatershedGraph *_this, MR_GraphVertId v)
MRC_API void MR_WatershedGraph_BasinInfo_Set_maxVolume(MR_WatershedGraph_BasinInfo *_this, float value)
MRC_API void MR_WatershedGraph_BasinInfo_Set_area(MR_WatershedGraph_BasinInfo *_this, float value)
MRC_API MR_FaceBitSet * MR_WatershedGraph_getBasinFacesBelowLevel(const MR_WatershedGraph *_this, MR_GraphVertId basin, float waterLevel)
MRC_API MR_WatershedGraph_BdInfo * MR_WatershedGraph_BdInfo_OffsetMutablePtr(MR_WatershedGraph_BdInfo *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API double MR_WatershedGraph_computeBasinVolume(const MR_WatershedGraph *_this, MR_GraphVertId basin, float waterLevel)
MRC_API const float * MR_WatershedGraph_BasinInfo_Get_maxVolume(const MR_WatershedGraph_BasinInfo *_this)
MRC_API void MR_WatershedGraph_BasinInfo_updateAccVolume(MR_WatershedGraph_BasinInfo *_this, float amount)
MRC_API const float * MR_WatershedGraph_BasinInfo_Get_area(const MR_WatershedGraph_BasinInfo *_this)
MRC_API MR_WatershedGraph_OverflowPoint * MR_WatershedGraph_OverflowPoint_DefaultConstruct(void)
MRC_API const MR_WatershedGraph_BdInfo * MR_WatershedGraph_bdInfo_const(const MR_WatershedGraph *_this, MR_GraphEdgeId e)
MRC_API MR_GraphVertId MR_WatershedGraph_mergeViaBd(MR_WatershedGraph *_this, MR_GraphEdgeId bd)
MRC_API void MR_WatershedGraph_BdInfo_Set_lowestVert(MR_WatershedGraph_BdInfo *_this, MR_VertId value)
MRC_API float * MR_WatershedGraph_BasinInfo_GetMutable_lowestBdLevel(MR_WatershedGraph_BasinInfo *_this)
struct MR_WatershedGraph_OverflowPoint MR_WatershedGraph_OverflowPoint
Definition MRWatershedGraph.h:39
MRC_API const MR_GraphVertId * MR_WatershedGraph_OverflowPoint_Get_fullBasin(const MR_WatershedGraph_OverflowPoint *_this)
MRC_API float * MR_WatershedGraph_BasinInfo_GetMutable_maxVolume(MR_WatershedGraph_BasinInfo *_this)
MRC_API const MR_VertId * MR_WatershedGraph_BdInfo_Get_lowestVert(const MR_WatershedGraph_BdInfo *_this)
MRC_API MR_WatershedGraph_BasinInfo * MR_WatershedGraph_BasinInfo_AssignFromAnother(MR_WatershedGraph_BasinInfo *_this, const MR_WatershedGraph_BasinInfo *_other)
MRC_API float MR_WatershedGraph_BasinInfo_approxLevel(const MR_WatershedGraph_BasinInfo *_this)
MRC_API MR_VertId * MR_WatershedGraph_BasinInfo_GetMutable_lowestVert(MR_WatershedGraph_BasinInfo *_this)
MRC_API MR_GraphVertId * MR_WatershedGraph_OverflowPoint_GetMutable_overflowTo(MR_WatershedGraph_OverflowPoint *_this)
MRC_API MR_GraphVertId MR_WatershedGraph_merge(MR_WatershedGraph *_this, MR_GraphVertId v0, MR_GraphVertId v1)
MRC_API MR_GraphVertId MR_WatershedGraph_flowsTo(const MR_WatershedGraph *_this, MR_GraphVertId v)
MRC_API const float * MR_WatershedGraph_BasinInfo_Get_lastMergeLevel(const MR_WatershedGraph_BasinInfo *_this)
MRC_API const float * MR_WatershedGraph_BasinInfo_Get_lastUpdateAmount(const MR_WatershedGraph_BasinInfo *_this)
MRC_API MR_GraphVertId MR_WatershedGraph_outsideId(const MR_WatershedGraph *_this)
MRC_API MR_WatershedGraph * MR_WatershedGraph_ConstructFromAnother(MR_PassBy _other_pass_by, MR_WatershedGraph *_other)
MRC_API const MR_WatershedGraph_BasinInfo * MR_WatershedGraph_BasinInfo_OffsetPtr(const MR_WatershedGraph_BasinInfo *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API void MR_WatershedGraph_Destroy(const MR_WatershedGraph *_this)
Destroys a heap-allocated instance of MR_WatershedGraph. Does nothing if the pointer is null.
MRC_API MR_WatershedGraph * MR_WatershedGraph_Construct(const MR_Mesh *mesh, const MR_Vector_int_MR_FaceId *face2basin, int numBasins)
MRC_API float MR_WatershedGraph_getHeightAt(const MR_WatershedGraph *_this, MR_VertId v)
MRC_API float * MR_WatershedGraph_BasinInfo_GetMutable_lastUpdateAmount(MR_WatershedGraph_BasinInfo *_this)
MRC_API MR_GraphEdgeId * MR_WatershedGraph_BasinInfo_GetMutable_overflowVia(MR_WatershedGraph_BasinInfo *_this)
MRC_API const MR_WatershedGraph_BdInfo * MR_WatershedGraph_BdInfo_OffsetPtr(const MR_WatershedGraph_BdInfo *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API const MR_GraphEdgeId * MR_WatershedGraph_BasinInfo_Get_overflowVia(const MR_WatershedGraph_BasinInfo *_this)
MRC_API float MR_WatershedGraph_totalArea(const MR_WatershedGraph *_this)
MRC_API MR_FaceBitSet * MR_WatershedGraph_getBasinFaces(const MR_WatershedGraph *_this, MR_GraphVertId basin)
MRC_API MR_std_vector_MR_WatershedGraph_OverflowPoint * MR_WatershedGraph_getOverflowPoints(const MR_WatershedGraph *_this)
MRC_API void MR_WatershedGraph_OverflowPoint_Set_overflowTo(MR_WatershedGraph_OverflowPoint *_this, MR_GraphVertId value)
MRC_API const MR_VertId * MR_WatershedGraph_OverflowPoint_Get_v(const MR_WatershedGraph_OverflowPoint *_this)
MRC_API void MR_WatershedGraph_BasinInfo_Set_lastUpdateAmount(MR_WatershedGraph_BasinInfo *_this, float value)
MRC_API MR_VertId * MR_WatershedGraph_BdInfo_GetMutable_lowestVert(MR_WatershedGraph_BdInfo *_this)
MRC_API MR_WatershedGraph_BasinInfo * MR_WatershedGraph_BasinInfo_OffsetMutablePtr(MR_WatershedGraph_BasinInfo *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_WatershedGraph_BdInfo * MR_WatershedGraph_BdInfo_ConstructFromAnother(const MR_WatershedGraph_BdInfo *_other)
MRC_API float * MR_WatershedGraph_BasinInfo_GetMutable_lastMergeVolume(MR_WatershedGraph_BasinInfo *_this)
MRC_API MR_GraphVertId MR_WatershedGraph_flowsFinallyTo(const MR_WatershedGraph *_this, MR_GraphVertId v, const bool *exceptOutside)
struct MR_std_vector_MR_WatershedGraph_OverflowPoint MR_std_vector_MR_WatershedGraph_OverflowPoint
Definition MRWatershedGraph.h:22
MRC_API void MR_WatershedGraph_OverflowPoint_DestroyArray(const MR_WatershedGraph_OverflowPoint *_this)
Destroys a heap-allocated array of MR_WatershedGraph_OverflowPoint. Does nothing if the pointer is nu...
MRC_API void MR_WatershedGraph_OverflowPoint_Set_v(MR_WatershedGraph_OverflowPoint *_this, MR_VertId value)
struct MR_std_pair_MR_GraphEdgeId_float MR_std_pair_MR_GraphEdgeId_float
Definition MRWatershedGraph.h:21
MRC_API void MR_WatershedGraph_BdInfo_DestroyArray(const MR_WatershedGraph_BdInfo *_this)
Destroys a heap-allocated array of MR_WatershedGraph_BdInfo. Does nothing if the pointer is null.
MRC_API MR_WatershedGraph * MR_WatershedGraph_OffsetMutablePtr(MR_WatershedGraph *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_WatershedGraph_OverflowPoint * MR_WatershedGraph_OverflowPoint_ConstructFrom(MR_VertId v, MR_GraphVertId fullBasin, MR_GraphVertId overflowTo)
MRC_API MR_GraphVertId * MR_WatershedGraph_OverflowPoint_GetMutable_fullBasin(MR_WatershedGraph_OverflowPoint *_this)
MRC_API void MR_WatershedGraph_BasinInfo_Set_lowestVert(MR_WatershedGraph_BasinInfo *_this, MR_VertId value)
MRC_API MR_VertId * MR_WatershedGraph_OverflowPoint_GetMutable_v(MR_WatershedGraph_OverflowPoint *_this)
MRC_API const float * MR_WatershedGraph_BasinInfo_Get_lowestBdLevel(const MR_WatershedGraph_BasinInfo *_this)
MRC_API void MR_WatershedGraph_BasinInfo_Set_lastMergeLevel(MR_WatershedGraph_BasinInfo *_this, float value)
MRC_API MR_WatershedGraph_BdInfo * MR_WatershedGraph_BdInfo_DefaultConstructArray(size_t num_elems)
MRC_API MR_WatershedGraph_BasinInfo * MR_WatershedGraph_BasinInfo_DefaultConstruct(void)
MRC_API MR_WatershedGraph_OverflowPoint * MR_WatershedGraph_OverflowPoint_DefaultConstructArray(size_t num_elems)
MRC_API MR_WatershedGraph_OverflowPoint * MR_WatershedGraph_OverflowPoint_AssignFromAnother(MR_WatershedGraph_OverflowPoint *_this, const MR_WatershedGraph_OverflowPoint *_other)
MRC_API MR_WatershedGraph_BdInfo * MR_WatershedGraph_BdInfo_AssignFromAnother(MR_WatershedGraph_BdInfo *_this, const MR_WatershedGraph_BdInfo *_other)
MRC_API float MR_WatershedGraph_BasinInfo_amountTillOverflow(const MR_WatershedGraph_BasinInfo *_this)
MRC_API const MR_WatershedGraph * MR_WatershedGraph_OffsetPtr(const MR_WatershedGraph *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API int MR_WatershedGraph_numBasins(const MR_WatershedGraph *_this)
MRC_API MR_std_pair_MR_GraphEdgeId_float * MR_WatershedGraph_findLowestBd(const MR_WatershedGraph *_this)
MRC_API MR_WatershedGraph_BasinInfo * MR_WatershedGraph_BasinInfo_DefaultConstructArray(size_t num_elems)
MRC_API void MR_WatershedGraph_OverflowPoint_Destroy(const MR_WatershedGraph_OverflowPoint *_this)
Destroys a heap-allocated instance of MR_WatershedGraph_OverflowPoint. Does nothing if the pointer is...
MRC_API void MR_WatershedGraph_BasinInfo_DestroyArray(const MR_WatershedGraph_BasinInfo *_this)
Destroys a heap-allocated array of MR_WatershedGraph_BasinInfo. Does nothing if the pointer is null.
MRC_API void MR_WatershedGraph_BasinInfo_Set_lowestBdLevel(MR_WatershedGraph_BasinInfo *_this, float value)
MRC_API void MR_WatershedGraph_DestroyArray(const MR_WatershedGraph *_this)
Destroys a heap-allocated array of MR_WatershedGraph. Does nothing if the pointer is null.
MRC_API const float * MR_WatershedGraph_BasinInfo_Get_accVolume(const MR_WatershedGraph_BasinInfo *_this)
MRC_API MR_UndirectedEdgeBitSet * MR_WatershedGraph_getInterBasinEdges(const MR_WatershedGraph *_this, const bool *joinOverflowBasins)
MRC_API float * MR_WatershedGraph_BasinInfo_GetMutable_accVolume(MR_WatershedGraph_BasinInfo *_this)
MR_PassBy
Definition common.h:19
#define MRC_API
Definition exports.h:11
Definition MRId.h:126
Definition MRId.h:116
Definition MRId.h:55