1 |
""" |
2 |
@var __author__: name of author |
3 |
@var __copyright__: copyrights |
4 |
@var __license__: licence agreement |
5 |
@var __url__: url entry point on documentation |
6 |
@var __version__: version |
7 |
@var __date__: date of the version |
8 |
""" |
9 |
|
10 |
__author__="John Ngui, john.ngui@uq.edu.au" |
11 |
__copyright__=""" Copyright (c) 2006 by ACcESS MNRF |
12 |
http://www.access.edu.au |
13 |
Primary Business: Queensland, Australia""" |
14 |
__license__="""Licensed under the Open Software License version 3.0 |
15 |
http://www.opensource.org/licenses/osl-3.0.php""" |
16 |
__url__="http://www.iservo.edu.au/esys" |
17 |
__version__="$Revision$" |
18 |
__date__="$Date$" |
19 |
|
20 |
|
21 |
import vtk |
22 |
|
23 |
class Cutter: |
24 |
""" |
25 |
Class that defines a cutter. |
26 |
""" |
27 |
|
28 |
def __init__(self): |
29 |
""" |
30 |
Initialise the cutter. |
31 |
""" |
32 |
|
33 |
self.__vtk_cutter = vtk.vtkCutter() |
34 |
|
35 |
def _setupCutter(self, object, plane): |
36 |
""" |
37 |
Setup the cutter. |
38 |
|
39 |
@type object: vtkUnstructuredGrid, etc |
40 |
@param object: Input for the cutter |
41 |
@type plane: vtkPlane |
42 |
@param plane: Plane to cut the object |
43 |
""" |
44 |
|
45 |
self.__object = object |
46 |
self.__plane = plane |
47 |
|
48 |
self.__setInput() |
49 |
self.__setCutFunction() |
50 |
|
51 |
def __setInput(self): |
52 |
""" |
53 |
Set the input for the cutter. |
54 |
""" |
55 |
|
56 |
self.__vtk_cutter.SetInput(self.__object) |
57 |
|
58 |
def __setCutFunction(self): |
59 |
""" |
60 |
Set the cut function (using a plane). |
61 |
""" |
62 |
|
63 |
self.__vtk_cutter.SetCutFunction(self.__plane) |
64 |
|
65 |
def _getCutterOutput(self): |
66 |
""" |
67 |
Return the output of the cutter. |
68 |
|
69 |
@rtype: vtkPolyData |
70 |
@return: Polygonal data |
71 |
""" |
72 |
|
73 |
return self.__vtk_cutter.GetOutput() |