QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
57  int addRing( const QList<QgsPoint>& ring );
58 
68  int addPart( const QList<QgsPoint>& ring, QgsFeatureId featureId );
69 
75  int translateFeature( QgsFeatureId featureId, double dx, double dy );
76 
84  int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
85 
91  int addTopologicalPoints( QgsGeometry* geom );
92 
100  int addTopologicalPoints( const QgsPoint& p );
101 
107  int insertSegmentVerticesForSnap( const QList<QgsSnappingResult>& snapResults );
108 
109  protected:
110 
113  int boundingBoxFromPointList( const QList<QgsPoint>& list, double& xmin, double& ymin, double& xmax, double& ymax ) const;
114 
116 };
117 
118 #endif // QGSVECTORLAYEREDITUTILS_H