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 QT3DCORE_QASPECTENGINE_P_H
5#define QT3DCORE_QASPECTENGINE_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 <Qt3DCore/private/qt3dcore_global_p.h>
19#include <QtCore/qsharedpointer.h>
20
21#include <Qt3DCore/private/qaspectfactory_p.h>
22#include <Qt3DCore/private/qaspectengine_p.h>
23#include <Qt3DCore/private/qabstractfrontendnodemanager_p.h>
24#include <QtCore/private/qobject_p.h>
25
26QT_BEGIN_NAMESPACE
27
28namespace Qt3DCore {
29
30class QEntity;
31class QNode;
32class QAspectManager;
33class QScene;
34
35class Q_3DCORE_PRIVATE_EXPORT QAspectEnginePrivate : public QObjectPrivate, public QAbstractFrontEndNodeManager
36{
37public:
38 QAspectEnginePrivate();
39 ~QAspectEnginePrivate();
40
41 Q_DECLARE_PUBLIC(QAspectEngine)
42
43 QAspectFactory m_factory;
44 QAspectManager *m_aspectManager;
45 QScene *m_scene;
46 QSharedPointer<QEntity> m_root;
47 QList<QAbstractAspect*> m_aspects;
48 QHash<QString, QAbstractAspect *> m_namedAspects;
49 bool m_initialized;
50 QAspectEngine::RunMode m_runMode;
51
52 void initialize();
53 void shutdown();
54
55 void exitSimulationLoop();
56
57 void initNodeTree(QNode *node);
58 void initNode(QNode *node);
59 void initEntity(QEntity *entity);
60 void addNode(QNode *node);
61 void removeNode(QNode *node);
62
63 QNode *lookupNode(QNodeId id) const override;
64 QList<QNode *> lookupNodes(const QList<QNodeId> &ids) const override;
65
66 static QAspectEnginePrivate *get(QAspectEngine *engine);
67};
68
69} // Qt3D
70
71QT_END_NAMESPACE
72
73#endif // QT3DCORE_QASPECTENGINE_P_H
74

source code of qt3d/src/core/aspects/qaspectengine_p.h