/[escript]/branches/windows_from_1456_trunk_merge_to_1459_trunk/pyvisi/py_src/cutter.py
ViewVC logotype

Annotation of /branches/windows_from_1456_trunk_merge_to_1459_trunk/pyvisi/py_src/cutter.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1147 - (hide annotations)
Wed May 16 06:39:11 2007 UTC (13 years, 11 months ago) by ksteube
Original Path: trunk/pyvisi/py_src/cutter.py
File MIME type: text/x-python
File size: 964 byte(s)
Added back in some files that were accidentally deleted.

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     def __init__(self, object, plane):
13     """
14     Initialise the cutter.
15    
16     @type object: vtkUnstructuredGrid, etc
17     @param object: Input for the cutter
18     @type plane: vtkPlane
19     @param plane: Plane to cut the object
20     """
21    
22     self.__object = object
23     self.__plane = plane
24     self.__vtk_cutter = vtk.vtkCutter()
25    
26     self.__setupCutter()
27    
28     def __setupCutter(self):
29     """
30     Setup the cutter.
31     """
32    
33     self.__setInput()
34     self.__setCutFunction()
35     self.__vtk_cutter.Update()
36    
37     def __setInput(self):
38     """
39     Set the input for the cutter.
40     """
41    
42     self.__vtk_cutter.SetInput(self.__object)
43    
44     def __setCutFunction(self):
45     """
46     Set the cut function (using a plane).
47     """
48    
49     self.__vtk_cutter.SetCutFunction(self.__plane)
50    
51     def _getOutput(self):
52     """
53     Return the output of the cutter.
54    
55     @rtype: vtkPolyData
56     @return: Polygonal data
57     """
58    
59     return self.__vtk_cutter.GetOutput()

  ViewVC Help
Powered by ViewVC 1.1.26