28 #ifndef GRAPHICSEDGE_H
29 #define GRAPHICSEDGE_H
32 #include <QGraphicsItem>
38 class QGraphicsSceneMouseEvent;
48 static const int TypeEdge= QGraphicsItem::UserType+2;
62 Q_INTERFACES (QGraphicsItem)
66 const QString &label,
const QString &color,
67 const Qt::PenStyle &style,
68 const int&type,
const bool & drawArrows,
const bool &bezier,
69 const bool &weightNumbers=
false,
70 const bool &highlighting=
true);
73 enum { Type = UserType + 2 };
74 int type()
const {
return Type; }
82 int sourceNodeNumber();
83 int targetNodeNumber();
91 void setSourceNodeSize(
const int & size);
92 void setTargetNodeSize(
const int & size);
94 void setMinimumOffsetFromNode(
const int & offset);
98 void setWeight(
const qreal &w) ;
100 void addWeightNumber ();
102 void setWeightNumberVisibility (
const bool &toggle);
104 void setLabel(
const QString &label) ;
105 QString label()
const;
108 void setLabelVisibility (
const bool &toggle);
110 void showArrows(
const bool &);
112 void setDirectionType(
const int &dirType=0);
118 void setState(
const int &state);
120 void setStyle(
const Qt::PenStyle &style);
121 Qt::PenStyle style()
const;
123 void setColor(
const QString &str) ;
125 QColor color()
const;
126 QString colorToPajek();
128 void setHighlighted (
const bool &flag);
129 void setHighlighting (
const bool &toggle);
131 QPainterPath shape()
const;
138 QRectF boundingRect()
const;
139 void paint(QPainter *painter,
const QStyleOptionGraphicsItem *option, QWidget *widget);
140 QVariant itemChange(GraphicsItemChange change,
const QVariant &value);
175 qreal
angle, line_length, line_dx, line_dy;
Definition: graphicsedgelabel.h:38
Definition: graphicsedgeweight.h:38
Definition: graphicsedge.h:60
QPointF sourcePoint
Definition: graphicsedge.h:156
GraphicsEdgeLabel * edgeLabel
Definition: graphicsedge.h:152
QPointF edgeOffset
Definition: graphicsedge.h:158
GraphicsEdgeWeight * weightNumber
Definition: graphicsedge.h:150
qreal m_arrowSize
Definition: graphicsedge.h:160
GraphicsWidget * graphicsWidget
Definition: graphicsedge.h:146
qreal angle
Definition: graphicsedge.h:175
QColor m_color
Definition: graphicsedge.h:169
int type() const
Definition: graphicsedge.h:74
bool m_Bezier
Definition: graphicsedge.h:177
bool m_drawLabel
Definition: graphicsedge.h:178
qreal m_weight
Definition: graphicsedge.h:171
QPainterPath m_path
Definition: graphicsedge.h:154
bool m_isClicked
Definition: graphicsedge.h:179
Qt::PenStyle m_style
Definition: graphicsedge.h:165
int m_state
Definition: graphicsedge.h:166
qreal m_offsetFromSourceNode
Definition: graphicsedge.h:163
int m_edgeDirType
Definition: graphicsedge.h:173
GraphicsNode * source
Definition: graphicsedge.h:148
QString m_colorNegative
Definition: graphicsedge.h:168
qreal m_minOffsetFromNode
Definition: graphicsedge.h:162
Definition: graphicsnode.h:58
static const int EDGE_STATE_HOVER
Definition: graphicsedge.h:54
static const int TypeEdge
Definition: graphicsedge.h:48
static const int EDGE_STATE_REGULAR
Definition: graphicsedge.h:52
static const int ZValueEdge
Definition: graphicsedge.h:49
static const int EDGE_STATE_HIGHLIGHT
Definition: graphicsedge.h:53
static const int ZValueEdgeHighlighted
Definition: graphicsedge.h:50