1 |
ksteube |
1147 |
""" |
2 |
jongui |
1197 |
@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 |
ksteube |
1147 |
""" |
9 |
|
|
|
10 |
jongui |
1197 |
__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 |
ksteube |
1147 |
import vtk |
22 |
|
|
|
23 |
|
|
class Arrow2D: |
24 |
|
|
""" |
25 |
|
|
Class that defines 2D arrows. |
26 |
|
|
""" |
27 |
|
|
|
28 |
|
|
def __init__(self): |
29 |
|
|
""" |
30 |
|
|
Initialise the 2D arrows. |
31 |
|
|
""" |
32 |
|
|
|
33 |
|
|
self.__vtk_arrow2D = vtk.vtkGlyphSource2D() |
34 |
|
|
self.__setupArrow2D() |
35 |
|
|
|
36 |
|
|
def __setupArrow2D(self): |
37 |
|
|
""" |
38 |
|
|
Setup the 2D arrows. |
39 |
|
|
""" |
40 |
|
|
|
41 |
|
|
# Use arrows instead of cone or sphere. |
42 |
|
|
self.__vtk_arrow2D.SetGlyphTypeToArrow() |
43 |
|
|
# Fill the inside of the arrows. |
44 |
|
|
self.__vtk_arrow2D.SetFilled(0) |
45 |
|
|
|
46 |
jongui |
1148 |
def _getArrow2DOutput(self): |
47 |
ksteube |
1147 |
""" |
48 |
|
|
Return the output of the 2D arrows. |
49 |
|
|
|
50 |
|
|
@rtype: vtkPolyData |
51 |
|
|
@return: Polygonal data |
52 |
|
|
""" |
53 |
|
|
|
54 |
|
|
return self.__vtk_arrow2D.GetOutput() |
55 |
|
|
|
56 |
|
|
|
57 |
|
|
############################################################################### |
58 |
|
|
|
59 |
|
|
|
60 |
|
|
class Arrow3D: |
61 |
|
|
""" |
62 |
|
|
Class that defines 3D arrows. |
63 |
|
|
""" |
64 |
|
|
|
65 |
|
|
def __init__(self): |
66 |
|
|
""" |
67 |
|
|
Initialise the 3D arrows. |
68 |
|
|
""" |
69 |
|
|
|
70 |
|
|
self.__vtk_arrow3D = vtk.vtkArrowSource() |
71 |
|
|
|
72 |
jongui |
1148 |
def _getArrow3DOutput(self): |
73 |
ksteube |
1147 |
""" |
74 |
|
|
Return the output of the 3D arrows. |
75 |
|
|
|
76 |
|
|
@rtype: vtkPolyData |
77 |
|
|
@return Polygonal data |
78 |
|
|
""" |
79 |
|
|
|
80 |
|
|
return self.__vtk_arrow3D.GetOutput() |
81 |
|
|
|