QGIS API Documentation 3.37.0-Master (c2d15952569)
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
936 void addSymbolLayerClipPath( const QString &symbolLayerId, QPainterPath path );
937
942 QList<QPainterPath> symbolLayerClipPaths( const QString &symbolLayerId ) const;
943
950 QgsDoubleRange zRange() const;
951
958 void setZRange( const QgsDoubleRange &range );
959
968 QSize outputSize() const;
969
976 void setOutputSize( QSize size );
977
986 float devicePixelRatio() const;
987
996 void setDevicePixelRatio( float ratio );
997
1009 QSize deviceOutputSize() const;
1010
1018 void setImageFormat( QImage::Format format ) { mImageFormat = format; }
1019
1027 QImage::Format imageFormat() const { return mImageFormat; }
1028
1035 Qgis::RendererUsage rendererUsage() const {return mRendererUsage;}
1036
1046 void setRendererUsage( Qgis::RendererUsage usage ) {mRendererUsage = usage;}
1047
1056 double frameRate() const;
1057
1066 void setFrameRate( double rate );
1067
1076 long long currentFrame() const;
1077
1086 void setCurrentFrame( long long frame );
1087
1088
1095 QgsElevationMap *elevationMap() const;
1096
1105 void setElevationMap( QgsElevationMap *map );
1106
1107 private:
1108
1109 Qgis::RenderContextFlags mFlags;
1110
1112 QPainter *mPainter = nullptr;
1113
1115 QPainter *mPreviewRenderPainter = nullptr;
1116
1123 QMap<int, QPainter *> mMaskPainter;
1124
1130 QgsMaskIdProvider *mMaskIdProvider = nullptr;
1131
1136 int mCurrentMaskId = -1;
1137
1142 bool mIsGuiPreview = false;
1143
1145 QgsCoordinateTransform mCoordTransform;
1146
1151 QgsDistanceArea mDistanceArea;
1152
1153 QgsRectangle mExtent;
1154 QgsRectangle mOriginalMapExtent;
1155
1156 QgsMapToPixel mMapToPixel;
1157
1159 bool mRenderingStopped = false;
1160
1162 QgsFeedback *mFeedback = nullptr;
1163
1165 double mScaleFactor = 1.0;
1166
1168 double mDpiTarget = -1.0;
1169
1171 double mRendererScale = 1.0;
1172
1173 double mSymbologyReferenceScale = -1;
1174
1176 QgsLabelingEngine *mLabelingEngine = nullptr;
1177
1179 QgsLabelSink *mLabelSink = nullptr;
1180
1182 QColor mSelectionColor;
1183
1185 QgsVectorSimplifyMethod mVectorSimplifyMethod;
1186
1188 QgsExpressionContext mExpressionContext;
1189
1191 const QgsAbstractGeometry *mGeometry = nullptr;
1192
1194 std::unique_ptr< QgsFeatureFilterProvider > mFeatureFilterProvider;
1195
1196 double mSegmentationTolerance = M_PI_2 / 90;
1197
1199
1200 QgsCoordinateTransformContext mTransformContext;
1201
1202 QgsPathResolver mPathResolver;
1203
1205 QList< QgsRenderedFeatureHandlerInterface * > mRenderedFeatureHandlers;
1206 bool mHasRenderedFeatureHandlers = false;
1207 QVariantMap mCustomRenderingFlags;
1208
1209 QSet<QString> mDisabledSymbolLayers;
1210
1211 QList< QgsMapClippingRegion > mClippingRegions;
1212 QgsGeometry mFeatureClipGeometry;
1213
1214 QPointF mTextureOrigin;
1215
1216 QgsDoubleRange mZRange;
1217
1218 QSize mSize;
1219 float mDevicePixelRatio = 1.0;
1220 QImage::Format mImageFormat = QImage::Format_ARGB32_Premultiplied;
1221
1223
1224 double mFrameRate = -1;
1225 long long mCurrentFrame = -1;
1226
1228 QMap< QString, QList<QPainterPath> > mSymbolLayerClipPaths;
1229
1230#ifdef QGISDEBUG
1231 bool mHasTransformContext = false;
1232#endif
1233
1234 QgsElevationMap *mElevationMap = nullptr;
1235};
1236
1237#ifndef SIP_RUN
1238
1251{
1252 public:
1253
1260 QgsScopedRenderContextPainterSwap( QgsRenderContext &context, QPainter *temporaryPainter )
1261 : mContext( context )
1262 , mPreviousPainter( context.painter() )
1263 {
1264 mContext.setPainter( temporaryPainter );
1265 }
1266
1270 void reset()
1271 {
1272 if ( !mReleased )
1273 {
1274 mContext.setPainter( mPreviousPainter );
1275 mReleased = true;
1276 }
1277 }
1278
1286
1287 private:
1288
1289 QgsRenderContext &mContext;
1290 QPainter *mPreviousPainter = nullptr;
1291 bool mReleased = false;
1292};
1293
1294
1307{
1308 public:
1309
1318 : mContext( context )
1319 {
1320 if ( mContext.painter() )
1321 mContext.painter()->scale( mContext.scaleFactor(), mContext.scaleFactor() );
1322 }
1323
1328 {
1329 if ( mContext.painter() )
1330 mContext.painter()->scale( 1.0 / mContext.scaleFactor(), 1.0 / mContext.scaleFactor() );
1331 }
1332
1333 private:
1334
1335 QgsRenderContext &mContext;
1336};
1337
1338
1351{
1352 public:
1353
1362 : mContext( context )
1363 {
1364 if ( mContext.painter() )
1365 mContext.painter()->scale( 1.0 / mContext.scaleFactor(), 1.0 / mContext.scaleFactor() );
1366 }
1367
1372 {
1373 if ( mContext.painter() )
1374 mContext.painter()->scale( mContext.scaleFactor(), mContext.scaleFactor() );
1375 }
1376
1377 private:
1378
1379 QgsRenderContext &mContext;
1380};
1381
1382
1395{
1396 public:
1397
1403 QgsScopedQPainterState( QPainter *painter )
1404 : mPainter( painter )
1405 {
1406 mPainter->save();
1407 }
1408
1413 {
1414 mPainter->restore();
1415 }
1416
1417 private:
1418
1419 QPainter *mPainter = nullptr;
1420};
1421
1422
1434{
1435 public:
1436
1443 : mContext( &context )
1444 , mOriginalScale( context.symbologyReferenceScale() )
1445 {
1446 mContext->setSymbologyReferenceScale( scale );
1447 }
1448
1453 : mContext( o.mContext )
1454 , mOriginalScale( o.mOriginalScale )
1455 {
1456 o.mContext = nullptr;
1457 }
1458
1463 {
1464 if ( mContext )
1465 mContext->setSymbologyReferenceScale( mOriginalScale );
1466 }
1467
1468 private:
1469
1470 QgsRenderContext *mContext = nullptr;
1471 double mOriginalScale = 0;
1472};
1473
1474
1475#endif
1476
1477#endif
RenderSubcomponentProperty
Rendering subcomponent properties.
Definition qgis.h:2442
@ Generic
Generic subcomponent property.
TextRenderFormat
Flags which control how map layer renderers behave.
Definition qgis.h:2287
@ AlwaysOutlines
Always render text using path objects (AKA outlines/curves). This setting guarantees the best quality...
RenderUnit
Rendering size units.
Definition qgis.h:4193
RenderContextFlag
Flags which affect rendering operations.
Definition qgis.h:2232
RendererUsage
Usage of the renderer.
Definition qgis.h:2781
@ 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:201
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