Jamoma API  0.6.0.a19
PositionDataspace.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup foundationDataspaceLib
4  *
5  * @brief The #PositionDataspace converts between different untis describing position.
6  *
7  * @details The neutral unit of the position dataspace is 3-dimensional Cartesian coordinates.
8  *
9  * @authors Nils Peters, Trond Lossius, Jan Schacher, Tim Place, ...
10  *
14  */
15
16
17 #ifndef __POSITIONDATASPACE_H__
18 #define __POSITIONDATASPACE_H__
19
20 #include "TTDataspace.h"
21
22
23 /** Base class for the position dataspace, provides dataspace support for converting position between Cartesian 2D or 3D, spherical, polar, cylindrical and OpenGL.
24  *
25  * @details: Radians is the neutral data unit of this dataspace.
26  */
29
30  /** Unit test for the position dataspace.
31  @param returnedTestInfo The outcome from the performed unit test.
32  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
33  */
34  virtual TTErr test(TTValue& returnedTestInfo);
35 };
36
37
38 /** Converts position to and from 3D Cartesian coordinates.
39  *
40  * @details This unit is denoted as "cart3D" or "xyz".
41  */
44
45 public:
46
47  /** Convert from 3D Cartesian coordinates to neutral unit.
48  @param input Input position described using 3D Cartesian coordinates .
49  @param output Returned position, converted to neutral unit.
50  */
51  void convertToNeutral(const TTValue& input, TTValue& output);
52
53  /** Convert from neutral unit to 3D Cartesian coordinates.
54  @param input Input position described using the neutral unit.
55  @param output Returned position, described using 3D Cartesian coordinates.
56  */
57  void convertFromNeutral(const TTValue& input, TTValue& output);
58 };
59
60
61 /** Converts position to and from 2D Cartesian coordinates.
62  *
63  * @details This unit is denoted as "cart2D" or "xy", and is only able to describe positions in the two-dimensional horisontal plane.
64  */
67
68 public:
69
70  /** Convert from 2D Cartesian coordinates to neutral unit.
71  @param input Input position described using 2D Cartesian coordinates .
72  @param output Returned position, converted to neutral unit.
73  */
74  void convertToNeutral(const TTValue& input, TTValue& output);
75
76  /** Convert from neutral unit to 2D Cartesian coordinates.
77  @param input Input position described using the neutral unit.
78  @param output Returned position, described using 2D Cartesian coordinates.
79  */
80  void convertFromNeutral(const TTValue& input, TTValue& output);
81 };
82
83
84 /** Converts position to and from spherical coordinates.
85  *
86  * @details This unit is denoted as "spherical" or "aed".
87 */
90
91 public:
92
93  /** Convert from spherical coordinates to neutral unit.
94  @param input Input position described using spherical coordinates .
95  @param output Returned position, converted to neutral unit.
96  */
97  void convertToNeutral(const TTValue& input, TTValue& output);
98
99  /** Convert from neutral unit to spherical coordinates.
100  @param input Input position described using the neutral unit.
101  @param output Returned position, described using spherical coordinates.
102  */
103  void convertFromNeutral(const TTValue& input, TTValue& output);
104 };
105
106
107 /** Converts position to and from polar coordinates.
108  *
109  * @details This unit is denoted as "polar" or "ad", and is only able to describe positions in the two-dimensional horisontal plane.
110 */
113
114 public:
115
116  /** Convert from polar coordinates to neutral unit.
117  @param input Input position described using polar coordinates .
118  @param output Returned position, converted to neutral unit.
119  */
120  void convertToNeutral(const TTValue& input, TTValue& output);
121
122  /** Convert from neutral unit to polar coordinates.
123  @param input Input position described using the neutral unit.
124  @param output Returned position, described using polar coordinates.
125  */
126  void convertFromNeutral(const TTValue& input, TTValue& output);
127 };
128
129
130 /** Converts position to and from OpenGL coordinates.
131  *
132  * @details This unit is denoted as "openGL".
133 */
136
137 public:
138
139  /** Convert from OpenGL coordinates to neutral unit.
140  @param input Input position described using OpenGL coordinates .
141  @param output Returned position, converted to neutral unit.
142  */
143  void convertToNeutral(const TTValue& input, TTValue& output);
144
145  /** Convert from neutral unit to OpenGL coordinates.
146  @param input Input position described using the neutral unit.
147  @param output Returned position, described using OpenGL coordinates.
148  */
149  void convertFromNeutral(const TTValue& input, TTValue& output);
150 };
151
152
153 /** Converts position to and from cylindrical coordinates.
154  *
155  * @details This unit is denoted as "cylindrical" or "daz".
156  */
159
160 public:
161
162  /** Convert from cylindrical coordinates to neutral unit.
163  @param input Input position described using cylindrical coordinates .
164  @param output Returned position, converted to neutral unit.
165  */
166  void convertToNeutral(const TTValue& input, TTValue& output);
167
168  /** Convert from neutral unit to cylindrical coordinates.
169  @param input Input position described using the neutral unit.
170  @param output Returned position, described using cylindrical coordinates.
171  */
172  void convertFromNeutral(const TTValue& input, TTValue& output);
173 };
174
175
176 #endif // __POSITIONDATASPACE_H__
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to polar coordinates.
void convertToNeutral(const TTValue &input, TTValue &output)
Convert from 2D Cartesian coordinates to neutral unit.
void convertToNeutral(const TTValue &input, TTValue &output)
Convert from 3D Cartesian coordinates to neutral unit.
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to cylindrical coordinates.
TTDataObjectBase is the base class for all data generating and processing objects.
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to spherical coordinates.
Converts position to and from 2D Cartesian coordinates.
void convertToNeutral(const TTValue &input, TTValue &output)
Convert from cylindrical coordinates to neutral unit.
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to OpenGL coordinates.
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
Converts position to and from OpenGL coordinates.
Specification for the base class of each DataspaceUnit.
Base class for the position dataspace, provides dataspace support for converting position between Car...
Converts position to and from spherical coordinates.
Specification for TTDataspace, the base class of each dataspace.
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to 3D Cartesian coordinates.
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
Converts position to and from 3D Cartesian coordinates.
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to 2D Cartesian coordinates.
Converts position to and from polar coordinates.
Base class for each dataspace.
Definition: TTDataspace.h:30
void convertToNeutral(const TTValue &input, TTValue &output)
Convert from spherical coordinates to neutral unit.
Converts position to and from cylindrical coordinates.
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34
void convertToNeutral(const TTValue &input, TTValue &output)
Convert from polar coordinates to neutral unit.
void convertToNeutral(const TTValue &input, TTValue &output)
Convert from OpenGL coordinates to neutral unit.