QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
qgsrasterlayerelevationproperties.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsrasterlayerelevationproperties.h
3 ---------------
4 begin : February 2022
5 copyright : (C) 2022 by Nyall Dawson
6 email : nyall dot dawson dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18
19#ifndef QGSRASTERLAYERELEVATIONPROPERTIES_H
20#define QGSRASTERLAYERELEVATIONPROPERTIES_H
21
22#include "qgis_core.h"
23#include "qgis_sip.h"
25#include "qgslinesymbol.h"
26
27class QgsRasterLayer;
28
37{
38
39 Q_OBJECT
40
41 public:
42
48
49 bool hasElevation() const override;
50 QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) override;
51 bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) override;
53 QString htmlSummary() const override;
54 bool isVisibleInZRange( const QgsDoubleRange &range ) const override;
55 QgsDoubleRange calculateZRange( QgsMapLayer *layer ) const override;
56 bool showByDefaultInElevationProfilePlots() const override;
57
63 bool isEnabled() const { return mEnabled; }
64
70 void setEnabled( bool enabled );
71
77 int bandNumber() const { return mBandNumber; }
78
84 void setBandNumber( int band );
85
91 QgsLineSymbol *profileLineSymbol() const;
92
100 void setProfileLineSymbol( QgsLineSymbol *symbol SIP_TRANSFER );
101
107 QgsFillSymbol *profileFillSymbol() const;
108
116 void setProfileFillSymbol( QgsFillSymbol *symbol SIP_TRANSFER );
117
123 Qgis::ProfileSurfaceSymbology profileSymbology() const { return mSymbology; }
124
130 void setProfileSymbology( Qgis::ProfileSurfaceSymbology symbology );
131
142 double elevationLimit() const;
143
154 void setElevationLimit( double limit );
155
171 static bool layerLooksLikeDem( QgsRasterLayer *layer );
172
173 private:
174
175 void setDefaultProfileLineSymbol( const QColor &color );
176 void setDefaultProfileFillSymbol( const QColor &color );
177
178 bool mEnabled = false;
179 std::unique_ptr< QgsLineSymbol > mProfileLineSymbol;
180 std::unique_ptr< QgsFillSymbol > mProfileFillSymbol;
182 double mElevationLimit = std::numeric_limits< double >::quiet_NaN();
183 int mBandNumber = 1;
184
185};
186
187#endif // QGSRASTERLAYERELEVATIONPROPERTIES_H
ProfileSurfaceSymbology
Surface symbology type for elevation profile plots.
Definition qgis.h:2823
@ Line
The elevation surface will be rendered using a line symbol.
QgsRange which stores a range of double values.
Definition qgsrange.h:203
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
A line symbol type, for rendering LineString and MultiLineString geometries.
Base class for storage of map layer elevation properties.
virtual QgsMapLayerElevationProperties * clone() const =0
Creates a clone of the properties.
virtual QDomElement writeXml(QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context)=0
Writes the properties to a DOM element, to be used later with readXml().
virtual bool readXml(const QDomElement &element, const QgsReadWriteContext &context)=0
Reads the elevation properties from a DOM element previously written by writeXml().
virtual bool hasElevation() const
Returns true if the layer has an elevation or z component.
Base class for all map layer types.
Definition qgsmaplayer.h:74
Raster layer specific subclass of QgsMapLayerElevationProperties.
Qgis::ProfileSurfaceSymbology profileSymbology() const
Returns the symbology option used to render the raster profile in elevation profile plots.
int bandNumber() const
Returns the band number from which the elevation should be taken.
Represents a raster layer.
The class is used as a container of context for various read/write operations on other objects.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_FACTORY
Definition qgis_sip.h:76