Main MRPT website > C++ reference for MRPT 1.9.9
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-2018, 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>
22 struct T3DTypeHelper; // generic version. Specialized below.
23 
24 template <>
26 {
27  enum
28  {
29  is_3D_val = 0
30  };
31 };
32 template <>
34 {
35  enum
36  {
37  is_3D_val = 1
38  };
39 };
40 template <>
42 {
43  enum
44  {
45  is_3D_val = 0
46  };
47 };
48 template <>
50 {
51  enum
52  {
53  is_3D_val = 1
54  };
55 };
56 template <>
58 {
59  enum
60  {
61  is_3D_val = 1
62  };
63 };
64 template <>
66 {
67  enum
68  {
69  is_3D_val = 1
70  };
71 };
72 
73 template <class DERIVEDCLASS, int IS3D>
74 struct pose_point_impl; // generic template, specialized below:
75 
76 // Extra members for 3D implementation:
77 template <class DERIVEDCLASS>
78 struct pose_point_impl<DERIVEDCLASS, 1>
79 {
80  inline double z() const /*!< Get Z coord. */
81  {
82  return static_cast<const DERIVEDCLASS*>(this)->m_coords[2];
83  }
84  inline double& z() /*!< Get ref to Z coord. */
85  {
86  return static_cast<DERIVEDCLASS*>(this)->m_coords[2];
87  }
88  inline void z(const double v) /*!< Set Z coord. */
89  {
90  static_cast<DERIVEDCLASS*>(this)->m_coords[2] = v;
91  }
92  inline void z_incr(const double v) /*!< Z+=v */
93  {
94  static_cast<DERIVEDCLASS*>(this)->m_coords[2] += v;
95  }
96 };
97 
98 // Extra members for 2D implementation:
99 template <class DERIVEDCLASS>
100 struct pose_point_impl<DERIVEDCLASS, 0>
101 {
102 };
103 
104 } // End of namespace
105 } // End of namespace
106 } // End of namespace
107 
108 #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:48
A class used to store a 2D point.
Definition: CPoint2D.h:35
A class used to store a 3D point.
Definition: CPoint3D.h:33
const GLdouble * v
Definition: glext.h:3678
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:40
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
A 3D pose, with a 3D translation and a rotation in 3D parameterized in rotation-vector form (equivale...
Definition: CPose3DRotVec.h:44



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019