NaviNIBS.util.pyvista.PlotInteraction module¶
- NaviNIBS.util.pyvista.PlotInteraction.set_mouse_event_for_picking(plotter, eventKey)[source]¶
To be called after pyvista plotter.enable_*_picking(), allowing for picking to be triggered by alternate mouse events, such as left double click instead of single press :type eventKey:
str
:param eventKey: can be any relevant vtk event, e.g. ‘LeftButtonPressEvent’, ‘RightButtonPressEvent’. :return: NoneUnfortunately, pyvista / Qt interactions mean that some events never reach VTK and so won’t work here. For example, double click events don’t work without some extra interactor modifications (see https://discourse.vtk.org/t/why-single-click-works-but-double-click-does-not/3599)
- async NaviNIBS.util.pyvista.PlotInteraction.pickActor(plotter, show=False, show_message=True, style='wireframe', line_width=5, color='pink', font_size=18, left_clicking=False, **kwargs)[source]¶
Adapted from pv.plotter.enable_mesh_picking but with a few improvements/modifications: - Supports highlighting selection even after UserTransform was set on original actor - Async call until pick is finished - Returns Actor instead of mesh PolyData
- Return type:
Optional
[vtkActor
]