Main MRPT website > C++ reference
MRPT logo

mrpt::poses::CPoint2D Class Reference

A class used to store a 2D point. More...

#include <mrpt/poses/CPoint2D.h>

Inheritance diagram for mrpt::poses::CPoint2D:
Inheritance graph
[legend]
Collaboration diagram for mrpt::poses::CPoint2D:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CPoint2D (double x=0, double y=0)
 Constructor for initializing point coordinates.
 CPoint2D (const CPose2D &o)
 Constructor from x/y coordinates given from other pose.
 CPoint2D (const CPose3D &o)
 Constructor from x/y coordinates given from other pose.
 CPoint2D (const CPoint3D &o)
 Constructor from x/y coordinates given from a 3D point.
 CPoint2D (const mrpt::math::TPoint2D &o)
 Implicit constructor from lightweight type.
CPoint2D operator- (const CPose2D &b) const
 The operator D="this"-b is the pose inverse compounding operator, the resulting points "D" fulfils: "this" = b + D, so that: b == a + (b-a).
void getAsVector (vector_double &v) const
 Return the pose or point as a 1x2 vector: [x y].
void getHomogeneousMatrix (CMatrixDouble44 &out_HM) const
 Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (translation+orientation).
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]" ).
const double & operator[] (unsigned int i) const
double & operator[] (unsigned int i)

STL-like methods and typedefs



enum  { static_size = 2 }
typedef double value_type
 The type of the elements.
typedef double & reference
typedef const double & const_reference
typedef std::size_t size_type
typedef std::ptrdiff_t difference_type
static size_type size ()
static bool empty ()
static size_type max_size ()
static void resize (const size_t n)

Detailed Description

A class used to store a 2D point.

For a complete description of Points/Poses, see mrpt::poses::CPoseOrPoint, or refer to the 2D/3D Geometry tutorial in the wiki.

poses::CPoint2D

Homogeneous transfomation matrix

Spatial representation

1

0

0

x

0

1

0

y

0

0

1

0

0

0

0

1

CPoint2D.gif
See also:
CPoseOrPoint,CPose, CPoint

Definition at line 151 of file CPoint2D.h.


Member Typedef Documentation

Definition at line 238 of file CPoint2D.h.

Definition at line 240 of file CPoint2D.h.

Definition at line 237 of file CPoint2D.h.

typedef std::size_t mrpt::poses::CPoint2D::size_type

Definition at line 239 of file CPoint2D.h.

The type of the elements.

Definition at line 236 of file CPoint2D.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
static_size 

Definition at line 243 of file CPoint2D.h.


Constructor & Destructor Documentation

mrpt::poses::CPoint2D::CPoint2D ( double  x = 0,
double  y = 0 
)

Constructor for initializing point coordinates.

mrpt::poses::CPoint2D::CPoint2D ( const CPose2D o  )  [explicit]

Constructor from x/y coordinates given from other pose.

mrpt::poses::CPoint2D::CPoint2D ( const CPose3D o  )  [explicit]

Constructor from x/y coordinates given from other pose.

mrpt::poses::CPoint2D::CPoint2D ( const CPoint3D o  )  [explicit]

Constructor from x/y coordinates given from a 3D point.

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

Implicit constructor from lightweight type.


Member Function Documentation

std::string mrpt::poses::CPoint2D::asString (  )  const [inline]

Definition at line 199 of file CPoint2D.h.

References asString().

Referenced by asString().

void mrpt::poses::CPoint2D::asString ( std::string &  s  )  const [inline, virtual]

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

See also:
fromString

Implements mrpt::poses::CPoseOrPoint.

Definition at line 198 of file CPoint2D.h.

References mrpt::format().

static bool mrpt::poses::CPoint2D::empty (  )  [inline, static]

Definition at line 245 of file CPoint2D.h.

void mrpt::poses::CPoint2D::fromString ( const std::string &  s  )  [inline, virtual]

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

Implements mrpt::poses::CPoseOrPoint.

Definition at line 205 of file CPoint2D.h.

References ASSERTMSG_, mrpt::math::CMatrixTemplate< T >::fromMatlabStringFormat(), mrpt::math::CMatrixTemplate< T >::get_unsafe(), mrpt::math::size(), and THROW_EXCEPTION.

void mrpt::poses::CPoint2D::getAsVector ( vector_double v  )  const [virtual]

Return the pose or point as a 1x2 vector: [x y].

Implements mrpt::poses::CPoseOrPoint.

void mrpt::poses::CPoint2D::getHomogeneousMatrix ( CMatrixDouble44 out_HM  )  const [inline, virtual]

Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (translation+orientation).

See also:
getInverseHomogeneousMatrix

Implements mrpt::poses::CPoseOrPoint.

Definition at line 188 of file CPoint2D.h.

static size_type mrpt::poses::CPoint2D::max_size (  )  [inline, static]

Definition at line 246 of file CPoint2D.h.

CPoint2D mrpt::poses::CPoint2D::operator- ( const CPose2D b  )  const

The operator D="this"-b is the pose inverse compounding operator, the resulting points "D" fulfils: "this" = b + D, so that: b == a + (b-a).

double& mrpt::poses::CPoint2D::operator[] ( unsigned int  i  )  [inline]

Definition at line 223 of file CPoint2D.h.

const double& mrpt::poses::CPoint2D::operator[] ( unsigned int  i  )  const [inline]

Definition at line 213 of file CPoint2D.h.

static void mrpt::poses::CPoint2D::resize ( const size_t  n  )  [inline, static]

Definition at line 247 of file CPoint2D.h.

References mrpt::format().

static size_type mrpt::poses::CPoint2D::size (  )  [inline, static]

Definition at line 244 of file CPoint2D.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines



Page generated by Doxygen 1.6.1 for MRPT 0.9.0 SVN: at Mon Jun 7 06:47:58 UTC 2010