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;
125 struct PictureBillboards
128 QVector< QVector3D > positions;
129 QVector< QSizeF > sizes;
132 QVector< PictureBillboards > mPictureBillboards;
134 QVector< QgsLineString > mCalloutLines;
135 QImage mBillboardAtlas;
136 QImage mTextBillboardAtlas;
137 double mZMin = std::numeric_limits< double >::max();
138 double mZMax = std::numeric_limits< double >::lowest();
152class QgsAnnotationLayerChunkedEntity :
public QgsAbstractFeatureBasedChunkedEntity
157 explicit QgsAnnotationLayerChunkedEntity(
158 Qgs3DMapSettings *map,
159 QgsAnnotationLayer *layer,
163 const QColor &calloutLineColor,
164 double calloutLineWidth,
165 const QgsTextFormat &textFormat,
169 ~QgsAnnotationLayerChunkedEntity()
override;
171 QList<QgsRayCastHit> rayIntersection(
const QgsRay3D &ray,
const QgsRayCastContext &context )
const override;
174 bool applyTerrainOffset()
const override;
AltitudeClamping
Altitude clamping.
@ Relative
Elevation is relative to terrain height (final elevation = terrain elevation + feature elevation).
BillboardScaleMode
3D billboard scaling modes.
@ ViewIndependent
Billboard has a fixed pixel size on the screen, regardless of the camera distance.
Abstract base class for annotation items which are drawn with QgsAnnotationLayers.
Represents a map layer containing a set of georeferenced annotations, e.g.