/[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 860 by jongui, Thu Sep 28 08:17:29 2006 UTC revision 879 by jongui, Wed Oct 25 03:56:34 2006 UTC
# Line 4  from common import Common Line 4  from common import Common
4    
5  class Carpet(Common, Plane):  class Carpet(Common, Plane):
6      """      """
7      Class that represents scalar data as plane deformated along the plane      Class that represents a scalar field as a plane deformated along the plane
8      normal and proportional to the scalar value on the plane.      normal and proportional to the scalar value on the plane.
9      """      """
10    
11      def __init__(self, scene, data_collector, transform, lut = None):      def __init__(self, scene, data_collector, transform, lut = None,
12            deform = None):
13          """          """
14          @type scene: L{Scene <scene.Scene>} object          @type scene: L{Scene <scene.Scene>} object
15          @param scene: Scene in which components are to be added to          @param scene: Scene in which components are to be added to
# Line 19  class Carpet(Common, Plane): Line 20  class Carpet(Common, Plane):
20          @type lut: L{BlueToRed <colormap.BlueToRed>} or          @type lut: L{BlueToRed <colormap.BlueToRed>} or
21              L{RedToBlue <colormap.RedToBlue>} object              L{RedToBlue <colormap.RedToBlue>} object
22          @param lut: Lookup table to be used by the mapper          @param lut: Lookup table to be used by the mapper
23            @type deform: String
24            @param deform: Mode the data is deformed. Either by I{Scalar}
25                or I{Vector}
26          """          """
27    
28          Common.__init__(self, scene, data_collector)          Common.__init__(self, scene, data_collector)
# Line 26  class Carpet(Common, Plane): Line 30  class Carpet(Common, Plane):
30          self.vtk_plane = vtk.vtkPlane()          self.vtk_plane = vtk.vtkPlane()
31          self.vtk_cutter = vtk.vtkCutter()          self.vtk_cutter = vtk.vtkCutter()
32          self.transform = transform.getTransform()          self.transform = transform.getTransform()
33          self.vtk_warp = vtk.vtkWarpScalar()          
34            if(deform == "Scalar"):
35                self.vtk_warp = vtk.vtkWarpScalar()
36            else:
37                self.vtk_warp = vtk.vtkWarpVector()
38                
39                    
40          Plane.setPlane(self)          Plane.setPlane(self)
41          Plane.setCutter(self, data_collector.getReader().GetOutput())            Plane.setCutter(self, data_collector.getReader().GetOutput())  
# Line 38  class Carpet(Common, Plane): Line 47  class Carpet(Common, Plane):
47    
48      def warpScalar(self):      def warpScalar(self):
49          """          """
50          Set up the war scalar and deform the plane with scalar data.          Set up the warp scalar and deform the plane with scalar data.
51          """          """
52    
53          self.vtk_warp.SetInput(self.vtk_cutter.GetOutput())          self.vtk_warp.SetInput(self.vtk_cutter.GetOutput())

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

  ViewVC Help
Powered by ViewVC 1.1.26