QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
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"
20#include "qgsmaptoolcapture.h"
21
22#define SIP_NO_FILE
23
26
27
39{
40 Q_OBJECT
41 public:
45 QgsMapTool *mapTool() override;
46 QgsMapLayer *layer() const override;
48 bool supportsTechnique( Qgis::CaptureTechnique technique ) const override;
49
50 protected:
51
53
54};
55
82
83
93{
94 Q_OBJECT
95
96 public:
99
101
102};
103
113{
114 Q_OBJECT
115
116 public:
119
120 private slots:
121 void lineCaptured( const QgsCurve *line ) override;
122};
123
133{
134 Q_OBJECT
135
136 public:
139
140 private slots:
141 void polygonCaptured( const QgsCurvePolygon *polygon ) override;
142};
143
153{
154 Q_OBJECT
155
156 public:
159
160 void cadCanvasPressEvent( QgsMapMouseEvent *event ) override;
161 void cadCanvasMoveEvent( QgsMapMouseEvent *event ) override;
162 void keyPressEvent( QKeyEvent *event ) override;
163
165 QgsMapTool *mapTool() override;
166
167 private:
168 QgsCreateAnnotationItemMapToolHandler *mHandler = nullptr;
169
170 QRectF mRect;
171 QgsPointXY mFirstPoint;
173};
174
184{
185 Q_OBJECT
186
187 public:
188 static inline QgsSettingsTreeNode *sTreePicture = QgsCreateAnnotationItemMapToolInterface::sTreeAnnotationTools->createChildNode( QStringLiteral( "picture-item" ) );
190
193
194 void cadCanvasPressEvent( QgsMapMouseEvent *event ) override;
195 void cadCanvasMoveEvent( QgsMapMouseEvent *event ) override;
196 void keyPressEvent( QKeyEvent *event ) override;
197
199 QgsMapTool *mapTool() override;
200
201 private:
203 QgsCreateAnnotationItemMapToolHandler *mHandler = nullptr;
204
205 QRectF mRect;
206 QgsPointXY mFirstPoint;
208};
209
219{
220 Q_OBJECT
221
222 public:
225
226 private slots:
227 void lineCaptured( const QgsCurve *line ) override;
228};
229
230
231#endif // QGSCREATEANNOTATIONITEMMAPTOOLIMPL_H
CaptureTechnique
Capture technique.
Definition qgis.h:376
The QgsAdvancedDigitizingDockWidget class is a dockable widget used to handle the CAD tools on top of...
A handler object for map tools which create annotation items.
An interface for map tools which create annotation items.
A map tool to digitize line items.
QgsCreateLineItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
A map tool to digitize line text items.
QgsCreateLineTextItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
A map tool to digitize marker items.
QgsCreateMarkerItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
void cadCanvasReleaseEvent(QgsMapMouseEvent *event) override
Override this method when subclassing this class.
A map tool to digitize picture items.
void cadCanvasMoveEvent(QgsMapMouseEvent *event) override
Override this method when subclassing this class.
static const QgsSettingsEntryString * settingLastSourceFolder
QgsCreateAnnotationItemMapToolHandler * handler() const override
Returns the handler object for the map tool.
void cadCanvasPressEvent(QgsMapMouseEvent *event) override
Override this method when subclassing this class.
void keyPressEvent(QKeyEvent *event) override
Key event for overriding. Default implementation does nothing.
QgsCreatePictureItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
QgsMapTool * mapTool() override
Returns a reference to the associated map tool.
A map tool to digitize point text items.
~QgsCreatePointTextItemMapTool() override
QgsMapTool * mapTool() override
Returns a reference to the associated map tool.
void cadCanvasPressEvent(QgsMapMouseEvent *event) override
Override this method when subclassing this class.
QgsCreatePointTextItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
QgsCreateAnnotationItemMapToolHandler * handler() const override
Returns the handler object for the map tool.
A map tool to digitize polygon items.
QgsCreatePolygonItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
A map tool to digitize rectangle text items.
QgsCreateRectangleTextItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
QgsMapTool * mapTool() override
Returns a reference to the associated map tool.
void cadCanvasMoveEvent(QgsMapMouseEvent *event) override
Override this method when subclassing this class.
void cadCanvasPressEvent(QgsMapMouseEvent *event) override
Override this method when subclassing this class.
void keyPressEvent(QKeyEvent *event) override
Key event for overriding. Default implementation does nothing.
QgsCreateAnnotationItemMapToolHandler * handler() const override
Returns the handler object for the map tool.
Curve polygon geometry type.
Abstract base class for curved geometry type.
Definition qgscurve.h:35
Map canvas is a class for displaying all GIS data types on a canvas.
Base class for all map layer types.
Definition qgsmaplayer.h:76
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
The QgsMapToolAdvancedDigitizing class is a QgsMapTool which gives event directly in map coordinates ...
A base class to digitize annotation items using QgsMapToolCapture.
QgsMapToolCaptureAnnotationItem(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget, CaptureMode mode)
Constructor.
QgsMapTool * mapTool() override
Returns a reference to the associated map tool.
bool supportsTechnique(Qgis::CaptureTechnique technique) const override
Returns true if the tool supports the specified capture technique.
QgsMapLayer * layer() const override
Returns the layer associated with the map tool.
QgsMapToolCapture::Capabilities capabilities() const override
Returns flags containing the supported capabilities.
QgsCreateAnnotationItemMapToolHandler * handler() const override
Returns the handler object for the map tool.
QgsMapToolCapture is a base class capable of capturing point, lines and polygons.
QFlags< Capability > Capabilities
CaptureMode
Different capture modes.
Abstract base class for all map tools.
Definition qgsmaptool.h:71
A class to represent a 2D point.
Definition qgspointxy.h:60
A string settings entry.
QgsSettingsTreeNode is a tree node for the settings tree to help organizing and introspecting the tre...
QgsSettingsTreeNode * createChildNode(const QString &key)
Creates a normal tree node It will return the existing child node if it exists at the given key.