TransformMatrix Class Reference

#include <TransformMatrix.hpp>

Inheritance diagram for TransformMatrix:

Inheritance graph
[legend]
Collaboration diagram for TransformMatrix:

Collaboration graph
[legend]

List of all members.

Public Member Functions

TinyVector< 3, real_t > operator() (const TinyVector< 3, real_t > &x) const
TinyVector< 3, real_t > inverse (const TinyVector< 3, real_t > &x) const
std::string povWrite () const
ReferenceCounting< TransformgetCopy () const
 TransformMatrix (const real_t r[12])
 Constructs a TransformMatrix for a set of given angles passed by r.
 TransformMatrix (const TransformMatrix &r)
 ~TransformMatrix ()
const TransTypetype () const
virtual TinyVector< 3, real_t > operator() (const TinyVector< 3 > &x) const =0
virtual TinyVector< 3, real_t > inverse (const TinyVector< 3 > &x) const =0

Protected Attributes

const TransType __type

Private Attributes

TinyVector< 3 > __translate
TinyMatrix< 3, 3 > __matrix
TinyMatrix< 3, 3 > __invMatrix


Detailed Description

Definition at line 35 of file TransformMatrix.hpp.


Constructor & Destructor Documentation

TransformMatrix::TransformMatrix ( const real_t  r[12]  ) 

Constructs a TransformMatrix for a set of given angles passed by r.

Constructor

Parameters:
r transformation matrix and vector

Definition at line 45 of file TransformMatrix.cpp.

References __invMatrix, __matrix, and __translate.

Referenced by getCopy().

00046   : Transform(matrix)
00047 {
00048   for (size_t i=0;i<3;++i) {
00049     __translate[i] = m[9+i];
00050     for (size_t j=0; j<3; ++j) {
00051       __matrix(i,j) = m[3*i+j];
00052     }
00053   }
00054 
00055   __invMatrix = __matrix.invert();
00056 }

TransformMatrix::TransformMatrix ( const TransformMatrix r  ) 

Copy constructor

Parameters:
r given TransformMatrix

Definition at line 59 of file TransformMatrix.cpp.

References __invMatrix, __matrix, and __translate.

00060   : Transform(r)
00061 {
00062   __translate = r.__translate;
00063   __matrix    = r.__matrix;
00064   __invMatrix = r.__invMatrix;
00065 }

TransformMatrix::~TransformMatrix (  )  [inline]

Destructor

Definition at line 104 of file TransformMatrix.hpp.

00105   {
00106     ;
00107   }


Member Function Documentation

TinyVector< 3, real_t > TransformMatrix::operator() ( const TinyVector< 3, real_t > &  x  )  const

Applies the TransformMatrix to a vector

Parameters:
x given vector
Returns:
$ Ax+b $

Definition at line 26 of file TransformMatrix.cpp.

References __matrix, and __translate.

00027 {
00028   TinyVector<3,real_t> temp = __matrix*v;
00029   temp += __translate;
00030   return temp;
00031 }

TinyVector< 3, real_t > TransformMatrix::inverse ( const TinyVector< 3, real_t > &  x  )  const

Applies the inverse TransformMatrix to a vector

Parameters:
x given vector
Returns:
$ A^{-1}(x-b) $

Definition at line 34 of file TransformMatrix.cpp.

References __invMatrix, and __translate.

00035 {
00036   // As 'matrix' is composed of transformMatrixs, and
00037   // as transformMatrixs are othogonal matrices
00038   // the inverse of 'matrix' is its transposed
00039   TinyVector<3,real_t> Temporary = v - __translate;
00040 
00041   return __invMatrix*Temporary;
00042 }

std::string TransformMatrix::povWrite (  )  const [virtual]

Writes the TransformMatrix to a string

Returns:
POVRay string

Implements Transform.

Definition at line 68 of file TransformMatrix.cpp.

References __matrix, and __translate.

00069 {
00070   std::stringstream povs;
00071   povs << "transformMatrix <";
00072   for (size_t i=0; i<3; ++i) {
00073     for(size_t j=0; j<3; ++j) {
00074       povs << __matrix(i,j) << ',';
00075     }
00076   }
00077   for (size_t i=0; i<2; ++i)
00078     povs << __translate << ',';
00079   povs << __translate[2];
00080   povs << ">";
00081   povs << std::ends;
00082   return povs.str();
00083 }

ReferenceCounting< Transform > TransformMatrix::getCopy (  )  const [virtual]

Copies the TransformMatrix

Returns:
deep copy of the TransformMatrix

Implements Transform.

Definition at line 86 of file TransformMatrix.cpp.

References TransformMatrix().

00087 {
00088   return new TransformMatrix(*this);
00089 }

Here is the call graph for this function:

const TransType& Transform::type (  )  const [inline, inherited]

Read-only access to the type of the transformation.

Returns:
__type

Definition at line 60 of file Transform.hpp.

References Transform::__type.

00061   {
00062     return __type;
00063   }

virtual TinyVector<3,real_t> Transform::operator() ( const TinyVector< 3 > &  x  )  const [pure virtual, inherited]

Applies the transformation to a point

Parameters:
x given point
Returns:
$ T(x) $

virtual TinyVector<3,real_t> Transform::inverse ( const TinyVector< 3 > &  x  )  const [pure virtual, inherited]

Applies the inverse transformation to a point

Parameters:
x given point
Returns:
$ T^{-1}(x) $


Member Data Documentation

TransformMatrix translation as given in POV-Ray

Definition at line 39 of file TransformMatrix.hpp.

Referenced by inverse(), operator()(), povWrite(), and TransformMatrix().

Matrix transformatino

Definition at line 42 of file TransformMatrix.hpp.

Referenced by operator()(), povWrite(), and TransformMatrix().

The inverse of the transformMatrix is stored in the matrix. This way one can know if a vertex is the image of a vertex contained in a base shape; so, if a vertex is in the image of shape!

Definition at line 44 of file TransformMatrix.hpp.

Referenced by inverse(), and TransformMatrix().

const TransType Transform::__type [protected, inherited]

Transformation type

Definition at line 52 of file Transform.hpp.

Referenced by Transform::type().


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

Generated on Wed Nov 19 00:16:32 2008 for FreeFEM3D (aka ff3d) by  doxygen 1.5.6