QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
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 Q_OBJECT
41
42 public:
48
49 bool hasElevation() const override;
50 QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) override;
51 bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) override;
52 QString htmlSummary() const override;
54 bool isVisibleInZRange( const QgsDoubleRange &range, QgsMapLayer *layer = nullptr ) const override;
55 QgsDoubleRange calculateZRange( QgsMapLayer *layer ) const override;
56 QList< double > significantZValues( QgsMapLayer *layer ) const override;
57 bool showByDefaultInElevationProfilePlots() const override;
59
66 Qgis::MeshElevationMode mode() const;
67
74 void setMode( Qgis::MeshElevationMode mode );
75
87
98 void setFixedRange( const QgsDoubleRange &range );
99
110 QMap<int, QgsDoubleRange> fixedRangePerGroup() const;
111
122 void setFixedRangePerGroup( const QMap<int, QgsDoubleRange> &ranges );
123
130
139
146
155
161 Qgis::ProfileSurfaceSymbology profileSymbology() const { return mSymbology; }
162
168 void setProfileSymbology( Qgis::ProfileSurfaceSymbology symbology );
169
180 double elevationLimit() const;
181
192 void setElevationLimit( double limit );
193
194 private:
195 void setDefaultProfileLineSymbol( const QColor &color );
196 void setDefaultProfileFillSymbol( const QColor &color );
197
199
200 std::unique_ptr< QgsLineSymbol > mProfileLineSymbol;
201 std::unique_ptr< QgsFillSymbol > mProfileFillSymbol;
203 double mElevationLimit = std::numeric_limits< double >::quiet_NaN();
204
205 QgsDoubleRange mFixedRange;
206
207 QMap< int, QgsDoubleRange > mRangePerGroup;
208};
209
210#endif // QGSMESHLAYERELEVATIONPROPERTIES_H
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:62
MeshElevationMode
Mesh layer elevation modes.
Definition qgis.h:4152
@ FromVertices
Elevation should be taken from mesh vertices.
Definition qgis.h:4154
ProfileSurfaceSymbology
Surface symbology type for elevation profile plots.
Definition qgis.h:4322
@ Line
The elevation surface will be rendered using a line symbol.
Definition qgis.h:4323
QgsRange which stores a range of double values.
Definition qgsrange.h:217
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:83
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:52
#define SIP_TRANSFER
Definition qgis_sip.h:35
#define SIP_FACTORY
Definition qgis_sip.h:83