QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
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 QgsVectorSimplifyMethod &vectorSimplifyMethod() { return mVectorSimplifyMethod; }
645
653 const QgsVectorSimplifyMethod &vectorSimplifyMethod() const SIP_SKIP { return mVectorSimplifyMethod; }
654
667 void setVectorSimplifyMethod( const QgsVectorSimplifyMethod &simplifyMethod ) { mVectorSimplifyMethod = simplifyMethod; }
668
674 void setExpressionContext( const QgsExpressionContext &context ) { mExpressionContext = context; }
675
681 QgsExpressionContext &expressionContext() { return mExpressionContext; }
682
689 const QgsExpressionContext &expressionContext() const { return mExpressionContext; } SIP_SKIP
690
692 const QgsAbstractGeometry *geometry() const { return mGeometry; }
694 void setGeometry( const QgsAbstractGeometry *geometry ) { mGeometry = geometry; }
695
701 void setFeatureFilterProvider( const QgsFeatureFilterProvider *ffp );
702
708 const QgsFeatureFilterProvider *featureFilterProvider() const;
709
716 void setSegmentationTolerance( double tolerance ) { mSegmentationTolerance = tolerance; }
717
722 double segmentationTolerance() const { return mSegmentationTolerance; }
723
730 void setSegmentationToleranceType( QgsAbstractGeometry::SegmentationToleranceType type ) { mSegmentationToleranceType = type; }
731
737
738 // Conversions
739
751 double convertToPainterUnits( double size, Qgis::RenderUnit unit, const QgsMapUnitScale &scale = QgsMapUnitScale(), Qgis::RenderSubcomponentProperty property = Qgis::RenderSubcomponentProperty::Generic ) const;
752
760 double convertFromPainterUnits( double size, Qgis::RenderUnit unit ) const;
761
767 double convertToMapUnits( double size, Qgis::RenderUnit unit, const QgsMapUnitScale &scale = QgsMapUnitScale() ) const;
768
773 double convertFromMapUnits( double sizeInMapUnits, Qgis::RenderUnit outputUnit ) const;
774
779 double convertMetersToMapUnits( double meters ) const;
780
788 {
789 return mTextRenderFormat;
790 }
791
799 {
800 mTextRenderFormat = format;
801 }
802
808 QList<QgsRenderedFeatureHandlerInterface *> renderedFeatureHandlers() const;
809
815 bool hasRenderedFeatureHandlers() const { return mHasRenderedFeatureHandlers; }
816
825 void setMaskIdProvider( QgsMaskIdProvider *provider ) { mMaskIdProvider = provider; }
826
832 const QgsMaskIdProvider *maskIdProvider() const { return mMaskIdProvider; }
833
839 void setCurrentMaskId( int id ) { mCurrentMaskId = id; }
840
847 int currentMaskId() const { return mCurrentMaskId; }
848
858 void setIsGuiPreview( bool preview ) { mIsGuiPreview = preview; }
859
870 bool isGuiPreview() const { return mIsGuiPreview; }
871
878 Q_DECL_DEPRECATED QVariantMap customRenderingFlags() const SIP_DEPRECATED { return mCustomProperties; }
879
888 QVariantMap customProperties() const { return mCustomProperties; }
889
897 Q_DECL_DEPRECATED void setCustomRenderingFlag( const QString &flag, const QVariant &value ) SIP_DEPRECATED { mCustomProperties[flag] = value; }
898
907 void setCustomProperty( const QString &property, const QVariant &value ) { mCustomProperties[property] = value; }
908
915 Q_DECL_DEPRECATED void clearCustomRenderingFlag( const QString &flag ) SIP_DEPRECATED { mCustomProperties.remove( flag ); }
916
923 void clearCustomProperty( const QString &property ) { mCustomProperties.remove( property ); }
924
932 QList< QgsMapClippingRegion > clippingRegions() const;
933
948 QgsGeometry featureClipGeometry() const;
949
959 void setFeatureClipGeometry( const QgsGeometry &geometry );
960
968 QPointF textureOrigin() const;
969
977 void setTextureOrigin( const QPointF &origin );
978
986 const QgsMaskRenderSettings &maskSettings() const SIP_SKIP { return mMaskRenderSettings; }
987
995 QgsMaskRenderSettings &maskSettings() { return mMaskRenderSettings; }
996
1004 void setMaskSettings( const QgsMaskRenderSettings &settings );
1005
1012 Q_DECL_DEPRECATED void addSymbolLayerClipPath( const QString &symbolLayerId, QPainterPath path ) SIP_DEPRECATED;
1013
1020 Q_DECL_DEPRECATED QList<QPainterPath> symbolLayerClipPaths( const QString &symbolLayerId ) const SIP_DEPRECATED;
1021
1028 void addSymbolLayerClipGeometry( const QString &symbolLayerId, const QgsGeometry &geometry );
1029
1036 bool symbolLayerHasClipGeometries( const QString &symbolLayerId ) const;
1037
1045 QVector<QgsGeometry> symbolLayerClipGeometries( const QString &symbolLayerId ) const;
1046
1053 QgsDoubleRange zRange() const;
1054
1061 void setZRange( const QgsDoubleRange &range );
1062
1071 QSize outputSize() const;
1072
1079 void setOutputSize( QSize size );
1080
1089 float devicePixelRatio() const;
1090
1099 void setDevicePixelRatio( float ratio );
1100
1112 QSize deviceOutputSize() const;
1113
1121 void setImageFormat( QImage::Format format ) { mImageFormat = format; }
1122
1130 QImage::Format imageFormat() const { return mImageFormat; }
1131
1138 Qgis::RendererUsage rendererUsage() const {return mRendererUsage;}
1139
1149 void setRendererUsage( Qgis::RendererUsage usage ) {mRendererUsage = usage;}
1150
1159 double frameRate() const;
1160
1169 void setFrameRate( double rate );
1170
1179 long long currentFrame() const;
1180
1189 void setCurrentFrame( long long frame );
1190
1191
1198 QgsElevationMap *elevationMap() const;
1199
1208 void setElevationMap( QgsElevationMap *map );
1209
1210 private:
1211
1213
1215 QPainter *mPainter = nullptr;
1216
1218 QPainter *mPreviewRenderPainter = nullptr;
1219
1226 QMap<int, QPainter *> mMaskPainter;
1227
1233 QgsMaskIdProvider *mMaskIdProvider = nullptr;
1234
1239 int mCurrentMaskId = -1;
1240
1245 bool mIsGuiPreview = false;
1246
1248 QgsCoordinateTransform mCoordTransform;
1249
1254 QgsDistanceArea mDistanceArea;
1255
1256 QgsRectangle mExtent;
1257 QgsRectangle mOriginalMapExtent;
1258
1259 QgsMapToPixel mMapToPixel;
1260
1262 bool mRenderingStopped = false;
1263
1265 QgsFeedback *mFeedback = nullptr;
1266
1268 double mScaleFactor = 1.0;
1269
1271 double mDpiTarget = -1.0;
1272
1274 double mRendererScale = 1.0;
1275
1276 double mSymbologyReferenceScale = -1;
1277
1279 QgsLabelingEngine *mLabelingEngine = nullptr;
1280
1282 QgsLabelSink *mLabelSink = nullptr;
1283
1285 QColor mSelectionColor;
1286
1288 QgsVectorSimplifyMethod mVectorSimplifyMethod;
1289
1291 QgsExpressionContext mExpressionContext;
1292
1294 const QgsAbstractGeometry *mGeometry = nullptr;
1295
1297 std::unique_ptr< QgsFeatureFilterProvider > mFeatureFilterProvider;
1298
1299 double mSegmentationTolerance = M_PI_2 / 90;
1300
1302
1303 QgsCoordinateTransformContext mTransformContext;
1304
1305 QgsPathResolver mPathResolver;
1306
1308 QList< QgsRenderedFeatureHandlerInterface * > mRenderedFeatureHandlers;
1309 bool mHasRenderedFeatureHandlers = false;
1310 QVariantMap mCustomProperties;
1311
1312 QSet<QString> mDisabledSymbolLayers;
1313
1314 QList< QgsMapClippingRegion > mClippingRegions;
1315 QgsGeometry mFeatureClipGeometry;
1316
1317 QPointF mTextureOrigin;
1318
1319 QgsDoubleRange mZRange;
1320
1321 QSize mSize;
1322 float mDevicePixelRatio = 1.0;
1323 QImage::Format mImageFormat = QImage::Format_ARGB32_Premultiplied;
1324
1326
1327 double mFrameRate = -1;
1328 long long mCurrentFrame = -1;
1329
1331 QMap< QString, QVector<QgsGeometry> > mSymbolLayerClippingGeometries;
1332
1333 QgsMaskRenderSettings mMaskRenderSettings;
1334
1335#ifdef QGISDEBUG
1336 bool mHasTransformContext = false;
1337#endif
1338
1339 QgsElevationMap *mElevationMap = nullptr;
1340};
1341
1342#ifndef SIP_RUN
1343
1356{
1357 public:
1358
1365 QgsScopedRenderContextPainterSwap( QgsRenderContext &context, QPainter *temporaryPainter )
1366 : mContext( context )
1367 , mPreviousPainter( context.painter() )
1368 {
1369 mContext.setPainter( temporaryPainter );
1370 }
1371
1375 void reset()
1376 {
1377 if ( !mReleased )
1378 {
1379 mContext.setPainter( mPreviousPainter );
1380 mReleased = true;
1381 }
1382 }
1383
1391
1392 private:
1393
1394 QgsRenderContext &mContext;
1395 QPainter *mPreviousPainter = nullptr;
1396 bool mReleased = false;
1397};
1398
1399
1412{
1413 public:
1414
1423 : mContext( context )
1424 {
1425 if ( mContext.painter() )
1426 mContext.painter()->scale( mContext.scaleFactor(), mContext.scaleFactor() );
1427 }
1428
1433 {
1434 if ( mContext.painter() )
1435 mContext.painter()->scale( 1.0 / mContext.scaleFactor(), 1.0 / mContext.scaleFactor() );
1436 }
1437
1438 private:
1439
1440 QgsRenderContext &mContext;
1441};
1442
1443
1456{
1457 public:
1458
1467 : mContext( context )
1468 {
1469 if ( mContext.painter() )
1470 mContext.painter()->scale( 1.0 / mContext.scaleFactor(), 1.0 / mContext.scaleFactor() );
1471 }
1472
1477 {
1478 if ( mContext.painter() )
1479 mContext.painter()->scale( mContext.scaleFactor(), mContext.scaleFactor() );
1480 }
1481
1482 private:
1483
1484 QgsRenderContext &mContext;
1485};
1486
1487
1500{
1501 public:
1502
1508 QgsScopedQPainterState( QPainter *painter )
1509 : mPainter( painter )
1510 {
1511 mPainter->save();
1512 }
1513
1518 {
1519 mPainter->restore();
1520 }
1521
1522 private:
1523
1524 QPainter *mPainter = nullptr;
1525};
1526
1527
1539{
1540 public:
1541
1548 : mContext( &context )
1549 , mOriginalScale( context.symbologyReferenceScale() )
1550 {
1551 mContext->setSymbologyReferenceScale( scale );
1552 }
1553
1558 : mContext( o.mContext )
1559 , mOriginalScale( o.mOriginalScale )
1560 {
1561 o.mContext = nullptr;
1562 }
1563
1568 {
1569 if ( mContext )
1570 mContext->setSymbologyReferenceScale( mOriginalScale );
1571 }
1572
1573 private:
1574
1575 QgsRenderContext *mContext = nullptr;
1576 double mOriginalScale = 0;
1577};
1578
1579
1580#endif
1581
1582#endif
RenderSubcomponentProperty
Rendering subcomponent properties.
Definition qgis.h:2822
@ Generic
Generic subcomponent property.
QFlags< RenderContextFlag > RenderContextFlags
Render context flags.
Definition qgis.h:2591
TextRenderFormat
Options for rendering text.
Definition qgis.h:2624
@ AlwaysOutlines
Always render text using path objects (AKA outlines/curves). This setting guarantees the best quality...
RenderUnit
Rendering size units.
Definition qgis.h:4839
RenderContextFlag
Flags which affect rendering operations.
Definition qgis.h:2566
RendererUsage
Usage of the renderer.
Definition qgis.h:3188
@ 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...
Q_DECL_DEPRECATED QVariantMap customRenderingFlags() const
Gets custom rendering flags.
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.
QgsVectorSimplifyMethod & vectorSimplifyMethod()
Returns the simplification settings to use when rendering vector layers.
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.
const QgsDistanceArea & distanceArea() const
A general purpose distance and area calculator, capable of performing ellipsoid based calculations.
Q_DECL_DEPRECATED void clearCustomRenderingFlag(const QString &flag)
Clears the specified custom rendering flag.
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.
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 clearCustomProperty(const QString &property)
Clears the specified custom rendering property.
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.
QVariantMap customProperties() const
Returns custom rendering properties.
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 setCustomProperty(const QString &property, const QVariant &value)
Sets a custom rendering property.
Q_DECL_DEPRECATED 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