32   return QStringLiteral( 
"Polygon" );
    37   auto result = qgis::make_unique< QgsPolygon >();
    39   return result.release();
    90   for ( 
int i = 0; i < nRings; ++i )
    93     line->fromWkbPoints( ringType, wkbPtr );
   114   int binarySize = 
sizeof( char ) + 
sizeof( quint32 ) + 
sizeof( quint32 );
   123     binarySize += 
sizeof( quint32 ) + curve->numPoints() * ( 2 + curve->is3D() + curve->isMeasure() ) * 
sizeof( 
double );
   127   wkbArray.resize( binarySize );
   130   wkb << static_cast<quint32>( 
wkbType() );
   131   wkb << static_cast<quint32>( ( 
nullptr != 
mExteriorRing ) + mInteriorRings.size() );
   138   for ( 
const QgsCurve *curve : mInteriorRings )
   141     curve->points( pts );
   162   if ( lineString && !lineString->
isClosed() )
   195   if ( lineString && !lineString->
isClosed() )
   227     multiLine->
reserve( nInteriorRings + 1 );
   229     for ( 
int i = 0; i < nInteriorRings; ++i )
   240     return std::numeric_limits< double >::quiet_NaN();
   243   double minimumDistance = std::numeric_limits<double>::max();
   244   double minDistX = 0.0;
   245   double minDistY = 0.0;
   248   for ( 
int ringIndex = 0; ringIndex < numRings; ++ringIndex )
   253     for ( 
int i = 0, j = len - 1; i < len; j = i++ )
   255       double aX = ring->
xAt( i );
   256       double aY = ring->
yAt( i );
   257       double bX = ring->
xAt( j );
   258       double bY = ring->
yAt( j );
   260       if ( ( ( aY > y ) != ( bY > y ) ) &&
   261            ( x < ( bX - aX ) * ( y - aY ) / ( bY - aY ) + aX ) )
   264       minimumDistance = std::min( minimumDistance, 
QgsGeometryUtils::sqrDistToLine( x, y, aX, aY, bX, bY, minDistX, minDistY, 4 * std::numeric_limits<double>::epsilon() ) );
   268   return ( inside ? 1 : -1 ) * std::sqrt( minimumDistance );
   281   for ( 
int i = 0; i < nInteriorRings; ++i )
 
virtual void setExteriorRing(QgsCurve *ring)
Sets the exterior ring of the polygon. 
 
void clearCache() const override
Clears any cached parameters associated with the geometry, e.g., bounding boxes. 
 
QgsPolygon * surfaceToPolygon() const override
Gets a polygon representation of this surface. 
 
virtual void addInteriorRing(QgsCurve *ring)
Adds an interior ring to the geometry (takes ownership) 
 
Multi line string geometry collection. 
 
Curve polygon geometry type. 
 
void clear() override
Clears the geometry, ie reset it to a null geometry. 
 
double pointDistanceToBoundary(double x, double y) const
Returns the distance from a point to the boundary of the polygon (either the exterior ring or any clo...
 
static endian_t endian()
Returns whether this machine uses big or little endian. 
 
QgsAbstractGeometry * boundary() const override
Returns the closure of the combinatorial boundary of the geometry (ie the topological boundary of the...
 
QgsWkbTypes::Type mWkbType
 
int numPoints() const override
Returns the number of points in the curve. 
 
QVector< QgsCurve * > mInteriorRings
 
void addInteriorRing(QgsCurve *ring) override
Adds an interior ring to the geometry (takes ownership) 
 
Type
The WKB type describes the number of dimensions a geometry has. 
 
void clear() override
Clears the geometry, ie reset it to a null geometry. 
 
double yAt(int index) const override
Returns the y-coordinate of the specified node in the line string. 
 
void setZMTypeFromSubGeometry(const QgsAbstractGeometry *subggeom, QgsWkbTypes::Type baseGeomType)
Updates the geometry type based on whether sub geometries contain z or m values. 
 
T qgsgeometry_cast(const QgsAbstractGeometry *geom)
 
void close()
Closes the line string by appending the first point to the end of the line, if it is not already clos...
 
bool fromWkb(QgsConstWkbPtr &wkb) override
Sets the geometry from a WKB string. 
 
QgsCurvePolygon * toCurveType() const override
Returns the geometry converted to the more generic curve type QgsCurvePolygon. 
 
Abstract base class for curved geometry type. 
 
QString geometryType() const override
Returns a unique string representing the geometry type. 
 
Abstract base class for all geometries. 
 
QgsPolygon * createEmptyWithSameType() const override
Creates a new geometry with the same class and same WKB type as the original and transfers ownership...
 
QgsWkbTypes::Type wkbType() const
Returns the WKB type of the geometry. 
 
bool addGeometry(QgsAbstractGeometry *g) override
Adds a geometry and takes ownership. Returns true in case of success. 
 
virtual bool isClosed() const
Returns true if the curve is closed. 
 
QVector< QgsPoint > QgsPointSequence
 
QgsCurve * segmentize(double tolerance=M_PI_2/90, SegmentationToleranceType toleranceType=MaximumAngle) const override
Returns a geometry without curves. 
 
void reserve(int size)
Attempts to allocate memory for at least size geometries. 
 
void setExteriorRing(QgsCurve *ring) override
Sets the exterior ring of the polygon. 
 
Line string geometry type, with support for z-dimension and m-values. 
 
virtual QgsLineString * curveToLine(double tolerance=M_PI_2/90, SegmentationToleranceType toleranceType=MaximumAngle) const =0
Returns a new line string geometry corresponding to a segmentized approximation of the curve...
 
QByteArray asWkb() const override
Returns a WKB representation of the geometry. 
 
QgsPolygon * clone() const override
Clones the geometry by performing a deep copy. 
 
static void pointsToWKB(QgsWkbPtr &wkb, const QgsPointSequence &points, bool is3D, bool isMeasure)
Returns a LinearRing { uint32 numPoints; Point points[numPoints]; }. 
 
double xAt(int index) const override
Returns the x-coordinate of the specified node in the line string. 
 
static double sqrDistToLine(double ptX, double ptY, double x1, double y1, double x2, double y2, double &minDistX, double &minDistY, double epsilon)
Returns the squared distance between a point and a line. 
 
virtual bool convertTo(QgsWkbTypes::Type type)
Converts the geometry to a specified type. 
 
std::unique_ptr< QgsCurve > mExteriorRing
 
static Type flatType(Type type)
Returns the flat type for a WKB type. 
 
QgsWkbTypes::Type readHeader() const
readHeader 
 
virtual bool hasCurvedSegments() const
Returns true if the geometry contains curved segments.