![]() |
gVirtualXRay
2.0.10
VirtualX-RayImagingLibraryonGPU
|
Matrix4x4 is a template class to handle a 4 by 4 matrix. More...
#include <Matrix4x4.h>
Public Member Functions | |
Matrix4x4 (const T &a1=1.0f, const T &a2=0.0f, const T &a3=0.0f, const T &a4=0.0f, const T &a5=0.0f, const T &a6=1.0f, const T &a7=0.0f, const T &a8=0.0f, const T &a9=0.0f, const T &a10=0.0f, const T &a11=1.0f, const T &a12=0.0f, const T &a13=0.0f, const T &a14=0.0f, const T &a15=0.0f, const T &a16=1.0f) | |
Default Constructor (create an identity matrix). More... | |
Matrix4x4 (const Matrix4x4 &aMatrix) | |
Copy Constructor. More... | |
Matrix4x4 (const Matrix4x4 *apMatrix) | |
Copy Constructor. More... | |
Matrix4x4 (const T *apMatrix) | |
Copy Constructor. More... | |
Matrix4x4 (const std::vector< double > &apMatrix) | |
Copy Constructor. More... | |
void | loadIdentity () |
Load identity matrix. More... | |
void | setFromVector (const std::vector< double > &apMatrix) |
Load the matrix. More... | |
void | rotate (const double anAngle, const Vec3< T > &aVector) |
Multiply the current matrix by a rotation matrix. More... | |
void | yawPitchRollRotate (double yaw, double pitch, double roll) |
Multiply the current matrix by a yaw, pitch, roll rotation matrix. More... | |
void | translate (const Vec3< T > &aVector) |
Multiply the current matrix by a translation matrix. More... | |
void | translate (T x, T y, T z) |
Multiply the current matrix by a translation matrix. More... | |
void | scale (T x, T y, T z) |
Multiply the current matrix by a scaling matrix. More... | |
Matrix4x4 | getTranspose () const |
Get the transpose of the current matrix. More... | |
T | determinant () const |
Compute the determinant of the current matrix. More... | |
Matrix4x4 | getInverse () const |
Get the inverse of the current matrix. More... | |
Matrix4x4 & | operator= (const Matrix4x4 &aMatrix) |
Copy operator. More... | |
const T * | get () const |
Accessor on the 4x4 matrix data. More... | |
const T * | get4x4 () const |
Accessor on the 4x4 matrix data. More... | |
const T * | get3x3 () |
Accessor on the 3x3 matrix data. More... | |
std::vector< double > | getAsVector () const |
Accessor on the 4x4 matrix data. More... | |
Vec3< T > | operator* (const Vec3< T > &aVector) const |
Operator * to multiply the current matrix by a vector. More... | |
Matrix4x4 | operator* (const Matrix4x4 &aMatrix) const |
Operator * to multiply the current matrix by another matrix. More... | |
Matrix4x4 & | operator*= (const Matrix4x4 &aMatrix) |
void | print () const |
Print the matrix in the console. More... | |
void | print (std::ostream &anOutputStream) const |
Print the matrix in the console. More... | |
Static Public Member Functions | |
static Matrix4x4 | buildIdentityMatrix () |
Build an identity matrix. More... | |
static Matrix4x4 | buildTranslationMatrix (const Vec3< T > &aVector) |
Build a tranlation matrix. More... | |
static Matrix4x4 | buildRotationMatrix (T anAngle, T x, T y, T z) |
Build a rotation matrix. More... | |
static Matrix4x4 | buildYawPitchRollRotationMatrix (T yaw, T pitch, T roll) |
Build a rotation matrix. More... | |
static Matrix4x4 | buildScaleMatrix (const Vec3< T > &aVector) |
Build a scale matrix. More... | |
static Matrix4x4 | buildScaleMatrix (T x, T y, T z) |
Build a scale matrix. More... | |
static Matrix4x4 | buildRotationMatrix (T anAngle, const Vec3< T > &aVector) |
Build a rotation matrix. More... | |
static Matrix4x4 | buildTranslationMatrix (T x, T y, T z) |
Build a rotation matrix. More... | |
Protected Attributes | |
T | m_p_4x4_data [4 *4] |
the matrix data More... | |
T | m_p_3x3_data [3 *3] |
the matrix data More... | |
bool | m_small_matrix_up_to_date |
Matrix4x4 is a template class to handle a 4 by 4 matrix.
Definition at line 89 of file Matrix4x4.h.
gVirtualXRay::Matrix4x4< T >::Matrix4x4 | ( | const T & | a1 = 1.0f , |
const T & | a2 = 0.0f , |
||
const T & | a3 = 0.0f , |
||
const T & | a4 = 0.0f , |
||
const T & | a5 = 0.0f , |
||
const T & | a6 = 1.0f , |
||
const T & | a7 = 0.0f , |
||
const T & | a8 = 0.0f , |
||
const T & | a9 = 0.0f , |
||
const T & | a10 = 0.0f , |
||
const T & | a11 = 1.0f , |
||
const T & | a12 = 0.0f , |
||
const T & | a13 = 0.0f , |
||
const T & | a14 = 0.0f , |
||
const T & | a15 = 0.0f , |
||
const T & | a16 = 1.0f |
||
) |
Default Constructor (create an identity matrix).
a1 | the 1st element of the matrix |
a2 | the 2nd element of the matrix |
a3 | the 3rd element of the matrix |
a4 | the 4th element of the matrix |
a5 | the 5th element of the matrix |
a6 | the 6th element of the matrix |
a7 | the 7th element of the matrix |
a8 | the 8th element of the matrix |
a9 | the 9th element of the matrix |
a10 | the 10th element of the matrix |
a11 | the 11th element of the matrix |
a12 | the 12th element of the matrix |
a13 | the 13th element of the matrix |
a14 | the 14th element of the matrix |
a15 | the 15th element of the matrix |
a16 | the 16th element of the matrix |
Definition at line 87 of file Matrix4x4.inl.
gVirtualXRay::Matrix4x4< T >::Matrix4x4 | ( | const Matrix4x4< T > & | aMatrix | ) |
Copy Constructor.
aMatrix | the matrix to copy |
Definition at line 115 of file Matrix4x4.inl.
gVirtualXRay::Matrix4x4< T >::Matrix4x4 | ( | const Matrix4x4< T > * | apMatrix | ) |
Copy Constructor.
apMatrix | the matrix to copy |
gVirtualXRay::Matrix4x4< T >::Matrix4x4 | ( | const T * | apMatrix | ) |
Copy Constructor.
apMatrix | the matrix to copy |
Definition at line 125 of file Matrix4x4.inl.
gVirtualXRay::Matrix4x4< T >::Matrix4x4 | ( | const std::vector< double > & | apMatrix | ) |
Copy Constructor.
apMatrix | the matrix to copy |
Definition at line 135 of file Matrix4x4.inl.
|
static |
|
static |
Build a rotation matrix.
anAngle | the angle of rotation in degrees |
x | the x-component of the axis of rotation |
y | the y-component of the axis of rotation |
z | the z-component of the axis of rotation |
Definition at line 307 of file Matrix4x4.inl.
|
static |
Build a rotation matrix.
anAngle | the angle of rotation in degrees |
aVector | the axis of rotation |
Definition at line 298 of file Matrix4x4.inl.
|
static |
Build a scale matrix.
aVector | the scale vector |
Definition at line 268 of file Matrix4x4.inl.
|
static |
Build a scale matrix.
x | the x-component of the axis of scale |
y | the y-component of the axis of scale |
z | the z-component of the axis of scale |
Definition at line 276 of file Matrix4x4.inl.
|
static |
Build a tranlation matrix.
aVector | the translation vector |
Definition at line 249 of file Matrix4x4.inl.
|
static |
Build a rotation matrix.
x | the x-component of the translation vector |
y | the y-component of the translation vector |
z | the z-component of the translation vector |
Definition at line 257 of file Matrix4x4.inl.
|
static |
Build a rotation matrix.
yaw | a counterclockwise rotation of yaw degrees about the z-axis |
pitch | a counterclockwise rotation of yaw degrees about the y-axis |
roll | a counterclockwise rotation of yaw degrees about the x-axis |
Definition at line 356 of file Matrix4x4.inl.
T gVirtualXRay::Matrix4x4< T >::determinant | ( | ) | const |
Compute the determinant of the current matrix.
Definition at line 436 of file Matrix4x4.inl.
const T * gVirtualXRay::Matrix4x4< T >::get | ( | ) | const |
Accessor on the 4x4 matrix data.
Definition at line 548 of file Matrix4x4.inl.
const T * gVirtualXRay::Matrix4x4< T >::get3x3 | ( | ) |
Accessor on the 3x3 matrix data.
Definition at line 564 of file Matrix4x4.inl.
const T * gVirtualXRay::Matrix4x4< T >::get4x4 | ( | ) | const |
Accessor on the 4x4 matrix data.
Definition at line 556 of file Matrix4x4.inl.
std::vector< double > gVirtualXRay::Matrix4x4< T >::getAsVector | ( | ) | const |
Accessor on the 4x4 matrix data.
Definition at line 590 of file Matrix4x4.inl.
Matrix4x4< T > gVirtualXRay::Matrix4x4< T >::getInverse | ( | ) | const |
Get the inverse of the current matrix.
Definition at line 450 of file Matrix4x4.inl.
Matrix4x4< T > gVirtualXRay::Matrix4x4< T >::getTranspose | ( | ) | const |
Get the transpose of the current matrix.
Definition at line 424 of file Matrix4x4.inl.
void gVirtualXRay::Matrix4x4< T >::loadIdentity | ( | ) |
Load identity matrix.
Definition at line 151 of file Matrix4x4.inl.
Vec3< T > gVirtualXRay::Matrix4x4< T >::operator* | ( | const Vec3< T > & | aVector | ) | const |
Operator * to multiply the current matrix by a vector.
aVector | the vector to transform |
Definition at line 493 of file Matrix4x4.inl.
Matrix4x4< T > gVirtualXRay::Matrix4x4< T >::operator* | ( | const Matrix4x4< T > & | aMatrix | ) | const |
Operator * to multiply the current matrix by another matrix.
aMatrix | the other matrix |
Definition at line 506 of file Matrix4x4.inl.
Matrix4x4< T > & gVirtualXRay::Matrix4x4< T >::operator*= | ( | const Matrix4x4< T > & | aMatrix | ) |
Operator *= to multiply the current matrix by another matrix, and modify the current matrix.
aMatrix | the other matrix |
Definition at line 536 of file Matrix4x4.inl.
Matrix4x4< T > & gVirtualXRay::Matrix4x4< T >::operator= | ( | const Matrix4x4< T > & | aMatrix | ) |
Copy operator.
aMatrix | the matrix to copy |
Definition at line 481 of file Matrix4x4.inl.
void gVirtualXRay::Matrix4x4< T >::print | ( | ) | const |
Print the matrix in the console.
Definition at line 605 of file Matrix4x4.inl.
void gVirtualXRay::Matrix4x4< T >::print | ( | std::ostream & | anOutputStream | ) | const |
Print the matrix in the console.
anOutputStream | the stream in which the matrix will be printed |
Definition at line 613 of file Matrix4x4.inl.
void gVirtualXRay::Matrix4x4< T >::rotate | ( | const double | anAngle, |
const Vec3< T > & | aVector | ||
) |
Multiply the current matrix by a rotation matrix.
anAngle | the angle of rotation in degrees |
aVector | the axis of rotation |
Definition at line 195 of file Matrix4x4.inl.
void gVirtualXRay::Matrix4x4< T >::scale | ( | T | x, |
T | y, | ||
T | z | ||
) |
Multiply the current matrix by a scaling matrix.
x | the scaling factor along the X-axis |
y | the scaling factor along the Y-axis |
z | the scaling factor along the Z-axis |
Definition at line 399 of file Matrix4x4.inl.
void gVirtualXRay::Matrix4x4< T >::setFromVector | ( | const std::vector< double > & | apMatrix | ) |
Load the matrix.
apMatrix | the matrix to copy |
Definition at line 179 of file Matrix4x4.inl.
void gVirtualXRay::Matrix4x4< T >::translate | ( | const Vec3< T > & | aVector | ) |
Multiply the current matrix by a translation matrix.
aVector | the translation vector |
Definition at line 217 of file Matrix4x4.inl.
void gVirtualXRay::Matrix4x4< T >::translate | ( | T | x, |
T | y, | ||
T | z | ||
) |
Multiply the current matrix by a translation matrix.
x | the x-component of the translation vector |
y | the y-component of the translation vector |
z | the z-component of the translation vector |
Definition at line 227 of file Matrix4x4.inl.
void gVirtualXRay::Matrix4x4< T >::yawPitchRollRotate | ( | double | yaw, |
double | pitch, | ||
double | roll | ||
) |
Multiply the current matrix by a yaw, pitch, roll rotation matrix.
yaw | a counterclockwise rotation of yaw degrees about the z-axis |
pitch | a counterclockwise rotation of yaw degrees about the y-axis |
roll | a counterclockwise rotation of yaw degrees about the x-axis |
Definition at line 205 of file Matrix4x4.inl.
|
protected |
the matrix data
Definition at line 468 of file Matrix4x4.h.
|
protected |
the matrix data
Definition at line 464 of file Matrix4x4.h.
|
protected |
A flag to check if the 3x3 matrix is up-to-date. It is used for lazy evaluation.
Definition at line 473 of file Matrix4x4.h.