// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
using namespace std;
#include "DataFlowBase_OutPort.hxx"
+#include "DataFlowBase_InPort.hxx"
//GraphBase::OutPort::~OutPort() {
// In GraphExecutor::OutPort
if ( index > 0 && index <= _InPortsSize ) {
anInPort = _InPorts[ index-1 ] ;
if ( anInPort != toPort ) {
- cout << "GraphBase::OutPort::GetInPort inconsistency toPort "
- << hex << (void *) toPort << " != anInPort " << (void *) anInPort
- << dec << endl ;
+ //cout << "GraphBase::OutPort::GetInPort inconsistency toPort "
+// << hex << (void *) toPort << " != anInPort " << (void *) anInPort
+// << dec << endl ;
anInPort = NULL ;
}
}
return true ;
}
+bool GraphBase::OutPort::RemoveInPort() {
+ if ( _InPortsSize != 1 ) {
+ return false ;
+ }
+ int index = 1 ;
+ GraphBase::InPort * toPort = _InPorts[ index - 1 ] ;
+ _InPortsSize -= 1 ;
+ _InPorts.resize( _InPortsSize ) ;
+ _Links.resize( _InPortsSize ) ;
+ _MapOfInPorts.erase( toPort->NodePortName() ) ;
+ if ( _InPortsSize == 0 ) {
+ PortStatus(NotConnected ) ;
+ if ( IsSwitch() ) {
+ Kind( SUPERV::InLineParameter ) ;
+ }
+ }
+ if ( toPort->GetOutPort() ) {
+ toPort->RemoveOutPort( false ) ;
+ }
+ cdebug << "OutPort::RemoveInPort " << NodeName() << "( " << PortName() << " " << PortStatus()
+ << " " << Kind() << " ) _InPortsSize " << _InPortsSize << " --> "
+ << toPort->NodeName() << "( " << toPort->PortName() << " " << toPort->PortStatus()
+ << " " << toPort->Kind() << " )" << endl ;
+ return true ;
+}
+
bool GraphBase::OutPort::RemoveInPort( GraphBase::InPort * toPort ) {
int i ;
int index = _MapOfInPorts[ toPort->NodePortName() ] ;
if ( index <= 0 || index > _InPortsSize ) {
- cdebug << "GraphBase::OutPort::RemoveInPort Error " << NodePortName()
- << " --> " << toPort->NodePortName() << endl ;
+//JR NPAL14110 09.02.2007 : Not an error with MacroNodes ...
+ //JRcdebug << "GraphBase::OutPort::RemoveInPort Error " << NodeName() << "( " << PortName()<< " ) --> "
+ //JR << toPort->NodeName() << "( " << toPort->PortName() << " )" << endl ;
return false ;
}
+ cdebug << "OutPort::RemoveInPort " << NodeName() << "(" << PortName() << ") --> "
+ << _InPorts[ index - 1 ]->NodeName() << "(" << _InPorts[ index - 1 ]->PortName() << ")" << endl ;
_InPortsSize -= 1 ;
for ( i = index - 1 ; i < _InPortsSize ; i++ ) {
_MapOfInPorts[ _InPorts[ i+1 ]->NodePortName() ] = i + 1 ;
_MapOfInPorts.erase( toPort->NodePortName() ) ;
if ( _InPortsSize == 0 ) {
PortStatus(NotConnected ) ;
+ if ( IsSwitch() ) {
+ Kind( SUPERV::InLineParameter ) ;
+ }
+ }
+ if ( toPort->GetOutPort() ) {
+ toPort->RemoveOutPort( false ) ;
}
- toPort->RemoveOutPort() ;
return true ;
}
const char* NewNodePortName ) {
int index = _MapOfInPorts[ OldNodePortName ] ;
if ( index <= 0 || index > _InPortsSize ) {
- cdebug << "GraphBase::OutPort::ReNameLink Error " << OldNodePortName
+ cdebug << "GraphBase::OutPort::ReNameInPort Error in Node " << NodeName() << " " << OldNodePortName
<< " --> " << NewNodePortName << " index " << index << endl ;
return false ;
}
ostream & operator<< (ostream &f ,const GraphBase::OutPort &P)
{
- f << P.PortName() << ", "
- << "type : " << P.PortType() << ", " ;
-
- f << "from "
- << P.NodeName() << ", ";
-
+ f << P.PortName() << ", " << "type : " << P.PortType() << ", " ;
+ f << "kind " << P.Kind() << ", ";
+ f << "Status " << P.PortStatus() << ", ";
+ f << "from Node " << P.NodeName() << ", ";
return f;
}