NAME
vtkTransform - a general matrix transformation class
SYNOPSIS
#include "/opt/vtk-c++/common/vtkTransform.h"
class VTK_EXPORT vtkTransform : public vtkObject
vtkTransform ();
vtkTransform (const vtkTransform& t);
~vtkTransform ();
static vtkTransform *New() {return new vtkTransform;};
const char *GetClassName () {return "vtkTransform";};
void PrintSelf (ostream& os, vtkIndent indent);
vtkTransform &operator=(const vtkTransform &t);
void Identity ();
void Pop ();
void PostMultiply ();
void PreMultiply ();
void Push ();
void RotateX ( float angle);
void RotateY ( float angle);
void RotateZ (float angle);
void RotateWXYZ ( float angle, float x, float y, float z);
void Scale ( float x, float y, float z);
void Translate ( float x, float y, float z);
void Transpose();
void GetTranspose (vtkMatrix4x4& transpose);
void Inverse();
void GetInverse(vtkMatrix4x4& inverse);
float *GetOrientation();
void GetOrientation(float& rx, float& ry, float& rz);
float *GetOrientationWXYZ();
float *GetPosition();
void GetPosition (float& x, float& y, float& z);
float *GetScale();
void GetScale (float& sx, float& sy, float& sz);
void SetMatrix(vtkMatrix4x4& m);
vtkMatrix4x4& GetMatrix();
void GetMatrix (vtkMatrix4x4& m);
void Concatenate (vtkMatrix4x4 & matrix);
void Multiply4x4 ( vtkMatrix4x4 & a, vtkMatrix4x4 & b, vtkMatrix4x4 & c);
void MultiplyPoint (float in[4],float out[4]);
void MultiplyPoints(vtkPoints *inPts, vtkPoints *outPts);
void MultiplyVectors(vtkVectors *inVectors, vtkVectors *outVectors);
void MultiplyNormals(vtkNormals *inNormals, vtkNormals *outNormals);
void SetPoint(float, float, float, float);
void SetPoint(float *);
float *GetPoint();
void GetPoint(float p[4]);
DESCRIPTION
vtkTransform maintains a stack of 4x4 transformation matrices. A variety of methods are provided to manipulate the translation, scale, and rotation components of the matrix. Methods operate on the matrix at the top of the stack. Many objects, such as vtkActor and vtkCamera, use this class for performing their matrix operations. It is very important to realize that this class performs all of its operations in a right handed coordinate system with right handed rotations. Some other graphics libraries use left handed coordinate systems and rotations.
CAVEATS
By default the initial matrix is the identity matrix.
SEE ALSO
vtkMatrix4x4 vtkTransformCollection vtkTransformFilter vtkTransformPolyDataFilter
vtkTransform ()
Constructs a transform and sets the following defaults preMultiplyFlag = 1 stackSize = 10. It then creates an identity matrix as the top matrix on the stack.
vtkTransform (const vtkTransform& t)
Copy constructor. Creates an instance of vtkTransform and then copies its instance variables from the values in t.
void Pop ()
Deletes the transformation on the top of the stack and sets the top to the next transformation on the stack.
void PostMultiply ()
Sets the internal state of the transform to post multiply. All subsequent matrix operations will occur after those already represented in the current transformation matrix.
void PreMultiply ()
Sets the internal state of the transform to pre multiply. All subsequent matrix operations will occur before those already represented in the current transformation matrix.
void Push ()
Pushes the current transformation matrix onto the transformation stack.
void RotateX ( float angle)
Creates an x rotation matrix and concatenates it with the current transformation matrix. The angle is specified in degrees.
void RotateY ( float angle)
Creates a y rotation matrix and concatenates it with the current transformation matrix. The angle is specified in degrees.
void RotateZ (float angle)
Creates a z rotation matrix and concatenates it with the current transformation matrix. The angle is specified in degrees.
void RotateWXYZ ( float angle, float x, float y, float z) Creates a matrix that rotates angle degrees about an axis through the origin and x, y, z. It then concatenates this matrix with the current transformation matrix.
void Scale ( float x, float y, float z)
Scales the current transformation matrix in the x, y and z directions. A scale factor of zero will automatically be replaced with one.
void Translate ( float x, float y, float z)
Translate the current transformation matrix by the vector {x, y, z}.
void GetTranspose (vtkMatrix4x4& (transpose))
Obtain the transpose of the current transformation matrix.
void Inverse ()
Invert the current transformation matrix.
void GetInverse ( vtkMatrix4x4& inverse)
Return the inverse of the current transformation matrix.
void GetOrientation(float& rx, float& ry, float &rz)
Get the x, y, z orientation angles from the transformation matrix.
float *GetOrientation ()
Get the x, y, z orientation angles from the transformation matrix as an array of three floating point values.
void GetPosition (float & x,float & y,float & z)
Return the x, y, z positions from the current transformation matrix. This is simply returning the translation component of the 4x4 matrix.
float *GetPosition()
Return the position from the current transformation matrix as an array of three floating point numbers. This is simply returning the translation component of the 4x4 matrix.
void GetScale (float& x, float& y, float& z)
Return the x, y, z scale factors of the current transformation matrix.
float *GetScale()
Return the x, y, z scale factors of the current transformation matrix as an array of three float numbers.
vtkMatrix4x4 & GetMatrix ()
Returns the current transformation matrix.
void SetMatrix(vtkMatrix4x4& m)
Set the current matrix directly.
void Identity ()
Creates an identity matrix and makes it the current transformation matrix.
void Concatenate (vtkMatrix4x4 & matrix)
Concatenates the input matrix with the current transformation matrix. The resulting matrix becomes the new current transformation matrix. The setting of the PreMultiply flag determines whether the matrix is PreConcatenated or PostConcatenated.
void Multiply4x4 ( vtkMatrix4x4 & a, vtkMatrix4x4 & b, vtkMatrix4x4 & c)
Multiplies matrices a and b and stores the result in c.
void Transpose ()
Transposes the current transformation matrix.
void GetMatrix (vtkMatrix4x4 & ctm)
Returns the current transformation matrix.
float *GetPoint()
Returns the result of multiplying the currently set Point by the current transformation matrix. Point is expressed in homogeneous coordinates. The setting of the PreMultiplyFlag will determine if the Point is Pre or Post multiplied.
void MultiplyPoints(vtkPoints *inPts, vtkPoints *outPts) Multiplies a list of points (inPts) by the current transformation matrix. Transformed points are appended to the output list (outPts).
void MultiplyVectors(vtkVectors *inVectors, vtkVectors *outVectors)
Multiplies a list of vectors (inVectors) by the current transformation matrix. The transformed vectors are appended to the output list (outVectors). This is a special multiplication, since these are vectors. It multiplies vectors by the transposed inverse of the matrix, ignoring the translational components.
void MultiplyNormals(vtkNormals *inNormals, vtkNormals *outNormals) Multiplies a list of normals (inNormals) by the current transformation matrix. The transformed normals are then appended to the output list (outNormals). This is a special multiplication, since these are normals. It multiplies the normals by the transposed inverse of the matrix, ignoring the translational components.
EXAMPLES
XFormSph.cc