QGIS API Documentation 3.38.0-Grenoble (exported)
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"
41
42class QPainter;
45class QgsMapSettings;
47class QgsSymbolLayer;
50class QgsElevationMap;
51
52
61class CORE_EXPORT QgsRenderContext : public QgsTemporalRangeObject
62{
63 public:
66
68 QgsRenderContext &operator=( const QgsRenderContext &rh );
69
73 void setFlags( Qgis::RenderContextFlags flags );
74
78 void setFlag( Qgis::RenderContextFlag flag, bool on = true );
79
83 Qgis::RenderContextFlags flags() const;
84
88 bool testFlag( Qgis::RenderContextFlag flag ) const;
89
93 static QgsRenderContext fromMapSettings( const QgsMapSettings &mapSettings );
94
100 static QgsRenderContext fromQPainter( QPainter *painter );
101
102 //getters
103
108 QPainter *painter() {return mPainter;}
109
110#ifndef SIP_RUN
111
117 const QPainter *painter() const { return mPainter; }
118#endif
119
128 QPainter *previewRenderPainter() {return mPreviewRenderPainter;}
129
130#ifndef SIP_RUN
131
140 const QPainter *previewRenderPainter() const { return mPreviewRenderPainter; }
141#endif
142
152 void setPainterFlagsUsingContext( QPainter *painter = nullptr ) const;
153
163 QPainter *maskPainter( int id = 0 ) { return mMaskPainter.value( id, nullptr ); }
164
165 // TODO QGIS 4 : remove the V2 from method name
166
177 Q_DECL_DEPRECATED void setDisabledSymbolLayers( const QSet<const QgsSymbolLayer *> &symbolLayers ) SIP_DEPRECATED;
178
188 void setDisabledSymbolLayersV2( const QSet<QString> &symbolLayers );
189
200 Q_DECL_DEPRECATED QSet<const QgsSymbolLayer *> disabledSymbolLayers() const SIP_DEPRECATED;
201
211 QSet<QString> disabledSymbolLayersV2() const;
212
222 bool isSymbolLayerEnabled( const QgsSymbolLayer *layer ) const;
223
234 QgsCoordinateTransform coordinateTransform() const {return mCoordTransform;}
235
239 const QgsDistanceArea &distanceArea() const { return mDistanceArea; }
240
248 QgsCoordinateTransformContext transformContext() const;
249
257 void setTransformContext( const QgsCoordinateTransformContext &context );
258
265 const QgsPathResolver &pathResolver() const { return mPathResolver; }
266
273 void setPathResolver( const QgsPathResolver &resolver ) { mPathResolver = resolver; }
274
290 const QgsRectangle &extent() const { return mExtent; }
291
302 QgsRectangle mapExtent() const { return mOriginalMapExtent; }
303
309 const QgsMapToPixel &mapToPixel() const {return mMapToPixel;}
310
317 double scaleFactor() const {return mScaleFactor;}
318
325 double dpiTarget() const {return mDpiTarget;}
326
336 bool renderingStopped() const {return mRenderingStopped;}
337
349 void setFeedback( QgsFeedback *feedback );
350
359 QgsFeedback *feedback() const;
360
367 bool forceVectorOutput() const;
368
374 bool useAdvancedEffects() const;
375
381 void setUseAdvancedEffects( bool enabled );
382
388 bool drawEditingInformation() const;
389
395 double rendererScale() const {return mRendererScale;}
396
397
413 double symbologyReferenceScale() const { return mSymbologyReferenceScale; }
414
419 QgsLabelingEngine *labelingEngine() const { return mLabelingEngine; } SIP_SKIP
420
426 QgsLabelSink *labelSink() const { return mLabelSink; } SIP_SKIP
427
433 QColor selectionColor() const { return mSelectionColor; }
434
442 bool showSelection() const;
443
444 //setters
445
456 void setCoordinateTransform( const QgsCoordinateTransform &t );
457
463 void setMapToPixel( const QgsMapToPixel &mtp ) {mMapToPixel = mtp;}
464
477 void setExtent( const QgsRectangle &extent ) {mExtent = extent;}
478
489 void setMapExtent( const QgsRectangle &extent ) { mOriginalMapExtent = extent; }
490
496 void setDrawEditingInformation( bool b );
497
508 void setRenderingStopped( bool stopped ) {mRenderingStopped = stopped;}
509
514 void setDistanceArea( const QgsDistanceArea &distanceArea ) {mDistanceArea = distanceArea ;}
515
522 void setScaleFactor( double factor ) {mScaleFactor = factor;}
523
530 void setDpiTarget( double dpi ) {mDpiTarget = dpi;}
531
537 void setRendererScale( double scale ) {mRendererScale = scale;}
538
554 void setSymbologyReferenceScale( double scale ) { mSymbologyReferenceScale = scale; }
555
562 void setPainter( QPainter *p ) {mPainter = p;}
563
574 void setPreviewRenderPainter( QPainter *painter ) { mPreviewRenderPainter = painter; }
575
583 void setMaskPainter( QPainter *p, int id = 0 ) { mMaskPainter[id] = p; }
584
591 void setForceVectorOutput( bool force );
592
597 void setLabelingEngine( QgsLabelingEngine *engine ) { mLabelingEngine = engine; } SIP_SKIP
598
605 void setLabelSink( QgsLabelSink *sink ) { mLabelSink = sink; } SIP_SKIP
606
612 void setSelectionColor( const QColor &color ) { mSelectionColor = color; }
613
621 void setShowSelection( bool showSelection );
622
628 bool useRenderingOptimization() const;
629
635 void setUseRenderingOptimization( bool enabled );
636
644 const QgsVectorSimplifyMethod &vectorSimplifyMethod() const { return mVectorSimplifyMethod; }
645
658 void setVectorSimplifyMethod( const QgsVectorSimplifyMethod &simplifyMethod ) { mVectorSimplifyMethod = simplifyMethod; }
659
665 void setExpressionContext( const QgsExpressionContext &context ) { mExpressionContext = context; }
666
672 QgsExpressionContext &expressionContext() { return mExpressionContext; }
673
680 const QgsExpressionContext &expressionContext() const { return mExpressionContext; } SIP_SKIP
681
683 const QgsAbstractGeometry *geometry() const { return mGeometry; }
685 void setGeometry( const QgsAbstractGeometry *geometry ) { mGeometry = geometry; }
686
692 void setFeatureFilterProvider( const QgsFeatureFilterProvider *ffp );
693
699 const QgsFeatureFilterProvider *featureFilterProvider() const;
700
707 void setSegmentationTolerance( double tolerance ) { mSegmentationTolerance = tolerance; }
708
713 double segmentationTolerance() const { return mSegmentationTolerance; }
714
721 void setSegmentationToleranceType( QgsAbstractGeometry::SegmentationToleranceType type ) { mSegmentationToleranceType = type; }
722
728
729 // Conversions
730
741 double convertToPainterUnits( double size, Qgis::RenderUnit unit, const QgsMapUnitScale &scale = QgsMapUnitScale(), Qgis::RenderSubcomponentProperty property = Qgis::RenderSubcomponentProperty::Generic ) const;
742
748 double convertToMapUnits( double size, Qgis::RenderUnit unit, const QgsMapUnitScale &scale = QgsMapUnitScale() ) const;
749
754 double convertFromMapUnits( double sizeInMapUnits, Qgis::RenderUnit outputUnit ) const;
755
761 double convertMetersToMapUnits( double meters ) const;
762
770 {
771 return mTextRenderFormat;
772 }
773
781 {
782 mTextRenderFormat = format;
783 }
784
790 QList<QgsRenderedFeatureHandlerInterface *> renderedFeatureHandlers() const;
791
797 bool hasRenderedFeatureHandlers() const { return mHasRenderedFeatureHandlers; }
798
807 void setMaskIdProvider( QgsMaskIdProvider *provider ) { mMaskIdProvider = provider; }
808
814 const QgsMaskIdProvider *maskIdProvider() const { return mMaskIdProvider; }
815
821 void setCurrentMaskId( int id ) { mCurrentMaskId = id; }
822
829 int currentMaskId() const { return mCurrentMaskId; }
830
840 void setIsGuiPreview( bool preview ) { mIsGuiPreview = preview; }
841
852 bool isGuiPreview() const { return mIsGuiPreview; }
853
860 QVariantMap customRenderingFlags() const { return mCustomRenderingFlags; }
861
869 void setCustomRenderingFlag( const QString &flag, const QVariant &value ) { mCustomRenderingFlags[flag] = value; }
870
877 void clearCustomRenderingFlag( const QString &flag ) { mCustomRenderingFlags.remove( flag ); }
878
886 QList< QgsMapClippingRegion > clippingRegions() const;
887
902 QgsGeometry featureClipGeometry() const;
903
913 void setFeatureClipGeometry( const QgsGeometry &geometry );
914
922 QPointF textureOrigin() const;
923
931 void setTextureOrigin( const QPointF &origin );
932
940 const QgsMaskRenderSettings &maskSettings() const SIP_SKIP { return mMaskRenderSettings; }
941
949 QgsMaskRenderSettings &maskSettings() { return mMaskRenderSettings; }
950
958 void setMaskSettings( const QgsMaskRenderSettings &settings );
959
966 void addSymbolLayerClipPath( const QString &symbolLayerId, QPainterPath path );
967
974 QList<QPainterPath> symbolLayerClipPaths( const QString &symbolLayerId ) const;
975
982 void addSymbolLayerClipGeometry( const QString &symbolLayerId, const QgsGeometry &geometry );
983
990 bool symbolLayerHasClipGeometries( const QString &symbolLayerId ) const;
991
999 QVector<QgsGeometry> symbolLayerClipGeometries( const QString &symbolLayerId ) const;
1000
1007 QgsDoubleRange zRange() const;
1008
1015 void setZRange( const QgsDoubleRange &range );
1016
1025 QSize outputSize() const;
1026
1033 void setOutputSize( QSize size );
1034
1043 float devicePixelRatio() const;
1044
1053 void setDevicePixelRatio( float ratio );
1054
1066 QSize deviceOutputSize() const;
1067
1075 void setImageFormat( QImage::Format format ) { mImageFormat = format; }
1076
1084 QImage::Format imageFormat() const { return mImageFormat; }
1085
1092 Qgis::RendererUsage rendererUsage() const {return mRendererUsage;}
1093
1103 void setRendererUsage( Qgis::RendererUsage usage ) {mRendererUsage = usage;}
1104
1113 double frameRate() const;
1114
1123 void setFrameRate( double rate );
1124
1133 long long currentFrame() const;
1134
1143 void setCurrentFrame( long long frame );
1144
1145
1152 QgsElevationMap *elevationMap() const;
1153
1162 void setElevationMap( QgsElevationMap *map );
1163
1164 private:
1165
1167
1169 QPainter *mPainter = nullptr;
1170
1172 QPainter *mPreviewRenderPainter = nullptr;
1173
1180 QMap<int, QPainter *> mMaskPainter;
1181
1187 QgsMaskIdProvider *mMaskIdProvider = nullptr;
1188
1193 int mCurrentMaskId = -1;
1194
1199 bool mIsGuiPreview = false;
1200
1202 QgsCoordinateTransform mCoordTransform;
1203
1208 QgsDistanceArea mDistanceArea;
1209
1210 QgsRectangle mExtent;
1211 QgsRectangle mOriginalMapExtent;
1212
1213 QgsMapToPixel mMapToPixel;
1214
1216 bool mRenderingStopped = false;
1217
1219 QgsFeedback *mFeedback = nullptr;
1220
1222 double mScaleFactor = 1.0;
1223
1225 double mDpiTarget = -1.0;
1226
1228 double mRendererScale = 1.0;
1229
1230 double mSymbologyReferenceScale = -1;
1231
1233 QgsLabelingEngine *mLabelingEngine = nullptr;
1234
1236 QgsLabelSink *mLabelSink = nullptr;
1237
1239 QColor mSelectionColor;
1240
1242 QgsVectorSimplifyMethod mVectorSimplifyMethod;
1243
1245 QgsExpressionContext mExpressionContext;
1246
1248 const QgsAbstractGeometry *mGeometry = nullptr;
1249
1251 std::unique_ptr< QgsFeatureFilterProvider > mFeatureFilterProvider;
1252
1253 double mSegmentationTolerance = M_PI_2 / 90;
1254
1256
1257 QgsCoordinateTransformContext mTransformContext;
1258
1259 QgsPathResolver mPathResolver;
1260
1262 QList< QgsRenderedFeatureHandlerInterface * > mRenderedFeatureHandlers;
1263 bool mHasRenderedFeatureHandlers = false;
1264 QVariantMap mCustomRenderingFlags;
1265
1266 QSet<QString> mDisabledSymbolLayers;
1267
1268 QList< QgsMapClippingRegion > mClippingRegions;
1269 QgsGeometry mFeatureClipGeometry;
1270
1271 QPointF mTextureOrigin;
1272
1273 QgsDoubleRange mZRange;
1274
1275 QSize mSize;
1276 float mDevicePixelRatio = 1.0;
1277 QImage::Format mImageFormat = QImage::Format_ARGB32_Premultiplied;
1278
1280
1281 double mFrameRate = -1;
1282 long long mCurrentFrame = -1;
1283
1285 QMap< QString, QList<QPainterPath> > mSymbolLayerClipPaths;
1286
1288 QMap< QString, QVector<QgsGeometry> > mSymbolLayerClippingGeometries;
1289
1290 QgsMaskRenderSettings mMaskRenderSettings;
1291
1292#ifdef QGISDEBUG
1293 bool mHasTransformContext = false;
1294#endif
1295
1296 QgsElevationMap *mElevationMap = nullptr;
1297};
1298
1299#ifndef SIP_RUN
1300
1313{
1314 public:
1315
1322 QgsScopedRenderContextPainterSwap( QgsRenderContext &context, QPainter *temporaryPainter )
1323 : mContext( context )
1324 , mPreviousPainter( context.painter() )
1325 {
1326 mContext.setPainter( temporaryPainter );
1327 }
1328
1332 void reset()
1333 {
1334 if ( !mReleased )
1335 {
1336 mContext.setPainter( mPreviousPainter );
1337 mReleased = true;
1338 }
1339 }
1340
1348
1349 private:
1350
1351 QgsRenderContext &mContext;
1352 QPainter *mPreviousPainter = nullptr;
1353 bool mReleased = false;
1354};
1355
1356
1369{
1370 public:
1371
1380 : mContext( context )
1381 {
1382 if ( mContext.painter() )
1383 mContext.painter()->scale( mContext.scaleFactor(), mContext.scaleFactor() );
1384 }
1385
1390 {
1391 if ( mContext.painter() )
1392 mContext.painter()->scale( 1.0 / mContext.scaleFactor(), 1.0 / mContext.scaleFactor() );
1393 }
1394
1395 private:
1396
1397 QgsRenderContext &mContext;
1398};
1399
1400
1413{
1414 public:
1415
1424 : mContext( context )
1425 {
1426 if ( mContext.painter() )
1427 mContext.painter()->scale( 1.0 / mContext.scaleFactor(), 1.0 / mContext.scaleFactor() );
1428 }
1429
1434 {
1435 if ( mContext.painter() )
1436 mContext.painter()->scale( mContext.scaleFactor(), mContext.scaleFactor() );
1437 }
1438
1439 private:
1440
1441 QgsRenderContext &mContext;
1442};
1443
1444
1457{
1458 public:
1459
1465 QgsScopedQPainterState( QPainter *painter )
1466 : mPainter( painter )
1467 {
1468 mPainter->save();
1469 }
1470
1475 {
1476 mPainter->restore();
1477 }
1478
1479 private:
1480
1481 QPainter *mPainter = nullptr;
1482};
1483
1484
1496{
1497 public:
1498
1505 : mContext( &context )
1506 , mOriginalScale( context.symbologyReferenceScale() )
1507 {
1508 mContext->setSymbologyReferenceScale( scale );
1509 }
1510
1515 : mContext( o.mContext )
1516 , mOriginalScale( o.mOriginalScale )
1517 {
1518 o.mContext = nullptr;
1519 }
1520
1525 {
1526 if ( mContext )
1527 mContext->setSymbologyReferenceScale( mOriginalScale );
1528 }
1529
1530 private:
1531
1532 QgsRenderContext *mContext = nullptr;
1533 double mOriginalScale = 0;
1534};
1535
1536
1537#endif
1538
1539#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 ...
Contains settings regarding how masks are calculated and handled during a map render.
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.
QgsMaskRenderSettings & maskSettings()
Returns a reference to the mask render settings, which control how masks are drawn and behave during ...
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 QgsMaskRenderSettings & maskSettings() const
Returns a reference to the mask render settings, which control how masks are drawn and behave during ...
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