iLand
environment.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
20#ifndef ENVIRONMENT_H
21#define ENVIRONMENT_H
22#include <QtCore>
23
24class Climate;
25class SpeciesSet;
26class CSVFile;
27class GisGrid;
28
34{
35public:
38 bool isSetup() const { return mInfile!=0; }
40 bool setGridMode(const QString &grid_file_name);
41 // setup
42 void setDefaultValues(Climate *climate, SpeciesSet *speciesSet) {mCurrentClimate=climate; mCurrentSpeciesSet=speciesSet; }
43 bool loadFromString(const QString &source);
44 bool loadFromFile(const QString &fileName);
45 QList<Climate*> climateList() const { return mClimate; }
46 QList<SpeciesSet*> speciesSetList() const { return mSpeciesSets; }
47 // access
48 void setPosition(const QPointF position);
49 Climate *climate() const { return mCurrentClimate;}
50 SpeciesSet *speciesSet() const {return mCurrentSpeciesSet;}
51 int currentID() const { return mCurrentID; }
52
53private:
54 bool mGridMode;
55 int mCurrentID;
56 Climate *mCurrentClimate;
57 SpeciesSet *mCurrentSpeciesSet;
58 QList<Climate*> mClimate;
59 QList<SpeciesSet*> mSpeciesSets;
60 QStringList mKeys;
61 QHash<QString, int> mRowCoordinates;
62 QHash<QString, void*> mCreatedObjects;
63 CSVFile *mInfile;
64 GisGrid *mGrid;
65
66};
67
68#endif // ENVIRONMENT_H
Provides access to table data stored in text files (CSV style).
Definition: csvfile.h:27
Climate handles climate input data and performs some basic related calculations on that data.
Definition: climate.h:66
Environment specifes the geographical properties of the landscape.
Definition: environment.h:34
bool isSetup() const
Definition: environment.h:38
bool loadFromString(const QString &source)
Definition: environment.cpp:66
bool setGridMode(const QString &grid_file_name)
switch to 'grid-mode': load the grid provided by grid_file_name
Definition: environment.cpp:244
QList< Climate * > climateList() const
created climates.
Definition: environment.h:45
bool loadFromFile(const QString &fileName)
Definition: environment.cpp:54
~Environment()
Definition: environment.cpp:45
void setPosition(const QPointF position)
set position (metric coordinates). Subsequent calls to retriever functions are for the current locati...
Definition: environment.cpp:177
Climate * climate() const
get climate at current pos
Definition: environment.h:49
SpeciesSet * speciesSet() const
get species set on current pos
Definition: environment.h:50
int currentID() const
current grid id (in grid mode the id of the stand grid, in matrix mode simply the an autogenerated in...
Definition: environment.h:51
void setDefaultValues(Climate *climate, SpeciesSet *speciesSet)
Definition: environment.h:42
QList< SpeciesSet * > speciesSetList() const
created species sets
Definition: environment.h:46
GisGrid encapsulates a simple grid of values based on GIS data.
Definition: gisgrid.h:68
A SpeciesSet acts as a container for individual Species objects.
Definition: speciesset.h:30
Environment()
Represents the input of various variables with regard to climate, soil properties and more.
Definition: environment.cpp:36