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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 852 - (show 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 """
2 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
7 from plane import Plane
8 from common import Common
9
10 class Carpet(Common, Plane):
11 """
12 represents scalar data as plane deformated along the plane normal
13 and proportional to the scalar value on the plane.
14 """
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

  ViewVC Help
Powered by ViewVC 1.1.26