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

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

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

revision 850 by gross, Sun Sep 17 23:27:00 2006 UTC revision 852 by jongui, Wed Sep 20 03:23:16 2006 UTC
# Line 1  Line 1 
1  """  """
2  class that represents scalar data as plane deformated along the plane normal and proportional to the scalar value on the plane.  class that represents scalar data as plane deformated along the plane normal
3    and proportional to the scalar value on the plane.
4  """  """
5    
6  import vtk  import vtk
7    from plane import Plane
8    from common import Common
9    
10  class Carpet(object):  class Carpet(Common, Plane):
11      """      """
12      represents scalar data as plane deformated along the plane normal      represents scalar data as plane deformated along the plane normal
13      and proportional to the scalar value on the plane.      and proportional to the scalar value on the plane.
14      """      """
     pass  
15    
16            def __init__(self, scene, data_collector, lut = None):
17            Common.__init__(self, scene, data_collector)
18            self.vtk_plane = vtk.vtkPlane()
19            self.vtk_cutter = vtk.vtkCutter()
20            self.vtk_transform = vtk.vtkTransform()
21            self.vtk_transform_filter = vtk.vtkTransformPolyDataFilter()
22            self.vtk_warp = vtk.vtkWarpScalar()
23            
24            Plane.setPlane(self)
25            Plane.setCutter(self, data_collector.getReader().GetOutput())  
26            self.warpScalar()
27            Plane.setTransformFilter(self, self.vtk_warp.GetOutput())  
28            
29            Common.setMapperInput(self, self.vtk_transform_filter.GetOutput(), lut)
30            Common.setActorInput(self)
31            Common.addActor(self)
32    
33        def warpScalar(self):
34            self.vtk_warp.SetInput(self.vtk_cutter.GetOutput())
35            self.vtk_warp.SetScaleFactor(0.5)
36                
37                                
38    
39    
40            
41            

Legend:
Removed from v.850  
changed lines
  Added in v.852

  ViewVC Help
Powered by ViewVC 1.1.26