QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
qgsmeshlayerelevationproperties.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmeshlayerelevationproperties.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 QGSMESHLAYERELEVATIONPROPERTIES_H
20#define QGSMESHLAYERELEVATIONPROPERTIES_H
21
22#include "qgis_core.h"
23#include "qgis_sip.h"
25#include "qgis.h"
26
27class QgsLineSymbol;
28class QgsFillSymbol;
29
38{
39
40 Q_OBJECT
41
42 public:
43
49
50 bool hasElevation() const override;
51 QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) override;
52 bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) override;
53 QString htmlSummary() const override;
55 bool isVisibleInZRange( const QgsDoubleRange &range, QgsMapLayer *layer = nullptr ) const override;
56 QgsDoubleRange calculateZRange( QgsMapLayer *layer ) const override;
57 bool showByDefaultInElevationProfilePlots() const override;
58 QgsMapLayerElevationProperties::Flags flags() const override;
59
66 Qgis::MeshElevationMode mode() const;
67
74 void setMode( Qgis::MeshElevationMode mode );
75
86 QgsDoubleRange fixedRange() const;
87
98 void setFixedRange( const QgsDoubleRange &range );
99
105 QgsLineSymbol *profileLineSymbol() const;
106
114 void setProfileLineSymbol( QgsLineSymbol *symbol SIP_TRANSFER );
115
121 QgsFillSymbol *profileFillSymbol() const;
122
130 void setProfileFillSymbol( QgsFillSymbol *symbol SIP_TRANSFER );
131
137 Qgis::ProfileSurfaceSymbology profileSymbology() const { return mSymbology; }
138
144 void setProfileSymbology( Qgis::ProfileSurfaceSymbology symbology );
145
156 double elevationLimit() const;
157
168 void setElevationLimit( double limit );
169
170 private:
171
172 void setDefaultProfileLineSymbol( const QColor &color );
173 void setDefaultProfileFillSymbol( const QColor &color );
174
176
177 std::unique_ptr< QgsLineSymbol > mProfileLineSymbol;
178 std::unique_ptr< QgsFillSymbol > mProfileFillSymbol;
180 double mElevationLimit = std::numeric_limits< double >::quiet_NaN();
181
182 QgsDoubleRange mFixedRange;
183};
184
185#endif // QGSMESHLAYERELEVATIONPROPERTIES_H
The Qgis class provides global constants for use throughout the application.
Definition: qgis.h:54
MeshElevationMode
Mesh layer elevation modes.
Definition: qgis.h:3291
@ FromVertices
Elevation should be taken from mesh vertices.
ProfileSurfaceSymbology
Surface symbology type for elevation profile plots.
Definition: qgis.h:3435
@ Line
The elevation surface will be rendered using a line symbol.
QgsRange which stores a range of double values.
Definition: qgsrange.h:231
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 QString htmlSummary() const
Returns a HTML formatted summary 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:75
Mesh layer specific subclass of QgsMapLayerElevationProperties.
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