InstantIO::Matrix3< T > Class Template Reference

Helper class for exchanging 3x3 transform matrices. More...

#include <InstantIO/Matrix3.h>

List of all members.

Public Types

enum  MatrixElementIndex {
  M_00 = 0, M_01 = 1, M_02 = 2, M_10 = 3,
  M_11 = 4, M_12 = 5, M_20 = 6, M_21 = 7,
  M_22 = 8
}
 

Defines symbolic indices for the elements of the matrix.


Public Member Functions

 Matrix3 ()
 Creates a new Matrix3 object that contains an identity matrix.
 Matrix3 (const Matrix3 &obj)
 Creates a new Matrix3 object that is an exact copy of another Matrix3 object.
 Matrix3 (const T matrix[9], bool transposed=false)
 Creates a new Matrix3 object that gets initialized by a given 9 component float array representing a 3x3 matrix.
const Matrix3operator= (const Matrix3 &obj)
 Assigns another Matrix3 to this Matrix3.
const T * operator= (const T matrix[9])
 Assigns the nine components of an float array to this Matrix3.
void setIdentity ()
 Sets the Matrix3 to identity.
operator[] (MatrixElementIndex i) const
 Returns a component of the Matrix3.
T & operator[] (MatrixElementIndex i)
 Returns a component of the Matrix3.
const T * getValue () const
 Returns the components of the Matrix3 as an array of nine float values.
T * getValue ()
 Returns the components of the Matrix3 as an array of nine float values.
 operator T * ()
 Transforms the Matrix3 to an array of 9 float values.
 operator const T * () const
 Transforms the Matrix3 to an array of 9 float values.

Detailed Description

template<class T>
class InstantIO::Matrix3< T >

Helper class for exchanging 3x3 transform matrices.

Matrix3 is a basic helper class for exchanging transformations between different software components. It does not contain any means for matrix arithmetics, only methods for setting and getting the transformation. It is not meant to be used directly by software components for matrix representation. Instead, software components should use their own, appropriate classes for handling matrices. Only when sending matrices to an OutSlot, or when receiving matrices from an InSlot, the internal representation of matrices should be converted to Matrix3's. This ensures the interoperability between different software components that use different internal representations for matrices.

Matrices are internally stored as 3x3 matrices. You can access these matrices directly, or you can use methods that convert a translation vector, a quaternion axis and a scale vector to a Matrix3.

Author:
Patrick Dähne

Constructor & Destructor Documentation

template<class T >
InstantIO::Matrix3< T >::Matrix3 ( const Matrix3< T > &  obj  )  [inline]

Creates a new Matrix3 object that is an exact copy of another Matrix3 object.

Parameters:
obj The other Matrix3 object
template<class T >
InstantIO::Matrix3< T >::Matrix3 ( const T  matrix[9],
bool  transposed = false 
) [inline]

Creates a new Matrix3 object that gets initialized by a given 9 component float array representing a 3x3 matrix.

Parameters:
matrix The nine components of the matrix
transposed Flags that must be set to true when the array needs to be transposed when copying it into the Matrix3 object

Member Function Documentation

template<class T >
const Matrix3& InstantIO::Matrix3< T >::operator= ( const Matrix3< T > &  obj  )  [inline]

Assigns another Matrix3 to this Matrix3.

Parameters:
obj The other Matrix3 object
Returns:
The other Matrix3 object
template<class T >
const T* InstantIO::Matrix3< T >::operator= ( const T  matrix[9]  )  [inline]

Assigns the nine components of an float array to this Matrix3.

Parameters:
matrix The nine components of the matrix
Returns:
The nine components of the matrix
template<class T >
T InstantIO::Matrix3< T >::operator[] ( MatrixElementIndex  i  )  const [inline]

Returns a component of the Matrix3.

Parameters:
i The index of the component
Returns:
The component
template<class T >
T& InstantIO::Matrix3< T >::operator[] ( MatrixElementIndex  i  )  [inline]

Returns a component of the Matrix3.

Parameters:
i The index of the component
Returns:
The component
template<class T >
const T* InstantIO::Matrix3< T >::getValue (  )  const [inline]

Returns the components of the Matrix3 as an array of nine float values.

Returns:
The components of the Matrix3
template<class T >
T* InstantIO::Matrix3< T >::getValue (  )  [inline]

Returns the components of the Matrix3 as an array of nine float values.

Returns:
The components of the Matrix3
template<class T >
InstantIO::Matrix3< T >::operator T * (  )  [inline]

Transforms the Matrix3 to an array of 9 float values.

Returns:
The array of 9 float values.
template<class T >
InstantIO::Matrix3< T >::operator const T * (  )  const [inline]

Transforms the Matrix3 to an array of 9 float values.

Returns:
The array of 9 float values.

The documentation for this class was generated from the following file:
Generated on Thu Jul 31 17:17:32 2014 by  doxygen 1.6.3