16 #ifndef QGSPOINTCLOUD3DSYMBOL_P_H
17 #define QGSPOINTCLOUD3DSYMBOL_P_H
29 #include <QFutureWatcher>
30 #include <Qt3DRender/QGeometry>
31 #include <Qt3DRender/QBuffer>
32 #include <Qt3DRender/QMaterial>
39 class QgsPointCloud3DSymbolHandler
42 QgsPointCloud3DSymbolHandler();
44 virtual ~QgsPointCloud3DSymbolHandler() =
default;
52 float zMinimum()
const {
return mZMin; }
53 float zMaximum()
const {
return mZMax; }
58 QVector<QVector3D> positions;
59 QVector<float> parameter;
60 QVector<QVector3D> colors;
66 float mZMin = std::numeric_limits<float>::max();
67 float mZMax = std::numeric_limits<float>::lowest();
70 virtual Qt3DRender::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride ) = 0;
81 void calculateNormals(
const std::vector<size_t> &triangles );
94 class QgsSingleColorPointCloud3DSymbolHandler :
public QgsPointCloud3DSymbolHandler
97 QgsSingleColorPointCloud3DSymbolHandler();
104 Qt3DRender::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
107 class QgsColorRampPointCloud3DSymbolHandler :
public QgsPointCloud3DSymbolHandler
110 QgsColorRampPointCloud3DSymbolHandler();
117 Qt3DRender::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
120 class QgsRGBPointCloud3DSymbolHandler :
public QgsPointCloud3DSymbolHandler
123 QgsRGBPointCloud3DSymbolHandler();
130 Qt3DRender::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
133 class QgsClassificationPointCloud3DSymbolHandler :
public QgsPointCloud3DSymbolHandler
136 QgsClassificationPointCloud3DSymbolHandler();
143 Qt3DRender::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
147 class QgsPointCloud3DGeometry:
public Qt3DRender::QGeometry
152 QgsPointCloud3DGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride );
155 virtual void makeVertexBuffer(
const QgsPointCloud3DSymbolHandler::PointData &data ) = 0;
157 Qt3DRender::QAttribute *mPositionAttribute =
nullptr;
158 Qt3DRender::QAttribute *mParameterAttribute =
nullptr;
159 Qt3DRender::QAttribute *mColorAttribute =
nullptr;
160 Qt3DRender::QAttribute *mTriangleIndexAttribute =
nullptr;
161 Qt3DRender::QAttribute *mNormalsAttribute =
nullptr;
162 Qt3DRender::QBuffer *mVertexBuffer =
nullptr;
163 Qt3DRender::QBuffer *mTriangleBuffer =
nullptr;
164 Qt3DRender::QBuffer *mNormalsBuffer =
nullptr;
165 int mVertexCount = 0;
167 unsigned int mByteStride = 16;
170 class QgsSingleColorPointCloud3DGeometry :
public QgsPointCloud3DGeometry
175 QgsSingleColorPointCloud3DGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride );
178 void makeVertexBuffer(
const QgsPointCloud3DSymbolHandler::PointData &data )
override;
181 class QgsColorRampPointCloud3DGeometry :
public QgsPointCloud3DGeometry
186 QgsColorRampPointCloud3DGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride );
189 void makeVertexBuffer(
const QgsPointCloud3DSymbolHandler::PointData &data )
override;
192 class QgsRGBPointCloud3DGeometry :
public QgsPointCloud3DGeometry
197 QgsRGBPointCloud3DGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride );
199 void makeVertexBuffer(
const QgsPointCloud3DSymbolHandler::PointData &data )
override;
205 #endif // QGSPOINTCLOUD3DSYMBOL_P_H