NaviNIBS.util.pyvista.PlotInteraction module

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: None

Unfortunately, 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)

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]