diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2014-07-28 14:09:55 +0200 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2014-08-13 20:19:07 +0200 |
commit | 93ee103b8539a56924e12a6887130d57847370fc (patch) | |
tree | b870c9848f8ebc5a5995d194bf44ecba98ee9553 /src/render/frontend/qcuboidmesh.cpp | |
parent | dfbddfa90384780bc64db073a7912f6eef928f62 (diff) |
QCuboidMesh implements doClone and copy methods
Change-Id: I1f10e6dc8eda39e2058926748e103c877d6d7daa
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/frontend/qcuboidmesh.cpp')
-rw-r--r-- | src/render/frontend/qcuboidmesh.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/render/frontend/qcuboidmesh.cpp b/src/render/frontend/qcuboidmesh.cpp index 5577cc314..42d603c99 100644 --- a/src/render/frontend/qcuboidmesh.cpp +++ b/src/render/frontend/qcuboidmesh.cpp @@ -68,12 +68,32 @@ QCuboidMesh::QCuboidMesh(QNode *parent) setDirty(true); } +void QCuboidMesh::copy(const QNode *ref) +{ + Q_D(QCuboidMesh); + QAbstractShapeMesh::copy(ref); + const QCuboidMesh *mesh = qobject_cast<const QCuboidMesh *>(mesh); + 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(); + } +} + QCuboidMesh::QCuboidMesh(QCuboidMeshPrivate &dd, QNode *parent) : QAbstractShapeMesh(dd, parent) { setDirty(true); } +QCuboidMesh *QCuboidMesh::doClone(QNode *clonedParent) const +{ + return new QCuboidMesh(clonedParent); +} + void QCuboidMesh::setXExtent(float xExtent) { Q_D(QCuboidMesh); |