32 #ifndef vtkQuaternion_h
33 #define vtkQuaternion_h
53 vtkQuaternion(
const T& w,
const T& x,
const T& y,
const T& z);
115 void Set(
const T& w,
const T& x,
const T& y,
const T& z);
117 void Get(T quat[4])
const;
122 void SetW(
const T& w);
123 const T&
GetW()
const;
128 void SetX(
const T& x);
129 const T&
GetX()
const;
134 void SetY(
const T& y);
135 const T&
GetY()
const;
140 void SetZ(
const T& z);
141 const T&
GetZ()
const;
150 const T& angle,
const T& x,
const T& y,
const T& z);
210 #define vtkQuaternionIdentity(quaternionType, type) \
211 quaternionType Identity() const \
213 return quaternionType(vtkQuaternion<type>::Identity().GetData()); \
215 #define vtkQuaternionNormalized(quaternionType, type) \
216 quaternionType Normalized() const \
218 return quaternionType(vtkQuaternion<type>::Normalized().GetData()); \
220 #define vtkQuaternionConjugated(quaternionType, type) \
221 quaternionType Conjugated() const \
223 return quaternionType(vtkQuaternion<type>::Conjugated().GetData()); \
225 #define vtkQuaternionInverse(quaternionType, type) \
226 quaternionType Inverse() const \
228 return quaternionType(vtkQuaternion<type>::Inverse().GetData()); \
230 #define vtkQuaternionUnitLog(quaternionType, type) \
231 quaternionType UnitLog() const \
233 return quaternionType( \
234 vtkQuaternion<type>::UnitLog().GetData()); \
236 #define vtkQuaternionUnitExp(quaternionType, type) \
237 quaternionType UnitExp() const \
239 return quaternionType( \
240 vtkQuaternion<type>::UnitExp().GetData()); \
242 #define vtkQuaternionNormalizedWithAngleInDegrees(quaternionType, type) \
243 quaternionType NormalizedWithAngleInDegrees() const \
245 return quaternionType( \
246 vtkQuaternion<type>::NormalizedWithAngleInDegrees().GetData()); \
248 #define vtkQuaternionSlerp(quaternionType, type) \
249 quaternionType Slerp(type t, const quaternionType& q) const \
251 return quaternionType( \
252 vtkQuaternion<type>::Slerp(t, q).GetData()); \
254 #define vtkQuaternionInnerPoint(quaternionType, type) \
255 quaternionType InnerPoint(const quaternionType& q1, \
256 const quaternionType& q2) const \
258 return quaternionType( \
259 vtkQuaternion<type>::InnerPoint(q1, q2).GetData()); \
261 #define vtkQuaternionOperatorPlus(quaternionType, type) \
262 inline quaternionType operator+(const quaternionType& q) const \
264 return quaternionType( ( \
265 static_cast< vtkQuaternion<type> > (*this) + \
266 static_cast< vtkQuaternion<type> > (q)).GetData()); \
268 #define vtkQuaternionOperatorMinus(quaternionType, type) \
269 inline quaternionType operator-(const quaternionType& q) const \
271 return quaternionType( ( \
272 static_cast< vtkQuaternion<type> > (*this) - \
273 static_cast< vtkQuaternion<type> > (q)).GetData()); \
275 #define vtkQuaternionOperatorMultiply(quaternionType, type) \
276 inline quaternionType operator*(const quaternionType& q) const \
278 return quaternionType( ( \
279 static_cast< vtkQuaternion<type> > (*this) * \
280 static_cast< vtkQuaternion<type> > (q)).GetData()); \
282 #define vtkQuaternionOperatorMultiplyScalar(quaternionType, type) \
283 inline quaternionType operator*(const type& scalar) const \
285 return quaternionType( ( \
286 static_cast< vtkQuaternion<type> > (*this) * \
287 scalar).GetData()); \
289 #define vtkQuaternionOperatorDivide(quaternionType, type) \
290 inline quaternionType operator/(const quaternionType& q) const \
292 return quaternionType( ( \
293 static_cast< vtkQuaternion<type> > (*this) / \
294 static_cast< vtkQuaternion<type> > (q)).GetData()); \
296 #define vtkQuaternionOperatorDivideScalar(quaternionType, type) \
297 inline quaternionType operator/(const type& scalar) const \
299 return quaternionType( ( \
300 static_cast< vtkQuaternion<type> > (*this) / \
301 scalar).GetData()); \
305 #define vtkQuaternionOperatorMacro(quaternionType, type) \
306 vtkQuaternionIdentity(quaternionType, type) \
307 vtkQuaternionNormalized(quaternionType, type) \
308 vtkQuaternionConjugated(quaternionType, type) \
309 vtkQuaternionInverse(quaternionType, type) \
310 vtkQuaternionUnitLog(quaternionType, type) \
311 vtkQuaternionUnitExp(quaternionType, type) \
312 vtkQuaternionNormalizedWithAngleInDegrees(quaternionType, type) \
313 vtkQuaternionSlerp(quaternionType, type) \
314 vtkQuaternionInnerPoint(quaternionType, type) \
315 vtkQuaternionOperatorPlus(quaternionType, type) \
316 vtkQuaternionOperatorMinus(quaternionType, type) \
317 vtkQuaternionOperatorMultiply(quaternionType, type) \
318 vtkQuaternionOperatorMultiplyScalar(quaternionType, type) \
319 vtkQuaternionOperatorDivide(quaternionType, type) \
320 vtkQuaternionOperatorDivideScalar(quaternionType, type)
356 #include "vtkQuaternion.txx"
358 #endif // vtkQuaternion_h
vtkQuaternion< T > UnitLog() const
vtkQuaternionf(float scalar)
void ToMatrix3x3(T A[3][3]) const
vtkQuaternion< T > operator/(const vtkQuaternion< T > &q) const
vtkQuaterniond(double w, double x, double y, double z)
void NormalizeWithAngleInDegrees()
void operator/=(const T &scalar)
vtkQuaternion< T > operator-(const vtkQuaternion< T > &q) const
vtkQuaternion< T > Normalized() const
vtkQuaternion< T > NormalizedWithAngleInDegrees() const
templated base type for storage of quaternions.
vtkQuaternion< T > UnitExp() const
void SetRotationAngleAndAxis(T angle, T axis[3])
T GetRotationAngleAndAxis(T axis[3]) const
vtkQuaterniond(double scalar)
void Get(T quat[4]) const
vtkQuaternionOperatorMacro(vtkQuaterniond, double)
vtkQuaternion< T > Slerp(T t, const vtkQuaternion< T > &q) const
vtkQuaternion(const T *init)
vtkQuaternionf(const float *init)
templated base type for containers of constant size.
void FromMatrix3x3(const T A[3][3])
vtkQuaternion< CastTo > Cast() const
vtkQuaternion< T > InnerPoint(const vtkQuaternion< T > &q1, const vtkQuaternion< T > &q2) const
vtkQuaternionf(float w, float x, float y, float z)
vtkQuaternion< T > operator+(const vtkQuaternion< T > &q) const
vtkQuaternion< T > Inverse() const
#define vtkQuaternionOperatorMacro(quaternionType, type)
vtkQuaterniond(const double *init)
vtkQuaternion(const T &scalar)
void Set(const T &w, const T &x, const T &y, const T &z)
VTKWRAPPINGJAVA_EXPORT jlong q(JNIEnv *env, jobject obj)
void operator*=(const T &scalar) const
vtkQuaternion< T > operator*(const vtkQuaternion< T > &q) const
static vtkQuaternion< T > Identity()
vtkQuaternion< T > Conjugated() const