forked from pyvista/pyvista
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve performance of Trame camera sync (pyvista#4223)
* Improve performance of Trame camera sync * Improve render events with camera setting * Fix update_image * Snake case file names
- Loading branch information
1 parent
92b436e
commit dd44661
Showing
6 changed files
with
157 additions
and
57 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from trame.app import get_server | ||
from trame.ui.vuetify import SinglePageLayout | ||
from trame.widgets import vuetify | ||
|
||
import pyvista as pv | ||
from pyvista.trame.ui import plotter_ui | ||
|
||
pv.OFF_SCREEN = True | ||
|
||
server = get_server() | ||
state, ctrl = server.state, server.controller | ||
|
||
state.trame__title = "PyVista Many Actors" | ||
|
||
# ----------------------------------------------------------------------------- | ||
|
||
plotter = pv.Plotter() | ||
|
||
for i in range(25): | ||
for j in range(25): | ||
actor = plotter.add_mesh(pv.Sphere(center=(i, j, 0))) | ||
|
||
|
||
# ----------------------------------------------------------------------------- | ||
# GUI | ||
# ----------------------------------------------------------------------------- | ||
|
||
with SinglePageLayout(server) as layout: | ||
layout.icon.click = ctrl.view_reset_camera | ||
layout.title.set_text(state.trame__title) | ||
|
||
with layout.toolbar: | ||
vuetify.VSpacer() | ||
|
||
with layout.content: | ||
# Use PyVista UI template for Plotters | ||
view = plotter_ui(plotter) | ||
ctrl.view_update = view.update | ||
|
||
# hide footer | ||
layout.footer.hide() | ||
|
||
server.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.