QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
qgsvectorlayereditutils.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsvectorlayereditutils.h
3  ---------------------
4  begin : Dezember 2012
5  copyright : (C) 2012 by Martin Dobias
6  email : wonder dot sk at gmail 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 #ifndef QGSVECTORLAYEREDITUTILS_H
16 #define QGSVECTORLAYEREDITUTILS_H
17 
18 
19 #include "qgis_core.h"
20 #include "qgis_sip.h"
21 #include "qgsgeometry.h"
22 #include "qgsfeatureid.h"
23 #include "qgsvectorlayer.h"
24 
25 class QgsCurve;
26 
31 class CORE_EXPORT QgsVectorLayerEditUtils
32 {
33  public:
35 
41  bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );
42 
48  bool insertVertex( const QgsPoint &point, QgsFeatureId atFeatureId, int beforeVertex );
49 
55  bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
56 
63  bool moveVertex( const QgsPoint &p, QgsFeatureId atFeatureId, int atVertex ) SIP_PYNAME( moveVertexV2 );
64 
71  QgsVectorLayer::EditResult deleteVertex( QgsFeatureId featureId, int vertex );
72 
82  Q_DECL_DEPRECATED QgsGeometry::OperationResult addRing( const QVector<QgsPointXY> &ring, const QgsFeatureIds &targetFeatureIds = QgsFeatureIds(), QgsFeatureId *modifiedFeatureId = nullptr ) SIP_DEPRECATED;
83 
92  QgsGeometry::OperationResult addRing( const QgsPointSequence &ring, const QgsFeatureIds &targetFeatureIds = QgsFeatureIds(), QgsFeatureId *modifiedFeatureId = nullptr );
93 
103  QgsGeometry::OperationResult addRing( QgsCurve *ring, const QgsFeatureIds &targetFeatureIds = QgsFeatureIds(), QgsFeatureId *modifiedFeatureId = nullptr ) SIP_PYNAME( addCurvedRing );
104 
114  Q_DECL_DEPRECATED QgsGeometry::OperationResult addPart( const QVector<QgsPointXY> &ring, QgsFeatureId featureId ) SIP_DEPRECATED;
115 
126  QgsGeometry::OperationResult addPart( const QgsPointSequence &ring, QgsFeatureId featureId );
127 
139  QgsGeometry::OperationResult addPart( QgsCurve *ring, QgsFeatureId featureId ) SIP_PYNAME( addCurvedPart );
140 
148  int translateFeature( QgsFeatureId featureId, double dx, double dy );
149 
163  Q_DECL_DEPRECATED QgsGeometry::OperationResult splitParts( const QVector<QgsPointXY> &splitLine, bool topologicalEditing = false ) SIP_DEPRECATED;
164 
177  QgsGeometry::OperationResult splitParts( const QgsPointSequence &splitLine, bool topologicalEditing = false );
178 
187  Q_DECL_DEPRECATED QgsGeometry::OperationResult splitFeatures( const QVector<QgsPointXY> &splitLine, bool topologicalEditing = false ) SIP_DEPRECATED;
188 
196  QgsGeometry::OperationResult splitFeatures( const QgsPointSequence &splitLine, bool topologicalEditing = false );
197 
204  int addTopologicalPoints( const QgsGeometry &geom );
205 
213  int addTopologicalPoints( const QgsPointXY &p );
214 
223  int addTopologicalPoints( const QgsPoint &p );
224 
225  private:
226 
231  bool boundingBoxFromPointList( const QgsPointSequence &list, double &xmin, double &ymin, double &xmax, double &ymax ) const;
232 
233  QgsVectorLayer *mLayer = nullptr;
234 };
235 
236 #endif // QGSVECTORLAYEREDITUTILS_H
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeatureid.h:34
A class to represent a 2D point.
Definition: qgspointxy.h:43
qint64 QgsFeatureId
Definition: qgsfeatureid.h:25
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:122
OperationResult
Success or failure of a geometry operation.
Definition: qgsgeometry.h:134
Abstract base class for curved geometry type.
Definition: qgscurve.h:35
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:37
QVector< QgsPoint > QgsPointSequence
Represents a vector layer which manages a vector based data sets.
EditResult
Result of an edit operation.
#define SIP_PYNAME(name)
Definition: qgis_sip.h:81