diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2014-09-15 17:04:13 +0200 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2014-09-30 00:23:23 +0200 |
commit | f382993d407ae57302e3999e89783779c97716a0 (patch) | |
tree | c625c07a00e8110890a378ec899d9ef44ca76a78 /src/render/frontend/qcylindermesh.cpp | |
parent | 7c05bc82dbf0e200c6a6534a70dea9f2ba42fcc5 (diff) |
Comparison operator for QAbstractMeshFunctor subclasses
Change-Id: I18f0c46631615787a5505f7591514bfd33ac6bd0
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/frontend/qcylindermesh.cpp')
-rw-r--r-- | src/render/frontend/qcylindermesh.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/render/frontend/qcylindermesh.cpp b/src/render/frontend/qcylindermesh.cpp index da917c808..e01c6b441 100644 --- a/src/render/frontend/qcylindermesh.cpp +++ b/src/render/frontend/qcylindermesh.cpp @@ -60,12 +60,14 @@ class CylinderMeshFunctor : public QAbstractMeshFunctor public: CylinderMeshFunctor(int rings, int slices, float radius, float length); QAbstractMeshDataPtr operator ()() Q_DECL_OVERRIDE; + bool operator ==(const QAbstractMeshFunctor &other) const; private: int m_rings; int m_slices; float m_radius; float m_length; + }; class QCylinderMeshPrivate : public QAbstractShapeMeshPrivate @@ -351,6 +353,17 @@ QAbstractMeshDataPtr CylinderMeshFunctor::operator ()() return createCylinderMesh(m_radius, m_length, m_rings, m_slices); } +bool CylinderMeshFunctor::operator ==(const QAbstractMeshFunctor &other) const +{ + const CylinderMeshFunctor *otherFunctor = dynamic_cast<const CylinderMeshFunctor *>(&other); + if (otherFunctor != Q_NULLPTR) + return (otherFunctor->m_radius == m_radius && + otherFunctor->m_length == m_length && + otherFunctor->m_rings == m_rings && + otherFunctor->m_slices == m_slices); + return false; +} + } // Qt3D QT_END_NAMESPACE |