iLand
barkbeetleplugin.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 BARKBEETLEPLUGIN_H
21#define BARKBEETLEPLUGIN_H
22
23#include <QObject>
24#include "barkbeetlemodule.h"
25
26#include "plugin_interface.h"
27class BarkBeetlePlugin: public QObject,
31{
32 Q_OBJECT
33 #if QT_VERSION >= 0x050000
34 Q_PLUGIN_METADATA(IID "at.ac.boku.iland.barkbeetleplugin" FILE "barkbeetleplugin.json")
35 #endif
37
38
39public:
41 // general interface details
42 QString name();
43 QString version();
44 QString description();
45
46 // setup
48 void setup();
50 void setupResourceUnit(const ResourceUnit *ru) { mBeetle.setup(ru);}
52 void setupScripting(QJSEngine *engine);
53
55 void treeDeath(const Tree *tree, const int removal_type) { Q_UNUSED(removal_type); mBeetle.treeDeath(tree); }
56
57 // calculations
58 void yearBegin() { mBeetle.yearBegin(); }
59 void run() { mBeetle.run(); }
60
61 // special functions for direct access (testing)
62 BarkBeetleModule *barkBeetleModule() { return &mBeetle; }
63private:
64 BarkBeetleModule mBeetle;
65};
66
67#endif // BARKBEETLEPLUGIN_H
The BarkBeetleModule class is the main class of the bark beetle module.
Definition: barkbeetlemodule.h:135
void run(int iteration=0)
main function to execute the bark beetle module (iteration can be non-0 when called from Javascript)
Definition: barkbeetlemodule.cpp:222
void setup()
general setup
Definition: barkbeetlemodule.cpp:69
void yearBegin()
called automatically
Definition: barkbeetlemodule.cpp:362
void treeDeath(const Tree *tree)
function that is called whenever a tree dies somewhere in iLand
Definition: barkbeetlemodule.cpp:265
Definition: barkbeetleplugin.h:31
BarkBeetlePlugin()
Definition: barkbeetleplugin.cpp:52
BarkBeetleModule * barkBeetleModule()
Definition: barkbeetleplugin.h:62
void setup()
setup after the main iLand model frame is created
Definition: barkbeetleplugin.cpp:61
void setupResourceUnit(const ResourceUnit *ru)
setup resource unit specific parameters
Definition: barkbeetleplugin.h:50
QString name()
a unique name of the plugin
Definition: barkbeetleplugin.cpp:36
void setupScripting(QJSEngine *engine)
setup additional javascript related features
Definition: barkbeetleplugin.cpp:75
void treeDeath(const Tree *tree, const int removal_type)
function is called whenever a tree dies in iLand (in order to track storm damage)
Definition: barkbeetleplugin.h:55
QString description()
some additional description. This info is shown in the GUI and is printed to the log file.
Definition: barkbeetleplugin.cpp:46
void run()
main function that once a year (after growth)
Definition: barkbeetleplugin.h:59
QString version()
a version identification
Definition: barkbeetleplugin.cpp:41
void yearBegin()
function executes at the beginning of a year (e.g., cleanup)
Definition: barkbeetleplugin.h:58
Definition: plugin_interface.h:35
ResourceUnit is the spatial unit that encapsulates a forest stand and links to several environmental ...
Definition: resourceunit.h:49
Definition: plugin_interface.h:52
Definition: plugin_interface.h:80
A tree is the basic simulation entity of iLand and represents a single tree.
Definition: tree.h:44