#ifndef EDGE_H #define EDGE_H #include class Node; class Edge : public QGraphicsItem { public: Edge(Node *sourceNode, Node *destNode); ~Edge(); Node *sourceNode() const; Node *destNode() const; double getAngle() const; void setColor(const QColor &color); QColor color() const { return m_color; } void adjust(); protected: QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); private: Node *m_sourceNode; Node *m_destNode; QPointF m_sourcePoint; QPointF m_destPoint; double m_angle; QColor m_color; static const qreal m_arrowSize; static const double m_pi; static const double m_twoPi; }; #endif