QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgscreateannotationitemmaptool_impl.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgscreateannotationitemmaptool_impl.h
3  ------------------------
4  Date : September 2021
5  Copyright : (C) 2021 Nyall Dawson
6  Email : nyall dot dawson at gmail dot 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 #ifndef QGSCREATEANNOTATIONITEMMAPTOOLIMPL_H
16 #define QGSCREATEANNOTATIONITEMMAPTOOLIMPL_H
17 
18 #include "qgis_gui.h"
19 #include "qgis_sip.h"
21 #include "qgsmaptoolcapture.h"
22 
23 #define SIP_NO_FILE
24 
26 
27 class QgsMapToolCaptureAnnotationItem: public QgsMapToolCapture, public QgsCreateAnnotationItemMapToolInterface
28 {
29  Q_OBJECT
30  public:
31  QgsMapToolCaptureAnnotationItem( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget, CaptureMode mode );
33  QgsMapTool *mapTool() override;
34  QgsMapLayer *layer() const override;
35  QgsMapToolCapture::Capabilities capabilities() const override;
36  bool supportsTechnique( Qgis::CaptureTechnique technique ) const override;
37 
38  protected:
39 
40  QgsCreateAnnotationItemMapToolHandler *mHandler = nullptr;
41 
42 };
43 
44 class QgsCreatePointTextItemMapTool: public QgsMapToolAdvancedDigitizing, public QgsCreateAnnotationItemMapToolInterface
45 {
46  Q_OBJECT
47 
48  public:
49 
50  QgsCreatePointTextItemMapTool( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget );
51  ~QgsCreatePointTextItemMapTool() override;
52 
53  void cadCanvasPressEvent( QgsMapMouseEvent *event ) override;
55  QgsMapTool *mapTool() override;
56 
57  private:
58 
59  QgsCreateAnnotationItemMapToolHandler *mHandler = nullptr;
60 
61 };
62 
63 
64 class QgsCreateMarkerItemMapTool: public QgsMapToolCaptureAnnotationItem
65 {
66  Q_OBJECT
67 
68  public:
69 
70  QgsCreateMarkerItemMapTool( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget );
71 
72  void cadCanvasReleaseEvent( QgsMapMouseEvent *event ) override;
73 
74 };
75 
76 class QgsCreateLineItemMapTool: public QgsMapToolCaptureAnnotationItem
77 {
78  Q_OBJECT
79 
80  public:
81 
82  QgsCreateLineItemMapTool( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget );
83 
84  private slots:
85  void lineCaptured( const QgsCurve *line ) override;
86 };
87 
88 class QgsCreatePolygonItemMapTool: public QgsMapToolCaptureAnnotationItem
89 {
90  Q_OBJECT
91 
92  public:
93 
94  QgsCreatePolygonItemMapTool( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget );
95 
96  private slots:
97  void polygonCaptured( const QgsCurvePolygon *polygon ) override;
98 };
99 
101 
102 #endif // QGSCREATEANNOTATIONITEMMAPTOOLIMPL_H
QgsCurve
Abstract base class for curved geometry type.
Definition: qgscurve.h:35
QgsCreateAnnotationItemMapToolInterface::mapTool
virtual QgsMapTool * mapTool()=0
Returns a reference to the associated map tool.
QgsCreateAnnotationItemMapToolInterface
An interface for map tools which create annotation items.
Definition: qgscreateannotationitemmaptool.h:102
QgsCurvePolygon
Curve polygon geometry type.
Definition: qgscurvepolygon.h:34
qgscreateannotationitemmaptool.h
QgsMapToolCapture::supportsTechnique
virtual bool supportsTechnique(Qgis::CaptureTechnique technique) const
Returns true if the tool supports the specified capture technique.
Definition: qgsmaptoolcapture.cpp:102
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:89
QgsCreateAnnotationItemMapToolInterface::handler
virtual QgsCreateAnnotationItemMapToolHandler * handler()=0
Returns the handler object for the map tool.
QgsMapToolAdvancedDigitizing::layer
virtual QgsMapLayer * layer() const
Returns the layer associated with the map tool.
Definition: qgsmaptooladvanceddigitizing.cpp:145
QgsCreateAnnotationItemMapToolHandler
A handler object for map tools which create annotation items.
Definition: qgscreateannotationitemmaptool.h:40
QgsMapTool
Abstract base class for all map tools. Map tools are user interactive tools for manipulating the map ...
Definition: qgsmaptool.h:70
QgsMapToolCapture::capabilities
virtual QgsMapToolCapture::Capabilities capabilities() const
Returns flags containing the supported capabilities.
Definition: qgsmaptoolcapture.cpp:97
qgis_sip.h
QgsAdvancedDigitizingDockWidget
The QgsAdvancedDigitizingDockWidget class is a dockable widget used to handle the CAD tools on top of...
Definition: qgsadvanceddigitizingdockwidget.h:50
QgsMapMouseEvent
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas....
Definition: qgsmapmouseevent.h:35
QgsMapLayer
Base class for all map layer types. This is the base class for all map layer types (vector,...
Definition: qgsmaplayer.h:72
qgsmaptoolcapture.h
QgsMapToolCapture
Definition: qgsmaptoolcapture.h:49
Qgis::CaptureTechnique
CaptureTechnique
Capture technique.
Definition: qgis.h:152
QgsMapToolAdvancedDigitizing
The QgsMapToolAdvancedDigitizing class is a QgsMapTool which gives event directly in map coordinates ...
Definition: qgsmaptooladvanceddigitizing.h:36
QgsMapToolAdvancedDigitizing::cadCanvasPressEvent
virtual void cadCanvasPressEvent(QgsMapMouseEvent *e)
Override this method when subclassing this class.
Definition: qgsmaptooladvanceddigitizing.h:132