Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

osg::LinearTransform< ValueTypeT > Class Template Reference

A transform that behaves linear under multiplication (+) and scalar multiplication (*).

#include <OSGLinearTransform.h>

List of all members.

Public Types

typedef ValueTypeT ValueType
 Value type, eg Real32.
typedef TransformationMatrix<
ValueTypeT > 
MatrixType
 Matrix type, eg Matrix4f.

Public Member Functions

const MatrixType getLogMatrixConst () const
 operator MatrixType ()
constructors & destructors
 LinearTransform (void)
 Constructor.
 LinearTransform (const LinearTransform &source)
 Copy Constructor.
 LinearTransform (const MatrixType &mat)
 Constrution from regular transform.
 ~LinearTransform (void)
 Destructor.
set functions
void setIdentity (void)
 Resets the matrix to identity.
void setValue (const MatrixType &mat)
 Set values from a transformation matrix.
void setValue (const LinearTransform &mat)
 Set values from a given linear transform.
void setLogMatrix (MatrixType &mat)
 Resets the matrix to identity.
MatrixType getLogMatrix ()
 Resets the matrix to identity.
create transformation matrices
MatrixType getTransform ()
 Returns the transformation matrix.
assignement
LinearTransform< ValueTypeT > & operator= (const LinearTransform &source)
 assignment
comparison
bool operator== (const LinearTransform &other) const
 equal
bool operator!= (const LinearTransform &other) const
 not equal, returns true if all matrix elements are equal with the tolerance of Eps
operators
LinearTransform< ValueTypeT > operator+ (const LinearTransform &lt) const
 sum of linear transforms
LinearTransform< ValueTypeT > operator * (const ValueTypeT s) const
 scalar multiple of linear transform
LinearTransform< ValueTypeT > & operator+= (const LinearTransform &lt)
 add to linear transforms
LinearTransform< ValueTypeT > & operator *= (const ValueTypeT s)
 scalar multiple of linear transform

Static Public Member Functions

static const char * getClassname (void)
 Classname.

Protected Attributes

MatrixType _logMatrix
 Value store.


Detailed Description

template<class ValueTypeT>
class osg::LinearTransform< ValueTypeT >

Definition at line 74 of file OSGLinearTransform.h.


Member Typedef Documentation

template<class ValueTypeT>
osg::LinearTransform< ValueTypeT >::ValueType
 

Definition at line 86 of file OSGLinearTransform.h.

template<class ValueTypeT>
TransformationMatrix< ValueTypeT > osg::LinearTransform< ValueTypeT >::MatrixType
 

Definition at line 87 of file OSGLinearTransform.h.


Constructor & Destructor Documentation

template<class ValueTypeT>
osg::LinearTransform< ValueTypeT >::LinearTransform void   ) 
 

Definition at line 120 of file OSGLinearTransform.inl.

References osg::LinearTransform< ValueTypeT >::_logMatrix.

00121 {
00122     UInt32 i;
00123 
00124     for(i = 0; i < 4; i++)
00125     {
00126         _logMatrix[i][i] = TypeTraits<ValueType>::getOneElement();
00127     }
00128 }

template<class ValueTypeT>
osg::LinearTransform< ValueTypeT >::LinearTransform const LinearTransform< ValueTypeT > &  source  )  [inline]
 

Definition at line 134 of file OSGLinearTransform.inl.

References osg::LinearTransform< ValueTypeT >::_logMatrix.

00136 {
00137     UInt32 i;
00138 
00139     for(i = 0; i < 4; i++)
00140     {
00141         _logMatrix[i] = source._logMatrix[i];
00142     }
00143 }

template<class ValueTypeT>
osg::LinearTransform< ValueTypeT >::LinearTransform const MatrixType mat  )  [inline]
 

Definition at line 149 of file OSGLinearTransform.inl.

References osg::LinearTransform< ValueTypeT >::_logMatrix, and osg::TransformationMatrix< ValueTypeT >::logOf().

00151 {
00152     _logMatrix.logOf(mat);
00153 }

template<class ValueTypeT>
osg::LinearTransform< ValueTypeT >::~LinearTransform void   )  [inline]
 

Definition at line 159 of file OSGLinearTransform.inl.

00160 {
00161 }


Member Function Documentation

template<class ValueTypeT>
const char * osg::LinearTransform< ValueTypeT >::getClassname void   )  [inline, static]
 

Definition at line 93 of file OSGLinearTransform.h.

00093 { return "LinearTransform";};

template<class ValueTypeT>
void osg::LinearTransform< ValueTypeT >::setIdentity void   )  [inline]
 

Definition at line 174 of file OSGLinearTransform.inl.

References osg::LinearTransform< ValueTypeT >::_logMatrix.

00175 {
00176     UInt32 i;
00177 
00178     for(i = 0; i < 4; i++)
00179     {
00180         _logMatrix[i].setNull();
00181         _logMatrix[i][i] = TypeTraits<ValueType>::getOneElement();
00182     }
00183 }

template<class ValueTypeT>
void osg::LinearTransform< ValueTypeT >::setValue const MatrixType mat  )  [inline]
 

Definition at line 203 of file OSGLinearTransform.inl.

References osg::LinearTransform< ValueTypeT >::_logMatrix, and osg::TransformationMatrix< ValueTypeT >::logOf().

00205 {   
00206     _logMatrix.logOf(mat);
00207 }

template<class ValueTypeT>
void osg::LinearTransform< ValueTypeT >::setValue const LinearTransform< ValueTypeT > &  mat  )  [inline]
 

Definition at line 190 of file OSGLinearTransform.inl.

References osg::LinearTransform< ValueTypeT >::_logMatrix.

00192 {
00193     for(UInt32 i = 0; i < 4; i++)
00194     {
00195         _logMatrix[i] = mat._logMatrix[i];
00196     }
00197 }

template<class ValueTypeT>
void osg::LinearTransform< ValueTypeT >::setLogMatrix MatrixType mat  )  [inline]
 

Definition at line 212 of file OSGLinearTransform.inl.

References osg::LinearTransform< ValueTypeT >::_logMatrix.

Referenced by osg::operator *().

00214 {
00215     _logMatrix = mat;
00216 }

template<class ValueTypeT>
TransformationMatrix< ValueTypeT > osg::LinearTransform< ValueTypeT >::getLogMatrix  )  [inline]
 

Definition at line 221 of file OSGLinearTransform.inl.

References osg::LinearTransform< ValueTypeT >::_logMatrix.

Referenced by osg::operator *().

00222 {
00223     return _logMatrix;
00224 }

template<class ValueTypeT>
const TransformationMatrix< ValueTypeT > osg::LinearTransform< ValueTypeT >::getLogMatrixConst  )  const [inline]
 

Definition at line 231 of file OSGLinearTransform.inl.

References osg::LinearTransform< ValueTypeT >::_logMatrix.

00232 {
00233     return _logMatrix;
00234 }

template<class ValueTypeT>
TransformationMatrix< ValueTypeT > osg::LinearTransform< ValueTypeT >::getTransform  )  [inline]
 

Definition at line 246 of file OSGLinearTransform.inl.

References osg::LinearTransform< ValueTypeT >::_logMatrix, and osg::TransformationMatrix< ValueTypeT >::expOf().

00247 {
00248     MatrixType mat;
00249     mat.expOf(_logMatrix);
00250     return mat;
00251 }

template<class ValueTypeT>
osg::LinearTransform< ValueTypeT >::operator MatrixType  ) 
 

template<class ValueTypeT>
LinearTransform< ValueTypeT > & osg::LinearTransform< ValueTypeT >::operator= const LinearTransform< ValueTypeT > &  source  )  [inline]
 

Definition at line 274 of file OSGLinearTransform.inl.

References osg::LinearTransform< ValueTypeT >::_logMatrix.

00276 {
00277     UInt32 i;
00278 
00279     if (this == &source)
00280         return *this;
00281 
00282     for(i = 0; i < 4; i++)
00283         _logMatrix[i] = source._logMatrix[i];
00284 
00285     return *this;
00286 }

template<class ValueTypeT>
bool osg::LinearTransform< ValueTypeT >::operator== const LinearTransform< ValueTypeT > &  other  )  const [inline]
 

Definition at line 299 of file OSGLinearTransform.inl.

References osg::LinearTransform< ValueTypeT >::_logMatrix.

00301 {
00302     return (_logMatrix == other._logMatrix);
00303 }

template<class ValueTypeT>
bool osg::LinearTransform< ValueTypeT >::operator!= const LinearTransform< ValueTypeT > &  other  )  const [inline]
 

Definition at line 310 of file OSGLinearTransform.inl.

00312 {
00313     return ! (*this == other);
00314 }

template<class ValueTypeT>
LinearTransform< ValueTypeT > osg::LinearTransform< ValueTypeT >::operator+ const LinearTransform< ValueTypeT > &  lt  )  const [inline]
 

Definition at line 328 of file OSGLinearTransform.inl.

References osg::LinearTransform< ValueTypeT >::_logMatrix.

00330 {
00331   LinearTransform sum;
00332     for (int i=0; i < 4; i++)
00333         for (int j=0; j < 4; j++)
00334             sum._logMatrix[i][j] = _logMatrix[i][j] + 
00335                                                          lt._logMatrix[i][j];
00336   return sum;
00337 }

template<class ValueTypeT>
LinearTransform< ValueTypeT > osg::LinearTransform< ValueTypeT >::operator * const ValueTypeT  s  )  const [inline]
 

Definition at line 344 of file OSGLinearTransform.inl.

References osg::LinearTransform< ValueTypeT >::_logMatrix.

00346 {
00347   LinearTransform pro;
00348     for (int i=0; i < 4; i++)
00349         for (int j=0; j < 4; j++)
00350             pro._logMatrix[i][j] = s * _logMatrix[i][j];
00351   return pro;
00352 }

template<class ValueTypeT>
LinearTransform< ValueTypeT > & osg::LinearTransform< ValueTypeT >::operator+= const LinearTransform< ValueTypeT > &  lt  )  [inline]
 

Definition at line 359 of file OSGLinearTransform.inl.

References osg::LinearTransform< ValueTypeT >::_logMatrix.

00361 {
00362     for (int i=0; i < 4; i++)
00363         for (int j=0; j < 4; j++)
00364             _logMatrix[i][j] += lt._logMatrix[i][j];
00365   return *this;
00366 }

template<class ValueTypeT>
LinearTransform< ValueTypeT > & osg::LinearTransform< ValueTypeT >::operator *= const ValueTypeT  s  )  [inline]
 

Definition at line 373 of file OSGLinearTransform.inl.

References osg::LinearTransform< ValueTypeT >::_logMatrix.

00375 {
00376     for (int i=0; i < 4; i++)
00377         for (int j=0; j < 4; j++)
00378             _logMatrix[i][j] *= s;
00379   return *this;
00380 }


Member Data Documentation

template<class ValueTypeT>
MatrixType osg::LinearTransform< ValueTypeT >::_logMatrix [protected]
 

Referenced by osg::LinearTransform< ValueTypeT >::getLogMatrix(), osg::LinearTransform< ValueTypeT >::getLogMatrixConst(), osg::LinearTransform< ValueTypeT >::getTransform(), osg::LinearTransform< ValueTypeT >::LinearTransform(), osg::LinearTransform< ValueTypeT >::operator *(), osg::LinearTransform< ValueTypeT >::operator *=(), osg::LinearTransform< ValueTypeT >::operator+(), osg::LinearTransform< ValueTypeT >::operator+=(), osg::LinearTransform< ValueTypeT >::operator=(), osg::LinearTransform< ValueTypeT >::operator==(), osg::LinearTransform< ValueTypeT >::setIdentity(), osg::LinearTransform< ValueTypeT >::setLogMatrix(), and osg::LinearTransform< ValueTypeT >::setValue().


The documentation for this class was generated from the following files:
Generated on Thu Aug 25 04:12:34 2005 for OpenSG by  doxygen 1.4.3