Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

CMat4D Class Reference

Matrix class. More...

#include <CMat4D.h>

List of all members.

Public Methods

 CMat4D (void)
 CMat4D (const CV4D &, const CV4D &, const CV4D &, const CV4D &)
 CMat4D (const double *)
 CMat4D (double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double)
 CMat4D (const CMat4D &)
 ~CMat4D (void)
const CMat4D & operator= (const CMat4D &)
const CMat4D & operator= (const double a)
CMat4D & operator+= (const CMat4D &m)
CMat4D & operator-= (const CMat4D &m)
CMat4D & operator *= (const CMat4D &)
CMat4D operator+ (const CMat4D &) const
CMat4D operator- (const CMat4D &) const
CMat4D operator * (const CMat4D &m) const
CMat4D operator * (double scalar) const
bool operator== (const CMat4D &m) const
bool operator!= (const CMat4D &m) const
double operator() (int i, int j) const
CV4D operator[] (int i) const
CV4D operator() (int j) const
const double * getArray ()
void clear (void)
void setValues (double *field)
double getCoeff (int i, int j) const
void setCoeff (int i, int j, double value)
CMat4D getTransposed (void) const
CMat4D getInverted (void) const
bool invert (void)
void transpose (void)
void print (void)
void setIdentity (void)
CV4D getRow (int)
CV4D getCol (int)
void setRow (int nRow, const CV4D &)
void setCol (int nCol, const CV4D &)
void setRows (const CV4D &, const CV4D &, const CV4D &, const CV4D &)
void setCols (const CV4D &, const CV4D &, const CV4D &, const CV4D &)
void setScaling (const CV4D &)
void setScaling (const CV3D &)
void setScaling (double, double, double)
void setTranslation (const CV4D &)
void setTranslation (const CV3D &)
void setTranslation (double, double, double)
void setRotation (CV4D &, double)
void setRotation (CV3D &, double)
void setRotation (CQuat &)

Static Public Methods

CMat4D PIdentity (void)
CMat4D PTranslate (const CV4D &)
CMat4D PTranslate (const CV3D &)
CMat4D PTranslate (double, double, double)
CMat4D PScale (const CV4D &)
CMat4D PScale (const CV3D &)
CMat4D PScale (double, double, double)
CMat4D PRotate (const CV4D &, double)
CMat4D PRotate (const CV3D &, double)
CMat4D PRotate (CQuat &)

Private Methods

double * get1DField (void)
double ** get2DField (void)

Private Attributes

double m_ardValues [16]

Friends

CV4D operator * (const CMat4D &, const CV4D &)
CP4D operator * (const CMat4D &, const CP4D &)
CMat4D operator * (double, const CMat4D &)
CMat4D operator * (const CMat4D &M, double rdFactor)
ostream & operator<< (ostream &s, const CMat4D &m)


Detailed Description

Matrix class.

Note: CMat4D objects are handled in classic mathematical manner, i.e. to "transform a vector" multiply it like Tv - i.e. we have column vectors multiplied from the right side. [richi]


Constructor & Destructor Documentation

CMat4D::CMat4D void  
 

Default Constructor.

CMat4D::CMat4D const CV4D &   col1,
const CV4D &   col2,
const CV4D &   col3,
const CV4D &   col4
 

Construct new matrix with the values passed by the vectors. The values of 'col1' are put in the first column, the values of 'col2' are put to the second column and so on.

CMat4D::CMat4D const double *   field
 

Construct new matrix with the values passed in '*field'. The first four values of the array passed by 'field' are stored in the first column of the matrix and so on.

CMat4D::CMat4D double   d0,
double   d1,
double   d2,
double   d3,
double   d4,
double   d5,
double   d6,
double   d7,
double   d8,
double   d9,
double   d10,
double   d11,
double   d12,
double   d13,
double   d14,
double   d15
 

Construct new matrix with values passed in [] order.

CMat4D::CMat4D const CMat4D &   m
 

Copy constructor.

CMat4D::~CMat4D void  
 

Default Destructor.


Member Function Documentation

CMat4D CMat4D::PIdentity void   [static]
 

Construtor for identity matrix.

CMat4D CMat4D::PRotate CQuat &   quad [static]
 

Construtor generating identity matrix with rotation defined by the quaternion.

CMat4D CMat4D::PRotate const CV3D &   Axis,
double   rdAngle
[static]
 

Construtor generating identity matrix with rotation around an axis by a certain angle in rad.

CMat4D CMat4D::PRotate const CV4D &   Axis,
double   rdAngle
[static]
 

Construtor generating identity matrix with rotation around an axis by a certain angle in rad. Please note that only x, y, and z of the vector are used, w is omitted.

CMat4D CMat4D::PScale double   rdX,
double   rdY,
double   rdZ
[static]
 

Construtor generating identity matrix with scaling by a vector.

CMat4D CMat4D::PScale const CV3D &   v [static]
 

Construtor generating identity matrix with scaling by a vector.

CMat4D CMat4D::PScale const CV4D &   v [static]
 

Construtor generating identity matrix with scaling by a vector. Please note, only x, y, and z of the vector are used. W is omitted.

CMat4D CMat4D::PTranslate double   rdX,
double   rdY,
double   rdZ
[static]
 

Construtor generating identity matrix with a translatation by a vector.

CMat4D CMat4D::PTranslate const CV3D &   v [static]
 

Construtor generating identity matrix with a translatation by a vector.

CMat4D CMat4D::PTranslate const CV4D &   v [static]
 

Construtor generating identity matrix with a translatation by a vector. Please note, only x, y, and z of the vector are used. W is omitted.

void CMat4D::clear void  
 

Initialize the matrix with 0.

double * CMat4D::get1DField void   [private]
 

Returns a one dimensional array of the matrix elements.

double ** CMat4D::get2DField void   [private]
 

Returns a two dimensional array of the matrix elements.

const double* CMat4D::getArray   [inline]
 

Returns the pointer to the array of the matrix.

double CMat4D::getCoeff int   i,
int   j
const
 

Returns the element in the i-th row and j-th coloumn.

CV4D CMat4D::getCol int   i
 

Returns the column of the matrix (0 through 3).

CMat4D CMat4D::getInverted void   const
 

CV4D CMat4D::getRow int   i
 

Returns the row of the matrix (0 through 3).

CMat4D CMat4D::getTransposed void   const
 

Tranpose the matrix.

bool CMat4D::invert void  
 

invert this matrix

CMat4D CMat4D::operator * double   rdScalar const
 

Multiplication of a matrix with a scalar.

CMat4D CMat4D::operator * const CMat4D &   m const
 

Multiplication of a matrix (this) with another matrix.

CMat4D & CMat4D::operator *= const CMat4D &   m
 

Multiplication of a matrix with this matrix.

bool CMat4D::operator!= const CMat4D &   m const
 

boolean operator ( NOT EQUAL )

CV4D CMat4D::operator() int   j const
 

Returns the j-th column of the matrix.

double CMat4D::operator() int   i,
int   j
const
 

Returns the element in the i-th row and j-th coloumn.

CMat4D CMat4D::operator+ const CMat4D &   mat const
 

Addition of two matrices.

CMat4D & CMat4D::operator+= const CMat4D &   mat
 

Add matrix to this matrix

CMat4D CMat4D::operator- const CMat4D &   mat const
 

Subtraction of two matrices.

CMat4D & CMat4D::operator-= const CMat4D &   mat
 

const CMat4D & CMat4D::operator= const double   a
 

Set the diagonal to the passed value.

const CMat4D & CMat4D::operator= const CMat4D &   mat
 

Assign one matrix to another.

bool CMat4D::operator== const CMat4D &   m const
 

boolean operator ( EQUAL )

CV4D CMat4D::operator[] int   i const
 

Returns the i-th row of the matrix.

void CMat4D::print void  
 

Print the matrix to standard output.

void CMat4D::setCoeff int   i,
int   j,
double   a
 

Sets the element in the i-th row and j-th coloumn.

void CMat4D::setCol int   nCol,
const CV4D &   cCol
 

Sets the specified column of the matrix with the given vector.

void CMat4D::setCols const CV4D &   col0,
const CV4D &   col1,
const CV4D &   col2,
const CV4D &   col3
 

Sets all four columns of the matrix with the given vectors.

void CMat4D::setIdentity void  
 

Set matrix to identity.

void CMat4D::setRotation CQuat &   quad
 

Rotates using the given quaternion.

void CMat4D::setRotation CV3D &   Axis,
double   rdAngle
 

Rotates around an axis by a certain angle.

void CMat4D::setRotation CV4D &   Axis,
double   rdAngle
 

Rotates around an axis by a certain angle.

void CMat4D::setRow int   nRow,
const CV4D &   cRow
 

Sets the specified row of the matrix with the given vector.

void CMat4D::setRows const CV4D &   row0,
const CV4D &   row1,
const CV4D &   row2,
const CV4D &   row3
 

Sets all four rows of the matrix with the given vectors.

void CMat4D::setScaling double   rdX,
double   rdY,
double   rdZ
 

Sets the scaling of the matrix (diagonal elements). Note Before this, the matrix is cleard and afterwards, the fourth diagonal element is set to 1!!!

void CMat4D::setScaling const CV3D &   v
 

Sets the scaling of the matrix (diagonal elements). Note Before this, the matrix is cleard and afterwards, the fourth diagonal element is set to 1!!!

void CMat4D::setScaling const CV4D &   v
 

Sets the scaling of the matrix (diagonal elements). Note Before this, the matrix is cleard and afterwards, the fourth diagonal element is set to 1!!!

void CMat4D::setTranslation double   rdX,
double   rdY,
double   rdZ
 

Sets the scaling of the matrix (diagonal elements). Note Before this, the matrix is cleard and afterwards, the fourth element in the last row is set to 1!!!

void CMat4D::setTranslation const CV3D &   v
 

Sets the scaling of the matrix (diagonal elements). Note Before this, the matrix is cleard and afterwards, the fourth element in the last row is set to 1!!!

void CMat4D::setTranslation const CV4D &   v
 

Sets the scaling of the matrix (diagonal elements). Note Before this, the matrix is cleard and afterwards, the fourth element in the last row is set to 1!!!

void CMat4D::setValues double *   prdValue
 

Set the coefficient of the matrix to the values given in *field. The first four values of the array passed by 'field' are stored in the first column of the matrix and so on.

void CMat4D::transpose void  
 

transpose this matrix


Friends And Related Function Documentation

CMat4D operator * const CMat4D &   M,
double   rdFactor
[friend]
 

Multiplication of a scalar with a matrix.

CMat4D operator * double   rdScalar,
const CMat4D &   m
[friend]
 

Multiplication of a matrix with a scalar.

CP4D operator * const CMat4D &   m,
const CP4D &   p
[friend]
 

Multiplication of a matrix with a point.

CV4D operator * const CMat4D &   m,
const CV4D &   v
[friend]
 

Multiplication of a matrix with a vector.

ostream& operator<< ostream &   s,
const CMat4D &   m
[friend]
 

Print the matrix to output stream.


Member Data Documentation

double CMat4D::m_ardValues[16] [private]
 


The documentation for this class was generated from the following files:
Generated at Thu Oct 4 17:17:29 2001 for QGLViewer by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001