18#ifndef QGSELEVATIONPROFILECANVAS_H
19#define QGSELEVATIONPROFILECANVAS_H
30class QgsElevationProfilePlotItem;
31class QgsElevationProfileCrossHairsItem;
62 void paintEvent( QPaintEvent *event )
override;
72 void scalePlot(
double xFactor,
double yFactor );
74 void zoomToRect(
const QRectF &rect )
override;
75 void wheelZoom( QWheelEvent *event )
override;
81 QRectF plotArea()
const;
93 void invalidateCurrentPlotExtent();
108 void setLayers(
const QList<QgsMapLayer *> &layers );
115 QList<QgsMapLayer *> layers()
const;
153 void setTolerance(
double tolerance );
172 void setVisiblePlotRange(
double minimumDistance,
double maximumDistance,
double minimumElevation,
double maximumElevation );
232 bool lockAxisScales() const;
240 void setLockAxisScales(
bool lock );
248 Qgis::DistanceUnit distanceUnit() const;
256 void setDistanceUnit(
Qgis::DistanceUnit unit );
266 void setBackgroundColor( const QColor &color );
276 return mSubsectionsSymbol.get();
317 void setSnappingEnabled(
bool enabled );
321 void generationFinished();
322 void onLayerProfileGenerationPropertyChanged();
323 void onLayerProfileRendererPropertyChanged();
324 void regenerateResultsForLayer();
325 void scheduleDeferredRegeneration();
326 void scheduleDeferredRedraw();
327 void startDeferredRegeneration();
328 void startDeferredRedraw();
329 void refineResults();
332 void updateChartFromPalette();
336 void setupLayerConnections(
QgsMapLayer *layer,
bool isDisconnect );
338 void adjustRangeForAxisScaleLock(
double &xMinimum,
double &xMaximum,
double &yMinimum,
double &yMaximum )
const;
342 bool mLockAxisScales =
false;
350 QgsElevationProfilePlotItem *mPlotItem =
nullptr;
351 QgsElevationProfileCrossHairsItem *mCrossHairsItem =
nullptr;
354 QTimer *mDeferredRegenerationTimer =
nullptr;
355 bool mDeferredRegenerationScheduled =
false;
356 QTimer *mDeferredRedrawTimer =
nullptr;
357 bool mDeferredRedrawScheduled =
false;
359 std::unique_ptr<QgsCurve> mProfileCurve;
360 double mTolerance = 0;
362 bool mFirstDrawOccurred =
false;
364 bool mSnappingEnabled =
true;
366 bool mZoomFullWhenJobFinished =
true;
368 bool mForceRegenerationAfterCurrentJobCompletes =
false;
370 static constexpr double MAX_ERROR_PIXELS = 2;
372 std::unique_ptr<QgsLineSymbol> mSubsectionsSymbol;
Provides global constants and enumerations for use throughout the application.
DistanceUnit
Units of distance.
@ Unknown
Unknown distance unit.
Base class for 2-dimensional plot/chart/graphs.
Abstract base class for storage of elevation profiles.
Represents a coordinate reference system (CRS).
Abstract base class for curved geometry type.
QgsRange which stores a range of double values.
A canvas for elevation profiles.
void activeJobCountChanged(int count)
Emitted when the number of active background jobs changes.
void canvasPointHovered(const QgsPointXY &point, const QgsProfilePoint &profilePoint)
Emitted when the mouse hovers over the specified point (in canvas coordinates).
double tolerance() const
Returns the tolerance of the profile (in crs() units).
A line symbol type, for rendering LineString and MultiLineString geometries.
Base class for all map layer types.
Plot canvas is a class for displaying interactive 2d charts and plots.
virtual void cancelJobs()
Cancel any rendering job, in a blocking way.
virtual void refresh()
Updates and redraws the plot.
virtual void zoomToRect(const QRectF &rect)
Zooms the plot to the specified rect in canvas units.
virtual void panContentsBy(double dx, double dy)
Pans the plot contents by dx, dy in canvas units.
virtual QgsPointXY toCanvasCoordinates(const QgsPoint &point) const
Converts a point in map coordinates to the associated canvas point.
void mouseMoveEvent(QMouseEvent *e) override
void resizeEvent(QResizeEvent *e) override
virtual void scalePlot(double factor)
Scales the plot by a specified scale factor.
virtual QgsCoordinateReferenceSystem crs() const
Returns the coordinate reference system (CRS) for map coordinates used by the canvas.
virtual void wheelZoom(QWheelEvent *event)
Zoom plot from a mouse wheel event.
virtual QgsPoint toMapCoordinates(const QgsPointXY &point) const
Converts a point on the canvas to the associated map coordinate.
virtual QgsPointXY snapToPlot(QPoint point)
Snap a canvas point to the plot.
virtual void centerPlotOn(double x, double y)
Centers the plot on the plot point corresponding to x, y in canvas units.
Point geometry type, with support for z-dimension and m-values.
Encapsulates the context of identifying profile results.
Stores identify results generated by a QgsAbstractProfileResults object.
Generates and renders elevation profile plots.
Encapsulates a point on a distance-elevation profile.
Encapsulates the context of snapping a profile point.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Contains information about the context of a rendering operation.
A utility class for dynamic handling of changes to screen properties.
QList< QgsWeakMapLayerPointer > QgsWeakMapLayerPointerList
A list of weak pointers to QgsMapLayers.
const QgsCoordinateReferenceSystem & crs