From 6c9295e7ce21ba24a647b2ded36201e3e72d88ef Mon Sep 17 00:00:00 2001 From: mkr Date: Fri, 20 Jan 2006 07:41:55 +0000 Subject: [PATCH] Fix for bug PAL8060 : Supervisor: Edit ports - existing links are deleted ( IsLinked() function : situation if node contains ports with same names but different types (Input or Output) ). --- src/GraphBase/DataFlowBase_ComputingNode.cxx | 12 ++++++++---- src/GraphBase/DataFlowBase_ComputingNode.hxx | 2 +- src/GraphEditor/DataFlowEditor_InNode.hxx | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/GraphBase/DataFlowBase_ComputingNode.cxx b/src/GraphBase/DataFlowBase_ComputingNode.cxx index f5203ff..12b7e59 100644 --- a/src/GraphBase/DataFlowBase_ComputingNode.cxx +++ b/src/GraphBase/DataFlowBase_ComputingNode.cxx @@ -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 ) ; diff --git a/src/GraphBase/DataFlowBase_ComputingNode.hxx b/src/GraphBase/DataFlowBase_ComputingNode.hxx index 76b84f4..9770303 100644 --- a/src/GraphBase/DataFlowBase_ComputingNode.hxx +++ b/src/GraphBase/DataFlowBase_ComputingNode.hxx @@ -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() ; diff --git a/src/GraphEditor/DataFlowEditor_InNode.hxx b/src/GraphEditor/DataFlowEditor_InNode.hxx index 0bb2a91..9a6bac5 100644 --- a/src/GraphEditor/DataFlowEditor_InNode.hxx +++ b/src/GraphEditor/DataFlowEditor_InNode.hxx @@ -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 ) ; } ; -- 2.39.2