Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquick3dresourceloader_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4
5#ifndef QQUICK3DRESOURCELOADER_H
6#define QQUICK3DRESOURCELOADER_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 <QtQuick3D/private/qquick3dnode_p.h>
20#include <QtQuick3D/private/qquick3dgeometry_p.h>
21#include <QtQuick3D/private/qquick3dtexture_p.h>
22#include <QtQml/QQmlListProperty>
23
25
26class Q_QUICK3D_EXPORT QQuick3DResourceLoader : public QQuick3DObject
27{
29 Q_PROPERTY(QList<QUrl> meshSources READ meshSources WRITE setMeshSources NOTIFY meshSourcesChanged)
31 Q_PROPERTY(QQmlListProperty<QQuick3DGeometry> geometries READ geometries)
32 QML_NAMED_ELEMENT(ResourceLoader)
34public:
35 QQuick3DResourceLoader(QQuick3DObject *parent = nullptr);
36
37 const QList<QUrl> &meshSources() const;
38 void setMeshSources(const QList<QUrl> &newMeshSources);
42 void meshSourcesChanged();
43
45 void onGeometryDestroyed(QObject *object);
46 void onTextureDestroyed(QObject *object);
47protected:
48 QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override;
49 void markAllDirty() override;
50 void itemChange(ItemChange change, const ItemChangeData &value) override;
51
53 static void qmlAppendGeometry(QQmlListProperty<QQuick3DGeometry> *list, QQuick3DGeometry *geometry);
55 static qsizetype qmlGeometriesCount(QQmlListProperty<QQuick3DGeometry> *list);
56 static void qmlClearGeometries(QQmlListProperty<QQuick3DGeometry> *list);
57
58 static void qmlAppendTexture(QQmlListProperty<QQuick3DTexture> *list, QQuick3DTexture *texture);
60 static qsizetype qmlTexturesCount(QQmlListProperty<QQuick3DTexture> *list);
61 static void qmlClearTextures(QQmlListProperty<QQuick3DTexture> *list);
62
63 enum ResourceLoaderDirtyType {
64 MeshesDirty = 0x00000001,
65 TexturesDirty = 0x00000002,
66 GeometriesDirty = 0x00000004
67 };
68
69
70 quint32 m_dirtyAttributes = 0xffffffff; // all dirty by default
71 void markDirty(ResourceLoaderDirtyType type);
72 void updateSceneManager(QQuick3DSceneManager *sceneManager);
73
74 QList<QUrl> m_meshSources;
75 QList<QQuick3DGeometry *> m_geometries;
76 QList<QQuick3DTexture *> m_textures;
77};
78
80
81#endif // QQUICK3DRESOURCELOADER_H
Definition qlist.h:75
\inmodule QtCore
Definition qobject.h:103
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
Definition qqmllist.h:24
\qmltype Geometry \inherits Object3D \inqmlmodule QtQuick3D \instantiates QQuick3DGeometry
\qmltype Object3D \inqmlmodule QtQuick3D \instantiates QQuick3DObject \inherits QtObject
\inmodule QtCore
Definition qurl.h:94
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLuint index
[2]
GLuint const GLuint GLuint const GLuint * textures
GLenum type
GLenum GLuint texture
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
unsigned int quint32
Definition qtypes.h:50
ptrdiff_t qsizetype
Definition qtypes.h:165
QList< int > list
[14]