QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
qgsvectortilelayerrenderer.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsvectortilelayerrenderer.h
3 --------------------------------------
4 Date : March 2020
5 Copyright : (C) 2020 by Martin Dobias
6 Email : wonder dot sk at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSVECTORTILELAYERRENDERER_H
17#define QGSVECTORTILELAYERRENDERER_H
18
19#define SIP_NO_FILE
20
21#include "qgsmaplayerrenderer.h"
25
30
31
44{
45 public:
49
50 virtual bool render() override;
51 virtual QgsFeedback *feedback() const override { return mFeedback.get(); }
52 bool forceRasterRender() const override;
53
54 private:
55 void decodeAndDrawTile( const QgsVectorTileRawData &rawTile );
56
57 // data coming from the vector tile layer
58
59 QString mLayerName;
60
61 std::unique_ptr< QgsVectorTileDataProvider > mDataProvider;
62
64 std::unique_ptr<QgsVectorTileRenderer> mRenderer;
65
70 QgsVectorTileLabelProvider *mLabelProvider = nullptr;
71
73 bool mDrawTileBoundaries = false;
74
76 bool mLabelsEnabled = true;
77
78 // temporary data used during rendering process
79
81 std::unique_ptr<QgsFeedback> mFeedback;
83 int mTileZoomToFetch = 0;
85 int mTileZoomToRender = 0;
86
88 QgsTileMatrix mTileMatrix;
90 QgsTileRange mTileRange;
92 QMap<QString, QgsFields> mPerLayerFields;
93
95 QSet< QString > mRequiredLayers;
96
98 QList< QgsFeature > mSelectedFeatures;
99
101 int mTotalDecodeTime = 0;
103 int mTotalDrawTime = 0;
104
105 QList< QgsMapClippingRegion > mClippingRegions;
106 double mLayerOpacity = 1.0;
107
108 QgsVectorTileMatrixSet mTileMatrixSet;
109
110 bool mEnableProfile = false;
111 quint64 mPreparationTime = 0;
112
113};
114
115
116#endif // QGSVECTORTILELAYERRENDERER_H
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition: qgsfeedback.h:44
Base class for utility classes that encapsulate information necessary for rendering of map layers.
Contains information about the context of a rendering operation.
Defines a matrix of tiles for a single zoom level: it is defined by its size (width *.
Definition: qgstiles.h:134
Range of tiles in a tile matrix to be rendered.
Definition: qgstiles.h:97
Base class for vector tile layer data providers.
Internal base class for implementation of label providers for vector tile labeling.
This class provides map rendering functionality for vector tile layers.
bool forceRasterRender() const override
Returns true if the renderer must be rendered to a raster paint device (e.g.
~QgsVectorTileLayerRenderer() override
QgsVectorTileLayerRenderer(QgsVectorTileLayer *layer, QgsRenderContext &context)
Creates the renderer. Always called from main thread, should copy whatever necessary from the layer.
virtual QgsFeedback * feedback() const override
Access to feedback object of the layer renderer (may be nullptr)
virtual bool render() override
Do the rendering (based on data stored in the class).
Implements a map layer that is dedicated to rendering of vector tiles.
Encapsulates properties of a vector tile matrix set, including tile origins and scaling information.
Keeps track of raw tile data that need to be decoded.