QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
qgstrackedvectorlayertools.h
Go to the documentation of this file.
1/***************************************************************************
2 qgstrackedvectorlayertools.h - QgsTrackedVectorLayerTools
3
4 ---------------------
5 begin : 16.5.2016
6 copyright : (C) 2016 by Matthias Kuhn, OPENGIS.ch
8 ***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16#ifndef QGSTRACKEDVECTORLAYERTOOLS_H
17#define QGSTRACKEDVECTORLAYERTOOLS_H
18
19#include "qgis_core.h"
20#include "qgsvectorlayertools.h"
22
28{
29 Q_OBJECT
30 public:
31
33
45 bool addFeatureV2( QgsVectorLayer *layer, const QgsAttributeMap &defaultValues, const QgsGeometry &defaultGeometry, QgsFeature *feature SIP_OUT, const QgsVectorLayerToolsContext &context ) const override;
46 bool startEditing( QgsVectorLayer *layer ) const override;
47 bool stopEditing( QgsVectorLayer *layer, bool allowCancel ) const override;
48 bool saveEdits( QgsVectorLayer *layer ) const override;
49 bool copyMoveFeatures( QgsVectorLayer *layer, QgsFeatureRequest &request, double dx = 0, double dy = 0, QString *errorMsg = nullptr, const bool topologicalEditing = false, QgsVectorLayer *topologicalLayer = nullptr, QString *childrenInfoMsg = nullptr ) const override;
50
54 void setVectorLayerTools( const QgsVectorLayerTools *tools );
55
59 void rollback();
60
61 private:
62
63 const QgsVectorLayerTools *mBackend = nullptr;
64 // TODO QGIS3: remove mutable once methods are no longer const
65 mutable QMap<QgsVectorLayer *, QgsFeatureIds> mAddedFeatures;
66};
67
68#endif // QGSTRACKEDVECTORLAYERTOOLS_H
This class wraps a request for features to a vector layer (or directly its vector data provider).
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition qgsfeature.h:58
A geometry is the spatial representation of a feature.
QgsTrackedVectorLayerTools()=default
Contains settings which reflect the context in which vector layer tool operations should consider.
Methods in this class are used to handle basic operations on vector layers.
virtual bool startEditing(QgsVectorLayer *layer) const =0
This will be called, whenever a vector layer should be switched to edit mode.
virtual bool saveEdits(QgsVectorLayer *layer) const =0
Should be called, when the features should be committed but the editing session is not ended.
virtual bool copyMoveFeatures(QgsVectorLayer *layer, QgsFeatureRequest &request, double dx=0, double dy=0, QString *errorMsg=nullptr, const bool topologicalEditing=false, QgsVectorLayer *topologicalLayer=nullptr, QString *childrenInfoMsg=nullptr) const
Copy and move features with defined translation.
virtual bool addFeatureV2(QgsVectorLayer *layer, const QgsAttributeMap &defaultValues=QgsAttributeMap(), const QgsGeometry &defaultGeometry=QgsGeometry(), QgsFeature *feature=nullptr, const QgsVectorLayerToolsContext &context=QgsVectorLayerToolsContext()) const
This method should/will be called, whenever a new feature will be added to the layer.
virtual bool stopEditing(QgsVectorLayer *layer, bool allowCancel=true) const =0
Will be called, when an editing session is ended and the features should be committed.
Represents a vector layer which manages a vector based data sets.
#define SIP_OUT
Definition qgis_sip.h:58
QMap< int, QVariant > QgsAttributeMap