QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
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;
143 void setStyles(
const QList<QgsVectorTileBasicRendererStyle> &styles );
145 QList<QgsVectorTileBasicRendererStyle> styles()
const;
152 static QList<QgsVectorTileBasicRendererStyle> simpleStyle(
153 const QColor &polygonFillColor,
const QColor &polygonStrokeColor,
double polygonStrokeWidth,
154 const QColor &lineStrokeColor,
double lineStrokeWidth,
155 const QColor &pointFillColor,
const QColor &pointStrokeColor,
double pointSize );
158 static QList<QgsVectorTileBasicRendererStyle> simpleStyleWithRandomColors();
161 void setDefaultStyle();
165 QList<QgsVectorTileBasicRendererStyle> mStyles;
170 QMap<QString, QSet<QString> > mRequiredFields;
174 #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.
virtual void stopRender(QgsRenderContext &context)=0
Finishes rendering and cleans up any resources.
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)
int maxZoomLevel() const
Returns maxnimum zoom level index (negative number means no limit)
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)
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)
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.
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.
void setGeometryType(QgsWkbTypes::GeometryType geomType)
Sets type of the geometry that will be used (point / line / polygon)