/[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 1002 by jongui, Wed Feb 28 06:51:33 2007 UTC revision 1004 by jongui, Thu Mar 1 04:57:31 2007 UTC
# Line 16  class Scene: Line 16  class Scene:
16          Initialise the scene.          Initialise the scene.
17    
18          @type renderer: String          @type renderer: String
19          @param renderer: Type of rendering (i.e.Renderer.ONLINE, etc)          @param renderer: Type of renderer (i.e.Renderer.ONLINE, etc)
20          @type num_viewport: Number          @type num_viewport: Number
21          @param num_viewport: Number of viewport(s) in the scene. Either 1 or 4          @param num_viewport: Number of viewport(s) in the scene. Either 1 or 4
22          @type x_size: Number          @type x_size: Number
# Line 51  class Scene: Line 51  class Scene:
51          else: # True for offline rendering.          else: # True for offline rendering.
52              self.__setupOfflineRendering()              self.__setupOfflineRendering()
53    
   
54      def __createViewport(self):      def __createViewport(self):
55          """          """
56          Create the viewport(s) in the scene.          Create the viewport(s) in the scene.
# Line 133  class Scene: Line 132  class Scene:
132          """          """
133    
134          # Associate the window interactor with the render window.          # Associate the window interactor with the render window.
135          self.__vtk_render_window_interactor = vtk.vtkRenderWindowInteractor(                    )          self.__vtk_render_window_interactor = vtk.vtkRenderWindowInteractor()
136          self.__vtk_render_window_interactor.SetRenderWindow(          self.__vtk_render_window_interactor.SetRenderWindow(
137                  self.__vtk_render_window)                  self.__vtk_render_window)
138          self.__vtk_render_window_interactor.Initialize()          self.__vtk_render_window_interactor.Initialize()
# Line 194  class Scene: Line 193  class Scene:
193              self.__vtk_image_writer.SetFileName(image_name)              self.__vtk_image_writer.SetFileName(image_name)
194              self.__vtk_image_writer.Write()                  self.__vtk_image_writer.Write()    
195          except AttributeError:          except AttributeError:
196              print "Sorry, incorrect use of the '" + self.__renderer + "' renderer. Kindly, switch to the 'offline'  renderer."              print "ERROR: Incorrect use of the '" + self.__renderer + \
197                        "' renderer. Kindly, use the 'offline' renderer instead."
198    
199      def animate(self):      def animate(self):
200          """          """
201          Render the object onto the scene on-the-fly. No interaction can occur.          Animate the object onto the scene on-the-fly. No interaction can occur.
202          """          """
203    
204          self.__vtk_render_window.Render()          self.__vtk_render_window.Render()
# Line 216  class Scene: Line 215  class Scene:
215              # any subsequent codes thereafter.              # any subsequent codes thereafter.
216              self.__vtk_render_window_interactor.Start()              self.__vtk_render_window_interactor.Start()
217          except AttributeError:          except AttributeError:
218              print "Sorry, incorrect use of the '" + self.__renderer + "' renderer. Kindly, switch to the 'online'  renderer."              print "ERROR: Incorrect use of the '" + self.__renderer + \
219                        "' renderer. Kindly, switch to the 'online'  renderer."
220            
221      def _addActor3D(self, viewport, actor):      def _addActor3D(self, viewport, actor):
222          """          """

Legend:
Removed from v.1002  
changed lines
  Added in v.1004

  ViewVC Help
Powered by ViewVC 1.1.26