cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | List of all members
vctQuaternionBase< _containerType > Class Template Reference

Define a quaternion container. More...

#include <vctForwardDeclarations.h>

Inheritance diagram for vctQuaternionBase< _containerType >:
vctQuaternionRotation3Base< _containerType >

Public Types

enum  { SIZE = 4 }
 
typedef _containerType BaseType
 
typedef _containerType ContainerType
 
typedef vctQuaternionBase
< _containerType > 
ThisType
 
typedef cmnTypeTraits< value_type > TypeTraits
 

Public Member Functions

 VCT_CONTAINER_TRAITS_TYPEDEFS (typename ContainerType::value_type)
 
 vctQuaternionBase (void)
 
 vctQuaternionBase (const value_type &x, const value_type &y, const value_type &z, const value_type &r)
 
const_reference R (void) const
 
reference R (void)
 
template<class __containerTypeOther >
ThisTypeConjugateOf (const vctQuaternionBase< __containerTypeOther > &otherQuaternion)
 
ThisTypeConjugateSelf (void)
 
ThisType Conjugate (void) const
 
template<class __containerType1 , class __containerType2 >
ThisTypeProductOf (const vctQuaternionBase< __containerType1 > &quat1, const vctQuaternionBase< __containerType2 > &quat2)
 
template<class __containerType1 , class __containerType2 >
ThisTypeQuotientOf (const vctQuaternionBase< __containerType1 > &quat1, const vctQuaternionBase< __containerType2 > &quat2)
 
template<class __containerTypeOther >
ThisTypePostMultiply (const vctQuaternionBase< __containerTypeOther > &other)
 
template<class __containerTypeOther >
ThisTypePreMultiply (const vctQuaternionBase< __containerTypeOther > &other)
 
template<class __containerTypeOther >
ThisTypeDivide (const vctQuaternionBase< __containerTypeOther > &other)
 
ThisTypeDivide (const value_type s)
 

Protected Member Functions

void Allocate (void)
 
template<>
void Allocate (void)
 
template<>
void Allocate (void)
 

Detailed Description

template<class _containerType>
class vctQuaternionBase< _containerType >

Define a quaternion container.

It is important to note that the class vctQuaternion is for any quaternion, i.e. it does not necessary represent a unit quaternion.

Parameters
_baseTypeThe base class used to contain the 4 elements.
See Also
vctFixedSizeVector, vctDynamicVector

Member Typedef Documentation

template<class _containerType>
typedef _containerType vctQuaternionBase< _containerType >::BaseType
template<class _containerType>
typedef _containerType vctQuaternionBase< _containerType >::ContainerType
template<class _containerType>
typedef vctQuaternionBase<_containerType> vctQuaternionBase< _containerType >::ThisType
template<class _containerType>
typedef cmnTypeTraits<value_type> vctQuaternionBase< _containerType >::TypeTraits

Member Enumeration Documentation

template<class _containerType>
anonymous enum
Enumerator
SIZE 

Constructor & Destructor Documentation

template<class _containerType>
vctQuaternionBase< _containerType >::vctQuaternionBase ( void  )
inline

Default constructor. Does nothing.

template<class _containerType>
vctQuaternionBase< _containerType >::vctQuaternionBase ( const value_type &  x,
const value_type &  y,
const value_type &  z,
const value_type &  r 
)
inline

Constructor from 4 elements.

Parameters
xThe first imaginary component
yThe second imaginary component
zThe third imaginary component
rThe real component

Member Function Documentation

template<class _containerType>
void vctQuaternionBase< _containerType >::Allocate ( void  )
inlineprotected

Allocate memory for the underlying container if needed. By default, this methods does nothing. For any container requiring a memory allocation, it is necessary to specialize this method.

template<>
void vctQuaternionBase< vctDynamicVector< double > >::Allocate ( void   )
inlineprotected
template<>
void vctQuaternionBase< vctDynamicVector< float > >::Allocate ( void   )
inlineprotected
template<class _containerType>
ThisType vctQuaternionBase< _containerType >::Conjugate ( void  ) const
inline

Returns the conjugate of this quaternion. This method returns a copy of the conjugate and does not modify this quaternion.

template<class _containerType>
template<class __containerTypeOther >
ThisType& vctQuaternionBase< _containerType >::ConjugateOf ( const vctQuaternionBase< __containerTypeOther > &  otherQuaternion)
inline

Sets this quaternion as the conjugate of another one.

Parameters
otherQuaternionQuaternion used to compute the conjugate.
template<class _containerType>
ThisType& vctQuaternionBase< _containerType >::ConjugateSelf ( void  )
inline

Replaces this quaternion by its conjugate.

template<class _containerType>
template<class __containerTypeOther >
ThisType& vctQuaternionBase< _containerType >::Divide ( const vctQuaternionBase< __containerTypeOther > &  other)
inline

Divide this quaternion by another, i.e., this = this / other.

template<class _containerType>
ThisType& vctQuaternionBase< _containerType >::Divide ( const value_type  s)
inline

Divide this quaternion by a scalar: equal to elementwise division. The method re-implements vector elementwise division, which is otherwise shadowed by the Divide(ThisType) method.

template<class _containerType>
template<class __containerTypeOther >
ThisType& vctQuaternionBase< _containerType >::PostMultiply ( const vctQuaternionBase< __containerTypeOther > &  other)
inline

Post-multiply this quaternion by another, i.e., this = this * other.

Note
Quaternion product is non-commutative.
template<class _containerType>
template<class __containerTypeOther >
ThisType& vctQuaternionBase< _containerType >::PreMultiply ( const vctQuaternionBase< __containerTypeOther > &  other)
inline

Pre-multiply this quaternion by another, i.e., this = other * this.

Note
Quaternion product is non-commutative.
template<class _containerType>
template<class __containerType1 , class __containerType2 >
ThisType& vctQuaternionBase< _containerType >::ProductOf ( const vctQuaternionBase< __containerType1 > &  quat1,
const vctQuaternionBase< __containerType2 > &  quat2 
)
inline

Set this quaternion as the product of two other ones.

Parameters
quat1Left operand
quat2Right operand
Note
Quaternion product in non-commutative.
template<class _containerType>
template<class __containerType1 , class __containerType2 >
ThisType& vctQuaternionBase< _containerType >::QuotientOf ( const vctQuaternionBase< __containerType1 > &  quat1,
const vctQuaternionBase< __containerType2 > &  quat2 
)
inline

Compute the quotient quat1 / quat2. The reciprocal of a quaternion q is conj(q) / norm(q)

template<class _containerType>
const_reference vctQuaternionBase< _containerType >::R ( void  ) const
inline

Returns the last element of the quaternion, i.e. the real part. This method is const. The methods X(), Y() and Z() are inherited from the base class.

template<class _containerType>
reference vctQuaternionBase< _containerType >::R ( void  )
inline

Access the last element of the quaternion, i.e. the real part. This method is not const. The methods X(), Y() and Z() are inherited from the base class.

template<class _containerType>
vctQuaternionBase< _containerType >::VCT_CONTAINER_TRAITS_TYPEDEFS ( typename ContainerType::value_type  )

The documentation for this class was generated from the following files: