16#ifndef QGSMODELARROWITEM_H
17#define QGSMODELARROWITEM_H
22#include <QGraphicsPathItem>
25class QgsModelComponentGraphicItem;
36class GUI_EXPORT QgsModelArrowItem :
public QObject,
public QGraphicsPathItem
54 QgsModelComponentGraphicItem *startItem,
59 QgsModelComponentGraphicItem *endItem,
72 QgsModelArrowItem( QgsModelComponentGraphicItem *startItem, Qt::Edge startEdge,
int startIndex, Marker startMarker, QgsModelComponentGraphicItem *endItem, Marker endMarker );
80 QgsModelArrowItem( QgsModelComponentGraphicItem *startItem, Marker startMarker, QgsModelComponentGraphicItem *endItem, Qt::Edge endEdge,
int endIndex, Marker endMarker );
87 QgsModelArrowItem( QgsModelComponentGraphicItem *startItem, Marker startMarker, QgsModelComponentGraphicItem *endItem, Marker endMarker );
89 void paint( QPainter *painter,
const QStyleOptionGraphicsItem *option, QWidget *widget =
nullptr )
override;
94 void setPenStyle( Qt::PenStyle style );
103 void painterPathUpdated();
113 QPointF bezierPointForCurve(
const QPointF &point, Qt::Edge edge,
bool incoming,
bool hasSpecificDirectionalFlow )
const;
115 void drawArrowHead( QPainter *painter,
const QPointF &point,
const QPointF &vector );
117 QgsModelComponentGraphicItem *mStartItem =
nullptr;
118 Qt::Edge mStartEdge = Qt::LeftEdge;
119 int mStartIndex = -1;
120 bool mStartIsOutgoing =
true;
123 QgsModelComponentGraphicItem *mEndItem =
nullptr;
124 Qt::Edge mEndEdge = Qt::LeftEdge;
126 bool mEndIsIncoming =
false;