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

Define a rotation matrix for a space of dimension 3. More...

#include <vctForwardDeclarations.h>

Inheritance diagram for vctMatrixRotation3ConstBase< _containerType >:
vctMatrixRotation3Base< _containerType >

Public Types

enum  { ROWS = 3, COLS = 3 }
 
enum  { DIMENSION = 3 }
 
typedef _containerType BaseType
 
typedef _containerType ContainerType
 
typedef
vctMatrixRotation3ConstBase
< ContainerType
ThisType
 
typedef vctMatrixRotation3
< value_type > 
RotationValueType
 
typedef cmnTypeTraits< value_type > TypeTraits
 

Public Member Functions

 VCT_CONTAINER_TRAITS_TYPEDEFS (typename ContainerType::value_type)
 
RotationValueType Normalized (void) const
 
bool IsNormalized (value_type tolerance=TypeTraits::Tolerance()) const
 
RotationValueType Inverse (void) const
 
template<stride_type __stride1, class __dataPtrType1 , stride_type __stride2, class __dataPtrType2 >
void ApplyTo (const vctFixedSizeConstVectorBase< DIMENSION, __stride1, value_type, __dataPtrType1 > &input, vctFixedSizeVectorBase< DIMENSION, __stride2, value_type, __dataPtrType2 > &output) const
 
template<stride_type __stride, class __dataPtrType >
vctFixedSizeVector< value_type,
DIMENSION
ApplyTo (const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &input) const
 
ThisType ApplyTo (const ThisType &input) const
 
template<class __vectorOwnerType1 , class __vectorOwnerType2 >
void ApplyTo (const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &input, vctDynamicVectorBase< __vectorOwnerType2, value_type > &output) const throw (std::runtime_error)
 
template<class __vectorOwnerType , stride_type __stride, class __dataPtrType >
void ApplyTo (const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &input, vctFixedSizeVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &output) const throw (std::runtime_error)
 
template<class __vectorOwnerType >
vctFixedSizeVector< value_type,
DIMENSION
ApplyTo (const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &input) const
 
template<stride_type __stride1, class __dataPtrType1 , stride_type __stride2, class __dataPtrType2 >
void ApplyInverseTo (const vctFixedSizeConstVectorBase< DIMENSION, __stride1, value_type, __dataPtrType1 > &input, vctFixedSizeVectorBase< DIMENSION, __stride2, value_type, __dataPtrType2 > &output) const
 
template<stride_type __stride, class __dataPtrType >
vctFixedSizeVector< value_type,
DIMENSION
ApplyInverseTo (const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &input) const
 
template<class __vectorOwnerType >
vctFixedSizeVector< value_type,
DIMENSION
ApplyInverseTo (const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &input) const
 
void ApplyInverseTo (const ThisType &input, ThisType &output) const
 
ThisType ApplyInverseTo (const ThisType &input) const
 
template<class __vectorOwnerType1 , class __vectorOwnerType2 >
void ApplyInverseTo (const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &input, vctDynamicVectorBase< __vectorOwnerType2, value_type > &output) const
 
template<class __vectorOwnerType , stride_type __stride, class __dataPtrType >
void ApplyInverseTo (const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &input, vctFixedSizeVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &output) const
 
template<size_type __cols, stride_type __rowStride1, stride_type __colStride1, class __dataPtrType1 , stride_type __rowStride2, stride_type __colStride2, class __dataPtrType2 >
void ApplyTo (const vctFixedSizeConstMatrixBase< DIMENSION, __cols, __rowStride1, __colStride1, value_type, __dataPtrType1 > &input, vctFixedSizeMatrixBase< DIMENSION, __cols, __rowStride2, __colStride2, value_type, __dataPtrType2 > &output) const
 
template<class __matrixOwnerType1 , class __matrixOwnerType2 >
void ApplyTo (const vctDynamicConstMatrixBase< __matrixOwnerType1, value_type > &input, vctDynamicMatrixBase< __matrixOwnerType2, value_type > &output) const
 
template<size_type __cols, stride_type __rowStride1, stride_type __colStride1, class __dataPtrType1 , stride_type __rowStride2, stride_type __colStride2, class __dataPtrType2 >
void ApplyInverseTo (const vctFixedSizeConstMatrixBase< DIMENSION, __cols, __rowStride1, __colStride1, value_type, __dataPtrType1 > &input, vctFixedSizeMatrixBase< DIMENSION, __cols, __rowStride2, __colStride2, value_type, __dataPtrType2 > &output) const
 
template<class __matrixOwnerType1 , class __matrixOwnerType2 >
void ApplyInverseTo (const vctDynamicConstMatrixBase< __matrixOwnerType1, value_type > &input, vctDynamicMatrixBase< __matrixOwnerType2, value_type > &output) const
 
ThisType operator* (const ThisType &input) const
 
template<stride_type __stride, class __dataPtrType >
vctFixedSizeVector< value_type,
DIMENSION
operator* (const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &input) const
 
template<class __vectorOwnerType1 >
vctFixedSizeVector< value_type,
DIMENSION
operator* (const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &input) const
 
bool AlmostEquivalent (const ThisType &other, value_type tolerance=TypeTraits::Tolerance()) const
 

Static Public Member Functions

static CISST_EXPORT const
RotationValueType
Identity ()
 

Protected Member Functions

void ThrowUnlessIsNormalized (void) const throw (std::runtime_error)
 
template<class _inputType >
void ThrowUnlessIsNormalized (const _inputType &input) const throw (std::runtime_error)
 

Detailed Description

template<class _containerType>
class vctMatrixRotation3ConstBase< _containerType >

Define a rotation matrix for a space of dimension 3.

This class is templated by the type of container used to store the rotation matrix. This class is an internal class, i.e. it is not intended for the end-user. The class which should be used by most is vctMatRot3 (eventually vctMatrixRotation3<_elementType>).

The main goal of this meta rotation matrix class is to ease the interface with Python. For a native Python object, a matrix rotation can be defined based on a vctDynamicMatrix which is much easier to wrap than a vctFixedSizeMatrix. For a C++ object accessed from Python, the rotation matrix will be defined using vctMatrixRotation3Base<vctDynamicMatrixRef<double> >, referring to the C++ vctMatrixRotation3Base<vctFixedSizeMatrix<double, 3, 3> >.

Parameters
_containerTypeThe type of the matrix.
See Also
vctFixedSizeMatrix

Member Typedef Documentation

template<class _containerType>
typedef _containerType vctMatrixRotation3ConstBase< _containerType >::BaseType
template<class _containerType>
typedef _containerType vctMatrixRotation3ConstBase< _containerType >::ContainerType
template<class _containerType>
typedef vctMatrixRotation3<value_type> vctMatrixRotation3ConstBase< _containerType >::RotationValueType

Type used to return by copy

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

Traits used for all useful types and values related to the element type.

Member Enumeration Documentation

template<class _containerType>
anonymous enum
Enumerator
ROWS 
COLS 
template<class _containerType>
anonymous enum
Enumerator
DIMENSION 

Member Function Documentation

template<class _containerType>
bool vctMatrixRotation3ConstBase< _containerType >::AlmostEquivalent ( const ThisType other,
value_type  tolerance = TypeTraits::Tolerance() 
) const
inline

Return true if this rotation is effectively equivalent to the other rotation, up to the given tolerance. For a rotation matrix, this method is strictly the same as AlmostEqual.

See Also
AlmostEqual
template<class _containerType>
template<stride_type __stride1, class __dataPtrType1 , stride_type __stride2, class __dataPtrType2 >
void vctMatrixRotation3ConstBase< _containerType >::ApplyInverseTo ( const vctFixedSizeConstVectorBase< DIMENSION, __stride1, value_type, __dataPtrType1 > &  input,
vctFixedSizeVectorBase< DIMENSION, __stride2, value_type, __dataPtrType2 > &  output 
) const
inline

Apply the inverse of the rotation to a vector of fixed size

  1. The result is stored into a vector of size 3 provided by the caller and passed by reference.
Parameters
inputThe input vector
outputThe output vector
template<class _containerType>
template<stride_type __stride, class __dataPtrType >
vctFixedSizeVector<value_type, DIMENSION> vctMatrixRotation3ConstBase< _containerType >::ApplyInverseTo ( const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &  input) const
inline

Apply the the inverse of the rotation to a vector of fixed size 3. The result is returned by copy. This interface might be more convenient for some but one should note that it is less efficient since it requires a copy.

Parameters
inputThe input vector
Returns
The output vector
template<class _containerType>
template<class __vectorOwnerType >
vctFixedSizeVector<value_type, DIMENSION> vctMatrixRotation3ConstBase< _containerType >::ApplyInverseTo ( const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &  input) const
inline

Apply the inverse rotation to a dynamic vector of length 3. The result is returned by value.

template<class _containerType>
void vctMatrixRotation3ConstBase< _containerType >::ApplyInverseTo ( const ThisType input,
ThisType output 
) const
inline

Apply the inverse of the rotation to another rotation. The result is stored into a vctMatrixRotation3Base (ThisType) provided by the caller and passed by reference.

Parameters
inputThe input rotation
outputThe output rotation
template<class _containerType>
ThisType vctMatrixRotation3ConstBase< _containerType >::ApplyInverseTo ( const ThisType input) const
inline

Apply the inverse of the rotation to another rotation. The result is returned by copy. This interface might be more convenient for some but one should note that it is less efficient since it requires a copy.

Parameters
inputThe input rotation
Returns
The output rotation
template<class _containerType>
template<class __vectorOwnerType1 , class __vectorOwnerType2 >
void vctMatrixRotation3ConstBase< _containerType >::ApplyInverseTo ( const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &  input,
vctDynamicVectorBase< __vectorOwnerType2, value_type > &  output 
) const
inline

Apply the the inverse of the rotation to a dynamic vector. The result is stored into another dynamic vector passed by reference by the caller. It is assumed that both are of size 3.

template<class _containerType>
template<class __vectorOwnerType , stride_type __stride, class __dataPtrType >
void vctMatrixRotation3ConstBase< _containerType >::ApplyInverseTo ( const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &  input,
vctFixedSizeVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &  output 
) const
inline

Apply the the inverse of the rotation to a dynamic vector. The result is stored into a fixed-size vector passed by reference by the caller. It is assumed that both are of size 3.

template<class _containerType>
template<size_type __cols, stride_type __rowStride1, stride_type __colStride1, class __dataPtrType1 , stride_type __rowStride2, stride_type __colStride2, class __dataPtrType2 >
void vctMatrixRotation3ConstBase< _containerType >::ApplyInverseTo ( const vctFixedSizeConstMatrixBase< DIMENSION, __cols, __rowStride1, __colStride1, value_type, __dataPtrType1 > &  input,
vctFixedSizeMatrixBase< DIMENSION, __cols, __rowStride2, __colStride2, value_type, __dataPtrType2 > &  output 
) const
inline

Apply the inverse rotation to a fixed-size matrix with 3 rows. The result is stored in another fixed-size matrix

template<class _containerType>
template<class __matrixOwnerType1 , class __matrixOwnerType2 >
void vctMatrixRotation3ConstBase< _containerType >::ApplyInverseTo ( const vctDynamicConstMatrixBase< __matrixOwnerType1, value_type > &  input,
vctDynamicMatrixBase< __matrixOwnerType2, value_type > &  output 
) const
inline

Apply this rotation inverse to a dynamic matrix with 3 rows. The result is stored in another dynamic matrix.

template<class _containerType>
template<stride_type __stride1, class __dataPtrType1 , stride_type __stride2, class __dataPtrType2 >
void vctMatrixRotation3ConstBase< _containerType >::ApplyTo ( const vctFixedSizeConstVectorBase< DIMENSION, __stride1, value_type, __dataPtrType1 > &  input,
vctFixedSizeVectorBase< DIMENSION, __stride2, value_type, __dataPtrType2 > &  output 
) const
inline

Apply the rotation to a vector of fixed size 3. The result is stored into a vector of size 3 provided by the caller and passed by reference.

Parameters
inputThe input vector
outputThe output vector
template<class _containerType>
template<stride_type __stride, class __dataPtrType >
vctFixedSizeVector<value_type, DIMENSION> vctMatrixRotation3ConstBase< _containerType >::ApplyTo ( const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &  input) const
inline

Apply the rotation to a vector of fixed size 3. The result is returned by copy. This interface might be more convenient for some but one should note that it is less efficient since it requires a copy.

Parameters
inputThe input vector
Returns
The output vector
template<class _containerType>
ThisType vctMatrixRotation3ConstBase< _containerType >::ApplyTo ( const ThisType input) const
inline

Apply the rotation to another rotation. The result is returned by copy. This interface might be more convenient for some but one should note that it is less efficient since it requires a copy.

Parameters
inputThe input rotation
Returns
The output rotation
template<class _containerType>
template<class __vectorOwnerType1 , class __vectorOwnerType2 >
void vctMatrixRotation3ConstBase< _containerType >::ApplyTo ( const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &  input,
vctDynamicVectorBase< __vectorOwnerType2, value_type > &  output 
) const
throw (std::runtime_error
)
inline

Apply the rotation to a dynamic vector. The result is stored into another dynamic vector passed by reference by the caller. It is assumed that both are of size 3.

template<class _containerType>
template<class __vectorOwnerType , stride_type __stride, class __dataPtrType >
void vctMatrixRotation3ConstBase< _containerType >::ApplyTo ( const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &  input,
vctFixedSizeVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &  output 
) const
throw (std::runtime_error
)
inline
template<class _containerType>
template<class __vectorOwnerType >
vctFixedSizeVector<value_type, DIMENSION> vctMatrixRotation3ConstBase< _containerType >::ApplyTo ( const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &  input) const
inline

Apply the rotation to a dynamic vector of length 3. The result is returned by value.

template<class _containerType>
template<size_type __cols, stride_type __rowStride1, stride_type __colStride1, class __dataPtrType1 , stride_type __rowStride2, stride_type __colStride2, class __dataPtrType2 >
void vctMatrixRotation3ConstBase< _containerType >::ApplyTo ( const vctFixedSizeConstMatrixBase< DIMENSION, __cols, __rowStride1, __colStride1, value_type, __dataPtrType1 > &  input,
vctFixedSizeMatrixBase< DIMENSION, __cols, __rowStride2, __colStride2, value_type, __dataPtrType2 > &  output 
) const
inline

Apply this rotation to a fixed-size matrix with 3 rows. The result is stored in another fixed-size matrix

template<class _containerType>
template<class __matrixOwnerType1 , class __matrixOwnerType2 >
void vctMatrixRotation3ConstBase< _containerType >::ApplyTo ( const vctDynamicConstMatrixBase< __matrixOwnerType1, value_type > &  input,
vctDynamicMatrixBase< __matrixOwnerType2, value_type > &  output 
) const
inline

Apply this rotation to a dynamic matrix with 3 rows. The result is stored in another dynamic matrix.

template<class _containerType>
static CISST_EXPORT const RotationValueType& vctMatrixRotation3ConstBase< _containerType >::Identity ( )
static

Const reference to the identity. In this case, the identity matrix:

1 0 0
0 1 0
0 0 1
template<class _containerType >
vctMatrixRotation3ConstBase< _containerType >::RotationValueType vctMatrixRotation3ConstBase< _containerType >::Inverse ( void  ) const

Create and return by copy the inverse of this matrix. This method is not the most efficient since it requires a copy. See also InverseSelf().

template<class _containerType>
bool vctMatrixRotation3ConstBase< _containerType >::IsNormalized ( value_type  tolerance = TypeTraits::Tolerance()) const
inline

Test if this matrix is normalized. This methods checks that all the columns are normalized (within a margin of tolerance) and then checks that the three vectors are orthogonal to each other.

Parameters
toleranceTolerance for the norm and scalar product tests.
template<class _containerType >
vctMatrixRotation3ConstBase< _containerType >::RotationValueType vctMatrixRotation3ConstBase< _containerType >::Normalized ( void  ) const

Returns the normalized version of this rotation. This method returns a copy of the normalized rotation and does not modify this rotation. See also NormalizedSelf().

template<class _containerType>
ThisType vctMatrixRotation3ConstBase< _containerType >::operator* ( const ThisType input) const
inline

Multiply two rotation matrices and return the result as a rotation matrix.

Returns
(*this) * other
Note
this function overrides and shadows the operator * defined for basic matrix type. The latter returns a vctFixedSizeMatrix, while this version returns a specialized rotation matrix.
template<class _containerType>
template<stride_type __stride, class __dataPtrType >
vctFixedSizeVector<value_type, DIMENSION> vctMatrixRotation3ConstBase< _containerType >::operator* ( const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &  input) const
inline

Override the * operator defined in the matrix base for matrix * vector. This prevents compiler confusion between the overloaded RotMat*RotMat and the base-class Mat*Vec

template<class _containerType>
template<class __vectorOwnerType1 >
vctFixedSizeVector<value_type, DIMENSION> vctMatrixRotation3ConstBase< _containerType >::operator* ( const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &  input) const
inline

Implement operator * for MatrixRotatin * DynamicVector. Return type is set to fixed-size vector of length 3. It is the caller's responsibility to convert the return value to a dynamic vector, if so desired.

template<class _containerType>
void vctMatrixRotation3ConstBase< _containerType >::ThrowUnlessIsNormalized ( void  ) const
throw (std::runtime_error
)
inlineprotected

Throw an exception unless this rotation is normalized.

template<class _containerType>
template<class _inputType >
void vctMatrixRotation3ConstBase< _containerType >::ThrowUnlessIsNormalized ( const _inputType &  input) const
throw (std::runtime_error
)
inlineprotected

Throw an exception unless the input is normalized.

Parameters
inputAn object with IsNormalized method.
template<class _containerType>
vctMatrixRotation3ConstBase< _containerType >::VCT_CONTAINER_TRAITS_TYPEDEFS ( typename ContainerType::value_type  )

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