| 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 | |
| 12 | QT_BEGIN_NAMESPACE |
| 13 | |
| 14 | namespace Qt3DCore { |
| 15 | |
| 16 | class QAbstractAspect; |
| 17 | class QAspectThread; |
| 18 | class QAspectEnginePrivate; |
| 19 | class QEntity; |
| 20 | class QNode; |
| 21 | |
| 22 | typedef QSharedPointer<QEntity> QEntityPtr; |
| 23 | |
| 24 | class Q_3DCORESHARED_EXPORT QAspectEngine : public QObject |
| 25 | { |
| 26 | Q_OBJECT |
| 27 | public: |
| 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 | |
| 58 | private: |
| 59 | Q_DECLARE_PRIVATE(QAspectEngine) |
| 60 | }; |
| 61 | |
| 62 | } // namespace Qt3DCore |
| 63 | |
| 64 | QT_END_NAMESPACE |
| 65 | |
| 66 | |
| 67 | #endif // QT3DCORE_QASPECTENGINE_H |
| 68 |
