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
29
34
39
44
48
51
54
61
64
67
72
78
83
88
94
99
105
110
115
120
125
132
138
145
150
155
161
169
175
181
189
195
203
209
214
220
226
231
237
243
248
254
260
265
271
277
282
288
294
299
305
311
316
322
328
333
339
345
350
356
362
367
373
377
382
385
388
393
396
399
405
411
416
421
427
432
438
442
447
451
454
457
462
465
468
474
475// mesh vertex on the boundary of full basin and the other where it overflows
480
481// mesh vertex on the boundary of full basin and the other where it overflows
485
486// mesh vertex on the boundary of full basin and the other where it overflows
491
496
500
505
506// basin where the flow from v goes
511
512// basin where the flow from v goes
516
517// basin where the flow from v goes
522
526
531
535
538
541
546
549
552
558
559#ifdef __cplusplus
560} // extern "C"
561#endif
struct MR_UndirectedEdgeBitSet MR_UndirectedEdgeBitSet
Definition MRAABBTreeBase.h:28
struct MR_FaceBitSet MR_FaceBitSet
Definition MRAABBTree.h:17
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:16
struct MR_Graph MR_Graph
Definition MRGraph.h:29
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:458
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:468
struct MR_WatershedGraph_BdInfo MR_WatershedGraph_BdInfo
Definition MRVector.h:41
struct MR_WatershedGraph_BasinInfo MR_WatershedGraph_BasinInfo
Definition MRVector.h:40
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:38
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:23
#define MRC_API
Definition exports.h:11
Definition MRId.h:126
Definition MRId.h:116
Definition MRId.h:55