X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkComplexBlackBox.cxx;h=f47e401248fdf3c0c5bd7fec30479eec353721a1;hb=e6b2de923e0e69c303c7d18fb8a5c1970541bb3a;hp=f4bc7dd3c42e0dae46d454e1f18ecd6d383d2ed1;hpb=768afeae7c180d69467cf9f6329af457ce2862e9;p=bbtk.git diff --git a/kernel/src/bbtkComplexBlackBox.cxx b/kernel/src/bbtkComplexBlackBox.cxx index f4bc7dd..f47e401 100644 --- a/kernel/src/bbtkComplexBlackBox.cxx +++ b/kernel/src/bbtkComplexBlackBox.cxx @@ -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/07/24 14:37:05 $ +Version: $Revision: 1.20 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -22,6 +22,7 @@ PURPOSE. See the above copyright notices for more information. * \brief class bbtk::ComplexBlackBox : user defined complex black boxes */ #include "bbtkComplexBlackBox.h" +#include "bbtkWx.h" #include "bbtkBlackBoxDescriptor.h" #include "bbtkFactory.h" #include "bbtkConfigurationFile.h" @@ -79,13 +80,17 @@ namespace bbtk <first<<"\""<second->bbClone(i->second->bbGetName()); bbUnsafeAddBlackBox(B); - } bbtkDebugMessage("object",4," * Cloning Connections"< Releasing boxes"<bbDesallocateConnectors(); - if (mLockedDescriptor) - { - bbtkMessage("object",3," --> Releasing descriptor"<GetInputDescriptorMap(); @@ -175,7 +173,6 @@ namespace bbtk ->bbGetInputConnectorMap()[ d->GetInput() ]; bbGetInputConnectorMap()[i->second->GetName()] = c; -//new BlackBoxInputConnector(); } // Output connectors @@ -195,11 +192,8 @@ namespace bbtk ->bbGetOutputConnectorMap()[ d->GetOutput() ]; bbGetOutputConnectorMap()[o->second->GetName()] = c; - //new BlackBoxOutputConnector(); } - -*/ - + bbtkDebugDecTab("Kernel",8); } //========================================================================= @@ -217,11 +211,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); } @@ -244,12 +236,12 @@ namespace bbtk /// Executes the box so that its outputs are up-to-date on exit void ComplexBlackBox::bbExecute(bool force) { - bbtkDebugMessageInc("Process",1, - "ComplexBlackBox::bbExecute() [" + bbtkDebugMessageInc("process",2, + "=> ComplexBlackBox::bbExecute() [" < Executing '"<<*i<<"'"< Executing '"<<*i<<"'"<bbExecute(force); } } @@ -272,26 +264,23 @@ namespace bbtk } } - Wx::EndBusyCursor(); - - - bbtkDebugDecTab("Process",1); - } //================================================================== //================================================================== void ComplexBlackBox::bbSetModifiedStatus(BlackBoxInputConnector* c) { - bbtkDebugMessage("Process",3, - "ComplexBlackBox::bbSetModifiedStatus(" + bbtkDebugMessage("modified",1, + "==> ComplexBlackBox::bbSetModifiedStatus(" <GetBlackBox()->bbSetModifiedStatus(c); - bbtkDebugMessage("Process",3, - "EO ComplexBlackBox::bbSetModifiedStatus(" + /* + bbtkDebugMessage("modified",1, + "<== ComplexBlackBox::bbSetModifiedStatus(" < ComplexBlackBox::bbBackwardUpdate(" <<(caller?caller->GetFullName():"0")<<") [" <GetBlackBoxFrom()->bbGetFullName() <<"."<GetBlackBoxFromOutput()<<"----" <GetOriginalBlackBoxFrom()->bbGetFullName() <<"."<GetOriginalBlackBoxFromOutput()<GetTarget() ); // Calls BackwardUpdate on it - bbtkDebugMessageInc("Process",2,"Internal box connected to output : "<GetTarget()<GetTarget()<GetFullName()<<"' does not point to a valid output of the complex box !"); } - bbtkDebugDecTab("Process",1); return s; @@ -479,7 +467,7 @@ namespace bbtk //========================================================================= /// Connects the input 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 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