Main Page | Packages | Class Hierarchy | Class List | Directories | Class Members

IDVR.Tools.Matrix4 Class Reference

#include <Matrix4.h>

List of all members.


Detailed Description

Class for a 4x4 matrix.

This class is part of the Tools namespace and its target is the handling and computing of different linear transformations (e.g. transformations, rotations,etc.). For all operations including such linear transformations this class which based on homogenous coordinates should be used.
With specific initialization function such as

all needed transformations can be created and with the Matrix4.MultiplyMatices function the accumulation of an arbitrary count of linear transformation will be possible.
Please notice that the logical order of the matrix elements is in ordinary (C++ like) alignment. The following brief schema visualizes the valid matix alignment:
m00 m01 m02 m03
m10 m11 m12 m13
m20 m21 m22 m23
m30 m31 m32 m33

The implemented linear operations of this class are of course only a fraction of linear algebra, the minimum pool of operations which will be used in the IDVR program.
See also:
Matrix3 - the 3x3 matrix class for specific linear operations.
Author:
Bernhard Pflugfelder
Version:
1.0
Date:
02-17-2005


Public Member Functions

 Matrix4 (void)
 This is the standard constructor.
 Matrix4 (double n_MatrixElements __gc[,])
 Constructor initialization by a specified array of matrix elements.
 Matrix4 (Matrix4 *n_Matrix)
 Constructor initialization by an existing Matrix4 object.
Vector4multiply_WithPoint (Vector4 *v_Point)
 Use this function for multiply matrices with a specified Vector4 object.
void multiply_WithScalar (double n_Scalar)
 Multiply the current matrix with a skalar value.
double getItem (int row, int column)
 This function returns the specific matrix element.
double getArray (void) __gc[
 Get all matrix elements as two dimensional double array.
double void setItem (int row, int column, double value)
 This function sets a specific matrix element by the specified value.
double getOneDimArray (void) __gc[]
 Get an one dimensional array of the matrix elements.
Matrix4getNegativeMatrix (void)
 This function returns the negative matrix of the current Matrix4 object.
double calculateDeterminant (void)
 Calculates the determinant of the current matrix.
Matrix4transpose (void)
 Returns the transpose matrix of the current matrix.

Static Public Member Functions

static Matrix4CreateTranslationMatrix (Vector3 *n_Tanslation)
 Creates a newly translation matrix based on the specified translation vector.
static Matrix4CreateRotXMatrix (double n_angle)
 Creates a newly rotaion matrix around the x-axis based on the specified angle.
static Matrix4CreateRotYMatrix (double n_angle)
 Creates a newly rotaion matrix around the y-axis based on the specified angle.
static Matrix4CreateRotZMatrix (double n_angle)
 Creates a newly rotaion matrix around the z-axis based on the specified angle.
static Matrix4InvertMatrix (Matrix4 *n_Matrix)
 Calculates the inverted matrix of the specified 4x4 matrix.
static Matrix4CreateScaleUniformMatrix (double n_ScaleFactor)
 Creates an uniform scale matrix by the specified scale parameter around the origin..
static Matrix4CreateScaleUniformMatrix (double n_ScaleFactor, Vector3 *n_FixedPoint)
 Creates an uniform scale matrix by the specified scale parameter around an arbitrary point.
static Matrix4MultiplyMatices (Matrix4 *leftMatrix, Matrix4 *rightMatrix)
 This static funtion multiplies the specified 4x4 matrices.
static Matrix4CreateReflectionAboutXMatrix (void)
 Creates a reflection matrix about the x-axis.
static Matrix4CreateReflectionAboutYMatrix (void)
 Creates a reflection matrix about the y-axis.
static Matrix4CreateReflectionAboutZMatrix (void)
 Creates a reflection matrix about the z-axis.
static Matrix4CreateIdentityMatrix (void)
 Creates an newly 4x4 identity matrix.

Static Public Attributes

static const unsigned char ORDER = 4
 A constant that specifies the matrix order of matices of this class type.

Private Attributes

double m_MatrixElements __gc [,]
 The array of the necessary matrix elements.


Constructor & Destructor Documentation

Matrix4::Matrix4 void   ) 
 

This is the standard constructor.

This standard constructor initialized all matrix elements with zero.

Matrix4::Matrix4 double n_MatrixElements  __gc[,]  ) 
 

Constructor initialization by a specified array of matrix elements.

This constructor initialized all matrix elements with the corresponding elements of the specified 2 dimensional array.

Parameters:
n_MatrixElements the values for the matrix elements.

Matrix4::Matrix4 Matrix4 n_Matrix  ) 
 

Constructor initialization by an existing Matrix4 object.

This constructor initialized all matrix elements with the corresponfing values of the specified Matrix4 object. Please notice that the currently initialized object is not directly linked to the specified parameter by the same memory address but it has its own memory space.

Parameters:
n_Matrix the Matrix4 object containing the initialization values.


Member Function Documentation

double IDVR.Tools.Matrix4.calculateDeterminant void   ) 
 

Calculates the determinant of the current matrix.

For the calculation of the determinant the ordinary mathematical method will be used. This method is based on reducing the 4x4 matrix to a 3x3 matrix which determinant value can be easily calculated.

Returns:
The calculated determinant value.

static Matrix4* IDVR.Tools.Matrix4.CreateIdentityMatrix void   )  [static]
 

Creates an newly 4x4 identity matrix.

Returns:
The 4x4 identity matrix.

static Matrix4* IDVR.Tools.Matrix4.CreateReflectionAboutXMatrix void   )  [static]
 

Creates a reflection matrix about the x-axis.

Returns:
The created standard reflection matrix around the x-axis.

static Matrix4* IDVR.Tools.Matrix4.CreateReflectionAboutYMatrix void   )  [static]
 

Creates a reflection matrix about the y-axis.

Returns:
The created standard reflection matrix around the y-axis.

static Matrix4* IDVR.Tools.Matrix4.CreateReflectionAboutZMatrix void   )  [static]
 

Creates a reflection matrix about the z-axis.

Returns:
The created standard reflection matrix around the z-axis.

static Matrix4* IDVR.Tools.Matrix4.CreateRotXMatrix double  n_angle  )  [static]
 

Creates a newly rotaion matrix around the x-axis based on the specified angle.

Please notice that the angle parameter have to be only in radians and not in degrees.

Parameters:
n_angle the radian angle between 0 and PI.
Returns:
The created rotation matrix about the x-axis.

static Matrix4* IDVR.Tools.Matrix4.CreateRotYMatrix double  n_angle  )  [static]
 

Creates a newly rotaion matrix around the y-axis based on the specified angle.

Please notice that the angle parameter have to be only in radians and not in degrees.

Parameters:
n_angle the radian angle between 0 and PI.
Returns:
The created rotation matrix about the y-axis.

static Matrix4* IDVR.Tools.Matrix4.CreateRotZMatrix double  n_angle  )  [static]
 

Creates a newly rotaion matrix around the z-axis based on the specified angle.

Please notice that the angle parameter have to be only in radians and not in degrees.

Parameters:
n_angle the radian angle between 0 and PI.
Returns:
The created rotation matrix about the z-axis.

static Matrix4* IDVR.Tools.Matrix4.CreateScaleUniformMatrix double  n_ScaleFactor,
Vector3 n_FixedPoint
[static]
 

Creates an uniform scale matrix by the specified scale parameter around an arbitrary point.

That means that all dimensions will be scaled by the same factor around a fix point.

Parameters:
n_ScaleFactor the scale factor.
n_FixedPoint the fix point of the scale transformation.
Returns:
The created uniform scale matrix.

static Matrix4* IDVR.Tools.Matrix4.CreateScaleUniformMatrix double  n_ScaleFactor  )  [static]
 

Creates an uniform scale matrix by the specified scale parameter around the origin..

That means that all dimensions will be scaled by the same factor.

Parameters:
n_ScaleFactor the scale factor.
Returns:
The created uniform scale matrix.

static Matrix4* IDVR.Tools.Matrix4.CreateTranslationMatrix Vector3 n_Tanslation  )  [static]
 

Creates a newly translation matrix based on the specified translation vector.

With the values of the Vector3 instance a standard translation matrix will be created.

Parameters:
n_Tanslation the translation values which should be used.
Returns:
The created translation matrix.

double Matrix4::getArray void   ) 
 

Get all matrix elements as two dimensional double array.

Returns:
The two dimensional array containing the corresponding matrix elements.

double Matrix4::getItem int  row,
int  column
 

This function returns the specific matrix element.

This element is specified by the specified parameter which are the row and column count.

Parameters:
row the row count of the specific element.
column the column count of the specific element.
Returns:
The matrix element which is defined by teh parameters.
Exceptions:
Exception instance will be thrown if either the row or column count is not valid.

Matrix4* IDVR.Tools.Matrix4.getNegativeMatrix void   ) 
 

This function returns the negative matrix of the current Matrix4 object.

This means that the current matrix is multiplied with the skalar -1 which is actually a skalar product.

Returns:
The negative matrix as a new Matrix4 object.

double IDVR.Tools.Matrix4.getOneDimArray void   ) 
 

Get an one dimensional array of the matrix elements.

Returns:
The one dimensional array of all matrix elements.

static Matrix4* IDVR.Tools.Matrix4.InvertMatrix Matrix4 n_Matrix  )  [static]
 

Calculates the inverted matrix of the specified 4x4 matrix.

The calculation of the inverse matrix will be realized by multiply the Cofactor matrix with the inverse determinant (just an abrasive try to explain this approximation of the inverse matrix).

Parameters:
n_Matrix the original 4x4 matrix.
Returns:
The calculated 4x4 inverse matrix.
See also:
Matrix3.CreateReducedMatrix - a main funtion to calculate the Cofactor matrix.

Vector4 * Matrix4::multiply_WithPoint Vector4 v_Point  ) 
 

Use this function for multiply matrices with a specified Vector4 object.

A right-side matrix multiplication will be used so that the Vector4 object always is the right sided matrix.

Parameters:
v_Point the specific Vector4 object to multiply the current matrix.
Returns:
The result as a newly created Vector4 object.

void IDVR.Tools.Matrix4.multiply_WithScalar double  n_Scalar  ) 
 

Multiply the current matrix with a skalar value.

Parameters:
n_Scalar the skalar value to multiply the matrix.

static Matrix4* IDVR.Tools.Matrix4.MultiplyMatices Matrix4 leftMatrix,
Matrix4 rightMatrix
[static]
 

This static funtion multiplies the specified 4x4 matrices.

An ordinary matrix multiplication will be used and the resultiin 3x3 matrix will be saved to a new created Matrix4 object.

Parameters:
leftMatrix the left sided matrix.
rightMatrix the right sided matrix.
Returns:
The resulting 4x4 matrix of the multiplication.

double void IDVR.Tools.Matrix4.setItem int  row,
int  column,
double  value
 

This function sets a specific matrix element by the specified value.

The matrix element which should be overwrited is specified by the specified parameter which are the row and column count.

Parameters:
row the row count of the specific element.
column the column count of the specific element.
value the new value of the specific element.
Exceptions:
Exception instance will be thrown if either the row or column count is not valid.

Matrix4* IDVR.Tools.Matrix4.transpose void   ) 
 

Returns the transpose matrix of the current matrix.

For the transpose matrix a new instance of the Matrix4 class will be created.

Returns:
The transposed matrix as a newly created Matrix4 object.


Member Data Documentation

double m_MatrixElements IDVR.Tools.Matrix4.__gc[,] [private]
 

The array of the necessary matrix elements.

All the needed 16 matrix elements are saved in a double array.


The documentation for this class was generated from the following files:
Generated on Sat Apr 9 11:51:00 2005 for RayCaster wiht Importance Driven Volume Rendering (IDVR) by  doxygen 1.4.1