From 17706144e9dc6c2dfde580b7821f18c5f6924682 Mon Sep 17 00:00:00 2001 From: Mike Krus Date: Wed, 22 Jan 2020 21:35:32 +0000 Subject: Geometry refactoring Move QBuffer, QAttribute, QGeometry to Qt3DCore. Change-Id: I59dfd091eefadcada93350b3aba955f40b304385 Reviewed-by: Paul Lemire --- .../qmorphinganimation/tst_qmorphinganimation.cpp | 18 +-- .../animation/qmorphtarget/tst_qmorphtarget.cpp | 32 ++-- tests/auto/extras/common/geometrytesthelper.h | 14 +- .../extras/qcuboidgeometry/tst_qcuboidgeometry.cpp | 28 ++-- .../extras/qtorusgeometry/tst_qtorusgeometry.cpp | 28 ++-- tests/auto/quick3d/3dcore/3dcore.qml | 4 + tests/auto/quick3d/3drender/3drender.qml | 4 - tests/auto/quick3d/quick3dbuffer/quick3dbuffer.pro | 2 +- .../quick3d/quick3dbuffer/tst_quick3dbuffer.cpp | 6 +- tests/auto/render/attribute/tst_attribute.cpp | 46 +++--- .../render/boundingsphere/tst_boundingsphere.cpp | 34 ++--- tests/auto/render/buffer/tst_buffer.cpp | 38 +++-- .../coordinatereader/tst_coordinatereader.cpp | 70 ++++----- tests/auto/render/geometry/tst_geometry.cpp | 32 ++-- .../render/geometryloaders/tst_geometryloaders.cpp | 5 +- .../geometryrenderer/tst_geometryrenderer.cpp | 14 +- tests/auto/render/gltfplugins/tst_gltfplugins.cpp | 136 ++++++++--------- .../auto/render/meshfunctors/tst_meshfunctors.cpp | 33 ++--- tests/auto/render/opengl/textures/tst_textures.cpp | 4 +- tests/auto/render/picking/tst_picking.cpp | 6 +- .../proximityfiltering/tst_proximityfiltering.cpp | 18 +-- tests/auto/render/qattribute/tst_qattribute.cpp | 56 +++---- tests/auto/render/qbuffer/tst_qbuffer.cpp | 12 +- tests/auto/render/qgeometry/tst_qgeometry.cpp | 24 +-- .../qgeometryrenderer/tst_qgeometryrenderer.cpp | 18 +-- tests/auto/render/scene2d/tst_scene2d.cpp | 22 +-- .../render/segmentvisitor/tst_segmentvisitor.cpp | 130 ++++++++--------- .../render/trianglevisitor/tst_trianglevisitor.cpp | 162 ++++++++++----------- .../tst_updatemeshtrianglelistjob.cpp | 12 +- 29 files changed, 494 insertions(+), 514 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/animation/qmorphinganimation/tst_qmorphinganimation.cpp b/tests/auto/animation/qmorphinganimation/tst_qmorphinganimation.cpp index 77ff01851..f41c8871b 100644 --- a/tests/auto/animation/qmorphinganimation/tst_qmorphinganimation.cpp +++ b/tests/auto/animation/qmorphinganimation/tst_qmorphinganimation.cpp @@ -35,11 +35,11 @@ class tst_QMorphingAnimation : public QObject { Q_OBJECT - bool verifyAttribute(Qt3DRender::QGeometry *geometry, QString name, - Qt3DRender::QAttribute *attribute) + bool verifyAttribute(Qt3DCore::QGeometry *geometry, QString name, + Qt3DCore::QAttribute *attribute) { - const QVector attributes = geometry->attributes(); - for (const Qt3DRender::QAttribute *attr : attributes) { + const QVector attributes = geometry->attributes(); + for (const Qt3DCore::QAttribute *attr : attributes) { if (attr->name() == name) { if (attr == attribute) return true; @@ -161,15 +161,15 @@ private Q_SLOTS: const QString baseName("position"); const QString targetName("positionTarget"); Qt3DAnimation::QMorphingAnimation morphingAnimation; - Qt3DRender::QAttribute *base = new Qt3DRender::QAttribute; + Qt3DCore::QAttribute *base = new Qt3DCore::QAttribute; - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry; + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry; Qt3DAnimation::QMorphTarget *mt1 = new Qt3DAnimation::QMorphTarget(&morphingAnimation); Qt3DAnimation::QMorphTarget *mt2 = new Qt3DAnimation::QMorphTarget(&morphingAnimation); Qt3DAnimation::QMorphTarget *mt3 = new Qt3DAnimation::QMorphTarget(&morphingAnimation); - Qt3DRender::QAttribute *a1 = new Qt3DRender::QAttribute(geometry); - Qt3DRender::QAttribute *a2 = new Qt3DRender::QAttribute(geometry); - Qt3DRender::QAttribute *a3 = new Qt3DRender::QAttribute(geometry); + Qt3DCore::QAttribute *a1 = new Qt3DCore::QAttribute(geometry); + Qt3DCore::QAttribute *a2 = new Qt3DCore::QAttribute(geometry); + Qt3DCore::QAttribute *a3 = new Qt3DCore::QAttribute(geometry); Qt3DRender::QGeometryRenderer gr; base->setName(baseName); diff --git a/tests/auto/animation/qmorphtarget/tst_qmorphtarget.cpp b/tests/auto/animation/qmorphtarget/tst_qmorphtarget.cpp index 2cba9ba2a..1511ea167 100644 --- a/tests/auto/animation/qmorphtarget/tst_qmorphtarget.cpp +++ b/tests/auto/animation/qmorphtarget/tst_qmorphtarget.cpp @@ -50,11 +50,11 @@ private Q_SLOTS: { // GIVEN Qt3DAnimation::QMorphTarget morphTarget; - Qt3DRender::QAttribute attribute1; - Qt3DRender::QAttribute attribute2; + Qt3DCore::QAttribute attribute1; + Qt3DCore::QAttribute attribute2; - attribute1.setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - attribute2.setName(Qt3DRender::QAttribute::defaultNormalAttributeName()); + attribute1.setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + attribute2.setName(Qt3DCore::QAttribute::defaultNormalAttributeName()); { // WHEN @@ -63,7 +63,7 @@ private Q_SLOTS: // THEN QStringList names = morphTarget.attributeNames(); QCOMPARE(names.size(), 1); - QCOMPARE(names.at(0), Qt3DRender::QAttribute::defaultPositionAttributeName()); + QCOMPARE(names.at(0), Qt3DCore::QAttribute::defaultPositionAttributeName()); } { @@ -73,23 +73,23 @@ private Q_SLOTS: // THEN QStringList names = morphTarget.attributeNames(); QCOMPARE(names.size(), 2); - QCOMPARE(names.at(1), Qt3DRender::QAttribute::defaultNormalAttributeName()); + QCOMPARE(names.at(1), Qt3DCore::QAttribute::defaultNormalAttributeName()); } } void testFromGeometry() { // GIVEN - Qt3DRender::QGeometry geometry; - Qt3DRender::QAttribute *attribute1 = new Qt3DRender::QAttribute; - Qt3DRender::QAttribute *attribute2 = new Qt3DRender::QAttribute; - attribute1->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - attribute2->setName(Qt3DRender::QAttribute::defaultTextureCoordinateAttributeName()); + Qt3DCore::QGeometry geometry; + Qt3DCore::QAttribute *attribute1 = new Qt3DCore::QAttribute; + Qt3DCore::QAttribute *attribute2 = new Qt3DCore::QAttribute; + attribute1->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + attribute2->setName(Qt3DCore::QAttribute::defaultTextureCoordinateAttributeName()); geometry.addAttribute(attribute1); geometry.addAttribute(attribute2); QStringList attributes; - attributes.push_back(Qt3DRender::QAttribute::defaultPositionAttributeName()); + attributes.push_back(Qt3DCore::QAttribute::defaultPositionAttributeName()); { // WHEN @@ -99,20 +99,20 @@ private Q_SLOTS: // THEN QStringList names = morphTarget->attributeNames(); QCOMPARE(names.size(), 1); - QCOMPARE(names.at(0), Qt3DRender::QAttribute::defaultPositionAttributeName()); + QCOMPARE(names.at(0), Qt3DCore::QAttribute::defaultPositionAttributeName()); } { // WHEN - attributes.push_back(Qt3DRender::QAttribute::defaultTextureCoordinateAttributeName()); + attributes.push_back(Qt3DCore::QAttribute::defaultTextureCoordinateAttributeName()); QScopedPointer morphTarget( Qt3DAnimation::QMorphTarget::fromGeometry(&geometry, attributes)); // THEN QStringList names = morphTarget->attributeNames(); QCOMPARE(names.size(), 2); - QCOMPARE(names.at(0), Qt3DRender::QAttribute::defaultPositionAttributeName()); - QCOMPARE(names.at(1), Qt3DRender::QAttribute::defaultTextureCoordinateAttributeName()); + QCOMPARE(names.at(0), Qt3DCore::QAttribute::defaultPositionAttributeName()); + QCOMPARE(names.at(1), Qt3DCore::QAttribute::defaultTextureCoordinateAttributeName()); } } diff --git a/tests/auto/extras/common/geometrytesthelper.h b/tests/auto/extras/common/geometrytesthelper.h index b825fa407..a80d652a8 100644 --- a/tests/auto/extras/common/geometrytesthelper.h +++ b/tests/auto/extras/common/geometrytesthelper.h @@ -29,12 +29,12 @@ #ifndef GEOMETRYTESTHELPER_H #define GEOMETRYTESTHELPER_H -#include -#include -#include +#include +#include +#include template -IndexType extractIndexData(Qt3DRender::QAttribute *attribute, int index) +IndexType extractIndexData(Qt3DCore::QAttribute *attribute, int index) { // Get the raw data const IndexType *typedData = reinterpret_cast(attribute->buffer()->data().constData()); @@ -45,7 +45,7 @@ IndexType extractIndexData(Qt3DRender::QAttribute *attribute, int index) } template -VertexType extractVertexData(Qt3DRender::QAttribute *attribute, IndexType index) +VertexType extractVertexData(Qt3DCore::QAttribute *attribute, IndexType index) { // Get the raw data const char *rawData = attribute->buffer()->data().constData(); @@ -55,10 +55,10 @@ VertexType extractVertexData(Qt3DRender::QAttribute *attribute, IndexType index) // Construct vertex from the typed data VertexType vertex; - const Qt3DRender::QAttribute::VertexBaseType type = attribute->vertexBaseType(); + const Qt3DCore::QAttribute::VertexBaseType type = attribute->vertexBaseType(); switch (type) { - case Qt3DRender::QAttribute::Float: { + case Qt3DCore::QAttribute::Float: { const float *typedVertexData = reinterpret_cast(vertexData); const int components = attribute->vertexSize(); for (int i = 0; i < components; ++i) diff --git a/tests/auto/extras/qcuboidgeometry/tst_qcuboidgeometry.cpp b/tests/auto/extras/qcuboidgeometry/tst_qcuboidgeometry.cpp index f20b1e870..2bfa89601 100644 --- a/tests/auto/extras/qcuboidgeometry/tst_qcuboidgeometry.cpp +++ b/tests/auto/extras/qcuboidgeometry/tst_qcuboidgeometry.cpp @@ -29,9 +29,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -58,13 +58,13 @@ private Q_SLOTS: QCOMPARE(geometry.yzMeshResolution(), QSize(2, 2)); QCOMPARE(geometry.xzMeshResolution(), QSize(2, 2)); QVERIFY(geometry.positionAttribute() != nullptr); - QCOMPARE(geometry.positionAttribute()->name(), Qt3DRender::QAttribute::defaultPositionAttributeName()); + QCOMPARE(geometry.positionAttribute()->name(), Qt3DCore::QAttribute::defaultPositionAttributeName()); QVERIFY(geometry.normalAttribute() != nullptr); - QCOMPARE(geometry.normalAttribute()->name(), Qt3DRender::QAttribute::defaultNormalAttributeName()); + QCOMPARE(geometry.normalAttribute()->name(), Qt3DCore::QAttribute::defaultNormalAttributeName()); QVERIFY(geometry.texCoordAttribute() != nullptr); - QCOMPARE(geometry.texCoordAttribute()->name(), Qt3DRender::QAttribute::defaultTextureCoordinateAttributeName()); + QCOMPARE(geometry.texCoordAttribute()->name(), Qt3DCore::QAttribute::defaultTextureCoordinateAttributeName()); QVERIFY(geometry.tangentAttribute() != nullptr); - QCOMPARE(geometry.tangentAttribute()->name(), Qt3DRender::QAttribute::defaultTangentAttributeName()); + QCOMPARE(geometry.tangentAttribute()->name(), Qt3DCore::QAttribute::defaultTangentAttributeName()); QVERIFY(geometry.indexAttribute() != nullptr); } @@ -520,12 +520,12 @@ private Q_SLOTS: { // GIVEN Qt3DExtras::QCuboidGeometry geometry; - const QVector attributes = geometry.attributes(); - Qt3DRender::QAttribute *positionAttribute = geometry.positionAttribute(); - Qt3DRender::QAttribute *normalAttribute = geometry.normalAttribute(); - Qt3DRender::QAttribute *texCoordAttribute = geometry.texCoordAttribute(); - Qt3DRender::QAttribute *tangentAttribute = geometry.tangentAttribute(); - Qt3DRender::QAttribute *indexAttribute = geometry.indexAttribute(); + const QVector attributes = geometry.attributes(); + Qt3DCore::QAttribute *positionAttribute = geometry.positionAttribute(); + Qt3DCore::QAttribute *normalAttribute = geometry.normalAttribute(); + Qt3DCore::QAttribute *texCoordAttribute = geometry.texCoordAttribute(); + Qt3DCore::QAttribute *tangentAttribute = geometry.tangentAttribute(); + Qt3DCore::QAttribute *indexAttribute = geometry.indexAttribute(); // WHEN QFETCH(float, xExtent); @@ -545,7 +545,7 @@ private Q_SLOTS: // Check buffer of each attribute is valid and actually has some data for (const auto &attribute : attributes) { - Qt3DRender::QBuffer *buffer = attribute->buffer(); + Qt3DCore::QBuffer *buffer = attribute->buffer(); QVERIFY(buffer != nullptr); QVERIFY(buffer->data().size() != 0); } diff --git a/tests/auto/extras/qtorusgeometry/tst_qtorusgeometry.cpp b/tests/auto/extras/qtorusgeometry/tst_qtorusgeometry.cpp index 7a6965f20..08afd09e3 100644 --- a/tests/auto/extras/qtorusgeometry/tst_qtorusgeometry.cpp +++ b/tests/auto/extras/qtorusgeometry/tst_qtorusgeometry.cpp @@ -29,9 +29,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -57,14 +57,14 @@ private Q_SLOTS: QCOMPARE(geometry.radius(), 1.0f); QCOMPARE(geometry.minorRadius(), 1.0f); QVERIFY(geometry.positionAttribute() != nullptr); - QCOMPARE(geometry.positionAttribute()->name(), Qt3DRender::QAttribute::defaultPositionAttributeName()); + QCOMPARE(geometry.positionAttribute()->name(), Qt3DCore::QAttribute::defaultPositionAttributeName()); QVERIFY(geometry.normalAttribute() != nullptr); - QCOMPARE(geometry.normalAttribute()->name(), Qt3DRender::QAttribute::defaultNormalAttributeName()); + QCOMPARE(geometry.normalAttribute()->name(), Qt3DCore::QAttribute::defaultNormalAttributeName()); QVERIFY(geometry.texCoordAttribute() != nullptr); - QCOMPARE(geometry.texCoordAttribute()->name(), Qt3DRender::QAttribute::defaultTextureCoordinateAttributeName()); + QCOMPARE(geometry.texCoordAttribute()->name(), Qt3DCore::QAttribute::defaultTextureCoordinateAttributeName()); // TODO: Expose tangent attribute in Qt 5.8 and see below // QVERIFY(geometry.tangentAttribute() != nullptr); -// QCOMPARE(geometry.tangentAttribute()->name(), Qt3DRender::QAttribute::defaultTangentAttributeName()); +// QCOMPARE(geometry.tangentAttribute()->name(), Qt3DCore::QAttribute::defaultTangentAttributeName()); QVERIFY(geometry.indexAttribute() != nullptr); } @@ -299,12 +299,12 @@ private Q_SLOTS: { // GIVEN Qt3DExtras::QTorusGeometry geometry; - const QVector attributes = geometry.attributes(); - Qt3DRender::QAttribute *positionAttribute = geometry.positionAttribute(); - Qt3DRender::QAttribute *normalAttribute = geometry.normalAttribute(); - Qt3DRender::QAttribute *texCoordAttribute = geometry.texCoordAttribute(); -// Qt3DRender::QAttribute *tangentAttribute = geometry.tangentAttribute(); - Qt3DRender::QAttribute *indexAttribute = geometry.indexAttribute(); + const QVector attributes = geometry.attributes(); + Qt3DCore::QAttribute *positionAttribute = geometry.positionAttribute(); + Qt3DCore::QAttribute *normalAttribute = geometry.normalAttribute(); + Qt3DCore::QAttribute *texCoordAttribute = geometry.texCoordAttribute(); +// Qt3DCore::QAttribute *tangentAttribute = geometry.tangentAttribute(); + Qt3DCore::QAttribute *indexAttribute = geometry.indexAttribute(); // WHEN QFETCH(int, rings); @@ -320,7 +320,7 @@ private Q_SLOTS: // Check buffer of each attribute is valid and actually has some data for (const auto &attribute : attributes) { - Qt3DRender::QBuffer *buffer = attribute->buffer(); + Qt3DCore::QBuffer *buffer = attribute->buffer(); QVERIFY(buffer != nullptr); QVERIFY(buffer->data().size() != 0); } diff --git a/tests/auto/quick3d/3dcore/3dcore.qml b/tests/auto/quick3d/3dcore/3dcore.qml index d0a5c6f09..664c29bc9 100644 --- a/tests/auto/quick3d/3dcore/3dcore.qml +++ b/tests/auto/quick3d/3dcore/3dcore.qml @@ -50,4 +50,8 @@ Item { QQ3Core210.Joint {} QQ3Core214.Transform {} + + QQ3Core20.Attribute {} //Qt3DCore::QAttribute + QQ3Core20.Buffer {} //Qt3DCore::Quick::Quick3DBuffer + QQ3Core20.Geometry {} //Qt3DCore::QGeometry, Qt3DCore::Quick::Quick3DGeometry } diff --git a/tests/auto/quick3d/3drender/3drender.qml b/tests/auto/quick3d/3drender/3drender.qml index 8c200f3c0..cc0db1ab1 100644 --- a/tests/auto/quick3d/3drender/3drender.qml +++ b/tests/auto/quick3d/3drender/3drender.qml @@ -87,10 +87,6 @@ Item { QQ3Render213.SetFence {} //Qt3DRender::QSetFence // Geometry - QQ3Render20.Attribute {} //Qt3DRender::QAttribute - //QQ3Render20.BufferBase // (uncreatable) Qt3DRender::QBuffer - QQ3Render20.Buffer {} //Qt3DRender::Render::Quick::Quick3DBuffer - QQ3Render20.Geometry {} //Qt3DRender::QGeometry, Qt3DRender::Render::Quick::Quick3DGeometry QQ3Render20.GeometryRenderer {} //Qt3DRender::QGeometryRenderer // Mesh diff --git a/tests/auto/quick3d/quick3dbuffer/quick3dbuffer.pro b/tests/auto/quick3d/quick3dbuffer/quick3dbuffer.pro index f36e42ff5..afcc30d19 100644 --- a/tests/auto/quick3d/quick3dbuffer/quick3dbuffer.pro +++ b/tests/auto/quick3d/quick3dbuffer/quick3dbuffer.pro @@ -2,7 +2,7 @@ TEMPLATE = app TARGET = tst_quick3dbuffer -QT += 3dcore 3dcore-private 3drender 3drender-private 3dquick 3dquick-private 3dquickrender-private testlib +QT += 3dcore 3dcore-private 3dquick 3dquick-private testlib CONFIG += testcase diff --git a/tests/auto/quick3d/quick3dbuffer/tst_quick3dbuffer.cpp b/tests/auto/quick3d/quick3dbuffer/tst_quick3dbuffer.cpp index 0392c0402..21f62ac00 100644 --- a/tests/auto/quick3d/quick3dbuffer/tst_quick3dbuffer.cpp +++ b/tests/auto/quick3d/quick3dbuffer/tst_quick3dbuffer.cpp @@ -28,7 +28,7 @@ #include -#include +#include #include #include @@ -53,7 +53,7 @@ private Q_SLOTS: void checkInvalidBinaryFile() { // GIVEN - Qt3DRender::Render::Quick::Quick3DBuffer buf; + Qt3DCore::Quick::Quick3DBuffer buf; // WHEN QVariant data = buf.readBinaryFile(QUrl::fromLocalFile(QLatin1String("this_should_not_exist.bin"))); @@ -66,7 +66,7 @@ private Q_SLOTS: void checkValidBinaryFile() { // GIVEN - Qt3DRender::Render::Quick::Quick3DBuffer buf; + Qt3DCore::Quick::Quick3DBuffer buf; QVector dataArray = QVector() << QVector3D(327.0f, 350.0f, 355.0f) << QVector3D(383.0f, 427.0f, 454.0f); diff --git a/tests/auto/render/attribute/tst_attribute.cpp b/tests/auto/render/attribute/tst_attribute.cpp index 5571ef334..0b47f808d 100644 --- a/tests/auto/render/attribute/tst_attribute.cpp +++ b/tests/auto/render/attribute/tst_attribute.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include "testrenderer.h" class tst_Attribute : public Qt3DCore::QBackendNodeTester @@ -45,18 +45,18 @@ private Q_SLOTS: Qt3DRender::Render::Attribute renderAttribute; renderAttribute.setRenderer(&renderer); - Qt3DRender::QAttribute attribute; - attribute.setAttributeType(Qt3DRender::QAttribute::IndexAttribute); + Qt3DCore::QAttribute attribute; + attribute.setAttributeType(Qt3DCore::QAttribute::IndexAttribute); attribute.setByteOffset(1200); attribute.setByteStride(883); attribute.setCount(427); attribute.setDivisor(305); attribute.setName(QStringLiteral("C3")); - attribute.setVertexBaseType(Qt3DRender::QAttribute::UnsignedShort); + attribute.setVertexBaseType(Qt3DCore::QAttribute::UnsignedShort); attribute.setVertexSize(3); - Qt3DRender::QBuffer buffer; - buffer.setUsage(Qt3DRender::QBuffer::DynamicCopy); + Qt3DCore::QBuffer buffer; + buffer.setUsage(Qt3DCore::QBuffer::DynamicCopy); buffer.setData(QByteArrayLiteral("Corvette")); attribute.setBuffer(&buffer); @@ -89,26 +89,26 @@ private Q_SLOTS: QVERIFY(renderAttribute.bufferId().isNull()); QVERIFY(renderAttribute.name().isEmpty()); QCOMPARE(renderAttribute.isDirty(), false); - QCOMPARE(renderAttribute.vertexBaseType(), Qt3DRender::QAttribute::Float); + QCOMPARE(renderAttribute.vertexBaseType(), Qt3DCore::QAttribute::Float); QCOMPARE(renderAttribute.vertexSize(), 1U); - QCOMPARE(renderAttribute.attributeType(), Qt3DRender::QAttribute::VertexAttribute); + QCOMPARE(renderAttribute.attributeType(), Qt3DCore::QAttribute::VertexAttribute); QCOMPARE(renderAttribute.byteOffset(), 0U); QCOMPARE(renderAttribute.byteStride(), 0U); QCOMPARE(renderAttribute.count(), 0U); QCOMPARE(renderAttribute.divisor(), 0U); // GIVEN - Qt3DRender::QAttribute attribute; - attribute.setAttributeType(Qt3DRender::QAttribute::IndexAttribute); + Qt3DCore::QAttribute attribute; + attribute.setAttributeType(Qt3DCore::QAttribute::IndexAttribute); attribute.setByteOffset(1200); attribute.setByteStride(883); attribute.setCount(427); attribute.setDivisor(305); attribute.setName(QStringLiteral("C3")); - attribute.setVertexBaseType(Qt3DRender::QAttribute::Double); + attribute.setVertexBaseType(Qt3DCore::QAttribute::Double); attribute.setVertexSize(4); - Qt3DRender::QBuffer buffer; - buffer.setUsage(Qt3DRender::QBuffer::DynamicCopy); + Qt3DCore::QBuffer buffer; + buffer.setUsage(Qt3DCore::QBuffer::DynamicCopy); buffer.setData(QByteArrayLiteral("C7")); attribute.setBuffer(&buffer); @@ -120,9 +120,9 @@ private Q_SLOTS: QVERIFY(renderAttribute.bufferId().isNull()); QVERIFY(renderAttribute.name().isEmpty()); QCOMPARE(renderAttribute.isDirty(), false); - QCOMPARE(renderAttribute.vertexBaseType(), Qt3DRender::QAttribute::Float); + QCOMPARE(renderAttribute.vertexBaseType(), Qt3DCore::QAttribute::Float); QCOMPARE(renderAttribute.vertexSize(), 1U); - QCOMPARE(renderAttribute.attributeType(), Qt3DRender::QAttribute::VertexAttribute); + QCOMPARE(renderAttribute.attributeType(), Qt3DCore::QAttribute::VertexAttribute); QCOMPARE(renderAttribute.byteOffset(), 0U); QCOMPARE(renderAttribute.byteStride(), 0U); QCOMPARE(renderAttribute.count(), 0U); @@ -132,7 +132,7 @@ private Q_SLOTS: void checkPropertyChanges() { // GIVEN - Qt3DRender::QAttribute attribute; + Qt3DCore::QAttribute attribute; TestRenderer renderer; Qt3DRender::Render::Attribute renderAttribute; renderAttribute.setRenderer(&renderer); @@ -144,11 +144,11 @@ private Q_SLOTS: QVERIFY(!renderer.dirtyBits()); // WHEN - attribute.setVertexBaseType(Qt3DRender::QAttribute::Int); + attribute.setVertexBaseType(Qt3DCore::QAttribute::Int); renderAttribute.syncFromFrontEnd(&attribute, false); // THEN - QCOMPARE(renderAttribute.vertexBaseType(), Qt3DRender::QAttribute::Int); + QCOMPARE(renderAttribute.vertexBaseType(), Qt3DCore::QAttribute::Int); QVERIFY(renderAttribute.isDirty()); QVERIFY(renderer.dirtyBits() != 0); @@ -171,11 +171,11 @@ private Q_SLOTS: QVERIFY(!renderAttribute.isDirty()); // WHEN - attribute.setAttributeType(Qt3DRender::QAttribute::IndexAttribute); + attribute.setAttributeType(Qt3DCore::QAttribute::IndexAttribute); renderAttribute.syncFromFrontEnd(&attribute, false); // THEN - QCOMPARE(renderAttribute.attributeType(), Qt3DRender::QAttribute::IndexAttribute); + QCOMPARE(renderAttribute.attributeType(), Qt3DCore::QAttribute::IndexAttribute); QVERIFY(renderAttribute.isDirty()); QVERIFY(renderer.dirtyBits() != 0); @@ -184,11 +184,11 @@ private Q_SLOTS: QVERIFY(!renderAttribute.isDirty()); // WHEN - attribute.setAttributeType(Qt3DRender::QAttribute::DrawIndirectAttribute); + attribute.setAttributeType(Qt3DCore::QAttribute::DrawIndirectAttribute); renderAttribute.syncFromFrontEnd(&attribute, false); // THEN - QCOMPARE(renderAttribute.attributeType(), Qt3DRender::QAttribute::DrawIndirectAttribute); + QCOMPARE(renderAttribute.attributeType(), Qt3DCore::QAttribute::DrawIndirectAttribute); QVERIFY(renderAttribute.isDirty()); QVERIFY(renderer.dirtyBits() != 0); @@ -262,7 +262,7 @@ private Q_SLOTS: QVERIFY(!renderAttribute.isDirty()); // WHEN - auto buffer = new Qt3DRender::QBuffer(); + auto buffer = new Qt3DCore::QBuffer(); attribute.setBuffer(buffer); renderAttribute.syncFromFrontEnd(&attribute, false); diff --git a/tests/auto/render/boundingsphere/tst_boundingsphere.cpp b/tests/auto/render/boundingsphere/tst_boundingsphere.cpp index 6c5473cff..c929c5cb5 100644 --- a/tests/auto/render/boundingsphere/tst_boundingsphere.cpp +++ b/tests/auto/render/boundingsphere/tst_boundingsphere.cpp @@ -422,8 +422,8 @@ private Q_SLOTS: QScopedPointer entity(new Qt3DCore::QEntity); QScopedPointer test(new Qt3DRender::TestAspect(entity.data())); - Qt3DRender::QBuffer *vbuffer = new Qt3DRender::QBuffer; - Qt3DRender::QBuffer *ibuffer = new Qt3DRender::QBuffer; + Qt3DCore::QBuffer *vbuffer = new Qt3DCore::QBuffer; + Qt3DCore::QBuffer *ibuffer = new Qt3DCore::QBuffer; vbuffer->setData(vdata); Qt3DRender::Render::Buffer *vbufferBackend = test->nodeManagers()->bufferManager()->getOrCreateResource(vbuffer->id()); @@ -437,15 +437,15 @@ private Q_SLOTS: ibufferBackend->setManager(test->nodeManagers()->bufferManager()); simulateInitializationSync(ibuffer, ibufferBackend); - Qt3DRender::QGeometry *g = new Qt3DRender::QGeometry; + Qt3DCore::QGeometry *g = new Qt3DCore::QGeometry; for (int i = 0; i < 2; ++i) - g->addAttribute(new Qt3DRender::QAttribute); + g->addAttribute(new Qt3DCore::QAttribute); - const QVector attrs = g->attributes(); - Qt3DRender::QAttribute *attr = attrs[0]; + const QVector attrs = g->attributes(); + Qt3DCore::QAttribute *attr = attrs[0]; attr->setBuffer(vbuffer); - attr->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - attr->setVertexBaseType(Qt3DRender::QAttribute::Float); + attr->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + attr->setVertexBaseType(Qt3DCore::QAttribute::Float); attr->setVertexSize(3); attr->setCount(6); attr->setByteOffset(0); @@ -453,8 +453,8 @@ private Q_SLOTS: attr = attrs[1]; attr->setBuffer(ibuffer); - attr->setAttributeType(Qt3DRender::QAttribute::IndexAttribute); - attr->setVertexBaseType(Qt3DRender::QAttribute::UnsignedShort); + attr->setAttributeType(Qt3DCore::QAttribute::IndexAttribute); + attr->setVertexBaseType(Qt3DCore::QAttribute::UnsignedShort); attr->setVertexSize(1); attr->setCount(indexCount); attr->setByteOffset(indexByteOffset); @@ -534,7 +534,7 @@ private Q_SLOTS: QScopedPointer entity(new Qt3DCore::QEntity); QScopedPointer test(new Qt3DRender::TestAspect(entity.data())); - Qt3DRender::QBuffer *vbuffer = new Qt3DRender::QBuffer; + Qt3DCore::QBuffer *vbuffer = new Qt3DCore::QBuffer; vbuffer->setData(vdata); Qt3DRender::Render::Buffer *vbufferBackend = test->nodeManagers()->bufferManager()->getOrCreateResource(vbuffer->id()); @@ -542,14 +542,14 @@ private Q_SLOTS: vbufferBackend->setManager(test->nodeManagers()->bufferManager()); simulateInitializationSync(vbuffer, vbufferBackend); - Qt3DRender::QGeometry *g = new Qt3DRender::QGeometry; - g->addAttribute(new Qt3DRender::QAttribute); + Qt3DCore::QGeometry *g = new Qt3DCore::QGeometry; + g->addAttribute(new Qt3DCore::QAttribute); - const QVector attrs = g->attributes(); - Qt3DRender::QAttribute *attr = attrs[0]; + const QVector attrs = g->attributes(); + Qt3DCore::QAttribute *attr = attrs[0]; attr->setBuffer(vbuffer); - attr->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - attr->setVertexBaseType(Qt3DRender::QAttribute::Float); + attr->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + attr->setVertexBaseType(Qt3DCore::QAttribute::Float); attr->setVertexSize(3); attr->setCount(6); attr->setByteOffset(0); diff --git a/tests/auto/render/buffer/tst_buffer.cpp b/tests/auto/render/buffer/tst_buffer.cpp index b9284623d..1746b81f8 100644 --- a/tests/auto/render/buffer/tst_buffer.cpp +++ b/tests/auto/render/buffer/tst_buffer.cpp @@ -26,14 +26,10 @@ ** ****************************************************************************/ -// TODO Remove in Qt6 -#include -QT_WARNING_DISABLE_DEPRECATED - #include #include #include -#include +#include #include #include #include "testarbiter.h" @@ -49,11 +45,11 @@ private Q_SLOTS: { // GIVEN Qt3DRender::Render::Buffer renderBuffer; - Qt3DRender::QBuffer buffer; + Qt3DCore::QBuffer buffer; Qt3DRender::Render::BufferManager bufferManager; TestRenderer renderer; - buffer.setUsage(Qt3DRender::QBuffer::DynamicCopy); + buffer.setUsage(Qt3DCore::QBuffer::DynamicCopy); buffer.setData(QByteArrayLiteral("Corvette")); // WHEN @@ -79,13 +75,13 @@ private Q_SLOTS: // THEN QCOMPARE(backendBuffer.isDirty(), false); - QCOMPARE(backendBuffer.usage(), Qt3DRender::QBuffer::StaticDraw); + QCOMPARE(backendBuffer.usage(), Qt3DCore::QBuffer::StaticDraw); QVERIFY(backendBuffer.data().isEmpty()); QVERIFY(backendBuffer.peerId().isNull()); QVERIFY(backendBuffer.pendingBufferUpdates().empty()); // GIVEN - Qt3DRender::QBuffer frontendBuffer; + Qt3DCore::QBuffer frontendBuffer; // WHEN backendBuffer.setManager(&bufferManager); @@ -94,17 +90,17 @@ private Q_SLOTS: // THEN QCOMPARE(backendBuffer.isDirty(), true); - QCOMPARE(backendBuffer.usage(), Qt3DRender::QBuffer::StaticDraw); + QCOMPARE(backendBuffer.usage(), Qt3DCore::QBuffer::StaticDraw); QVERIFY(backendBuffer.data().isEmpty()); QVERIFY(backendBuffer.pendingBufferUpdates().empty()); // WHEN - frontendBuffer.setUsage(Qt3DRender::QBuffer::DynamicCopy); + frontendBuffer.setUsage(Qt3DCore::QBuffer::DynamicCopy); frontendBuffer.setData(QByteArrayLiteral("C7KR4")); backendBuffer.syncFromFrontEnd(&frontendBuffer, false); // THEN - QCOMPARE(backendBuffer.usage(), Qt3DRender::QBuffer::DynamicCopy); + QCOMPARE(backendBuffer.usage(), Qt3DCore::QBuffer::DynamicCopy); QCOMPARE(backendBuffer.isDirty(), true); QCOMPARE(backendBuffer.data(), QByteArrayLiteral("C7KR4")); QVERIFY(!backendBuffer.pendingBufferUpdates().empty()); @@ -121,7 +117,7 @@ private Q_SLOTS: // THEN QCOMPARE(backendBuffer.isDirty(), false); - QCOMPARE(backendBuffer.usage(), Qt3DRender::QBuffer::StaticDraw); + QCOMPARE(backendBuffer.usage(), Qt3DCore::QBuffer::StaticDraw); QVERIFY(backendBuffer.data().isEmpty()); QVERIFY(backendBuffer.pendingBufferUpdates().empty()); } @@ -133,7 +129,7 @@ private Q_SLOTS: Qt3DRender::Render::Buffer backendBuffer; Qt3DRender::Render::BufferManager bufferManager; TestRenderer renderer; - Qt3DRender::QBuffer frontendBuffer; + Qt3DCore::QBuffer frontendBuffer; QByteArray data("111456789\0"); @@ -150,7 +146,7 @@ private Q_SLOTS: // THEN QCOMPARE(backendBuffer.pendingBufferUpdates().size(), 1); - Qt3DRender::QBufferUpdate fullUpdate = backendBuffer.pendingBufferUpdates().first(); + Qt3DCore::QBufferUpdate fullUpdate = backendBuffer.pendingBufferUpdates().first(); QCOMPARE(fullUpdate.offset, -1); QVERIFY(fullUpdate.data.isEmpty()); QCOMPARE(frontendBuffer.data(), backendBuffer.data()); @@ -185,24 +181,24 @@ private Q_SLOTS: { // GIVEN TestRenderer renderer; - Qt3DRender::QBuffer frontendBuffer; + Qt3DCore::QBuffer frontendBuffer; Qt3DRender::Render::Buffer backendBuffer; backendBuffer.setRenderer(&renderer); simulateInitializationSync(&frontendBuffer, &backendBuffer); // THEN QVERIFY(backendBuffer.data().isEmpty()); - QVERIFY(backendBuffer.usage() != Qt3DRender::QBuffer::DynamicRead); + QVERIFY(backendBuffer.usage() != Qt3DCore::QBuffer::DynamicRead); QVERIFY(!backendBuffer.isDirty()); QVERIFY(renderer.dirtyBits() & Qt3DRender::Render::AbstractRenderer::BuffersDirty); renderer.clearDirtyBits(Qt3DRender::Render::AbstractRenderer::AllDirty); // WHEN - frontendBuffer.setUsage(Qt3DRender::QBuffer::DynamicRead); + frontendBuffer.setUsage(Qt3DCore::QBuffer::DynamicRead); backendBuffer.syncFromFrontEnd(&frontendBuffer, false); // THEN - QCOMPARE(backendBuffer.usage(), Qt3DRender::QBuffer::DynamicRead); + QCOMPARE(backendBuffer.usage(), Qt3DCore::QBuffer::DynamicRead); QVERIFY(backendBuffer.isDirty()); QVERIFY(renderer.dirtyBits() & Qt3DRender::Render::AbstractRenderer::BuffersDirty); @@ -252,7 +248,7 @@ private Q_SLOTS: { // GIVEN Qt3DRender::Render::Buffer renderBuffer; - Qt3DRender::QBuffer buffer; + Qt3DCore::QBuffer buffer; Qt3DRender::Render::BufferManager bufferManager; TestRenderer renderer; @@ -278,7 +274,7 @@ private Q_SLOTS: { // GIVEN Qt3DRender::Render::Buffer renderBuffer; - Qt3DRender::QBuffer buffer; + Qt3DCore::QBuffer buffer; Qt3DRender::Render::BufferManager bufferManager; TestRenderer renderer; diff --git a/tests/auto/render/coordinatereader/tst_coordinatereader.cpp b/tests/auto/render/coordinatereader/tst_coordinatereader.cpp index 417684245..9ff37f878 100644 --- a/tests/auto/render/coordinatereader/tst_coordinatereader.cpp +++ b/tests/auto/render/coordinatereader/tst_coordinatereader.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include @@ -115,11 +115,11 @@ private Q_SLOTS: void checkSetGeometry() { QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer( new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); TestReader reader(nodeManagers.data()); TestRenderer renderer; @@ -152,13 +152,13 @@ private Q_SLOTS: simulateInitializationSync(dataBuffer.data(), backendBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(6); positionAttribute->setByteStride(3 * 4); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); geometry->addAttribute(positionAttribute.data()); geometryRenderer->setGeometry(geometry); @@ -182,13 +182,13 @@ private Q_SLOTS: // WHEN bool ret = reader.setGeometry(backendRenderer, - Qt3DRender::QAttribute::defaultPositionAttributeName()); + Qt3DCore::QAttribute::defaultPositionAttributeName()); // THEN QCOMPARE(ret, true); QCOMPARE(reader.attribute(), backendAttribute); QCOMPARE(reader.buffer(), backendBuffer); - QCOMPARE(reader.bufferInfo().type, Qt3DRender::QAttribute::Float); + QCOMPARE(reader.bufferInfo().type, Qt3DCore::QAttribute::Float); QCOMPARE(reader.bufferInfo().dataSize, 3u); QCOMPARE(reader.bufferInfo().count, 6u); QCOMPARE(reader.bufferInfo().byteStride, 12u); @@ -198,11 +198,11 @@ private Q_SLOTS: void testReadCoordinate() { QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer( new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); TestReader reader(nodeManagers.data()); TestRenderer renderer; @@ -235,13 +235,13 @@ private Q_SLOTS: simulateInitializationSync(dataBuffer.data(), backendBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(6); positionAttribute->setByteStride(3 * 4); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); geometry->addAttribute(positionAttribute.data()); geometryRenderer->setGeometry(geometry); @@ -265,7 +265,7 @@ private Q_SLOTS: // WHEN bool ret = reader.setGeometry(backendRenderer, - Qt3DRender::QAttribute::defaultPositionAttributeName()); + Qt3DCore::QAttribute::defaultPositionAttributeName()); // THEN QCOMPARE(ret, true); @@ -281,11 +281,11 @@ private Q_SLOTS: void testReadCoordinateVec4() { QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer( new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); TestReader reader(nodeManagers.data()); TestRenderer renderer; @@ -329,13 +329,13 @@ private Q_SLOTS: simulateInitializationSync(dataBuffer.data(), backendBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(4); positionAttribute->setCount(6); positionAttribute->setByteStride(4 * 4); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); geometry->addAttribute(positionAttribute.data()); geometryRenderer->setGeometry(geometry); @@ -359,7 +359,7 @@ private Q_SLOTS: // WHEN bool ret = reader.setGeometry(backendRenderer, - Qt3DRender::QAttribute::defaultPositionAttributeName()); + Qt3DCore::QAttribute::defaultPositionAttributeName()); // THEN QCOMPARE(ret, true); @@ -375,12 +375,12 @@ private Q_SLOTS: void testReadCoordinateFromAttribute() { QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer( new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer texcoordAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer texcoordAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); TestReader reader(nodeManagers.data()); TestRenderer renderer; @@ -418,23 +418,23 @@ private Q_SLOTS: simulateInitializationSync(dataBuffer.data(), backendBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(3); positionAttribute->setByteStride(3 * 4 * 2); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); geometry->addAttribute(positionAttribute.data()); texcoordAttribute->setBuffer(dataBuffer.data()); - texcoordAttribute->setName(Qt3DRender::QAttribute::defaultTextureCoordinateAttributeName()); - texcoordAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + texcoordAttribute->setName(Qt3DCore::QAttribute::defaultTextureCoordinateAttributeName()); + texcoordAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); texcoordAttribute->setVertexSize(3); texcoordAttribute->setCount(6); texcoordAttribute->setByteStride(3 * 4 * 2); texcoordAttribute->setByteOffset(3 * 4); - texcoordAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + texcoordAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); geometry->addAttribute(texcoordAttribute.data()); geometryRenderer->setGeometry(geometry); @@ -463,7 +463,7 @@ private Q_SLOTS: // WHEN bool ret = reader.setGeometry(backendRenderer, - Qt3DRender::QAttribute::defaultPositionAttributeName()); + Qt3DCore::QAttribute::defaultPositionAttributeName()); // THEN QCOMPARE(ret, true); @@ -474,7 +474,7 @@ private Q_SLOTS: // WHEN ret = reader.setGeometry(backendRenderer, - Qt3DRender::QAttribute::defaultTextureCoordinateAttributeName()); + Qt3DCore::QAttribute::defaultTextureCoordinateAttributeName()); // THEN QCOMPARE(ret, true); diff --git a/tests/auto/render/geometry/tst_geometry.cpp b/tests/auto/render/geometry/tst_geometry.cpp index 9355f8339..aa856da39 100644 --- a/tests/auto/render/geometry/tst_geometry.cpp +++ b/tests/auto/render/geometry/tst_geometry.cpp @@ -33,18 +33,18 @@ QT_WARNING_DISABLE_DEPRECATED #include #include #include -#include -#include +#include +#include #include #include "testrenderer.h" #include "testarbiter.h" -class DummyAttribute : public Qt3DRender::QAttribute +class DummyAttribute : public Qt3DCore::QAttribute { Q_OBJECT public: DummyAttribute(Qt3DCore::QNode *parent = nullptr) - : Qt3DRender::QAttribute(parent) + : Qt3DCore::QAttribute(parent) {} }; @@ -60,11 +60,11 @@ private Q_SLOTS: Qt3DRender::Render::Geometry renderGeometry; TestRenderer renderer; - Qt3DRender::QGeometry geometry; - Qt3DRender::QAttribute attr1; - Qt3DRender::QAttribute attr2; - Qt3DRender::QAttribute attr4; - Qt3DRender::QAttribute attr3; + Qt3DCore::QGeometry geometry; + Qt3DCore::QAttribute attr1; + Qt3DCore::QAttribute attr2; + Qt3DCore::QAttribute attr4; + Qt3DCore::QAttribute attr3; geometry.addAttribute(&attr1); geometry.addAttribute(&attr2); @@ -91,7 +91,7 @@ private Q_SLOTS: { // GIVEN Qt3DRender::Render::Geometry renderGeometry; - Qt3DRender::QGeometry geometry; + Qt3DCore::QGeometry geometry; TestRenderer renderer; renderGeometry.setRenderer(&renderer); @@ -120,11 +120,11 @@ private Q_SLOTS: QCOMPARE(renderGeometry.boundingPositionAttribute(), Qt3DCore::QNodeId()); // GIVEN - Qt3DRender::QGeometry geometry; - Qt3DRender::QAttribute attr1; - Qt3DRender::QAttribute attr2; - Qt3DRender::QAttribute attr4; - Qt3DRender::QAttribute attr3; + Qt3DCore::QGeometry geometry; + Qt3DCore::QAttribute attr1; + Qt3DCore::QAttribute attr2; + Qt3DCore::QAttribute attr4; + Qt3DCore::QAttribute attr3; geometry.setBoundingVolumePositionAttribute(&attr1); geometry.addAttribute(&attr1); @@ -148,7 +148,7 @@ private Q_SLOTS: TestRenderer renderer; Qt3DRender::Render::Geometry renderGeometry; renderGeometry.setRenderer(&renderer); - Qt3DRender::QGeometry geometry; + Qt3DCore::QGeometry geometry; simulateInitializationSync(&geometry, &renderGeometry); diff --git a/tests/auto/render/geometryloaders/tst_geometryloaders.cpp b/tests/auto/render/geometryloaders/tst_geometryloaders.cpp index 07545403d..7fc914cda 100644 --- a/tests/auto/render/geometryloaders/tst_geometryloaders.cpp +++ b/tests/auto/render/geometryloaders/tst_geometryloaders.cpp @@ -42,14 +42,15 @@ #include #include -#include -#include +#include +#include #include #include #include "../../../../src/plugins/geometryloaders/qtgeometryloaders-config.h" +using namespace Qt3DCore; using namespace Qt3DRender; Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, geometryLoader, diff --git a/tests/auto/render/geometryrenderer/tst_geometryrenderer.cpp b/tests/auto/render/geometryrenderer/tst_geometryrenderer.cpp index 111b0a3ba..9d236b516 100644 --- a/tests/auto/render/geometryrenderer/tst_geometryrenderer.cpp +++ b/tests/auto/render/geometryrenderer/tst_geometryrenderer.cpp @@ -26,23 +26,19 @@ ** ****************************************************************************/ -// TODO Remove in Qt6 -#include -QT_WARNING_DISABLE_DEPRECATED - #include #include #include #include -#include +#include #include "testrenderer.h" -class DummyGeometry : public Qt3DRender::QGeometry +class DummyGeometry : public Qt3DCore::QGeometry { Q_OBJECT public: DummyGeometry(Qt3DCore::QNode *parent = nullptr) - : Qt3DRender::QGeometry(parent) + : Qt3DCore::QGeometry(parent) {} }; @@ -57,7 +53,7 @@ private Q_SLOTS: // GIVEN Qt3DRender::Render::GeometryRenderer renderGeometryRenderer; Qt3DRender::QGeometryRenderer geometryRenderer; - Qt3DRender::QGeometry geometry; + Qt3DCore::QGeometry geometry; Qt3DRender::Render::GeometryRendererManager geometryRendererManager; TestRenderer renderer; @@ -115,7 +111,7 @@ private Q_SLOTS: // GIVEN Qt3DRender::QGeometryRenderer geometryRenderer; - Qt3DRender::QGeometry geometry; + Qt3DCore::QGeometry geometry; TestRenderer renderer; geometryRenderer.setInstanceCount(454); diff --git a/tests/auto/render/gltfplugins/tst_gltfplugins.cpp b/tests/auto/render/gltfplugins/tst_gltfplugins.cpp index 7f40fffcc..26dddf12f 100644 --- a/tests/auto/render/gltfplugins/tst_gltfplugins.cpp +++ b/tests/auto/render/gltfplugins/tst_gltfplugins.cpp @@ -56,8 +56,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -111,12 +111,12 @@ private: Qt3DCore::QComponent *comp2 = nullptr, Qt3DCore::QComponent *comp3 = nullptr, Qt3DCore::QEntity *parent = nullptr); - void addPositionAttributeToGeometry(Qt3DRender::QGeometry *geometry, - Qt3DRender::QBuffer *buffer, int count); - void addIndexAttributeToGeometry(Qt3DRender::QGeometry *geometry, - Qt3DRender::QBuffer *buffer, int count); - void addColorAttributeToGeometry(Qt3DRender::QGeometry *geometry, - Qt3DRender::QBuffer *buffer, int count); + void addPositionAttributeToGeometry(Qt3DCore::QGeometry *geometry, + Qt3DCore::QBuffer *buffer, int count); + void addIndexAttributeToGeometry(Qt3DCore::QGeometry *geometry, + Qt3DCore::QBuffer *buffer, int count); + void addColorAttributeToGeometry(Qt3DCore::QGeometry *geometry, + Qt3DCore::QBuffer *buffer, int count); Qt3DCore::QEntity *findChildEntity(Qt3DCore::QEntity *entity, const QString &name); Qt3DCore::QTransform *transformComponent(Qt3DCore::QEntity *entity); Qt3DRender::QAbstractLight *lightComponent(Qt3DCore::QEntity *entity); @@ -124,10 +124,10 @@ private: Qt3DRender::QGeometryRenderer *meshComponent(Qt3DCore::QEntity *entity); Qt3DRender::QMaterial *materialComponent(Qt3DCore::QEntity *entity); void compareComponents(Qt3DCore::QComponent *c1, Qt3DCore::QComponent *c2); - Qt3DRender::QAttribute *findAttribute(const QString &name, - Qt3DRender::QAttribute::AttributeType type, - Qt3DRender::QGeometry *geometry); - void compareAttributes(Qt3DRender::QAttribute *a1, Qt3DRender::QAttribute *a2); + Qt3DCore::QAttribute *findAttribute(const QString &name, + Qt3DCore::QAttribute::AttributeType type, + Qt3DCore::QGeometry *geometry); + void compareAttributes(Qt3DCore::QAttribute *a1, Qt3DCore::QAttribute *a2); void compareParameters(const QVector ¶ms1, const QVector ¶ms2); void compareRenderPasses(const QVector &passes1, @@ -515,8 +515,8 @@ void tst_gltfPlugins::createTestScene() transform->setRotation(Qt3DCore::QTransform::fromAxisAndAngle(1.0f, 1.0f, 1.0f, 270.0f)); Qt3DRender::QGeometryRenderer *boxMesh = createCustomCube(); - Qt3DRender::QBuffer *colorDataBuffer = - new Qt3DRender::QBuffer(boxMesh->geometry()); + Qt3DCore::QBuffer *colorDataBuffer = + new Qt3DCore::QBuffer(boxMesh->geometry()); QByteArray colorBufferData; colorBufferData.resize(8 * 4 * sizeof(float)); @@ -570,8 +570,8 @@ void tst_gltfPlugins::createTestScene() transform->setTranslation(QVector3D(0.0f, 2.0f, -40.0f)); transform->setRotation(Qt3DCore::QTransform::fromAxisAndAngle(1.0f, 2.0f, 3.0f, 90.0f)); Qt3DRender::QGeometryRenderer *boxMesh = createCustomCube(); - Qt3DRender::QBuffer *offsetBuffer = - new Qt3DRender::QBuffer(boxMesh->geometry()); + Qt3DCore::QBuffer *offsetBuffer = + new Qt3DCore::QBuffer(boxMesh->geometry()); QByteArray offsetBufferData; offsetBufferData.resize(8 * 3 * sizeof(float)); @@ -584,10 +584,10 @@ void tst_gltfPlugins::createTestScene() offsetBuffer->setData(offsetBufferData); - Qt3DRender::QAttribute *customAttribute = new Qt3DRender::QAttribute(); - customAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + Qt3DCore::QAttribute *customAttribute = new Qt3DCore::QAttribute(); + customAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); customAttribute->setBuffer(offsetBuffer); - customAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + customAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); customAttribute->setVertexSize(3); customAttribute->setByteOffset(0); customAttribute->setByteStride(0); @@ -614,29 +614,29 @@ void tst_gltfPlugins::createTestScene() #endif } -void tst_gltfPlugins::addPositionAttributeToGeometry(Qt3DRender::QGeometry *geometry, - Qt3DRender::QBuffer *buffer, int count) +void tst_gltfPlugins::addPositionAttributeToGeometry(Qt3DCore::QGeometry *geometry, + Qt3DCore::QBuffer *buffer, int count) { - Qt3DRender::QAttribute *posAttribute = new Qt3DRender::QAttribute(); - posAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + Qt3DCore::QAttribute *posAttribute = new Qt3DCore::QAttribute(); + posAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); posAttribute->setBuffer(buffer); - posAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + posAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); posAttribute->setVertexSize(3); posAttribute->setByteOffset(0); posAttribute->setByteStride(0); posAttribute->setCount(count); - posAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); + posAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); geometry->addAttribute(posAttribute); } -void tst_gltfPlugins::addIndexAttributeToGeometry(Qt3DRender::QGeometry *geometry, - Qt3DRender::QBuffer *buffer, int count) +void tst_gltfPlugins::addIndexAttributeToGeometry(Qt3DCore::QGeometry *geometry, + Qt3DCore::QBuffer *buffer, int count) { - Qt3DRender::QAttribute *indexAttribute = new Qt3DRender::QAttribute(); - indexAttribute->setAttributeType(Qt3DRender::QAttribute::IndexAttribute); + Qt3DCore::QAttribute *indexAttribute = new Qt3DCore::QAttribute(); + indexAttribute->setAttributeType(Qt3DCore::QAttribute::IndexAttribute); indexAttribute->setBuffer(buffer); - indexAttribute->setVertexBaseType(Qt3DRender::QAttribute::UnsignedShort); + indexAttribute->setVertexBaseType(Qt3DCore::QAttribute::UnsignedShort); indexAttribute->setVertexSize(1); indexAttribute->setByteOffset(0); indexAttribute->setByteStride(0); @@ -645,18 +645,18 @@ void tst_gltfPlugins::addIndexAttributeToGeometry(Qt3DRender::QGeometry *geometr geometry->addAttribute(indexAttribute); } -void tst_gltfPlugins::addColorAttributeToGeometry(Qt3DRender::QGeometry *geometry, - Qt3DRender::QBuffer *buffer, int count) +void tst_gltfPlugins::addColorAttributeToGeometry(Qt3DCore::QGeometry *geometry, + Qt3DCore::QBuffer *buffer, int count) { - Qt3DRender::QAttribute *colorAttribute = new Qt3DRender::QAttribute(); - colorAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + Qt3DCore::QAttribute *colorAttribute = new Qt3DCore::QAttribute(); + colorAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); colorAttribute->setBuffer(buffer); - colorAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + colorAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); colorAttribute->setVertexSize(4); colorAttribute->setByteOffset(0); colorAttribute->setByteStride(0); colorAttribute->setCount(count); - colorAttribute->setName(Qt3DRender::QAttribute::defaultColorAttributeName()); + colorAttribute->setName(Qt3DCore::QAttribute::defaultColorAttributeName()); geometry->addAttribute(colorAttribute); } @@ -736,46 +736,46 @@ void tst_gltfPlugins::compareComponents(Qt3DCore::QComponent *c1, Qt3DCore::QCom auto geometry2 = mesh2->geometry(); // Check that attributes match. compareAttributes( - findAttribute(Qt3DRender::QAttribute::defaultPositionAttributeName(), - Qt3DRender::QAttribute::VertexAttribute, + findAttribute(Qt3DCore::QAttribute::defaultPositionAttributeName(), + Qt3DCore::QAttribute::VertexAttribute, geometry1), - findAttribute(Qt3DRender::QAttribute::defaultPositionAttributeName(), - Qt3DRender::QAttribute::VertexAttribute, + findAttribute(Qt3DCore::QAttribute::defaultPositionAttributeName(), + Qt3DCore::QAttribute::VertexAttribute, geometry2)); compareAttributes( - findAttribute(Qt3DRender::QAttribute::defaultNormalAttributeName(), - Qt3DRender::QAttribute::VertexAttribute, + findAttribute(Qt3DCore::QAttribute::defaultNormalAttributeName(), + Qt3DCore::QAttribute::VertexAttribute, geometry1), - findAttribute(Qt3DRender::QAttribute::defaultNormalAttributeName(), - Qt3DRender::QAttribute::VertexAttribute, + findAttribute(Qt3DCore::QAttribute::defaultNormalAttributeName(), + Qt3DCore::QAttribute::VertexAttribute, geometry2)); compareAttributes( - findAttribute(Qt3DRender::QAttribute::defaultTangentAttributeName(), - Qt3DRender::QAttribute::VertexAttribute, + findAttribute(Qt3DCore::QAttribute::defaultTangentAttributeName(), + Qt3DCore::QAttribute::VertexAttribute, geometry1), - findAttribute(Qt3DRender::QAttribute::defaultTangentAttributeName(), - Qt3DRender::QAttribute::VertexAttribute, + findAttribute(Qt3DCore::QAttribute::defaultTangentAttributeName(), + Qt3DCore::QAttribute::VertexAttribute, geometry2)); compareAttributes( - findAttribute(Qt3DRender::QAttribute::defaultTextureCoordinateAttributeName(), - Qt3DRender::QAttribute::VertexAttribute, + findAttribute(Qt3DCore::QAttribute::defaultTextureCoordinateAttributeName(), + Qt3DCore::QAttribute::VertexAttribute, geometry1), - findAttribute(Qt3DRender::QAttribute::defaultTextureCoordinateAttributeName(), - Qt3DRender::QAttribute::VertexAttribute, + findAttribute(Qt3DCore::QAttribute::defaultTextureCoordinateAttributeName(), + Qt3DCore::QAttribute::VertexAttribute, geometry2)); compareAttributes( - findAttribute(Qt3DRender::QAttribute::defaultColorAttributeName(), - Qt3DRender::QAttribute::VertexAttribute, + findAttribute(Qt3DCore::QAttribute::defaultColorAttributeName(), + Qt3DCore::QAttribute::VertexAttribute, geometry1), - findAttribute(Qt3DRender::QAttribute::defaultColorAttributeName(), - Qt3DRender::QAttribute::VertexAttribute, + findAttribute(Qt3DCore::QAttribute::defaultColorAttributeName(), + Qt3DCore::QAttribute::VertexAttribute, geometry2)); compareAttributes( findAttribute(QStringLiteral(""), - Qt3DRender::QAttribute::IndexAttribute, + Qt3DCore::QAttribute::IndexAttribute, geometry1), findAttribute(QStringLiteral(""), - Qt3DRender::QAttribute::IndexAttribute, + Qt3DCore::QAttribute::IndexAttribute, geometry2)); } else { int count = c1->metaObject()->propertyCount(); @@ -840,12 +840,12 @@ void tst_gltfPlugins::compareComponents(Qt3DCore::QComponent *c1, Qt3DCore::QCom } } -Qt3DRender::QAttribute *tst_gltfPlugins::findAttribute(const QString &name, - Qt3DRender::QAttribute::AttributeType type, - Qt3DRender::QGeometry *geometry) +Qt3DCore::QAttribute *tst_gltfPlugins::findAttribute(const QString &name, + Qt3DCore::QAttribute::AttributeType type, + Qt3DCore::QGeometry *geometry) { for (auto att : geometry->attributes()) { - if ((type == Qt3DRender::QAttribute::IndexAttribute && type == att->attributeType()) + if ((type == Qt3DCore::QAttribute::IndexAttribute && type == att->attributeType()) || name == att->name()) { return att; } @@ -853,7 +853,7 @@ Qt3DRender::QAttribute *tst_gltfPlugins::findAttribute(const QString &name, return nullptr; } -void tst_gltfPlugins::compareAttributes(Qt3DRender::QAttribute *a1, Qt3DRender::QAttribute *a2) +void tst_gltfPlugins::compareAttributes(Qt3DCore::QAttribute *a1, Qt3DCore::QAttribute *a2) { QCOMPARE(a1 == nullptr, a2 == nullptr); if (a1) { @@ -962,11 +962,11 @@ QUrl tst_gltfPlugins::getTextureUrl(Qt3DRender::QAbstractTexture *tex) Qt3DRender::QGeometryRenderer *tst_gltfPlugins::createCustomCube() { Qt3DRender::QGeometryRenderer *boxMesh = new Qt3DRender::QGeometryRenderer; - Qt3DRender::QGeometry *boxGeometry = new Qt3DRender::QGeometry(boxMesh); - Qt3DRender::QBuffer *boxDataBuffer = - new Qt3DRender::QBuffer(boxGeometry); - Qt3DRender::QBuffer *indexDataBuffer = - new Qt3DRender::QBuffer(boxGeometry); + Qt3DCore::QGeometry *boxGeometry = new Qt3DCore::QGeometry(boxMesh); + Qt3DCore::QBuffer *boxDataBuffer = + new Qt3DCore::QBuffer(boxGeometry); + Qt3DCore::QBuffer *indexDataBuffer = + new Qt3DCore::QBuffer(boxGeometry); QByteArray vertexBufferData; QByteArray indexBufferData; diff --git a/tests/auto/render/meshfunctors/tst_meshfunctors.cpp b/tests/auto/render/meshfunctors/tst_meshfunctors.cpp index e8dfaa2cb..96341ce23 100644 --- a/tests/auto/render/meshfunctors/tst_meshfunctors.cpp +++ b/tests/auto/render/meshfunctors/tst_meshfunctors.cpp @@ -26,19 +26,14 @@ ** ****************************************************************************/ -// TODO Remove in Qt6 -#include -QT_WARNING_DISABLE_DEPRECATED - #include #include -#include -#include +#include #include #include #include -class MeshFunctorA : public Qt3DRender::QGeometryFactory +class MeshFunctorA : public Qt3DCore::QGeometryFactory { public: MeshFunctorA() @@ -47,20 +42,20 @@ public: ~MeshFunctorA() {} - Qt3DRender::QGeometry *operator ()() override + Qt3DCore::QGeometry *operator ()() override { return nullptr; } - bool operator ==(const Qt3DRender::QGeometryFactory &other) const override + bool operator ==(const Qt3DCore::QGeometryFactory &other) const override { - return Qt3DRender::functor_cast(&other); + return Qt3DCore::functor_cast(&other); } QT3D_FUNCTOR(MeshFunctorA) }; -class MeshFunctorB : public Qt3DRender::QGeometryFactory +class MeshFunctorB : public Qt3DCore::QGeometryFactory { public: MeshFunctorB() @@ -69,14 +64,14 @@ public: ~MeshFunctorB() {} - Qt3DRender::QGeometry *operator ()() override + Qt3DCore::QGeometry *operator ()() override { return nullptr; } - bool operator ==(const Qt3DRender::QGeometryFactory &other) const override + bool operator ==(const Qt3DCore::QGeometryFactory &other) const override { - return Qt3DRender::functor_cast(&other); + return Qt3DCore::functor_cast(&other); } QT3D_FUNCTOR(MeshFunctorB) @@ -91,9 +86,9 @@ public: ~MeshFunctorASub() {} - bool operator ==(const Qt3DRender::QGeometryFactory &other) const override + bool operator ==(const Qt3DCore::QGeometryFactory &other) const override { - return Qt3DRender::functor_cast(&other); + return Qt3DCore::functor_cast(&other); } QT3D_FUNCTOR(MeshFunctorASub) @@ -190,7 +185,7 @@ private Q_SLOTS: Qt3DRender::MeshLoaderFunctor functor(&mesh); // WHEN - const Qt3DRender::QGeometry *g = functor(); + const Qt3DCore::QGeometry *g = functor(); // THEN QVERIFY(g == nullptr); @@ -204,7 +199,7 @@ private Q_SLOTS: Qt3DRender::MeshLoaderFunctor functor(&mesh); // WHEN - const Qt3DRender::QGeometry *g = functor(); + const Qt3DCore::QGeometry *g = functor(); // THEN QVERIFY(g == nullptr); @@ -218,7 +213,7 @@ private Q_SLOTS: Qt3DRender::MeshLoaderFunctor functor(&mesh); // WHEN - const Qt3DRender::QGeometry *g = functor(); + const Qt3DCore::QGeometry *g = functor(); // THEN QVERIFY(g == nullptr); diff --git a/tests/auto/render/opengl/textures/tst_textures.cpp b/tests/auto/render/opengl/textures/tst_textures.cpp index 5fb00f23d..c9504cbbf 100644 --- a/tests/auto/render/opengl/textures/tst_textures.cpp +++ b/tests/auto/render/opengl/textures/tst_textures.cpp @@ -62,7 +62,7 @@ public: } bool operator ==(const Qt3DRender::QTextureImageDataGenerator &other) const override { - const TestImageDataGenerator *otherFunctor = Qt3DRender::functor_cast(&other); + const TestImageDataGenerator *otherFunctor = Qt3DCore::functor_cast(&other); return (otherFunctor != nullptr && otherFunctor->m_id == m_id); } @@ -83,7 +83,7 @@ public: } bool operator ==(const Qt3DRender::QTextureGenerator &other) const override { - const TestTextureGenerator *otherFunctor = Qt3DRender::functor_cast(&other); + const TestTextureGenerator *otherFunctor = Qt3DCore::functor_cast(&other); return (otherFunctor != nullptr && otherFunctor->m_id == m_id); } diff --git a/tests/auto/render/picking/tst_picking.cpp b/tests/auto/render/picking/tst_picking.cpp index acc9664bf..b38aa3695 100644 --- a/tests/auto/render/picking/tst_picking.cpp +++ b/tests/auto/render/picking/tst_picking.cpp @@ -36,8 +36,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -72,7 +72,7 @@ public: mesh->setRadius(radius); QSphereGeometry *g = static_cast(mesh->geometry()); QAttribute *positionAttr = static_cast(g->attributes().first()); - Qt3DRender::QBuffer *vertexBuffer = static_cast(positionAttr->buffer()); + Qt3DCore::QBuffer *vertexBuffer = static_cast(positionAttr->buffer()); transform->setTranslation(position); diff --git a/tests/auto/render/proximityfiltering/tst_proximityfiltering.cpp b/tests/auto/render/proximityfiltering/tst_proximityfiltering.cpp index 51b59bffc..ee0be6647 100644 --- a/tests/auto/render/proximityfiltering/tst_proximityfiltering.cpp +++ b/tests/auto/render/proximityfiltering/tst_proximityfiltering.cpp @@ -29,10 +29,10 @@ #include #include #include -#include +#include #include -#include -#include +#include +#include #include #include #include @@ -53,13 +53,13 @@ Qt3DCore::QEntity *buildEntityAtDistance(float distance, Qt3DCore::QEntity *pare Qt3DCore::QEntity *entity = new Qt3DCore::QEntity(parent); // create geometry with a valid bounding volume - a single point is sufficient - auto geometry = new Qt3DRender::QGeometry; - auto vertexBuffer = new Qt3DRender::QBuffer(geometry); + auto geometry = new Qt3DCore::QGeometry; + auto vertexBuffer = new Qt3DCore::QBuffer(geometry); - auto positionAttribute = new Qt3DRender::QAttribute; - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + auto positionAttribute = new Qt3DCore::QAttribute; + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setByteStride(3 * sizeof(float)); positionAttribute->setBuffer(vertexBuffer); diff --git a/tests/auto/render/qattribute/tst_qattribute.cpp b/tests/auto/render/qattribute/tst_qattribute.cpp index 44793ce9f..8cc3f1b8c 100644 --- a/tests/auto/render/qattribute/tst_qattribute.cpp +++ b/tests/auto/render/qattribute/tst_qattribute.cpp @@ -30,9 +30,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "testarbiter.h" @@ -42,49 +42,49 @@ class tst_QAttribute: public QObject public: tst_QAttribute() { - qRegisterMetaType("Qt3DCore::QBuffer*"); + qRegisterMetaType("Qt3DCore::QBuffer*"); } private Q_SLOTS: void shouldHaveDefaultAttributeNames() { // GIVEN - Qt3DRender::QAttribute attribute; + Qt3DCore::QAttribute attribute; // THEN - QCOMPARE(Qt3DRender::QAttribute::defaultPositionAttributeName(), QStringLiteral("vertexPosition")); - QCOMPARE(Qt3DRender::QAttribute::defaultNormalAttributeName(), QStringLiteral("vertexNormal")); - QCOMPARE(Qt3DRender::QAttribute::defaultColorAttributeName(), QStringLiteral("vertexColor")); - QCOMPARE(Qt3DRender::QAttribute::defaultTextureCoordinateAttributeName(), QStringLiteral("vertexTexCoord")); - QCOMPARE(Qt3DRender::QAttribute::defaultTangentAttributeName(), QStringLiteral("vertexTangent")); - QCOMPARE(Qt3DRender::QAttribute::defaultJointIndicesAttributeName(), QStringLiteral("vertexJointIndices")); - QCOMPARE(Qt3DRender::QAttribute::defaultJointWeightsAttributeName(), QStringLiteral("vertexJointWeights")); + QCOMPARE(Qt3DCore::QAttribute::defaultPositionAttributeName(), QStringLiteral("vertexPosition")); + QCOMPARE(Qt3DCore::QAttribute::defaultNormalAttributeName(), QStringLiteral("vertexNormal")); + QCOMPARE(Qt3DCore::QAttribute::defaultColorAttributeName(), QStringLiteral("vertexColor")); + QCOMPARE(Qt3DCore::QAttribute::defaultTextureCoordinateAttributeName(), QStringLiteral("vertexTexCoord")); + QCOMPARE(Qt3DCore::QAttribute::defaultTangentAttributeName(), QStringLiteral("vertexTangent")); + QCOMPARE(Qt3DCore::QAttribute::defaultJointIndicesAttributeName(), QStringLiteral("vertexJointIndices")); + QCOMPARE(Qt3DCore::QAttribute::defaultJointWeightsAttributeName(), QStringLiteral("vertexJointWeights")); QCOMPARE(attribute.property("defaultPositionAttributeName").toString(), - Qt3DRender::QAttribute::defaultPositionAttributeName()); + Qt3DCore::QAttribute::defaultPositionAttributeName()); QCOMPARE(attribute.property("defaultNormalAttributeName").toString(), - Qt3DRender::QAttribute::defaultNormalAttributeName()); + Qt3DCore::QAttribute::defaultNormalAttributeName()); QCOMPARE(attribute.property("defaultColorAttributeName").toString(), - Qt3DRender::QAttribute::defaultColorAttributeName()); + Qt3DCore::QAttribute::defaultColorAttributeName()); QCOMPARE(attribute.property("defaultTextureCoordinateAttributeName").toString(), - Qt3DRender::QAttribute::defaultTextureCoordinateAttributeName()); + Qt3DCore::QAttribute::defaultTextureCoordinateAttributeName()); QCOMPARE(attribute.property("defaultTangentAttributeName").toString(), - Qt3DRender::QAttribute::defaultTangentAttributeName()); + Qt3DCore::QAttribute::defaultTangentAttributeName()); QCOMPARE(attribute.property("defaultJointIndicesAttributeName").toString(), - Qt3DRender::QAttribute::defaultJointIndicesAttributeName()); + Qt3DCore::QAttribute::defaultJointIndicesAttributeName()); QCOMPARE(attribute.property("defaultJointWeightsAttributeName").toString(), - Qt3DRender::QAttribute::defaultJointWeightsAttributeName()); + Qt3DCore::QAttribute::defaultJointWeightsAttributeName()); } void checkPropertyUpdates() { // GIVEN TestArbiter arbiter; - QScopedPointer attribute(new Qt3DRender::QAttribute()); + QScopedPointer attribute(new Qt3DCore::QAttribute()); arbiter.setArbiterOnNode(attribute.data()); // WHEN - attribute->setVertexBaseType(Qt3DRender::QAttribute::Double); + attribute->setVertexBaseType(Qt3DCore::QAttribute::Double); // THEN QCOMPARE(arbiter.dirtyNodes().size(), 1); @@ -147,7 +147,7 @@ private Q_SLOTS: arbiter.clear(); // WHEN - attribute->setAttributeType(Qt3DRender::QAttribute::IndexAttribute); + attribute->setAttributeType(Qt3DCore::QAttribute::IndexAttribute); // THEN QCOMPARE(arbiter.dirtyNodes().size(), 1); @@ -156,7 +156,7 @@ private Q_SLOTS: arbiter.clear(); // WHEN - Qt3DRender::QBuffer buf; + Qt3DCore::QBuffer buf; attribute->setBuffer(&buf); // THEN @@ -166,7 +166,7 @@ private Q_SLOTS: arbiter.clear(); // WHEN - Qt3DRender::QBuffer buf2; + Qt3DCore::QBuffer buf2; attribute->setBuffer(&buf2); // THEN @@ -179,10 +179,10 @@ private Q_SLOTS: void checkBufferBookkeeping() { // GIVEN - QScopedPointer attribute(new Qt3DRender::QAttribute); + QScopedPointer attribute(new Qt3DCore::QAttribute); { // WHEN - Qt3DRender::QBuffer buf; + Qt3DCore::QBuffer buf; attribute->setBuffer(&buf); // THEN @@ -194,8 +194,8 @@ private Q_SLOTS: { // WHEN - Qt3DRender::QAttribute someOtherAttribute; - QScopedPointer buf(new Qt3DRender::QBuffer(&someOtherAttribute)); + Qt3DCore::QAttribute someOtherAttribute; + QScopedPointer buf(new Qt3DCore::QBuffer(&someOtherAttribute)); attribute->setBuffer(buf.data()); // THEN diff --git a/tests/auto/render/qbuffer/tst_qbuffer.cpp b/tests/auto/render/qbuffer/tst_qbuffer.cpp index 34cfe4941..d5c5f1b3a 100644 --- a/tests/auto/render/qbuffer/tst_qbuffer.cpp +++ b/tests/auto/render/qbuffer/tst_qbuffer.cpp @@ -26,16 +26,12 @@ ** ****************************************************************************/ -// TODO Remove in Qt6 -#include -QT_WARNING_DISABLE_DEPRECATED - #include #include #include -#include -#include +#include +#include #include "testarbiter.h" @@ -49,11 +45,11 @@ private Q_SLOTS: { // GIVEN TestArbiter arbiter; - QScopedPointer buffer(new Qt3DRender::QBuffer); + QScopedPointer buffer(new Qt3DCore::QBuffer); arbiter.setArbiterOnNode(buffer.data()); // WHEN - buffer->setUsage(Qt3DRender::QBuffer::DynamicCopy); + buffer->setUsage(Qt3DCore::QBuffer::DynamicCopy); // THEN QCOMPARE(arbiter.dirtyNodes().size(), 1); diff --git a/tests/auto/render/qgeometry/tst_qgeometry.cpp b/tests/auto/render/qgeometry/tst_qgeometry.cpp index 30092b204..59684567b 100644 --- a/tests/auto/render/qgeometry/tst_qgeometry.cpp +++ b/tests/auto/render/qgeometry/tst_qgeometry.cpp @@ -30,16 +30,16 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include "testarbiter.h" -class FakeGeometry : public Qt3DRender::QGeometry +class FakeGeometry : public Qt3DCore::QGeometry { Q_OBJECT }; @@ -54,11 +54,11 @@ private Q_SLOTS: { // GIVEN TestArbiter arbiter; - QScopedPointer geometry(new Qt3DRender::QGeometry()); + QScopedPointer geometry(new Qt3DCore::QGeometry()); arbiter.setArbiterOnNode(geometry.data()); // WHEN - Qt3DRender::QAttribute attr; + Qt3DCore::QAttribute attr; geometry->addAttribute(&attr); QCoreApplication::processEvents(); @@ -87,10 +87,10 @@ private Q_SLOTS: void checkAttributeBookkeeping() { // GIVEN - QScopedPointer geometry(new Qt3DRender::QGeometry); + QScopedPointer geometry(new Qt3DCore::QGeometry); { // WHEN - Qt3DRender::QAttribute attribute; + Qt3DCore::QAttribute attribute; geometry->addAttribute(&attribute); // THEN @@ -102,8 +102,8 @@ private Q_SLOTS: { // WHEN - Qt3DRender::QGeometry someOtherGeometry; - QScopedPointer attribute(new Qt3DRender::QAttribute(&someOtherGeometry)); + Qt3DCore::QGeometry someOtherGeometry; + QScopedPointer attribute(new Qt3DCore::QAttribute(&someOtherGeometry)); geometry->addAttribute(attribute.data()); // THEN @@ -134,7 +134,7 @@ private Q_SLOTS: QCOMPARE(geometry->maxExtent(), QVector3D()); // WHEN - auto dNode = static_cast(Qt3DCore::QNodePrivate::get(geometry.data())); + auto dNode = static_cast(Qt3DCore::QNodePrivate::get(geometry.data())); const QVector3D minExt(-1.0f, -1.0f, -1.0f); const QVector3D maxExt(1.0f, 1.0f, 1.0f); dNode->setExtent(minExt, maxExt); diff --git a/tests/auto/render/qgeometryrenderer/tst_qgeometryrenderer.cpp b/tests/auto/render/qgeometryrenderer/tst_qgeometryrenderer.cpp index 76f913af7..f3560e353 100644 --- a/tests/auto/render/qgeometryrenderer/tst_qgeometryrenderer.cpp +++ b/tests/auto/render/qgeometryrenderer/tst_qgeometryrenderer.cpp @@ -26,18 +26,14 @@ ** ****************************************************************************/ -// TODO Remove in Qt6 -#include -QT_WARNING_DISABLE_DEPRECATED - #include #include #include #include -#include -#include -#include +#include +#include +#include #include #include "testarbiter.h" @@ -146,7 +142,7 @@ private Q_SLOTS: arbiter.clear(); // WHEN - Qt3DRender::QGeometry geom; + Qt3DCore::QGeometry geom; geometryRenderer->setGeometry(&geom); QCoreApplication::processEvents(); @@ -157,7 +153,7 @@ private Q_SLOTS: arbiter.clear(); // WHEN - Qt3DRender::QGeometry geom2; + Qt3DCore::QGeometry geom2; geometryRenderer->setGeometry(&geom2); QCoreApplication::processEvents(); @@ -174,7 +170,7 @@ private Q_SLOTS: QScopedPointer geometryRenderer(new Qt3DRender::QGeometryRenderer); { // WHEN - Qt3DRender::QGeometry geometry; + Qt3DCore::QGeometry geometry; geometryRenderer->setGeometry(&geometry); // THEN @@ -187,7 +183,7 @@ private Q_SLOTS: { // WHEN Qt3DRender::QGeometryRenderer someOtherGeometryRenderer; - QScopedPointer geometry(new Qt3DRender::QGeometry(&someOtherGeometryRenderer)); + QScopedPointer geometry(new Qt3DCore::QGeometry(&someOtherGeometryRenderer)); geometryRenderer->setGeometry(geometry.data()); // THEN diff --git a/tests/auto/render/scene2d/tst_scene2d.cpp b/tests/auto/render/scene2d/tst_scene2d.cpp index 4b4ba03f0..bf9e70879 100644 --- a/tests/auto/render/scene2d/tst_scene2d.cpp +++ b/tests/auto/render/scene2d/tst_scene2d.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include @@ -211,11 +211,11 @@ private Q_SLOTS: TestRenderer renderer; QScopedPointer scene2d(new Scene2D()); QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); Qt3DRender::QGeometryRenderer *geometryRenderer = new Qt3DRender::QGeometryRenderer(); - Qt3DRender::QAttribute *positionAttribute = new Qt3DRender::QAttribute(); - Qt3DRender::QAttribute *texcoordAttribute = new Qt3DRender::QAttribute(); - Qt3DRender::QBuffer *dataBuffer =new Qt3DRender::QBuffer(); + Qt3DCore::QAttribute *positionAttribute = new Qt3DCore::QAttribute(); + Qt3DCore::QAttribute *texcoordAttribute = new Qt3DCore::QAttribute(); + Qt3DCore::QBuffer *dataBuffer =new Qt3DCore::QBuffer(); QScopedPointer entity(new Qt3DCore::QEntity()); entity->addComponent(geometryRenderer); renderer.setNodeManagers(nodeManagers.data()); @@ -272,23 +272,23 @@ private Q_SLOTS: simulateInitializationSync(dataBuffer, backendBuffer); positionAttribute->setBuffer(dataBuffer); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(6); positionAttribute->setByteStride(sizeof(float) * 5); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); geometry->addAttribute(positionAttribute); texcoordAttribute->setBuffer(dataBuffer); - texcoordAttribute->setName(Qt3DRender::QAttribute::defaultTextureCoordinateAttributeName()); - texcoordAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + texcoordAttribute->setName(Qt3DCore::QAttribute::defaultTextureCoordinateAttributeName()); + texcoordAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); texcoordAttribute->setVertexSize(2); texcoordAttribute->setCount(6); texcoordAttribute->setByteStride(sizeof(float) * 5); texcoordAttribute->setByteOffset(sizeof(float) * 3); - texcoordAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + texcoordAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); geometry->addAttribute(texcoordAttribute); geometryRenderer->setGeometry(geometry); diff --git a/tests/auto/render/segmentvisitor/tst_segmentvisitor.cpp b/tests/auto/render/segmentvisitor/tst_segmentvisitor.cpp index fc65d0854..7283f7a0a 100644 --- a/tests/auto/render/segmentvisitor/tst_segmentvisitor.cpp +++ b/tests/auto/render/segmentvisitor/tst_segmentvisitor.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include @@ -150,10 +150,10 @@ private Q_SLOTS: void testVisitSegments() { QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer(new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); TestVisitor visitor(nodeManagers.data()); TestRenderer renderer; @@ -188,13 +188,13 @@ private Q_SLOTS: simulateInitializationSync(dataBuffer.data(), backendBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(6); positionAttribute->setByteStride(3*4); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); geometry->addAttribute(positionAttribute.data()); geometryRenderer->setGeometry(geometry); @@ -226,12 +226,12 @@ private Q_SLOTS: void testVisitSegmentsIndexed() { QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer(new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer indexAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); - QScopedPointer indexDataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer indexAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); + QScopedPointer indexDataBuffer(new Qt3DCore::QBuffer()); TestVisitor visitor(nodeManagers.data()); TestRenderer renderer; @@ -277,18 +277,18 @@ private Q_SLOTS: simulateInitializationSync(indexDataBuffer.data(), backendIndexBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(4); positionAttribute->setByteStride(3*sizeof(float)); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); indexAttribute->setBuffer(indexDataBuffer.data()); - indexAttribute->setVertexBaseType(Qt3DRender::QAttribute::UnsignedInt); + indexAttribute->setVertexBaseType(Qt3DCore::QAttribute::UnsignedInt); indexAttribute->setCount(2*5); - indexAttribute->setAttributeType(Qt3DRender::QAttribute::IndexAttribute); + indexAttribute->setAttributeType(Qt3DCore::QAttribute::IndexAttribute); geometry->addAttribute(positionAttribute.data()); geometry->addAttribute(indexAttribute.data()); @@ -328,10 +328,10 @@ private Q_SLOTS: void testVisitLineStrip() { QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer(new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); TestVisitor visitor(nodeManagers.data()); TestRenderer renderer; @@ -357,13 +357,13 @@ private Q_SLOTS: simulateInitializationSync(dataBuffer.data(), backendBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(4); positionAttribute->setByteStride(3*4); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); geometry->addAttribute(positionAttribute.data()); geometryRenderer->setGeometry(geometry); @@ -395,12 +395,12 @@ private Q_SLOTS: void testVisitListStripIndexed() { QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer(new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer indexAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); - QScopedPointer indexDataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer indexAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); + QScopedPointer indexDataBuffer(new Qt3DCore::QBuffer()); TestVisitor visitor(nodeManagers.data()); TestRenderer renderer; @@ -443,18 +443,18 @@ private Q_SLOTS: simulateInitializationSync(indexDataBuffer.data(), backendIndexBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(4); positionAttribute->setByteStride(3*sizeof(float)); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); indexAttribute->setBuffer(indexDataBuffer.data()); - indexAttribute->setVertexBaseType(Qt3DRender::QAttribute::UnsignedInt); + indexAttribute->setVertexBaseType(Qt3DCore::QAttribute::UnsignedInt); indexAttribute->setCount(7); - indexAttribute->setAttributeType(Qt3DRender::QAttribute::IndexAttribute); + indexAttribute->setAttributeType(Qt3DCore::QAttribute::IndexAttribute); geometry->addAttribute(positionAttribute.data()); geometry->addAttribute(indexAttribute.data()); @@ -495,10 +495,10 @@ private Q_SLOTS: void testVisitLineLoop() { QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer(new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); TestVisitor visitor(nodeManagers.data()); TestRenderer renderer; @@ -524,13 +524,13 @@ private Q_SLOTS: simulateInitializationSync(dataBuffer.data(), backendBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(4); positionAttribute->setByteStride(3*4); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); geometry->addAttribute(positionAttribute.data()); geometryRenderer->setGeometry(geometry); @@ -563,12 +563,12 @@ private Q_SLOTS: void testVisitLineLoopIndexed() { QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer(new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer indexAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); - QScopedPointer indexDataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer indexAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); + QScopedPointer indexDataBuffer(new Qt3DCore::QBuffer()); TestVisitor visitor(nodeManagers.data()); TestRenderer renderer; @@ -612,18 +612,18 @@ private Q_SLOTS: simulateInitializationSync(indexDataBuffer.data(), backendIndexBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(4); positionAttribute->setByteStride(3*sizeof(float)); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); indexAttribute->setBuffer(indexDataBuffer.data()); - indexAttribute->setVertexBaseType(Qt3DRender::QAttribute::UnsignedInt); + indexAttribute->setVertexBaseType(Qt3DCore::QAttribute::UnsignedInt); indexAttribute->setCount(8); - indexAttribute->setAttributeType(Qt3DRender::QAttribute::IndexAttribute); + indexAttribute->setAttributeType(Qt3DCore::QAttribute::IndexAttribute); geometry->addAttribute(positionAttribute.data()); geometry->addAttribute(indexAttribute.data()); @@ -667,10 +667,10 @@ private Q_SLOTS: void testVisitLineAdjacency() { QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer(new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); TestVisitor visitor(nodeManagers.data()); TestRenderer renderer; @@ -697,13 +697,13 @@ private Q_SLOTS: simulateInitializationSync(dataBuffer.data(), backendBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(4); positionAttribute->setByteStride(3*4); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); geometry->addAttribute(positionAttribute.data()); geometryRenderer->setGeometry(geometry); @@ -733,12 +733,12 @@ private Q_SLOTS: void testVisitLinesAdjacencyIndexed() { QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer(new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer indexAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); - QScopedPointer indexDataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer indexAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); + QScopedPointer indexDataBuffer(new Qt3DCore::QBuffer()); TestVisitor visitor(nodeManagers.data()); TestRenderer renderer; @@ -779,18 +779,18 @@ private Q_SLOTS: simulateInitializationSync(indexDataBuffer.data(), backendIndexBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(4); positionAttribute->setByteStride(3*sizeof(float)); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); indexAttribute->setBuffer(indexDataBuffer.data()); - indexAttribute->setVertexBaseType(Qt3DRender::QAttribute::UnsignedInt); + indexAttribute->setVertexBaseType(Qt3DCore::QAttribute::UnsignedInt); indexAttribute->setCount(4); - indexAttribute->setAttributeType(Qt3DRender::QAttribute::IndexAttribute); + indexAttribute->setAttributeType(Qt3DCore::QAttribute::IndexAttribute); geometry->addAttribute(positionAttribute.data()); geometry->addAttribute(indexAttribute.data()); diff --git a/tests/auto/render/trianglevisitor/tst_trianglevisitor.cpp b/tests/auto/render/trianglevisitor/tst_trianglevisitor.cpp index 66f67e08a..058df8887 100644 --- a/tests/auto/render/trianglevisitor/tst_trianglevisitor.cpp +++ b/tests/auto/render/trianglevisitor/tst_trianglevisitor.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include @@ -154,10 +154,10 @@ private Q_SLOTS: void testVisitTriangles() { QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer(new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); TestVisitor visitor(nodeManagers.data()); TestRenderer renderer; @@ -190,13 +190,13 @@ private Q_SLOTS: simulateInitializationSync(dataBuffer.data(), backendBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(6); positionAttribute->setByteStride(0); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); geometry->addAttribute(positionAttribute.data()); geometryRenderer->setGeometry(geometry); @@ -227,12 +227,12 @@ private Q_SLOTS: void testVisitTrianglesIndexed() { QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer(new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer indexAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); - QScopedPointer indexDataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer indexAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); + QScopedPointer indexDataBuffer(new Qt3DCore::QBuffer()); TestVisitor visitor(nodeManagers.data()); TestRenderer renderer; @@ -290,18 +290,18 @@ private Q_SLOTS: simulateInitializationSync(indexDataBuffer.data(), backendIndexBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(6); positionAttribute->setByteStride(3*sizeof(float)); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); indexAttribute->setBuffer(indexDataBuffer.data()); - indexAttribute->setVertexBaseType(Qt3DRender::QAttribute::UnsignedInt); + indexAttribute->setVertexBaseType(Qt3DCore::QAttribute::UnsignedInt); indexAttribute->setCount(3*5); - indexAttribute->setAttributeType(Qt3DRender::QAttribute::IndexAttribute); + indexAttribute->setAttributeType(Qt3DCore::QAttribute::IndexAttribute); geometry->addAttribute(positionAttribute.data()); geometry->addAttribute(indexAttribute.data()); @@ -341,10 +341,10 @@ private Q_SLOTS: void testVisitTriangleStrip() { QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer(new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); TestVisitor visitor(nodeManagers.data()); TestRenderer renderer; @@ -377,13 +377,13 @@ private Q_SLOTS: simulateInitializationSync(dataBuffer.data(), backendBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(6); positionAttribute->setByteStride(3*4); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); geometry->addAttribute(positionAttribute.data()); geometryRenderer->setGeometry(geometry); @@ -416,12 +416,12 @@ private Q_SLOTS: void testVisitTriangleStripIndexed() { QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer(new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer indexAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); - QScopedPointer indexDataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer indexAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); + QScopedPointer indexDataBuffer(new Qt3DCore::QBuffer()); TestVisitor visitor(nodeManagers.data()); TestRenderer renderer; @@ -480,18 +480,18 @@ private Q_SLOTS: simulateInitializationSync(indexDataBuffer.data(), backendIndexBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(6); positionAttribute->setByteStride(3*sizeof(float)); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); indexAttribute->setBuffer(indexDataBuffer.data()); - indexAttribute->setVertexBaseType(Qt3DRender::QAttribute::UnsignedInt); + indexAttribute->setVertexBaseType(Qt3DCore::QAttribute::UnsignedInt); indexAttribute->setCount(4*4); - indexAttribute->setAttributeType(Qt3DRender::QAttribute::IndexAttribute); + indexAttribute->setAttributeType(Qt3DCore::QAttribute::IndexAttribute); geometry->addAttribute(positionAttribute.data()); geometry->addAttribute(indexAttribute.data()); @@ -537,10 +537,10 @@ private Q_SLOTS: void testVisitTriangleFan() { QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer(new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); TestVisitor visitor(nodeManagers.data()); TestRenderer renderer; @@ -573,13 +573,13 @@ private Q_SLOTS: simulateInitializationSync(dataBuffer.data(), backendBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(6); positionAttribute->setByteStride(3*4); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); geometry->addAttribute(positionAttribute.data()); geometryRenderer->setGeometry(geometry); @@ -612,12 +612,12 @@ private Q_SLOTS: void testVisitTriangleFanIndexed() { QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer(new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer indexAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); - QScopedPointer indexDataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer indexAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); + QScopedPointer indexDataBuffer(new Qt3DCore::QBuffer()); TestVisitor visitor(nodeManagers.data()); TestRenderer renderer; @@ -670,18 +670,18 @@ private Q_SLOTS: simulateInitializationSync(indexDataBuffer.data(), backendIndexBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(6); positionAttribute->setByteStride(3*sizeof(float)); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); indexAttribute->setBuffer(indexDataBuffer.data()); - indexAttribute->setVertexBaseType(Qt3DRender::QAttribute::UnsignedInt); + indexAttribute->setVertexBaseType(Qt3DCore::QAttribute::UnsignedInt); indexAttribute->setCount(10); - indexAttribute->setAttributeType(Qt3DRender::QAttribute::IndexAttribute); + indexAttribute->setAttributeType(Qt3DCore::QAttribute::IndexAttribute); geometry->addAttribute(positionAttribute.data()); geometry->addAttribute(indexAttribute.data()); @@ -723,10 +723,10 @@ private Q_SLOTS: void testVisitTrianglesAdjacency() { QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer(new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); TestVisitor visitor(nodeManagers.data()); TestRenderer renderer; @@ -759,13 +759,13 @@ private Q_SLOTS: simulateInitializationSync(dataBuffer.data(), backendBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(6); positionAttribute->setByteStride(3*4); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); geometry->addAttribute(positionAttribute.data()); geometryRenderer->setGeometry(geometry); @@ -795,12 +795,12 @@ private Q_SLOTS: void testVisitTrianglesAdjacencyIndexed() { QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer(new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer indexAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); - QScopedPointer indexDataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer indexAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); + QScopedPointer indexDataBuffer(new Qt3DCore::QBuffer()); TestVisitor visitor(nodeManagers.data()); TestRenderer renderer; @@ -856,18 +856,18 @@ private Q_SLOTS: simulateInitializationSync(indexDataBuffer.data(), backendIndexBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(6); positionAttribute->setByteStride(3*sizeof(float)); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); indexAttribute->setBuffer(indexDataBuffer.data()); - indexAttribute->setVertexBaseType(Qt3DRender::QAttribute::UnsignedInt); + indexAttribute->setVertexBaseType(Qt3DCore::QAttribute::UnsignedInt); indexAttribute->setCount(3*4); - indexAttribute->setAttributeType(Qt3DRender::QAttribute::IndexAttribute); + indexAttribute->setAttributeType(Qt3DCore::QAttribute::IndexAttribute); geometry->addAttribute(positionAttribute.data()); geometry->addAttribute(indexAttribute.data()); @@ -905,10 +905,10 @@ private Q_SLOTS: { QSKIP("TriangleStripAdjacency not implemented"); QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer(new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); TestVisitor visitor(nodeManagers.data()); TestRenderer renderer; @@ -953,13 +953,13 @@ private Q_SLOTS: simulateInitializationSync(dataBuffer.data(), backendBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(8); positionAttribute->setByteStride(3*4); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); geometry->addAttribute(positionAttribute.data()); geometryRenderer->setGeometry(geometry); @@ -991,12 +991,12 @@ private Q_SLOTS: { QSKIP("TriangleStripAdjacency not implemented"); QScopedPointer nodeManagers(new NodeManagers()); - Qt3DRender::QGeometry *geometry = new Qt3DRender::QGeometry(); + Qt3DCore::QGeometry *geometry = new Qt3DCore::QGeometry(); QScopedPointer geometryRenderer(new Qt3DRender::QGeometryRenderer()); - QScopedPointer positionAttribute(new Qt3DRender::QAttribute()); - QScopedPointer indexAttribute(new Qt3DRender::QAttribute()); - QScopedPointer dataBuffer(new Qt3DRender::QBuffer()); - QScopedPointer indexDataBuffer(new Qt3DRender::QBuffer()); + QScopedPointer positionAttribute(new Qt3DCore::QAttribute()); + QScopedPointer indexAttribute(new Qt3DCore::QAttribute()); + QScopedPointer dataBuffer(new Qt3DCore::QBuffer()); + QScopedPointer indexDataBuffer(new Qt3DCore::QBuffer()); TestVisitor visitor(nodeManagers.data()); TestRenderer renderer; @@ -1047,18 +1047,18 @@ private Q_SLOTS: simulateInitializationSync(indexDataBuffer.data(), backendIndexBuffer); positionAttribute->setBuffer(dataBuffer.data()); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setCount(6); positionAttribute->setByteStride(3*sizeof(float)); positionAttribute->setByteOffset(0); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); indexAttribute->setBuffer(indexDataBuffer.data()); - indexAttribute->setVertexBaseType(Qt3DRender::QAttribute::UnsignedInt); + indexAttribute->setVertexBaseType(Qt3DCore::QAttribute::UnsignedInt); indexAttribute->setCount(8); - indexAttribute->setAttributeType(Qt3DRender::QAttribute::IndexAttribute); + indexAttribute->setAttributeType(Qt3DCore::QAttribute::IndexAttribute); geometry->addAttribute(positionAttribute.data()); geometry->addAttribute(indexAttribute.data()); diff --git a/tests/auto/render/updatemeshtrianglelistjob/tst_updatemeshtrianglelistjob.cpp b/tests/auto/render/updatemeshtrianglelistjob/tst_updatemeshtrianglelistjob.cpp index ae2218739..a0af5cea5 100644 --- a/tests/auto/render/updatemeshtrianglelistjob/tst_updatemeshtrianglelistjob.cpp +++ b/tests/auto/render/updatemeshtrianglelistjob/tst_updatemeshtrianglelistjob.cpp @@ -146,8 +146,8 @@ struct NodeCollection { explicit NodeCollection(Qt3DRender::TestAspect *aspect, QObject *frontendRoot) : geometryRenderers(frontendRoot->findChildren()) - , attributes(frontendRoot->findChildren()) - , buffers(frontendRoot->findChildren()) + , attributes(frontendRoot->findChildren()) + , buffers(frontendRoot->findChildren()) { // THEN QCOMPARE(aspect->nodeManagers()->geometryManager()->activeHandles().size(), geometryRenderers.size()); @@ -160,13 +160,13 @@ struct NodeCollection backendGeometryRenderer.push_back(backend); } - for (const Qt3DRender::QAttribute *a : qAsConst(attributes)) { + for (const Qt3DCore::QAttribute *a : qAsConst(attributes)) { Qt3DRender::Render::Attribute *backend = aspect->nodeManagers()->attributeManager()->lookupResource(a->id()); QVERIFY(backend != nullptr); backendAttributes.push_back(backend); } - for (const Qt3DRender::QBuffer *b : qAsConst(buffers)) { + for (const Qt3DCore::QBuffer *b : qAsConst(buffers)) { Qt3DRender::Render::Buffer *backend = aspect->nodeManagers()->bufferManager()->lookupResource(b->id()); QVERIFY(backend != nullptr); backendBuffers.push_back(backend); @@ -174,8 +174,8 @@ struct NodeCollection } QList geometryRenderers; - QList attributes; - QList buffers; + QList attributes; + QList buffers; QVector backendGeometryRenderer; QVector backendAttributes; -- cgit v1.2.3