diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2014-09-02 12:30:39 +0200 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2014-09-15 12:36:41 +0200 |
commit | ace4c69538cc6f5bc22f51fe41edaa3dddb28a16 (patch) | |
tree | 620d3064607a7432c3c73e880e53cc5b167d001a /src/core/aspects/qaspectengine.h | |
parent | e934fa27483dbc0e2648ab290a4124599f414609 (diff) |
QAspectEngine QNode lookup table
QNode now contains an instance of the QAspectEngine. When the scene is first
created, all nodes are traversed and inserted in a table referenced by their
uuid.
When new nodes are added at runtine, QNode::addChild takes care of inserting
the new node into the QAspectEngine's table. The same applies for
QNode::removeChild.
QNode now also has a isCloned() method.
QFrontendSceneObserver has a pointer to the QAspectEngine.
QFrontendSceneObserver will need to check in the QAspectEngine's table if a
node is available to receive the notification when sceneUpdated is called.
Change-Id: Ic243261ecff5e15f841ca180cb97ba65df2b3bfb
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/core/aspects/qaspectengine.h')
-rw-r--r-- | src/core/aspects/qaspectengine.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/aspects/qaspectengine.h b/src/core/aspects/qaspectengine.h index 613878b2e..90df4b979 100644 --- a/src/core/aspects/qaspectengine.h +++ b/src/core/aspects/qaspectengine.h @@ -52,6 +52,7 @@ class QWindow; namespace Qt3D { +class QNode; class QAbstractAspect; class QAspectThread; class QAspectEnginePrivate; @@ -65,13 +66,20 @@ public: void initialize(); void shutdown(); - void setRoot(QObject *rootObject); + void setRoot(QNode *rootObject); void setWindow(QWindow *window); void registerAspect(QAbstractAspect *aspect); + void addNodeLookup(QNode *node); + void removeNodeLookup(QNode *node); + QNode *lookupNode(const QUuid &id) const; + protected: Q_DECLARE_PRIVATE(QAspectEngine) QAspectEngine(QAspectEnginePrivate &dd, QObject *parent = 0); + +private: + void initNodeTree(QNode *node); }; } // namespace Qt3D |