iLand
windscript.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 WINDSCRIPT_H
21#define WINDSCRIPT_H
22
23#include <QObject>
24#include <QJSValue>
25
26class WindModule; // forward
27
28class WindScript : public QObject
29{
30 Q_OBJECT
31public:
32 explicit WindScript(QObject *parent = 0);
33 void setModule(WindModule *module) { mModule = module; }
34signals:
35
36public slots:
44 int windEvent(double windspeed, double winddirection, int max_iteration, bool simulate=false, int iteration=-1);
46 bool gridToFile(QString grid_type, QString file_name);
48 QJSValue grid(QString type);
50 void initialize();
52 void initializeEdgeAge(int years);
53
55 int damagedArea(int threshold, QString fileName);
56
57private:
58 WindModule *mModule;
59};
60
61#endif // WINDSCRIPT_H
The WindModule is the main object of the iLand wind module.
Definition: windmodule.h:95
Definition: windscript.h:29
void initialize()
initialize/ reset the wind module
Definition: windscript.cpp:79
WindScript(QObject *parent=0)
Definition: windscript.cpp:26
void setModule(WindModule *module)
Definition: windscript.h:33
bool gridToFile(QString grid_type, QString file_name)
create a "ESRI-grid" text file 'grid_type' is one of a fixed list of names, 'file_name' the ouptut fi...
Definition: windscript.cpp:47
int damagedArea(int threshold, QString fileName)
number of damaged pixels with a patchsize>'threshold'; save to grid to "fileName" (if not empty)
Definition: windscript.cpp:97
int windEvent(double windspeed, double winddirection, int max_iteration, bool simulate=false, int iteration=-1)
trigger a wind event from javascript.
Definition: windscript.cpp:32
QJSValue grid(QString type)
returns a ScriptGrid with the requested type
Definition: windscript.cpp:66
void initializeEdgeAge(int years)
initialize/reset the age of edges
Definition: windscript.cpp:85