55 void setAllVertices(
const std::vector<double> &x,
const std::vector<double> &y );
57 void setAllVertices(
size_t nVertices,
const double *xs,
const double *ys );
59 void setAllVertices(
size_t nVertices,
const float *xs,
const float *ys );
62 void getAllVertices( std::vector<double> &x, std::vector<double> &y )
const;
65 void Clear() { TPolygon2D::clear(); }
double GetVertex_x(size_t i) const
Methods for accessing the vertexs:
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.
bool PointIntoPolygon(double x, double y) const
Check if a point is inside the polygon:
#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 the polygon.
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()
Constructor cx and cy are the "central" point coordinates (laser sensor location if applicable) This ...
size_t size(const MATRIXLIKE &m, int dim)
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE(class_name, base_name)
void Clear()
Clear the polygon, erasing all vertexs.
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>.