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

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

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

revision 943 by jongui, Mon Jan 29 07:22:43 2007 UTC revision 947 by jongui, Wed Jan 31 07:17:43 2007 UTC
# Line 9  class Clipper: Line 9  class Clipper:
9      Class that defines a clipper.      Class that defines a clipper.
10      """      """
11            
12      # plane by default is assigned to None because a plane is not required      def __init__(self, object, plane):
     # when a scalar value is used to perform the clipping.  
     def __init__(self, object, plane = None):  
13          """          """
14          Initialise the clipper.          Initialise the clipper.
15    
16          @type object: vtkUnstructuredGrid, etc          @type object: vtkUnstructuredGrid, etc
17          @param object: Input for the clipper          @param object: Input for the clipper
18          @type plane: vtkPlane          @type plane: vtkPlane
19          @param plane: Plane to clip the object          @param plane: Plane to clip the rendered object
20          """          """
21    
22          self.__object = object          self.__object = object
23          if(plane != None): # True only if a plane is used to perform clipping.          # True only if a plane is used to perform clipping. Will be false
24            # for scalar clipping.
25            if(plane != None):
26              self.__plane = plane              self.__plane = plane
27                            
28          self.__vtk_clipper = vtk.vtkClipDataSet()          self.__vtk_clipper = vtk.vtkClipDataSet()
29            self.__setupClipper()
30    
31        def __setupClipper(self):
32            """
33            Setup the clipper.
34            """
35    
36          self.__setInput()          self.__setInput()
         #self.__setClipFunction()  
         # Generates the clipped away section. At this stage, the clipped  
         # away section is not used.  
         #self.__vtk_clipper.GenerateClippedOutputOn()  
37          self.setInsideOutOn()          self.setInsideOutOn()
38          self.__vtk_clipper.Update()          self.__vtk_clipper.Update()
39    
# Line 44  class Clipper: Line 46  class Clipper:
46    
47      def _setClipFunction(self):      def _setClipFunction(self):
48          """          """
49          Set the clip function.          Set the clip function (using a plane).
50          """          """
51    
52          self.__vtk_clipper.SetClipFunction(self.__plane)          self.__vtk_clipper.SetClipFunction(self.__plane)

Legend:
Removed from v.943  
changed lines
  Added in v.947

  ViewVC Help
Powered by ViewVC 1.1.26