QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsprojectelevationproperties.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprojectelevationproperties.h
3 ---------------
4 begin : February 2022
5 copyright : (C) 2022 by Nyall Dawson
6 email : nyall dot dawson at gmail 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#ifndef QGSPROJECTELEVATIONPROPERTIES_H
18#define QGSPROJECTELEVATIONPROPERTIES_H
19
20#include <memory>
21
22#include "qgis_core.h"
23#include "qgsrange.h"
24#include "qgsunittypes.h"
25
26#include <QObject>
27
28class QDomElement;
30class QDomDocument;
32class QgsProject;
33
40class CORE_EXPORT QgsProjectElevationProperties : public QObject
41{
42 Q_OBJECT
43
44 public:
45
49 QgsProjectElevationProperties( QObject *parent SIP_TRANSFERTHIS = nullptr );
50
52
56 void reset();
57
61 void resolveReferences( const QgsProject *project );
62
67 bool readXml( const QDomElement &element, const QgsReadWriteContext &context );
68
73 QDomElement writeXml( QDomDocument &document, const QgsReadWriteContext &context ) const;
74
81
90
103 QgsDoubleRange elevationRange() const { return mElevationRange; }
104
117 double elevationFilterRangeSize() const { return mElevationFilterRangeSize; }
118
126 bool invertElevationFilter() const { return mInvertElevationFilter; }
127
128 public slots:
129
142 void setElevationRange( const QgsDoubleRange &range );
143
156 void setElevationFilterRangeSize( double size );
157
165 void setInvertElevationFilter( bool invert );
166
167 signals:
168
172 void changed();
173
186
187 private:
188
189 std::unique_ptr< QgsAbstractTerrainProvider > mTerrainProvider;
190 QgsDoubleRange mElevationRange;
191 double mElevationFilterRangeSize = -1;
192 bool mInvertElevationFilter = false;
193
194};
195
196
197#endif // QGSPROJECTELEVATIONPROPERTIES_H
Abstract base class for terrain providers.
QgsRange which stores a range of double values.
Definition qgsrange.h:233
bool readXml(const QDomElement &element, const QgsReadWriteContext &context)
Reads the property state from a DOM element.
void reset()
Resets the properties to a default state.
QgsDoubleRange elevationRange() const
Returns the project's elevation range, which indicates the upper and lower elevation limits associate...
QgsProjectElevationProperties(QObject *parent=nullptr)
Constructor for QgsProjectElevationProperties with the specified parent object.
QDomElement writeXml(QDomDocument &document, const QgsReadWriteContext &context) const
Returns a DOM element representing the properties.
~QgsProjectElevationProperties() override
QgsAbstractTerrainProvider * terrainProvider()
Returns the project's terrain provider.
void elevationRangeChanged(const QgsDoubleRange &range)
Emitted when the project's elevation is changed.
double elevationFilterRangeSize() const
Returns the fixed size for elevation range filtering in the project, used when interactively filterin...
void changed()
Emitted when the elevation properties change.
void resolveReferences(const QgsProject *project)
Resolves reference to layers from stored layer ID.
void setTerrainProvider(QgsAbstractTerrainProvider *provider)
Sets the project's terrain provider.
bool invertElevationFilter() const
Returns true if the elevation range filter slider should be inverted for this project.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:109
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