MRPT
2.0.4
mrpt
poses
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
<>
24
struct
T3DTypeHelper
<
CPoint2D
>
25
{
26
enum
27
{
28
is_3D_val = 0
29
};
30
};
31
template
<>
32
struct
T3DTypeHelper
<
CPoint3D
>
33
{
34
enum
35
{
36
is_3D_val = 1
37
};
38
};
39
template
<>
40
struct
T3DTypeHelper
<
CPose2D
>
41
{
42
enum
43
{
44
is_3D_val = 0
45
};
46
};
47
template
<>
48
struct
T3DTypeHelper
<
CPose3D
>
49
{
50
enum
51
{
52
is_3D_val = 1
53
};
54
};
55
template
<>
56
struct
T3DTypeHelper
<
CPose3DQuat
>
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
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition:
BaseAppDataSource.h:15
mrpt::poses::CPose3DQuat
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,...
Definition:
CPose3DQuat.h:45
mrpt::poses::detail::pose_point_impl
Definition:
CPoseOrPoint_detail.h:65
mrpt::poses::CPose2D
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle.
Definition:
CPose2D.h:39
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition:
CPose3D.h:85
mrpt::poses::detail::T3DTypeHelper
Definition:
CPoseOrPoint_detail.h:21
mrpt::poses::detail::pose_point_impl< DERIVEDCLASS, 1 >::z
double & z()
Definition:
CPoseOrPoint_detail.h:75
poses_frwds.h
mrpt::poses::detail::pose_point_impl< DERIVEDCLASS, 1 >::z
void z(const double v)
Definition:
CPoseOrPoint_detail.h:79
mrpt::poses::CPoint2D
A class used to store a 2D point.
Definition:
CPoint2D.h:32
mrpt::poses::CPoint3D
A class used to store a 3D point.
Definition:
CPoint3D.h:31
mrpt::poses::detail::pose_point_impl< DERIVEDCLASS, 1 >::z
double z() const
Definition:
CPoseOrPoint_detail.h:71
mrpt::poses::detail::pose_point_impl< DERIVEDCLASS, 1 >::z_incr
void z_incr(const double v)
Definition:
CPoseOrPoint_detail.h:83
Page generated by
Doxygen 1.8.17
for MRPT 2.0.4 at Sun Jul 19 17:54:30 UTC 2020