QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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 
28 #include "qgscoordinatetransform.h"
29 #include "qgsexpressioncontext.h"
31 #include "qgslabelsink.h"
32 #include "qgsmaptopixel.h"
33 #include "qgsmapunitscale.h"
34 #include "qgsrectangle.h"
36 #include "qgsdistancearea.h"
38 #include "qgspathresolver.h"
39 #include "qgstemporalrangeobject.h"
40 
41 class QPainter;
43 class QgsLabelingEngine;
44 class QgsMapSettings;
46 class QgsSymbolLayer;
47 class QgsMaskIdProvider;
49 
50 
59 class CORE_EXPORT QgsRenderContext : public QgsTemporalRangeObject
60 {
61  public:
63  ~QgsRenderContext() override;
64 
66  QgsRenderContext &operator=( const QgsRenderContext &rh );
67 
72  void setFlags( Qgis::RenderContextFlags flags );
73 
78  void setFlag( Qgis::RenderContextFlag flag, bool on = true );
79 
84  Qgis::RenderContextFlags flags() const;
85 
90  bool testFlag( Qgis::RenderContextFlag flag ) const;
91 
96  static QgsRenderContext fromMapSettings( const QgsMapSettings &mapSettings );
97 
104  static QgsRenderContext fromQPainter( QPainter *painter );
105 
106  //getters
107 
112  QPainter *painter() {return mPainter;}
113 
114 #ifndef SIP_RUN
115 
121  const QPainter *painter() const { return mPainter; }
122 #endif
123 
133  void setPainterFlagsUsingContext( QPainter *painter = nullptr ) const;
134 
144  QPainter *maskPainter( int id = 0 ) { return mMaskPainter.value( id, nullptr ); }
145 
155  QSet<const QgsSymbolLayer *> disabledSymbolLayers() const { return mDisabledSymbolLayers; }
156 
166  bool isSymbolLayerEnabled( const QgsSymbolLayer *layer ) const { return ! mDisabledSymbolLayers.contains( layer ); }
167 
178  QgsCoordinateTransform coordinateTransform() const {return mCoordTransform;}
179 
184  const QgsDistanceArea &distanceArea() const { return mDistanceArea; }
185 
194  QgsCoordinateTransformContext transformContext() const;
195 
204  void setTransformContext( const QgsCoordinateTransformContext &context );
205 
213  const QgsPathResolver &pathResolver() const { return mPathResolver; }
214 
222  void setPathResolver( const QgsPathResolver &resolver ) { mPathResolver = resolver; }
223 
239  const QgsRectangle &extent() const { return mExtent; }
240 
251  QgsRectangle mapExtent() const { return mOriginalMapExtent; }
252 
258  const QgsMapToPixel &mapToPixel() const {return mMapToPixel;}
259 
266  double scaleFactor() const {return mScaleFactor;}
267 
274  double dpiTarget() const {return mDpiTarget;}
275 
285  bool renderingStopped() const {return mRenderingStopped;}
286 
298  void setFeedback( QgsFeedback *feedback );
299 
308  QgsFeedback *feedback() const;
309 
316  bool forceVectorOutput() const;
317 
323  bool useAdvancedEffects() const;
324 
330  void setUseAdvancedEffects( bool enabled );
331 
337  bool drawEditingInformation() const;
338 
344  double rendererScale() const {return mRendererScale;}
345 
346 
362  double symbologyReferenceScale() const { return mSymbologyReferenceScale; }
363 
368  QgsLabelingEngine *labelingEngine() const { return mLabelingEngine; } SIP_SKIP
369 
375  QgsLabelSink *labelSink() const { return mLabelSink; } SIP_SKIP
376 
382  QColor selectionColor() const { return mSelectionColor; }
383 
391  bool showSelection() const;
392 
393  //setters
394 
405  void setCoordinateTransform( const QgsCoordinateTransform &t );
406 
412  void setMapToPixel( const QgsMapToPixel &mtp ) {mMapToPixel = mtp;}
413 
426  void setExtent( const QgsRectangle &extent ) {mExtent = extent;}
427 
438  void setMapExtent( const QgsRectangle &extent ) { mOriginalMapExtent = extent; }
439 
445  void setDrawEditingInformation( bool b );
446 
457  void setRenderingStopped( bool stopped ) {mRenderingStopped = stopped;}
458 
464  void setDistanceArea( const QgsDistanceArea &distanceArea ) {mDistanceArea = distanceArea ;}
465 
472  void setScaleFactor( double factor ) {mScaleFactor = factor;}
473 
480  void setDpiTarget( double dpi ) {mDpiTarget = dpi;}
481 
487  void setRendererScale( double scale ) {mRendererScale = scale;}
488 
504  void setSymbologyReferenceScale( double scale ) { mSymbologyReferenceScale = scale; }
505 
512  void setPainter( QPainter *p ) {mPainter = p;}
513 
521  void setMaskPainter( QPainter *p, int id = 0 ) { mMaskPainter[id] = p; }
522 
532  void setDisabledSymbolLayers( const QSet<const QgsSymbolLayer *> &symbolLayers ) { mDisabledSymbolLayers = symbolLayers; }
533 
540  void setForceVectorOutput( bool force );
541 
546  void setLabelingEngine( QgsLabelingEngine *engine ) { mLabelingEngine = engine; } SIP_SKIP
547 
554  void setLabelSink( QgsLabelSink *sink ) { mLabelSink = sink; } SIP_SKIP
555 
561  void setSelectionColor( const QColor &color ) { mSelectionColor = color; }
562 
570  void setShowSelection( bool showSelection );
571 
577  bool useRenderingOptimization() const;
578 
584  void setUseRenderingOptimization( bool enabled );
585 
594  const QgsVectorSimplifyMethod &vectorSimplifyMethod() const { return mVectorSimplifyMethod; }
595 
609  void setVectorSimplifyMethod( const QgsVectorSimplifyMethod &simplifyMethod ) { mVectorSimplifyMethod = simplifyMethod; }
610 
617  void setExpressionContext( const QgsExpressionContext &context ) { mExpressionContext = context; }
618 
625  QgsExpressionContext &expressionContext() { return mExpressionContext; }
626 
634  const QgsExpressionContext &expressionContext() const { return mExpressionContext; } SIP_SKIP
635 
637  const QgsAbstractGeometry *geometry() const { return mGeometry; }
639  void setGeometry( const QgsAbstractGeometry *geometry ) { mGeometry = geometry; }
640 
647  void setFeatureFilterProvider( const QgsFeatureFilterProvider *ffp );
648 
655  const QgsFeatureFilterProvider *featureFilterProvider() const;
656 
663  void setSegmentationTolerance( double tolerance ) { mSegmentationTolerance = tolerance; }
664 
669  double segmentationTolerance() const { return mSegmentationTolerance; }
670 
677  void setSegmentationToleranceType( QgsAbstractGeometry::SegmentationToleranceType type ) { mSegmentationToleranceType = type; }
678 
683  QgsAbstractGeometry::SegmentationToleranceType segmentationToleranceType() const { return mSegmentationToleranceType; }
684 
685  // Conversions
686 
698  double convertToPainterUnits( double size, QgsUnitTypes::RenderUnit unit, const QgsMapUnitScale &scale = QgsMapUnitScale(), Qgis::RenderSubcomponentProperty property = Qgis::RenderSubcomponentProperty::Generic ) const;
699 
706  double convertToMapUnits( double size, QgsUnitTypes::RenderUnit unit, const QgsMapUnitScale &scale = QgsMapUnitScale() ) const;
707 
713  double convertFromMapUnits( double sizeInMapUnits, QgsUnitTypes::RenderUnit outputUnit ) const;
714 
721  double convertMetersToMapUnits( double meters ) const;
722 
730  {
731  return mTextRenderFormat;
732  }
733 
741  {
742  mTextRenderFormat = format;
743  }
744 
750  QList<QgsRenderedFeatureHandlerInterface *> renderedFeatureHandlers() const;
751 
757  bool hasRenderedFeatureHandlers() const { return mHasRenderedFeatureHandlers; }
758 
767  void setMaskIdProvider( QgsMaskIdProvider *provider ) { mMaskIdProvider = provider; }
768 
774  const QgsMaskIdProvider *maskIdProvider() const { return mMaskIdProvider; }
775 
781  void setCurrentMaskId( int id ) { mCurrentMaskId = id; }
782 
789  int currentMaskId() const { return mCurrentMaskId; }
790 
800  void setIsGuiPreview( bool preview ) { mIsGuiPreview = preview; }
801 
812  bool isGuiPreview() const { return mIsGuiPreview; }
813 
820  QVariantMap customRenderingFlags() const { return mCustomRenderingFlags; }
821 
829  void setCustomRenderingFlag( const QString &flag, const QVariant &value ) { mCustomRenderingFlags[flag] = value; }
830 
837  void clearCustomRenderingFlag( const QString &flag ) { mCustomRenderingFlags.remove( flag ); }
838 
846  QList< QgsMapClippingRegion > clippingRegions() const;
847 
862  QgsGeometry featureClipGeometry() const;
863 
873  void setFeatureClipGeometry( const QgsGeometry &geometry );
874 
882  QPointF textureOrigin() const;
883 
891  void setTextureOrigin( const QPointF &origin );
892 
893 #ifndef SIP_RUN
894 
899  void addSymbolLayerClipPath( const QgsSymbolLayer *symbolLayer, QPainterPath path );
900 
905  QList<QPainterPath> symbolLayerClipPaths( const QgsSymbolLayer *symbolLayer ) const;
906 
907 #endif
908 
915  QgsDoubleRange zRange() const;
916 
923  void setZRange( const QgsDoubleRange &range );
924 
933  QSize outputSize() const;
934 
941  void setOutputSize( QSize size );
942 
951  float devicePixelRatio() const;
952 
961  void setDevicePixelRatio( float ratio );
962 
974  QSize deviceOutputSize() const;
975 
983  void setImageFormat( QImage::Format format ) { mImageFormat = format; }
984 
992  QImage::Format imageFormat() const { return mImageFormat; }
993 
1000  Qgis::RendererUsage rendererUsage() const {return mRendererUsage;}
1001 
1011  void setRendererUsage( Qgis::RendererUsage usage ) {mRendererUsage = usage;}
1012 
1021  double frameRate() const;
1022 
1031  void setFrameRate( double rate );
1032 
1041  long long currentFrame() const;
1042 
1051  void setCurrentFrame( long long frame );
1052 
1053  private:
1054 
1055  Qgis::RenderContextFlags mFlags;
1056 
1058  QPainter *mPainter = nullptr;
1059 
1066  QMap<int, QPainter *> mMaskPainter;
1067 
1073  QgsMaskIdProvider *mMaskIdProvider = nullptr;
1074 
1079  int mCurrentMaskId = -1;
1080 
1085  bool mIsGuiPreview = false;
1086 
1088  QgsCoordinateTransform mCoordTransform;
1089 
1095  QgsDistanceArea mDistanceArea;
1096 
1097  QgsRectangle mExtent;
1098  QgsRectangle mOriginalMapExtent;
1099 
1100  QgsMapToPixel mMapToPixel;
1101 
1103  bool mRenderingStopped = false;
1104 
1106  QgsFeedback *mFeedback = nullptr;
1107 
1109  double mScaleFactor = 1.0;
1110 
1112  double mDpiTarget = -1.0;
1113 
1115  double mRendererScale = 1.0;
1116 
1117  double mSymbologyReferenceScale = -1;
1118 
1120  QgsLabelingEngine *mLabelingEngine = nullptr;
1121 
1123  QgsLabelSink *mLabelSink = nullptr;
1124 
1126  QColor mSelectionColor;
1127 
1129  QgsVectorSimplifyMethod mVectorSimplifyMethod;
1130 
1132  QgsExpressionContext mExpressionContext;
1133 
1135  const QgsAbstractGeometry *mGeometry = nullptr;
1136 
1138  std::unique_ptr< QgsFeatureFilterProvider > mFeatureFilterProvider;
1139 
1140  double mSegmentationTolerance = M_PI_2 / 90;
1141 
1143 
1144  QgsCoordinateTransformContext mTransformContext;
1145 
1146  QgsPathResolver mPathResolver;
1147 
1148  Qgis::TextRenderFormat mTextRenderFormat = Qgis::TextRenderFormat::AlwaysOutlines;
1149  QList< QgsRenderedFeatureHandlerInterface * > mRenderedFeatureHandlers;
1150  bool mHasRenderedFeatureHandlers = false;
1151  QVariantMap mCustomRenderingFlags;
1152 
1153  QSet<const QgsSymbolLayer *> mDisabledSymbolLayers;
1154 
1155  QList< QgsMapClippingRegion > mClippingRegions;
1156  QgsGeometry mFeatureClipGeometry;
1157 
1158  QPointF mTextureOrigin;
1159 
1160  QgsDoubleRange mZRange;
1161 
1162  QSize mSize;
1163  float mDevicePixelRatio = 1.0;
1164  QImage::Format mImageFormat = QImage::Format_ARGB32_Premultiplied;
1165 
1167 
1168  double mFrameRate = -1;
1169  long long mCurrentFrame = -1;
1170 
1172  QMap< const QgsSymbolLayer *, QList<QPainterPath> > mSymbolLayerClipPaths;
1173 
1174 #ifdef QGISDEBUG
1175  bool mHasTransformContext = false;
1176 #endif
1177 };
1178 
1179 #ifndef SIP_RUN
1180 
1193 {
1194  public:
1195 
1202  QgsScopedRenderContextPainterSwap( QgsRenderContext &context, QPainter *temporaryPainter )
1203  : mContext( context )
1204  , mPreviousPainter( context.painter() )
1205  {
1206  mContext.setPainter( temporaryPainter );
1207  }
1208 
1212  void reset()
1213  {
1214  if ( !mReleased )
1215  {
1216  mContext.setPainter( mPreviousPainter );
1217  mReleased = true;
1218  }
1219  }
1220 
1225  {
1226  reset();
1227  }
1228 
1229  private:
1230 
1231  QgsRenderContext &mContext;
1232  QPainter *mPreviousPainter = nullptr;
1233  bool mReleased = false;
1234 };
1235 
1236 
1249 {
1250  public:
1251 
1260  : mContext( context )
1261  {
1262  if ( mContext.painter() )
1263  mContext.painter()->scale( mContext.scaleFactor(), mContext.scaleFactor() );
1264  }
1265 
1270  {
1271  if ( mContext.painter() )
1272  mContext.painter()->scale( 1.0 / mContext.scaleFactor(), 1.0 / mContext.scaleFactor() );
1273  }
1274 
1275  private:
1276 
1277  QgsRenderContext &mContext;
1278 };
1279 
1280 
1293 {
1294  public:
1295 
1304  : mContext( context )
1305  {
1306  if ( mContext.painter() )
1307  mContext.painter()->scale( 1.0 / mContext.scaleFactor(), 1.0 / mContext.scaleFactor() );
1308  }
1309 
1314  {
1315  if ( mContext.painter() )
1316  mContext.painter()->scale( mContext.scaleFactor(), mContext.scaleFactor() );
1317  }
1318 
1319  private:
1320 
1321  QgsRenderContext &mContext;
1322 };
1323 
1324 
1337 {
1338  public:
1339 
1345  QgsScopedQPainterState( QPainter *painter )
1346  : mPainter( painter )
1347  {
1348  mPainter->save();
1349  }
1350 
1355  {
1356  mPainter->restore();
1357  }
1358 
1359  private:
1360 
1361  QPainter *mPainter = nullptr;
1362 };
1363 
1364 
1376 {
1377  public:
1378 
1385  : mContext( &context )
1386  , mOriginalScale( context.symbologyReferenceScale() )
1387  {
1388  mContext->setSymbologyReferenceScale( scale );
1389  }
1390 
1395  : mContext( o.mContext )
1396  , mOriginalScale( o.mOriginalScale )
1397  {
1398  o.mContext = nullptr;
1399  }
1400 
1405  {
1406  if ( mContext )
1407  mContext->setSymbologyReferenceScale( mOriginalScale );
1408  }
1409 
1410  private:
1411 
1412  QgsRenderContext *mContext = nullptr;
1413  double mOriginalScale = 0;
1414 };
1415 
1416 
1417 #endif
1418 
1419 #endif
QgsAbstractGeometry::MaximumAngle
@ MaximumAngle
Maximum angle between generating radii (lines from arc center to output vertices)
Definition: qgsabstractgeometry.h:127
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition: qgsexpressioncontext.h:406
QgsRenderContext::maskPainter
QPainter * maskPainter(int id=0)
Returns a mask QPainter for the render operation.
Definition: qgsrendercontext.h:144
QgsRenderContext::setImageFormat
void setImageFormat(QImage::Format format)
Sets QImage format which should be used for QImages created during rendering.
Definition: qgsrendercontext.h:983
QgsVectorSimplifyMethod
This class contains information how to simplify geometries fetched from a vector layer.
Definition: qgsvectorsimplifymethod.h:29
QgsRenderContext::labelSink
QgsLabelSink * labelSink() const
Returns the associated label sink, or nullptr if not set.
Definition: qgsrendercontext.h:375
QgsScopedRenderContextReferenceScaleOverride
Scoped object for temporary override of the symbologyReferenceScale property of a QgsRenderContext.
Definition: qgsrendercontext.h:1375
QgsRenderContext::setCustomRenderingFlag
void setCustomRenderingFlag(const QString &flag, const QVariant &value)
Sets a custom rendering flag.
Definition: qgsrendercontext.h:829
QgsRenderContext::setIsGuiPreview
void setIsGuiPreview(bool preview)
Sets GUI preview mode.
Definition: qgsrendercontext.h:800
QgsRenderContext::setDpiTarget
void setDpiTarget(double dpi)
Sets the targeted dpi for rendering.
Definition: qgsrendercontext.h:480
QgsCoordinateTransformContext
Contains information about the context in which a coordinate transform is executed.
Definition: qgscoordinatetransformcontext.h:57
QgsRenderContext::mapToPixel
const QgsMapToPixel & mapToPixel() const
Returns the context's map to pixel transform, which transforms between map coordinates and device coo...
Definition: qgsrendercontext.h:258
QgsMapClippingRegion
A map clipping region (in map coordinates and CRS).
Definition: qgsmapclippingregion.h:33
Qgis::TextRenderFormat
TextRenderFormat
Options for rendering text.
Definition: qgis.h:1331
QgsUnitTypes::RenderUnit
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:167
QgsRenderContext::expressionContext
QgsExpressionContext & expressionContext()
Gets the expression context.
Definition: qgsrendercontext.h:625
QgsRenderContext::expressionContext
const QgsExpressionContext & expressionContext() const
Gets the expression context (const version).
Definition: qgsrendercontext.h:634
QgsRenderContext::imageFormat
QImage::Format imageFormat() const
Returns the QImage format which should be used for QImages created during rendering.
Definition: qgsrendercontext.h:992
QgsRenderContext::clearCustomRenderingFlag
void clearCustomRenderingFlag(const QString &flag)
Clears the specified custom rendering flag.
Definition: qgsrendercontext.h:837
qgsrectangle.h
QgsRenderContext::setSegmentationTolerance
void setSegmentationTolerance(double tolerance)
Sets the segmentation tolerance applied when rendering curved geometries.
Definition: qgsrendercontext.h:663
qgsmaptopixel.h
qgstemporalrangeobject.h
QgsRenderContext::setLabelSink
void setLabelSink(QgsLabelSink *sink)
Assigns the label sink which will take over responsibility for handling labels.
Definition: qgsrendercontext.h:554
qgscoordinatetransformcontext.h
QgsRenderContext::setPainter
void setPainter(QPainter *p)
Sets the destination QPainter for the render operation.
Definition: qgsrendercontext.h:512
QgsLabelSink
Abstract base class that can be used to intercept rendered labels from a labeling / rendering job.
Definition: qgslabelsink.h:37
QgsRenderContext::rendererUsage
Qgis::RendererUsage rendererUsage() const
Returns the renderer usage.
Definition: qgsrendercontext.h:1000
QgsRenderContext::hasRenderedFeatureHandlers
bool hasRenderedFeatureHandlers() const
Returns true if the context has any rendered feature handlers.
Definition: qgsrendercontext.h:757
qgspathresolver.h
qgsfeaturefilterprovider.h
QgsRenderContext
Contains information about the context of a rendering operation.
Definition: qgsrendercontext.h:59
QgsRenderContext::setLabelingEngine
void setLabelingEngine(QgsLabelingEngine *engine)
Assigns the labeling engine.
Definition: qgsrendercontext.h:546
QgsScopedRenderContextScaleToPixels::QgsScopedRenderContextScaleToPixels
QgsScopedRenderContextScaleToPixels(QgsRenderContext &context)
Constructor for QgsScopedRenderContextScaleToPixels.
Definition: qgsrendercontext.h:1303
QgsScopedRenderContextPainterSwap::~QgsScopedRenderContextPainterSwap
~QgsScopedRenderContextPainterSwap()
Returns the destination painter for the context back to the original QPainter object.
Definition: qgsrendercontext.h:1224
Qgis::RenderSubcomponentProperty
RenderSubcomponentProperty
Rendering subcomponent properties.
Definition: qgis.h:1343
QgsAbstractGeometry::SegmentationToleranceType
SegmentationToleranceType
Segmentation tolerance as maximum angle or maximum difference between approximation and circle.
Definition: qgsabstractgeometry.h:120
QgsScopedRenderContextReferenceScaleOverride::QgsScopedRenderContextReferenceScaleOverride
QgsScopedRenderContextReferenceScaleOverride(QgsScopedRenderContextReferenceScaleOverride &&o) noexcept
Move constructor.
Definition: qgsrendercontext.h:1394
QgsRenderContext::scaleFactor
double scaleFactor() const
Returns the scaling factor for the render to convert painter units to physical sizes.
Definition: qgsrendercontext.h:266
QgsRenderContext::extent
const QgsRectangle & extent() const
When rendering a map layer, calling this method returns the "clipping" extent for the layer (in the l...
Definition: qgsrendercontext.h:239
QgsScopedRenderContextReferenceScaleOverride::QgsScopedRenderContextReferenceScaleOverride
QgsScopedRenderContextReferenceScaleOverride(QgsRenderContext &context, double scale)
Constructor for QgsScopedRenderContextReferenceScaleOverride.
Definition: qgsrendercontext.h:1384
QgsRenderContext::textRenderFormat
Qgis::TextRenderFormat textRenderFormat() const
Returns the text render format, which dictates how text is rendered (e.g.
Definition: qgsrendercontext.h:729
QgsRenderContext::distanceArea
const QgsDistanceArea & distanceArea() const
A general purpose distance and area calculator, capable of performing ellipsoid based calculations.
Definition: qgsrendercontext.h:184
QgsRenderContext::dpiTarget
double dpiTarget() const
Returns the targeted DPI for rendering.
Definition: qgsrendercontext.h:274
QgsRenderContext::setSegmentationToleranceType
void setSegmentationToleranceType(QgsAbstractGeometry::SegmentationToleranceType type)
Sets segmentation tolerance type (maximum angle or maximum difference between curve and approximation...
Definition: qgsrendercontext.h:677
QgsRectangle
A rectangle specified with double values.
Definition: qgsrectangle.h:41
QgsScopedRenderContextPainterSwap::QgsScopedRenderContextPainterSwap
QgsScopedRenderContextPainterSwap(QgsRenderContext &context, QPainter *temporaryPainter)
Constructor for QgsScopedRenderContextPainterSwap.
Definition: qgsrendercontext.h:1202
QgsRenderedFeatureHandlerInterface
An interface for classes which provider custom handlers for features rendered as part of a map render...
Definition: qgsrenderedfeaturehandlerinterface.h:46
QgsRenderContext::isSymbolLayerEnabled
bool isSymbolLayerEnabled(const QgsSymbolLayer *layer) const
When rendering a map layer in a second pass (for selective masking), some symbol layers may be disabl...
Definition: qgsrendercontext.h:166
QgsRenderContext::currentMaskId
int currentMaskId() const
Returns the current mask id, which can be used with maskPainter()
Definition: qgsrendercontext.h:789
QgsRenderContext::renderingStopped
bool renderingStopped() const
Returns true if the rendering operation has been stopped and any ongoing rendering should be canceled...
Definition: qgsrendercontext.h:285
QgsRenderContext::coordinateTransform
QgsCoordinateTransform coordinateTransform() const
Returns the current coordinate transform for the context.
Definition: qgsrendercontext.h:178
qgsexpressioncontext.h
QgsSymbolLayer
Definition: qgssymbollayer.h:54
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsRenderContext::maskIdProvider
const QgsMaskIdProvider * maskIdProvider() const
Returns the mask id provider attached to the context.
Definition: qgsrendercontext.h:774
QgsScopedRenderContextScaleToMm::QgsScopedRenderContextScaleToMm
QgsScopedRenderContextScaleToMm(QgsRenderContext &context)
Constructor for QgsScopedRenderContextScaleToMm.
Definition: qgsrendercontext.h:1259
QgsRenderContext::setMaskIdProvider
void setMaskIdProvider(QgsMaskIdProvider *provider)
Attaches a mask id provider to the context.
Definition: qgsrendercontext.h:767
QgsRenderContext::customRenderingFlags
QVariantMap customRenderingFlags() const
Gets custom rendering flags.
Definition: qgsrendercontext.h:820
qgslabelsink.h
QgsRenderContext::setPathResolver
void setPathResolver(const QgsPathResolver &resolver)
Sets the path resolver for conversion between relative and absolute paths during rendering operations...
Definition: qgsrendercontext.h:222
QgsFeedback
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition: qgsfeedback.h:44
QgsRenderContext::setExtent
void setExtent(const QgsRectangle &extent)
When rendering a map layer, calling this method sets the "clipping" extent for the layer (in the laye...
Definition: qgsrendercontext.h:426
QgsScopedRenderContextScaleToPixels::~QgsScopedRenderContextScaleToPixels
~QgsScopedRenderContextScaleToPixels()
Returns the destination painter back to millimeter based units.
Definition: qgsrendercontext.h:1313
QgsRenderContext::setVectorSimplifyMethod
void setVectorSimplifyMethod(const QgsVectorSimplifyMethod &simplifyMethod)
Sets the simplification setting to use when rendering vector layers.
Definition: qgsrendercontext.h:609
QgsRenderContext::setRenderingStopped
void setRenderingStopped(bool stopped)
Sets whether the rendering operation has been stopped and any ongoing rendering should be canceled im...
Definition: qgsrendercontext.h:457
qgis_sip.h
QgsRenderContext::setMapToPixel
void setMapToPixel(const QgsMapToPixel &mtp)
Sets the context's map to pixel transform, which transforms between map coordinates and device coordi...
Definition: qgsrendercontext.h:412
QgsRenderContext::segmentationTolerance
double segmentationTolerance() const
Gets the segmentation tolerance applied when rendering curved geometries.
Definition: qgsrendercontext.h:669
QgsRenderContext::segmentationToleranceType
QgsAbstractGeometry::SegmentationToleranceType segmentationToleranceType() const
Gets segmentation tolerance type (maximum angle or maximum difference between curve and approximation...
Definition: qgsrendercontext.h:683
qgsvectorsimplifymethod.h
qgscoordinatetransform.h
QgsRenderContext::setDistanceArea
void setDistanceArea(const QgsDistanceArea &distanceArea)
A general purpose distance and area calculator, capable of performing ellipsoid based calculations.
Definition: qgsrendercontext.h:464
QgsMapUnitScale
Struct for storing maximum and minimum scales for measurements in map units.
Definition: qgsmapunitscale.h:36
QgsScopedQPainterState
Scoped object for saving and restoring a QPainter object's state.
Definition: qgsrendercontext.h:1336
Qgis::RenderContextFlag
RenderContextFlag
Flags which affect rendering operations.
Definition: qgis.h:1297
QgsRenderContext::painter
const QPainter * painter() const
Returns the const destination QPainter for the render operation.
Definition: qgsrendercontext.h:121
QgsScopedRenderContextScaleToMm
Scoped object for temporary scaling of a QgsRenderContext for millimeter based rendering.
Definition: qgsrendercontext.h:1248
QgsAbstractGeometry
Abstract base class for all geometries.
Definition: qgsabstractgeometry.h:79
Qgis::RendererUsage::Unknown
@ Unknown
Renderer used for unknown usage.
QgsScopedRenderContextPainterSwap::reset
void reset()
Resets the destination painter for the context back to the original QPainter object.
Definition: qgsrendercontext.h:1212
QgsRenderContext::setSelectionColor
void setSelectionColor(const QColor &color)
Sets the color to use when rendering selected features.
Definition: qgsrendercontext.h:561
QgsRenderContext::vectorSimplifyMethod
const QgsVectorSimplifyMethod & vectorSimplifyMethod() const
Returns the simplification settings to use when rendering vector layers.
Definition: qgsrendercontext.h:594
QgsRenderContext::setRendererScale
void setRendererScale(double scale)
Sets the renderer map scale.
Definition: qgsrendercontext.h:487
QgsLabelingEngine
The QgsLabelingEngine class provides map labeling functionality. The input for the engine is a list o...
Definition: qgslabelingengine.h:343
QgsScopedQPainterState::~QgsScopedQPainterState
~QgsScopedQPainterState()
Restores the painter back to its original state.
Definition: qgsrendercontext.h:1354
QgsScopedRenderContextPainterSwap
Scoped object for temporary replacement of a QgsRenderContext destination painter.
Definition: qgsrendercontext.h:1192
QgsRenderContext::selectionColor
QColor selectionColor() const
Returns the color to use when rendering selected features.
Definition: qgsrendercontext.h:382
QgsRenderContext::labelingEngine
QgsLabelingEngine * labelingEngine() const
Gets access to new labeling engine (may be nullptr).
Definition: qgsrendercontext.h:368
QgsMaskIdProvider
This class allows the creation of mask ids based on the different label layers and to give a mask id ...
Definition: qgsmaskidprovider.h:39
QgsDoubleRange
QgsRange which stores a range of double values.
Definition: qgsrange.h:202
QgsRenderContext::mapExtent
QgsRectangle mapExtent() const
Returns the original extent of the map being rendered.
Definition: qgsrendercontext.h:251
QgsRenderContext::geometry
const QgsAbstractGeometry * geometry() const
Returns pointer to the unsegmentized geometry.
Definition: qgsrendercontext.h:637
QgsGeometry
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:124
QgsMapToPixel
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:38
QgsScopedRenderContextReferenceScaleOverride::~QgsScopedRenderContextReferenceScaleOverride
~QgsScopedRenderContextReferenceScaleOverride()
Returns the render context back to the original reference scale.
Definition: qgsrendercontext.h:1404
QgsRenderContext::symbologyReferenceScale
double symbologyReferenceScale() const
Returns the symbology reference scale.
Definition: qgsrendercontext.h:362
QgsRenderContext::isGuiPreview
bool isGuiPreview() const
Returns the Gui preview mode.
Definition: qgsrendercontext.h:812
QgsRenderContext::pathResolver
const QgsPathResolver & pathResolver() const
Returns the path resolver for conversion between relative and absolute paths during rendering operati...
Definition: qgsrendercontext.h:213
QgsFeatureFilterProvider
Abstract interface for use by classes that filter the features or attributes of a layer.
Definition: qgsfeaturefilterprovider.h:43
QgsScopedQPainterState::QgsScopedQPainterState
QgsScopedQPainterState(QPainter *painter)
Constructor for QgsScopedQPainterState.
Definition: qgsrendercontext.h:1345
qgsmapunitscale.h
Qgis::RendererUsage
RendererUsage
Usage of the renderer.
Definition: qgis.h:1647
QgsRenderContext::setExpressionContext
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context.
Definition: qgsrendercontext.h:617
QgsDistanceArea
A general purpose distance and area calculator, capable of performing ellipsoid based calculations.
Definition: qgsdistancearea.h:52
QgsScopedRenderContextScaleToMm::~QgsScopedRenderContextScaleToMm
~QgsScopedRenderContextScaleToMm()
Returns the destination painter back to pixel based units.
Definition: qgsrendercontext.h:1269
qgsdistancearea.h
QgsRenderContext::setSymbologyReferenceScale
void setSymbologyReferenceScale(double scale)
Sets the symbology reference scale.
Definition: qgsrendercontext.h:504
QgsScopedRenderContextScaleToPixels
Scoped object for temporary scaling of a QgsRenderContext for pixel based rendering.
Definition: qgsrendercontext.h:1292
QgsRenderContext::setTextRenderFormat
void setTextRenderFormat(Qgis::TextRenderFormat format)
Sets the text render format, which dictates how text is rendered (e.g.
Definition: qgsrendercontext.h:740
QgsRenderContext::painter
QPainter * painter()
Returns the destination QPainter for the render operation.
Definition: qgsrendercontext.h:112
QgsRenderContext::setRendererUsage
void setRendererUsage(Qgis::RendererUsage usage)
Sets the renderer usage.
Definition: qgsrendercontext.h:1011
QgsRenderContext::setGeometry
void setGeometry(const QgsAbstractGeometry *geometry)
Sets pointer to original (unsegmentized) geometry.
Definition: qgsrendercontext.h:639
QgsRenderContext::rendererScale
double rendererScale() const
Returns the renderer map scale.
Definition: qgsrendercontext.h:344
QgsRenderContext::setDisabledSymbolLayers
void setDisabledSymbolLayers(const QSet< const QgsSymbolLayer * > &symbolLayers)
When rendering a map layer in a second pass (for selective masking), some symbol layers may be disabl...
Definition: qgsrendercontext.h:532
QgsMapSettings
The QgsMapSettings class contains configuration for rendering of the map. The rendering itself is don...
Definition: qgsmapsettings.h:88
QgsCoordinateTransform
Class for doing transforms between two map coordinate systems.
Definition: qgscoordinatetransform.h:57
QgsRenderContext::disabledSymbolLayers
QSet< const QgsSymbolLayer * > disabledSymbolLayers() const
When rendering a map layer in a second pass (for selective masking), some symbol layers may be disabl...
Definition: qgsrendercontext.h:155
QgsRenderContext::setCurrentMaskId
void setCurrentMaskId(int id)
Stores a mask id as the "current" one.
Definition: qgsrendercontext.h:781
QgsPathResolver
Resolves relative paths into absolute paths and vice versa. Used for writing.
Definition: qgspathresolver.h:31
QgsTemporalRangeObject
Base class for objects with an associated (optional) temporal range.
Definition: qgstemporalrangeobject.h:33
QgsRenderContext::setScaleFactor
void setScaleFactor(double factor)
Sets the scaling factor for the render to convert painter units to physical sizes.
Definition: qgsrendercontext.h:472
QgsRenderContext::setMapExtent
void setMapExtent(const QgsRectangle &extent)
Sets the original extent of the map being rendered.
Definition: qgsrendercontext.h:438
QgsRenderContext::setMaskPainter
void setMaskPainter(QPainter *p, int id=0)
Sets a mask QPainter for the render operation.
Definition: qgsrendercontext.h:521
Qgis::RenderSubcomponentProperty::Generic
@ Generic
Generic subcomponent property.