12 |
Class that deals with data for the visualization. |
Class that deals with data for the visualization. |
13 |
""" |
""" |
14 |
|
|
15 |
def __init__(self, scene, outline = True): |
def __init__(self, scene, outline = True, cube_axes = True): |
16 |
""" |
""" |
17 |
Initialize all the instance variables. |
Initialize all the instance variables. |
18 |
|
|
23 |
""" |
""" |
24 |
|
|
25 |
self.scene = scene |
self.scene = scene |
26 |
self.outline = True |
self.outline = outline |
27 |
|
self.cube_axes = cube_axes |
28 |
self.file_name = None |
self.file_name = None |
29 |
self.vtk_outline = None |
self.vtk_outline = None |
30 |
self.vtk_xml_reader = None |
self.vtk_xml_reader = None |
48 |
Common.setActor(self) |
Common.setActor(self) |
49 |
Common.addActor(self) |
Common.addActor(self) |
50 |
Common.setColor(self, 0, 0, 0) # Default outline is black |
Common.setColor(self, 0, 0, 0) # Default outline is black |
51 |
|
|
52 |
|
if(self.cube_axes == True): |
53 |
|
self.setCubeAxes() |
54 |
|
|
55 |
def getReader(self): |
def getReader(self): |
56 |
""" |
""" |
70 |
self.vtk_outline = vtk.vtkOutlineFilter() |
self.vtk_outline = vtk.vtkOutlineFilter() |
71 |
self.vtk_outline.SetInput(self.vtk_xml_reader.GetOutput()) |
self.vtk_outline.SetInput(self.vtk_xml_reader.GetOutput()) |
72 |
|
|
73 |
|
def setCubeAxes(self): |
74 |
|
vtk_cube_axes = vtk.vtkCubeAxesActor2D() |
75 |
|
vtk_cube_axes.SetInput(self.vtk_xml_reader.GetOutput()) |
76 |
|
vtk_cube_axes.SetCamera(self.scene.getRenderer().GetActiveCamera()) |
77 |
|
vtk_cube_axes.SetLabelFormat("%6.4g") |
78 |
|
vtk_cube_axes.SetFlyModeToClosestTriad() |
79 |
|
vtk_cube_axes.SetFontFactor(0.8) |
80 |
|
|
81 |
|
self.scene.getRenderer().AddActor(vtk_cube_axes) |
82 |
|
|
83 |
|
|
84 |
|
|
85 |
|
|
86 |
|
|