16#ifndef QGSANNOTATIONLAYERCHUNKLOADER_P_H
17#define QGSANNOTATIONLAYERCHUNKLOADER_P_H
48#include <QFutureWatcher>
57class QgsAnnotationLayerChunkLoaderFactory :
public QgsQuadtreeChunkLoaderFactory
63 QgsAnnotationLayerChunkLoaderFactory(
64 const Qgs3DRenderContext &context,
65 QgsAnnotationLayer *layer,
70 const QColor &calloutLineColor,
71 double calloutLineWidth,
72 const QgsTextFormat &textFormat,
78 QgsChunkLoader *createChunkLoader( QgsChunkNode *node )
const override;
80 Qgs3DRenderContext mRenderContext;
81 QgsAnnotationLayer *mLayer =
nullptr;
85 bool mShowCallouts =
false;
86 QColor mCalloutLineColor;
87 double mCalloutLineWidth = 2;
88 QgsTextFormat mTextFormat;
99class QgsAnnotationLayerChunkLoader :
public QgsChunkLoader
105 QgsAnnotationLayerChunkLoader(
const QgsAnnotationLayerChunkLoaderFactory *factory, QgsChunkNode *node );
106 ~QgsAnnotationLayerChunkLoader()
override;
108 void start()
override;
109 void cancel()
override;
110 Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent )
override;
113 const QgsAnnotationLayerChunkLoaderFactory *mFactory =
nullptr;
114 Qgs3DRenderContext mRenderContext;
115 bool mCanceled =
false;
116 QFutureWatcher<void> *mFutureWatcher =
nullptr;
118 QgsVector3D mChunkOrigin;
120 std::vector< std::unique_ptr< QgsAnnotationItem > > mItemsToRender;
122 QVector< QgsBillboardGeometry::BillboardAtlasData > mBillboardPositions;
123 QVector< QgsBillboardGeometry::BillboardAtlasData > mTextBillboardPositions;
124 QVector< QgsLineString > mCalloutLines;
125 QImage mBillboardAtlas;
126 QImage mTextBillboardAtlas;
127 double mZMin = std::numeric_limits< double >::max();
128 double mZMax = std::numeric_limits< double >::lowest();
142class QgsAnnotationLayerChunkedEntity :
public QgsChunkedEntity
147 explicit QgsAnnotationLayerChunkedEntity(
148 Qgs3DMapSettings *map,
149 QgsAnnotationLayer *layer,
153 const QColor &calloutLineColor,
154 double calloutLineWidth,
155 const QgsTextFormat &textFormat,
159 ~QgsAnnotationLayerChunkedEntity()
override;
162 void onTerrainElevationOffsetChanged();
165 Qt3DCore::QTransform *mTransform =
nullptr;
167 bool applyTerrainOffset()
const;
169 friend class TestQgsChunkedEntity;
AltitudeClamping
Altitude clamping.
@ Relative
Elevation is relative to terrain height (final elevation = terrain elevation + feature elevation).
Abstract base class for annotation items which are drawn with QgsAnnotationLayers.
Represents a map layer containing a set of georeferenced annotations, e.g.