18#ifndef QGSELEVATIONPROFILECANVAS_H
19#define QGSELEVATIONPROFILECANVAS_H
29class QgsElevationProfilePlotItem;
30class QgsElevationProfileCrossHairsItem;
63 void paintEvent( QPaintEvent *event )
override;
73 void scalePlot(
double xFactor,
double yFactor );
75 void zoomToRect(
const QRectF &rect )
override;
76 void wheelZoom( QWheelEvent *event )
override;
82 QRectF plotArea()
const;
94 void invalidateCurrentPlotExtent();
109 void setLayers(
const QList< QgsMapLayer * > &layers );
116 QList< QgsMapLayer * > layers()
const;
154 void setTolerance(
double tolerance );
173 void setVisiblePlotRange(
double minimumDistance,
double maximumDistance,
double minimumElevation,
double maximumElevation );
232 void activeJobCountChanged(
int count );
256 void setSnappingEnabled(
bool enabled );
260 void generationFinished();
261 void onLayerProfileGenerationPropertyChanged();
262 void onLayerProfileRendererPropertyChanged();
263 void regenerateResultsForLayer();
264 void scheduleDeferredRegeneration();
265 void scheduleDeferredRedraw();
266 void startDeferredRegeneration();
267 void startDeferredRedraw();
268 void refineResults();
275 void setupLayerConnections(
QgsMapLayer *layer,
bool isDisconnect );
284 QgsElevationProfilePlotItem *mPlotItem =
nullptr;
285 QgsElevationProfileCrossHairsItem *mCrossHairsItem =
nullptr;
288 QTimer *mDeferredRegenerationTimer =
nullptr;
289 bool mDeferredRegenerationScheduled = false;
290 QTimer *mDeferredRedrawTimer =
nullptr;
291 bool mDeferredRedrawScheduled = false;
294 double mTolerance = 0;
296 bool mFirstDrawOccurred = false;
298 bool mSnappingEnabled = true;
300 bool mZoomFullWhenJobFinished = true;
302 bool mForceRegenerationAfterCurrentJobCompletes = false;
304 static constexpr
double MAX_ERROR_PIXELS = 2;
Base class for 2-dimensional plot/chart/graphs.
Abstract base class for storage of elevation profiles.
This class 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.
double tolerance() const
Returns the tolerance of the profile (in crs() units).
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.
A class to represent a 2D point.
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.
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
QList< QgsWeakMapLayerPointer > QgsWeakMapLayerPointerList
A list of weak pointers to QgsMapLayers.
const QgsCoordinateReferenceSystem & crs