Subversion Repositories public iLand

Rev

Rev 1221 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
674 werner 1
/********************************************************************************************
2
**    iLand - an individual based forest landscape and disturbance model
3
**    http://iland.boku.ac.at
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 FIRESCRIPT_H
20
#define FIRESCRIPT_H
21
 
22
#include <QObject>
23
class FireModule; // forward
24
class FireScript : public QObject
25
{
26
    Q_OBJECT
766 werner 27
    Q_PROPERTY(int id READ id)
28
    Q_PROPERTY(int x READ x)
29
    Q_PROPERTY(int y READ y)
696 werner 30
 
674 werner 31
public:
32
    explicit FireScript(QObject *parent = 0);
33
    void setFireModule(FireModule *module) { mFire = module; }
696 werner 34
    int id() const; ///< the id of the last ignited fire during the simulation
757 werner 35
    double x() const; ///< the x-coordinate of the last ignition
36
    double y() const; ///< the x-coordinate of the last ignition
802 werner 37
    static QString fireRUValueType; // for the exporter
674 werner 38
signals:
39
 
40
public slots:
41
/**    Ignite a fire event with pre-defined properties, i.e. at a given location (parameters x_meter, y_meter) with given conditions (i.e. wind direction and speed). The fire size (as taken from the distribution)
42
    x_meter, y_meter: metric coordinates of the ignition point in the landscape
43
    firesize: provide a fire size (m2). The fire size will be drawn from the fire size distribution if firesize=-1 or omitted.
44
    windspeed: wind speed (m/s), drawn randomly if omitted or -1.
45
    winddirection: wind direction (0°=N..180°=S..270=W°), drawn randomly if omitted or set to -1.
46
    Returns the burnt area */
47
    double ignite(double x, double y, double firesize=-1, double windspeed=-1, double winddirection=-1);
680 werner 48
    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 file location
49
 
674 werner 50
private:
51
    FireModule *mFire;
802 werner 52
 
674 werner 53
};
54
 
55
#endif // FIRESCRIPT_H