hydrobricks
Loading...
Searching...
No Matches
HydroUnit.h
1#ifndef HYDROBRICKS_HYDRO_UNIT_H
2#define HYDROBRICKS_HYDRO_UNIT_H
3
4#include "Brick.h"
5#include "Forcing.h"
6#include "HydroUnitProperty.h"
7#include "Includes.h"
8#include "LandCover.h"
9#include "Splitter.h"
10
12
13class HydroUnit : public wxObject {
14 public:
15 enum Types {
16 Distributed,
17 SemiDistributed,
18 Lumped,
19 Undefined
20 };
21
22 HydroUnit(double area = UNDEFINED, Types type = Undefined);
23
24 ~HydroUnit() override;
25
26 void Reset();
27
28 void SaveAsInitialState();
29
30 void SetProperties(HydroUnitSettings& unitSettings);
31
32 void AddProperty(HydroUnitProperty* property);
33
34 double GetPropertyDouble(const string& name, const string& unit = "");
35
36 string GetPropertyString(const string& name);
37
38 void AddBrick(Brick* brick);
39
40 void AddSplitter(Splitter* splitter);
41
42 bool HasForcing(VariableType type);
43
44 void AddForcing(Forcing* forcing);
45
46 Forcing* GetForcing(VariableType type);
47
48 int GetBricksCount();
49
50 int GetSplittersCount();
51
52 Brick* GetBrick(int index);
53
54 bool HasBrick(const string& name);
55
56 Brick* GetBrick(const string& name);
57
58 LandCover* GetLandCover(const string& name);
59
60 Splitter* GetSplitter(int index);
61
62 bool HasSplitter(const string& name);
63
64 Splitter* GetSplitter(const string& name);
65
66 bool IsOk();
67
68 bool ChangeLandCoverAreaFraction(const string& name, double fraction);
69
70 bool FixLandCoverFractionsTotal();
71
72 Types GetType() {
73 return m_type;
74 }
75
76 void SetId(int id) {
77 m_id = id;
78 }
79
80 double GetArea() const {
81 return m_area;
82 }
83
84 int GetId() const {
85 return m_id;
86 }
87
88 protected:
89 Types m_type;
90 int m_id;
91 double m_area; // m2
92 vector<HydroUnitProperty*> m_properties;
93 vector<Brick*> m_bricks;
94 vector<LandCover*> m_landCoverBricks;
95 vector<Splitter*> m_splitters;
96 vector<Forcing*> m_forcing;
97
98 private:
99};
100
101#endif
Definition Brick.h:10
Definition Forcing.h:7
Definition HydroUnitProperty.h:6
Definition HydroUnit.h:13
Definition LandCover.h:10
Definition Splitter.h:11
Definition SettingsBasin.h:30