QGIS API Documentation  2.12.0-Lyon
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 
28 class GUI_EXPORT QgsMapToolEdit: public QgsMapTool
29 {
30  Q_OBJECT
31 
32  public:
33  QgsMapToolEdit( QgsMapCanvas* canvas );
34  virtual ~QgsMapToolEdit();
35 
40  virtual bool isEditTool() override { return true; }
41 
42  protected:
43 
50  QgsRubberBand* createRubberBand( QGis::GeometryType geometryType = QGis::Line, bool alternativeBand = false );
51 
52  QgsGeometryRubberBand* createGeometryRubberBand( QGis::GeometryType geometryType = QGis::Line ) const;
53 
55  QgsVectorLayer* currentVectorLayer();
56 
60  int addTopologicalPoints( const QList<QgsPoint>& geom );
61 
63  void notifyNotVectorLayer();
65  void notifyNotEditableLayer();
66 };
67 
68 #endif
GeometryType
Definition: qgis.h:104
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:107
A class for drawing transient features (e.g.
Definition: qgsrubberband.h:32
Abstract base class for all map tools.
Definition: qgsmaptool.h:50
A rubberband class for QgsAbstractGeometryV2 (considering curved geometries)
virtual bool isEditTool() override
Is this an edit tool?
Represents a vector layer which manages a vector based data sets.