2D polygon, inheriting from std::vector<TPoint2D>.
Definition at line 981 of file lightweight_geom_data.h.
#include <mrpt/math/lightweight_geom_data.h>
Public Member Functions | |
double | distance (const TPoint2D &point) const |
Distance to a point. More... | |
bool | contains (const TPoint2D &point) const |
Check whether a point is inside the polygon. More... | |
void | getAsSegmentList (std::vector< TSegment2D > &v) const |
Gets as set of segments, instead of points. More... | |
void | generate3DObject (TPolygon3D &p) const |
Projects into 3D space, zeroing the z. More... | |
void | getCenter (TPoint2D &p) const |
Polygon's central point. More... | |
bool | isConvex () const |
Checks whether is convex. More... | |
void | removeRepeatedVertices () |
Erase repeated vertices. More... | |
void | removeRedundantVertices () |
Erase every redundant vertex from the polygon, saving space. More... | |
void | getPlotData (std::vector< double > &x, std::vector< double > &y) const |
Gets plot data, ready to use on a 2D plot. More... | |
TPolygon2D () | |
Default constructor. More... | |
TPolygon2D (size_t N) | |
Constructor for a given number of vertices, intializing them as garbage. More... | |
TPolygon2D (const std::vector< TPoint2D > &v) | |
Implicit constructor from a vector of 2D points. More... | |
TPolygon2D (const TPolygon3D &p) | |
Constructor from a 3D object. More... | |
Static Public Member Functions | |
static void | createRegularPolygon (size_t numEdges, double radius, TPolygon2D &poly) |
Static method to create a regular polygon, given its size and radius. More... | |
static void | createRegularPolygon (size_t numEdges, double radius, TPolygon2D &poly, const mrpt::poses::CPose2D &pose) |
Static method to create a regular polygon from its size and radius. More... | |
Public Attributes | |
T | elements |
STL member. More... | |
|
inline |
Default constructor.
Definition at line 1025 of file lightweight_geom_data.h.
|
inlineexplicit |
Constructor for a given number of vertices, intializing them as garbage.
Definition at line 1029 of file lightweight_geom_data.h.
|
inline |
Implicit constructor from a vector of 2D points.
Definition at line 1033 of file lightweight_geom_data.h.
|
explicit |
Constructor from a 3D object.
bool mrpt::math::TPolygon2D::contains | ( | const TPoint2D & | point | ) | const |
Check whether a point is inside the polygon.
Referenced by mrpt::math::CPolygon::PointIntoPolygon().
|
static |
Static method to create a regular polygon, given its size and radius.
std::logic_error | if radius is near zero or the number of edges is less than three. |
|
inlinestatic |
Static method to create a regular polygon from its size and radius.
The center will correspond to the given pose.
std::logic_error | if radius is near zero or the number of edges is less than three. |
double mrpt::math::TPolygon2D::distance | ( | const TPoint2D & | point | ) | const |
Distance to a point.
void mrpt::math::TPolygon2D::generate3DObject | ( | TPolygon3D & | p | ) | const |
Projects into 3D space, zeroing the z.
void mrpt::math::TPolygon2D::getAsSegmentList | ( | std::vector< TSegment2D > & | v | ) | const |
Gets as set of segments, instead of points.
void mrpt::math::TPolygon2D::getCenter | ( | TPoint2D & | p | ) | const |
Polygon's central point.
void mrpt::math::TPolygon2D::getPlotData | ( | std::vector< double > & | x, |
std::vector< double > & | y | ||
) | const |
Gets plot data, ready to use on a 2D plot.
bool mrpt::math::TPolygon2D::isConvex | ( | ) | const |
Checks whether is convex.
void mrpt::math::TPolygon2D::removeRedundantVertices | ( | ) |
Erase every redundant vertex from the polygon, saving space.
void mrpt::math::TPolygon2D::removeRepeatedVertices | ( | ) |
Erase repeated vertices.
|
inherited |
STL member.
Page generated by Doxygen 1.8.11 for MRPT 1.4.0 SVN:Unversioned directory at Mon Jul 4 10:31:07 UTC 2016 |