18#ifndef QGSELEVATIONPROFILECANVAS_H
19#define QGSELEVATIONPROFILECANVAS_H
21#include "qgis_quick.h"
30class QgsElevationProfilePlotItem;
44 Q_PROPERTY(
QgsProject *project READ project WRITE setProject NOTIFY projectChanged )
48 Q_PROPERTY(
QgsGeometry profileCurve READ profileCurve WRITE setProfileCurve NOTIFY profileCurveChanged )
50 Q_PROPERTY(
double tolerance READ tolerance WRITE setTolerance NOTIFY toleranceChanged )
58 Q_PROPERTY(
bool isRendering READ isRendering NOTIFY isRenderingChanged )
67 QSGNode *updatePaintNode( QSGNode *oldNode, QQuickItem::UpdatePaintNodeData * ) override;
75 bool isRendering() const;
81 Q_INVOKABLE
void refresh();
99 Q_INVOKABLE
void populateLayersFromProject();
106 QList<QgsMapLayer *> layers()
const;
147 void setTolerance(
double tolerance );
166 void setVisiblePlotRange(
double minimumDistance,
double maximumDistance,
double minimumElevation,
double maximumElevation );
205#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
206 void geometryChanged(
const QRectF &newGeometry,
const QRectF &oldGeometry )
override;
208 void geometryChange(
const QRectF &newGeometry,
const QRectF &oldGeometry )
override;
216 Q_INVOKABLE
void zoomFull();
222 Q_INVOKABLE
void zoomFullInRatio();
227 Q_INVOKABLE
void clear();
231 void generationFinished();
232 void onLayerProfileGenerationPropertyChanged();
233 void onLayerProfileRendererPropertyChanged();
234 void regenerateResultsForLayer();
235 void scheduleDeferredRegeneration();
236 void scheduleDeferredRedraw();
237 void startDeferredRegeneration();
238 void startDeferredRedraw();
239 void refineResults();
242 void setupLayerConnections(
QgsMapLayer *layer,
bool isDisconnect );
251 QgsElevationProfilePlotItem *mPlotItem =
nullptr;
254 QTimer *mDeferredRegenerationTimer =
nullptr;
255 bool mDeferredRegenerationScheduled =
false;
256 QTimer *mDeferredRedrawTimer =
nullptr;
257 bool mDeferredRedrawScheduled =
false;
260 double mTolerance = 0;
262 bool mZoomFullWhenJobFinished =
true;
264 bool mForceRegenerationAfterCurrentJobCompletes =
false;
266 static constexpr double MAX_ERROR_PIXELS = 2;
This class represents a coordinate reference system (CRS).
QgsRange which stores a range of double values.
A geometry is the spatial representation of a feature.
Base class for all map layer types.
Generates and renders elevation profile plots.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
This class implements a visual Qt Quick Item that does elevation profile rendering according to the c...
QgsGeometry profileCurve() const
Returns the profile curve geometry.
void activeJobCountChanged(int count)
Emitted when the number of active background jobs changes.
void crsChanged()
Emitted when the CRS linked to the profile curve geometry changes.
QgsCoordinateReferenceSystem crs() const
Returns the crs associated with map coordinates.
void profileCurveChanged()
Emitted when the profile curve geometry changes.
void projectChanged()
Emitted when the associated project changes.
double tolerance() const
Returns the tolerance of the profile (in crs() units).
void toleranceChanged()
Emitted when the tolerance changes.
void isRenderingChanged()
The isRendering property is set to true while a rendering job is pending for this elevation profile c...
QList< QgsWeakMapLayerPointer > QgsWeakMapLayerPointerList
A list of weak pointers to QgsMapLayers.
const QgsCoordinateReferenceSystem & crs