1// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QT3DRENDER_QSCENELOADER_H
5#define QT3DRENDER_QSCENELOADER_H
6
7#include <Qt3DCore/qcomponent.h>
8#include <Qt3DRender/qt3drender_global.h>
9#include <QtCore/QUrl>
10
11QT_BEGIN_NAMESPACE
12
13namespace Qt3DRender {
14
15class QSceneLoaderPrivate;
16
17class Q_3DRENDERSHARED_EXPORT QSceneLoader : public Qt3DCore::QComponent
18{
19 Q_OBJECT
20 Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
21 Q_PROPERTY(Status status READ status NOTIFY statusChanged)
22public:
23 explicit QSceneLoader(Qt3DCore::QNode *parent = nullptr);
24 ~QSceneLoader();
25
26 enum Status {
27 None = 0,
28 Loading,
29 Ready,
30 Error
31 };
32 Q_ENUM(Status) // LCOV_EXCL_LINE
33
34 enum ComponentType {
35 UnknownComponent = 0,
36 GeometryRendererComponent,
37 TransformComponent,
38 MaterialComponent,
39 LightComponent,
40 CameraLensComponent
41 };
42 Q_ENUM(ComponentType)
43
44 QUrl source() const;
45 Status status() const;
46
47 Q_REVISION(9) Q_INVOKABLE Qt3DCore::QEntity *entity(const QString &entityName) const;
48 Q_REVISION(9) Q_INVOKABLE QStringList entityNames() const;
49 Q_REVISION(9) Q_INVOKABLE Qt3DCore::QComponent *component(const QString &entityName,
50 ComponentType componentType) const;
51
52public Q_SLOTS:
53 void setSource(const QUrl &arg);
54
55Q_SIGNALS:
56 void sourceChanged(const QUrl &source);
57 void statusChanged(Status status);
58
59protected:
60 explicit QSceneLoader(QSceneLoaderPrivate &dd, Qt3DCore::QNode *parent = nullptr);
61
62private:
63 Q_DECLARE_PRIVATE(QSceneLoader)
64};
65
66} // namespace Qt3DRender
67
68QT_END_NAMESPACE
69
70#endif // QT3DRENDER_QSCENELOADER_H
71

source code of qt3d/src/render/io/qsceneloader.h