]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkBlackBox.cxx
bbAlways vs Always (to avoid troubles with X11 at compile time)
[bbtk.git] / kernel / src / bbtkBlackBox.cxx
index c74b2e9e1cf4a53a87ab398660813ffadc5d580a..35bda120cdf1aebc80a2d43cdc83e8dcecc1e9cf 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBox.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/06/08 14:50:02 $
-  Version:   $Revision: 1.48 $
+  Date:      $Date: 2011/03/03 14:33:13 $
+  Version:   $Revision: 1.51 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -48,8 +48,6 @@
 
 namespace bbtk
 {
-
-
   static bool bbmgSomeBoxExecuting = false;
   static bool bbmgFreezeExecution = false;
   static std::set<BlackBox::WeakPointer> bbmgExecutionList;
@@ -114,6 +112,10 @@ namespace bbtk
     bbmParent()
     
   {
+         //JCP 02-11-09
+        // bbmBoxProcessMode = "Pipeline";     
+//std::cout<<"JCP BlackBox::BlackBox(const std::string &name) name=" <<name
+//               <<"bbmBoxProcessMode="<<bbmBoxProcessMode<<std::endl;
     bbtkBlackBoxDebugMessage("object",4,"==> BlackBox::BlackBox(\""
                     <<name<<"\")"<<std::endl);
     bbtkBlackBoxDebugMessage("object",4,"<== BlackBox::BlackBox(\""
@@ -136,6 +138,10 @@ namespace bbtk
     bbmParent()
     
   {
+         //JCP 02-11-09
+         //bbmBoxProcessMode = from.bbmBoxProcessMode;
+         //std::cout<<"JCP BlackBox::BlackBox(const std::string &name) name=" <<name
+               //  <<"bbmBoxProcessMode="<<bbmBoxProcessMode<<std::endl;
     bbtkBlackBoxDebugMessage("object",4,"==> BlackBox::BlackBox("
                     <<from.bbGetFullName()<<",\""
                     <<name<<"\")"<<std::endl);
@@ -273,7 +279,6 @@ namespace bbtk
        bbGetOutputConnectorMap()[o->second->GetName()] 
          = new BlackBoxOutputConnector(GetThisPointer<BlackBox>());
       }
-
   }
   //=========================================================================
 
@@ -300,8 +305,7 @@ namespace bbtk
        delete (o->second);
       }                                                                        
    
-    bbtkDebugDecTab("kernel",8);  
-
+    bbtkDebugDecTab("kernel",8);
   }
   //=========================================================================
 
@@ -337,7 +341,6 @@ namespace bbtk
       }
 
     bbtkDebugDecTab("kernel",9);
-
   }
   //=========================================================================
 
@@ -350,7 +353,7 @@ namespace bbtk
 #ifdef USE_WXWIDGETS
             || Wx::IsSomeWindowAlive() 
 #endif
-            ); 
+            );
   }
   //=========================================================================
 
@@ -362,13 +365,14 @@ namespace bbtk
     const std::string& p = bbmBoxProcessMode;
     if ( (p == "0") ||
         (p == "P") || (p == "p") ||
-        (p == "Pipeline") || (p == "pipeline") ) return Pipeline;
+        (p == "Pipeline") || (p == "pipeline") ) return bbPipeline;
     if ( (p == "1") ||
         (p == "A") || (p == "a") ||
-        (p == "Always") || (p == "always") ) return Always;
+        (p == "Always") || (p == "always") ) return bbAlways;
     if ( (p == "2") ||
         (p == "R") || (p == "r") ||
-        (p == "Reactive") || (p == "reactive") ) return Reactive;
+        (p == "Reactive") || (p == "reactive") ) 
+               return bbReactive;
     /*
     if ( (p == "3") ||
         (p == "F") || (p == "f") ||
@@ -387,14 +391,14 @@ namespace bbtk
   //=========================================================================
   bool  BlackBox::bbBoxProcessModeIsReactive() const
   {
-    return (bbGetBoxProcessModeValue() == Reactive);
+    return (bbGetBoxProcessModeValue() == BlackBox::Reactive);
   }
   //=========================================================================
 
   //=========================================================================
   bool  BlackBox::bbBoxProcessModeIsAlways() const
   {
-    return (bbGetBoxProcessModeValue() == Always);
+    return (bbGetBoxProcessModeValue() == BlackBox::Always);
   }
   //=========================================================================
 
@@ -447,7 +451,7 @@ namespace bbtk
            o->second->SetStatus(OUTOFDATE);
            o->second->SignalChange(GetThisPointer<BlackBox>(),o->first); 
          }
-      }                                                                        
+       }                                                               
     
     if ( ( bbBoxProcessModeIsReactive()  ||
           (c==bbGetInputConnectorMap().find("BoxExecute")->second))
@@ -471,7 +475,7 @@ namespace bbtk
                             "=> BlackBox::bbSignalOutputModification("
                             <<reaction<<")"
                             <<"]"<<std::endl);
-    
+
     OutputConnectorMapType::iterator i;
     for ( i  = bbGetOutputConnectorMap().begin(); 
          i != bbGetOutputConnectorMap().end(); ++i) 
@@ -492,7 +496,6 @@ namespace bbtk
     bbtkBlackBoxDebugMessage("change",5,
                             "<= BlackBox::bbSignalOutputModification()"
                             <<std::endl);
-    
   }  
   //=========================================================================   
   //=========================================================================  
@@ -532,7 +535,6 @@ namespace bbtk
                             "<= BlackBox::bbSignalOutputModification("
                             <<output<<")"
                             <<std::endl);
-    
   }  
   //=========================================================================   
   //=========================================================================  
@@ -576,7 +578,6 @@ namespace bbtk
     bbtkBlackBoxDebugMessage("change",5,
                             "<= BlackBox::bbSignalOutputModification(vector of outputs)"
                             <<std::endl);
-
   }  
   //=========================================================================   
 
@@ -724,8 +725,7 @@ namespace bbtk
     bbSetExecuting(false);
     bbGlobalSetSomeBoxExecuting(wasExecuting);
 
-    return; 
-
+    return;
   }
   //=========================================================================
   
@@ -768,9 +768,7 @@ namespace bbtk
     
     bbtkBlackBoxDebugMessage("process",4,
                        "<= BlackBox::bbUpdateInputs()"
-                       <<std::endl);   
-    
-    
+                       <<std::endl);
     return s;
   }
   //=========================================================================
@@ -814,8 +812,7 @@ namespace bbtk
 
     bbtkBlackBoxDebugMessage("process",4,
                        "<= BlackBox::bbComputePostProcessStatus()"
-                       <<std::endl);   
-
+                       <<std::endl);
   }
   //==================================================================
 
@@ -827,7 +824,6 @@ namespace bbtk
                        <<name<<"\","<<c->GetFullName()<<")"
                        <<std::endl);       
 
-
     InputConnectorMapType::iterator i = bbGetInputConnectorMap().find(name);
     if (i==bbGetInputConnectorMap().end())
       {
@@ -836,12 +832,11 @@ namespace bbtk
     i->second->SetConnection(c);
     // The input *MUST* be set OUTOFDATE to update its input on next execution
     bbSetStatusAndPropagate(i->second,OUTOFDATE);
-    
+
     bbtkBlackBoxDebugMessage("connection",2,
                        "<== BlackBox::bbConnectInput(\""
                        <<name<<"\","<<c->GetFullName()<<")"
-                       <<std::endl);       
-
+                       <<std::endl);
   }
   //=========================================================================
 
@@ -853,7 +848,7 @@ namespace bbtk
                             "==> BlackBox::bbConnectOutput(\""<<name<<"\","
                             <<c->GetFullName()<<")"
                             <<std::endl);       
-    
+
     OutputConnectorMapType::iterator i = bbGetOutputConnectorMap().find(name);
     if (i==bbGetOutputConnectorMap().end())
       {
@@ -864,8 +859,7 @@ namespace bbtk
     bbtkBlackBoxDebugMessage("connection",2,
                             "<== BlackBox::bbConnectOutput(\""<<name<<"\","
                             <<c->GetFullName()<<")"
-                            <<std::endl);       
-
+                            <<std::endl);
   }
   //=========================================================================
 
@@ -877,8 +871,7 @@ namespace bbtk
     bbtkBlackBoxDebugMessage("connection",2,
                     "==> BlackBox::bbDisconnectInput(\""<<name
                     <<"\","<<c->GetFullName()<<")"
-                    <<std::endl);      
-
+                    <<std::endl);
     if (!c) 
       {