/[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 792 by gross, Fri Jul 28 10:37:16 2006 UTC revision 860 by jongui, Thu Sep 28 08:17:29 2006 UTC
# Line 1  Line 1 
1  """  import vtk
2  class that represents scalar data as plane deformated along the plane normal and proportional to the scalar value on the plane.  from plane import Plane
3    from common import Common
4    
5  @var __author__: name of author  class Carpet(Common, Plane):
6  @var __license__: licence agreement      """
7  @var __copyright__: copyrights      Class that represents scalar data as plane deformated along the plane
8  @var __url__: url entry point on documentation      normal and proportional to the scalar value on the plane.
9  @var __version__: version      """
10  @var __date__: date of the version  
11  """      def __init__(self, scene, data_collector, transform, lut = None):
12  __copyright__="""  Copyright (c) 2006 by ACcESS MNRF          """
13                      http://www.access.edu.au          @type scene: L{Scene <scene.Scene>} object
14                  Primary Business: Queensland, Australia"""          @param scene: Scene in which components are to be added to
15  __license__="""Licensed under the Open Software License version 3.0          @type data_collector: L{DataCollector <datacollector.DataCollector>}
16               http://www.opensource.org/licenses/osl-3.0.php"""              object
17  __author__="Paul Cochrane, L. Gross"          @type transform: L{Transform <geo.Transform>} object
18  __url__="http://www.iservo.edu.au/esys"          @param transform: Orientation of the plane
19  __version__="$Revision:$"          @type lut: L{BlueToRed <colormap.BlueToRed>} or
20  __date__="$Date:$"              L{RedToBlue <colormap.RedToBlue>} object
21            @param lut: Lookup table to be used by the mapper
22  from common import Component          """
23    
24  class Carpet(Component):          Common.__init__(self, scene, data_collector)
25      """          # Declared because needed by the setPlane method.
26      represents scalar data as plane deformated along the plane normal and proportional to the scalar value on the plane.          self.vtk_plane = vtk.vtkPlane()
27      """          self.vtk_cutter = vtk.vtkCutter()
28      pass          self.transform = transform.getTransform()
29            self.vtk_warp = vtk.vtkWarpScalar()
30            
31            Plane.setPlane(self)
32            Plane.setCutter(self, data_collector.getReader().GetOutput())  
33            self.warpScalar()
34            
35            Common.setMapperInput(self, self.vtk_warp.GetOutput(), lut)
36            Common.setActorInput(self)
37            Common.addActor(self)
38    
39        def warpScalar(self):
40            """
41            Set up the war scalar and deform the plane with scalar data.
42            """
43    
44            self.vtk_warp.SetInput(self.vtk_cutter.GetOutput())
45    
46        def setScaleFactor(self, scale_factor):
47            """
48            Set the displacement scale factor.
49            @type scale_factor: Number
50            @param scale_factor: Size of the displacement
51            """
52    
53            self.vtk_warp.SetScaleFactor(scale_factor)

Legend:
Removed from v.792  
changed lines
  Added in v.860

  ViewVC Help
Powered by ViewVC 1.1.26