QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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"
22 
23 class QgsVectorTileLayer;
26 
27 #include "qgsvectortilerenderer.h"
28 #include "qgsmapclippingregion.h"
29 
42 {
43  public:
46 
47  virtual bool render() override;
48  virtual QgsFeedback *feedback() const override { return mFeedback.get(); }
49 
50  private:
51  void decodeAndDrawTile( const QgsVectorTileRawData &rawTile );
52 
53  // data coming from the vector tile layer
54 
56  QString mSourceType;
58  QString mSourcePath;
59 
60  QString mAuthCfg;
61  QString mReferer;
62 
64  int mSourceMinZoom = -1;
66  int mSourceMaxZoom = -1;
68  std::unique_ptr<QgsVectorTileRenderer> mRenderer;
69 
74  QgsVectorTileLabelProvider *mLabelProvider = nullptr;
75 
77  bool mDrawTileBoundaries = false;
78 
79  // temporary data used during rendering process
80 
82  std::unique_ptr<QgsFeedback> mFeedback;
84  int mTileZoom = 0;
86  QgsTileMatrix mTileMatrix;
88  QgsTileRange mTileRange;
90  QMap<QString, QgsFields> mPerLayerFields;
91 
93  QSet< QString > mRequiredLayers;
94 
96  int mTotalDecodeTime = 0;
98  int mTotalDrawTime = 0;
99 
100  QList< QgsMapClippingRegion > mClippingRegions;
101 };
102 
103 
104 #endif // QGSVECTORTILELAYERRENDERER_H
qgsvectortilerenderer.h
QgsVectorTileLayer
Implements a map layer that is dedicated to rendering of vector tiles.
Definition: qgsvectortilelayer.h:84
QgsTileRange
Range of tiles in a tile matrix to be rendered.
Definition: qgstiles.h:66
QgsVectorTileLayerRenderer::feedback
virtual QgsFeedback * feedback() const override
Access to feedback object of the layer renderer (may be nullptr)
Definition: qgsvectortilelayerrenderer.h:48
QgsVectorTileLabelProvider
Internal base class for implementation of label providers for vector tile labeling.
Definition: qgsvectortilelabeling.h:34
QgsVectorTileLayerRenderer::QgsVectorTileLayerRenderer
QgsVectorTileLayerRenderer(QgsVectorTileLayer *layer, QgsRenderContext &context)
Creates the renderer. Always called from main thread, should copy whatever necessary from the layer.
Definition: qgsvectortilelayerrenderer.cpp:33
QgsRenderContext
Contains information about the context of a rendering operation.
Definition: qgsrendercontext.h:58
QgsVectorTileLayerRenderer
This class provides map rendering functionality for vector tile layers.
Definition: qgsvectortilelayerrenderer.h:42
QgsMapLayerRenderer
Base class for utility classes that encapsulate information necessary for rendering of map layers.
Definition: qgsmaplayerrenderer.h:51
QgsTileMatrix
Defines a matrix of tiles for a single zoom level: it is defined by its size (width * height) and map...
Definition: qgstiles.h:103
QgsFeedback
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition: qgsfeedback.h:44
qgsmaplayerrenderer.h
QgsVectorTileRawData
Keeps track of raw tile data that need to be decoded.
Definition: qgsvectortileloader.h:32
qgsmapclippingregion.h
QgsVectorTileLayerRenderer::render
virtual bool render() override
Do the rendering (based on data stored in the class)
Definition: qgsvectortilelayerrenderer.cpp:64