#include <yarp/dev/Map2DArea.h>
Public Member Functions | |
Map2DArea (const std::string &map_name, const std::vector< yarp::math::Vec2D< double >> area_points) | |
Constructor. More... | |
Map2DArea (const std::string &map_name, const std::vector< yarp::dev::Nav2D::Map2DLocation > area_points) | |
Constructor. More... | |
Map2DArea () | |
Default constructor: the map name is empty, coordinates are set to zero. More... | |
std::string | toString () const |
Returns text representation of the area. More... | |
bool | operator!= (const Map2DArea &r) const |
Compares two Map2DAreas. More... | |
bool | operator== (const Map2DArea &r) const |
Compares two Map2DArea. More... | |
bool | isValid () const |
Checks if the Map2DArea is valid return true if the Map2DArea is valid. More... | |
bool | checkLocationInsideArea (yarp::dev::Nav2D::Map2DLocation loc) |
Check if a Map2DLocation is inside a Map2DArea. More... | |
bool | findAreaBounds (yarp::dev::Nav2D::Map2DLocation <, yarp::dev::Nav2D::Map2DLocation &rb) |
retrieves two Map2DLocations representing the bounding box of the Map2DArea @lt the left-top vertex @rb the right-bottom vertex More... | |
bool | getRandomLocation (yarp::dev::Nav2D::Map2DLocation &loc) |
get a random Map2DLocation inside the Map2DArea @loc the computed Map2DLocation More... | |
yarp::math::Vec2D< double > & | operator[] (size_t index) |
Returns a vertex of the area. More... | |
void | clear () |
Remove all elements from the path. More... | |
bool | read (yarp::os::ConnectionReader &connection) override |
Read this object from a network connection. More... | |
bool | write (yarp::os::ConnectionWriter &connection) const override |
Write a map2DArea to a connection. More... | |
Public Member Functions inherited from yarp::os::Portable | |
virtual Type | getType () const |
Public Member Functions inherited from yarp::os::PortReader | |
virtual | ~PortReader () |
Destructor. More... | |
virtual Type | getReadType () const |
Public Member Functions inherited from yarp::os::PortWriter | |
virtual | ~PortWriter () |
Destructor. More... | |
virtual void | onCompletion () const |
This is called when the port has finished all writing operations. More... | |
virtual void | onCommencement () const |
This is called when the port is about to begin writing operations. More... | |
virtual yarp::os::Type | getWriteType () const |
Public Attributes | |
std::string | map_id |
std::vector< yarp::math::Vec2D< double > > | points |
Additional Inherited Members | |
Static Public Member Functions inherited from yarp::os::Portable | |
static bool | copyPortable (const PortWriter &writer, PortReader &reader) |
Copy one portable to another, via writing and reading. More... | |
Definition at line 29 of file Map2DArea.h.
Map2DArea::Map2DArea | ( | const std::string & | map_name, |
const std::vector< yarp::math::Vec2D< double >> | area_points | ||
) |
Constructor.
map_name | the name of the map the location refers to. |
area_points | a set of vertexes defining the area. At least three points are required to define a valid area. |
Definition at line 44 of file Map2DArea.cpp.
Map2DArea::Map2DArea | ( | const std::string & | map_name, |
const std::vector< yarp::dev::Nav2D::Map2DLocation > | area_points | ||
) |
Constructor.
map_name | the name of the map the location refers to. |
area_points | a set of Map2DLocations defining the area. At least three points are required to define a valid area. |
Definition at line 50 of file Map2DArea.cpp.
Map2DArea::Map2DArea | ( | ) |
Default constructor: the map name is empty, coordinates are set to zero.
Definition at line 70 of file Map2DArea.cpp.
bool Map2DArea::checkLocationInsideArea | ( | yarp::dev::Nav2D::Map2DLocation | loc | ) |
Check if a Map2DLocation is inside a Map2DArea.
Definition at line 150 of file Map2DArea.cpp.
void Map2DArea::clear | ( | ) |
Remove all elements from the path.
Definition at line 240 of file Map2DArea.cpp.
bool Map2DArea::findAreaBounds | ( | yarp::dev::Nav2D::Map2DLocation & | lt, |
yarp::dev::Nav2D::Map2DLocation & | rb | ||
) |
retrieves two Map2DLocations representing the bounding box of the Map2DArea @lt the left-top vertex @rb the right-bottom vertex
Definition at line 189 of file Map2DArea.cpp.
bool Map2DArea::getRandomLocation | ( | yarp::dev::Nav2D::Map2DLocation & | loc | ) |
get a random Map2DLocation inside the Map2DArea @loc the computed Map2DLocation
Definition at line 205 of file Map2DArea.cpp.
bool Map2DArea::isValid | ( | ) | const |
Checks if the Map2DArea is valid return true if the Map2DArea is valid.
Definition at line 182 of file Map2DArea.cpp.
bool Map2DArea::operator!= | ( | const Map2DArea & | r | ) | const |
Compares two Map2DAreas.
Definition at line 158 of file Map2DArea.cpp.
bool Map2DArea::operator== | ( | const Map2DArea & | r | ) | const |
Compares two Map2DArea.
Definition at line 170 of file Map2DArea.cpp.
yarp::math::Vec2D< double > & Map2DArea::operator[] | ( | size_t | index | ) |
Returns a vertex of the area.
index | the vertex index |
Definition at line 246 of file Map2DArea.cpp.
|
overridevirtual |
Read this object from a network connection.
Override this for your particular class.
reader | an interface to the network connection for reading |
Implements yarp::os::Portable.
Definition at line 75 of file Map2DArea.cpp.
std::string Map2DArea::toString | ( | ) | const |
Returns text representation of the area.
Definition at line 137 of file Map2DArea.cpp.
|
overridevirtual |
Write a map2DArea to a connection.
return true iff a map2DArea was written correctly
Implements yarp::os::Portable.
Definition at line 112 of file Map2DArea.cpp.
std::string yarp::dev::Nav2D::Map2DArea::map_id |
Definition at line 113 of file Map2DArea.h.
std::vector<yarp::math::Vec2D<double> > yarp::dev::Nav2D::Map2DArea::points |
Definition at line 114 of file Map2DArea.h.