vtk
Class vtkPerspectiveTransform

java.lang.Object
  extended byvtk.vtkObjectBase
      extended byvtk.vtkObject
          extended byvtk.vtkAbstractTransform
              extended byvtk.vtkHomogeneousTransform
                  extended byvtk.vtkPerspectiveTransform
All Implemented Interfaces:
java.io.Serializable

public class vtkPerspectiveTransform
extends vtkHomogeneousTransform
implements java.io.Serializable

vtkPerspectiveTransform - describes a 4x4 matrix transformation. A vtkPerspectiveTransform can be used to describe the full range of homogeneous transformations. It was designed in particular to describe a camera-view of a scene.

The order in which you set up the display coordinates (via AdjustZBuffer() and AdjustViewport()), the projection (via Perspective(), Frustum(), or Ortho()) and the camera view (via SetupCamera()) are important. If the transform is in PreMultiply mode, which is the default, set the Viewport and ZBuffer first, then the projection, and finally the camera view. Once the view is set up, the Translate and Rotate methods can be used to move the camera around in world coordinates. If the Oblique() or Stereo() methods are used, they should be called just before SetupCamera().

In PostMultiply mode, you must perform all transformations in the opposite order. This is necessary, for example, if you already have a perspective transformation set up but must adjust the viewport. Another example is if you have a view transformation, and wish to perform translations and rotations in the camera's coordinate system rather than in world coordinates.

The SetInput and Concatenate methods can be used to create a transformation pipeline with vtkPerspectiveTransform. See vtkTransform for more information on the transformation pipeline. JavaBean wrapper for vtkPerspectiveTransform object.

Author:
vtk2jbean Automatic JavaBean wrapper for VTK.
See Also:
vtkGeneralTransform, vtkTransform, vtkMatrix4x4, Serialized Form

Field Summary
protected  java.beans.PropertyChangeSupport changes
           
 
Fields inherited from class vtk.vtkObjectBase
vtkId
 
Constructor Summary
  vtkPerspectiveTransform()
           
protected vtkPerspectiveTransform(int dmy)
           
 
Method Summary
 void adjustViewport(double id0, double id1, double id2, double id3, double id4, double id5, double id6, double id7)
          Perform an adjustment to the viewport coordinates.
 void adjustZBuffer(double id0, double id1, double id2, double id3)
          Perform an adjustment to the Z-Buffer range that the near and far clipping planes map to.
 int circuitCheck(vtkAbstractTransform id0)
          Check for self-reference.
 void concatenate(double[] id0)
          Concatenates the matrix with the current transformation according to PreMultiply or PostMultiply semantics.
 void concatenate(vtkHomogeneousTransform id0)
          Concatenate the specified transform with the current transformation according to PreMultiply or PostMultiply semantics.
 void concatenate(vtkMatrix4x4 id0)
          Concatenates the matrix with the current transformation according to PreMultiply or PostMultiply semantics.
 void frustum(double id0, double id1, double id2, double id3, double id4, double id5)
          Create an perspective projection matrix and concatenate it by the current transformation.
 java.lang.String getClassName()
          Return the class name as a string.
 vtkHomogeneousTransform getConcatenatedTransform(int id0)
           
 vtkHomogeneousTransform getInput()
          Set the input for this transformation.
 int getInverseFlag()
          Get the inverse flag of the transformation.
 int getMTime()
          Override GetMTime to account for input and concatenation.
 int getNumberOfConcatenatedTransforms()
          Get the total number of transformations that are linked into this one via Concatenate() operations or via SetInput().
 vtkPerspectiveTransform getThisPerspectiveTransform()
           
 void identity()
          Set this transformation to the identity transformation.
 void inverse()
          Invert the transformation.
 int isA(java.lang.String id0)
          Return 1 if this class is the same type of (or a subclass of) the named class.
 vtkAbstractTransform makeTransform()
          Make a new transform of the same type -- you are responsible for deleting the transform when you are done with it.
 void ortho(double id0, double id1, double id2, double id3, double id4, double id5)
          Create an orthogonal projection matrix and concatenate it by the current transformation.
 void perspective(double id0, double id1, double id2, double id3)
          Create a perspective projection matrix by specifying the view angle (this angle is in the y direction), the aspect ratio, and the near and far clipping range.
 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 PostMultiply.
 void preMultiply()
          Sets the internal state of the transform to PreMultiply.
 void push()
          Pushes the current transformation onto the transformation stack.
 void rotateWXYZ(double id0, double[] id1)
          Create a rotation matrix and concatenate it with the current transformation according to PreMultiply or PostMultiply semantics.
 void rotateWXYZ(double id0, double id1, double id2, double id3)
          Create a rotation matrix and concatenate it with the current transformation according to PreMultiply or PostMultiply semantics.
 void rotateX(double id0)
          Create a rotation matrix about the X, Y, or Z axis and concatenate it with the current transformation according to PreMultiply or PostMultiply semantics.
 void rotateY(double id0)
          Create a rotation matrix about the X, Y, or Z axis and concatenate it with the current transformation according to PreMultiply or PostMultiply semantics.
 void rotateZ(double id0)
          Create a rotation matrix about the X, Y, or Z axis and concatenate it with the current transformation according to PreMultiply or PostMultiply semantics.
 void scale(double[] id0)
          Create a scale matrix (i.e. set the diagonal elements to x, y, z) and concatenate it with the current transformation according to PreMultiply or PostMultiply semantics.
 void scale(double id0, double id1, double id2)
          Create a scale matrix (i.e. set the diagonal elements to x, y, z) and concatenate it with the current transformation according to PreMultiply or PostMultiply semantics.
 void setInput(vtkHomogeneousTransform id0)
          Set the input for this transformation.
 void setMatrix(double[] id0)
          Set the current matrix directly.
 void setMatrix(vtkMatrix4x4 id0)
          Set the current matrix directly.
 void setupCamera(double[] id0, double[] id1, double[] id2)
          Set a view transformation matrix for the camera (this matrix does not contain any perspective) and concatenate it with the current transformation.
 void setupCamera(double id0, double id1, double id2, double id3, double id4, double id5, double id6, double id7, double id8)
           
 void shear(double id0, double id1, double id2)
          Create a shear transformation about a plane at distance z from the camera.
 void stereo(double id0, double id1)
          Create a stereo shear matrix and concatenate it with the current transformation.
 void translate(double[] id0)
          Create a translation matrix and concatenate it with the current transformation according to PreMultiply or PostMultiply semantics.
 void translate(double id0, double id1, double id2)
          Create a translation matrix and concatenate it with the current transformation according to PreMultiply or PostMultiply semantics.
protected  void VTKCastInit()
           
 void VTKInit()
           
 
Methods inherited from class vtk.vtkHomogeneousTransform
getHomogeneousInverse, getMatrix, getMatrix, getThisHomogeneousTransform, internalTransformPoint, transformPoints, transformPointsNormalsVectors
 
Methods inherited from class vtk.vtkAbstractTransform
deepCopy, getInverse, getThisAbstractTransform, setInverse, transformDoubleNormalAtPoint, transformDoublePoint, transformDoublePoint, transformDoubleVectorAtPoint, transformFloatNormalAtPoint, transformFloatPoint, transformFloatPoint, transformFloatVectorAtPoint, transformNormalAtPoint, transformNormalAtPoint, transformPoint, transformPoint, transformPoint, transformVectorAtPoint, transformVectorAtPoint, unRegister, update
 
Methods inherited from class vtk.vtkObject
AddObserver, breakOnError, debugOff, debugOn, getDebug, getGlobalWarningDisplay, getThisObject, globalWarningDisplayOff, globalWarningDisplayOn, hasObserver, hasObserver, invokeEvent, invokeEvent, modified, Print, PrintRevisions, register, removeObserver, removeObservers, removeObservers, setDebug, setGlobalWarningDisplay
 
Methods inherited from class vtk.vtkObjectBase
addPropertyChangeListener, finalize, getReferenceCount, getThisObjectBase, isTypeOf, removePropertyChangeListener, setReferenceCount, VTKDelete
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

changes

protected java.beans.PropertyChangeSupport changes
Constructor Detail

vtkPerspectiveTransform

public vtkPerspectiveTransform()

vtkPerspectiveTransform

protected vtkPerspectiveTransform(int dmy)
Method Detail

getThisPerspectiveTransform

public vtkPerspectiveTransform getThisPerspectiveTransform()

getClassName

public java.lang.String getClassName()
Description copied from class: vtkObjectBase
Return the class name as a string. This method is defined in all subclasses of vtkObjectBase with the vtkTypeRevisionMacro found in vtkSetGet.h.

Overrides:
getClassName in class vtkHomogeneousTransform

isA

public int isA(java.lang.String id0)
Description copied from class: vtkObjectBase
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.

Overrides:
isA in class vtkHomogeneousTransform

identity

public void identity()
Set this transformation to the identity transformation. If the transform has an Input, then the transformation will be reset so that it is the same as the Input.

Overrides:
identity in class vtkAbstractTransform

inverse

public void inverse()
Invert the transformation. This will also set a flag so that the transformation will use the inverse of its Input, if an Input has been set.

Overrides:
inverse in class vtkAbstractTransform

adjustViewport

public void adjustViewport(double id0,
                           double id1,
                           double id2,
                           double id3,
                           double id4,
                           double id5,
                           double id6,
                           double id7)
Perform an adjustment to the viewport coordinates. By default Ortho, Frustum, and Perspective provide a window of ([-1,+1],[-1,+1]). In PreMultiply mode, you call this method before calling Ortho, Frustum, or Perspective. In PostMultiply mode you can call it after. Note that if you must apply both AdjustZBuffer and AdjustViewport, it makes no difference which order you apply them in.


adjustZBuffer

public void adjustZBuffer(double id0,
                          double id1,
                          double id2,
                          double id3)
Perform an adjustment to the Z-Buffer range that the near and far clipping planes map to. By default Ortho, Frustum, and Perspective map the near clipping plane to -1 and the far clipping plane to +1. In PreMultiply mode, you call this method before calling Ortho, Frustum, or Perspective. In PostMultiply mode you can call it after.


ortho

public void ortho(double id0,
                  double id1,
                  double id2,
                  double id3,
                  double id4,
                  double id5)
Create an orthogonal projection matrix and concatenate it by the current transformation. The matrix maps [xmin,xmax], [ymin,ymax], [-znear,-zfar] to [-1,+1], [-1,+1], [+1,-1].


frustum

public void frustum(double id0,
                    double id1,
                    double id2,
                    double id3,
                    double id4,
                    double id5)
Create an perspective projection matrix and concatenate it by the current transformation. The matrix maps a frustum with a back plane at -zfar and a front plane at -znear with extent [xmin,xmax],[ymin,ymax] to [-1,+1], [-1,+1], [+1,-1].


perspective

public void perspective(double id0,
                        double id1,
                        double id2,
                        double id3)
Create a perspective projection matrix by specifying the view angle (this angle is in the y direction), the aspect ratio, and the near and far clipping range. The projection matrix is concatenated with the current transformation. This method works via Frustum.


shear

public void shear(double id0,
                  double id1,
                  double id2)
Create a shear transformation about a plane at distance z from the camera. The values dxdz (i.e. dx/dz) and dydz specify the amount of shear in the x and y directions. The 'zplane' specifies the distance from the camera to the plane at which the shear causes zero displacement. Generally you want this plane to be the focal plane. This transformation can be used in combination with Ortho to create an oblique projection. It can also be used in combination with Perspective to provide correct stereo views when the eye is at arbitrary but known positions relative to the center of a flat viewing screen.


stereo

public void stereo(double id0,
                   double id1)
Create a stereo shear matrix and concatenate it with the current transformation. This can be applied in conjunction with either a perspective transformation (via Frustum or Projection) or an orthographic projection. You must specify the distance from the camera plane to the focal plane, and the angle between the distance vector and the eye. The angle should be negative for the left eye, and positive for the right. This method works via Oblique.


setupCamera

public void setupCamera(double[] id0,
                        double[] id1,
                        double[] id2)
Set a view transformation matrix for the camera (this matrix does not contain any perspective) and concatenate it with the current transformation.


setupCamera

public void setupCamera(double id0,
                        double id1,
                        double id2,
                        double id3,
                        double id4,
                        double id5,
                        double id6,
                        double id7,
                        double id8)

translate

public void translate(double id0,
                      double id1,
                      double id2)
Create a translation matrix and concatenate it with the current transformation according to PreMultiply or PostMultiply semantics.


translate

public void translate(double[] id0)
Create a translation matrix and concatenate it with the current transformation according to PreMultiply or PostMultiply semantics.


rotateWXYZ

public void rotateWXYZ(double id0,
                       double id1,
                       double id2,
                       double id3)
Create a rotation matrix and concatenate it with the current transformation according to PreMultiply or PostMultiply semantics. The angle is in degrees, and (x,y,z) specifies the axis that the rotation will be performed around.


rotateWXYZ

public void rotateWXYZ(double id0,
                       double[] id1)
Create a rotation matrix and concatenate it with the current transformation according to PreMultiply or PostMultiply semantics. The angle is in degrees, and (x,y,z) specifies the axis that the rotation will be performed around.


rotateX

public void rotateX(double id0)
Create a rotation matrix about the X, Y, or Z axis and concatenate it with the current transformation according to PreMultiply or PostMultiply semantics. The angle is expressed in degrees.


rotateY

public void rotateY(double id0)
Create a rotation matrix about the X, Y, or Z axis and concatenate it with the current transformation according to PreMultiply or PostMultiply semantics. The angle is expressed in degrees.


rotateZ

public void rotateZ(double id0)
Create a rotation matrix about the X, Y, or Z axis and concatenate it with the current transformation according to PreMultiply or PostMultiply semantics. The angle is expressed in degrees.


scale

public void scale(double id0,
                  double id1,
                  double id2)
Create a scale matrix (i.e. set the diagonal elements to x, y, z) and concatenate it with the current transformation according to PreMultiply or PostMultiply semantics.


scale

public void scale(double[] id0)
Create a scale matrix (i.e. set the diagonal elements to x, y, z) and concatenate it with the current transformation according to PreMultiply or PostMultiply semantics.


setMatrix

public void setMatrix(vtkMatrix4x4 id0)
Set the current matrix directly. This actually calls Identity(), followed by Concatenate(matrix).


setMatrix

public void setMatrix(double[] id0)
Set the current matrix directly. This actually calls Identity(), followed by Concatenate(matrix).


concatenate

public void concatenate(vtkMatrix4x4 id0)
Concatenates the matrix with the current transformation according to PreMultiply or PostMultiply semantics.


concatenate

public void concatenate(double[] id0)
Concatenates the matrix with the current transformation according to PreMultiply or PostMultiply semantics.


concatenate

public void concatenate(vtkHomogeneousTransform id0)
Concatenate the specified transform with the current transformation according to PreMultiply or PostMultiply semantics. The concatenation is pipelined, meaning that if any of the transformations are changed, even after Concatenate() is called, those changes will be reflected when you call TransformPoint().


preMultiply

public void preMultiply()
Sets the internal state of the transform to PreMultiply. All subsequent operations will occur before those already represented in the current transformation. In homogeneous matrix notation, M = M*A where M is the current transformation matrix and A is the applied matrix. The default is PreMultiply.


postMultiply

public void postMultiply()
Sets the internal state of the transform to PostMultiply. All subsequent operations will occur after those already represented in the current transformation. In homogeneous matrix notation, M = A*M where M is the current transformation matrix and A is the applied matrix. The default is PreMultiply.


getNumberOfConcatenatedTransforms

public int getNumberOfConcatenatedTransforms()
Get the total number of transformations that are linked into this one via Concatenate() operations or via SetInput().


getConcatenatedTransform

public vtkHomogeneousTransform getConcatenatedTransform(int id0)

setInput

public void setInput(vtkHomogeneousTransform id0)
Set the input for this transformation. This will be used as the base transformation if it is set. This method allows you to build a transform pipeline: if the input is modified, then this transformation will automatically update accordingly. Note that the InverseFlag, controlled via Inverse(), determines whether this transformation will use the Input or the inverse of the Input.


getInput

public vtkHomogeneousTransform getInput()
Set the input for this transformation. This will be used as the base transformation if it is set. This method allows you to build a transform pipeline: if the input is modified, then this transformation will automatically update accordingly. Note that the InverseFlag, controlled via Inverse(), determines whether this transformation will use the Input or the inverse of the Input.


getInverseFlag

public int getInverseFlag()
Get the inverse flag of the transformation. This controls whether it is the Input or the inverse of the Input that is used as the base transformation. The InverseFlag is flipped every time Inverse() is called. The InverseFlag is off when a transform is first created.


push

public void push()
Pushes the current transformation onto the transformation stack.


pop

public void pop()
Deletes the transformation on the top of the stack and sets the top to the next transformation on the stack.


makeTransform

public vtkAbstractTransform makeTransform()
Make a new transform of the same type -- you are responsible for deleting the transform when you are done with it.

Overrides:
makeTransform in class vtkAbstractTransform

circuitCheck

public int circuitCheck(vtkAbstractTransform id0)
Check for self-reference. Will return true if concatenating with the specified transform, setting it to be our inverse, or setting it to be our input will create a circular reference. CircuitCheck is automatically called by SetInput(), SetInverse(), and Concatenate(vtkXTransform *). Avoid using this function, it is experimental.

Overrides:
circuitCheck in class vtkAbstractTransform

getMTime

public int getMTime()
Override GetMTime to account for input and concatenation.

Overrides:
getMTime in class vtkAbstractTransform

VTKInit

public void VTKInit()
Overrides:
VTKInit in class vtkObject

VTKCastInit

protected void VTKCastInit()
Overrides:
VTKCastInit in class vtkHomogeneousTransform


Copyright © 2004 Sydney ViSLAB. All Rights Reserved.