/[escript]/branches/more_shared_ptrs_from_1812/pyvisi/py_src/sphere.py
ViewVC logotype

Contents of /branches/more_shared_ptrs_from_1812/pyvisi/py_src/sphere.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1813 - (show annotations)
Fri Sep 26 00:58:05 2008 UTC (10 years, 8 months ago) by jfenwick
File MIME type: text/x-python
File size: 1788 byte(s)
Branching to experiment with proxies and shared pointers.

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 Sphere:
37 """
38 Class that defines a sphere.
39 """
40
41 def __init__(self):
42 """
43 Initialise the sphere.
44 """
45
46 self.__vtk_sphere = vtk.vtkSphereSource()
47
48 def setThetaResolution(self, resolution):
49 """
50 Set the theta resolution of the sphere.
51
52 @type resolution: Number
53 @param resolution: Theta resolution
54 """
55
56 self.__vtk_sphere.SetThetaResolution(resolution)
57
58 def setPhiResolution(self, resolution):
59 """
60 Set the phi resolution of the sphere.
61
62 @type resolution: Number
63 @param resolution: Phi resolution
64 """
65
66 self.__vtk_sphere.SetPhiResolution(resolution)
67
68 def _getSphereOutput(self):
69 """
70 Return the output of the sphere.
71
72 @rtype: vtkPolyData
73 @return: Polygonal data
74 """
75
76 return self.__vtk_sphere.GetOutput()
77

  ViewVC Help
Powered by ViewVC 1.1.26