Subversion Repositories public iLand

Rev

Rev 1033 | Rev 1104 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1
 
1033 werner 2
/********************************************************************************************
3
**    iLand - an individual based forest landscape and disturbance model
4
**    http://iland.boku.ac.at
5
**    Copyright (C) 2009-  Werner Rammer, Rupert Seidl
6
**
7
**    This program is free software: you can redistribute it and/or modify
8
**    it under the terms of the GNU General Public License as published by
9
**    the Free Software Foundation, either version 3 of the License, or
10
**    (at your option) any later version.
11
**
12
**    This program is distributed in the hope that it will be useful,
13
**    but WITHOUT ANY WARRANTY; without even the implied warranty of
14
**    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
**    GNU General Public License for more details.
16
**
17
**    You should have received a copy of the GNU General Public License
18
**    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
********************************************************************************************/
909 werner 20
#ifndef ABEGRID_H
21
#define ABEGRID_H
873 werner 22
#include "layeredgrid.h"
905 werner 23
namespace ABE {
873 werner 24
class FMStand; // forward
939 werner 25
class Agent; // forward
873 werner 26
}
27
 
909 werner 28
/** Helper class for visualizing ABE management data.
873 werner 29
*/
905 werner 30
typedef ABE::FMStand* FMStandPtr;
909 werner 31
class ABELayers: public LayeredGrid<FMStandPtr> {
873 werner 32
  public:
909 werner 33
    ~ABELayers();
873 werner 34
    void setGrid(Grid<FMStandPtr> &grid) { mGrid = &grid; }
35
    double value(const FMStandPtr &data, const int index) const;
1014 werner 36
    const QVector<LayeredGridBase::LayerElement> &names();
877 werner 37
    const QString labelvalue(const int value, const int index) const;
873 werner 38
    void registerLayers();
877 werner 39
    void clearClasses(); // clear ID and agent classes...
873 werner 40
private:
1014 werner 41
    QVector<LayeredGridBase::LayerElement> mNames;
939 werner 42
    mutable QHash<const ABE::Agent*, int > mAgentIndex;
877 werner 43
    mutable QHash<QString, int> mUnitIndex;
44
    mutable QHash<int, int> mStandIndex;
1058 werner 45
    mutable QHash<QString, int> mSTPIndex;
873 werner 46
};
47
 
939 werner 48
 
49
 
909 werner 50
#endif // ABEGRID_H