MRPT  2.0.1
List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
mrpt::math::TObject3D Struct Reference

Detailed Description

Standard object for storing any 3D lightweight object.

Do not inherit from this class.

See also
TPoint3D,TSegment3D,TLine3D,TPlane,TPolygon3D

Definition at line 25 of file TObject3D.h.

#include <mrpt/math/TObject3D.h>

Classes

struct  tobject3d_data_t
 Union containing pointer to actual data. More...
 

Public Member Functions

 TObject3D (const TPoint3D &p)
 Constructor from point. More...
 
 TObject3D (const TSegment3D &s)
 Constructor from segment. More...
 
 TObject3D (const TLine3D &r)
 Constructor from line. More...
 
 TObject3D (const TPolygon3D &p)
 Constructor from polygon. More...
 
 TObject3D (const TPlane &p)
 Constructor from plane. More...
 
 TObject3D ()
 Empty constructor. More...
 
 ~TObject3D ()
 Destructor. 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...
 
bool isPlane () const
 Checks whether content is a plane. More...
 
unsigned char getType () const
 Gets object type. More...
 
bool getPoint (TPoint3D &p) const
 Gets the content as a point, returning false if the type is not adequate. More...
 
bool getSegment (TSegment3D &s) const
 Gets the content as a segment, returning false if the type is not adequate. More...
 
bool getLine (TLine3D &r) const
 Gets the content as a line, returning false if the type is not adequate. More...
 
bool getPolygon (TPolygon3D &p) const
 Gets the content as a polygon, returning false if the type is not adequate. More...
 
bool getPlane (TPlane &p) const
 Gets the content as a plane, returning false if the type is not adequate. More...
 
TObject3Doperator= (const TObject3D &obj)
 Assigns another object, creating a new pointer if needed. More...
 
void operator= (const TPoint3D &p)
 Assigns a point to this object. More...
 
void operator= (const TSegment3D &s)
 Assigns a segment to this object. More...
 
void operator= (const TLine3D &l)
 Assigns a line to this object. More...
 
void operator= (const TPolygon3D &p)
 Assigns a polygon to this object. More...
 
void operator= (const TPlane &p)
 Assigns a plane to this object. More...
 
void generate2DObject (TObject2D &obj) const
 Projects into 2D space. More...
 
 TObject3D (const TObject3D &obj)
 Constructs from another object. More...
 

Static Public Member Functions

static void getPoints (const std::vector< TObject3D > &objs, std::vector< TPoint3D > &pnts)
 Static method to retrieve every point included in a vector of objects. More...
 
static void getSegments (const std::vector< TObject3D > &objs, std::vector< TSegment3D > &sgms)
 Static method to retrieve every segment included in a vector of objects. More...
 
static void getLines (const std::vector< TObject3D > &objs, std::vector< TLine3D > &lins)
 Static method to retrieve every line included in a vector of objects. More...
 
static void getPlanes (const std::vector< TObject3D > &objs, std::vector< TPlane > &plns)
 Static method to retrieve every plane included in a vector of objects. More...
 
static void getPolygons (const std::vector< TObject3D > &objs, std::vector< TPolygon3D > &polys)
 Static method to retrieve every polygon included in a vector of objects. More...
 
static void getPoints (const std::vector< TObject3D > &objs, std::vector< TPoint3D > &pnts, std::vector< TObject3D > &remainder)
 Static method to retrieve every point included in a vector of objects, returning the remaining objects in another argument. More...
 
static void getSegments (const std::vector< TObject3D > &objs, std::vector< TSegment3D > &sgms, std::vector< TObject3D > &remainder)
 Static method to retrieve every segment included in a vector of objects, returning the remaining objects in another argument. More...
 
static void getLines (const std::vector< TObject3D > &objs, std::vector< TLine3D > &lins, std::vector< TObject3D > &remainder)
 Static method to retrieve every line included in a vector of objects, returning the remaining objects in another argument. More...
 
static void getPlanes (const std::vector< TObject3D > &objs, std::vector< TPlane > &plns, std::vector< TObject3D > &remainder)
 Static method to retrieve every plane included in a vector of objects, returning the remaining objects in another argument. More...
 
static void getPolygons (const std::vector< TObject3D > &objs, std::vector< TPolygon3D > &polys, std::vector< TObject3D > &remainder)
 Static method to retrieve every polygon included in a vector of objects, returning the remaining objects in another argument. More...
 

Private Member Functions

void destroy ()
 Destroys the object and releases the pointer, if any. More...
 

Private Attributes

unsigned char type {GEOMETRIC_TYPE_UNDEFINED}
 Object type identifier. More...
 
struct mrpt::math::TObject3D::tobject3d_data_t data
 

Constructor & Destructor Documentation

◆ TObject3D() [1/7]

mrpt::math::TObject3D::TObject3D ( const TPoint3D p)
inline

Constructor from point.

Definition at line 58 of file TObject3D.h.

References data, and mrpt::math::TObject3D::tobject3d_data_t::point.

◆ TObject3D() [2/7]

mrpt::math::TObject3D::TObject3D ( const TSegment3D s)
inline

Constructor from segment.

Definition at line 65 of file TObject3D.h.

References data, and mrpt::math::TObject3D::tobject3d_data_t::segment.

◆ TObject3D() [3/7]

mrpt::math::TObject3D::TObject3D ( const TLine3D r)
inline

Constructor from line.

Definition at line 72 of file TObject3D.h.

References data, and mrpt::math::TObject3D::tobject3d_data_t::line.

◆ TObject3D() [4/7]

mrpt::math::TObject3D::TObject3D ( const TPolygon3D p)
inline

Constructor from polygon.

Definition at line 76 of file TObject3D.h.

References data, and mrpt::math::TObject3D::tobject3d_data_t::polygon.

◆ TObject3D() [5/7]

mrpt::math::TObject3D::TObject3D ( const TPlane p)
inline

Constructor from plane.

Definition at line 83 of file TObject3D.h.

References data, and mrpt::math::TObject3D::tobject3d_data_t::plane.

◆ TObject3D() [6/7]

mrpt::math::TObject3D::TObject3D ( )
inline

Empty constructor.

Definition at line 87 of file TObject3D.h.

◆ ~TObject3D()

mrpt::math::TObject3D::~TObject3D ( )
inline

Destructor.

Definition at line 91 of file TObject3D.h.

References destroy().

Here is the call graph for this function:

◆ TObject3D() [7/7]

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

Constructs from another object.

Definition at line 270 of file TObject3D.h.

References operator=().

Here is the call graph for this function:

Member Function Documentation

◆ destroy()

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

Destroys the object and releases the pointer, if any.

Definition at line 48 of file TObject3D.h.

References data, mrpt::math::GEOMETRIC_TYPE_POLYGON, mrpt::math::GEOMETRIC_TYPE_UNDEFINED, mrpt::math::TObject3D::tobject3d_data_t::polygon, and type.

Referenced by operator=(), and ~TObject3D().

Here is the caller graph for this function:

◆ generate2DObject()

void TObject3D::generate2DObject ( TObject2D obj) const

◆ getLine()

bool mrpt::math::TObject3D::getLine ( TLine3D r) const
inline

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

Definition at line 147 of file TObject3D.h.

References data, isLine(), and mrpt::math::TObject3D::tobject3d_data_t::line.

Referenced by getPlanesIntersection(), mrpt::math::intersect(), intersect(), intersectAux(), and mrpt::math::operator<<().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLines() [1/2]

void TObject3D::getLines ( const std::vector< TObject3D > &  objs,
std::vector< TLine3D > &  lins 
)
static

Static method to retrieve every line included in a vector of objects.

Definition at line 58 of file TObject3D.cpp.

◆ getLines() [2/2]

void TObject3D::getLines ( const std::vector< TObject3D > &  objs,
std::vector< TLine3D > &  lins,
std::vector< TObject3D > &  remainder 
)
static

Static method to retrieve every line included in a vector of objects, returning the remaining objects in another argument.

Definition at line 96 of file TObject3D.cpp.

◆ getPlane()

bool mrpt::math::TObject3D::getPlane ( TPlane p) const
inline

Gets the content as a plane, returning false if the type is not adequate.

Definition at line 175 of file TObject3D.h.

References data, isPlane(), and mrpt::math::TObject3D::tobject3d_data_t::plane.

Referenced by getPlanesIntersection(), mrpt::math::intersect(), and mrpt::math::operator<<().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPlanes() [1/2]

void TObject3D::getPlanes ( const std::vector< TObject3D > &  objs,
std::vector< TPlane > &  plns 
)
static

Static method to retrieve every plane included in a vector of objects.

Definition at line 64 of file TObject3D.cpp.

◆ getPlanes() [2/2]

void TObject3D::getPlanes ( const std::vector< TObject3D > &  objs,
std::vector< TPlane > &  plns,
std::vector< TObject3D > &  remainder 
)
static

Static method to retrieve every plane included in a vector of objects, returning the remaining objects in another argument.

Definition at line 106 of file TObject3D.cpp.

◆ getPoint()

bool mrpt::math::TObject3D::getPoint ( TPoint3D p) const
inline

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

Definition at line 120 of file TObject3D.h.

References data, isPoint(), and mrpt::math::TObject3D::tobject3d_data_t::point.

Referenced by getPlanesIntersection(), mrpt::math::intersect(), intersect(), intersectAux(), mrpt::maps::CHeightGridMap2D_Base::intersectLine3D(), and mrpt::math::operator<<().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPoints() [1/2]

void TObject3D::getPoints ( const std::vector< TObject3D > &  objs,
std::vector< TPoint3D > &  pnts 
)
static

Static method to retrieve every point included in a vector of objects.

Definition at line 46 of file TObject3D.cpp.

◆ getPoints() [2/2]

void TObject3D::getPoints ( const std::vector< TObject3D > &  objs,
std::vector< TPoint3D > &  pnts,
std::vector< TObject3D > &  remainder 
)
static

Static method to retrieve every point included in a vector of objects, returning the remaining objects in another argument.

Definition at line 76 of file TObject3D.cpp.

◆ getPolygon()

bool mrpt::math::TObject3D::getPolygon ( TPolygon3D p) const
inline

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

Definition at line 161 of file TObject3D.h.

References data, isPolygon(), and mrpt::math::TObject3D::tobject3d_data_t::polygon.

Referenced by mrpt::math::intersect(), and mrpt::math::operator<<().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPolygons() [1/2]

void TObject3D::getPolygons ( const std::vector< TObject3D > &  objs,
std::vector< TPolygon3D > &  polys 
)
static

Static method to retrieve every polygon included in a vector of objects.

Definition at line 70 of file TObject3D.cpp.

◆ getPolygons() [2/2]

void TObject3D::getPolygons ( const std::vector< TObject3D > &  objs,
std::vector< TPolygon3D > &  polys,
std::vector< TObject3D > &  remainder 
)
static

Static method to retrieve every polygon included in a vector of objects, returning the remaining objects in another argument.

Definition at line 116 of file TObject3D.cpp.

◆ getSegment()

bool mrpt::math::TObject3D::getSegment ( TSegment3D s) const
inline

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

Definition at line 134 of file TObject3D.h.

References data, isSegment(), and mrpt::math::TObject3D::tobject3d_data_t::segment.

Referenced by mrpt::math::intersect(), intersect(), intersectAux(), and mrpt::math::operator<<().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSegments() [1/2]

void TObject3D::getSegments ( const std::vector< TObject3D > &  objs,
std::vector< TSegment3D > &  sgms 
)
static

Static method to retrieve every segment included in a vector of objects.

Definition at line 52 of file TObject3D.cpp.

◆ getSegments() [2/2]

void TObject3D::getSegments ( const std::vector< TObject3D > &  objs,
std::vector< TSegment3D > &  sgms,
std::vector< TObject3D > &  remainder 
)
static

Static method to retrieve every segment included in a vector of objects, returning the remaining objects in another argument.

Definition at line 86 of file TObject3D.cpp.

◆ getType()

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

Gets object type.

Definition at line 115 of file TObject3D.h.

References type.

Referenced by mrpt::math::operator<<().

Here is the caller graph for this function:

◆ isLine()

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

Checks whether content is a line.

Definition at line 103 of file TObject3D.h.

References mrpt::math::GEOMETRIC_TYPE_LINE, and type.

Referenced by getLine(), and mrpt::math::intersect().

Here is the caller graph for this function:

◆ isPlane()

bool mrpt::math::TObject3D::isPlane ( ) const
inline

Checks whether content is a plane.

Definition at line 111 of file TObject3D.h.

References mrpt::math::GEOMETRIC_TYPE_PLANE, and type.

Referenced by getPlane(), mrpt::math::intersect(), and intersectAux().

Here is the caller graph for this function:

◆ isPoint()

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

Checks whether content is a point.

Definition at line 95 of file TObject3D.h.

References mrpt::math::GEOMETRIC_TYPE_POINT, and type.

Referenced by getPoint(), and mrpt::math::intersect().

Here is the caller graph for this function:

◆ isPolygon()

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

Checks whether content is a polygon.

Definition at line 107 of file TObject3D.h.

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

Referenced by getPolygon().

Here is the caller graph for this function:

◆ isSegment()

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

Checks whether content is a segment.

Definition at line 99 of file TObject3D.h.

References mrpt::math::GEOMETRIC_TYPE_SEGMENT, and type.

Referenced by getSegment().

Here is the caller graph for this function:

◆ operator=() [1/6]

TObject3D& mrpt::math::TObject3D::operator= ( const TObject3D obj)
inline

Assigns another object, creating a new pointer if needed.

Definition at line 188 of file TObject3D.h.

References data, destroy(), mrpt::math::GEOMETRIC_TYPE_LINE, mrpt::math::GEOMETRIC_TYPE_PLANE, mrpt::math::GEOMETRIC_TYPE_POINT, mrpt::math::GEOMETRIC_TYPE_POLYGON, mrpt::math::GEOMETRIC_TYPE_SEGMENT, mrpt::math::GEOMETRIC_TYPE_UNDEFINED, mrpt::math::TObject3D::tobject3d_data_t::line, mrpt::math::TObject3D::tobject3d_data_t::plane, mrpt::math::TObject3D::tobject3d_data_t::point, mrpt::math::TObject3D::tobject3d_data_t::polygon, mrpt::math::TObject3D::tobject3d_data_t::segment, THROW_EXCEPTION, and type.

Referenced by TObject3D().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [2/6]

void mrpt::math::TObject3D::operator= ( const TPoint3D p)
inline

Assigns a point to this object.

Definition at line 219 of file TObject3D.h.

References data, destroy(), mrpt::math::GEOMETRIC_TYPE_POINT, mrpt::math::TObject3D::tobject3d_data_t::point, and type.

Here is the call graph for this function:

◆ operator=() [3/6]

void mrpt::math::TObject3D::operator= ( const TSegment3D s)
inline

Assigns a segment to this object.

Definition at line 228 of file TObject3D.h.

References data, destroy(), mrpt::math::GEOMETRIC_TYPE_SEGMENT, mrpt::math::TObject3D::tobject3d_data_t::segment, and type.

Here is the call graph for this function:

◆ operator=() [4/6]

void mrpt::math::TObject3D::operator= ( const TLine3D l)
inline

Assigns a line to this object.

Definition at line 237 of file TObject3D.h.

References data, destroy(), mrpt::math::GEOMETRIC_TYPE_LINE, mrpt::math::TObject3D::tobject3d_data_t::line, and type.

Here is the call graph for this function:

◆ operator=() [5/6]

void mrpt::math::TObject3D::operator= ( const TPolygon3D p)
inline

Assigns a polygon to this object.

Definition at line 246 of file TObject3D.h.

References data, destroy(), mrpt::math::GEOMETRIC_TYPE_POLYGON, mrpt::math::TObject3D::tobject3d_data_t::polygon, and type.

Here is the call graph for this function:

◆ operator=() [6/6]

void mrpt::math::TObject3D::operator= ( const TPlane p)
inline

Assigns a plane to this object.

Definition at line 255 of file TObject3D.h.

References data, destroy(), mrpt::math::GEOMETRIC_TYPE_PLANE, mrpt::math::TObject3D::tobject3d_data_t::plane, and type.

Here is the call graph for this function:

Member Data Documentation

◆ data

struct mrpt::math::TObject3D::tobject3d_data_t mrpt::math::TObject3D::data
private

◆ type

unsigned char mrpt::math::TObject3D::type {GEOMETRIC_TYPE_UNDEFINED}
private

Object type identifier.

Definition at line 31 of file TObject3D.h.

Referenced by destroy(), generate2DObject(), getType(), isLine(), isPlane(), isPoint(), isPolygon(), isSegment(), and operator=().




Page generated by Doxygen 1.8.14 for MRPT 2.0.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020