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



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019