17#ifndef QGSMAPTOOLSELECTANNOTATION_H
18#define QGSMAPTOOLSELECTANNOTATION_H
35class QgsAnnotationItemNodesSpatialIndex;
36class QgsMapToolSelectAnnotationMouseHandles;
60 QString
layerId()
const {
return mLayerId; }
70 QString
itemId()
const {
return mItemId; }
85 void updateBoundingBox(
const QgsRectangle &boundingBox );
95 void setNeedsUpdatedBoundingBox(
bool needsUpdatedBoundingBox );
101 bool mNeedsUpdatedBoundingBox =
true;
179 void onCanvasRefreshed();
182 long long annotationItemRubberBandIndexFromId(
const QString &layerId,
const QString &itemId );
184 void setSelectedItemFromPoint(
const QgsPointXY &mapPoint,
bool toggleSelection =
false );
185 void setSelectedItemsFromRect(
const QgsRectangle &mapRect,
bool toggleSelection =
false );
186 void clearSelectedItems();
187 void updateSelectedItem();
189 std::vector<std::unique_ptr<QgsAnnotationItemRubberBand>> mSelectedItems;
190 QList<QPair<QString, QString>> mCopiedItems;
194 bool mHoveringMouseHandles =
false;
195 QPointF mLastScenePos;
198 QRect mSelectionRect;
200 bool mDragging =
false;
201 bool mCanceled =
false;
Keeps a pointer to a QObject and deletes it whenever this object is deleted.
An annotation item rubberband used by QgsMapToolSelectAnnotation to represent selected items.
bool needsUpdatedBoundingBox() const
Returns true if the bounding box requires updating on fresh annotation item rendering.
QgsRectangle boundingBox() const
Returns the item bounding box.
QString itemId() const
Returns the annotation item ID.
QgsAnnotationItemRubberBand(const QString &layerId, const QString &itemId, QgsMapCanvas *canvas)
Constructor for QgsAnnotationItemRubberBand.
QString layerId() const
Returns the annotation layer ID.
~QgsAnnotationItemRubberBand() override=default
Abstract base class for annotation items which are drawn with QgsAnnotationLayers.
Represents a map layer containing a set of georeferenced annotations, e.g.
Map canvas is a class for displaying all GIS data types on a canvas.
A mouse event which is the result of a user interaction with a QgsMapCanvas.
A rectangle specified with double values.
Contains information about a rendered annotation item.
Responsible for drawing transient features (e.g.
QgsRubberBand(QgsMapCanvas *mapCanvas, Qgis::GeometryType geometryType=Qgis::GeometryType::Line)
Creates a new RubberBand.