Hi,
In an attempt to display vtkCubeAxesActor2D
I use the code:
# Get renderer and camera
layoutManager = slicer.app.layoutManager()
view = layoutManager.sliceWidget('Red').sliceView()
renderWindow = view.renderWindow()
renderers = renderWindow.GetRenderers()
renderer = renderers.GetItemAsObject(0)
camera = renderer.GetActiveCamera()
# Customize vtkCubeAxesActor2D
cubeAxesActor = vtk.vtkCubeAxesActor2D()
cubeAxesActor.SetBounds(-50, 50, -50, 50, -50, 50) # some boundary points
cubeAxesActor.SetCamera(camera)
cubeAxesActor.SetXAxisVisibility(1)
cubeAxesActor.SetYAxisVisibility(1)
cubeAxesActor.SetZAxisVisibility(1)
cubeAxesActor.SetVisibility(1)
renderer.AddActor(cubeAxesActor)
# Update views
slicer.util.forceRenderAllViews()
this snippet of code doesn’t show anything.
I look to the vtkMRMLRulerDisplayableManager
source code and I feel that I pretty understand how vtkMRMLRulerDisplayableManager
works but it uses vtkAxisActor2D
instead.
There is a thing that I can’t understand: what is layers
in slice view? Is slice view is represented by somehow overlapping square planes and there is foreground layer and background?