QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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 class QgsMaskIdProvider;
48 
49 
57 class CORE_EXPORT QgsRenderContext : public QgsTemporalRangeObject
58 {
59  public:
61  ~QgsRenderContext() override;
62 
64  QgsRenderContext &operator=( const QgsRenderContext &rh );
65 
70  enum Flag
71  {
72  DrawEditingInfo = 0x01,
73  ForceVectorOutput = 0x02,
74  UseAdvancedEffects = 0x04,
75  UseRenderingOptimization = 0x08,
76  DrawSelection = 0x10,
77  DrawSymbolBounds = 0x20,
78  RenderMapTile = 0x40,
79  Antialiasing = 0x80,
80  RenderPartialOutput = 0x100,
81  RenderPreviewJob = 0x200,
82  RenderBlocking = 0x400,
83  RenderSymbolPreview = 0x800,
84  LosslessImageRendering = 0x1000,
85  ApplyScalingWorkaroundForTextRendering = 0x2000,
86  Render3DMap = 0x4000,
87  ApplyClipAfterReprojection = 0x8000,
88  };
89  Q_DECLARE_FLAGS( Flags, Flag )
90 
91 
96  {
97  // refs for below dox: https://github.com/qgis/QGIS/pull/1286#issuecomment-39806854
98  // https://github.com/qgis/QGIS/pull/8573#issuecomment-445585826
99 
117 
133  };
134 
139  void setFlags( QgsRenderContext::Flags flags );
140 
145  void setFlag( Flag flag, bool on = true );
146 
151  Flags flags() const;
152 
157  bool testFlag( Flag flag ) const;
158 
163  static QgsRenderContext fromMapSettings( const QgsMapSettings &mapSettings );
164 
171  static QgsRenderContext fromQPainter( QPainter *painter );
172 
173  //getters
174 
179  QPainter *painter() {return mPainter;}
180 
181 #ifndef SIP_RUN
182 
188  const QPainter *painter() const { return mPainter; }
189 #endif
190 
200  void setPainterFlagsUsingContext( QPainter *painter = nullptr ) const;
201 
211  QPainter *maskPainter( int id = 0 ) { return mMaskPainter.value( id, nullptr ); }
212 
222  QSet<const QgsSymbolLayer *> disabledSymbolLayers() const { return mDisabledSymbolLayers; }
223 
233  bool isSymbolLayerEnabled( const QgsSymbolLayer *layer ) const { return ! mDisabledSymbolLayers.contains( layer ); }
234 
245  QgsCoordinateTransform coordinateTransform() const {return mCoordTransform;}
246 
251  const QgsDistanceArea &distanceArea() const { return mDistanceArea; }
252 
261  QgsCoordinateTransformContext transformContext() const;
262 
271  void setTransformContext( const QgsCoordinateTransformContext &context );
272 
280  const QgsPathResolver &pathResolver() const { return mPathResolver; }
281 
289  void setPathResolver( const QgsPathResolver &resolver ) { mPathResolver = resolver; }
290 
306  const QgsRectangle &extent() const { return mExtent; }
307 
318  QgsRectangle mapExtent() const { return mOriginalMapExtent; }
319 
325  const QgsMapToPixel &mapToPixel() const {return mMapToPixel;}
326 
333  double scaleFactor() const {return mScaleFactor;}
334 
341  bool renderingStopped() const {return mRenderingStopped;}
342 
349  bool forceVectorOutput() const;
350 
356  bool useAdvancedEffects() const;
357 
363  void setUseAdvancedEffects( bool enabled );
364 
370  bool drawEditingInformation() const;
371 
377  double rendererScale() const {return mRendererScale;}
378 
383  QgsLabelingEngine *labelingEngine() const { return mLabelingEngine; } SIP_SKIP
384 
390  QColor selectionColor() const { return mSelectionColor; }
391 
399  bool showSelection() const;
400 
401  //setters
402 
413  void setCoordinateTransform( const QgsCoordinateTransform &t );
414 
420  void setMapToPixel( const QgsMapToPixel &mtp ) {mMapToPixel = mtp;}
421 
434  void setExtent( const QgsRectangle &extent ) {mExtent = extent;}
435 
446  void setMapExtent( const QgsRectangle &extent ) { mOriginalMapExtent = extent; }
447 
453  void setDrawEditingInformation( bool b );
454 
461  void setRenderingStopped( bool stopped ) {mRenderingStopped = stopped;}
462 
468  void setDistanceArea( const QgsDistanceArea &distanceArea ) {mDistanceArea = distanceArea ;}
469 
476  void setScaleFactor( double factor ) {mScaleFactor = factor;}
477 
483  void setRendererScale( double scale ) {mRendererScale = scale;}
484 
491  void setPainter( QPainter *p ) {mPainter = p;}
492 
500  void setMaskPainter( QPainter *p, int id = 0 ) { mMaskPainter[id] = p; }
501 
511  void setDisabledSymbolLayers( const QSet<const QgsSymbolLayer *> &symbolLayers ) { mDisabledSymbolLayers = symbolLayers; }
512 
519  void setForceVectorOutput( bool force );
520 
525  void setLabelingEngine( QgsLabelingEngine *engine ) { mLabelingEngine = engine; } SIP_SKIP
526 
532  void setSelectionColor( const QColor &color ) { mSelectionColor = color; }
533 
541  void setShowSelection( bool showSelection );
542 
548  bool useRenderingOptimization() const;
549 
555  void setUseRenderingOptimization( bool enabled );
556 
565  const QgsVectorSimplifyMethod &vectorSimplifyMethod() const { return mVectorSimplifyMethod; }
566 
580  void setVectorSimplifyMethod( const QgsVectorSimplifyMethod &simplifyMethod ) { mVectorSimplifyMethod = simplifyMethod; }
581 
588  void setExpressionContext( const QgsExpressionContext &context ) { mExpressionContext = context; }
589 
596  QgsExpressionContext &expressionContext() { return mExpressionContext; }
597 
605  const QgsExpressionContext &expressionContext() const { return mExpressionContext; } SIP_SKIP
606 
608  const QgsAbstractGeometry *geometry() const { return mGeometry; }
610  void setGeometry( const QgsAbstractGeometry *geometry ) { mGeometry = geometry; }
611 
618  void setFeatureFilterProvider( const QgsFeatureFilterProvider *ffp );
619 
626  const QgsFeatureFilterProvider *featureFilterProvider() const;
627 
634  void setSegmentationTolerance( double tolerance ) { mSegmentationTolerance = tolerance; }
635 
640  double segmentationTolerance() const { return mSegmentationTolerance; }
641 
648  void setSegmentationToleranceType( QgsAbstractGeometry::SegmentationToleranceType type ) { mSegmentationToleranceType = type; }
649 
654  QgsAbstractGeometry::SegmentationToleranceType segmentationToleranceType() const { return mSegmentationToleranceType; }
655 
656  // Conversions
657 
664  double convertToPainterUnits( double size, QgsUnitTypes::RenderUnit unit, const QgsMapUnitScale &scale = QgsMapUnitScale() ) const;
665 
672  double convertToMapUnits( double size, QgsUnitTypes::RenderUnit unit, const QgsMapUnitScale &scale = QgsMapUnitScale() ) const;
673 
679  double convertFromMapUnits( double sizeInMapUnits, QgsUnitTypes::RenderUnit outputUnit ) const;
680 
687  double convertMetersToMapUnits( double meters ) const;
688 
696  {
697  return mTextRenderFormat;
698  }
699 
707  {
708  mTextRenderFormat = format;
709  }
710 
716  QList<QgsRenderedFeatureHandlerInterface *> renderedFeatureHandlers() const;
717 
723  bool hasRenderedFeatureHandlers() const { return mHasRenderedFeatureHandlers; }
724 
733  void setMaskIdProvider( QgsMaskIdProvider *provider ) { mMaskIdProvider = provider; }
734 
740  const QgsMaskIdProvider *maskIdProvider() const { return mMaskIdProvider; }
741 
747  void setCurrentMaskId( int id ) { mCurrentMaskId = id; }
748 
755  int currentMaskId() const { return mCurrentMaskId; }
756 
766  void setIsGuiPreview( bool preview ) { mIsGuiPreview = preview; }
767 
778  bool isGuiPreview() const { return mIsGuiPreview; }
779 
786  QVariantMap customRenderingFlags() const { return mCustomRenderingFlags; }
787 
795  void setCustomRenderingFlag( const QString &flag, const QVariant &value ) { mCustomRenderingFlags[flag] = value; }
796 
803  void clearCustomRenderingFlag( const QString &flag ) { mCustomRenderingFlags.remove( flag ); }
804 
812  QList< QgsMapClippingRegion > clippingRegions() const;
813 
828  QgsGeometry featureClipGeometry() const;
829 
839  void setFeatureClipGeometry( const QgsGeometry &geometry );
840 
848  QPointF textureOrigin() const;
849 
857  void setTextureOrigin( const QPointF &origin );
858 
859  private:
860 
861  Flags mFlags;
862 
864  QPainter *mPainter = nullptr;
865 
872  QMap<int, QPainter *> mMaskPainter;
873 
879  QgsMaskIdProvider *mMaskIdProvider = nullptr;
880 
885  int mCurrentMaskId = -1;
886 
891  bool mIsGuiPreview = false;
892 
894  QgsCoordinateTransform mCoordTransform;
895 
901  QgsDistanceArea mDistanceArea;
902 
903  QgsRectangle mExtent;
904  QgsRectangle mOriginalMapExtent;
905 
906  QgsMapToPixel mMapToPixel;
907 
909  bool mRenderingStopped = false;
910 
912  double mScaleFactor = 1.0;
913 
915  double mRendererScale = 1.0;
916 
918  QgsLabelingEngine *mLabelingEngine = nullptr;
919 
921  QColor mSelectionColor;
922 
924  QgsVectorSimplifyMethod mVectorSimplifyMethod;
925 
927  QgsExpressionContext mExpressionContext;
928 
930  const QgsAbstractGeometry *mGeometry = nullptr;
931 
933  std::unique_ptr< QgsFeatureFilterProvider > mFeatureFilterProvider;
934 
935  double mSegmentationTolerance = M_PI_2 / 90;
936 
938 
939  QgsCoordinateTransformContext mTransformContext;
940 
941  QgsPathResolver mPathResolver;
942 
943  TextRenderFormat mTextRenderFormat = TextFormatAlwaysOutlines;
944  QList< QgsRenderedFeatureHandlerInterface * > mRenderedFeatureHandlers;
945  bool mHasRenderedFeatureHandlers = false;
946  QVariantMap mCustomRenderingFlags;
947 
948  QSet<const QgsSymbolLayer *> mDisabledSymbolLayers;
949 
950  QList< QgsMapClippingRegion > mClippingRegions;
951  QgsGeometry mFeatureClipGeometry;
952 
953  QPointF mTextureOrigin;
954 
955 #ifdef QGISDEBUG
956  bool mHasTransformContext = false;
957 #endif
958 };
959 
960 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsRenderContext::Flags )
961 
962 #ifndef SIP_RUN
963 
976 {
977  public:
978 
985  QgsScopedRenderContextPainterSwap( QgsRenderContext &context, QPainter *temporaryPainter )
986  : mContext( context )
987  , mPreviousPainter( context.painter() )
988  {
989  mContext.setPainter( temporaryPainter );
990  }
991 
995  void reset()
996  {
997  if ( !mReleased )
998  {
999  mContext.setPainter( mPreviousPainter );
1000  mReleased = true;
1001  }
1002  }
1003 
1008  {
1009  reset();
1010  }
1011 
1012  private:
1013 
1014  QgsRenderContext &mContext;
1015  QPainter *mPreviousPainter = nullptr;
1016  bool mReleased = false;
1017 };
1018 
1019 
1032 {
1033  public:
1034 
1043  : mContext( context )
1044  {
1045  if ( mContext.painter() )
1046  mContext.painter()->scale( mContext.scaleFactor(), mContext.scaleFactor() );
1047  }
1048 
1053  {
1054  if ( mContext.painter() )
1055  mContext.painter()->scale( 1.0 / mContext.scaleFactor(), 1.0 / mContext.scaleFactor() );
1056  }
1057 
1058  private:
1059 
1060  QgsRenderContext &mContext;
1061 };
1062 
1063 
1076 {
1077  public:
1078 
1087  : mContext( context )
1088  {
1089  if ( mContext.painter() )
1090  mContext.painter()->scale( 1.0 / mContext.scaleFactor(), 1.0 / mContext.scaleFactor() );
1091  }
1092 
1097  {
1098  if ( mContext.painter() )
1099  mContext.painter()->scale( mContext.scaleFactor(), mContext.scaleFactor() );
1100  }
1101 
1102  private:
1103 
1104  QgsRenderContext &mContext;
1105 };
1106 
1107 
1120 {
1121  public:
1122 
1128  QgsScopedQPainterState( QPainter *painter )
1129  : mPainter( painter )
1130  {
1131  mPainter->save();
1132  }
1133 
1138  {
1139  mPainter->restore();
1140  }
1141 
1142  private:
1143 
1144  QPainter *mPainter = nullptr;
1145 };
1146 
1147 #endif
1148 
1149 #endif
QgsRenderContext::textRenderFormat
TextRenderFormat textRenderFormat() const
Returns the text render format, which dictates how text is rendered (e.g.
Definition: qgsrendercontext.h:695
QgsAbstractGeometry::MaximumAngle
@ MaximumAngle
Maximum angle between generating radii (lines from arc center to output vertices)
Definition: qgsabstractgeometry.h:121
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition: qgsexpressioncontext.h:370
QgsRenderContext::maskPainter
QPainter * maskPainter(int id=0)
Returns a mask QPainter for the render operation.
Definition: qgsrendercontext.h:211
QgsVectorSimplifyMethod
This class contains information how to simplify geometries fetched from a vector layer.
Definition: qgsvectorsimplifymethod.h:30
QgsRenderContext::setCustomRenderingFlag
void setCustomRenderingFlag(const QString &flag, const QVariant &value)
Sets a custom rendering flag.
Definition: qgsrendercontext.h:795
QgsRenderContext::setIsGuiPreview
void setIsGuiPreview(bool preview)
Sets GUI preview mode.
Definition: qgsrendercontext.h:766
QgsCoordinateTransformContext
Contains information about the context in which a coordinate transform is executed.
Definition: qgscoordinatetransformcontext.h:58
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:325
QgsMapClippingRegion
A map clipping region (in map coordinates and CRS).
Definition: qgsmapclippingregion.h:32
QgsUnitTypes::RenderUnit
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:167
QgsRenderContext::expressionContext
QgsExpressionContext & expressionContext()
Gets the expression context.
Definition: qgsrendercontext.h:596
QgsRenderContext::expressionContext
const QgsExpressionContext & expressionContext() const
Gets the expression context (const version).
Definition: qgsrendercontext.h:605
QgsRenderContext::clearCustomRenderingFlag
void clearCustomRenderingFlag(const QString &flag)
Clears the specified custom rendering flag.
Definition: qgsrendercontext.h:803
qgsrectangle.h
QgsRenderContext::setSegmentationTolerance
void setSegmentationTolerance(double tolerance)
Sets the segmentation tolerance applied when rendering curved geometries.
Definition: qgsrendercontext.h:634
qgsmaptopixel.h
qgstemporalrangeobject.h
qgscoordinatetransformcontext.h
QgsRenderContext::setPainter
void setPainter(QPainter *p)
Sets the destination QPainter for the render operation.
Definition: qgsrendercontext.h:491
QgsRenderContext::hasRenderedFeatureHandlers
bool hasRenderedFeatureHandlers() const
Returns true if the context has any rendered feature handlers.
Definition: qgsrendercontext.h:723
qgspathresolver.h
qgsfeaturefilterprovider.h
QgsRenderContext
Contains information about the context of a rendering operation.
Definition: qgsrendercontext.h:58
QgsRenderContext::TextRenderFormat
TextRenderFormat
Options for rendering text.
Definition: qgsrendercontext.h:96
QgsRenderContext::setLabelingEngine
void setLabelingEngine(QgsLabelingEngine *engine)
Assign new labeling engine.
Definition: qgsrendercontext.h:525
QgsScopedRenderContextScaleToPixels::QgsScopedRenderContextScaleToPixels
QgsScopedRenderContextScaleToPixels(QgsRenderContext &context)
Constructor for QgsScopedRenderContextScaleToPixels.
Definition: qgsrendercontext.h:1086
QgsScopedRenderContextPainterSwap::~QgsScopedRenderContextPainterSwap
~QgsScopedRenderContextPainterSwap()
Returns the destination painter for the context back to the original QPainter object.
Definition: qgsrendercontext.h:1007
QgsAbstractGeometry::SegmentationToleranceType
SegmentationToleranceType
Segmentation tolerance as maximum angle or maximum difference between approximation and circle.
Definition: qgsabstractgeometry.h:115
QgsRenderContext::scaleFactor
double scaleFactor() const
Returns the scaling factor for the render to convert painter units to physical sizes.
Definition: qgsrendercontext.h:333
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:306
QgsRenderContext::distanceArea
const QgsDistanceArea & distanceArea() const
A general purpose distance and area calculator, capable of performing ellipsoid based calculations.
Definition: qgsrendercontext.h:251
QgsRenderContext::setSegmentationToleranceType
void setSegmentationToleranceType(QgsAbstractGeometry::SegmentationToleranceType type)
Sets segmentation tolerance type (maximum angle or maximum difference between curve and approximation...
Definition: qgsrendercontext.h:648
QgsRectangle
A rectangle specified with double values.
Definition: qgsrectangle.h:42
QgsScopedRenderContextPainterSwap::QgsScopedRenderContextPainterSwap
QgsScopedRenderContextPainterSwap(QgsRenderContext &context, QPainter *temporaryPainter)
Constructor for QgsScopedRenderContextPainterSwap.
Definition: qgsrendercontext.h:985
qgssymbollayerreference.h
QgsRenderedFeatureHandlerInterface
An interface for classes which provider custom handlers for features rendered as part of a map render...
Definition: qgsrenderedfeaturehandlerinterface.h:47
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:233
QgsRenderContext::currentMaskId
int currentMaskId() const
Returns the current mask id, which can be used with maskPainter()
Definition: qgsrendercontext.h:755
QgsRenderContext::renderingStopped
bool renderingStopped() const
Returns true if the rendering operation has been stopped and any ongoing rendering should be canceled...
Definition: qgsrendercontext.h:341
QgsRenderContext::coordinateTransform
QgsCoordinateTransform coordinateTransform() const
Returns the current coordinate transform for the context.
Definition: qgsrendercontext.h:245
qgsexpressioncontext.h
QgsSymbolLayer
Definition: qgssymbollayer.h:53
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:740
QgsScopedRenderContextScaleToMm::QgsScopedRenderContextScaleToMm
QgsScopedRenderContextScaleToMm(QgsRenderContext &context)
Constructor for QgsScopedRenderContextScaleToMm.
Definition: qgsrendercontext.h:1042
QgsRenderContext::setMaskIdProvider
void setMaskIdProvider(QgsMaskIdProvider *provider)
Attaches a mask id provider to the context.
Definition: qgsrendercontext.h:733
QgsRenderContext::customRenderingFlags
QVariantMap customRenderingFlags() const
Gets custom rendering flags.
Definition: qgsrendercontext.h:786
QgsRenderContext::setPathResolver
void setPathResolver(const QgsPathResolver &resolver)
Sets the path resolver for conversion between relative and absolute paths during rendering operations...
Definition: qgsrendercontext.h:289
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:434
QgsScopedRenderContextScaleToPixels::~QgsScopedRenderContextScaleToPixels
~QgsScopedRenderContextScaleToPixels()
Returns the destination painter back to millimeter based units.
Definition: qgsrendercontext.h:1096
QgsRenderContext::setVectorSimplifyMethod
void setVectorSimplifyMethod(const QgsVectorSimplifyMethod &simplifyMethod)
Sets the simplification setting to use when rendering vector layers.
Definition: qgsrendercontext.h:580
QgsRenderContext::TextFormatAlwaysText
@ TextFormatAlwaysText
Always render text as text objects.
Definition: qgsrendercontext.h:132
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:461
qgis_sip.h
Q_DECLARE_OPERATORS_FOR_FLAGS
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
QgsRenderContext::~QgsRenderContext
~QgsRenderContext() override
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:420
QgsRenderContext::segmentationTolerance
double segmentationTolerance() const
Gets the segmentation tolerance applied when rendering curved geometries.
Definition: qgsrendercontext.h:640
QgsRenderContext::segmentationToleranceType
QgsAbstractGeometry::SegmentationToleranceType segmentationToleranceType() const
Gets segmentation tolerance type (maximum angle or maximum difference between curve and approximation...
Definition: qgsrendercontext.h:654
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:468
QgsMapUnitScale
Struct for storing maximum and minimum scales for measurements in map units.
Definition: qgsmapunitscale.h:38
QgsScopedQPainterState
Scoped object for saving and restoring a QPainter object's state.
Definition: qgsrendercontext.h:1120
QgsRenderContext::painter
const QPainter * painter() const
Returns the const destination QPainter for the render operation.
Definition: qgsrendercontext.h:188
QgsScopedRenderContextScaleToMm
Scoped object for temporary scaling of a QgsRenderContext for millimeter based rendering.
Definition: qgsrendercontext.h:1032
QgsRenderContext::Flag
Flag
Enumeration of flags that affect rendering operations.
Definition: qgsrendercontext.h:71
QgsAbstractGeometry
Abstract base class for all geometries.
Definition: qgsabstractgeometry.h:74
QgsScopedRenderContextPainterSwap::reset
void reset()
Resets the destination painter for the context back to the original QPainter object.
Definition: qgsrendercontext.h:995
QgsRenderContext::setSelectionColor
void setSelectionColor(const QColor &color)
Sets the color to use when rendering selected features.
Definition: qgsrendercontext.h:532
QgsRenderContext::vectorSimplifyMethod
const QgsVectorSimplifyMethod & vectorSimplifyMethod() const
Returns the simplification settings to use when rendering vector layers.
Definition: qgsrendercontext.h:565
QgsRenderContext::setRendererScale
void setRendererScale(double scale)
Sets the renderer map scale.
Definition: qgsrendercontext.h:483
QgsLabelingEngine
The QgsLabelingEngine class provides map labeling functionality.
Definition: qgslabelingengine.h:215
QgsRenderContext::setTextRenderFormat
void setTextRenderFormat(TextRenderFormat format)
Sets the text render format, which dictates how text is rendered (e.g.
Definition: qgsrendercontext.h:706
QgsScopedQPainterState::~QgsScopedQPainterState
~QgsScopedQPainterState()
Restores the painter back to its original state.
Definition: qgsrendercontext.h:1137
QgsScopedRenderContextPainterSwap
Scoped object for temporary replacement of a QgsRenderContext destination painter.
Definition: qgsrendercontext.h:976
QgsRenderContext::selectionColor
QColor selectionColor() const
Returns the color to use when rendering selected features.
Definition: qgsrendercontext.h:390
QgsRenderContext::labelingEngine
QgsLabelingEngine * labelingEngine() const
Gets access to new labeling engine (may be nullptr)
Definition: qgsrendercontext.h:383
QgsMaskIdProvider
Some rendering operations may need multiple mask images.
Definition: qgsmaskidprovider.h:38
QgsRenderContext::mapExtent
QgsRectangle mapExtent() const
Returns the original extent of the map being rendered.
Definition: qgsrendercontext.h:318
QgsRenderContext::geometry
const QgsAbstractGeometry * geometry() const
Returns pointer to the unsegmentized geometry.
Definition: qgsrendercontext.h:608
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
QgsRenderContext::isGuiPreview
bool isGuiPreview() const
Returns the Gui preview mode.
Definition: qgsrendercontext.h:778
QgsRenderContext::pathResolver
const QgsPathResolver & pathResolver() const
Returns the path resolver for conversion between relative and absolute paths during rendering operati...
Definition: qgsrendercontext.h:280
QgsFeatureFilterProvider
Abstract interface for use by classes that filter the features of a layer.
Definition: qgsfeaturefilterprovider.h:41
QgsScopedQPainterState::QgsScopedQPainterState
QgsScopedQPainterState(QPainter *painter)
Constructor for QgsScopedQPainterState.
Definition: qgsrendercontext.h:1128
qgsmapunitscale.h
QgsRenderContext::setExpressionContext
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context.
Definition: qgsrendercontext.h:588
QgsDistanceArea
A general purpose distance and area calculator, capable of performing ellipsoid based calculations.
Definition: qgsdistancearea.h:50
QgsScopedRenderContextScaleToMm::~QgsScopedRenderContextScaleToMm
~QgsScopedRenderContextScaleToMm()
Returns the destination painter back to pixel based units.
Definition: qgsrendercontext.h:1052
qgsdistancearea.h
QgsScopedRenderContextScaleToPixels
Scoped object for temporary scaling of a QgsRenderContext for pixel based rendering.
Definition: qgsrendercontext.h:1076
QgsRenderContext::painter
QPainter * painter()
Returns the destination QPainter for the render operation.
Definition: qgsrendercontext.h:179
QgsRenderContext::setGeometry
void setGeometry(const QgsAbstractGeometry *geometry)
Sets pointer to original (unsegmentized) geometry.
Definition: qgsrendercontext.h:610
QgsRenderContext::rendererScale
double rendererScale() const
Returns the renderer map scale.
Definition: qgsrendercontext.h:377
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:511
QgsRenderContext::TextFormatAlwaysOutlines
@ TextFormatAlwaysOutlines
Always render text using path objects (AKA outlines/curves).
Definition: qgsrendercontext.h:116
QgsMapSettings
The QgsMapSettings class contains configuration for rendering of the map.
Definition: qgsmapsettings.h:88
QgsCoordinateTransform
Class for doing transforms between two map coordinate systems.
Definition: qgscoordinatetransform.h:53
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:222
QgsRenderContext::setCurrentMaskId
void setCurrentMaskId(int id)
Stores a mask id as the "current" one.
Definition: qgsrendercontext.h:747
QgsPathResolver
Resolves relative paths into absolute paths and vice versa.
Definition: qgspathresolver.h:32
QgsTemporalRangeObject
Base class for objects with an associated (optional) temporal range.
Definition: qgstemporalrangeobject.h:34
QgsRenderContext::setScaleFactor
void setScaleFactor(double factor)
Sets the scaling factor for the render to convert painter units to physical sizes.
Definition: qgsrendercontext.h:476
QgsRenderContext::setMapExtent
void setMapExtent(const QgsRectangle &extent)
Sets the original extent of the map being rendered.
Definition: qgsrendercontext.h:446
QgsRenderContext::setMaskPainter
void setMaskPainter(QPainter *p, int id=0)
Sets a mask QPainter for the render operation.
Definition: qgsrendercontext.h:500