Main MRPT website > C++ reference
MRPT logo
Public Member Functions | Static Public Member Functions | Public Attributes

mrpt::math::TPoint2D Struct Reference


Detailed Description

Lightweight 2D point.

Allows coordinate access using [] operator.

See also:
mrpt::poses::CPoint2D

Definition at line 67 of file lightweight_geom_data.h.

#include <mrpt/math/lightweight_geom_data.h>

List of all members.

Public Member Functions

 TPoint2D (const TPose2D &p)
 Constructor from TPose2D, discarding phi.
 TPoint2D (const TPoint3D &p)
 Constructor from TPoint3D, discarding z.
 TPoint2D (const TPose3D &p)
 Constructor from TPose3D, discarding z and the angular coordinates.
template<class DERIVEDCLASS >
 TPoint2D (const mrpt::poses::CPoseOrPoint< DERIVEDCLASS > &p)
 Constructor from CPoseOrPoint, perhaps losing 3D information.
 TPoint2D (const mrpt::utils::TPixelCoordf &p)
 Implicit transformation constructor from TPixelCoordf.
 TPoint2D (const mrpt::poses::CPoint2D &p)
 Implicit constructor from CPoint2D.
 TPoint2D (double xx, double yy)
 Constructor from coordinates.
 TPoint2D ()
 Default fast constructor.
double & operator[] (size_t i)
 Unsafe coordinate access using operator[].
const double & operator[] (size_t i) const
 Unsafe coordinate access using operator[].
void getAsVector (vector_double &v) const
 Transformation into vector.
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]" ).
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]" ).

Static Public Member Functions

static size_t size ()

Public Attributes

double x
 X coordinate.
double y
 Y coordinate.

Constructor & Destructor Documentation

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

Constructor from TPose2D, discarding phi.

See also:
TPose2D
mrpt::math::TPoint2D::TPoint2D ( const TPoint3D p  )  [explicit]

Constructor from TPoint3D, discarding z.

See also:
TPoint3D
mrpt::math::TPoint2D::TPoint2D ( const TPose3D p  )  [explicit]

Constructor from TPose3D, discarding z and the angular coordinates.

See also:
TPose3D
template<class DERIVEDCLASS >
mrpt::math::TPoint2D::TPoint2D ( const mrpt::poses::CPoseOrPoint< DERIVEDCLASS > &  p  )  [inline, explicit]

Constructor from CPoseOrPoint, perhaps losing 3D information.

See also:
CPoseOrPoint,CPoint3D,CPose2D,CPose3D

Definition at line 96 of file lightweight_geom_data.h.

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

Implicit transformation constructor from TPixelCoordf.

Definition at line 99 of file lightweight_geom_data.h.

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

Implicit constructor from CPoint2D.

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

Constructor from coordinates.

Definition at line 106 of file lightweight_geom_data.h.

mrpt::math::TPoint2D::TPoint2D (  )  [inline]

Default fast constructor.

Initializes to garbage.

Definition at line 110 of file lightweight_geom_data.h.


Member Function Documentation

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

References mrpt::format(), and internal::y.

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

Definition at line 180 of file lightweight_geom_data.h.

References asString().

Referenced by asString().

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::exception On invalid format
void mrpt::math::TPoint2D::getAsVector ( vector_double v  )  const [inline]

Transformation into vector.

Definition at line 126 of file lightweight_geom_data.h.

References mrpt::dynamicsize_vector< T >::resize(), and internal::y.

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

Definition at line 167 of file lightweight_geom_data.h.

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

Definition at line 145 of file lightweight_geom_data.h.

References internal::y.

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

Definition at line 157 of file lightweight_geom_data.h.

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

Definition at line 133 of file lightweight_geom_data.h.

References x, y, and internal::y.

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

Definition at line 162 of file lightweight_geom_data.h.

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

Definition at line 139 of file lightweight_geom_data.h.

References x, y, and internal::y.

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

Definition at line 172 of file lightweight_geom_data.h.

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

Definition at line 151 of file lightweight_geom_data.h.

References internal::y.

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

Unsafe coordinate access using operator[].

Intended for loops.

Definition at line 120 of file lightweight_geom_data.h.

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

Unsafe coordinate access using operator[].

Intended for loops.

Definition at line 114 of file lightweight_geom_data.h.

static size_t mrpt::math::TPoint2D::size (  )  [inline, static]

Definition at line 187 of file lightweight_geom_data.h.


Member Data Documentation




Page generated by Doxygen 1.7.1 for MRPT 0.9.4 SVN: at Mon Jan 10 23:33:19 UTC 2011