File: qgscurve.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 (357 lines) | stat: -rw-r--r-- 9,836 bytes parent folder | download | duplicates (6)
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
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/geometry/qgscurve.h                                         *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/





class QgsCurve: QgsAbstractGeometry /Abstract/
{
%Docstring(signature="appended")
Abstract base class for curved geometry type
%End

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

    QgsCurve();

    virtual bool equals( const QgsCurve &other ) const = 0;
%Docstring
Checks whether this curve exactly equals another curve.
%End

    virtual bool operator==( const QgsAbstractGeometry &other ) const;

    virtual bool operator!=( const QgsAbstractGeometry &other ) const;


    virtual QgsCurve *clone() const = 0 /Factory/;


    virtual QgsPoint startPoint() const = 0;
%Docstring
Returns the starting point of the curve.

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

    virtual QgsPoint endPoint() const = 0;
%Docstring
Returns the end point of the curve.

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

    virtual bool isClosed() const /HoldGIL/;
%Docstring
Returns ``True`` if the curve is closed.

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

    virtual bool isClosed2D() const /HoldGIL/;
%Docstring
Returns true if the curve is closed.

Unlike isClosed. It looks only for XY coordinates.

.. seealso:: :py:func:`isClosed`

.. versionadded:: 3.20
%End

    virtual bool isRing() const /HoldGIL/;
%Docstring
Returns ``True`` if the curve is a ring.
%End

    virtual QgsLineString *curveToLine( double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const = 0 /Factory/;
%Docstring
Returns a new line string geometry corresponding to a segmentized
approximation of the curve.

:param tolerance: segmentation tolerance
:param toleranceType: maximum segmentation angle or maximum difference
                      between approximation and curve

Uses a MaximumAngle tolerance of 1 degrees by default (360 segments in a
full circle)
%End

    virtual void addToPainterPath( QPainterPath &path ) const = 0;
%Docstring
Adds a curve to a painter path.
%End
    virtual QPainterPath asQPainterPath() const;


    virtual void drawAsPolygon( QPainter &p ) const = 0;
%Docstring
Draws the curve as a polygon on the specified QPainter.

:param p: destination QPainter
%End

    virtual void points( QgsPointSequence &pt /Out/ ) const = 0;
%Docstring
Returns a list of points within the curve.
%End

    virtual int numPoints() const = 0;
%Docstring
Returns the number of points in the curve.
%End

    Py_ssize_t __len__() const;
%Docstring
    Returns the number of points in the curve.
%End
%MethodCode
    sipRes = sipCpp->numPoints();
%End

    //! Ensures that bool(obj) returns ``True`` (otherwise __len__() would be used)
    int __bool__() const;
%MethodCode
    sipRes = true;
%End

    virtual void sumUpArea( double &sum /Out/ ) const = 0;
%Docstring
Sums up the area of the curve by iterating over the vertices (shoelace
formula).
%End

    virtual QgsCoordinateSequence coordinateSequence() const;

    virtual bool nextVertex( QgsVertexId &id, QgsPoint &vertex /Out/ ) const;

    virtual void adjacentVertices( QgsVertexId vertex, QgsVertexId &previousVertex /Out/, QgsVertexId &nextVertex /Out/ ) const;

    virtual int vertexNumberFromVertexId( QgsVertexId id ) const;


    virtual bool pointAt( int node, QgsPoint &point /Out/, Qgis::VertexType &type /Out/ ) const = 0;
%Docstring
Returns the point and vertex id of a point within the curve.

:param node: node number, where the first node is 0

:return: - ``True`` if node exists within the curve
         - point: point at corresponding node in the curve
         - type: the vertex type of the node
%End

    virtual int indexOf( const QgsPoint &point ) const = 0;
%Docstring
Returns the index of the first vertex matching the given ``point``, or
-1 if a matching vertex is not found.

.. note::

   If the curve has m or z values then the search ``point`` must have exactly matching
   m and z values in order to be matched against the curve's vertices.

.. note::

   This method only matches against segment vertices, not curve vertices.

.. versionadded:: 3.20
%End

    virtual QgsCurve *reversed() const = 0 /Factory/;
%Docstring
Returns a reversed copy of the curve, where the direction of the curve
has been flipped.
%End

    virtual QgsAbstractGeometry *boundary() const /Factory/;


    virtual QString asKml( int precision = 17 ) const;


    virtual QgsCurve *segmentize( double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const /Factory/;

%Docstring
Returns a geometry without curves. Caller takes ownership

:param tolerance: segmentation tolerance
:param toleranceType: maximum segmentation angle or maximum difference
                      between approximation and curve
%End

    virtual int vertexCount( int part = 0, int ring = 0 ) const;

    virtual int ringCount( int part = 0 ) const;

    virtual int partCount() const;

    virtual QgsPoint vertexAt( QgsVertexId id ) const;

    virtual QgsCurve *toCurveType() const /Factory/;

    void normalize() final /HoldGIL/;

    virtual QgsBox3D boundingBox3D() const;

    virtual bool isValid( QString &error /Out/, Qgis::GeometryValidityFlags flags = Qgis::GeometryValidityFlags() ) const;


    virtual double xAt( int index ) const = 0;
%Docstring
Returns the x-coordinate of the specified node in the line string.

:param index: index of node, where the first node in the line is 0

:return: x-coordinate of node, or 0.0 if index is out of bounds
%End

    virtual double yAt( int index ) const = 0;
%Docstring
Returns the y-coordinate of the specified node in the line string.

:param index: index of node, where the first node in the line is 0

:return: y-coordinate of node, or 0.0 if index is out of bounds
%End

    virtual double zAt( int index ) const = 0;
%Docstring
Returns the z-coordinate of the specified node in the line string.

:param index: index of node, where the first node in the line is 0

:return: z-coordinate of node, or 0.0 if index is out of bounds

.. versionadded:: 3.28
%End

    virtual double mAt( int index ) const = 0;
%Docstring
Returns the m-coordinate of the specified node in the line string.

:param index: index of node, where the first node in the line is 0

:return: m-coordinate of node, or 0.0 if index is out of bounds

.. versionadded:: 3.28
%End

    virtual QPolygonF asQPolygonF() const;
%Docstring
Returns a QPolygonF representing the points.
%End

    virtual QgsPoint *interpolatePoint( double distance ) const = 0 /Factory/;
%Docstring
Returns an interpolated point on the curve at the specified
``distance``.

If z or m values are present, the output z and m will be interpolated
using the existing vertices' z or m values.

If distance is negative, or is greater than the length of the curve,
``None`` will be returned.

.. versionadded:: 3.4
%End

    virtual QgsCurve *curveSubstring( double startDistance, double endDistance ) const = 0 /Factory/;
%Docstring
Returns a new curve representing a substring of this curve.

The ``startDistance`` and ``endDistance`` arguments specify the length
along the curve which the substring should start and end at. If the
``endDistance`` is greater than the total length of the curve then any
"extra" length will be ignored.

If z or m values are present, the output z and m will be interpolated
using the existing vertices' z or m values.

.. versionadded:: 3.4
%End

    double straightDistance2d() const;
%Docstring
Returns the straight distance of the curve, i.e. the direct/euclidean
distance between the first and last vertex of the curve. (Also known as
"as the crow flies" distance).

.. versionadded:: 3.2
%End

    double sinuosity() const;
%Docstring
Returns the curve sinuosity, which is the ratio of the curve
:py:func:`~QgsCurve.length` to curve
:py:func:`~QgsCurve.straightDistance2d`. Larger numbers indicate a more
"sinuous" curve (i.e. more "bendy"). The minimum value returned of 1.0
indicates a perfectly straight curve.

If a curve :py:func:`~QgsCurve.isClosed`, it has infinite sinuosity and
will return NaN.

.. versionadded:: 3.2
%End

    Qgis::AngularDirection orientation() const;
%Docstring
Returns the curve's orientation, e.g. clockwise or counter-clockwise.

.. warning::

   The result is not predictable for non-closed curves.

.. versionadded:: 3.6
%End

    virtual void scroll( int firstVertexIndex ) = 0;
%Docstring
Scrolls the curve vertices so that they start with the vertex at the
given index.

.. warning::

   This should only be called on closed curves, or the shape of the curve will be altered and
   the result is undefined.

.. warning::

   The ``firstVertexIndex`` must correspond to a segment vertex and not a curve point or the result
   is undefined.

.. versionadded:: 3.20
%End



  protected:

    virtual void clearCache() const;


    virtual int childCount() const;

    virtual QgsPoint childPoint( int index ) const;




};

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