]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
To fix the following remark:
authormkr <mkr@opencascade.com>
Thu, 11 Jan 2007 08:06:00 +0000 (08:06 +0000)
committermkr <mkr@opencascade.com>
Thu, 11 Jan 2007 08:06:00 +0000 (08:06 +0000)
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.

src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx

index 5d9c498d3513f3fac2fde17fa4063d040f2f9565..71bd607f5d65f2735c1e68ee1ef989f9e41a898c 100644 (file)
@@ -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();
     }
   }