]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkComplexBlackBox.cxx
*** empty log message ***
[bbtk.git] / kernel / src / bbtkComplexBlackBox.cxx
index f4bc7dd3c42e0dae46d454e1f18ecd6d383d2ed1..d15a45cc726c94b137be1158e8c17c4a2b3d2dee 100644 (file)
@@ -3,8 +3,8 @@
 Program:   bbtk
 Module:    $RCSfile: bbtkComplexBlackBox.cxx,v $
 Language:  C++
-Date:      $Date: 2008/04/22 08:29:09 $
-Version:   $Revision: 1.14 $
+Date:      $Date: 2008/04/22 14:30:25 $
+Version:   $Revision: 1.15 $
                                                                                 
 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
 l'Image). All rights reserved. See Doc/License.txt or
@@ -132,16 +132,9 @@ namespace bbtk
                     " -> Releasing boxes"<<std::endl);
     mBlackBoxMap.clear();
 
-    /*    
     //    Clear();
     this->bbDesallocateConnectors();
-    if (mLockedDescriptor) 
-      {
-       bbtkMessage("object",3," --> Releasing descriptor"<<std::endl);
-       mLockedDescriptor.reset();                                      
-       if (!mDescriptor.expired()) BlackBoxDescriptor::Release(mDescriptor);
-      }
-    */
+
     bbtkDebugMessage("object",3,
                     "<== ComplexBlackBox::~ComplexBlackBox() ["
                     <<bbGetName()<<"]"<<std::endl);
@@ -157,7 +150,7 @@ namespace bbtk
                        "ComplexBlackBox::bbAllocateConnectors() ["
                        <<bbGetFullName()<<"]"
                        <<std::endl);   
-    /*
+    
     // Input connectors
     const BlackBoxDescriptor::InputDescriptorMapType& imap 
       = bbGetDescriptor()->GetInputDescriptorMap(); 
@@ -175,7 +168,6 @@ namespace bbtk
          ->bbGetInputConnectorMap()[ d->GetInput() ];
        
        bbGetInputConnectorMap()[i->second->GetName()] = c;
-//new BlackBoxInputConnector();
       }                                                                        
 
     // Output connectors
@@ -195,11 +187,8 @@ namespace bbtk
          ->bbGetOutputConnectorMap()[ d->GetOutput() ];
 
        bbGetOutputConnectorMap()[o->second->GetName()] = c;
-       //new BlackBoxOutputConnector();
       }
-
-*/
-
+    
     bbtkDebugDecTab("Kernel",8);  
   }
   //=========================================================================
@@ -217,11 +206,9 @@ namespace bbtk
     // but by the internal boxes. Hence **DO NOT** desallocate !
     // just clear the maps to avoid that 
     // BlackBox::bbDesallocateConnectors delete the connectors
-    /*
-   bbGetInputConnectorMap().clear();
+    bbGetInputConnectorMap().clear();
     bbGetOutputConnectorMap().clear();
-    */
+
     bbtkDebugDecTab("Kernel",8);  
 
   }
@@ -324,11 +311,12 @@ namespace bbtk
        bbtkInternalError("ComplexBlackBox::bbBackwardUpdate called with caller=0");
       }
 
+    /*
     std::cout << "CBB BUP : "<<caller->GetBlackBoxFrom()->bbGetFullName()
              <<"."<<caller->GetBlackBoxFromOutput()<<"----"
              <<caller->GetOriginalBlackBoxFrom()->bbGetFullName()
              <<"."<<caller->GetOriginalBlackBoxFromOutput()<<std::endl;
-      
+    */
       
 
 
@@ -479,7 +467,7 @@ namespace bbtk
 
   //=========================================================================
   /// Connects the input <name> to the connection c
-  void ComplexBlackBox::bbConnectInput( const std::string& name, Connection::Pointer c)
+  void ComplexBlackBox::bbConnectInput( const std::string& name, Connection* c)
   {
     bbtkDebugMessage("connection",2,
                     "==> ComplexBlackBox::bbConnectInput(\""
@@ -512,7 +500,7 @@ namespace bbtk
 
   //=========================================================================  
   /// Connects the output <name> to the connection c
-  void ComplexBlackBox::bbConnectOutput( const std::string& name, Connection::Pointer c)
+  void ComplexBlackBox::bbConnectOutput( const std::string& name, Connection* c)
   {
     bbtkDebugMessage("connection",2,
                     "==> ComplexBlackBox::bbConnectOutput(\""
@@ -1042,21 +1030,21 @@ namespace bbtk
        {
          if (ii->second)
            {
-             Connection::Pointer con = ii->second->GetConnection();
+             Connection* con = ii->second->GetConnection();
              if (con!=NULL){
-               BlackBox::Pointer a=con->GetBlackBoxFrom();
-               BlackBox::Pointer b=con->GetBlackBoxTo();
+               BlackBox::Pointer a=con->GetOriginalBlackBoxFrom();
+               BlackBox::Pointer b=con->GetOriginalBlackBoxTo();
                fprintf(ff,"  ");
                a->bbWriteDotInputOutputName(ff,false,detail,level);
                if (detail==1)
                  {
-                   fprintf(ff,":%s",con->GetBlackBoxFromOutput().c_str());
+                   fprintf(ff,":%s",con->GetOriginalBlackBoxFromOutput().c_str());
                  }
                fprintf(ff,"->");
                b->bbWriteDotInputOutputName(ff,true,detail,level);
                if (detail==1)
                  {
-                   fprintf(ff,":%s",con->GetBlackBoxToInput().c_str());
+                   fprintf(ff,":%s",con->GetOriginalBlackBoxToInput().c_str());
                  }
                fprintf(ff,"%s\n",";");
              } // if con