A wrapper of a TPolygon2D class, implementing CSerializable.
Definition at line 44 of file CPolygon.h.
#include <mrpt/math/CPolygon.h>
Public Member Functions | |
CPolygon () | |
Constructor cx and cy are the "central" point coordinates (laser sensor location if applicable) This parameters are NOT used in PointIntoPolygon, so they can be ignored. | |
void | AddVertex (double x, double y) |
Add a new vertex to polygon: | |
double | GetVertex_x (size_t i) const |
Methods for accessing the vertexs: | |
double | GetVertex_y (size_t i) const |
size_t | verticesCount () const |
Returns the vertices count in the polygon: | |
void | setAllVertices (const std::vector< double > &x, const std::vector< double > &y) |
Set all vertices at once. | |
void | setAllVertices (size_t nVertices, const double *xs, const double *ys) |
Set all vertices at once. | |
void | setAllVertices (size_t nVertices, const float *xs, const float *ys) |
Set all vertices at once. | |
void | getAllVertices (std::vector< double > &x, std::vector< double > &y) const |
Get all vertices at once. | |
void | Clear () |
Clear the polygon, erasing all vertexs. | |
bool | PointIntoPolygon (double x, double y) const |
Check if a point is inside the polygon: | |
RTTI stuff | |
typedef CPolygonPtr | SmartPtr |
static mrpt::utils::CLASSINIT | _init_CPolygon |
static mrpt::utils::TRuntimeClassId | classCPolygon |
static const mrpt::utils::TRuntimeClassId * | classinfo |
static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const |
Returns information about the class of an object in runtime. | |
virtual mrpt::utils::CObject * | duplicate () const |
Returns a copy of the object, indepently of its class. | |
static mrpt::utils::CObject * | CreateObject () |
static CPolygonPtr | Create () |
A typedef for the associated smart pointer
Definition at line 47 of file CPolygon.h.
mrpt::math::CPolygon::CPolygon | ( | ) | [inline] |
Constructor cx and cy are the "central" point coordinates (laser sensor location if applicable) This parameters are NOT used in PointIntoPolygon, so they can be ignored.
Definition at line 55 of file CPolygon.h.
static const mrpt::utils::TRuntimeClassId* mrpt::math::CPolygon::_GetBaseClass | ( | ) | [static, protected] |
Reimplemented from mrpt::utils::CSerializable.
void mrpt::math::CPolygon::AddVertex | ( | double | x, |
double | y | ||
) | [inline] |
void mrpt::math::CPolygon::Clear | ( | ) | [inline] |
Clear the polygon, erasing all vertexs.
Definition at line 84 of file CPolygon.h.
static CPolygonPtr mrpt::math::CPolygon::Create | ( | ) | [static] |
static mrpt::utils::CObject* mrpt::math::CPolygon::CreateObject | ( | ) | [static] |
virtual mrpt::utils::CObject* mrpt::math::CPolygon::duplicate | ( | ) | const [virtual] |
Returns a copy of the object, indepently of its class.
Implements mrpt::utils::CObject.
void mrpt::math::CPolygon::getAllVertices | ( | std::vector< double > & | x, |
std::vector< double > & | y | ||
) | const |
Get all vertices at once.
virtual const mrpt::utils::TRuntimeClassId* mrpt::math::CPolygon::GetRuntimeClass | ( | ) | const [virtual] |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::utils::CSerializable.
double mrpt::math::CPolygon::GetVertex_x | ( | size_t | i | ) | const [inline] |
Methods for accessing the vertexs:
Definition at line 67 of file CPolygon.h.
References ASSERT_, and mrpt::math::size().
double mrpt::math::CPolygon::GetVertex_y | ( | size_t | i | ) | const [inline] |
Definition at line 68 of file CPolygon.h.
References ASSERT_, and mrpt::math::size().
bool mrpt::math::CPolygon::PointIntoPolygon | ( | double | x, |
double | y | ||
) | const [inline] |
Check if a point is inside the polygon:
Definition at line 88 of file CPolygon.h.
References mrpt::math::TPolygon2D::contains().
void mrpt::math::CPolygon::setAllVertices | ( | const std::vector< double > & | x, |
const std::vector< double > & | y | ||
) |
Set all vertices at once.
void mrpt::math::CPolygon::setAllVertices | ( | size_t | nVertices, |
const double * | xs, | ||
const double * | ys | ||
) |
Set all vertices at once.
Please use the std::vector version whenever possible unless efficiency is really an issue
void mrpt::math::CPolygon::setAllVertices | ( | size_t | nVertices, |
const float * | xs, | ||
const float * | ys | ||
) |
Set all vertices at once.
Please use the std::vector version whenever possible unless efficiency is really an issue
size_t mrpt::math::CPolygon::verticesCount | ( | ) | const [inline] |
Returns the vertices count in the polygon:
Definition at line 71 of file CPolygon.h.
References mrpt::math::size().
mrpt::utils::CLASSINIT mrpt::math::CPolygon::_init_CPolygon [static, protected] |
Definition at line 47 of file CPolygon.h.
Definition at line 47 of file CPolygon.h.
const mrpt::utils::TRuntimeClassId* mrpt::math::CPolygon::classinfo [static] |
Definition at line 47 of file CPolygon.h.
Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:40:17 UTC 2011 |