]> AND Private Git Repository - blast.git/blobdiff - ConnectionItem.h
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
nearly finished GroupBlock VHDL gen
[blast.git] / ConnectionItem.h
index 6370c90d31ec3b6ed62effbae538d9e6d703baab..55487156239f489a4cbbb2e85fb80fbc864eb386 100644 (file)
@@ -41,8 +41,7 @@ public:
   ConnectionItem(InterfaceItem* _iface1,
                  InterfaceItem* _iface2,
                  Dispatcher* _dispatcher,
   ConnectionItem(InterfaceItem* _iface1,
                  InterfaceItem* _iface2,
                  Dispatcher* _dispatcher,
-                 Parameters* _params,
-                 QGraphicsItem* _parent);
+                 Parameters* _params);
   ConnectionItem (const ConnectionItem & copy);
   ConnectionItem();
   ~ConnectionItem();
   ConnectionItem (const ConnectionItem & copy);
   ConnectionItem();
   ~ConnectionItem();
@@ -51,17 +50,24 @@ public:
   QPainterPath shape() const;
 
   void prepareChange();
   QPainterPath shape() const;
 
   void prepareChange();
-
+  
+  // getters
   inline GroupScene* getScene() { return (GroupScene*)(scene()); }
   inline InterfaceItem* getToInterfaceItem(){ return toInterfaceItem; }
   inline GroupScene* getScene() { return (GroupScene*)(scene()); }
   inline InterfaceItem* getToInterfaceItem(){ return toInterfaceItem; }
-  inline void setToInterfaceItem(InterfaceItem *iface){ toInterfaceItem = iface; }
   inline InterfaceItem* getFromInterfaceItem(){ return fromInterfaceItem; }
   inline InterfaceItem* getFromInterfaceItem(){ return fromInterfaceItem; }
-  inline void setFromInterfaceItem(InterfaceItem* iface){ fromInterfaceItem = iface; }
   inline int getId(){ return id; }
   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 void setId(int id){ this->id = id; }
-  inline bool isSelected() { return selected; }
   void setSelected(bool selected);
   void setSelected(bool selected);
-
+  inline void setVisible(bool state) { visible = state; }
+  
+  // testers
+  inline bool isSelected() { return selected; }
+  
+  // others
   void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
 
   /*!
   void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
 
   /*!
@@ -87,7 +93,14 @@ protected:
   void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
 
 private:
   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;
   QPointF pointFrom;
   QPointF pointTo;
   QList<QPointF> interPoints;
@@ -106,13 +119,8 @@ private:
   bool selected;
   int id;
   int marginConn;
   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);
 
   friend QDataStream &operator << (QDataStream &out, ConnectionItem &c);
   friend QDataStream &operator >> (QDataStream &in, ConnectionItem &c);