summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Brock <robert.brock@kdab.com>2016-03-02 10:45:15 +0000
committerRobert Brock <robert.brock@kdab.com>2016-03-08 15:59:41 +0000
commit13194c299983f8825be947224734e76bb74d97ee (patch)
treeb149f72c125c4ec3075ebf1519252affba897ac6
parentb387ae5dd0463ebef7279f662100cddf88198ae1 (diff)
QBufferFunctor renamed to QBufferDataGenerator
bufferFunctor -> dataGenerator As per API review Change-Id: Ie67fff2fd6b75574ca840bd43836028c0726ec5e Task-number: QTBUG-51469 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/render/geometry/buffer.cpp10
-rw-r--r--src/render/geometry/buffer_p.h6
-rw-r--r--src/render/geometry/geometry.pri4
-rw-r--r--src/render/geometry/qbuffer.cpp12
-rw-r--r--src/render/geometry/qbuffer.h8
-rw-r--r--src/render/geometry/qbuffer_p.h4
-rw-r--r--src/render/geometry/qbufferdatagenerator.h (renamed from src/render/geometry/qbufferfunctor.h)16
-rw-r--r--src/render/geometry/qconegeometry.cpp18
-rw-r--r--src/render/geometry/qconemesh.cpp2
-rw-r--r--src/render/geometry/qcuboidgeometry.cpp18
-rw-r--r--src/render/geometry/qcylindergeometry.cpp18
-rw-r--r--src/render/geometry/qcylindermesh.cpp2
-rw-r--r--src/render/geometry/qplanegeometry.cpp18
-rw-r--r--src/render/geometry/qspheregeometry.cpp18
-rw-r--r--src/render/geometry/qtorusgeometry.cpp18
-rw-r--r--tests/auto/render/buffer/tst_buffer.cpp22
-rw-r--r--tests/auto/render/picking/tst_picking.cpp4
-rw-r--r--tests/auto/render/qbuffer/tst_qbuffer.cpp26
-rw-r--r--tests/auto/render/qdefaultmeshes/tst_qdefaultmeshes.cpp10
19 files changed, 117 insertions, 117 deletions
diff --git a/src/render/geometry/buffer.cpp b/src/render/geometry/buffer.cpp
index 3b70161d4..ec03096fc 100644
--- a/src/render/geometry/buffer.cpp
+++ b/src/render/geometry/buffer.cpp
@@ -102,7 +102,7 @@ void Buffer::updateFromPeer(Qt3DCore::QNode *peer)
m_type = buffer->type();
m_usage = buffer->usage();
m_data = buffer->data();
- m_functor = buffer->bufferFunctor();
+ m_functor = buffer->dataGenerator();
// Add to dirty list in the manager
if (m_functor && m_manager != Q_NULLPTR)
m_manager->addDirtyBuffer(peerId());
@@ -126,10 +126,10 @@ void Buffer::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e)
} else if (propertyName == QByteArrayLiteral("usage")) {
m_usage = static_cast<QBuffer::UsageType>(propertyChange->value().value<int>());
m_bufferDirty = true;
- } else if (propertyName == QByteArrayLiteral("bufferFunctor")) {
- QBufferFunctorPtr newFunctor = propertyChange->value().value<QBufferFunctorPtr>();
- m_bufferDirty |= !(newFunctor && m_functor && *newFunctor == *m_functor);
- m_functor = newFunctor;
+ } else if (propertyName == QByteArrayLiteral("dataGenerator")) {
+ QBufferDataGeneratorPtr newGenerator = propertyChange->value().value<QBufferDataGeneratorPtr>();
+ m_bufferDirty |= !(newGenerator && m_functor && *newGenerator == *m_functor);
+ m_functor = newGenerator;
if (m_functor && m_manager != Q_NULLPTR)
m_manager->addDirtyBuffer(peerId());
} else if (propertyName == QByteArrayLiteral("syncData")) {
diff --git a/src/render/geometry/buffer_p.h b/src/render/geometry/buffer_p.h
index f39a631e7..b0bf3587b 100644
--- a/src/render/geometry/buffer_p.h
+++ b/src/render/geometry/buffer_p.h
@@ -53,7 +53,7 @@
#include <Qt3DRender/private/backendnode_p.h>
#include <Qt3DRender/qbuffer.h>
-#include <Qt3DRender/qbufferfunctor.h>
+#include <Qt3DRender/qbufferdatagenerator.h>
QT_BEGIN_NAMESPACE
@@ -80,7 +80,7 @@ public:
inline QBuffer::UsageType usage() const { return m_usage; }
inline QByteArray data() const { return m_data; }
inline bool isDirty() const { return m_bufferDirty; }
- inline QBufferFunctorPtr bufferFunctor() const { return m_functor; }
+ inline QBufferDataGeneratorPtr dataGenerator() const { return m_functor; }
inline bool isSyncData() const { return m_syncData; }
void unsetDirty();
@@ -90,7 +90,7 @@ private:
QByteArray m_data;
bool m_bufferDirty;
bool m_syncData;
- QBufferFunctorPtr m_functor;
+ QBufferDataGeneratorPtr m_functor;
BufferManager *m_manager;
};
diff --git a/src/render/geometry/geometry.pri b/src/render/geometry/geometry.pri
index c2e7d0427..a83cfe9c1 100644
--- a/src/render/geometry/geometry.pri
+++ b/src/render/geometry/geometry.pri
@@ -9,7 +9,6 @@ HEADERS += \
$$PWD/geometryrenderermanager_p.h \
$$PWD/qbuffer.h \
$$PWD/qbuffer_p.h \
- $$PWD/qbufferfunctor.h \
$$PWD/qconegeometry.h \
$$PWD/qconegeometry_p.h \
$$PWD/qconemesh.h \
@@ -37,7 +36,8 @@ HEADERS += \
$$PWD/qplanegeometry_p.h \
$$PWD/qboundingvolumespecifier.h \
$$PWD/qattribute_p.h \
- $$PWD/qattribute.h
+ $$PWD/qattribute.h \
+ $$PWD/qbufferdatagenerator.h
SOURCES += \
$$PWD/attribute.cpp \
diff --git a/src/render/geometry/qbuffer.cpp b/src/render/geometry/qbuffer.cpp
index feddb8bf9..424ffeaf0 100644
--- a/src/render/geometry/qbuffer.cpp
+++ b/src/render/geometry/qbuffer.cpp
@@ -77,7 +77,7 @@ QBufferPrivate::QBufferPrivate()
* \qmlproperty bool Buffer::syncData
*
* Holds the syncData flag. When syncData is true, this will force data created
- * by a Qt3DRender::QBufferFunctor to also be updated on the frontend
+ * by a Qt3DRender::QBufferDataGenerator to also be updated on the frontend
* Qt3DRender::QBuffer node. By default syncData is false.
*
* \note: This has no effect if the buffer's data was set directly using the data
@@ -139,7 +139,7 @@ QBufferPrivate::QBufferPrivate()
*/
/*!
- * \typedef Qt3DRender::QBufferFunctorPtr
+ * \typedef Qt3DRender::QBufferDataGeneratorPtr
* \relates QBuffer
*/
@@ -244,7 +244,7 @@ QBuffer::BufferType QBuffer::type() const
/*!
* Sets the buffer \a functor.
*/
-void QBuffer::setBufferFunctor(const QBufferFunctorPtr &functor)
+void QBuffer::setDataGenerator(const QBufferDataGeneratorPtr &functor)
{
Q_D(QBuffer);
if (functor && d->m_functor && *functor == *d->m_functor)
@@ -252,7 +252,7 @@ void QBuffer::setBufferFunctor(const QBufferFunctorPtr &functor)
d->m_functor = functor;
if (d->m_changeArbiter != Q_NULLPTR) {
QScenePropertyChangePtr change(new QScenePropertyChange(NodeUpdated, QSceneChange::Node, id()));
- change->setPropertyName("bufferFunctor");
+ change->setPropertyName("dataGenerator");
change->setValue(QVariant::fromValue(d->m_functor));
d->notifyObservers(change);
}
@@ -261,7 +261,7 @@ void QBuffer::setBufferFunctor(const QBufferFunctorPtr &functor)
/*!
* \return the buffer functor.
*/
-QBufferFunctorPtr QBuffer::bufferFunctor() const
+QBufferDataGeneratorPtr QBuffer::dataGenerator() const
{
Q_D(const QBuffer);
return d->m_functor;
@@ -271,7 +271,7 @@ QBufferFunctorPtr QBuffer::bufferFunctor() const
* \property QBuffer::syncData
*
* Holds the syncData flag. When syncData is true, this will force data created
- * by a Qt3DRender::QBufferFunctor to also be updated on the frontend
+ * by a Qt3DRender::QBufferDataGenerator to also be updated on the frontend
* Qt3DRender::QBuffer node. By default syncData is false.
*
* \note: This has no effect if the buffer's data was set directly using the data
diff --git a/src/render/geometry/qbuffer.h b/src/render/geometry/qbuffer.h
index eaa200d32..7b4169007 100644
--- a/src/render/geometry/qbuffer.h
+++ b/src/render/geometry/qbuffer.h
@@ -49,8 +49,8 @@ QT_BEGIN_NAMESPACE
namespace Qt3DRender {
class QBufferPrivate;
-class QBufferFunctor;
-typedef QSharedPointer<QBufferFunctor> QBufferFunctorPtr;
+class QBufferDataGenerator;
+typedef QSharedPointer<QBufferDataGenerator> QBufferDataGeneratorPtr;
class QT3DRENDERSHARED_EXPORT QBuffer : public Qt3DCore::QNode
{
@@ -95,8 +95,8 @@ public:
void setData(const QByteArray &bytes);
QByteArray data() const;
- void setBufferFunctor(const QBufferFunctorPtr &functor);
- QBufferFunctorPtr bufferFunctor() const;
+ void setDataGenerator(const QBufferDataGeneratorPtr &functor);
+ QBufferDataGeneratorPtr dataGenerator() const;
public Q_SLOTS:
void setType(BufferType type);
diff --git a/src/render/geometry/qbuffer_p.h b/src/render/geometry/qbuffer_p.h
index 821d60358..e13bb45f6 100644
--- a/src/render/geometry/qbuffer_p.h
+++ b/src/render/geometry/qbuffer_p.h
@@ -53,7 +53,7 @@
#include <Qt3DCore/private/qnode_p.h>
#include <Qt3DRender/qbuffer.h>
-#include <Qt3DRender/qbufferfunctor.h>
+#include <Qt3DRender/qbufferdatagenerator.h>
#include <Qt3DRender/qt3drender_global.h>
#include <private/qnode_p.h>
#include <QByteArray>
@@ -72,7 +72,7 @@ public:
QByteArray m_data;
QBuffer::BufferType m_type;
QBuffer::UsageType m_usage;
- QBufferFunctorPtr m_functor;
+ QBufferDataGeneratorPtr m_functor;
bool m_syncData;
};
diff --git a/src/render/geometry/qbufferfunctor.h b/src/render/geometry/qbufferdatagenerator.h
index 695df2095..2b37ec24d 100644
--- a/src/render/geometry/qbufferfunctor.h
+++ b/src/render/geometry/qbufferdatagenerator.h
@@ -37,8 +37,8 @@
**
****************************************************************************/
-#ifndef QT3DRENDER_QBUFFERFUNCTOR
-#define QT3DRENDER_QBUFFERFUNCTOR
+#ifndef QT3DRENDER_QBUFFERDATAGENERATOR
+#define QT3DRENDER_QBUFFERDATAGENERATOR
#include <Qt3DRender/qt3drender_global.h>
#include <Qt3DRender/qabstractfunctor.h>
@@ -48,21 +48,21 @@ QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-class QT3DRENDERSHARED_EXPORT QBufferFunctor : public QAbstractFunctor
+class QT3DRENDERSHARED_EXPORT QBufferDataGenerator : public QAbstractFunctor
{
public:
- virtual ~QBufferFunctor() {}
+ virtual ~QBufferDataGenerator() {}
virtual QByteArray operator()() = 0;
- virtual bool operator ==(const QBufferFunctor &other) const = 0;
+ virtual bool operator ==(const QBufferDataGenerator &other) const = 0;
};
-typedef QSharedPointer<QBufferFunctor> QBufferFunctorPtr;
+typedef QSharedPointer<QBufferDataGenerator> QBufferDataGeneratorPtr;
} // namespace Qt3DRender
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(Qt3DRender::QBufferFunctorPtr)
+Q_DECLARE_METATYPE(Qt3DRender::QBufferDataGeneratorPtr)
-#endif // QT3DRENDER_QBUFFERFUNCTOR
+#endif // QT3DRENDER_QBUFFERDATAGENERATOR
diff --git a/src/render/geometry/qconegeometry.cpp b/src/render/geometry/qconegeometry.cpp
index 3ca5f526c..816c24983 100644
--- a/src/render/geometry/qconegeometry.cpp
+++ b/src/render/geometry/qconegeometry.cpp
@@ -44,7 +44,7 @@
#include "qconegeometry.h"
#include "qconegeometry_p.h"
#include <Qt3DRender/qbuffer.h>
-#include <Qt3DRender/qbufferfunctor.h>
+#include <Qt3DRender/qbufferdatagenerator.h>
#include <Qt3DRender/qattribute.h>
#include <QVector3D>
#include <cmath>
@@ -196,7 +196,7 @@ void createDiscIndices(quint16 *&indicesPtr,
} // anonymous
-class ConeVertexDataFunctor : public QBufferFunctor
+class ConeVertexDataFunctor : public QBufferDataGenerator
{
public:
ConeVertexDataFunctor(bool hasTopEndcap, bool hasBottomEndcap, int rings, int slices,
@@ -233,7 +233,7 @@ public:
return verticesData;
}
- bool operator ==(const QBufferFunctor &other) const Q_DECL_OVERRIDE
+ bool operator ==(const QBufferDataGenerator &other) const Q_DECL_OVERRIDE
{
const ConeVertexDataFunctor *otherFunctor = functor_cast<ConeVertexDataFunctor>(&other);
if (otherFunctor != Q_NULLPTR)
@@ -259,7 +259,7 @@ private:
float m_length;
};
-class ConeIndexDataFunctor : public QBufferFunctor
+class ConeIndexDataFunctor : public QBufferDataGenerator
{
public:
ConeIndexDataFunctor(bool hasTopEndcap, bool hasBottomEndcap, int rings, int slices,
@@ -296,7 +296,7 @@ public:
return indicesBytes;
}
- bool operator ==(const QBufferFunctor &other) const Q_DECL_OVERRIDE
+ bool operator ==(const QBufferDataGenerator &other) const Q_DECL_OVERRIDE
{
const ConeIndexDataFunctor *otherFunctor = functor_cast<ConeIndexDataFunctor>(&other);
if (otherFunctor != Q_NULLPTR)
@@ -388,9 +388,9 @@ void QConeGeometryPrivate::init()
m_indexAttribute->setCount(faces * 3);
- m_vertexBuffer->setBufferFunctor(QBufferFunctorPtr(new ConeVertexDataFunctor(m_hasTopEndcap, m_hasBottomEndcap, m_rings, m_slices,
+ m_vertexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new ConeVertexDataFunctor(m_hasTopEndcap, m_hasBottomEndcap, m_rings, m_slices,
m_topRadius, m_bottomRadius, m_length)));
- m_indexBuffer->setBufferFunctor(QBufferFunctorPtr(new ConeIndexDataFunctor(m_hasTopEndcap, m_hasBottomEndcap, m_rings, m_slices,
+ m_indexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new ConeIndexDataFunctor(m_hasTopEndcap, m_hasBottomEndcap, m_rings, m_slices,
m_length)));
q->addAttribute(m_positionAttribute);
@@ -425,7 +425,7 @@ void QConeGeometry::updateVertices()
d->m_positionAttribute->setCount(nVerts);
d->m_texCoordAttribute->setCount(nVerts);
d->m_normalAttribute->setCount(nVerts);
- d->m_vertexBuffer->setBufferFunctor(QBufferFunctorPtr(new ConeVertexDataFunctor(d->m_hasTopEndcap, d->m_hasBottomEndcap, d->m_rings, d->m_slices,
+ d->m_vertexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new ConeVertexDataFunctor(d->m_hasTopEndcap, d->m_hasBottomEndcap, d->m_rings, d->m_slices,
d->m_topRadius, d->m_bottomRadius, d->m_length)));
}
@@ -438,7 +438,7 @@ void QConeGeometry::updateIndices()
+ d->m_slices * (d->m_hasTopEndcap + d->m_hasBottomEndcap); // 2 x endcaps
d->m_indexAttribute->setCount(faces * 3);
- d->m_indexBuffer->setBufferFunctor(QBufferFunctorPtr(new ConeIndexDataFunctor(d->m_hasTopEndcap, d->m_hasBottomEndcap, d->m_rings, d->m_slices,
+ d->m_indexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new ConeIndexDataFunctor(d->m_hasTopEndcap, d->m_hasBottomEndcap, d->m_rings, d->m_slices,
d->m_length)));
}
diff --git a/src/render/geometry/qconemesh.cpp b/src/render/geometry/qconemesh.cpp
index 06b8d70e8..b2620c5c4 100644
--- a/src/render/geometry/qconemesh.cpp
+++ b/src/render/geometry/qconemesh.cpp
@@ -44,7 +44,7 @@
#include "qconemesh.h"
#include "qconegeometry.h"
#include <Qt3DRender/qbuffer.h>
-#include <Qt3DRender/qbufferfunctor.h>
+#include <Qt3DRender/qbufferdatagenerator.h>
#include <Qt3DRender/qattribute.h>
#include <qmath.h>
#include <QVector3D>
diff --git a/src/render/geometry/qcuboidgeometry.cpp b/src/render/geometry/qcuboidgeometry.cpp
index 64c6f5b24..9173ae0eb 100644
--- a/src/render/geometry/qcuboidgeometry.cpp
+++ b/src/render/geometry/qcuboidgeometry.cpp
@@ -41,7 +41,7 @@
#include "qcuboidgeometry_p.h"
#include <Qt3DRender/qattribute.h>
#include <Qt3DRender/qbuffer.h>
-#include <Qt3DRender/qbufferfunctor.h>
+#include <Qt3DRender/qbufferdatagenerator.h>
#include <Qt3DRender/private/renderlogging_p.h>
#include <limits>
@@ -314,7 +314,7 @@ QByteArray createCuboidIndexData(const QSize &yzResolution,
} // anonymous
-class CuboidVertexBufferFunctor : public QBufferFunctor
+class CuboidVertexBufferFunctor : public QBufferDataGenerator
{
public:
explicit CuboidVertexBufferFunctor(float xExtent,
@@ -339,7 +339,7 @@ public:
m_yzFaceResolution, m_xzFaceResolution, m_xyFaceResolution);
}
- bool operator ==(const QBufferFunctor &other) const Q_DECL_FINAL
+ bool operator ==(const QBufferDataGenerator &other) const Q_DECL_FINAL
{
const CuboidVertexBufferFunctor *otherFunctor = functor_cast<CuboidVertexBufferFunctor>(&other);
if (otherFunctor != Q_NULLPTR)
@@ -363,7 +363,7 @@ private:
QSize m_xyFaceResolution;
};
-class CuboidIndexBufferFunctor : public QBufferFunctor
+class CuboidIndexBufferFunctor : public QBufferDataGenerator
{
public:
explicit CuboidIndexBufferFunctor(const QSize &yzResolution,
@@ -381,7 +381,7 @@ public:
return createCuboidIndexData(m_yzFaceResolution, m_xzFaceResolution, m_xyFaceResolution);
}
- bool operator ==(const QBufferFunctor &other) const Q_DECL_FINAL
+ bool operator ==(const QBufferDataGenerator &other) const Q_DECL_FINAL
{
const CuboidIndexBufferFunctor *otherFunctor = functor_cast<CuboidIndexBufferFunctor>(&other);
if (otherFunctor != Q_NULLPTR)
@@ -481,9 +481,9 @@ void QCuboidGeometryPrivate::init()
m_indexAttribute->setCount(indexCount);
- m_vertexBuffer->setBufferFunctor(QBufferFunctorPtr(new CuboidVertexBufferFunctor(m_xExtent, m_yExtent, m_zExtent,
+ m_vertexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new CuboidVertexBufferFunctor(m_xExtent, m_yExtent, m_zExtent,
m_yzFaceResolution, m_xzFaceResolution, m_xyFaceResolution)));
- m_indexBuffer->setBufferFunctor(QBufferFunctorPtr(new CuboidIndexBufferFunctor(m_yzFaceResolution, m_xzFaceResolution, m_xyFaceResolution)));
+ m_indexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new CuboidIndexBufferFunctor(m_yzFaceResolution, m_xzFaceResolution, m_xyFaceResolution)));
q->addAttribute(m_positionAttribute);
q->addAttribute(m_texCoordAttribute);
@@ -612,7 +612,7 @@ void QCuboidGeometry::updateIndices()
const int indexCount = 2 * (yzIndices + xzIndices + xyIndices);
d->m_indexAttribute->setCount(indexCount);
- d->m_indexBuffer->setBufferFunctor(QBufferFunctorPtr(new CuboidIndexBufferFunctor(d->m_yzFaceResolution, d->m_xzFaceResolution, d->m_xyFaceResolution)));
+ d->m_indexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new CuboidIndexBufferFunctor(d->m_yzFaceResolution, d->m_xzFaceResolution, d->m_xyFaceResolution)));
}
@@ -632,7 +632,7 @@ void QCuboidGeometry::updateVertices()
d->m_texCoordAttribute->setCount(nVerts);
d->m_tangentAttribute->setCount(nVerts);
- d->m_vertexBuffer->setBufferFunctor(QBufferFunctorPtr(new CuboidVertexBufferFunctor(d->m_xExtent, d->m_yExtent, d->m_zExtent,
+ d->m_vertexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new CuboidVertexBufferFunctor(d->m_xExtent, d->m_yExtent, d->m_zExtent,
d->m_yzFaceResolution, d->m_xzFaceResolution, d->m_xyFaceResolution)));
}
diff --git a/src/render/geometry/qcylindergeometry.cpp b/src/render/geometry/qcylindergeometry.cpp
index d1a7aa601..1ea16bf37 100644
--- a/src/render/geometry/qcylindergeometry.cpp
+++ b/src/render/geometry/qcylindergeometry.cpp
@@ -44,7 +44,7 @@
#include "qcylindergeometry.h"
#include "qcylindergeometry_p.h"
#include <Qt3DRender/qbuffer.h>
-#include <Qt3DRender/qbufferfunctor.h>
+#include <Qt3DRender/qbufferdatagenerator.h>
#include <Qt3DRender/qattribute.h>
#include <qmath.h>
#include <QVector3D>
@@ -166,7 +166,7 @@ void createDiscIndices(quint16 *&indicesPtr,
} // anonymous
-class CylinderVertexDataFunctor : public QBufferFunctor
+class CylinderVertexDataFunctor : public QBufferDataGenerator
{
public:
CylinderVertexDataFunctor(int rings, int slices, float radius, float length)
@@ -193,7 +193,7 @@ public:
return verticesData;
}
- bool operator ==(const QBufferFunctor &other) const Q_DECL_OVERRIDE
+ bool operator ==(const QBufferDataGenerator &other) const Q_DECL_OVERRIDE
{
const CylinderVertexDataFunctor *otherFunctor = functor_cast<CylinderVertexDataFunctor>(&other);
if (otherFunctor != Q_NULLPTR)
@@ -213,7 +213,7 @@ private:
float m_length;
};
-class CylinderIndexDataFunctor : public QBufferFunctor
+class CylinderIndexDataFunctor : public QBufferDataGenerator
{
public:
CylinderIndexDataFunctor(int rings, int slices, float length)
@@ -242,7 +242,7 @@ public:
return indicesBytes;
}
- bool operator ==(const QBufferFunctor &other) const Q_DECL_OVERRIDE
+ bool operator ==(const QBufferDataGenerator &other) const Q_DECL_OVERRIDE
{
const CylinderIndexDataFunctor *otherFunctor = functor_cast<CylinderIndexDataFunctor>(&other);
if (otherFunctor != Q_NULLPTR)
@@ -324,8 +324,8 @@ void QCylinderGeometryPrivate::init()
m_indexAttribute->setCount(faces * 3);
- m_vertexBuffer->setBufferFunctor(QBufferFunctorPtr(new CylinderVertexDataFunctor(m_rings, m_slices, m_radius, m_length)));
- m_indexBuffer->setBufferFunctor(QBufferFunctorPtr(new CylinderIndexDataFunctor(m_rings, m_slices, m_length)));
+ m_vertexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new CylinderVertexDataFunctor(m_rings, m_slices, m_radius, m_length)));
+ m_indexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new CylinderIndexDataFunctor(m_rings, m_slices, m_length)));
q->addAttribute(m_positionAttribute);
q->addAttribute(m_texCoordAttribute);
@@ -433,7 +433,7 @@ void QCylinderGeometry::updateVertices()
d->m_texCoordAttribute->setCount(nVerts);
d->m_normalAttribute->setCount(nVerts);
- d->m_vertexBuffer->setBufferFunctor(QBufferFunctorPtr(new CylinderVertexDataFunctor(d->m_rings, d->m_slices, d->m_radius, d->m_length)));
+ d->m_vertexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new CylinderVertexDataFunctor(d->m_rings, d->m_slices, d->m_radius, d->m_length)));
}
/*!
@@ -444,7 +444,7 @@ void QCylinderGeometry::updateIndices()
Q_D(QCylinderGeometry);
const int faces = (d->m_slices * 2) * d->m_rings + (2 * d->m_slices);
d->m_indexAttribute->setCount(faces * 3);
- d->m_indexBuffer->setBufferFunctor(QBufferFunctorPtr(new CylinderIndexDataFunctor(d->m_rings, d->m_slices, d->m_length)));
+ d->m_indexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new CylinderIndexDataFunctor(d->m_rings, d->m_slices, d->m_length)));
}
void QCylinderGeometry::setRings(int rings)
diff --git a/src/render/geometry/qcylindermesh.cpp b/src/render/geometry/qcylindermesh.cpp
index 0bd528c9a..45f2c63f5 100644
--- a/src/render/geometry/qcylindermesh.cpp
+++ b/src/render/geometry/qcylindermesh.cpp
@@ -45,7 +45,7 @@
#include "qcylindermesh.h"
#include "qcylindergeometry.h"
#include <Qt3DRender/qbuffer.h>
-#include <Qt3DRender/qbufferfunctor.h>
+#include <Qt3DRender/qbufferdatagenerator.h>
#include <Qt3DRender/qattribute.h>
#include <qmath.h>
#include <QVector3D>
diff --git a/src/render/geometry/qplanegeometry.cpp b/src/render/geometry/qplanegeometry.cpp
index 8abf07a81..ff9a1d2c4 100644
--- a/src/render/geometry/qplanegeometry.cpp
+++ b/src/render/geometry/qplanegeometry.cpp
@@ -41,7 +41,7 @@
#include "qplanegeometry_p.h"
#include <Qt3DRender/qattribute.h>
#include <Qt3DRender/qbuffer.h>
-#include <Qt3DRender/qbufferfunctor.h>
+#include <Qt3DRender/qbufferdatagenerator.h>
#include <limits>
QT_BEGIN_NAMESPACE
@@ -142,7 +142,7 @@ QByteArray createPlaneIndexData(const QSize &resolution)
} // anonymous
-class PlaneVertexBufferFunctor : public QBufferFunctor
+class PlaneVertexBufferFunctor : public QBufferDataGenerator
{
public:
explicit PlaneVertexBufferFunctor(float w, float h, const QSize &resolution)
@@ -158,7 +158,7 @@ public:
return createPlaneVertexData(m_width, m_height, m_resolution);
}
- bool operator ==(const QBufferFunctor &other) const Q_DECL_FINAL
+ bool operator ==(const QBufferDataGenerator &other) const Q_DECL_FINAL
{
const PlaneVertexBufferFunctor *otherFunctor = functor_cast<PlaneVertexBufferFunctor>(&other);
if (otherFunctor != Q_NULLPTR)
@@ -176,7 +176,7 @@ public:
QSize m_resolution;
};
-class PlaneIndexBufferFunctor : public QBufferFunctor
+class PlaneIndexBufferFunctor : public QBufferDataGenerator
{
public:
explicit PlaneIndexBufferFunctor(const QSize &resolution)
@@ -190,7 +190,7 @@ public:
return createPlaneIndexData(m_resolution);
}
- bool operator ==(const QBufferFunctor &other) const Q_DECL_FINAL
+ bool operator ==(const QBufferDataGenerator &other) const Q_DECL_FINAL
{
const PlaneIndexBufferFunctor *otherFunctor = functor_cast<PlaneIndexBufferFunctor>(&other);
if (otherFunctor != Q_NULLPTR)
@@ -305,7 +305,7 @@ void QPlaneGeometry::updateVertices()
d->m_normalAttribute->setCount(nVerts);
d->m_texCoordAttribute->setCount(nVerts);
d->m_tangentAttribute->setCount(nVerts);
- d->m_vertexBuffer->setBufferFunctor(QBufferFunctorPtr(new PlaneVertexBufferFunctor(d->m_width, d->m_height, d->m_meshResolution)));
+ d->m_vertexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new PlaneVertexBufferFunctor(d->m_width, d->m_height, d->m_meshResolution)));
}
/*!
@@ -317,7 +317,7 @@ void QPlaneGeometry::updateIndices()
const int faces = 2 * (d->m_meshResolution.width() - 1) * (d->m_meshResolution.height() - 1);
// Each primitive has 3 vertices
d->m_indexAttribute->setCount(faces * 3);
- d->m_indexBuffer->setBufferFunctor(QBufferFunctorPtr(new PlaneIndexBufferFunctor(d->m_meshResolution)));
+ d->m_indexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new PlaneIndexBufferFunctor(d->m_meshResolution)));
}
@@ -512,8 +512,8 @@ void QPlaneGeometryPrivate::init()
// Each primitive has 3 vertives
m_indexAttribute->setCount(faces * 3);
- m_vertexBuffer->setBufferFunctor(QBufferFunctorPtr(new PlaneVertexBufferFunctor(m_width, m_height, m_meshResolution)));
- m_indexBuffer->setBufferFunctor(QBufferFunctorPtr(new PlaneIndexBufferFunctor(m_meshResolution)));
+ m_vertexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new PlaneVertexBufferFunctor(m_width, m_height, m_meshResolution)));
+ m_indexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new PlaneIndexBufferFunctor(m_meshResolution)));
q->addAttribute(m_positionAttribute);
q->addAttribute(m_texCoordAttribute);
diff --git a/src/render/geometry/qspheregeometry.cpp b/src/render/geometry/qspheregeometry.cpp
index 72c5b64df..f82bc5ec6 100644
--- a/src/render/geometry/qspheregeometry.cpp
+++ b/src/render/geometry/qspheregeometry.cpp
@@ -39,7 +39,7 @@
#include "qspheregeometry.h"
#include "qspheregeometry_p.h"
-#include <Qt3DRender/qbufferfunctor.h>
+#include <Qt3DRender/qbufferdatagenerator.h>
#include <Qt3DRender/qbuffer.h>
#include <Qt3DRender/qattribute.h>
@@ -163,7 +163,7 @@ QByteArray createSphereMeshIndexData(int rings, int slices)
} // anonymous
-class SphereVertexDataFunctor : public QBufferFunctor
+class SphereVertexDataFunctor : public QBufferDataGenerator
{
public:
SphereVertexDataFunctor(int rings, int slices, float radius)
@@ -178,7 +178,7 @@ public:
return createSphereMeshVertexData(m_radius, m_rings, m_slices);
}
- bool operator ==(const QBufferFunctor &other) const Q_DECL_OVERRIDE
+ bool operator ==(const QBufferDataGenerator &other) const Q_DECL_OVERRIDE
{
const SphereVertexDataFunctor *otherFunctor = functor_cast<SphereVertexDataFunctor>(&other);
if (otherFunctor != Q_NULLPTR)
@@ -196,7 +196,7 @@ private:
float m_radius;
};
-class SphereIndexDataFunctor : public QBufferFunctor
+class SphereIndexDataFunctor : public QBufferDataGenerator
{
public:
SphereIndexDataFunctor(int rings, int slices)
@@ -210,7 +210,7 @@ public:
return createSphereMeshIndexData(m_rings, m_slices);
}
- bool operator ==(const QBufferFunctor &other) const Q_DECL_OVERRIDE
+ bool operator ==(const QBufferDataGenerator &other) const Q_DECL_OVERRIDE
{
const SphereIndexDataFunctor *otherFunctor = functor_cast<SphereIndexDataFunctor>(&other);
if (otherFunctor != Q_NULLPTR)
@@ -300,8 +300,8 @@ void QSphereGeometryPrivate::init()
m_indexAttribute->setCount(faces * 3);
- m_vertexBuffer->setBufferFunctor(QBufferFunctorPtr(new SphereVertexDataFunctor(m_rings, m_slices, m_radius)));
- m_indexBuffer->setBufferFunctor(QBufferFunctorPtr(new SphereIndexDataFunctor(m_rings, m_slices)));
+ m_vertexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new SphereVertexDataFunctor(m_rings, m_slices, m_radius)));
+ m_indexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new SphereIndexDataFunctor(m_rings, m_slices)));
q->addAttribute(m_positionAttribute);
q->addAttribute(m_texCoordAttribute);
@@ -417,7 +417,7 @@ void QSphereGeometry::updateVertices()
d->m_texCoordAttribute->setCount(nVerts);
d->m_normalAttribute->setCount(nVerts);
d->m_tangentAttribute->setCount(nVerts);
- d->m_vertexBuffer->setBufferFunctor(QBufferFunctorPtr(new SphereVertexDataFunctor(d->m_rings, d->m_slices, d->m_radius)));
+ d->m_vertexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new SphereVertexDataFunctor(d->m_rings, d->m_slices, d->m_radius)));
}
/*!
@@ -428,7 +428,7 @@ void QSphereGeometry::updateIndices()
Q_D(QSphereGeometry);
const int faces = (d->m_slices * 2) * (d->m_rings - 2) + (2 * d->m_slices);
d->m_indexAttribute->setCount(faces * 3);
- d->m_indexBuffer->setBufferFunctor(QBufferFunctorPtr(new SphereIndexDataFunctor(d->m_rings, d->m_slices)));
+ d->m_indexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new SphereIndexDataFunctor(d->m_rings, d->m_slices)));
}
diff --git a/src/render/geometry/qtorusgeometry.cpp b/src/render/geometry/qtorusgeometry.cpp
index af77e7e95..8271f93da 100644
--- a/src/render/geometry/qtorusgeometry.cpp
+++ b/src/render/geometry/qtorusgeometry.cpp
@@ -40,7 +40,7 @@
#include "qtorusgeometry.h"
#include "qtorusgeometry_p.h"
#include <Qt3DRender/qbuffer.h>
-#include <Qt3DRender/qbufferfunctor.h>
+#include <Qt3DRender/qbufferdatagenerator.h>
#include <Qt3DRender/qattribute.h>
#include <qmath.h>
#include <QVector3D>
@@ -123,7 +123,7 @@ QByteArray createTorusIndexData(int rings, int sides)
} // anonymous
-class TorusVertexDataFunctor : public QBufferFunctor
+class TorusVertexDataFunctor : public QBufferDataGenerator
{
public:
TorusVertexDataFunctor(int rings, int slices, float radius, float minorRadius)
@@ -139,7 +139,7 @@ public:
return createTorusVertexData(m_radius, m_minorRadius, m_rings, m_sides);
}
- bool operator ==(const QBufferFunctor &other) const Q_DECL_OVERRIDE
+ bool operator ==(const QBufferDataGenerator &other) const Q_DECL_OVERRIDE
{
const TorusVertexDataFunctor *otherFunctor = functor_cast<TorusVertexDataFunctor>(&other);
if (otherFunctor != Q_NULLPTR)
@@ -159,7 +159,7 @@ private:
float m_minorRadius;
};
-class TorusIndexDataFunctor : public QBufferFunctor
+class TorusIndexDataFunctor : public QBufferDataGenerator
{
public:
TorusIndexDataFunctor(int rings, int slices)
@@ -173,7 +173,7 @@ public:
return createTorusIndexData(m_rings, m_sides);
}
- bool operator ==(const QBufferFunctor &other) const Q_DECL_OVERRIDE
+ bool operator ==(const QBufferDataGenerator &other) const Q_DECL_OVERRIDE
{
const TorusIndexDataFunctor *otherFunctor = functor_cast<TorusIndexDataFunctor>(&other);
if (otherFunctor != Q_NULLPTR)
@@ -251,8 +251,8 @@ void QTorusGeometryPrivate::init()
m_indexAttribute->setCount(faces * 3);
- m_vertexBuffer->setBufferFunctor(QBufferFunctorPtr(new TorusVertexDataFunctor(m_rings, m_slices, m_radius, m_minorRadius)));
- m_indexBuffer->setBufferFunctor(QBufferFunctorPtr(new TorusIndexDataFunctor(m_rings, m_slices)));
+ m_vertexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new TorusVertexDataFunctor(m_rings, m_slices, m_radius, m_minorRadius)));
+ m_indexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new TorusIndexDataFunctor(m_rings, m_slices)));
q->addAttribute(m_positionAttribute);
q->addAttribute(m_texCoordAttribute);
@@ -359,7 +359,7 @@ void QTorusGeometry::updateVertices()
d->m_positionAttribute->setCount(nVerts);
d->m_texCoordAttribute->setCount(nVerts);
d->m_normalAttribute->setCount(nVerts);
- d->m_vertexBuffer->setBufferFunctor(QBufferFunctorPtr(new TorusVertexDataFunctor(d->m_rings, d->m_slices, d->m_radius, d->m_minorRadius)));
+ d->m_vertexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new TorusVertexDataFunctor(d->m_rings, d->m_slices, d->m_radius, d->m_minorRadius)));
}
/*!
@@ -370,7 +370,7 @@ void QTorusGeometry::updateIndices()
Q_D(QTorusGeometry);
const int faces = (d->m_slices * 2) * d->m_rings;
d->m_indexAttribute->setCount(faces * 3);
- d->m_indexBuffer->setBufferFunctor(QBufferFunctorPtr(new TorusIndexDataFunctor(d->m_rings, d->m_slices)));
+ d->m_indexBuffer->setDataGenerator(QBufferDataGeneratorPtr(new TorusIndexDataFunctor(d->m_rings, d->m_slices)));
}
diff --git a/tests/auto/render/buffer/tst_buffer.cpp b/tests/auto/render/buffer/tst_buffer.cpp
index b95b214d8..ee04d26c0 100644
--- a/tests/auto/render/buffer/tst_buffer.cpp
+++ b/tests/auto/render/buffer/tst_buffer.cpp
@@ -33,7 +33,7 @@
#include "testpostmanarbiter.h"
#include "testrenderer.h"
-class TestFunctor : public Qt3DRender::QBufferFunctor
+class TestFunctor : public Qt3DRender::QBufferDataGenerator
{
public:
explicit TestFunctor(int size)
@@ -45,7 +45,7 @@ public:
return QByteArrayLiteral("454");
}
- bool operator ==(const Qt3DRender::QBufferFunctor &other) const
+ bool operator ==(const Qt3DRender::QBufferDataGenerator &other) const
{
const TestFunctor *otherFunctor = functor_cast<TestFunctor>(&other);
if (otherFunctor != Q_NULLPTR)
@@ -71,7 +71,7 @@ private Q_SLOTS:
Qt3DRender::QBuffer buffer(Qt3DRender::QBuffer::IndexBuffer);
buffer.setUsage(Qt3DRender::QBuffer::DynamicCopy);
buffer.setData(QByteArrayLiteral("Corvette"));
- buffer.setBufferFunctor(Qt3DRender::QBufferFunctorPtr(new TestFunctor(883)));
+ buffer.setDataGenerator(Qt3DRender::QBufferDataGeneratorPtr(new TestFunctor(883)));
// WHEN
renderBuffer.setPeer(&buffer);
@@ -82,8 +82,8 @@ private Q_SLOTS:
QCOMPARE(renderBuffer.type(), buffer.type());
QCOMPARE(renderBuffer.usage(), buffer.usage());
QCOMPARE(renderBuffer.data(), buffer.data());
- QCOMPARE(renderBuffer.bufferFunctor(), buffer.bufferFunctor());
- QVERIFY(*renderBuffer.bufferFunctor() == *buffer.bufferFunctor());
+ QCOMPARE(renderBuffer.dataGenerator(), buffer.dataGenerator());
+ QVERIFY(*renderBuffer.dataGenerator() == *buffer.dataGenerator());
}
void checkInitialAndCleanedUpState()
@@ -97,13 +97,13 @@ private Q_SLOTS:
QCOMPARE(renderBuffer.usage(), Qt3DRender::QBuffer::StaticDraw);
QVERIFY(renderBuffer.data().isEmpty());
QVERIFY(renderBuffer.peerId().isNull());
- QVERIFY(renderBuffer.bufferFunctor().isNull());
+ QVERIFY(renderBuffer.dataGenerator().isNull());
// GIVEN
Qt3DRender::QBuffer buffer(Qt3DRender::QBuffer::IndexBuffer);
buffer.setUsage(Qt3DRender::QBuffer::DynamicCopy);
buffer.setData(QByteArrayLiteral("C7"));
- buffer.setBufferFunctor(Qt3DRender::QBufferFunctorPtr(new TestFunctor(73)));
+ buffer.setDataGenerator(Qt3DRender::QBufferDataGeneratorPtr(new TestFunctor(73)));
// WHEN
renderBuffer.updateFromPeer(&buffer);
@@ -114,7 +114,7 @@ private Q_SLOTS:
QCOMPARE(renderBuffer.type(), Qt3DRender::QBuffer::VertexBuffer);
QCOMPARE(renderBuffer.usage(), Qt3DRender::QBuffer::StaticDraw);
QVERIFY(renderBuffer.data().isEmpty());
- QVERIFY(renderBuffer.bufferFunctor().isNull());
+ QVERIFY(renderBuffer.dataGenerator().isNull());
}
void checkPropertyChanges()
@@ -173,14 +173,14 @@ private Q_SLOTS:
// WHEN
- Qt3DRender::QBufferFunctorPtr functor(new TestFunctor(355));
+ Qt3DRender::QBufferDataGeneratorPtr functor(new TestFunctor(355));
updateChange.reset(new Qt3DCore::QScenePropertyChange(Qt3DCore::NodeUpdated, Qt3DCore::QSceneChange::Node, Qt3DCore::QNodeId()));
updateChange->setValue(QVariant::fromValue(functor));
- updateChange->setPropertyName("bufferFunctor");
+ updateChange->setPropertyName("dataGenerator");
renderBuffer.sceneChangeEvent(updateChange);
// THEN
- QCOMPARE(renderBuffer.bufferFunctor(), functor);
+ QCOMPARE(renderBuffer.dataGenerator(), functor);
QVERIFY(renderBuffer.isDirty());
renderBuffer.unsetDirty();
diff --git a/tests/auto/render/picking/tst_picking.cpp b/tests/auto/render/picking/tst_picking.cpp
index b9dfe6135..d379966d0 100644
--- a/tests/auto/render/picking/tst_picking.cpp
+++ b/tests/auto/render/picking/tst_picking.cpp
@@ -37,7 +37,7 @@
#include <Qt3DRender/qspheremesh.h>
#include <Qt3DRender/qattribute.h>
#include <Qt3DRender/qbuffer.h>
-#include <Qt3DRender/qbufferfunctor.h>
+#include <Qt3DRender/qbufferdatagenerator.h>
#include <Qt3DRender/qspheregeometry.h>
#include <Qt3DRender/qpickevent.h>
#include <Qt3DCore/qbackendscenepropertychange.h>
@@ -80,7 +80,7 @@ public:
Qt3DRender::QBuffer *vertexBuffer = static_cast<Qt3DRender::QBuffer *>(positionAttr->buffer());
// Load the geometry
- const QByteArray data = (*vertexBuffer->bufferFunctor())();
+ const QByteArray data = (*vertexBuffer->dataGenerator())();
vertexBuffer->setData(data);
transform->setTranslation(position);
diff --git a/tests/auto/render/qbuffer/tst_qbuffer.cpp b/tests/auto/render/qbuffer/tst_qbuffer.cpp
index c2da0618d..f4b4f8f71 100644
--- a/tests/auto/render/qbuffer/tst_qbuffer.cpp
+++ b/tests/auto/render/qbuffer/tst_qbuffer.cpp
@@ -31,11 +31,11 @@
#include <Qt3DCore/private/qscene_p.h>
#include <Qt3DRender/qbuffer.h>
-#include <Qt3DRender/qbufferfunctor.h>
+#include <Qt3DRender/qbufferdatagenerator.h>
#include "testpostmanarbiter.h"
-class TestFunctor : public Qt3DRender::QBufferFunctor
+class TestFunctor : public Qt3DRender::QBufferDataGenerator
{
public:
explicit TestFunctor(int size)
@@ -47,7 +47,7 @@ public:
return QByteArray();
}
- bool operator ==(const Qt3DRender::QBufferFunctor &other) const
+ bool operator ==(const Qt3DRender::QBufferDataGenerator &other) const
{
const TestFunctor *otherFunctor = functor_cast<TestFunctor>(&other);
if (otherFunctor != Q_NULLPTR)
@@ -84,13 +84,13 @@ private Q_SLOTS:
Qt3DRender::QBuffer *buffer = new Qt3DRender::QBuffer(Qt3DRender::QBuffer::VertexBuffer);
buffer->setUsage(Qt3DRender::QBuffer::DynamicRead);
buffer->setData(QByteArrayLiteral("There's no replacement"));
- buffer->setBufferFunctor(Qt3DRender::QBufferFunctorPtr(new TestFunctor(883)));
+ buffer->setDataGenerator(Qt3DRender::QBufferDataGeneratorPtr(new TestFunctor(883)));
QTest::newRow("vertex") << buffer;
Qt3DRender::QBuffer *indexBuffer = new Qt3DRender::QBuffer(Qt3DRender::QBuffer::IndexBuffer);
indexBuffer->setUsage(Qt3DRender::QBuffer::StaticCopy);
indexBuffer->setData(QByteArrayLiteral("For displacement"));
- indexBuffer->setBufferFunctor(Qt3DRender::QBufferFunctorPtr(new TestFunctor(1340)));
+ indexBuffer->setDataGenerator(Qt3DRender::QBufferDataGeneratorPtr(new TestFunctor(1340)));
indexBuffer->setSyncData(true);
QTest::newRow("index") << indexBuffer;
}
@@ -110,11 +110,11 @@ private Q_SLOTS:
QCOMPARE(buffer->data(), clone->data());
QCOMPARE(buffer->usage(), clone->usage());
QCOMPARE(buffer->type(), clone->type());
- QCOMPARE(buffer->bufferFunctor(), clone->bufferFunctor());
+ QCOMPARE(buffer->dataGenerator(), clone->dataGenerator());
QCOMPARE(buffer->isSyncData(), clone->isSyncData());
- if (buffer->bufferFunctor()) {
- QVERIFY(clone->bufferFunctor());
- QVERIFY(*clone->bufferFunctor() == *buffer->bufferFunctor());
+ if (buffer->dataGenerator()) {
+ QVERIFY(clone->dataGenerator());
+ QVERIFY(*clone->dataGenerator() == *buffer->dataGenerator());
}
}
@@ -161,15 +161,15 @@ private Q_SLOTS:
arbiter.events.clear();
// WHEN
- Qt3DRender::QBufferFunctorPtr functor(new TestFunctor(355));
- buffer->setBufferFunctor(functor);
+ Qt3DRender::QBufferDataGeneratorPtr functor(new TestFunctor(355));
+ buffer->setDataGenerator(functor);
QCoreApplication::processEvents();
// THEN
QCOMPARE(arbiter.events.size(), 1);
change = arbiter.events.first().staticCast<Qt3DCore::QScenePropertyChange>();
- QCOMPARE(change->propertyName(), "bufferFunctor");
- QCOMPARE(change->value().value<Qt3DRender::QBufferFunctorPtr>(), functor);
+ QCOMPARE(change->propertyName(), "dataGenerator");
+ QCOMPARE(change->value().value<Qt3DRender::QBufferDataGeneratorPtr>(), functor);
arbiter.events.clear();
diff --git a/tests/auto/render/qdefaultmeshes/tst_qdefaultmeshes.cpp b/tests/auto/render/qdefaultmeshes/tst_qdefaultmeshes.cpp
index 51eaee7e8..063a80723 100644
--- a/tests/auto/render/qdefaultmeshes/tst_qdefaultmeshes.cpp
+++ b/tests/auto/render/qdefaultmeshes/tst_qdefaultmeshes.cpp
@@ -33,7 +33,7 @@
#include <Qt3DRender/qgeometry.h>
#include <Qt3DRender/qattribute.h>
#include <Qt3DRender/qbuffer.h>
-#include <Qt3DRender/qbufferfunctor.h>
+#include <Qt3DRender/qbufferdatagenerator.h>
#include <Qt3DRender/qspheremesh.h>
#include <Qt3DRender/qcylindermesh.h>
@@ -117,11 +117,11 @@ private Q_SLOTS:
QCOMPARE(buffer->data(), clonedBuffer->data());
QCOMPARE(buffer->usage(), clonedBuffer->usage());
QCOMPARE(buffer->type(), clonedBuffer->type());
- QCOMPARE(buffer->bufferFunctor(), clonedBuffer->bufferFunctor());
+ QCOMPARE(buffer->dataGenerator(), clonedBuffer->dataGenerator());
QCOMPARE(buffer->isSyncData(), clonedBuffer->isSyncData());
- if (buffer->bufferFunctor()) {
- QVERIFY(clonedBuffer->bufferFunctor());
- QVERIFY(*clonedBuffer->bufferFunctor() == *buffer->bufferFunctor());
+ if (buffer->dataGenerator()) {
+ QVERIFY(clonedBuffer->dataGenerator());
+ QVERIFY(*clonedBuffer->dataGenerator() == *buffer->dataGenerator());
}
}
}