Template Class CPoint

Inheritance Relationships

Base Types

Class Documentation

template<class DERIVEDCLASS, std::size_t DIM>
class CPoint : public mrpt::poses::CPoseOrPoint<DERIVEDCLASS, DIM>, public mrpt::Stringifyable

A base class for representing a point in 2D or 3D. For more information refer to the 2D/3D Geometry tutorial online.

See also

CPoseOrPoint, CPose

Note

This class is based on the CRTP design pattern

Methods common to all 2D or 3D points

template<class OTHERCLASS>
inline void AddComponents(const OTHERCLASS &b)

Scalar addition of all coordinates. This is different from poses/point composition, which is implemented as “+” operators in classes derived from “CPose”

inline void operator*=(const double s)

Scalar multiplication.

template<class MATRIX44>
inline void getHomogeneousMatrix(MATRIX44 &out_HM) const

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

virtual std::string asString() const override

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

See also

fromString

void fromString(const std::string &s)

Set the current object value from a string generated by ‘asString’ (eg: “[0.02 1.04]” )

See also

asString

Throws:

std::exception – On invalid format

inline double operator[](unsigned int i) const
inline double &operator[](unsigned int i)

Public Functions

CPoint() = default