An abstraction for representing areas within free vehicle movement is permitted. More...
#include <Zone.hh>
Public Member Functions | |
Zone () | |
Default constructor. More... | |
Zone (const int _id) | |
Constructor. More... | |
Zone (const Zone &_other) | |
Copy constructor. More... | |
virtual | ~Zone () |
Destructor. More... | |
bool | AddSpot (const ParkingSpot &_newSpot) |
Add a new parking spot. More... | |
int | Id () const |
Id. More... | |
bool | Load (std::ifstream &_rndfFile, int &_lineNumber) |
Parsing. More... | |
std::string | Name () const |
Name. More... | |
unsigned int | NumSpots () const |
Parking spots. More... | |
bool | operator!= (const Zone &_other) const |
Inequality. More... | |
Zone & | operator= (const Zone &_other) |
Assignment operator. More... | |
bool | operator== (const Zone &_other) const |
Operators. More... | |
rndf::Perimeter & | Perimeter () |
Perimeter. More... | |
const rndf::Perimeter & | Perimeter () const |
Get the perimeter. More... | |
bool | RemoveSpot (const int _psId) |
Remove an existing parking spot. More... | |
bool | SetId (const int _id) |
Set the identifier of the zone. More... | |
void | SetName (const std::string &_name) const |
Set the zone name. More... | |
bool | Spot (const int _psId, ParkingSpot &_ps) const |
Get the details of one of the parking spots with Id _psId. More... | |
std::vector< ParkingSpot > & | Spots () |
Get a mutable reference to the vector of parking spots. More... | |
const std::vector< ParkingSpot > & | Spots () const |
Get the vector of parking spots. More... | |
bool | UpdateSpot (const ParkingSpot &_ps) |
Update an existing parking spot. More... | |
bool | Valid () const |
Validation. More... | |
An abstraction for representing areas within free vehicle movement is permitted.
The zone is determined by a polygonal boundary defined by perimeter points. Some perimeter points are identified as entry and exit points into the zone area. A zone may also include one or more parking spots, each specified by a pair of waypoints.
|
explicit |
Default constructor.
|
explicit |
ignition::rndf::Zone::Zone | ( | const Zone & | _other | ) |
|
virtual |
Destructor.
bool ignition::rndf::Zone::AddSpot | ( | const ParkingSpot & | _newSpot | ) |
Add a new parking spot.
[in] | _newSpot | A new spot to be added. |
int ignition::rndf::Zone::Id | ( | ) | const |
Id.
Get the unique identifier of the zone.
bool ignition::rndf::Zone::Load | ( | std::ifstream & | _rndfFile, |
int & | _lineNumber | ||
) |
Parsing.
Load a zone 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] | _lineNumber | Line number pointed by the stream position indicator. |
std::string ignition::rndf::Zone::Name | ( | ) | const |
Name.
Get the zone name. E.g.: "North_parking_lot".
unsigned int ignition::rndf::Zone::NumSpots | ( | ) | const |
Parking spots.
Get the number of parking spots stored.
bool ignition::rndf::Zone::operator!= | ( | const Zone & | _other | ) | const |
Assignment operator.
[in] | _other | The new zone. |
bool ignition::rndf::Zone::operator== | ( | const Zone & | _other | ) | const |
Operators.
Equality operator, result = this == _other
[in] | _other | Zone to check for equality. |
rndf::Perimeter& ignition::rndf::Zone::Perimeter | ( | ) |
const rndf::Perimeter& ignition::rndf::Zone::Perimeter | ( | ) | const |
Get the perimeter.
bool ignition::rndf::Zone::RemoveSpot | ( | const int | _psId | ) |
Remove an existing parking spot.
[in] | _psId | The parking spot Id to be removed. |
bool ignition::rndf::Zone::SetId | ( | const int | _id | ) |
Set the identifier of the zone.
[in] | _id | New unique Id. |
void ignition::rndf::Zone::SetName | ( | const std::string & | _name | ) | const |
Set the zone name.
E.g.: "North_parking_lot".
[in] | _name | The new name. |
bool ignition::rndf::Zone::Spot | ( | const int | _psId, |
ParkingSpot & | _ps | ||
) | const |
Get the details of one of the parking spots with Id _psId.
[in] | _psId | The parking spot Id. |
[out] | _ps | The parking spot requested. |
std::vector<ParkingSpot>& ignition::rndf::Zone::Spots | ( | ) |
Get a mutable reference to the vector of parking spots.
const std::vector<ParkingSpot>& ignition::rndf::Zone::Spots | ( | ) | const |
Get the vector of parking spots.
bool ignition::rndf::Zone::UpdateSpot | ( | const ParkingSpot & | _ps | ) |
Update an existing parking spot.
[in] | _ps | The updated parking spot. |
bool ignition::rndf::Zone::Valid | ( | ) | const |
Validation.
Whether the current object is valid or not.