16#ifndef QGSVECTORTILEBASICRENDERER_H
17#define QGSVECTORTILEBASICRENDERER_H
143 return mEnabled && ( mMinZoomLevel == -1 || zoomLevel >= mMinZoomLevel ) && ( mMaxZoomLevel == -1 || zoomLevel <= mMaxZoomLevel );
155 std::unique_ptr<QgsSymbol> mSymbol;
156 bool mEnabled =
true;
158 int mMinZoomLevel = -1;
159 int mMaxZoomLevel = -1;
177 QString
type()
const override;
191 void setStyles(
const QList<QgsVectorTileBasicRendererStyle> &
styles );
193 QList<QgsVectorTileBasicRendererStyle>
styles()
const;
200 static QList<QgsVectorTileBasicRendererStyle> simpleStyle(
201 const QColor &polygonFillColor,
const QColor &polygonStrokeColor,
double polygonStrokeWidth,
202 const QColor &lineStrokeColor,
double lineStrokeWidth,
203 const QColor &pointFillColor,
const QColor &pointStrokeColor,
double pointSize );
206 static QList<QgsVectorTileBasicRendererStyle> simpleStyleWithRandomColors();
209 void setDefaultStyle();
213 QList<QgsVectorTileBasicRendererStyle> mStyles;
218 QMap<QString, QSet<QString> > mRequiredFields;
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
A line symbol type, for rendering LineString and MultiLineString geometries.
A marker symbol type, for rendering Point and MultiPoint geometries.
A container for the context for various read/write operations on objects.
Contains information about the context of a rendering operation.
Abstract base class for all rendered symbols.
A range of tiles in a tile matrix.
Definition of map rendering of a subset of vector tile data.
QgsVectorTileBasicRendererStyle(const QString &stName=QString(), const QString &laName=QString(), Qgis::GeometryType geomType=Qgis::GeometryType::Unknown)
Constructs a style object.
~QgsVectorTileBasicRendererStyle()
void setEnabled(bool enabled)
Sets whether this style is enabled (used for rendering).
void setMinZoomLevel(int minZoom)
Sets minimum zoom level index (negative number means no limit).
void setLayerName(const QString &name)
Sets name of the sub-layer to render (empty layer means that all layers match).
Qgis::GeometryType geometryType() const
Returns type of the geometry that will be used (point / line / polygon).
QgsSymbol * symbol() const
Returns symbol for rendering.
QString filterExpression() const
Returns filter expression (empty filter means that all features match).
QString styleName() const
Returns human readable name of this style.
void setFilterExpression(const QString &expr)
Sets filter expression (empty filter means that all features match).
QgsVectorTileBasicRendererStyle & operator=(const QgsVectorTileBasicRendererStyle &other)
void setStyleName(const QString &name)
Sets human readable name of this style.
bool isEnabled() const
Returns whether this style is enabled (used for rendering).
void setMaxZoomLevel(int maxZoom)
Sets maximum zoom level index (negative number means no limit).
int minZoomLevel() const
Returns the minimum zoom level index (negative number means no limit).
int maxZoomLevel() const
Returns the maximum zoom level index (negative number means no limit).
QString layerName() const
Returns name of the sub-layer to render (empty layer means that all layers match).
bool isActive(int zoomLevel) const
Returns whether the style is active at given zoom level (also checks "enabled" flag).
void setGeometryType(Qgis::GeometryType geomType)
Sets type of the geometry that will be used (point / line / polygon).
void renderTile(const QgsVectorTileRendererData &tile, QgsRenderContext &context) override
Renders given vector tile. Must be called between startRender/stopRender.
QList< QgsVectorTileBasicRendererStyle > styles() const
Returns list of styles of the renderer.
void readXml(const QDomElement &elem, const QgsReadWriteContext &context) override
Reads renderer's properties from given XML element.
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...
QgsVectorTileBasicRenderer()
Constructs renderer with no styles.
void renderSelectedFeatures(const QList< QgsFeature > &selection, QgsRenderContext &context) override
Renders the specified features in a selected state.
void setStyles(const QList< QgsVectorTileBasicRendererStyle > &styles)
Sets list of styles of the renderer.
void startRender(QgsRenderContext &context, int tileZoom, const QgsTileRange &tileRange) override
Initializes rendering. It should be paired with a stopRender() call.
QString type() const override
Returns unique type name of the renderer implementation.
bool willRenderFeature(const QgsFeature &feature, int tileZoom, const QString &layerName, QgsRenderContext &context) override
Returns true if the specified feature will be rendered in the given render context.
QgsVectorTileBasicRenderer * clone() const override
Returns a clone of the renderer.
void setStyle(int index, const QgsVectorTileBasicRendererStyle &style)
Updates style definition at the paricular index of the list (the index must be in interval [0,...
QSet< QString > requiredLayers(QgsRenderContext &context, int tileZoom) const override
Returns a list of the layers required for rendering.
void renderBackground(QgsRenderContext &context) override
Renders the background if defined.
QgsVectorTileBasicRendererStyle style(int index) const
Returns style definition at the particular index.
void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const override
Writes renderer's properties to given XML element.
void stopRender(QgsRenderContext &context) override
Finishes rendering and cleans up any resources.
Contains decoded features of a single vector tile and any other data necessary for rendering of it.
Abstract base class for all vector tile renderer implementations.