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

Private GIT Repository
finished conn mode of library
[blast.git] / GroupScene.cpp
index 2ceb21fdc2b63264b6c937cb65566bb149b5aabc..05d7c4c61cb96ba3d163270ea44d9c734884fc1a 100644 (file)
@@ -103,19 +103,40 @@ int GroupScene::setInterfacesId(int countInit) {
   return counter;
 }
 
-BoxItem *GroupScene::createBoxItem(AbstractBlock *block) {
+BoxItem *GroupScene::createBoxItem(AbstractBlock *block, BoxItem::Position position, int lock, BoxItem::SpanType span) {
 
-  BoxItem* item = new BoxItem(block,dispatcher,params,groupItem);
+  BoxItem* item = new BoxItem(block,dispatcher,params,groupItem, lock, span, position);
   item->setZValue(1);
   // add item from the QList
   boxItems.append(item);
   // repainting the group
   groupItem->updateShape();
-  // center the new block
-  QPointF newPos((groupItem->getWidth()-item->getTotalWidth())/2.0, (groupItem->getHeight()-item->getTotalHeight())/2.0);
+
+/*
+  // position the new block
+  double x,y;
+  if (hPos == BoxItem::Left) {
+    x = 0;
+  }
+  else if (hPos == BoxItem::Center) {
+    x = (groupItem->getWidth()-item->getTotalWidth())/2.0;
+  }
+  else if (hPos == BoxItem::Right) {
+    x = groupItem->getWidth()-item->getTotalWidth();
+  }
+  if (vPos == BoxItem::Top) {
+    y = 0;
+  }
+  else if (vPos == BoxItem::Center) {
+    y = (groupItem->getHeight()-item->getTotalHeight())/2.0;
+  }
+  else if (vPos == BoxItem::Bottom) {
+    y = groupItem->getHeight()-item->getTotalHeight();
+  }
+  QPointF newPos(x,y);
   newPos = newPos-item->getOriginPoint();
   item->moveTo(newPos);
-
+*/
   return item;
 }