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<QVector3D> colors;
66 float mZMin = std::numeric_limits<float>::max();
67 float mZMax = std::numeric_limits<float>::lowest();
71#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
72 virtual Qt3DRender::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride ) = 0;
74 virtual Qt3DCore::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride ) = 0;
86 void calculateNormals(
const std::vector<size_t> &triangles );
99class QgsSingleColorPointCloud3DSymbolHandler :
public QgsPointCloud3DSymbolHandler
102 QgsSingleColorPointCloud3DSymbolHandler();
109#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
110 Qt3DRender::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
112 Qt3DCore::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
116class QgsColorRampPointCloud3DSymbolHandler :
public QgsPointCloud3DSymbolHandler
119 QgsColorRampPointCloud3DSymbolHandler();
126#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
127 Qt3DRender::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
129 Qt3DCore::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
133class QgsRGBPointCloud3DSymbolHandler :
public QgsPointCloud3DSymbolHandler
136 QgsRGBPointCloud3DSymbolHandler();
143#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
144 Qt3DRender::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
146 Qt3DCore::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
150class QgsClassificationPointCloud3DSymbolHandler :
public QgsPointCloud3DSymbolHandler
153 QgsClassificationPointCloud3DSymbolHandler();
160#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
161 Qt3DRender::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
163 Qt3DCore::QGeometry *makeGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride )
override;
167#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
168class QgsPointCloud3DGeometry:
public Qt3DRender::QGeometry
170class QgsPointCloud3DGeometry:
public Qt3DCore::QGeometry
176 QgsPointCloud3DGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride );
179 virtual void makeVertexBuffer(
const QgsPointCloud3DSymbolHandler::PointData &data ) = 0;
181#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
182 Qt3DRender::QAttribute *mPositionAttribute =
nullptr;
183 Qt3DRender::QAttribute *mParameterAttribute =
nullptr;
184 Qt3DRender::QAttribute *mColorAttribute =
nullptr;
185 Qt3DRender::QAttribute *mTriangleIndexAttribute =
nullptr;
186 Qt3DRender::QAttribute *mNormalsAttribute =
nullptr;
187 Qt3DRender::QBuffer *mVertexBuffer =
nullptr;
188 Qt3DRender::QBuffer *mTriangleBuffer =
nullptr;
189 Qt3DRender::QBuffer *mNormalsBuffer =
nullptr;
191 Qt3DCore::QAttribute *mPositionAttribute =
nullptr;
192 Qt3DCore::QAttribute *mParameterAttribute =
nullptr;
193 Qt3DCore::QAttribute *mColorAttribute =
nullptr;
194 Qt3DCore::QAttribute *mTriangleIndexAttribute =
nullptr;
195 Qt3DCore::QAttribute *mNormalsAttribute =
nullptr;
196 Qt3DCore::QBuffer *mVertexBuffer =
nullptr;
197 Qt3DCore::QBuffer *mTriangleBuffer =
nullptr;
198 Qt3DCore::QBuffer *mNormalsBuffer =
nullptr;
200 int mVertexCount = 0;
202 unsigned int mByteStride = 16;
205class QgsSingleColorPointCloud3DGeometry :
public QgsPointCloud3DGeometry
210 QgsSingleColorPointCloud3DGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride );
213 void makeVertexBuffer(
const QgsPointCloud3DSymbolHandler::PointData &data )
override;
216class QgsColorRampPointCloud3DGeometry :
public QgsPointCloud3DGeometry
221 QgsColorRampPointCloud3DGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride );
224 void makeVertexBuffer(
const QgsPointCloud3DSymbolHandler::PointData &data )
override;
227class QgsRGBPointCloud3DGeometry :
public QgsPointCloud3DGeometry
232 QgsRGBPointCloud3DGeometry( Qt3DCore::QNode *parent,
const QgsPointCloud3DSymbolHandler::PointData &data,
unsigned int byteStride );
234 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.
Base class for storing raw data from point cloud nodes.
Represents a indexed point clouds data in octree.
Point cloud data request.