Main MRPT website > C++ reference for MRPT 1.4.0
CPoseOrPoint_detail.h
Go to the documentation of this file.
1/* +---------------------------------------------------------------------------+
2 | Mobile Robot Programming Toolkit (MRPT) |
3 | http://www.mrpt.org/ |
4 | |
5 | Copyright (c) 2005-2016, Individual contributors, see AUTHORS file |
6 | See: http://www.mrpt.org/Authors - All rights reserved. |
7 | Released under BSD License. See details in http://www.mrpt.org/License |
8 +---------------------------------------------------------------------------+ */
9#ifndef CPOSEORPOINT_DETAIL_H
10#define CPOSEORPOINT_DETAIL_H
11
13
14namespace mrpt
15{
16 namespace poses
17 {
18 /** Internal, auxiliary templates for MRPT classes */
19 namespace detail
20 {
21 template <class POSEORPOINT> struct T3DTypeHelper; // generic version. Specialized below.
22
23 template <> struct T3DTypeHelper<CPoint2D> { enum { is_3D_val = 0 }; };
24 template <> struct T3DTypeHelper<CPoint3D> { enum { is_3D_val = 1 }; };
25 template <> struct T3DTypeHelper<CPose2D> { enum { is_3D_val = 0 }; };
26 template <> struct T3DTypeHelper<CPose3D> { enum { is_3D_val = 1 }; };
27 template <> struct T3DTypeHelper<CPose3DQuat> { enum { is_3D_val = 1 }; };
28 template <> struct T3DTypeHelper<CPose3DRotVec> { enum { is_3D_val = 1 }; };
29
30
31 template <class DERIVEDCLASS, int IS3D> struct pose_point_impl; // generic template, specialized below:
32
33 // Extra members for 3D implementation:
34 template <class DERIVEDCLASS> struct pose_point_impl<DERIVEDCLASS,1>
35 {
36 inline double z() const /*!< Get Z coord. */ { return static_cast<const DERIVEDCLASS*>(this)->m_coords[2]; }
37 inline double &z() /*!< Get ref to Z coord. */ { return static_cast<DERIVEDCLASS*>(this)->m_coords[2]; }
38 inline void z(const double v) /*!< Set Z coord. */ { static_cast<DERIVEDCLASS*>(this)->m_coords[2]=v; }
39 inline void z_incr(const double v) /*!< Z+=v */ { static_cast<DERIVEDCLASS*>(this)->m_coords[2]+=v; }
40 };
41
42 // Extra members for 2D implementation:
43 template <class DERIVEDCLASS> struct pose_point_impl<DERIVEDCLASS,0>
44 {
45 };
46
47 } // End of namespace
48 } // End of namespace
49} // End of namespace
50
51#endif
A class used to store a 2D point.
Definition: CPoint2D.h:37
A class used to store a 3D point.
Definition: CPoint3D.h:33
A class used to store a 2D pose.
Definition: CPose2D.h:37
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:73
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,...
Definition: CPose3DQuat.h:42
A 3D pose, with a 3D translation and a rotation in 3D parameterized in rotation-vector form (equivale...
Definition: CPose3DRotVec.h:42
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.



Page generated by Doxygen 1.9.4 for MRPT 1.4.0 SVN: at Sun Aug 14 11:28:23 UTC 2022