]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
Fix for bug PAL8060 : Supervisor: Edit ports - existing links are deleted
authormkr <mkr@opencascade.com>
Fri, 20 Jan 2006 07:41:55 +0000 (07:41 +0000)
committermkr <mkr@opencascade.com>
Fri, 20 Jan 2006 07:41:55 +0000 (07:41 +0000)
( IsLinked() function : situation if node contains ports with same names
but different types (Input or Output) ).

src/GraphBase/DataFlowBase_ComputingNode.cxx
src/GraphBase/DataFlowBase_ComputingNode.hxx
src/GraphEditor/DataFlowEditor_InNode.hxx

index f5203ff30304ec4108b2b318d5520771b533bbf8..12b7e59d718cc92a0980b98b6417a28a94657e3d 100644 (file)
@@ -333,11 +333,15 @@ void GraphBase::ComputingNode::NodePort( const char * NodeName ,
   }
 }
 
-bool GraphBase::ComputingNode::IsLinked(const char * ToServiceParameterName ) {
+bool GraphBase::ComputingNode::IsLinked(const char * ToServiceParameterName, bool isInput ) {
   bool RetVal = false ;
-  const GraphBase::InPort * thePort = GetInPort( ToServiceParameterName ) ;
-  if ( thePort ) {
-    RetVal = thePort->IsPortConnected() ;
+  if ( isInput ) { // mkr : PAL8060
+    // we have to know the type of the port, because of input and output ports 
+    // belong to one node may have the same names
+    const GraphBase::InPort * thePort = GetInPort( ToServiceParameterName ) ;
+    if ( thePort ) {
+      RetVal = thePort->IsPortConnected() ;
+    }
   }
   else {
     const GraphBase::OutPort * thePort = GetOutPort( ToServiceParameterName ) ;
index 76b84f4aced55eda06128baf51ee642d67858a08..9770303f78f3c833bf45c2e8dcf761dd5305a174 100644 (file)
@@ -183,7 +183,7 @@ namespace GraphBase {
                      const char * ServiceParameterName ,
                      char ** aNode , char ** aPort ) ;
 
-      bool IsLinked(const char * ToServiceParameterName ) ;
+      bool IsLinked(const char * ToServiceParameterName, bool isInput ) ; // mkr : PAL8060
       bool HasInput(const char * ToServiceParameterName ) ;
 
       GraphBase::SNode * GetInfo() ;
index 0bb2a91154b929c39c3ca92a52fad09a626e4357..9a6bac596034ed4f16535e313e31f06a4bee2ac0 100644 (file)
@@ -222,8 +222,8 @@ namespace GraphEditor {
       void DelOutPort( const char * OutputParameterName ) {
            _ComputingNode->DelOutPort( OutputParameterName ) ; } ;
 
-      bool IsLinked(const char * ToServiceParameterName ) {
-           return _ComputingNode->IsLinked( ToServiceParameterName ) ; } ;
+      bool IsLinked(const char * ToServiceParameterName, bool isInput ) {
+           return _ComputingNode->IsLinked( ToServiceParameterName, isInput ) ; } ; // mkr : PAL8060
       bool HasInput(const char * ToServiceParameterName ) {
            return _ComputingNode->HasInput( ToServiceParameterName ) ; } ;