From: mkr Date: Thu, 11 Jan 2007 08:06:00 +0000 (+0000) Subject: To fix the following remark: X-Git-Tag: V3_2_5pre1~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d540268429991b9bc4745ab98b2f6ab305ad10c8;p=modules%2Fsuperv.git To fix the following remark: after "Link to Node" functionality a new link created between GoTo(OutGate) and CoupledNode(InGate) is not visible in GUI as long as we perform Export -> Import/Modify operations. --- diff --git a/src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx b/src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx index 5d9c498..71bd607 100644 --- a/src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx +++ b/src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx @@ -26,6 +26,7 @@ #include "SUPERVGUI_CanvasControlNode.h" #include "SUPERVGUI_CanvasControlNodePrs.h" #include "SUPERVGUI_CanvasCellNodePrs.h" +#include "SUPERVGUI_CanvasLink.h" #include "SUPERVGUI_Clipboard.h" #include "SUPERVGUI_Main.h" #include "SUPERVGUI.h" @@ -244,7 +245,43 @@ void SUPERVGUI_CanvasGotoNode::linkToNode() { if (aDlg->exec()) { QString aNodeName = aDlg->getName(); if (!aNodeName.isEmpty()) { //implement additional check from GUI side for bug PAL7007 + // mkr : here we should re/create (if it is not yet exists) a presentation for new + // Goto(OutGate)->CoupledNode(InGate) link, which will be created in SetCoupled method + + // check if GoTo node have coupled node + SUPERV_INode aCoupledNode = getGotoNode()->Coupled(); + if ( !SUPERV_isNull(aCoupledNode) ) + { // we got old coupled node + SUPERV_Port anInGatePort = aCoupledNode->GetInPort("InGate"); + SUPERV_Link anOldLinkEngine = anInGatePort->Link(); + if ( !SUPERV_isNull(anOldLinkEngine) ) + { // we got old link engine + SUPERVGUI_CanvasLink* anOldLinkPrs = getMain()->getCanvas()->getLink(anOldLinkEngine); + if ( anOldLinkPrs ) + { // delete old link presentation + delete anOldLinkPrs; + anOldLinkPrs = 0; + } + } + } + getGotoNode()->SetCoupled(aNodeName.latin1()); + + aCoupledNode = SUPERV::INode::_narrow(getMain()->getDataflow()->Node(aNodeName.latin1())); + if ( !SUPERV_isNull(aCoupledNode) ) + { // we got new coupled node + SUPERV_Port anInGatePort = aCoupledNode->GetInPort("InGate"); + SUPERV_Link aLinkEngine = anInGatePort->Link(); + if ( !SUPERV_isNull(aLinkEngine) ) + { // we got new link engine + if ( !getMain()->getCanvas()->getLink(aLinkEngine) ) + { // there is no presentation for such link engine => create it + SUPERVGUI_CanvasLink* aLink = new SUPERVGUI_CanvasLink(getMain()->getCanvas(), getMain(), aLinkEngine); + aLink->show(); + } + } + } + getMain()->getCanvas()->sync(); } }