Main MRPT website > C++ reference for MRPT 1.9.9
xsvector3.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 XSVECTOR3_H
10 #define XSVECTOR3_H
11 
12 #include "xsvector.h"
13 
14 struct XsVector3;
15 #ifdef __cplusplus
16 extern "C" {
17 #else
18 typedef struct XsVector3 XsVector3;
19 #endif
20 
22 XSTYPES_DLL_API void XsVector3_assign(XsVector3* thisPtr, const XsReal* src);
25 
26 #ifdef __cplusplus
27 } // extern "C"
28 #endif
29 
30 #ifdef __cplusplus
31 /* This is allowed since the C standard says that no padding appears before the
32  first member of a struct.
33  Basically we're defining a union between a C++ inherited type and a C
34  encapsulated type.
35 */
36 struct XsVector3 : public XsVector
37 {
39 #else
40 struct XsVector3
41 {
42  /** The underlying vector */
44 #endif
45  /** Fixed size storage for the components in the vector */
47 
48 #ifdef __cplusplus
49  public:
50  //! \brief Constructs an empty vector3
52  {
53  // XsVector3_construct(this, 0);
54  }
55 
56  //! \brief Constructs a vector3 from an \a other XsVector
57  XsVector3(XsVector3 const& other)
58  : XsVector(other, m_fixedData, 3, XSDF_FixedSize)
59  {
60  }
61 
62  //! \brief Constructs a vector3 from an \a other XsVector
63  XsVector3(XsVector const& other)
64  : XsVector(other, m_fixedData, 3, XSDF_FixedSize)
65  {
66  }
67 
68  //! \brief Constructs a vector3 using the values \a x, \a y, \a z
71  {
72  m_fixedData[0] = x;
73  m_fixedData[1] = y;
74  m_fixedData[2] = z;
75  }
76 
77  //! \brief Return a 3-element zero vector
78  static XsVector3 zero3()
79  {
81  }
82 
83 // using XsVector::operator=;
84 // using XsVector::operator[];
85 #endif
86 };
87 
88 #endif // file guard
XSCCONST
#define XSCCONST
Definition: xstypesconfig.h:56
XsVector3
struct XsVector3 XsVector3
Definition: xsvector3.h:18
src
GLuint src
Definition: glext.h:7278
xsvector.h
XSDF_FixedSize
@ XSDF_FixedSize
Definition: xstypedefs.h:53
XsVector3_construct
XSTYPES_DLL_API void XsVector3_construct(XsVector3 *thisPtr, const XsReal *src)
XsVector
Definition: xsvector.h:59
XsVector3_copy
XSTYPES_DLL_API void XsVector3_copy(XsVector *copy, XsVector3 const *src)
XSCPPPROTECTED
#define XSCPPPROTECTED
Definition: xstypesconfig.h:57
XsVector3_destruct
XSTYPES_DLL_API void XsVector3_destruct(XsVector3 *thisPtr)
XsReal
double XsReal
Defines the floating point type used by the Xsens libraries.
Definition: xstypedefs.h:17
XsVector3::m_vector
XsVector m_vector
The underlying vector.
Definition: xsvector3.h:43
XsVector3_assign
XSTYPES_DLL_API void XsVector3_assign(XsVector3 *thisPtr, const XsReal *src)
XsVector3::m_fixedData
XsReal XSCCONST m_fixedData[3]
Fixed size storage for the components in the vector.
Definition: xsvector3.h:46
XsMath_zero
const XSTYPES_DLL_API XsReal XsMath_zero
XSTYPES_DLL_API
#define XSTYPES_DLL_API
Definition: xstypesconfig.h:9
z
GLdouble GLdouble z
Definition: glext.h:3872
XsVector3
Definition: xsvector3.h:40
y
GLenum GLint GLint y
Definition: glext.h:3538
x
GLenum GLint x
Definition: glext.h:3538



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST