18 #ifndef QGSANNOTATIONITEM_H 19 #define QGSANNOTATIONITEM_H 60 virtual QSizeF minimumFrameSize()
const;
66 Qt::CursorShape cursorShapeForAction(
MouseMoveAction moveAction )
const;
69 void setMapPositionFixed(
bool fixed );
72 virtual void setMapPosition(
const QgsPoint& pos );
87 void setFrameSize(
QSizeF size );
90 void setOffsetFromReferencePoint(
QPointF offset );
149 void updateBoundingRect();
151 void updateBalloon();
154 void drawFrame(
QPainter* p )
const;
157 void drawMarkerSymbol(
QPainter* p )
const;
160 void drawSelectionBoxes(
QPainter* p )
const;
167 QPointF pointOnLineWithDistance(
QPointF startPoint,
QPointF directionPoint,
double distance )
const;
169 double scaledSymbolSize()
const;
172 #endif // QGSANNOTATIONITEM_H QgsPoint mapPosition() const override
Returns the map position of the annotation, if it is attached to a fixed map position.
QgsMarkerSymbolV2 * mMarkerSymbol
Point symbol that is to be drawn at the map reference location.
QColor frameColor() const
double mFrameBorderWidth
Width of the frame.
virtual void setItemData(int role, const QVariant &value)=0
deprecated - do not use
QPointF mOffsetFromReferencePoint
Describes the shift of the item content box to the reference point.
An abstract class for items that can be placed on the map canvas.
virtual double scaleFactor() const =0
Returns a scaling factor which should be applied to painters before rendering the item...
Map canvas is a class for displaying all GIS data types on a canvas.
An interface for annotation items which are drawn over a map.
void setFrameColor(const QColor &c)
QRectF mBoundingRect
Bounding rect (including item frame and balloon)
virtual bool showItem() const override
Returns true if the annotation should be shown.
virtual QRectF boundingRect() const override
default implementation for canvas items
QPointF mBalloonSegmentPoint1
First segment point for drawing the connection (ccw direction)
void setFrameBorderWidth(double w)
const QgsMarkerSymbolV2 * markerSymbol() const
virtual QPointF relativePosition() const
Returns the relative position of the annotation, if it is not attached to a fixed map position...
int mBalloonSegment
Segment number where the connection to the map point is attached.
QgsCoordinateReferenceSystem mapPositionCrs() const override
Returns the CRS of the map position.
A class to represent a point.
bool mapPositionFixed() const override
Returns true if the annotation is attached to a fixed map position, or false if the annotation uses a...
QgsCoordinateReferenceSystem mMapPositionCrs
CRS of the map position.
An annotation item can be either placed either on screen corrdinates or on map coordinates.
bool mMapPositionFixed
True: the item stays at the same map position, False: the item stays on same screen position...
QColor mFrameColor
Frame / balloon color.
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr)=0
Paint the annotation to a destination painter.
QColor frameBackgroundColor() const
double frameBorderWidth() const
Class for storing a coordinate reference system (CRS)
QColor mFrameBackgroundColor
QPointF mBalloonSegmentPoint2
Second segment point for drawing the balloon connection (ccw direction)
QPointF offsetFromReferencePoint() const
Represents a vector layer which manages a vector based data sets.
QgsPoint mMapPosition
Map position (in case mMapPositionFixed is true)
virtual void updatePosition()
called on changed extent or resize event to update position of the item
QSizeF mFrameSize
Size of the frame (without balloon)
void setFrameBackgroundColor(const QColor &c)