QGIS API Documentation 4.1.0-Master (01362494303)
Loading...
Searching...
No Matches
qgsannotationlayer3drenderer.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsannotationlayer3drenderer.h
3 --------------------------------------
4 Date : September 2025
5 Copyright : (C) 2025 by Nyall Dawson
6 Email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSANNOTATIONLAYER3DRENDERER_H
17#define QGSANNOTATIONLAYER3DRENDERER_H
18
19#include "qgis_3d.h"
20#include "qgis_sip.h"
23#include "qgsmaplayerref.h"
24#include "qgstextformat.h"
25
27
28#ifdef SIP_RUN
29// this is needed for the "convert to subclass" code below to compile
30% ModuleHeaderCode
32 % End
33#endif
34
45{
46 public:
48
50 QgsAbstract3DRenderer *createRenderer( QDomElement &elem, const QgsReadWriteContext &context ) override SIP_FACTORY;
51};
52
60{
61 public:
63
70
77
78 QString type() const override;
80 Qt3DCore::QEntity *createEntity( Qgs3DMapSettings *map ) const override SIP_SKIP;
81
82 void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override;
83 void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
84 void resolveReferences( const QgsProject &project ) override;
85
91 Qgis::AltitudeClamping altitudeClamping() const { return mAltClamping; }
92
98 void setAltitudeClamping( Qgis::AltitudeClamping clamping ) { mAltClamping = clamping; }
99
105 double zOffset() const { return mZOffset; }
106
112 void setZOffset( double offset ) { mZOffset = offset; }
113
119 bool showCalloutLines() const;
120
126 void setShowCalloutLines( bool show );
127
128 // TODO -- consider exposing via QgsSimpleLineMaterialSettings, for now, for testing only
129
136 SIP_SKIP void setCalloutLineColor( const QColor &color );
137
144 SIP_SKIP QColor calloutLineColor() const;
145
152 SIP_SKIP void setCalloutLineWidth( double width );
153
160 SIP_SKIP double calloutLineWidth() const;
161
167 QgsTextFormat textFormat() const;
168
174 void setTextFormat( const QgsTextFormat &format );
175
176 private:
177#ifdef SIP_RUN
179#endif
180
181 static constexpr double DEFAULT_Z_OFFSET = 50;
182
183 QgsMapLayerRef mLayerRef;
185 double mZOffset = DEFAULT_Z_OFFSET;
186 bool mShowCalloutLines = true;
187 QColor mCalloutLineColor { 0, 0, 0 };
188 double mCalloutLineWidth = 2;
189 QgsTextFormat mTextFormat;
190};
191
192#endif // QGSANNOTATIONLAYER3DRENDERER_H
AltitudeClamping
Altitude clamping.
Definition qgis.h:4166
@ Relative
Elevation is relative to terrain height (final elevation = terrain elevation + feature elevation).
Definition qgis.h:4168
Definition of the world.
virtual QgsAbstract3DRenderer * createRenderer(QDomElement &elem, const QgsReadWriteContext &context)=0
Returns new instance of the renderer given the DOM element.
Qgs3DRendererAbstractMetadata(const QString &type)
Constructor of the base class.
QString type() const
Returns unique identifier of the 3D renderer class.
Base class for all renderers that participate in 3D views.
QgsAbstract3DRenderer()=default
3D renderers for annotation layers.
void setAltitudeClamping(Qgis::AltitudeClamping clamping)
Sets the altitude clamping method, which determines the vertical position of annotations.
Qt3DCore::QEntity * createEntity(Qgs3DMapSettings *map) const override
Returns a 3D entity that will be used to show renderer's data in 3D scene.
void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const override
Writes renderer's properties to given XML element.
void readXml(const QDomElement &elem, const QgsReadWriteContext &context) override
Reads renderer's properties from given XML element.
Qgis::AltitudeClamping altitudeClamping() const
Returns the altitude clamping method, which determines the vertical position of annotations.
void resolveReferences(const QgsProject &project) override
Resolves references to other objects - second phase of loading - after readXml().
QgsAnnotationLayer * layer() const
Returns the annotation layer associated with the renderer.
void setZOffset(double offset)
Sets the z offset, which is a fixed offset amount which will be added to z values for the annotations...
double zOffset() const
Returns the z offset, which is a fixed offset amount which should be added to z values for the annota...
void setLayer(QgsAnnotationLayer *layer)
Sets the annotation layer associated with the renderer.
QgsAnnotationLayer3DRenderer * clone() const override
Returns a cloned instance.
Represents a map layer containing a set of georeferenced annotations, e.g.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:114
A container for the context for various read/write operations on objects.
Container for all settings relating to text rendering.
#define SIP_SKIP
Definition qgis_sip.h:133
#define SIP_FACTORY
Definition qgis_sip.h:83
_LayerRef< QgsMapLayer > QgsMapLayerRef