QPickingSettings

The QPickingSettings class specifies how entity picking is handled. More

Inheritance diagram of PySide2.Qt3DRender.Qt3DRender.QPickingSettings

Synopsis

Functions

Slots

Signals

Detailed Description

The picking settings determine how the entity picking is handled. For more details about entity picking, see QObjectPicker and QRayCaster component documentation.

When using QObjectPicker components, picking is triggered by mouse events.

When using QRayCaster or QScreenRayCaster components, picking can be explicitly triggered by the application.

In both cases, a ray will be cast through the scene to find geometry intersecting the ray.

See also

QObjectPicker QPickEvent QPickTriangleEvent QRayCaster QScreenRayCaster

class PySide2.Qt3DRender.Qt3DRender.QPickingSettings([parent=None])
Parameters:

parentPySide2.Qt3DCore.Qt3DCore.QNode

PySide2.Qt3DRender.Qt3DRender.QPickingSettings.PickMethod

Specifies the picking method.

Constant

Description

Qt3DRender.QPickingSettings.BoundingVolumePicking

An entity is considered picked if the picking ray intersects the bounding volume of the entity (default).

Qt3DRender.QPickingSettings.TrianglePicking

An entity is considered picked if the picking ray intersects with any triangle of the entity’s mesh component.

Qt3DRender.QPickingSettings.LinePicking

An entity is considered picked if the picking ray intersects with any edge of the entity’s mesh component.

Qt3DRender.QPickingSettings.PointPicking

An entity is considered picked if the picking ray intersects with any point of the entity’s mesh component.

Qt3DRender.QPickingSettings.PrimitivePicking

An entity is considered picked if the picking ray intersects with any point, edge or triangle of the entity’s mesh component.

PySide2.Qt3DRender.Qt3DRender.QPickingSettings.PickResultMode

Specifies what is included into the picking results.

Constant

Description

Qt3DRender.QPickingSettings.NearestPick

Only the nearest entity to picking ray origin intersected by the picking ray is picked (default).

Qt3DRender.QPickingSettings.AllPicks

All entities that intersect the picking ray are picked.

Qt3DRender.QPickingSettings.NearestPriorityPick

Selects the entity whose object picker has the highest value. If several object pickers have the same priority, the closest one on the ray is selected.

See also

QPickEvent

PySide2.Qt3DRender.Qt3DRender.QPickingSettings.FaceOrientationPickingMode

Specifies how face orientation affects triangle picking

Constant

Description

Qt3DRender.QPickingSettings.FrontFace

Only front-facing triangles will be picked (default).

Qt3DRender.QPickingSettings.BackFace

Only back-facing triangles will be picked.

Qt3DRender.QPickingSettings.FrontAndBackFace

Both front- and back-facing triangles will be picked.

PySide2.Qt3DRender.Qt3DRender.QPickingSettings.faceOrientationPickingMode()
Return type:

FaceOrientationPickingMode

Specifies how face orientation affects triangle picking

PySide2.Qt3DRender.Qt3DRender.QPickingSettings.faceOrientationPickingModeChanged(faceOrientationPickingMode)
Parameters:

faceOrientationPickingModeFaceOrientationPickingMode

PySide2.Qt3DRender.Qt3DRender.QPickingSettings.pickMethod()
Return type:

PickMethod

Holds the current pick method.

By default, for performance reasons, ray casting will use bounding volume picking. This may however lead to unexpected results if a small object is englobed in the bounding sphere of a large object behind it.

Triangle picking will produce exact results but is computationally more expensive.

PySide2.Qt3DRender.Qt3DRender.QPickingSettings.pickMethodChanged(pickMethod)
Parameters:

pickMethodPickMethod

PySide2.Qt3DRender.Qt3DRender.QPickingSettings.pickResultMode()
Return type:

PickResultMode

Holds the current pick results mode.

By default, pick results will only be produced for the entity closest to the camera.

When setting the pick method to AllPicks , events will be triggered for all the entities with a QObjectPicker along the ray.

When setting the pick method to NearestPriorityPick , events will be triggered for the nearest highest priority picker. This can be used when a given element should always be selected even if others are in front of it.

If a QObjectPicker is assigned to an entity with multiple children, an event will be triggered for each child entity that intersects the ray.

PySide2.Qt3DRender.Qt3DRender.QPickingSettings.pickResultModeChanged(pickResult)
Parameters:

pickResultPickResultMode

PySide2.Qt3DRender.Qt3DRender.QPickingSettings.setFaceOrientationPickingMode(faceOrientationPickingMode)
Parameters:

faceOrientationPickingModeFaceOrientationPickingMode

Specifies how face orientation affects triangle picking

PySide2.Qt3DRender.Qt3DRender.QPickingSettings.setPickMethod(pickMethod)
Parameters:

pickMethodPickMethod

Holds the current pick method.

By default, for performance reasons, ray casting will use bounding volume picking. This may however lead to unexpected results if a small object is englobed in the bounding sphere of a large object behind it.

Triangle picking will produce exact results but is computationally more expensive.

PySide2.Qt3DRender.Qt3DRender.QPickingSettings.setPickResultMode(pickResultMode)
Parameters:

pickResultModePickResultMode

Holds the current pick results mode.

By default, pick results will only be produced for the entity closest to the camera.

When setting the pick method to AllPicks , events will be triggered for all the entities with a QObjectPicker along the ray.

When setting the pick method to NearestPriorityPick , events will be triggered for the nearest highest priority picker. This can be used when a given element should always be selected even if others are in front of it.

If a QObjectPicker is assigned to an entity with multiple children, an event will be triggered for each child entity that intersects the ray.

PySide2.Qt3DRender.Qt3DRender.QPickingSettings.setWorldSpaceTolerance(worldSpaceTolerance)
Parameters:

worldSpaceTolerance – float

Holds the threshold, in model space coordinates, used to evaluate line and point picking.

PySide2.Qt3DRender.Qt3DRender.QPickingSettings.worldSpaceTolerance()
Return type:

float

Holds the threshold, in model space coordinates, used to evaluate line and point picking.

PySide2.Qt3DRender.Qt3DRender.QPickingSettings.worldSpaceToleranceChanged(worldSpaceTolerance)
Parameters:

worldSpaceTolerance – float