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
19 virtual void Reset();
20
26 virtual double GetAmount() = 0;
27
33 virtual void UpdateFlux(double amount);
34
35 void LinkChangeRate(double* rate) {
36 m_changeRate = rate;
37 }
38
39 double* GetChangeRatePointer() {
40 return m_changeRate;
41 }
42
43 double* GetAmountPointer() {
44 return &m_amount;
45 }
46
47 virtual bool IsForcing() {
48 return false;
49 }
50
51 virtual bool IsInstantaneous() {
52 return false;
53 }
54
55 void SetAsStatic() {
56 m_static = true;
57 }
58
59 bool IsStatic() {
60 return m_static;
61 }
62
63 bool NeedsWeighting() {
64 return m_needsWeighting;
65 }
66
67 void NeedsWeighting(bool value) {
68 m_needsWeighting = value;
69 }
70
71 void SetFractionUnitArea(double value) {
72 m_fractionUnitArea = value;
73 UpdateFractionTotal();
74 }
75
76 void SetFractionLandCover(double value) {
77 m_fractionLandCover = value;
78 UpdateFractionTotal();
79 }
80
81 void UpdateFractionTotal() {
82 m_fractionTotal = m_fractionUnitArea * m_fractionLandCover;
83 }
84
85 string GetType() {
86 return m_type;
87 }
88
89 void SetType(const string& type) {
90 m_type = type;
91 }
92
93 protected:
94 double m_amount;
95 double* m_changeRate;
96 bool m_static;
97 bool m_needsWeighting;
98 double m_fractionUnitArea;
99 double m_fractionLandCover;
100 double m_fractionTotal;
101 Modifier* m_modifier;
102 string m_type;
103
104 private:
105};
106
107#endif // HYDROBRICKS_FLUX_H
Definition Flux.h:8
virtual void UpdateFlux(double amount)
Definition Flux.cpp:20
virtual bool IsOk()=0
virtual double GetAmount()=0
Definition Modifier.h:6