18#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
19#include <Qt3DRender/QAttribute>
20#include <Qt3DRender/QBuffer>
25#include <Qt3DCore/QAttribute>
26#include <Qt3DCore/QBuffer>
40 mPositionAttribute->setAttributeType( Qt3DQAttribute::VertexAttribute );
41 mPositionAttribute->setBuffer( mVertexBuffer );
42 mPositionAttribute->setVertexBaseType( Qt3DQAttribute::Float );
43 mPositionAttribute->setVertexSize( 3 );
44 mPositionAttribute->setByteOffset( 0 );
45 mPositionAttribute->setByteStride( 3 *
sizeof(
float ) );
46 mPositionAttribute->setName( Qt3DQAttribute::defaultPositionAttributeName() );
48 addAttribute( mPositionAttribute );
54 QByteArray vertexBufferData;
55 vertexBufferData.resize( vertices.size() * 3 *
sizeof(
float ) );
56 float *rawVertexArray =
reinterpret_cast<float *
>( vertexBufferData.data() );
58 for (
const auto &v : vertices )
60 rawVertexArray[idx++] = v.x();
61 rawVertexArray[idx++] = v.y();
62 rawVertexArray[idx++] = v.z();
65 mVertexCount = vertices.count();
66 mVertexBuffer->setData( vertexBufferData );
void countChanged(int count)
Signal when the number of points changed.
void setPoints(const QVector< QVector3D > &vertices)
Set the points for the billboard with vertices.
QgsBillboardGeometry(Qt3DCore::QNode *parent=nullptr)
Constructor of QgsBillboardGeometry.
Qt3DCore::QAttribute Qt3DQAttribute
Qt3DCore::QBuffer Qt3DQBuffer
Qt3DCore::QAttribute Qt3DQAttribute
Qt3DCore::QBuffer Qt3DQBuffer