Jamoma API  0.6.0.a19
TTSpatEntity.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspSpatLib
4  *
5  * @brief #TTSpatEntity describes the geometry of a point, and #TTSpatSource and #TTSpatSink specialise this further for the description of sources and sinks.
6  *
7  * @details
8  *
9  * @authors Trond Lossius, Timothy Place, Nils Peters,
10  *
11  * @copyright Copyright © 2011 by Trond Lossius, Nils Peters, and Timothy Place @n
12  * This code is licensed under the terms of the "New BSD License" @n
13  * http://creativecommons.org/licenses/BSD/
14  */
15 
16 #ifndef __SPATSNAPENTITY_H__
17 #define __SPATSNAPENTITY_H__
18 
19 #include "TTDSP.h"
20 #include <array>
21 
22 /** The TTSpatEntity class describes the geometry of a point.
23  It can be used to describe a source or a sink, and includes the minimum
24  amount of descriptors as defined in the core section of the SpatDIF specs.
25  */
26 class TTSpatEntity {
27 protected:
28 
29  std::array<TTFloat64, 3> mPosition; ///< Position as Cartesian coordinates
30  std::array<TTFloat64, 4> mOrientation; ///< The orientation of the object using Euler coordinates
31  std::array<TTFloat64, 4> mData; ///< Storage for up to 4 values that can be used by subclasses
32 
33 public:
34 
35  /** Constructor.
36  */
37  TTSpatEntity();
38 
39 
40  /** Destructor.
41  */
42  virtual ~TTSpatEntity();
43 
44 
45  /** Get the current position of the point.
46  @param x Cartesian x-coordinate of the point.
47  @param y Cartesian y-coordinate of the point.
48  @param z Cartesian z-coordinate of the point.
49  */
50  void getPosition(TTFloat64& x, TTFloat64& y, TTFloat64& z);
51 
52 
53  /** Set the position of the point.
54  @param x Cartesian x-coordinate of the point.
55  @param y Cartesian y-coordinate of the point.
56  @param z Cartesian z-coordinate of the point.
57  */
59 
60 
61  /** Get the orientation of the point expressed as quaternions.
62  @param q1 First coordinate of the point.
63  @param q2 Second coordinate of the point.
64  @param q3 Third coordinate of the point.
65  @param q4 Fourth coordinate of the point.
66  */
67  void getOrientation(TTFloat64& q1, TTFloat64& q2, TTFloat64& q3, TTFloat64& q4);
68 
69 
70  /** Set the orientation of the point expressed as quaternions.
71  @param q1 First coordinate of the point.
72  @param q2 Second coordinate of the point.
73  @param q3 Third coordinate of the point.
74  @param q4 Fourth coordinate of the point.
75  */
77 
78 
79 
80 };
81 
82 
83 /** The #TTSpatSource class extends and specialise the #TTSpatEntity class to provide attributes and methods suitable for the description of a source.
84  @details Actually #TTSpatSource provides no specialization at this time
85  */
86 class TTSpatSource : public TTSpatEntity {
87  // no specialization at this time
88 };
89 
90 
91 /** The #TTSpatSink class extends and specialise the #TTSpatEntity class to provide attributes and methods suitable for the description of a sink.
92  @details Actually #TTSpatSink provides no specialization at this time
93  */
94 class TTSpatSink : public TTSpatEntity {
95  // no specialization at this time
96 };
97 
98 
99 /** Pointer to a vector of #TTSpatEntity points.
100  @ingroup typedefs
101  */
102 typedef std::vector<TTSpatEntity> TTSpatEntityVector;
103 
104 
105 /** Pointer to a vector of #TTSpatSource points.
106  @ingroup typedefs
107  */
108 typedef std::vector<TTSpatSource> TTSpatSourceVector;
109 
110 
111 /** Pointer to a vector of #TTSpatSink points.
112  @ingroup typedefs
113  */
114 typedef std::vector<TTSpatSink> TTSpatSinkVector;
115 
116 
117 
118 #endif // __SPATSNAPENTITY_H__
The TTSpatSource class extends and specialise the TTSpatEntity class to provide attributes and method...
Definition: TTSpatEntity.h:86
std::vector< TTSpatEntity > TTSpatEntityVector
Pointer to a vector of TTSpatEntity points.
Definition: TTSpatEntity.h:102
std::array< TTFloat64, 4 > mData
Storage for up to 4 values that can be used by subclasses.
Definition: TTSpatEntity.h:31
Jamoma DSP Library.
virtual ~TTSpatEntity()
Destructor.
double TTFloat64
64 bit floating point number
Definition: TTBase.h:188
TTSpatEntity()
Constructor.
void setPosition(TTFloat64 x, TTFloat64 y, TTFloat64 z)
Set the position of the point.
std::array< TTFloat64, 3 > mPosition
Position as Cartesian coordinates.
Definition: TTSpatEntity.h:29
The TTSpatEntity class describes the geometry of a point.
Definition: TTSpatEntity.h:26
void setOrientation(TTFloat64 q1, TTFloat64 q2, TTFloat64 q3, TTFloat64 q4)
Set the orientation of the point expressed as quaternions.
std::vector< TTSpatSource > TTSpatSourceVector
Pointer to a vector of TTSpatSource points.
Definition: TTSpatEntity.h:108
void getOrientation(TTFloat64 &q1, TTFloat64 &q2, TTFloat64 &q3, TTFloat64 &q4)
Get the orientation of the point expressed as quaternions.
std::vector< TTSpatSink > TTSpatSinkVector
Pointer to a vector of TTSpatSink points.
Definition: TTSpatEntity.h:114
void getPosition(TTFloat64 &x, TTFloat64 &y, TTFloat64 &z)
Get the current position of the point.
The TTSpatSink class extends and specialise the TTSpatEntity class to provide attributes and methods ...
Definition: TTSpatEntity.h:94
std::array< TTFloat64, 4 > mOrientation
The orientation of the object using Euler coordinates.
Definition: TTSpatEntity.h:30