summaryrefslogtreecommitdiffstats
path: root/src/render/frontend/qcuboidmesh.cpp
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/render/frontend/qcuboidmesh.cpp
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/render/frontend/qcuboidmesh.cpp')
-rw-r--r--src/render/frontend/qcuboidmesh.cpp32
1 files changed, 14 insertions, 18 deletions
diff --git a/src/render/frontend/qcuboidmesh.cpp b/src/render/frontend/qcuboidmesh.cpp
index 28ba881ee..ea58fd9c0 100644
--- a/src/render/frontend/qcuboidmesh.cpp
+++ b/src/render/frontend/qcuboidmesh.cpp
@@ -62,25 +62,22 @@ QCuboidMeshPrivate::QCuboidMeshPrivate(QCuboidMesh *qq)
{
}
-QCuboidMesh::QCuboidMesh(QNode *parent)
- : QAbstractShapeMesh(*new QCuboidMeshPrivate(this), parent)
+void QCuboidMeshPrivate::copy(const QNodePrivate *ref)
{
- setDirty(true);
+ QAbstractShapeMeshPrivate::copy(ref);
+ const QCuboidMeshPrivate *mesh = static_cast<const QCuboidMeshPrivate *>(ref);
+ m_xExtent = mesh->m_xExtent;
+ m_yExtent = mesh->m_yExtent;
+ m_zExtent = mesh->m_zExtent;
+ m_yzFaceResolution = mesh->m_yzFaceResolution;
+ m_xzFaceResolution = mesh->m_xzFaceResolution;
+ m_xyFaceResolution = mesh->m_xyFaceResolution;
}
-void QCuboidMesh::copy(const QNode *ref)
+QCuboidMesh::QCuboidMesh(QNode *parent)
+ : QAbstractShapeMesh(*new QCuboidMeshPrivate(this), parent)
{
- Q_D(QCuboidMesh);
- QAbstractShapeMesh::copy(ref);
- const QCuboidMesh *mesh = qobject_cast<const QCuboidMesh *>(ref);
- if (mesh != Q_NULLPTR) {
- d->m_xExtent = mesh->xExtent();
- d->m_yExtent = mesh->yExtent();
- d->m_zExtent = mesh->zExtent();
- d->m_yzFaceResolution = mesh->yzMeshResolution();
- d->m_xzFaceResolution = mesh->xzMeshResolution();
- d->m_xyFaceResolution = mesh->xyMeshResolution();
- }
+ setDirty(true);
}
QCuboidMesh::QCuboidMesh(QCuboidMeshPrivate &dd, QNode *parent)
@@ -89,11 +86,10 @@ QCuboidMesh::QCuboidMesh(QCuboidMeshPrivate &dd, QNode *parent)
setDirty(true);
}
-QCuboidMesh *QCuboidMesh::doClone(bool isClone) const
+QCuboidMesh *QCuboidMesh::doClone() const
{
QCuboidMesh *clone = new QCuboidMesh();
- clone->copy(this);
- clone->d_func()->m_isClone = isClone;
+ clone->d_func()->copy(d_func());
return clone;
}