WidgetComponent

WidgetComponent#

class WidgetComponent(*args, **kwargs)[source]#

Plotter widget component.

Owns every interactive widget (box, plane, line, slider, sphere, spline, button, radio button, measurement, logo, camera, camera3d) that has been attached to the owning plotter, along with the derived meshes some widgets generate. Constructed lazily on first access of plotter.widgets and registered for close-time teardown via __plotter_close__.

The plotter exposes the public widget surface (add_*_widget, clear_*_widgets, add_mesh_clip_box, etc.) as forwarding shims that delegate here.

Parameters:
plotterpyvista.BasePlotter

Owning plotter. Stored as a strong reference; the component’s lifetime is bounded by the plotter’s lifetime.

Attributes:
box_widgetslist

vtkBoxWidget instances added via add_box_widget().

box_clipped_mesheslist

Meshes produced by box-widget clipping in add_mesh_clip_box().

plane_widgetslist

vtkImplicitPlaneWidget instances added via add_plane_widget().

plane_clipped_mesheslist

Meshes produced by plane-widget clipping in add_mesh_clip_plane().

plane_sliced_mesheslist

Meshes produced by plane-widget slicing in add_mesh_slice().

line_widgetslist

vtkLineWidget instances added via add_line_widget().

slider_widgetslist

vtkSliderWidget instances added via add_slider_widget().

threshold_mesheslist

Meshes produced by threshold sliders in add_mesh_threshold().

isovalue_mesheslist

Meshes produced by isovalue sliders in add_mesh_isovalue().

spline_widgetslist

vtkSplineWidget instances added via add_spline_widget().

spline_sliced_mesheslist

Meshes produced by spline slicing in add_mesh_slice_spline().

sphere_widgetslist

vtkSphereWidget instances added via add_sphere_widget().

button_widgetslist

Checkbox / radio button widgets.

radio_button_widget_dictdict

Mapping of group name to the radio buttons in that group.

radio_button_title_dictdict

Mapping of group name to title actors for that group.

distance_widgetslist

Measurement widgets added via add_measurement_widget().

logo_widgetslist

Logo widgets added via add_logo_widget().

camera_widgetslist

Camera-orientation widgets added via add_camera_orientation_widget().

camera3d_widgetslist

3D camera widgets added via add_camera3d_widget().

.. versionadded:: 0.48.0

Methods#

WidgetComponent.add_affine_transform_widget(actor)

Add a 3D affine transform widget.

WidgetComponent.add_box_widget(callback[, ...])

Add a box widget to the scene.

WidgetComponent.add_camera3d_widget()

Add a camera3d widget allow to move the camera.

WidgetComponent.add_camera_orientation_widget([...])

Add a camera orientation widget to the active renderer.

WidgetComponent.add_checkbox_button_widget(...)

Add a checkbox button widget to the scene.

WidgetComponent.add_line_widget(callback[, ...])

Add a line widget to the scene.

WidgetComponent.add_logo_widget([logo, ...])

Add a logo widget to the top of the viewport.

WidgetComponent.add_measurement_widget([...])

Interactively measure distance with a distance widget.

WidgetComponent.add_mesh_clip_box(mesh[, ...])

Clip a mesh using a box widget.

WidgetComponent.add_mesh_clip_plane(mesh[, ...])

Clip a mesh using a plane widget.

WidgetComponent.add_mesh_isovalue(mesh[, ...])

Create a contour of a mesh with a slider.

WidgetComponent.add_mesh_slice(mesh[, ...])

Slice a mesh using a plane widget.

WidgetComponent.add_mesh_slice_orthogonal(mesh)

Slice a mesh with three interactive planes.

WidgetComponent.add_mesh_slice_spline(mesh)

Slice a mesh with a spline widget.

WidgetComponent.add_mesh_threshold(mesh[, ...])

Apply a threshold on a mesh with a slider.

WidgetComponent.add_plane_widget(callback[, ...])

Add a plane widget to the scene.

WidgetComponent.add_radio_button_widget(...)

Add a radio button widget to the scene.

WidgetComponent.add_slider_widget(callback, rng)

Add a slider bar widget.

WidgetComponent.add_sphere_widget(callback)

Add one or many sphere widgets to a scene.

WidgetComponent.add_spline_widget(callback)

Create and add a spline widget to the scene.

WidgetComponent.add_text_slider_widget(...)

Add a text slider bar widget.

WidgetComponent.add_volume_clip_plane(volume)

Clip a volume using a plane widget.

WidgetComponent.clear_box_widgets()

Remove all of the box widgets.

WidgetComponent.clear_button_widgets()

Remove all of the button widgets.

WidgetComponent.clear_camera3d_widgets()

Remove all of the camera3d widgets.

WidgetComponent.clear_camera_widgets()

Remove all of the camera widgets.

WidgetComponent.clear_line_widgets()

Remove all of the line widgets.

WidgetComponent.clear_logo_widgets()

Remove all of the logo widgets.

WidgetComponent.clear_measure_widgets()

Remove all of the measurement widgets.

WidgetComponent.clear_plane_widgets()

Remove all of the plane widgets.

WidgetComponent.clear_radio_button_widgets()

Remove all of the radio button widgets.

WidgetComponent.clear_slider_widgets()

Remove all of the slider widgets.

WidgetComponent.clear_sphere_widgets()

Remove all of the sphere widgets.

WidgetComponent.clear_spline_widgets()

Remove all of the spline widgets.