Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qssgrendergraphobject_p.h
Go to the documentation of this file.
1// Copyright (C) 2008-2012 NVIDIA Corporation.
2// Copyright (C) 2019 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
4
5#ifndef QSSG_RENDER_GRAPH_OBJECT_H
6#define QSSG_RENDER_GRAPH_OBJECT_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtQuick3DRuntimeRender/private/qtquick3druntimerenderglobal_p.h>
20#include <QtQuick3DUtils/private/qquick3dprofiler_p.h>
21#include <QtCore/QString>
22#include <QtCore/QDebug>
23
24#define QSSG_DEBUG_ID 0
25
27
28struct Q_QUICK3DRUNTIMERENDER_EXPORT QSSGRenderGraphObject
29{
30 // Types should be setup on construction. Change the type
31 // at your own risk as the type is used for RTTI purposes.
32 // See QSSGRenderGraphObject, QQuick3DObject and QSSceneDesc (asset useage).
33
35 {
36 Node = 0x10,
37 Light = 0x20,
38 Camera = 0x40,
39 Renderable = 0x80,
40 Resource = 0x100,
41 Material = 0x200,
42 Texture = 0x400,
43 Extension = 0x800
44 };
45
46 enum class Type : quint16 {
47 Unknown = 0,
48 // Nodes
49 Node = BaseType::Node,
50 Layer, // Node
51 Joint, // Node
52 Skeleton, // Node (A resource to the model node)
53 ImportScene, // Node
54 ReflectionProbe,
55 // Light nodes
56 DirectionalLight = BaseType::Light | BaseType::Node,
57 PointLight,
58 SpotLight,
59 // Camera nodes
60 OrthographicCamera = BaseType::Camera | BaseType::Node,
61 PerspectiveCamera,
62 CustomFrustumCamera, // Perspective camera with user specified frustum bounds.
63 CustomCamera,
64 // Renderable nodes
65 Model = BaseType::Renderable | BaseType::Node, // Renderable Node
66 Item2D, // Renderable Node
67 Particles, // Renderable Node
68 // Resources
69 SceneEnvironment = BaseType::Resource, // Resource
70 Effect, // Resource
71 Geometry, // Resource
72 TextureData, // Resource
73 MorphTarget, // Resource
74 ModelInstance, // Resource
75 ModelBlendParticle, // Resource
76 ResourceLoader, // Resource [meta]
77 // Materials
78 DefaultMaterial = BaseType::Material | BaseType::Resource, // Resource
79 PrincipledMaterial, // Resource
80 CustomMaterial, // Resource
81 SpecularGlossyMaterial, //Resource
82 Skin, // Resource
83 // Textures
84 Image2D = BaseType::Texture | BaseType::Resource, // Resource
85 ImageCube, // Resource
86 RenderExtension = BaseType::Extension // Extension
87 };
88
89 Q_REQUIRED_RESULT static inline constexpr bool isNodeType(Type type) Q_DECL_NOTHROW
90 {
91 return (quint16(type) & BaseType::Node);
92 }
93
94 Q_REQUIRED_RESULT static inline constexpr bool isLight(Type type) Q_DECL_NOTHROW
95 {
96 return (quint16(type) & BaseType::Light);
97 }
98
99 Q_REQUIRED_RESULT static inline constexpr bool isCamera(Type type) Q_DECL_NOTHROW
100 {
101 return (quint16(type) & BaseType::Camera);
102 }
103
105 {
106 return (quint16(type) & BaseType::Material);
107 }
108
109 Q_REQUIRED_RESULT static inline constexpr bool isTexture(Type type) Q_DECL_NOTHROW
110 {
111 return (quint16(type) & BaseType::Texture);
112 }
113
115 {
116 return (quint16(type) & BaseType::Renderable);
117 }
118
120 {
121 return (quint16(type) & BaseType::Resource);
122 }
123
124 [[nodiscard]] static inline constexpr bool isExtension(Type type) noexcept
125 {
126 return (quint16(type) & BaseType::Extension);
127 }
128
129 // These require special handling, see cleanupNodes() in the scene manager.
131 {
132 return ((type == Type::Model)
133 || (isTexture(type))
134 || (type == Type::Geometry)
135 || (type == Type::TextureData)
136 || (type == Type::ResourceLoader));
137 }
138
139 // Id's help debugging the object and are optionally set
140#if QSSG_DEBUG_ID
142#endif
143 // Type is used for RTTI purposes down the road.
146
148 virtual ~QSSGRenderGraphObject();
149
150 Q_DISABLE_COPY_MOVE(QSSGRenderGraphObject)
151
152 static const char *asString(QSSGRenderGraphObject::Type type);
153 static QDebug debugPrintImpl(QDebug stream, QSSGRenderGraphObject::Type type);
154
156 {
157 return debugPrintImpl(stream, type);
158 }
159
160};
161
163
164#endif
Definition lalr.h:137
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
Combined button and popup list for selecting options.
#define Q_DECL_NOTHROW
#define Q_REQUIRED_RESULT
EGLStreamKHR stream
GLenum GLuint id
[7]
GLenum type
#define Q_QUICK3D_PROFILE_ID
unsigned short quint16
Definition qtypes.h:43
static Q_REQUIRED_RESULT constexpr bool isNodeType(Type type) Q_DECL_NOTHROW
static Q_REQUIRED_RESULT constexpr bool isTexture(Type type) Q_DECL_NOTHROW
static Q_REQUIRED_RESULT constexpr bool isLight(Type type) Q_DECL_NOTHROW
static constexpr bool isExtension(Type type) noexcept
friend QDebug operator<<(QDebug stream, QSSGRenderGraphObject::Type type)
static Q_REQUIRED_RESULT constexpr bool hasGraphicsResources(Type type) Q_DECL_NOTHROW
static Q_REQUIRED_RESULT constexpr bool isResource(Type type) Q_DECL_NOTHROW
static Q_REQUIRED_RESULT constexpr bool isCamera(Type type) Q_DECL_NOTHROW
static Q_REQUIRED_RESULT constexpr bool isRenderable(Type type) Q_DECL_NOTHROW
Q_QUICK3D_PROFILE_ID QSSGRenderGraphObject(QSSGRenderGraphObject::Type inType)
static Q_REQUIRED_RESULT constexpr bool isMaterial(Type type) Q_DECL_NOTHROW
Definition moc.h:24