/[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 792 by gross, Fri Jul 28 10:37:16 2006 UTC revision 827 by jongui, Wed Aug 30 00:08:02 2006 UTC
# Line 20  __url__="http://www.iservo.edu.au/esys" Line 20  __url__="http://www.iservo.edu.au/esys"
20  __version__="$Revision:$"  __version__="$Revision:$"
21  __date__="$Date:$"  __date__="$Date:$"
22    
23  from common import PyvisiObject  import vtk
24    
25    class DataCollector:
26    
27        def __init__(self, open_scene, outline = True):
28            self.open_scene = open_scene    
29            self.outline = True
30            self.file_name = None
31            self.vtk_xml_reader = None
32            self.vtk_xml_reader_output = None
33    
34    
35        # set up the file reader and set the file name
36        def setSource(self, file_name):
37            self.file_name = file_name
38            self.vtk_xml_reader = vtk.vtkXMLUnstructuredGridReader()
39            self.vtk_xml_reader.SetFileName(self.file_name)
40    
41            if(self.outline == True):
42                self.setOutlineFilter()
43        
44        # return the file reader output
45        def getReader(self):
46            return self.vtk_xml_reader
47    
48        # set the outline
49        def setOutlineFilter(self):
50            vtk_outline = vtk.vtkOutlineFilter()
51            vtk_outline.SetInput(self.vtk_xml_reader.GetOutput())  
52            
53            vtk_outline_mapper = vtk.vtkPolyDataMapper()
54            vtk_outline_mapper.SetInput(vtk_outline.GetOutput())
55            
56            vtk_outline_actor = vtk.vtkActor()
57            vtk_outline_actor.SetMapper(vtk_outline_mapper)
58            vtk_outline_actor.GetProperty().SetColor(0, 0, 0)  
59    
60            self.open_scene.getRenderer().AddActor(vtk_outline_actor)  
61        
62    
63            
64            
65                            
66    
 class DataCollector(PyvisiObject):  
     """  
     a collector for data, typically read from file or from an escript object  
     """  
     pass  
67    

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

  ViewVC Help
Powered by ViewVC 1.1.26