1// Copyright (C) 2016 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#ifndef QT3DRENDER_QRENDERSETTINGS_H
5#define QT3DRENDER_QRENDERSETTINGS_H
6
7#include <Qt3DCore/qcomponent.h>
8#include <Qt3DRender/qt3drender_global.h>
9#include <Qt3DRender/qpickingsettings.h>
10#include <QtGui/qtguiglobal.h>
11
12QT_BEGIN_NAMESPACE
13namespace Qt3DRender {
14
15class QFrameGraphNode;
16class QRenderCapabilities;
17class QRenderSettingsPrivate;
18
19class Q_3DRENDERSHARED_EXPORT QRenderSettings : public Qt3DCore::QComponent
20{
21 Q_OBJECT
22 Q_PROPERTY(Qt3DRender::QRenderCapabilities* renderCapabilities READ renderCapabilities CONSTANT REVISION 15)
23 Q_PROPERTY(Qt3DRender::QPickingSettings* pickingSettings READ pickingSettings CONSTANT)
24 Q_PROPERTY(RenderPolicy renderPolicy READ renderPolicy WRITE setRenderPolicy NOTIFY renderPolicyChanged)
25 Q_PROPERTY(Qt3DRender::QFrameGraphNode *activeFrameGraph READ activeFrameGraph WRITE setActiveFrameGraph NOTIFY activeFrameGraphChanged)
26 Q_CLASSINFO("DefaultProperty", "activeFrameGraph")
27
28public:
29 explicit QRenderSettings(Qt3DCore::QNode *parent = nullptr);
30 ~QRenderSettings();
31
32 enum RenderPolicy {
33 OnDemand,
34 Always
35 };
36 Q_ENUM(RenderPolicy) // LCOV_EXCL_LINE
37
38 QRenderCapabilities* renderCapabilities();
39 QPickingSettings* pickingSettings();
40 QFrameGraphNode *activeFrameGraph() const;
41 RenderPolicy renderPolicy() const;
42
43public Q_SLOTS:
44 void setActiveFrameGraph(QFrameGraphNode *activeFrameGraph);
45 void setRenderPolicy(RenderPolicy renderPolicy);
46
47Q_SIGNALS:
48 void activeFrameGraphChanged(QFrameGraphNode *activeFrameGraph);
49 void renderPolicyChanged(RenderPolicy renderPolicy);
50
51protected:
52 Q_DECLARE_PRIVATE(QRenderSettings)
53 explicit QRenderSettings(QRenderSettingsPrivate &dd, Qt3DCore::QNode *parent = nullptr);
54
55private:
56 Q_PRIVATE_SLOT(d_func(), void _q_onPickingMethodChanged(QPickingSettings::PickMethod))
57 Q_PRIVATE_SLOT(d_func(), void _q_onPickResultModeChanged(QPickingSettings::PickResultMode))
58 Q_PRIVATE_SLOT(d_func(), void _q_onFaceOrientationPickingModeChanged(QPickingSettings::FaceOrientationPickingMode))
59 Q_PRIVATE_SLOT(d_func(), void _q_onWorldSpaceToleranceChanged(float))
60};
61
62} // namespace Qt3Drender
63
64QT_END_NAMESPACE
65
66#endif // QT3DRENDER_QRENDERSETTINGS_H
67

source code of qt3d/src/render/frontend/qrendersettings.h