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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 852 - (hide annotations)
Wed Sep 20 03:23:16 2006 UTC (14 years, 1 month ago) by jongui
File MIME type: text/x-python
File size: 1112 byte(s)
added carpet and isosurface


1 gross 792 """
2 jongui 852 class that represents scalar data as plane deformated along the plane normal
3     and proportional to the scalar value on the plane.
4 gross 792 """
5    
6 jongui 847 import vtk
7 jongui 852 from plane import Plane
8     from common import Common
9 gross 792
10 jongui 852 class Carpet(Common, Plane):
11     """
12     represents scalar data as plane deformated along the plane normal
13 jongui 847 and proportional to the scalar value on the plane.
14 jongui 852 """
15 jongui 847
16 jongui 852 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 jongui 847

  ViewVC Help
Powered by ViewVC 1.1.26