QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
Public Member Functions | List of all members
QgsVectorTileRenderer Class Referenceabstract

Abstract base class for all vector tile renderer implementations. More...

#include <qgsvectortilerenderer.h>

Inheritance diagram for QgsVectorTileRenderer:
Inheritance graph
[legend]

Public Member Functions

virtual ~QgsVectorTileRenderer ()=default
 
virtual QgsVectorTileRendererclone () const =0
 Returns a clone of the renderer. More...
 
virtual void readXml (const QDomElement &elem, const QgsReadWriteContext &context)=0
 Reads renderer's properties from given XML element. More...
 
virtual void renderSelectedFeatures (const QList< QgsFeature > &selection, QgsRenderContext &context)=0
 Renders the specified features in a selected state. More...
 
virtual void renderTile (const QgsVectorTileRendererData &tile, QgsRenderContext &context)=0
 Renders given vector tile. Must be called between startRender/stopRender. More...
 
virtual QSet< QString > requiredLayers (QgsRenderContext &context, int tileZoom) const
 Returns a list of the layers required for rendering. More...
 
virtual void resolveReferences (const QgsProject &project)
 Resolves references to other objects - second phase of loading - after readXml() More...
 
virtual void startRender (QgsRenderContext &context, int tileZoom, const QgsTileRange &tileRange)=0
 Initializes rendering. It should be paired with a stopRender() call. More...
 
virtual void stopRender (QgsRenderContext &context)=0
 Finishes rendering and cleans up any resources. More...
 
virtual QString type () const =0
 Returns unique type name of the renderer implementation. More...
 
virtual QMap< QString, QSet< QString > > usedAttributes (const QgsRenderContext &)
 Returns field names of sub-layers that will be used for rendering. Must be called between startRender/stopRender. More...
 
virtual bool willRenderFeature (const QgsFeature &feature, int tileZoom, const QString &layerName, QgsRenderContext &context)=0
 Returns true if the specified feature will be rendered in the given render context. More...
 
virtual void writeXml (QDomElement &elem, const QgsReadWriteContext &context) const =0
 Writes renderer's properties to given XML element. More...
 

Detailed Description

Abstract base class for all vector tile renderer implementations.

For rendering it is expected that client code calls:

startRender() to prepare renderer

renderTile() for each tile

stopRender() to clean up renderer and free resources

Since
QGIS 3.14

Definition at line 92 of file qgsvectortilerenderer.h.

Constructor & Destructor Documentation

◆ ~QgsVectorTileRenderer()

virtual QgsVectorTileRenderer::~QgsVectorTileRenderer ( )
virtualdefault

Member Function Documentation

◆ clone()

virtual QgsVectorTileRenderer * QgsVectorTileRenderer::clone ( ) const
pure virtual

Returns a clone of the renderer.

Implemented in QgsVectorTileBasicRenderer.

◆ readXml()

virtual void QgsVectorTileRenderer::readXml ( const QDomElement &  elem,
const QgsReadWriteContext context 
)
pure virtual

Reads renderer's properties from given XML element.

Implemented in QgsVectorTileBasicRenderer.

◆ renderSelectedFeatures()

virtual void QgsVectorTileRenderer::renderSelectedFeatures ( const QList< QgsFeature > &  selection,
QgsRenderContext context 
)
pure virtual

Renders the specified features in a selected state.

This will be called after rendering the tiles, so that the selected features are always visible on the top of the layer.

Since
QGIS 3.28

Implemented in QgsVectorTileBasicRenderer.

◆ renderTile()

virtual void QgsVectorTileRenderer::renderTile ( const QgsVectorTileRendererData tile,
QgsRenderContext context 
)
pure virtual

Renders given vector tile. Must be called between startRender/stopRender.

Implemented in QgsVectorTileBasicRenderer.

◆ requiredLayers()

virtual QSet< QString > QgsVectorTileRenderer::requiredLayers ( QgsRenderContext context,
int  tileZoom 
) const
inlinevirtual

Returns a list of the layers required for rendering.

Only layers which are visible at the specified tileZoom should be included in this list.

An empty string present in the list indicates that all layer in the tiles are required.

Since
QGIS 3.16

Reimplemented in QgsVectorTileBasicRenderer.

Definition at line 133 of file qgsvectortilerenderer.h.

◆ resolveReferences()

virtual void QgsVectorTileRenderer::resolveReferences ( const QgsProject project)
inlinevirtual

Resolves references to other objects - second phase of loading - after readXml()

Definition at line 162 of file qgsvectortilerenderer.h.

◆ startRender()

virtual void QgsVectorTileRenderer::startRender ( QgsRenderContext context,
int  tileZoom,
const QgsTileRange tileRange 
)
pure virtual

Initializes rendering. It should be paired with a stopRender() call.

Implemented in QgsVectorTileBasicRenderer.

◆ stopRender()

virtual void QgsVectorTileRenderer::stopRender ( QgsRenderContext context)
pure virtual

Finishes rendering and cleans up any resources.

Implemented in QgsVectorTileBasicRenderer.

◆ type()

virtual QString QgsVectorTileRenderer::type ( ) const
pure virtual

Returns unique type name of the renderer implementation.

Implemented in QgsVectorTileBasicRenderer.

◆ usedAttributes()

virtual QMap< QString, QSet< QString > > QgsVectorTileRenderer::usedAttributes ( const QgsRenderContext )
inlinevirtual

Returns field names of sub-layers that will be used for rendering. Must be called between startRender/stopRender.

Reimplemented in QgsVectorTileBasicRenderer.

Definition at line 120 of file qgsvectortilerenderer.h.

◆ willRenderFeature()

virtual bool QgsVectorTileRenderer::willRenderFeature ( const QgsFeature feature,
int  tileZoom,
const QString &  layerName,
QgsRenderContext context 
)
pure virtual

Returns true if the specified feature will be rendered in the given render context.

Since
QGIS 3.28

Implemented in QgsVectorTileBasicRenderer.

◆ writeXml()

virtual void QgsVectorTileRenderer::writeXml ( QDomElement &  elem,
const QgsReadWriteContext context 
) const
pure virtual

Writes renderer's properties to given XML element.

Implemented in QgsVectorTileBasicRenderer.


The documentation for this class was generated from the following file: