29 #include <QGraphicsObject> 32 class QGraphicsSceneMouseEvent;
39 class Node :
public QGraphicsObject
45 static std::pair<QPointF, QPointF> getEffectiveNodes(
52 enum {
Type =
static_cast<int>(UserType) + 1 };
53 int type()
const override {
return Type; }
55 QString getName()
const;
56 qint32 getNodeSize()
const {
59 QColor getColor()
const {
62 qint32 getNodeType()
const {
65 bool hasGraphFocus()
const;
66 bool isOperator()
const;
68 void unFocusInGraph();
69 void setOperator(
bool t_op);
70 void setGridPos(qreal x, qreal y);
71 void setDiagramWidget(DiagramWidget *t_widget) {
75 QRectF boundingRect()
const override;
76 QPainterPath shape()
const override;
77 void paint(QPainter *painter,
78 const QStyleOptionGraphicsItem *option,
79 QWidget *widget)
override;
93 void setName(QString
const& t_name);
94 void setNodeSize(qint32 t_size) {
98 void setColor(QColor t_color) {
102 void setNodeType(qint32 t_nodeType) {
103 nodeType = t_nodeType;
106 void changeNode(QAction *action =
nullptr);
113 QVariant itemChange(GraphicsItemChange change,
const QVariant &value)
override;
115 void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
override;
116 void mousePressEvent(QGraphicsSceneMouseEvent *event)
override;
117 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
override;
118 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
override;
119 void dropEvent(QGraphicsSceneDragDropEvent *event)
override;
123 static constexpr qint32 size = 16;
124 static constexpr qreal zValue = -1;
126 Proxy *label =
nullptr;
132 DiagramWidget *widget;
136 qint32 doubleClicked = 0;
Definition: diagram.h:243
Definition: amplitudeSimplification.h:38