X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/d43174d0eb3d293b3bb5fbe76662241134e74d0d..d111eaf49741a0a79d372445f97c314a637e331e:/AbstractBoxItem.h diff --git a/AbstractBoxItem.h b/AbstractBoxItem.h index 98cec58..fe08535 100644 --- a/AbstractBoxItem.h +++ b/AbstractBoxItem.h @@ -44,19 +44,23 @@ public: void setRefBlock(AbstractBlock* _refBlock); inline void setId(int _id){ id = _id; } inline void setSelected(bool _selected) { selected = _selected; } - inline void setRstClkVisible(bool b){ rstClkVisible = b;} + void setRstClkVisible(bool b); + void setWishboneVisible(bool b); void setDimension(int x, int y); inline void setCurrentInterface(InterfaceItem* iface) { currentInterface = iface; } // testers virtual bool isBoxItem(); - virtual bool isGroupItem(); + virtual bool isGroupItem(); + virtual bool isSourceItem(); inline bool isSelected() { return selected; } inline bool isRstClkVisible(){ return rstClkVisible;} + inline bool isWishboneVisible(){ return wishboneVisible;} bool isInterfaces(int orientation) const; // others - + QRectF boundingRectInScene(); + virtual void nameChanged() = 0; // called when an interface or box name have changed void addInterface(InterfaceItem* i, bool resetPosition = false); void removeInterface(InterfaceItem* i); void resetInterfacesPosition(); @@ -113,12 +117,13 @@ protected: int nameHeight; // the height of the name in Arial 10 int nameMargin; // the margin around each side of the name int ifaceMargin; // the margin around each side of interfaces' name - QPointF originPoint; // the left-top point that is the origin of the bounding box + QPointF originPoint; // the left-top point that is the origin of the bounding box, in the item coordinates bool selected; - bool rstClkVisible; + bool rstClkVisible; //! true if clock/reset interfaces are visible + bool wishboneVisible; //! true if wishbone interfaces are visible - QPointF currentPosition; // the start point for resize + QPointF currentPosition; // the start point for resize, i.e. the position of the lef-top corner of the box, in the scene coordinates virtual void updateMinimumSize() = 0; // modify the minimum size virtual bool updateGeometry(ChangeType type) = 0; // modify the originPoint and the total dimension @@ -127,7 +132,8 @@ protected: /* pure virtual method inherited from QGraphicsItem : virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) =0; virtual QRectF boundingRect() const =0; - */ + */ + void initInterfaces(); int nbInterfacesByOrientation(int orientation); };