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

Detailed Description

Lightweight 2D point.

Allows coordinate access using [] operator.

See also
mrpt::poses::CPoint2D

Definition at line 79 of file lightweight_geom_data.h.

#include <mrpt/math/lightweight_geom_data.h>

Public Member Functions

 TPoint2D (const TPose2D &p)
 Constructor from TPose2D, discarding phi. More...
 
 TPoint2D (const TPoint3D &p)
 Constructor from TPoint3D, discarding z. More...
 
 TPoint2D (const TPose3D &p)
 Constructor from TPose3D, discarding z and the angular coordinates. More...
 
template<class DERIVEDCLASS >
 TPoint2D (const mrpt::poses::CPoseOrPoint< DERIVEDCLASS > &p)
 Constructor from CPoseOrPoint, perhaps losing 3D information. More...
 
 TPoint2D (const mrpt::utils::TPixelCoordf &p)
 Implicit transformation constructor from TPixelCoordf. More...
 
 TPoint2D (const mrpt::poses::CPoint2D &p)
 Implicit constructor from CPoint2D. More...
 
 TPoint2D (double xx, double yy)
 Constructor from coordinates. More...
 
 TPoint2D ()
 Default fast constructor. More...
 
double & operator[] (size_t i)
 Unsafe coordinate access using operator[]. More...
 
const double & operator[] (size_t i) const
 Unsafe coordinate access using operator[]. More...
 
void getAsVector (vector_double &v) const
 Transformation into vector. More...
 
bool operator< (const TPoint2D &p) const
 
TPoint2Doperator+= (const TPoint2D &p)
 
TPoint2Doperator-= (const TPoint2D &p)
 
TPoint2Doperator*= (double d)
 
TPoint2Doperator/= (double d)
 
TPoint2D operator+ (const TPoint2D &p) const
 
TPoint2D operator- (const TPoint2D &p) const
 
TPoint2D operator* (double d) const
 
TPoint2D operator/ (double d) const
 
void asString (std::string &s) const
 Returns a human-readable textual representation of the object (eg: "[0.02 1.04]" ) 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]" ) More...
 
double norm () const
 Point norm. More...
 

Static Public Member Functions

static size_t size ()
 

Public Attributes

double x
 X coordinate. More...
 
double y
 Y coordinate. More...
 

Constructor & Destructor Documentation

◆ TPoint2D() [1/8]

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

Constructor from TPose2D, discarding phi.

See also
TPose2D

◆ TPoint2D() [2/8]

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

Constructor from TPoint3D, discarding z.

See also
TPoint3D

◆ TPoint2D() [3/8]

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

Constructor from TPose3D, discarding z and the angular coordinates.

See also
TPose3D

◆ TPoint2D() [4/8]

template<class DERIVEDCLASS >
mrpt::math::TPoint2D::TPoint2D ( const mrpt::poses::CPoseOrPoint< DERIVEDCLASS > &  p)
inlineexplicit

Constructor from CPoseOrPoint, perhaps losing 3D information.

See also
CPoseOrPoint,CPoint3D,CPose2D,CPose3D

Definition at line 108 of file lightweight_geom_data.h.

◆ TPoint2D() [5/8]

mrpt::math::TPoint2D::TPoint2D ( const mrpt::utils::TPixelCoordf p)
inline

Implicit transformation constructor from TPixelCoordf.

Definition at line 111 of file lightweight_geom_data.h.

◆ TPoint2D() [6/8]

mrpt::math::TPoint2D::TPoint2D ( const mrpt::poses::CPoint2D p)

Implicit constructor from CPoint2D.

◆ TPoint2D() [7/8]

mrpt::math::TPoint2D::TPoint2D ( double  xx,
double  yy 
)
inline

Constructor from coordinates.

Definition at line 118 of file lightweight_geom_data.h.

◆ TPoint2D() [8/8]

mrpt::math::TPoint2D::TPoint2D ( )
inline

Default fast constructor.

Initializes to garbage.

Definition at line 122 of file lightweight_geom_data.h.

Member Function Documentation

◆ asString() [1/2]

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

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

See also
fromString

Definition at line 191 of file lightweight_geom_data.h.

References mrpt::mrpt::format().

◆ asString() [2/2]

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

Definition at line 192 of file lightweight_geom_data.h.

References asString().

Referenced by asString().

◆ fromString()

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

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

See also
asString
Exceptions
std::exceptionOn invalid format

◆ getAsVector()

void mrpt::math::TPoint2D::getAsVector ( vector_double v) const
inline

Transformation into vector.

Definition at line 138 of file lightweight_geom_data.h.

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

◆ norm()

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

Point norm.

Definition at line 202 of file lightweight_geom_data.h.

References mrpt::utils::square().

◆ operator*()

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

Definition at line 179 of file lightweight_geom_data.h.

◆ operator*=()

TPoint2D& mrpt::math::TPoint2D::operator*= ( double  d)
inline

Definition at line 157 of file lightweight_geom_data.h.

◆ operator+()

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

Definition at line 169 of file lightweight_geom_data.h.

◆ operator+=()

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

Definition at line 145 of file lightweight_geom_data.h.

References x, and y.

◆ operator-()

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

Definition at line 174 of file lightweight_geom_data.h.

◆ operator-=()

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

Definition at line 151 of file lightweight_geom_data.h.

References x, and y.

◆ operator/()

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

Definition at line 184 of file lightweight_geom_data.h.

◆ operator/=()

TPoint2D& mrpt::math::TPoint2D::operator/= ( double  d)
inline

Definition at line 163 of file lightweight_geom_data.h.

◆ operator<()

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

◆ operator[]() [1/2]

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

Unsafe coordinate access using operator[].

Intended for loops.

Definition at line 126 of file lightweight_geom_data.h.

◆ operator[]() [2/2]

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

Unsafe coordinate access using operator[].

Intended for loops.

Definition at line 132 of file lightweight_geom_data.h.

◆ size()

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

Definition at line 199 of file lightweight_geom_data.h.

Member Data Documentation

◆ x

double mrpt::math::TPoint2D::x

◆ y

double mrpt::math::TPoint2D::y



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