1 |
ksteube |
1147 |
""" |
2 |
|
|
@author: John NGUI |
3 |
|
|
""" |
4 |
|
|
|
5 |
|
|
import vtk |
6 |
|
|
|
7 |
|
|
class Arrow2D: |
8 |
|
|
""" |
9 |
|
|
Class that defines 2D arrows. |
10 |
|
|
""" |
11 |
|
|
|
12 |
|
|
def __init__(self): |
13 |
|
|
""" |
14 |
|
|
Initialise the 2D arrows. |
15 |
|
|
""" |
16 |
|
|
|
17 |
|
|
self.__vtk_arrow2D = vtk.vtkGlyphSource2D() |
18 |
|
|
self.__setupArrow2D() |
19 |
|
|
|
20 |
|
|
def __setupArrow2D(self): |
21 |
|
|
""" |
22 |
|
|
Setup the 2D arrows. |
23 |
|
|
""" |
24 |
|
|
|
25 |
|
|
# Use arrows instead of cone or sphere. |
26 |
|
|
self.__vtk_arrow2D.SetGlyphTypeToArrow() |
27 |
|
|
# Fill the inside of the arrows. |
28 |
|
|
self.__vtk_arrow2D.SetFilled(0) |
29 |
|
|
|
30 |
jongui |
1148 |
def _getArrow2DOutput(self): |
31 |
ksteube |
1147 |
""" |
32 |
|
|
Return the output of the 2D arrows. |
33 |
|
|
|
34 |
|
|
@rtype: vtkPolyData |
35 |
|
|
@return: Polygonal data |
36 |
|
|
""" |
37 |
|
|
|
38 |
|
|
return self.__vtk_arrow2D.GetOutput() |
39 |
|
|
|
40 |
|
|
|
41 |
|
|
############################################################################### |
42 |
|
|
|
43 |
|
|
|
44 |
|
|
class Arrow3D: |
45 |
|
|
""" |
46 |
|
|
Class that defines 3D arrows. |
47 |
|
|
""" |
48 |
|
|
|
49 |
|
|
def __init__(self): |
50 |
|
|
""" |
51 |
|
|
Initialise the 3D arrows. |
52 |
|
|
""" |
53 |
|
|
|
54 |
|
|
self.__vtk_arrow3D = vtk.vtkArrowSource() |
55 |
|
|
|
56 |
jongui |
1148 |
def _getArrow3DOutput(self): |
57 |
ksteube |
1147 |
""" |
58 |
|
|
Return the output of the 3D arrows. |
59 |
|
|
|
60 |
|
|
@rtype: vtkPolyData |
61 |
|
|
@return Polygonal data |
62 |
|
|
""" |
63 |
|
|
|
64 |
|
|
return self.__vtk_arrow3D.GetOutput() |
65 |
|
|
|