Skip to content

Commit

Permalink
docs(selection): Update pv selection with clear and click
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Dec 9, 2022
1 parent 00fa606 commit 0d06739
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions examples/07_paraview/Picking/pv_selection.py
Expand Up @@ -47,6 +47,11 @@
view = simple.Render()


def clear_selection():
simple.ClearSelection()
ctrl.view_update()


@ctrl.set("on_selection_change")
def on_box_selection(event):
fn = MODE_TO_METHOD[state.selection_mode]
Expand Down Expand Up @@ -74,11 +79,18 @@ def on_mode_change(selection_mode, **kwargs):
view.InteractionMode = "Selection"

# Handle hover with live update
# => attempt to do hover selection...
# state.send_mouse = selection_mode in ["select_hover_point", "select_hover_cell"]
state.send_mouse = selection_mode in [
"select_block",
"select_hover_point",
"select_hover_cell",
]
# if state.send_mouse:
# asynchronous.create_task(animate())

# Disable active mode
if selection_mode == "-":
state.selection_mode = None


# async def animate():
# while state.send_mouse:
Expand All @@ -104,6 +116,8 @@ def on_mode_change(selection_mode, **kwargs):
height=ICON_SIZE,
width=ICON_SIZE,
)
with vuetify.VBtn(small=True, click=clear_selection, value="-"):
vuetify.VIcon("mdi-trash-can-outline", small=True)

with layout.content:
with vuetify.VContainer(fluid=True, classes="pa-0 fill-height"):
Expand Down

0 comments on commit 0d06739

Please sign in to comment.