38 mrpt::math::CArrayDouble<3> m_coords;
42 inline CPoint3D(const
double x=0,const
double y=0,const
double z=0) { m_coords[0]= x; m_coords[1]=y; m_coords[2]=z; }
51 explicit CPoint3D(
const CPose3D &p);
54 explicit CPoint3D(
const CPose2D &p);
72 enum { is_3D_val = 1 };
73 static inline bool is_3D() {
return is_3D_val!=0; }
75 enum { is_PDF_val = 0 };
76 static inline bool is_PDF() {
return is_PDF_val!=0; }
90 static inline bool empty() {
return false; }
92 static inline void resize(
const size_t n) {
if (n!=
static_size)
throw std::logic_error(
format(
"Try to change the size of CPoint3D to %u.",static_cast<unsigned>(n))); }
CPose2D BASE_IMPEXP operator-(const CPose2D &p)
Unary - operator: return the inverse pose "-p" (Note that is NOT the same than a pose with negative x...
const double & const_reference
#define DEFINE_SERIALIZABLE_PRE(class_name)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
CPoint3D(const mrpt::math::TPoint3D &p)
Constructor from lightweight object.
double z
X,Y,Z coordinates.
A base class for representing a point in 2D or 3D.
class BASE_IMPEXP CSerializable
CPoint3D(const mrpt::math::CArrayDouble< 3 > &xyz)
Constructor from a XYZ 3-vector.
mrpt::math::TPoint2D BASE_IMPEXP operator+(const CPose2D &pose, const mrpt::math::TPoint2D &pnt)
Compose a 2D point from a new coordinate base given by a 2D pose.
static void resize(const size_t n)
static size_type max_size()
A class used to store a 2D point.
A class used to store a 3D point.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
A class used to store a 2D pose.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
#define DEFINE_SERIALIZABLE_POST(class_name)
double value_type
The type of the elements.
std::ptrdiff_t difference_type