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