QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
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
35{
36
37 Q_OBJECT
38
39 public:
40
46
47 bool hasElevation() const override;
48 QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) override;
49 bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) override;
51 QString htmlSummary() const override;
52 bool isVisibleInZRange( const QgsDoubleRange &range ) const override;
53 QgsDoubleRange calculateZRange( QgsMapLayer *layer ) const override;
54 bool showByDefaultInElevationProfilePlots() const override;
55
61 bool isEnabled() const { return mEnabled; }
62
68 void setEnabled( bool enabled );
69
75 int bandNumber() const { return mBandNumber; }
76
82 void setBandNumber( int band );
83
89 QgsLineSymbol *profileLineSymbol() const;
90
98 void setProfileLineSymbol( QgsLineSymbol *symbol SIP_TRANSFER );
99
105 QgsFillSymbol *profileFillSymbol() const;
106
114 void setProfileFillSymbol( QgsFillSymbol *symbol SIP_TRANSFER );
115
121 Qgis::ProfileSurfaceSymbology profileSymbology() const { return mSymbology; }
122
128 void setProfileSymbology( Qgis::ProfileSurfaceSymbology symbology );
129
130 private:
131
132 void setDefaultProfileLineSymbol( const QColor &color );
133 void setDefaultProfileFillSymbol( const QColor &color );
134
135 bool mEnabled = false;
136 std::unique_ptr< QgsLineSymbol > mProfileLineSymbol;
137 std::unique_ptr< QgsFillSymbol > mProfileFillSymbol;
139 int mBandNumber = 1;
140
141};
142
143#endif // QGSRASTERLAYERELEVATIONPROPERTIES_H
ProfileSurfaceSymbology
Surface symbology type for elevation profile plots.
Definition: qgis.h:2019
@ 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.
Definition: qgsfillsymbol.h:30
A line symbol type, for rendering LineString and MultiLineString geometries.
Definition: qgslinesymbol.h:30
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:73
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.
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