QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
53 , mFields( layer->fields() )
55 , mNoSetLayerExpressionContext( layer->customProperty( QStringLiteral(
"_noset_layer_expression_context" ) ).toBool() )
57 std::unique_ptr< QgsFeatureRenderer > mainRenderer( layer->
renderer() ? layer->
renderer()->
clone() :
nullptr );
65 return g1->level() < g2->level();
68 bool insertedMainRenderer =
false;
69 double prevLevel = std::numeric_limits< double >::lowest();
70 mRenderer = mainRenderer.get();
73 if ( generator->level() >= 0 && prevLevel < 0 && !insertedMainRenderer )
76 mRenderers.emplace_back( std::move( mainRenderer ) );
77 insertedMainRenderer =
true;
79 mRenderers.emplace_back( generator->createRenderer() );
80 prevLevel = generator->level();
86 mRenderers.emplace_back( std::move( mainRenderer ) );
91 mDrawVertexMarkers =
nullptr != layer->
editBuffer();
101 mTemporalFilter = qobject_cast< const QgsVectorLayerTemporalProperties * >( layer->
temporalProperties() )->createFilterString( temporalContext, context.
temporalRange() );
102 QgsDebugMsgLevel(
"Rendering with Temporal Filter: " + mTemporalFilter, 2 );
122 if ( markerTypeString == QLatin1String(
"Cross" ) )
126 else if ( markerTypeString == QLatin1String(
"SemiTransparentCircle" ) )
139 if ( mDrawVertexMarkers )
144 if ( !mNoSetLayerExpressionContext )
147 for (
const std::unique_ptr< QgsFeatureRenderer > &renderer : mRenderers )
149 mAttrNames.unite( renderer->usedAttributes( context ) );
155 mAttrNames.unite( handler->usedAttributes( layer, context ) );
159 prepareLabeling( layer, mAttrNames );
160 prepareDiagrams( layer, mAttrNames );
164 if ( std::any_of( mRenderers.begin(), mRenderers.end(), [](
const auto & renderer ) { return renderer->forceRasterRender(); } ) )
167 mForceRasterRender =
true;
171 ( ( layer->
blendMode() != QPainter::CompositionMode_SourceOver )
176 mForceRasterRender =
true;
186 mRenderTimeHint = time;
191 return mFeedback.get();
196 return mForceRasterRender;
207 if ( mRenderers.empty() )
210 mErrors.append( QObject::tr(
"No renderer for drawing." ) );
218 mBlockRenderUpdates =
true;
219 mElapsedTimer.start();
223 for (
const std::unique_ptr< QgsFeatureRenderer > &renderer : mRenderers )
225 res = renderInternal( renderer.get() ) && res;
234 const bool isMainRenderer = renderer == mRenderer;
239 if ( renderer->
type() == QLatin1String(
"nullSymbol" ) )
243 if ( !isMainRenderer ||
244 ( !mDrawVertexMarkers && !mLabelProvider && !mDiagramProvider && mSelectedFeatureIds.isEmpty() ) )
250 bool usingEffect =
false;
258 if ( context.
useAdvancedEffects() && mFeatureBlendMode != QPainter::CompositionMode_SourceOver )
262 context.
painter()->setCompositionMode( mFeatureBlendMode );
267 QString rendererFilter = renderer->
filter( mFields );
270 if ( !mClippingRegions.empty() )
277 bool needsPainterClipPath =
false;
279 if ( needsPainterClipPath )
280 context.
painter()->setClipPath( path, Qt::IntersectClip );
284 if ( mDiagramProvider )
299 if ( featureFilterProvider )
303 if ( !rendererFilter.isEmpty() && rendererFilter != QLatin1String(
"TRUE" ) )
307 if ( !mTemporalFilter.isEmpty() )
318 if ( mSimplifyGeometry )
320 double map2pixelTol = mSimplifyMethod.
threshold();
321 bool validTransform =
true;
350 double sourceHypothenuse = std::sqrt( minimumSrcPoint.sqrDist( maximumSrcPoint ) );
351 double targetHypothenuse = std::sqrt( minimumDstPoint.sqrDist( maximumDstPoint ) );
353 QgsDebugMsgLevel( QStringLiteral(
"Simplify - SourceHypothenuse=%1" ).arg( sourceHypothenuse ), 4 );
354 QgsDebugMsgLevel( QStringLiteral(
"Simplify - TargetHypothenuse=%1" ).arg( targetHypothenuse ), 4 );
357 map2pixelTol *= ( sourceHypothenuse / targetHypothenuse );
363 validTransform =
false;
367 if ( validTransform )
407 drawRendererLevels( renderer, fit );
409 drawRenderer( renderer, fit );
413 mErrors.append( QStringLiteral(
"Data source invalid" ) );
428 const bool isMainRenderer = renderer == mRenderer;
434 std::unique_ptr< QgsGeometryEngine > clipEngine;
435 if ( mApplyClipFilter )
438 clipEngine->prepareGeometry();
458 if ( mApplyClipGeometries )
461 if ( ! mNoSetLayerExpressionContext )
464 bool sel = isMainRenderer && context.
showSelection() && mSelectedFeatureIds.contains( fet.
id() );
465 bool drawMarker = isMainRenderer && ( mDrawVertexMarkers && context.
drawEditingInformation() && ( !mVertexMarkerOnlyForSelection || sel ) );
468 bool rendered =
false;
471 rendered = renderer->
renderFeature( fet, context, -1, sel, drawMarker );
490 if ( isMainRenderer && context.
labelingEngine() && ( mLabelProvider || mDiagramProvider ) )
500 if ( !symbols.isEmpty() )
502 symbol = symbols.at( 0 );
506 if ( mApplyLabelClipGeometries )
509 if ( mLabelProvider )
511 mLabelProvider->
registerFeature( fet, context, obstacleGeometry, symbol );
513 if ( mDiagramProvider )
518 if ( mApplyLabelClipGeometries )
526 QgsDebugMsg( QStringLiteral(
"Failed to transform a point while drawing a feature with ID '%1'. Ignoring this feature. %2" )
527 .arg( fet.
id() ).arg( cse.
what() ) );
533 stopRenderer( renderer,
nullptr );
538 const bool isMainRenderer = renderer == mRenderer;
540 QHash< QgsSymbol *, QList<QgsFeature> >
features;
544 if ( !mSelectedFeatureIds.isEmpty() )
553 std::unique_ptr< QgsExpressionContextScopePopper > scopePopper = std::make_unique< QgsExpressionContextScopePopper >( context.
expressionContext(), symbolScope );
556 std::unique_ptr< QgsGeometryEngine > clipEngine;
557 if ( mApplyClipFilter )
560 clipEngine->prepareGeometry();
563 if ( mApplyLabelClipGeometries )
572 qDebug(
"rendering stop!" );
573 stopRenderer( renderer, selRenderer );
583 if ( ! mNoSetLayerExpressionContext )
595 features.insert( sym, QList<QgsFeature>() );
601 if ( isMainRenderer && context.
labelingEngine() && ( mLabelProvider || mDiagramProvider ) )
611 if ( !symbols.isEmpty() )
613 symbol = symbols.at( 0 );
617 if ( mLabelProvider )
619 mLabelProvider->
registerFeature( fet, context, obstacleGeometry, symbol );
621 if ( mDiagramProvider )
628 if ( mApplyLabelClipGeometries )
636 stopRenderer( renderer, selRenderer );
643 for (
int i = 0; i < symbols.count(); i++ )
649 if ( level < 0 || level >= 1000 )
652 while ( level >= levels.count() )
654 levels[level].append( item );
658 if ( mApplyClipGeometries )
662 for (
int l = 0; l < levels.count(); l++ )
665 for (
int i = 0; i < level.count(); i++ )
670 QgsDebugMsg( QStringLiteral(
"level item's symbol not found!" ) );
673 int layer = item.
layer();
675 QList<QgsFeature>::iterator fit;
676 for ( fit = lst.begin(); fit != lst.end(); ++fit )
680 stopRenderer( renderer, selRenderer );
684 bool sel = isMainRenderer && context.
showSelection() && mSelectedFeatureIds.contains( fit->id() );
686 bool drawMarker = isMainRenderer && ( mDrawVertexMarkers && context.
drawEditingInformation() && ( !mVertexMarkerOnlyForSelection || sel ) );
688 if ( ! mNoSetLayerExpressionContext )
693 renderer->
renderFeature( *fit, context, layer, sel, drawMarker );
706 QgsDebugMsg( QStringLiteral(
"Failed to transform a point while drawing a feature with ID '%1'. Ignoring this feature. %2" )
707 .arg( fet.
id() ).arg( cse.
what() ) );
713 stopRenderer( renderer, selRenderer );
727 void QgsVectorLayerRenderer::prepareLabeling(
QgsVectorLayer *layer, QSet<QString> &attributeNames )
751 if ( mLabelProvider )
753 engine2->addProvider( mLabelProvider );
754 if ( !mLabelProvider->
prepare( context, attributeNames ) )
756 engine2->removeProvider( mLabelProvider );
757 mLabelProvider =
nullptr;
763 #if 0 // TODO: limit of labels, font not found
767 if ( palyr.limitNumLabels && palyr.maxNumLabels > 0 )
770 .setFilterRect( mContext.extent() )
775 int nFeatsToLabel = 0;
784 if ( !palyr.mTextFontFound && !mLabelFontNotFoundNotified )
786 emit labelingFontNotFound(
this, palyr.mTextFontFamily );
787 mLabelFontNotFoundNotified =
true;
792 void QgsVectorLayerRenderer::prepareDiagrams(
QgsVectorLayer *layer, QSet<QString> &attributeNames )
801 engine2->addProvider( mDiagramProvider );
802 if ( !mDiagramProvider->
prepare( context, attributeNames ) )
804 engine2->removeProvider( mDiagramProvider );
805 mDiagramProvider =
nullptr;
QList< QgsRenderedFeatureHandlerInterface * > renderedFeatureHandlers() const
Returns the list of rendered feature handlers to use while rendering map layers.
static QList< QgsMapClippingRegion > collectClippingRegionsForLayer(const QgsRenderContext &context, const QgsMapLayer *layer)
Collects the list of map clipping regions from a context which apply to a map layer.
Q_INVOKABLE QgsVectorLayerEditBuffer * editBuffer()
Buffer with uncommitted editing operations. Only valid after editing has been turned on.
bool diagramsEnabled() const
Returns whether the layer contains diagrams which are enabled and should be drawn.
This class contains information how to simplify geometries fetched from a vector layer.
bool isFinite() const
Returns true if the rectangle has finite boundaries.
@ NoSimplification
No simplification can be applied.
QgsLabelSink * labelSink() const
Returns the associated label sink, or nullptr if not set.
QPainter::CompositionMode featureBlendMode() const
Returns the current blending mode for features.
@ SemiTransparentCircle
Semi-transparent circle marker.
const QgsMapToPixel & mapToPixel() const
Returns the context's map to pixel transform, which transforms between map coordinates and device coo...
This class contains information about how to simplify geometries fetched from a QgsFeatureIterator.
static QgsGeometry calculateFeatureIntersectionGeometry(const QList< QgsMapClippingRegion > ®ions, const QgsRenderContext &context, bool &shouldClip)
Returns the geometry representing the intersection of clipping regions from context which should be u...
QList< QgsSymbolLevelItem > QgsSymbolLevel
QgsExpressionContext & expressionContext()
Gets the expression context.
double mapUnitsPerPixel() const
Returns the current map units per pixel.
QgsExpressionContextScope * popScope()
Removes the last scope from the expression context and return it.
static QgsSymbol * defaultSymbol(QgsWkbTypes::GeometryType geomType)
Returns a new default symbol for the specified geometry type.
@ VectorLayer
Vector layer.
void setFeatureClipGeometry(const QgsGeometry &geometry)
Sets a geometry to use to clip features at render time.
#define QgsDebugMsgLevel(str, level)
Contains settings for how a map layer will be labeled.
QPointer< QgsVectorLayer > mLayer
QPainter::CompositionMode blendMode() const
Returns the current blending mode for a layer.
bool drawEditingInformation() const
Returns true if edit markers should be drawn during the render operation.
bool isTemporal() const
Returns true if the object's temporal range is enabled, and the object will be filtered when renderin...
QgsPointXY center() const SIP_HOLDGIL
Returns the center point of the rectangle.
virtual void begin(QgsRenderContext &context)
Begins intercepting paint operations to a render context.
Implements a derived label provider for rule based labels for use with QgsLabelSink.
bool showSelection() const
Returns true if vector selections should be shown in the rendered map.
The QgsVectorLayerDiagramProvider class implements support for diagrams within the labeling engine....
virtual QgsFeatureRenderer::Capabilities capabilities()
Returns details about internals of this renderer.
bool hasRenderedFeatureHandlers() const
Returns true if the context has any rendered feature handlers.
double yMinimum() const SIP_HOLDGIL
Returns the y minimum value (bottom side of rectangle).
static QgsExpressionContextScope * layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
QgsVectorLayerRenderer(QgsVectorLayer *layer, QgsRenderContext &context)
void setThreshold(float threshold)
Sets the simplification threshold in pixels. Represents the maximum distance in pixels between two co...
bool testFlag(Qgis::RenderContextFlag flag) const
Check whether a particular flag is enabled.
const QgsDateTimeRange & temporalRange() const
Returns the datetime range for the object.
Contains information about the context of a rendering operation.
QgsRenderContext * renderContext()
Returns the render context associated with the renderer.
void stopRender(QgsRenderContext &context) override
Must be called when a render cycle has finished, to allow the renderer to clean up.
bool mReadyToCompose
The flag must be set to false in renderer's constructor if wants to use the smarter map redraws funct...
void setSimplifyHints(SimplifyHints simplifyHints)
Sets the simplification hints of the vector layer managed.
QgsFeatureRequest & setSubsetOfAttributes(const QgsAttributeList &attrs)
Set a subset of attributes that will be fetched.
Abstract base class for all rendered symbols.
QgsSymbolLayer * symbolLayer(int layer)
Returns the symbol layer at the specified index.
QgsRectangle intersect(const QgsRectangle &rect) const
Returns the intersection with the given rectangle.
const QgsRectangle & extent() const
When rendering a map layer, calling this method returns the "clipping" extent for the layer (in the l...
An interface for objects which generate feature renderers for vector layers.
@ FullSimplification
All simplification hints can be applied ( Geometry + AA-disabling )
A rectangle specified with double values.
Rule based labeling for a vector layer.
int layer() const
The layer of this symbol level.
virtual void stopRender(QgsRenderContext &context)
Must be called when a render cycle has finished, to allow the renderer to clean up.
QgsFeatureRequest & setExpressionContext(const QgsExpressionContext &context)
Sets the expression context used to evaluate filter expressions.
An interface for classes which provider custom handlers for features rendered as part of a map render...
@ SymbolLevels
Rendering with symbol levels (i.e. implements symbols(), symbolForFeature())
QgsSymbol * symbol() const
The symbol of this symbol level.
Flags flags() const
Returns the flags which affect how features are fetched.
Base class for utility classes that encapsulate information necessary for rendering of map layers.
virtual bool willRenderFeature(const QgsFeature &feature, QgsRenderContext &context) const
Returns whether the renderer will render a feature or not.
QgsFeatureRequest::OrderBy orderBy() const
Gets the order in which features shall be processed by this renderer.
double referenceScale() const
Returns the symbology reference scale.
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...
virtual bool usesEmbeddedSymbols() const
Returns true if the renderer uses embedded symbols for features.
void setFeedback(QgsFeedback *feedback)
Attach a feedback object that can be queried regularly by the expression engine to check if expressio...
QgsFeatureRequest & setFilterRect(const QgsRectangle &rectangle)
Sets the rectangle from which features will be taken.
bool simplifyDrawingCanbeApplied(const QgsRenderContext &renderContext, QgsVectorSimplifyMethod::SimplifyHint simplifyHint) const
Returns whether the VectorLayer can apply the specified simplification hint.
virtual bool prepare(const QgsRenderContext &context, QSet< QString > &attributeNames)
Prepare for registration of features.
bool renderingStopped() const
Returns true if the rendering operation has been stopped and any ongoing rendering should be canceled...
double xMaximum() const SIP_HOLDGIL
Returns the x maximum value (right side of rectangle).
QgsCoordinateTransform coordinateTransform() const
Returns the current coordinate transform for the context.
This class wraps a request for features to a vector layer (or directly its vector data provider).
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...
Custom exception class for Coordinate Reference System related exceptions.
bool useAdvancedEffects() const
Returns true if advanced effects such as blend modes such be used.
QgsFeatureRequest & combineFilterExpression(const QString &expression)
Modifies the existing filter expression to add an additional expression filter.
int renderingPass() const
Specifies the rendering pass in which this symbol layer should be rendered.
QgsMapLayerTemporalProperties * temporalProperties() override
Returns the layer's temporal properties.
static const QgsSettingsEntryString settingsDigitizingMarkerStyle
Settings entry digitizing marker style.
@ DistanceDegrees
Degrees, for planar geographic CRS distance measurements.
@ OptimizeForRendering
Simplify using the map2pixel data to optimize the rendering of geometries.
void setClipFeatureGeometry(const QgsGeometry &geometry)
Sets a geometry to use to clip features to when registering them as diagrams.
QString layerId() const
Gets access to the ID of the layer rendered by this class.
QList< QgsSymbol * > QgsSymbolList
static QPainterPath calculatePainterClipRegion(const QList< QgsMapClippingRegion > ®ions, const QgsRenderContext &context, QgsMapLayerType layerType, bool &shouldClip)
Returns a QPainterPath representing the intersection of clipping regions from context which should be...
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
const QgsFeatureFilterProvider * featureFilterProvider() const
Gets the filter feature provider used for additional filtering of rendered features.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
const QgsAbstractVectorLayerLabeling * labeling() const
Access to const labeling configuration.
virtual QgsSymbolList originalSymbolsForFeature(const QgsFeature &feature, QgsRenderContext &context) const
Equivalent of originalSymbolsForFeature() call extended to support renderers that may use more symbol...
void setTolerance(double tolerance)
Sets the tolerance of simplification in map units. Represents the maximum distance in map units betwe...
void setVectorSimplifyMethod(const QgsVectorSimplifyMethod &simplifyMethod)
Sets the simplification setting to use when rendering vector layers.
const Q_INVOKABLE QgsFeatureIds & selectedFeatureIds() const
Returns a list of the selected features IDs in this layer.
static QgsGeometry calculateLabelIntersectionGeometry(const QList< QgsMapClippingRegion > ®ions, const QgsRenderContext &context, bool &shouldClip)
Returns the geometry representing the intersection of clipping regions from context which should be u...
void setLayer(QgsVectorLayer *layer)
Sets the associated layer.
virtual QgsSymbolList symbols(QgsRenderContext &context) const
Returns list of symbols used by the renderer.
void setTolerance(double tolerance)
Sets the tolerance of simplification in map units. Represents the maximum distance in map units betwe...
void setLayerRenderingTimeHint(int time) override
Sets approximate render time (in ms) for the layer to render.
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::MessageLevel::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
bool usingSymbolLevels() const
virtual QgsSymbol * symbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const =0
To be overridden.
float threshold() const
Gets the simplification threshold of the vector layer managed.
bool isEmpty() const
Returns true if the geometry is empty (eg a linestring with no vertices, or a collection with no geom...
void setFeedback(QgsFeedback *feedback)
Attach a feedback object that can be queried regularly by the iterator to check if it should be cance...
virtual void end(QgsRenderContext &context)
Ends interception of paint operations to a render context, and draws the result to the render context...
Encapsulates the context in which a QgsVectorLayer's temporal capabilities will be applied.
@ SkipSymbolRendering
Disable symbol rendering while still drawing labels if enabled (since QGIS 3.24)
double xMinimum() const SIP_HOLDGIL
Returns the x minimum value (left side of rectangle).
QgsFeatureRequest & setSimplifyMethod(const QgsSimplifyMethod &simplifyMethod)
Set a simplification method for geometries that will be fetched.
Scoped object for saving and restoring a QPainter object's state.
virtual void modifyRequestExtent(QgsRectangle &extent, QgsRenderContext &context)
Allows for a renderer to modify the extent of a feature request prior to rendering.
QgsFeatureRequest & setNoAttributes()
Set that no attributes will be fetched.
static QgsGeometry calculateFeatureRequestGeometry(const QList< QgsMapClippingRegion > ®ions, const QgsRenderContext &context, bool &shouldFilter)
Returns the geometry representing the intersection of clipping regions from context.
const QgsAbstractGeometry * constGet() const SIP_HOLDGIL
Returns a non-modifiable (const) reference to the underlying abstract geometry primitive.
bool forceRasterRender() const override
Returns true if the renderer must be rendered to a raster paint device (e.g.
bool forceLocalOptimization() const
Gets where the simplification executes, after fetch the geometries from provider, or when supported,...
Single scope for storing variables and functions for use within a QgsExpressionContext....
const QgsVectorSimplifyMethod & simplifyMethod() const
Returns the simplification settings for fast rendering of features.
const QgsVectorSimplifyMethod & vectorSimplifyMethod() const
Returns the simplification settings to use when rendering vector layers.
void setForceLocalOptimization(bool localOptimization)
Sets whether the simplification executes after fetch the geometries from provider,...
The QgsLabelingEngine class provides map labeling functionality. The input for the engine is a list o...
QString toString(int precision=16) const
Returns a string representation of form xmin,ymin : xmax,ymax Coordinates will be truncated to the sp...
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
A class to represent a 2D point.
virtual QgsVectorLayerLabelProvider * provider(QgsVectorLayer *layer) const
Factory for label provider implementation.
QColor selectionColor() const
Returns the color to use when rendering selected features.
QgsLabelingEngine * labelingEngine() const
Gets access to new labeling engine (may be nullptr).
static QgsGeometryEngine * createGeometryEngine(const QgsAbstractGeometry *geometry)
Creates and returns a new geometry engine representing the specified geometry.
QgsUnitTypes::DistanceUnit mapUnits
static const QgsSettingsEntryDouble settingsDigitizingMarkerSizeMm
Settings entry digitizing marker size mm.
double yMaximum() const SIP_HOLDGIL
Returns the y maximum value (top side of rectangle).
void startRender(QgsRenderContext &context, const QgsFields &fields) override
Must be called when a new render cycle is started.
static QgsExpressionContextScope * updateSymbolScope(const QgsSymbol *symbol, QgsExpressionContextScope *symbolScope=nullptr)
Updates a symbol scope related to a QgsSymbol to an expression context.
bool nextFeature(QgsFeature &f)
T value(const QString &dynamicKeyPart=QString()) const
Returns settings value.
A geometry is the spatial representation of a feature.
Perform transforms between map coordinates and device coordinates.
Represents a vector layer which manages a vector based data sets.
bool hasGeometry() const
Returns true if the feature has an associated geometry.
bool orderByEnabled() const
Returns whether custom ordering will be applied before features are processed by this renderer.
Implements a derived label provider for use with QgsLabelSink.
Partial snapshot of vector layer's state (only the members necessary for access to features)
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.
QHash< QgsFeatureId, QVector< Feature > > features
void setMethodType(MethodType methodType)
Sets the simplification type.
QList< QgsSymbolLevel > QgsSymbolLevelOrder
Abstract interface for use by classes that filter the features or attributes of a layer.
virtual QList< QgsLabelFeature * > 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.
QgsFeatureRequest & setOrderBy(const OrderBy &orderBy)
Set a list of order by clauses.
QgsRectangle boundingBox() const
Returns the bounding box of the geometry.
SimplifyHints simplifyHints() const
Gets the simplification hints of the vector layer managed.
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.
virtual QString dump() const
Returns debug information about this renderer.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
QList< const QgsFeatureRendererGenerator * > featureRendererGenerators() const
Returns a list of the feature renderer generators owned by the layer.
void setInterruptionChecker(QgsFeedback *interruptionChecker)
Attach an object that can be queried regularly by the iterator to check if it must stopped.
void setSymbologyReferenceScale(double scale)
Sets the symbology reference scale.
@ EmbeddedSymbols
Retrieve any embedded feature symbology (since QGIS 3.20)
QgsPaintEffect * paintEffect() const
Returns the current paint effect for the renderer.
virtual bool prepare(QgsRenderContext &context, QSet< QString > &attributeNames)
Prepare for registration of features.
static constexpr int MAX_TIME_TO_USE_CACHED_PREVIEW_IMAGE
Maximum time (in ms) to allow display of a previously cached preview image while rendering layers,...
QPainter * painter()
Returns the destination QPainter for the render operation.
bool enabled() const
Returns whether the effect is enabled.
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.
QgsSymbol * symbol() const
Returns the symbol which will be rendered for every feature.
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)
Must be called when a new render cycle is started.
QgsWkbTypes::GeometryType type
void setVertexMarkerAppearance(Qgis::VertexMarkerType type, double size)
Sets type and size of editing vertex markers for subsequent rendering.
Wrapper for iterator of features from vector data provider or vector layer.
Q_INVOKABLE QgsWkbTypes::GeometryType geometryType() const
Returns point, line or polygon.
bool isEmpty() const
Returns true if the rectangle is empty.
@ UseAdvancedEffects
Enable layer opacity and blending effects.
void setColor(const QColor &color) const
Sets the color for the symbol.
QgsFeedback * feedback() const override
Access to feedback object of the layer renderer (may be nullptr)
QgsFeatureRequest & setFlags(QgsFeatureRequest::Flags flags)
Sets flags that affect how features will be fetched.
static const QgsSettingsEntryBool settingsDigitizingMarkerOnlyForSelected
Settings entry digitizing marker only for selected.
@ GeometrySimplification
The geometries can be simplified using the current map2pixel context state.
bool isValid() const
Will return if this iterator is valid.
bool render() override
Do the rendering (based on data stored in the class).
virtual QgsPalLayerSettings settings(const QString &providerId=QString()) const =0
Gets associated label settings.
bool labelsEnabled() const
Returns whether the layer contains labels which are enabled and should be drawn.
int symbolLayerCount() const
Returns the total number of symbol layers contained in the symbol.
~QgsVectorLayerRenderer() override
T value(const QString &dynamicKeyPart=QString()) const
Returns settings value.
void setFeature(const QgsFeature &feature)
Convenience function for setting a feature for the context.
QgsFeatureRenderer * renderer()
Returns the feature renderer used for rendering the features in the layer in 2D map views.