summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2014-10-20 07:44:12 +0200
committerSean Harmer <sean.harmer@kdab.com>2014-10-20 08:47:17 +0200
commit0c8a6df93997e7aba0c8269ce986bd8fe4168d5b (patch)
tree0629f1f3459c092414989e62ffbd11e4ac6ea1ef /src
parentf28d3304ee5e7d046ac553bd680d5b0245d48e4d (diff)
QAbstractMesh: setDirty -> update
Change-Id: I8e4094d69446ec8290fa34e4875f5e1cf822054c Task-number: QTBUG-41522 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/core-components/qabstractmesh.cpp14
-rw-r--r--src/core/core-components/qabstractmesh.h3
-rw-r--r--src/core/core-components/qabstractmesh_p.h1
-rw-r--r--src/plugins/sceneparsers/assimp/assimpparser.cpp2
-rw-r--r--src/render/frontend/qcuboidmesh.cpp16
-rw-r--r--src/render/frontend/qcylindermesh.cpp10
-rw-r--r--src/render/frontend/qmesh.cpp2
-rw-r--r--src/render/frontend/qplanemesh.cpp10
-rw-r--r--src/render/frontend/qspheremesh.cpp10
-rw-r--r--src/render/frontend/qtorusmesh.cpp10
-rw-r--r--src/render/io/gltfparser.cpp2
11 files changed, 33 insertions, 47 deletions
diff --git a/src/core/core-components/qabstractmesh.cpp b/src/core/core-components/qabstractmesh.cpp
index 76492560c..81f811515 100644
--- a/src/core/core-components/qabstractmesh.cpp
+++ b/src/core/core-components/qabstractmesh.cpp
@@ -62,7 +62,6 @@ namespace Qt3D {
QAbstractMeshPrivate::QAbstractMeshPrivate(QAbstractMesh *qq)
: QComponentPrivate(qq)
- , m_dirty(false)
{
}
@@ -71,7 +70,6 @@ void QAbstractMesh::copy(const QNode *ref)
QComponent::copy(ref);
const QAbstractMesh *abstractMesh = static_cast<const QAbstractMesh*>(ref);
d_func()->m_uuid = abstractMesh->d_func()->m_uuid;
- d_func()->m_dirty = abstractMesh->d_func()->m_dirty;
}
@@ -85,17 +83,9 @@ QAbstractMesh::QAbstractMesh(QAbstractMeshPrivate &dd, QNode *parent)
{
}
-bool QAbstractMesh::isDirty() const
-{
- Q_D(const QAbstractMesh);
- return d->m_dirty;
-}
-
-void QAbstractMesh::setDirty(bool dirty)
+void QAbstractMesh::update()
{
Q_D(QAbstractMesh);
- if (dirty != d->m_dirty) {
- d->m_dirty = dirty;
if (d->m_changeArbiter != Q_NULLPTR) {
QScenePropertyChangePtr change(new QScenePropertyChange(NodeUpdated, this));
change->setPropertyName(QByteArrayLiteral("meshFunctor"));
@@ -104,9 +94,7 @@ void QAbstractMesh::setDirty(bool dirty)
// TO DO see if we can clear the d->m_dirty on request.
// This would allow to send a single notification for classes that have several property changes occur
// over a single given frame or maybe that's the job of the QChangeArbiter
- d->m_dirty = false;
}
- }
}
} // Qt3D
diff --git a/src/core/core-components/qabstractmesh.h b/src/core/core-components/qabstractmesh.h
index 2afaba48a..dde047cc7 100644
--- a/src/core/core-components/qabstractmesh.h
+++ b/src/core/core-components/qabstractmesh.h
@@ -72,8 +72,7 @@ class QT3DCORESHARED_EXPORT QAbstractMesh : public QComponent
public:
QAbstractMesh(QNode *parent = 0);
- bool isDirty() const;
- void setDirty(bool dirty);
+ void update();
virtual QAbstractMeshFunctorPtr meshFunctor() const = 0;
diff --git a/src/core/core-components/qabstractmesh_p.h b/src/core/core-components/qabstractmesh_p.h
index 99d00ac67..8e9b57a24 100644
--- a/src/core/core-components/qabstractmesh_p.h
+++ b/src/core/core-components/qabstractmesh_p.h
@@ -63,7 +63,6 @@ public:
Q_DECLARE_PUBLIC(QAbstractMesh)
QUuid m_uuid;
- bool m_dirty;
};
}
diff --git a/src/plugins/sceneparsers/assimp/assimpparser.cpp b/src/plugins/sceneparsers/assimp/assimpparser.cpp
index 169147afe..52bc0be0a 100644
--- a/src/plugins/sceneparsers/assimp/assimpparser.cpp
+++ b/src/plugins/sceneparsers/assimp/assimpparser.cpp
@@ -828,7 +828,7 @@ void AssimpMesh::copy(const QNode *ref)
void AssimpMesh::setData(QMeshDataPtr data)
{
m_meshData = data;
- QAbstractMesh::setDirty(this);
+ QAbstractMesh::update();
}
QAbstractMeshFunctorPtr AssimpMesh::meshFunctor() const
diff --git a/src/render/frontend/qcuboidmesh.cpp b/src/render/frontend/qcuboidmesh.cpp
index d9f684620..d41448d58 100644
--- a/src/render/frontend/qcuboidmesh.cpp
+++ b/src/render/frontend/qcuboidmesh.cpp
@@ -77,13 +77,13 @@ void QCuboidMesh::copy(const QNode *ref)
QCuboidMesh::QCuboidMesh(QNode *parent)
: QAbstractMesh(*new QCuboidMeshPrivate(this), parent)
{
- setDirty(true);
+ update();
}
QCuboidMesh::QCuboidMesh(QCuboidMeshPrivate &dd, QNode *parent)
: QAbstractMesh(dd, parent)
{
- setDirty(true);
+ update();
}
void QCuboidMesh::setXExtent(float xExtent)
@@ -92,7 +92,7 @@ void QCuboidMesh::setXExtent(float xExtent)
if (d->m_xExtent != xExtent) {
d->m_xExtent = xExtent;
emit xExtentChanged();
- setDirty(true);
+ update();
}
}
@@ -108,7 +108,7 @@ void QCuboidMesh::setYExtent(float yExtent)
if (d->m_yExtent != yExtent) {
d->m_yExtent = yExtent;
emit yExtentChanged();
- setDirty(true);
+ update();
}
}
@@ -124,7 +124,7 @@ void QCuboidMesh::setZExtent(float zExtent)
if (d->m_zExtent != zExtent) {
d->m_zExtent = zExtent;
emit zExtentChanged();
- setDirty(true);
+ update();
}
}
@@ -140,7 +140,7 @@ void QCuboidMesh::setYZMeshResolution(const QSize &resolution)
if (d->m_yzFaceResolution != resolution) {
d->m_yzFaceResolution = resolution;
emit yzMeshResolutionChanged();
- setDirty(true);
+ update();
}
}
@@ -156,7 +156,7 @@ void QCuboidMesh::setXZMeshResolution(const QSize &resolution)
if (d->m_xzFaceResolution != resolution) {
d->m_xzFaceResolution = resolution;
emit xzMeshResolutionChanged();
- setDirty(true);
+ update();
}
}
@@ -172,7 +172,7 @@ void QCuboidMesh::setXYMeshResolution(const QSize &resolution)
if (d->m_xyFaceResolution != resolution) {
d->m_xyFaceResolution = resolution;
emit xyMeshResolutionChanged();
- setDirty(true);
+ update();
}
}
diff --git a/src/render/frontend/qcylindermesh.cpp b/src/render/frontend/qcylindermesh.cpp
index 32be0de6c..9fd1ce71a 100644
--- a/src/render/frontend/qcylindermesh.cpp
+++ b/src/render/frontend/qcylindermesh.cpp
@@ -101,7 +101,7 @@ void QCylinderMesh::copy(const QNode *ref)
QCylinderMesh::QCylinderMesh(QNode *parent)
: QAbstractMesh(*new QCylinderMeshPrivate(this), parent)
{
- setDirty(true);
+ update();
}
@@ -111,7 +111,7 @@ void QCylinderMesh::setRings(int rings)
if (rings != d->m_rings) {
d->m_rings = rings;
emit ringsChanged(rings);
- setDirty(true);
+ update();
}
}
@@ -121,7 +121,7 @@ void QCylinderMesh::setSlices(int slices)
if (slices != d->m_slices) {
d->m_slices = slices;
emit slicesChanged(slices);
- setDirty(true);
+ update();
}
}
@@ -131,7 +131,7 @@ void QCylinderMesh::setRadius(float radius)
if (radius != d->m_radius) {
d->m_radius = radius;
emit radiusChanged(radius);
- setDirty(true);
+ update();
}
}
@@ -141,7 +141,7 @@ void QCylinderMesh::setLength(float length)
if (length != d->m_length) {
d->m_length = length;
emit lengthChanged(length);
- setDirty(true);
+ update();
}
}
diff --git a/src/render/frontend/qmesh.cpp b/src/render/frontend/qmesh.cpp
index 05a7419e4..e4e5b54d8 100644
--- a/src/render/frontend/qmesh.cpp
+++ b/src/render/frontend/qmesh.cpp
@@ -96,7 +96,7 @@ void QMesh::setSource( const QString& source )
d->m_source = source;
emit sourceChanged();
// Let aspects know about the change
- QAbstractMesh::setDirty(true);
+ QAbstractMesh::update();
}
QString QMesh::source() const
diff --git a/src/render/frontend/qplanemesh.cpp b/src/render/frontend/qplanemesh.cpp
index 650959bf7..69aa69ab0 100644
--- a/src/render/frontend/qplanemesh.cpp
+++ b/src/render/frontend/qplanemesh.cpp
@@ -62,7 +62,7 @@ QPlaneMeshPrivate::QPlaneMeshPrivate(QPlaneMesh *qq)
QPlaneMesh::QPlaneMesh(QNode *parent)
: QAbstractMesh(*new QPlaneMeshPrivate(this), parent)
{
- setDirty(true);
+ update();
}
void QPlaneMesh::copy(const QNode *ref)
@@ -77,7 +77,7 @@ void QPlaneMesh::copy(const QNode *ref)
QPlaneMesh::QPlaneMesh(QPlaneMeshPrivate &dd, QNode *parent)
: QAbstractMesh(dd, parent)
{
- setDirty(true);
+ update();
}
@@ -87,7 +87,7 @@ void QPlaneMesh::setWidth(float width)
if (width != d->m_width) {
d->m_width = width;
emit widthChanged();
- setDirty(true);
+ update();
}
}
@@ -103,7 +103,7 @@ void QPlaneMesh::setHeight(float height)
if (height != d->m_height) {
d->m_height = height;
emit heightChanged();
- setDirty(true);
+ update();
}
}
@@ -119,7 +119,7 @@ void QPlaneMesh::setMeshResolution(const QSize &resolution)
if (resolution != d->m_meshResolution) {
d->m_meshResolution = resolution;
emit meshResolutionChanged();
- setDirty(true);
+ update();
}
}
diff --git a/src/render/frontend/qspheremesh.cpp b/src/render/frontend/qspheremesh.cpp
index 975ae10b3..4cf35c2b1 100644
--- a/src/render/frontend/qspheremesh.cpp
+++ b/src/render/frontend/qspheremesh.cpp
@@ -91,7 +91,7 @@ class QSphereMeshPrivate : public QAbstractMeshPrivate
QSphereMesh::QSphereMesh(QNode *parent)
: QAbstractMesh(*new QSphereMeshPrivate(this), parent)
{
- setDirty(true);
+ update();
}
void QSphereMesh::copy(const QNode *ref)
@@ -110,7 +110,7 @@ void QSphereMesh::setRings(int rings)
if (rings != d->m_rings) {
d->m_rings = rings;
emit ringsChanged();
- QAbstractMesh::setDirty(true);
+ QAbstractMesh::update();
}
}
@@ -120,7 +120,7 @@ void QSphereMesh::setSlices(int slices)
if (slices != d->m_slices) {
d->m_slices = slices;
emit slicesChanged();
- QAbstractMesh::setDirty(true);
+ QAbstractMesh::update();
}
}
@@ -130,7 +130,7 @@ void QSphereMesh::setRadius(float radius)
if (radius != d->m_radius) {
d->m_radius = radius;
emit radiusChanged();
- QAbstractMesh::setDirty(true);
+ QAbstractMesh::update();
}
}
@@ -140,7 +140,7 @@ void QSphereMesh::setGenerateTangents(bool gen)
if (d->m_generateTangents != gen) {
d->m_generateTangents = gen;
emit generateTangentsChanged();
- QAbstractMesh::setDirty(true);
+ QAbstractMesh::update();
}
}
diff --git a/src/render/frontend/qtorusmesh.cpp b/src/render/frontend/qtorusmesh.cpp
index 390d6e611..341c58054 100644
--- a/src/render/frontend/qtorusmesh.cpp
+++ b/src/render/frontend/qtorusmesh.cpp
@@ -101,7 +101,7 @@ void QTorusMesh::copy(const QNode *ref)
QTorusMesh::QTorusMesh(QNode *parent)
: QAbstractMesh(*new QTorusMeshPrivate(this), parent)
{
- setDirty(true);
+ update();
}
void QTorusMesh::setRings(int rings)
{
@@ -109,7 +109,7 @@ void QTorusMesh::setRings(int rings)
if (rings != d->m_rings) {
d->m_rings = rings;
emit ringsChanged();
- QAbstractMesh::setDirty(true);
+ QAbstractMesh::update();
}
}
@@ -119,7 +119,7 @@ void QTorusMesh::setSlices(int slices)
if (slices != d->m_slices) {
d->m_slices = slices;
emit slicesChanged();
- QAbstractMesh::setDirty(true);
+ QAbstractMesh::update();
}
}
@@ -129,7 +129,7 @@ void QTorusMesh::setRadius(float radius)
if (radius != d->m_radius) {
d->m_radius = radius;
emit radiusChanged();
- QAbstractMesh::setDirty(true);
+ QAbstractMesh::update();
}
}
@@ -139,7 +139,7 @@ void QTorusMesh::setMinorRadius(float minorRadius)
if (minorRadius != d->m_minorRadius) {
d->m_minorRadius = minorRadius;
emit minorRadiusChanged();
- QAbstractMesh::setDirty(true);
+ QAbstractMesh::update();
}
}
diff --git a/src/render/io/gltfparser.cpp b/src/render/io/gltfparser.cpp
index 497506538..c78e844e7 100644
--- a/src/render/io/gltfparser.cpp
+++ b/src/render/io/gltfparser.cpp
@@ -1026,7 +1026,7 @@ void GLTFParserMesh::setData(QMeshDataPtr data)
{
Q_D(GLTFParserMesh);
d->m_meshData = data;
- QAbstractMesh::setDirty(this);
+ QAbstractMesh::update();
}
QAbstractMeshFunctorPtr GLTFParserMesh::meshFunctor() const