Skip to content

Commit

Permalink
fix(examples): update some examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Feb 28, 2024
1 parent 67cd840 commit 1878952
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions examples/vtk/silhouette.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def _build_ui(self):
vuetify3.VDivider(vertical=True, classes="mx-2")
with vuetify3.VBtn(icon=True, click=self.reset_resolution):
vuetify3.VIcon("mdi-undo-variant")
vuetify3.VBtn("Update view", click=self.ctrl.view_update)

with layout.content:
with vuetify3.VContainer(
Expand All @@ -111,6 +112,7 @@ def _build_ui(self):
vr = vtk_widgets.VtkRemoteView(
self.render_window,
ref="remote",
interactive_ratio=1,
)
self.ctrl.view2_update = vr.update

Expand Down
10 changes: 8 additions & 2 deletions examples/vtk/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def setup_vtk():
class App:
def __init__(self, server=None):
self.server = get_server(server, client_type="vue3")
self.local_view = None
self.render_window = setup_vtk()
self.ui = self._build_ui()

Expand All @@ -89,6 +90,10 @@ def _build_ui(self):
with SinglePageLayout(self.server) as layout:
layout.icon.click = self.ctrl.view_reset_camera

with layout.toolbar:
vuetify.VSpacer()
vuetify.VBtn("Update", click=self.ctrl.view_update)

with layout.content:
with vuetify.VContainer(
fluid=True,
Expand All @@ -97,11 +102,12 @@ def _build_ui(self):
with vuetify.VContainer(
fluid=True, classes="pa-0 fill-height", style="width: 50%;"
):
vtklocal.LocalView(self.render_window)
self.local_view = vtklocal.LocalView(self.render_window)
self.ctrl.view_update = self.local_view.update
with vuetify.VContainer(
fluid=True, classes="pa-0 fill-height", style="width: 50%;"
):
VtkRemoteView(self.render_window)
VtkRemoteView(self.render_window, interactive_ratio=1)

# hide footer
layout.footer.hide()
Expand Down

0 comments on commit 1878952

Please sign in to comment.