QGIS API Documentation  3.13.0-Master (5a3b1ced84)
qgsmaptooldigitizefeature.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmaptooldigitizegeometry.h
3 
4  ---------------------
5  begin : 7.12.2017
6  copyright : (C) 2017 by David Signer
7  email : david at opengis dot 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 QGSMAPTOOLDIGITIZEFEATURE_H
17 #define QGSMAPTOOLDIGITIZEFEATURE_H
18 
19 #include "qgsmaptoolcapture.h"
20 #include "qgis_gui.h"
21 
22 class QgsFeature;
23 
32 {
33  Q_OBJECT
34 
35  public:
36 
44 
45  void cadCanvasReleaseEvent( QgsMapMouseEvent *e ) override;
46 
51  void setLayer( QgsMapLayer *vl );
52 
53  void activate() override;
54  void deactivate() override;
55 
56  signals:
57 
62  void digitizingCompleted( const QgsFeature &feature );
63 
68  void digitizingFinished( );
69 
70  protected:
71 
76  bool checkGeometryType() const;
77 
82  void setCheckGeometryType( bool checkGeometryType );
83 
84  private:
85 
90  virtual void digitized( const QgsFeature &f );
91 
95  QgsMapLayer *mLayer = nullptr;
96 
100  QgsMapLayer *mCurrentLayer = nullptr;
101 
105  bool mCheckGeometryType;
106 
107  friend class TestQgsRelationReferenceWidget;
108 };
109 
110 #endif // QGSMAPTOOLDIGITIZEFEATURE_H
Base class for all map layer types.
Definition: qgsmaplayer.h:80
CaptureMode
Different capture modes.
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:55
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:78
Do not capture / determine mode from layer geometry type.
void activate() override
Registers this maptool with the cad dock widget.
void deactivate() override
Unregisters this maptool from the cad dock widget.
This tool digitizes geometry of new point/line/polygon features on already existing vector layers Onc...
virtual void cadCanvasReleaseEvent(QgsMapMouseEvent *e)
Override this method when subclassing this class.
The QgsAdvancedDigitizingDockWidget class is a dockable widget used to handle the CAD tools on top of...