Main MRPT website > C++ reference for MRPT 1.5.6
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-2017, 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 first member of a struct.
32  Basically we're defining a union between a C++ inherited type and a C encapsulated type.
33 */
34 struct XsVector3 : public XsVector {
36 #else
37 struct XsVector3 {
38  XsVector m_vector; //!< The underlying vector
39 #endif
40  XsReal XSCCONST m_fixedData[3]; //!< Fixed size storage for the components in the vector
41 
42 #ifdef __cplusplus
43 public:
44  //! \brief Constructs an empty vector3
46  {
47  //XsVector3_construct(this, 0);
48  }
49 
50  //! \brief Constructs a vector3 from an \a other XsVector
51  XsVector3(XsVector3 const& other) : XsVector(other, m_fixedData, 3, XSDF_FixedSize)
52  {
53  }
54 
55  //! \brief Constructs a vector3 from an \a other XsVector
56  XsVector3(XsVector const& other) : XsVector(other, m_fixedData, 3, XSDF_FixedSize)
57  {
58  }
59 
60  //! \brief Constructs a vector3 using the values \a x, \a y, \a z
62  {
63  m_fixedData[0] = x;
64  m_fixedData[1] = y;
65  m_fixedData[2] = z;
66  }
67 
68  //! \brief Return a 3-element zero vector
69  static XsVector3 zero3()
70  {
72  }
73 
74 // using XsVector::operator=;
75 // using XsVector::operator[];
76 #endif
77 };
78 
79 #endif // file guard
GLdouble GLdouble z
Definition: glext.h:3734
XsReal XSCCONST m_fixedData[3]
Fixed size storage for the components in the vector.
Definition: xsvector3.h:40
XsVector m_vector
The underlying vector.
Definition: xsvector3.h:38
XSTYPES_DLL_API const XsReal XsMath_zero
XSTYPES_DLL_API void XsVector3_assign(XsVector3 *thisPtr, const XsReal *src)
GLuint src
Definition: glext.h:6303
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:56
#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:16
GLenum GLint GLint y
Definition: glext.h:3516
The contained data points to a fixed-size buffer, this allows creation of dynamic objects on the stac...
Definition: xstypedefs.h:40
GLenum GLint x
Definition: glext.h:3516
XSTYPES_DLL_API void XsVector3_destruct(XsVector3 *thisPtr)
#define XSCCONST
Definition: xstypesconfig.h:55



Page generated by Doxygen 1.8.14 for MRPT 1.5.6 Git: 4c65e8431 Tue Apr 24 08:18:17 2018 +0200 at lun oct 28 01:35:26 CET 2019