1/************************************************************************
2 * This file has been generated automatically from                      *
3 *                                                                      *
4 * src/core/vectortile/qgsvectortilerenderer.h                          *
5 *                                                                      *
6 * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
7 ************************************************************************/
8
9
10
11
12
13
14
15class QgsVectorTileRendererData
16{
17%Docstring
18Contains decoded features of a single vector tile and any other data necessary
19for rendering of it.
20
21.. versionadded:: 3.14
22%End
23
24%TypeHeaderCode
25#include "qgsvectortilerenderer.h"
26%End
27  public:
28    explicit QgsVectorTileRendererData( QgsTileXYZ id );
29%Docstring
30Constructs the object
31%End
32
33    QgsTileXYZ id() const;
34%Docstring
35Returns coordinates of the tile
36%End
37
38    void setTilePolygon( QPolygon polygon );
39%Docstring
40Sets polygon of the tile
41%End
42    QPolygon tilePolygon() const;
43%Docstring
44Returns polygon (made out of four corners of the tile) in screen coordinates calculated from render context
45%End
46
47    void setFields( const QMap<QString, QgsFields> &fields );
48%Docstring
49Sets per-layer fields
50%End
51    QMap<QString, QgsFields> fields() const;
52%Docstring
53Returns per-layer fields
54%End
55
56    QStringList layers() const;
57%Docstring
58Returns list of layer names present in the tile
59%End
60    QVector<QgsFeature> layerFeatures( const QString &layerName ) const;
61%Docstring
62Returns list of all features within a single sub-layer
63%End
64
65};
66
67class QgsVectorTileRenderer
68{
69%Docstring
70Abstract base class for all vector tile renderer implementations.
71
72For rendering it is expected that client code calls:
73
74# :py:func:`~QgsVectorTileRendererData.startRender` to prepare renderer
75# :py:func:`~QgsVectorTileRendererData.renderTile` for each tile
76# :py:func:`~QgsVectorTileRendererData.stopRender` to clean up renderer and free resources
77
78.. versionadded:: 3.14
79%End
80
81%TypeHeaderCode
82#include "qgsvectortilerenderer.h"
83%End
84%ConvertToSubClassCode
85
86    const QString type = sipCpp->type();
87
88    if ( type == QLatin1String( "basic" ) )
89      sipType = sipType_QgsVectorTileBasicRenderer;
90    else
91      sipType = 0;
92%End
93  public:
94    virtual ~QgsVectorTileRenderer();
95
96    virtual QString type() const = 0;
97%Docstring
98Returns unique type name of the renderer implementation
99%End
100
101    virtual QgsVectorTileRenderer *clone() const = 0 /Factory/;
102%Docstring
103Returns a clone of the renderer
104%End
105
106    virtual void startRender( QgsRenderContext &context, int tileZoom, const QgsTileRange &tileRange ) = 0;
107%Docstring
108Initializes rendering. It should be paired with a :py:func:`~QgsVectorTileRenderer.stopRender` call.
109%End
110
111
112
113    virtual QSet< QString > requiredLayers( QgsRenderContext &context, int tileZoom ) const;
114%Docstring
115Returns a list of the layers required for rendering.
116
117Only layers which are visible at the specified ``tileZoom`` should be included in this list.
118
119An empty string present in the list indicates that all layer in the tiles are required.
120
121.. versionadded:: 3.16
122%End
123
124    virtual void stopRender( QgsRenderContext &context ) = 0;
125%Docstring
126Finishes rendering and cleans up any resources
127%End
128
129    virtual void renderTile( const QgsVectorTileRendererData &tile, QgsRenderContext &context ) = 0;
130%Docstring
131Renders given vector tile. Must be called between startRender/stopRender.
132%End
133
134    virtual void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const = 0;
135%Docstring
136Writes renderer's properties to given XML element
137%End
138    virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) = 0;
139%Docstring
140Reads renderer's properties from given XML element
141%End
142    virtual void resolveReferences( const QgsProject &project );
143%Docstring
144Resolves references to other objects - second phase of loading - after :py:func:`~QgsVectorTileRenderer.readXml`
145%End
146
147};
148
149/************************************************************************
150 * This file has been generated automatically from                      *
151 *                                                                      *
152 * src/core/vectortile/qgsvectortilerenderer.h                          *
153 *                                                                      *
154 * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
155 ************************************************************************/
156