QGIS API Documentation
2.12.0-Lyon
|
#include <qgsvectorlayereditutils.h>
Public Member Functions | |
QgsVectorLayerEditUtils (QgsVectorLayer *layer) | |
int | addPart (const QList< QgsPoint > &ring, QgsFeatureId featureId) |
Adds a new part polygon to a multipart feature. More... | |
int | addPart (QgsCurveV2 *ring, QgsFeatureId featureId) |
int | addRing (const QList< QgsPoint > &ring, const QgsFeatureIds &targetFeatureIds=QgsFeatureIds(), QgsFeatureId *modifiedFeatureId=0) |
Adds a ring to polygon/multipolygon features. More... | |
int | addRing (QgsCurveV2 *ring, const QgsFeatureIds &targetFeatureIds=QgsFeatureIds(), QgsFeatureId *modifiedFeatureId=0) |
Adds a ring to polygon/multipolygon features. More... | |
int | addTopologicalPoints (const QgsGeometry *geom) |
Adds topological points for every vertex of the geometry. More... | |
int | addTopologicalPoints (const QgsPoint &p) |
Adds a vertex to segments which intersect point p but don't already have a vertex there. More... | |
QgsGeometryCache * | cache () |
bool | deleteVertex (QgsFeatureId atFeatureId, int atVertex) |
Deletes a vertex from a feature. More... | |
int | insertSegmentVerticesForSnap (const QList< QgsSnappingResult > &snapResults) |
Inserts vertices to the snapped segments. More... | |
bool | insertVertex (double x, double y, QgsFeatureId atFeatureId, int beforeVertex) |
Insert a new vertex before the given vertex number, in the given ring, item (first number is index 0), and feature Not meaningful for Point geometries. More... | |
bool | moveVertex (double x, double y, QgsFeatureId atFeatureId, int atVertex) |
Moves the vertex at the given position number, ring and item (first number is index 0), and feature to the given coordinates. More... | |
bool | moveVertex (const QgsPointV2 &p, QgsFeatureId atFeatureId, int atVertex) |
Moves the vertex at the given position number, ring and item (first number is index 0), and feature to the given coordinates. More... | |
int | splitFeatures (const QList< QgsPoint > &splitLine, bool topologicalEditing=false) |
Splits features cut by the given line. More... | |
int | splitParts (const QList< QgsPoint > &splitLine, bool topologicalEditing=false) |
Splits parts cut by the given line. More... | |
int | translateFeature (QgsFeatureId featureId, double dx, double dy) |
Translates feature by dx, dy. More... | |
Protected Member Functions | |
int | boundingBoxFromPointList (const QList< QgsPoint > &list, double &xmin, double &ymin, double &xmax, double &ymax) const |
Little helper function that gives bounding box from a list of points. More... | |
Protected Attributes | |
QgsVectorLayer * | L |
Definition at line 26 of file qgsvectorlayereditutils.h.
QgsVectorLayerEditUtils::QgsVectorLayerEditUtils | ( | QgsVectorLayer * | layer | ) |
Definition at line 30 of file qgsvectorlayereditutils.cpp.
int QgsVectorLayerEditUtils::addPart | ( | const QList< QgsPoint > & | ring, |
QgsFeatureId | featureId | ||
) |
Adds a new part polygon to a multipart feature.
Definition at line 170 of file qgsvectorlayereditutils.cpp.
int QgsVectorLayerEditUtils::addPart | ( | QgsCurveV2 * | ring, |
QgsFeatureId | featureId | ||
) |
Definition at line 209 of file qgsvectorlayereditutils.cpp.
int QgsVectorLayerEditUtils::addRing | ( | const QList< QgsPoint > & | ring, |
const QgsFeatureIds & | targetFeatureIds = QgsFeatureIds() , |
||
QgsFeatureId * | modifiedFeatureId = 0 |
||
) |
Adds a ring to polygon/multipolygon features.
ring | ring to add |
targetFeatureIds | if specified, only these features will be the candidates for adding a ring. Otherwise all intersecting features are tested and the ring is added to the first valid feature. |
modifiedFeatureId | if specified, feature ID for feature that ring was added to will be stored in this parameter |
Definition at line 110 of file qgsvectorlayereditutils.cpp.
int QgsVectorLayerEditUtils::addRing | ( | QgsCurveV2 * | ring, |
const QgsFeatureIds & | targetFeatureIds = QgsFeatureIds() , |
||
QgsFeatureId * | modifiedFeatureId = 0 |
||
) |
Adds a ring to polygon/multipolygon features.
ring | ring to add |
targetFeatureIds | if specified, only these features will be the candidates for adding a ring. Otherwise all intersecting features are tested and the ring is added to the first valid feature. |
modifiedFeatureId | if specified, feature ID for feature that ring was added to will be stored in this parameter |
Definition at line 123 of file qgsvectorlayereditutils.cpp.
int QgsVectorLayerEditUtils::addTopologicalPoints | ( | const QgsGeometry * | geom | ) |
Adds topological points for every vertex of the geometry.
geom | the geometry where each vertex is added to segments of other features |
Definition at line 543 of file qgsvectorlayereditutils.cpp.
int QgsVectorLayerEditUtils::addTopologicalPoints | ( | const QgsPoint & | p | ) |
Adds a vertex to segments which intersect point p but don't already have a vertex there.
If a feature already has a vertex at position p, no additional vertex is inserted. This method is useful for topological editing.
p | position of the vertex |
Definition at line 651 of file qgsvectorlayereditutils.cpp.
|
protected |
Little helper function that gives bounding box from a list of points.
Definition at line 735 of file qgsvectorlayereditutils.cpp.
|
inline |
Definition at line 31 of file qgsvectorlayereditutils.h.
bool QgsVectorLayerEditUtils::deleteVertex | ( | QgsFeatureId | atFeatureId, |
int | atVertex | ||
) |
Deletes a vertex from a feature.
Definition at line 87 of file qgsvectorlayereditutils.cpp.
int QgsVectorLayerEditUtils::insertSegmentVerticesForSnap | ( | const QList< QgsSnappingResult > & | snapResults | ) |
Inserts vertices to the snapped segments.
This is useful for topological editing if snap to segment is enabled.
snapResults | results collected from the snapping operation |
Definition at line 709 of file qgsvectorlayereditutils.cpp.
bool QgsVectorLayerEditUtils::insertVertex | ( | double | x, |
double | y, | ||
QgsFeatureId | atFeatureId, | ||
int | beforeVertex | ||
) |
Insert a new vertex before the given vertex number, in the given ring, item (first number is index 0), and feature Not meaningful for Point geometries.
Definition at line 35 of file qgsvectorlayereditutils.cpp.
bool QgsVectorLayerEditUtils::moveVertex | ( | double | x, |
double | y, | ||
QgsFeatureId | atFeatureId, | ||
int | atVertex | ||
) |
Moves the vertex at the given position number, ring and item (first number is index 0), and feature to the given coordinates.
Definition at line 58 of file qgsvectorlayereditutils.cpp.
bool QgsVectorLayerEditUtils::moveVertex | ( | const QgsPointV2 & | p, |
QgsFeatureId | atFeatureId, | ||
int | atVertex | ||
) |
Moves the vertex at the given position number, ring and item (first number is index 0), and feature to the given coordinates.
Definition at line 64 of file qgsvectorlayereditutils.cpp.
int QgsVectorLayerEditUtils::splitFeatures | ( | const QList< QgsPoint > & | splitLine, |
bool | topologicalEditing = false |
||
) |
Splits features cut by the given line.
splitLine | line that splits the layer features |
topologicalEditing | true if topological editing is enabled |
Definition at line 274 of file qgsvectorlayereditutils.cpp.
int QgsVectorLayerEditUtils::splitParts | ( | const QList< QgsPoint > & | splitLine, |
bool | topologicalEditing = false |
||
) |
Splits parts cut by the given line.
splitLine | line that splits the layer feature parts |
topologicalEditing | true if topological editing is enabled |
Definition at line 408 of file qgsvectorlayereditutils.cpp.
int QgsVectorLayerEditUtils::translateFeature | ( | QgsFeatureId | featureId, |
double | dx, | ||
double | dy | ||
) |
Translates feature by dx, dy.
featureId | id of the feature to translate |
dx | translation of x-coordinate |
dy | translation of y-coordinate |
Definition at line 249 of file qgsvectorlayereditutils.cpp.
|
protected |
Definition at line 151 of file qgsvectorlayereditutils.h.