Main MRPT website > C++ reference for MRPT 1.4.0
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes

Detailed Description

Lightweight 3D point.

Allows coordinate access using [] operator.

See also
mrpt::poses::CPoint3D, mrpt::math::TPoint3Df

Definition at line 229 of file lightweight_geom_data.h.

#include <mrpt/math/lightweight_geom_data.h>

Public Types

enum  { static_size = 3 }
 

Public Member Functions

 TPoint3D (double xx, double yy, double zz)
 Constructor from coordinates. More...
 
 TPoint3D ()
 Default fast constructor. More...
 
 TPoint3D (const TPoint3Df &p)
 Explicit constructor from coordinates. More...
 
 TPoint3D (const TPoint2D &p)
 Implicit constructor from TPoint2D. More...
 
 TPoint3D (const TPose2D &p)
 Constructor from TPose2D, losing information. More...
 
 TPoint3D (const TPose3D &p)
 Constructor from TPose3D, losing information. More...
 
 TPoint3D (const mrpt::poses::CPoint3D &p)
 Implicit constructor from heavyweight type. More...
 
 TPoint3D (const mrpt::poses::CPose3D &p)
 Constructor from heavyweight 3D pose. More...
 
double & operator[] (size_t i)
 Coordinate access using operator[]. More...
 
const double & operator[] (size_t i) const
 Coordinate access using operator[]. More...
 
double distanceTo (const TPoint3D &p) const
 Point-to-point distance. More...
 
double sqrDistanceTo (const TPoint3D &p) const
 Point-to-point distance, squared. More...
 
double norm () const
 Point norm. More...
 
TPoint3Doperator*= (const double f)
 Point scale. More...
 
template<class VECTORLIKE >
void getAsVector (VECTORLIKE &v) const
 Transformation into vector. More...
 
TPoint3Doperator+= (const TPoint3D &p)
 Translation. More...
 
TPoint3Doperator-= (const TPoint3D &p)
 Difference between points. More...
 
TPoint3D operator+ (const TPoint3D &p) const
 Points addition. More...
 
TPoint3D operator- (const TPoint3D &p) const
 Points substraction. More...
 
TPoint3D operator* (double d) const
 
TPoint3D operator/ (double d) const
 
bool operator< (const TPoint3D &p) const
 
void asString (std::string &s) const
 Returns a human-readable textual representation of the object (eg: "[0.02 1.04 -0.8]" ) More...
 
std::string asString () const
 
void fromString (const std::string &s)
 Set the current object value from a string generated by 'asString' (eg: "[0.02 1.04 -0.8]" ) More...
 

Static Public Member Functions

static size_t size ()
 

Public Attributes

double x
 
double y
 
double z
 X,Y,Z coordinates. More...
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
static_size 

Definition at line 230 of file lightweight_geom_data.h.

Constructor & Destructor Documentation

◆ TPoint3D() [1/8]

mrpt::math::TPoint3D::TPoint3D ( double  xx,
double  yy,
double  zz 
)
inline

Constructor from coordinates.


Definition at line 234 of file lightweight_geom_data.h.

◆ TPoint3D() [2/8]

mrpt::math::TPoint3D::TPoint3D ( )
inline

Default fast constructor.

Initializes to garbage.

Definition at line 236 of file lightweight_geom_data.h.

◆ TPoint3D() [3/8]

mrpt::math::TPoint3D::TPoint3D ( const TPoint3Df p)
inlineexplicit

Explicit constructor from coordinates.


Definition at line 238 of file lightweight_geom_data.h.

◆ TPoint3D() [4/8]

mrpt::math::TPoint3D::TPoint3D ( const TPoint2D p)

Implicit constructor from TPoint2D.

Zeroes the z.

See also
TPoint2D

◆ TPoint3D() [5/8]

mrpt::math::TPoint3D::TPoint3D ( const TPose2D p)
explicit

Constructor from TPose2D, losing information.

Zeroes the z.

See also
TPose2D

◆ TPoint3D() [6/8]

mrpt::math::TPoint3D::TPoint3D ( const TPose3D p)
explicit

Constructor from TPose3D, losing information.

See also
TPose3D

◆ TPoint3D() [7/8]

mrpt::math::TPoint3D::TPoint3D ( const mrpt::poses::CPoint3D p)

Implicit constructor from heavyweight type.

See also
mrpt::poses::CPoint3D

◆ TPoint3D() [8/8]

mrpt::math::TPoint3D::TPoint3D ( const mrpt::poses::CPose3D p)
explicit

Constructor from heavyweight 3D pose.

See also
mrpt::poses::CPose3D.

Member Function Documentation

◆ asString() [1/2]

std::string mrpt::math::TPoint3D::asString ( ) const
inline

Definition at line 346 of file lightweight_geom_data.h.

References asString().

Referenced by asString().

◆ asString() [2/2]

void mrpt::math::TPoint3D::asString ( std::string &  s) const
inline

Returns a human-readable textual representation of the object (eg: "[0.02 1.04 -0.8]" )

See also
fromString

Definition at line 345 of file lightweight_geom_data.h.

References mrpt::format().

◆ distanceTo()

double mrpt::math::TPoint3D::distanceTo ( const TPoint3D p) const
inline

Point-to-point distance.

Definition at line 271 of file lightweight_geom_data.h.

References mrpt::utils::square(), x, y, and z.

◆ fromString()

void mrpt::math::TPoint3D::fromString ( const std::string &  s)

Set the current object value from a string generated by 'asString' (eg: "[0.02 1.04 -0.8]" )

See also
asString
Exceptions
std::exceptionOn invalid format

◆ getAsVector()

template<class VECTORLIKE >
void mrpt::math::TPoint3D::getAsVector ( VECTORLIKE &  v) const
inline

Transformation into vector.

Definition at line 297 of file lightweight_geom_data.h.

◆ norm()

double mrpt::math::TPoint3D::norm ( ) const
inline

Point norm.

Definition at line 283 of file lightweight_geom_data.h.

References mrpt::utils::square().

◆ operator*()

TPoint3D mrpt::math::TPoint3D::operator* ( double  d) const
inline

Definition at line 332 of file lightweight_geom_data.h.

◆ operator*=()

TPoint3D& mrpt::math::TPoint3D::operator*= ( const double  f)
inline

Point scale.

Definition at line 289 of file lightweight_geom_data.h.

◆ operator+()

TPoint3D mrpt::math::TPoint3D::operator+ ( const TPoint3D p) const
inline

Points addition.

Definition at line 322 of file lightweight_geom_data.h.

References x, y, and z.

◆ operator+=()

TPoint3D& mrpt::math::TPoint3D::operator+= ( const TPoint3D p)
inline

Translation.

Definition at line 304 of file lightweight_geom_data.h.

References x, y, and z.

◆ operator-()

TPoint3D mrpt::math::TPoint3D::operator- ( const TPoint3D p) const
inline

Points substraction.

Definition at line 328 of file lightweight_geom_data.h.

References x, y, and z.

◆ operator-=()

TPoint3D& mrpt::math::TPoint3D::operator-= ( const TPoint3D p)
inline

Difference between points.

Definition at line 313 of file lightweight_geom_data.h.

References x, y, and z.

◆ operator/()

TPoint3D mrpt::math::TPoint3D::operator/ ( double  d) const
inline

Definition at line 336 of file lightweight_geom_data.h.

◆ operator<()

bool mrpt::math::TPoint3D::operator< ( const TPoint3D p) const

◆ operator[]() [1/2]

double& mrpt::math::TPoint3D::operator[] ( size_t  i)
inline

Coordinate access using operator[].

Order: x,y,z

Definition at line 265 of file lightweight_geom_data.h.

◆ operator[]() [2/2]

const double& mrpt::math::TPoint3D::operator[] ( size_t  i) const
inline

Coordinate access using operator[].

Order: x,y,z

Definition at line 267 of file lightweight_geom_data.h.

◆ size()

static size_t mrpt::math::TPoint3D::size ( )
inlinestatic

Definition at line 353 of file lightweight_geom_data.h.

◆ sqrDistanceTo()

double mrpt::math::TPoint3D::sqrDistanceTo ( const TPoint3D p) const
inline

Point-to-point distance, squared.

Definition at line 277 of file lightweight_geom_data.h.

References mrpt::utils::square(), x, y, and z.

Member Data Documentation

◆ x

double mrpt::math::TPoint3D::x

◆ y

double mrpt::math::TPoint3D::y

◆ z

double mrpt::math::TPoint3D::z



Page generated by Doxygen 1.8.17 for MRPT 1.4.0 SVN: at Tue Mar 3 09:15:16 UTC 2020