/[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 846 by jongui, Fri Sep 8 07:13:01 2006 UTC revision 847 by jongui, Thu Sep 14 07:54:04 2006 UTC
# Line 12  class DataCollector(Common): Line 12  class DataCollector(Common):
12      Class that deals with data for the visualization.      Class that deals with data for the visualization.
13      """      """
14    
15      def __init__(self, scene, outline = True):      def __init__(self, scene, outline = True, cube_axes = True):
16          """          """
17          Initialize all the instance variables.          Initialize all the instance variables.
18    
# Line 23  class DataCollector(Common): Line 23  class DataCollector(Common):
23          """          """
24    
25          self.scene = scene            self.scene = scene  
26          self.outline = True          self.outline = outline
27            self.cube_axes = cube_axes
28          self.file_name = None          self.file_name = None
29          self.vtk_outline = None          self.vtk_outline = None
30          self.vtk_xml_reader = None          self.vtk_xml_reader = None
# Line 47  class DataCollector(Common): Line 48  class DataCollector(Common):
48              Common.setActor(self)              Common.setActor(self)
49              Common.addActor(self)                Common.addActor(self)  
50              Common.setColor(self, 0, 0, 0) # Default outline is black              Common.setColor(self, 0, 0, 0) # Default outline is black
51    
52            if(self.cube_axes == True):
53                self.setCubeAxes()
54            
55      def getReader(self):      def getReader(self):
56          """          """
# Line 66  class DataCollector(Common): Line 70  class DataCollector(Common):
70          self.vtk_outline = vtk.vtkOutlineFilter()          self.vtk_outline = vtk.vtkOutlineFilter()
71          self.vtk_outline.SetInput(self.vtk_xml_reader.GetOutput())            self.vtk_outline.SetInput(self.vtk_xml_reader.GetOutput())  
72    
73        def setCubeAxes(self):
74            vtk_cube_axes = vtk.vtkCubeAxesActor2D()
75            vtk_cube_axes.SetInput(self.vtk_xml_reader.GetOutput())
76            vtk_cube_axes.SetCamera(self.scene.getRenderer().GetActiveCamera())
77            vtk_cube_axes.SetLabelFormat("%6.4g")
78            vtk_cube_axes.SetFlyModeToClosestTriad()
79            vtk_cube_axes.SetFontFactor(0.8)
80    
81            self.scene.getRenderer().AddActor(vtk_cube_axes)
82                
83    
84    
85    
86    

Legend:
Removed from v.846  
changed lines
  Added in v.847

  ViewVC Help
Powered by ViewVC 1.1.26