QGIS API Documentation  3.23.0-Master (eb871beae0)
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  bool forceRasterRender() const override;
50 
51  private:
52  void decodeAndDrawTile( const QgsVectorTileRawData &rawTile );
53 
54  // data coming from the vector tile layer
55 
57  QString mSourceType;
59  QString mSourcePath;
60 
61  QString mAuthCfg;
62  QString mReferer;
63 
65  int mSourceMinZoom = -1;
67  int mSourceMaxZoom = -1;
69  std::unique_ptr<QgsVectorTileRenderer> mRenderer;
70 
75  QgsVectorTileLabelProvider *mLabelProvider = nullptr;
76 
78  bool mDrawTileBoundaries = false;
79 
80  // temporary data used during rendering process
81 
83  std::unique_ptr<QgsFeedback> mFeedback;
85  int mTileZoom = 0;
87  QgsTileMatrix mTileMatrix;
89  QgsTileRange mTileRange;
91  QMap<QString, QgsFields> mPerLayerFields;
92 
94  QSet< QString > mRequiredLayers;
95 
97  int mTotalDecodeTime = 0;
99  int mTotalDrawTime = 0;
100 
101  QList< QgsMapClippingRegion > mClippingRegions;
102  double mLayerOpacity = 1.0;
103 };
104 
105 
106 #endif // QGSVECTORTILELAYERRENDERER_H
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition: qgsfeedback.h:45
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:104
Range of tiles in a tile matrix to be rendered.
Definition: qgstiles.h:67
Internal base class for implementation of label providers for vector tile labeling.
This class provides map rendering functionality for vector tile layers.
virtual QgsFeedback * feedback() const override
Access to feedback object of the layer renderer (may be nullptr)
bool forceRasterRender() const override
Returns true if the renderer must be rendered to a raster paint device (e.g.
QgsVectorTileLayerRenderer(QgsVectorTileLayer *layer, QgsRenderContext &context)
Creates the renderer. Always called from main thread, should copy whatever necessary from the layer.
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.
Keeps track of raw tile data that need to be decoded.