QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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 <memory>
26 
27 #include "qgscoordinatetransform.h"
28 #include "qgsexpressioncontext.h"
30 #include "qgsmaptopixel.h"
31 #include "qgsmapunitscale.h"
32 #include "qgsrectangle.h"
34 #include "qgsdistancearea.h"
36 #include "qgspathresolver.h"
38 #include "qgstemporalrangeobject.h"
39 
40 class QPainter;
42 class QgsLabelingEngine;
43 class QgsMapSettings;
45 class QgsSymbolLayer;
46 
47 class QgsMaskIdProvider;
48 
49 
57 class CORE_EXPORT QgsRenderContext : public QgsTemporalRangeObject
58 {
59  public:
61 
63  QgsRenderContext &operator=( const QgsRenderContext &rh );
64 
69  enum Flag
70  {
71  DrawEditingInfo = 0x01,
72  ForceVectorOutput = 0x02,
73  UseAdvancedEffects = 0x04,
74  UseRenderingOptimization = 0x08,
75  DrawSelection = 0x10,
76  DrawSymbolBounds = 0x20,
77  RenderMapTile = 0x40,
78  Antialiasing = 0x80,
79  RenderPartialOutput = 0x100,
80  RenderPreviewJob = 0x200,
81  RenderBlocking = 0x400,
82  RenderSymbolPreview = 0x800,
83  };
84  Q_DECLARE_FLAGS( Flags, Flag )
85 
86 
91  {
92  // refs for below dox: https://github.com/qgis/QGIS/pull/1286#issuecomment-39806854
93  // https://github.com/qgis/QGIS/pull/8573#issuecomment-445585826
94 
112 
128  };
129 
134  void setFlags( QgsRenderContext::Flags flags );
135 
140  void setFlag( Flag flag, bool on = true );
141 
146  Flags flags() const;
147 
152  bool testFlag( Flag flag ) const;
153 
158  static QgsRenderContext fromMapSettings( const QgsMapSettings &mapSettings );
159 
166  static QgsRenderContext fromQPainter( QPainter *painter );
167 
168  //getters
169 
174  QPainter *painter() {return mPainter;}
175 
176 #ifndef SIP_RUN
177 
183  const QPainter *painter() const { return mPainter; }
184 #endif
185 
195  QPainter *maskPainter( int id = 0 ) { return mMaskPainter.value( id, nullptr ); }
196 
206  QSet<const QgsSymbolLayer *> disabledSymbolLayers() const { return mDisabledSymbolLayers; }
207 
217  bool isSymbolLayerEnabled( const QgsSymbolLayer *layer ) const { return ! mDisabledSymbolLayers.contains( layer ); }
218 
229  QgsCoordinateTransform coordinateTransform() const {return mCoordTransform;}
230 
235  const QgsDistanceArea &distanceArea() const { return mDistanceArea; }
236 
245  QgsCoordinateTransformContext transformContext() const;
246 
255  void setTransformContext( const QgsCoordinateTransformContext &context );
256 
264  const QgsPathResolver &pathResolver() const { return mPathResolver; }
265 
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  bool renderingStopped() const {return mRenderingStopped;}
326 
333  bool forceVectorOutput() const;
334 
340  bool useAdvancedEffects() const;
341 
347  void setUseAdvancedEffects( bool enabled );
348 
354  bool drawEditingInformation() const;
355 
361  double rendererScale() const {return mRendererScale;}
362 
367  QgsLabelingEngine *labelingEngine() const { return mLabelingEngine; } SIP_SKIP
368 
374  QColor selectionColor() const { return mSelectionColor; }
375 
383  bool showSelection() const;
384 
385  //setters
386 
397  void setCoordinateTransform( const QgsCoordinateTransform &t );
398 
404  void setMapToPixel( const QgsMapToPixel &mtp ) {mMapToPixel = mtp;}
405 
418  void setExtent( const QgsRectangle &extent ) {mExtent = extent;}
419 
430  void setMapExtent( const QgsRectangle &extent ) { mOriginalMapExtent = extent; }
431 
437  void setDrawEditingInformation( bool b );
438 
445  void setRenderingStopped( bool stopped ) {mRenderingStopped = stopped;}
446 
452  void setDistanceArea( const QgsDistanceArea &distanceArea ) {mDistanceArea = distanceArea ;}
453 
460  void setScaleFactor( double factor ) {mScaleFactor = factor;}
461 
467  void setRendererScale( double scale ) {mRendererScale = scale;}
468 
475  void setPainter( QPainter *p ) {mPainter = p;}
476 
484  void setMaskPainter( QPainter *p, int id = 0 ) { mMaskPainter[id] = p; }
485 
495  void setDisabledSymbolLayers( const QSet<const QgsSymbolLayer *> &symbolLayers ) { mDisabledSymbolLayers = symbolLayers; }
496 
503  void setForceVectorOutput( bool force );
504 
509  void setLabelingEngine( QgsLabelingEngine *engine ) { mLabelingEngine = engine; } SIP_SKIP
510 
516  void setSelectionColor( const QColor &color ) { mSelectionColor = color; }
517 
525  void setShowSelection( bool showSelection );
526 
532  bool useRenderingOptimization() const;
533 
539  void setUseRenderingOptimization( bool enabled );
540 
549  const QgsVectorSimplifyMethod &vectorSimplifyMethod() const { return mVectorSimplifyMethod; }
550 
564  void setVectorSimplifyMethod( const QgsVectorSimplifyMethod &simplifyMethod ) { mVectorSimplifyMethod = simplifyMethod; }
565 
572  void setExpressionContext( const QgsExpressionContext &context ) { mExpressionContext = context; }
573 
580  QgsExpressionContext &expressionContext() { return mExpressionContext; }
581 
589  const QgsExpressionContext &expressionContext() const { return mExpressionContext; } SIP_SKIP
590 
592  const QgsAbstractGeometry *geometry() const { return mGeometry; }
594  void setGeometry( const QgsAbstractGeometry *geometry ) { mGeometry = geometry; }
595 
602  void setFeatureFilterProvider( const QgsFeatureFilterProvider *ffp );
603 
610  const QgsFeatureFilterProvider *featureFilterProvider() const;
611 
618  void setSegmentationTolerance( double tolerance ) { mSegmentationTolerance = tolerance; }
619 
624  double segmentationTolerance() const { return mSegmentationTolerance; }
625 
632  void setSegmentationToleranceType( QgsAbstractGeometry::SegmentationToleranceType type ) { mSegmentationToleranceType = type; }
633 
638  QgsAbstractGeometry::SegmentationToleranceType segmentationToleranceType() const { return mSegmentationToleranceType; }
639 
640  // Conversions
641 
648  double convertToPainterUnits( double size, QgsUnitTypes::RenderUnit unit, const QgsMapUnitScale &scale = QgsMapUnitScale() ) const;
649 
656  double convertToMapUnits( double size, QgsUnitTypes::RenderUnit unit, const QgsMapUnitScale &scale = QgsMapUnitScale() ) const;
657 
663  double convertFromMapUnits( double sizeInMapUnits, QgsUnitTypes::RenderUnit outputUnit ) const;
664 
671  double convertMetersToMapUnits( double meters ) const;
672 
680  {
681  return mTextRenderFormat;
682  }
683 
691  {
692  mTextRenderFormat = format;
693  }
694 
700  QList<QgsRenderedFeatureHandlerInterface *> renderedFeatureHandlers() const;
701 
707  bool hasRenderedFeatureHandlers() const { return mHasRenderedFeatureHandlers; }
708 
717  void setMaskIdProvider( QgsMaskIdProvider *provider ) { mMaskIdProvider = provider; }
718 
724  const QgsMaskIdProvider *maskIdProvider() const { return mMaskIdProvider; }
725 
731  void setCurrentMaskId( int id ) { mCurrentMaskId = id; }
732 
739  int currentMaskId() const { return mCurrentMaskId; }
740 
750  void setIsGuiPreview( bool preview ) { mIsGuiPreview = preview; }
751 
762  bool isGuiPreview() const { return mIsGuiPreview; }
763 
770  QVariantMap customRenderingFlags() const { return mCustomRenderingFlags; }
771 
779  void setCustomRenderingFlag( const QString &flag, const QVariant &value ) { mCustomRenderingFlags[flag] = value; }
780 
787  void clearCustomRenderingFlag( const QString &flag ) { mCustomRenderingFlags.remove( flag ); }
788 
789  private:
790 
791  Flags mFlags;
792 
794  QPainter *mPainter = nullptr;
795 
802  QMap<int, QPainter *> mMaskPainter;
803 
809  QgsMaskIdProvider *mMaskIdProvider = nullptr;
810 
815  int mCurrentMaskId = -1;
816 
821  bool mIsGuiPreview = false;
822 
824  QgsCoordinateTransform mCoordTransform;
825 
831  QgsDistanceArea mDistanceArea;
832 
833  QgsRectangle mExtent;
834  QgsRectangle mOriginalMapExtent;
835 
836  QgsMapToPixel mMapToPixel;
837 
839  bool mRenderingStopped = false;
840 
842  double mScaleFactor = 1.0;
843 
845  double mRendererScale = 1.0;
846 
848  QgsLabelingEngine *mLabelingEngine = nullptr;
849 
851  QColor mSelectionColor;
852 
854  QgsVectorSimplifyMethod mVectorSimplifyMethod;
855 
857  QgsExpressionContext mExpressionContext;
858 
860  const QgsAbstractGeometry *mGeometry = nullptr;
861 
863  std::unique_ptr< QgsFeatureFilterProvider > mFeatureFilterProvider;
864 
865  double mSegmentationTolerance = M_PI_2 / 90;
866 
868 
869  QgsCoordinateTransformContext mTransformContext;
870 
871  QgsPathResolver mPathResolver;
872 
873  TextRenderFormat mTextRenderFormat = TextFormatAlwaysOutlines;
874  QList< QgsRenderedFeatureHandlerInterface * > mRenderedFeatureHandlers;
875  bool mHasRenderedFeatureHandlers = false;
876  QVariantMap mCustomRenderingFlags;
877 
878  QSet<const QgsSymbolLayer *> mDisabledSymbolLayers;
879 
880 #ifdef QGISDEBUG
881  bool mHasTransformContext = false;
882 #endif
883 };
884 
885 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsRenderContext::Flags )
886 
887 #ifndef SIP_RUN
888 
901 {
902  public:
903 
910  QgsScopedRenderContextPainterSwap( QgsRenderContext &context, QPainter *temporaryPainter )
911  : mContext( context )
912  , mPreviousPainter( context.painter() )
913  {
914  mContext.setPainter( temporaryPainter );
915  }
916 
920  void reset()
921  {
922  if ( !mReleased )
923  {
924  mContext.setPainter( mPreviousPainter );
925  mReleased = true;
926  }
927  }
928 
933  {
934  reset();
935  }
936 
937  private:
938 
939  QgsRenderContext &mContext;
940  QPainter *mPreviousPainter = nullptr;
941  bool mReleased = false;
942 };
943 
944 
957 {
958  public:
959 
968  : mContext( context )
969  {
970  if ( mContext.painter() )
971  mContext.painter()->scale( mContext.scaleFactor(), mContext.scaleFactor() );
972  }
973 
978  {
979  if ( mContext.painter() )
980  mContext.painter()->scale( 1.0 / mContext.scaleFactor(), 1.0 / mContext.scaleFactor() );
981  }
982 
983  private:
984 
985  QgsRenderContext &mContext;
986 };
987 
988 
1001 {
1002  public:
1003 
1012  : mContext( context )
1013  {
1014  if ( mContext.painter() )
1015  mContext.painter()->scale( 1.0 / mContext.scaleFactor(), 1.0 / mContext.scaleFactor() );
1016  }
1017 
1022  {
1023  if ( mContext.painter() )
1024  mContext.painter()->scale( mContext.scaleFactor(), mContext.scaleFactor() );
1025  }
1026 
1027  private:
1028 
1029  QgsRenderContext &mContext;
1030 };
1031 #endif
1032 
1033 #endif
QgsRenderContext::textRenderFormat
TextRenderFormat textRenderFormat() const
Returns the text render format, which dictates how text is rendered (e.g.
Definition: qgsrendercontext.h:679
QgsAbstractGeometry::MaximumAngle
@ MaximumAngle
Maximum angle between generating radii (lines from arc center to output vertices)
Definition: qgsabstractgeometry.h:118
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition: qgsexpressioncontext.h:369
QgsRenderContext::maskPainter
QPainter * maskPainter(int id=0)
Returns a mask QPainter for the render operation.
Definition: qgsrendercontext.h:195
QgsVectorSimplifyMethod
Definition: qgsvectorsimplifymethod.h:29
QgsRenderContext::setCustomRenderingFlag
void setCustomRenderingFlag(const QString &flag, const QVariant &value)
Sets a custom rendering flag.
Definition: qgsrendercontext.h:779
QgsRenderContext::setIsGuiPreview
void setIsGuiPreview(bool preview)
Sets GUI preview mode.
Definition: qgsrendercontext.h:750
QgsCoordinateTransformContext
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:309
QgsUnitTypes::RenderUnit
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:166
QgsRenderContext::expressionContext
QgsExpressionContext & expressionContext()
Gets the expression context.
Definition: qgsrendercontext.h:580
QgsRenderContext::expressionContext
const QgsExpressionContext & expressionContext() const
Gets the expression context (const version).
Definition: qgsrendercontext.h:589
QgsRenderContext::clearCustomRenderingFlag
void clearCustomRenderingFlag(const QString &flag)
Clears the specified custom rendering flag.
Definition: qgsrendercontext.h:787
qgsrectangle.h
QgsRenderContext::setSegmentationTolerance
void setSegmentationTolerance(double tolerance)
Sets the segmentation tolerance applied when rendering curved geometries.
Definition: qgsrendercontext.h:618
qgsmaptopixel.h
qgstemporalrangeobject.h
qgscoordinatetransformcontext.h
QgsRenderContext::setPainter
void setPainter(QPainter *p)
Sets the destination QPainter for the render operation.
Definition: qgsrendercontext.h:475
QgsRenderContext::hasRenderedFeatureHandlers
bool hasRenderedFeatureHandlers() const
Returns true if the context has any rendered feature handlers.
Definition: qgsrendercontext.h:707
qgspathresolver.h
qgsfeaturefilterprovider.h
QgsRenderContext
Definition: qgsrendercontext.h:57
QgsRenderContext::TextRenderFormat
TextRenderFormat
Options for rendering text.
Definition: qgsrendercontext.h:90
QgsRenderContext::setLabelingEngine
void setLabelingEngine(QgsLabelingEngine *engine)
Assign new labeling engine.
Definition: qgsrendercontext.h:509
QgsScopedRenderContextScaleToPixels::QgsScopedRenderContextScaleToPixels
QgsScopedRenderContextScaleToPixels(QgsRenderContext &context)
Constructor for QgsScopedRenderContextScaleToPixels.
Definition: qgsrendercontext.h:1011
QgsScopedRenderContextPainterSwap::~QgsScopedRenderContextPainterSwap
~QgsScopedRenderContextPainterSwap()
Returns the destination painter for the context back to the original QPainter object.
Definition: qgsrendercontext.h:932
QgsAbstractGeometry::SegmentationToleranceType
SegmentationToleranceType
Segmentation tolerance as maximum angle or maximum difference between approximation and circle.
Definition: qgsabstractgeometry.h:112
QgsRenderContext::scaleFactor
double scaleFactor() const
Returns the scaling factor for the render to convert painter units to physical sizes.
Definition: qgsrendercontext.h:317
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:290
QgsRenderContext::distanceArea
const QgsDistanceArea & distanceArea() const
A general purpose distance and area calculator, capable of performing ellipsoid based calculations.
Definition: qgsrendercontext.h:235
QgsRenderContext::setSegmentationToleranceType
void setSegmentationToleranceType(QgsAbstractGeometry::SegmentationToleranceType type)
Sets segmentation tolerance type (maximum angle or maximum difference between curve and approximation...
Definition: qgsrendercontext.h:632
QgsRectangle
Definition: qgsrectangle.h:41
QgsScopedRenderContextPainterSwap::QgsScopedRenderContextPainterSwap
QgsScopedRenderContextPainterSwap(QgsRenderContext &context, QPainter *temporaryPainter)
Constructor for QgsScopedRenderContextPainterSwap.
Definition: qgsrendercontext.h:910
qgssymbollayerreference.h
QgsRenderedFeatureHandlerInterface
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:217
QgsRenderContext::currentMaskId
int currentMaskId() const
Returns the current mask id, which can be used with maskPainter()
Definition: qgsrendercontext.h:739
QgsRenderContext::renderingStopped
bool renderingStopped() const
Returns true if the rendering operation has been stopped and any ongoing rendering should be canceled...
Definition: qgsrendercontext.h:325
QgsRenderContext::coordinateTransform
QgsCoordinateTransform coordinateTransform() const
Returns the current coordinate transform for the context.
Definition: qgsrendercontext.h:229
qgsexpressioncontext.h
QgsSymbolLayer
Definition: qgssymbollayer.h:52
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:724
QgsScopedRenderContextScaleToMm::QgsScopedRenderContextScaleToMm
QgsScopedRenderContextScaleToMm(QgsRenderContext &context)
Constructor for QgsScopedRenderContextScaleToMm.
Definition: qgsrendercontext.h:967
QgsRenderContext::setMaskIdProvider
void setMaskIdProvider(QgsMaskIdProvider *provider)
Attaches a mask id provider to the context.
Definition: qgsrendercontext.h:717
QgsRenderContext::customRenderingFlags
QVariantMap customRenderingFlags() const
Gets custom rendering flags.
Definition: qgsrendercontext.h:770
QgsRenderContext::setPathResolver
void setPathResolver(const QgsPathResolver &resolver)
Sets the path resolver for conversion between relative and absolute paths during rendering operations...
Definition: qgsrendercontext.h:273
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:418
QgsScopedRenderContextScaleToPixels::~QgsScopedRenderContextScaleToPixels
~QgsScopedRenderContextScaleToPixels()
Returns the destination painter back to millimeter based units.
Definition: qgsrendercontext.h:1021
QgsRenderContext::setVectorSimplifyMethod
void setVectorSimplifyMethod(const QgsVectorSimplifyMethod &simplifyMethod)
Sets the simplification setting to use when rendering vector layers.
Definition: qgsrendercontext.h:564
QgsRenderContext::TextFormatAlwaysText
@ TextFormatAlwaysText
Always render text as text objects.
Definition: qgsrendercontext.h:127
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:445
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:404
QgsRenderContext::segmentationTolerance
double segmentationTolerance() const
Gets the segmentation tolerance applied when rendering curved geometries.
Definition: qgsrendercontext.h:624
QgsRenderContext::segmentationToleranceType
QgsAbstractGeometry::SegmentationToleranceType segmentationToleranceType() const
Gets segmentation tolerance type (maximum angle or maximum difference between curve and approximation...
Definition: qgsrendercontext.h:638
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:452
QgsMapUnitScale
Struct for storing maximum and minimum scales for measurements in map units.
Definition: qgsmapunitscale.h:37
QgsRenderContext::painter
const QPainter * painter() const
Returns the const destination QPainter for the render operation.
Definition: qgsrendercontext.h:183
QgsScopedRenderContextScaleToMm
Definition: qgsrendercontext.h:956
QgsRenderContext::Flag
Flag
Enumeration of flags that affect rendering operations.
Definition: qgsrendercontext.h:69
QgsAbstractGeometry
Abstract base class for all geometries.
Definition: qgsabstractgeometry.h:71
QgsScopedRenderContextPainterSwap::reset
void reset()
Resets the destination painter for the context back to the original QPainter object.
Definition: qgsrendercontext.h:920
QgsRenderContext::setSelectionColor
void setSelectionColor(const QColor &color)
Sets the color to use when rendering selected features.
Definition: qgsrendercontext.h:516
QgsRenderContext::vectorSimplifyMethod
const QgsVectorSimplifyMethod & vectorSimplifyMethod() const
Returns the simplification settings to use when rendering vector layers.
Definition: qgsrendercontext.h:549
QgsRenderContext::setRendererScale
void setRendererScale(double scale)
Sets the renderer map scale.
Definition: qgsrendercontext.h:467
QgsLabelingEngine
The QgsLabelingEngine class provides map labeling functionality. The input for the engine is a list o...
Definition: qgslabelingengine.h:214
QgsRenderContext::setTextRenderFormat
void setTextRenderFormat(TextRenderFormat format)
Sets the text render format, which dictates how text is rendered (e.g.
Definition: qgsrendercontext.h:690
QgsScopedRenderContextPainterSwap
Definition: qgsrendercontext.h:900
QgsRenderContext::selectionColor
QColor selectionColor() const
Returns the color to use when rendering selected features.
Definition: qgsrendercontext.h:374
QgsRenderContext::labelingEngine
QgsLabelingEngine * labelingEngine() const
Gets access to new labeling engine (may be nullptr)
Definition: qgsrendercontext.h:367
QgsMaskIdProvider
Definition: qgsmaskidprovider.h:37
QgsRenderContext::mapExtent
QgsRectangle mapExtent() const
Returns the original extent of the map being rendered.
Definition: qgsrendercontext.h:302
QgsRenderContext::geometry
const QgsAbstractGeometry * geometry() const
Returns pointer to the unsegmentized geometry.
Definition: qgsrendercontext.h:592
QgsMapToPixel
Definition: qgsmaptopixel.h:37
QgsRenderContext::isGuiPreview
bool isGuiPreview() const
Returns the Gui preview mode.
Definition: qgsrendercontext.h:762
QgsRenderContext::pathResolver
const QgsPathResolver & pathResolver() const
Returns the path resolver for conversion between relative and absolute paths during rendering operati...
Definition: qgsrendercontext.h:264
QgsFeatureFilterProvider
Definition: qgsfeaturefilterprovider.h:40
qgsmapunitscale.h
QgsRenderContext::setExpressionContext
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context.
Definition: qgsrendercontext.h:572
QgsDistanceArea
Definition: qgsdistancearea.h:49
QgsScopedRenderContextScaleToMm::~QgsScopedRenderContextScaleToMm
~QgsScopedRenderContextScaleToMm()
Returns the destination painter back to pixel based units.
Definition: qgsrendercontext.h:977
qgsdistancearea.h
QgsScopedRenderContextScaleToPixels
Definition: qgsrendercontext.h:1000
QgsRenderContext::painter
QPainter * painter()
Returns the destination QPainter for the render operation.
Definition: qgsrendercontext.h:174
QgsRenderContext::setGeometry
void setGeometry(const QgsAbstractGeometry *geometry)
Sets pointer to original (unsegmentized) geometry.
Definition: qgsrendercontext.h:594
QgsRenderContext::rendererScale
double rendererScale() const
Returns the renderer map scale.
Definition: qgsrendercontext.h:361
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:495
QgsRenderContext::TextFormatAlwaysOutlines
@ TextFormatAlwaysOutlines
Always render text using path objects (AKA outlines/curves).
Definition: qgsrendercontext.h:111
QgsMapSettings
Definition: qgsmapsettings.h:86
QgsCoordinateTransform
Definition: qgscoordinatetransform.h:52
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:206
QgsRenderContext::setCurrentMaskId
void setCurrentMaskId(int id)
Stores a mask id as the "current" one.
Definition: qgsrendercontext.h:731
QgsPathResolver
Definition: qgspathresolver.h:31
QgsTemporalRangeObject
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:460
QgsRenderContext::setMapExtent
void setMapExtent(const QgsRectangle &extent)
Sets the original extent of the map being rendered.
Definition: qgsrendercontext.h:430
QgsRenderContext::setMaskPainter
void setMaskPainter(QPainter *p, int id=0)
Sets a mask QPainter for the render operation.
Definition: qgsrendercontext.h:484