X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/d111eaf49741a0a79d372445f97c314a637e331e..e45bacc6bd342a1b19e42b62133ddabc99aa9edd:/AbstractBoxItem.h?ds=sidebyside diff --git a/AbstractBoxItem.h b/AbstractBoxItem.h index fe08535..fb2bdcc 100644 --- a/AbstractBoxItem.h +++ b/AbstractBoxItem.h @@ -14,6 +14,10 @@ class AbstractBlock; class GroupScene; class ConnectedInterface; +#define ABI_TO_BI(ptr) ((BoxItem*)ptr) +#define ABI_TO_GI(ptr) ((GroupItem*)ptr) +#define ABI_TO_SI(ptr) ((SourceItem*)ptr) + class AbstractBoxItem : public QGraphicsItem { public: @@ -61,9 +65,9 @@ public: // 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(); + void addInterfaceItem(InterfaceItem* i, bool resetPosition = false); + void removeInterfaceItem(InterfaceItem* i); + void resetInterfaceItemsPosition(); /*! * \brief moveInterfaceTo * \param pos the new position (in scene) of the interface @@ -71,7 +75,7 @@ public: * This method is called when user moves an InterfaceItem. * see BoxItem::mouseMoveEvent() and GroupItem::mouseMoveEvent() */ - void moveInterfaceTo(QPointF pos); + void moveInterfaceItemTo(QPointF pos); /*! * \brief updateInterfacesAndConnections * @@ -86,11 +90,11 @@ public: * that is called in this method. Thus, there is no need to call update() after the termination of * this method. */ - void updateInterfacesAndConnections(); + void updateInterfaceAndConnectionItems(); - InterfaceItem *searchInterfaceByName(QString name); - InterfaceItem *searchInterfaceByRef(ConnectedInterface* ref); - InterfaceItem* getInterfaceFromCursor(qreal x, qreal y); + InterfaceItem *searchInterfaceItemByName(QString name); + InterfaceItem *searchInterfaceItemByRef(ConnectedInterface* ref); + InterfaceItem* getInterfaceItemFromCursor(qreal x, qreal y); protected: Dispatcher *dispatcher; @@ -134,7 +138,7 @@ protected: virtual QRectF boundingRect() const =0; */ - void initInterfaces(); + void initInterfaceItems(); int nbInterfacesByOrientation(int orientation); };