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
qquick3drenderextensions.cpp
Go to the documentation of this file.
1// Copyright (C) 2023 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
7
8#include <QtQuick3D/private/qquick3dobject_p.h>
9
11
12/*!
13 \class QQuick3DRenderExtension
14 \inmodule QtQuick3D
15 \since 6.7
16
17 \brief Abstract class for implementing user side render extensions.
18
19 This is the front-end side of a render extension. The back-end side is implemented
20 in \l QSSGRenderExtension. The QQuick3DRenderExtension class is used to create a custom
21 render extension that can be used in the QtQuick3D scene graph by adding it to the list of
22 extensions to be used with a \l View3D. The extension code will then be run as part of
23 QtQuick3D's rendering pipeline execution.
24
25 The QQuick3DRenderExtension class is an abstract class that should be subclassed and
26 exposed to QML. The subclass should implement the \l QQuick3DRenderExtension::updateSpatialNode()
27 function and return a QSSGRenderExtension instance that contains the code that should be run.
28
29 \sa QSSGRenderExtension
30*/
31
32/*!
33 \qmltype RenderExtension
34 \nativetype QQuick3DRenderExtension
35 \inqmlmodule QtQuick3D
36 \inherits Object3D
37 \since 6.7
38 \brief An uncreatable abstract base type for render extensions.
39
40 \sa QQuick3DRenderExtension, QSSGRenderExtension, View3D::extensions()
41*/
42
43QQuick3DRenderExtension::QQuick3DRenderExtension(QQuick3DObjectPrivate &dd, QQuick3DObject *parent)
44 : QQuick3DObject(dd, parent)
45{
46
47}
48
49QQuick3DRenderExtension::QQuick3DRenderExtension(QQuick3DObject *parent)
50 : QQuick3DRenderExtension(*new QQuick3DObjectPrivate(QQuick3DObjectPrivate::Type::RenderExtension), parent)
51{
52
53}
54
55QQuick3DRenderExtension::~QQuick3DRenderExtension()
56{
57
58}
59
60/*!
61 \fn QSSGRenderGraphObject *QQuick3DRenderExtension::updateSpatialNode(QSSGRenderGraphObject *node)
62
63 This function is called during the synchronization of the QtQuick3D scene graph when an item is
64 created or when an update is requested, usually as a result of a change in the item's properties.
65 The function should return a QSSGRenderExtension instance that contains the code that should be
66 run during QtQuick3D's rendering pipeline execution.
67
68 The \a node parameter is the previous QSSGRenderExtension instance that was returned from this
69 function, or null if this is the first time the function is called. The function can return the
70 same instance, a different instance, or null. If the function returns null, the extension will
71 be removed from the rendering pipeline.
72
73 \note The QSSGRenderExtension instance is a resource object and will be owned by the QtQuick3D
74 scene graph. If a different instance, or null, is returned, the previous instance will be
75 queued for deletion by the renderer.
76
77 \sa QSSGRenderExtension
78*/
79
80QSSGRenderGraphObject *QQuick3DRenderExtension::updateSpatialNode(QSSGRenderGraphObject *node)
81{
82 return QQuick3DObject::updateSpatialNode(node);
83}
84
85
86
87
88
89QT_END_NAMESPACE
Combined button and popup list for selecting options.