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>
31#include <Qt3DRender/QMaterial>
39class 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<float> pointSizes;
61 QVector<QVector3D> colors;
67 float mZMin = std::numeric_limits<float>::max();
68 float mZMax = std::numeric_limits<float>::lowest();
72#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
73 virtual Qt3DRender::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride ) = 0;
75 virtual Qt3DCore::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride ) = 0;
87 void calculateNormals(
const std::vector<size_t> &triangles );
100class QgsSingleColorPointCloud3DSymbolHandler :
public QgsPointCloud3DSymbolHandler
103 QgsSingleColorPointCloud3DSymbolHandler();
110#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
111 Qt3DRender::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
113 Qt3DCore::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
117class QgsColorRampPointCloud3DSymbolHandler :
public QgsPointCloud3DSymbolHandler
120 QgsColorRampPointCloud3DSymbolHandler();
127#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
128 Qt3DRender::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
130 Qt3DCore::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
134class QgsRGBPointCloud3DSymbolHandler :
public QgsPointCloud3DSymbolHandler
137 QgsRGBPointCloud3DSymbolHandler();
144#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
145 Qt3DRender::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
147 Qt3DCore::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
151class QgsClassificationPointCloud3DSymbolHandler :
public QgsPointCloud3DSymbolHandler
154 QgsClassificationPointCloud3DSymbolHandler();
161#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
162 Qt3DRender::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
164 Qt3DCore::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
168#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
169class QgsPointCloud3DGeometry:
public Qt3DRender::QGeometry
171class QgsPointCloud3DGeometry:
public Qt3DCore::QGeometry
177 QgsPointCloud3DGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride );
180 virtual void makeVertexBuffer(
const QgsPointCloud3DSymbolHandler::PointData &data ) = 0;
182#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
183 Qt3DRender::QAttribute *mPositionAttribute =
nullptr;
184 Qt3DRender::QAttribute *mParameterAttribute =
nullptr;
185 Qt3DRender::QAttribute *mPointSizeAttribute =
nullptr;
186 Qt3DRender::QAttribute *mColorAttribute =
nullptr;
187 Qt3DRender::QAttribute *mTriangleIndexAttribute =
nullptr;
188 Qt3DRender::QAttribute *mNormalsAttribute =
nullptr;
189 Qt3DRender::QBuffer *mVertexBuffer =
nullptr;
190 Qt3DRender::QBuffer *mTriangleBuffer =
nullptr;
191 Qt3DRender::QBuffer *mNormalsBuffer =
nullptr;
193 Qt3DCore::QAttribute *mPositionAttribute =
nullptr;
194 Qt3DCore::QAttribute *mParameterAttribute =
nullptr;
195 Qt3DCore::QAttribute *mPointSizeAttribute =
nullptr;
196 Qt3DCore::QAttribute *mColorAttribute =
nullptr;
197 Qt3DCore::QAttribute *mTriangleIndexAttribute =
nullptr;
198 Qt3DCore::QAttribute *mNormalsAttribute =
nullptr;
199 Qt3DCore::QBuffer *mVertexBuffer =
nullptr;
200 Qt3DCore::QBuffer *mTriangleBuffer =
nullptr;
201 Qt3DCore::QBuffer *mNormalsBuffer =
nullptr;
203 int mVertexCount = 0;
205 unsigned int mByteStride = 16;
208class QgsSingleColorPointCloud3DGeometry :
public QgsPointCloud3DGeometry
213 QgsSingleColorPointCloud3DGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride );
216 void makeVertexBuffer(
const QgsPointCloud3DSymbolHandler::PointData &data )
override;
219class QgsColorRampPointCloud3DGeometry :
public QgsPointCloud3DGeometry
224 QgsColorRampPointCloud3DGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride );
227 void makeVertexBuffer(
const QgsPointCloud3DSymbolHandler::PointData &data )
override;
230class QgsRGBPointCloud3DGeometry :
public QgsPointCloud3DGeometry
235 QgsRGBPointCloud3DGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride );
237 void makeVertexBuffer(
const QgsPointCloud3DSymbolHandler::PointData &data )
override;
240class QgsClassificationPointCloud3DGeometry :
public QgsPointCloud3DGeometry
245 QgsClassificationPointCloud3DGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride );
248 void makeVertexBuffer(
const QgsPointCloud3DSymbolHandler::PointData &data )
override;
Represents a indexed point cloud node in octree.
Encapsulates the render context for a 3D point cloud rendering operation.
Represents a indexed point clouds data in octree.
Point cloud data request.