public:
- ConnectionItem(InterfaceItem* _iface1,
- InterfaceItem* _iface2,
+ ConnectionItem(InterfaceItem* _fromInterfaceItem,
+ InterfaceItem* _toInterfaceItem,
Dispatcher* _dispatcher,
- Parameters* _params,
- QGraphicsItem* _parent);
+ Parameters* _params);
ConnectionItem (const ConnectionItem & copy);
ConnectionItem();
~ConnectionItem();
QPainterPath shape() const;
void prepareChange();
-
+
+ // getters
inline GroupScene* getScene() { return (GroupScene*)(scene()); }
inline InterfaceItem* getToInterfaceItem(){ return toInterfaceItem; }
- inline void setToInterfaceItem(InterfaceItem *iface){ toInterfaceItem = iface; }
inline InterfaceItem* getFromInterfaceItem(){ return fromInterfaceItem; }
- inline void setFromInterfaceItem(InterfaceItem* iface){ fromInterfaceItem = iface; }
inline int getId(){ return id; }
+
+ // setters
+ inline void setToInterfaceItem(InterfaceItem *iface){ toInterfaceItem = iface; }
+ inline void setFromInterfaceItem(InterfaceItem* iface){ fromInterfaceItem = iface; }
inline void setId(int id){ this->id = id; }
- inline bool isSelected() { return selected; }
void setSelected(bool selected);
-
+ inline void setVisible(bool state) { visible = state; }
+
+ // testers
+ inline bool isSelected() { return selected; }
+ inline bool isVisible() { return visible; }
+
+ // others
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
/*!
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
private:
-
+ void computeEsse(int orientationFrom);
+ void computeStaircase(int orientationFrom);
+ void computeHookSmallEnd(int orientationFrom, int orientationTo);
+ void computeHookSmallStart(int orientationFrom, int orientationTo);
+ void computeOpenRect(int orientationFrom, int orientationTo);
+ void computeElle(int orientationFrom);
+ void computeCorner(int orientationFrom);
+
QPointF pointFrom;
QPointF pointTo;
QList<QPointF> interPoints;
bool selected;
int id;
int marginConn;
- void computeEsse(int orientationFrom);
- void computeStaircase(int orientationFrom);
- void computeHookSmallEnd(int orientationFrom, int orientationTo);
- void computeHookSmallStart(int orientationFrom, int orientationTo);
- void computeOpenRect(int orientationFrom, int orientationTo);
- void computeElle(int orientationFrom);
- void computeCorner(int orientationFrom);
+
+ bool visible;
friend QDataStream &operator << (QDataStream &out, ConnectionItem &c);
friend QDataStream &operator >> (QDataStream &in, ConnectionItem &c);