QGIS API Documentation  2.8.6-Wien
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 "qgsfeature.h"
20 
21 #include "qgsvectorlayer.h"
22 
23 class QgsGeometryCache;
24 
25 class CORE_EXPORT QgsVectorLayerEditUtils
26 {
27  public:
29 
30  inline QgsGeometryCache* cache() { return L->cache(); }
31 
32 
37  bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );
38 
43  bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
44 
47  bool deleteVertex( QgsFeatureId atFeatureId, int atVertex );
48 
59  int addRing( const QList<QgsPoint>& ring, QgsFeatureId* featureId = 0 );
60 
70  int addPart( const QList<QgsPoint>& ring, QgsFeatureId featureId );
71 
77  int translateFeature( QgsFeatureId featureId, double dx, double dy );
78 
86  int splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
87 
95  int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
96 
102  int addTopologicalPoints( QgsGeometry* geom );
103 
111  int addTopologicalPoints( const QgsPoint& p );
112 
118  int insertSegmentVerticesForSnap( const QList<QgsSnappingResult>& snapResults );
119 
120  protected:
121 
124  int boundingBoxFromPointList( const QList<QgsPoint>& list, double& xmin, double& ymin, double& xmax, double& ymax ) const;
125 
127 };
128 
129 #endif // QGSVECTORLAYEREDITUTILS_H
A class to represent a point.
Definition: qgspoint.h:63
qint64 QgsFeatureId
Definition: qgsfeature.h:30
Represents a vector layer which manages a vector based data sets.