Jamoma API  0.6.0.a19
AngleDataspace.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup foundationDataspaceLib
4  *
5  * @brief The #AngleDataspace converts between different measurement untis describing trigonometric angles.
6  *
7  * @details The neutral unit of the angle dataspace is _radian_.
8  *
9  * @authors Nils Peters, Trond Lossius, Tim Place, ...
10  *
11  * @copyright Copyright © 2007 by Nils Peters @n
12  * This code is licensed under the terms of the "New BSD License" @n
13  * http://creativecommons.org/licenses/BSD/
14  */
15 
16 
17 #ifndef __ANGLEDATASPACE_H__
18 #define __ANGLEDATASPACE_H__
19 
20 #include "TTDataspace.h"
21 
22 
23 /** Base class for the angle dataspace, provides dataspace support for converting angles between radians and degrees.
24  *
25  * @details: Radians is the neutral data unit of this dataspace.
26  */
28 
30 
31  /** Unit test for the angle dataspace.
32  @param returnedTestInfo The outcome from the performed unit test.
33  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
34  */
35  virtual TTErr test(TTValue& returnedTestInfo);
36 };
37 
38 
39 
40 /** Converts angles to and from radians.
41  *
42  * @details Tghis unit is denoted as "rad" or "radian".
43  */
46 
47 public:
48 
49  /** Convert from radians to neutral unit.
50  @param input Input angle described using radians .
51  @param output Returned angle, converted to neutral unit.
52  */
53  void convertToNeutral(const TTValue& input, TTValue& output);
54 
55 
56  /** Convert from neutral unit to radians.
57  @param input Input angle described using the neutral unit.
58  @param output Returned angle, described using radians.
59  */
60  void convertFromNeutral(const TTValue& input, TTValue& output);
61 };
62 
63 
64 
65 /** Converts angles to and from degrees.
66  *
67  * @details This unit is denoted as "deg" or "degree".
68  */
71 
72 public:
73 
74  /** Convert from degrees to neutral unit.
75  @param input Input angle described using degrees .
76  @param output Returned angle, converted to neutral unit.
77  */
78  void convertToNeutral(const TTValue& input, TTValue& output);
79 
80 
81  /** Convert from neutral unit to degrees.
82  @param input Input angle described using the neutral unit.
83  @param output Returned angle, described using degrees.
84  */
85  void convertFromNeutral(const TTValue& input, TTValue& output);
86 };
87 
88 
89 
90 #endif // __ANGLEDATASPACE_H__
void convertToNeutral(const TTValue &input, TTValue &output)
Convert from degrees to neutral unit.
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to degrees.
Converts angles to and from radians.
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
Specification for the base class of each DataspaceUnit.
Converts angles to and from degrees.
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
Base class for each dataspace.
Definition: TTDataspace.h:30
Base class for the angle dataspace, provides dataspace support for converting angles between radians ...
void convertToNeutral(const TTValue &input, TTValue &output)
Convert from radians to neutral unit.
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to radians.