/[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 1198 by jongui, Mon Jun 18 02:08:34 2007 UTC revision 1199 by jongui, Wed Jun 20 05:01:30 2007 UTC
# Line 27  class Scene: Line 27  class Scene:
27      be rendered on. Only one scene needs to be created. However, a scene may      be rendered on. Only one scene needs to be created. However, a scene may
28      be divided into four smaller windows called viewports (if needed).      be divided into four smaller windows called viewports (if needed).
29      Each viewport can render a different object.        Each viewport can render a different object.  
30    
31        @attention: If the IV or VRML renderer type is used, then only one
32        viewport can be used (four viewports are not supported for these two
33        cases).
34      """      """
35    
36      def __init__(self, renderer = Renderer.ONLINE, num_viewport = 1,      def __init__(self, renderer = Renderer.ONLINE, num_viewport = 1,
# Line 187  class Scene: Line 191  class Scene:
191      def __setupWindowToImage(self):      def __setupWindowToImage(self):
192          """          """
193          Setup the window to image filter to convert the output from the render          Setup the window to image filter to convert the output from the render
194          window into an image.          window into an image, vrml or open inventor file.
195          """          """
196    
197          self.__vtk_window_to_image = vtk.vtkWindowToImageFilter()          self.__vtk_window_to_image = vtk.vtkWindowToImageFilter()
# Line 222  class Scene: Line 226  class Scene:
226            
227      def __saveImage(self, image_name):      def __saveImage(self, image_name):
228          """          """
229          Save the rendered object as an image.          Save the rendered object as an image, vrml or open inventor file.
230    
231          @type image_name: String          @type image_name: String
232          @param image_name: Name of the saved image.          @param image_name: Name of the saved image, vrml or open inventor file
233          """          """
234    
235          # NOTE: Render and Modified must be called everytime before writing          # NOTE: Render and Modified must be called everytime before writing
236          # an image. Otherwise, only the first image will always be saved.          # an image, vrml or open inventor file. Otherwise, only the first
237          # This is due to the architecture of VTK.          # object will always be saved. This is due to the architecture of VTK.
238          self.__vtk_render_window.Render()          self.__vtk_render_window.Render()
239          self.__vtk_window_to_image.Modified()          self.__vtk_window_to_image.Modified()
240                    
241          # Retrieve the rendered object from the window and convert it into an          # Retrieve the rendered object from the window and convert it into an
242          # image.          # image, vrml or open inventor file.
243          # True for all writers besides VRML.          # True for all writers besides VRML.
244          if(not(self.__renderer.endswith(self.__VRML)) and \          if(not(self.__renderer.endswith(self.__VRML)) and \
245                  not(self.__renderer.endswith(self.__IV))):                  not(self.__renderer.endswith(self.__IV))):
# Line 263  class Scene: Line 267  class Scene:
267          Render the object using either the online, offline or display mode.          Render the object using either the online, offline or display mode.
268    
269          @type image_name: String          @type image_name: String
270          @param image_name: Name of the saved image.          @param image_name: Name of the saved image, vrml or open inventor file
271          """          """
272    
273          for i in range(0, len(self.__visualization_modules)):          for i in range(0, len(self.__visualization_modules)):
# Line 349  class Scene: Line 353  class Scene:
353          Store visualization modules (i.e. Map, Velocity, Ellipsoid, etc)          Store visualization modules (i.e. Map, Velocity, Ellipsoid, etc)
354          which needs to be rendered.          which needs to be rendered.
355                    
356          @type module: Visualization object          @type module: Visualization modules
357          @param module: Visualization object to be rendered          @param module: Visualization modules to be rendered
358          """          """
359    
360          self.__visualization_modules.append(module)          self.__visualization_modules.append(module)

Legend:
Removed from v.1198  
changed lines
  Added in v.1199

  ViewVC Help
Powered by ViewVC 1.1.26