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_backendPlotter

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.

Overview#

pick_select_object

Add actor to picked list and add label if required.

pick_unselect_object

Remove actor from picked list and remove label if required.

hover_select_object

Add label to hovered object if required.

hover_unselect_object

Remove all hover labels from the scene.

picked_dict

Return the dictionary of picked objects.

Import detail#

from ansys.tools.visualization_interface.backends.pyvista.picker import Picker

Property detail#

property Picker.picked_dict: dict#

Return the dictionary of picked objects.

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_objectUnion[MeshObjectPlot, EdgePlot]

The object to be selected.

ptnp.ndarray

The point where the object was picked.

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_objectUnion[MeshObjectPlot, EdgePlot]

The object to be unselected.

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_objectUnion[MeshObjectPlot, EdgePlot]

The object to be hovered over.

actorvtkActor

The actor corresponding to the hovered object.

Picker.hover_unselect_object()#

Remove all hover labels from the scene.