QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgsvectorlayerrenderer.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsvectorlayerrenderer.cpp
3  --------------------------------------
4  Date : December 2013
5  Copyright : (C) 2013 by Martin Dobias
6  Email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #include "qgsvectorlayerrenderer.h"
17 
18 #include "diagram/qgsdiagram.h"
19 
20 #include "qgsdiagramrenderer.h"
21 #include "qgsmessagelog.h"
22 #include "qgspallabeling.h"
23 #include "qgsrenderer.h"
24 #include "qgsrendercontext.h"
26 #include "qgssymbollayer.h"
27 #include "qgssymbollayerutils.h"
28 #include "qgssymbol.h"
29 #include "qgsvectorlayer.h"
32 #include "qgsvectorlayerlabeling.h"
34 #include "qgspainteffect.h"
36 #include "qgsexception.h"
37 #include "qgslogger.h"
38 #include "qgssettings.h"
42 
43 #include <QPicture>
44 
45 
47  : QgsMapLayerRenderer( layer->id(), &context )
48  , mLayer( layer )
49  , mFields( layer->fields() )
50  , mLabeling( false )
51  , mDiagrams( false )
52 {
53  mSource = new QgsVectorLayerFeatureSource( layer );
54 
55  mRenderer = layer->renderer() ? layer->renderer()->clone() : nullptr;
57 
58  mDrawVertexMarkers = nullptr != layer->editBuffer();
59 
60  mGeometryType = layer->geometryType();
61 
63 
64  if ( context.isTemporal() )
65  {
66  QgsVectorLayerTemporalContext temporalContext;
67  temporalContext.setLayer( layer );
68  mTemporalFilter = qobject_cast< const QgsVectorLayerTemporalProperties * >( layer->temporalProperties() )->createFilterString( temporalContext, context.temporalRange() );
69  }
70 
71  // if there's already a simplification method specified via the context, we respect that. Otherwise, we fall back
72  // to the layer's individual setting
73  if ( renderContext()->vectorSimplifyMethod().simplifyHints() != QgsVectorSimplifyMethod::NoSimplification )
74  {
78  }
79  else
80  {
83  }
84 
85  QgsSettings settings;
86  mVertexMarkerOnlyForSelection = settings.value( QStringLiteral( "qgis/digitizing/marker_only_for_selected" ), true ).toBool();
87 
88  QString markerTypeString = settings.value( QStringLiteral( "qgis/digitizing/marker_style" ), "Cross" ).toString();
89  if ( markerTypeString == QLatin1String( "Cross" ) )
90  {
92  }
93  else if ( markerTypeString == QLatin1String( "SemiTransparentCircle" ) )
94  {
96  }
97  else
98  {
100  }
101 
102  mVertexMarkerSize = settings.value( QStringLiteral( "qgis/digitizing/marker_size_mm" ), 2.0 ).toDouble();
103 
104  if ( !mRenderer )
105  return;
106 
107  QgsDebugMsgLevel( "rendering v2:\n " + mRenderer->dump(), 2 );
108 
109  if ( mDrawVertexMarkers )
110  {
111  // set editing vertex markers style
113  }
115 
116  mAttrNames = mRenderer->usedAttributes( context );
117  if ( context.hasRenderedFeatureHandlers() )
118  {
119  const QList< QgsRenderedFeatureHandlerInterface * > handlers = context.renderedFeatureHandlers();
120  for ( QgsRenderedFeatureHandlerInterface *handler : handlers )
121  mAttrNames.unite( handler->usedAttributes( layer, context ) );
122  }
123 
124  //register label and diagram layer to the labeling engine
125  prepareLabeling( layer, mAttrNames );
126  prepareDiagrams( layer, mAttrNames );
127 }
128 
129 
131 {
132  delete mRenderer;
133  delete mSource;
134 }
135 
137 {
138  return mInterruptionChecker.get();
139 }
140 
142 {
144  return true;
145 
146  if ( !mRenderer )
147  {
148  mErrors.append( QObject::tr( "No renderer for drawing." ) );
149  return false;
150  }
151 
152  if ( mRenderer->type() == QStringLiteral( "nullSymbol" ) )
153  {
154  // a little shortcut for the null symbol renderer - most of the time it is not going to render anything
155  // so we can even skip the whole loop to fetch features
157  return true;
158  }
159 
160  QgsRenderContext &context = *renderContext();
161 
162  // MUST be created in the thread doing the rendering
163  mInterruptionChecker = qgis::make_unique< QgsVectorLayerRendererInterruptionChecker >( context );
164  bool usingEffect = false;
166  {
167  usingEffect = true;
168  mRenderer->paintEffect()->begin( context );
169  }
170 
171  // Per feature blending mode
172  if ( context.useAdvancedEffects() && mFeatureBlendMode != QPainter::CompositionMode_SourceOver )
173  {
174  // set the painter to the feature blend mode, so that features drawn
175  // on this layer will interact and blend with each other
176  context.painter()->setCompositionMode( mFeatureBlendMode );
177  }
178 
179  mRenderer->startRender( context, mFields );
180 
181  QString rendererFilter = mRenderer->filter( mFields );
182 
183  QgsRectangle requestExtent = context.extent();
184  mRenderer->modifyRequestExtent( requestExtent, context );
185 
186  QgsFeatureRequest featureRequest = QgsFeatureRequest()
187  .setFilterRect( requestExtent )
190  if ( mRenderer->orderByEnabled() )
191  {
192  featureRequest.setOrderBy( mRenderer->orderBy() );
193  }
194 
195  const QgsFeatureFilterProvider *featureFilterProvider = context.featureFilterProvider();
196  if ( featureFilterProvider )
197  {
198  featureFilterProvider->filterFeatures( mLayer, featureRequest );
199  }
200  if ( !rendererFilter.isEmpty() && rendererFilter != QLatin1String( "TRUE" ) )
201  {
202  featureRequest.combineFilterExpression( rendererFilter );
203  }
204  if ( !mTemporalFilter.isEmpty() )
205  {
206  featureRequest.combineFilterExpression( mTemporalFilter );
207  }
208 
209  // enable the simplification of the geometries (Using the current map2pixel context) before send it to renderer engine.
210  if ( mSimplifyGeometry )
211  {
212  double map2pixelTol = mSimplifyMethod.threshold();
213  bool validTransform = true;
214 
215  const QgsMapToPixel &mtp = context.mapToPixel();
216  map2pixelTol *= mtp.mapUnitsPerPixel();
218 
219  // resize the tolerance using the change of size of an 1-BBOX from the source CoordinateSystem to the target CoordinateSystem
220  if ( ct.isValid() && !ct.isShortCircuited() )
221  {
222  try
223  {
224  QgsPointXY center = context.extent().center();
225  double rectSize = ct.sourceCrs().isGeographic() ? 0.0008983 /* ~100/(40075014/360=111319.4833) */ : 100;
226 
227  QgsRectangle sourceRect = QgsRectangle( center.x(), center.y(), center.x() + rectSize, center.y() + rectSize );
228  QgsRectangle targetRect = ct.transform( sourceRect );
229 
230  QgsDebugMsgLevel( QStringLiteral( "Simplify - SourceTransformRect=%1" ).arg( sourceRect.toString( 16 ) ), 4 );
231  QgsDebugMsgLevel( QStringLiteral( "Simplify - TargetTransformRect=%1" ).arg( targetRect.toString( 16 ) ), 4 );
232 
233  if ( !sourceRect.isEmpty() && sourceRect.isFinite() && !targetRect.isEmpty() && targetRect.isFinite() )
234  {
235  QgsPointXY minimumSrcPoint( sourceRect.xMinimum(), sourceRect.yMinimum() );
236  QgsPointXY maximumSrcPoint( sourceRect.xMaximum(), sourceRect.yMaximum() );
237  QgsPointXY minimumDstPoint( targetRect.xMinimum(), targetRect.yMinimum() );
238  QgsPointXY maximumDstPoint( targetRect.xMaximum(), targetRect.yMaximum() );
239 
240  double sourceHypothenuse = std::sqrt( minimumSrcPoint.sqrDist( maximumSrcPoint ) );
241  double targetHypothenuse = std::sqrt( minimumDstPoint.sqrDist( maximumDstPoint ) );
242 
243  QgsDebugMsgLevel( QStringLiteral( "Simplify - SourceHypothenuse=%1" ).arg( sourceHypothenuse ), 4 );
244  QgsDebugMsgLevel( QStringLiteral( "Simplify - TargetHypothenuse=%1" ).arg( targetHypothenuse ), 4 );
245 
246  if ( !qgsDoubleNear( targetHypothenuse, 0.0 ) )
247  map2pixelTol *= ( sourceHypothenuse / targetHypothenuse );
248  }
249  }
250  catch ( QgsCsException &cse )
251  {
252  QgsMessageLog::logMessage( QObject::tr( "Simplify transform error caught: %1" ).arg( cse.what() ), QObject::tr( "CRS" ) );
253  validTransform = false;
254  }
255  }
256 
257  if ( validTransform )
258  {
259  QgsSimplifyMethod simplifyMethod;
261  simplifyMethod.setTolerance( map2pixelTol );
262  simplifyMethod.setThreshold( mSimplifyMethod.threshold() );
264  featureRequest.setSimplifyMethod( simplifyMethod );
265 
267  vectorMethod.setTolerance( map2pixelTol );
268  context.setVectorSimplifyMethod( vectorMethod );
269  }
270  else
271  {
272  QgsVectorSimplifyMethod vectorMethod;
274  context.setVectorSimplifyMethod( vectorMethod );
275  }
276  }
277  else
278  {
279  QgsVectorSimplifyMethod vectorMethod;
281  context.setVectorSimplifyMethod( vectorMethod );
282  }
283 
284  QgsFeatureIterator fit = mSource->getFeatures( featureRequest );
285  // Attach an interruption checker so that iterators that have potentially
286  // slow fetchFeature() implementations, such as in the WFS provider, can
287  // check it, instead of relying on just the mContext.renderingStopped() check
288  // in drawRenderer()
290 
292  drawRendererLevels( fit );
293  else
294  drawRenderer( fit );
295 
296  if ( !fit.isValid() )
297  {
298  mErrors.append( QStringLiteral( "Data source invalid" ) );
299  }
300 
301  if ( usingEffect )
302  {
303  mRenderer->paintEffect()->end( context );
304  }
305 
306  mInterruptionChecker.reset();
307  return true;
308 }
309 
310 
311 void QgsVectorLayerRenderer::drawRenderer( QgsFeatureIterator &fit )
312 {
314  QgsRenderContext &context = *renderContext();
315  context.expressionContext().appendScope( symbolScope );
316 
317  QgsFeature fet;
318  while ( fit.nextFeature( fet ) )
319  {
320  try
321  {
322  if ( context.renderingStopped() )
323  {
324  QgsDebugMsgLevel( QStringLiteral( "Drawing of vector layer %1 canceled." ).arg( layerId() ), 2 );
325  break;
326  }
327 
328  if ( !fet.hasGeometry() || fet.geometry().isEmpty() )
329  continue; // skip features without geometry
330 
331  context.expressionContext().setFeature( fet );
332 
333  bool sel = context.showSelection() && mSelectedFeatureIds.contains( fet.id() );
334  bool drawMarker = ( mDrawVertexMarkers && context.drawEditingInformation() && ( !mVertexMarkerOnlyForSelection || sel ) );
335 
336  // render feature
337  bool rendered = mRenderer->renderFeature( fet, context, -1, sel, drawMarker );
338 
339  // labeling - register feature
340  if ( rendered )
341  {
342  // new labeling engine
343  if ( context.labelingEngine() && ( mLabelProvider || mDiagramProvider ) )
344  {
345  QgsGeometry obstacleGeometry;
346  QgsSymbolList symbols = mRenderer->originalSymbolsForFeature( fet, context );
347  QgsSymbol *symbol = nullptr;
348  if ( !symbols.isEmpty() && fet.geometry().type() == QgsWkbTypes::PointGeometry )
349  {
350  obstacleGeometry = QgsVectorLayerLabelProvider::getPointObstacleGeometry( fet, context, symbols );
351  }
352 
353  if ( !symbols.isEmpty() )
354  {
355  symbol = symbols.at( 0 );
356  QgsExpressionContextUtils::updateSymbolScope( symbol, symbolScope );
357  }
358 
359  if ( mLabelProvider )
360  {
361  mLabelProvider->registerFeature( fet, context, obstacleGeometry, symbol );
362  }
363  if ( mDiagramProvider )
364  {
365  mDiagramProvider->registerFeature( fet, context, obstacleGeometry );
366  }
367  }
368  }
369  }
370  catch ( const QgsCsException &cse )
371  {
372  Q_UNUSED( cse )
373  QgsDebugMsg( QStringLiteral( "Failed to transform a point while drawing a feature with ID '%1'. Ignoring this feature. %2" )
374  .arg( fet.id() ).arg( cse.what() ) );
375  }
376  }
377 
378  delete context.expressionContext().popScope();
379 
380  stopRenderer( nullptr );
381 }
382 
383 void QgsVectorLayerRenderer::drawRendererLevels( QgsFeatureIterator &fit )
384 {
385  QHash< QgsSymbol *, QList<QgsFeature> > features; // key = symbol, value = array of features
386  QgsRenderContext &context = *renderContext();
387 
388  QgsSingleSymbolRenderer *selRenderer = nullptr;
389  if ( !mSelectedFeatureIds.isEmpty() )
390  {
392  selRenderer->symbol()->setColor( context.selectionColor() );
394  selRenderer->startRender( context, mFields );
395  }
396 
398  std::unique_ptr< QgsExpressionContextScopePopper > scopePopper = qgis::make_unique< QgsExpressionContextScopePopper >( context.expressionContext(), symbolScope );
399 
400  // 1. fetch features
401  QgsFeature fet;
402  while ( fit.nextFeature( fet ) )
403  {
404  if ( context.renderingStopped() )
405  {
406  qDebug( "rendering stop!" );
407  stopRenderer( selRenderer );
408  return;
409  }
410 
411  if ( !fet.hasGeometry() )
412  continue; // skip features without geometry
413 
414  context.expressionContext().setFeature( fet );
415  QgsSymbol *sym = mRenderer->symbolForFeature( fet, context );
416  if ( !sym )
417  {
418  continue;
419  }
420 
421  if ( !features.contains( sym ) )
422  {
423  features.insert( sym, QList<QgsFeature>() );
424  }
425  features[sym].append( fet );
426 
427  // new labeling engine
428  if ( context.labelingEngine() && ( mLabelProvider || mDiagramProvider ) )
429  {
430  QgsGeometry obstacleGeometry;
431  QgsSymbolList symbols = mRenderer->originalSymbolsForFeature( fet, context );
432  QgsSymbol *symbol = nullptr;
433  if ( !symbols.isEmpty() && fet.geometry().type() == QgsWkbTypes::PointGeometry )
434  {
435  obstacleGeometry = QgsVectorLayerLabelProvider::getPointObstacleGeometry( fet, context, symbols );
436  }
437 
438  if ( !symbols.isEmpty() )
439  {
440  symbol = symbols.at( 0 );
441  QgsExpressionContextUtils::updateSymbolScope( symbol, symbolScope );
442  }
443 
444  if ( mLabelProvider )
445  {
446  mLabelProvider->registerFeature( fet, context, obstacleGeometry, symbol );
447  }
448  if ( mDiagramProvider )
449  {
450  mDiagramProvider->registerFeature( fet, context, obstacleGeometry );
451  }
452  }
453  }
454 
455  scopePopper.reset();
456 
457  if ( features.empty() )
458  {
459  // nothing to draw
460  stopRenderer( selRenderer );
461  return;
462  }
463 
464  // find out the order
465  QgsSymbolLevelOrder levels;
466  QgsSymbolList symbols = mRenderer->symbols( context );
467  for ( int i = 0; i < symbols.count(); i++ )
468  {
469  QgsSymbol *sym = symbols[i];
470  for ( int j = 0; j < sym->symbolLayerCount(); j++ )
471  {
472  int level = sym->symbolLayer( j )->renderingPass();
473  if ( level < 0 || level >= 1000 ) // ignore invalid levels
474  continue;
475  QgsSymbolLevelItem item( sym, j );
476  while ( level >= levels.count() ) // append new empty levels
477  levels.append( QgsSymbolLevel() );
478  levels[level].append( item );
479  }
480  }
481 
482  // 2. draw features in correct order
483  for ( int l = 0; l < levels.count(); l++ )
484  {
485  QgsSymbolLevel &level = levels[l];
486  for ( int i = 0; i < level.count(); i++ )
487  {
488  QgsSymbolLevelItem &item = level[i];
489  if ( !features.contains( item.symbol() ) )
490  {
491  QgsDebugMsg( QStringLiteral( "level item's symbol not found!" ) );
492  continue;
493  }
494  int layer = item.layer();
495  QList<QgsFeature> &lst = features[item.symbol()];
496  QList<QgsFeature>::iterator fit;
497  for ( fit = lst.begin(); fit != lst.end(); ++fit )
498  {
499  if ( context.renderingStopped() )
500  {
501  stopRenderer( selRenderer );
502  return;
503  }
504 
505  bool sel = context.showSelection() && mSelectedFeatureIds.contains( fit->id() );
506  // maybe vertex markers should be drawn only during the last pass...
507  bool drawMarker = ( mDrawVertexMarkers && context.drawEditingInformation() && ( !mVertexMarkerOnlyForSelection || sel ) );
508 
509  context.expressionContext().setFeature( *fit );
510 
511  try
512  {
513  mRenderer->renderFeature( *fit, context, layer, sel, drawMarker );
514  }
515  catch ( const QgsCsException &cse )
516  {
517  Q_UNUSED( cse )
518  QgsDebugMsg( QStringLiteral( "Failed to transform a point while drawing a feature with ID '%1'. Ignoring this feature. %2" )
519  .arg( fet.id() ).arg( cse.what() ) );
520  }
521  }
522  }
523  }
524 
525  stopRenderer( selRenderer );
526 }
527 
528 
529 void QgsVectorLayerRenderer::stopRenderer( QgsSingleSymbolRenderer *selRenderer )
530 {
531  QgsRenderContext &context = *renderContext();
532  mRenderer->stopRender( context );
533  if ( selRenderer )
534  {
535  selRenderer->stopRender( context );
536  delete selRenderer;
537  }
538 }
539 
540 
541 
542 
543 void QgsVectorLayerRenderer::prepareLabeling( QgsVectorLayer *layer, QSet<QString> &attributeNames )
544 {
545  QgsRenderContext &context = *renderContext();
546  // TODO: add attributes for geometry generator
547  if ( QgsLabelingEngine *engine2 = context.labelingEngine() )
548  {
549  if ( layer->labelsEnabled() )
550  {
551  mLabelProvider = layer->labeling()->provider( layer );
552  if ( mLabelProvider )
553  {
554  engine2->addProvider( mLabelProvider );
555  if ( !mLabelProvider->prepare( context, attributeNames ) )
556  {
557  engine2->removeProvider( mLabelProvider );
558  mLabelProvider = nullptr; // deleted by engine
559  }
560  }
561  }
562  }
563 
564 #if 0 // TODO: limit of labels, font not found
565  QgsPalLayerSettings &palyr = mContext.labelingEngine()->layer( mLayerID );
566 
567  // see if feature count limit is set for labeling
568  if ( palyr.limitNumLabels && palyr.maxNumLabels > 0 )
569  {
570  QgsFeatureIterator fit = getFeatures( QgsFeatureRequest()
571  .setFilterRect( mContext.extent() )
572  .setNoAttributes() );
573 
574  // total number of features that may be labeled
575  QgsFeature f;
576  int nFeatsToLabel = 0;
577  while ( fit.nextFeature( f ) )
578  {
579  nFeatsToLabel++;
580  }
581  palyr.mFeaturesToLabel = nFeatsToLabel;
582  }
583 
584  // notify user about any font substitution
585  if ( !palyr.mTextFontFound && !mLabelFontNotFoundNotified )
586  {
587  emit labelingFontNotFound( this, palyr.mTextFontFamily );
588  mLabelFontNotFoundNotified = true;
589  }
590 #endif
591 }
592 
593 void QgsVectorLayerRenderer::prepareDiagrams( QgsVectorLayer *layer, QSet<QString> &attributeNames )
594 {
595  QgsRenderContext &context = *renderContext();
596  if ( QgsLabelingEngine *engine2 = context.labelingEngine() )
597  {
598  if ( layer->diagramsEnabled() )
599  {
601  // need to be added before calling prepare() - uses map settings from engine
602  engine2->addProvider( mDiagramProvider );
603  if ( !mDiagramProvider->prepare( context, attributeNames ) )
604  {
605  engine2->removeProvider( mDiagramProvider );
606  mDiagramProvider = nullptr; // deleted by engine
607  }
608  }
609  }
610 }
611 
612 /* ----------------------------------------- */
613 /* QgsVectorLayerRendererInterruptionChecker */
614 /* ----------------------------------------- */
615 
617 ( const QgsRenderContext &context )
618  : mContext( context )
619  , mTimer( new QTimer( this ) )
620 {
621  connect( mTimer, &QTimer::timeout, this, [ = ]
622  {
623  if ( mContext.renderingStopped() )
624  {
625  mTimer->stop();
626  cancel();
627  }
628  } );
629  mTimer->start( 50 );
630 
631 }
QgsRenderContext::renderedFeatureHandlers
QList< QgsRenderedFeatureHandlerInterface * > renderedFeatureHandlers() const
Returns the list of rendered feature handlers to use while rendering map layers.
Definition: qgsrendercontext.cpp:489
QgsVectorLayer::editBuffer
Q_INVOKABLE QgsVectorLayerEditBuffer * editBuffer()
Buffer with uncommitted editing operations. Only valid after editing has been turned on.
Definition: qgsvectorlayer.h:1942
QgsVectorLayerFeatureSource::getFeatures
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) override
Gets an iterator for features matching the specified request.
Definition: qgsvectorlayerfeatureiterator.cpp:96
qgsexpressioncontextutils.h
QgsVectorLayerRenderer::mVertexMarkerStyle
int mVertexMarkerStyle
Definition: qgsvectorlayerrenderer.h:133
QgsVectorLayerRenderer::mSimplifyMethod
QgsVectorSimplifyMethod mSimplifyMethod
Definition: qgsvectorlayerrenderer.h:159
QgsVectorLayer::diagramsEnabled
bool diagramsEnabled() const
Returns whether the layer contains diagrams which are enabled and should be drawn.
Definition: qgsvectorlayer.cpp:738
QgsVectorSimplifyMethod
Definition: qgsvectorsimplifymethod.h:29
QgsRectangle::isFinite
bool isFinite() const
Returns true if the rectangle has finite boundaries.
Definition: qgsrectangle.h:527
QgsVectorSimplifyMethod::NoSimplification
@ NoSimplification
No simplification can be applied.
Definition: qgsvectorsimplifymethod.h:52
QgsMapLayerRenderer::mLayerID
QString mLayerID
Definition: qgsmaplayerrenderer.h:88
QgsVectorLayer::featureBlendMode
QPainter::CompositionMode featureBlendMode() const
Returns the current blending mode for features.
Definition: qgsvectorlayer.cpp:4319
QgsPalLayerSettings::mFeaturesToLabel
int mFeaturesToLabel
Definition: qgspallabeling.h:1109
QgsVectorLayerRenderer::mAttrNames
QSet< QString > mAttrNames
Definition: qgsvectorlayerrenderer.h:138
QgsPointXY::y
double y
Definition: qgspointxy.h:48
qgspallabeling.h
QgsSymbolLayerUtils::Cross
@ Cross
Definition: qgssymbollayerutils.h:62
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
QgsVectorLayerRenderer::mRenderer
QgsFeatureRenderer * mRenderer
Definition: qgsvectorlayerrenderer.h:129
QgsSimplifyMethod
Definition: qgssimplifymethod.h:28
QgsSymbolLevel
QList< QgsSymbolLevelItem > QgsSymbolLevel
Definition: qgsrenderer.h:85
QgsRenderContext::expressionContext
QgsExpressionContext & expressionContext()
Gets the expression context.
Definition: qgsrendercontext.h:580
QgsMapToPixel::mapUnitsPerPixel
double mapUnitsPerPixel() const
Returns current map units per pixel.
Definition: qgsmaptopixel.cpp:128
QgsExpressionContext::popScope
QgsExpressionContextScope * popScope()
Removes the last scope from the expression context and return it.
Definition: qgsexpressioncontext.cpp:500
QgsSettings::value
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
Definition: qgssettings.cpp:174
QgsSymbol::defaultSymbol
static QgsSymbol * defaultSymbol(QgsWkbTypes::GeometryType geomType)
Returns a new default symbol for the specified geometry type.
Definition: qgssymbol.cpp:301
QgsVectorLayerRenderer::mInterruptionChecker
std::unique_ptr< QgsVectorLayerRendererInterruptionChecker > mInterruptionChecker
Definition: qgsvectorlayerrenderer.h:116
QgsWkbTypes::NullGeometry
@ NullGeometry
Definition: qgswkbtypes.h:145
QgsDebugMsgLevel
#define QgsDebugMsgLevel(str, level)
Definition: qgslogger.h:39
qgssinglesymbolrenderer.h
QgsPalLayerSettings
Definition: qgspallabeling.h:205
QgsVectorLayerRenderer::mGeometryType
QgsWkbTypes::GeometryType mGeometryType
Definition: qgsvectorlayerrenderer.h:136
QgsRenderContext::drawEditingInformation
bool drawEditingInformation() const
Returns true if edit markers should be drawn during the render operation.
Definition: qgsrendercontext.cpp:230
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
QgsPointXY::sqrDist
double sqrDist(double x, double y) const
Returns the squared distance between this point a specified x, y coordinate.
Definition: qgspointxy.h:175
QgsPaintEffect::begin
virtual void begin(QgsRenderContext &context)
Begins intercepting paint operations to a render context.
Definition: qgspainteffect.cpp:117
QgsVectorLayerRenderer::mSource
QgsVectorLayerFeatureSource * mSource
Definition: qgsvectorlayerrenderer.h:127
QgsRenderContext::showSelection
bool showSelection() const
Returns true if vector selections should be shown in the rendered map.
Definition: qgsrendercontext.cpp:235
QgsVectorLayerDiagramProvider
The QgsVectorLayerDiagramProvider class implements support for diagrams within the labeling engine....
Definition: qgsvectorlayerdiagramprovider.h:62
QgsFeatureRenderer::capabilities
virtual QgsFeatureRenderer::Capabilities capabilities()
Returns details about internals of this renderer.
Definition: qgsrenderer.h:274
qgsvectorlayerrenderer.h
QgsRectangle::xMaximum
double xMaximum() const
Returns the x maximum value (right side of rectangle).
Definition: qgsrectangle.h:162
QgsVectorLayerRenderer::mDrawVertexMarkers
bool mDrawVertexMarkers
Definition: qgsvectorlayerrenderer.h:131
qgssymbollayerutils.h
QgsRenderContext::hasRenderedFeatureHandlers
bool hasRenderedFeatureHandlers() const
Returns true if the context has any rendered feature handlers.
Definition: qgsrendercontext.h:707
QgsVectorLayerRenderer::mVertexMarkerOnlyForSelection
bool mVertexMarkerOnlyForSelection
Definition: qgsvectorlayerrenderer.h:132
QgsExpressionContextUtils::layerScope
static QgsExpressionContextScope * layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
Definition: qgsexpressioncontextutils.cpp:264
QgsVectorLayerRenderer::QgsVectorLayerRenderer
QgsVectorLayerRenderer(QgsVectorLayer *layer, QgsRenderContext &context)
Definition: qgsvectorlayerrenderer.cpp:46
QgsFeatureRenderer::type
QString type() const
Definition: qgsrenderer.h:141
QgsSimplifyMethod::setThreshold
void setThreshold(float threshold)
Sets the simplification threshold in pixels. Represents the maximum distance in pixels between two co...
Definition: qgssimplifymethod.h:52
QgsFeature::geometry
QgsGeometry geometry
Definition: qgsfeature.h:71
qgsfeaturefilterprovider.h
QgsTemporalRangeObject::temporalRange
const QgsDateTimeRange & temporalRange() const
Returns the datetime range for the object.
Definition: qgstemporalrangeobject.cpp:43
qgsrenderedfeaturehandlerinterface.h
QgsRenderContext
Definition: qgsrendercontext.h:57
QgsMapLayerRenderer::renderContext
QgsRenderContext * renderContext()
Returns the render context associated with the renderer.
Definition: qgsmaplayerrenderer.h:84
QgsFeatureRenderer::usedAttributes
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const =0
Returns a list of attributes required by this renderer.
QgsSingleSymbolRenderer
Definition: qgssinglesymbolrenderer.h:29
QgsSingleSymbolRenderer::stopRender
void stopRender(QgsRenderContext &context) override
Must be called when a render cycle has finished, to allow the renderer to clean up.
Definition: qgssinglesymbolrenderer.cpp:68
QgsSettings
Definition: qgssettings.h:61
qgsdiagram.h
QgsVectorLayerRenderer::mSimplifyGeometry
bool mSimplifyGeometry
Definition: qgsvectorlayerrenderer.h:160
QgsVectorSimplifyMethod::setSimplifyHints
void setSimplifyHints(SimplifyHints simplifyHints)
Sets the simplification hints of the vector layer managed.
Definition: qgsvectorsimplifymethod.h:62
QgsFeatureRequest::setSubsetOfAttributes
QgsFeatureRequest & setSubsetOfAttributes(const QgsAttributeList &attrs)
Set a subset of attributes that will be fetched.
Definition: qgsfeaturerequest.cpp:190
QgsSymbol
Definition: qgssymbol.h:63
QgsDebugMsg
#define QgsDebugMsg(str)
Definition: qgslogger.h:38
qgspainteffect.h
QgsCoordinateTransform::transform
QgsPointXY transform(const QgsPointXY &point, TransformDirection direction=ForwardTransform) const SIP_THROW(QgsCsException)
Transform the point from the source CRS to the destination CRS.
Definition: qgscoordinatetransform.cpp:239
QgsSymbol::symbolLayer
QgsSymbolLayer * symbolLayer(int layer)
Returns the symbol layer at the specified index.
Definition: qgssymbol.cpp:366
QgsCoordinateTransform::isValid
bool isValid() const
Returns true if the coordinate transform is valid, ie both the source and destination CRS have been s...
Definition: qgscoordinatetransform.cpp:876
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
QgsVectorSimplifyMethod::FullSimplification
@ FullSimplification
All simplification hints can be applied ( Geometry + AA-disabling )
Definition: qgsvectorsimplifymethod.h:55
QgsRectangle
Definition: qgsrectangle.h:41
QgsSymbolLevelItem::layer
int layer() const
The layer of this symbol level.
Definition: qgsrenderer.cpp:509
QgsFeatureRenderer::stopRender
virtual void stopRender(QgsRenderContext &context)
Must be called when a render cycle has finished, to allow the renderer to clean up.
Definition: qgsrenderer.cpp:107
QgsFeatureRenderer::setVertexMarkerAppearance
void setVertexMarkerAppearance(int type, double size)
Sets type and size of editing vertex markers for subsequent rendering.
Definition: qgsrenderer.cpp:358
QgsFeatureRequest::setExpressionContext
QgsFeatureRequest & setExpressionContext(const QgsExpressionContext &context)
Sets the expression context used to evaluate filter expressions.
Definition: qgsfeaturerequest.cpp:149
QgsRenderedFeatureHandlerInterface
Definition: qgsrenderedfeaturehandlerinterface.h:46
QgsFeatureRenderer::SymbolLevels
@ SymbolLevels
Rendering with symbol levels (i.e. implements symbols(), symbolForFeature())
Definition: qgsrenderer.h:254
QgsSymbolLevelItem::symbol
QgsSymbol * symbol() const
The symbol of this symbol level.
Definition: qgsrenderer.cpp:504
QgsMapLayerRenderer
Definition: qgsmaplayerrenderer.h:50
QgsFeatureRenderer::orderBy
QgsFeatureRequest::OrderBy orderBy() const
Gets the order in which features shall be processed by this renderer.
Definition: qgsrenderer.cpp:435
QgsVectorLayerRenderer::mLayer
QgsVectorLayer * mLayer
The rendered layer.
Definition: qgsvectorlayerrenderer.h:119
QgsFeatureRenderer::filter
virtual QString filter(const QgsFields &fields=QgsFields())
If a renderer does not require all the features this method may be overridden and return an expressio...
Definition: qgsrenderer.h:205
QgsVectorLayerRendererInterruptionChecker::QgsVectorLayerRendererInterruptionChecker
QgsVectorLayerRendererInterruptionChecker(const QgsRenderContext &context)
Constructor.
Definition: qgsvectorlayerrenderer.cpp:617
QgsFeatureRequest::setFilterRect
QgsFeatureRequest & setFilterRect(const QgsRectangle &rectangle)
Sets the rectangle from which features will be taken.
Definition: qgsfeaturerequest.cpp:97
QgsVectorLayer::simplifyDrawingCanbeApplied
bool simplifyDrawingCanbeApplied(const QgsRenderContext &renderContext, QgsVectorSimplifyMethod::SimplifyHint simplifyHint) const
Returns whether the VectorLayer can apply the specified simplification hint.
Definition: qgsvectorlayer.cpp:976
qgsvectorlayerdiagramprovider.h
QgsVectorLayerDiagramProvider::prepare
virtual bool prepare(const QgsRenderContext &context, QSet< QString > &attributeNames)
Prepare for registration of features.
Definition: qgsvectorlayerdiagramprovider.cpp:144
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
QgsFeature::id
QgsFeatureId id
Definition: qgsfeature.h:68
QgsRenderContext::coordinateTransform
QgsCoordinateTransform coordinateTransform() const
Returns the current coordinate transform for the context.
Definition: qgsrendercontext.h:229
QgsCoordinateTransform::sourceCrs
QgsCoordinateReferenceSystem sourceCrs() const
Returns the source coordinate reference system, which the transform will transform coordinates from.
Definition: qgscoordinatetransform.cpp:229
QgsVectorLayerRenderer::mFields
QgsFields mFields
Definition: qgsvectorlayerrenderer.h:121
QgsFeatureRequest
Definition: qgsfeaturerequest.h:75
QgsCoordinateReferenceSystem::isGeographic
bool isGeographic
Definition: qgscoordinatereferencesystem.h:211
qgsvectorlayertemporalproperties.h
QgsFeatureFilterProvider::filterFeatures
virtual void filterFeatures(const QgsVectorLayer *layer, QgsFeatureRequest &featureRequest) const =0
Add additional filters to the feature request to further restrict the features returned by the reques...
QgsCsException
Definition: qgsexception.h:65
QgsRenderContext::useAdvancedEffects
bool useAdvancedEffects() const
Returns true if advanced effects such as blend modes such be used.
Definition: qgsrendercontext.cpp:220
QgsFeatureRequest::combineFilterExpression
QgsFeatureRequest & combineFilterExpression(const QString &expression)
Modifies the existing filter expression to add an additional expression filter.
Definition: qgsfeaturerequest.cpp:136
QgsCoordinateTransform::isShortCircuited
bool isShortCircuited() const
Returns true if the transform short circuits because the source and destination are equivalent.
Definition: qgscoordinatetransform.cpp:881
QgsSymbolLayer::renderingPass
int renderingPass() const
Specifies the rendering pass in which this symbol layer should be rendered.
Definition: qgssymbollayer.cpp:241
QgsVectorLayer::temporalProperties
QgsMapLayerTemporalProperties * temporalProperties() override
Returns temporal properties associated with the vector layer.
Definition: qgsvectorlayer.cpp:637
QgsSimplifyMethod::OptimizeForRendering
@ OptimizeForRendering
Simplify using the map2pixel data to optimize the rendering of geometries.
Definition: qgssimplifymethod.h:34
QgsMapLayerRenderer::layerId
QString layerId() const
Gets access to the ID of the layer rendered by this class.
Definition: qgsmaplayerrenderer.h:77
QgsSymbolList
QList< QgsSymbol * > QgsSymbolList
Definition: qgsrenderer.h:45
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:315
QgsRenderContext::featureFilterProvider
const QgsFeatureFilterProvider * featureFilterProvider() const
Gets the filter feature provider used for additional filtering of rendered features.
Definition: qgsrendercontext.cpp:282
QgsFeedback
Definition: qgsfeedback.h:43
QgsSymbolLayerUtils::SemiTransparentCircle
@ SemiTransparentCircle
Definition: qgssymbollayerutils.h:61
QgsFeatureRenderer::clone
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
QgsVectorLayer::labeling
const QgsAbstractVectorLayerLabeling * labeling() const
Access to const labeling configuration.
Definition: qgsvectorlayer.h:1598
QgsFeatureRenderer::originalSymbolsForFeature
virtual QgsSymbolList originalSymbolsForFeature(const QgsFeature &feature, QgsRenderContext &context) const
Equivalent of originalSymbolsForFeature() call extended to support renderers that may use more symbol...
Definition: qgsrenderer.cpp:416
QgsVectorSimplifyMethod::setTolerance
void setTolerance(double tolerance)
Sets the tolerance of simplification in map units. Represents the maximum distance in map units betwe...
Definition: qgsvectorsimplifymethod.h:82
QgsRenderContext::setVectorSimplifyMethod
void setVectorSimplifyMethod(const QgsVectorSimplifyMethod &simplifyMethod)
Sets the simplification setting to use when rendering vector layers.
Definition: qgsrendercontext.h:564
QgsException::what
QString what() const
Definition: qgsexception.h:48
QgsVectorLayer::selectedFeatureIds
const Q_INVOKABLE QgsFeatureIds & selectedFeatureIds() const
Returns a list of the selected features IDs in this layer.
Definition: qgsvectorlayer.cpp:3433
QgsSymbolLevelItem
Definition: qgsrenderer.h:60
QgsVectorLayerRenderer::mTemporalFilter
QString mTemporalFilter
Definition: qgsvectorlayerrenderer.h:125
QgsVectorLayerTemporalContext::setLayer
void setLayer(QgsVectorLayer *layer)
Sets the associated layer.
Definition: qgsvectorlayertemporalproperties.cpp:660
QgsSymbolLayerUtils::NoMarker
@ NoMarker
Definition: qgssymbollayerutils.h:63
qgsrendercontext.h
QgsFeatureRenderer::symbols
virtual QgsSymbolList symbols(QgsRenderContext &context) const
Returns list of symbols used by the renderer.
Definition: qgsrenderer.cpp:143
QgsSimplifyMethod::setTolerance
void setTolerance(double tolerance)
Sets the tolerance of simplification in map units. Represents the maximum distance in map units betwe...
Definition: qgssimplifymethod.cpp:27
QgsMapLayerRenderer::mErrors
QStringList mErrors
Definition: qgsmaplayerrenderer.h:87
QgsFeatureRenderer::usingSymbolLevels
bool usingSymbolLevels() const
Definition: qgsrenderer.h:283
QgsFeatureRenderer::symbolForFeature
virtual QgsSymbol * symbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const =0
To be overridden.
qgssymbollayer.h
QgsVectorSimplifyMethod::threshold
float threshold() const
Gets the simplification threshold of the vector layer managed.
Definition: qgsvectorsimplifymethod.h:89
QgsGeometry::isEmpty
bool isEmpty() const
Returns true if the geometry is empty (eg a linestring with no vertices, or a collection with no geom...
Definition: qgsgeometry.cpp:367
qgsvectorlayerfeatureiterator.h
QgsPaintEffect::end
virtual void end(QgsRenderContext &context)
Ends interception of paint operations to a render context, and draws the result to the render context...
Definition: qgspainteffect.cpp:132
QgsVectorLayerTemporalContext
Definition: qgsvectorlayertemporalproperties.h:40
QgsVectorLayerRenderer::mFeatureBlendMode
QPainter::CompositionMode mFeatureBlendMode
Definition: qgsvectorlayerrenderer.h:157
qgsrenderer.h
QgsFeatureRequest::setSimplifyMethod
QgsFeatureRequest & setSimplifyMethod(const QgsSimplifyMethod &simplifyMethod)
Set a simplification method for geometries that will be fetched.
Definition: qgsfeaturerequest.cpp:246
QgsFeatureRenderer::modifyRequestExtent
virtual void modifyRequestExtent(QgsRectangle &extent, QgsRenderContext &context)
Allows for a renderer to modify the extent of a feature request prior to rendering.
Definition: qgsrenderer.cpp:410
qgsdiagramrenderer.h
QgsFeatureRequest::setNoAttributes
QgsFeatureRequest & setNoAttributes()
Set that no attributes will be fetched.
Definition: qgsfeaturerequest.cpp:197
QgsVectorSimplifyMethod::forceLocalOptimization
bool forceLocalOptimization() const
Gets where the simplification executes, after fetch the geometries from provider, or when supported,...
Definition: qgsvectorsimplifymethod.h:94
QgsRectangle::yMaximum
double yMaximum() const
Returns the y maximum value (top side of rectangle).
Definition: qgsrectangle.h:172
QgsExpressionContextScope
Single scope for storing variables and functions for use within a QgsExpressionContext....
Definition: qgsexpressioncontext.h:111
QgsVectorLayer::simplifyMethod
const QgsVectorSimplifyMethod & simplifyMethod() const
Returns the simplification settings for fast rendering of features.
Definition: qgsvectorlayer.h:2207
QgsRenderContext::vectorSimplifyMethod
const QgsVectorSimplifyMethod & vectorSimplifyMethod() const
Returns the simplification settings to use when rendering vector layers.
Definition: qgsrendercontext.h:549
QgsSimplifyMethod::setForceLocalOptimization
void setForceLocalOptimization(bool localOptimization)
Sets whether the simplification executes after fetch the geometries from provider,...
Definition: qgssimplifymethod.cpp:32
QgsVectorLayerRenderer::mDiagramProvider
QgsVectorLayerDiagramProvider * mDiagramProvider
used with new labeling engine (QgsLabelingEngine): provider for diagrams.
Definition: qgsvectorlayerrenderer.h:155
QgsLabelingEngine
The QgsLabelingEngine class provides map labeling functionality. The input for the engine is a list o...
Definition: qgslabelingengine.h:214
QgsRectangle::toString
QString toString(int precision=16) const
Returns a string representation of form xmin,ymin : xmax,ymax Coordinates will be truncated to the sp...
Definition: qgsrectangle.cpp:127
QgsExpressionContext::appendScope
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
Definition: qgsexpressioncontext.cpp:490
qgsvectorlayer.h
QgsPointXY
Definition: qgspointxy.h:43
QgsAbstractVectorLayerLabeling::provider
virtual QgsVectorLayerLabelProvider * provider(QgsVectorLayer *layer) const
Factory for label provider implementation.
Definition: qgsvectorlayerlabeling.h:70
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
QgsWkbTypes::PointGeometry
@ PointGeometry
Definition: qgswkbtypes.h:141
QgsSingleSymbolRenderer::startRender
void startRender(QgsRenderContext &context, const QgsFields &fields) override
Must be called when a new render cycle is started.
Definition: qgssinglesymbolrenderer.cpp:58
QgsExpressionContextUtils::updateSymbolScope
static QgsExpressionContextScope * updateSymbolScope(const QgsSymbol *symbol, QgsExpressionContextScope *symbolScope=nullptr)
Updates a symbol scope related to a QgsSymbol to an expression context.
Definition: qgsexpressioncontextutils.cpp:458
QgsRectangle::center
QgsPointXY center() const
Returns the center point of the rectangle.
Definition: qgsrectangle.h:230
QgsFeatureIterator::nextFeature
bool nextFeature(QgsFeature &f)
Definition: qgsfeatureiterator.h:373
QgsGeometry
Definition: qgsgeometry.h:122
QgsSymbol::setColor
void setColor(const QColor &color)
Sets the color for the symbol.
Definition: qgssymbol.cpp:485
QgsMapToPixel
Definition: qgsmaptopixel.h:37
QgsVectorLayer
Definition: qgsvectorlayer.h:385
QgsFeature::hasGeometry
bool hasGeometry() const
Returns true if the feature has an associated geometry.
Definition: qgsfeature.cpp:197
QgsFeatureRenderer::orderByEnabled
bool orderByEnabled() const
Returns whether custom ordering will be applied before features are processed by this renderer.
Definition: qgsrenderer.cpp:445
QgsPointXY::x
double x
Definition: qgspointxy.h:47
QgsVectorLayerFeatureSource
Definition: qgsvectorlayerfeatureiterator.h:51
QgsFeatureRenderer::renderFeature
virtual bool renderFeature(const QgsFeature &feature, QgsRenderContext &context, int layer=-1, bool selected=false, bool drawVertexMarker=false) SIP_THROW(QgsCsException)
Render a feature using this renderer in the given context.
Definition: qgsrenderer.cpp:119
qgssettings.h
QgsVectorLayerRenderer::mVertexMarkerSize
double mVertexMarkerSize
Definition: qgsvectorlayerrenderer.h:134
QgsMessageLog::logMessage
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
Definition: qgsmessagelog.cpp:27
QgsVectorLayerLabelProvider::registerFeature
virtual void registerFeature(const QgsFeature &feature, QgsRenderContext &context, const QgsGeometry &obstacleGeometry=QgsGeometry(), const QgsSymbol *symbol=nullptr)
Register a feature for labeling as one or more QgsLabelFeature objects stored into mLabels.
Definition: qgsvectorlayerlabelprovider.cpp:190
QgsWkbTypes::UnknownGeometry
@ UnknownGeometry
Definition: qgswkbtypes.h:144
QgsSimplifyMethod::setMethodType
void setMethodType(MethodType methodType)
Sets the simplification type.
Definition: qgssimplifymethod.cpp:22
QgsSymbolLevelOrder
QList< QgsSymbolLevel > QgsSymbolLevelOrder
Definition: qgsrenderer.h:89
QgsRectangle::yMinimum
double yMinimum() const
Returns the y minimum value (bottom side of rectangle).
Definition: qgsrectangle.h:177
QgsFeatureFilterProvider
Definition: qgsfeaturefilterprovider.h:40
QgsVectorLayerRenderer::mSelectedFeatureIds
QgsFeatureIds mSelectedFeatureIds
Definition: qgsvectorlayerrenderer.h:123
QgsFeatureRequest::setOrderBy
QgsFeatureRequest & setOrderBy(const OrderBy &orderBy)
Set a list of order by clauses.
Definition: qgsfeaturerequest.cpp:172
QgsVectorLayerRenderer::mLabelProvider
QgsVectorLayerLabelProvider * mLabelProvider
used with new labeling engine (QgsLabelingEngine): provider for labels.
Definition: qgsvectorlayerrenderer.h:149
qgsvectorlayerlabelprovider.h
QgsVectorSimplifyMethod::simplifyHints
SimplifyHints simplifyHints() const
Gets the simplification hints of the vector layer managed.
Definition: qgsvectorsimplifymethod.h:64
qgsexception.h
QgsVectorLayerLabelProvider::getPointObstacleGeometry
static QgsGeometry getPointObstacleGeometry(QgsFeature &fet, QgsRenderContext &context, const QgsSymbolList &symbols)
Returns the geometry for a point feature which should be used as an obstacle for labels.
Definition: qgsvectorlayerlabelprovider.cpp:199
QgsFeatureRenderer::dump
virtual QString dump() const
Returns debug information about this renderer.
Definition: qgsrenderer.cpp:138
QgsFeature
Definition: qgsfeature.h:55
QgsFeatureIterator::setInterruptionChecker
void setInterruptionChecker(QgsFeedback *interruptionChecker)
Attach an object that can be queried regularly by the iterator to check if it must stopped.
Definition: qgsfeatureiterator.h:409
qgsvectorlayerlabeling.h
QgsFeatureRenderer::paintEffect
QgsPaintEffect * paintEffect() const
Returns the current paint effect for the renderer.
Definition: qgsrenderer.cpp:424
QgsVectorLayerLabelProvider::prepare
virtual bool prepare(QgsRenderContext &context, QSet< QString > &attributeNames)
Prepare for registration of features.
Definition: qgsvectorlayerlabelprovider.cpp:112
qgslogger.h
QgsRenderContext::painter
QPainter * painter()
Returns the destination QPainter for the render operation.
Definition: qgsrendercontext.h:174
QgsPaintEffect::enabled
bool enabled() const
Returns whether the effect is enabled.
Definition: qgspainteffect.h:198
QgsVectorLayerDiagramProvider::registerFeature
virtual void registerFeature(QgsFeature &feature, QgsRenderContext &context, const QgsGeometry &obstacleGeometry=QgsGeometry())
Register a feature for labeling as one or more QgsLabelFeature objects stored into mFeatures.
Definition: qgsvectorlayerdiagramprovider.cpp:169
QgsSingleSymbolRenderer::symbol
QgsSymbol * symbol() const
Returns the symbol which will be rendered for every feature.
Definition: qgssinglesymbolrenderer.cpp:96
QgsCoordinateTransform
Definition: qgscoordinatetransform.h:52
QgsFeatureRenderer::startRender
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)
Must be called when a new render cycle is started.
Definition: qgsrenderer.cpp:93
QgsGeometry::type
QgsWkbTypes::GeometryType type
Definition: qgsgeometry.h:126
QgsFeatureIterator
Definition: qgsfeatureiterator.h:263
QgsVectorLayer::geometryType
Q_INVOKABLE QgsWkbTypes::GeometryType geometryType() const
Returns point, line or polygon.
Definition: qgsvectorlayer.cpp:659
QgsRectangle::isEmpty
bool isEmpty() const
Returns true if the rectangle is empty.
Definition: qgsrectangle.h:437
QgsVectorLayerRenderer::feedback
QgsFeedback * feedback() const override
Access to feedback object of the layer renderer (may be nullptr)
Definition: qgsvectorlayerrenderer.cpp:136
qgssymbol.h
QgsVectorSimplifyMethod::GeometrySimplification
@ GeometrySimplification
The geometries can be simplified using the current map2pixel context state.
Definition: qgsvectorsimplifymethod.h:53
QgsFeatureIterator::isValid
bool isValid() const
Will return if this iterator is valid.
Definition: qgsfeatureiterator.cpp:239
QgsVectorLayerRenderer::render
bool render() override
Do the rendering (based on data stored in the class)
Definition: qgsvectorlayerrenderer.cpp:141
QgsRectangle::xMinimum
double xMinimum() const
Returns the x minimum value (left side of rectangle).
Definition: qgsrectangle.h:167
QgsVectorLayer::labelsEnabled
bool labelsEnabled() const
Returns whether the layer contains labels which are enabled and should be drawn.
Definition: qgsvectorlayer.cpp:728
QgsSymbol::symbolLayerCount
int symbolLayerCount() const
Returns the total number of symbol layers contained in the symbol.
Definition: qgssymbol.h:183
QgsVectorLayerRenderer::~QgsVectorLayerRenderer
~QgsVectorLayerRenderer() override
Definition: qgsvectorlayerrenderer.cpp:130
qgsmessagelog.h
QgsExpressionContext::setFeature
void setFeature(const QgsFeature &feature)
Convenience function for setting a feature for the context.
Definition: qgsexpressioncontext.cpp:521
QgsVectorLayer::renderer
QgsFeatureRenderer * renderer()
Returns renderer.
Definition: qgsvectorlayer.h:881