Jamoma API  0.6.0.a19
OrientationDataspace.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup foundationDataspaceLib
4  *
5  * @brief The #OrientationDataspace converts between different untis describing orientation.
6  *
7  * @details The neutral unit of the orientation dataspace is _quarternian_. @n
8  * @n
9  * The unit conventinos are based on SpinCalc for Matlab: http://www.mathworks.com/matlabcentral/fileexchange/20696-function-to-convert-between-dcm-euler-orientation-quaternions-and-euler-vectors
10  *
11  * @authors Nils Peters, Trond Lossius, Tim Place, ...
12  *
13  * @copyright Copyright © 2011 by Nils Peters @n
14  * This code is licensed under the terms of the "New BSD License" @n
15  * http://creativecommons.org/licenses/BSD/
16  */
17 
18 
19 #ifndef __ORIENTATIONDATASPACE_H__
20 #define __ORIENTATIONDATASPACE_H__
21 
22 #include "TTDataspace.h"
23 
24 
25 /** Base class for the orientation dataspace, provides dataspace support for converting orientation between radians and degrees.
26  *
27  * @details: Quarternian is the neutral data unit of this dataspace.
28  */
31 
32  /** Unit test for the orientation dataspace.
33  @param returnedTestInfo The outcome from the performed unit test.
34  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
35  */
36  virtual TTErr test(TTValue& returnedTestInfo);
37 };
38 
39 
40 /** Converts orientation to and from quarternian.
41  *
42  * @details This unit is denoted as "quarternian" or "quat".
43  */
46 
47 public:
48 
49  /** Convert from quarternian to neutral unit.
50  @param input Input orientation described using quarternian .
51  @param output Returned orientation, converted to neutral unit.
52  */
53  void convertToNeutral(const TTValue& input, TTValue& output);
54 
55  /** Convert from neutral unit to quarternian.
56  @param input Input orientation described using the neutral unit.
57  @param output Returned orientation, described using quarternian.
58  */
59  void convertFromNeutral(const TTValue& input, TTValue& output);
60 };
61 
62 
63 /** Converts orientation to and from Euler.
64  *
65  * @details This unit is denoted as "euler" or "ypr".
66  */
67 class EulerUnit : public TTDataObjectBase, public TTDataspaceUnit {
69 
70 public:
71 
72  /** Convert from Euler to neutral unit.
73  @param input Input orientation described using Euler .
74  @param output Returned orientation, converted to neutral unit.
75  */
76  void convertToNeutral(const TTValue& input, TTValue& output);
77 
78  /** Convert from neutral unit to Euler.
79  @param input Input orientation described using the neutral unit.
80  @param output Returned orientation, described using Euler.
81  */
82  void convertFromNeutral(const TTValue& input, TTValue& output);
83 };
84 
85 
86 /** Converts orientation to and from axis unit.
87  *
88  * @details This unit is denoted as "axis" or "xyza".
89  */
90 class AxisUnit : public TTDataObjectBase, public TTDataspaceUnit {
92 
93 public:
94 
95  /** Convert from axis unit to neutral unit.
96  @param input Input orientation described using axis unit .
97  @param output Returned orientation, converted to neutral unit.
98  */
99  void convertToNeutral(const TTValue& input, TTValue& output);
100 
101  /** Convert from neutral unit to axis unit.
102  @param input Input orientation described using the neutral unit.
103  @param output Returned orientation, described using axis unit.
104  */
105  void convertFromNeutral(const TTValue& input, TTValue& output);
106 };
107 
108 
109 
110 #endif // __ORIENTATIONDATASPACE_H__
void convertToNeutral(const TTValue &input, TTValue &output)
Convert from axis unit to neutral unit.
Converts orientation to and from axis unit.
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to Euler.
TTDataObjectBase is the base class for all data generating and processing objects.
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
Converts orientation to and from quarternian.
Specification for the base class of each DataspaceUnit.
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to axis unit.
Converts orientation to and from Euler.
void convertToNeutral(const TTValue &input, TTValue &output)
Convert from Euler to neutral unit.
Base class for the orientation dataspace, provides dataspace support for converting orientation betwe...
Specification for TTDataspace, the base class of each dataspace.
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to quarternian.
Base class for each dataspace.
Definition: TTDataspace.h:30
void convertToNeutral(const TTValue &input, TTValue &output)
Convert from quarternian to neutral unit.
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34