#include <Rotation.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 |
| prints rotation information to a string. | |
| ReferenceCounting< Transform > | getCopy () const |
| Rotation (const TinyVector< 3, real_t > &r) | |
| Rotation (const Rotation &r) | |
| ~Rotation () | |
| 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 | |
| const TinyVector< 3, real_t > | __angles |
| TinyMatrix< 3, 3 > | __matrix |
Definition at line 39 of file Rotation.hpp.
| Rotation::Rotation | ( | const TinyVector< 3, real_t > & | r | ) |
Constructor
| r | given POVRay angles |
Definition at line 46 of file Rotation.cpp.
References __matrix.
Referenced by getCopy().
00047 : Transform(rotation), 00048 __angles(r) 00049 { 00050 const real_t deg2rad=4*std::atan(1.)/180.; 00051 00052 const real_t cosx = std::cos(deg2rad*r[0]); 00053 const real_t cosy = std::cos(deg2rad*r[1]); 00054 const real_t cosz = std::cos(deg2rad*r[2]); 00055 const real_t sinx = std::sin(deg2rad*r[0]); 00056 const real_t siny = std::sin(deg2rad*r[1]); 00057 const real_t sinz = std::sin(deg2rad*r[2]); 00058 00059 __matrix(0,0) = cosy*cosz; 00060 __matrix(0,1) = -sinz*cosx + sinx*siny*cosz; 00061 __matrix(0,2) = sinx*sinz + cosx*siny*cosz; 00062 __matrix(1,0) = cosy*sinz; 00063 __matrix(1,1) = cosx*cosz + sinx*siny*sinz; 00064 __matrix(1,2) = -sinx*cosy + cosx*siny*sinz; 00065 __matrix(2,0) = -siny; 00066 __matrix(2,1) = sinx*cosy; 00067 __matrix(2,2) = cosx*cosy; 00068 }
| Rotation::Rotation | ( | const Rotation & | r | ) |
| Rotation::~Rotation | ( | ) | [inline] |
| TinyVector< 3, real_t > Rotation::operator() | ( | const TinyVector< 3, real_t > & | x | ) | const |
Applies the Rotation to a vector
| x | given vector |
Definition at line 26 of file Rotation.cpp.
References __matrix.
00027 { 00028 return __matrix*v; 00029 }
| TinyVector< 3, real_t > Rotation::inverse | ( | const TinyVector< 3, real_t > & | x | ) | const |
Applies the inverse Rotation to a vector
| x | given vector |
Definition at line 32 of file Rotation.cpp.
References __matrix.
00033 { 00034 // As 'matrix' is composed of rotations, and 00035 // as rotations are othogonal matrices 00036 // the inverse of 'matrix' is its transposed 00037 TinyVector<3,real_t> Temporary = 0; 00038 for (size_t i=0; i<3; i++) 00039 for (size_t j=0; j<3; j++) { 00040 Temporary[i]+=__matrix(j,i)*v[j]; 00041 } 00042 return Temporary; 00043 }
| std::string Rotation::povWrite | ( | ) | const [virtual] |
prints rotation information to a string.
Prints Rotation informations to a string.
Implements Transform.
Definition at line 81 of file Rotation.cpp.
References __angles.
00082 { 00083 std::stringstream povs; 00084 povs << "rotation <" 00085 << __angles[0] 00086 << ", " 00087 << __angles[1] 00088 << ", " 00089 << __angles[2] 00090 << ">"; 00091 povs << std::ends; 00092 return povs.str(); 00093 }
| ReferenceCounting< Transform > Rotation::getCopy | ( | ) | const [virtual] |
Gets a copy of the Rotation
Implements Transform.
Definition at line 97 of file Rotation.cpp.
References Rotation().
00098 { 00099 return new Rotation(*this); 00100 }

| 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 |
const TinyVector<3,real_t> Rotation::__angles [private] |
Rotation angles as given in POVRay
Definition at line 44 of file Rotation.hpp.
Referenced by povWrite().
TinyMatrix<3,3> Rotation::__matrix [private] |
The inverse of the rotation 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 47 of file Rotation.hpp.
Referenced by inverse(), operator()(), and Rotation().
const TransType Transform::__type [protected, inherited] |
1.5.6