QGIS API Documentation 3.99.0-Master (09f76ad7019)
Loading...
Searching...
No Matches
qgsmaptoolshapeabstract.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsmaptoolshapeabstract.cpp
3 ----------------------
4 begin : January 2022
5 copyright : (C) 2022 by Denis Rouzaud
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
19
21#include "qgsmapcanvas.h"
22
23#include <QKeyEvent>
24
25#include "moc_qgsmaptoolshapeabstract.cpp"
26
31
33{
34 e->ignore();
35}
36
38{
39 e->ignore();
40}
41
43{
44 if ( mTempRubberBand )
45 {
46 delete mTempRubberBand;
47 mTempRubberBand = nullptr;
48 }
49
50 mPoints.clear();
51}
52
54{
55 if ( mPoints.count() == 1 )
56 clean();
57 else if ( mPoints.count() > 1 )
58 mPoints.removeLast();
59}
60
62{
63 emit transientGeometryChanged( QgsReferencedGeometry( geometry, mParentTool->canvas()->mapSettings().destinationCrs() ) );
64}
A geometry is the spatial representation of a feature.
void transientGeometryChanged(const QgsReferencedGeometry &geometry)
Emitted whenever the geometry associated with the tool is changed, including transient (i....
QgsPointSequence mPoints
points (in map coordinates)
virtual void keyReleaseEvent(QKeyEvent *e)
Filters a key release event Ignores the event in default implementation.
virtual void undo()
Called to undo last action (last point added).
virtual void clean()
Called to clean the map tool (after canceling the operation or when the digitization has finished).
void setTransientGeometry(const QgsGeometry &geometry)
Sets the current geometry, including transient (i.e.
virtual void keyPressEvent(QKeyEvent *e)
Filters a key press event Ignores the event in default implementation.
QgsGeometryRubberBand * mTempRubberBand
A QgsGeometry with associated coordinate reference system.