A class that represents a road lane composed by a set of waypoints. More...
#include <Lane.hh>
Public Member Functions | |
Lane () | |
Default constructor. More... | |
Lane (const int _id) | |
Constructor. More... | |
Lane (const Lane &_other) | |
Copy constructor. More... | |
virtual | ~Lane () |
Destructor. More... | |
bool | AddCheckpoint (const rndf::Checkpoint &_newCheckpoint) |
Add a new checkpoint. More... | |
bool | AddExit (const Exit &_newExit) |
Add a new exit. More... | |
bool | AddStop (const int _waypointId) |
Add a new stop. More... | |
bool | AddWaypoint (const rndf::Waypoint &_newWaypoint) |
Add a new waypoint. More... | |
bool | Checkpoint (const int _cpId, rndf::Checkpoint &_cp) const |
Get the details of one of the checkpoints with Id _cpId. More... | |
std::vector< rndf::Checkpoint > & | Checkpoints () |
Get a mutable reference to the vector of checkpoints;. More... | |
const std::vector< rndf::Checkpoint > & | Checkpoints () const |
Get the vector of checkpoints;. 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... | |
int | Id () const |
Id. More... | |
Marking | LeftBoundary () const |
Boundaries. More... | |
bool | Load (std::ifstream &_rndfFile, const int _segmentId, int &_lineNumber) |
Parsing. More... | |
unsigned int | NumCheckpoints () const |
Checkpoints. More... | |
unsigned int | NumExits () const |
Exits. More... | |
unsigned int | NumStops () const |
Stops. More... | |
unsigned int | NumWaypoints () const |
Waypoints. More... | |
bool | operator!= (const Lane &_other) const |
Inequality. More... | |
Lane & | operator= (const Lane &_other) |
Assignment operator. More... | |
bool | operator== (const Lane &_other) const |
Operators. More... | |
bool | RemoveCheckpoint (const int _cpId) |
Remove an existing checkpoint. More... | |
bool | RemoveExit (const Exit &_exit) |
Remove an existing exit. More... | |
bool | RemoveStop (const int _waypointId) |
Remove an existing stop. More... | |
bool | RemoveWaypoint (const int _wpId) |
Remove an existing waypoint. More... | |
Marking | RightBoundary () const |
Get the right boundary type. More... | |
bool | SetId (const int _id) |
Set the identifier of the lane. More... | |
void | SetLeftBoundary (const Marking &_boundary) |
Set the new left boundary type. More... | |
void | SetRightBoundary (const Marking &_boundary) |
Set the new right boundary type. More... | |
bool | SetWidth (const double _newWidth) |
Set the lane width. More... | |
std::vector< int > & | Stops () |
Get a mutable reference to the vector of stops. More... | |
const std::vector< int > & | Stops () const |
Get the vector of stops. More... | |
bool | UpdateCheckpoint (const rndf::Checkpoint &_cp) |
Update an existing checkpoint. More... | |
bool | UpdateWaypoint (const rndf::Waypoint &_wp) |
Update an existing waypoint. More... | |
bool | Valid () const |
Validation. More... | |
bool | Waypoint (const int _wpId, rndf::Waypoint &_wp) const |
Get the details of one of the waypoints with Id _wpId. More... | |
std::vector< rndf::Waypoint > & | Waypoints () |
Get a mutable reference to the vector of waypoints. More... | |
const std::vector< rndf::Waypoint > & | Waypoints () const |
Get the vector of waypoints. More... | |
double | Width () const |
Width. More... | |
A class that represents a road lane composed by a set of waypoints.
ignition::rndf::Lane::Lane | ( | ) |
Default constructor.
|
explicit |
|
explicit |
|
virtual |
Destructor.
bool ignition::rndf::Lane::AddCheckpoint | ( | const rndf::Checkpoint & | _newCheckpoint | ) |
Add a new checkpoint.
[in] | _newCheckpoint | A new checkpoint to be added. |
bool ignition::rndf::Lane::AddExit | ( | const Exit & | _newExit | ) |
Add a new exit.
[in] | _newExit | The exit to add. |
bool ignition::rndf::Lane::AddStop | ( | const int | _waypointId | ) |
Add a new stop.
[in] | _waypointId | The Id of a new waypoint considered a stop. |
bool ignition::rndf::Lane::AddWaypoint | ( | const rndf::Waypoint & | _newWaypoint | ) |
Add a new waypoint.
[in] | _newWaypoint | A new waypoint to be added. |
bool ignition::rndf::Lane::Checkpoint | ( | const int | _cpId, |
rndf::Checkpoint & | _cp | ||
) | const |
Get the details of one of the checkpoints with Id _cpId.
[in] | _cpId | The checkpoint Id. |
[out] | _cp | The checkpoint requested. |
std::vector<rndf::Checkpoint>& ignition::rndf::Lane::Checkpoints | ( | ) |
Get a mutable reference to the vector of checkpoints;.
const std::vector<rndf::Checkpoint>& ignition::rndf::Lane::Checkpoints | ( | ) | const |
Get the vector of checkpoints;.
std::vector<Exit>& ignition::rndf::Lane::Exits | ( | ) |
Get a mutable reference to the vector of exits.
const std::vector<Exit>& ignition::rndf::Lane::Exits | ( | ) | const |
Get the vector of stops.
int ignition::rndf::Lane::Id | ( | ) | const |
Id.
Get the unique identifier of the lane.
Marking ignition::rndf::Lane::LeftBoundary | ( | ) | const |
Boundaries.
Get the left boundary type.
bool ignition::rndf::Lane::Load | ( | std::ifstream & | _rndfFile, |
const int | _segmentId, | ||
int & | _lineNumber | ||
) |
Parsing.
Load a lane 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,out] | _segmentId | Expected segment Id. |
[in,out] | _lineNumber | Line number pointed by the stream position indicator. |
unsigned int ignition::rndf::Lane::NumCheckpoints | ( | ) | const |
Checkpoints.
Get the number of checkpoints stored.
unsigned int ignition::rndf::Lane::NumExits | ( | ) | const |
Exits.
Get the number of exits stored.
unsigned int ignition::rndf::Lane::NumStops | ( | ) | const |
Stops.
Get the number of stops stored.
unsigned int ignition::rndf::Lane::NumWaypoints | ( | ) | const |
Waypoints.
Get the number of waypoints stored.
bool ignition::rndf::Lane::operator!= | ( | const Lane & | _other | ) | const |
Assignment operator.
[in] | _other | The new lane. |
bool ignition::rndf::Lane::operator== | ( | const Lane & | _other | ) | const |
Operators.
Equality operator, result = this == _other
[in] | _other | Lane to check for equality. |
bool ignition::rndf::Lane::RemoveCheckpoint | ( | const int | _cpId | ) |
Remove an existing checkpoint.
[in] | _cpId | The checkpoint Id to be removed. |
bool ignition::rndf::Lane::RemoveExit | ( | const Exit & | _exit | ) |
Remove an existing exit.
[in] | _exit | The exit to be removed. |
bool ignition::rndf::Lane::RemoveStop | ( | const int | _waypointId | ) |
Remove an existing stop.
[in] | _waypointId | The waypoint Id (of a stop sign) to be removed. |
bool ignition::rndf::Lane::RemoveWaypoint | ( | const int | _wpId | ) |
Remove an existing waypoint.
[in] | _wpId | The waypoint Id to be removed. |
Marking ignition::rndf::Lane::RightBoundary | ( | ) | const |
Get the right boundary type.
bool ignition::rndf::Lane::SetId | ( | const int | _id | ) |
Set the identifier of the lane.
[in] | _id | New unique Id. |
void ignition::rndf::Lane::SetLeftBoundary | ( | const Marking & | _boundary | ) |
Set the new left boundary type.
[in] | _boundary | The new left boundary type. |
void ignition::rndf::Lane::SetRightBoundary | ( | const Marking & | _boundary | ) |
Set the new right boundary type.
[in] | _boundary | The new right boundary type. |
bool ignition::rndf::Lane::SetWidth | ( | const double | _newWidth | ) |
Set the lane width.
[in] | _newWidth | The new width in meters. |
std::vector<int>& ignition::rndf::Lane::Stops | ( | ) |
Get a mutable reference to the vector of stops.
The elements are waypoint Ids.
const std::vector<int>& ignition::rndf::Lane::Stops | ( | ) | const |
Get the vector of stops.
The elements are waypoint Ids.
bool ignition::rndf::Lane::UpdateCheckpoint | ( | const rndf::Checkpoint & | _cp | ) |
Update an existing checkpoint.
[in] | _cp | The updated checkpoint. |
bool ignition::rndf::Lane::UpdateWaypoint | ( | const rndf::Waypoint & | _wp | ) |
Update an existing waypoint.
[in] | _wp | The updated waypoint. |
bool ignition::rndf::Lane::Valid | ( | ) | const |
Validation.
bool ignition::rndf::Lane::Waypoint | ( | const int | _wpId, |
rndf::Waypoint & | _wp | ||
) | const |
Get the details of one of the waypoints with Id _wpId.
[in] | _wpId | The waypoint Id. |
[out] | _wp | The waypoint requested. |
std::vector<rndf::Waypoint>& ignition::rndf::Lane::Waypoints | ( | ) |
Get a mutable reference to the vector of waypoints.
const std::vector<rndf::Waypoint>& ignition::rndf::Lane::Waypoints | ( | ) | const |
Get the vector of waypoints.
double ignition::rndf::Lane::Width | ( | ) | const |
Width.
Get the lane width in meters.