#include <TransformMatrix.hpp>


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< Transform > | getCopy () 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 TransType & | type () 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 |
Definition at line 35 of file TransformMatrix.hpp.
| TransformMatrix::TransformMatrix | ( | const real_t | r[12] | ) |
Constructs a TransformMatrix for a set of given angles passed by r.
Constructor
| 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
| 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] |
| TinyVector< 3, real_t > TransformMatrix::operator() | ( | const TinyVector< 3, real_t > & | x | ) | const |
Applies the TransformMatrix to a vector
| x | given vector |
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
| x | given vector |
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
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
Implements Transform.
Definition at line 86 of file TransformMatrix.cpp.
References TransformMatrix().
00087 { 00088 return new TransformMatrix(*this); 00089 }

| const TransType& Transform::type | ( | ) | const [inline, inherited] |
Read-only access to the type of the transformation.
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
| x | given point |
| virtual TinyVector<3,real_t> Transform::inverse | ( | const TinyVector< 3 > & | x | ) | const [pure virtual, inherited] |
Applies the inverse transformation to a point
| x | given point |
TinyVector<3> TransformMatrix::__translate [private] |
TransformMatrix translation as given in POV-Ray
Definition at line 39 of file TransformMatrix.hpp.
Referenced by inverse(), operator()(), povWrite(), and TransformMatrix().
TinyMatrix<3,3> TransformMatrix::__matrix [private] |
Matrix transformatino
Definition at line 42 of file TransformMatrix.hpp.
Referenced by operator()(), povWrite(), and TransformMatrix().
TinyMatrix<3,3> TransformMatrix::__invMatrix [private] |
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] |
1.5.6