QGIS API Documentation
3.22.4-Białowieża (ce8e65e95e)
|
The default vector tile renderer implementation. More...
#include <qgsvectortilebasicrenderer.h>
Public Member Functions | |
QgsVectorTileBasicRenderer () | |
Constructs renderer with no styles. More... | |
QgsVectorTileBasicRenderer * | clone () const override |
Returns a clone of the renderer. More... | |
void | readXml (const QDomElement &elem, const QgsReadWriteContext &context) override |
Reads renderer's properties from given XML element. More... | |
void | renderTile (const QgsVectorTileRendererData &tile, QgsRenderContext &context) override |
Renders given vector tile. Must be called between startRender/stopRender. More... | |
QSet< QString > | requiredLayers (QgsRenderContext &context, int tileZoom) const override |
Returns a list of the layers required for rendering. More... | |
void | setStyle (int index, const QgsVectorTileBasicRendererStyle &style) |
Updates style definition at the paricular index of the list (the index must be in interval [0,N-1] otherwise this function does nothing) More... | |
void | setStyles (const QList< QgsVectorTileBasicRendererStyle > &styles) |
Sets list of styles of the renderer. More... | |
void | startRender (QgsRenderContext &context, int tileZoom, const QgsTileRange &tileRange) override |
Initializes rendering. It should be paired with a stopRender() call. More... | |
void | stopRender (QgsRenderContext &context) override |
Finishes rendering and cleans up any resources. More... | |
QgsVectorTileBasicRendererStyle | style (int index) const |
Returns style definition at the particular index. More... | |
QList< QgsVectorTileBasicRendererStyle > | styles () const |
Returns list of styles of the renderer. More... | |
QString | type () const override |
Returns unique type name of the renderer implementation. More... | |
QMap< QString, QSet< QString > > | usedAttributes (const QgsRenderContext &) override |
Returns field names of sub-layers that will be used for rendering. Must be called between startRender/stopRender. More... | |
void | writeXml (QDomElement &elem, const QgsReadWriteContext &context) const override |
Writes renderer's properties to given XML element. More... | |
Public Member Functions inherited from QgsVectorTileRenderer | |
virtual | ~QgsVectorTileRenderer ()=default |
virtual void | resolveReferences (const QgsProject &project) |
Resolves references to other objects - second phase of loading - after readXml() More... | |
Static Public Member Functions | |
static QList< QgsVectorTileBasicRendererStyle > | simpleStyle (const QColor &polygonFillColor, const QColor &polygonStrokeColor, double polygonStrokeWidth, const QColor &lineStrokeColor, double lineStrokeWidth, const QColor &pointFillColor, const QColor &pointStrokeColor, double pointSize) |
Returns a list of styles to render all layers with the given fill/stroke colors, stroke widths and marker sizes. More... | |
static QList< QgsVectorTileBasicRendererStyle > | simpleStyleWithRandomColors () |
Returns a list of styles to render all layers, using random colors. More... | |
The default vector tile renderer implementation.
It has an ordered list of "styles", each defines a rendering rule.
Definition at line 127 of file qgsvectortilebasicrenderer.h.
QgsVectorTileBasicRenderer::QgsVectorTileBasicRenderer | ( | ) |
Constructs renderer with no styles.
Definition at line 104 of file qgsvectortilebasicrenderer.cpp.
|
overridevirtual |
Returns a clone of the renderer.
Implements QgsVectorTileRenderer.
Definition at line 113 of file qgsvectortilebasicrenderer.cpp.
|
overridevirtual |
Reads renderer's properties from given XML element.
Implements QgsVectorTileRenderer.
Definition at line 277 of file qgsvectortilebasicrenderer.cpp.
|
overridevirtual |
Renders given vector tile. Must be called between startRender/stopRender.
Implements QgsVectorTileRenderer.
Definition at line 166 of file qgsvectortilebasicrenderer.cpp.
|
overridevirtual |
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.
Reimplemented from QgsVectorTileRenderer.
Definition at line 148 of file qgsvectortilebasicrenderer.cpp.
|
inline |
Updates style definition at the paricular index of the list (the index must be in interval [0,N-1] otherwise this function does nothing)
Definition at line 148 of file qgsvectortilebasicrenderer.h.
void QgsVectorTileBasicRenderer::setStyles | ( | const QList< QgsVectorTileBasicRendererStyle > & | styles | ) |
Sets list of styles of the renderer.
Definition at line 292 of file qgsvectortilebasicrenderer.cpp.
|
static |
Returns a list of styles to render all layers with the given fill/stroke colors, stroke widths and marker sizes.
Definition at line 322 of file qgsvectortilebasicrenderer.cpp.
|
static |
Returns a list of styles to render all layers, using random colors.
Definition at line 302 of file qgsvectortilebasicrenderer.cpp.
|
overridevirtual |
Initializes rendering. It should be paired with a stopRender() call.
Implements QgsVectorTileRenderer.
Definition at line 121 of file qgsvectortilebasicrenderer.cpp.
|
overridevirtual |
Finishes rendering and cleans up any resources.
Implements QgsVectorTileRenderer.
Definition at line 161 of file qgsvectortilebasicrenderer.cpp.
|
inline |
Returns style definition at the particular index.
Definition at line 150 of file qgsvectortilebasicrenderer.h.
QList< QgsVectorTileBasicRendererStyle > QgsVectorTileBasicRenderer::styles | ( | ) | const |
Returns list of styles of the renderer.
Definition at line 297 of file qgsvectortilebasicrenderer.cpp.
|
overridevirtual |
Returns unique type name of the renderer implementation.
Implements QgsVectorTileRenderer.
Definition at line 108 of file qgsvectortilebasicrenderer.cpp.
|
overridevirtual |
Returns field names of sub-layers that will be used for rendering. Must be called between startRender/stopRender.
Reimplemented from QgsVectorTileRenderer.
Definition at line 143 of file qgsvectortilebasicrenderer.cpp.
|
overridevirtual |
Writes renderer's properties to given XML element.
Implements QgsVectorTileRenderer.
Definition at line 264 of file qgsvectortilebasicrenderer.cpp.