pyvista.RenderWindowInteractor.enable_rubber_band_2d_style#
- RenderWindowInteractor.enable_rubber_band_2d_style()[source]#
Set the interactive style to Rubber Band 2D.
Camera rotation is not enabled with this interactor style. Zooming affects the camera’s parallel scale only, and assumes that the camera is in parallel projection mode. The style also allows to draw a rubber band using the left mouse button. All camera changes invoke
StartInteractionEvent
when the button is pressed,InteractionEvent
when the mouse (or wheel) is moved, andEndInteractionEvent
when the button is released. The bindings are as follows:Left mouse: Select (invokes a
SelectionChangedEvent
).Right mouse: Zoom.
Middle mouse: Pan.
Scroll wheel: Zoom.
Examples
Create a simple scene with a plotter that has the Rubber Band 2D interactive style:
>>> import pyvista as pv >>> plotter = pv.Plotter() >>> _ = plotter.add_mesh(pv.Cube(center=(1, 0, 0))) >>> _ = plotter.add_mesh(pv.Cube(center=(0, 1, 0))) >>> plotter.show_axes() >>> plotter.enable_rubber_band_2d_style() >>> plotter.show()