iLand
|
The FMTreeList class implements low-level functionality for selecting and harvesting of trees. More...
#include <fmtreelist.h>
Public Slots | |
int | loadAll () |
load all trees of the stand, return number of trees (living trees) More... | |
int | load (const QString &filter) |
load all trees passing the filter, return number of trees (load only living trees) More... | |
int | filter (QString filter) |
apply a filter on the current tree list. More... | |
int | spatialFilter (QJSValue grid, QString filter) |
spatial filter within the stand trees are kept in the list if the expession 'filter' returns true for the location of the tree More... | |
int | removeMarkedTrees () |
load all trees of the stand and either kill or harvest trees that are marked for that operation. More... | |
int | resetMarks () |
reset all marks of currently loaded trees to zero More... | |
QJSValue | tree (int index) |
access to single trees (returns a reference) More... | |
QJSValue | treeObject (int index) |
return a copy of a tree More... | |
int | kill (QString filter=QString()) |
kill "number" of stems in the percentile interval "from" - "to". More... | |
int | harvest (QString filter=QString(), double fraction=1.) |
manage 'fraction' of all trees [0..1] with 'filter'. More... | |
double | percentile (int pct) |
get value for the pct th percentile (1..100) More... | |
void | sort (QString statement) |
hacky access function to resource units covered by a polygon. More... | |
void | randomize () |
random shuffle of all trees in the list More... | |
double | mean (QString expression, QString filter=QString()) |
calculate the mean value for all trees in the internal list for 'expression' (filtered by the filter criterion) More... | |
double | sum (QString expression, QString filter=QString()) |
calculate the sum for all trees in the internal list for the 'expression' (filtered by the filter criterion) More... | |
void | prepareStandGrid (QString type, QString custom_expression=QString()) |
set up internally a map (10m grid cells) of the stand with a given grid type or using a custom expression. More... | |
void | exportStandGrid (QString file_name) |
FloatGrid & | standGrid () |
int | killSaplings (QString expression) |
modify sapling More... | |
double | meanSaplings (QString expression, QString filter=QString()) |
calculate the mean value for all trees in the internal list for 'expression' (filtered by the filter criterion) More... | |
double | sumSaplings (QString expression, QString filter=QString()) |
calculate the sum for all trees in the internal list for the 'expression' (filtered by the filter criterion) More... | |
Public Member Functions | |
FMTreeList (QObject *parent=0) | |
FMTreeList (FMStand *stand, QObject *parent=0) | |
~FMTreeList () | |
int | standId () const |
void | setStand (FMStand *stand) |
bool | simulate () const |
void | setSimulate (bool do_simulate) |
int | count () const |
int | loadFromRect (ResourceUnit *ru, const QRectF &rect) |
load trees from a portion of a RU More... | |
int | loadFromRU (ResourceUnit *ru, bool append=false) |
load all trees from a RU More... | |
const QVector< QPair< Tree *, double > > | trees () const |
access the list of trees More... | |
Grid< float > & | localGrid () |
access to local grid (setup if necessary) More... | |
Properties | |
int | stand |
return stand, -1 if not set More... | |
int | count |
return the number of trees that are currently loaded More... | |
bool | simulate |
if 'simulate' is true, trees are only marked for removal More... | |
Friends | |
class | ActThinning |
void | rungrid_custom (float &cell, int &n, const Tree *tree, const FMTreeList *list) |
The FMTreeList class implements low-level functionality for selecting and harvesting of trees.
The functions of the class are usually accessed via Javascript.
|
explicit |
|
explicit |
ABE::FMTreeList::~FMTreeList | ( | ) |
|
inline |
|
slot |
|
slot |
apply a filter on the current tree list.
Only trees for which 'filter' returns true remain in the list. returns the number of tree that remain in the list.
|
slot |
manage 'fraction' of all trees [0..1] with 'filter'.
Return number of removed trees.
|
slot |
kill "number" of stems in the percentile interval "from" - "to".
remove all if "number" is higher than the count. return the number of removed trees. kill 'fraction' of all trees with 'filter'=true kill "number" of stems in the percentile interval "from" - "to". remove all if "number" is higher than the count. Use the removal fractions set by the removeStem, removeBranch and removeFoliage properties. return the number of removed trees. kill (i.e., cut down and do not remove from the forest) the trees in the list, filtered with 'filter'.
|
slot |
modify sapling
|
slot |
load all trees passing the filter, return number of trees (load only living trees)
|
inlineslot |
load all trees of the stand, return number of trees (living trees)
int ABE::FMTreeList::loadFromRect | ( | ResourceUnit * | ru, |
const QRectF & | rect | ||
) |
load trees from a portion of a RU
int ABE::FMTreeList::loadFromRU | ( | ResourceUnit * | ru, |
bool | append = false |
||
) |
load all trees from a RU
|
inline |
access to local grid (setup if necessary)
|
inlineslot |
calculate the mean value for all trees in the internal list for 'expression' (filtered by the filter criterion)
|
inlineslot |
calculate the mean value for all trees in the internal list for 'expression' (filtered by the filter criterion)
|
slot |
get value for the pct th percentile (1..100)
|
slot |
set up internally a map (10m grid cells) of the stand with a given grid type or using a custom expression.
|
slot |
random shuffle of all trees in the list
|
slot |
load all trees of the stand and either kill or harvest trees that are marked for that operation.
|
slot |
reset all marks of currently loaded trees to zero
|
inline |
void ABE::FMTreeList::setStand | ( | FMStand * | stand | ) |
|
inline |
|
slot |
hacky access function to resource units covered by a polygon.
the parameters are "remove-fractions": i.e. value=0: no change, value=1: set to zero. slash snags (SWD and otherWood-Pools) of polygon 'key' on the map 'wrap'.
slash_fraction | 0: no change, 1: 100% sort the list according to 'statement'. Note that sorting is in ascending order. To have e.g. tallest trees first in the list, use '-height'. sort trees in the list according to a criterion |
|
slot |
spatial filter within the stand trees are kept in the list if the expession 'filter' returns true for the location of the tree
|
inlineslot |
|
inline |
|
inlineslot |
calculate the sum for all trees in the internal list for the 'expression' (filtered by the filter criterion)
|
inlineslot |
calculate the sum for all trees in the internal list for the 'expression' (filtered by the filter criterion)
|
slot |
access to single trees (returns a reference)
|
slot |
return a copy of a tree
|
inline |
access the list of trees
|
friend |
|
friend |
|
read |
return the number of trees that are currently loaded
|
readwrite |
if 'simulate' is true, trees are only marked for removal
|
read |
return stand, -1 if not set