hydrobricks
Loading...
Searching...
No Matches
Flux.h
1#ifndef HYDROBRICKS_FLUX_H
2#define HYDROBRICKS_FLUX_H
3
4#include "Includes.h"
5
6class Modifier;
7
8class Flux : public wxObject {
9 public:
10 explicit Flux();
11
17 virtual bool IsOk() = 0;
18
22 virtual void Reset();
23
29 virtual double GetAmount() = 0;
30
36 virtual void UpdateFlux(double amount);
37
43 void LinkChangeRate(double* rate) {
44 _changeRate = rate;
45 }
46
53 return _changeRate;
54 }
55
61 double* GetAmountPointer() {
62 return &_amount;
63 }
64
70 virtual bool IsForcing() {
71 return false;
72 }
73
79 virtual bool IsInstantaneous() {
80 return false;
81 }
82
86 void SetAsStatic() {
87 _static = true;
88 }
89
95 bool IsStatic() {
96 return _static;
97 }
98
105 return _needsWeighting;
106 }
107
113 void NeedsWeighting(bool value) {
114 _needsWeighting = value;
115 }
116
122 void SetFractionUnitArea(double value) {
123 _fractionUnitArea = value;
125 }
126
132 void SetFractionLandCover(double value) {
133 _fractionLandCover = value;
135 }
136
141 _fractionTotal = _fractionUnitArea * _fractionLandCover;
142 }
143
149 string GetType() {
150 return _type;
151 }
152
158 void SetType(const string& type) {
159 _type = type;
160 }
161
162 protected:
163 double _amount;
164 double* _changeRate;
165 bool _static;
166 bool _needsWeighting;
167 double _fractionUnitArea;
168 double _fractionLandCover;
169 double _fractionTotal;
170 Modifier* _modifier;
171 string _type;
172};
173
174#endif // HYDROBRICKS_FLUX_H
Definition Flux.h:8
void LinkChangeRate(double *rate)
Definition Flux.h:43
virtual void Reset()
Definition Flux.cpp:16
virtual void UpdateFlux(double amount)
Definition Flux.cpp:20
bool IsStatic()
Definition Flux.h:95
void SetType(const string &type)
Definition Flux.h:158
virtual bool IsOk()=0
double * GetChangeRatePointer()
Definition Flux.h:52
double * GetAmountPointer()
Definition Flux.h:61
void SetFractionLandCover(double value)
Definition Flux.h:132
virtual bool IsInstantaneous()
Definition Flux.h:79
void SetFractionUnitArea(double value)
Definition Flux.h:122
string GetType()
Definition Flux.h:149
virtual bool IsForcing()
Definition Flux.h:70
void UpdateFractionTotal()
Definition Flux.h:140
bool NeedsWeighting()
Definition Flux.h:104
void SetAsStatic()
Definition Flux.h:86
virtual double GetAmount()=0
void NeedsWeighting(bool value)
Definition Flux.h:113
Definition Modifier.h:6