16#ifndef QGSPOINTCLOUD3DSYMBOL_P_H
17#define QGSPOINTCLOUD3DSYMBOL_P_H
23#include <QFutureWatcher>
24#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
25#include <Qt3DRender/QGeometry>
26#include <Qt3DRender/QBuffer>
28#include <Qt3DCore/QGeometry>
29#include <Qt3DCore/QBuffer>
38class QgsPointCloud3DSymbolHandler
41 QgsPointCloud3DSymbolHandler();
43 virtual ~QgsPointCloud3DSymbolHandler() =
default;
53 float zMinimum()
const {
return mZMin; }
54 float zMaximum()
const {
return mZMax; }
60 QVector<QVector3D> positions;
61 QVector<float> parameter;
62 QVector<float> pointSizes;
63 QVector<QVector3D> colors;
69 float mZMin = std::numeric_limits<float>::max();
70 float mZMax = std::numeric_limits<float>::lowest();
74#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
75 virtual Qt3DRender::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride ) = 0;
77 virtual Qt3DCore::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride ) = 0;
89 void calculateNormals(
const std::vector<size_t> &triangles );
102class QgsSingleColorPointCloud3DSymbolHandler :
public QgsPointCloud3DSymbolHandler
105 QgsSingleColorPointCloud3DSymbolHandler();
112#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
113 Qt3DRender::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
115 Qt3DCore::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
119class QgsColorRampPointCloud3DSymbolHandler :
public QgsPointCloud3DSymbolHandler
122 QgsColorRampPointCloud3DSymbolHandler();
129#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
130 Qt3DRender::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
132 Qt3DCore::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
136class QgsRGBPointCloud3DSymbolHandler :
public QgsPointCloud3DSymbolHandler
139 QgsRGBPointCloud3DSymbolHandler();
146#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
147 Qt3DRender::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
149 Qt3DCore::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
153class QgsClassificationPointCloud3DSymbolHandler :
public QgsPointCloud3DSymbolHandler
156 QgsClassificationPointCloud3DSymbolHandler();
163#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
164 Qt3DRender::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
166 Qt3DCore::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
170#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
171class QgsPointCloud3DGeometry:
public Qt3DRender::QGeometry
173class QgsPointCloud3DGeometry:
public Qt3DCore::QGeometry
179 QgsPointCloud3DGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride );
182 virtual void makeVertexBuffer(
const QgsPointCloud3DSymbolHandler::PointData &data ) = 0;
184#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
185 Qt3DRender::QAttribute *mPositionAttribute =
nullptr;
186 Qt3DRender::QAttribute *mParameterAttribute =
nullptr;
187 Qt3DRender::QAttribute *mPointSizeAttribute =
nullptr;
188 Qt3DRender::QAttribute *mColorAttribute =
nullptr;
189 Qt3DRender::QAttribute *mTriangleIndexAttribute =
nullptr;
190 Qt3DRender::QAttribute *mNormalsAttribute =
nullptr;
191 Qt3DRender::QBuffer *mVertexBuffer =
nullptr;
192 Qt3DRender::QBuffer *mTriangleBuffer =
nullptr;
193 Qt3DRender::QBuffer *mNormalsBuffer =
nullptr;
195 Qt3DCore::QAttribute *mPositionAttribute =
nullptr;
196 Qt3DCore::QAttribute *mParameterAttribute =
nullptr;
197 Qt3DCore::QAttribute *mPointSizeAttribute =
nullptr;
198 Qt3DCore::QAttribute *mColorAttribute =
nullptr;
199 Qt3DCore::QAttribute *mTriangleIndexAttribute =
nullptr;
200 Qt3DCore::QAttribute *mNormalsAttribute =
nullptr;
201 Qt3DCore::QBuffer *mVertexBuffer =
nullptr;
202 Qt3DCore::QBuffer *mTriangleBuffer =
nullptr;
203 Qt3DCore::QBuffer *mNormalsBuffer =
nullptr;
205 int mVertexCount = 0;
207 unsigned int mByteStride = 16;
210class QgsSingleColorPointCloud3DGeometry :
public QgsPointCloud3DGeometry
215 QgsSingleColorPointCloud3DGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride );
218 void makeVertexBuffer(
const QgsPointCloud3DSymbolHandler::PointData &data )
override;
221class QgsColorRampPointCloud3DGeometry :
public QgsPointCloud3DGeometry
226 QgsColorRampPointCloud3DGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride );
229 void makeVertexBuffer(
const QgsPointCloud3DSymbolHandler::PointData &data )
override;
232class QgsRGBPointCloud3DGeometry :
public QgsPointCloud3DGeometry
237 QgsRGBPointCloud3DGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride );
239 void makeVertexBuffer(
const QgsPointCloud3DSymbolHandler::PointData &data )
override;
242class QgsClassificationPointCloud3DGeometry :
public QgsPointCloud3DGeometry
247 QgsClassificationPointCloud3DGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride );
250 void makeVertexBuffer(
const QgsPointCloud3DSymbolHandler::PointData &data )
override;
Represents a indexed point cloud node in octree.
A 3-dimensional box composed of x, y, z coordinates.
Encapsulates the render context for a 3D point cloud rendering operation.
Represents a indexed point clouds data in octree.
Point cloud data request.
Class for storage of 3D vectors similar to QVector3D, with the difference that it uses double precisi...