QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
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
7
email : matthias@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 "
qgsexpressioncontext.h
"
21
#include "
qgsvectorlayertools.h
"
22
28
class
CORE_EXPORT
QgsTrackedVectorLayerTools
:
public
QgsVectorLayerTools
29
{
30
Q_OBJECT
31
public
:
32
QgsTrackedVectorLayerTools
() =
default
;
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
(
50
QgsVectorLayer
*layer,
51
QgsFeatureRequest
&request,
52
double
dx = 0,
53
double
dy = 0,
54
QString *errorMsg =
nullptr
,
55
const
bool
topologicalEditing =
false
,
56
QgsVectorLayer
*topologicalLayer =
nullptr
,
57
QString *childrenInfoMsg =
nullptr
58
)
const override
;
59
63
void
setVectorLayerTools
(
const
QgsVectorLayerTools
*tools );
64
68
void
rollback
();
69
70
private
:
71
const
QgsVectorLayerTools
*mBackend =
nullptr
;
72
// TODO QGIS5: remove mutable once methods are no longer const
73
mutable
QMap<QgsVectorLayer *, QgsFeatureIds> mAddedFeatures;
74
};
75
76
#endif
// QGSTRACKEDVECTORLAYERTOOLS_H
QgsFeatureRequest
Wraps a request for features to a vector layer (or directly its vector data provider).
Definition
qgsfeaturerequest.h:85
QgsFeature
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition
qgsfeature.h:60
QgsGeometry
A geometry is the spatial representation of a feature.
Definition
qgsgeometry.h:267
QgsTrackedVectorLayerTools::setVectorLayerTools
void setVectorLayerTools(const QgsVectorLayerTools *tools)
Set the vector layer tools that will be used to interact with the data.
Definition
qgstrackedvectorlayertools.cpp:70
QgsTrackedVectorLayerTools::rollback
void rollback()
Delete all features which have been added via this object.
Definition
qgstrackedvectorlayertools.cpp:75
QgsTrackedVectorLayerTools::QgsTrackedVectorLayerTools
QgsTrackedVectorLayerTools()=default
QgsVectorLayerToolsContext
Contains settings which reflect the context in which vector layer tool operations should be considere...
Definition
qgsvectorlayertoolscontext.h:32
QgsVectorLayerTools::startEditing
virtual bool startEditing(QgsVectorLayer *layer) const =0
This will be called, whenever a vector layer should be switched to edit mode.
QgsVectorLayerTools::saveEdits
virtual bool saveEdits(QgsVectorLayer *layer) const =0
Should be called, when the features should be committed but the editing session is not ended.
QgsVectorLayerTools::copyMoveFeatures
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.
Definition
qgsvectorlayertools.cpp:35
QgsVectorLayerTools::addFeatureV2
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.
Definition
qgsvectorlayertools.h:96
QgsVectorLayerTools::QgsVectorLayerTools
QgsVectorLayerTools()
Definition
qgsvectorlayertools.cpp:31
QgsVectorLayerTools::stopEditing
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.
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:414
SIP_OUT
#define SIP_OUT
Definition
qgis_sip.h:57
QgsAttributeMap
QMap< int, QVariant > QgsAttributeMap
Definition
qgsattributes.h:40
qgsexpressioncontext.h
qgsvectorlayertools.h
Generated on
for QGIS API Documentation by
1.17.0