Rev 106 | Rev 110 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | |||
3 | Werner | 2 | #ifndef TREE_H |
3 | #define TREE_H |
||
4 | #include <QPointF> |
||
5 | |||
83 | Werner | 6 | #include "grid.h" |
3 | Werner | 7 | |
90 | Werner | 8 | class Species; |
38 | Werner | 9 | class Stamp; |
106 | Werner | 10 | class RessourceUnit; |
3 | Werner | 11 | |
12 | class Tree |
||
13 | { |
||
14 | public: |
||
15 | Tree(); |
||
106 | Werner | 16 | void setId(const int id) { mId=id;} |
17 | const int id() const { return mId; } |
||
18 | void setPosition(const QPointF pos) { mPosition=pos; } |
||
19 | const QPointF position() const { return mPosition; } |
||
3 | Werner | 20 | |
106 | Werner | 21 | void setDbh(const float dbh) { mDbh=dbh; } |
22 | const float dbh() const { return mDbh; } |
||
3 | Werner | 23 | |
106 | Werner | 24 | void setHeight(const float height) { mHeight=height; } |
25 | const float height() const { return mHeight; } |
||
3 | Werner | 26 | |
106 | Werner | 27 | const float lightRessourceIndex() const { return mLRI; } |
3 | Werner | 28 | |
106 | Werner | 29 | const Species* species() const { return mSpecies; } |
30 | void setSpecies(Species *ts) { mSpecies=ts; } |
||
31 | const RessourceUnit *ru() const { return mRU; } |
||
32 | void setRU(RessourceUnit *ru) { mRU = ru; } |
||
39 | Werner | 33 | |
38 | Werner | 34 | void setup(); |
35 | |||
106 | Werner | 36 | void enableDebugging() { mDebugid = mId; } |
58 | Werner | 37 | |
3 | Werner | 38 | |
107 | Werner | 39 | // grid based light-concurrency functions |
40 | void applyStamp(); ///< apply LightInfluencePattern onto the global grid |
||
40 | Werner | 41 | double readStamp(); |
107 | Werner | 42 | void readStampMul(); ///< calculate the lightRessourceIndex |
43 | void heightGrid(); ///< calculate the height grid |
||
39 | Werner | 44 | |
107 | Werner | 45 | // growth, etc. |
46 | void grow(); |
||
47 | |||
48 | // static functions |
||
49 | static void setGrid(FloatGrid* gridToStamp, FloatGrid *dominanceGrid) { mGrid = gridToStamp; mHeightGrid = dominanceGrid; } |
||
40 | Werner | 50 | // statistics |
51 | static void resetStatistics(); |
||
52 | static const int statPrints() { return m_statPrint; } |
||
106 | Werner | 53 | static const int statCreated() { return m_statCreated; } |
40 | Werner | 54 | |
53 | Werner | 55 | static float lafactor; |
58 | Werner | 56 | |
3 | Werner | 57 | private: |
107 | Werner | 58 | // state variables |
106 | Werner | 59 | int mId; |
60 | float mDbh; |
||
61 | float mHeight; |
||
62 | QPointF mPosition; |
||
107 | Werner | 63 | // biomass compartements |
64 | float mLeafArea; // m2 |
||
65 | |||
66 | float mLeafMass; // kg |
||
67 | float mStemMass; // kg |
||
68 | float mRootMass; // kg |
||
69 | |||
70 | |||
71 | float mLRI; // resulting lightRessourceIndex |
||
72 | // Stamp, Species, Ressource Unit |
||
106 | Werner | 73 | const Stamp *mStamp; |
74 | Species *mSpecies; |
||
75 | RessourceUnit *mRU; |
||
107 | Werner | 76 | |
77 | bool isDebugging() { return mId == mDebugid; } |
||
78 | // static data |
||
106 | Werner | 79 | static FloatGrid *mGrid; |
80 | static FloatGrid *mHeightGrid; |
||
58 | Werner | 81 | // debugging |
106 | Werner | 82 | static int mDebugid; |
53 | Werner | 83 | |
40 | Werner | 84 | // statistics |
85 | static int m_statPrint; |
||
48 | Werner | 86 | static int m_statAboveZ; |
105 | Werner | 87 | static int m_statCreated; |
40 | Werner | 88 | static int m_nextId; |
3 | Werner | 89 | }; |
90 | |||
91 | #endif // TREE_H |