16#ifndef QGSPOINTCLOUDLAYERCHUNKLOADER_P_H
17#define QGSPOINTCLOUDLAYERCHUNKLOADER_P_H
39#include <QFutureWatcher>
41#include <Qt3DCore/QBuffer>
42#include <Qt3DCore/QGeometry>
53class QgsPointCloudLayerChunkLoaderFactory :
public QgsChunkLoaderFactory
62 QgsPointCloudLayerChunkLoaderFactory(
63 const Qgs3DRenderContext &context,
const QgsCoordinateTransform &coordinateTransform, QgsPointCloudIndex pc, QgsPointCloud3DSymbol *symbol,
double zValueScale,
double zValueOffset,
int pointBudget
67 QgsChunkLoader *createChunkLoader( QgsChunkNode *node )
const override;
68 QgsChunkNode *createRootNode()
const override;
69 QVector<QgsChunkNode *> createChildren( QgsChunkNode *node )
const override;
70 int primitivesCount( QgsChunkNode *node )
const override;
72 bool canCreateChildren( QgsChunkNode *node )
override;
73 void prepareChildren( QgsChunkNode *node )
override;
76 void fetchHierarchyForNode(
const QgsPointCloudNodeId &nodeId, QgsChunkNode *origNode );
78 Qgs3DRenderContext mRenderContext;
79 QgsCoordinateTransform mCoordinateTransform;
80 QgsPointCloudIndex mPointCloudIndex;
81 std::unique_ptr<QgsPointCloud3DSymbol> mSymbol;
82 double mZValueScale = 1.0;
83 double mZValueOffset = 0;
84 int mPointBudget = 1000000;
85 bool mTriangulate =
false;
87 QSet<QgsPointCloudNodeId> mPendingHierarchyFetches;
88 QSet<QgsPointCloudNodeId> mFutureHierarchyFetches;
100class QgsPointCloudLayerChunkLoader :
public QgsChunkLoader
109 QgsPointCloudLayerChunkLoader(
110 const QgsPointCloudLayerChunkLoaderFactory *factory, QgsChunkNode *node, std::unique_ptr<QgsPointCloud3DSymbol> symbol,
const QgsCoordinateTransform &coordinateTransform,
double zValueScale,
double zValueOffset
112 ~QgsPointCloudLayerChunkLoader()
override;
114 void start()
override;
115 void cancel()
override;
116 Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent )
override;
119 const QgsPointCloudLayerChunkLoaderFactory *mFactory;
120 std::unique_ptr<QgsPointCloud3DSymbolHandler> mHandler;
121 QgsPointCloud3DRenderContext mContext;
122 QFutureWatcher<void> *mFutureWatcher =
nullptr;
136class QgsPointCloudLayerChunkedEntity :
public QgsChunkedEntity
140 explicit QgsPointCloudLayerChunkedEntity(
141 Qgs3DMapSettings *map,
142 QgsPointCloudLayer *pcl,
143 const int indexPosition,
144 const QgsCoordinateTransform &coordinateTransform,
145 QgsPointCloud3DSymbol *symbol,
146 float maxScreenError,
147 bool showBoundingBoxes,
153 QList<QgsRayCastHit> rayIntersection(
const QgsRay3D &ray,
const QgsRayCastContext &context )
const override;
155 ~QgsPointCloudLayerChunkedEntity()
override;
168 static QgsPointCloudIndex resolveIndex(
const QgsPointCloudLayer *pcl,
int indexPosition );
170 QgsPointCloudLayer *mLayer =
nullptr;
171 std::unique_ptr<QgsChunkUpdaterFactory> mChunkUpdaterFactory;