Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

VPTransform Class Reference

Geometric transformations. More...

#include <vptransform.h>

Inheritance diagram for VPTransform:

VPSceneNode VPMemoryObj VPJoint VPBiaxialJoint VPPlaneJoint VPPolyaxialJoint VPUniaxialJoint VPCondylarJoint VPEllipsoidJoint VPSaddlelJoint VPHingeJoint VPPivotJoint List of all members.

Public Member Functions

 VPTransform ()
 Creates an uninitialized transform.
 VPTransform (const VPTransform &trans)
 Copy constructor.
void MakeIdentity ()
 Turns transform into identity.
VPPoint4D operator * (const VPPoint4D &point) const
 Applies transformation to a point.
VPTransform operator * (const VPTransform &t) const
 Applies transformation to another transform.
VPTransformoperator= (const VPTransform &t)
void ApplyTo (VPPoint4D *ptPoint) const
 Applies tranformation to a point.
void MakeTranslation (const VPPoint4D &translationVector)
 Turns transform into a translation.
void MakeTranslation (double tx, double ty, double tz)
 Turns transform into a translation.
void MakeXRotation (double radians)
 Turns transform into a rotation around the X axis.
void MakeYRotation (double radians)
 Turns transform into a rotation around the Y axis.
void MakeZRotation (double radians)
 Turns transform into a rotation around the Z axis.
void MakeRotation (const VPPoint4D &refVec, const float radians)
 Turns transform into a rotation (around some reference vetor).
void MakeRotation (const VPPoint4D &refPoint, const VPPoint4D &refVec, const float radians)
 Turns transform into a rotation (around some reference axis).
void MakeScale (double sX, double sY, double sZ)
 Turns transform into a scale.
void MakeShear (double shX, double shY)
 Turns transform into a shear.
const double * GetData () const
 Returns the address of transformation matrix.
void GetVectorX (VPPoint4D *result) const
 Returns the X vector of the transform.
void GetVectorY (VPPoint4D *result) const
 Returns the Y vector of the transform.
void GetVectorZ (VPPoint4D *result) const
 Returns the Z vector of the transform.
void GetTranslation (VPPoint4D *result) const
 Returns the translation part of the transform.
virtual bool DrawOGL () const
 Apply transform to rendering engine.

Friends

std::ostream & operator<< (std::ostream &output, const VPTransform &t)
 'ostream' class extension to output a transformation on the console.

Detailed Description

Geometric transformations.

A transformation matrix is represented by a 4x4 pre-multiplication matrix, i.e., to apply T1, then T2, then T3, one must multiply T3*T2*T1. Translation values are at the rightmost column.

Definition at line 21 of file vptransform.h.


Constructor & Destructor Documentation

VPTransform::VPTransform  ) 
 

Creates an uninitialized transform.

Definition at line 23 of file vptransform.cpp.

VPTransform::VPTransform const VPTransform trans  ) 
 

Copy constructor.

Parameters:
trans [in] Source transform

Definition at line 27 of file vptransform.cpp.

References matrix.


Member Function Documentation

void VPTransform::ApplyTo VPPoint4D ptPoint  )  const
 

Applies tranformation to a point.

Parameters:
ptPoint [in,out] Point to be transformed

Definition at line 121 of file vptransform.cpp.

References VPPoint4D::GetW(), VPPoint4D::GetX(), VPPoint4D::GetY(), VPPoint4D::GetZ(), and VPPoint4D::SetXYZW().

Referenced by VPCamera::MoveForward(), VPCamera::MoveSideways(), VPCamera::MoveUp(), VPCamera::PitchAroundTarget(), VPMeshObject::Transform(), VPDof::Transform(), VPCurve::Transform(), VPCamera::Yaw(), and VPCamera::YawAroundTarget().

bool VPTransform::DrawOGL  )  const [virtual]
 

Apply transform to rendering engine.

Returns:
false if VPAT was not compiled with OpenGL support.

Reimplemented from VPSceneNode.

Definition at line 232 of file vptransform.cpp.

References VPSceneNode::childList.

const double* VPTransform::GetData  )  const [inline]
 

Returns the address of transformation matrix.

Use this method to get an OpenGl like transformation matrix, compatible with methods such as "glLoadMatrixd" and "glMultMatrixd".

Definition at line 98 of file vptransform.h.

void VPTransform::GetTranslation VPPoint4D result  )  const
 

Returns the translation part of the transform.

Definition at line 224 of file vptransform.cpp.

References VPPoint4D::SetW(), VPPoint4D::SetX(), VPPoint4D::SetY(), and VPPoint4D::SetZ().

Referenced by VPDof::GetOrigin().

void VPTransform::GetVectorX VPPoint4D result  )  const
 

Returns the X vector of the transform.

A rigid transformation matrix may be interpreted as a coordinate system. This method returns the 1st column of the matrix which may be interpreted as the X vector of such coordinate system.

Definition at line 200 of file vptransform.cpp.

References VPPoint4D::SetW(), VPPoint4D::SetX(), VPPoint4D::SetY(), and VPPoint4D::SetZ().

void VPTransform::GetVectorY VPPoint4D result  )  const
 

Returns the Y vector of the transform.

A rigid transformation matrix may be interpreted as a coordinate system. This method returns the 2nd column of the matrix which may be interpreted as the Y vector of such coordinate system.

Definition at line 208 of file vptransform.cpp.

References VPPoint4D::SetW(), VPPoint4D::SetX(), VPPoint4D::SetY(), and VPPoint4D::SetZ().

void VPTransform::GetVectorZ VPPoint4D result  )  const
 

Returns the Z vector of the transform.

A rigid transformation matrix may be interpreted as a coordinate system. This method returns the 3rd column of the matrix which may be interpreted as the Z vector of such coordinate system.

Definition at line 216 of file vptransform.cpp.

References VPPoint4D::SetW(), VPPoint4D::SetX(), VPPoint4D::SetY(), and VPPoint4D::SetZ().

void VPTransform::MakeIdentity  ) 
 

Turns transform into identity.

Definition at line 33 of file vptransform.cpp.

Referenced by MakeRotation(), MakeScale(), MakeShear(), MakeTranslation(), MakeXRotation(), MakeYRotation(), MakeZRotation(), and VPDof::VPDof().

void VPTransform::MakeRotation const VPPoint4D refPoint,
const VPPoint4D refVec,
const float  radians
 

Turns transform into a rotation (around some reference axis).

Parameters:
refPoint [in] Reference point (defines an axis together with refVec)
refVec [in] Reference vector (defines an axis together with refPoint)
radians [in] Angle of rotation

Definition at line 188 of file vptransform.cpp.

References MakeRotation(), and MakeTranslation().

void VPTransform::MakeRotation const VPPoint4D refVec,
const float  radians
 

Turns transform into a rotation (around some reference vetor).

Parameters:
refVec [in] Reference vector
radians [in] Angle of rotation

Definition at line 143 of file vptransform.cpp.

References VPPoint4D::AngleTo(), VPPoint4D::GetX(), VPPoint4D::GetY(), VPPoint4D::GetZ(), MakeIdentity(), MakeXRotation(), MakeYRotation(), MakeZRotation(), VPPoint4D::Normalize(), and VPPoint4D::SetXYZW().

Referenced by VPDof::ComputeLIM(), MakeRotation(), VPCamera::MoveSideways(), VPDof::MoveTo(), VPCamera::PitchAroundTarget(), VPDof::Transform(), VPCamera::Yaw(), and VPCamera::YawAroundTarget().

void VPTransform::MakeScale double  sX,
double  sY,
double  sZ
 

Turns transform into a scale.

Definition at line 75 of file vptransform.cpp.

References MakeIdentity().

void VPTransform::MakeShear double  shX,
double  shY
 

Turns transform into a shear.

Definition at line 83 of file vptransform.cpp.

References MakeIdentity().

void VPTransform::MakeTranslation double  tx,
double  ty,
double  tz
[inline]
 

Turns transform into a translation.

Parameters:
tx [in] X component of translation
ty [in] Y component of translation
tz [in] Z component of translation

Definition at line 62 of file vptransform.h.

References MakeTranslation().

void VPTransform::MakeTranslation const VPPoint4D translationVector  ) 
 

Turns transform into a translation.

MakeTranslation expects a vector but actualy ignores the W coordinate.

Parameters:
translationVector [in] Vector representation of the translation

Definition at line 40 of file vptransform.cpp.

References VPPoint4D::GetX(), VPPoint4D::GetY(), VPPoint4D::GetZ(), and MakeIdentity().

Referenced by MakeRotation(), MakeTranslation(), VPCamera::MoveForward(), VPCamera::MoveSideways(), and VPCamera::MoveUp().

void VPTransform::MakeXRotation double  radians  ) 
 

Turns transform into a rotation around the X axis.

Parameters:
radians [in] Angle of rotation

Definition at line 48 of file vptransform.cpp.

References MakeIdentity().

Referenced by MakeRotation().

void VPTransform::MakeYRotation double  radians  ) 
 

Turns transform into a rotation around the Y axis.

Parameters:
radians [in] Angle of rotation

Definition at line 57 of file vptransform.cpp.

References MakeIdentity().

Referenced by MakeRotation().

void VPTransform::MakeZRotation double  radians  ) 
 

Turns transform into a rotation around the Z axis.

Parameters:
radians [in] Angle of rotation

Definition at line 66 of file vptransform.cpp.

References MakeIdentity().

Referenced by MakeRotation().

VPTransform VPTransform::operator * const VPTransform t  )  const
 

Applies transformation to another transform.

Parameters:
t [in] Transform to apply transformation
Returns:
The combined transform.

Definition at line 104 of file vptransform.cpp.

References matrix.

VPPoint4D VPTransform::operator * const VPPoint4D point  )  const
 

Applies transformation to a point.

Parameters:
point [in] Point to apply transformation
Returns:
The transformed point.

Definition at line 90 of file vptransform.cpp.

References VPPoint4D::GetW(), VPPoint4D::GetX(), VPPoint4D::GetY(), and VPPoint4D::GetZ().

VPTransform & VPTransform::operator= const VPTransform t  ) 
 

Definition at line 114 of file vptransform.cpp.

References matrix.


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  output,
const VPTransform t
[friend]
 

'ostream' class extension to output a transformation on the console.


The documentation for this class was generated from the following files:
Generated on Tue Sep 6 10:00:19 2005 for VPAT by  doxygen 1.4.4