QGIS API Documentation  master-59fd5e0
src/core/qgsvectorlayereditutils.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     qgsvectorlayereditutils.h
00003     ---------------------
00004     begin                : Dezember 2012
00005     copyright            : (C) 2012 by Martin Dobias
00006     email                : wonder dot sk at gmail dot com
00007  ***************************************************************************
00008  *                                                                         *
00009  *   This program is free software; you can redistribute it and/or modify  *
00010  *   it under the terms of the GNU General Public License as published by  *
00011  *   the Free Software Foundation; either version 2 of the License, or     *
00012  *   (at your option) any later version.                                   *
00013  *                                                                         *
00014  ***************************************************************************/
00015 #ifndef QGSVECTORLAYEREDITUTILS_H
00016 #define QGSVECTORLAYEREDITUTILS_H
00017 
00018 
00019 #include "qgsfeature.h"
00020 
00021 #include "qgsvectorlayer.h"
00022 
00023 class QgsGeometryCache;
00024 
00025 class CORE_EXPORT QgsVectorLayerEditUtils
00026 {
00027   public:
00028     QgsVectorLayerEditUtils( QgsVectorLayer* layer );
00029 
00030     inline QgsGeometryCache* cache() { return L->cache(); }
00031 
00032 
00037     bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );
00038 
00043     bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
00044 
00047     bool deleteVertex( QgsFeatureId atFeatureId, int atVertex );
00048 
00057     int addRing( const QList<QgsPoint>& ring );
00058 
00068     int addPart( const QList<QgsPoint>& ring, QgsFeatureId featureId );
00069 
00075     int translateFeature( QgsFeatureId featureId, double dx, double dy );
00076 
00084     int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
00085 
00091     int addTopologicalPoints( QgsGeometry* geom );
00092 
00100     int addTopologicalPoints( const QgsPoint& p );
00101 
00107     int insertSegmentVerticesForSnap( const QList<QgsSnappingResult>& snapResults );
00108 
00109   protected:
00110 
00113     int boundingBoxFromPointList( const QList<QgsPoint>& list, double& xmin, double& ymin, double& xmax, double& ymax ) const;
00114 
00115     QgsVectorLayer* L;
00116 };
00117 
00118 #endif // QGSVECTORLAYEREDITUTILS_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines