X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/6a0ffdb10d7344d99e04c5518fca2b8295df94be..8fb3c55ee009a11db5e1c08a4cfb286979412745:/GroupScene.cpp?ds=sidebyside diff --git a/GroupScene.cpp b/GroupScene.cpp index 05d7c4c..70c88e2 100644 --- a/GroupScene.cpp +++ b/GroupScene.cpp @@ -5,7 +5,7 @@ #include "GroupWidget.h" #include "GroupItem.h" #include "BoxItem.h" -#include "SourceItem.h" +#include "StimuliItem.h" #include "ConnectionItem.h" #include "InterfaceItem.h" #include "AbstractBlock.h" @@ -73,7 +73,7 @@ int GroupScene::setItemsId(int countInit) { int counter = countInit; groupItem->setId(counter++); if (isTopScene()) { - foreach(SourceItem *item, sourceItems){ + foreach(StimuliItem *item, stimuliItems){ item->setId(counter++); } } @@ -89,7 +89,7 @@ int GroupScene::setInterfacesId(int countInit) { inter->setId(counter++); } if (isTopScene()) { - foreach(SourceItem *item, sourceItems){ + foreach(StimuliItem *item, stimuliItems){ foreach(InterfaceItem* inter, item->getInterfaces()){ inter->setId(counter++); } @@ -156,35 +156,35 @@ void GroupScene::removeBoxItem(BoxItem* item) { groupItem->updateShape(); } -SourceItem *GroupScene::createSourceItem(AbstractBlock *block) { +StimuliItem *GroupScene::createStimuliItem(AbstractBlock *block) { - SourceItem* item = new SourceItem(block,dispatcher,params); + StimuliItem* item = new StimuliItem(block,dispatcher,params); // adding item to the scene addItem(item); item->setZValue(1); // add item from the QList - sourceItems.append(item); + stimuliItems.append(item); // center the new block QPointF groupPos = groupItem->pos(); - QPointF newPos(groupPos.x()-item->getTotalWidth()-50, groupPos.y()); + QPointF newPos(groupPos.x()-item->getTotalWidth()-100, groupPos.y()); newPos = newPos-item->getOriginPoint(); item->moveTo(newPos); return item; } -void GroupScene::addSourceItem(SourceItem* item) { +void GroupScene::addStimuliItem(StimuliItem* item) { // adding item to the scene addItem(item); item->setZValue(1); // add item from the QList - sourceItems.append(item); + stimuliItems.append(item); } -void GroupScene::removeSourceItem(SourceItem* item) { +void GroupScene::removeStimuliItem(StimuliItem* item) { // remove item from the viewport removeItem(item); // remove item from the QList - sourceItems.removeAll(item); + stimuliItems.removeAll(item); } void GroupScene::createConnectionItem(InterfaceItem *iface1, InterfaceItem *iface2, bool visible) { @@ -272,8 +272,8 @@ void GroupScene::save(QXmlStreamWriter &writer) { if (isTopScene()) { writer.writeStartElement("source_items"); - writer.writeAttribute("count",QString::number(sourceItems.length())); - foreach(SourceItem* item, sourceItems) { + writer.writeAttribute("count",QString::number(stimuliItems.length())); + foreach(StimuliItem* item, stimuliItems) { item->save(writer); } writer.writeEndElement(); // source_items