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 Arrow2D: |
37 |
""" |
38 |
Class that defines 2D arrows. |
39 |
""" |
40 |
|
41 |
def __init__(self): |
42 |
""" |
43 |
Initialise the 2D arrows. |
44 |
""" |
45 |
|
46 |
self.__vtk_arrow2D = vtk.vtkGlyphSource2D() |
47 |
self.__setupArrow2D() |
48 |
|
49 |
def __setupArrow2D(self): |
50 |
""" |
51 |
Setup the 2D arrows. |
52 |
""" |
53 |
|
54 |
# Use arrows instead of cone or sphere. |
55 |
self.__vtk_arrow2D.SetGlyphTypeToArrow() |
56 |
# Fill the inside of the arrows. |
57 |
self.__vtk_arrow2D.SetFilled(0) |
58 |
|
59 |
def _getArrow2DOutput(self): |
60 |
""" |
61 |
Return the output of the 2D arrows. |
62 |
|
63 |
@rtype: vtkPolyData |
64 |
@return: Polygonal data |
65 |
""" |
66 |
|
67 |
return self.__vtk_arrow2D.GetOutput() |
68 |
|
69 |
|
70 |
############################################################################### |
71 |
|
72 |
|
73 |
class Arrow3D: |
74 |
""" |
75 |
Class that defines 3D arrows. |
76 |
""" |
77 |
|
78 |
def __init__(self): |
79 |
""" |
80 |
Initialise the 3D arrows. |
81 |
""" |
82 |
|
83 |
self.__vtk_arrow3D = vtk.vtkArrowSource() |
84 |
|
85 |
def _getArrow3DOutput(self): |
86 |
""" |
87 |
Return the output of the 3D arrows. |
88 |
|
89 |
@rtype: vtkPolyData |
90 |
@return Polygonal data |
91 |
""" |
92 |
|
93 |
return self.__vtk_arrow3D.GetOutput() |
94 |
|