QGIS API Documentation 3.99.0-Master (21b3aa880ba)
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.h"
23#include "qgis_core.h"
24#include "qgis_sip.h"
26#include "qgsmeshdataset.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;
61
68 Qgis::MeshElevationMode mode() const;
69
76 void setMode( Qgis::MeshElevationMode mode );
77
89
100 void setFixedRange( const QgsDoubleRange &range );
101
112 QMap<int, QgsDoubleRange> fixedRangePerGroup() const;
113
124 void setFixedRangePerGroup( const QMap<int, QgsDoubleRange> &ranges );
125
132
141
148
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
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:56
MeshElevationMode
Mesh layer elevation modes.
Definition qgis.h:4035
@ FromVertices
Elevation should be taken from mesh vertices.
Definition qgis.h:4037
ProfileSurfaceSymbology
Surface symbology type for elevation profile plots.
Definition qgis.h:4193
@ Line
The elevation surface will be rendered using a line symbol.
Definition qgis.h:4194
QgsRange which stores a range of double values.
Definition qgsrange.h:233
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
A line symbol type, for rendering LineString and MultiLineString geometries.
virtual QgsMapLayerElevationProperties * clone() const =0
Creates a clone of the properties.
QgsMapLayerElevationProperties(QObject *parent)
Constructor for QgsMapLayerElevationProperties, with the specified parent object.
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:80
Qgis::ProfileSurfaceSymbology profileSymbology() const
Returns the symbology option used to render the mesh profile in elevation profile plots.
QgsLineSymbol * profileLineSymbol() const
Returns the line symbol used to render the mesh profile in elevation profile plots.
QgsDoubleRange fixedRange() const
Returns the fixed elevation range for the mesh.
bool isVisibleInZRange(const QgsDoubleRange &range, QgsMapLayer *layer=nullptr) const override
Returns true if the layer should be visible and rendered for the specified z range.
Qgis::MeshElevationMode mode() const
Returns the elevation mode.
void setFixedRangePerGroup(const QMap< int, QgsDoubleRange > &ranges)
Sets the fixed elevation range for each group.
QList< double > significantZValues(QgsMapLayer *layer) const override
Returns a list of significant elevation/z-values for the specified layer, using the settings defined ...
QgsFillSymbol * profileFillSymbol() const
Returns the fill symbol used to render the mesh profile in elevation profile plots.
void setProfileFillSymbol(QgsFillSymbol *symbol)
Sets the fill symbol used to render the mesh profile in elevation profile plots.
void setProfileLineSymbol(QgsLineSymbol *symbol)
Sets the line symbol used to render the mesh profile in elevation profile plots.
QgsMeshLayerElevationProperties(QObject *parent)
Constructor for QgsMeshLayerElevationProperties, with the specified parent object.
void setMode(Qgis::MeshElevationMode mode)
Sets the elevation mode.
QMap< int, QgsDoubleRange > fixedRangePerGroup() const
Returns the fixed elevation range for each group.
QgsMapLayerElevationProperties::Flags flags() const override
Returns flags associated to the elevation properties.
void setFixedRange(const QgsDoubleRange &range)
Sets the fixed elevation range for the mesh.
bool showByDefaultInElevationProfilePlots() const override
Returns true if the layer should be visible by default in newly created elevation profile plots.
QgsDoubleRange calculateZRange(QgsMapLayer *layer) const override
Attempts to calculate the overall elevation or z range for the specified layer, using the settings de...
A container for the context for various read/write operations on objects.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_FACTORY
Definition qgis_sip.h:84