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

vtkViewRays Class Reference

provides view ray information for efficiently casting rays. More...

#include <vtkViewRays.h>

Inheritance diagram for vtkViewRays:

Inheritance graph
[legend]
Collaboration diagram for vtkViewRays:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
void SetRenderer (vtkRenderer *ren)
virtual vtkRendererGetRenderer ()
virtual void SetSize (int, int)
void SetSize (int[2])
virtual int * GetSize ()
virtual void GetSize (int &, int &)
virtual void GetSize (int[2])
float * GetPerspectiveViewRays (void)
float * GetParallelStartPosition (void)
float * GetParallelIncrements (void)

Static Public Methods

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

Protected Methods

 vtkViewRays (void)
 ~vtkViewRays (void)
 vtkViewRays (const vtkViewRays &)
void operator= (const vtkViewRays &)
void ComputeParallelInfo (int size[2])
void ComputePerspectiveInfo (float *vr_ptr, int size[2])

Protected Attributes

vtkRendererRenderer
int Size [2]
unsigned long ViewRaysCamMtime
unsigned long ViewRaysMTime
float StartPosition [3]
float Increments [2]
float * ViewRays

Detailed Description

provides view ray information for efficiently casting rays.

Date:
2000/12/10 20:08:58
Revision:
1.20

The vtkViewRays class calculates and stores the relevant information necessary to efficiently render perspective or parallel viewing rays. View rays are typically used by a ray caster where a view ray is cast per pixel in the requested image.

The number of view rays requested in both X and Y is specified by the SetSize() method. The camera model used to create the view ray information is specified by the SetRenderer() method. Both the SetSize() and SetRenderer() method must be called before viewing ray information can be requested. vtkViewRays will recompute view ray information should the critical information in the camera, the renderer or number of rays change.

vtkViewRays contains view ray information in view coordinates for either parallel or perspective viewing transformations. This reduces the computational burden on a ray caster since the computation of perspective, normalized viewing ray vectors is pre-computed once rather than during each rendering.

When the camera viewing transform is perspective the start of each viewing vector (eye point) is fixed, but the direction of each ray varies. Therefore, vtkViewRays contains a 2D array of 3D unit vectors each representing the direction of a view ray with respect to the viewing coordinate system. A pointer to this 2D array of vectors is obtained by calling the GetPerspectiveViewRays() method.

When the camera viewing transform is parallel the start of each viewing vector varies across the viewing plane but the direction remains constant. Since the starting point of each view ray can be captured by regularly sampling the parallel viewing plane, a 2D array of starting view ray positions is NOT used. Instead, the first view ray position (bottom left corner of view) is returned by the GetParallelStartPosition() method and the X and Y distance increments to the next view ray starting position are returned by the GetParallelIncrements() method.

Definition at line 89 of file vtkViewRays.h.


Constructor & Destructor Documentation

vtkViewRays::vtkViewRays void    [protected]
 

vtkViewRays::~vtkViewRays void    [protected]
 

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

Definition at line 122 of file vtkViewRays.h.


Member Function Documentation

vtkViewRays* vtkViewRays::New   [static]
 

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkObject.

virtual const char* vtkViewRays::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.

int vtkViewRays::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.

virtual int vtkViewRays::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.

vtkViewRays* vtkViewRays::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.

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

void vtkViewRays::SetRenderer vtkRenderer   ren
 

Specify the vtkRenderer whose camera will be used to to calculate the view rays. The type of camera (parallel, perspective) will determine which type of view ray information is calculated. Note: this does not increase the reference count of the renderer.

virtual vtkRenderer* vtkViewRays::GetRenderer   [virtual]
 

virtual void vtkViewRays::SetSize int   ,
int   
[virtual]
 

Set the image size for the view rays.

void vtkViewRays::SetSize int   [2]
 

virtual int* vtkViewRays::GetSize   [virtual]
 

virtual void vtkViewRays::GetSize int &   ,
int &   
[virtual]
 

virtual void vtkViewRays::GetSize int   [2] [virtual]
 

float* vtkViewRays::GetPerspectiveViewRays void   
 

Retrieve the 2D array of normalized view ray vectors formatted as 3 floats per vector (dx,dy,dz). This method is only valid after the SetSize() and SetRenderer() methods have been called.

float* vtkViewRays::GetParallelStartPosition void   
 

Retrieve the position of the bottom left ray

float* vtkViewRays::GetParallelIncrements void   
 

Retrieve the distance to the next ray starting point along the X and Y direction.

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

Definition at line 123 of file vtkViewRays.h.

void vtkViewRays::ComputeParallelInfo int    size[2] [protected]
 

void vtkViewRays::ComputePerspectiveInfo float *    vr_ptr,
int    size[2]
[protected]
 


Member Data Documentation

vtkRenderer* vtkViewRays::Renderer [protected]
 

Definition at line 125 of file vtkViewRays.h.

int vtkViewRays::Size[2] [protected]
 

Definition at line 126 of file vtkViewRays.h.

unsigned long vtkViewRays::ViewRaysCamMtime [protected]
 

Definition at line 127 of file vtkViewRays.h.

unsigned long vtkViewRays::ViewRaysMTime [protected]
 

Definition at line 128 of file vtkViewRays.h.

float vtkViewRays::StartPosition[3] [protected]
 

Definition at line 132 of file vtkViewRays.h.

float vtkViewRays::Increments[2] [protected]
 

Definition at line 133 of file vtkViewRays.h.

float* vtkViewRays::ViewRays [protected]
 

Definition at line 137 of file vtkViewRays.h.


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