Rev 1104 | Rev 1217 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1104 | Rev 1157 | ||
---|---|---|---|
Line 59... | Line 59... | ||
59 | double cover(const grass_grid_type &data) const {return mType == Pixel? data : data/double(GRASSCOVERSTEPS-1); } |
59 | double cover(const grass_grid_type &data) const {return mType == Pixel? data : data/double(GRASSCOVERSTEPS-1); } |
60 | 60 | ||
61 | 61 | ||
62 | /// main function
|
62 | /// main function
|
63 | double regenerationInhibition(QPoint &lif_index) const { |
63 | double regenerationInhibition(QPoint &lif_index) const { |
- | 64 | ||
64 | if (mType==Pixel) |
65 | if (mType==Pixel) |
65 | return mGrid.constValueAtIndex(lif_index)>0 ? 1. : 0.; |
- | |
66 | return mEnabled?effect(mGrid.constValueAtIndex(lif_index)) : 0.; } |
- | |
- | 66 | // -1: off, out of project area, 0: off, ready to get grassy again, 1: off (waiting for LIF threshold), >1 on, counting down
|
|
- | 67 | return mGrid.constValueAtIndex(lif_index)>1 ? 1. : 0.; |
|
- | 68 | ||
- | 69 | // type continuous
|
|
- | 70 | return mEnabled?effect(mGrid.constValueAtIndex(lif_index)) : 0.; |
|
- | 71 | }
|
|
67 | 72 | ||
68 | /// retrieve the grid of current grass cover
|
73 | /// retrieve the grid of current grass cover
|
69 | const Grid<grass_grid_type> &grid() { return mGrid; } |
74 | const Grid<grass_grid_type> &grid() { return mGrid; } |
70 | private: |
75 | private: |
71 | enum GrassAlgorithmType { Invalid, Continuous, Pixel }; |
76 | enum GrassAlgorithmType { Invalid, Continuous, Pixel }; |