From 16b1544fff7e9ca11deb3ae1b891c79eac7ec50e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 21 Jan 2018 11:36:34 +0100 Subject: Implement little bit more of scheme and fix connection angle This commit adds few more bits to scheme but mainly it chnages how connectors specify angles. Originally it was in radians but we was mapping that trough mathematical operations directly to sizes. But that was problematic because of floating point inacuracy and we sometimes founded intersection where there should be one. So this commit gets rid of this at all and instead allows just some fixes axes to be used instead of arbitrary angles. --- qtmips_gui/coreview/and.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 qtmips_gui/coreview/and.h (limited to 'qtmips_gui/coreview/and.h') diff --git a/qtmips_gui/coreview/and.h b/qtmips_gui/coreview/and.h new file mode 100644 index 0000000..ca0af30 --- /dev/null +++ b/qtmips_gui/coreview/and.h @@ -0,0 +1,29 @@ +#ifndef COREVIEW_AND_H +#define COREVIEW_AND_H + +#include +#include +#include "connection.h" + +namespace coreview { + +class And : public QGraphicsItem { +public: + And(unsigned size = 2); + ~And(); + + QRectF boundingRect() const; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + + void setPos(qreal x, qreal y); + const Connector *connector_in(unsigned) const; + const Connector *connector_out() const; + +private: + QVector connectors; + Connector* con_out; +}; + +} + +#endif // COREVIEW_AND_H -- cgit v1.2.3