/
qgsmaptooladdfeature.h
50 lines (41 loc) · 1.84 KB
/
qgsmaptooladdfeature.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/***************************************************************************
qgsmaptooladdfeature.h - map tool for adding point/line/polygon features
---------------------
begin : April 2007
copyright : (C) 2007 by Marco Hugentobler
email : marco dot hugentobler at karto dot baug dot ethz dot ch
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "qgsmaptooldigitizefeature.h"
//! This tool adds new point/line/polygon features to already existing vector layers
class APP_EXPORT QgsMapToolAddFeature : public QgsMapToolDigitizeFeature
{
Q_OBJECT
public:
//! \since QGIS 2.12
QgsMapToolAddFeature( QgsMapCanvas *canvas, CaptureMode mode );
bool addFeature( QgsVectorLayer *vlayer, QgsFeature *f, bool showModal = true );
void digitized( QgsFeature &f ) override;
protected:
/**
* Check if CaptureMode matches layer type. Default is true.
* \since QGIS 3.0
*/
bool checkGeometryType() const;
/**
* Check if CaptureMode matches layer type. Default is true.
* \since QGIS 3.0
*/
void setCheckGeometryType( bool checkGeometryType );
private:
/**
* Check if CaptureMode matches layer type. Default is true.
* \since QGIS 2.12 */
bool mCheckGeometryType;
};