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_RENDER_RENDERSETTINGS_H
5#define QT3DRENDER_RENDER_RENDERSETTINGS_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of other Qt classes. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <Qt3DRender/private/backendnode_p.h>
19#include <Qt3DRender/qrendersettings.h>
20#include <Qt3DRender/qpickingsettings.h>
21
22QT_BEGIN_NAMESPACE
23
24namespace Qt3DRender {
25namespace Render {
26
27class AbstractRenderer;
28
29class Q_3DRENDERSHARED_PRIVATE_EXPORT RenderSettings : public BackendNode
30{
31public:
32 RenderSettings();
33
34 void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) override;
35
36 Qt3DCore::QNodeId activeFrameGraphID() const { return m_activeFrameGraph; }
37 QRenderSettings::RenderPolicy renderPolicy() const { return m_renderPolicy; }
38 QPickingSettings::PickMethod pickMethod() const { return m_pickMethod; }
39 QPickingSettings::PickResultMode pickResultMode() const { return m_pickResultMode; }
40 QPickingSettings::FaceOrientationPickingMode faceOrientationPickingMode() const { return m_faceOrientationPickingMode; }
41 float pickWorldSpaceTolerance() const { return m_pickWorldSpaceTolerance; }
42 QString capabilities() const { return m_capabilities; }
43
44 // For unit test purposes
45 void setActiveFrameGraphId(Qt3DCore::QNodeId frameGraphNodeId) { m_activeFrameGraph = frameGraphNodeId; }
46
47private:
48 QRenderSettings::RenderPolicy m_renderPolicy;
49 QPickingSettings::PickMethod m_pickMethod;
50 QPickingSettings::PickResultMode m_pickResultMode;
51 QPickingSettings::FaceOrientationPickingMode m_faceOrientationPickingMode;
52 float m_pickWorldSpaceTolerance;
53 Qt3DCore::QNodeId m_activeFrameGraph;
54 QString m_capabilities;
55};
56
57class RenderSettingsFunctor : public Qt3DCore::QBackendNodeMapper
58{
59public:
60 explicit RenderSettingsFunctor(AbstractRenderer *renderer);
61 Qt3DCore::QBackendNode *create(Qt3DCore::QNodeId id) const override;
62 Qt3DCore::QBackendNode *get(Qt3DCore::QNodeId id) const override;
63 void destroy(Qt3DCore::QNodeId id) const override;
64
65private:
66 AbstractRenderer *m_renderer;
67};
68
69} // namespace Render
70} // namespace Qt3DRender
71
72QT_END_NAMESPACE
73
74#endif // QT3DRENDER_RENDER_RENDERSETTINGS_H
75

source code of qt3d/src/render/backend/rendersettings_p.h