iLand
Public Slots | Public Member Functions | Properties | Friends | List of all members

The FMTreeList class implements low-level functionality for selecting and harvesting of trees. More...

#include <fmtreelist.h>

Inheritance diagram for ABE::FMTreeList:

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)
 
FloatGridstandGrid ()
 
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)
 

Detailed Description

The FMTreeList class implements low-level functionality for selecting and harvesting of trees.

The functions of the class are usually accessed via Javascript.

Constructor & Destructor Documentation

◆ FMTreeList() [1/2]

ABE::FMTreeList::FMTreeList ( QObject *  parent = 0)
explicit

◆ FMTreeList() [2/2]

ABE::FMTreeList::FMTreeList ( FMStand stand,
QObject *  parent = 0 
)
explicit

◆ ~FMTreeList()

ABE::FMTreeList::~FMTreeList ( )

Member Function Documentation

◆ count()

int ABE::FMTreeList::count ( ) const
inline

◆ exportStandGrid

void ABE::FMTreeList::exportStandGrid ( QString  file_name)
slot

◆ filter

int ABE::FMTreeList::filter ( QString  filter)
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.

◆ harvest

int ABE::FMTreeList::harvest ( QString  filter = QString(),
double  fraction = 1. 
)
slot

manage 'fraction' of all trees [0..1] with 'filter'.

Return number of removed trees.

◆ kill

int ABE::FMTreeList::kill ( QString  filter = QString())
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'.

◆ killSaplings

int ABE::FMTreeList::killSaplings ( QString  expression)
slot

modify sapling

◆ load

int ABE::FMTreeList::load ( const QString &  filter)
slot

load all trees passing the filter, return number of trees (load only living trees)

◆ loadAll

int ABE::FMTreeList::loadAll ( )
inlineslot

load all trees of the stand, return number of trees (living trees)

◆ loadFromRect()

int ABE::FMTreeList::loadFromRect ( ResourceUnit ru,
const QRectF &  rect 
)

load trees from a portion of a RU

◆ loadFromRU()

int ABE::FMTreeList::loadFromRU ( ResourceUnit ru,
bool  append = false 
)

load all trees from a RU

◆ localGrid()

Grid< float > & ABE::FMTreeList::localGrid ( )
inline

access to local grid (setup if necessary)

◆ mean

double ABE::FMTreeList::mean ( QString  expression,
QString  filter = QString() 
)
inlineslot

calculate the mean value for all trees in the internal list for 'expression' (filtered by the filter criterion)

◆ meanSaplings

double ABE::FMTreeList::meanSaplings ( QString  expression,
QString  filter = QString() 
)
inlineslot

calculate the mean value for all trees in the internal list for 'expression' (filtered by the filter criterion)

◆ percentile

double ABE::FMTreeList::percentile ( int  pct)
slot

get value for the pct th percentile (1..100)

◆ prepareStandGrid

void ABE::FMTreeList::prepareStandGrid ( QString  type,
QString  custom_expression = QString() 
)
slot

set up internally a map (10m grid cells) of the stand with a given grid type or using a custom expression.

◆ randomize

void ABE::FMTreeList::randomize ( )
slot

random shuffle of all trees in the list

◆ removeMarkedTrees

int ABE::FMTreeList::removeMarkedTrees ( )
slot

load all trees of the stand and either kill or harvest trees that are marked for that operation.

◆ resetMarks

int ABE::FMTreeList::resetMarks ( )
slot

reset all marks of currently loaded trees to zero

◆ setSimulate()

void ABE::FMTreeList::setSimulate ( bool  do_simulate)
inline

◆ setStand()

void ABE::FMTreeList::setStand ( FMStand stand)

◆ simulate()

bool ABE::FMTreeList::simulate ( ) const
inline

◆ sort

void ABE::FMTreeList::sort ( QString  statement)
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'.

Parameters
slash_fraction0: 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

◆ spatialFilter

int ABE::FMTreeList::spatialFilter ( QJSValue  grid,
QString  filter 
)
slot

spatial filter within the stand trees are kept in the list if the expession 'filter' returns true for the location of the tree

◆ standGrid

FloatGrid & ABE::FMTreeList::standGrid ( )
inlineslot

◆ standId()

int ABE::FMTreeList::standId ( ) const
inline

◆ sum

double ABE::FMTreeList::sum ( QString  expression,
QString  filter = QString() 
)
inlineslot

calculate the sum for all trees in the internal list for the 'expression' (filtered by the filter criterion)

◆ sumSaplings

double ABE::FMTreeList::sumSaplings ( QString  expression,
QString  filter = QString() 
)
inlineslot

calculate the sum for all trees in the internal list for the 'expression' (filtered by the filter criterion)

◆ tree

QJSValue ABE::FMTreeList::tree ( int  index)
slot

access to single trees (returns a reference)

◆ treeObject

QJSValue ABE::FMTreeList::treeObject ( int  index)
slot

return a copy of a tree

◆ trees()

const QVector< QPair< Tree *, double > > ABE::FMTreeList::trees ( ) const
inline

access the list of trees

Friends And Related Function Documentation

◆ ActThinning

friend class ActThinning
friend

◆ rungrid_custom

void rungrid_custom ( float &  cell,
int &  n,
const Tree tree,
const FMTreeList list 
)
friend

Property Documentation

◆ count

int ABE::FMTreeList::count
read

return the number of trees that are currently loaded

◆ simulate

bool ABE::FMTreeList::simulate
readwrite

if 'simulate' is true, trees are only marked for removal

◆ stand

int ABE::FMTreeList::stand
read

return stand, -1 if not set


The documentation for this class was generated from the following files: