summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2014-09-29 17:19:36 +0200
committerSean Harmer <sean.harmer@kdab.com>2014-10-03 21:18:41 +0200
commit7b26f6a1746419161a8f875e341b3e31220f4141 (patch)
treef784e568015e1f7f199abb388b97fefdb158c84e /src/plugins
parentc16689bb1ccf31416df7b8c69fe032898cf87dec (diff)
QNode refactoring
Move almost everything to private classes. Assimp loading restored. All examples working. QNode hierachy is now handled through QObject::setParent, addChild, removeChild are part of the private api. Note: commented QChangeArbiter unit tests as they can no longer work with this patch and will restore them when QChangeArbiter will have been made private. Task-number: QTBUG-41470 Task-number: QTBUG-41523 Change-Id: I4430974b3aa7f3744c38714b451b122e0cb4d0c9 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/sceneparsers/assimp/assimpparser.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/sceneparsers/assimp/assimpparser.cpp b/src/plugins/sceneparsers/assimp/assimpparser.cpp
index ebfad8c7d..9e5a067a5 100644
--- a/src/plugins/sceneparsers/assimp/assimpparser.cpp
+++ b/src/plugins/sceneparsers/assimp/assimpparser.cpp
@@ -191,7 +191,7 @@ public :
private:
QMeshDataPtr m_meshData;
- AssimpMesh *doClone(bool isClone = true) const Q_DECL_OVERRIDE;
+ AssimpMesh *doClone() const Q_DECL_OVERRIDE;
class AssimpMeshFunctor : public QAbstractMeshFunctor
{
@@ -208,8 +208,8 @@ private:
* Initialized a new instance of AssimpParser.
*/
AssimpParser::AssimpParser() : AbstractSceneParser(),
- m_scene(Q_NULLPTR),
- m_sceneParsed(false)
+ m_sceneParsed(false),
+ m_scene(Q_NULLPTR)
{
Assimp::DefaultLogger::create("AssimpLog.txt", Assimp::Logger::VERBOSE);
Assimp::DefaultLogger::kill();
@@ -338,8 +338,9 @@ QEntity *AssimpParser::node(aiNode *node)
// this-> is necessary here otherwise
// it conflicts with the variable node
QEntity *child = this->node(node->mChildren[i]);
+ // Are we sure each child are unique ???
if (child != Q_NULLPTR)
- entityNode->addChild(child);
+ child->setParent(entityNode);
}
// Add Transformations
@@ -350,7 +351,7 @@ QEntity *AssimpParser::node(aiNode *node)
// Add Camera
if (m_scene->m_cameras.contains(node))
- entityNode->addChild(m_scene->m_cameras.value(node));
+ m_scene->m_cameras.value(node)->setParent(entityNode);
// TO DO : Add lights ....
@@ -830,11 +831,10 @@ void AssimpMesh::setData(QMeshDataPtr data)
QAbstractMesh::setDirty(this);
}
-AssimpMesh *AssimpMesh::doClone(bool isClone) const
+AssimpMesh *AssimpMesh::doClone() const
{
AssimpMesh *clone = new AssimpMesh();
clone->copy(this);
- clone->d_func()->m_isClone = isClone;
return clone;
}