vtk
Class vtkCamera

java.lang.Object
  extended byvtk.vtkObjectBase
      extended byvtk.vtkObject
          extended byvtk.vtkCamera
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
vtkOpenGLCamera

public class vtkCamera
extends vtkObject
implements java.io.Serializable

vtkCamera - a virtual camera for 3D rendering. vtkCamera is a virtual camera for 3D rendering. It provides methods to position and orient the view point and focal point. Convenience methods for moving about the focal point also are provided. More complex methods allow the manipulation of the computer graphics model including view up vector, clipping planes, and camera perspective. JavaBean wrapper for vtkCamera object.

Author:
vtk2jbean Automatic JavaBean wrapper for VTK.
See Also:
Serialized Form

Field Summary
protected  java.beans.PropertyChangeSupport changes
           
 
Fields inherited from class vtk.vtkObjectBase
vtkId
 
Constructor Summary
  vtkCamera()
           
protected vtkCamera(int dmy)
           
 
Method Summary
 void applyTransform(vtkTransform id0)
          Apply a transform to the camera.
 void azimuth(double id0)
          Rotate the camera about the view up vector centered at the focal point.
 void computeViewPlaneNormal()
          This method is called automatically whenever necessary, it should never be used outside of vtkCamera.cxx.
 void dolly(double id0)
          Move the position of the camera along the direction of projection.
 void elevation(double id0)
          Rotate the camera about the cross product of the direction of projection and the view up vector centered on the focal point.
 vtkMatrix4x4 getCameraLightTransformMatrix()
          Returns a transformation matrix for a coordinate frame attached to the camera, where the camera is located at (0, 0, 1) looking at the focal point at (0, 0, 0), with up being (0, 1, 0).
 java.lang.String getClassName()
          Return the class name as a string.
 double[] getClippingRange()
          Set/Get the location of the near and far clipping planes along the direction of projection.
 vtkMatrix4x4 getCompositePerspectiveTransformMatrix(double id0, double id1, double id2)
          Return the concatenation of the ViewTransform and the PerspectiveTransform.
 double[] getDirectionOfProjection()
          Get the vector in the direction from the camera position to the focal point.
 double getDistance()
          Move the focal point so that it is the specified distance from the camera position.
 double getEyeAngle()
          Set/Get the separation between eyes (in degrees).
 double getFocalDisk()
          Set the size of the cameras lens in world coordinates.
 double[] getFocalPoint()
          Set/Get the focal of the camera in world coordinates.
 void getFrustumPlanes(double id0, double[] id1)
          Get the plane equations that bound the view frustum.
 double[] getOrientation()
          Get the orientation of the camera.
 double[] getOrientationWXYZ()
          Get the orientation of the camera.
 int getParallelProjection()
          Set/Get the value of the ParallelProjection instance variable.
 double getParallelScale()
          Set/Get the scaling used for a parallel projection, i.e. the height of the viewport in world-coordinate distances.
 vtkMatrix4x4 getPerspectiveTransformMatrix(double id0, double id1, double id2)
          Return the perspective transform matrix, which converts from camera coordinates to viewport coordinates.
 double[] getPosition()
          Set/Get the position of the camera in world coordinates.
 double getRoll()
          Set the roll angle of the camera about the direction of projection.
 double getThickness()
          Set the distance between clipping planes.
 vtkCamera getThisCamera()
           
 int getUseHorizontalViewAngle()
          Set/Get the value of the UseHorizontalViewAngle instance variable.
 vtkHomogeneousTransform getUserTransform()
          In addition to the instance variables such as position and orientation, you can add an additional transformation for your own use.
 double getViewAngle()
          Set/Get the camera view angle, which is the angular height of the camera view measured in degrees.
 int getViewingRaysMTime()
          Return the MTime that concerns recomputing the view rays of the camera.
 double[] getViewPlaneNormal()
          Get the ViewPlaneNormal.
 double[] getViewShear()
          Set/get the shear transform of the viewing frustum.
 vtkMatrix4x4 getViewTransformMatrix()
          Return the matrix of the view transform.
 vtkTransform getViewTransformObject()
           
 double[] getViewUp()
          Set/Get the view up direction for the camera.
 double[] getWindowCenter()
          Set/Get the center of the window in viewport coordinates.
 int isA(java.lang.String id0)
          Return 1 if this class is the same type of (or a subclass of) the named class.
 void orthogonalizeViewUp()
          Recompute the ViewUp vector to force it to be perpendicular to camera->focalpoint vector.
 void parallelProjectionOff()
          Set/Get the value of the ParallelProjection instance variable.
 void parallelProjectionOn()
          Set/Get the value of the ParallelProjection instance variable.
 void pitch(double id0)
          Rotate the focal point about the cross product of the view up vector and the direction of projection, centered at the camera's position.
 void render(vtkRenderer id0)
          This method causes the camera to set up whatever is required for viewing the scene.
 void roll(double id0)
          Rotate the camera about the direction of projection.
 void setClippingRange(double[] id0)
          Set/Get the location of the near and far clipping planes along the direction of projection.
 void setClippingRange(double id0, double id1)
          Set/Get the location of the near and far clipping planes along the direction of projection.
 void setDistance(double id0)
          Move the focal point so that it is the specified distance from the camera position.
 void setEyeAngle(double id0)
          Set/Get the separation between eyes (in degrees).
 void setFocalDisk(double id0)
          Set the size of the cameras lens in world coordinates.
 void setFocalPoint(double[] id0)
          Set/Get the focal of the camera in world coordinates.
 void setFocalPoint(double id0, double id1, double id2)
          Set/Get the focal of the camera in world coordinates.
 void setObliqueAngles(double id0, double id1)
          Get/Set the oblique viewing angles.
 void setParallelProjection(int id0)
          Set/Get the value of the ParallelProjection instance variable.
 void setParallelScale(double id0)
          Set/Get the scaling used for a parallel projection, i.e. the height of the viewport in world-coordinate distances.
 void setPosition(double[] id0)
          Set/Get the position of the camera in world coordinates.
 void setPosition(double id0, double id1, double id2)
          Set/Get the position of the camera in world coordinates.
 void setRoll(double id0)
          Set the roll angle of the camera about the direction of projection.
 void setThickness(double id0)
          Set the distance between clipping planes.
 void setUseHorizontalViewAngle(int id0)
          Set/Get the value of the UseHorizontalViewAngle instance variable.
 void setUserTransform(vtkHomogeneousTransform id0)
          In addition to the instance variables such as position and orientation, you can add an additional transformation for your own use.
 void setViewAngle(double id0)
          Set/Get the camera view angle, which is the angular height of the camera view measured in degrees.
 void setViewPlaneNormal(double[] id0)
          These methods have been deprecated.
 void setViewPlaneNormal(double id0, double id1, double id2)
          These methods have been deprecated.
 void setViewShear(double[] id0)
          Set/get the shear transform of the viewing frustum.
 void setViewShear(double id0, double id1, double id2)
          Set/get the shear transform of the viewing frustum.
 void setViewUp(double[] id0)
          Set/Get the view up direction for the camera.
 void setViewUp(double id0, double id1, double id2)
          Set/Get the view up direction for the camera.
 void setWindowCenter(double id0, double id1)
          Set/Get the center of the window in viewport coordinates.
 void updateViewport(vtkRenderer id0)
           
 void useHorizontalViewAngleOff()
          Set/Get the value of the UseHorizontalViewAngle instance variable.
 void useHorizontalViewAngleOn()
          Set/Get the value of the UseHorizontalViewAngle instance variable.
 void viewingRaysModified()
          Mark that something has changed which requires the view rays to be recomputed.
protected  void VTKCastInit()
           
 void VTKInit()
           
 void yaw(double id0)
          Rotate the focal point about the view up vector centered at the camera's position.
 void zoom(double id0)
          In perspective mode, decrease the view angle by the specified factor.
 
Methods inherited from class vtk.vtkObject
AddObserver, breakOnError, debugOff, debugOn, getDebug, getGlobalWarningDisplay, getMTime, getThisObject, globalWarningDisplayOff, globalWarningDisplayOn, hasObserver, hasObserver, invokeEvent, invokeEvent, modified, Print, PrintRevisions, register, removeObserver, removeObservers, removeObservers, setDebug, setGlobalWarningDisplay, unRegister
 
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

vtkCamera

public vtkCamera()

vtkCamera

protected vtkCamera(int dmy)
Method Detail

getThisCamera

public vtkCamera getThisCamera()

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 vtkObject

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 vtkObject

setPosition

public void setPosition(double id0,
                        double id1,
                        double id2)
Set/Get the position of the camera in world coordinates. The default position is (0,0,1).


setPosition

public void setPosition(double[] id0)
Set/Get the position of the camera in world coordinates. The default position is (0,0,1).


getPosition

public double[] getPosition()
Set/Get the position of the camera in world coordinates. The default position is (0,0,1).


setFocalPoint

public void setFocalPoint(double id0,
                          double id1,
                          double id2)
Set/Get the focal of the camera in world coordinates. The default focal point is the origin.


setFocalPoint

public void setFocalPoint(double[] id0)
Set/Get the focal of the camera in world coordinates. The default focal point is the origin.


getFocalPoint

public double[] getFocalPoint()
Set/Get the focal of the camera in world coordinates. The default focal point is the origin.


setViewUp

public void setViewUp(double id0,
                      double id1,
                      double id2)
Set/Get the view up direction for the camera. The default is (0,1,0).


setViewUp

public void setViewUp(double[] id0)
Set/Get the view up direction for the camera. The default is (0,1,0).


getViewUp

public double[] getViewUp()
Set/Get the view up direction for the camera. The default is (0,1,0).


orthogonalizeViewUp

public void orthogonalizeViewUp()
Recompute the ViewUp vector to force it to be perpendicular to camera->focalpoint vector. Unless you are going to use Yaw or Azimuth on the camera, there is no need to do this.


setDistance

public void setDistance(double id0)
Move the focal point so that it is the specified distance from the camera position. This distance must be positive.


getDistance

public double getDistance()
Move the focal point so that it is the specified distance from the camera position. This distance must be positive.


getDirectionOfProjection

public double[] getDirectionOfProjection()
Get the vector in the direction from the camera position to the focal point. This is usually the opposite of the ViewPlaneNormal, the vector perpendicular to the screen, unless the view is oblique.


dolly

public void dolly(double id0)
Move the position of the camera along the direction of projection. Moving towards the focal point (e.g., greater than 1) is a dolly-in, moving away from the focal point (e.g., less than 1) is a dolly-out.


setRoll

public void setRoll(double id0)
Set the roll angle of the camera about the direction of projection.


getRoll

public double getRoll()
Set the roll angle of the camera about the direction of projection.


roll

public void roll(double id0)
Rotate the camera about the direction of projection.


azimuth

public void azimuth(double id0)
Rotate the camera about the view up vector centered at the focal point. Note that the view up vector is not necessarily perpendicular to the direction of projection.


yaw

public void yaw(double id0)
Rotate the focal point about the view up vector centered at the camera's position. Note that the view up vector is not necessarily perpendicular to the direction of projection.


elevation

public void elevation(double id0)
Rotate the camera about the cross product of the direction of projection and the view up vector centered on the focal point.


pitch

public void pitch(double id0)
Rotate the focal point about the cross product of the view up vector and the direction of projection, centered at the camera's position.


setParallelProjection

public void setParallelProjection(int id0)
Set/Get the value of the ParallelProjection instance variable. This determines if the camera should do a perspective or parallel projection.


getParallelProjection

public int getParallelProjection()
Set/Get the value of the ParallelProjection instance variable. This determines if the camera should do a perspective or parallel projection.


parallelProjectionOn

public void parallelProjectionOn()
Set/Get the value of the ParallelProjection instance variable. This determines if the camera should do a perspective or parallel projection.


parallelProjectionOff

public void parallelProjectionOff()
Set/Get the value of the ParallelProjection instance variable. This determines if the camera should do a perspective or parallel projection.


setUseHorizontalViewAngle

public void setUseHorizontalViewAngle(int id0)
Set/Get the value of the UseHorizontalViewAngle instance variable. If set, the camera's view angle represents a horizontal view angle, rather than the default vertical view angle. This is useful if the application uses a display device which whose specs indicate a particular horizontal view angle, or if the application varies the window height but wants to keep the perspective transform unchanges.


getUseHorizontalViewAngle

public int getUseHorizontalViewAngle()
Set/Get the value of the UseHorizontalViewAngle instance variable. If set, the camera's view angle represents a horizontal view angle, rather than the default vertical view angle. This is useful if the application uses a display device which whose specs indicate a particular horizontal view angle, or if the application varies the window height but wants to keep the perspective transform unchanges.


useHorizontalViewAngleOn

public void useHorizontalViewAngleOn()
Set/Get the value of the UseHorizontalViewAngle instance variable. If set, the camera's view angle represents a horizontal view angle, rather than the default vertical view angle. This is useful if the application uses a display device which whose specs indicate a particular horizontal view angle, or if the application varies the window height but wants to keep the perspective transform unchanges.


useHorizontalViewAngleOff

public void useHorizontalViewAngleOff()
Set/Get the value of the UseHorizontalViewAngle instance variable. If set, the camera's view angle represents a horizontal view angle, rather than the default vertical view angle. This is useful if the application uses a display device which whose specs indicate a particular horizontal view angle, or if the application varies the window height but wants to keep the perspective transform unchanges.


setViewAngle

public void setViewAngle(double id0)
Set/Get the camera view angle, which is the angular height of the camera view measured in degrees. The default angle is 30 degrees. This method has no effect in parallel projection mode. The formula for setting the angle up for perfect perspective viewing is: angle = 2*atan((h/2)/d) where h is the height of the RenderWindow (measured in mm by holding a ruler up to your screen) and d is the distance from your eyes to the screen.


getViewAngle

public double getViewAngle()
Set/Get the camera view angle, which is the angular height of the camera view measured in degrees. The default angle is 30 degrees. This method has no effect in parallel projection mode. The formula for setting the angle up for perfect perspective viewing is: angle = 2*atan((h/2)/d) where h is the height of the RenderWindow (measured in mm by holding a ruler up to your screen) and d is the distance from your eyes to the screen.


setParallelScale

public void setParallelScale(double id0)
Set/Get the scaling used for a parallel projection, i.e. the height of the viewport in world-coordinate distances. The default is 1. Note that the "scale" parameter works as an "inverse scale" --- larger numbers produce smaller images. This method has no effect in perspective projection mode.


getParallelScale

public double getParallelScale()
Set/Get the scaling used for a parallel projection, i.e. the height of the viewport in world-coordinate distances. The default is 1. Note that the "scale" parameter works as an "inverse scale" --- larger numbers produce smaller images. This method has no effect in perspective projection mode.


zoom

public void zoom(double id0)
In perspective mode, decrease the view angle by the specified factor. In parallel mode, decrease the parallel scale by the specified factor. A value greater than 1 is a zoom-in, a value less than 1 is a zoom-out.


setClippingRange

public void setClippingRange(double id0,
                             double id1)
Set/Get the location of the near and far clipping planes along the direction of projection. Both of these values must be positive. How the clipping planes are set can have a large impact on how well z-buffering works. In particular the front clipping plane can make a very big difference. Setting it to 0.01 when it really could be 1.0 can have a big impact on your z-buffer resolution farther away. The default clipping range is (0.1,1000).


setClippingRange

public void setClippingRange(double[] id0)
Set/Get the location of the near and far clipping planes along the direction of projection. Both of these values must be positive. How the clipping planes are set can have a large impact on how well z-buffering works. In particular the front clipping plane can make a very big difference. Setting it to 0.01 when it really could be 1.0 can have a big impact on your z-buffer resolution farther away. The default clipping range is (0.1,1000).


getClippingRange

public double[] getClippingRange()
Set/Get the location of the near and far clipping planes along the direction of projection. Both of these values must be positive. How the clipping planes are set can have a large impact on how well z-buffering works. In particular the front clipping plane can make a very big difference. Setting it to 0.01 when it really could be 1.0 can have a big impact on your z-buffer resolution farther away. The default clipping range is (0.1,1000).


setThickness

public void setThickness(double id0)
Set the distance between clipping planes. This method adjusts the far clipping plane to be set a distance 'thickness' beyond the near clipping plane.


getThickness

public double getThickness()
Set the distance between clipping planes. This method adjusts the far clipping plane to be set a distance 'thickness' beyond the near clipping plane.


setWindowCenter

public void setWindowCenter(double id0,
                            double id1)
Set/Get the center of the window in viewport coordinates. The viewport coordinate range is ([-1,+1],[-1,+1]). This method is for if you have one window which consists of several viewports, or if you have several screens which you want to act together as one large screen.


getWindowCenter

public double[] getWindowCenter()
Set/Get the center of the window in viewport coordinates. The viewport coordinate range is ([-1,+1],[-1,+1]). This method is for if you have one window which consists of several viewports, or if you have several screens which you want to act together as one large screen.


setObliqueAngles

public void setObliqueAngles(double id0,
                             double id1)
Get/Set the oblique viewing angles. The first angle, alpha, is the angle (measured from the horizontal) that rays along the direction of projection will follow once projected onto the 2D screen. The second angle, beta, is the angle between the view plane and the direction of projection. This creates a shear transform x' = x + dz*cos(alpha)/tan(beta), y' = dz*sin(alpha)/tan(beta) where dz is the distance of the point from the focal plane. The angles are (45,90) by default. Oblique projections commonly use (30,63.435).


applyTransform

public void applyTransform(vtkTransform id0)
Apply a transform to the camera. The camera position, focal-point, and view-up are re-calulated using the transform's matrix to multiply the old points by the new transform.


getViewPlaneNormal

public double[] getViewPlaneNormal()
Get the ViewPlaneNormal. This vector will point opposite to the direction of projection, unless you have created an sheared output view using SetViewShear/SetObliqueAngles.


setViewShear

public void setViewShear(double id0,
                         double id1,
                         double id2)
Set/get the shear transform of the viewing frustum. Parameters are dx/dz, dy/dz, and center. center is a factor that describes where to shear around. The distance dshear from the camera where no shear occurs is given by (dshear = center * FocalDistance).


setViewShear

public void setViewShear(double[] id0)
Set/get the shear transform of the viewing frustum. Parameters are dx/dz, dy/dz, and center. center is a factor that describes where to shear around. The distance dshear from the camera where no shear occurs is given by (dshear = center * FocalDistance).


getViewShear

public double[] getViewShear()
Set/get the shear transform of the viewing frustum. Parameters are dx/dz, dy/dz, and center. center is a factor that describes where to shear around. The distance dshear from the camera where no shear occurs is given by (dshear = center * FocalDistance).


setEyeAngle

public void setEyeAngle(double id0)
Set/Get the separation between eyes (in degrees). This is used when generating stereo images.


getEyeAngle

public double getEyeAngle()
Set/Get the separation between eyes (in degrees). This is used when generating stereo images.


setFocalDisk

public void setFocalDisk(double id0)
Set the size of the cameras lens in world coordinates. This is only used when the renderer is doing focal depth rendering. When that is being done the size of the focal disk will effect how significant the depth effects will be.


getFocalDisk

public double getFocalDisk()
Set the size of the cameras lens in world coordinates. This is only used when the renderer is doing focal depth rendering. When that is being done the size of the focal disk will effect how significant the depth effects will be.


getViewTransformMatrix

public vtkMatrix4x4 getViewTransformMatrix()
Return the matrix of the view transform.


getPerspectiveTransformMatrix

public vtkMatrix4x4 getPerspectiveTransformMatrix(double id0,
                                                  double id1,
                                                  double id2)
Return the perspective transform matrix, which converts from camera coordinates to viewport coordinates. The 'aspect' is the width/height for the viewport, and the nearz and farz are the Z-buffer values that map to the near and far clipping planes. The viewport coordinates are in the range ([-1,+1],[-1,+1],[nearz,farz]).


getCompositePerspectiveTransformMatrix

public vtkMatrix4x4 getCompositePerspectiveTransformMatrix(double id0,
                                                           double id1,
                                                           double id2)
Return the concatenation of the ViewTransform and the PerspectiveTransform. This transform will convert world coordinates to viewport coordinates. The 'aspect' is the width/height for the viewport, and the nearz and farz are the Z-buffer values that map to the near and far clipping planes. The viewport coordinates are in the range ([-1,+1],[-1,+1],[nearz,farz]).


setUserTransform

public void setUserTransform(vtkHomogeneousTransform id0)
In addition to the instance variables such as position and orientation, you can add an additional transformation for your own use. This transformation is concatenated to the camera's PerspectiveTransform


getUserTransform

public vtkHomogeneousTransform getUserTransform()
In addition to the instance variables such as position and orientation, you can add an additional transformation for your own use. This transformation is concatenated to the camera's PerspectiveTransform


render

public void render(vtkRenderer id0)
This method causes the camera to set up whatever is required for viewing the scene. This is actually handled by an subclass of vtkCamera, which is created through New()


getViewingRaysMTime

public int getViewingRaysMTime()
Return the MTime that concerns recomputing the view rays of the camera.


viewingRaysModified

public void viewingRaysModified()
Mark that something has changed which requires the view rays to be recomputed.


getFrustumPlanes

public void getFrustumPlanes(double id0,
                             double[] id1)
Get the plane equations that bound the view frustum. The plane normals point inward. The planes array contains six plane equations of the form (Ax+By+Cz+D=0), the first four values are (A,B,C,D) which repeats for each of the planes. The aspect of the viewport is needed to correctly compute the planes


getOrientation

public double[] getOrientation()
Get the orientation of the camera.


getOrientationWXYZ

public double[] getOrientationWXYZ()
Get the orientation of the camera.


setViewPlaneNormal

public void setViewPlaneNormal(double id0,
                               double id1,
                               double id2)
These methods have been deprecated. The view plane normal is automatically set from the DirectionOfProjection according to the ViewShear.


setViewPlaneNormal

public void setViewPlaneNormal(double[] id0)
These methods have been deprecated. The view plane normal is automatically set from the DirectionOfProjection according to the ViewShear.


computeViewPlaneNormal

public void computeViewPlaneNormal()
This method is called automatically whenever necessary, it should never be used outside of vtkCamera.cxx.


getCameraLightTransformMatrix

public vtkMatrix4x4 getCameraLightTransformMatrix()
Returns a transformation matrix for a coordinate frame attached to the camera, where the camera is located at (0, 0, 1) looking at the focal point at (0, 0, 0), with up being (0, 1, 0).


updateViewport

public void updateViewport(vtkRenderer id0)

getViewTransformObject

public vtkTransform getViewTransformObject()

VTKInit

public void VTKInit()
Overrides:
VTKInit in class vtkObject

VTKCastInit

protected void VTKCastInit()
Overrides:
VTKCastInit in class vtkObject


Copyright © 2004 Sydney ViSLAB. All Rights Reserved.