pyvista.RenderWindowInteractor.style

pyvista.RenderWindowInteractor.style#

property RenderWindowInteractor.style: vtkContextInteractorStyle | vtkInteractorStyle | InteractorStyleCaptureMixin | None[source]#

Get/set the current interactor style.

Warning

Setting an interactor style needs careful control of events handling. See InteractorStyleCaptureMixin and its implementation as an example.

Returns:
vtkInteractorStyle | vtkContextInteractorStyle | None

The current interactor style.

Examples

Set interactor style with a customized vtk interactor

>>> import pyvista as pv
>>> from vtkmodules.vtkInteractionStyle import (
...     vtkInteractorStyleTrackballCamera,
... )
>>> class MyCustomInteractorStyle(vtkInteractorStyleTrackballCamera):
...     # Implement custom functionality
...     def __repr__(self):
...         return 'A custom interactor style.'
>>> plotter = pv.Plotter()
>>> plotter.iren.style = MyCustomInteractorStyle()
>>> plotter.iren.style
A custom interactor style.