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.widgetsand 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:
- plotter
pyvista.BasePlotter Owning plotter. Stored as a strong reference; the component’s lifetime is bounded by the plotter’s lifetime.
- plotter
- Attributes:
- box_widgets
list vtkBoxWidget instances added via
add_box_widget().- box_clipped_meshes
list Meshes produced by box-widget clipping in
add_mesh_clip_box().- plane_widgets
list vtkImplicitPlaneWidget instances added via
add_plane_widget().- plane_clipped_meshes
list Meshes produced by plane-widget clipping in
add_mesh_clip_plane().- plane_sliced_meshes
list Meshes produced by plane-widget slicing in
add_mesh_slice().- line_widgets
list vtkLineWidget instances added via
add_line_widget().- slider_widgets
list vtkSliderWidget instances added via
add_slider_widget().- threshold_meshes
list Meshes produced by threshold sliders in
add_mesh_threshold().- isovalue_meshes
list Meshes produced by isovalue sliders in
add_mesh_isovalue().- spline_widgets
list vtkSplineWidget instances added via
add_spline_widget().- spline_sliced_meshes
list Meshes produced by spline slicing in
add_mesh_slice_spline().- sphere_widgets
list vtkSphereWidget instances added via
add_sphere_widget().- button_widgets
list Checkbox / radio button widgets.
- radio_button_widget_dict
dict Mapping of group name to the radio buttons in that group.
- radio_button_title_dict
dict Mapping of group name to title actors for that group.
- distance_widgets
list Measurement widgets added via
add_measurement_widget().- logo_widgets
list Logo widgets added via
add_logo_widget().- camera_widgets
list Camera-orientation widgets added via
add_camera_orientation_widget().- camera3d_widgets
list 3D camera widgets added via
add_camera3d_widget().- .. versionadded:: 0.48.0
- box_widgets
Methods#
Add a 3D affine transform widget. |
|
|
Add a box widget to the scene. |
Add a camera3d widget allow to move the camera. |
|
Add a camera orientation widget to the active renderer. |
|
Add a checkbox button widget to the scene. |
|
|
Add a line widget to the scene. |
|
Add a logo widget to the top of the viewport. |
Interactively measure distance with a distance widget. |
|
|
Clip a mesh using a box widget. |
|
Clip a mesh using a plane widget. |
|
Create a contour of a mesh with a slider. |
|
Slice a mesh using a plane widget. |
Slice a mesh with three interactive planes. |
|
Slice a mesh with a spline widget. |
|
|
Apply a threshold on a mesh with a slider. |
|
Add a plane widget to the scene. |
Add a radio button widget to the scene. |
|
|
Add a slider bar widget. |
|
Add one or many sphere widgets to a scene. |
|
Create and add a spline widget to the scene. |
Add a text slider bar widget. |
|
Clip a volume using a plane widget. |
|
Remove all of the box widgets. |
|
Remove all of the button widgets. |
|
Remove all of the camera3d widgets. |
|
Remove all of the camera widgets. |
|
Remove all of the line widgets. |
|
Remove all of the logo widgets. |
|
Remove all of the measurement widgets. |
|
Remove all of the plane widgets. |
|
Remove all of the radio button widgets. |
|
Remove all of the slider widgets. |
|
Remove all of the sphere widgets. |
|
Remove all of the spline widgets. |