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_H
5#define QT3DCORE_QASPECTENGINE_H
6
7#include <Qt3DCore/qt3dcore_global.h>
8#include <Qt3DCore/qnodeid.h>
9#include <QtCore/QList>
10#include <QtCore/QObject>
11
12QT_BEGIN_NAMESPACE
13
14namespace Qt3DCore {
15
16class QAbstractAspect;
17class QAspectThread;
18class QAspectEnginePrivate;
19class QEntity;
20class QNode;
21
22typedef QSharedPointer<QEntity> QEntityPtr;
23
24class Q_3DCORESHARED_EXPORT QAspectEngine : public QObject
25{
26 Q_OBJECT
27public:
28 enum RunMode {
29 Manual = 0,
30 Automatic
31 };
32 Q_ENUM(RunMode)
33
34 explicit QAspectEngine(QObject *parent = nullptr);
35 ~QAspectEngine();
36
37 void setRootEntity(QEntityPtr root);
38 QEntityPtr rootEntity() const;
39
40 void setRunMode(RunMode mode);
41 RunMode runMode() const;
42
43 void registerAspect(QAbstractAspect *aspect);
44 void registerAspect(const QString &name);
45 void unregisterAspect(QAbstractAspect *aspect);
46 void unregisterAspect(const QString &name);
47
48 QList<QAbstractAspect*> aspects() const;
49 QAbstractAspect *aspect(const QString &name) const;
50
51 QVariant executeCommand(const QString &command);
52
53 void processFrame();
54
55 QNode *lookupNode(QNodeId id) const;
56 QList<QNode *> lookupNodes(const QList<QNodeId> &ids) const;
57
58private:
59 Q_DECLARE_PRIVATE(QAspectEngine)
60};
61
62} // namespace Qt3DCore
63
64QT_END_NAMESPACE
65
66
67#endif // QT3DCORE_QASPECTENGINE_H
68

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