Main MRPT website > C++ reference
MRPT logo
List of all members | 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 292 of file lightweight_geom_data.h.

#include <mrpt/math/lightweight_geom_data.h>

Public Member Functions

 TPoint3D (double xx, double yy, double zz)
 Constructor from coordinates.
 
 TPoint3D ()
 Default fast constructor.
 
 TPoint3D (const TPoint3Df &p)
 Explicit constructor from coordinates.
 
 TPoint3D (const TPoint2D &p)
 Implicit constructor from TPoint2D.
 
 TPoint3D (const TPose2D &p)
 Constructor from TPose2D, losing information.
 
 TPoint3D (const TPose3D &p)
 Constructor from TPose3D, losing information.
 
 TPoint3D (const mrpt::poses::CPoint3D &p)
 Implicit constructor from heavyweight type.
 
 TPoint3D (const mrpt::poses::CPose3D &p)
 Constructor from heavyweight 3D pose.
 
double & operator[] (size_t i)
 Unsafe coordinate access using operator[].
 
const double & operator[] (size_t i) const
 Unsafe coordinate access using operator[].
 
double distanceTo (const TPoint3D &p) const
 Point-to-point distance.
 
double sqrDistanceTo (const TPoint3D &p) const
 Point-to-point distance, squared.
 
double norm () const
 Point norm.
 
TPoint3Doperator*= (const double f)
 Point scale.
 
void getAsVector (vector_double &v) const
 Transformation into vector.
 
TPoint3Doperator+= (const TPoint3D &p)
 Translation.
 
TPoint3Doperator-= (const TPoint3D &p)
 Difference between points.
 
TPoint3D operator+ (const TPoint3D &p) const
 Points addition.
 
TPoint3D operator- (const TPoint3D &p) const
 Points substraction.
 
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]" )
 
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]" )
 

Static Public Member Functions

static size_t size ()
 

Public Attributes

double x
 X coordinate.
 
double y
 Y coordinate.
 
double z
 Z coordinate.
 

Constructor & Destructor Documentation

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

Constructor from coordinates.

Definition at line 298 of file lightweight_geom_data.h.

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

Default fast constructor.

Initializes to garbage.

Definition at line 300 of file lightweight_geom_data.h.

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

Explicit constructor from coordinates.

Definition at line 302 of file lightweight_geom_data.h.

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

Implicit constructor from TPoint2D.

Zeroes the z.

See Also
TPoint2D
mrpt::math::TPoint3D::TPoint3D ( const TPose2D p)
explicit

Constructor from TPose2D, losing information.

Zeroes the z.

See Also
TPose2D
mrpt::math::TPoint3D::TPoint3D ( const TPose3D p)
explicit

Constructor from TPose3D, losing information.

See Also
TPose3D
mrpt::math::TPoint3D::TPoint3D ( const mrpt::poses::CPoint3D p)

Implicit constructor from heavyweight type.

See Also
mrpt::poses::CPoint3D
mrpt::math::TPoint3D::TPoint3D ( const mrpt::poses::CPose3D p)
explicit

Constructor from heavyweight 3D pose.

See Also
mrpt::poses::CPose3D.

Member Function Documentation

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 416 of file lightweight_geom_data.h.

References mrpt::mrpt::format().

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

Definition at line 417 of file lightweight_geom_data.h.

References asString().

Referenced by asString().

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

Point-to-point distance.

Definition at line 343 of file lightweight_geom_data.h.

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

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
void mrpt::math::TPoint3D::getAsVector ( vector_double v) const
inline

Transformation into vector.

Definition at line 368 of file lightweight_geom_data.h.

References mrpt::dynamicsize_vector< T >::resize().

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

Point norm.

Definition at line 355 of file lightweight_geom_data.h.

References mrpt::utils::square().

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

Definition at line 403 of file lightweight_geom_data.h.

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

Point scale.

Definition at line 361 of file lightweight_geom_data.h.

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

Points addition.

Definition at line 393 of file lightweight_geom_data.h.

References x, y, and z.

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

Translation.

Definition at line 375 of file lightweight_geom_data.h.

References x, y, and z.

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

Points substraction.

Definition at line 399 of file lightweight_geom_data.h.

References x, y, and z.

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

Difference between points.

Definition at line 384 of file lightweight_geom_data.h.

References x, y, and z.

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

Definition at line 407 of file lightweight_geom_data.h.

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

Unsafe coordinate access using operator[].

Intended for loops.

Definition at line 331 of file lightweight_geom_data.h.

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

Unsafe coordinate access using operator[].

Intended for loops.

Definition at line 337 of file lightweight_geom_data.h.

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

Definition at line 424 of file lightweight_geom_data.h.

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

Point-to-point distance, squared.

Definition at line 349 of file lightweight_geom_data.h.

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

Member Data Documentation

double mrpt::math::TPoint3D::x
double mrpt::math::TPoint3D::y
double mrpt::math::TPoint3D::z



Page generated by Doxygen 1.8.3 for MRPT 0.9.6 SVN: at Fri Feb 15 22:05:02 EST 2013