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
GLdouble GLdouble z
Definition: glext.h:3872
XsReal XSCCONST m_fixedData[3]
Fixed size storage for the components in the vector.
Definition: xsvector3.h:46
XsVector m_vector
The underlying vector.
Definition: xsvector3.h:43
XSTYPES_DLL_API const XsReal XsMath_zero
XSTYPES_DLL_API void XsVector3_assign(XsVector3 *thisPtr, const XsReal *src)
GLuint src
Definition: glext.h:7278
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:18
double XsReal
Defines the floating point type used by the Xsens libraries.
Definition: xstypedefs.h:17
GLenum GLint GLint y
Definition: glext.h:3538
GLenum GLint x
Definition: glext.h:3538
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: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020