16#ifndef QGSANNOTATIONLAYERCHUNKLOADER_P_H
17#define QGSANNOTATIONLAYERCHUNKLOADER_P_H
59#include <QFutureWatcher>
68class QgsAnnotationLayerChunkLoader :
public QgsQuadtreeChunkLoader
74 QgsAnnotationLayerChunkLoader(
75 const Qgs3DRenderContext &context,
76 QgsAnnotationLayer *layer,
81 const QColor &calloutLineColor,
82 double calloutLineWidth,
83 const QgsTextFormat &textFormat,
88 QFuture<QgsChunkLoaderResult> loadChunk( QgsChunkNode *node )
override;
90 Qgs3DRenderContext mRenderContext;
91 QgsAnnotationLayer *mLayer =
nullptr;
99 bool mShowCallouts =
false;
100 QColor mCalloutLineColor;
101 double mCalloutLineWidth = 2;
102 QgsTextFormat mTextFormat;
110 struct PictureBillboards
113 QVector< QVector3D > positions;
114 QVector< QSizeF > sizes;
121 QgsChunkNode *node =
nullptr;
123 QgsVector3D chunkOrigin;
124 Qgs3DRenderContext renderContext;
125 QVector< QgsBillboardGeometry::BillboardAtlasData > billboardPositions;
126 QVector< QgsBillboardGeometry::BillboardAtlasData > textBillboardPositions;
127 QImage billboardAtlas;
128 QImage textBillboardAtlas;
129 QVector< PictureBillboards > pictureBillboards;
130 QVector< QgsLineString > calloutLines;
131 double zMin = std::numeric_limits< double >::max();
132 double zMax = std::numeric_limits< double >::lowest();
135 static void loadChunkInWorker(
136 QPromise<ChunkData> &promise,
138 const QgsRectangle &rect,
139 const QgsCoordinateTransform &layerToMapTransform,
140 const QString &layerName,
141 const std::vector< std::unique_ptr< QgsAnnotationItem > > &itemsToRender,
142 const QgsVector3D &chunkOrigin,
143 const Qgs3DRenderContext &renderCtx,
144 const LoaderData &data
147 Qt3DCore::QEntity *createEntity(
const ChunkData &chunkData, Qt3DCore::QEntity *parent );
160class QgsAnnotationLayerChunkedEntity :
public QgsAbstractFeatureBasedChunkedEntity
165 explicit QgsAnnotationLayerChunkedEntity(
166 Qgs3DMapSettings *map,
167 QgsAnnotationLayer *layer,
171 const QColor &calloutLineColor,
172 double calloutLineWidth,
173 const QgsTextFormat &textFormat,
177 ~QgsAnnotationLayerChunkedEntity()
override;
179 QList<QgsRayCastHit> rayIntersection(
const QgsRay3D &ray,
const QgsRayCastContext &context )
const override;
182 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.