MRPT  2.0.0
CPoseOrPoint_detail.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 #include <mrpt/poses/poses_frwds.h>
12 
13 namespace mrpt
14 {
15 namespace poses
16 {
17 /** Internal, auxiliary templates for MRPT classes */
18 namespace detail
19 {
20 template <class POSEORPOINT>
21 struct T3DTypeHelper; // generic version. Specialized below.
22 
23 template <>
25 {
26  enum
27  {
28  is_3D_val = 0
29  };
30 };
31 template <>
33 {
34  enum
35  {
36  is_3D_val = 1
37  };
38 };
39 template <>
41 {
42  enum
43  {
44  is_3D_val = 0
45  };
46 };
47 template <>
49 {
50  enum
51  {
52  is_3D_val = 1
53  };
54 };
55 template <>
57 {
58  enum
59  {
60  is_3D_val = 1
61  };
62 };
63 
64 template <class DERIVEDCLASS, int IS3D>
65 struct pose_point_impl; // generic template, specialized below:
66 
67 // Extra members for 3D implementation:
68 template <class DERIVEDCLASS>
69 struct pose_point_impl<DERIVEDCLASS, 1>
70 {
71  inline double z() const /*!< Get Z coord. */
72  {
73  return static_cast<const DERIVEDCLASS*>(this)->m_coords[2];
74  }
75  inline double& z() /*!< Get ref to Z coord. */
76  {
77  return static_cast<DERIVEDCLASS*>(this)->m_coords[2];
78  }
79  inline void z(const double v) /*!< Set Z coord. */
80  {
81  static_cast<DERIVEDCLASS*>(this)->m_coords[2] = v;
82  }
83  inline void z_incr(const double v) /*!< Z+=v */
84  {
85  static_cast<DERIVEDCLASS*>(this)->m_coords[2] += v;
86  }
87 };
88 
89 // Extra members for 2D implementation:
90 template <class DERIVEDCLASS>
91 struct pose_point_impl<DERIVEDCLASS, 0>
92 {
93 };
94 
95 } // namespace detail
96 } // namespace poses
97 } // namespace mrpt
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,qz).
Definition: CPose3DQuat.h:45
A class used to store a 2D point.
Definition: CPoint2D.h:32
A class used to store a 3D point.
Definition: CPoint3D.h:31
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:39
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:85



Page generated by Doxygen 1.8.14 for MRPT 2.0.0 Git: b38439d21 Tue Mar 31 19:58:06 2020 +0200 at miƩ abr 1 00:50:30 CEST 2020