diff options
author | Mike Krus <mike.krus@kdab.com> | 2020-01-22 21:35:32 +0000 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2020-02-27 06:29:57 +0000 |
commit | 17706144e9dc6c2dfde580b7821f18c5f6924682 (patch) | |
tree | 5f77929db358607fe63a1d438b7a746a6966cbfb /tests/manual/custom-mesh-cpp/main.cpp | |
parent | 7f625e93620b313466d0223e911c0c3a5b492617 (diff) |
Geometry refactoring
Move QBuffer, QAttribute, QGeometry to Qt3DCore.
Change-Id: I59dfd091eefadcada93350b3aba955f40b304385
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tests/manual/custom-mesh-cpp/main.cpp')
-rw-r--r-- | tests/manual/custom-mesh-cpp/main.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/tests/manual/custom-mesh-cpp/main.cpp b/tests/manual/custom-mesh-cpp/main.cpp index 275d97088..dee8363d8 100644 --- a/tests/manual/custom-mesh-cpp/main.cpp +++ b/tests/manual/custom-mesh-cpp/main.cpp @@ -55,6 +55,9 @@ #include <Qt3DRender/QCameraLens> #include <Qt3DCore/QTransform> #include <Qt3DCore/QAspectEngine> +#include <Qt3DCore/QGeometry> +#include <Qt3DCore/QAttribute> +#include <Qt3DCore/QBuffer> #include <Qt3DInput/QInputAspect> @@ -64,9 +67,6 @@ #include <Qt3DExtras/QPerVertexColorMaterial> #include <Qt3DRender/QGeometryRenderer> -#include <Qt3DRender/QGeometry> -#include <Qt3DRender/QAttribute> -#include <Qt3DRender/QBuffer> #include <QPropertyAnimation> #include <Qt3DExtras/qt3dwindow.h> @@ -105,10 +105,10 @@ int main(int argc, char* argv[]) // Custom Mesh (TetraHedron) Qt3DRender::QGeometryRenderer *customMeshRenderer = new Qt3DRender::QGeometryRenderer; - Qt3DRender::QGeometry *customGeometry = new Qt3DRender::QGeometry(customMeshRenderer); + Qt3DCore::QGeometry *customGeometry = new Qt3DCore::QGeometry(customMeshRenderer); - Qt3DRender::QBuffer *vertexDataBuffer = new Qt3DRender::QBuffer(customGeometry); - Qt3DRender::QBuffer *indexDataBuffer = new Qt3DRender::QBuffer(customGeometry); + Qt3DCore::QBuffer *vertexDataBuffer = new Qt3DCore::QBuffer(customGeometry); + Qt3DCore::QBuffer *indexDataBuffer = new Qt3DCore::QBuffer(customGeometry); // vec3 for position // vec3 for colors @@ -190,40 +190,40 @@ int main(int argc, char* argv[]) indexDataBuffer->setData(indexBufferData); // Attributes - Qt3DRender::QAttribute *positionAttribute = new Qt3DRender::QAttribute(); - positionAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + Qt3DCore::QAttribute *positionAttribute = new Qt3DCore::QAttribute(); + positionAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); positionAttribute->setBuffer(vertexDataBuffer); - positionAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + positionAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); positionAttribute->setVertexSize(3); positionAttribute->setByteOffset(0); positionAttribute->setByteStride(9 * sizeof(float)); positionAttribute->setCount(4); - positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); + positionAttribute->setName(Qt3DCore::QAttribute::defaultPositionAttributeName()); - Qt3DRender::QAttribute *normalAttribute = new Qt3DRender::QAttribute(); - normalAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + Qt3DCore::QAttribute *normalAttribute = new Qt3DCore::QAttribute(); + normalAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); normalAttribute->setBuffer(vertexDataBuffer); - normalAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + normalAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); normalAttribute->setVertexSize(3); normalAttribute->setByteOffset(3 * sizeof(float)); normalAttribute->setByteStride(9 * sizeof(float)); normalAttribute->setCount(4); - normalAttribute->setName(Qt3DRender::QAttribute::defaultNormalAttributeName()); + normalAttribute->setName(Qt3DCore::QAttribute::defaultNormalAttributeName()); - Qt3DRender::QAttribute *colorAttribute = new Qt3DRender::QAttribute(); - colorAttribute->setAttributeType(Qt3DRender::QAttribute::VertexAttribute); + Qt3DCore::QAttribute *colorAttribute = new Qt3DCore::QAttribute(); + colorAttribute->setAttributeType(Qt3DCore::QAttribute::VertexAttribute); colorAttribute->setBuffer(vertexDataBuffer); - colorAttribute->setVertexBaseType(Qt3DRender::QAttribute::Float); + colorAttribute->setVertexBaseType(Qt3DCore::QAttribute::Float); colorAttribute->setVertexSize(3); colorAttribute->setByteOffset(6 * sizeof(float)); colorAttribute->setByteStride(9 * sizeof(float)); colorAttribute->setCount(4); - colorAttribute->setName(Qt3DRender::QAttribute::defaultColorAttributeName()); + colorAttribute->setName(Qt3DCore::QAttribute::defaultColorAttributeName()); - Qt3DRender::QAttribute *indexAttribute = new Qt3DRender::QAttribute(); - indexAttribute->setAttributeType(Qt3DRender::QAttribute::IndexAttribute); + Qt3DCore::QAttribute *indexAttribute = new Qt3DCore::QAttribute(); + indexAttribute->setAttributeType(Qt3DCore::QAttribute::IndexAttribute); indexAttribute->setBuffer(indexDataBuffer); - indexAttribute->setVertexBaseType(Qt3DRender::QAttribute::UnsignedShort); + indexAttribute->setVertexBaseType(Qt3DCore::QAttribute::UnsignedShort); indexAttribute->setVertexSize(1); indexAttribute->setByteOffset(0); indexAttribute->setByteStride(0); |