22 , mPositionAttribute( new
Qt3DRender::QAttribute( this ) )
26 mPositionAttribute->setAttributeType( Qt3DRender::QAttribute::VertexAttribute );
27 mPositionAttribute->setBuffer( mVertexBuffer );
28 mPositionAttribute->setVertexBaseType( Qt3DRender::QAttribute::Float );
29 mPositionAttribute->setVertexSize( 3 );
30 mPositionAttribute->setName( Qt3DRender::QAttribute::defaultPositionAttributeName() );
32 addAttribute( mPositionAttribute );
38 QByteArray vertexBufferData;
39 vertexBufferData.resize( vertices.size() * 3 *
sizeof( float ) );
40 float *rawVertexArray =
reinterpret_cast<float *
>( vertexBufferData.data() );
42 for (
const auto &v : vertices )
44 rawVertexArray[idx++] = v.x();
45 rawVertexArray[idx++] = v.y();
46 rawVertexArray[idx++] = v.z();
49 mVertexCount = vertices.count();
50 mVertexBuffer->setData( vertexBufferData );
void countChanged(int count)
Signal when the number of points changed.
int count() const
Returns the number of points.
void setPoints(const QVector< QVector3D > &vertices)
Set the points for the billboard with vertices.
QgsBillboardGeometry(Qt3DCore::QNode *parent=nullptr)
Constructor of QgsBillboardGeometry.