17#ifndef QGSMAPTOOLSELECTANNOTATION_H
18#define QGSMAPTOOLSELECTANNOTATION_H
37class QgsAnnotationItemNodesSpatialIndex;
38class QgsMapToolSelectAnnotationMouseHandles;
61 QString
layerId()
const {
return mLayerId; }
71 QString
itemId()
const {
return mItemId; }
86 void updateBoundingBox(
const QgsRectangle &boundingBox );
96 void setNeedsUpdatedBoundingBox(
bool needsUpdatedBoundingBox );
102 bool mNeedsUpdatedBoundingBox =
true;
181 void onCanvasRefreshed();
184 long long annotationItemRubberBandIndexFromId(
const QString &layerId,
const QString &itemId );
186 void setSelectedItemFromPoint(
const QgsPointXY &mapPoint,
bool toggleSelection =
false );
187 void setSelectedItemsFromRect(
const QgsRectangle &mapRect,
bool toggleSelection =
false );
188 void clearSelectedItems();
189 void updateSelectedItem();
191 std::vector<std::unique_ptr<QgsAnnotationItemRubberBand>> mSelectedItems;
192 std::vector<std::unique_ptr<QgsAnnotationItem>> mCopiedItems;
196 bool mHoveringMouseHandles =
false;
197 QPointF mLastScenePos;
200 QRect mSelectionRect;
202 bool mDragging =
false;
203 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.