QGIS API Documentation  3.27.0-Master (0e23467727)
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 #include "qgshttpheaders.h"
30 #include "qgsvectortilematrixset.h"
31 
44 {
45  public:
48 
49  virtual bool render() override;
50  virtual QgsFeedback *feedback() const override { return mFeedback.get(); }
51  bool forceRasterRender() const override;
52 
53  private:
54  void decodeAndDrawTile( const QgsVectorTileRawData &rawTile );
55 
56  // data coming from the vector tile layer
57 
59  QString mSourceType;
61  QString mSourcePath;
62 
63  QString mAuthCfg;
64  QgsHttpHeaders mHeaders;
65 
67  std::unique_ptr<QgsVectorTileRenderer> mRenderer;
68 
73  QgsVectorTileLabelProvider *mLabelProvider = nullptr;
74 
76  bool mDrawTileBoundaries = false;
77 
78  // temporary data used during rendering process
79 
81  std::unique_ptr<QgsFeedback> mFeedback;
83  int mTileZoom = 0;
85  QgsTileMatrix mTileMatrix;
87  QgsTileRange mTileRange;
89  QMap<QString, QgsFields> mPerLayerFields;
90 
92  QSet< QString > mRequiredLayers;
93 
95  int mTotalDecodeTime = 0;
97  int mTotalDrawTime = 0;
98 
99  QList< QgsMapClippingRegion > mClippingRegions;
100  double mLayerOpacity = 1.0;
101 
102  QgsVectorTileMatrixSet mTileMatrixSet;
103 
104 };
105 
106 
107 #endif // QGSVECTORTILELAYERRENDERER_H
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition: qgsfeedback.h:45
This class implements simple http header management.
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:108
Range of tiles in a tile matrix to be rendered.
Definition: qgstiles.h:71
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.
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.