QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
qgselevationshadingrenderer.h
Go to the documentation of this file.
1/***************************************************************************
2 qgselevationshadingrenderer.h - QgsElevationShadingRenderer
3
4 ---------------------
5 begin : 4.12.2022
6 copyright : (C) 2022 by Vincent Cloarec
7 email : vcloarec at gmail dot com
8 ***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16#ifndef QGSELEVATIONSHADINGRENDERER_H
17#define QGSELEVATIONSHADINGRENDERER_H
18
19#include "qgis_sip.h"
20#include "qgselevationmap.h"
21#include "qgis.h"
22
23class QImage;
24class QgsElevationMap;
26class QgsMapSettings;
27class QDomDocument;
29class QDomElement;
30
48{
49 public:
51
56 void renderShading( const QgsElevationMap &elevation, QImage &image, const QgsRenderContext &context ) const;
57
59 void setActive( bool active );
60
62 bool isActive() const;
63
65 void setActiveEyeDomeLighting( bool active );
66
68 bool isActiveEyeDomeLighting() const;
69
75 double eyeDomeLightingStrength() const;
76
82 void setEyeDomeLightingStrength( double strength );
83
90 double eyeDomeLightingDistance() const;
91
98 void setEyeDomeLightingDistance( double distance );
99
105 Qgis::RenderUnit eyeDomeLightingDistanceUnit() const;
106
112 void setEyeDomeLightingDistanceUnit( Qgis::RenderUnit unit );
113
115 void setActiveHillshading( bool active );
116
118 bool isActiveHillshading() const;
119
125 double hillshadingZFactor() const;
126
132 void setHillshadingZFactor( double zFactor );
133
139 bool isHillshadingMultidirectional() const;
140
146 void setHillshadingMultidirectional( bool multiDirectional );
147
153 double lightAltitude() const;
154
160 void setLightAltitude( double lightAltitude );
161
167 double lightAzimuth() const;
168
174 void setLightAzimuth( double lightAzimuth );
175
177 void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const;
178
180 void readXml( const QDomElement &element, const QgsReadWriteContext &context );
181
187 Qgis::ElevationMapCombineMethod combinedElevationMethod() const;
188
194 void setCombinedElevationMethod( Qgis::ElevationMapCombineMethod method );
195
196 private:
197 bool mIsActive = false;
198
200
201 bool mRenderEdl = true;
202 double mEyeDomeLightingStrength = 1000.0;
203 double mEyeDomeLightingDistance = 0.5;
204 Qgis::RenderUnit mEyeDomeLightingDistanceUnit = Qgis::RenderUnit::Millimeters;
205
206 bool mRenderHillshading = false;
207 double mLightAltitude = 45.0;
208 double mLightAzimuth = 315.0;
209 double mHillshadingZFactor = 1.0;
210 bool mHillshadingMultiDir = false;
211
212 void renderEdl( const QgsElevationMap &elevation, QImage &image, const QgsRenderContext &context ) const;
213 void renderHillshading( const QgsElevationMap &elevation, QImage &image, const QgsRenderContext &context ) const;
214};
215
216#endif // QGSELEVATIONSHADINGRENDERER_H
ElevationMapCombineMethod
Methods used to select the elevation when two elevation maps are combined.
Definition: qgis.h:4026
@ HighestElevation
Keep the highest elevation if it is not null.
RenderUnit
Rendering size units.
Definition: qgis.h:4255
@ Millimeters
Millimeters.
Stores digital elevation model in a raster image which may get updated as a part of map layer renderi...
This class can render elevation shading on an image with different methods (eye dome lighting,...
The QgsMapSettings class contains configuration for rendering of the map.
The class is used as a container of context for various read/write operations on other objects.
Contains information about the context of a rendering operation.