X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/e40a5399ec7887c2606f18575c809b0d05b09278..HEAD:/GroupItem.cpp?ds=sidebyside diff --git a/GroupItem.cpp b/GroupItem.cpp index 385b352..d9e7459 100644 --- a/GroupItem.cpp +++ b/GroupItem.cpp @@ -5,7 +5,7 @@ #include "Dispatcher.h" #include "Parameters.h" #include "BoxItem.h" -#include "SourceItem.h" +#include "StimuliItem.h" #include "AbstractBlock.h" #include "AbstractInterface.h" #include "ConnectedInterface.h" @@ -88,6 +88,9 @@ void GroupItem::setParentItem(BoxItem *_parentItem) { } void GroupItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { + + if (!visible) return; + if(boxWidth > 0 && boxHeight > 0){ if(selected) painter->setPen(Qt::red); @@ -430,7 +433,7 @@ void GroupItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { if (refBlock->isTopGroupBlock()) { QRectF rectGroup = boundingRectInScene(); rectGroup.moveTo(rectGroup.x()+gapX,rectGroup.y()+gapY); - foreach(SourceItem* source, getScene()->getSourceItems()) { + foreach(StimuliItem* source, getScene()->getSourceItems()) { QRectF rectSource = source->boundingRectInScene(); if (rectGroup.intersects(rectSource)) canMove = false; } @@ -814,7 +817,12 @@ void GroupItem::load(QDomElement groupElement) throw(Exception) { GroupInterface *groupIface = new GroupInterface(groupBlock,name,direction,purpose); groupBlock->addInterface(groupIface); - InterfaceItem *interfaceItem = new InterfaceItem(position,orientation,groupIface,this,params); + bool show = false; + if ((groupBlock->isTopGroupBlock()) && (purpose == AbstractInterface::Clock)) { + show = true; + } + + InterfaceItem *interfaceItem = new InterfaceItem(position,orientation,groupIface,this,params,show); interfaceItem->setId(id); addInterfaceItem(interfaceItem, false); @@ -823,7 +831,7 @@ void GroupItem::load(QDomElement groupElement) throw(Exception) { groupCtlIface->setAssociatedIface(groupIface); groupBlock->addInterface(groupCtlIface); } - cout << "interface add to " << groupBlock->getName().toStdString() << endl; + cout << "interface " << qPrintable(name) << " added to " << groupBlock->getName().toStdString() << endl; } }