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

Diff of /trunk/pyvisi/py_src/common.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 20  __date__="$Date:$" Line 20  __date__="$Date:$"
20    
21  import vtk  import vtk
22    
23  class Mapper:  class Common:
24    
25      def __init__(self):      def __init__(self, open_scene, data_collector):
26          self.mapper = None          self.open_scene = open_scene
27            self.data_collector = data_collector
28            self.vtk_mapper = None
29            self.vtk_actor = None
30    
31      def setMapper(self, component):      def setMapper(self, component):
32          self.vtk_mapper = vtk.vtkDataSetMapper()          self.vtk_mapper = vtk.vtkDataSetMapper()
33          eval("self.vtk_mapper.SetInput(self.%s.GetOutput())" % component)          eval("self.vtk_mapper.SetInput(%s)" % component)
34    
35        def setActor(self):
36            self.vtk_actor = vtk.vtkActor()
37            self.vtk_actor.SetMapper(self.vtk_mapper)
38    
39        def addActor(self):
40            self.open_scene.getRenderer().AddActor(self.vtk_actor)
41    
42        def setOpacity(self, opacity):
43            self.getProperty().SetOpacity(opacity)
44    
45        def setColor(self, red, green, blue):
46            self.getProperty().SetColor(red, green, blue)
47    
48        def setRepresentation(self, representation):
49            eval("self.getProperty().SetRepresentationTo%s()" % representation)
50        
51        def getProperty(self):
52            return self.vtk_actor.GetProperty()
53    
54                    

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

  ViewVC Help
Powered by ViewVC 1.1.26