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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1384 - (show annotations)
Fri Jan 11 02:29:38 2008 UTC (13 years, 3 months ago) by phornby
Original Path: temp_trunk_copy/pyvisi/py_src/tube.py
File MIME type: text/x-python
File size: 2228 byte(s)
Make a temp copy of the trunk before checking in the windows changes


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 Tube:
24 """
25 Class that defines the tube wrapped around the streamlines.
26 """
27
28 def __init__(self):
29 """
30 Initialise the tube.
31 """
32
33 self.__vtk_tube = vtk.vtkTubeFilter()
34
35 def _setupTube(self, object):
36 """
37 Setup the tube.
38
39 @type object: vtkPolyData, etc
40 @param object: Input for the tube
41 """
42
43 self.__object = object
44
45 self.__setInput()
46 # Default radius of the tube is 0.02.
47 self.setTubeRadius(0.02)
48 # Default number of sides for the tube is 12.
49 self.setTubeNumberOfSides(12)
50 self.setTubeRadiusToVaryByVector()
51
52 def __setInput(self):
53 """
54 Set the input for the tube.
55 """
56
57 self.__vtk_tube.SetInput(self.__object)
58
59 def setTubeRadius(self, radius):
60 """
61 Set the radius of the tube.
62
63 @type radius: Number
64 @param radius: Radius of the tube
65 """
66
67 self.__vtk_tube.SetRadius(radius)
68
69 def setTubeNumberOfSides(self, sides):
70 """
71 Set the number of sides for the tube. Minimum number of sides is 3.
72 The larger the number of sides, the higher the quality.
73
74 @type sides: Number
75 @param sides: Number of sides for the tube
76 """
77
78 self.__vtk_tube.SetNumberOfSides(sides)
79
80 def setTubeRadiusToVaryByVector(self):
81 """
82 Set the radius to vary by vector data.
83 """
84
85 self.__vtk_tube.SetVaryRadiusToVaryRadiusByVector()
86
87 def setTubeRadiusToVaryByScalar(self):
88 """
89 Set the radius to vary by scalar data.
90 """
91
92 self.__vtk_tube.SetVaryRadiusToVaryRadiusByScalar()
93
94 def _getTubeOutput(self):
95 """
96 Return the output of the tube.
97
98 @rtype: vtkPolyData
99 @return: Polygonal data
100 """
101
102 return self.__vtk_tube.GetOutput()

  ViewVC Help
Powered by ViewVC 1.1.26