1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QQUICK3DDEBUGSETTINGS_H
5#define QQUICK3DDEBUGSETTINGS_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 purely as an
12// implementation detail. 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 <QtQuick3D/private/qquick3dobject_p.h>
19
20QT_BEGIN_NAMESPACE
21
22class Q_QUICK3D_EXPORT QQuick3DDebugSettings : public QObject
23{
24 Q_OBJECT
25 Q_PROPERTY(QQuick3DMaterialOverrides materialOverride READ materialOverride WRITE setMaterialOverride NOTIFY materialOverrideChanged)
26 Q_PROPERTY(bool wireframeEnabled READ wireframeEnabled WRITE setWireframeEnabled NOTIFY wireframeEnabledChanged)
27 QML_NAMED_ELEMENT(DebugSettings)
28public:
29 enum QQuick3DMaterialOverrides {
30 None,
31 BaseColor,
32 Roughness,
33 Metalness,
34 Diffuse,
35 Specular,
36 ShadowOcclusion,
37 Emission,
38 AmbientOcclusion,
39 Normals,
40 Tangents,
41 Binormals,
42 F0
43 };
44 Q_ENUM(QQuick3DMaterialOverrides)
45
46 explicit QQuick3DDebugSettings(QObject *parent = nullptr);
47
48 QQuick3DMaterialOverrides materialOverride() const;
49 void setMaterialOverride(QQuick3DMaterialOverrides newMaterialOverride);
50
51 bool wireframeEnabled() const;
52 void setWireframeEnabled(bool newWireframeEnabled);
53
54Q_SIGNALS:
55 void materialOverrideChanged();
56 void wireframeEnabledChanged();
57 void changed();
58
59private:
60 void update();
61 QQuick3DMaterialOverrides m_materialOverride = None;
62
63 bool m_wireframeEnabled = false;
64};
65
66QT_END_NAMESPACE
67
68#endif // QQUICK3DDEBUGSETTINGS_H
69

source code of qtquick3d/src/quick3d/qquick3ddebugsettings_p.h