QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
16 #ifndef QGSVECTORTILEBASICRENDERER_H
17 #define QGSVECTORTILEBASICRENDERER_H
19 #include "qgis_core.h"
100 return mEnabled && ( mMinZoomLevel == -1 || zoomLevel >= mMinZoomLevel ) && ( mMaxZoomLevel == -1 || zoomLevel <= mMaxZoomLevel );
112 std::unique_ptr<QgsSymbol> mSymbol;
113 bool mEnabled =
true;
115 int mMinZoomLevel = -1;
116 int mMaxZoomLevel = -1;
133 QString
type()
const override;
144 void setStyles(
const QList<QgsVectorTileBasicRendererStyle> &styles );
146 QList<QgsVectorTileBasicRendererStyle> styles()
const;
153 static QList<QgsVectorTileBasicRendererStyle> simpleStyle(
154 const QColor &polygonFillColor,
const QColor &polygonStrokeColor,
double polygonStrokeWidth,
155 const QColor &lineStrokeColor,
double lineStrokeWidth,
156 const QColor &pointFillColor,
const QColor &pointStrokeColor,
double pointSize );
159 static QList<QgsVectorTileBasicRendererStyle> simpleStyleWithRandomColors();
162 void setDefaultStyle();
166 QList<QgsVectorTileBasicRendererStyle> mStyles;
171 QMap<QString, QSet<QString> > mRequiredFields;
175 #endif // QGSVECTORTILEBASICRENDERER_H
virtual QString type() const =0
Returns unique type name of the renderer implementation.
QgsVectorTileBasicRendererStyle style(int index) const
Returns style definition at the particular index.
The class is used as a container of context for various read/write operations on other objects.
virtual void stopRender(QgsRenderContext &context)=0
Finishes rendering and cleans up any resources.
Range of tiles in a tile matrix to be rendered.
void setEnabled(bool enabled)
Sets whether this style is enabled (used for rendering)
bool isEnabled() const
Returns whether this style is enabled (used for rendering)
The default vector tile renderer implementation.
Contains information about the context of a rendering operation.
Contains decoded features of a single vector tile and any other data necessary for rendering of it.
Abstract base class for all rendered symbols.
int maxZoomLevel() const
Returns maxnimum zoom level index (negative number means no limit)
Definition of map rendering of a subset of vector tile data.
bool isActive(int zoomLevel) const
Returns whether the style is active at given zoom level (also checks "enabled" flag)
QString layerName() const
Returns name of the sub-layer to render (empty layer means that all layers match)
QgsWkbTypes::GeometryType geometryType() const
Returns type of the geometry that will be used (point / line / polygon)
Abstract base class for all vector tile renderer implementations.
A marker symbol type, for rendering Point and MultiPoint geometries.
virtual void readXml(const QDomElement &elem, const QgsReadWriteContext &context)=0
Reads renderer's properties from given XML element.
void setFilterExpression(const QString &expr)
Sets filter expression (empty filter means that all features match)
~QgsVectorTileBasicRendererStyle()
A line symbol type, for rendering LineString and MultiLineString geometries.
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...
void setLayerName(const QString &name)
Sets name of the sub-layer to render (empty layer means that all layers match)
int minZoomLevel() const
Returns minimum zoom level index (negative number means no limit)
virtual void renderTile(const QgsVectorTileRendererData &tile, QgsRenderContext &context)=0
Renders given vector tile. Must be called between startRender/stopRender.
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
void setMinZoomLevel(int minZoom)
Sets minimum zoom level index (negative number means no limit)
QgsSymbol * symbol() const
Returns symbol for rendering.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
QString filterExpression() const
Returns filter expression (empty filter means that all features match)
void setMaxZoomLevel(int maxZoom)
Sets maximum zoom level index (negative number means no limit)
virtual QgsVectorTileRenderer * clone() const =0
Returns a clone of the renderer.
virtual void startRender(QgsRenderContext &context, int tileZoom, const QgsTileRange &tileRange)=0
Initializes rendering. It should be paired with a stopRender() call.
void setStyle(int index, const QgsVectorTileBasicRendererStyle &style)
Updates style definition at the paricular index of the list (the index must be in interval [0,...
void setStyleName(const QString &name)
Sets human readable name of this style.
QString styleName() const
Returns human readable name of this style.
virtual void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const =0
Writes renderer's properties to given XML element.
virtual QSet< QString > requiredLayers(QgsRenderContext &context, int tileZoom) const
Returns a list of the layers required for rendering.
void setGeometryType(QgsWkbTypes::GeometryType geomType)
Sets type of the geometry that will be used (point / line / polygon)