-
Notifications
You must be signed in to change notification settings - Fork 0
/
Axes.py
23 lines (21 loc) · 833 Bytes
/
Axes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import vtk
from Rendered_Object import *
class Axes(Rendered_Object):
name = "Axes"
def __init__(self,data_reader,renderer):
# Create a text property for cube axes
self.tprop=vtk.vtkTextProperty()
self.tprop.SetColor(1,1,1)
self.tprop.ShadowOn()
# Create a vtkCubeAxesActor2D. Use the closest vertex to the camera to
# determine where to draw the axes. Add the actor to the renderer.
self.actor=vtk.vtkCubeAxesActor2D()
self.actor.SetInput(data_reader.get_data_set())
self.actor.SetCamera(renderer.GetActiveCamera())
self.actor.SetLabelFormat("%6.4g")
self.actor.SetFlyModeToClosestTriad()
self.actor.SetFontFactor(0.8)
self.actor.GetProperty().SetColor(0,0,0)
self.actor.ScalingOff()
self.actor.SetAxisTitleTextProperty(self.tprop)
self.actor.SetAxisLabelTextProperty(self.tprop)