MeshLib
 
Loading...
Searching...
No Matches
MRPrecipitationSimulator.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRId.h"
4#include "MRHeap.h"
5#include <cfloat>
6
7namespace MR
8{
9
12{
13public:
16
17 enum class Event
18 {
19 Finish,
20 BasinFull,
21 Merge
22 };
23
25 {
27 float amount = FLT_MAX;
28 GraphVertId basin;
30 GraphVertId neiBasin;
32 };
33
36
37private:
38 WatershedGraph& wg_;
40};
41
42} //namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
stores map from element id in[0, size) to T;
Definition MRMesh/MRMeshFwd.h:462
the class models water increase in the terrain under the rain with constant precipitation
Definition MRPrecipitationSimulator.h:12
MRMESH_API SimulationStep simulateOne()
processes the next event happened with the terrain basins
Event
Definition MRPrecipitationSimulator.h:18
@ Merge
two basins just merged
@ BasinFull
one basin just became full
@ Finish
all basins are full and water goes outside
MRMESH_API PrecipitationSimulator(WatershedGraph &wg)
initializes modeling from the initial subdivision of the terrain
graphs representing rain basins on the mesh
Definition MRWatershedGraph.h:12
Definition MRCameraOrientationPlugin.h:7
Definition MRPrecipitationSimulator.h:25
GraphVertId neiBasin
Definition MRPrecipitationSimulator.h:30
float amount
amount of precipitation (in same units as mesh coordinates and water level)
Definition MRPrecipitationSimulator.h:27
GraphVertId basin
Definition MRPrecipitationSimulator.h:28