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

Diff of /trunk/pyvisi/py_src/contour.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 826 by gross, Fri Jul 28 10:37:16 2006 UTC revision 827 by jongui, Wed Aug 30 00:08:02 2006 UTC
# Line 18  __url__="http://www.iservo.edu.au/esys" Line 18  __url__="http://www.iservo.edu.au/esys"
18  __version__="$Revision:$"  __version__="$Revision:$"
19  __date__="$Date:$"  __date__="$Date:$"
20    
21  from common import Component  import vtk
22    
23  class Contour(Component):  class Contour:
24      """      
25      shows scalar data by contour surfaces      def __init__(self, open_scene, data_collector):
26      """          self.open_scene = open_scene
27      pass          self.data_collector = data_collector
28            self.vtk_contour = None
29            self.vtk_contour_mapper = None
30            self.vtk_contour_actor = None
31    
32            self.setContour()
33            self.setMapper()
34            self.setActor()
35    
36  class ContourOnPlane(Component):      # set up the contour and specify the number and range
37      """      def setContour(self):
38      shows scalar data by contour surfaces on a given plane          self.vtk_contour = vtk.vtkContourFilter()
39      """          self.vtk_contour.SetInput(self.data_collector.getReader().GetOutput())
40      pass          self.vtk_contour.GenerateValues(5, 0.0, 1.2)
41            
42        # set up the mapper and data    
43        def setMapper(self):
44            self.vtk_contour_mapper = vtk.vtkPolyDataMapper()
45            self.vtk_contour_mapper.SetInput(
46                self.vtk_contour.GetOutput())
47        
48        # set up the actor and add the actor to the scene
49        def setActor(self):
50            self.vtk_contour_actor = vtk.vtkActor()
51            self.vtk_contour_actor.SetMapper(self.vtk_contour_mapper)
52            self.vtk_contour_actor.GetProperty().SetOpacity(0.6)
53    
54            self.open_scene.getRenderer().AddActor(self.vtk_contour_actor)
55    
56    
57    #class ContourOnPlane(Component):
58    """
59    shows scalar data by contour surfaces on a given plane
60    """
61    pass

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

  ViewVC Help
Powered by ViewVC 1.1.26