QGIS API Documentation 3.38.0-Grenoble (exported)
Loading...
Searching...
No Matches
qgsbillboardgeometry.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsbillboardgeometry.h
3 --------------------------------------
4 Date : Jul 2019
5 Copyright : (C) 2019 by Ismail Sunni
6 Email : imajimatika at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSBILLBOARDGEOMETRY_H
17#define QGSBILLBOARDGEOMETRY_H
18
19#include <QObject>
20#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
21#include <Qt3DRender/QGeometry>
22#include <Qt3DRender/QBuffer>
23#include <Qt3DRender/QAttribute>
24#else
25#include <Qt3DCore/QGeometry>
26#include <Qt3DCore/QBuffer>
27#include <Qt3DCore/QAttribute>
28#endif
29
30#define SIP_NO_FILE
31
40#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
41class QgsBillboardGeometry : public Qt3DRender::QGeometry
42#else
43class QgsBillboardGeometry : public Qt3DCore::QGeometry
44#endif
45{
46 Q_OBJECT
47
48 Q_PROPERTY( int count READ count NOTIFY countChanged )
49 public:
51 QgsBillboardGeometry( Qt3DCore::QNode *parent = nullptr );
52
54 void setPoints( const QVector<QVector3D> &vertices );
55
57 int count() const;
58 signals:
60 void countChanged( int count );
61
62 private:
63#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
64 Qt3DRender::QAttribute *mPositionAttribute = nullptr;
65 Qt3DRender::QBuffer *mVertexBuffer = nullptr;
66#else
67 Qt3DCore::QAttribute *mPositionAttribute = nullptr;
68 Qt3DCore::QBuffer *mVertexBuffer = nullptr;
69#endif
70 int mVertexCount = 0;
71};
72
73#endif // QGSBILLBOARDGEOMETRY_H
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.