Picker
#
- class ansys.tools.visualization_interface.backends.pyvista.picker.Picker(plotter_backend: ansys.tools.visualization_interface.backends.pyvista.pyvista.Plotter, plot_picked_names: bool = True)#
Bases:
AbstractPicker
Class to manage picking and hovering of objects in the plotter.
This class is responsible for managing the selection and deselection of objects in the plotter, both through direct picking and hovering. It keeps track of the currently selected and hovered objects, and provides methods to select and unselect them.
- Parameters:
- plotter_backend
Plotter
The plotter instance to which this picker is attached.
- plot_picked_namesbool,
optional
Whether to display the names of picked objects in the plotter. Defaults to True.
- plotter_backend
Overview#
Add actor to picked list and add label if required. |
|
Remove actor from picked list and remove label if required. |
|
Add label to hovered object if required. |
|
Remove all hover labels from the scene. |
Return the dictionary of picked objects. |
Import detail#
from ansys.tools.visualization_interface.backends.pyvista.picker import Picker
Property detail#
Method detail#
- Picker.pick_select_object(custom_object: ansys.tools.visualization_interface.types.mesh_object_plot.MeshObjectPlot | ansys.tools.visualization_interface.types.edge_plot.EdgePlot, pt: numpy.ndarray) None #
Add actor to picked list and add label if required.
- Parameters:
- custom_object
Union
[MeshObjectPlot
,EdgePlot
] The object to be selected.
- pt
np.ndarray
The point where the object was picked.
- custom_object
- Picker.pick_unselect_object(custom_object: ansys.tools.visualization_interface.types.mesh_object_plot.MeshObjectPlot | ansys.tools.visualization_interface.types.edge_plot.EdgePlot) None #
Remove actor from picked list and remove label if required.
- Parameters:
- custom_object
Union
[MeshObjectPlot
,EdgePlot
] The object to be unselected.
- custom_object
- Picker.hover_select_object(custom_object: ansys.tools.visualization_interface.types.mesh_object_plot.MeshObjectPlot | ansys.tools.visualization_interface.types.edge_plot.EdgePlot, actor: pyvista.Actor) None #
Add label to hovered object if required.
- Parameters:
- custom_object
Union
[MeshObjectPlot
,EdgePlot
] The object to be hovered over.
- actor
vtkActor
The actor corresponding to the hovered object.
- custom_object
- Picker.hover_unselect_object()#
Remove all hover labels from the scene.