10
10
#include < Qt3DRender/QRenderPass>
11
11
#include < Qt3DRender/QShaderProgram>
12
12
13
- #include < Qt3DRender /QAttribute>
14
- #include < Qt3DRender /QBuffer>
13
+ #include < Qt3DCore /QAttribute>
14
+ #include < Qt3DCore /QBuffer>
15
15
#include < Qt3DCore/QTransform>
16
+ #include < Qt3DCore/QGeometry>
16
17
17
18
#include < QDebug>
18
19
@@ -338,7 +339,7 @@ void DepthMapEntity::loadDepthMap()
338
339
point3d p = CArr + (iCamArr * point2d ((double )x, (double )y)).normalize () * depthValue;
339
340
Vec3f position (p.x , -p.y , -p.z );
340
341
341
- indexPerPixel[y * inSpec.width + x] = positions.size ();
342
+ indexPerPixel[y * inSpec.width + x] = ( int ) positions.size ();
342
343
positions.push_back (position);
343
344
344
345
if (validSimMap)
@@ -361,7 +362,7 @@ void DepthMapEntity::loadDepthMap()
361
362
qDebug () << " [DepthMapEntity] Valid Depth Values: " << positions.size ();
362
363
363
364
// create geometry
364
- QGeometry * customGeometry = new QGeometry;
365
+ auto * customGeometry = new Qt3DCore:: QGeometry;
365
366
366
367
// vertices buffer
367
368
std::vector<int > trianglesIndexes;
@@ -411,33 +412,33 @@ void DepthMapEntity::loadDepthMap()
411
412
normals[i+t] = normal;
412
413
}
413
414
414
- QBuffer* vertexBuffer = new QBuffer (QBuffer::VertexBuffer) ;
415
+ Qt3DCore:: QBuffer* vertexBuffer = new Qt3DCore::QBuffer ;
415
416
QByteArray trianglesData ((const char *)&triangles[0 ], triangles.size () * sizeof (Vec3f));
416
417
vertexBuffer->setData (trianglesData);
417
418
418
- QBuffer* normalBuffer = new QBuffer (QBuffer::VertexBuffer) ;
419
+ Qt3DCore:: QBuffer* normalBuffer = new Qt3DCore::QBuffer ;
419
420
QByteArray normalsData ((const char *)&normals[0 ], normals.size () * sizeof (Vec3f));
420
421
normalBuffer->setData (normalsData);
421
422
422
- QAttribute* positionAttribute = new QAttribute (this );
423
- positionAttribute->setName (QAttribute::defaultPositionAttributeName ());
424
- positionAttribute->setAttributeType (QAttribute::VertexAttribute);
423
+ Qt3DCore:: QAttribute* positionAttribute = new Qt3DCore:: QAttribute (this );
424
+ positionAttribute->setName (Qt3DCore:: QAttribute::defaultPositionAttributeName ());
425
+ positionAttribute->setAttributeType (Qt3DCore:: QAttribute::VertexAttribute);
425
426
positionAttribute->setBuffer (vertexBuffer);
426
- positionAttribute->setDataType ( QAttribute::Float);
427
- positionAttribute->setDataSize (3 );
427
+ positionAttribute->setVertexBaseType (Qt3DCore:: QAttribute::Float);
428
+ positionAttribute->setVertexSize (3 );
428
429
positionAttribute->setByteOffset (0 );
429
430
positionAttribute->setByteStride (sizeof (Vec3f));
430
- positionAttribute->setCount (triangles.size ());
431
+ positionAttribute->setCount ((uint) triangles.size ());
431
432
432
- QAttribute* normalAttribute = new QAttribute (this );
433
- normalAttribute->setName (QAttribute::defaultNormalAttributeName ());
434
- normalAttribute->setAttributeType (Qt3DRender ::QAttribute::VertexAttribute);
433
+ Qt3DCore:: QAttribute* normalAttribute = new Qt3DCore:: QAttribute (this );
434
+ normalAttribute->setName (Qt3DCore:: QAttribute::defaultNormalAttributeName ());
435
+ normalAttribute->setAttributeType (Qt3DCore ::QAttribute::VertexAttribute);
435
436
normalAttribute->setBuffer (normalBuffer);
436
- normalAttribute->setDataType ( QAttribute::Float);
437
- normalAttribute->setDataSize (3 );
437
+ normalAttribute->setVertexBaseType (Qt3DCore:: QAttribute::Float);
438
+ normalAttribute->setVertexSize (3 );
438
439
normalAttribute->setByteOffset (0 );
439
440
normalAttribute->setByteStride (sizeof (Vec3f));
440
- normalAttribute->setCount (normals.size ());
441
+ normalAttribute->setCount ((uint) normals.size ());
441
442
442
443
customGeometry->addAttribute (positionAttribute);
443
444
customGeometry->addAttribute (normalAttribute);
@@ -452,20 +453,20 @@ void DepthMapEntity::loadDepthMap()
452
453
}
453
454
454
455
// read color data
455
- QBuffer* colorDataBuffer = new QBuffer (QBuffer::VertexBuffer) ;
456
+ Qt3DCore:: QBuffer* colorDataBuffer = new Qt3DCore::QBuffer ;
456
457
QByteArray colorData ((const char *)colorsFlat[0 ].m , colorsFlat.size () * 3 * sizeof (float ));
457
458
colorDataBuffer->setData (colorData);
458
459
459
- QAttribute* colorAttribute = new QAttribute;
460
- qDebug () << " Qt3DRender::QAttribute::defaultColorAttributeName(): " << Qt3DRender ::QAttribute::defaultColorAttributeName ();
461
- colorAttribute->setName (Qt3DRender ::QAttribute::defaultColorAttributeName ());
462
- colorAttribute->setAttributeType (QAttribute::VertexAttribute);
460
+ Qt3DCore:: QAttribute* colorAttribute = new Qt3DCore:: QAttribute;
461
+ qDebug () << " Qt3DRender::QAttribute::defaultColorAttributeName(): " << Qt3DCore ::QAttribute::defaultColorAttributeName ();
462
+ colorAttribute->setName (Qt3DCore ::QAttribute::defaultColorAttributeName ());
463
+ colorAttribute->setAttributeType (Qt3DCore:: QAttribute::VertexAttribute);
463
464
colorAttribute->setBuffer (colorDataBuffer);
464
- colorAttribute->setDataType ( QAttribute::Float);
465
- colorAttribute->setDataSize (3 );
465
+ colorAttribute->setVertexBaseType (Qt3DCore:: QAttribute::Float);
466
+ colorAttribute->setVertexSize (3 );
466
467
colorAttribute->setByteOffset (0 );
467
468
colorAttribute->setByteStride (3 * sizeof (float ));
468
- colorAttribute->setCount (colorsFlat.size ());
469
+ colorAttribute->setCount ((uint) colorsFlat.size ());
469
470
customGeometry->addAttribute (colorAttribute);
470
471
471
472
// create the geometry renderer
0 commit comments