13 Q_PROPERTY(
double x READ
x)
14 Q_PROPERTY(
double y READ
y)
15 Q_PROPERTY(
double dbh READ
dbh)
31 explicit ScriptTree(QObject *parent =
nullptr);
34 void clear() { mTree =
nullptr; }
36 bool valid()
const {
return mTree !=
nullptr; }
37 double x()
const {
return mTree ? mTree->
position().x() : -1.; }
38 double y()
const {
return mTree ? mTree->
position().y() : -1; }
39 double dbh()
const {
return mTree ?
static_cast<double>(mTree->
dbh()) : -1.; }
40 double height()
const {
return mTree ?
static_cast<double>(mTree->
height()) : -1.; }
41 QString
species()
const {
return mTree ? mTree->
species()->
id() : QStringLiteral(
"invalid"); }
42 int flags()
const {
return mTree ? mTree->flags() : 0; }
48 double expr(QString expr_str);
An expression engine for mathematical expressions provided as strings.
Definition: expression.h:29
void setModelObject(ExpressionWrapper *wrapper)
Definition: expression.h:38
void setExpression(const QString &aExpression)
set expression
Definition: expression.cpp:200
const QString & expression() const
Definition: expression.h:39
Definition: scripttree.h:56
Q_INVOKABLE ScriptTreeExpr(QString expr)
Definition: scripttree.cpp:46
void setExpression(QString expr)
Definition: scripttree.h:64
double value(ScriptTree *script_tree)
Definition: scripttree.cpp:57
QString expression
Definition: scripttree.h:58
QString expression()
Definition: scripttree.h:63
static void addToScriptEngine(QJSEngine &engine)
Definition: scripttree.cpp:51
Definition: scripttree.h:10
double x() const
Definition: scripttree.h:37
double y() const
Definition: scripttree.h:38
double expr(QString expr_str)
Definition: scripttree.cpp:29
bool valid() const
Definition: scripttree.h:36
ScriptTree(QObject *parent=nullptr)
Definition: scripttree.cpp:15
double dbh
Definition: scripttree.h:15
static void addToScriptEngine(QJSEngine &engine)
Definition: scripttree.cpp:8
void setTree(Tree *t)
Definition: scripttree.h:32
bool valid
Definition: scripttree.h:12
double height
Definition: scripttree.h:16
QString species
Definition: scripttree.h:17
double height() const
Definition: scripttree.h:40
double x
Definition: scripttree.h:13
QString species() const
Definition: scripttree.h:41
double y
Definition: scripttree.h:14
int flags
Definition: scripttree.h:18
QString info()
Definition: scripttree.cpp:20
TreeRemovalType
Definition: scripttree.h:20
@ RemovedDeath
Definition: scripttree.h:20
@ RemovedCutDown
Definition: scripttree.h:20
@ RemovedHarvest
Definition: scripttree.h:20
@ RemovedKilled
Definition: scripttree.h:20
@ RemovedSalavaged
Definition: scripttree.h:20
@ RemovedDisturbance
Definition: scripttree.h:20
void clear()
Definition: scripttree.h:34
int flags() const
Definition: scripttree.h:42
const Tree * tree()
Definition: scripttree.h:33
Flags
Definition: scripttree.h:24
@ TreeDead
Definition: scripttree.h:24
@ TreeHarvested
Definition: scripttree.h:25
@ TreeDeadFire
Definition: scripttree.h:25
@ TreeDeadKillAndDrop
Definition: scripttree.h:25
@ TreeDeadWind
Definition: scripttree.h:25
@ TreeDeadBarkBeetle
Definition: scripttree.h:25
@ TreeAffectedBite
Definition: scripttree.h:26
double dbh() const
Definition: scripttree.h:39
const QString & id() const
Definition: species.h:87
A tree is the basic simulation entity of iLand and represents a single tree.
Definition: tree.h:44
const QPointF position() const
metric coordinates of the tree
Definition: tree.h:54
float height() const
tree height in m
Definition: tree.h:63
const Species * species() const
pointer to the tree species of the tree.
Definition: tree.h:58
float dbh() const
dimater at breast height in cm
Definition: tree.h:62
Definition: expressionwrapper.h:42