Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages | Examples

WT_Matrix Class Reference

#include <matrix.h>

List of all members.


Detailed Description

Simple 4x4 matrix.

Definition at line 25 of file matrix.h.

Public Member Functions

Construction
 WT_Matrix ()
 Constructs a WT_Matrix object (sets it to an identity matrix.).
 WT_Matrix (WT_Matrix const &xform)
 Constructs a WT_Matrix object. Copy constructor.
 WT_Matrix (double const *xform)
 Constructs a WT_Matrix object from an array of doubles (must be 16 doubles in the array.).
Data access methods
double const * elements () const
 Returns a 16 element double array containing the matrix values.
double operator() (unsigned int row, unsigned int col) const
 Returns the value at the given row and column.
double & operator() (unsigned int row, unsigned int col)
 Returns a reference to the value at the given row and column (can be used to set the value).
Manipulation methods
void adjoin (WT_Matrix &result) const
 Adjoins the given matrix to this matrix and returns the result.
void rotate (WT_Matrix &result, long rotation) const
 Rotates the matrix.
void set_identity ()
 Sets the matrix to the identity matrix (1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1).
void set (double const *xform)
 Sets the matrix to the array of doubles (must be 16 doubles in the array.).
void set (WT_Matrix const &xform)
 Sets the matrix from the given one (copies its values.).
void transform (WT_Point3D const &pt, WT_Point3D &result, double *out_w=WD_Null, double cutoff=0.0) const
 Uses this matrix to transform the given point.
WT_Matrixoperator *= (WT_Transform const &xform)
 Adds the scaling and translation values from the given transform to the corresponding entries in the matrix.
Inspection methods
WT_Boolean is_identity () const
 Returns WD_True if the matrix is an identity matrix.
WT_Boolean operator== (WT_Matrix const &matrix) const
 Returns WD_True if the matrix is equivalent to this one.
WT_Boolean operator!= (WT_Matrix const &matrix) const
 Returns WD_True if the matrix is NOT equivalent to this one.
Materialization / serialization
Warning:
These methods are typically only used by parent objects. Client code should not call these methods.


WT_Result serialize (WT_File &file) const
WT_Result serialize_padded (WT_File &file) const
WT_Result materialize (WT_File &file)
WT_Result materialize_row (WT_File &file, int row)


Member Function Documentation

void WT_Matrix::adjoin WT_Matrix result  )  const
 

Adjoins the given matrix to this matrix and returns the result.

Returns the matrix obtained by joining each row of result to the right of the corresponding row of this matrix.

double& WT_Matrix::operator() unsigned int  row,
unsigned int  col
[inline]
 

Returns a reference to the value at the given row and column (can be used to set the value).

Exceptions:
WT_Result::Toolkit_Usage_Error One of the arguments was out of range (0 <= x <= 3).

Definition at line 93 of file matrix.h.

double WT_Matrix::operator() unsigned int  row,
unsigned int  col
const [inline]
 

Returns the value at the given row and column.

Exceptions:
WT_Result::Toolkit_Usage_Error One of the arguments was out of range (0 <= x <= 3).

Definition at line 85 of file matrix.h.

void WT_Matrix::rotate WT_Matrix result,
long  rotation
const
 

Rotates the matrix.

This method takes the matrix and applies a rotation of the first quadrant of WHIP! coordinate space about that quadrant's center (in other words it rotates the first quadrant around (MAX_Int/2, Max_int/2)

void WT_Matrix::transform WT_Point3D const &  pt,
WT_Point3D result,
double *  out_w = WD_Null,
double  cutoff = 0.0
const
 

Uses this matrix to transform the given point.

Transforms pt into result.

Parameters:
pt  The source point.
result  Output parameter. The resultant transformed point.
out_w  Output parameter. If non-null, receives the homogeneous adjustment (projection constant) for the point.
cutoff  Maximum homogeneous adjustment (projection constant) allowed for the point.


The documentation for this class was generated from the following file:
Generated on Tue May 17 12:07:59 2005 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.1