Man Page for vtkRenderer
Table of Contents

NAME

vtkRenderer - abstract specification for renderers

SYNOPSIS


#include "/opt/vtk-c++/graphics/vtkRenderer.h"

class VTK_EXPORT vtkRenderer : public vtkObject

vtkRenderer();
~vtkRenderer();
static vtkRenderer *New();
const char *GetClassName() {return "vtkRenderer";};
void PrintSelf(ostream& os, vtkIndent indent);
void AddLight(vtkLight *);
void AddActor(vtkActor *);
void AddVolume(vtkVolume *);
void RemoveLight(vtkLight *);
void RemoveActor(vtkActor *);
void RemoveVolume(vtkVolume *);
vtkLightCollection *GetLights();
vtkActorCollection *GetActors();
vtkVolumeCollection *GetVolumes();
void SetActiveCamera(vtkCamera *);
vtkCamera *GetActiveCamera();
void SetBackground(float, float, float);
void SetBackground(float *);
float *GetBackground();
void GetBackground(float data[3]);
void SetAspect(float, float);
void SetAspect(float *);
float *GetAspect();
void GetAspect(float data[2]);
void SetAmbient(float, float, float);
void SetAmbient(float *);
float *GetAmbient();
void GetAmbient(float data[3]);
void SetAllocatedRenderTime(float);
float GetAllocatedRenderTime();
virtual void Render() {};
virtual int UpdateActors(void) {return 0;};
virtual int UpdateVolumes(void) {return 0;};
virtual int UpdateCameras(void) {return 0;};
virtual int UpdateLights(void) {return 0;};
int VisibleActorCount();
int VisibleVolumeCount();
void CreateLight(void);
void ResetCamera();
void ResetCamera(float bounds[6]);
void SetRenderWindow(vtkRenderWindow *);
vtkRenderWindow *GetRenderWindow() {return RenderWindow;};
void SetDisplayPoint(float, float, float);
void SetDisplayPoint(float *);
float *GetDisplayPoint();
void GetDisplayPoint(float data[3]);
void SetViewPoint(float, float, float);
void SetViewPoint(float *);
float *GetViewPoint();
void GetViewPoint(float data[3]);
void SetWorldPoint(float, float, float, float);
void SetWorldPoint(float *);
float *GetWorldPoint();
void GetWorldPoint(float data[4]);
void SetViewport(float, float, float, float);
void SetViewport(float *);
float *GetViewport();
void GetViewport(float data[4]);
int GetTwoSidedLighting();
void SetTwoSidedLighting(int);
void TwoSidedLightingOn();
void TwoSidedLightingOff();
virtual float *GetCenter();

virtual void DisplayToView();
these get modified in subclasses
virtual void ViewToDisplay();
to handle stereo rendering
virtual int IsInViewport(int x,int y);
void WorldToView();
void ViewToWorld();
void DisplayToWorld();
void WorldToDisplay();
vtkRayCaster *GetRayCaster();
void SetStartRenderMethod(void (*f)(void *), void *arg);
void SetEndRenderMethod(void (*f)(void *), void *arg);
void SetStartRenderMethodArgDelete(void (*f)(void *));
void SetEndRenderMethodArgDelete(void (*f)(void *));
float GetZ (int x, int y);

DESCRIPTION

vtkRenderer provides an abstract specification for renderers. A renderer is an object that controls the rendering process for objects. Rendering is the process of converting geometry, a specification for lights, and a camera view into an image. vtkRenderer also performs coordinate transformation between world coordinates, view coordinates (the computer graphics rendering coordinate system), and display coordinates (the actual screen coordinates on the display device). Certain advanced rendering features such as twosided lighting can also be controlled.

SEE ALSO

vtkRenderWindow vtkActor vtkCamera vtkLight vtkVolume vtkRayCaster

SUMMARY

void SetBackground(float, float, float)
void SetBackground(float *)

Set/Get the background color of the rendering screen using an rgb color specification.

void SetAspect(float, float)
void SetAspect(float *)
Set the aspect ratio of the rendered image. This is computed automatically and should not be set by the user.

void SetAmbient(float, float, float)
void SetAmbient(float *)
Set the intensity of ambient lighting.

void SetAllocatedRenderTime(float)
Set/Get the amount of time this renderer is allowed to spend rendering its scene. Zero indicates an infinite amount of time. This is used by vtkLODActor's.

virtual void Render() {};
Create an image. Subclasses of vtkRenderer must implement this method.

virtual int UpdateActors(void) {return 0;};
Ask all actors to build and draw themselves. Returns the number of actors processed.

virtual int UpdateVolumes(void) {return 0;};
Ask the volumes to build and draw themselves. Returns the number of volumes processed.

virtual int UpdateCameras(void) {return 0;};
Ask the active camera to do whatever it needs to do prior to rendering. Creates a camera if none found active.

virtual int UpdateLights(void) {return 0;};
Ask all lights to load themselves into rendering pipeline. This method will return the actual number of lights that were on.

void SetDisplayPoint(float, float, float)
void SetDisplayPoint(float *)
Returns the number of visible actors. Returns the number of visible volumes. Create and add a light to renderer. Set/get a point location in display (or screen) coordinates. The lower left corner of the window is the origin and y increases as you go up the screen.

void SetViewPoint(float, float, float)
void SetViewPoint(float *)
Specify a point location in view coordinates. The origin is in the middle of the viewport and it extends from -1 to 1 in all three dimensions.

void SetWorldPoint(float, float, float, float)
void SetWorldPoint(float *)
Specify a point location in world coordinates. This method takes homogeneous coordinates.

void SetViewport(float, float, float, float)
void SetViewport(float *)
Specify the viewport for the renderer to draw in the rendering window. Coordinates are expressed as (xmin,ymin,xmax,ymax), where each coordinate is 0 <= coordinate <= 1.0.

int GetTwoSidedLighting()
Turn on/off two-sided lighting of surfaces. If twosided lighting is off, then only the side of the surface facing the light(s) will be lit, and the other side dark. If two-sided lighting on, both sides of the surface will be lit.

vtkLightCollection *GetLights()
Get the list of lights for this renderer.

vtkActorCollection *GetActors()
Get the list of actors for this renderer.

vtkVolumeCollection *GetVolumes()
Get the list of volumes for this renderer.

void DisplayToWorld()
Convert display (or screen) coordinates to world coordinates.

void WorldToDisplay()
Convert world point coordinates to display (or screen) coordinates.

vtkRenderer()
Create a vtkRenderer with a black background, a white ambient light, two-sided lighting turned on, a viewport of (0,0,1,1), and backface culling turned off.

void SetActiveCamera(vtkCamera *cam)
Specify the camera to use for this renderer.

vtkCamera *GetActiveCamera()
Get the current camera.

void AddLight(vtkLight *light)
Add a light to the list of lights.

void AddActor(vtkActor *actor)
Add an actor to the list of actors.

void AddVolume(vtkVolume *volume)
Add a volume to the list of volumes.

void RemoveLight(vtkLight *light)
Remove a light from the list of lights.

void RemoveActor(vtkActor *actor)
Remove an actor from the list of actors.

void RemoveVolume(vtkVolume *volume)
Remove a volume from the list of volumes.

void ResetCamera()
Automatically set up the camera based on the visible actors. The camera will reposition itself to view the center point of the actors, and move along its initial view plane normal (i.e., vector defined from camera position to focal point) so that all of the actors can be seen.

void ResetCamera(float bounds[6])
Automatically set up the camera based on a specified bounding box (xmin,xmax, ymin,ymax, zmin,zmax). Camera will reposition itself so that its focal point is the center of the bounding box, and adjust its distance and position to preserve its initial view plane normal (i.e., vector defined from camera position to focal point). Note: is the view plane is parallel to the view up axis, the view up axis will be reset to one of the three coordinate axes.

void SetRenderWindow(vtkRenderWindow *renwin)
Specify the rendering window in which to draw. This is automatically set when the renderer is created by MakeRenderer. The user probably shouldn't ever need to
call this method.

float GetZ (int x, int y)
Given a pixel location, return the Z value

void DisplayToView()
Convert display coordinates to view coordinates.

void ViewToDisplay()
Convert view coordinates to display coordinates.

void ViewToWorld()
Convert view point coordinates to world coordinates.

void WorldToView()
Convert world point coordinates to view coordinates.

float *GetCenter()
Return the center of this renderer in display coordinates.

int IsInViewport(int x,int y)
Is a given display point in this renderer's viewport.

void SetStartRenderMethod(void (*f)(void *), void *arg) Specify a function to be called before rendering process begins. Function will be called with argument provided.

void SetStartRenderMethodArgDelete(void (*f)(void *))
Set the arg delete method. This is used to free user memory.

void SetEndRenderMethodArgDelete(void (*f)(void *))
Set the arg delete method. This is used to free user memory.

void SetEndRenderMethod(void (*f)(void *), void *arg)
Specify a function to be called when rendering process completes. Function will be called with argument provided.


Table of Contents