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 m_changeRate = rate;
45 }
46
53 return m_changeRate;
54 }
55
61 double* GetAmountPointer() {
62 return &m_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 m_static = true;
88 }
89
95 bool IsStatic() {
96 return m_static;
97 }
98
105 return m_needsWeighting;
106 }
107
113 void NeedsWeighting(bool value) {
114 m_needsWeighting = value;
115 }
116
122 void SetFractionUnitArea(double value) {
123 m_fractionUnitArea = value;
125 }
126
132 void SetFractionLandCover(double value) {
133 m_fractionLandCover = value;
135 }
136
141 m_fractionTotal = m_fractionUnitArea * m_fractionLandCover;
142 }
143
149 string GetType() {
150 return m_type;
151 }
152
158 void SetType(const string& type) {
159 m_type = type;
160 }
161
162 protected:
163 double m_amount;
164 double* m_changeRate;
165 bool m_static;
166 bool m_needsWeighting;
167 double m_fractionUnitArea;
168 double m_fractionLandCover;
169 double m_fractionTotal;
170 Modifier* m_modifier;
171 string m_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