17#ifndef QGSLAYOUTITEMELEVATIONPROFILE_H
18#define QGSLAYOUTITEMELEVATIONPROFILE_H
24class QgsLayoutItemElevationProfilePlot;
54 int type()
const override;
55 QIcon
icon()
const override;
78 QList< QgsMapLayer * > layers()
const;
85 void setLayers(
const QList< QgsMapLayer * > &layers );
135 void setTolerance(
double tolerance );
147 double tolerance()
const;
163 void setAtlasDriven(
bool enabled );
170 void paint( QPainter *painter,
const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget )
override;
209 void recreateCachedImageInBackground();
210 void profileGenerationFinished();
213 std::unique_ptr< QgsLayoutItemElevationProfilePlot > mPlot;
215 QList< QgsMapLayerRef > mLayers;
219 std::unique_ptr< QgsCurve> mCurve;
220 bool mAtlasDriven =
false;
222 double mTolerance = 0;
227 std::unique_ptr< QImage > mCacheFinalImage;
228 std::unique_ptr< QImage > mCacheRenderingImage;
229 bool mUpdatesEnabled =
true;
230 bool mCacheInvalidated =
true;
231 bool mDrawing =
false;
232 bool mDrawingPreview =
false;
233 QTimer *mBackgroundUpdateTimer =
nullptr;
234 double mPreviewScaleFactor = 0;
235 std::unique_ptr< QPainter > mPainter;
236 std::unique_ptr< QgsProfilePlotRenderer > mRenderJob;
237 bool mPainterCancelWait =
false;
DistanceUnit
Units of distance.
@ Unknown
Unknown distance unit.
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.
void previewRefreshed()
Emitted whenever the item's preview has been refreshed.
Contains settings and helpers relating to a render of a QgsLayoutItem.
Base class for graphical items within a QgsLayout.
virtual void refreshDataDefinedProperty(QgsLayoutObject::DataDefinedProperty property=QgsLayoutObject::DataDefinedProperty::AllProperties)
Refreshes a data defined property for the item by reevaluating the property's value and redrawing the...
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 bool requiresRasterization() const
Returns true if the item is drawn in such a way that forces the whole layout to be rasterized when ex...
virtual bool containsAdvancedEffects() const
Returns true if the item contains contents with blend modes or transparency effects which can only be...
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...
friend class QgsLayoutItemElevationProfile
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