![]() |
FMT 1.2.0
Forest management tools for forest planning
|
Base class for a spatial event (FMTsaevent or FMTsesevent): a set of FMTCoordinate corresponding to the coordinates present in the event. More...
#include <FMTEvent.h>
Public Member Functions | |
| std::set< FMTCoordinate >::const_iterator | midPosition () const |
| Get the mid point of the elements of the event. | |
| ~FMTEvent ()=default | |
| Default destructor for FMTEvent. | |
| FMTEvent (const FMTEvent &rhs)=default | |
| Copy constructor for FMTEvent. | |
| FMTEvent & | operator= (const FMTEvent &rhs)=default |
| Copy assignment operator for FMTEvent. | |
| FMTEvent ()=default | |
| Default constructor for FMTEvent. | |
| FMTEvent (const FMTCoordinate &p_location, int p_actionId, int p_period, size_t p_centroidGraphFamily) | |
| Construct a FMTEvent from a location, an action id, a period and a centroid graph family. | |
| bool | empty () const |
| Test whether the event is empty. | |
| size_t | size () const |
| Return the size of the event. | |
| size_t | hash () const |
| Hash the event. | |
| FMTEventRelation | getRelation (const FMTEvent &rhs) const |
| Return the relation between this event and another one. | |
| bool | operator== (const FMTEvent &rhs) const |
| Comparison operator for FMTEvent. | |
| bool | operator!= (const FMTEvent &rhs) const |
| Comparison operator for FMTEvent. | |
| bool | operator< (const FMTEvent &rhs) const |
| Less than operator for FMTEvent. | |
| size_t | perimeter () const |
| Return the perimeter of the event, including any internal holes. | |
| size_t | height () const |
| Return the height of the event. | |
| size_t | width () const |
| Return the width of the event. | |
| FMTCoordinate | averageCentroid () const |
| Return the centroid based on the envelope of the event. | |
| std::string | getStats () const |
| Return the patch stats (size, perimeter, height and width) as a string. | |
| virtual void | erase (const FMTCoordinate &newlocation) |
| Erase a coordinate from the event. | |
| virtual void | merge (const FMTEvent &event) |
| Merge another event into this one. | |
| virtual void | insert (const FMTCoordinate &newlocation) |
| Insert a coordinate in the event. | |
| void | setActionId (const int &laction_id) |
| Set the action id of the event. | |
| const int & | getActionId () const |
| Return the action id of the event. | |
| const int & | getPeriod () const |
| Return the period of the event. | |
| const size_t & | getGraphFamily () const |
| Return the graph family of the event. | |
| const std::set< FMTCoordinate > & | getElements () const |
| Return the elements (coordinates) of the event. | |
| virtual std::vector< std::set< FMTCoordinate >::const_iterator > | ignit (const size_t &eventmaximalsize, const std::set< FMTCoordinate >::const_iterator &ignit, int p_actionId, int p_period, size_t p_GraphFamily) |
| Ignite the event at a coordinate for an action, a period and a graph family, up to a maximal size. | |
| 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) |
| Spread the event within a territory from the active coordinates, respecting the size bounds. | |
| double | distance (const FMTEvent &rhs) const |
| Return the distance between this event and another one. | |
| template<typename T > | |
| bool | within (const T &dist, const FMTEvent &rhs) const |
| Return true if the event is within a distance of another event's envelope. | |
| template<typename T > | |
| bool | within (const T &dist, const FMTCoordinate &location) const |
| Return true if a coordinate is within a distance of the event's coordinates. | |
| bool | contain (const FMTCoordinate &coord) const |
| Return true if a coordinate is in the elements of the event. | |
| bool | willSplitEvent (const FMTCoordinate &p_coordinate) const |
| Return true if removing a coordinate will split the event. | |
| bool | splitEvent (std::vector< FMTEvent > &splittedevents) const |
| Split the event, filling a vector with the split events and removing the elements from the current event. | |
| std::set< FMTCoordinate > | getTerritory (const size_t &distance) const |
| Return the adjacent territory of the event based on a distance. | |
| std::vector< std::set< FMTCoordinate >::const_iterator > | getBorders () const |
| Return the coordinates of the border of the event. | |
| std::vector< std::pair< FMTCoordinate, FMTCoordinate > > | getOutsideBordersPair () const |
| Return the outside borders of the event as pairs of coordinates. | |
| std::array< FMTCoordinate, 4 > | getEnveloppe () const |
| Return the four coordinates that create the envelope of the event. | |
| void | getClosesCoordinates (const FMTEvent &rhs, std::set< FMTCoordinate >::const_iterator &thiscoordinate, std::set< FMTCoordinate >::const_iterator &rhscoordinate) const |
| Return the closest coordinates between this event and another one. | |
Static Public Member Functions | |
| static std::string | getStatsHeader () |
| Return the header of the patch stats (size, perimeter, height and width). | |
Friends | |
| class | boost::serialization::access |
Base class for a spatial event (FMTsaevent or FMTsesevent): a set of FMTCoordinate corresponding to the coordinates present in the event.
|
default |
Default destructor for FMTEvent.
|
default |
|
default |
Default constructor for FMTEvent.
| Spatial::FMTEvent::FMTEvent | ( | const FMTCoordinate & | p_location, |
| int | p_actionId, | ||
| int | p_period, | ||
| size_t | p_centroidGraphFamily | ||
| ) |
Construct a FMTEvent from a location, an action id, a period and a centroid graph family.
| [in] | p_location | the location. |
| [in] | p_actionId | the action id. |
| [in] | p_period | the period. |
| [in] | p_centroidGraphFamily | the centroid graph family. |
| FMTCoordinate Spatial::FMTEvent::averageCentroid | ( | ) | const |
Return the centroid based on the envelope of the event.
| bool Spatial::FMTEvent::contain | ( | const FMTCoordinate & | coord | ) | const |
Return true if a coordinate is in the elements of the event.
| [in] | coord | the coordinate. |
| double Spatial::FMTEvent::distance | ( | const FMTEvent & | rhs | ) | const |
Return the distance between this event and another one.
| [in] | rhs | the other event. |
| bool Spatial::FMTEvent::empty | ( | ) | const |
Test whether the event is empty.
|
virtual |
Erase a coordinate from the event.
| [in] | newlocation | the coordinate to erase. |
| const int & Spatial::FMTEvent::getActionId | ( | ) | const |
Return the action id of the event.
| std::vector< std::set< FMTCoordinate >::const_iterator > Spatial::FMTEvent::getBorders | ( | ) | const |
Return the coordinates of the border of the event.
| void Spatial::FMTEvent::getClosesCoordinates | ( | const FMTEvent & | rhs, |
| std::set< FMTCoordinate >::const_iterator & | thiscoordinate, | ||
| std::set< FMTCoordinate >::const_iterator & | rhscoordinate | ||
| ) | const |
Return the closest coordinates between this event and another one.
| [in] | rhs | the other event. |
| [out] | thiscoordinate | the closest coordinate of this event. |
| [out] | rhscoordinate | the closest coordinate of the other event. |
| const std::set< FMTCoordinate > & Spatial::FMTEvent::getElements | ( | ) | const |
Return the elements (coordinates) of the event.
| std::array< FMTCoordinate, 4 > Spatial::FMTEvent::getEnveloppe | ( | ) | const |
Return the four coordinates that create the envelope of the event.
| const size_t & Spatial::FMTEvent::getGraphFamily | ( | ) | const |
Return the graph family of the event.
| std::vector< std::pair< FMTCoordinate, FMTCoordinate > > Spatial::FMTEvent::getOutsideBordersPair | ( | ) | const |
Return the outside borders of the event as pairs of coordinates.
| const int & Spatial::FMTEvent::getPeriod | ( | ) | const |
Return the period of the event.
| FMTEventRelation Spatial::FMTEvent::getRelation | ( | const FMTEvent & | rhs | ) | const |
Return the relation between this event and another one.
| [in] | rhs | the other event. |
| std::string Spatial::FMTEvent::getStats | ( | ) | const |
Return the patch stats (size, perimeter, height and width) as a string.
|
static |
Return the header of the patch stats (size, perimeter, height and width).
| std::set< FMTCoordinate > Spatial::FMTEvent::getTerritory | ( | const size_t & | distance | ) | const |
Return the adjacent territory of the event based on a distance.
| [in] | distance | the distance. |
| size_t Spatial::FMTEvent::hash | ( | ) | const |
Hash the event.
| size_t Spatial::FMTEvent::height | ( | ) | const |
Return the height of the event.
|
virtual |
Ignite the event at a coordinate for an action, a period and a graph family, up to a maximal size.
| [in] | eventmaximalsize | the maximal event size. |
| [in] | ignit | the ignition coordinate. |
| [in] | p_actionId | the action id. |
| [in] | p_period | the period. |
| [in] | p_GraphFamily | the graph family. |
|
virtual |
Insert a coordinate in the event.
| [in] | newlocation | the coordinate to insert. |
|
virtual |
Merge another event into this one.
| [in] | event | the event to merge. |
| std::set< FMTCoordinate >::const_iterator Spatial::FMTEvent::midPosition | ( | ) | const |
Get the mid point of the elements of the event.
| bool Spatial::FMTEvent::operator!= | ( | const FMTEvent & | rhs | ) | const |
| bool Spatial::FMTEvent::operator< | ( | const FMTEvent & | rhs | ) | const |
| bool Spatial::FMTEvent::operator== | ( | const FMTEvent & | rhs | ) | const |
| size_t Spatial::FMTEvent::perimeter | ( | ) | const |
Return the perimeter of the event, including any internal holes.
| void Spatial::FMTEvent::setActionId | ( | const int & | laction_id | ) |
Set the action id of the event.
| [in] | laction_id | the action id. |
| size_t Spatial::FMTEvent::size | ( | ) | const |
Return the size of the event.
| bool Spatial::FMTEvent::splitEvent | ( | std::vector< FMTEvent > & | splittedevents | ) | const |
Split the event, filling a vector with the split events and removing the elements from the current event.
| [in,out] | splittedevents | the split events. |
|
virtual |
Spread the event within a territory from the active coordinates, respecting the size bounds.
| [in] | eventminimalsize | the minimal event size. |
| [in] | eventmaximalsize | the maximal event size. |
| [in] | neighboringsize | the neighboring size. |
| [in] | territory | the territory to spread in. |
| [in] | active | the active coordinates. |
| size_t Spatial::FMTEvent::width | ( | ) | const |
Return the width of the event.
| bool Spatial::FMTEvent::willSplitEvent | ( | const FMTCoordinate & | p_coordinate | ) | const |
Return true if removing a coordinate will split the event.
| [in] | p_coordinate | the coordinate that will be removed. |
| bool Spatial::FMTEvent::within | ( | const T & | dist, |
| const FMTCoordinate & | location | ||
| ) | const |
Return true if a coordinate is within a distance of the event's coordinates.
| T | the distance type. |
| [in] | dist | the distance. |
| [in] | location | the coordinate. |
| bool Spatial::FMTEvent::within | ( | const T & | dist, |
| const FMTEvent & | rhs | ||
| ) | const |
Return true if the event is within a distance of another event's envelope.
| T | the distance type. |
| [in] | dist | the distance. |
| [in] | rhs | the other event. |
|
friend |