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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1148 - (hide annotations)
Wed May 16 22:45:33 2007 UTC (13 years, 11 months ago) by jongui
File MIME type: text/x-python
File size: 916 byte(s)
Added the updated files for pyvisi and removed some incorrect reference images.
1 ksteube 1147 """
2     @author: John NGUI
3     """
4    
5     import vtk
6    
7     class Cutter:
8     """
9     Class that defines a cutter.
10     """
11    
12 jongui 1148 def __init__(self):
13 ksteube 1147 """
14     Initialise the cutter.
15 jongui 1148 """
16 ksteube 1147
17 jongui 1148 self.__vtk_cutter = vtk.vtkCutter()
18    
19     def _setupCutter(self, object, plane):
20     """
21     Setup the cutter.
22    
23 ksteube 1147 @type object: vtkUnstructuredGrid, etc
24     @param object: Input for the cutter
25     @type plane: vtkPlane
26     @param plane: Plane to cut the object
27     """
28    
29     self.__object = object
30     self.__plane = plane
31    
32     self.__setInput()
33     self.__setCutFunction()
34    
35     def __setInput(self):
36     """
37     Set the input for the cutter.
38     """
39    
40     self.__vtk_cutter.SetInput(self.__object)
41    
42     def __setCutFunction(self):
43     """
44     Set the cut function (using a plane).
45     """
46    
47     self.__vtk_cutter.SetCutFunction(self.__plane)
48    
49 jongui 1148 def _getCutterOutput(self):
50 ksteube 1147 """
51     Return the output of the cutter.
52    
53     @rtype: vtkPolyData
54     @return: Polygonal data
55     """
56    
57     return self.__vtk_cutter.GetOutput()

  ViewVC Help
Powered by ViewVC 1.1.26