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#include <stdint.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15typedef struct MR_FaceBitSet MR_FaceBitSet; // Defined in `#include <MRCMesh/MRBitSet.h>`.
16typedef struct MR_Graph MR_Graph; // Defined in `#include <MRCMesh/MRGraph.h>`.
17typedef struct MR_Mesh MR_Mesh; // Defined in `#include <MRCMesh/MRMesh.h>`.
18typedef struct MR_UndirectedEdgeBitSet MR_UndirectedEdgeBitSet; // Defined in `#include <MRCMesh/MRBitSet.h>`.
19typedef struct MR_Vector_MR_FaceBitSet_MR_GraphVertId MR_Vector_MR_FaceBitSet_MR_GraphVertId; // Defined in `#include <MRCMesh/MRVector.h>`.
20typedef struct MR_Vector_MR_GraphVertId_MR_GraphVertId MR_Vector_MR_GraphVertId_MR_GraphVertId; // Defined in `#include <MRCMesh/MRVector.h>`.
21typedef struct MR_Vector_int32_t_MR_FaceId MR_Vector_int32_t_MR_FaceId; // Defined in `#include <MRCMesh/MRVector.h>`.
22typedef struct MR_std_pair_MR_GraphEdgeId_float MR_std_pair_MR_GraphEdgeId_float; // Defined in `#include <MRCMisc/std_pair_MR_GraphEdgeId_float.h>`.
23typedef struct MR_std_vector_MR_WatershedGraph_OverflowPoint MR_std_vector_MR_WatershedGraph_OverflowPoint; // Defined in `#include <MRCMisc/std_vector_MR_WatershedGraph_OverflowPoint.h>`.
24
25
29
33
37
41
45
48
51
58
61
64
69
75
80
85
91
96
102
107
112
117
122
129
135
142
147
152
158
166
172
178
186
192
200
206
211
217
223
228
234
240
245
251
257
262
268
274
279
285
291
296
302
308
313
319
325
330
336
342
347
353
359
364
370
374
379
382
385
390
393
396
402
408
413
418
424
429
435
439
444
448
451
454
459
462
465
471
472// mesh vertex on the boundary of full basin and the other where it overflows
477
478// mesh vertex on the boundary of full basin and the other where it overflows
482
483// mesh vertex on the boundary of full basin and the other where it overflows
488
493
497
502
503// basin where the flow from v goes
508
509// basin where the flow from v goes
513
514// basin where the flow from v goes
519
523
528
532
535
538
543
546
549
555
556#ifdef __cplusplus
557} // extern "C"
558#endif
struct MR_FaceBitSet MR_FaceBitSet
Definition MRAABBTreeBase.h:25
struct MR_UndirectedEdgeBitSet MR_UndirectedEdgeBitSet
Definition MRAABBTreeBase.h:29
struct MR_Vector_MR_GraphVertId_MR_GraphVertId MR_Vector_MR_GraphVertId_MR_GraphVertId
Definition MRBitSet.h:33
struct MR_Mesh MR_Mesh
Definition MRCtm.h:13
struct MR_Graph MR_Graph
Definition MRGraph.h:24
struct MR_WatershedGraph MR_WatershedGraph
Definition MRPrecipitationSimulator.h:14
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:619
struct MR_WatershedGraph_BdInfo MR_WatershedGraph_BdInfo
Definition MRVector.h:41
struct MR_WatershedGraph_BasinInfo MR_WatershedGraph_BasinInfo
Definition MRVector.h:40
struct MR_Vector_int32_t_MR_FaceId MR_Vector_int32_t_MR_FaceId
std::vector<T>-like container that requires specific indexing type,
Definition MRVector.h:610
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 * MR_WatershedGraph_Construct(const MR_Mesh *mesh, const MR_Vector_int32_t_MR_FaceId *face2basin, int32_t numBasins)
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 int32_t MR_WatershedGraph_numBasins(const MR_WatershedGraph *_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:40
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 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:23
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:22
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 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:127
Definition MRId.h:117
Definition MRId.h:56