QGIS API Documentation  3.27.0-Master (597e8eebd4)
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 
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  bool supportsTechnique( Qgis::CaptureTechnique technique ) const override;
47 
48  void cadCanvasReleaseEvent( QgsMapMouseEvent *e ) override;
49 
54  void setLayer( QgsMapLayer *vl );
55 
56  void activate() override;
57  void deactivate() override;
58 
59  signals:
60 
65  void digitizingCompleted( const QgsFeature &feature );
66 
72 
73  protected:
74 
79  bool checkGeometryType() const;
80 
85  void setCheckGeometryType( bool checkGeometryType );
86  // TODO QGIS 4: remove if GRASS plugin is dropped
87 
88  private:
89 
94  void layerGeometryCaptured( const QgsGeometry &geometry ) FINAL;
95 
100  virtual void featureDigitized( const QgsFeature &feature ) {Q_UNUSED( feature )} SIP_FORCE
101 
106  QgsMapLayer *mLayer = nullptr;
107 
112  QgsMapLayer *mCurrentLayer = nullptr;
113 
118  bool mCheckGeometryType;
119 
120  friend class TestQgsRelationReferenceWidget;
121 };
122 
123 #endif // QGSMAPTOOLDIGITIZEFEATURE_H
CaptureTechnique
Capture technique.
Definition: qgis.h:153
The QgsAdvancedDigitizingDockWidget class is a dockable widget used to handle the CAD tools on top of...
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition: qgsfeature.h:56
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:125
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:90
Base class for all map layer types.
Definition: qgsmaplayer.h:73
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
QgsMapToolCaptureLayerGeometry is a base class for map tools digitizing layer geometries This map too...
void deactivate() override
Unregisters this maptool from the cad dock widget.
void activate() override
Registers this maptool with the cad dock widget.
CaptureMode
Different capture modes.
@ CaptureNone
Do not capture / determine mode from layer geometry type.
virtual bool supportsTechnique(Qgis::CaptureTechnique technique) const
Returns true if the tool supports the specified capture technique.
virtual QgsMapToolCapture::Capabilities capabilities() const
Returns flags containing the supported capabilities.
void cadCanvasReleaseEvent(QgsMapMouseEvent *e) override
Override this method when subclassing this class.
This tool digitizes geometry of new point/line/polygon features on already existing vector layers Onc...
void digitizingCompleted(const QgsFeature &feature)
Emitted whenever the digitizing has been successfully completed.
void digitizingFinished()
Emitted whenever the digitizing has been ended without digitizing any feature.
#define SIP_FORCE
Definition: qgis_sip.h:131
#define FINAL
Definition: qgis_sip.h:237