File: qgsprofilerenderer.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 (206 lines) | stat: -rw-r--r-- 6,895 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
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/elevation/qgsprofilerenderer.h                              *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/





class QgsProfilePlotRenderer : QObject
{
%Docstring(signature="appended")
Generates and renders elevation profile plots.

This class has two roles:

1. Extraction and generation of the raw elevation profiles from a list of :py:class:`QgsAbstractProfileSource` objects.
2. Rendering the results

Step 1, involving the generation of the elevation profiles only needs to
occur once. This is done via a call to :py:func:`~startGeneration`,
which commences generation of the profiles from each source in a
separate background thread. When the generation is completed for all
sources the :py:func:`~generationFinished` signal is emitted.

After the profile is generated, it can be rendered. The rendering step
may be undertaken multiple times (e.g. to render to different image
sizes or data ranges) without having to re-generate the raw profile
data.

.. versionadded:: 3.26
%End

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

    QgsProfilePlotRenderer( const QList< QgsAbstractProfileSource * > &sources,
                            const QgsProfileRequest &request );
%Docstring
Constructor for QgsProfilePlotRenderer, using the provided list of
profile ``sources`` to generate the results.
%End


    ~QgsProfilePlotRenderer();

    QStringList sourceIds() const;
%Docstring
Returns the ordered list of source IDs for the sources used by the
renderer.
%End

    void startGeneration();
%Docstring
Start the generation job and immediately return. Does nothing if the
generation is already in progress.
%End

    void generateSynchronously();
%Docstring
Generate the profile results synchronously in this thread. The function
does not return until the generation is complete.

This is an alternative to ordinary API (using
:py:func:`~QgsProfilePlotRenderer.startGeneration` + waiting for
:py:func:`~QgsProfilePlotRenderer.generationFinished` signal). Users are
discouraged to use this method unless they have a strong reason for
doing it. The synchronous generation blocks the main thread, making the
application unresponsive. Also, it is not possible to cancel generation
while it is in progress.

.. versionadded:: 3.30
%End

    void cancelGeneration();
%Docstring
Stop the generation job - does not return until the job has terminated.
Does nothing if the generation is not active.
%End

    void cancelGenerationWithoutBlocking();
%Docstring
Triggers cancellation of the generation job without blocking. The
generation job will continue to operate until it is able to cancel, at
which stage the :py:func:`~QgsProfilePlotRenderer.generationFinished`
signal will be emitted. Does nothing if the generation is not active.
%End

    void waitForFinished();
%Docstring
Block until the current job has finished.
%End

    bool isActive() const;
%Docstring
Returns ``True`` if the generation job is currently running in
background.
%End

    void setContext( const QgsProfileGenerationContext &context );
%Docstring
Sets the ``context`` in which the profile generation will occur.

Depending on the sources present, this may trigger automatically a
regeneration of results.
%End

    void invalidateAllRefinableSources();
%Docstring
Invalidates previous results from all refinable sources.
%End

    void replaceSource( QgsAbstractProfileSource *source );
%Docstring
Replaces the existing source with matching ID.

The matching stored source will be deleted and replaced with ``source``.
%End

    bool invalidateResults( QgsAbstractProfileSource *source );
%Docstring
Invalidates the profile results from the source with matching ID.

The matching stored source will be deleted and replaced with ``source``.

Returns ``True`` if results were previously stored for the matching
source and have been invalidated.

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

    void regenerateInvalidatedResults();
%Docstring
Starts a background regeneration of any invalidated results and
immediately returns.

Does nothing if the generation is already in progress.

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

    QgsDoubleRange zRange() const;
%Docstring
Returns the limits of the retrieved elevation values.
%End

    QImage renderToImage( int width, int height, double distanceMin, double distanceMax, double zMin, double zMax, const QString &sourceId = QString(), double devicePixelRatio = 1.0 );
%Docstring
Renders a portion of the profile to an image with the given ``width``
and ``height``.

If ``sourceId`` is empty then all sources will be rendered, otherwise
only the matching source will be rendered.
%End

    void render( QgsRenderContext &context, double width, double height, double distanceMin, double distanceMax, double zMin, double zMax, const QString &sourceId = QString() );
%Docstring
Renders a portion of the profile using the specified render ``context``.

If ``sourceId`` is empty then all sources will be rendered, otherwise
only the matching source will be rendered.
%End

    QgsProfileSnapResult snapPoint( const QgsProfilePoint &point, const QgsProfileSnapContext &context );
%Docstring
Snap a ``point`` to the results.
%End

    QVector<QgsProfileIdentifyResults> identify( const QgsProfilePoint &point, const QgsProfileIdentifyContext &context );
%Docstring
Identify results visible at the specified profile ``point``.
%End

    QVector<QgsProfileIdentifyResults> identify( const QgsDoubleRange &distanceRange, const QgsDoubleRange &elevationRange, const QgsProfileIdentifyContext &context );
%Docstring
Identify results visible within the specified ranges.
%End

    QVector< QgsAbstractProfileResults::Feature > asFeatures( Qgis::ProfileExportType type, QgsFeedback *feedback = 0 );
%Docstring
Exports the profile results as a set of features.

.. versionadded:: 3.32
%End

  signals:

    void generationFinished();
%Docstring
Emitted when the profile generation is finished (or canceled).
%End

};

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