QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsrendercontext.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrendercontext.cpp
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 
19 #include "qgsrendercontext.h"
20 
21 #include "qgsmapsettings.h"
22 #include "qgsexpression.h"
23 #include "qgsvectorlayer.h"
25 #include "qgslogger.h"
26 #include "qgspoint.h"
27 
28 #define POINTS_TO_MM 2.83464567
29 #define INCH_TO_MM 25.4
30 
32  : mFlags( Qgis::RenderContextFlag::DrawEditingInfo | Qgis::RenderContextFlag::UseAdvancedEffects | Qgis::RenderContextFlag::DrawSelection | Qgis::RenderContextFlag::UseRenderingOptimization )
33 {
35  // For RenderMetersInMapUnits support, when rendering in Degrees, the Ellipsoid must be set
36  // - for Previews/Icons the default Extent can be used
37  mDistanceArea.setEllipsoid( mDistanceArea.sourceCrs().ellipsoidAcronym() );
38 }
39 
41 
44  , mFlags( rh.mFlags )
45  , mPainter( rh.mPainter )
46  , mMaskPainter( rh.mMaskPainter )
47  , mCoordTransform( rh.mCoordTransform )
48  , mDistanceArea( rh.mDistanceArea )
49  , mExtent( rh.mExtent )
50  , mOriginalMapExtent( rh.mOriginalMapExtent )
51  , mMapToPixel( rh.mMapToPixel )
52  , mRenderingStopped( rh.mRenderingStopped )
53  , mFeedback( rh.mFeedback )
54  , mScaleFactor( rh.mScaleFactor )
55  , mDpiTarget( rh.mDpiTarget )
56  , mRendererScale( rh.mRendererScale )
57  , mSymbologyReferenceScale( rh.mSymbologyReferenceScale )
58  , mLabelingEngine( rh.mLabelingEngine )
59  , mLabelSink( rh.mLabelSink )
60  , mSelectionColor( rh.mSelectionColor )
61  , mVectorSimplifyMethod( rh.mVectorSimplifyMethod )
62  , mExpressionContext( rh.mExpressionContext )
63  , mGeometry( rh.mGeometry )
64  , mFeatureFilterProvider( rh.mFeatureFilterProvider ? rh.mFeatureFilterProvider->clone() : nullptr )
65  , mSegmentationTolerance( rh.mSegmentationTolerance )
66  , mSegmentationToleranceType( rh.mSegmentationToleranceType )
67  , mTransformContext( rh.mTransformContext )
68  , mPathResolver( rh.mPathResolver )
69  , mTextRenderFormat( rh.mTextRenderFormat )
70  , mRenderedFeatureHandlers( rh.mRenderedFeatureHandlers )
71  , mHasRenderedFeatureHandlers( rh.mHasRenderedFeatureHandlers )
72  , mCustomRenderingFlags( rh.mCustomRenderingFlags )
73  , mDisabledSymbolLayers()
74  , mClippingRegions( rh.mClippingRegions )
75  , mFeatureClipGeometry( rh.mFeatureClipGeometry )
76  , mTextureOrigin( rh.mTextureOrigin )
77  , mZRange( rh.mZRange )
78  , mSize( rh.mSize )
79  , mDevicePixelRatio( rh.mDevicePixelRatio )
80  , mImageFormat( rh.mImageFormat )
81  , mRendererUsage( rh.mRendererUsage )
82  , mFrameRate( rh.mFrameRate )
83  , mCurrentFrame( rh.mCurrentFrame )
84  , mSymbolLayerClipPaths( rh.mSymbolLayerClipPaths )
85 #ifdef QGISDEBUG
86  , mHasTransformContext( rh.mHasTransformContext )
87 #endif
88 {
89 }
90 
92 {
93  mFlags = rh.mFlags;
94  mPainter = rh.mPainter;
95  mMaskPainter = rh.mMaskPainter;
96  mCoordTransform = rh.mCoordTransform;
97  mExtent = rh.mExtent;
98  mOriginalMapExtent = rh.mOriginalMapExtent;
99  mMapToPixel = rh.mMapToPixel;
100  mRenderingStopped = rh.mRenderingStopped;
101  mFeedback = rh.mFeedback;
102  mScaleFactor = rh.mScaleFactor;
103  mDpiTarget = rh.mDpiTarget;
104  mRendererScale = rh.mRendererScale;
105  mSymbologyReferenceScale = rh.mSymbologyReferenceScale;
106  mLabelingEngine = rh.mLabelingEngine;
107  mLabelSink = rh.mLabelSink;
108  mSelectionColor = rh.mSelectionColor;
109  mVectorSimplifyMethod = rh.mVectorSimplifyMethod;
110  mExpressionContext = rh.mExpressionContext;
111  mGeometry = rh.mGeometry;
112  mFeatureFilterProvider.reset( rh.mFeatureFilterProvider ? rh.mFeatureFilterProvider->clone() : nullptr );
113  mSegmentationTolerance = rh.mSegmentationTolerance;
114  mSegmentationToleranceType = rh.mSegmentationToleranceType;
115  mDistanceArea = rh.mDistanceArea;
116  mTransformContext = rh.mTransformContext;
117  mPathResolver = rh.mPathResolver;
118  mTextRenderFormat = rh.mTextRenderFormat;
119  mRenderedFeatureHandlers = rh.mRenderedFeatureHandlers;
120  mHasRenderedFeatureHandlers = rh.mHasRenderedFeatureHandlers;
121  mCustomRenderingFlags = rh.mCustomRenderingFlags;
122  mClippingRegions = rh.mClippingRegions;
123  mFeatureClipGeometry = rh.mFeatureClipGeometry;
124  mTextureOrigin = rh.mTextureOrigin;
125  mZRange = rh.mZRange;
126  mSize = rh.mSize;
127  mDevicePixelRatio = rh.mDevicePixelRatio;
128  mImageFormat = rh.mImageFormat;
129  setIsTemporal( rh.isTemporal() );
130  mRendererUsage = rh.mRendererUsage;
131  mFrameRate = rh.mFrameRate;
132  mCurrentFrame = rh.mCurrentFrame;
133  mSymbolLayerClipPaths = rh.mSymbolLayerClipPaths;
134  if ( isTemporal() )
136 #ifdef QGISDEBUG
137  mHasTransformContext = rh.mHasTransformContext;
138 #endif
139 
140  return *this;
141 }
142 
144 {
145  QgsRenderContext context;
146  context.setPainter( painter );
147  if ( painter && painter->device() )
148  {
149  context.setScaleFactor( painter->device()->logicalDpiX() / 25.4 );
150  }
151  else
152  {
153  context.setScaleFactor( 3.465 ); //assume 88 dpi as standard value
154  }
155 
156  if ( painter && painter->renderHints() & QPainter::Antialiasing )
158  if ( painter && painter->renderHints() & QPainter::SmoothPixmapTransform )
160 
161 #if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
162  if ( painter && painter->renderHints() & QPainter::LosslessImageRendering )
164 #endif
165 
166  return context;
167 }
168 
169 void QgsRenderContext::setPainterFlagsUsingContext( QPainter *painter ) const
170 {
171  if ( !painter )
172  painter = mPainter;
173 
174  if ( !painter )
175  return;
176 
177  painter->setRenderHint( QPainter::Antialiasing, mFlags & Qgis::RenderContextFlag::Antialiasing );
178 #if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
179  painter->setRenderHint( QPainter::LosslessImageRendering, mFlags & Qgis::RenderContextFlag::LosslessImageRendering );
180 #endif
181  painter->setRenderHint( QPainter::SmoothPixmapTransform, mFlags & Qgis::RenderContextFlag::HighQualityImageTransforms );
182 }
183 
185 {
186 #ifdef QGISDEBUG
187  if ( !mHasTransformContext )
188  QgsDebugMsgLevel( QStringLiteral( "No QgsCoordinateTransformContext context set for transform" ), 4 );
189 #endif
190  return mTransformContext;
191 }
192 
194 {
195  mTransformContext = context;
196 #ifdef QGISDEBUG
197  mHasTransformContext = true;
198 #endif
199 }
200 
202 {
203  mFeedback = feedback;
204 }
205 
207 {
208  return mFeedback;
209 }
210 
211 void QgsRenderContext::setFlags( Qgis::RenderContextFlags flags )
212 {
213  mFlags = flags;
214 }
215 
217 {
218  if ( on )
219  mFlags |= flag;
220  else
221  mFlags &= ~( static_cast< int >( flag ) );
222 }
223 
224 Qgis::RenderContextFlags QgsRenderContext::flags() const
225 {
226  return mFlags;
227 }
228 
230 {
231  return mFlags.testFlag( flag );
232 }
233 
235 {
236  QgsRenderContext ctx;
237  QgsRectangle extent = mapSettings.visibleExtent();
238  extent.grow( mapSettings.extentBuffer() );
239  ctx.setMapToPixel( mapSettings.mapToPixel() );
240  ctx.setExtent( extent );
241  ctx.setMapExtent( mapSettings.visibleExtent() );
247  ctx.setSelectionColor( mapSettings.selectionColor() );
259  ctx.setScaleFactor( mapSettings.outputDpi() / 25.4 ); // = pixels per mm
260  ctx.setDpiTarget( mapSettings.dpiTarget() >= 0.0 ? mapSettings.dpiTarget() : -1.0 );
261  ctx.setRendererScale( mapSettings.scale() );
262  ctx.setExpressionContext( mapSettings.expressionContext() );
263  ctx.setSegmentationTolerance( mapSettings.segmentationTolerance() );
265  ctx.mDistanceArea.setSourceCrs( mapSettings.destinationCrs(), mapSettings.transformContext() );
266  ctx.mDistanceArea.setEllipsoid( mapSettings.ellipsoid() );
267  ctx.setTransformContext( mapSettings.transformContext() );
268  ctx.setPathResolver( mapSettings.pathResolver() );
269  ctx.setTextRenderFormat( mapSettings.textRenderFormat() );
270  ctx.setVectorSimplifyMethod( mapSettings.simplifyMethod() );
271  ctx.mRenderedFeatureHandlers = mapSettings.renderedFeatureHandlers();
272  ctx.mHasRenderedFeatureHandlers = !mapSettings.renderedFeatureHandlers().isEmpty();
273  //this flag is only for stopping during the current rendering progress,
274  //so must be false at every new render operation
275  ctx.setRenderingStopped( false );
276  ctx.mCustomRenderingFlags = mapSettings.customRenderingFlags();
277  ctx.setIsTemporal( mapSettings.isTemporal() );
278  if ( ctx.isTemporal() )
279  ctx.setTemporalRange( mapSettings.temporalRange() );
280 
281  ctx.setZRange( mapSettings.zRange() );
282  ctx.setOutputSize( mapSettings.outputSize() );
283  ctx.setDevicePixelRatio( mapSettings.devicePixelRatio() );
284  ctx.setImageFormat( mapSettings.outputImageFormat() );
285 
286  ctx.mClippingRegions = mapSettings.clippingRegions();
287 
288  ctx.mRendererUsage = mapSettings.rendererUsage();
289  ctx.mFrameRate = mapSettings.frameRate();
290  ctx.mCurrentFrame = mapSettings.currentFrame();
291 
292  return ctx;
293 }
294 
296 {
297  return mFlags.testFlag( Qgis::RenderContextFlag::ForceVectorOutput );
298 }
299 
301 {
302  return mFlags.testFlag( Qgis::RenderContextFlag::UseAdvancedEffects );
303 }
304 
306 {
308 }
309 
311 {
312  return mFlags.testFlag( Qgis::RenderContextFlag::DrawEditingInfo );
313 }
314 
316 {
317  return mFlags.testFlag( Qgis::RenderContextFlag::DrawSelection );
318 }
319 
321 {
322  mCoordTransform = t;
323 }
324 
326 {
328 }
329 
331 {
333 }
334 
335 void QgsRenderContext::setShowSelection( const bool showSelection )
336 {
338 }
339 
341 {
342  return mFlags.testFlag( Qgis::RenderContextFlag::UseRenderingOptimization );
343 }
344 
346 {
348 }
349 
351 {
352  if ( ffp )
353  {
354  mFeatureFilterProvider.reset( ffp->clone() );
355  }
356  else
357  {
358  mFeatureFilterProvider.reset( nullptr );
359  }
360 }
361 
363 {
364  return mFeatureFilterProvider.get();
365 }
366 
368 {
369  double conversionFactor = 1.0;
370  bool isMapUnitHack = false;
371  switch ( unit )
372  {
374  conversionFactor = mScaleFactor;
375  break;
376 
378  conversionFactor = mScaleFactor / POINTS_TO_MM;
379  break;
380 
382  conversionFactor = mScaleFactor * INCH_TO_MM;
383  break;
384 
386  {
387  if ( mMapToPixel.isValid() )
388  size = convertMetersToMapUnits( size );
390  // Fall through to RenderMapUnits with size in meters converted to size in MapUnits
392  }
394  {
395  if ( mMapToPixel.isValid() )
396  {
397  const double mup = scale.computeMapUnitsPerPixel( *this );
398  if ( mup > 0 )
399  {
400  conversionFactor = 1.0 / mup;
401  }
402  else
403  {
404  conversionFactor = 1.0;
405  }
406  }
407  else
408  {
409  // invalid map to pixel. A size in map units can't be calculated, so treat the size as points
410  // and clamp it to a reasonable range. It's the best we can do in this situation!
411  isMapUnitHack = true;
412  conversionFactor = mScaleFactor / POINTS_TO_MM;
413  }
414  break;
415  }
417  conversionFactor = 1.0;
418  break;
419 
422  //no sensible value
423  conversionFactor = 1.0;
424  break;
425  }
426 
427  double convertedSize = size * conversionFactor;
428 
429  if ( unit == QgsUnitTypes::RenderMapUnits )
430  {
431  //check max/min size
432  if ( scale.minSizeMMEnabled )
433  convertedSize = std::max( convertedSize, scale.minSizeMM * mScaleFactor );
434  if ( scale.maxSizeMMEnabled )
435  convertedSize = std::min( convertedSize, scale.maxSizeMM * mScaleFactor );
436  }
437 
438  if ( isMapUnitHack )
439  {
440  // since we are arbitrarily treating map units as mm, we need to clamp to an (arbitrary!) reasonable range.
441  convertedSize = std::clamp( convertedSize, 10.0, 100.0 );
442  }
443  else
444  {
445  const double symbologyReferenceScaleFactor = mSymbologyReferenceScale > 0 ? mSymbologyReferenceScale / mRendererScale : 1;
446  convertedSize *= symbologyReferenceScaleFactor;
447  }
448 
450  {
451  // apply property based constraints in order to optimise symbol preview rendering
452  switch ( property )
453  {
455  break;
456 
458  // excessively large shadow offset in symbol preview icons is undesirable -- it pushes the shadow outside of view
459  convertedSize = std::min( convertedSize, 100.0 );
460  break;
462  // excessively large blur in symbol preview icons is too slow to calculate
463  convertedSize = std::min<double>( convertedSize, 30 );
464  break;
466  // excessively large glow spread in symbol preview icons is too slow to calculate
467  convertedSize = std::min<double>( convertedSize, 50 );
468  break;
469  }
470  }
471 
472  return convertedSize;
473 }
474 
475 double QgsRenderContext::convertToMapUnits( double size, QgsUnitTypes::RenderUnit unit, const QgsMapUnitScale &scale ) const
476 {
477  const double mup = mMapToPixel.mapUnitsPerPixel();
478 
479  const double symbologyReferenceScaleFactor = mSymbologyReferenceScale > 0 ? mSymbologyReferenceScale / mRendererScale : 1;
480 
481  switch ( unit )
482  {
484  {
485  size = convertMetersToMapUnits( size );
486  // Fall through to RenderMapUnits with values of meters converted to MapUnits
488  }
490  {
491  // check scale
492  double minSizeMU = std::numeric_limits<double>::lowest();
493  if ( scale.minSizeMMEnabled )
494  {
495  minSizeMU = scale.minSizeMM * mScaleFactor * mup;
496  }
497  if ( !qgsDoubleNear( scale.minScale, 0.0 ) )
498  {
499  minSizeMU = std::max( minSizeMU, size * ( mRendererScale / scale.minScale ) );
500  }
501  size = std::max( size, minSizeMU );
502 
503  double maxSizeMU = std::numeric_limits<double>::max();
504  if ( scale.maxSizeMMEnabled )
505  {
506  maxSizeMU = scale.maxSizeMM * mScaleFactor * mup;
507  }
508  if ( !qgsDoubleNear( scale.maxScale, 0.0 ) )
509  {
510  maxSizeMU = std::min( maxSizeMU, size * ( mRendererScale / scale.maxScale ) );
511  }
512  size = std::min( size, maxSizeMU );
513 
514  return size;
515  }
517  {
518  return size * mScaleFactor * mup / symbologyReferenceScaleFactor;
519  }
521  {
522  return size * mScaleFactor * mup / POINTS_TO_MM / symbologyReferenceScaleFactor;
523  }
525  {
526  return size * mScaleFactor * mup * INCH_TO_MM / symbologyReferenceScaleFactor;
527  }
529  {
530  return size * mup / symbologyReferenceScaleFactor;
531  }
532 
535  //no sensible value
536  return 0.0;
537  }
538  return 0.0;
539 }
540 
541 double QgsRenderContext::convertFromMapUnits( double sizeInMapUnits, QgsUnitTypes::RenderUnit outputUnit ) const
542 {
543  const double mup = mMapToPixel.mapUnitsPerPixel();
544  const double symbologyReferenceScaleFactor = mSymbologyReferenceScale > 0 ? mSymbologyReferenceScale / mRendererScale : 1;
545 
546  switch ( outputUnit )
547  {
549  {
550  return sizeInMapUnits / convertMetersToMapUnits( 1.0 );
551  }
553  {
554  return sizeInMapUnits;
555  }
557  {
558  return sizeInMapUnits / ( mScaleFactor * mup ) * symbologyReferenceScaleFactor;
559  }
561  {
562  return sizeInMapUnits / ( mScaleFactor * mup / POINTS_TO_MM ) * symbologyReferenceScaleFactor;
563  }
565  {
566  return sizeInMapUnits / ( mScaleFactor * mup * INCH_TO_MM ) * symbologyReferenceScaleFactor;
567  }
569  {
570  return sizeInMapUnits / mup * symbologyReferenceScaleFactor;
571  }
572 
575  //no sensible value
576  return 0.0;
577  }
578  return 0.0;
579 }
580 
581 double QgsRenderContext::convertMetersToMapUnits( double meters ) const
582 {
583  switch ( mDistanceArea.sourceCrs().mapUnits() )
584  {
586  return meters;
588  {
589  if ( mExtent.isNull() )
590  {
591  // we don't have an extent to calculate exactly -- so just use a very rough approximation
593  }
594 
595  QgsPointXY pointCenter = mExtent.center();
596  // The Extent is in the sourceCrs(), when different from destinationCrs()
597  // - the point must be transformed, since DistanceArea uses the destinationCrs()
598  // Note: the default QgsCoordinateTransform() : authid() will return an empty String
599  if ( !mCoordTransform.isShortCircuited() )
600  {
601  pointCenter = mCoordTransform.transform( pointCenter );
602  }
603 
604  const int multiplier = meters < 0 ? -1 : 1;
605  return multiplier * mDistanceArea.measureLineProjected( pointCenter, std::fabs( meters ) );
606  }
615  return ( meters * QgsUnitTypes::fromUnitToUnitFactor( QgsUnitTypes::DistanceMeters, mDistanceArea.sourceCrs().mapUnits() ) );
616  }
617  return meters;
618 }
619 
620 QList<QgsRenderedFeatureHandlerInterface *> QgsRenderContext::renderedFeatureHandlers() const
621 {
622  return mRenderedFeatureHandlers;
623 }
624 
625 QList<QgsMapClippingRegion> QgsRenderContext::clippingRegions() const
626 {
627  return mClippingRegions;
628 }
629 
631 {
632  return mFeatureClipGeometry;
633 }
634 
636 {
637  mFeatureClipGeometry = geometry;
638 }
639 
641 {
642  return mTextureOrigin;
643 }
644 
645 void QgsRenderContext::setTextureOrigin( const QPointF &origin )
646 {
647  mTextureOrigin = origin;
648 }
649 
651 {
652  return mZRange;
653 }
654 
656 {
657  mZRange = range;
658 }
659 
661 {
662  return mSize;
663 }
664 
666 {
667  mSize = size;
668 }
669 
671 {
672  return mDevicePixelRatio;
673 }
674 
676 {
677  mDevicePixelRatio = ratio;
678 }
679 
681 {
682  return outputSize() * mDevicePixelRatio;
683 }
684 
686 {
687  return mFrameRate;
688 }
689 
691 {
692  mFrameRate = rate;
693 }
694 
696 {
697  return mCurrentFrame;
698 }
699 
700 void QgsRenderContext::setCurrentFrame( long long frame )
701 {
702  mCurrentFrame = frame;
703 }
704 
705 void QgsRenderContext::addSymbolLayerClipPath( const QgsSymbolLayer *symbolLayer, QPainterPath path )
706 {
707  mSymbolLayerClipPaths[ symbolLayer ].append( path );
708 }
709 
710 QList<QPainterPath> QgsRenderContext::symbolLayerClipPaths( const QgsSymbolLayer *symbolLayer ) const
711 {
712  return mSymbolLayerClipPaths[ symbolLayer ];
713 }
QgsRenderContext::renderedFeatureHandlers
QList< QgsRenderedFeatureHandlerInterface * > renderedFeatureHandlers() const
Returns the list of rendered feature handlers to use while rendering map layers.
Definition: qgsrendercontext.cpp:620
QgsRenderContext::setImageFormat
void setImageFormat(QImage::Format format)
Sets QImage format which should be used for QImages created during rendering.
Definition: qgsrendercontext.h:983
QgsRenderContext::setCurrentFrame
void setCurrentFrame(long long frame)
Sets the current frame of the map, for maps which are part of an animation.
Definition: qgsrendercontext.cpp:700
Qgis::MapSettingsFlag::RenderPartialOutput
@ RenderPartialOutput
Whether to make extra effort to update map image with partially rendered layers (better for interacti...
QgsRenderContext::deviceOutputSize
QSize deviceOutputSize() const
Returns the device output size of the render.
Definition: qgsrendercontext.cpp:680
QgsVectorSimplifyMethod::NoSimplification
@ NoSimplification
No simplification can be applied.
Definition: qgsvectorsimplifymethod.h:52
QgsUnitTypes::RenderInches
@ RenderInches
Inches.
Definition: qgsunittypes.h:174
Qgis::RenderContextFlag::RenderSymbolPreview
@ RenderSymbolPreview
The render is for a symbol preview only and map based properties may not be available,...
QgsRenderContext::setFlags
void setFlags(Qgis::RenderContextFlags flags)
Set combination of flags that will be used for rendering.
Definition: qgsrendercontext.cpp:211
QgsRenderContext::setPainterFlagsUsingContext
void setPainterFlagsUsingContext(QPainter *painter=nullptr) const
Sets relevant flags on a destination painter, using the flags and settings currently defined for the ...
Definition: qgsrendercontext.cpp:169
Qgis::RenderContextFlag::HighQualityImageTransforms
@ HighQualityImageTransforms
Enable high quality image transformations, which results in better appearance of scaled or rotated ra...
Qgis::MapSettingsFlag::UseRenderingOptimization
@ UseRenderingOptimization
Enable vector simplification and other rendering optimizations.
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::setFrameRate
void setFrameRate(double rate)
Sets the frame rate of the map (in frames per second), for maps which are part of an animation.
Definition: qgsrendercontext.cpp:690
Qgis::MapSettingsFlag::SkipSymbolRendering
@ SkipSymbolRendering
Disable symbol rendering while still drawing labels if enabled (since QGIS 3.24)
QgsUnitTypes::RenderUnit
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:167
QgsRenderContext::featureClipGeometry
QgsGeometry featureClipGeometry() const
Returns the geometry to use to clip features at render time.
Definition: qgsrendercontext.cpp:630
QgsMapToPixel::mapUnitsPerPixel
double mapUnitsPerPixel() const
Returns the current map units per pixel.
Definition: qgsmaptopixel.h:229
QgsRenderContext::setDevicePixelRatio
void setDevicePixelRatio(float ratio)
Sets the device pixel ratio.
Definition: qgsrendercontext.cpp:675
QgsMapSettings::outputSize
QSize outputSize() const
Returns the size of the resulting map image, in pixels.
Definition: qgsmapsettings.cpp:239
Qgis::RenderContextFlag::ForceVectorOutput
@ ForceVectorOutput
Vector graphics should not be cached and drawn as raster images.
QgsRenderContext::fromMapSettings
static QgsRenderContext fromMapSettings(const QgsMapSettings &mapSettings)
create initialized QgsRenderContext instance from given QgsMapSettings
Definition: qgsrendercontext.cpp:234
Qgis::RenderContextFlag::DrawEditingInfo
@ DrawEditingInfo
Enable drawing of vertex markers for layers in editing mode.
QgsMapSettings::extentBuffer
double extentBuffer() const
Returns the buffer in map units to use around the visible extent for rendering symbols whose correspo...
Definition: qgsmapsettings.cpp:92
QgsRenderContext::setFeatureClipGeometry
void setFeatureClipGeometry(const QgsGeometry &geometry)
Sets a geometry to use to clip features at render time.
Definition: qgsrendercontext.cpp:635
QgsUnitTypes::DistanceUnknownUnit
@ DistanceUnknownUnit
Unknown distance unit.
Definition: qgsunittypes.h:78
QgsDebugMsgLevel
#define QgsDebugMsgLevel(str, level)
Definition: qgslogger.h:39
QgsRenderContext::setSegmentationTolerance
void setSegmentationTolerance(double tolerance)
Sets the segmentation tolerance applied when rendering curved geometries.
Definition: qgsrendercontext.h:663
Qgis::MapSettingsFlag::UseAdvancedEffects
@ UseAdvancedEffects
Enable layer opacity and blending effects.
qgsexpression.h
QgsRenderContext::drawEditingInformation
bool drawEditingInformation() const
Returns true if edit markers should be drawn during the render operation.
Definition: qgsrendercontext.cpp:310
QgsTemporalRangeObject::isTemporal
bool isTemporal() const
Returns true if the object's temporal range is enabled, and the object will be filtered when renderin...
Definition: qgstemporalrangeobject.cpp:30
QgsMapSettings::dpiTarget
double dpiTarget() const
Returns the target DPI (dots per inch) to be taken into consideration when rendering.
Definition: qgsmapsettings.cpp:279
QgsMapSettings::devicePixelRatio
float devicePixelRatio() const
Returns the device pixel ratio.
Definition: qgsmapsettings.cpp:251
QgsRectangle::center
QgsPointXY center() const SIP_HOLDGIL
Returns the center point of the rectangle.
Definition: qgsrectangle.h:251
Qgis::RenderContextFlag::RenderMapTile
@ RenderMapTile
Draw map such that there are no problems between adjacent tiles.
QgsRenderContext::showSelection
bool showSelection() const
Returns true if vector selections should be shown in the rendered map.
Definition: qgsrendercontext.cpp:315
QgsTemporalRangeObject::setIsTemporal
void setIsTemporal(bool enabled)
Sets whether the temporal range is enabled (i.e.
Definition: qgstemporalrangeobject.cpp:25
QgsRenderContext::setPainter
void setPainter(QPainter *p)
Sets the destination QPainter for the render operation.
Definition: qgsrendercontext.h:512
QgsUnitTypes::RenderPoints
@ RenderPoints
Points (e.g., for font sizes)
Definition: qgsunittypes.h:173
QgsRenderContext::setShowSelection
void setShowSelection(bool showSelection)
Sets whether vector selections should be shown in the rendered map.
Definition: qgsrendercontext.cpp:335
QgsRenderContext::setZRange
void setZRange(const QgsDoubleRange &range)
Sets the range of z-values which should be rendered.
Definition: qgsrendercontext.cpp:655
Qgis::RenderSubcomponentProperty::ShadowOffset
@ ShadowOffset
Shadow offset.
QgsMapSettings::ellipsoid
QString ellipsoid() const
Returns ellipsoid's acronym.
Definition: qgsmapsettings.h:374
QgsRenderContext::testFlag
bool testFlag(Qgis::RenderContextFlag flag) const
Check whether a particular flag is enabled.
Definition: qgsrendercontext.cpp:229
QgsRenderContext::flags
Qgis::RenderContextFlags flags() const
Returns combination of flags used for rendering.
Definition: qgsrendercontext.cpp:224
qgsfeaturefilterprovider.h
QgsRenderContext::addSymbolLayerClipPath
void addSymbolLayerClipPath(const QgsSymbolLayer *symbolLayer, QPainterPath path)
Add a clip path to be applied to the symbolLayer before rendering.
Definition: qgsrendercontext.cpp:705
QgsUnitTypes::RenderPercentage
@ RenderPercentage
Percentage of another measurement (e.g., canvas size, feature size)
Definition: qgsunittypes.h:172
QgsRenderContext::convertToMapUnits
double convertToMapUnits(double size, QgsUnitTypes::RenderUnit unit, const QgsMapUnitScale &scale=QgsMapUnitScale()) const
Converts a size from the specified units to map units.
Definition: qgsrendercontext.cpp:475
QgsTemporalRangeObject::temporalRange
const QgsDateTimeRange & temporalRange() const
Returns the datetime range for the object.
Definition: qgstemporalrangeobject.cpp:43
Qgis::RenderContextFlag::DrawSymbolBounds
@ DrawSymbolBounds
Draw bounds of symbols (for debugging/testing)
QgsMapSettings::simplifyMethod
const QgsVectorSimplifyMethod & simplifyMethod() const
Returns the simplification settings to use when rendering vector layers.
Definition: qgsmapsettings.h:772
QgsDistanceArea::sourceCrs
QgsCoordinateReferenceSystem sourceCrs() const
Returns the source spatial reference system.
Definition: qgsdistancearea.h:84
QgsRenderContext
Contains information about the context of a rendering operation.
Definition: qgsrendercontext.h:59
QgsUnitTypes::RenderMillimeters
@ RenderMillimeters
Millimeters.
Definition: qgsunittypes.h:169
QgsMapUnitScale::minSizeMM
double minSizeMM
The minimum size in millimeters, or 0.0 if unset.
Definition: qgsmapunitscale.h:66
Qgis::RenderSubcomponentProperty
RenderSubcomponentProperty
Rendering subcomponent properties.
Definition: qgis.h:1343
QgsMapSettings::outputImageFormat
QImage::Format outputImageFormat() const
format of internal QImage, default QImage::Format_ARGB32_Premultiplied
Definition: qgsmapsettings.h:444
QgsMapSettings::customRenderingFlags
QVariantMap customRenderingFlags() const
Returns any custom rendering flags.
Definition: qgsmapsettings.h:320
QgsVectorSimplifyMethod::setSimplifyHints
void setSimplifyHints(SimplifyHints simplifyHints)
Sets the simplification hints of the vector layer managed.
Definition: qgsvectorsimplifymethod.h:62
qgspoint.h
QgsRenderContext::currentFrame
long long currentFrame() const
Returns the current frame number of the map (in frames per second), for maps which are part of an ani...
Definition: qgsrendercontext.cpp:695
FALLTHROUGH
#define FALLTHROUGH
Definition: qgis.h:2847
qgsmapsettings.h
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
QgsMapSettings::frameRate
double frameRate() const
Returns the frame rate of the map (in frames per second), for maps which are part of an animation.
Definition: qgsmapsettings.cpp:868
Qgis::RenderContextFlag::UseRenderingOptimization
@ UseRenderingOptimization
Enable vector simplification and other rendering optimizations.
QgsUnitTypes::DistanceKilometers
@ DistanceKilometers
Kilometers.
Definition: qgsunittypes.h:70
QgsRenderContext::frameRate
double frameRate() const
Returns the frame rate of the map, for maps which are part of an animation.
Definition: qgsrendercontext.cpp:685
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
QgsDistanceArea::measureLineProjected
double measureLineProjected(const QgsPointXY &p1, double distance=1, double azimuth=M_PI_2, QgsPointXY *projectedPoint=nullptr) const
Calculates the distance from one point with distance in meters and azimuth (direction) When the sourc...
Definition: qgsdistancearea.cpp:401
Qgis::MapSettingsFlag::Antialiasing
@ Antialiasing
Enable anti-aliasing for map rendering.
Qgis::MapSettingsFlag::RenderPreviewJob
@ RenderPreviewJob
Render is a 'canvas preview' render, and shortcuts should be taken to ensure fast rendering.
QgsUnitTypes::fromUnitToUnitFactor
static Q_INVOKABLE double fromUnitToUnitFactor(QgsUnitTypes::DistanceUnit fromUnit, QgsUnitTypes::DistanceUnit toUnit)
Returns the conversion factor between the specified distance units.
Definition: qgsunittypes.cpp:352
QgsMapSettings::rendererUsage
Qgis::RendererUsage rendererUsage() const
Returns the rendering usage.
Definition: qgsmapsettings.cpp:858
QgsDistanceArea::setEllipsoid
bool setEllipsoid(const QString &ellipsoid)
Sets the ellipsoid by its acronym.
Definition: qgsdistancearea.cpp:89
Qgis::MapSettingsFlag::DrawEditingInfo
@ DrawEditingInfo
Enable drawing of vertex markers for layers in editing mode.
QgsSymbolLayer
Definition: qgssymbollayer.h:54
QgsRenderContext::useAdvancedEffects
bool useAdvancedEffects() const
Returns true if advanced effects such as blend modes such be used.
Definition: qgsrendercontext.cpp:300
QgsRenderContext::forceVectorOutput
bool forceVectorOutput() const
Returns true if rendering operations should use vector operations instead of any faster raster shortc...
Definition: qgsrendercontext.cpp:295
QgsMapSettings::segmentationToleranceType
QgsAbstractGeometry::SegmentationToleranceType segmentationToleranceType() const
Gets segmentation tolerance type (maximum angle or maximum difference between curve and approximation...
Definition: qgsmapsettings.h:642
QgsCoordinateTransform::isShortCircuited
bool isShortCircuited() const
Returns true if the transform short circuits because the source and destination are equivalent.
Definition: qgscoordinatetransform.cpp:905
QgsMapSettings::transformContext
QgsCoordinateTransformContext transformContext() const
Returns the coordinate transform context, which stores various information regarding which datum tran...
Definition: qgsmapsettings.cpp:463
QgsMapSettings::testFlag
bool testFlag(Qgis::MapSettingsFlag flag) const
Check whether a particular flag is enabled.
Definition: qgsmapsettings.cpp:395
QgsUnitTypes::DistanceDegrees
@ DistanceDegrees
Degrees, for planar geographic CRS distance measurements.
Definition: qgsunittypes.h:75
Qgis::RenderContextFlag::RenderPreviewJob
@ RenderPreviewJob
Render is a 'canvas preview' render, and shortcuts should be taken to ensure fast rendering.
qgsDoubleNear
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
Definition: qgis.h:2265
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
QgsRenderContext::featureFilterProvider
const QgsFeatureFilterProvider * featureFilterProvider() const
Gets the filter feature provider used for additional filtering of rendered features.
Definition: qgsrendercontext.cpp:362
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
QgsRenderContext::setFlag
void setFlag(Qgis::RenderContextFlag flag, bool on=true)
Enable or disable a particular flag (other flags are not affected)
Definition: qgsrendercontext.cpp:216
QgsRenderContext::setCoordinateTransform
void setCoordinateTransform(const QgsCoordinateTransform &t)
Sets the current coordinate transform for the context.
Definition: qgsrendercontext.cpp:320
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::MapSettingsFlag::DrawSymbolBounds
@ DrawSymbolBounds
Draw bounds of symbols (for debugging/testing)
QgsMapSettings::zRange
QgsDoubleRange zRange() const
Returns the range of z-values which will be visible in the map.
Definition: qgsmapsettings.cpp:848
QgsRenderContext::outputSize
QSize outputSize() const
Returns the size of the resulting rendered image, in pixels.
Definition: qgsrendercontext.cpp:660
qgsrendercontext.h
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:412
QgsUnitTypes::DistanceFeet
@ DistanceFeet
Imperial feet.
Definition: qgsunittypes.h:71
Qgis::MapSettingsFlag::ForceVectorOutput
@ ForceVectorOutput
Vector graphics should not be cached and drawn as raster images.
QgsUnitTypes::DistanceMeters
@ DistanceMeters
Meters.
Definition: qgsunittypes.h:69
QgsRenderContext::setFeatureFilterProvider
void setFeatureFilterProvider(const QgsFeatureFilterProvider *ffp)
Set a filter feature provider used for additional filtering of rendered features.
Definition: qgsrendercontext.cpp:350
QgsRenderContext::operator=
QgsRenderContext & operator=(const QgsRenderContext &rh)
Definition: qgsrendercontext.cpp:91
Qgis::RenderContextFlag::SkipSymbolRendering
@ SkipSymbolRendering
Disable symbol rendering while still drawing labels if enabled (since QGIS 3.24)
QgsMapSettings::scale
double scale() const
Returns the calculated map scale.
Definition: qgsmapsettings.cpp:458
QgsRenderContext::setFeedback
void setFeedback(QgsFeedback *feedback)
Attach a feedback object that can be queried regularly during rendering to check if rendering should ...
Definition: qgsrendercontext.cpp:201
QgsMapUnitScale
Struct for storing maximum and minimum scales for measurements in map units.
Definition: qgsmapunitscale.h:36
QgsRenderContext::symbolLayerClipPaths
QList< QPainterPath > symbolLayerClipPaths(const QgsSymbolLayer *symbolLayer) const
Returns clip paths to be applied to the symbolLayer before rendering.
Definition: qgsrendercontext.cpp:710
Qgis::MapSettingsFlag::Render3DMap
@ Render3DMap
Render is for a 3D map.
Qgis::RenderContextFlag::RenderPartialOutput
@ RenderPartialOutput
Whether to make extra effort to update map image with partially rendered layers (better for interacti...
QgsDistanceArea::setSourceCrs
void setSourceCrs(const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &context)
Sets source spatial reference system crs.
Definition: qgsdistancearea.cpp:83
Qgis::RenderContextFlag
RenderContextFlag
Flags which affect rendering operations.
Definition: qgis.h:1297
QgsMapSettings::expressionContext
const QgsExpressionContext & expressionContext() const
Gets the expression context.
Definition: qgsmapsettings.h:487
Qgis::MapSettingsFlag::HighQualityImageTransforms
@ HighQualityImageTransforms
Enable high quality image transformations, which results in better appearance of scaled or rotated ra...
Qgis::MapSettingsFlag::RenderBlocking
@ RenderBlocking
Render and load remote sources in the same thread to ensure rendering remote sources (svg and images)...
QgsMapSettings::selectionColor
QColor selectionColor() const
Returns the color that is used for drawing of selected vector features.
Definition: qgsmapsettings.h:402
QgsRenderContext::setSelectionColor
void setSelectionColor(const QColor &color)
Sets the color to use when rendering selected features.
Definition: qgsrendercontext.h:561
QgsMapSettings::textRenderFormat
Qgis::TextRenderFormat textRenderFormat() const
Returns the text render format, which dictates how text is rendered (e.g.
Definition: qgsmapsettings.h:419
QgsMapSettings::segmentationTolerance
double segmentationTolerance() const
Gets the segmentation tolerance applied when rendering curved geometries.
Definition: qgsmapsettings.h:634
QgsUnitTypes::RenderPixels
@ RenderPixels
Pixels.
Definition: qgsunittypes.h:171
QgsRenderContext::setRendererScale
void setRendererScale(double scale)
Sets the renderer map scale.
Definition: qgsrendercontext.h:487
QgsRenderContext::zRange
QgsDoubleRange zRange() const
Returns the range of z-values which should be rendered.
Definition: qgsrendercontext.cpp:650
QgsRenderContext::setUseRenderingOptimization
void setUseRenderingOptimization(bool enabled)
Sets whether the rendering optimization (geometry simplification) should be executed.
Definition: qgsrendercontext.cpp:345
qgsvectorlayer.h
QgsPointXY
A class to represent a 2D point.
Definition: qgspointxy.h:58
QgsRenderContext::convertToPainterUnits
double convertToPainterUnits(double size, QgsUnitTypes::RenderUnit unit, const QgsMapUnitScale &scale=QgsMapUnitScale(), Qgis::RenderSubcomponentProperty property=Qgis::RenderSubcomponentProperty::Generic) const
Converts a size from the specified units to painter units (pixels).
Definition: qgsrendercontext.cpp:367
QgsRenderContext::setForceVectorOutput
void setForceVectorOutput(bool force)
Sets whether rendering operations should use vector operations instead of any faster raster shortcuts...
Definition: qgsrendercontext.cpp:330
QgsMapSettings::destinationCrs
QgsCoordinateReferenceSystem destinationCrs() const
Returns the destination coordinate reference system for the map render.
Definition: qgsmapsettings.cpp:358
QgsRenderContext::setTransformContext
void setTransformContext(const QgsCoordinateTransformContext &context)
Sets the context's coordinate transform context, which stores various information regarding which dat...
Definition: qgsrendercontext.cpp:193
POINTS_TO_MM
#define POINTS_TO_MM
Definition: qgsrendercontext.cpp:28
Qgis::RenderContextFlag::Antialiasing
@ Antialiasing
Use antialiasing while drawing.
Qgis::RenderContextFlag::RenderBlocking
@ RenderBlocking
Render and load remote sources in the same thread to ensure rendering remote sources (svg and images)...
QgsRenderContext::textureOrigin
QPointF textureOrigin() const
Returns the texture origin, which should be used as a brush transform when rendering using QBrush obj...
Definition: qgsrendercontext.cpp:640
QgsRenderContext::feedback
QgsFeedback * feedback() const
Returns the feedback object that can be queried regularly during rendering to check if rendering shou...
Definition: qgsrendercontext.cpp:206
QgsDoubleRange
QgsRange which stores a range of double values.
Definition: qgsrange.h:202
QgsMapUnitScale::maxSizeMMEnabled
bool maxSizeMMEnabled
Whether the maximum size in mm should be respected.
Definition: qgsmapunitscale.h:68
QgsCoordinateReferenceSystem::mapUnits
QgsUnitTypes::DistanceUnit mapUnits
Definition: qgscoordinatereferencesystem.h:215
QgsRenderContext::geometry
const QgsAbstractGeometry * geometry() const
Returns pointer to the unsegmentized geometry.
Definition: qgsrendercontext.h:637
QgsRenderContext::setDrawEditingInformation
void setDrawEditingInformation(bool b)
Sets whether edit markers should be drawn during the render operation.
Definition: qgsrendercontext.cpp:325
QgsGeometry
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:124
QgsUnitTypes::DistanceMillimeters
@ DistanceMillimeters
Millimeters.
Definition: qgsunittypes.h:77
QgsMapUnitScale::maxSizeMM
double maxSizeMM
The maximum size in millimeters, or 0.0 if unset.
Definition: qgsmapunitscale.h:70
QgsUnitTypes::DistanceCentimeters
@ DistanceCentimeters
Centimeters.
Definition: qgsunittypes.h:76
QgsRenderContext::transformContext
QgsCoordinateTransformContext transformContext() const
Returns the context's coordinate transform context, which stores various information regarding which ...
Definition: qgsrendercontext.cpp:184
QgsFeatureFilterProvider::clone
virtual QgsFeatureFilterProvider * clone() const =0
Create a clone of the feature filter provider.
Qgis::RenderContextFlag::DrawSelection
@ DrawSelection
Whether vector selections should be shown in the rendered map.
QgsRenderContext::fromQPainter
static QgsRenderContext fromQPainter(QPainter *painter)
Creates a default render context given a pixel based QPainter destination.
Definition: qgsrendercontext.cpp:143
QgsMapSettings::pathResolver
const QgsPathResolver & pathResolver() const
Returns the path resolver for conversion between relative and absolute paths during rendering operati...
Definition: qgsmapsettings.h:516
QgsMapUnitScale::computeMapUnitsPerPixel
double computeMapUnitsPerPixel(const QgsRenderContext &c) const
Computes a map units per pixel scaling factor, respecting the minimum and maximum scales set for the ...
Definition: qgsmapunitscale.cpp:20
Qgis::MapSettingsFlag::DrawSelection
@ DrawSelection
Whether vector selections should be shown in the rendered map.
QgsUnitTypes::RenderMetersInMapUnits
@ RenderMetersInMapUnits
Meters value as Map units.
Definition: qgsunittypes.h:176
INCH_TO_MM
#define INCH_TO_MM
Definition: qgsrendercontext.cpp:29
QgsUnitTypes::RenderUnknownUnit
@ RenderUnknownUnit
Mixed or unknown units.
Definition: qgsunittypes.h:175
QgsUnitTypes::DistanceYards
@ DistanceYards
Imperial yards.
Definition: qgsunittypes.h:73
QgsMapSettings::renderedFeatureHandlers
QList< QgsRenderedFeatureHandlerInterface * > renderedFeatureHandlers() const
Returns the list of rendered feature handlers to use while rendering the map settings.
Definition: qgsmapsettings.cpp:843
QgsFeatureFilterProvider
Abstract interface for use by classes that filter the features or attributes of a layer.
Definition: qgsfeaturefilterprovider.h:43
QgsRenderContext::clippingRegions
QList< QgsMapClippingRegion > clippingRegions() const
Returns the list of clipping regions to apply during the render.
Definition: qgsrendercontext.cpp:625
QgsRenderContext::convertMetersToMapUnits
double convertMetersToMapUnits(double meters) const
Convert meter distances to active MapUnit values for QgsUnitTypes::RenderMetersInMapUnits.
Definition: qgsrendercontext.cpp:581
QgsUnitTypes::DistanceMiles
@ DistanceMiles
Terrestrial miles.
Definition: qgsunittypes.h:74
QgsTemporalRangeObject::setTemporalRange
void setTemporalRange(const QgsDateTimeRange &range)
Sets the temporal range for the object.
Definition: qgstemporalrangeobject.cpp:35
QgsRenderContext::setExpressionContext
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context.
Definition: qgsrendercontext.h:617
Qgis
The Qgis class provides global constants for use throughout the application.
Definition: qgis.h:71
QgsCoordinateReferenceSystem::ellipsoidAcronym
QString ellipsoidAcronym() const
Returns the ellipsoid acronym for the ellipsoid used by the CRS.
Definition: qgscoordinatereferencesystem.cpp:1251
QgsUnitTypes::DistanceNauticalMiles
@ DistanceNauticalMiles
Nautical miles.
Definition: qgsunittypes.h:72
QgsMapSettings::clippingRegions
QList< QgsMapClippingRegion > clippingRegions() const
Returns the list of clipping regions to apply to the map.
Definition: qgsmapsettings.cpp:833
QgsRenderContext::setUseAdvancedEffects
void setUseAdvancedEffects(bool enabled)
Used to enable or disable advanced effects such as blend modes.
Definition: qgsrendercontext.cpp:305
Qgis::RenderContextFlag::Render3DMap
@ Render3DMap
Render is for a 3D map.
QgsRectangle::grow
void grow(double delta)
Grows the rectangle in place by the specified amount.
Definition: qgsrectangle.h:296
QgsMapUnitScale::minScale
double minScale
The minimum scale, or 0.0 if unset.
Definition: qgsmapunitscale.h:55
QgsRenderContext::setTextRenderFormat
void setTextRenderFormat(Qgis::TextRenderFormat format)
Sets the text render format, which dictates how text is rendered (e.g.
Definition: qgsrendercontext.h:740
qgslogger.h
QgsMapSettings::outputDpi
double outputDpi() const
Returns the DPI (dots per inch) used for conversion between real world units (e.g.
Definition: qgsmapsettings.cpp:267
QgsRenderContext::setOutputSize
void setOutputSize(QSize size)
Sets the size of the resulting rendered image, in pixels.
Definition: qgsrendercontext.cpp:665
QgsRenderContext::painter
QPainter * painter()
Returns the destination QPainter for the render operation.
Definition: qgsrendercontext.h:112
QgsCoordinateTransform::transform
QgsPointXY transform(const QgsPointXY &point, Qgis::TransformDirection direction=Qgis::TransformDirection::Forward) const SIP_THROW(QgsCsException)
Transform the point from the source CRS to the destination CRS.
Definition: qgscoordinatetransform.cpp:272
QgsMapUnitScale::maxScale
double maxScale
The maximum scale, or 0.0 if unset.
Definition: qgsmapunitscale.h:61
QgsMapSettings
The QgsMapSettings class contains configuration for rendering of the map. The rendering itself is don...
Definition: qgsmapsettings.h:88
QgsMapSettings::visibleExtent
QgsRectangle visibleExtent() const
Returns the actual extent derived from requested extent that takes output image size into account.
Definition: qgsmapsettings.cpp:411
Qgis::RenderSubcomponentProperty::GlowSpread
@ GlowSpread
Glow spread size.
QgsCoordinateTransform
Class for doing transforms between two map coordinate systems.
Definition: qgscoordinatetransform.h:57
QgsMapUnitScale::minSizeMMEnabled
bool minSizeMMEnabled
Whether the minimum size in mm should be respected.
Definition: qgsmapunitscale.h:64
QgsRenderContext::QgsRenderContext
QgsRenderContext()
Definition: qgsrendercontext.cpp:31
QgsMapSettings::currentFrame
long long currentFrame() const
Returns the current frame number of the map, for maps which are part of an animation.
Definition: qgsmapsettings.cpp:878
Qgis::RenderSubcomponentProperty::BlurSize
@ BlurSize
Blur size.
QgsRenderContext::setTextureOrigin
void setTextureOrigin(const QPointF &origin)
Sets the texture origin, which should be used as a brush transform when rendering using QBrush object...
Definition: qgsrendercontext.cpp:645
Qgis::RenderContextFlag::UseAdvancedEffects
@ UseAdvancedEffects
Enable layer opacity and blending effects.
QgsRenderContext::useRenderingOptimization
bool useRenderingOptimization() const
Returns true if the rendering optimization (geometry simplification) can be executed.
Definition: qgsrendercontext.cpp:340
QgsMapSettings::mapToPixel
const QgsMapToPixel & mapToPixel() const
Definition: qgsmapsettings.h:527
QgsUnitTypes::RenderMapUnits
@ RenderMapUnits
Map units.
Definition: qgsunittypes.h:170
QgsRectangle::isNull
bool isNull() const
Test if the rectangle is null (all coordinates zero or after call to setMinimal()).
Definition: qgsrectangle.h:479
QgsTemporalRangeObject
Base class for objects with an associated (optional) temporal range.
Definition: qgstemporalrangeobject.h:33
QgsMapToPixel::isValid
bool isValid() const
Returns true if the object is valid (i.e.
Definition: qgsmaptopixel.h:83
QgsRenderContext::setScaleFactor
void setScaleFactor(double factor)
Sets the scaling factor for the render to convert painter units to physical sizes.
Definition: qgsrendercontext.h:472
Qgis::MapSettingsFlag::LosslessImageRendering
@ LosslessImageRendering
Render images losslessly whenever possible, instead of the default lossy jpeg rendering used for some...
Qgis::RenderContextFlag::LosslessImageRendering
@ LosslessImageRendering
Render images losslessly whenever possible, instead of the default lossy jpeg rendering used for some...
QgsRenderContext::convertFromMapUnits
double convertFromMapUnits(double sizeInMapUnits, QgsUnitTypes::RenderUnit outputUnit) const
Converts a size from map units to the specified units.
Definition: qgsrendercontext.cpp:541
QgsRenderContext::setMapExtent
void setMapExtent(const QgsRectangle &extent)
Sets the original extent of the map being rendered.
Definition: qgsrendercontext.h:438
QgsRenderContext::devicePixelRatio
float devicePixelRatio() const
Returns the device pixel ratio.
Definition: qgsrendercontext.cpp:670
Qgis::RenderSubcomponentProperty::Generic
@ Generic
Generic subcomponent property.
Qgis::MapSettingsFlag::RenderMapTile
@ RenderMapTile
Draw map such that there are no problems between adjacent tiles.