DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
SchemaGraphicSegmentedArrow.hpp
Go to the documentation of this file.
1#ifndef SchemaGraphicSegmentedArrow_H
2#define SchemaGraphicSegmentedArrow_H
3
5#include <QGraphicsPathItem>
9
10namespace dbse {
11
12class SchemaGraphicSegmentedArrow : public QGraphicsPathItem
13{
14public:
16 SchemaGraphicObject* EndItem,
17 int connection_count,
18 bool IsInheritance,
19 bool IsComposite,
20 QString ArrowName,
21 QString ArrowCardinality,
22 QGraphicsItem* parent = nullptr);
24 QRectF boundingRect() const;
25 QPainterPath shape() const;
26 void UpdatePosition();
29 bool GetInheritanceMode();
30 void RemoveArrow();
31
32protected:
33 void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
34 void hoverEnterEvent(QGraphicsSceneHoverEvent* ev);
35 void hoverLeaveEvent(QGraphicsSceneHoverEvent* ev);
36
37private:
38 QPointF p1() const { return path().elementCount() > 0 ? path().elementAt(0) : QPointF(); }
39 QPointF p2() const { return path().elementCount() > 0 ? path().elementAt(path().elementCount() - 1) : QPointF(); }
40 qreal dx() const { return p2().x() - p1().x(); }
41 qreal dy() const { return p2().y() - p1().y(); }
42
43 QPolygonF make_arrow_head(qreal angle) const;
44 QPolygonF make_rhombus(qreal angle) const;
45
49 QPolygonF m_marker;
54 QString m_name;
59
60 double LastDegree;
62 // QString LabelString;
63};
64
65} // namespace dbse
66#endif // SchemaGraphicSegmentedArrow_H
SchemaGraphicSegmentedArrow(SchemaGraphicObject *StartItem, SchemaGraphicObject *EndItem, int connection_count, bool IsInheritance, bool IsComposite, QString ArrowName, QString ArrowCardinality, QGraphicsItem *parent=nullptr)
void hoverLeaveEvent(QGraphicsSceneHoverEvent *ev)
void hoverEnterEvent(QGraphicsSceneHoverEvent *ev)
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Including QT Headers.