summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2020-01-22 21:35:32 +0000
committerMike Krus <mike.krus@kdab.com>2020-02-27 06:29:57 +0000
commit17706144e9dc6c2dfde580b7821f18c5f6924682 (patch)
tree5f77929db358607fe63a1d438b7a746a6966cbfb /src/plugins
parent7f625e93620b313466d0223e911c0c3a5b492617 (diff)
Geometry refactoring
Move QBuffer, QAttribute, QGeometry to Qt3DCore. Change-Id: I59dfd091eefadcada93350b3aba955f40b304385 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/geometryloaders/default/basegeometryloader.cpp10
-rw-r--r--src/plugins/geometryloaders/default/basegeometryloader_p.h10
-rw-r--r--src/plugins/geometryloaders/fbx/fbxgeometryloader.cpp6
-rw-r--r--src/plugins/geometryloaders/gltf/gltfgeometryloader.cpp16
-rw-r--r--src/plugins/geometryloaders/gltf/gltfgeometryloader.h21
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp6
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicscontext_p.h4
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp6
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/submissioncontext_p.h1
-rw-r--r--src/plugins/renderers/opengl/renderer/renderer.cpp2
-rw-r--r--src/plugins/renderers/opengl/renderer/renderview.cpp10
-rw-r--r--src/plugins/sceneparsers/assimp/assimpimporter.cpp28
-rw-r--r--src/plugins/sceneparsers/gltf/gltfimporter.cpp8
-rw-r--r--src/plugins/sceneparsers/gltf/gltfimporter.h10
-rw-r--r--src/plugins/sceneparsers/gltfexport/gltfexporter.cpp6
15 files changed, 77 insertions, 67 deletions
diff --git a/src/plugins/geometryloaders/default/basegeometryloader.cpp b/src/plugins/geometryloaders/default/basegeometryloader.cpp
index 46e912a4e..a7c226c68 100644
--- a/src/plugins/geometryloaders/default/basegeometryloader.cpp
+++ b/src/plugins/geometryloaders/default/basegeometryloader.cpp
@@ -39,15 +39,17 @@
#include "basegeometryloader_p.h"
-#include <Qt3DRender/qattribute.h>
-#include <Qt3DRender/qbuffer.h>
-#include <Qt3DRender/qgeometry.h>
+#include <Qt3DCore/qattribute.h>
+#include <Qt3DCore/qbuffer.h>
+#include <Qt3DCore/qgeometry.h>
#include <Qt3DRender/private/qaxisalignedboundingbox_p.h>
#include <Qt3DRender/private/renderlogging_p.h>
QT_BEGIN_NAMESPACE
+using namespace Qt3DCore;
+
namespace Qt3DRender {
Q_LOGGING_CATEGORY(BaseGeometryLoaderLog, "Qt3D.BaseGeometryLoader", QtWarningMsg)
@@ -60,7 +62,7 @@ BaseGeometryLoader::BaseGeometryLoader()
{
}
-QGeometry *BaseGeometryLoader::geometry() const
+Qt3DCore::QGeometry *BaseGeometryLoader::geometry() const
{
return m_geometry;
}
diff --git a/src/plugins/geometryloaders/default/basegeometryloader_p.h b/src/plugins/geometryloaders/default/basegeometryloader_p.h
index 0fe1e2763..2f9e25fab 100644
--- a/src/plugins/geometryloaders/default/basegeometryloader_p.h
+++ b/src/plugins/geometryloaders/default/basegeometryloader_p.h
@@ -67,9 +67,11 @@ QT_BEGIN_NAMESPACE
class QIODevice;
class QString;
-namespace Qt3DRender {
-
+namespace Qt3DCore {
class QGeometry;
+}
+
+namespace Qt3DRender {
class BaseGeometryLoader : public QGeometryLoaderInterface
{
@@ -96,7 +98,7 @@ public:
QVector<QVector4D> tangents() const { return m_tangents; }
QVector<unsigned int> indices() const { return m_indices; }
- QGeometry *geometry() const override;
+ Qt3DCore::QGeometry *geometry() const override;
bool load(QIODevice *ioDev, const QString &subMesh = QString()) override;
@@ -124,7 +126,7 @@ protected:
QVector<QVector4D> m_tangents;
QVector<unsigned int> m_indices;
- QGeometry *m_geometry;
+ Qt3DCore::QGeometry *m_geometry;
};
struct FaceIndices
diff --git a/src/plugins/geometryloaders/fbx/fbxgeometryloader.cpp b/src/plugins/geometryloaders/fbx/fbxgeometryloader.cpp
index 355096448..e8b92dc82 100644
--- a/src/plugins/geometryloaders/fbx/fbxgeometryloader.cpp
+++ b/src/plugins/geometryloaders/fbx/fbxgeometryloader.cpp
@@ -41,9 +41,9 @@
#include <QtCore/QFileDevice>
-#include <Qt3DRender/QAttribute>
-#include <Qt3DRender/QBuffer>
-#include <Qt3DRender/QGeometry>
+#include <Qt3DCore/QAttribute>
+#include <Qt3DCore/QBuffer>
+#include <Qt3DCore/QGeometry>
#include <Qt3DRender/private/renderlogging_p.h>
#include <fbxsdk.h>
diff --git a/src/plugins/geometryloaders/gltf/gltfgeometryloader.cpp b/src/plugins/geometryloaders/gltf/gltfgeometryloader.cpp
index 2c8bb14c3..9f13ca2c6 100644
--- a/src/plugins/geometryloaders/gltf/gltfgeometryloader.cpp
+++ b/src/plugins/geometryloaders/gltf/gltfgeometryloader.cpp
@@ -46,8 +46,8 @@
#include <QOpenGLTexture>
-#include <Qt3DRender/QGeometry>
#include <Qt3DRender/private/renderlogging_p.h>
+#include <Qt3DCore/QGeometry>
#include <Qt3DCore/private/qloadgltf_p.h>
QT_BEGIN_NAMESPACE
@@ -57,6 +57,8 @@ QT_BEGIN_NAMESPACE
static_cast<const wchar_t*>(static_cast<const void*>(string.utf16()))
#endif
+using namespace Qt3DCore;
+
namespace Qt3DRender {
Q_LOGGING_CATEGORY(GLTFGeometryLoaderLog, "Qt3D.GLTFGeometryLoader", QtWarningMsg)
@@ -326,7 +328,7 @@ void GLTFGeometryLoader::processJSONBufferView(const QString &id, const QJsonObj
qUtf16PrintableImpl(bufferData.path), qUtf16PrintableImpl(id));
}
- Qt3DRender::QBuffer *b = new Qt3DRender::QBuffer();
+ Qt3DCore::QBuffer *b = new Qt3DCore::QBuffer();
b->setData(bytes);
m_gltf1.m_buffers[id] = b;
}
@@ -363,7 +365,7 @@ void GLTFGeometryLoader::processJSONBufferViewV2(const QJsonObject &json)
qUtf16PrintableImpl(bufferData.path));
}
- auto b = new Qt3DRender::QBuffer;
+ auto b = new Qt3DCore::QBuffer;
b->setData(bytes);
m_gltf2.m_buffers.push_back(b);
}
@@ -409,7 +411,7 @@ void GLTFGeometryLoader::processJSONMesh(const QString &id, const QJsonObject &j
attributeName = attrName;
//Get buffer handle for accessor
- Qt3DRender::QBuffer *buffer = m_gltf1.m_buffers.value(accessorIt->bufferViewName, nullptr);
+ Qt3DCore::QBuffer *buffer = m_gltf1.m_buffers.value(accessorIt->bufferViewName, nullptr);
if (Q_UNLIKELY(!buffer)) {
qCWarning(GLTFGeometryLoaderLog, "unknown buffer-view: %ls processing accessor: %ls",
qUtf16PrintableImpl(accessorIt->bufferViewName), qUtf16PrintableImpl(id));
@@ -436,7 +438,7 @@ void GLTFGeometryLoader::processJSONMesh(const QString &id, const QJsonObject &j
qUtf16PrintableImpl(k), qUtf16PrintableImpl(id));
} else {
//Get buffer handle for accessor
- Qt3DRender::QBuffer *buffer = m_gltf1.m_buffers.value(accessorIt->bufferViewName, nullptr);
+ Qt3DCore::QBuffer *buffer = m_gltf1.m_buffers.value(accessorIt->bufferViewName, nullptr);
if (Q_UNLIKELY(!buffer)) {
qCWarning(GLTFGeometryLoaderLog, "unknown buffer-view: %ls processing accessor: %ls",
qUtf16PrintableImpl(accessorIt->bufferViewName), qUtf16PrintableImpl(id));
@@ -489,7 +491,7 @@ void GLTFGeometryLoader::processJSONMeshV2(const QJsonObject &json)
accessor.bufferViewIndex, qUtf16PrintableImpl(json.value(KEY_NAME).toString()));
continue;
}
- Qt3DRender::QBuffer *buffer = m_gltf2.m_buffers[accessor.bufferViewIndex];
+ Qt3DCore::QBuffer *buffer = m_gltf2.m_buffers[accessor.bufferViewIndex];
QAttribute *attribute = new QAttribute(buffer,
attributeName,
@@ -517,7 +519,7 @@ void GLTFGeometryLoader::processJSONMeshV2(const QJsonObject &json)
accessor.bufferViewIndex, qUtf16PrintableImpl(json.value(KEY_NAME).toString()));
continue;
}
- Qt3DRender::QBuffer *buffer = m_gltf2.m_buffers[accessor.bufferViewIndex];
+ Qt3DCore::QBuffer *buffer = m_gltf2.m_buffers[accessor.bufferViewIndex];
QAttribute *attribute = new QAttribute(buffer,
accessor.type,
diff --git a/src/plugins/geometryloaders/gltf/gltfgeometryloader.h b/src/plugins/geometryloaders/gltf/gltfgeometryloader.h
index 404668dd0..36ac0f174 100644
--- a/src/plugins/geometryloaders/gltf/gltfgeometryloader.h
+++ b/src/plugins/geometryloaders/gltf/gltfgeometryloader.h
@@ -54,13 +54,17 @@
#include <QtCore/QJsonDocument>
#include <Qt3DRender/private/qgeometryloaderinterface_p.h>
-#include <Qt3DRender/qattribute.h>
-#include <Qt3DRender/qbuffer.h>
+#include <Qt3DCore/qattribute.h>
+#include <Qt3DCore/qbuffer.h>
#include <private/qlocale_tools_p.h>
QT_BEGIN_NAMESPACE
+namespace Qt3DCore {
+class QGeometry;
+}
+
namespace Qt3DRender {
#define GLTFGEOMETRYLOADER_EXT QLatin1String("gltf")
@@ -77,7 +81,6 @@ class QRenderState;
class QTechnique;
class QParameter;
class QGeometryRenderer;
-class QGeometry;
class GLTFGeometryLoader : public QGeometryLoaderInterface
{
@@ -111,7 +114,7 @@ class GLTFGeometryLoader : public QGeometryLoaderInterface
QString bufferViewName;
int bufferViewIndex;
- QAttribute::VertexBaseType type;
+ Qt3DCore::QAttribute::VertexBaseType type;
uint dataSize;
int count;
int offset;
@@ -122,13 +125,13 @@ class GLTFGeometryLoader : public QGeometryLoaderInterface
{
QHash<QString, AccessorData> m_accessorDict;
QHash<QString, BufferData> m_bufferDatas;
- QHash<QString, Qt3DRender::QBuffer*> m_buffers;
+ QHash<QString, Qt3DCore::QBuffer*> m_buffers;
};
struct Gltf2
{
QVector<BufferData> m_bufferDatas;
- QVector<Qt3DRender::QBuffer*> m_buffers;
+ QVector<Qt3DCore::QBuffer*> m_buffers;
QVector<AccessorData> m_accessors;
};
@@ -137,7 +140,7 @@ public:
GLTFGeometryLoader();
~GLTFGeometryLoader();
- QGeometry *geometry() const final;
+ Qt3DCore::QGeometry *geometry() const final;
bool load(QIODevice *ioDev, const QString &subMesh = QString()) final;
@@ -170,7 +173,7 @@ protected:
QByteArray resolveLocalData(const QString &path) const;
- static QAttribute::VertexBaseType accessorTypeFromJSON(int componentType);
+ static Qt3DCore::QAttribute::VertexBaseType accessorTypeFromJSON(int componentType);
static uint accessorDataSizeFromJson(const QString &type);
private:
@@ -181,7 +184,7 @@ private:
Gltf1 m_gltf1;
Gltf2 m_gltf2;
- QGeometry *m_geometry;
+ Qt3DCore::QGeometry *m_geometry;
};
} // namespace Qt3DRender
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp
index 508b38755..30a8184b5 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp
@@ -52,9 +52,7 @@
#include <Qt3DRender/private/buffermanager_p.h>
#include <Qt3DRender/private/managers_p.h>
#include <Qt3DRender/private/attachmentpack_p.h>
-#include <Qt3DRender/private/qbuffer_p.h>
#include <Qt3DRender/private/attachmentpack_p.h>
-#include <Qt3DRender/private/qbuffer_p.h>
#include <Qt3DRender/private/renderstateset_p.h>
#include <QOpenGLShaderProgram>
#include <glresourcemanagers_p.h>
@@ -971,8 +969,10 @@ GLuint GraphicsContext::byteSizeFromType(GLint type)
return 0;
}
-GLint GraphicsContext::glDataTypeFromAttributeDataType(QAttribute::VertexBaseType dataType)
+GLint GraphicsContext::glDataTypeFromAttributeDataType(Qt3DCore::QAttribute::VertexBaseType dataType)
{
+ using namespace Qt3DCore;
+
switch (dataType) {
case QAttribute::Byte:
return GL_BYTE;
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicscontext_p.h b/src/plugins/renderers/opengl/graphicshelpers/graphicscontext_p.h
index 8da1a420c..ba474a89b 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicscontext_p.h
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicscontext_p.h
@@ -60,9 +60,9 @@
#include <QMatrix4x4>
#include <QBitArray>
#include <QImage>
+#include <Qt3DCore/qattribute.h>
#include <Qt3DRender/qclearbuffers.h>
#include <Qt3DRender/private/shader_p.h>
-#include <Qt3DRender/qattribute.h>
#include <Qt3DRender/qmemorybarrier.h>
#include <Qt3DRender/private/handle_types_p.h>
#include <Qt3DRender/private/qgraphicsapifilter_p.h>
@@ -184,7 +184,7 @@ public:
static GLint elementType(GLint type);
static GLint tupleSizeFromType(GLint type);
static GLuint byteSizeFromType(GLint type);
- static GLint glDataTypeFromAttributeDataType(QAttribute::VertexBaseType dataType);
+ static GLint glDataTypeFromAttributeDataType(Qt3DCore::QAttribute::VertexBaseType dataType);
bool supportsDrawBuffersBlend() const;
bool supportsVAO() const { return m_supportsVAO; }
diff --git a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp
index b22477435..519f2ae98 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp
+++ b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp
@@ -39,6 +39,7 @@
#include "submissioncontext_p.h"
+#include <Qt3DCore/private/qbuffer_p.h>
#include <Qt3DRender/qgraphicsapifilter.h>
#include <Qt3DRender/qparameter.h>
#include <Qt3DRender/qcullface.h>
@@ -54,7 +55,6 @@
#include <Qt3DRender/private/buffermanager_p.h>
#include <Qt3DRender/private/managers_p.h>
#include <Qt3DRender/private/attachmentpack_p.h>
-#include <Qt3DRender/private/qbuffer_p.h>
#include <Qt3DRender/private/stringtoint_p.h>
#include <gltexture_p.h>
#include <rendercommand_p.h>
@@ -97,6 +97,8 @@ QT_BEGIN_NAMESPACE
#define GL_DRAW_FRAMEBUFFER 0x8CA9
#endif
+using namespace Qt3DCore;
+
namespace Qt3DRender {
namespace Render {
namespace OpenGL {
@@ -1461,7 +1463,7 @@ void SubmissionContext::uploadDataToGLBuffer(Buffer *buffer, GLBuffer *b, bool r
// * partial buffer updates where received
// TO DO: Handle usage pattern
- QVector<Qt3DRender::QBufferUpdate> updates = std::move(buffer->pendingBufferUpdates());
+ QVector<Qt3DCore::QBufferUpdate> updates = std::move(buffer->pendingBufferUpdates());
for (auto it = updates.begin(); it != updates.end(); ++it) {
auto update = it;
// We have a partial update
diff --git a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext_p.h b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext_p.h
index d43cae4f8..59b2b78f3 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext_p.h
+++ b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext_p.h
@@ -59,7 +59,6 @@
#include <texturesubmissioncontext_p.h>
#include <imagesubmissioncontext_p.h>
#include <Qt3DRender/qclearbuffers.h>
-#include <Qt3DRender/qattribute.h>
#include <Qt3DRender/private/handle_types_p.h>
#include <Qt3DRender/private/attachmentpack_p.h>
diff --git a/src/plugins/renderers/opengl/renderer/renderer.cpp b/src/plugins/renderers/opengl/renderer/renderer.cpp
index 2dafa15c5..deb77ee4b 100644
--- a/src/plugins/renderers/opengl/renderer/renderer.cpp
+++ b/src/plugins/renderers/opengl/renderer/renderer.cpp
@@ -1116,7 +1116,7 @@ void Renderer::lookForDownloadableBuffers()
const QVector<HBuffer> activeBufferHandles = m_nodesManager->bufferManager()->activeHandles();
for (const HBuffer &handle : activeBufferHandles) {
Buffer *buffer = m_nodesManager->bufferManager()->data(handle);
- if (buffer->access() & QBuffer::Read)
+ if (buffer->access() & Qt3DCore::QBuffer::Read)
m_downloadableBuffers.push_back(buffer->peerId());
}
}
diff --git a/src/plugins/renderers/opengl/renderer/renderview.cpp b/src/plugins/renderers/opengl/renderer/renderview.cpp
index 47f4beffd..326a8a91b 100644
--- a/src/plugins/renderers/opengl/renderer/renderview.cpp
+++ b/src/plugins/renderers/opengl/renderer/renderview.cpp
@@ -381,8 +381,8 @@ struct SubRangeSorter
{
static void sortSubRange(CommandIt begin, const CommandIt end)
{
- Q_UNUSED(begin);
- Q_UNUSED(end);
+ Q_UNUSED(begin)
+ Q_UNUSED(end)
Q_UNREACHABLE();
}
};
@@ -705,13 +705,13 @@ EntityRenderCommandData RenderView::buildDrawRenderCommands(const QVector<Entity
for (Qt3DCore::QNodeId attributeId : attributeIds) {
Attribute *attribute = m_manager->attributeManager()->lookupResource(attributeId);
switch (attribute->attributeType()) {
- case QAttribute::IndexAttribute:
+ case Qt3DCore::QAttribute::IndexAttribute:
indexAttribute = attribute;
break;
- case QAttribute::DrawIndirectAttribute:
+ case Qt3DCore::QAttribute::DrawIndirectAttribute:
indirectAttribute = attribute;
break;
- case QAttribute::VertexAttribute:
+ case Qt3DCore::QAttribute::VertexAttribute:
estimatedCount = std::max(int(attribute->count()), estimatedCount);
break;
default:
diff --git a/src/plugins/sceneparsers/assimp/assimpimporter.cpp b/src/plugins/sceneparsers/assimp/assimpimporter.cpp
index ef28c577f..7655bf931 100644
--- a/src/plugins/sceneparsers/assimp/assimpimporter.cpp
+++ b/src/plugins/sceneparsers/assimp/assimpimporter.cpp
@@ -41,20 +41,20 @@
#include <Qt3DCore/qentity.h>
#include <Qt3DCore/qtransform.h>
-#include <Qt3DExtras/qdiffusemapmaterial.h>
-#include <Qt3DExtras/qdiffusespecularmapmaterial.h>
-#include <Qt3DExtras/qphongmaterial.h>
-#include <Qt3DRender/qattribute.h>
-#include <Qt3DRender/qbuffer.h>
+#include <Qt3DCore/qattribute.h>
+#include <Qt3DCore/qbuffer.h>
+#include <Qt3DCore/qgeometry.h>
#include <Qt3DRender/qcameralens.h>
#include <Qt3DRender/qeffect.h>
-#include <Qt3DRender/qgeometry.h>
#include <Qt3DRender/qgeometryrenderer.h>
#include <Qt3DRender/qmaterial.h>
#include <Qt3DRender/qmesh.h>
#include <Qt3DRender/qparameter.h>
#include <Qt3DRender/qtexture.h>
#include <Qt3DRender/qtextureimagedatagenerator.h>
+#include <Qt3DExtras/qdiffusemapmaterial.h>
+#include <Qt3DExtras/qdiffusespecularmapmaterial.h>
+#include <Qt3DExtras/qphongmaterial.h>
#include <Qt3DExtras/qmorphphongmaterial.h>
#include <Qt3DExtras/qdiffusemapmaterial.h>
#include <Qt3DExtras/qdiffusespecularmapmaterial.h>
@@ -67,8 +67,8 @@
#include <qmath.h>
#include <Qt3DCore/private/qabstractnodefactory_p.h>
+#include <Qt3DCore/private/qurlhelper_p.h>
#include <Qt3DRender/private/renderlogging_p.h>
-#include <Qt3DRender/private/qurlhelper_p.h>
QT_BEGIN_NAMESPACE
@@ -394,7 +394,7 @@ bool AssimpImporter::areAssimpExtensions(const QStringList &extensions)
*/
void AssimpImporter::setSource(const QUrl &source)
{
- const QString path = QUrlHelper::urlToLocalFileOrQrc(source);
+ const QString path = Qt3DCore::QUrlHelper::urlToLocalFileOrQrc(source);
QFileInfo file(path);
m_sceneDir = file.absoluteDir();
if (!file.exists()) {
@@ -702,12 +702,12 @@ QGeometryRenderer *AssimpImporter::loadMesh(uint meshIndex)
QGeometryRenderer *geometryRenderer = QAbstractNodeFactory::createNode<QGeometryRenderer>("QGeometryRenderer");
QGeometry *meshGeometry = QAbstractNodeFactory::createNode<QGeometry>("QGeometry");
meshGeometry->setParent(geometryRenderer);
- Qt3DRender::QBuffer *vertexBuffer = QAbstractNodeFactory::createNode<Qt3DRender::QBuffer>("QBuffer");
+ Qt3DCore::QBuffer *vertexBuffer = QAbstractNodeFactory::createNode<Qt3DCore::QBuffer>("QBuffer");
vertexBuffer->setParent(meshGeometry);
- vertexBuffer->setType(Qt3DRender::QBuffer::VertexBuffer);
- Qt3DRender::QBuffer *indexBuffer = QAbstractNodeFactory::createNode<Qt3DRender::QBuffer>("QBuffer");
+ vertexBuffer->setType(Qt3DCore::QBuffer::VertexBuffer);
+ Qt3DCore::QBuffer *indexBuffer = QAbstractNodeFactory::createNode<Qt3DCore::QBuffer>("QBuffer");
indexBuffer->setParent(meshGeometry);
- indexBuffer->setType(Qt3DRender::QBuffer::IndexBuffer);
+ indexBuffer->setType(Qt3DCore::QBuffer::IndexBuffer);
geometryRenderer->setGeometry(meshGeometry);
@@ -922,8 +922,8 @@ QGeometryRenderer *AssimpImporter::loadMesh(uint meshIndex)
}
}
- Qt3DRender::QBuffer *targetBuffer
- = QAbstractNodeFactory::createNode<Qt3DRender::QBuffer>("QBuffer");
+ Qt3DCore::QBuffer *targetBuffer
+ = QAbstractNodeFactory::createNode<Qt3DCore::QBuffer>("QBuffer");
targetBuffer->setData(targetBufferArray);
targetBuffer->setParent(meshGeometry);
diff --git a/src/plugins/sceneparsers/gltf/gltfimporter.cpp b/src/plugins/sceneparsers/gltf/gltfimporter.cpp
index 860dec3e7..b141a44a5 100644
--- a/src/plugins/sceneparsers/gltf/gltfimporter.cpp
+++ b/src/plugins/sceneparsers/gltf/gltfimporter.cpp
@@ -50,6 +50,7 @@
#include <Qt3DCore/qentity.h>
#include <Qt3DCore/qtransform.h>
+#include <Qt3DCore/qgeometry.h>
#include <Qt3DRender/qcameralens.h>
#include <Qt3DRender/qcamera.h>
@@ -74,7 +75,6 @@
#include <Qt3DRender/qstenciltestarguments.h>
#include <Qt3DRender/qeffect.h>
#include <Qt3DRender/qfrontface.h>
-#include <Qt3DRender/qgeometry.h>
#include <Qt3DRender/qgeometryrenderer.h>
#include <Qt3DRender/qmaterial.h>
#include <Qt3DRender/qgraphicsapifilter.h>
@@ -1522,7 +1522,7 @@ void GLTFImporter::processJSONBufferView(const QString &id, const QJsonObject& j
qUtf16PrintableImpl(bufferData.path), qUtf16PrintableImpl(id));
}
- Qt3DRender::QBuffer *b = new Qt3DRender::QBuffer();
+ Qt3DCore::QBuffer *b = new Qt3DCore::QBuffer();
b->setData(bytes);
m_buffers[id] = b;
}
@@ -1768,7 +1768,7 @@ void GLTFImporter::processJSONMesh(const QString &id, const QJsonObject &json)
attributeName = attrName;
//Get buffer handle for accessor
- Qt3DRender::QBuffer *buffer = m_buffers.value(accessorIt->bufferViewName, nullptr);
+ Qt3DCore::QBuffer *buffer = m_buffers.value(accessorIt->bufferViewName, nullptr);
if (Q_UNLIKELY(!buffer)) {
qCWarning(GLTFImporterLog, "unknown buffer-view: %ls processing accessor: %ls",
qUtf16PrintableImpl(accessorIt->bufferViewName),
@@ -1796,7 +1796,7 @@ void GLTFImporter::processJSONMesh(const QString &id, const QJsonObject &json)
qUtf16PrintableImpl(accIndex), qUtf16PrintableImpl(id));
} else {
//Get buffer handle for accessor
- Qt3DRender::QBuffer *buffer = m_buffers.value(accessorIt->bufferViewName, nullptr);
+ Qt3DCore::QBuffer *buffer = m_buffers.value(accessorIt->bufferViewName, nullptr);
if (Q_UNLIKELY(!buffer)) {
qCWarning(GLTFImporterLog, "unknown buffer-view: %ls processing accessor: %ls",
qUtf16PrintableImpl(accessorIt->bufferViewName),
diff --git a/src/plugins/sceneparsers/gltf/gltfimporter.h b/src/plugins/sceneparsers/gltf/gltfimporter.h
index 271ce5979..79f35ebad 100644
--- a/src/plugins/sceneparsers/gltf/gltfimporter.h
+++ b/src/plugins/sceneparsers/gltf/gltfimporter.h
@@ -52,8 +52,8 @@
// We mean it.
//
-#include <Qt3DRender/qattribute.h>
-#include <Qt3DRender/qbuffer.h>
+#include <Qt3DCore/qattribute.h>
+#include <Qt3DCore/qbuffer.h>
#include <QtCore/qjsondocument.h>
#include <QtCore/qjsonobject.h>
#include <QtCore/qhash.h>
@@ -135,7 +135,7 @@ private:
explicit AccessorData(const QJsonObject& json, int major, int minor);
QString bufferViewName;
- QAttribute::VertexBaseType type;
+ Qt3DCore::QAttribute::VertexBaseType type;
uint dataSize;
int count;
int offset;
@@ -178,7 +178,7 @@ private:
QByteArray resolveLocalData(const QString &path) const;
QVariant parameterValueFromJSON(int type, const QJsonValue &value) const;
- static QAttribute::VertexBaseType accessorTypeFromJSON(int componentType);
+ static Qt3DCore::QAttribute::VertexBaseType accessorTypeFromJSON(int componentType);
static uint accessorDataSizeFromJson(const QString &type);
static QRenderState *buildStateEnable(int state);
@@ -212,7 +212,7 @@ private:
QHash<QString, QMaterial*> m_materialCache;
QHash<QString, BufferData> m_bufferDatas;
- QHash<QString, Qt3DRender::QBuffer*> m_buffers;
+ QHash<QString, Qt3DCore::QBuffer*> m_buffers;
QHash<QString, QString> m_shaderPaths;
QHash<QString, QShaderProgram*> m_programs;
diff --git a/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp b/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
index 9fced8e89..8b4fac1ce 100644
--- a/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
+++ b/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
@@ -58,14 +58,15 @@
#include <QtGui/qmatrix4x4.h>
#include <Qt3DCore/qentity.h>
+#include <Qt3DCore/qattribute.h>
+#include <Qt3DCore/qbuffer.h>
+#include <Qt3DCore/qgeometry.h>
#include <Qt3DCore/qtransform.h>
#include <Qt3DRender/qcameralens.h>
#include <Qt3DRender/qcamera.h>
#include <Qt3DRender/qblendequation.h>
#include <Qt3DRender/qblendequationarguments.h>
#include <Qt3DRender/qeffect.h>
-#include <Qt3DRender/qattribute.h>
-#include <Qt3DRender/qbuffer.h>
#include <Qt3DRender/qmaterial.h>
#include <Qt3DRender/qgraphicsapifilter.h>
#include <Qt3DRender/qparameter.h>
@@ -74,7 +75,6 @@
#include <Qt3DRender/qpointlight.h>
#include <Qt3DRender/qspotlight.h>
#include <Qt3DRender/qdirectionallight.h>
-#include <Qt3DRender/qgeometry.h>
#include <Qt3DRender/qgeometryrenderer.h>
#include <Qt3DRender/qtechnique.h>
#include <Qt3DRender/qalphacoverage.h>