QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgsmaptooledit.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmaptooledit.h - base class for editing map tools
3  ---------------------
4  begin : Juli 2007
5  copyright : (C) 2007 by Marco Hugentobler
6  email : marco dot hugentobler at karto dot baug dot ethz dot ch
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSMAPTOOLEDIT_H
17 #define QGSMAPTOOLEDIT_H
18 
19 #include "qgis.h"
20 #include "qgsmaptool.h"
21 
22 class QgsRubberBand;
24 class QgsVectorLayer;
25 class QKeyEvent;
26 
30 class GUI_EXPORT QgsMapToolEdit: public QgsMapTool
31 {
32  Q_OBJECT
33 
34  public:
35  QgsMapToolEdit( QgsMapCanvas* canvas );
36  virtual ~QgsMapToolEdit();
37 
38  virtual Flags flags() const override { return QgsMapTool::EditTool; }
39 
40  protected:
41 
48  QgsRubberBand* createRubberBand( QGis::GeometryType geometryType = QGis::Line, bool alternativeBand = false );
49 
50  QgsGeometryRubberBand* createGeometryRubberBand( QGis::GeometryType geometryType = QGis::Line, bool alternativeBand = false ) const;
51 
53  QgsVectorLayer* currentVectorLayer();
54 
59  int addTopologicalPoints( const QList<QgsPoint>& geom );
60 
62  void notifyNotVectorLayer();
64  void notifyNotEditableLayer();
65 };
66 
67 #endif
GeometryType
Definition: qgis.h:115
Base class for map tools that edit vector geometry.
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:109
A class for drawing transient features (e.g.
Definition: qgsrubberband.h:32
virtual Flags flags() const override
Returns the flags for the map tool.
Abstract base class for all map tools.
Definition: qgsmaptool.h:50
A rubberband class for QgsAbstractGeometryV2 (considering curved geometries)
Represents a vector layer which manages a vector based data sets.