PickingComponent

PickingComponent#

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

Plotter picking component.

Owns every picking observer, picked-result attribute, and per-pick representation actor for a single pyvista.BasePlotter. Constructed lazily on first access of plotter.picking and registered for close-time teardown via __plotter_close__.

The plotter exposes the public picking surface (enable_*_picking, disable_picking, picked_point and friends) 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:
picked_pathpyvista.PolyData | None

Polyline accumulated by enable_path_picking().

picked_geodesicpyvista.PolyData | None

Geodesic polyline accumulated by enable_geodesic_picking().

picked_horizonpyvista.PolyData | None

Ribbon surface produced by enable_horizon_picking().

.. versionadded:: 0.48.0

Methods#

PickingComponent.disable_picking()

Disable any active picking and remove observers.

PickingComponent.enable_block_picking([...])

Enable composite block picking.

PickingComponent.enable_cell_picking([...])

Enable picking of cells with a rectangle selection tool.

PickingComponent.enable_element_picking([...])

Select individual elements on a mesh.

PickingComponent.enable_fly_to_right_click([...])

Set the camera to track right click positions.

PickingComponent.enable_geodesic_picking([...])

Enable picking at geodesic paths.

PickingComponent.enable_horizon_picking([...])

Enable horizon picking.

PickingComponent.enable_mesh_picking([...])

Enable picking of a mesh.

PickingComponent.enable_path_picking([...])

Enable picking at paths.

PickingComponent.enable_point_picking([...])

Enable picking at points under the cursor.

PickingComponent.enable_rectangle_picking([...])

Enable rectangle based picking at cells.

PickingComponent.enable_rectangle_through_picking([...])

Enable rectangle based cell picking through the scene.

PickingComponent.enable_rectangle_visible_picking([...])

Enable rectangle based cell picking on visible surfaces.

PickingComponent.enable_surface_point_picking([...])

Enable picking of a point on the surface of a mesh.

PickingComponent.fly_to_mouse_position([focus])

Focus on last stored mouse position.

PickingComponent.get_pick_position()

Get the pick position or area.

PickingComponent.pick_click_position()

Get corresponding click location in the 3D plot.

PickingComponent.pick_mouse_position()

Get corresponding mouse location in the 3D plot.

Attributes#

PickingComponent.picked_actor

Return the picked actor.

PickingComponent.picked_block_index

Return the picked block index.

PickingComponent.picked_cell

Return the cell-picked object.

PickingComponent.picked_cells

Return the cell-picked object.

PickingComponent.picked_mesh

Return the picked mesh.

PickingComponent.picked_point

Return the picked point.