48 void setAllVertices(
const std::vector<double> &
x,
const std::vector<double> &
y );
50 void setAllVertices(
size_t nVertices,
const double *xs,
const double *ys );
52 void setAllVertices(
size_t nVertices,
const float *xs,
const float *ys );
55 void getAllVertices( std::vector<double> &
x, std::vector<double> &
y )
const;
double GetVertex_x(size_t i) const
Methods for accessing the vertices.
size_t verticesCount() const
Returns the vertices count in the polygon:
The virtual base class which provides a unified interface for all persistent objects in MRPT...
EIGEN_STRONG_INLINE void push_back(Scalar val)
Insert an element at the end of the container (for 1D vectors/arrays)
A wrapper of a TPolygon2D class, implementing CSerializable.
void clear()
Clear the contents of this container.
bool PointIntoPolygon(double x, double y) const
Check if a point is inside the polygon.
VALUE & operator[](const KEY &key)
Write/read via [i] operator, that creates an element if it didn't exist already.
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE(class_name, base_name)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
bool contains(const TPoint2D &point) const
Check whether a point is inside (or within geometryEpsilon of a polygon edge). This works for concave...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
CPolygon()
Default constructor (empty polygon, 0 vertices)
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE(class_name, base_name)
void Clear()
Clear the polygon, erasing all vertices.
double GetVertex_y(size_t i) const
void AddVertex(double x, double y)
Add a new vertex to polygon.
2D polygon, inheriting from std::vector<TPoint2D>.