QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
qgsgeometryeditutils.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsgeometryeditutils.h
3 -------------------------------------------------------------------
4Date : 21 Jan 2015
5Copyright : (C) 2015 by Marco Hugentobler
6email : marco.hugentobler at sourcepole dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSGEOMETRYEDITUTILS_H
17#define QGSGEOMETRYEDITUTILS_H
18
20class QgsCurve;
22class QgsVectorLayer;
23
24#define SIP_NO_FILE
25
26#include "qgsfeatureid.h"
27#include "qgis.h"
28#include <QMap>
29#include <memory>
30
38{
39 public:
40
47 static Qgis::GeometryOperationResult addRing( QgsAbstractGeometry *geometry, std::unique_ptr< QgsCurve > ring );
48
55 static Qgis::GeometryOperationResult addPart( QgsAbstractGeometry *geometry, std::unique_ptr< QgsAbstractGeometry > part );
56
61 static bool deleteRing( QgsAbstractGeometry *geom, int ringNum, int partNum = 0 );
62
67 static bool deletePart( QgsAbstractGeometry *geom, int partNum );
68
77 static std::unique_ptr< QgsAbstractGeometry > avoidIntersections( const QgsAbstractGeometry &geom,
78 const QList<QgsVectorLayer *> &avoidIntersectionsLayers,
79 bool &haveInvalidGeometry,
80 const QHash<QgsVectorLayer *, QSet<QgsFeatureId> > &ignoreFeatures = ( QHash<QgsVectorLayer *, QSet<QgsFeatureId> >() ) );
81};
82
83#endif // QGSGEOMETRYEDITUTILS_H
GeometryOperationResult
Success or failure of a geometry operation.
Definition: qgis.h:1615
Abstract base class for all geometries.
Abstract base class for curved geometry type.
Definition: qgscurve.h:35
Convenience functions for geometry editing.
static Qgis::GeometryOperationResult addRing(QgsAbstractGeometry *geometry, std::unique_ptr< QgsCurve > ring)
Add an interior ring to a geometry.
static std::unique_ptr< QgsAbstractGeometry > avoidIntersections(const QgsAbstractGeometry &geom, const QList< QgsVectorLayer * > &avoidIntersectionsLayers, bool &haveInvalidGeometry, const QHash< QgsVectorLayer *, QSet< QgsFeatureId > > &ignoreFeatures=(QHash< QgsVectorLayer *, QSet< QgsFeatureId > >()))
Alters a geometry so that it avoids intersections with features from all open vector layers.
static bool deletePart(QgsAbstractGeometry *geom, int partNum)
Deletes a part from a geometry.
static bool deleteRing(QgsAbstractGeometry *geom, int ringNum, int partNum=0)
Deletes a ring from a geometry.
static Qgis::GeometryOperationResult addPart(QgsAbstractGeometry *geometry, std::unique_ptr< QgsAbstractGeometry > part)
Add a part to multi type geometry.
A geometry engine is a low-level representation of a QgsAbstractGeometry object, optimised for use wi...
Represents a vector layer which manages a vector based data sets.