17#ifndef QGSLAYOUTITEMELEVATIONPROFILE_H
18#define QGSLAYOUTITEMELEVATIONPROFILE_H
24class QgsLayoutItemElevationProfilePlot;
54 int type()
const override;
55 QIcon
icon()
const override;
57 QgsLayoutItem::Flags
itemFlags()
const override;
76 QList< QgsMapLayer * > layers()
const;
83 void setLayers(
const QList< QgsMapLayer * > &layers );
133 void setTolerance(
double tolerance );
145 double tolerance()
const;
161 void setAtlasDriven(
bool enabled );
168 void paint( QPainter *painter,
const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget )
override;
182 void recreateCachedImageInBackground();
183 void profileGenerationFinished();
186 std::unique_ptr< QgsLayoutItemElevationProfilePlot > mPlot;
188 QList< QgsMapLayerRef > mLayers;
191 std::unique_ptr< QgsCurve> mCurve;
192 bool mAtlasDriven =
false;
194 double mTolerance = 0;
199 std::unique_ptr< QImage > mCacheFinalImage;
200 std::unique_ptr< QImage > mCacheRenderingImage;
201 bool mUpdatesEnabled =
true;
202 bool mCacheInvalidated =
true;
203 bool mDrawing =
false;
204 bool mDrawingPreview =
false;
205 QTimer *mBackgroundUpdateTimer =
nullptr;
206 double mPreviewScaleFactor = 0;
207 std::unique_ptr< QPainter > mPainter;
208 std::unique_ptr< QgsProfilePlotRenderer > mRenderJob;
209 bool mPainterCancelWait =
false;
Base class for 2-dimensional plot/chart/graphs.
This class represents a coordinate reference system (CRS).
Abstract base class for curved geometry type.
A layout item subclass for elevation profile plots.
bool atlasDriven() const
Returns whether the profile curve is set to follow the current atlas feature.
Contains settings and helpers relating to a render of a QgsLayoutItem.
Base class for graphical items within a QgsLayout.
virtual QIcon icon() const
Returns the item's icon.
void paint(QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget) override
Handles preparing a paint surface for the layout item and painting the item's content.
virtual bool writePropertiesToElement(QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const
Stores item state within an XML DOM element.
int type() const override
Returns a unique graphics item type identifier.
virtual void refreshDataDefinedProperty(QgsLayoutObject::DataDefinedProperty property=QgsLayoutObject::AllProperties)
Refreshes a data defined property for the item by reevaluating the property's value and redrawing the...
virtual void invalidateCache()
Forces a deferred update of any cached image the item uses.
virtual Flags itemFlags() const
Returns the item's flags, which indicate how the item behaves.
virtual bool readPropertiesFromElement(const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context)
Sets item state from a DOM element.
void refresh() override
Refreshes the item, causing a recalculation of any property overrides and recalculation of its positi...
virtual void draw(QgsLayoutItemRenderContext &context)=0
Draws the item's contents using the specified item render context.
DataDefinedProperty
Data defined properties for different item types.
@ AllProperties
All properties for item.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Generates and renders elevation profile plots.
Encapsulates properties and constraints relating to fetching elevation profiles from different source...
The class is used as a container of context for various read/write operations on other objects.
const QgsCoordinateReferenceSystem & crs