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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 848 by jongui, Fri Sep 8 07:13:01 2006 UTC revision 849 by jongui, Fri Sep 15 07:11:55 2006 UTC
# Line 4  Line 4 
4  """  """
5    
6  import vtk  import vtk
7    from constants import *
8    
9  class Scene:  class Scene:
10      """      """
# Line 23  class Scene: Line 24  class Scene:
24          @param y_size: Size of the rendering window on the y-axis          @param y_size: Size of the rendering window on the y-axis
25          """          """
26    
         self.renderer = renderer  
27          self.x_size = x_size          self.x_size = x_size
28          self.y_size = y_size          self.y_size = y_size
29          self.vtk_renderer = None          self.vtk_renderer = vtk.vtkRenderer()
30          self.vtk_render_window = None          self.vtk_render_window = vtk.vtkRenderWindow()
31    
32          if(renderer == "vtk_online"):          if(renderer == "vtk_online"):
33              self.setRenderingWindow()              self.setRenderWindow()
34    
35      def setRenderingWindow(self):      def setRenderWindow(self):
36          """          """
37          Set up the renderer and rendering window.          Set up the renderer and rendering window.
38          """          """
39    
         self.vtk_renderer = vtk.vtkRenderer()  
         self.vtk_render_window = vtk.vtkRenderWindow()  
40          self.vtk_render_window.AddRenderer(self.vtk_renderer)          self.vtk_render_window.AddRenderer(self.vtk_renderer)
41          self.vtk_render_window.SetSize(self.x_size, self.y_size)          self.vtk_render_window.SetSize(self.x_size, self.y_size)
42          self.vtk_renderer.SetBackground(1, 1, 1) # Default color is white          self.vtk_renderer.SetBackground(
43                WHITE[0], WHITE[1], WHITE[2])
44    
45      def render(self):      def render(self):
46          """          """
# Line 63  class Scene: Line 62  class Scene:
62          """          """
63    
64          return self.vtk_renderer          return self.vtk_renderer
           
           
   
   
       
   
   
   

Legend:
Removed from v.848  
changed lines
  Added in v.849

  ViewVC Help
Powered by ViewVC 1.1.26