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

Diff of /trunk/pyvisi/py_src/datacollector.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 21  __version__="$Revision:$" Line 21  __version__="$Revision:$"
21  __date__="$Date:$"  __date__="$Date:$"
22    
23  import vtk  import vtk
24    from common import *
25    
26  class DataCollector:  class DataCollector(Common):
27    
28      def __init__(self, open_scene, outline = True):      def __init__(self, open_scene, outline = True):
29          self.open_scene = open_scene              self.open_scene = open_scene    
30          self.outline = True          self.outline = True
31          self.file_name = None          self.file_name = None
32            self.vtk_outline = None
33          self.vtk_xml_reader = None          self.vtk_xml_reader = None
34          self.vtk_xml_reader_output = None          self.vtk_xml_reader_output = None
35    
   
36      # set up the file reader and set the file name      # set up the file reader and set the file name
37      def setSource(self, file_name):      def setSource(self, file_name):
38          self.file_name = file_name          self.file_name = file_name
# Line 39  class DataCollector: Line 40  class DataCollector:
40          self.vtk_xml_reader.SetFileName(self.file_name)          self.vtk_xml_reader.SetFileName(self.file_name)
41    
42          if(self.outline == True):          if(self.outline == True):
43              self.setOutlineFilter()              self.setOutline()
44                Common.setMapper(self, "self.vtk_outline.GetOutput()")
45                Common.setActor(self)
46                Common.addActor(self)  
47                Common.setColor(self, 0, 0, 0)
48                
49                
50            
51      # return the file reader output      # return the file reader output
52      def getReader(self):      def getReader(self):
53          return self.vtk_xml_reader          return self.vtk_xml_reader
54    
55      # set the outline      # set the outline
56      def setOutlineFilter(self):      def setOutline(self):
57          vtk_outline = vtk.vtkOutlineFilter()          self.vtk_outline = vtk.vtkOutlineFilter()
58          vtk_outline.SetInput(self.vtk_xml_reader.GetOutput())            self.vtk_outline.SetInput(self.vtk_xml_reader.GetOutput())  
59                    
60          vtk_outline_mapper = vtk.vtkPolyDataMapper()          #vtk_outline_mapper = vtk.vtkPolyDataMapper()
61          vtk_outline_mapper.SetInput(vtk_outline.GetOutput())          #vtk_outline_mapper.SetInput(vtk_outline.GetOutput())
62                    
63          vtk_outline_actor = vtk.vtkActor()          #vtk_outline_actor = vtk.vtkActor()
64          vtk_outline_actor.SetMapper(vtk_outline_mapper)          #vtk_outline_actor.SetMapper(vtk_outline_mapper)
65          vtk_outline_actor.GetProperty().SetColor(0, 0, 0)            #vtk_outline_actor.GetProperty().SetColor(0, 0, 0)  
66    
67          self.open_scene.getRenderer().AddActor(vtk_outline_actor)            #self.open_scene.getRenderer().AddActor(vtk_outline_actor)  
68            
69    
70                    

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

  ViewVC Help
Powered by ViewVC 1.1.26