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;
180 void onCanvasRefreshed();
183 long long annotationItemRubberBandIndexFromId(
const QString &layerId,
const QString &itemId );
185 void setSelectedItemFromPoint(
const QgsPointXY &mapPoint,
bool toggleSelection =
false );
186 void setSelectedItemsFromRect(
const QgsRectangle &mapRect,
bool toggleSelection =
false );
187 void clearSelectedItems();
188 void updateSelectedItem();
190 std::vector<std::unique_ptr<QgsAnnotationItemRubberBand>> mSelectedItems;
191 std::vector<std::unique_ptr<QgsAnnotationItem>> mCopiedItems;
195 bool mHoveringMouseHandles =
false;
196 QPointF mLastScenePos;
199 QRect mSelectionRect;
201 bool mDragging =
false;
202 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.