QGIS API Documentation
3.99.0-Master (752b475928d)
Loading...
Searching...
No Matches
src
core
elevation
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
"
21
#include "
qgscoordinatereferencesystem.h
"
22
#include "
qgsmaplayerref.h
"
23
24
#include <QObject>
25
#include <QPointer>
26
27
class
QgsProject
;
28
class
QgsReadWriteContext
;
29
class
QDomDocument;
30
class
QDomElement;
31
class
QgsMapLayer
;
32
class
QgsCurve
;
33
class
QgsLineSymbol
;
34
class
QgsLayerTree
;
35
44
class
CORE_EXPORT
QgsElevationProfile
:
public
QObject
45
{
46
Q_OBJECT
47
48
public
:
49
50
Q_PROPERTY(
bool
useProjectLayerTree
READ
useProjectLayerTree
WRITE
setUseProjectLayerTree
NOTIFY
useProjectLayerTreeChanged
)
51
52
55
explicit
QgsElevationProfile
(
QgsProject
*project );
56
~QgsElevationProfile
()
override
;
57
64
QString
name
()
const
{
return
mName; }
65
70
QDomElement writeXml( QDomDocument &document,
const
QgsReadWriteContext
&context )
const
;
71
80
bool
readXml(
const
QDomElement &element,
const
QDomDocument &document,
const
QgsReadWriteContext
&context );
81
87
void
resolveReferences(
const
QgsProject
*project );
88
92
QIcon icon()
const
;
93
102
QgsLayerTree
*layerTree();
103
113
bool
useProjectLayerTree
() {
return
mUseProjectLayerTree; }
114
120
QgsCoordinateReferenceSystem
crs()
const
;
121
131
void
setProfileCurve(
QgsCurve
*curve
SIP_TRANSFER
);
132
140
QgsCurve
*profileCurve()
const
;
141
151
double
tolerance()
const
;
152
158
bool
lockAxisScales()
const
;
159
165
Qgis::DistanceUnit
distanceUnit()
const
;
166
172
QgsLineSymbol
*subsectionsSymbol();
173
182
void
setSubsectionsSymbol(
QgsLineSymbol
*symbol
SIP_TRANSFER
);
183
184
public
slots:
185
192
void
setName(
const
QString &name );
193
199
void
setCrs(
const
QgsCoordinateReferenceSystem
&crs );
200
210
void
setTolerance(
double
tolerance );
211
217
void
setLockAxisScales(
bool
lock );
218
224
void
setDistanceUnit(
Qgis::DistanceUnit
unit );
225
226
236
void
setUseProjectLayerTree(
bool
useProjectTree );
237
238
signals:
239
246
void
nameChanged
(
const
QString &newName );
247
253
void
useProjectLayerTreeChanged
(
bool
useProjectTree );
254
255
private
slots:
256
257
void
dirtyProject();
258
259
private
:
260
261
void
setupLayerTreeConnections();
262
263
QPointer< QgsProject > mProject;
264
QString mName;
265
QgsCoordinateReferenceSystem
mCrs;
266
bool
mLockAxisScales =
false
;
267
Qgis::DistanceUnit
mDistanceUnit =
Qgis::DistanceUnit::Unknown
;
268
std::unique_ptr<QgsLayerTree> mLayerTree;
269
bool
mUseProjectLayerTree =
false
;
270
std::unique_ptr<QgsCurve> mProfileCurve;
271
double
mTolerance = 0;
272
std::unique_ptr<QgsLineSymbol> mSubsectionsSymbol;
273
274
};
275
276
#endif
// QGSELEVATIONPROFILE_H
Qgis::DistanceUnit
DistanceUnit
Units of distance.
Definition
qgis.h:5013
Qgis::DistanceUnit::Unknown
@ Unknown
Unknown distance unit.
Definition
qgis.h:5063
QgsCoordinateReferenceSystem
Represents a coordinate reference system (CRS).
Definition
qgscoordinatereferencesystem.h:212
QgsCurve
Abstract base class for curved geometry type.
Definition
qgscurve.h:36
QgsElevationProfile::useProjectLayerTreeChanged
void useProjectLayerTreeChanged(bool useProjectTree)
Emitted when the use project layer tree property is changed.
QgsElevationProfile::useProjectLayerTree
bool useProjectLayerTree()
Returns true if the profile should always use the project's layer tree.
Definition
qgselevationprofile.h:113
QgsElevationProfile::QgsElevationProfile
QgsElevationProfile(QgsProject *project)
Constructor for QgsElevationProfile.
Definition
qgselevationprofile.cpp:25
QgsElevationProfile::useProjectLayerTree
bool useProjectLayerTree
Definition
qgselevationprofile.h:50
QgsElevationProfile::nameChanged
void nameChanged(const QString &newName)
Emitted when the profile is renamed.
QgsElevationProfile::name
QString name() const
Returns the profile's unique name.
Definition
qgselevationprofile.h:64
QgsElevationProfile::setUseProjectLayerTree
void setUseProjectLayerTree(bool useProjectTree)
Sets whether the profile should always use the project's layer tree.
Definition
qgselevationprofile.cpp:225
QgsElevationProfile::~QgsElevationProfile
~QgsElevationProfile() override
QgsLayerTree
Namespace with helper functions for layer tree operations.
Definition
qgslayertree.h:33
QgsLineSymbol
A line symbol type, for rendering LineString and MultiLineString geometries.
Definition
qgslinesymbol.h:30
QgsMapLayer
Base class for all map layer types.
Definition
qgsmaplayer.h:80
QgsProject
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition
qgsproject.h:109
QgsReadWriteContext
A container for the context for various read/write operations on objects.
Definition
qgsreadwritecontext.h:34
qgis_sip.h
SIP_TRANSFER
#define SIP_TRANSFER
Definition
qgis_sip.h:36
qgscoordinatereferencesystem.h
qgsmaplayerref.h
Generated on
for QGIS API Documentation by
1.15.0