QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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  QgsMapToolCapture::Capabilities capabilities() const override;
46 
47  void cadCanvasReleaseEvent( QgsMapMouseEvent *e ) override;
48 
53  void setLayer( QgsMapLayer *vl );
54 
55  void activate() override;
56  void deactivate() override;
57 
58  signals:
59 
64  void digitizingCompleted( const QgsFeature &feature );
65 
71 
72  protected:
73 
78  bool checkGeometryType() const;
79 
84  void setCheckGeometryType( bool checkGeometryType );
85 
86  private:
87 
92  virtual void digitized( const QgsFeature &f );
93 
98  QgsMapLayer *mLayer = nullptr;
99 
104  QgsMapLayer *mCurrentLayer = nullptr;
105 
110  bool mCheckGeometryType;
111 
112  friend class TestQgsRelationReferenceWidget;
113 };
114 
115 #endif // QGSMAPTOOLDIGITIZEFEATURE_H
QgsMapToolCapture::CaptureMode
CaptureMode
Different capture modes.
Definition: qgsmaptoolcapture.h:130
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:85
QgsMapToolDigitizeFeature::digitizingCompleted
void digitizingCompleted(const QgsFeature &feature)
Emitted whenever the digitizing has been successfully completed.
QgsMapToolCapture::activate
void activate() override
Registers this maptool with the cad dock widget.
Definition: qgsmaptoolcapture.cpp:88
QgsMapToolCapture::capabilities
virtual QgsMapToolCapture::Capabilities capabilities() const
Returns flags containing the supported capabilities.
Definition: qgsmaptoolcapture.cpp:83
QgsMapToolDigitizeFeature
This tool digitizes geometry of new point/line/polygon features on already existing vector layers Onc...
Definition: qgsmaptooldigitizefeature.h:32
QgsAdvancedDigitizingDockWidget
The QgsAdvancedDigitizingDockWidget class is a dockable widget used to handle the CAD tools on top of...
Definition: qgsadvanceddigitizingdockwidget.h:49
QgsMapMouseEvent
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
Definition: qgsmapmouseevent.h:36
QgsMapLayer
Base class for all map layer types.
Definition: qgsmaplayer.h:83
QgsMapToolCapture::CaptureNone
@ CaptureNone
Do not capture / determine mode from layer geometry type.
Definition: qgsmaptoolcapture.h:131
qgsmaptoolcapture.h
QgsFeature
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:56
QgsMapToolCapture::deactivate
void deactivate() override
Unregisters this maptool from the cad dock widget.
Definition: qgsmaptoolcapture.cpp:97
QgsMapToolCapture
Definition: qgsmaptoolcapture.h:123
QgsMapToolAdvancedDigitizing::cadCanvasReleaseEvent
virtual void cadCanvasReleaseEvent(QgsMapMouseEvent *e)
Override this method when subclassing this class.
Definition: qgsmaptooladvanceddigitizing.h:134
QgsMapToolDigitizeFeature::digitizingFinished
void digitizingFinished()
Emitted whenever the digitizing has been ended without digitizing any feature.