A wrapper of a TPolygon2D class, implementing CSerializable.
#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: | |
| mrpt::utils::CObjectPtr | duplicateGetSmartPtr () const |
| Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer). | |
| CObject * | clone () const |
| Cloning interface for smart pointers. | |
| double | distance (const TPoint2D &point) const |
| Distance to a point. | |
| bool | contains (const TPoint2D &point) const |
| Check whether a point is inside the polygon. | |
| void | getAsSegmentList (std::vector< TSegment2D > &v) const |
| Gets as set of segments, instead of points. | |
| void | generate3DObject (TPolygon3D &p) const |
| Projects into 3D space, zeroing the z. | |
| void | getCenter (TPoint2D &p) const |
| Polygon's central point. | |
| bool | isConvex () const |
| Checks whether is convex. | |
| void | removeRepeatedVertices () |
| Erase repeated vertices. | |
| void | removeRedundantVertices () |
| Erase every redundant vertex from the polygon, saving space. | |
| void | getPlotData (std::vector< double > &x, std::vector< double > &y) const |
| Gets plot data, ready to use on a 2D plot. | |
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. | |
| 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. | |
Static Public Attributes | |
| static const mrpt::utils::TRuntimeClassId | classCObject |
Protected Member Functions | |
| virtual void | writeToStream (mrpt::utils::CStream &out, int *getVersion) const =0 |
| Introduces a pure virtual method responsible for writing to a CStream. | |
| virtual void | readFromStream (mrpt::utils::CStream &in, int version)=0 |
| Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori. | |
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 () |
RTTI stuff | |
| static const mrpt::utils::TRuntimeClassId | classCSerializable |
| class | mrpt::utils::CStream |
A typedef for the associated smart pointer
Definition at line 48 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 56 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 85 of file CPolygon.h.
| CObject* mrpt::utils::CObject::clone | ( | ) | const [inline, inherited] |
Cloning interface for smart pointers.
Reimplemented in mrpt::opengl::CRenderizable, and mrpt::opengl::CRenderizableDisplayList.
| bool mrpt::math::TPolygon2D::contains | ( | const TPoint2D & | point | ) | const [inherited] |
Check whether a point is inside the polygon.
Referenced by PointIntoPolygon().
| static CPolygonPtr mrpt::math::CPolygon::Create | ( | ) | [static] |
| static mrpt::utils::CObject* mrpt::math::CPolygon::CreateObject | ( | ) | [static] |
| static void mrpt::math::TPolygon2D::createRegularPolygon | ( | size_t | numEdges, |
| double | radius, | ||
| TPolygon2D & | poly | ||
| ) | [static, inherited] |
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. |
| static void mrpt::math::TPolygon2D::createRegularPolygon | ( | size_t | numEdges, |
| double | radius, | ||
| TPolygon2D & | poly, | ||
| const mrpt::poses::CPose2D & | pose | ||
| ) | [inline, static, inherited] |
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 [inherited] |
Distance to a point.
| virtual mrpt::utils::CObject* mrpt::math::CPolygon::duplicate | ( | ) | const [virtual] |
Returns a copy of the object, indepently of its class.
Implements mrpt::utils::CObject.
| mrpt::utils::CObjectPtr mrpt::utils::CObject::duplicateGetSmartPtr | ( | ) | const [inline, inherited] |
| void mrpt::math::TPolygon2D::generate3DObject | ( | TPolygon3D & | p | ) | const [inherited] |
Projects into 3D space, zeroing the z.
| void mrpt::math::CPolygon::getAllVertices | ( | std::vector< double > & | x, |
| std::vector< double > & | y | ||
| ) | const |
Get all vertices at once.
| void mrpt::math::TPolygon2D::getAsSegmentList | ( | std::vector< TSegment2D > & | v | ) | const [inherited] |
Gets as set of segments, instead of points.
| void mrpt::math::TPolygon2D::getCenter | ( | TPoint2D & | p | ) | const [inherited] |
Polygon's central point.
| void mrpt::math::TPolygon2D::getPlotData | ( | std::vector< double > & | x, |
| std::vector< double > & | y | ||
| ) | const [inherited] |
Gets plot data, ready to use on a 2D plot.
| 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 68 of file CPolygon.h.
References ASSERT_, and mrpt::math::size().
| double mrpt::math::CPolygon::GetVertex_y | ( | size_t | i | ) | const [inline] |
Definition at line 69 of file CPolygon.h.
References ASSERT_, and mrpt::math::size().
| bool mrpt::math::TPolygon2D::isConvex | ( | ) | const [inherited] |
Checks whether is convex.
| bool mrpt::math::CPolygon::PointIntoPolygon | ( | double | x, |
| double | y | ||
| ) | const [inline] |
Check if a point is inside the polygon:
Definition at line 89 of file CPolygon.h.
References mrpt::math::TPolygon2D::contains().
| virtual void mrpt::utils::CSerializable::readFromStream | ( | mrpt::utils::CStream & | in, |
| int | version | ||
| ) | [protected, pure virtual, inherited] |
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori.
| in | The input binary stream where the object data must read from. |
| version | The version of the object stored in the stream: use this version number in your code to know how to read the incoming data. |
| std::exception | On any error, see CStream::ReadBuffer |
Implemented in mrpt::math::CMatrixD, and mrpt::math::CMatrix.
| void mrpt::math::TPolygon2D::removeRedundantVertices | ( | ) | [inherited] |
Erase every redundant vertex from the polygon, saving space.
| void mrpt::math::TPolygon2D::removeRepeatedVertices | ( | ) | [inherited] |
Erase repeated vertices.
| 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 72 of file CPolygon.h.
References mrpt::math::size().
| virtual void mrpt::utils::CSerializable::writeToStream | ( | mrpt::utils::CStream & | out, |
| int * | getVersion | ||
| ) | const [protected, pure virtual, inherited] |
Introduces a pure virtual method responsible for writing to a CStream.
This can not be used directly be users, instead use "stream << object;" for writing it to a stream.
| out | The output binary stream where object must be dumped. |
| getVersion | If NULL, the object must be dumped. If not, only the version of the object dump must be returned in this pointer. This enables the versioning of objects dumping and backward compatibility with previously stored data. |
| std::exception | On any error, see CStream::WriteBuffer |
Implemented in mrpt::math::CMatrixD, and mrpt::math::CMatrix.
friend class mrpt::utils::CStream [friend, inherited] |
Reimplemented in mrpt::slam::CRandomFieldGridMap2D, mrpt::slam::CPointsMap, mrpt::slam::CObservation, mrpt::slam::CMetricMap, mrpt::opengl::CRenderizable, mrpt::poses::CPose3DQuatPDF, mrpt::poses::CPointPDF, mrpt::poses::CPose3DPDF, mrpt::poses::CPosePDF, mrpt::poses::CPoint2DPDF, mrpt::opengl::CRenderizableDisplayList, mrpt::slam::CAction, mrpt::detectors::CDetectableObject, mrpt::opengl::CTexturedObject, and mrpt::reactivenav::CHolonomicLogFileRecord.
Definition at line 56 of file CSerializable.h.
mrpt::utils::CLASSINIT mrpt::math::CPolygon::_init_CPolygon [static, protected] |
Definition at line 48 of file CPolygon.h.
const mrpt::utils::TRuntimeClassId mrpt::utils::CObject::classCObject [static, inherited] |
Definition at line 48 of file CPolygon.h.
const mrpt::utils::TRuntimeClassId mrpt::utils::CSerializable::classCSerializable [static, inherited] |
Definition at line 56 of file CSerializable.h.
const mrpt::utils::TRuntimeClassId* mrpt::math::CPolygon::classinfo [static] |
Definition at line 48 of file CPolygon.h.
| Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011 |