QGIS API Documentation  3.6.0-Noosa (5873452)
qgsgeometryeditutils.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsgeometryeditutils.h
3  -------------------------------------------------------------------
4 Date : 21 Jan 2015
5 Copyright : (C) 2015 by Marco Hugentobler
6 email : 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 
20 class QgsCurve;
21 class QgsGeometryEngine;
22 class QgsVectorLayer;
23 
24 #define SIP_NO_FILE
25 
26 #include "qgsgeometry.h"
27 #include "qgsfeatureid.h"
28 #include <QMap>
29 #include <memory>
30 
39 {
40  public:
41 
48  static QgsGeometry::OperationResult addRing( QgsAbstractGeometry *geometry, std::unique_ptr< QgsCurve > ring );
49 
56  static QgsGeometry::OperationResult addPart( QgsAbstractGeometry *geometry, std::unique_ptr< QgsAbstractGeometry > part );
57 
62  static bool deleteRing( QgsAbstractGeometry *geom, int ringNum, int partNum = 0 );
63 
68  static bool deletePart( QgsAbstractGeometry *geom, int partNum );
69 
76  static std::unique_ptr< QgsAbstractGeometry > avoidIntersections( const QgsAbstractGeometry &geom,
77  const QList<QgsVectorLayer *> &avoidIntersectionsLayers,
78  const QHash<QgsVectorLayer *, QSet<QgsFeatureId> > &ignoreFeatures = ( QHash<QgsVectorLayer *, QSet<QgsFeatureId> >() ) );
79 };
80 
81 #endif // QGSGEOMETRYEDITUTILS_H
OperationResult
Success or failure of a geometry operation.
Definition: qgsgeometry.h:118
static bool deleteRing(QgsAbstractGeometry *geom, int ringNum, int partNum=0)
Deletes a ring from a geometry.
static std::unique_ptr< QgsAbstractGeometry > avoidIntersections(const QgsAbstractGeometry &geom, const QList< QgsVectorLayer *> &avoidIntersectionsLayers, 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...
Abstract base class for curved geometry type.
Definition: qgscurve.h:35
Abstract base class for all geometries.
static QgsGeometry::OperationResult addPart(QgsAbstractGeometry *geometry, std::unique_ptr< QgsAbstractGeometry > part)
Add a part to multi type geometry.
Contains geometry relation and modification algorithms.
static bool deletePart(QgsAbstractGeometry *geom, int partNum)
Deletes a part from a geometry.
Represents a vector layer which manages a vector based data sets.
Convenience functions for geometry editing.
static QgsGeometry::OperationResult addRing(QgsAbstractGeometry *geometry, std::unique_ptr< QgsCurve > ring)
Add an interior ring to a geometry.