hydrobricks
Loading...
Searching...
No Matches
Flux.h
1#ifndef HYDROBRICKS_FLUX_H
2#define HYDROBRICKS_FLUX_H
3
4#include "../base/ContentTypes.h"
5#include "Includes.h"
6
7class Modifier;
8
9class Flux : public wxObject {
10 public:
11 explicit Flux();
12
18 [[nodiscard]] virtual bool IsOk() = 0;
19
23 virtual void Reset();
24
30 virtual double GetAmount() = 0;
31
37 virtual void UpdateFlux(double amount);
38
44 void LinkChangeRate(double* rate) {
45 _changeRate = rate;
46 }
47
54 return _changeRate;
55 }
56
62 double* GetAmountPointer() {
63 return &_amount;
64 }
65
71 virtual bool IsForcing() {
72 return false;
73 }
74
80 virtual bool IsInstantaneous() {
81 return false;
82 }
83
87 void SetAsStatic() {
88 _static = true;
89 }
90
96 [[nodiscard]] bool IsStatic() const {
97 return _static;
98 }
99
105 [[nodiscard]] bool NeedsWeighting() const {
106 return _needsWeighting;
107 }
108
114 void NeedsWeighting(bool value) {
115 _needsWeighting = value;
116 }
117
123 void SetFractionUnitArea(double value) {
124 _fractionUnitArea = value;
126 }
127
133 void SetFractionLandCover(double value) {
134 _fractionLandCover = value;
136 }
137
142 _fractionTotal = _fractionUnitArea * _fractionLandCover;
143 }
144
150 ContentType GetType() const {
151 return _type;
152 }
153
159 void SetType(const ContentType type) {
160 _type = type;
161 }
162
163 protected:
164 double _amount{};
165 double* _changeRate{};
166 bool _static{};
167 bool _needsWeighting{};
168 double _fractionUnitArea{1.0};
169 double _fractionLandCover{1.0};
170 double _fractionTotal{1.0};
171 Modifier* _modifier{};
172 ContentType _type{ContentType::Water};
173};
174
175#endif // HYDROBRICKS_FLUX_H
Definition Flux.h:9
bool NeedsWeighting() const
Definition Flux.h:105
void LinkChangeRate(double *rate)
Definition Flux.h:44
virtual void Reset()
Definition Flux.cpp:16
virtual void UpdateFlux(double amount)
Definition Flux.cpp:20
virtual bool IsOk()=0
double * GetChangeRatePointer()
Definition Flux.h:53
double * GetAmountPointer()
Definition Flux.h:62
void SetFractionLandCover(double value)
Definition Flux.h:133
virtual bool IsInstantaneous()
Definition Flux.h:80
ContentType GetType() const
Definition Flux.h:150
void SetType(const ContentType type)
Definition Flux.h:159
bool IsStatic() const
Definition Flux.h:96
void SetFractionUnitArea(double value)
Definition Flux.h:123
virtual bool IsForcing()
Definition Flux.h:71
void UpdateFractionTotal()
Definition Flux.h:141
void SetAsStatic()
Definition Flux.h:87
virtual double GetAmount()=0
void NeedsWeighting(bool value)
Definition Flux.h:114
Definition Modifier.h:6