File: qgsterrainprovider.sip.in

package info (click to toggle)
qgis 3.40.11%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,183,800 kB
  • sloc: cpp: 1,595,841; python: 372,637; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 154
file content (314 lines) | stat: -rw-r--r-- 7,959 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/elevation/qgsterrainprovider.h                              *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/





class QgsAbstractTerrainProvider
{
%Docstring(signature="appended")
Abstract base class for terrain providers

.. versionadded:: 3.26
%End

%TypeHeaderCode
#include "qgsterrainprovider.h"
%End
%ConvertToSubClassCode
    if ( sipCpp->type().compare( QLatin1String( "flat" ) ) == 0 )
    {
      sipType = sipType_QgsFlatTerrainProvider;
    }
    else if ( sipCpp->type().compare( QLatin1String( "raster" ) ) == 0 )
    {
      sipType = sipType_QgsRasterDemTerrainProvider;
    }
    else if ( sipCpp->type().compare( QLatin1String( "mesh" ) ) == 0 )
    {
      sipType = sipType_QgsMeshTerrainProvider;
    }
    else
    {
      sipType = 0;
    }
%End
  public:

    virtual ~QgsAbstractTerrainProvider();


    virtual bool equals( const QgsAbstractTerrainProvider *other ) const = 0;
%Docstring
Returns ``True`` if the provider is equal to ``other``.
%End

    virtual void resolveReferences( const QgsProject *project );
%Docstring
Resolves reference to layers from stored layer ID (if it has not been
resolved already)
%End

    virtual bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) = 0;
%Docstring
Reads the terrain provider state from a DOM ``element``.

.. seealso:: :py:func:`writeXml`
%End

    virtual QDomElement writeXml( QDomDocument &document, const QgsReadWriteContext &context ) const = 0;
%Docstring
Returns a DOM element representing the state of the terrain provider.

.. seealso:: :py:func:`readXml`
%End

    virtual QString type() const = 0;
%Docstring
Returns the unique type ID string for the provider.
%End

    virtual QgsAbstractTerrainProvider *clone() const = 0 /Factory/;
%Docstring
Creates a clone of the provider and returns the new object.

Ownership is transferred to the caller.
%End

    virtual void prepare() = 0 /Factory/;
%Docstring
Called on the main thread prior to accessing the provider from a
background thread.

Subclasses must implement suitable logic in order to prepare for
thread-safe calculation of terrain heights on background threads.
%End

    virtual QgsCoordinateReferenceSystem crs() const = 0;
%Docstring
Returns the native coordinate reference system of the terrain provider.
%End

    virtual double heightAt( double x, double y ) const = 0;
%Docstring
Returns the height at the point (x,y) in the terrain provider's native
:py:func:`~QgsAbstractTerrainProvider.crs`.

Returns NaN if the height could not be obtained at the specified point.
%End

    double scale() const;
%Docstring
Returns the vertical scale factor, which can be used to exaggerate
vertical heights.

.. seealso:: :py:func:`setScale`

.. seealso:: :py:func:`offset`
%End

    void setScale( double scale );
%Docstring
Sets the vertical ``scale`` factor, which can be used to exaggerate
vertical heights.

.. seealso:: :py:func:`scale`

.. seealso:: :py:func:`setOffset`
%End

    double offset() const;
%Docstring
Returns the vertical offset value, used for adjusting the heights from
the terrain provider.

.. seealso:: :py:func:`setOffset`

.. seealso:: :py:func:`scale`
%End

    void setOffset( double offset );
%Docstring
Returns the vertical ``offset`` value, used for adjusting the heights
from the terrain provider

.. seealso:: :py:func:`offset`

.. seealso:: :py:func:`setScale`
%End

  protected:

    QgsAbstractTerrainProvider();


    void writeCommonProperties( QDomElement &element, const QgsReadWriteContext &context ) const;
%Docstring
Writes common properties to a DOM ``element``.
%End

    void readCommonProperties( const QDomElement &element, const QgsReadWriteContext &context );
%Docstring
Reads common properties from a DOM ``element``.
%End



  private:
    QgsAbstractTerrainProvider( const QgsAbstractTerrainProvider &other );
};


class QgsFlatTerrainProvider : QgsAbstractTerrainProvider
{
%Docstring(signature="appended")
A terrain provider where the terrain is a simple flat surface.

.. versionadded:: 3.26
%End

%TypeHeaderCode
#include "qgsterrainprovider.h"
%End
  public:

    QgsFlatTerrainProvider();

    virtual QString type() const;

    virtual bool readXml( const QDomElement &element, const QgsReadWriteContext &context );

    virtual QDomElement writeXml( QDomDocument &document, const QgsReadWriteContext &context ) const;

    virtual QgsCoordinateReferenceSystem crs() const;

    virtual double heightAt( double x, double y ) const;

    virtual QgsFlatTerrainProvider *clone() const /Factory/;

    virtual void prepare();

    virtual bool equals( const QgsAbstractTerrainProvider *other ) const;

};

class QgsRasterDemTerrainProvider : QgsAbstractTerrainProvider
{
%Docstring(signature="appended")
A terrain provider where the terrain source is a raster DEM layer.

.. versionadded:: 3.26
%End

%TypeHeaderCode
#include "qgsterrainprovider.h"
%End
  public:

    QgsRasterDemTerrainProvider();


    virtual QString type() const;

    virtual void resolveReferences( const QgsProject *project );

    virtual bool readXml( const QDomElement &element, const QgsReadWriteContext &context );

    virtual QDomElement writeXml( QDomDocument &document, const QgsReadWriteContext &context ) const;

    virtual QgsCoordinateReferenceSystem crs() const;

    virtual double heightAt( double x, double y ) const;

    virtual QgsRasterDemTerrainProvider *clone() const /Factory/;

    virtual bool equals( const QgsAbstractTerrainProvider *other ) const;

    virtual void prepare();


    void setLayer( QgsRasterLayer *layer );
%Docstring
Sets the raster ``layer`` with elevation model to be used as the terrain
source.

.. seealso:: :py:func:`layer`
%End

    QgsRasterLayer *layer() const;
%Docstring
Returns the raster layer with elevation model to be used as the terrain
source.

.. seealso:: :py:func:`layer`
%End


};


class QgsMeshTerrainProvider : QgsAbstractTerrainProvider
{
%Docstring(signature="appended")
A terrain provider that uses the Z values of a mesh layer to build a
terrain surface.

.. versionadded:: 3.26
%End

%TypeHeaderCode
#include "qgsterrainprovider.h"
%End
  public:

    QgsMeshTerrainProvider();


    virtual QString type() const;

    virtual void resolveReferences( const QgsProject *project );

    virtual bool readXml( const QDomElement &element, const QgsReadWriteContext &context );

    virtual QDomElement writeXml( QDomDocument &document, const QgsReadWriteContext &context ) const;

    virtual QgsCoordinateReferenceSystem crs() const;

    virtual double heightAt( double x, double y ) const;

    virtual QgsMeshTerrainProvider *clone() const /Factory/;

    virtual bool equals( const QgsAbstractTerrainProvider *other ) const;

    virtual void prepare();


    void setLayer( QgsMeshLayer *layer );
%Docstring
Sets the mesh ``layer`` to be used as the terrain source.

.. seealso:: :py:func:`layer`
%End

    QgsMeshLayer *layer() const;
%Docstring
Returns the mesh layer to be used as the terrain source.

.. seealso:: :py:func:`layer`
%End

};

/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/elevation/qgsterrainprovider.h                              *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/