FMT 0.9.8
Forest management tools for forest planning
|
#include <FMTevent.hpp>
Public Member Functions | |
std::set< FMTcoordinate >::const_iterator | midposition () const |
virtual | ~FMTevent ()=default |
FMTevent () | |
FMTevent (const FMTcoordinate &location, const int &laction_id, const int &lperiod) | |
FMTevent (const FMTevent &rhs) | |
FMTevent & | operator= (const FMTevent &rhs) |
bool | empty () const |
size_t | size () const |
size_t | hash () const |
FMTeventrelation | getrelation (const FMTevent &rhs) const |
virtual bool | operator== (const FMTevent &rhs) const |
bool | operator!= (const FMTevent &rhs) const |
virtual bool | operator< (const FMTevent &rhs) const |
size_t | perimeter () const |
size_t | height () const |
size_t | width () const |
FMTcoordinate | averagecentroid () const |
std::string | getstats () const |
virtual void | erase (const FMTcoordinate &newlocation) |
virtual void | merge (const FMTevent &event) |
virtual void | insert (const FMTcoordinate &newlocation) |
void | setactionid (const int &laction_id) |
void | setperiod (const int &lperiod) |
const int & | getactionid () const |
const int & | getperiod () const |
virtual std::vector< std::set< FMTcoordinate >::const_iterator > | ignit (const size_t &eventmaximalsize, const std::set< FMTcoordinate >::const_iterator &ignit, const int &laction_id, const int &lperiod) |
virtual bool | spread (const size_t &eventminimalsize, const size_t &eventmaximalsize, const size_t &neighboringsize, const std::set< FMTcoordinate > &territory, std::vector< std::set< FMTcoordinate >::const_iterator > active) |
double | distance (const FMTevent &rhs) const |
template<typename T > | |
bool | within (const T &dist, const FMTevent &rhs) const |
template<typename T > | |
bool | within (const T &dist, const FMTcoordinate &location) const |
bool | contain (const FMTcoordinate &coord) const |
bool | potentialysplitevent (const FMTcoordinate &coord) const |
bool | splitevent (const unsigned int &ldistance, std::vector< FMTevent > &splittedevents) const |
std::set< FMTcoordinate > | getterritory (const size_t &distance) const |
std::vector< std::set< FMTcoordinate >::const_iterator > | getborders () const |
std::vector< FMTcoordinate > | getenveloppe () const |
void | getclosescoordinates (const FMTevent &rhs, std::set< FMTcoordinate >::const_iterator &thiscoordinate, std::set< FMTcoordinate >::const_iterator &rhscoordinate) const |
Static Public Member Functions | |
static std::string | getstatsheader () |
Public Attributes | |
std::set< FMTcoordinate > | elements |
Protected Attributes | |
int | action_id |
int | period |
Friends | |
class | boost::serialization::access |
This is the base class use to create FMTsaevent or FMTsesevent. It is a set of FMTcoordinate (elements) corresponding to the FMTcoordinates presents in the event.
|
virtualdefault |
Destructor
Spatial::FMTevent::FMTevent | ( | ) |
Constructor
Spatial::FMTevent::FMTevent | ( | const FMTcoordinate & | location, |
const int & | laction_id, | ||
const int & | lperiod | ||
) |
Constructor with coordinate, action_id and period
Spatial::FMTevent::FMTevent | ( | const FMTevent & | rhs | ) |
Copy constructor
FMTcoordinate Spatial::FMTevent::averagecentroid | ( | ) | const |
Return centroid based on the envelope of the event
bool Spatial::FMTevent::contain | ( | const FMTcoordinate & | coord | ) | const |
Return true if coordinate is in elements
double Spatial::FMTevent::distance | ( | const FMTevent & | rhs | ) | const |
Return the distance between this event and the event pass as argument
|
inline |
Test whether event is empty
|
virtual |
Erase coordinate from event
|
inline |
Getter of the action id
std::vector< std::set< FMTcoordinate >::const_iterator > Spatial::FMTevent::getborders | ( | ) | const |
Returns coordinate of the border of the even
void Spatial::FMTevent::getclosescoordinates | ( | const FMTevent & | rhs, |
std::set< FMTcoordinate >::const_iterator & | thiscoordinate, | ||
std::set< FMTcoordinate >::const_iterator & | rhscoordinate | ||
) | const |
Return the closes coordinate between two FMTevent
std::vector< FMTcoordinate > Spatial::FMTevent::getenveloppe | ( | ) | const |
Coordinates that create the envelope of the event
0//-//1// -//-//-// 2//-//3// Returns coordinate of the enveloppe
|
inline |
Getter of the period
FMTeventrelation Spatial::FMTevent::getrelation | ( | const FMTevent & | rhs | ) | const |
std::string Spatial::FMTevent::getstats | ( | ) | const |
Return string containing size, perimeter, height and width
|
static |
Return the header of the patch stats (size, perimeter, height and width)
std::set< FMTcoordinate > Spatial::FMTevent::getterritory | ( | const size_t & | distance | ) | const |
Returns the adjacent territory of the event base on a distance.
size_t Spatial::FMTevent::hash | ( | ) | const |
size_t Spatial::FMTevent::height | ( | ) | const |
Return height of the event
|
virtual |
|
virtual |
Insert coordinate in the event
|
virtual |
Merge two events
|
inline |
Get mid point of elements.
bool Spatial::FMTevent::operator!= | ( | const FMTevent & | rhs | ) | const |
Comparison operator different than
|
virtual |
Comparison operator less than
|
virtual |
Comparison operator equal to
size_t Spatial::FMTevent::perimeter | ( | ) | const |
The perimeter of the event, including any internal holes in the event.
bool Spatial::FMTevent::potentialysplitevent | ( | const FMTcoordinate & | coord | ) | const |
Fastest way to evaluate if an event will be split after erasing a coordinate. Only when neighbors the 4 around the pixel
|
inline |
Setter for action id
|
inline |
Setter for period
|
inline |
Return event size
bool Spatial::FMTevent::splitevent | ( | const unsigned int & | ldistance, |
std::vector< FMTevent > & | splittedevents | ||
) | const |
Check if events are split and fill vector of split events Remove all elements from the current event and put it in the events in splittedevents
|
virtual |
size_t Spatial::FMTevent::width | ( | ) | const |
Return width of the event
bool Spatial::FMTevent::within | ( | const T & | dist, |
const FMTcoordinate & | location | ||
) | const |
Return true if coordinate is within specified distance of the coordinates
bool Spatial::FMTevent::within | ( | const T & | dist, |
const FMTevent & | rhs | ||
) | const |
Return true if the event is within specified distance of the envelope
|
friend |
|
protected |
Coordinate where the event started Used in spread, the active coordinate are the next to spread. Action id from the FMTmodel.
std::set<FMTcoordinate> Spatial::FMTevent::elements |
Coordinates presents in the event
|
protected |
Period at which the event take place