QGIS API Documentation 3.99.0-Master (c03dd32cbdd)
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#include <QString>
23
24#define SIP_NO_FILE
25
26using namespace Qt::StringLiterals;
27
28
31
32
58
83
84
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:
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
Keeps a pointer to a QObject and deletes it whenever this object is deleted.
CaptureTechnique
Capture technique.
Definition qgis.h:415
A dockable widget used to handle the CAD tools on top of a selection of map tools.
A handler object for map tools which create annotation items.
An interface for map tools which create annotation items.
QgsCreateLineItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
QgsCreateLineTextItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
QgsCreateMarkerItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
void cadCanvasReleaseEvent(QgsMapMouseEvent *event) override
Override this method when subclassing this class.
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.
~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.
QgsCreatePolygonItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
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:36
Map canvas is a class for displaying all GIS data types on a canvas.
Base class for all map layer types.
Definition qgsmaplayer.h:83
A mouse event which is the result of a user interaction with a QgsMapCanvas.
QgsAdvancedDigitizingDockWidget * cadDockWidget() const
QgsMapToolAdvancedDigitizing(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Creates an advanced digitizing maptool.
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.
QgsCreateAnnotationItemMapToolHandler * mHandler
QgsMapToolCapture::Capabilities capabilities() const override
Returns flags containing the supported capabilities.
QgsCreateAnnotationItemMapToolHandler * handler() const override
Returns the handler object for the map tool.
CaptureMode mode() const
The capture mode.
QgsMapToolCapture(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget, CaptureMode mode)
constructor
QFlags< Capability > Capabilities
CaptureMode
Different capture modes.
virtual void polygonCaptured(const QgsCurvePolygon *polygon)
Called when a polygon is captured.
virtual void lineCaptured(const QgsCurve *line)
Called when a line is captured.
Abstract base class for all map tools.
Definition qgsmaptool.h:72
QgsMapCanvas * canvas() const
returns pointer to the tool's map canvas
QgsMapTool(QgsMapCanvas *canvas)
Constructor takes a map canvas as a parameter.
friend class QgsMapCanvas
Definition qgsmaptool.h:389
Represents a 2D point.
Definition qgspointxy.h:62
A string settings entry.
A tree node for the settings tree to help organizing and introspecting the tree.