Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

vtkCamera Class Reference

a virtual camera for 3D rendering. More...

#include <vtkCamera.h>

Inheritance diagram for vtkCamera:

Inheritance graph
[legend]
Collaboration diagram for vtkCamera:

Collaboration graph
[legend]
List of all members.

Public Methods

void PrintSelf (ostream &os, vtkIndent indent)
virtual const char * GetClassName ()
virtual int IsA (const char *type)
void SetPosition (double x, double y, double z)
void SetPosition (const double a[3])
void SetPosition (const float a[3])
virtual double * GetPosition ()
virtual void GetPosition (double &, double &, double &)
virtual void GetPosition (double[3])
void GetPosition (float a[3])
void SetFocalPoint (double x, double y, double z)
void SetFocalPoint (const double a[3])
void SetFocalPoint (const float a[3])
virtual double * GetFocalPoint ()
virtual void GetFocalPoint (double &, double &, double &)
virtual void GetFocalPoint (double[3])
void GetFocalPoint (float a[3])
void SetViewUp (double vx, double vy, double vz)
void SetViewUp (const double a[3])
void SetViewUp (const float a[3])
virtual double * GetViewUp ()
virtual void GetViewUp (double &, double &, double &)
virtual void GetViewUp (double[3])
void GetViewUp (float a[3])
void OrthogonalizeViewUp ()
void SetDistance (double)
virtual double GetDistance ()
virtual double * GetDirectionOfProjection ()
virtual void GetDirectionOfProjection (double &, double &, double &)
virtual void GetDirectionOfProjection (double[3])
void GetDirectionOfProjection (float a[3])
void Dolly (double distance)
void SetRoll (double angle)
double GetRoll ()
void Roll (double angle)
void Azimuth (double angle)
void Yaw (double angle)
void Elevation (double angle)
void Pitch (double angle)
void SetParallelProjection (int flag)
virtual int GetParallelProjection ()
virtual void ParallelProjectionOn ()
virtual void ParallelProjectionOff ()
void SetViewAngle (double angle)
virtual double GetViewAngle ()
void SetParallelScale (double scale)
virtual double GetParallelScale ()
void Zoom (double factor)
void SetClippingRange (double near, double far)
void SetClippingRange (const double a[2])
void SetClippingRange (const float a[2])
virtual double * GetClippingRange ()
virtual void GetClippingRange (double &, double &)
virtual void GetClippingRange (double[2])
void GetClippingRange (float a[2])
void SetThickness (double)
virtual double GetThickness ()
void SetWindowCenter (double x, double y)
virtual double * GetWindowCenter ()
virtual void GetWindowCenter (double &, double &)
virtual void GetWindowCenter (double[2])
void SetObliqueAngles (double alpha, double beta)
virtual double * GetObliqueAngles ()
virtual void GetObliqueAngles (double &, double &)
virtual void GetObliqueAngles (double[2])
virtual double * GetViewPlaneNormal ()
virtual void GetViewPlaneNormal (double &, double &, double &)
virtual void GetViewPlaneNormal (double[3])
void GetViewPlaneNormal (float a[3])
virtual void SetEyeAngle (double)
virtual double GetEyeAngle ()
virtual void SetFocalDisk (double)
virtual double GetFocalDisk ()
vtkMatrix4x4GetViewTransformMatrix ()
vtkMatrix4x4GetPerspectiveTransformMatrix (double aspect, double nearz, double farz)
vtkMatrix4x4GetCompositePerspectiveTransformMatrix (double aspect, double nearz, double farz)
virtual void Render (vtkRenderer *)
unsigned long GetViewingRaysMTime ()
void ViewingRaysModified ()
void GetFrustumPlanes (float aspect, float planes[24])
float * GetOrientation ()
float * GetOrientationWXYZ ()
void SetViewPlaneNormal (double x, double y, double z)
void SetViewPlaneNormal (const double a[3])
void SetViewPlaneNormal (const float a[3])
void ComputeViewPlaneNormal ()
vtkMatrix4x4GetCameraLightTransformMatrix ()
vtkMatrix4x4GetViewTransform ()
vtkMatrix4x4GetPerspectiveTransform (double aspect, double nearz, double farz)
vtkMatrix4x4GetCompositePerspectiveTransform (double aspect, double nearz, double farz)

Static Public Methods

int IsTypeOf (const char *type)
vtkCamera * SafeDownCast (vtkObject *o)
vtkCamera * New ()

Protected Methods

 vtkCamera ()
 ~vtkCamera ()
 vtkCamera (const vtkCamera &)
void operator= (const vtkCamera &)
void ComputeDistance ()
void ComputeViewTransform ()
void ComputePerspectiveTransform (double aspect, double nearz, double farz)
void ComputeCompositePerspectiveTransform (double aspect, double nearz, double farz)
void ComputeCameraLightTransform ()

Protected Attributes

double WindowCenter [2]
double ObliqueAngles [2]
double FocalPoint [3]
double Position [3]
double ViewUp [3]
double ViewAngle
double ClippingRange [2]
double EyeAngle
int ParallelProjection
double ParallelScale
int Stereo
int LeftEye
double Thickness
double Distance
double DirectionOfProjection [3]
double ViewPlaneNormal [3]
vtkTransformViewTransform
vtkPerspectiveTransformPerspectiveTransform
vtkPerspectiveTransformTransform
vtkTransformCameraLightTransform
double FocalDisk
vtkTimeStamp ViewingRaysMTime

Detailed Description

a virtual camera for 3D rendering.

Date:
2000/12/10 20:08:30
Revision:
1.72

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.

See also:
vtkPerspectiveTransform
Examples:
vtkCamera (examples)

Definition at line 67 of file vtkCamera.h.


Constructor & Destructor Documentation

vtkCamera::vtkCamera   [protected]
 

vtkCamera::~vtkCamera   [protected]
 

vtkCamera::vtkCamera const vtkCamera &    [inline, protected]
 

Definition at line 333 of file vtkCamera.h.


Member Function Documentation

void vtkCamera::PrintSelf ostream &    os,
vtkIndent    indent
[virtual]
 

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObject.

virtual const char* vtkCamera::GetClassName   [virtual]
 

Return the class name as a string. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented in vtkMesaCamera, and vtkOpenGLCamera.

int vtkCamera::IsTypeOf const char *    type [static]
 

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented in vtkMesaCamera, and vtkOpenGLCamera.

virtual int vtkCamera::IsA const char *    type [virtual]
 

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 vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented in vtkMesaCamera, and vtkOpenGLCamera.

vtkCamera* vtkCamera::SafeDownCast vtkObject   o [static]
 

Will cast the supplied object to vtkObject* is this is a safe operation (i.e., a safe downcast); otherwise NULL is returned. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented in vtkMesaCamera, and vtkOpenGLCamera.

vtkCamera* vtkCamera::New   [static]
 

Construct camera instance with its focal point at the origin, and position=(0,0,1). The view up is along the y-axis, view angle is 30 degrees, and the clipping range is (.1,1000).

Reimplemented from vtkObject.

Reimplemented in vtkMesaCamera, and vtkOpenGLCamera.

void vtkCamera::SetPosition double    x,
double    y,
double    z
 

Set/Get the position of the camera in world coordinates. The default position is (0,0,1).

void vtkCamera::SetPosition const double    a[3] [inline]
 

Definition at line 81 of file vtkCamera.h.

void vtkCamera::SetPosition const float    a[3] [inline]
 

Definition at line 83 of file vtkCamera.h.

virtual double* vtkCamera::GetPosition   [virtual]
 

virtual void vtkCamera::GetPosition double &   ,
double &   ,
double &   
[virtual]
 

virtual void vtkCamera::GetPosition double   [3] [virtual]
 

void vtkCamera::GetPosition float    a[3] [inline]
 

Definition at line 86 of file vtkCamera.h.

void vtkCamera::SetFocalPoint double    x,
double    y,
double    z
 

Set/Get the focal of the camera in world coordinates. The default focal point is the origin.

void vtkCamera::SetFocalPoint const double    a[3] [inline]
 

Definition at line 93 of file vtkCamera.h.

void vtkCamera::SetFocalPoint const float    a[3] [inline]
 

Definition at line 95 of file vtkCamera.h.

virtual double* vtkCamera::GetFocalPoint   [virtual]
 

virtual void vtkCamera::GetFocalPoint double &   ,
double &   ,
double &   
[virtual]
 

virtual void vtkCamera::GetFocalPoint double   [3] [virtual]
 

void vtkCamera::GetFocalPoint float    a[3] [inline]
 

Definition at line 98 of file vtkCamera.h.

void vtkCamera::SetViewUp double    vx,
double    vy,
double    vz
 

Set/Get the view up direction for the camera. The default is (0,1,0).

void vtkCamera::SetViewUp const double    a[3] [inline]
 

Definition at line 105 of file vtkCamera.h.

void vtkCamera::SetViewUp const float    a[3] [inline]
 

Definition at line 107 of file vtkCamera.h.

virtual double* vtkCamera::GetViewUp   [virtual]
 

virtual void vtkCamera::GetViewUp double &   ,
double &   ,
double &   
[virtual]
 

virtual void vtkCamera::GetViewUp double   [3] [virtual]
 

void vtkCamera::GetViewUp float    a[3] [inline]
 

Definition at line 110 of file vtkCamera.h.

void vtkCamera::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.

void vtkCamera::SetDistance double   
 

Move the focal point so that it is the specified distance from the camera position. This distance must be positive.

virtual double vtkCamera::GetDistance   [virtual]
 

virtual double* vtkCamera::GetDirectionOfProjection   [virtual]
 

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.

virtual void vtkCamera::GetDirectionOfProjection double &   ,
double &   ,
double &   
[virtual]
 

virtual void vtkCamera::GetDirectionOfProjection double   [3] [virtual]
 

void vtkCamera::GetDirectionOfProjection float    a[3] [inline]
 

Definition at line 128 of file vtkCamera.h.

void vtkCamera::Dolly double    distance
 

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.

void vtkCamera::SetRoll double    angle
 

Set the roll angle of the camera about the direction of projection.

double vtkCamera::GetRoll  
 

void vtkCamera::Roll double    angle
 

Rotate the camera about the direction of projection.

void vtkCamera::Azimuth double    angle
 

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.

void vtkCamera::Yaw double    angle
 

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.

void vtkCamera::Elevation double    angle
 

Rotate the camera about the cross product of the direction of projection and the view up vector centered on the focal point.

void vtkCamera::Pitch double    angle
 

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 vtkCamera::SetParallelProjection int    flag
 

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

virtual int vtkCamera::GetParallelProjection   [virtual]
 

virtual void vtkCamera::ParallelProjectionOn   [virtual]
 

virtual void vtkCamera::ParallelProjectionOff   [virtual]
 

void vtkCamera::SetViewAngle double    angle
 

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.

virtual double vtkCamera::GetViewAngle   [virtual]
 

void vtkCamera::SetParallelScale double    scale
 

Set/Get the scaling used for a parallel projection, i.e. the height of the viewport in world-coordinate distances. The default is 1. This method has no effect in perspective projection mode.

virtual double vtkCamera::GetParallelScale   [virtual]
 

void vtkCamera::Zoom double    factor
 

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.

void vtkCamera::SetClippingRange double    near,
double    far
 

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).

void vtkCamera::SetClippingRange const double    a[2] [inline]
 

Definition at line 199 of file vtkCamera.h.

void vtkCamera::SetClippingRange const float    a[2] [inline]
 

Definition at line 201 of file vtkCamera.h.

virtual double* vtkCamera::GetClippingRange   [virtual]
 

virtual void vtkCamera::GetClippingRange double &   ,
double &   
[virtual]
 

virtual void vtkCamera::GetClippingRange double   [2] [virtual]
 

void vtkCamera::GetClippingRange float    a[2] [inline]
 

Definition at line 204 of file vtkCamera.h.

void vtkCamera::SetThickness double   
 

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

virtual double vtkCamera::GetThickness   [virtual]
 

void vtkCamera::SetWindowCenter double    x,
double    y
 

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.

virtual double* vtkCamera::GetWindowCenter   [virtual]
 

virtual void vtkCamera::GetWindowCenter double &   ,
double &   
[virtual]
 

virtual void vtkCamera::GetWindowCenter double   [2] [virtual]
 

void vtkCamera::SetObliqueAngles double    alpha,
double    beta
 

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(phi)/tan(alpha), y' = dz*sin(phi)/tan(alpha) where dz is the distance of the point from the focal plane. The angles are (90,45) by default. Oblique projections commonly use (63.435,30).

virtual double* vtkCamera::GetObliqueAngles   [virtual]
 

virtual void vtkCamera::GetObliqueAngles double &   ,
double &   
[virtual]
 

virtual void vtkCamera::GetObliqueAngles double   [2] [virtual]
 

virtual double* vtkCamera::GetViewPlaneNormal   [virtual]
 

Get the ViewPlaneNormal. This vector will point opposite to the direction of projection, unless you have created an oblique view using SetObliqueAngles.

virtual void vtkCamera::GetViewPlaneNormal double &   ,
double &   ,
double &   
[virtual]
 

virtual void vtkCamera::GetViewPlaneNormal double   [3] [virtual]
 

void vtkCamera::GetViewPlaneNormal float    a[3] [inline]
 

Definition at line 237 of file vtkCamera.h.

virtual void vtkCamera::SetEyeAngle double    [virtual]
 

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

virtual double vtkCamera::GetEyeAngle   [virtual]
 

virtual void vtkCamera::SetFocalDisk double    [virtual]
 

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.

virtual double vtkCamera::GetFocalDisk   [virtual]
 

vtkMatrix4x4* vtkCamera::GetViewTransformMatrix   [inline]
 

Return the matrix of the view transform.

Definition at line 254 of file vtkCamera.h.

vtkMatrix4x4* vtkCamera::GetPerspectiveTransformMatrix double    aspect,
double    nearz,
double    farz
 

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]).

vtkMatrix4x4* vtkCamera::GetCompositePerspectiveTransformMatrix double    aspect,
double    nearz,
double    farz
 

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]).

virtual void vtkCamera::Render vtkRenderer   ren [inline, virtual]
 

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()

Reimplemented in vtkMesaCamera, and vtkOpenGLCamera.

Definition at line 279 of file vtkCamera.h.

unsigned long vtkCamera::GetViewingRaysMTime  
 

Return the MTime that concerns recomputing the view rays of the camera.

void vtkCamera::ViewingRaysModified  
 

Mark that something has changed which requires the view rays to be recomputed.

void vtkCamera::GetFrustumPlanes float    aspect,
float    planes[24]
 

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

float* vtkCamera::GetOrientation   [inline]
 

Get the orientation of the camera.

Definition at line 297 of file vtkCamera.h.

float* vtkCamera::GetOrientationWXYZ   [inline]
 

Definition at line 299 of file vtkCamera.h.

void vtkCamera::SetViewPlaneNormal double    x,
double    y,
double    z
 

These methods have been deprecated. The view plane normal is automatically set from the DirectionOfProjection according to the ObliqueAngles.

void vtkCamera::SetViewPlaneNormal const double    a[3] [inline]
 

Definition at line 306 of file vtkCamera.h.

void vtkCamera::SetViewPlaneNormal const float    a[3] [inline]
 

Definition at line 308 of file vtkCamera.h.

void vtkCamera::ComputeViewPlaneNormal  
 

This method is called automatically whenever necessary, it should never be used outside of vtkCamera.cxx.

vtkMatrix4x4* vtkCamera::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).

vtkMatrix4x4& vtkCamera::GetViewTransform   [inline]
 

For legacy compatibility. Do not use.

Definition at line 322 of file vtkCamera.h.

vtkMatrix4x4& vtkCamera::GetPerspectiveTransform double    aspect,
double    nearz,
double    farz
[inline]
 

Definition at line 324 of file vtkCamera.h.

vtkMatrix4x4& vtkCamera::GetCompositePerspectiveTransform double    aspect,
double    nearz,
double    farz
[inline]
 

Definition at line 326 of file vtkCamera.h.

void vtkCamera::operator= const vtkCamera &    [inline, protected]
 

Definition at line 334 of file vtkCamera.h.

void vtkCamera::ComputeDistance   [protected]
 

These methods should only be used within vtkCamera.cxx.

void vtkCamera::ComputeViewTransform   [protected]
 

void vtkCamera::ComputePerspectiveTransform double    aspect,
double    nearz,
double    farz
[protected]
 

void vtkCamera::ComputeCompositePerspectiveTransform double    aspect,
double    nearz,
double    farz
[protected]
 

void vtkCamera::ComputeCameraLightTransform   [protected]
 


Member Data Documentation

double vtkCamera::WindowCenter[2] [protected]
 

Definition at line 346 of file vtkCamera.h.

double vtkCamera::ObliqueAngles[2] [protected]
 

Definition at line 347 of file vtkCamera.h.

double vtkCamera::FocalPoint[3] [protected]
 

Definition at line 348 of file vtkCamera.h.

double vtkCamera::Position[3] [protected]
 

Definition at line 349 of file vtkCamera.h.

double vtkCamera::ViewUp[3] [protected]
 

Definition at line 350 of file vtkCamera.h.

double vtkCamera::ViewAngle [protected]
 

Definition at line 351 of file vtkCamera.h.

double vtkCamera::ClippingRange[2] [protected]
 

Definition at line 352 of file vtkCamera.h.

double vtkCamera::EyeAngle [protected]
 

Definition at line 353 of file vtkCamera.h.

int vtkCamera::ParallelProjection [protected]
 

Definition at line 354 of file vtkCamera.h.

double vtkCamera::ParallelScale [protected]
 

Definition at line 355 of file vtkCamera.h.

int vtkCamera::Stereo [protected]
 

Definition at line 356 of file vtkCamera.h.

int vtkCamera::LeftEye [protected]
 

Definition at line 357 of file vtkCamera.h.

double vtkCamera::Thickness [protected]
 

Definition at line 358 of file vtkCamera.h.

double vtkCamera::Distance [protected]
 

Definition at line 359 of file vtkCamera.h.

double vtkCamera::DirectionOfProjection[3] [protected]
 

Definition at line 360 of file vtkCamera.h.

double vtkCamera::ViewPlaneNormal[3] [protected]
 

Definition at line 361 of file vtkCamera.h.

vtkTransform* vtkCamera::ViewTransform [protected]
 

Definition at line 363 of file vtkCamera.h.

vtkPerspectiveTransform* vtkCamera::PerspectiveTransform [protected]
 

Definition at line 364 of file vtkCamera.h.

vtkPerspectiveTransform* vtkCamera::Transform [protected]
 

Definition at line 365 of file vtkCamera.h.

vtkTransform* vtkCamera::CameraLightTransform [protected]
 

Definition at line 366 of file vtkCamera.h.

double vtkCamera::FocalDisk [protected]
 

Definition at line 368 of file vtkCamera.h.

vtkTimeStamp vtkCamera::ViewingRaysMTime [protected]
 

Definition at line 373 of file vtkCamera.h.


The documentation for this class was generated from the following file:
Generated on Wed Nov 21 12:46:39 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001