iLand
|
Collection of Stamp for one tree species. More...
#include <stampcontainer.h>
Public Member Functions | |
StampContainer () | |
~StampContainer () | |
void | useLookup (const bool use) |
void | addStamp (Stamp *stamp, const float dbh, const float hd_value, const float crown_radius) |
addStamp() add a pre-allocated stamp More... | |
void | addReaderStamp (Stamp *stamp, const float crown_radius_m) |
const Stamp * | stamp (const float bhd_cm, const float height_m) const |
fast access for an individual stamp using a lookup table. More... | |
const Stamp * | readerStamp (const float crown_radius_m) const |
retrieve reader-stamp. More... | |
int | count () const |
void | save (QDataStream &out) |
save the content of the StampContainer to the output stream (binary encoding) More... | |
void | load (QDataStream &in) |
load the content of the StampContainer to the output stream (binary encoding) More... | |
void | load (const QString &fileName) |
convenience function that loads stamps directly from a single file. More... | |
void | attachReaderStamps (const StampContainer &source) |
this functions attaches the appropriate reader (dep. More... | |
void | invert () |
invert stamps (value = 1. - value) (for multiplicative overlay) More... | |
const QString & | description () |
void | setDescription (const QString s) |
QString | dump () |
Static Public Member Functions | |
static const Grid< float > & | distanceGrid () |
static function to retrieve distance grid. See Stamp::distanceToCenter More... | |
Collection of Stamp for one tree species.
Per species several stamps are stored (different BHD, different HD relations). This class encapsulates storage and access to these stamps. The design goal is to deliver high access speeds for the "stamp()" method. Use getStamp(bhd, hd) or getStamp(bhd, height) to access.
StampContainer::StampContainer | ( | ) |
StampContainer::~StampContainer | ( | ) |
void StampContainer::addReaderStamp | ( | Stamp * | stamp, |
const float | crown_radius_m | ||
) |
void StampContainer::addStamp | ( | Stamp * | stamp, |
const float | dbh, | ||
const float | hd_value, | ||
const float | crown_radius | ||
) |
addStamp() add a pre-allocated stamp
add a stamp to the internal storage.
stamp | to internal collection. Caller must allocate stamp on the heap, freeing is done by this class. |
After loading the function finalizeSetup() must be called to ensure that gaps in the matrix get filled.
void StampContainer::attachReaderStamps | ( | const StampContainer & | source | ) |
this functions attaches the appropriate reader (dep.
on crown radius) to each stamp of the container. The reader-stamp is returned by a call to the reader()-function of the Stamp itself.
Container | holding the reader stamps. |
|
inline |
|
inline |
|
inlinestatic |
static function to retrieve distance grid. See Stamp::distanceToCenter
QString StampContainer::dump | ( | ) |
void StampContainer::invert | ( | ) |
invert stamps (value = 1. - value) (for multiplicative overlay)
void StampContainer::load | ( | const QString & | fileName | ) |
convenience function that loads stamps directly from a single file.
void StampContainer::load | ( | QDataStream & | in | ) |
load the content of the StampContainer to the output stream (binary encoding)
const Stamp * StampContainer::readerStamp | ( | const float | crown_radius_m | ) | const |
retrieve reader-stamp.
retrieve a read-out-stamp.
radius | of crown in m. |
Readers depend solely on a crown radius. Internally, readers are stored in the same lookup-table, but using a encoding/decoding trick.
void StampContainer::save | ( | QDataStream & | out | ) |
save the content of the StampContainer to the output stream (binary encoding)
Saves all stamps of the container to a binary stream.
Format: * count of stamps (int32) a string containing a description (free text) (QString) for each stamp:
|
inline |
const Stamp * StampContainer::stamp | ( | const float | bhd_cm, |
const float | height_m | ||
) | const |
fast access for an individual stamp using a lookup table.
the dimensions of the lookup table are defined by class-constants. If stamp is not found there, the more complete list of stamps is searched.
|
inline |