Main Page   Class Hierarchy   Compound List   File List   Compound Members  

PLib::MatrixRT Class Template Reference

a matrix for rotation and translation transformation. More...

#include <matrixRT.h>

Inheritance diagram for PLib::MatrixRT:

PLib::Matrix PLib::Basic2DArray List of all members.

Public Methods

 MatrixRT (T ax, T ay, T az, T x, T y, T z)
 MatrixRT ()
 MatrixRT (T *p)
 MatrixRT (const Matrix< T > &plM)
MatrixRT< T > & rotate (T ax, T ay, T az)
MatrixRT< T > & rotateXYZ (T ax, T ay, T az)
MatrixRT< T > & translate (T x, T y, T z)
MatrixRT< T > & scale (T x, T y, T z)
MatrixRT< T > & rotateDeg (T ax, T ay, T az)
MatrixRT< T > & rotateDegXYZ (T ax, T ay, T az)
MatrixRT< T > & operator= (const Matrix< T > &M)
MatrixRT< T > & operator= (const MatrixRT< T > &M)

Protected Attributes

int created

Friends

MatrixRT< T > operator * (const MatrixRT< T > &, const MatrixRT< T > &)

Detailed Description

template<class T>
class PLib::MatrixRT< T >

a matrix for rotation and translation transformation.

This is a matrix for the rotation, translation and scaling of a point in 3D or 4D.

Author:
Philippe Lavoie
Date:
25 July 1997

Definition at line 52 of file matrixRT.h.


Constructor & Destructor Documentation

template<class T>
PLib::MatrixRT< T >::MatrixRT   ax,
  ay,
  az,
  x,
  y,
  z
 

constructor with the angles and translation parameters specified.

Sets the matrixRT to be a rotation of ax,ay,az then a translation x,y,z around the origin.

Parameters:
ax  specifies the rotation around the x-axis
ay  specifies the rotation around the y-axis
az  specifies the rotation around the z-axis
x  specifies the translation along the x-axis
y  specifies the translation along the y-axis
z  specifies the translation along the z-axis
Author:
Philippe Lavoie
Date:
25 July, 1997

Definition at line 53 of file matrixRT.cpp.

References PLib::Basic2DArray::m, and rotate.

template<class T>
PLib::MatrixRT< T >::MatrixRT  
 

default constructor.

Default constructor

Author:
Philippe Lavoie
Date:
25 July, 1997

Definition at line 77 of file matrixRT.cpp.

References PLib::Matrix::diag, and PLib::Basic2DArray::reset.

template<class T>
PLib::MatrixRT< T >::MatrixRT T *    p
 

Constructor from using a formated memory location.

Parameters:
p  a vector of data composing the matrix
Warning:
Make sure the ordering is adequate, i.e. either column or row wise.
Author:
Philippe Lavoie
Date:
25 July, 1997

Definition at line 119 of file matrixRT.cpp.

template<class T>
PLib::MatrixRT< T >::MatrixRT const Matrix< T > &    plM
 

copy constructor.

Copy constructor

Parameters:
plM  the matrix to copy
Author:
Philippe Lavoie
Date:
25 July, 1997

Definition at line 93 of file matrixRT.cpp.


Member Function Documentation

template<class T>
MatrixRT< T > & PLib::MatrixRT< T >::operator= const MatrixRT< T > &    M
 

The assignment operator with a matrixRT.

Parameters:
M  the matrix
Returns:
A reference to itself
Author:
Philippe Lavoie
Date:
25 July, 1997

Definition at line 440 of file matrixRT.cpp.

References PLib::Basic2DArray::m.

template<class T>
MatrixRT< T > & PLib::MatrixRT< T >::operator= const Matrix< T > &    M
 

The assignment operator with a matrix.

Parameters:
M  the matrix
Returns:
A reference to itself
Warning:
The matrix must be of size 4x4
Author:
Philippe Lavoie
Date:
25 July, 1997

Reimplemented from PLib::Matrix.

Definition at line 415 of file matrixRT.cpp.

References PLib::Basic2DArray::m.

template<class T>
MatrixRT< T > & PLib::MatrixRT< T >::rotate   ax,
  ay,
  az
 

creates a rotation matrix of angle (ax,ay,az).

The rotation are clockwise around the main axes. The rotation is performed in that order: a rotation around the z-axis, then the y-axis and finally around the x-axis.

Parameters:
ax  specifies the rotation around the x-axis
ay  specifies the rotation around the y-axis
az  specifies the rotation around the z-axis
See also:
rotateXYZ
Author:
Philippe Lavoie
Date:
25 July, 1997

Definition at line 140 of file matrixRT.cpp.

References PLib::Basic2DArray::m.

Referenced by MatrixRT, and rotateDeg.

template<class T>
MatrixRT< T > & PLib::MatrixRT< T >::rotateXYZ   ax,
  ay,
  az
 

creates a rotation matrix of angle (ax,ay,az).

The rotation are clockwise around the main axes. The rotation is performed in that order: a rotation around the x-axis, then the y-axis and finally around the z-axis.

Parameters:
ax  specifies the rotation around the x-axis
ay  specifies the rotation around the y-axis
az  specifies the rotation around the z-axis
See also:
rotate
Author:
Philippe Lavoie
Date:
25 July, 1997

Definition at line 199 of file matrixRT.cpp.

References PLib::Basic2DArray::m.

Referenced by rotateDegXYZ.

template<class T>
MatrixRT< T > & PLib::MatrixRT< T >::scale   x,
  y,
  z
 

Generates a scaling matrix.

Parameters:
x  specifies the scaling along the $x$-axis
y  specifies the scaling along the $y$-axis
z  specifies the scaling along the $z$-axis
Author:
Philippe Lavoie
Date:
25 July, 1997

Definition at line 277 of file matrixRT.cpp.

References PLib::Basic2DArray::m, and PLib::Basic2DArray::reset.

Referenced by PLib::NurbsSurfaceGL::applyTransform, and PLib::NurbsCurveGL::applyTransform.

template<class T>
MatrixRT< T > & PLib::MatrixRT< T >::translate   x,
  y,
  z
 

Generates a translation matrix.

Parameters:
x  specifies the translation along the $x$-axis
y  specifies the translation along the $y$-axis
z  specifies the translation along the $z$-axis
Warning:
This resets the rotation part of the matrix
Author:
Philippe Lavoie
Date:
25 July, 1997

Definition at line 251 of file matrixRT.cpp.

References PLib::Matrix::diag, PLib::Basic2DArray::m, and PLib::Basic2DArray::reset.

Referenced by PLib::NurbsSurface::sweep.


Friends And Related Function Documentation

template<class T>
MatrixRT<T> operator * const MatrixRT< T > &   ,
const MatrixRT< T > &   
[friend]
 

Multiplies a matrixRT with a MatrixRT.

Parameters:
m1  the first matrix
m2  the second matrix
Returns:
a new matrixRT
Warning:
Be aware of the way C++ handles function calls. If you want to generate a matrixRT from different ones, you can't do
A = A.translate(x,y,z)*A.rotate(ax,ay,az)
, since the translate and rotate return *this, when reaching the * operator, the function will be called with the same argument on its left and right. Instead, use something like this:
A = A.translate(x,y,z)*B.rotate(ax,ay,az)
.
Author:
Philippe Lavoie
Date:
25 July, 1997

Definition at line 349 of file matrixRT.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 13:26:59 2003 for NURBS++ by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002