iLand
abegrid.h
Go to the documentation of this file.
1/********************************************************************************************
2** iLand - an individual based forest landscape and disturbance model
3** http://iland-model.org
4** Copyright (C) 2009- Werner Rammer, Rupert Seidl
5**
6** This program is free software: you can redistribute it and/or modify
7** it under the terms of the GNU General Public License as published by
8** the Free Software Foundation, either version 3 of the License, or
9** (at your option) any later version.
10**
11** This program is distributed in the hope that it will be useful,
12** but WITHOUT ANY WARRANTY; without even the implied warranty of
13** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14** GNU General Public License for more details.
15**
16** You should have received a copy of the GNU General Public License
17** along with this program. If not, see <http://www.gnu.org/licenses/>.
18********************************************************************************************/
19#ifndef ABEGRID_H
20#define ABEGRID_H
21#include "layeredgrid.h"
22namespace ABE {
23class FMStand; // forward
24class Agent; // forward
25}
26
30class ABELayers: public LayeredGrid<FMStandPtr> {
31 public:
32 ~ABELayers();
33 void setGrid(Grid<FMStandPtr> &grid) { mGrid = &grid; }
34 double value(const FMStandPtr &data, const int index) const;
35 const QVector<LayeredGridBase::LayerElement> &names();
36 const QString labelvalue(const int value, const int index) const;
37 void registerLayers();
38 void clearClasses(); // clear ID and agent classes...
39private:
40 QVector<LayeredGridBase::LayerElement> mNames;
41 mutable QHash<const ABE::Agent*, int > mAgentIndex;
42 mutable QHash<QString, int> mUnitIndex;
43 mutable QHash<int, int> mStandIndex;
44 mutable QHash<QString, int> mSTPIndex;
45 mutable QHash<QString, int> mActivityIndex;
46};
47
48
49
50#endif // ABEGRID_H
ABE::FMStand * FMStandPtr
Helper class for visualizing ABE management data.
Definition: abegrid.h:29
The Agent is the core element of the agent based forest management model and simulates a foresters de...
Definition: agent.h:35
FMStand encapsulates a forest stand for the forest management engine.
Definition: fmstand.h:49
ABELayers is a helper class for spatial visualization of ABE data.
Definition: abegrid.h:30
void clearClasses()
Definition: abegrid.cpp:127
void registerLayers()
Definition: abegrid.cpp:122
void setGrid(Grid< FMStandPtr > &grid)
Definition: abegrid.h:33
double value(const FMStandPtr &data, const int index) const
Definition: abegrid.cpp:43
~ABELayers()
Definition: abegrid.cpp:38
const QString labelvalue(const int value, const int index) const
Definition: abegrid.cpp:105
const QVector< LayeredGridBase::LayerElement > & names()
list of stored layers
Definition: abegrid.cpp:83
Grid class (template).
Definition: grid.h:44
This is the base class for multi-layer grids in iLand.
Definition: layeredgrid.h:95
const Grid< FMStandPtr > * mGrid
Definition: layeredgrid.h:130
Definition: abegrid.h:22