20 #define thisTTClass Cartesian3DUnit
21 #define thisTTClassName "unit.cart3d"
22 #define thisTTClassTags "dataspace.unit, position"
28 Cartesian3DUnit::~Cartesian3DUnit(){;}
45 #undef thisTTClassName
46 #undef thisTTClassTags
50 #define thisTTClass Cartesian2DUnit
51 #define thisTTClassName "unit.cart2d"
52 #define thisTTClassTags "dataspace.unit, position"
58 Cartesian2DUnit::~Cartesian2DUnit(){;}
82 #undef thisTTClassName
83 #undef thisTTClassTags
87 #define thisTTClass SphericalUnit
88 #define thisTTClassName "unit.spherical"
89 #define thisTTClassTags "dataspace.unit, position"
95 SphericalUnit::~SphericalUnit(){;}
114 output[0] = sin(aa) * temp;
115 output[1] = cos(aa) * temp;
116 output[2] = sin(ee) * dd;
131 temp = (xx * xx) + (yy * yy);
136 output[2] = pow((temp + (zz * zz)), 0.5);
141 #undef thisTTClassName
142 #undef thisTTClassTags
146 #define thisTTClass PolarUnit
147 #define thisTTClassName "unit.polar"
148 #define thisTTClassTags "dataspace.unit, position"
154 PolarUnit::~PolarUnit(){;}
166 output[0] = sin(aa) * dd;
167 output[1] = cos(aa) * dd;
182 output[1] = pow(((xx * xx) + (yy * yy)), 0.5);
187 #undef thisTTClassName
188 #undef thisTTClassTags
192 #define thisTTClass OpenGlUnit
193 #define thisTTClassName "unit.openGL"
194 #define thisTTClassTags "dataspace.unit, position"
200 OpenGlUnit::~OpenGlUnit(){;}
214 output[1] = -1.0 * z;
232 output[2] = y * -1.0;
237 #undef thisTTClassName
238 #undef thisTTClassTags
242 #define thisTTClass CylindricalUnit
243 #define thisTTClassName "unit.cylindrical"
244 #define thisTTClassTags "dataspace.unit, position"
250 CylindricalUnit::~CylindricalUnit(){;}
266 output[0] = sin(aa) * dd;
267 output[1] = cos(aa) * dd;
284 output[0] = pow(((xx * xx) + (yy * yy)), 0.5);
291 #undef thisTTClassName
292 #undef thisTTClassTags
296 #define thisTTClass PositionDataspace
297 #define thisTTClassName "dataspace.position"
298 #define thisTTClassTags "foundationDataspaceLib, dataspace, position"
303 registerUnit(
TT(
"unit.cart3d"),
TT(
"cart3D"));
304 registerUnit(
TT(
"unit.cart3d"),
TT(
"xyz"));
305 registerUnit(
TT(
"unit.cart2d"),
TT(
"cart2D"));
306 registerUnit(
TT(
"unit.cart2d"),
TT(
"xy"));
307 registerUnit(
TT(
"unit.spherical"),
TT(
"spherical"));
308 registerUnit(
TT(
"unit.spherical"),
TT(
"aed"));
309 registerUnit(
TT(
"unit.polar"),
TT(
"polar"));
310 registerUnit(
TT(
"unit.polar"),
TT(
"ad"));
311 registerUnit(
TT(
"unit.openGL"),
TT(
"openGL"));
312 registerUnit(
TT(
"unit.cylindrical"),
TT(
"cylindrical"));
313 registerUnit(
TT(
"unit.cylindrical"),
TT(
"daz"));
316 neutralUnit =
TT(
"xyz");
319 setInputUnit(neutralUnit);
320 setOutputUnit(neutralUnit);
324 PositionDataspace::~PositionDataspace()
330 #undef thisTTClassName
331 #undef thisTTClassTags
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.
The PositionDataspace converts between different untis describing position.
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to spherical coordinates.
void convertToNeutral(const TTValue &input, TTValue &output)
Convert from cylindrical coordinates to neutral unit.
double TTFloat64
64 bit floating point number
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to OpenGL coordinates.
#define TT
This macro is defined as a shortcut for doing a lookup in the symbol table.
TTFOUNDATION_EXPORT const TTFloat64 kTTRadiansToDegrees
Factor constant for converting radians to degrees.
Specification for the base class of each DataspaceUnit.
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to 3D Cartesian coordinates.
TTFOUNDATION_EXPORT const TTFloat64 kTTDegreesToRadians
Factor constant for converting degrees to radians.
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to 2D Cartesian coordinates.
void convertToNeutral(const TTValue &input, TTValue &output)
Convert from spherical coordinates to neutral unit.
TT_OBJECT_CONSTRUCTOR
Constructor macro.
void resize(size_type n)
Change the number of elements.
[doxygenAppendixC_copyExample]
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.