QGIS API Documentation  2.14.0-Essen
qgsmaptooladvanceddigitizing.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmaptooladvanceddigitizing.h - map tool with event in map coordinates
3  ----------------------
4  begin : October 2014
5  copyright : (C) Denis Rouzaud
6  email : denis.rouzaud@gmail.com
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 
17 #ifndef QGSMAPTOOLADVANCEDDIGITIZE_H
18 #define QGSMAPTOOLADVANCEDDIGITIZE_H
19 
20 #include "qgsmaptool.h"
21 #include "qgsmaptooledit.h"
23 
24 class QgsMapMouseEvent;
25 
35 {
36  Q_OBJECT
37  public:
40  {
44  CapturePolygon
45  };
46 
53 
55 
57  virtual void canvasPressEvent( QgsMapMouseEvent* e ) override;
59  virtual void canvasReleaseEvent( QgsMapMouseEvent* e ) override;
61  virtual void canvasMoveEvent( QgsMapMouseEvent* e ) override;
62 
68  CaptureMode mode() const { return mCaptureMode; }
69 
76  void setMode( CaptureMode mode ) { mCaptureMode = mode; }
77 
81  virtual void activate() override;
82 
86  virtual void deactivate() override;
87 
88  QgsAdvancedDigitizingDockWidget* cadDockWidget() const { return mCadDockWidget; }
89 
90  protected:
99  virtual void cadCanvasPressEvent( QgsMapMouseEvent* e ) { Q_UNUSED( e ) }
100 
101 
110  virtual void cadCanvasReleaseEvent( QgsMapMouseEvent* e ) { Q_UNUSED( e ) }
111 
112 
121  virtual void cadCanvasMoveEvent( QgsMapMouseEvent* e ) { Q_UNUSED( e ) }
122 
125 
128  bool mSnapOnMove;
130 
131  private slots:
140  void cadPointChanged( const QgsPoint& point );
141 
142  private:
143  QgsAdvancedDigitizingDockWidget* mCadDockWidget;
144 
145  void snap( QgsMapMouseEvent* e );
146 };
147 
148 #endif // QGSMAPTOOLADVANCEDDIGITIZE_H
virtual void canvasMoveEvent(QgsMapMouseEvent *e)
Mouse move event for overriding. Default implementation does nothing.
Definition: qgsmaptool.cpp:145
void setMode(CaptureMode mode)
Set capture mode.
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
The QgsMapToolAdvancedDigitizing class is a QgsMapTool whcih gives event directly in map coordinates ...
bool mSnapOnDoubleClick
snap on double click
CaptureMode mode() const
The capture mode.
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:105
virtual void canvasPressEvent(QgsMapMouseEvent *e)
Mouse press event for overriding. Default implementation does nothing.
Definition: qgsmaptool.cpp:155
virtual void activate()
called when set as currently active map tool
Definition: qgsmaptool.cpp:83
QgsAdvancedDigitizingDockWidget * cadDockWidget() const
CaptureMode mCaptureMode
The capture mode in which this tool operates.
virtual void deactivate()
called when map tool is being deactivated
Definition: qgsmaptool.cpp:99
A class to represent a point.
Definition: qgspoint.h:65
virtual void cadCanvasPressEvent(QgsMapMouseEvent *e)
Override this method when subclassing this class.
virtual void cadCanvasMoveEvent(QgsMapMouseEvent *e)
Override this method when subclassing this class.
virtual void cadCanvasReleaseEvent(QgsMapMouseEvent *e)
Override this method when subclassing this class.
The QgsAdvancedDigitizingDock class is a dockable widget used to handle the CAD tools on top of a sel...
virtual void canvasReleaseEvent(QgsMapMouseEvent *e)
Mouse release event for overriding. Default implementation does nothing.
Definition: qgsmaptool.cpp:160