Main MRPT website > C++ reference
MRPT logo
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

Detailed Description

Standard type for storing any lightweight 2D type.

Do not inherit from this class.

See also
TPoint2D,TSegment2D,TLine2D,TPolygon2D

Definition at line 1814 of file lightweight_geom_data.h.

#include <mrpt/math/lightweight_geom_data.h>

Public Member Functions

 TObject2D (const TPoint2D &p)
 Implicit constructor from point. More...
 
 TObject2D (const TSegment2D &s)
 Implicit constructor from segment. More...
 
 TObject2D (const TLine2D &r)
 Implicit constructor from line. More...
 
 TObject2D (const TPolygon2D &p)
 Implicit constructor from polygon. More...
 
 TObject2D ()
 Implicit constructor from polygon. More...
 
 ~TObject2D ()
 Object destruction. More...
 
bool isPoint () const
 Checks whether content is a point. More...
 
bool isSegment () const
 Checks whether content is a segment. More...
 
bool isLine () const
 Checks whether content is a line. More...
 
bool isPolygon () const
 Checks whether content is a polygon. More...
 
unsigned char getType () const
 Gets content type. More...
 
bool getPoint (TPoint2D &p) const
 Gets the content as a point, returning false if the type is inadequate. More...
 
bool getSegment (TSegment2D &s) const
 Gets the content as a segment, returning false if the type is inadequate. More...
 
bool getLine (TLine2D &r) const
 Gets the content as a line, returning false if the type is inadequate. More...
 
bool getPolygon (TPolygon2D &p) const
 Gets the content as a polygon, returning false if the type is inadequate. More...
 
void operator= (const TObject2D &obj)
 Assign another TObject2D. More...
 
void operator= (const TPoint2D &p)
 Assign a point to this object. More...
 
void operator= (const TSegment2D &s)
 Assign a segment to this object. More...
 
void operator= (const TLine2D &l)
 Assign a line to this object. More...
 
void operator= (const TPolygon2D &p)
 Assign a polygon to this object. More...
 
void generate3DObject (TObject3D &obj) const
 Project into 3D space. More...
 
 TObject2D (const TObject2D &obj)
 Constructor from another TObject2D. More...
 

Static Public Member Functions

static void getPoints (const std::vector< TObject2D > &objs, std::vector< TPoint2D > &pnts)
 Static method to retrieve all the points in a vector of TObject2D. More...
 
static void getSegments (const std::vector< TObject2D > &objs, std::vector< TSegment2D > &sgms)
 Static method to retrieve all the segments in a vector of TObject2D. More...
 
static void getLines (const std::vector< TObject2D > &objs, std::vector< TLine2D > &lins)
 Static method to retrieve all the lines in a vector of TObject2D. More...
 
static void getPolygons (const std::vector< TObject2D > &objs, std::vector< TPolygon2D > &polys)
 Static method to retrieve all the polygons in a vector of TObject2D. More...
 
static void getPoints (const std::vector< TObject2D > &objs, std::vector< TPoint2D > &pnts, std::vector< TObject2D > &remainder)
 Static method to retrieve all the points in a vector of TObject2D, returning the remainder objects in another parameter. More...
 
static void getSegments (const std::vector< TObject2D > &objs, std::vector< TSegment2D > &sgms, std::vector< TObject2D > &remainder)
 Static method to retrieve all the segments in a vector of TObject2D, returning the remainder objects in another parameter. More...
 
static void getLines (const std::vector< TObject2D > &objs, std::vector< TLine2D > &lins, std::vector< TObject2D > &remainder)
 Static method to retrieve all the lines in a vector of TObject2D, returning the remainder objects in another parameter. More...
 
static void getPolygons (const std::vector< TObject2D > &objs, std::vector< TPolygon2D > &polys, std::vector< TObject2D > &remainder)
 Static method to retrieve all the polygons in a vector of TObject2D, returning the remainder objects in another parameter. More...
 

Private Member Functions

void destroy ()
 Destroys the object, releasing the pointer to the content (if any). More...
 

Private Attributes

unsigned char type
 Object type identifier. More...
 
struct {
   TPoint2D   point
 
   TSegment2D   segment
 
   TLine2D   line
 
   TPolygon2D *   polygon
 
data
 Union type storing pointers to every allowed type. More...
 

Constructor & Destructor Documentation

◆ TObject2D() [1/6]

mrpt::math::TObject2D::TObject2D ( const TPoint2D p)
inline

Implicit constructor from point.

Definition at line 1840 of file lightweight_geom_data.h.

◆ TObject2D() [2/6]

mrpt::math::TObject2D::TObject2D ( const TSegment2D s)
inline

Implicit constructor from segment.

Definition at line 1846 of file lightweight_geom_data.h.

◆ TObject2D() [3/6]

mrpt::math::TObject2D::TObject2D ( const TLine2D r)
inline

Implicit constructor from line.

Definition at line 1852 of file lightweight_geom_data.h.

◆ TObject2D() [4/6]

mrpt::math::TObject2D::TObject2D ( const TPolygon2D p)
inline

Implicit constructor from polygon.

Definition at line 1858 of file lightweight_geom_data.h.

◆ TObject2D() [5/6]

mrpt::math::TObject2D::TObject2D ( )
inline

Implicit constructor from polygon.

Definition at line 1864 of file lightweight_geom_data.h.

◆ ~TObject2D()

mrpt::math::TObject2D::~TObject2D ( )
inline

Object destruction.

Definition at line 1868 of file lightweight_geom_data.h.

◆ TObject2D() [6/6]

mrpt::math::TObject2D::TObject2D ( const TObject2D obj)
inline

Constructor from another TObject2D.

Definition at line 1997 of file lightweight_geom_data.h.

Member Function Documentation

◆ destroy()

void mrpt::math::TObject2D::destroy ( )
inlineprivate

Destroys the object, releasing the pointer to the content (if any).

Definition at line 1832 of file lightweight_geom_data.h.

References mrpt::math::GEOMETRIC_TYPE_POLYGON, and mrpt::math::GEOMETRIC_TYPE_UNDEFINED.

◆ generate3DObject()

void mrpt::math::TObject2D::generate3DObject ( TObject3D obj) const

Project into 3D space.

◆ getLine()

bool mrpt::math::TObject2D::getLine ( TLine2D r) const
inline

Gets the content as a line, returning false if the type is inadequate.

Definition at line 1922 of file lightweight_geom_data.h.

◆ getLines() [1/2]

static void mrpt::math::TObject2D::getLines ( const std::vector< TObject2D > &  objs,
std::vector< TLine2D > &  lins 
)
static

Static method to retrieve all the lines in a vector of TObject2D.

◆ getLines() [2/2]

static void mrpt::math::TObject2D::getLines ( const std::vector< TObject2D > &  objs,
std::vector< TLine2D > &  lins,
std::vector< TObject2D > &  remainder 
)
static

Static method to retrieve all the lines in a vector of TObject2D, returning the remainder objects in another parameter.

◆ getPoint()

bool mrpt::math::TObject2D::getPoint ( TPoint2D p) const
inline

Gets the content as a point, returning false if the type is inadequate.

Definition at line 1904 of file lightweight_geom_data.h.

◆ getPoints() [1/2]

static void mrpt::math::TObject2D::getPoints ( const std::vector< TObject2D > &  objs,
std::vector< TPoint2D > &  pnts 
)
static

Static method to retrieve all the points in a vector of TObject2D.

◆ getPoints() [2/2]

static void mrpt::math::TObject2D::getPoints ( const std::vector< TObject2D > &  objs,
std::vector< TPoint2D > &  pnts,
std::vector< TObject2D > &  remainder 
)
static

Static method to retrieve all the points in a vector of TObject2D, returning the remainder objects in another parameter.

◆ getPolygon()

bool mrpt::math::TObject2D::getPolygon ( TPolygon2D p) const
inline

Gets the content as a polygon, returning false if the type is inadequate.

Definition at line 1931 of file lightweight_geom_data.h.

◆ getPolygons() [1/2]

static void mrpt::math::TObject2D::getPolygons ( const std::vector< TObject2D > &  objs,
std::vector< TPolygon2D > &  polys 
)
static

Static method to retrieve all the polygons in a vector of TObject2D.

◆ getPolygons() [2/2]

static void mrpt::math::TObject2D::getPolygons ( const std::vector< TObject2D > &  objs,
std::vector< TPolygon2D > &  polys,
std::vector< TObject2D > &  remainder 
)
static

Static method to retrieve all the polygons in a vector of TObject2D, returning the remainder objects in another parameter.

◆ getSegment()

bool mrpt::math::TObject2D::getSegment ( TSegment2D s) const
inline

Gets the content as a segment, returning false if the type is inadequate.

Definition at line 1913 of file lightweight_geom_data.h.

◆ getSegments() [1/2]

static void mrpt::math::TObject2D::getSegments ( const std::vector< TObject2D > &  objs,
std::vector< TSegment2D > &  sgms 
)
static

Static method to retrieve all the segments in a vector of TObject2D.

◆ getSegments() [2/2]

static void mrpt::math::TObject2D::getSegments ( const std::vector< TObject2D > &  objs,
std::vector< TSegment2D > &  sgms,
std::vector< TObject2D > &  remainder 
)
static

Static method to retrieve all the segments in a vector of TObject2D, returning the remainder objects in another parameter.

◆ getType()

unsigned char mrpt::math::TObject2D::getType ( ) const
inline

Gets content type.

Definition at line 1898 of file lightweight_geom_data.h.

◆ isLine()

bool mrpt::math::TObject2D::isLine ( ) const
inline

Checks whether content is a line.

Definition at line 1886 of file lightweight_geom_data.h.

References mrpt::math::GEOMETRIC_TYPE_LINE.

◆ isPoint()

bool mrpt::math::TObject2D::isPoint ( ) const
inline

Checks whether content is a point.

Definition at line 1874 of file lightweight_geom_data.h.

References mrpt::math::GEOMETRIC_TYPE_POINT.

◆ isPolygon()

bool mrpt::math::TObject2D::isPolygon ( ) const
inline

Checks whether content is a polygon.

Definition at line 1892 of file lightweight_geom_data.h.

References mrpt::math::GEOMETRIC_TYPE_POLYGON.

◆ isSegment()

bool mrpt::math::TObject2D::isSegment ( ) const
inline

Checks whether content is a segment.

Definition at line 1880 of file lightweight_geom_data.h.

References mrpt::math::GEOMETRIC_TYPE_SEGMENT.

◆ operator=() [1/5]

void mrpt::math::TObject2D::operator= ( const TObject2D obj)
inline

◆ operator=() [2/5]

void mrpt::math::TObject2D::operator= ( const TPoint2D p)
inline

Assign a point to this object.

Definition at line 1961 of file lightweight_geom_data.h.

References mrpt::math::GEOMETRIC_TYPE_POINT.

◆ operator=() [3/5]

void mrpt::math::TObject2D::operator= ( const TSegment2D s)
inline

Assign a segment to this object.

Definition at line 1969 of file lightweight_geom_data.h.

References mrpt::math::GEOMETRIC_TYPE_SEGMENT.

◆ operator=() [4/5]

void mrpt::math::TObject2D::operator= ( const TLine2D l)
inline

Assign a line to this object.

Definition at line 1977 of file lightweight_geom_data.h.

References mrpt::math::GEOMETRIC_TYPE_LINE.

◆ operator=() [5/5]

void mrpt::math::TObject2D::operator= ( const TPolygon2D p)
inline

Assign a polygon to this object.

Definition at line 1985 of file lightweight_geom_data.h.

References mrpt::math::GEOMETRIC_TYPE_POLYGON.

Member Data Documentation

◆ data

struct { ... } mrpt::math::TObject2D::data

Union type storing pointers to every allowed type.

Referenced by operator=().

◆ line

TLine2D mrpt::math::TObject2D::line

Definition at line 1826 of file lightweight_geom_data.h.

Referenced by operator=().

◆ point

TPoint2D mrpt::math::TObject2D::point

Definition at line 1824 of file lightweight_geom_data.h.

Referenced by operator=().

◆ polygon

TPolygon2D* mrpt::math::TObject2D::polygon

Definition at line 1827 of file lightweight_geom_data.h.

Referenced by operator=().

◆ segment

TSegment2D mrpt::math::TObject2D::segment

Definition at line 1825 of file lightweight_geom_data.h.

Referenced by operator=().

◆ type

unsigned char mrpt::math::TObject2D::type
private

Object type identifier.

Definition at line 1819 of file lightweight_geom_data.h.

Referenced by operator=().




Page generated by Doxygen 1.8.14 for MRPT 1.0.2 SVN: at lun oct 28 00:52:41 CET 2019 Hosted on:
SourceForge.net Logo