QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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 
41 {
42  public:
45 
46  virtual bool render() override;
47  virtual QgsFeedback *feedback() const override { return mFeedback.get(); }
48 
49  private:
50  void decodeAndDrawTile( const QgsVectorTileRawData &rawTile );
51 
52  // data coming from the vector tile layer
53 
55  QString mSourceType;
57  QString mSourcePath;
59  int mSourceMinZoom = -1;
61  int mSourceMaxZoom = -1;
63  std::unique_ptr<QgsVectorTileRenderer> mRenderer;
64 
69  QgsVectorTileLabelProvider *mLabelProvider = nullptr;
70 
72  bool mDrawTileBoundaries = false;
73 
74  // temporary data used during rendering process
75 
77  std::unique_ptr<QgsFeedback> mFeedback;
79  int mTileZoom = 0;
81  QgsTileMatrix mTileMatrix;
83  QgsTileRange mTileRange;
85  QMap<QString, QgsFields> mPerLayerFields;
87  int mTotalDecodeTime = 0;
89  int mTotalDrawTime = 0;
90 };
91 
92 
93 #endif // QGSVECTORTILELAYERRENDERER_H
qgsvectortilerenderer.h
QgsVectorTileLayer
Definition: qgsvectortilelayer.h:83
QgsTileRange
Definition: qgstiles.h:65
QgsVectorTileLayerRenderer::feedback
virtual QgsFeedback * feedback() const override
Access to feedback object of the layer renderer (may be nullptr)
Definition: qgsvectortilelayerrenderer.h:47
QgsVectorTileLabelProvider
Definition: qgsvectortilelabeling.h:33
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
Definition: qgsrendercontext.h:57
QgsVectorTileLayerRenderer
Definition: qgsvectortilelayerrenderer.h:40
QgsMapLayerRenderer
Definition: qgsmaplayerrenderer.h:50
QgsTileMatrix
Definition: qgstiles.h:102
QgsFeedback
Definition: qgsfeedback.h:43
qgsmaplayerrenderer.h
QgsVectorTileRawData
Definition: qgsvectortileloader.h:31
QgsVectorTileLayerRenderer::render
virtual bool render() override
Do the rendering (based on data stored in the class)
Definition: qgsvectortilelayerrenderer.cpp:58