QGIS API Documentation 3.37.0-Master (df6056bf1be)
Loading...
Searching...
No Matches
qgsrendercontext.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsrendercontext.h
3 ------------------
4 begin : March 16, 2008
5 copyright : (C) 2008 by Marco Hugentobler
6 email : marco dot hugentobler at karto dot baug dot ethz dot ch
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSRENDERCONTEXT_H
19#define QGSRENDERCONTEXT_H
20
21#include "qgis_core.h"
22#include "qgis_sip.h"
23#include <QColor>
24#include <QPainter>
25#include <QPainterPath>
26#include <memory>
27
31#include "qgslabelsink.h"
32#include "qgsmaptopixel.h"
33#include "qgsmapunitscale.h"
34#include "qgsrectangle.h"
36#include "qgsdistancearea.h"
38#include "qgspathresolver.h"
40
41class QPainter;
44class QgsMapSettings;
46class QgsSymbolLayer;
49class QgsElevationMap;
50
51
60class CORE_EXPORT QgsRenderContext : public QgsTemporalRangeObject
61{
62 public:
65
67 QgsRenderContext &operator=( const QgsRenderContext &rh );
68
72 void setFlags( Qgis::RenderContextFlags flags );
73
77 void setFlag( Qgis::RenderContextFlag flag, bool on = true );
78
82 Qgis::RenderContextFlags flags() const;
83
87 bool testFlag( Qgis::RenderContextFlag flag ) const;
88
92 static QgsRenderContext fromMapSettings( const QgsMapSettings &mapSettings );
93
99 static QgsRenderContext fromQPainter( QPainter *painter );
100
101 //getters
102
107 QPainter *painter() {return mPainter;}
108
109#ifndef SIP_RUN
110
116 const QPainter *painter() const { return mPainter; }
117#endif
118
127 QPainter *previewRenderPainter() {return mPreviewRenderPainter;}
128
129#ifndef SIP_RUN
130
139 const QPainter *previewRenderPainter() const { return mPreviewRenderPainter; }
140#endif
141
151 void setPainterFlagsUsingContext( QPainter *painter = nullptr ) const;
152
162 QPainter *maskPainter( int id = 0 ) { return mMaskPainter.value( id, nullptr ); }
163
164 // TODO QGIS 4 : remove the V2 from method name
165
176 Q_DECL_DEPRECATED void setDisabledSymbolLayers( const QSet<const QgsSymbolLayer *> &symbolLayers ) SIP_DEPRECATED;
177
187 void setDisabledSymbolLayersV2( const QSet<QString> &symbolLayers );
188
199 Q_DECL_DEPRECATED QSet<const QgsSymbolLayer *> disabledSymbolLayers() const SIP_DEPRECATED;
200
210 QSet<QString> disabledSymbolLayersV2() const;
211
221 bool isSymbolLayerEnabled( const QgsSymbolLayer *layer ) const;
222
233 QgsCoordinateTransform coordinateTransform() const {return mCoordTransform;}
234
238 const QgsDistanceArea &distanceArea() const { return mDistanceArea; }
239
247 QgsCoordinateTransformContext transformContext() const;
248
256 void setTransformContext( const QgsCoordinateTransformContext &context );
257
264 const QgsPathResolver &pathResolver() const { return mPathResolver; }
265
272 void setPathResolver( const QgsPathResolver &resolver ) { mPathResolver = resolver; }
273
289 const QgsRectangle &extent() const { return mExtent; }
290
301 QgsRectangle mapExtent() const { return mOriginalMapExtent; }
302
308 const QgsMapToPixel &mapToPixel() const {return mMapToPixel;}
309
316 double scaleFactor() const {return mScaleFactor;}
317
324 double dpiTarget() const {return mDpiTarget;}
325
335 bool renderingStopped() const {return mRenderingStopped;}
336
348 void setFeedback( QgsFeedback *feedback );
349
358 QgsFeedback *feedback() const;
359
366 bool forceVectorOutput() const;
367
373 bool useAdvancedEffects() const;
374
380 void setUseAdvancedEffects( bool enabled );
381
387 bool drawEditingInformation() const;
388
394 double rendererScale() const {return mRendererScale;}
395
396
412 double symbologyReferenceScale() const { return mSymbologyReferenceScale; }
413
418 QgsLabelingEngine *labelingEngine() const { return mLabelingEngine; } SIP_SKIP
419
425 QgsLabelSink *labelSink() const { return mLabelSink; } SIP_SKIP
426
432 QColor selectionColor() const { return mSelectionColor; }
433
441 bool showSelection() const;
442
443 //setters
444
455 void setCoordinateTransform( const QgsCoordinateTransform &t );
456
462 void setMapToPixel( const QgsMapToPixel &mtp ) {mMapToPixel = mtp;}
463
476 void setExtent( const QgsRectangle &extent ) {mExtent = extent;}
477
488 void setMapExtent( const QgsRectangle &extent ) { mOriginalMapExtent = extent; }
489
495 void setDrawEditingInformation( bool b );
496
507 void setRenderingStopped( bool stopped ) {mRenderingStopped = stopped;}
508
513 void setDistanceArea( const QgsDistanceArea &distanceArea ) {mDistanceArea = distanceArea ;}
514
521 void setScaleFactor( double factor ) {mScaleFactor = factor;}
522
529 void setDpiTarget( double dpi ) {mDpiTarget = dpi;}
530
536 void setRendererScale( double scale ) {mRendererScale = scale;}
537
553 void setSymbologyReferenceScale( double scale ) { mSymbologyReferenceScale = scale; }
554
561 void setPainter( QPainter *p ) {mPainter = p;}
562
573 void setPreviewRenderPainter( QPainter *painter ) { mPreviewRenderPainter = painter; }
574
582 void setMaskPainter( QPainter *p, int id = 0 ) { mMaskPainter[id] = p; }
583
590 void setForceVectorOutput( bool force );
591
596 void setLabelingEngine( QgsLabelingEngine *engine ) { mLabelingEngine = engine; } SIP_SKIP
597
604 void setLabelSink( QgsLabelSink *sink ) { mLabelSink = sink; } SIP_SKIP
605
611 void setSelectionColor( const QColor &color ) { mSelectionColor = color; }
612
620 void setShowSelection( bool showSelection );
621
627 bool useRenderingOptimization() const;
628
634 void setUseRenderingOptimization( bool enabled );
635
643 const QgsVectorSimplifyMethod &vectorSimplifyMethod() const { return mVectorSimplifyMethod; }
644
657 void setVectorSimplifyMethod( const QgsVectorSimplifyMethod &simplifyMethod ) { mVectorSimplifyMethod = simplifyMethod; }
658
664 void setExpressionContext( const QgsExpressionContext &context ) { mExpressionContext = context; }
665
671 QgsExpressionContext &expressionContext() { return mExpressionContext; }
672
679 const QgsExpressionContext &expressionContext() const { return mExpressionContext; } SIP_SKIP
680
682 const QgsAbstractGeometry *geometry() const { return mGeometry; }
684 void setGeometry( const QgsAbstractGeometry *geometry ) { mGeometry = geometry; }
685
691 void setFeatureFilterProvider( const QgsFeatureFilterProvider *ffp );
692
698 const QgsFeatureFilterProvider *featureFilterProvider() const;
699
706 void setSegmentationTolerance( double tolerance ) { mSegmentationTolerance = tolerance; }
707
712 double segmentationTolerance() const { return mSegmentationTolerance; }
713
720 void setSegmentationToleranceType( QgsAbstractGeometry::SegmentationToleranceType type ) { mSegmentationToleranceType = type; }
721
727
728 // Conversions
729
740 double convertToPainterUnits( double size, Qgis::RenderUnit unit, const QgsMapUnitScale &scale = QgsMapUnitScale(), Qgis::RenderSubcomponentProperty property = Qgis::RenderSubcomponentProperty::Generic ) const;
741
747 double convertToMapUnits( double size, Qgis::RenderUnit unit, const QgsMapUnitScale &scale = QgsMapUnitScale() ) const;
748
753 double convertFromMapUnits( double sizeInMapUnits, Qgis::RenderUnit outputUnit ) const;
754
760 double convertMetersToMapUnits( double meters ) const;
761
769 {
770 return mTextRenderFormat;
771 }
772
780 {
781 mTextRenderFormat = format;
782 }
783
789 QList<QgsRenderedFeatureHandlerInterface *> renderedFeatureHandlers() const;
790
796 bool hasRenderedFeatureHandlers() const { return mHasRenderedFeatureHandlers; }
797
806 void setMaskIdProvider( QgsMaskIdProvider *provider ) { mMaskIdProvider = provider; }
807
813 const QgsMaskIdProvider *maskIdProvider() const { return mMaskIdProvider; }
814
820 void setCurrentMaskId( int id ) { mCurrentMaskId = id; }
821
828 int currentMaskId() const { return mCurrentMaskId; }
829
839 void setIsGuiPreview( bool preview ) { mIsGuiPreview = preview; }
840
851 bool isGuiPreview() const { return mIsGuiPreview; }
852
859 QVariantMap customRenderingFlags() const { return mCustomRenderingFlags; }
860
868 void setCustomRenderingFlag( const QString &flag, const QVariant &value ) { mCustomRenderingFlags[flag] = value; }
869
876 void clearCustomRenderingFlag( const QString &flag ) { mCustomRenderingFlags.remove( flag ); }
877
885 QList< QgsMapClippingRegion > clippingRegions() const;
886
901 QgsGeometry featureClipGeometry() const;
902
912 void setFeatureClipGeometry( const QgsGeometry &geometry );
913
921 QPointF textureOrigin() const;
922
930 void setTextureOrigin( const QPointF &origin );
931
938 void addSymbolLayerClipPath( const QString &symbolLayerId, QPainterPath path );
939
946 QList<QPainterPath> symbolLayerClipPaths( const QString &symbolLayerId ) const;
947
954 void addSymbolLayerClipGeometry( const QString &symbolLayerId, const QgsGeometry &geometry );
955
962 QVector<QgsGeometry> symbolLayerClipGeometries( const QString &symbolLayerId ) const;
963
970 QgsDoubleRange zRange() const;
971
978 void setZRange( const QgsDoubleRange &range );
979
988 QSize outputSize() const;
989
996 void setOutputSize( QSize size );
997
1006 float devicePixelRatio() const;
1007
1016 void setDevicePixelRatio( float ratio );
1017
1029 QSize deviceOutputSize() const;
1030
1038 void setImageFormat( QImage::Format format ) { mImageFormat = format; }
1039
1047 QImage::Format imageFormat() const { return mImageFormat; }
1048
1055 Qgis::RendererUsage rendererUsage() const {return mRendererUsage;}
1056
1066 void setRendererUsage( Qgis::RendererUsage usage ) {mRendererUsage = usage;}
1067
1076 double frameRate() const;
1077
1086 void setFrameRate( double rate );
1087
1096 long long currentFrame() const;
1097
1106 void setCurrentFrame( long long frame );
1107
1108
1115 QgsElevationMap *elevationMap() const;
1116
1125 void setElevationMap( QgsElevationMap *map );
1126
1127 private:
1128
1130
1132 QPainter *mPainter = nullptr;
1133
1135 QPainter *mPreviewRenderPainter = nullptr;
1136
1143 QMap<int, QPainter *> mMaskPainter;
1144
1150 QgsMaskIdProvider *mMaskIdProvider = nullptr;
1151
1156 int mCurrentMaskId = -1;
1157
1162 bool mIsGuiPreview = false;
1163
1165 QgsCoordinateTransform mCoordTransform;
1166
1171 QgsDistanceArea mDistanceArea;
1172
1173 QgsRectangle mExtent;
1174 QgsRectangle mOriginalMapExtent;
1175
1176 QgsMapToPixel mMapToPixel;
1177
1179 bool mRenderingStopped = false;
1180
1182 QgsFeedback *mFeedback = nullptr;
1183
1185 double mScaleFactor = 1.0;
1186
1188 double mDpiTarget = -1.0;
1189
1191 double mRendererScale = 1.0;
1192
1193 double mSymbologyReferenceScale = -1;
1194
1196 QgsLabelingEngine *mLabelingEngine = nullptr;
1197
1199 QgsLabelSink *mLabelSink = nullptr;
1200
1202 QColor mSelectionColor;
1203
1205 QgsVectorSimplifyMethod mVectorSimplifyMethod;
1206
1208 QgsExpressionContext mExpressionContext;
1209
1211 const QgsAbstractGeometry *mGeometry = nullptr;
1212
1214 std::unique_ptr< QgsFeatureFilterProvider > mFeatureFilterProvider;
1215
1216 double mSegmentationTolerance = M_PI_2 / 90;
1217
1219
1220 QgsCoordinateTransformContext mTransformContext;
1221
1222 QgsPathResolver mPathResolver;
1223
1225 QList< QgsRenderedFeatureHandlerInterface * > mRenderedFeatureHandlers;
1226 bool mHasRenderedFeatureHandlers = false;
1227 QVariantMap mCustomRenderingFlags;
1228
1229 QSet<QString> mDisabledSymbolLayers;
1230
1231 QList< QgsMapClippingRegion > mClippingRegions;
1232 QgsGeometry mFeatureClipGeometry;
1233
1234 QPointF mTextureOrigin;
1235
1236 QgsDoubleRange mZRange;
1237
1238 QSize mSize;
1239 float mDevicePixelRatio = 1.0;
1240 QImage::Format mImageFormat = QImage::Format_ARGB32_Premultiplied;
1241
1243
1244 double mFrameRate = -1;
1245 long long mCurrentFrame = -1;
1246
1248 QMap< QString, QList<QPainterPath> > mSymbolLayerClipPaths;
1249
1251 QMap< QString, QVector<QgsGeometry> > mSymbolLayerClippingGeometries;
1252
1253#ifdef QGISDEBUG
1254 bool mHasTransformContext = false;
1255#endif
1256
1257 QgsElevationMap *mElevationMap = nullptr;
1258};
1259
1260#ifndef SIP_RUN
1261
1274{
1275 public:
1276
1283 QgsScopedRenderContextPainterSwap( QgsRenderContext &context, QPainter *temporaryPainter )
1284 : mContext( context )
1285 , mPreviousPainter( context.painter() )
1286 {
1287 mContext.setPainter( temporaryPainter );
1288 }
1289
1293 void reset()
1294 {
1295 if ( !mReleased )
1296 {
1297 mContext.setPainter( mPreviousPainter );
1298 mReleased = true;
1299 }
1300 }
1301
1309
1310 private:
1311
1312 QgsRenderContext &mContext;
1313 QPainter *mPreviousPainter = nullptr;
1314 bool mReleased = false;
1315};
1316
1317
1330{
1331 public:
1332
1341 : mContext( context )
1342 {
1343 if ( mContext.painter() )
1344 mContext.painter()->scale( mContext.scaleFactor(), mContext.scaleFactor() );
1345 }
1346
1351 {
1352 if ( mContext.painter() )
1353 mContext.painter()->scale( 1.0 / mContext.scaleFactor(), 1.0 / mContext.scaleFactor() );
1354 }
1355
1356 private:
1357
1358 QgsRenderContext &mContext;
1359};
1360
1361
1374{
1375 public:
1376
1385 : mContext( context )
1386 {
1387 if ( mContext.painter() )
1388 mContext.painter()->scale( 1.0 / mContext.scaleFactor(), 1.0 / mContext.scaleFactor() );
1389 }
1390
1395 {
1396 if ( mContext.painter() )
1397 mContext.painter()->scale( mContext.scaleFactor(), mContext.scaleFactor() );
1398 }
1399
1400 private:
1401
1402 QgsRenderContext &mContext;
1403};
1404
1405
1418{
1419 public:
1420
1426 QgsScopedQPainterState( QPainter *painter )
1427 : mPainter( painter )
1428 {
1429 mPainter->save();
1430 }
1431
1436 {
1437 mPainter->restore();
1438 }
1439
1440 private:
1441
1442 QPainter *mPainter = nullptr;
1443};
1444
1445
1457{
1458 public:
1459
1466 : mContext( &context )
1467 , mOriginalScale( context.symbologyReferenceScale() )
1468 {
1469 mContext->setSymbologyReferenceScale( scale );
1470 }
1471
1476 : mContext( o.mContext )
1477 , mOriginalScale( o.mOriginalScale )
1478 {
1479 o.mContext = nullptr;
1480 }
1481
1486 {
1487 if ( mContext )
1488 mContext->setSymbologyReferenceScale( mOriginalScale );
1489 }
1490
1491 private:
1492
1493 QgsRenderContext *mContext = nullptr;
1494 double mOriginalScale = 0;
1495};
1496
1497
1498#endif
1499
1500#endif
RenderSubcomponentProperty
Rendering subcomponent properties.
Definition qgis.h:2601
@ Generic
Generic subcomponent property.
QFlags< RenderContextFlag > RenderContextFlags
Render context flags.
Definition qgis.h:2372
TextRenderFormat
Options for rendering text.
Definition qgis.h:2404
@ AlwaysOutlines
Always render text using path objects (AKA outlines/curves). This setting guarantees the best quality...
RenderUnit
Rendering size units.
Definition qgis.h:4489
RenderContextFlag
Flags which affect rendering operations.
Definition qgis.h:2349
RendererUsage
Usage of the renderer.
Definition qgis.h:2940
@ Unknown
Renderer used for unknown usage.
Abstract base class for all geometries.
SegmentationToleranceType
Segmentation tolerance as maximum angle or maximum difference between approximation and circle.
@ MaximumAngle
Maximum angle between generating radii (lines from arc center to output vertices)
Contains information about the context in which a coordinate transform is executed.
Class for doing transforms between two map coordinate systems.
A general purpose distance and area calculator, capable of performing ellipsoid based calculations.
QgsRange which stores a range of double values.
Definition qgsrange.h:231
Stores digital elevation model in a raster image which may get updated as a part of map layer renderi...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Abstract interface for use by classes that filter the features or attributes of a layer.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition qgsfeedback.h:44
A geometry is the spatial representation of a feature.
Abstract base class that can be used to intercept rendered labels from a labeling / rendering job.
The QgsLabelingEngine class provides map labeling functionality.
A map clipping region (in map coordinates and CRS).
The QgsMapSettings class contains configuration for rendering of the map.
Perform transforms between map coordinates and device coordinates.
Struct for storing maximum and minimum scales for measurements in map units.
This class allows the creation of mask ids based on the different label layers and to give a mask id ...
Resolves relative paths into absolute paths and vice versa.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
const QgsMaskIdProvider * maskIdProvider() const
Returns the mask id provider attached to the context.
void setMapExtent(const QgsRectangle &extent)
Sets the original extent of the map being rendered.
double scaleFactor() const
Returns the scaling factor for the render to convert painter units to physical sizes.
void setRenderingStopped(bool stopped)
Sets whether the rendering operation has been stopped and any ongoing rendering should be canceled im...
void setDistanceArea(const QgsDistanceArea &distanceArea)
A general purpose distance and area calculator, capable of performing ellipsoid based calculations.
Qgis::RendererUsage rendererUsage() const
Returns the renderer usage.
void setScaleFactor(double factor)
Sets the scaling factor for the render to convert painter units to physical sizes.
bool hasRenderedFeatureHandlers() const
Returns true if the context has any rendered feature handlers.
void setImageFormat(QImage::Format format)
Sets QImage format which should be used for QImages created during rendering.
void setSegmentationToleranceType(QgsAbstractGeometry::SegmentationToleranceType type)
Sets segmentation tolerance type (maximum angle or maximum difference between curve and approximation...
double symbologyReferenceScale() const
Returns the symbology reference scale.
double segmentationTolerance() const
Gets the segmentation tolerance applied when rendering curved geometries.
const QPainter * painter() const
Returns the const destination QPainter for the render operation.
void clearCustomRenderingFlag(const QString &flag)
Clears the specified custom rendering flag.
const QgsDistanceArea & distanceArea() const
A general purpose distance and area calculator, capable of performing ellipsoid based calculations.
const QPainter * previewRenderPainter() const
Returns the const destination QPainter for temporary in-progress preview renders.
QPainter * painter()
Returns the destination QPainter for the render operation.
double rendererScale() const
Returns the renderer map scale.
QgsExpressionContext & expressionContext()
Gets the expression context.
void setTextRenderFormat(Qgis::TextRenderFormat format)
Sets the text render format, which dictates how text is rendered (e.g.
void setGeometry(const QgsAbstractGeometry *geometry)
Sets pointer to original (unsegmentized) geometry.
void setVectorSimplifyMethod(const QgsVectorSimplifyMethod &simplifyMethod)
Sets the simplification setting to use when rendering vector layers.
QVariantMap customRenderingFlags() const
Gets custom rendering flags.
QgsLabelSink * labelSink() const
Returns the associated label sink, or nullptr if not set.
bool isGuiPreview() const
Returns the Gui preview mode.
void setPreviewRenderPainter(QPainter *painter)
Sets the destination painter for temporary in-progress preview renders.
const QgsRectangle & extent() const
When rendering a map layer, calling this method returns the "clipping" extent for the layer (in the l...
void setCurrentMaskId(int id)
Stores a mask id as the "current" one.
void setDpiTarget(double dpi)
Sets the targeted dpi for rendering.
~QgsRenderContext() override
void setPathResolver(const QgsPathResolver &resolver)
Sets the path resolver for conversion between relative and absolute paths during rendering operations...
void setIsGuiPreview(bool preview)
Sets GUI preview mode.
void setLabelSink(QgsLabelSink *sink)
Assigns the label sink which will take over responsibility for handling labels.
const QgsExpressionContext & expressionContext() const
Gets the expression context (const version).
Qgis::TextRenderFormat textRenderFormat() const
Returns the text render format, which dictates how text is rendered (e.g.
QgsRectangle mapExtent() const
Returns the original extent of the map being rendered.
void setSymbologyReferenceScale(double scale)
Sets the symbology reference scale.
double dpiTarget() const
Returns the targeted DPI for rendering.
const QgsVectorSimplifyMethod & vectorSimplifyMethod() const
Returns the simplification settings to use when rendering vector layers.
const QgsMapToPixel & mapToPixel() const
Returns the context's map to pixel transform, which transforms between map coordinates and device coo...
void setMaskIdProvider(QgsMaskIdProvider *provider)
Attaches a mask id provider to the context.
QColor selectionColor() const
Returns the color to use when rendering selected features.
void setExtent(const QgsRectangle &extent)
When rendering a map layer, calling this method sets the "clipping" extent for the layer (in the laye...
QPainter * maskPainter(int id=0)
Returns a mask QPainter for the render operation.
void setMapToPixel(const QgsMapToPixel &mtp)
Sets the context's map to pixel transform, which transforms between map coordinates and device coordi...
int currentMaskId() const
Returns the current mask id, which can be used with maskPainter()
void setCustomRenderingFlag(const QString &flag, const QVariant &value)
Sets a custom rendering flag.
void setPainter(QPainter *p)
Sets the destination QPainter for the render operation.
void setMaskPainter(QPainter *p, int id=0)
Sets a mask QPainter for the render operation.
void setLabelingEngine(QgsLabelingEngine *engine)
Assigns the labeling engine.
bool renderingStopped() const
Returns true if the rendering operation has been stopped and any ongoing rendering should be canceled...
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context.
void setRendererScale(double scale)
Sets the renderer map scale.
QgsLabelingEngine * labelingEngine() const
Gets access to new labeling engine (may be nullptr).
QPainter * previewRenderPainter()
Returns the const destination QPainter for temporary in-progress preview renders.
void setRendererUsage(Qgis::RendererUsage usage)
Sets the renderer usage.
QgsAbstractGeometry::SegmentationToleranceType segmentationToleranceType() const
Gets segmentation tolerance type (maximum angle or maximum difference between curve and approximation...
const QgsAbstractGeometry * geometry() const
Returns pointer to the unsegmentized geometry.
QImage::Format imageFormat() const
Returns the QImage format which should be used for QImages created during rendering.
const QgsPathResolver & pathResolver() const
Returns the path resolver for conversion between relative and absolute paths during rendering operati...
void setSelectionColor(const QColor &color)
Sets the color to use when rendering selected features.
void setSegmentationTolerance(double tolerance)
Sets the segmentation tolerance applied when rendering curved geometries.
An interface for classes which provider custom handlers for features rendered as part of a map render...
Scoped object for saving and restoring a QPainter object's state.
QgsScopedQPainterState(QPainter *painter)
Constructor for QgsScopedQPainterState.
~QgsScopedQPainterState()
Restores the painter back to its original state.
Scoped object for temporary replacement of a QgsRenderContext destination painter.
QgsScopedRenderContextPainterSwap(QgsRenderContext &context, QPainter *temporaryPainter)
Constructor for QgsScopedRenderContextPainterSwap.
~QgsScopedRenderContextPainterSwap()
Returns the destination painter for the context back to the original QPainter object.
void reset()
Resets the destination painter for the context back to the original QPainter object.
Scoped object for temporary override of the symbologyReferenceScale property of a QgsRenderContext.
QgsScopedRenderContextReferenceScaleOverride(QgsScopedRenderContextReferenceScaleOverride &&o) noexcept
Move constructor.
~QgsScopedRenderContextReferenceScaleOverride()
Returns the render context back to the original reference scale.
QgsScopedRenderContextReferenceScaleOverride(QgsRenderContext &context, double scale)
Constructor for QgsScopedRenderContextReferenceScaleOverride.
Scoped object for temporary scaling of a QgsRenderContext for millimeter based rendering.
~QgsScopedRenderContextScaleToMm()
Returns the destination painter back to pixel based units.
QgsScopedRenderContextScaleToMm(QgsRenderContext &context)
Constructor for QgsScopedRenderContextScaleToMm.
Scoped object for temporary scaling of a QgsRenderContext for pixel based rendering.
QgsScopedRenderContextScaleToPixels(QgsRenderContext &context)
Constructor for QgsScopedRenderContextScaleToPixels.
~QgsScopedRenderContextScaleToPixels()
Returns the destination painter back to millimeter based units.
Base class for objects with an associated (optional) temporal range.
This class contains information how to simplify geometries fetched from a vector layer.
#define SIP_DEPRECATED
Definition qgis_sip.h:106
#define SIP_SKIP
Definition qgis_sip.h:126