GLC_Matrix4x4 Class Reference

GLC_Matrix4x4 is a 4 dimensions Matrix. More...

#include <glc_matrix4x4.h>

List of all members.

Public Types

enum  { General = 0x0000, Direct = 0x0001, Indirect = 0x0002, Identity = 0x0003 }
 

matrix possible type

More...

Public Member Functions

Constructor

 GLC_Matrix4x4 ()
 Construct an identity matrix.
 GLC_Matrix4x4 (const GLC_Matrix4x4 &matrix)
 Construct a matrix from another matrix.
 GLC_Matrix4x4 (const double *pArray)
 Construct a matrix from an array of 16 double elements.
 GLC_Matrix4x4 (const float *)
 Construct a Matrix from an array of 16 float elements.
 GLC_Matrix4x4 (const GLC_Vector3d &Vect, const double &dAngleRad)
 Construct rotation matrix from a 3d vector and an angle in radians.
 GLC_Matrix4x4 (const GLC_Vector3d &Vect1, const GLC_Vector3d &Vect2)
 Construct rotation matrix from 2 3d vectors.
 GLC_Matrix4x4 (const GLC_Vector3d &Vect)
 Construct translation matrix from a 3d vector.
 GLC_Matrix4x4 (const double Tx, const double Ty, const double Tz)
 Construct translation matrix from coordinates in double.
Operator Overload

GLC_Matrix4x4operator= (const GLC_Matrix4x4 &matrix)
 Copy the content of the given matrix in this matrix.
GLC_Matrix4x4 operator* (const GLC_Matrix4x4 &Mat) const
 Return the product of this matrix to the given matrix.
GLC_Vector3d operator* (const GLC_Vector3d &Vect) const
 Return the result of transforming the given vector by this matrix.
bool operator== (const GLC_Matrix4x4 &mat) const
 Return true if this matrix is equal to the given matrix.
bool operator!= (const GLC_Matrix4x4 &mat) const
 Return true if this matrix is not equal to the given matrix.
Get Function

double determinant (void) const
 Return the determinant of this matrix.
const double * getData (void)
 Return a pointer to the row first array of 16 elements of this matrix.
const double * getData (void) const
 Return a const pointer to the row first array of 16 elements of this matrix.
double * setData (void)
 Return a pointer to the row first array of 16 elements of this matrix.
QVector< double > toEuler (void) const
 Return a QVector<double> which contains radians Euler angle of this matrix.
QString toString () const
 Return the string representation of this matrix.
GLC_Matrix4x4 rotationMatrix () const
 Return the rotation matrix of this matrix.
GLC_Matrix4x4 isometricMatrix () const
 Return the isometric matrix of this matrix.
double scalingX () const
 Return the x Scaling of this matrix.
double scalingY () const
 Return the y Scaling of this matrix.
double scalingZ () const
 Return the z Scaling of this matrix.
GLC_Matrix4x4 inverted () const
 Return the inverse of this matrix.
int type () const
 Return The type af this matrix.
bool isDirect () const
 Return true if this matrix is direct.
Set Function

GLC_Matrix4x4setMatRot (const GLC_Vector3d &, const double &)
 Set this matrix to a rotation matrix given by a 3d vector and an angle in radian.
GLC_Matrix4x4setMatRot (const GLC_Vector3d &, const GLC_Vector3d &)
 Set this matrix to a rotation matrix given by 2 3d vectors.
GLC_Matrix4x4setMatTranslate (const GLC_Vector3d &)
 Set this matrix to a translation matrix given by a 3d vector.
GLC_Matrix4x4setMatTranslate (const double, const double, const double)
 Set this matrix to a translation matrix given by 3 double coordinates.
GLC_Matrix4x4setMatScaling (const double, const double, const double)
 Set this matrix to a scaling matrix define by 3 double.
GLC_Matrix4x4invert (void)
 Inverse this Matrix and return a reference to this matrix.
GLC_Matrix4x4setToIdentity ()
 Set this matrix to the identify matrix and return a reference to this matrix.
GLC_Matrix4x4transpose (void)
 Transpose this matrix and return a reference to this matrix.
GLC_Matrix4x4fromEuler (const double, const double, const double)
 Set this matrix with Euler angle and return a reference to this matrix.
GLC_Matrix4x4setColumn (int index, const GLC_Vector3d &vector)
 Set this matrix column from the given 3d vector.
GLC_Matrix4x4optimise (bool force=false)
 Optimise the usage of this matrix (Genral, Direct, Identity).

Private Types

enum  { TAILLEMAT4X4 = 16 }
 

Number of elements of this matrix.

More...
enum  { DIMMAT4X4 = 4 }
 

Matrix size.

More...

Private Member Functions

bool isInDiagonal (const int index) const
 Return true if the index (argument) is in the diagonal of this matrix.
double getDeterminantLC (const int, const int) const
 Return the determinant of this matrix cell given from 2 int.
void getSubMat (const int, const int, double *) const
 Compute Sub 3X3 matrix given by 2 int and set the given double pointeur.
GLC_Matrix4x4 getTranspose (void) const
 Return the transpose matrix of this matrix.
GLC_Matrix4x4 getCoMat4x4 (void) const
 Return the co-matrix of this matrix.

Private Attributes

double m_Matrix [TAILLEMAT4X4]
 Matrix row first array.
int m_Type
 the type of this matrix

Friends

class GLC_Vector3d

Detailed Description

GLC_Matrix4x4 is a 4 dimensions Matrix.

GLC_Matrix4x4 is used to represent 3d homogeneous transformation in 3d space
GLC_Matrix4x4 is a row first matrix compatible with OpenGL Matrix

Definition at line 41 of file glc_matrix4x4.h.


Member Enumeration Documentation

anonymous enum

matrix possible type

Enumerator:
General 
Direct 
Indirect 
Identity 

Definition at line 46 of file glc_matrix4x4.h.

anonymous enum [private]

Number of elements of this matrix.

Enumerator:
TAILLEMAT4X4 

Definition at line 256 of file glc_matrix4x4.h.

anonymous enum [private]

Matrix size.

Enumerator:
DIMMAT4X4 

Definition at line 259 of file glc_matrix4x4.h.


Constructor & Destructor Documentation

GLC_Matrix4x4::GLC_Matrix4x4 (  )  [inline]

Construct an identity matrix.

Definition at line 297 of file glc_matrix4x4.h.

References setToIdentity().

GLC_Matrix4x4::GLC_Matrix4x4 ( const GLC_Matrix4x4 matrix  )  [inline]

Construct a matrix from another matrix.

Definition at line 64 of file glc_matrix4x4.h.

References m_Matrix.

GLC_Matrix4x4::GLC_Matrix4x4 ( const double *  pArray  )  [inline]

Construct a matrix from an array of 16 double elements.

Definition at line 71 of file glc_matrix4x4.h.

GLC_Matrix4x4::GLC_Matrix4x4 ( const float *  Tableau  )  [inline]

Construct a Matrix from an array of 16 float elements.

Definition at line 303 of file glc_matrix4x4.h.

References m_Matrix, and TAILLEMAT4X4.

GLC_Matrix4x4::GLC_Matrix4x4 ( const GLC_Vector3d Vect,
const double &  dAngleRad 
) [inline]

Construct rotation matrix from a 3d vector and an angle in radians.

Definition at line 312 of file glc_matrix4x4.h.

References setMatRot(), and setToIdentity().

GLC_Matrix4x4::GLC_Matrix4x4 ( const GLC_Vector3d Vect1,
const GLC_Vector3d Vect2 
) [inline]

Construct rotation matrix from 2 3d vectors.

Definition at line 319 of file glc_matrix4x4.h.

References setMatRot(), and setToIdentity().

GLC_Matrix4x4::GLC_Matrix4x4 ( const GLC_Vector3d Vect  )  [inline]

Construct translation matrix from a 3d vector.

Definition at line 87 of file glc_matrix4x4.h.

GLC_Matrix4x4::GLC_Matrix4x4 ( const double  Tx,
const double  Ty,
const double  Tz 
) [inline]

Construct translation matrix from coordinates in double.

Definition at line 91 of file glc_matrix4x4.h.


Member Function Documentation

double GLC_Matrix4x4::determinant ( void   )  const [inline]

Return the determinant of this matrix.

Definition at line 647 of file glc_matrix4x4.h.

References DIMMAT4X4, getDeterminant3x3(), getSubMat(), and m_Matrix.

Referenced by invert(), and optimise().

GLC_Matrix4x4 & GLC_Matrix4x4::fromEuler ( const double  angle_x,
const double  angle_y,
const double  angle_z 
)

Set this matrix with Euler angle and return a reference to this matrix.

Definition at line 32 of file glc_matrix4x4.cpp.

References m_Matrix.

GLC_Matrix4x4 GLC_Matrix4x4::getCoMat4x4 ( void   )  const [inline, private]

Return the co-matrix of this matrix.

Definition at line 733 of file glc_matrix4x4.h.

References DIMMAT4X4, General, getDeterminant3x3(), getSubMat(), m_Matrix, and m_Type.

Referenced by invert().

const double* GLC_Matrix4x4::getData ( void   )  const [inline]

Return a const pointer to the row first array of 16 elements of this matrix.

Definition at line 132 of file glc_matrix4x4.h.

const double* GLC_Matrix4x4::getData ( void   )  [inline]

Return a pointer to the row first array of 16 elements of this matrix.

Don't modify data with this method

Definition at line 128 of file glc_matrix4x4.h.

Referenced by GLC_WorldTo3dxml::matrixString(), GLC_Viewport::unproject(), GLC_Viewport::unProject(), and GLC_Frustum::update().

double GLC_Matrix4x4::getDeterminantLC ( const int  Ligne,
const int  Colonne 
) const [inline, private]

Return the determinant of this matrix cell given from 2 int.

Definition at line 663 of file glc_matrix4x4.h.

References DIMMAT4X4, getDeterminant3x3(), getSubMat(), and m_Matrix.

void GLC_Matrix4x4::getSubMat ( const int  Ligne,
const int  Colonne,
double *  ResultMat 
) const [inline, private]

Compute Sub 3X3 matrix given by 2 int and set the given double pointeur.

Definition at line 678 of file glc_matrix4x4.h.

References DIMMAT4X4, and m_Matrix.

Referenced by determinant(), getCoMat4x4(), and getDeterminantLC().

GLC_Matrix4x4 GLC_Matrix4x4::getTranspose ( void   )  const [inline, private]

Return the transpose matrix of this matrix.

Definition at line 713 of file glc_matrix4x4.h.

References DIMMAT4X4, m_Matrix, and m_Type.

Referenced by invert().

GLC_Matrix4x4 & GLC_Matrix4x4::invert ( void   )  [inline]

Inverse this Matrix and return a reference to this matrix.

Definition at line 568 of file glc_matrix4x4.h.

References determinant(), getCoMat4x4(), getTranspose(), m_Matrix, and TAILLEMAT4X4.

Referenced by GLC_3dsToWorld::createMeshes(), GLC_Camera::orbit(), and GLC_Camera::pan().

GLC_Matrix4x4 GLC_Matrix4x4::inverted (  )  const [inline]

Return the inverse of this matrix.

Definition at line 167 of file glc_matrix4x4.h.

References GLC_Vector3d::GLC_Matrix4x4.

Referenced by GLC_TsrMover::move().

bool GLC_Matrix4x4::isDirect (  )  const [inline]

Return true if this matrix is direct.

Definition at line 177 of file glc_matrix4x4.h.

bool GLC_Matrix4x4::isInDiagonal ( const int  index  )  const [inline, private]

Return true if the index (argument) is in the diagonal of this matrix.

Private services Functions

Definition at line 228 of file glc_matrix4x4.h.

GLC_Matrix4x4 GLC_Matrix4x4::isometricMatrix (  )  const [inline]

Return the isometric matrix of this matrix.

Definition at line 449 of file glc_matrix4x4.h.

References General, m_Matrix, m_Type, scalingX(), scalingY(), and scalingZ().

bool GLC_Matrix4x4::operator!= ( const GLC_Matrix4x4 mat  )  const [inline]

Return true if this matrix is not equal to the given matrix.

Definition at line 113 of file glc_matrix4x4.h.

References operator==().

GLC_Vector3d GLC_Matrix4x4::operator* ( const GLC_Vector3d Vect  )  const [inline]

Return the result of transforming the given vector by this matrix.

Definition at line 379 of file glc_matrix4x4.h.

References DIMMAT4X4, m_Matrix, and GLC_Vector3d::m_Vector.

GLC_Matrix4x4 GLC_Matrix4x4::operator* ( const GLC_Matrix4x4 Mat  )  const [inline]

Return the product of this matrix to the given matrix.

Definition at line 326 of file glc_matrix4x4.h.

References DIMMAT4X4, Identity, Indirect, m_Matrix, and m_Type.

GLC_Matrix4x4 & GLC_Matrix4x4::operator= ( const GLC_Matrix4x4 matrix  )  [inline]

Copy the content of the given matrix in this matrix.

Definition at line 371 of file glc_matrix4x4.h.

References m_Matrix, and m_Type.

bool GLC_Matrix4x4::operator== ( const GLC_Matrix4x4 mat  )  const [inline]

Return true if this matrix is equal to the given matrix.

Definition at line 410 of file glc_matrix4x4.h.

References m_Matrix, and TAILLEMAT4X4.

GLC_Matrix4x4 & GLC_Matrix4x4::optimise ( bool  force = false  )  [inline]

Optimise the usage of this matrix (Genral, Direct, Identity).

Definition at line 620 of file glc_matrix4x4.h.

References determinant(), Direct, General, Identity, Indirect, m_Matrix, and m_Type.

Referenced by GLC_ColladaToWorld::composeMatrixNode(), GLC_3dsToWorld::createMeshes(), and GLC_ColladaToWorld::scaleNode().

GLC_Matrix4x4 GLC_Matrix4x4::rotationMatrix (  )  const [inline]

Return the rotation matrix of this matrix.

Definition at line 422 of file glc_matrix4x4.h.

References General, m_Matrix, m_Type, scalingX(), scalingY(), and scalingZ().

Referenced by GLC_Camera::move(), GLC_CuttingPlane::moveManipulatorRep(), GLC_CuttingPlane::rotationNavigator(), and GLC_Mesh::transformVertice().

double GLC_Matrix4x4::scalingX (  )  const [inline]

Return the x Scaling of this matrix.

Definition at line 155 of file glc_matrix4x4.h.

References GLC_Vector3d::GLC_Vector3d().

Referenced by GLC_3DViewInstance::choseLod(), isometricMatrix(), rotationMatrix(), and GLC_OctreeNode::updateViewableInstances().

double GLC_Matrix4x4::scalingY (  )  const [inline]

Return the y Scaling of this matrix.

Definition at line 159 of file glc_matrix4x4.h.

References GLC_Vector3d::GLC_Vector3d().

Referenced by isometricMatrix(), and rotationMatrix().

double GLC_Matrix4x4::scalingZ (  )  const [inline]

Return the z Scaling of this matrix.

Definition at line 163 of file glc_matrix4x4.h.

References GLC_Vector3d::GLC_Vector3d().

Referenced by isometricMatrix(), and rotationMatrix().

GLC_Matrix4x4 & GLC_Matrix4x4::setColumn ( int  index,
const GLC_Vector3d vector 
)

Set this matrix column from the given 3d vector.

Definition at line 60 of file glc_matrix4x4.cpp.

References General, m_Matrix, m_Type, GLC_Vector3d::x(), GLC_Vector3d::y(), and GLC_Vector3d::z().

Referenced by GLC_Arrow::createWire().

double* GLC_Matrix4x4::setData ( void   )  [inline]

Return a pointer to the row first array of 16 elements of this matrix.

Definition at line 136 of file glc_matrix4x4.h.

Referenced by GLC_Camera::createMatComp(), and GLC_Viewport::updateProjectionMat().

GLC_Matrix4x4 & GLC_Matrix4x4::setMatRot ( const GLC_Vector3d Vect1,
const GLC_Vector3d Vect2 
) [inline]

Set this matrix to a rotation matrix given by 2 3d vectors.

Definition at line 516 of file glc_matrix4x4.h.

References GLC_Vector3d::isNull(), and setMatRot().

GLC_Matrix4x4 & GLC_Matrix4x4::setMatRot ( const GLC_Vector3d Vect,
const double &  dAngleRad 
) [inline]
GLC_Matrix4x4 & GLC_Matrix4x4::setMatScaling ( const double  sX,
const double  sY,
const double  sZ 
) [inline]

Set this matrix to a scaling matrix define by 3 double.

Definition at line 555 of file glc_matrix4x4.h.

References General, m_Matrix, and m_Type.

Referenced by GLC_CuttingPlane::moveManipulatorRep(), GLC_Axis::moveManipulatorRep(), and GLC_ColladaToWorld::scaleNode().

GLC_Matrix4x4 & GLC_Matrix4x4::setMatTranslate ( const double  Tx,
const double  Ty,
const double  Tz 
) [inline]

Set this matrix to a translation matrix given by 3 double coordinates.

Definition at line 543 of file glc_matrix4x4.h.

References Direct, m_Matrix, and m_Type.

GLC_Matrix4x4 & GLC_Matrix4x4::setMatTranslate ( const GLC_Vector3d Vect  )  [inline]

Set this matrix to a translation matrix given by a 3d vector.

Definition at line 531 of file glc_matrix4x4.h.

References Direct, m_Matrix, m_Type, and GLC_Vector3d::m_Vector.

Referenced by GLC_Interpolator::CalcInterpolLineaireMat(), and GLC_Axis::moveManipulatorRep().

GLC_Matrix4x4 & GLC_Matrix4x4::setToIdentity (  )  [inline]

Set this matrix to the identify matrix and return a reference to this matrix.

Definition at line 586 of file glc_matrix4x4.h.

References Identity, m_Matrix, and m_Type.

Referenced by GLC_Interpolator::CalcInterpolAngulaireMat(), GLC_Interpolator::CalcInterpolLineaireMat(), GLC_Matrix4x4(), and GLC_3DViewInstance::resetMatrix().

QVector< double > GLC_Matrix4x4::toEuler ( void   )  const

Return a QVector<double> which contains radians Euler angle of this matrix.

Definition at line 76 of file glc_matrix4x4.cpp.

References m_Matrix, and glc::PI.

QString GLC_Matrix4x4::toString (  )  const

Return the string representation of this matrix.

Definition at line 110 of file glc_matrix4x4.cpp.

References DIMMAT4X4, and m_Matrix.

GLC_Matrix4x4 & GLC_Matrix4x4::transpose ( void   )  [inline]

Transpose this matrix and return a reference to this matrix.

Definition at line 598 of file glc_matrix4x4.h.

References DIMMAT4X4, and m_Matrix.

int GLC_Matrix4x4::type (  )  const [inline]

Return The type af this matrix.

Definition at line 171 of file glc_matrix4x4.h.

Referenced by GLC_3DViewInstance::render(), and GLC_Mesh::transformVertice().


Friends And Related Function Documentation

friend class GLC_Vector3d [friend]

Member Data Documentation

double GLC_Matrix4x4::m_Matrix[TAILLEMAT4X4] [private]
int GLC_Matrix4x4::m_Type [private]

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

SourceForge.net Logo

©2005-2011 Laurent Ribon