30 TPolygon2D::push_back(
TPoint2D(x, y));
49 const std::vector<double>& x,
const std::vector<double>& y);
52 void setAllVertices(
size_t nVertices,
const double* xs,
const double* ys);
55 void setAllVertices(
size_t nVertices,
const float* xs,
const float* ys);
58 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:
TPoint2D_< double > TPoint2D
Lightweight 2D point.
size_t size(const MATRIXLIKE &m, const int dim)
void setAllVertices(const std::vector< double > &x, const std::vector< double > &y)
Set all vertices at once.
A wrapper of a TPolygon2D class, implementing CSerializable.
bool contains(const TPoint2D &point) const
Check whether a point is inside (or within geometryEpsilon of a polygon edge).
VALUE & operator[](const KEY &key)
Write/read via [i] operator, that creates an element if it didn't exist already.
void getAllVertices(std::vector< double > &x, std::vector< double > &y) const
Get all vertices at once.
#define ASSERT_(f)
Defines an assertion mechanism.
This base provides a set of functions for maths stuff.
bool PointIntoPolygon(double x, double y) const
Check if a point is inside the polygon.
CPolygon()
Default constructor (empty polygon, 0 vertices)
The virtual base class which provides a unified interface for all persistent objects in MRPT...
void Clear()
Clear the polygon, erasing all vertices.
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
double GetVertex_y(size_t i) const
void AddVertex(double x, double y)
Add a new vertex to polygon.
void clear()
Clear the contents of this container.
2D polygon, inheriting from std::vector<TPoint2D>.