cisst-saw
Loading...
Searching...
No Matches
vctQuaternionBase< _containerType > Class Template Reference

Define a quaternion container. More...

#include <vctQuaternionBase.h>

Inheritance diagram for vctQuaternionBase< _containerType >:
vctQuaternion< value_type > vctQuaternion< double > vctQuaternion< float > vctQuaternionRotation3Base< _containerType > vctQuaternionRotation3< value_type > vctQuaternionRotation3< double > vctQuaternionRotation3< float >

Public Types

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

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)
void Allocate (void)
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

◆ BaseType

template<class _containerType>
typedef _containerType vctQuaternionBase< _containerType >::BaseType

◆ ContainerType

template<class _containerType>
typedef _containerType vctQuaternionBase< _containerType >::ContainerType

◆ ThisType

template<class _containerType>
typedef vctQuaternionBase<_containerType> vctQuaternionBase< _containerType >::ThisType

◆ TypeTraits

template<class _containerType>
typedef cmnTypeTraits<value_type> vctQuaternionBase< _containerType >::TypeTraits

Member Enumeration Documentation

◆ anonymous enum

template<class _containerType>
anonymous enum
Enumerator
SIZE 

Constructor & Destructor Documentation

◆ vctQuaternionBase() [1/2]

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

Default constructor. Does nothing.

◆ vctQuaternionBase() [2/2]

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

◆ Allocate() [1/3]

void vctQuaternionBase< vctDynamicVector< float > >::Allocate ( void )
inlineprotected

◆ Allocate() [2/3]

void vctQuaternionBase< vctDynamicVector< double > >::Allocate ( void )
inlineprotected

◆ Allocate() [3/3]

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.

◆ Conjugate()

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.

◆ ConjugateOf()

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.

◆ ConjugateSelf()

template<class _containerType>
ThisType & vctQuaternionBase< _containerType >::ConjugateSelf ( void )
inline

Replaces this quaternion by its conjugate.

◆ Divide() [1/2]

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.

◆ Divide() [2/2]

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.

◆ PostMultiply()

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.

◆ PreMultiply()

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.

◆ ProductOf()

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.

◆ QuotientOf()

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)

◆ R() [1/2]

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.

◆ R() [2/2]

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.

◆ VCT_CONTAINER_TRAITS_TYPEDEFS()

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

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