16#ifndef QGSVECTORLAYERCHUNKLOADER_P_H
17#define QGSVECTORLAYERCHUNKLOADER_P_H
40class QgsFeature3DHandler;
47#include <QFutureWatcher>
57class QgsVectorLayerChunkLoaderFactory :
public QgsQuadtreeChunkLoaderFactory
63 QgsVectorLayerChunkLoaderFactory(
const Qgs3DRenderContext &context, QgsVectorLayer *vl, QgsAbstract3DSymbol *symbol,
double zMin,
double zMax,
int maxFeatures );
66 QgsChunkLoader *createChunkLoader( QgsChunkNode *node )
const override;
67 bool canCreateChildren( QgsChunkNode *node )
override;
68 QVector<QgsChunkNode *> createChildren( QgsChunkNode *node )
const override;
70 Qgs3DRenderContext mRenderContext;
71 QgsVectorLayer *mLayer;
72 std::unique_ptr<QgsAbstract3DSymbol> mSymbol;
74 mutable QHash< QString, bool > mNodesAreLeafs;
87class QgsVectorLayerChunkLoader :
public QgsChunkLoader
93 QgsVectorLayerChunkLoader(
const QgsVectorLayerChunkLoaderFactory *factory, QgsChunkNode *node );
94 ~QgsVectorLayerChunkLoader()
override;
96 void start()
override;
97 void cancel()
override;
98 Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent )
override;
101 const QgsVectorLayerChunkLoaderFactory *mFactory;
102 std::unique_ptr<QgsFeature3DHandler> mHandler;
103 Qgs3DRenderContext mRenderContext;
104 std::unique_ptr<QgsVectorLayerFeatureSource> mSource;
105 bool mCanceled =
false;
106 QFutureWatcher<void> *mFutureWatcher =
nullptr;
108 bool mNodeIsLeaf =
false;
122class QgsVectorLayerChunkedEntity :
public QgsChunkedEntity
127 explicit QgsVectorLayerChunkedEntity( Qgs3DMapSettings *map, QgsVectorLayer *vl,
double zMin,
double zMax,
const QgsVectorLayer3DTilingSettings &tilingSettings, QgsAbstract3DSymbol *symbol );
129 QList<QgsRayCastHit> rayIntersection(
const QgsRay3D &ray,
const QgsRayCastContext &context )
const override;
131 ~QgsVectorLayerChunkedEntity()
override;
133 void onTerrainElevationOffsetChanged();
136 friend class QgsRuleBasedChunkedEntity;
138 static QList<QgsRayCastHit> rayIntersection(
const QList<QgsChunkNode *> &activeNodes,
const QMatrix4x4 &transformMatrix,
const QgsRay3D &ray,
const QgsRayCastContext &context,
const QgsVector3D &origin );
140 Qt3DCore::QTransform *mTransform =
nullptr;
142 bool applyTerrainOffset()
const;
144 friend class TestQgsChunkedEntity;
Abstract base class for 3D symbols that are used by VectorLayer3DRenderer objects.
Defines configuration of how a vector layer gets tiled for 3D rendering.
Partial snapshot of vector layer's state (only the members necessary for access to features).
Represents a vector layer which manages a vector based dataset.