X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkComplexBlackBox.cxx;h=3625afdb8705fa9d40da4092c59c5ca6be54ac98;hb=6ac9074f717f22c4ffdc6a70d0704c1b1f8fe842;hp=de9bb69e41cb1e154bb38c60899a1677c2a895fd;hpb=3928b4ad06b5b5fd142f696f58a7828d064e2883;p=bbtk.git diff --git a/kernel/src/bbtkComplexBlackBox.cxx b/kernel/src/bbtkComplexBlackBox.cxx index de9bb69..3625afd 100644 --- a/kernel/src/bbtkComplexBlackBox.cxx +++ b/kernel/src/bbtkComplexBlackBox.cxx @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbtkComplexBlackBox.cxx,v $ Language: C++ - Date: $Date: 2008/12/08 12:54:09 $ - Version: $Revision: 1.22 $ + Date: $Date: 2010/03/19 08:18:41 $ + Version: $Revision: 1.32 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -35,8 +35,8 @@ */ #include "bbtkComplexBlackBox.h" #include "bbtkWx.h" -#include "bbtkBlackBoxDescriptor.h" -#include "bbtkFactory.h" +//#include "bbtkBlackBoxDescriptor.h" +//#include "bbtkFactory.h" #include "bbtkConfigurationFile.h" namespace bbtk @@ -66,12 +66,12 @@ namespace bbtk mLockedDescriptor(desc), mDescriptor(desc) { - bbtkDebugMessage("object",3, - "##> ComplexBlackBox::ComplexBlackBox(\"" + bbtkBlackBoxDebugMessage("object",3, + "##> ComplexBlackBox(\"" < ComplexBlackBox::ComplexBlackBox(\"" + bbtkBlackBoxDebugMessage("object",3, + "##> ComplexBlackBox(\"" <first<<"\""<first<<"\""<second->bbClone(i->second->bbGetName()); bbUnsafeAddBlackBox(B); } - bbtkDebugMessage("object",4," * Cloning Connections"<GetFullName()<<"\""<GetOriginalBlackBoxFrom()->bbGetName() ); @@ -127,8 +127,8 @@ namespace bbtk } bbAllocateConnectors(); - bbtkDebugMessage("object",3, - "<## ComplexBlackBox::ComplexBlackBox(\"" + bbtkBlackBoxDebugMessage("object",3, + "<## ComplexBlackBox(\"" < ComplexBlackBox::~ComplexBlackBox() [" - < ~ComplexBlackBox()" + <bbDesallocateConnectors(); + + bbtkBlackBoxDebugMessage("object",3, + "<== ~ComplexBlackBox()" + < ComplexBlackBox::Clear()" + < Releasing connections"< Releasing boxes"<bbDesallocateConnectors(); - - bbtkDebugMessage("object",3, - "<== ComplexBlackBox::~ComplexBlackBox() [" - < ComplexBlackBox::bbAllocateConnectors()" <first<<"\""<first<<"\""<first<<"\""<first<<"\""<second->GetName()] = c; } - - bbtkDebugDecTab("Kernel",8); - } + bbtkBlackBoxDebugMessage("kernel",8, + "<== ComplexBlackBox::bbAllocateConnectors()" + < ComplexBlackBox::DesallocateConnectors()" < ComplexBlackBox::bbClone(\""< ComplexBlackBox::bbExecute() [" - < ComplexBlackBox::bbExecute()" + < Executing '"<<*i<<"'"< Executing '"<<*i<<"'"<bbExecute(force); } } @@ -275,104 +295,23 @@ namespace bbtk i->second->bbExecute(force); } } - - } - //================================================================== - - /* - //================================================================== - void ComplexBlackBox::bbSetModifiedStatus(BlackBoxInputConnector* c) - { - bbtkDebugMessage("modified",1, - "==> ComplexBlackBox::bbSetModifiedStatus(" - <GetBlackBox()->bbSetModifiedStatus(c); - + bbtkBlackBoxDebugMessage("process",2, + "<** ComplexBlackBox::bbExecute()" + < ComplexBlackBox::bbBackwardUpdate(" - <<(caller?caller->GetFullName():"0")<<") [" - <GetBlackBoxFrom()->bbGetFullName() - <<"."<GetBlackBoxFromOutput()<<"----" - <GetOriginalBlackBoxFrom()->bbGetFullName() - <<"."<GetOriginalBlackBoxFromOutput()<GetOutputDescriptorMap(); - BlackBoxDescriptor::OutputDescriptorMapType::const_iterator i - = omap.find(caller->GetBlackBoxFromOutput()); - if (i!=omap.end()) - { - // Cast the BBOutputDescriptor into a ComplexBBOutputDescriptor - ComplexBlackBoxOutputDescriptor* d = - (ComplexBlackBoxOutputDescriptor*)i->second; - // Get the internal box - BlackBox::Pointer b = bbUnsafeGetBlackBox ( d->GetTarget() ); - // Calls BackwardUpdate on it - bbtkDebugMessageInc("process",4,"Internal box connected to output : "<GetTarget()<GetBlackBoxFromOutput(); - // std::cout << "oldout = "<GetFullName()<<"' does not point to a valid output of the complex box !"); - } - - return; // s; } //================================================================== @@ -381,9 +320,9 @@ namespace bbtk //================================================================== Data ComplexBlackBox::bbGetOutput( const std::string &name ) { - bbtkDebugMessageInc("Data",7, - "ComplexBlackBox::bbGetOutput(\""<GetTarget())->bbGetOutput(d->GetOutput()); - - bbtkDebugDecTab("Data",7); return p; } //================================================================== @@ -401,9 +338,9 @@ namespace bbtk /// Gets the input Data of a given name Data ComplexBlackBox::bbGetInput( const std::string &name ) { - bbtkDebugMessageInc("Data",7, - "ComplexBlackBox::bbGetInput(\""<GetTarget())->bbGetInput(d->GetInput()); - bbtkDebugDecTab("Data",7); return p; } //================================================================== @@ -420,9 +356,9 @@ namespace bbtk /// Sets the data of the output called void ComplexBlackBox::bbSetOutput( const std::string &name, Data data) { - bbtkDebugMessageInc("Data",7, - "ComplexBlackBox::bbSetOutput(\""<GetTarget())->bbSetOutput(d->GetOutput(),data); - bbtkDebugDecTab("Data",7); } //================================================================== @@ -439,16 +374,15 @@ namespace bbtk void ComplexBlackBox::bbSetInput( const std::string &name, Data data, bool setModified) { - bbtkDebugMessageInc("Data",7, - "ComplexBlackBox::bbSetInput(\""<GetInputDescriptor(name); bbGetBlackBox(d->GetTarget())->bbSetInput(d->GetInput(),data,setModified); - bbtkDebugDecTab("Data",7); } //================================================================== @@ -459,10 +393,10 @@ namespace bbtk void* data, bool setModified) { - bbtkDebugMessageInc("Data",7, + bbtkBlackBoxDebugMessage("data",7, "ComplexBlackBox::bbBruteForceSetInputPointer('" - <GetInputDescriptor(name); @@ -471,7 +405,6 @@ namespace bbtk data, setModified); - bbtkDebugDecTab("Data",7); } //================================================================== @@ -479,10 +412,9 @@ namespace bbtk /// Connects the input to the connection c void ComplexBlackBox::bbConnectInput( const std::string& name, Connection* c) { - bbtkDebugMessage("connection",2, + bbtkBlackBoxDebugMessage("connection",2, "==> ComplexBlackBox::bbConnectInput(\"" - <GetFullName()<<") [" - <GetFullName()<<")" <GetTarget()); - bbtkDebugMessage("connection",2," - Target = "<GetTarget()<<" = "<bbGetFullName()<bbGetFullName()<SetBlackBoxTo(t); c->SetBlackBoxToInput(d->GetInput()); - bbtkDebugMessage("connection",2," - New conn = "<GetFullName()<GetFullName()<<") [" - <GetFullName()<<")" < to the connection c void ComplexBlackBox::bbConnectOutput( const std::string& name, Connection* c) { - bbtkDebugMessage("connection",2, + bbtkBlackBoxDebugMessage("connection",2, "==> ComplexBlackBox::bbConnectOutput(\"" - <GetFullName()<<") [" - <GetFullName()<<")" + <GetOutputDescriptor(name); BlackBox::Pointer t = bbGetBlackBox(d->GetTarget()); - bbtkDebugMessage("connection",2," - Target = "<GetTarget()<<" = "<bbGetFullName()<bbGetFullName()<SetBlackBoxFrom(t); c->SetBlackBoxFromOutput(d->GetOutput()); - bbtkDebugMessage("connection",2," - New conn = "<GetFullName()<GetFullName()<<") [" - <GetFullName()<<")" + <bbGetName() - <<"\") [" - <bbGetName() + <<"\")" + <bbGetName()) ) { @@ -556,7 +487,6 @@ namespace bbtk b->bbSetParent(GetThisPointer()); mBlackBoxMap[b->bbGetName()] = b; - bbtkDebugDecTab("Kernel",7); } //================================================================== @@ -564,15 +494,14 @@ namespace bbtk /// Adds the black box to the complex box (unsafe) void ComplexBlackBox::bbUnsafeAddBlackBox( BlackBox::Pointer b) { - bbtkDebugMessageInc("Kernel",7, + bbtkBlackBoxDebugMessage("kernel",7, "ComplexBlackBox::UnsafeAddBlackBox(\""<bbGetName() - <<"\") [" - <bbSetParent(GetThisPointer()); mBlackBoxMap[b->bbGetName()] = b; - bbtkDebugDecTab("Kernel",7); } //================================================================== @@ -581,9 +510,9 @@ namespace bbtk void ComplexBlackBox::bbRemoveBlackBox( const std::string& name, bool remove_connections ) { - bbtkDebugMessageInc("Kernel",7, - "ComplexBlackBox::RemoveBlackBox(\""< BlackBox::Pointer ComplexBlackBox::bbGetBlackBox( const std::string& name ) { - bbtkDebugMessageInc("Kernel",9, - "ComplexBlackBox::GetBlackBox(\""<second; } //================================================================== @@ -655,19 +581,16 @@ namespace bbtk /// if it does not exist but return a null pointer BlackBox::Pointer ComplexBlackBox::bbUnsafeGetBlackBox( const std::string& name ) { - bbtkDebugMessageInc("Kernel",9, - "ComplexBlackBox::UnsafeGetBlackBox(\""<second; } @@ -676,18 +599,16 @@ namespace bbtk //================================================================== void ComplexBlackBox::bbPrintBlackBoxes() { - bbtkDebugMessageInc("Kernel",9, - "ComplexBlackBox::PrintBlackBoxes() [" - <second->bbGetFullName()<second->bbGetFullName()<\n\n"; // End