1 #ifndef __INTERFACEITEM_H__
2 #define __INTERFACEITEM_H__
8 class ConnectedInterface;
22 InterfaceItem(double _position,
24 ConnectedInterface* _refInter,
25 AbstractBoxItem* _owner,
26 Parameters* _params, bool forceVisible = false);
28 QRectF boundingRect() const;
29 void paint(QPainter *painter);
32 inline int getId() { return id; }
34 QString getReferenceName();
35 inline double getPositionRatio() { return positionRatio; }
36 inline double getPosition() { return position; }
37 inline int getOrientation() { return orientation; }
38 inline AbstractBoxItem *getOwner() { return owner; }
39 inline int getNameWidth() { return nameWidth; }
40 inline int getNameHeight() { return nameHeight; }
41 QString getStrOrientation();
42 static int getIntOrientation(QString str);
43 QPointF getEndPosition();
44 QPointF getStartPosition();
47 void setOriginPoint();
48 inline void setId(int id){ this->id = id; }
49 inline void setPositionRatio(double ratio) { positionRatio = ratio; }
50 inline void setOrientation(int _orientation){ orientation = _orientation; }
53 void addConnectionItem(ConnectionItem* item);
54 void removeConnectionItem(ConnectionItem* item);
55 void updatePosition();
56 void updateName(QString name);
58 AbstractBoxItem* owner;
59 ConnectedInterface* refInter;
66 QList<ConnectionItem*> connections; // the connection items that are bounded to this interface item
72 int position; // position in pixels on the "orientation side" of the owner
73 int orientation; // north, south, east, west
74 QPointF originPoint; // the point where starts the drawing (along the box border) NB : in the owner coordinates
75 int nameWidth; // the graphical width of the name, computed from default font metrics
76 int nameHeight; // the graphical height of the name, computed from default font metrics
78 friend QDataStream &operator<<(QDataStream &out, InterfaceItem *b);
79 friend QDataStream &operator>>(QDataStream &in, InterfaceItem &b);
83 QDataStream & operator <<(QDataStream &out, InterfaceItem *b);
84 QDataStream & operator >>(QDataStream &in, InterfaceItem &b);