Package esys :: Package pyvisi :: Module scene :: Class Scene
[hide private]
[frames] | no frames]

Class Scene

Class that defines a scene. A scene is a window in which objects are to be rendered on. Only one scene needs to be created. However, a scene may be divided into four smaller windows called viewports (if needed). Each viewport can render a different object.


Attention: If the IV or VRML renderer type is used, then only one viewport can be used (four viewports are not supported for these two cases).

Instance Methods [hide private]
 
__addRenderer(self)
Add the renderer(s) to the render window.
 
__animate(self)
Animate the rendered object on-the-fly.
 
__createViewport(self)
Create the viewport(s) in the scene.
vtkImageWriter or vtkExporter
__getImageWriter(self)
Return the appropriate image writer or exporter based on the specified renderer.
 
__init__(self, renderer='online', num_viewport=1, x_size=1152, y_size=864)
Initialise the scene.
 
__saveImage(self, image_name)
Save the rendered object as an image, vrml or open inventor file.
 
__setSize(self, x_size, y_size)
Set the size of the render window.
 
__setupOfflineRendering(self)
Enables the offline rendering (no window comes up).
 
__setupOnlineRendering(self)
Setup the window interactor for online rendering.
 
__setupScene(self)
Setup the scene.
 
__setupWindowToImage(self)
Setup the window to image filter to convert the output from the render window into an image, vrml or open inventor file.
 
_addActor2D(self, viewport, actor)
Add the actor2D to the appropriate viewport.
 
_addActor3D(self, viewport, actor)
Add the actor3D to the appropriate viewport.
 
_addLight(self, viewport, light)
Add the light to the appropriate viewport.
 
_addVisualizationModules(self, module)
Store visualization modules (i.e.
List
_getRenderer(self)
Return the renderer(s)
 
_setActiveCamera(self, viewport, camera)
Set the camera to the appropriate viewport.
 
render(self, image_name=None)
Render the object using either the online, offline or display mode.
 
setBackground(self, color)
Set the background color of the scene.
 
setTitleBar(self, text)
Set the text on the title bar of the render window.
Method Details [hide private]

__getImageWriter(self)

 

Return the appropriate image writer or exporter based on the specified renderer.

Returns: vtkImageWriter or vtkExporter
Image writer or exporter

__init__(self, renderer='online', num_viewport=1, x_size=1152, y_size=864)
(Constructor)

 

Initialise the scene.

Parameters:
  • renderer (Renderer constant) - Type of renderer
  • num_viewport (Number) - Number of viewport(s) in the scene. Either 1 or 4
  • x_size (Number) - Size of the render window along the x-axis
  • y_size (Number) - Size of the render window along the y-axis

__saveImage(self, image_name)

 

Save the rendered object as an image, vrml or open inventor file.

Parameters:
  • image_name (String) - Name of the saved image, vrml or open inventor file

__setSize(self, x_size, y_size)

 

Set the size of the render window.

Parameters:
  • x_size (Number) - Size of the render window along the x-axis
  • y_size (Number) - Size of the render window along the y-axis

_addActor2D(self, viewport, actor)

 

Add the actor2D to the appropriate viewport.

Parameters:
  • viewport (Viewport constant) - Viewport in which the actor2D is to be added to
  • actor (vtkActor2D) - Actor2D which is to be added to the viewport

_addActor3D(self, viewport, actor)

 

Add the actor3D to the appropriate viewport.

Parameters:
  • viewport (Viewport constant) - Viewport in which the actor3D is to be added to
  • actor (vtkActor) - Actor3D which is to be added to the viewport

_addLight(self, viewport, light)

 

Add the light to the appropriate viewport.

Parameters:
  • viewport (Viewport constant) - Viewport in which the camera is to be added to
  • light (vtkLight) - Light which is to be assigned to the viewport

_addVisualizationModules(self, module)

 

Store visualization modules (i.e. Map, Velocity, Ellipsoid, etc) which needs to be rendered.

Parameters:
  • module (Visualization modules) - Visualization modules to be rendered

_getRenderer(self)

 

Return the renderer(s)

Returns: List
A list of renderer(s)

_setActiveCamera(self, viewport, camera)

 

Set the camera to the appropriate viewport.

Parameters:
  • viewport (Viewport constant) - Viewport in which the camera is to be added to
  • camera (vtkCamera) - Camera which is to be assigned to the viewport

render(self, image_name=None)

 

Render the object using either the online, offline or display mode.

Parameters:
  • image_name (String) - Name of the saved image, vrml or open inventor file

setBackground(self, color)

 

Set the background color of the scene.

Parameters:
  • color (Color constant) - Scene background color

setTitleBar(self, text)

 

Set the text on the title bar of the render window.

Parameters:
  • text (String) - Text on the title bar