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{
12
13class SchemaGraphicSegmentedArrow: public QGraphicsPathItem
14{
15public:
17 int connection_count,
18 bool IsInheritance, bool IsComposite, QString ArrowName,
19 QString ArrowCardinality, QGraphicsItem * parent = nullptr );
21 QRectF boundingRect() const;
22 QPainterPath shape() const;
23 void UpdatePosition();
26 bool GetInheritanceMode();
27 void RemoveArrow();
28protected:
29 void paint ( QPainter * painter, const QStyleOptionGraphicsItem * option,
30 QWidget * widget = 0 );
31 void hoverEnterEvent ( QGraphicsSceneHoverEvent* ev );
32 void hoverLeaveEvent ( QGraphicsSceneHoverEvent* ev );
33private:
34
35 QPointF p1() const { return path().elementCount() > 0 ? path().elementAt(0) : QPointF(); }
36 QPointF p2() const { return path().elementCount() > 0 ? path().elementAt(path().elementCount()-1) : QPointF(); }
37 qreal dx() const { return p2().x() - p1().x(); }
38 qreal dy() const { return p2().y() - p1().y(); }
39
40 QPolygonF make_arrow_head(qreal angle) const;
41 QPolygonF make_rhombus(qreal angle) const;
42
46 QPolygonF m_marker;
51 QString m_name;
56
57 double LastDegree;
59 //QString LabelString;
60};
61
62} // namespace dbse
63#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.