1/************************************************************************
2 * This file has been generated automatically from                      *
3 *                                                                      *
4 * src/core/geometry/qgspolygon.h                                       *
5 *                                                                      *
6 * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
7 ************************************************************************/
8
9
10
11
12
13class QgsPolygon: QgsCurvePolygon
14{
15%Docstring
16Polygon geometry type.
17
18.. versionadded:: 2.10
19%End
20
21%TypeHeaderCode
22#include "qgspolygon.h"
23%End
24  public:
25
26
27    QgsPolygon() /HoldGIL/;
28%Docstring
29Constructor for an empty polygon geometry.
30%End
31
32    QgsPolygon( QgsLineString *exterior /Transfer/, const QList< QgsLineString * > &rings /Transfer/ = QList< QgsLineString * >() ) /HoldGIL/;
33%Docstring
34Constructor for QgsPolygon, with the specified ``exterior`` ring and interior ``rings``.
35
36Ownership of ``exterior`` and ``rings`` is transferred to the polygon.
37
38.. versionadded:: 3.14
39%End
40
41    virtual QString geometryType() const /HoldGIL/;
42
43    virtual QgsPolygon *clone() const /Factory/;
44
45    virtual void clear();
46
47    virtual bool fromWkb( QgsConstWkbPtr &wkb );
48
49    virtual int wkbSize( QgsAbstractGeometry::WkbFlags flags = QgsAbstractGeometry::WkbFlags() ) const;
50
51    virtual QByteArray asWkb( QgsAbstractGeometry::WkbFlags flags = QgsAbstractGeometry::WkbFlags() ) const;
52
53    virtual QgsPolygon *surfaceToPolygon() const /Factory/;
54
55
56    virtual QgsCurvePolygon *toCurveType() const /Factory/;
57
58%Docstring
59Returns the geometry converted to the more generic curve type :py:class:`QgsCurvePolygon`
60
61:return: the converted geometry. Caller takes ownership
62%End
63
64    virtual void addInteriorRing( QgsCurve *ring /Transfer/ );
65
66    virtual void setExteriorRing( QgsCurve *ring /Transfer/ );
67
68
69    virtual QgsAbstractGeometry *boundary() const /Factory/;
70
71
72    double pointDistanceToBoundary( double x, double y ) const;
73%Docstring
74Returns the distance from a point to the boundary of the polygon (either the
75exterior ring or any closer interior rings). The returned distance will be
76negative if the point lies outside the polygon.
77
78.. versionadded:: 3.0
79%End
80
81
82    virtual QgsPolygon *createEmptyWithSameType() const /Factory/;
83
84
85    SIP_PYOBJECT __repr__();
86%MethodCode
87    QString wkt = sipCpp->asWkt();
88    if ( wkt.length() > 1000 )
89      wkt = wkt.left( 1000 ) + QStringLiteral( "..." );
90    QString str = QStringLiteral( "<QgsPolygon: %1>" ).arg( wkt );
91    sipRes = PyUnicode_FromString( str.toUtf8().constData() );
92%End
93
94  protected:
95
96
97};
98/************************************************************************
99 * This file has been generated automatically from                      *
100 *                                                                      *
101 * src/core/geometry/qgspolygon.h                                       *
102 *                                                                      *
103 * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
104 ************************************************************************/
105