]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
Control of SwitchNodes
authorrahuel <rahuel@opencascade.com>
Wed, 9 Mar 2005 08:07:00 +0000 (08:07 +0000)
committerrahuel <rahuel@opencascade.com>
Wed, 9 Mar 2005 08:07:00 +0000 (08:07 +0000)
Name State --> PortState ==> Lisibility
Debuf of Kind of port

src/GraphBase/DataFlowBase_InPort.cxx
src/GraphBase/DataFlowBase_InPort.hxx

index 9f8f7b5e377c5f3cedbbc2dba17be941f6d07e86..7e0dedb1f4c6887fa615d23a6c6aa63d271ac590 100644 (file)
@@ -34,7 +34,7 @@ char ** _PortStateName ;
 
 GraphBase::InPort::InPort() :
            Port() {
-  _State = SUPERV::UndefinedState ;
+  _PortState = SUPERV::UndefinedState ;
   _OutPort = NULL ;
   _InitialOutPort = NULL ;
 }
@@ -45,7 +45,7 @@ GraphBase::InPort::InPort(
             const SUPERV::KindOfPort aKind ,
             const SALOME_ModuleCatalog::DataStreamDependency aDependency ) :
           Port( Name , aserviceParameter , aKind , aDependency ) {
-  _State = SUPERV::UndefinedState ;
+  _PortState = SUPERV::UndefinedState ;
   _OutPort = NULL ;
   _InitialOutPort = NULL ;
 }
@@ -118,6 +118,9 @@ bool GraphBase::InPort::RemoveOutPort() {
   if ( !IsEndSwitch() ) {
     RemoveCoords() ;
   }
+  else {
+    Kind( SUPERV::InLineParameter ) ;
+  }
   return true ;
 }
 
@@ -136,8 +139,8 @@ ostream & operator<< (ostream &f ,const GraphBase::InPort &P) {
   return f;
 }
 
-ostream & operator<< (ostream &f ,const SUPERV::GraphState & aState ) {
-  switch (aState) {
+ostream & operator<< (ostream &f ,const SUPERV::GraphState & aPortState ) {
+  switch (aPortState) {
   case SUPERV::UndefinedState :
     f << "UndefinedState";
     break;
index 5716725c62bac8a5152e3564eb826741111c9c92..89217ab92de84f71768599827720291c1d53288c 100644 (file)
@@ -39,9 +39,10 @@ namespace GraphBase {
 
     private:
 
-      SUPERV::GraphState   _State ;
+      SUPERV::GraphState   _PortState ;
       OutPort *            _OutPort ;
       OutPort *            _InitialOutPort ;
+      bool                 _BranchOfSwitchLinked ; // For Check from Branches to EndOfSwitch links
 
     public:   
 
@@ -58,24 +59,26 @@ namespace GraphBase {
          cdebug << "GraphBase::InPort::destroy " << PortName() << " "
                 << NodeName() << endl ; } ;
 
-      void State( SUPERV::GraphState aState ) {
+      void PortState( SUPERV::GraphState aPortState ) {
 //           cdebug << pthread_self() << " " << PortName() << " from "
 //                  << NodeName() << " SUPERV::GraphState " << _State << " "
-//                  << " --> " << aState << " _EndSwitchPort "
+//                  << " --> " << aPortState << " _EndSwitchPort "
 //                  << IsEndSwitch() << endl ;
-           _State = aState ; } ;
-      SUPERV::GraphState State() { return _State ; } ;
+           _PortState = aPortState ; } ;
+      SUPERV::GraphState PortState() { return _PortState ; } ;
 
       OutPort * GetOutPort() {
            return _OutPort ; } ;
       OutPort * GetOutPort() const {
            return _OutPort ; } ;
       const StatusOfPort PortStatus() const ;
+
       bool IsNotConnected() const ;
 //      bool IsConnected() const ;
       bool IsPortConnected() const ;
       bool IsDataConnected() const ;
       bool IsExternConnected() const ;
+
       bool AddOutPort( OutPort * anOutPort ) {
            if ( _OutPort )
              return false ;
@@ -91,6 +94,15 @@ namespace GraphBase {
            return false ; } ;
       bool RemoveOutPort() ;
 
+      bool BranchOfSwitchLinked( bool aInPortLinked ) {
+           if ( aInPortLinked && _BranchOfSwitchLinked ) {
+             return false ; // Already setted
+          }
+           _BranchOfSwitchLinked = aInPortLinked ;
+           return true ; } ;
+      bool BranchOfSwitchLinked() {
+           return _BranchOfSwitchLinked ; } ;
+
       void StringValue(ostream & f ) const ;
 
   } ;