QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 QgsCurveV2;
21 class QgsGeometryEngine;
22 class QgsVectorLayer;
23 
24 #include "qgsfeature.h"
25 #include <QMap>
26 
35 {
36  public:
40  // TODO QGIS 3.0 returns an enum instead of a magic constant
41  static int addRing( QgsAbstractGeometryV2* geom, QgsCurveV2* ring );
42 
46  // TODO QGIS 3.0 returns an enum instead of a magic constant
47  static int addPart( QgsAbstractGeometryV2* geom, QgsAbstractGeometryV2* part );
48 
52  static bool deleteRing( QgsAbstractGeometryV2* geom, int ringNum, int partNum = 0 );
53 
57  static bool deletePart( QgsAbstractGeometryV2* geom, int partNum );
58 
64 };
65 
66 #endif // QGSGEOMETRYEDITUTILS_H
Abstract base class for all geometries.
static int addPart(QgsAbstractGeometryV2 *geom, QgsAbstractGeometryV2 *part)
Adds part to multi type geometry (taking ownership)
static bool deletePart(QgsAbstractGeometryV2 *geom, int partNum)
Deletes a part from a geometry.
static bool deleteRing(QgsAbstractGeometryV2 *geom, int ringNum, int partNum=0)
Deletes a ring from a geometry.
static QgsAbstractGeometryV2 * avoidIntersections(const QgsAbstractGeometryV2 &geom, QMap< QgsVectorLayer *, QSet< QgsFeatureId > > ignoreFeatures=(QMap< QgsVectorLayer *, QSet< QgsFeatureId > >()))
Alters a geometry so that it avoids intersections with features from all open vector layers...
static int addRing(QgsAbstractGeometryV2 *geom, QgsCurveV2 *ring)
Adds interior ring (taking ownership).
Contains geometry relation and modification algorithms.
Abstract base class for curved geometry type.
Definition: qgscurvev2.h:32
Represents a vector layer which manages a vector based data sets.
Convenience functions for geometry editing.