From 74ff0f2d5282adf5ce36c9faeb2a5e85c358bf23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 21 Jan 2018 18:22:07 +0100 Subject: Implement even more parts of the schema --- qtmips_gui/coreview/connection.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'qtmips_gui/coreview/connection.h') diff --git a/qtmips_gui/coreview/connection.h b/qtmips_gui/coreview/connection.h index 88ad1da..fa40d95 100644 --- a/qtmips_gui/coreview/connection.h +++ b/qtmips_gui/coreview/connection.h @@ -20,6 +20,7 @@ public: Connector(enum Axis axis = AX_X); void setPos(qreal x, qreal y); + void setPos(const QPointF&); enum Axis axis() const; qreal x() const; @@ -48,7 +49,7 @@ public: void setHasText(bool has); void setText(QString val); - void setAxes(QVector); + virtual void setAxes(QVector); private slots: void moved_start(QLineF); @@ -71,6 +72,9 @@ protected: class Bus : public Connection { public: Bus(const Connector *start, const Connector *end, unsigned width = 4); + ~Bus(); + + void setAxes(QVector); // This creates connector snapped to closes point to x,y that is on bus const Connector *new_connector(qreal x, qreal y, enum Connector::Axis = Connector::AX_X); @@ -82,6 +86,7 @@ protected: QPointF p; }; QVector conns; + void conns_update(); // TODO because of this we have to overload setAxis function and update that in there }; @@ -90,6 +95,11 @@ public: Signal(const Connector *start, const Connector *end); }; +#define CON_AX_X (coreview::Connector::AX_X) +#define CON_AX_Y (coreview::Connector::AX_Y) +#define CON_AX_XY (coreview::Connector::AX_XY) +#define CON_AX_MXY (coreview::Connector::AX_MXY) + #define CON_AXIS_X(Y) QLineF(QPointF(0, Y), QPointF(1, Y)) #define CON_AXIS_Y(X) QLineF(QPointF(X, 0), QPointF(X, 1)) -- cgit v1.2.3