Abstraction for representing a perimeter as a collection of perimeter points. More...
#include <Perimeter.hh>
Public Member Functions | |
Perimeter () | |
Default constructor. More... | |
Perimeter (const Perimeter &_other) | |
Copy constructor. More... | |
virtual | ~Perimeter () |
Destructor. More... | |
bool | AddExit (const Exit &_newExit) |
Add a new exit. More... | |
bool | AddPoint (const rndf::Waypoint &_newWaypoint) |
Add a new perimeter point. More... | |
std::vector< Exit > & | Exits () |
Get a mutable reference to the vector of exits. More... | |
const std::vector< Exit > & | Exits () const |
Get the vector of stops. More... | |
bool | Load (std::ifstream &_rndfFile, const int _zoneId, int &_lineNumber) |
Parsing. More... | |
unsigned int | NumExits () const |
Exits. More... | |
unsigned int | NumPoints () const |
Perimeter points. More... | |
bool | operator!= (const Perimeter &_other) const |
Inequality. More... | |
Perimeter & | operator= (const Perimeter &_other) |
Assignment operator. More... | |
bool | operator== (const Perimeter &_other) const |
Operators. More... | |
bool | Point (const int _wpId, rndf::Waypoint &_wp) const |
Get the details of one of the points with Id _wpId. More... | |
std::vector< rndf::Waypoint > & | Points () |
Get a mutable reference to the vector of perimeter points. More... | |
const std::vector< rndf::Waypoint > & | Points () const |
Get the vector of perimeter points. More... | |
bool | RemoveExit (const Exit &_exit) |
Remove an existing exit. More... | |
bool | RemovePoint (const int _wpId) |
Remove an existing perimeter point. More... | |
bool | UpdatePoint (const rndf::Waypoint &_wp) |
Update an existing point. More... | |
bool | Valid () const |
Validation. More... | |
Abstraction for representing a perimeter as a collection of perimeter points.
A perimeter point can be tagged as "exit" if it's posible to leave the zone (represented by the perimeter) and jump to a different segment.
ignition::rndf::Perimeter::Perimeter | ( | ) |
Default constructor.
ignition::rndf::Perimeter::Perimeter | ( | const Perimeter & | _other | ) |
|
virtual |
Destructor.
bool ignition::rndf::Perimeter::AddExit | ( | const Exit & | _newExit | ) |
Add a new exit.
[in] | _newExit | The exit to add. |
bool ignition::rndf::Perimeter::AddPoint | ( | const rndf::Waypoint & | _newWaypoint | ) |
Add a new perimeter point.
[in] | _newWaypoint | A new waypoint to be added. |
std::vector<Exit>& ignition::rndf::Perimeter::Exits | ( | ) |
Get a mutable reference to the vector of exits.
const std::vector<Exit>& ignition::rndf::Perimeter::Exits | ( | ) | const |
Get the vector of stops.
The elements are waypoint Ids.
bool ignition::rndf::Perimeter::Load | ( | std::ifstream & | _rndfFile, |
const int | _zoneId, | ||
int & | _lineNumber | ||
) |
Parsing.
Load a perimeter from an input stream coming from a text file. The expected format is the one specified on the RNDF spec.
[in,out] | _rndfFile | Input file stream. |
[in] | _zoneId | The zone Id in which the perimeter is located. |
[in,out] | _lineNumber | Line number pointed by the stream position indicator. |
unsigned int ignition::rndf::Perimeter::NumExits | ( | ) | const |
Exits.
Get the number of exits stored.
unsigned int ignition::rndf::Perimeter::NumPoints | ( | ) | const |
Perimeter points.
Get the number of perimeter points stored.
bool ignition::rndf::Perimeter::operator!= | ( | const Perimeter & | _other | ) | const |
Assignment operator.
[in] | _other | The new perimeter. |
bool ignition::rndf::Perimeter::operator== | ( | const Perimeter & | _other | ) | const |
Operators.
Equality operator, result = this == _other
[in] | _other | Perimeter to check for equality. |
bool ignition::rndf::Perimeter::Point | ( | const int | _wpId, |
rndf::Waypoint & | _wp | ||
) | const |
Get the details of one of the points with Id _wpId.
[in] | _wpId | The point Id. |
[out] | _wp | The waypoint requested. |
std::vector<rndf::Waypoint>& ignition::rndf::Perimeter::Points | ( | ) |
Get a mutable reference to the vector of perimeter points.
const std::vector<rndf::Waypoint>& ignition::rndf::Perimeter::Points | ( | ) | const |
Get the vector of perimeter points.
bool ignition::rndf::Perimeter::RemoveExit | ( | const Exit & | _exit | ) |
Remove an existing exit.
[in] | _exit | The exit to be removed. |
bool ignition::rndf::Perimeter::RemovePoint | ( | const int | _wpId | ) |
Remove an existing perimeter point.
[in] | _wpId | The waypoint Id to be removed. |
bool ignition::rndf::Perimeter::UpdatePoint | ( | const rndf::Waypoint & | _wp | ) |
Update an existing point.
[in] | _wp | The updated waypoint. |
bool ignition::rndf::Perimeter::Valid | ( | ) | const |
Validation.