1// Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qnopicking.h"
5
6
7QT_BEGIN_NAMESPACE
8
9namespace Qt3DRender {
10
11/*!
12 \class Qt3DRender::QNoPicking
13 \inmodule Qt3DRender
14 \since 5.14
15
16 \brief When a Qt3DRender::QNoPicking node is present in a FrameGraph
17 branch, this prevents the render aspect from performing picking selection
18 for the given branch.
19
20 When disabled, a Qt3DRender::QNoPicking node won't prevent picking from
21 being performed. Toggling the enabled property is therefore a way to make a
22 Qt3DRender::QNoPicking active or inactive.
23
24 When using multiple subviewports in the FrameGraph, QNoPicking can be
25 useful to prevent picking conflicts between overlapping viewports or non
26 visual ones. It can also be used as an optimization to prevent unnecessary
27 work for hidden viewports or for sections of the scenes which don't require
28 any picking.
29
30 \code
31 Qt3DRender::QViewport *viewport = new Qt3DRender::QViewport();
32 Qt3DRender::QCameraSelector *cameraSelector = new Qt3DRender::QCameraSelector(viewport);
33 Qt3DRender::QNoPicking *noPicking = new Qt3DRender::QNoPicking(cameraSelector);
34
35 Qt3DRender::QClearBuffers *clearBuffers = new Qt3DRender::QClearBuffers(noPicking);
36 clearBuffers->setBuffers(Qt3DRender::QClearBuffers::ColorDepthBuffer);
37
38 Qt3DRender::QRenderPassFilter *mainPass = new Qt3DRender::QRenderPassFilter(cameraSelector);
39 ....
40 Qt3DRender::QRenderPassFilter *previewPass = new Qt3DRender::QRenderPassFilter(cameraSelector);
41 ....
42 \endcode
43 \sa Qt3DRender::QObjectPicker, Qt3DRender::QRayCaster, Qt3DRender::QScreenRayCaster
44 */
45
46/*!
47 \qmltype NoPicking
48 \instantiates Qt3DRender::QNoPicking
49 \inherits FrameGraphNode
50 \inqmlmodule Qt3D.Render
51 \since 5.14
52
53 \brief When a NoPicking node is present in a FrameGraph branch, this
54 prevents the render aspect from performing picking selection for the given
55 branch.
56
57 When disabled, a NoPicking node won't prevent picking from being performed.
58 Toggling the enabled property is therefore a way to make a NoPicking active
59 or inactive.
60
61 When using multiple subviewports in the FrameGraph, NoPicking can be useful
62 to prevent picking conflicts between overlapping viewports or non visual
63 ones. It can also be used as an optimization to prevent unnecessary work for
64 hidden viewports or for sections of the scenes which don't require any
65 picking.
66
67
68 \code
69
70 Viewport {
71 CameraSelector {
72 NoPicking {
73 ClearBuffers {
74 buffers: ClearBuffers.ColorDepthBuffer
75 NoDraw { } // Prevents from drawing anything
76 }
77 RenderPassFilter {
78 ...
79 }
80 RenderPassFilter {
81 ...
82 }
83 }
84 }
85 }
86
87 \endcode
88 \sa ObjectPicker, RayCaster, ScreenRayCaster
89
90*/
91
92QNoPicking::QNoPicking(Qt3DCore::QNode *parent)
93 : QFrameGraphNode(parent)
94{
95}
96
97QNoPicking::~QNoPicking()
98{
99}
100
101} // namespace Qt3DRender
102
103QT_END_NAMESPACE
104
105#include "moc_qnopicking.cpp"
106

source code of qt3d/src/render/framegraph/qnopicking.cpp