Main MRPT website > C++ reference for MRPT 1.5.6
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-2017, 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 
12 #include <mrpt/poses/poses_frwds.h>
13 
14 namespace 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 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,qz).
Definition: CPose3DQuat.h:41
A class used to store a 2D point.
Definition: CPoint2D.h:36
A class used to store a 3D point.
Definition: CPoint3D.h:32
const GLdouble * v
Definition: glext.h:3603
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
Definition: CPose2D.h:36
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:72
A 3D pose, with a 3D translation and a rotation in 3D parameterized in rotation-vector form (equivale...
Definition: CPose3DRotVec.h:41



Page generated by Doxygen 1.8.14 for MRPT 1.5.6 Git: 4c65e8431 Tue Apr 24 08:18:17 2018 +0200 at lun oct 28 01:35:26 CET 2019