Main MRPT website
>
C++ reference for MRPT 1.4.0
mrpt
poses
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
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
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition:
CParticleFilter.h:16
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:41
mrpt::poses::CPose3DRotVec
A 3D pose, with a 3D translation and a rotation in 3D parameterized in rotation-vector form (equivale...
Definition:
CPose3DRotVec.h:41
mrpt::poses::detail::pose_point_impl
Definition:
CPoseOrPoint_detail.h:31
mrpt::poses::CPose2D
A class used to store a 2D pose.
Definition:
CPose2D.h:36
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition:
CPose3D.h:72
mrpt::poses::detail::T3DTypeHelper
Definition:
CPoseOrPoint_detail.h:21
mrpt::poses::detail::pose_point_impl< DERIVEDCLASS, 1 >::z
double & z()
Definition:
CPoseOrPoint_detail.h:37
poses_frwds.h
mrpt::poses::detail::pose_point_impl< DERIVEDCLASS, 1 >::z
void z(const double v)
Definition:
CPoseOrPoint_detail.h:38
mrpt::poses::CPoint2D
A class used to store a 2D point.
Definition:
CPoint2D.h:36
mrpt::poses::CPoint3D
A class used to store a 3D point.
Definition:
CPoint3D.h:32
mrpt::poses::detail::pose_point_impl< DERIVEDCLASS, 1 >::z
double z() const
Definition:
CPoseOrPoint_detail.h:36
mrpt::poses::detail::pose_point_impl< DERIVEDCLASS, 1 >::z_incr
void z_incr(const double v)
Definition:
CPoseOrPoint_detail.h:39
Page generated by
Doxygen 1.8.16
for MRPT 1.4.0 SVN: at Mon Oct 14 23:11:08 UTC 2019