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

Contents of /trunk/pyvisi/py_src/rotation.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1809 - (show annotations)
Thu Sep 25 06:43:44 2008 UTC (11 years, 2 months ago) by ksteube
File MIME type: text/x-python
File size: 2366 byte(s)
Copyright updated in all python files

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 Rotation:
37 """
38 Class that sweeps 2D data around the z-axis to create a 3D looking effect.
39 """
40
41 def __init__(self):
42 """
43 Initialise the rotation.
44 """
45
46 self.__vtk_rotational_extrusion_filter = \
47 vtk.vtkRotationalExtrusionFilter()
48
49 def _setupRotationExtrusionFilter(self, object):
50 """
51 Setup the rotation.
52
53 @type object: vtkUnstructuredGrid, etc
54 @param object: Input for the clipper
55 """
56
57 self.__object = object
58 self.__setInput()
59
60 def __setInput(self):
61 """
62 Set the input for the rotation.
63 """
64
65 self.__vtk_rotational_extrusion_filter.SetInput(self.__object)
66 self.__vtk_rotational_extrusion_filter.Update()
67
68 def setResolution(self, resolution):
69 """
70 Set the resolution of the sweep for the rotation, which controls the
71 number of intermediate points
72
73 @type resolution: Number
74 @param resolution: Resolution of the rotation
75 """
76
77 self.__vtk_rotational_extrusion_filter.SetResolution(resolution)
78
79 def setAngle(self, angle):
80 """
81 Set the angle of rotation.
82
83 @type angle: Number
84 @param angle: Angle of rotation
85 """
86
87 self.__vtk_rotational_extrusion_filter.SetAngle(angle)
88
89 def _getRotationOutput(self):
90 """
91 Return the output of the rotation.
92
93 @rtype: vtkPolyData
94 @return: Polygonal data
95 """
96
97 return self.__vtk_rotational_extrusion_filter.GetOutput()
98

  ViewVC Help
Powered by ViewVC 1.1.26