/[escript]/trunk/pyvisi/py_src/scene.py
ViewVC logotype

Contents of /trunk/pyvisi/py_src/scene.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 822 - (show annotations)
Tue Aug 29 01:39:27 2006 UTC (14 years, 2 months ago) by jongui
File MIME type: text/x-python
File size: 1555 byte(s)
Added:
trunk/pyvisi/py_src/driver.py

Modified:
trunk/pyvisi/py_src/datacollector.py
trunk/pyvisi/py_src/map.py
trunk/pyvisi/py_src/scene.py


1 """
2 defines a scene in which items are shown
3
4 @var __author__: name of author
5 @var __license__: licence agreement
6 @var __copyright__: copyrights
7 @var __url__: url entry point on documentation
8 @var __version__: version
9 @var __date__: date of the version
10 """
11
12 __copyright__=""" Copyright (c) 2006 by ACcESS MNRF
13 http://www.access.edu.au
14 Primary Business: Queensland, Australia"""
15 __license__="""Licensed under the Open Software License version 3.0
16 http://www.opensource.org/licenses/osl-3.0.php"""
17 __author__="Paul Cochrane, L. Gross"
18 __url__="http://www.iservo.edu.au/esys"
19 __version__="$Revision:$"
20 __date__="$Date:$"
21
22 import vtk
23
24 class OpenScene:
25 def __init__(self, renderer = "vtk-online", x_size = 800, y_size = 600):
26 self.renderer = renderer
27 self.x_size = x_size
28 self.y_size = y_size
29 self.vtk_renderer = None
30 self.vtk_render_window = None
31
32 self.setupRenderingWindow()
33
34 def setupRenderingWindow(self):
35 self.vtk_renderer = vtk.vtkRenderer()
36 self.vtk_render_window = vtk.vtkRenderWindow()
37 self.vtk_render_window.AddRenderer(self.vtk_renderer)
38 self.vtk_render_window.SetSize(self.x_size, self.y_size)
39 self.vtk_renderer.SetBackground(1, 1, 1)
40
41 def render(self):
42 vtk_render_window_interactor = vtk.vtkRenderWindowInteractor()
43 vtk_render_window_interactor.SetRenderWindow(self.vtk_render_window)
44 vtk_render_window_interactor.Initialize()
45 self.vtk_render_window.Render()
46 vtk_render_window_interactor.Start()
47
48 def getRenderer(self):
49 return self.vtk_renderer
50
51
52
53
54
55
56
57

  ViewVC Help
Powered by ViewVC 1.1.26