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

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

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

revision 826 by jongui, Tue Aug 29 01:39:27 2006 UTC revision 827 by jongui, Wed Aug 30 00:08:02 2006 UTC
# Line 22  import vtk Line 22  import vtk
22    
23  class Map:  class Map:
24    
25      def __init__(self, scene, data_collector):      def __init__(self, open_scene, data_collector):
26          self.scene = scene          self.open_scene = open_scene
27          self.data_collector = data_collector          self.data_collector = data_collector
28          self.vtk_xml_mapper = None          self.vtk_xml_mapper = None
29          self.vtk_xml_actor = None          self.vtk_xml_actor = None
# Line 31  class Map: Line 31  class Map:
31          self.setMapper()          self.setMapper()
32          self.setActor()          self.setActor()
33    
34        # set up the mapper and data
35      def setMapper(self):      def setMapper(self):
36          self.vtk_xml_mapper = vtk.vtkDataSetMapper()          self.vtk_xml_mapper = vtk.vtkDataSetMapper()
37          self.vtk_xml_mapper.SetInput(          self.vtk_xml_mapper.SetInput(
38              self.data_collector.getReader().GetOutput())              self.data_collector.getReader().GetOutput())
39        
40        # set up the actor and add the actor to the scene
41      def setActor(self):      def setActor(self):
42          self.vtk_xml_actor = vtk.vtkActor()          self.vtk_xml_actor = vtk.vtkActor()
43          self.vtk_xml_actor.SetMapper(self.vtk_xml_mapper)          self.vtk_xml_actor.SetMapper(self.vtk_xml_mapper)
44            self.vtk_xml_actor.GetProperty().SetOpacity(0.2)
45    
46          self.scene.getRenderer().AddActor(self.vtk_xml_actor)          self.open_scene.getRenderer().AddActor(self.vtk_xml_actor)
47    
48            
49    

Legend:
Removed from v.826  
changed lines
  Added in v.827

  ViewVC Help
Powered by ViewVC 1.1.26