QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgselevationprofile.h
Go to the documentation of this file.
1/***************************************************************************
2 qgselevationprofile.h
3 ------------------
4 Date : July 2025
5 Copyright : (C) 2025 Nyall Dawson
6 Email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSELEVATIONPROFILE_H
17#define QGSELEVATIONPROFILE_H
18
19#include "qgis_core.h"
20#include "qgis_sip.h"
22#include "qgsmaplayerref.h"
23
24#include <QObject>
25#include <QPointer>
26
27class QgsProject;
29class QDomDocument;
30class QDomElement;
31class QgsMapLayer;
32class QgsCurve;
33class QgsLineSymbol;
34class QgsLayerTree;
35
44class CORE_EXPORT QgsElevationProfile : public QObject
45{
46 Q_OBJECT
47
48 public:
49
53 explicit QgsElevationProfile( QgsProject *project );
55
62 QString name() const { return mName; }
63
68 QDomElement writeXml( QDomDocument &document, const QgsReadWriteContext &context ) const;
69
78 bool readXml( const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context );
79
85 void resolveReferences( const QgsProject *project );
86
90 QIcon icon() const;
91
95 QgsLayerTree *layerTree();
96
103
113 void setProfileCurve( QgsCurve *curve SIP_TRANSFER );
114
122 QgsCurve *profileCurve() const;
123
133 double tolerance() const;
134
140 bool lockAxisScales() const;
141
147 Qgis::DistanceUnit distanceUnit() const;
148
154 QgsLineSymbol *subsectionsSymbol();
155
164 void setSubsectionsSymbol( QgsLineSymbol *symbol SIP_TRANSFER );
165
166 public slots:
167
174 void setName( const QString &name );
175
181 void setCrs( const QgsCoordinateReferenceSystem &crs );
182
192 void setTolerance( double tolerance );
193
199 void setLockAxisScales( bool lock );
200
206 void setDistanceUnit( Qgis::DistanceUnit unit );
207
208 signals:
209
216 void nameChanged( const QString &newName );
217
218 private slots:
219
220 void dirtyProject();
221
222 private:
223
224 void setupLayerTreeConnections();
225
226 QPointer< QgsProject > mProject;
227 QString mName;
229 bool mLockAxisScales = false;
231 std::unique_ptr<QgsLayerTree> mLayerTree;
232 std::unique_ptr<QgsCurve> mProfileCurve;
233 double mTolerance = 0;
234 std::unique_ptr<QgsLineSymbol> mSubsectionsSymbol;
235
236};
237
238#endif // QGSELEVATIONPROFILE_H
DistanceUnit
Units of distance.
Definition qgis.h:5013
@ Unknown
Unknown distance unit.
Definition qgis.h:5063
Represents a coordinate reference system (CRS).
Abstract base class for curved geometry type.
Definition qgscurve.h:36
QgsElevationProfile(QgsProject *project)
Constructor for QgsElevationProfile.
void nameChanged(const QString &newName)
Emitted when the profile is renamed.
QString name() const
Returns the profile's unique name.
~QgsElevationProfile() override
Namespace with helper functions for layer tree operations.
A line symbol type, for rendering LineString and MultiLineString geometries.
Base class for all map layer types.
Definition qgsmaplayer.h:80
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_TRANSFER
Definition qgis_sip.h:36