QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
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 "qgsfeatureid.h"
22#include "qgsvectorlayer.h"
23
24class QgsCurve;
25class QgsGeometry;
26
32class CORE_EXPORT QgsVectorLayerEditUtils
33{
34 public:
36
42 bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );
43
49 bool insertVertex( const QgsPoint &point, QgsFeatureId atFeatureId, int beforeVertex );
50
56 bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
57
64 bool moveVertex( const QgsPoint &p, QgsFeatureId atFeatureId, int atVertex ) SIP_PYNAME( moveVertexV2 );
65
71 Qgis::VectorEditResult deleteVertex( QgsFeatureId featureId, int vertex );
72
82 Q_DECL_DEPRECATED Qgis::GeometryOperationResult addRing( const QVector<QgsPointXY> &ring, const QgsFeatureIds &targetFeatureIds = QgsFeatureIds(), QgsFeatureId *modifiedFeatureId = nullptr ) SIP_DEPRECATED;
83
92 Qgis::GeometryOperationResult addRing( const QgsPointSequence &ring, const QgsFeatureIds &targetFeatureIds = QgsFeatureIds(), QgsFeatureId *modifiedFeatureId = nullptr );
93
103 Qgis::GeometryOperationResult addRingV2( QgsCurve *ring SIP_TRANSFER, const QgsFeatureIds &targetFeatureIds = QgsFeatureIds(), QgsFeatureIds *modifiedFeatureIds SIP_OUT = nullptr );
104
114 Qgis::GeometryOperationResult addRing( QgsCurve *ring, const QgsFeatureIds &targetFeatureIds = QgsFeatureIds(), QgsFeatureId *modifiedFeatureId = nullptr ) SIP_PYNAME( addCurvedRing );
115
127 Q_DECL_DEPRECATED Qgis::GeometryOperationResult addPart( const QVector<QgsPointXY> &ring, QgsFeatureId featureId ) SIP_DEPRECATED;
128
141 Qgis::GeometryOperationResult addPart( const QgsPointSequence &ring, QgsFeatureId featureId );
142
155 Qgis::GeometryOperationResult addPart( QgsCurve *ring, QgsFeatureId featureId ) SIP_PYNAME( addCurvedPart );
156
164 int translateFeature( QgsFeatureId featureId, double dx, double dy );
165
181 Q_DECL_DEPRECATED Qgis::GeometryOperationResult splitParts( const QVector<QgsPointXY> &splitLine, bool topologicalEditing = false ) SIP_DEPRECATED;
182
196 Qgis::GeometryOperationResult splitParts( const QgsPointSequence &splitLine, bool topologicalEditing = false );
197
205 Q_DECL_DEPRECATED Qgis::GeometryOperationResult splitFeatures( const QVector<QgsPointXY> &splitLine, bool topologicalEditing = false ) SIP_DEPRECATED;
206
213 Qgis::GeometryOperationResult splitFeatures( const QgsPointSequence &splitLine, bool topologicalEditing = false );
214
224 Qgis::GeometryOperationResult splitFeatures( const QgsCurve *curve, QgsPointSequence &topologyTestPoints SIP_OUT, bool preserveCircular = false, bool topologicalEditing = false );
225
234 int addTopologicalPoints( const QgsGeometry &geom );
235
245 int addTopologicalPoints( const QgsPointXY &p );
246
257 int addTopologicalPoints( const QgsPoint &p );
258
269 int addTopologicalPoints( const QgsPointSequence &ps );
270
283 bool mergeFeatures( const QgsFeatureId &targetFeatureId, const QgsFeatureIds &mergeFeatureIds, const QgsAttributes &mergeAttributes, const QgsGeometry &unionGeometry, QString &errorMessage SIP_OUT );
284
285 private:
286
291 bool boundingBoxFromPointList( const QgsPointSequence &list, double &xmin, double &ymin, double &xmax, double &ymax ) const;
292
293 QgsVectorLayer *mLayer = nullptr;
294};
295
296#endif // QGSVECTORLAYEREDITUTILS_H
GeometryOperationResult
Success or failure of a geometry operation.
Definition qgis.h:1889
VectorEditResult
Specifies the result of a vector layer edit operation.
Definition qgis.h:1665
A vector of attributes.
Abstract base class for curved geometry type.
Definition qgscurve.h:35
A geometry is the spatial representation of a feature.
A class to represent a 2D point.
Definition qgspointxy.h:60
Point geometry type, with support for z-dimension and m-values.
Definition qgspoint.h:49
Contains utility functions for editing vector layers.
Represents a vector layer which manages a vector based data sets.
#define SIP_DEPRECATED
Definition qgis_sip.h:106
#define SIP_PYNAME(name)
Definition qgis_sip.h:81
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_OUT
Definition qgis_sip.h:58
QVector< QgsPoint > QgsPointSequence
QSet< QgsFeatureId > QgsFeatureIds
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features