How to display vtkAxesActor in LocalRenderView? #209
-
Hi, from trame.app import get_server
from trame.ui.vuetify import SinglePageLayout
from trame.widgets import vtk, vuetify
from vtkmodules.vtkFiltersSources import vtkConeSource
from vtkmodules.vtkRenderingCore import (
vtkActor,
vtkPolyDataMapper,
vtkRenderer,
vtkRenderWindow,
vtkRenderWindowInteractor,
)
from vtkmodules.vtkRenderingAnnotation import vtkAxesActor
from vtkmodules.vtkCommonTransforms import vtkTransform
from vtkmodules.vtkInteractionStyle import vtkInteractorStyleSwitch # noqa
import vtkmodules.vtkRenderingOpenGL2 # noqa
renderer = vtkRenderer()
renderWindow = vtkRenderWindow()
renderWindow.AddRenderer(renderer)
renderWindowInteractor = vtkRenderWindowInteractor()
renderWindowInteractor.SetRenderWindow(renderWindow)
renderWindowInteractor.GetInteractorStyle().SetCurrentStyleToTrackballCamera()
cone_source = vtkConeSource()
mapper = vtkPolyDataMapper()
mapper.SetInputConnection(cone_source.GetOutputPort())
actor = vtkActor()
actor.SetMapper(mapper)
axes = vtkAxesActor()
transform = vtkTransform()
transform.Translate(1.0, 0.0, 0.0)
axes.SetUserTransform(transform)
renderer.AddActor(axes)
renderer.AddActor(actor)
renderer.ResetCamera()
server = get_server()
ctrl = server.controller
with SinglePageLayout(server) as layout:
layout.title.set_text("Hello trame")
with layout.content:
with vuetify.VContainer(
fluid=True,
classes="pa-0 fill-height",
):
view = vtk.VtkLocalView(renderWindow)
if __name__ == "__main__":
server.start() |
Beta Was this translation helpful? Give feedback.
Answered by
jourdain
Apr 4, 2023
Replies: 3 comments 3 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Actually it seems that we have it. Then it just a matter of a missing serializer. Fairly easy to add, we just need to get to it. |
Beta Was this translation helpful? Give feedback.
3 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jourdain
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Latest version of trame-vtk also support the orientation marker widget.
Examples can be found below: