Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qssgrenderroot_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5
6#ifndef QSSGRENDERROOT_P_H
7#define QSSGRENDERROOT_P_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QtQuick3DRuntimeRender/private/qssgrendernode_p.h>
21
22#include <QtGui/qmatrix4x4.h>
23
24#include <memory>
25
27
28class QSSGGlobalRenderNodeData;
29
30class Q_QUICK3DRUNTIMERENDER_EXPORT QSSGRenderRoot final : public QSSGRenderNode
31{
32public:
33 QSSGRenderRoot();
34 ~QSSGRenderRoot();
35
36 enum class DirtyFlag : quint8
37 {
38 TreeDirty = 0x1
39 };
40 using FlagT = std::underlying_type_t<DirtyFlag>;
41
42 static constexpr DirtyFlag DirtyMask { std::numeric_limits<FlagT>::max() };
43
44 [[nodiscard]] bool isDirty(DirtyFlag dirtyFlag = DirtyMask) const
45 {
46 return ((m_rootDirtyFlags & FlagT(dirtyFlag)) != 0)
47 || ((dirtyFlag == DirtyMask) && QSSGRenderNode::isDirty());
48 }
49 void markDirty(DirtyFlag dirtyFlag);
50 void clearDirty(DirtyFlag dirtyFlag);
51
52 [[nodiscard]] const std::shared_ptr<QSSGGlobalRenderNodeData> &globalNodeData() const
53 {
54 return m_gnd;
55 }
56
57 // This is the starting point when indexing the nodes.
58 // By default it is 0, which means the first version when
59 // indexing will be 1. The start version can be set to a
60 // different value when needed. For example we'll set this
61 // to the last version of the layer node when the window
62 // changes, as that avoids accidentally re-using the same
63 // version when re-indexing the layer node, as that can cause
64 // issues.
65 void setStartVersion(quint32 startVersion)
66 {
67 m_startVersion = startVersion;
68 }
69
70 [[nodiscard]] quint32 startVersion() const
71 {
72 return m_startVersion;
73 }
74
75 [[nodiscard]] static QSSGRenderRoot *get(QSSGRenderRoot **ref)
76 {
77 return (ref && *ref) ? *ref : nullptr;
78 }
79
80 void reindex();
81
82private:
83 QSSGRenderRoot *self = this;
84 quint32 m_startVersion = 0;
85 std::shared_ptr<QSSGGlobalRenderNodeData> m_gnd;
86 FlagT m_rootDirtyFlags = FlagT(DirtyFlag::TreeDirty);
87};
88
89QT_END_NAMESPACE
90
91#endif // QSSGRENDERROOT_P_H
Combined button and popup list for selecting options.