QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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
QgsMapLayerElevationProperties::clone
virtual QgsMapLayerElevationProperties * clone() const =0
Creates a clone of the properties.
QgsRasterLayerElevationProperties::bandNumber
int bandNumber() const
Returns the band number from which the elevation should be taken.
Definition: qgsrasterlayerelevationproperties.h:75
QgsMapLayerElevationProperties::readXml
virtual bool readXml(const QDomElement &element, const QgsReadWriteContext &context)=0
Reads the elevation properties from a DOM element previously written by writeXml().
QgsRasterLayerElevationProperties::profileSymbology
Qgis::ProfileSurfaceSymbology profileSymbology() const
Returns the symbology option used to render the raster profile in elevation profile plots.
Definition: qgsrasterlayerelevationproperties.h:121
QgsReadWriteContext
The class is used as a container of context for various read/write operations on other objects.
Definition: qgsreadwritecontext.h:34
QgsMapLayerElevationProperties
Base class for storage of map layer elevation properties.
Definition: qgsmaplayerelevationproperties.h:41
Qgis::ProfileSurfaceSymbology
ProfileSurfaceSymbology
Surface symbology type for elevation profile plots.
Definition: qgis.h:1849
QgsMapLayerElevationProperties::writeXml
virtual QDomElement writeXml(QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context)=0
Writes the properties to a DOM element, to be used later with readXml().
QgsMapLayerElevationProperties::isVisibleInZRange
virtual bool isVisibleInZRange(const QgsDoubleRange &range) const
Returns true if the layer should be visible and rendered for the specified z range.
Definition: qgsmaplayerelevationproperties.cpp:71
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsMapLayerElevationProperties::calculateZRange
virtual QgsDoubleRange calculateZRange(QgsMapLayer *layer) const
Attempts to calculate the overall elevation or z range for the specified layer, using the settings de...
Definition: qgsmaplayerelevationproperties.cpp:76
Qgis::ProfileSurfaceSymbology::Line
@ Line
The elevation surface will be rendered using a line symbol.
QgsMapLayerElevationProperties::hasElevation
virtual bool hasElevation() const
Returns true if the layer has an elevation or z component.
Definition: qgsmaplayerelevationproperties.cpp:29
QgsMapLayerElevationProperties::htmlSummary
virtual QString htmlSummary() const
Returns a HTML formatted summary of the properties.
Definition: qgsmaplayerelevationproperties.cpp:39
QgsRasterLayerElevationProperties
Raster layer specific subclass of QgsMapLayerElevationProperties.
Definition: qgsrasterlayerelevationproperties.h:34
qgis_sip.h
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsLineSymbol
A line symbol type, for rendering LineString and MultiLineString geometries.
Definition: qgslinesymbol.h:29
QgsDoubleRange
QgsRange which stores a range of double values.
Definition: qgsrange.h:202
QgsMapLayer
Base class for all map layer types. This is the base class for all map layer types (vector,...
Definition: qgsmaplayer.h:72
QgsMapLayerElevationProperties::showByDefaultInElevationProfilePlots
virtual bool showByDefaultInElevationProfilePlots() const
Returns true if the layer should be visible by default in newly created elevation profile plots.
Definition: qgsmaplayerelevationproperties.cpp:81
QgsFillSymbol
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Definition: qgsfillsymbol.h:29
QgsRasterLayerElevationProperties::isEnabled
bool isEnabled() const
Returns true if the elevation properties are enabled, i.e.
Definition: qgsrasterlayerelevationproperties.h:61
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
qgsmaplayerelevationproperties.h
qgslinesymbol.h