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_RENDER_SCENE_P_H |
5 | #define QT3DRENDER_RENDER_SCENE_P_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists for the convenience |
12 | // of other Qt classes. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include <Qt3DRender/private/backendnode_p.h> |
19 | #include <Qt3DRender/qsceneloader.h> |
20 | #include <QtGlobal> |
21 | #include <QUrl> |
22 | |
23 | QT_BEGIN_NAMESPACE |
24 | |
25 | namespace Qt3DCore { |
26 | class QEntity; |
27 | } |
28 | |
29 | namespace Qt3DRender { |
30 | namespace Render { |
31 | |
32 | class SceneManager; |
33 | |
34 | class Q_3DRENDERSHARED_PRIVATE_EXPORT Scene : public BackendNode |
35 | { |
36 | public: |
37 | Scene(); |
38 | |
39 | void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) override; |
40 | QUrl source() const; |
41 | void setSceneManager(SceneManager *manager); |
42 | |
43 | void cleanup(); |
44 | void setStatus(QSceneLoader::Status status); |
45 | |
46 | private: |
47 | SceneManager *m_sceneManager; |
48 | QUrl m_source; |
49 | }; |
50 | |
51 | class RenderSceneFunctor : public Qt3DCore::QBackendNodeMapper |
52 | { |
53 | public: |
54 | explicit RenderSceneFunctor(AbstractRenderer *renderer, SceneManager *sceneManager); |
55 | Qt3DCore::QBackendNode *create(Qt3DCore::QNodeId id) const override; |
56 | Qt3DCore::QBackendNode *get(Qt3DCore::QNodeId id) const override; |
57 | void destroy(Qt3DCore::QNodeId id) const override; |
58 | |
59 | private: |
60 | SceneManager *m_sceneManager; |
61 | AbstractRenderer *m_renderer; |
62 | }; |
63 | |
64 | } // namespace Render |
65 | } // namespace Qt3DRender |
66 | |
67 | QT_END_NAMESPACE |
68 | |
69 | #endif // QT3DRENDER_RENDER_SCENE_P_H |
70 | |