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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1813 - (show annotations)
Fri Sep 26 00:58:05 2008 UTC (10 years, 7 months ago) by jfenwick
File MIME type: text/x-python
File size: 2550 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 CubeSource:
37 """
38 Class that defines a cube source. The center of the cube souce defines
39 the point from which the cube is to be generated and the X, Y
40 and Z lengths define the length of the cube from the center point. If
41 X length is 3, then the X length to the left and right of the center
42 point is 1.5 respectively.
43 """
44
45 def __init__(self):
46 """
47 Initialise the cube source.
48 """
49
50 self.__vtk_cube_source = vtk.vtkCubeSource()
51
52 def setCenter(self, center):
53 """
54 Set the cube source center.
55
56 @type center: L{GlobalPosition <position.GlobalPosition>} object
57 @param center: Cube source center
58 """
59
60 self.__vtk_cube_source.SetCenter(center._getGlobalPosition())
61
62 def setXLength(self, length):
63 """
64 Set the cube source length along the x-axis.
65
66 @type length: Number
67 @param length: Cube source length along the x-axis
68 """
69 self.__vtk_cube_source.SetXLength(length)
70
71 def setYLength(self, length):
72 """
73 Set the cube source length along the y-axis.
74
75 @type length: Number
76 @param length: Cube source length along the y-axis
77 """
78
79 self.__vtk_cube_source.SetYLength(length)
80
81 def setZLength(self, length):
82 """
83 Set the cube source length along the z-axis.
84
85 @type length: Number
86 @param length: Cube source length along the z-axis
87 """
88
89 self.__vtk_cube_source.SetZLength(length)
90
91 def _getCubeSourceOutput(self):
92 """
93 Return the output of the cube source
94
95 @rtype: vtkPolyData
96 @return: Polygonal data
97 """
98
99 return self.__vtk_cube_source.GetOutput()
100
101
102

  ViewVC Help
Powered by ViewVC 1.1.26