The QPickingSettings class specifies how entity picking is handled. 更多...
头: | #include <QPickingSettings> |
CMake: |
find_package(Qt6 COMPONENTS 3drender REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::3drender) |
qmake: | QT += 3drender |
Since: | Qt 5.7 |
实例化: | PickingSettings |
继承: | Qt3DCore::QNode |
enum | FaceOrientationPickingMode { FrontFace, BackFace, FrontAndBackFace } |
enum | PickMethod { BoundingVolumePicking, TrianglePicking, LinePicking, PointPicking, PrimitivePicking } |
enum | PickResultMode { NearestPick, AllPicks, NearestPriorityPick } |
Qt3DRender::QPickingSettings::FaceOrientationPickingMode | faceOrientationPickingMode () const |
Qt3DRender::QPickingSettings::PickMethod | pickMethod () const |
Qt3DRender::QPickingSettings::PickResultMode | pickResultMode () const |
float | worldSpaceTolerance () const |
void | setFaceOrientationPickingMode (Qt3DRender::QPickingSettings::FaceOrientationPickingMode faceOrientationPickingMode ) |
void | setPickMethod (Qt3DRender::QPickingSettings::PickMethod pickMethod ) |
void | setPickResultMode (Qt3DRender::QPickingSettings::PickResultMode pickResultMode ) |
void | setWorldSpaceTolerance (float worldSpaceTolerance ) |
void | faceOrientationPickingModeChanged (QPickingSettings::FaceOrientationPickingMode faceOrientationPickingMode ) |
void | pickMethodChanged (QPickingSettings::PickMethod pickMethod ) |
void | pickResultModeChanged (QPickingSettings::PickResultMode pickResult ) |
void | worldSpaceToleranceChanged (float worldSpaceTolerance ) |
The picking settings determine how the entity picking is handled. For more details about entity picking, see QObjectPicker and QRayCaster component documentation.
当使用 QObjectPicker components, picking is triggered by mouse events.
当使用 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.
另请参阅 QObjectPicker , QPickEvent , QPickTriangleEvent , QRayCaster ,和 QScreenRayCaster .
Specifies how face orientation affects triangle picking
常量 | 值 | 描述 |
---|---|---|
Qt3DRender::QPickingSettings::FrontFace
|
0x01
|
Only front-facing triangles will be picked (default). |
Qt3DRender::QPickingSettings::BackFace
|
0x02
|
Only back-facing triangles will be picked. |
Qt3DRender::QPickingSettings::FrontAndBackFace
|
0x03
|
Both front- and back-facing triangles will be picked. |
Specifies the picking method.
常量 | 值 | 描述 |
---|---|---|
Qt3DRender::QPickingSettings::BoundingVolumePicking
|
0x00
|
An entity is considered picked if the picking ray intersects the bounding volume of the entity (default). |
Qt3DRender::QPickingSettings::TrianglePicking
|
0x01
|
An entity is considered picked if the picking ray intersects with any triangle of the entity's mesh component. |
Qt3DRender::QPickingSettings::LinePicking
|
0x02
|
An entity is considered picked if the picking ray intersects with any edge of the entity's mesh component. |
Qt3DRender::QPickingSettings::PointPicking
|
0x04
|
An entity is considered picked if the picking ray intersects with any point of the entity's mesh component. |
Qt3DRender::QPickingSettings::PrimitivePicking
|
TrianglePicking | LinePicking | PointPicking
|
An entity is considered picked if the picking ray intersects with any point, edge or triangle of the entity's mesh component. |
Specifies what is included into the picking results.
常量 | 值 | 描述 |
---|---|---|
Qt3DRender::QPickingSettings::NearestPick
|
0
|
Only the nearest entity to picking ray origin intersected by the picking ray is picked (default). |
Qt3DRender::QPickingSettings::AllPicks
|
1
|
All entities that intersect the picking ray are picked. |
Qt3DRender::QPickingSettings::NearestPriorityPick
|
2
|
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. |
另请参阅 Qt3DRender::QPickEvent .
Specifies how face orientation affects triangle picking
访问函数:
Qt3DRender::QPickingSettings::FaceOrientationPickingMode | faceOrientationPickingMode () const |
void | setFaceOrientationPickingMode (Qt3DRender::QPickingSettings::FaceOrientationPickingMode faceOrientationPickingMode ) |
通知程序信号:
void | faceOrientationPickingModeChanged (QPickingSettings::FaceOrientationPickingMode faceOrientationPickingMode ) |
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.
访问函数:
Qt3DRender::QPickingSettings::PickMethod | pickMethod () const |
void | setPickMethod (Qt3DRender::QPickingSettings::PickMethod pickMethod ) |
通知程序信号:
void | pickMethodChanged (QPickingSettings::PickMethod pickMethod ) |
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.
若 QObjectPicker is assigned to an entity with multiple children, an event will be triggered for each child entity that intersects the ray.
访问函数:
Qt3DRender::QPickingSettings::PickResultMode | pickResultMode () const |
void | setPickResultMode (Qt3DRender::QPickingSettings::PickResultMode pickResultMode ) |
通知程序信号:
void | pickResultModeChanged (QPickingSettings::PickResultMode pickResult ) |
Holds the threshold, in model space coordinates, used to evaluate line and point picking.
访问函数:
float | worldSpaceTolerance () const |
void | setWorldSpaceTolerance (float worldSpaceTolerance ) |
通知程序信号:
void | worldSpaceToleranceChanged (float worldSpaceTolerance ) |
[slot]
void
QPickingSettings::
setWorldSpaceTolerance
(
float
worldSpaceTolerance
)
Sets the threshold used for line and point picking to worldSpaceTolerance .
注意: setter 函数对于特性 worldSpaceTolerance .
另请参阅 worldSpaceTolerance ().
Returns the line and point precision worldSpaceTolerance
注意: Getter function for property worldSpaceTolerance.
另请参阅 setWorldSpaceTolerance ().