/[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 827 by jongui, Wed Aug 30 00:08:02 2006 UTC revision 828 by jongui, Wed Aug 30 07:52:35 2006 UTC
# Line 19  __version__="$Revision:$" Line 19  __version__="$Revision:$"
19  __date__="$Date:$"  __date__="$Date:$"
20    
21  import vtk  import vtk
22    from common import *
23    
24  class Map:  class Map(Common):
25    
26      def __init__(self, open_scene, data_collector):      def __init__(self, open_scene, data_collector):
27          self.open_scene = open_scene          Common.__init__(self, open_scene, data_collector)
28          self.data_collector = data_collector          #self.open_scene = open_scene
29          self.vtk_xml_mapper = None          #self.data_collector = data_collector
30          self.vtk_xml_actor = None          #self.vtk_xml_mapper = None
31            #self.vtk_xml_actor = None
32    
33            #self.setMapper()
34            #self.setActor()
35            Common.setMapper(self, "self.data_collector.getReader().GetOutput()")
36            Common.setActor(self)
37            Common.addActor(self)
38    
39          self.setMapper()  
40          self.setActor()          
41    
42      # set up the mapper and data      # set up the mapper and data
43      def setMapper(self):      #def setMapper(self):
44          self.vtk_xml_mapper = vtk.vtkDataSetMapper()          
45          self.vtk_xml_mapper.SetInput(          #self.vtk_xml_mapper = vtk.vtkDataSetMapper()
46              self.data_collector.getReader().GetOutput())          #self.vtk_xml_mapper.SetInput(
47            #   self.data_collector.getReader().GetOutput())
48    
49      # set up the actor and add the actor to the scene      # set up the actor and add the actor to the scene
50      def setActor(self):      #def setActor(self):
51          self.vtk_xml_actor = vtk.vtkActor()          #self.vtk_xml_actor = vtk.vtkActor()
52          self.vtk_xml_actor.SetMapper(self.vtk_xml_mapper)          #self.vtk_xml_actor.SetMapper(self.vtk_xml_mapper)
53          self.vtk_xml_actor.GetProperty().SetOpacity(0.2)          #self.vtk_xml_actor.GetProperty().SetOpacity(0.2)
54    
55          self.open_scene.getRenderer().AddActor(self.vtk_xml_actor)          #self.open_scene.getRenderer().AddActor(self.vtk_xml_actor)
56    
57            
58    

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

  ViewVC Help
Powered by ViewVC 1.1.26