iLand
fmsaplinglist.h
Go to the documentation of this file.
1#ifndef FMSAPLINGLIST_H
2#define FMSAPLINGLIST_H
3
4#include <QObject>
5
6#include "saplings.h"
7
8namespace ABE {
9
10
11class FMSaplingList : public QObject
12{
13 Q_OBJECT
14 Q_PROPERTY(int count READ length)
15public:
16 explicit FMSaplingList(QObject *parent = nullptr);
17 QVector<QPair<SaplingTree*, SaplingCell*> > &saplings() { return mSaplings; }
18 int length() { return mSaplings.length(); }
19
20
22 int loadFromRect(ResourceUnit *ru, const QRectF &rect);
24 int loadFromRU(ResourceUnit *ru, bool append=false);
25
26 // to load from a stand: see e.g. FMTreeList::aggregate_function_sapling(QString expression, QString filter, QString type) and SaplingCellRunner....
27
28signals:
29
30public slots:
33 double sum(QString expression, QString filter=QLatin1Literal(""));
34
37 int filter(QString filter);
38
41 int kill(QString filter = QLatin1Literal(""));
42
44 int browse(bool do_browse=true);
45
46private:
47 QVector<QPair<SaplingTree*, SaplingCell*> > mSaplings;
48};
49
50}; // end namespace
51
52#endif // FMSAPLINGLIST_H
Definition: fmsaplinglist.h:12
int filter(QString filter)
apply a filter on the current list of saplings.
Definition: fmsaplinglist.cpp:48
int count
Definition: fmsaplinglist.h:14
double sum(QString expression, QString filter=QLatin1Literal(""))
return the sum of 'expression' over all saplings in the list if 'filter' is provided,...
Definition: fmsaplinglist.cpp:95
int loadFromRU(ResourceUnit *ru, bool append=false)
load all saplings from RU
Definition: fmsaplinglist.cpp:32
int length()
Definition: fmsaplinglist.h:18
FMSaplingList(QObject *parent=nullptr)
Definition: fmsaplinglist.cpp:8
int loadFromRect(ResourceUnit *ru, const QRectF &rect)
load saplings from a portion of a RU
Definition: fmsaplinglist.cpp:13
int kill(QString filter=QLatin1Literal(""))
kill all saplings in the list for which "filter" evaluates to true (or all if filter is omitted) retu...
Definition: fmsaplinglist.cpp:70
QVector< QPair< SaplingTree *, SaplingCell * > > & saplings()
Definition: fmsaplinglist.h:17
int browse(bool do_browse=true)
affect all saplings by browsing -> this reduces the height growth in the current year to 0
Definition: fmsaplinglist.cpp:87
ResourceUnit is the spatial unit that encapsulates a forest stand and links to several environmental ...
Definition: resourceunit.h:49
Definition: abegrid.h:22