QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
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 "qgsmeshdataset.h"
26#include "qgis.h"
27
28class QgsLineSymbol;
29class QgsFillSymbol;
30
39{
40
41 Q_OBJECT
42
43 public:
44
50
51 bool hasElevation() const override;
52 QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) override;
53 bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) override;
54 QString htmlSummary() const override;
56 bool isVisibleInZRange( const QgsDoubleRange &range, QgsMapLayer *layer = nullptr ) const override;
57 QgsDoubleRange calculateZRange( QgsMapLayer *layer ) const override;
58 QList< double > significantZValues( QgsMapLayer *layer ) const override;
59 bool showByDefaultInElevationProfilePlots() const override;
60 QgsMapLayerElevationProperties::Flags flags() const override;
61
68 Qgis::MeshElevationMode mode() const;
69
76 void setMode( Qgis::MeshElevationMode mode );
77
88 QgsDoubleRange fixedRange() const;
89
100 void setFixedRange( const QgsDoubleRange &range );
101
112 QMap<int, QgsDoubleRange> fixedRangePerGroup() const;
113
124 void setFixedRangePerGroup( const QMap<int, QgsDoubleRange> &ranges );
125
131 QgsLineSymbol *profileLineSymbol() const;
132
140 void setProfileLineSymbol( QgsLineSymbol *symbol SIP_TRANSFER );
141
147 QgsFillSymbol *profileFillSymbol() const;
148
156 void setProfileFillSymbol( QgsFillSymbol *symbol SIP_TRANSFER );
157
163 Qgis::ProfileSurfaceSymbology profileSymbology() const { return mSymbology; }
164
170 void setProfileSymbology( Qgis::ProfileSurfaceSymbology symbology );
171
182 double elevationLimit() const;
183
194 void setElevationLimit( double limit );
195
196 private:
197
198 void setDefaultProfileLineSymbol( const QColor &color );
199 void setDefaultProfileFillSymbol( const QColor &color );
200
202
203 std::unique_ptr< QgsLineSymbol > mProfileLineSymbol;
204 std::unique_ptr< QgsFillSymbol > mProfileFillSymbol;
206 double mElevationLimit = std::numeric_limits< double >::quiet_NaN();
207
208 QgsDoubleRange mFixedRange;
209
210 QMap< int, QgsDoubleRange > mRangePerGroup;
211};
212
213#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:3744
@ FromVertices
Elevation should be taken from mesh vertices.
ProfileSurfaceSymbology
Surface symbology type for elevation profile plots.
Definition qgis.h:3889
@ 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.
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 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:76
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