/[escript]/tags/trunk_2172_checkpoint/pyvisi/py_src/cutter.py
ViewVC logotype

Contents of /tags/trunk_2172_checkpoint/pyvisi/py_src/cutter.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2175 - (show annotations)
Wed Dec 17 09:22:40 2008 UTC (12 years, 2 months ago) by phornby
File MIME type: text/x-python
File size: 1915 byte(s)
Try again at conforming to naming convention.
1
2 ########################################################
3 #
4 # Copyright (c) 2003-2008 by University of Queensland
5 # Earth Systems Science Computational Center (ESSCC)
6 # http://www.uq.edu.au/esscc
7 #
8 # Primary Business: Queensland, Australia
9 # Licensed under the Open Software License version 3.0
10 # http://www.opensource.org/licenses/osl-3.0.php
11 #
12 ########################################################
13
14 __copyright__="""Copyright (c) 2003-2008 by University of Queensland
15 Earth Systems Science Computational Center (ESSCC)
16 http://www.uq.edu.au/esscc
17 Primary Business: Queensland, Australia"""
18 __license__="""Licensed under the Open Software License version 3.0
19 http://www.opensource.org/licenses/osl-3.0.php"""
20 __url__="http://www.uq.edu.au/esscc/escript-finley"
21
22 """
23 @var __author__: name of author
24 @var __copyright__: copyrights
25 @var __license__: licence agreement
26 @var __url__: url entry point on documentation
27 @var __version__: version
28 @var __date__: date of the version
29 """
30
31 __author__="John Ngui, john.ngui@uq.edu.au"
32
33
34 import vtk
35
36 class Cutter:
37 """
38 Class that defines a cutter.
39 """
40
41 def __init__(self):
42 """
43 Initialise the cutter.
44 """
45
46 self.__vtk_cutter = vtk.vtkCutter()
47
48 def _setupCutter(self, object, plane):
49 """
50 Setup the cutter.
51
52 @type object: vtkUnstructuredGrid, etc
53 @param object: Input for the cutter
54 @type plane: vtkPlane
55 @param plane: Plane to cut the object
56 """
57
58 self.__object = object
59 self.__plane = plane
60
61 self.__setInput()
62 self.__setCutFunction()
63
64 def __setInput(self):
65 """
66 Set the input for the cutter.
67 """
68
69 self.__vtk_cutter.SetInput(self.__object)
70
71 def __setCutFunction(self):
72 """
73 Set the cut function (using a plane).
74 """
75
76 self.__vtk_cutter.SetCutFunction(self.__plane)
77
78 def _getCutterOutput(self):
79 """
80 Return the output of the cutter.
81
82 @rtype: vtkPolyData
83 @return: Polygonal data
84 """
85
86 return self.__vtk_cutter.GetOutput()

  ViewVC Help
Powered by ViewVC 1.1.26