X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkComplexBlackBox.cxx;h=195b53a222040423bd4389139ebaf3fde5e904ef;hb=3dcc408acd2264664ca6431a501378ea64233dd6;hp=f3531fc5b301539336b3539d80f6c324767b1eec;hpb=98e18224b83c6955a804d79d4e7083626ea8afcd;p=bbtk.git diff --git a/kernel/src/bbtkComplexBlackBox.cxx b/kernel/src/bbtkComplexBlackBox.cxx index f3531fc..195b53a 100644 --- a/kernel/src/bbtkComplexBlackBox.cxx +++ b/kernel/src/bbtkComplexBlackBox.cxx @@ -1,32 +1,38 @@ -/*========================================================================= +/* + # --------------------------------------------------------------------- + # + # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image + # pour la SantÈ) + # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton + # Previous Authors : Laurent Guigues, Jean-Pierre Roux + # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil + # + # This software is governed by the CeCILL-B license under French law and + # abiding by the rules of distribution of free software. You can use, + # modify and/ or redistribute the software under the terms of the CeCILL-B + # license as circulated by CEA, CNRS and INRIA at the following URL + # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html + # or in the file LICENSE.txt. + # + # As a counterpart to the access to the source code and rights to copy, + # modify and redistribute granted by the license, users are provided only + # with a limited warranty and the software's author, the holder of the + # economic rights, and the successive licensors have only limited + # liability. + # + # The fact that you are presently reading this means that you have had + # knowledge of the CeCILL-B license and that you accept its terms. + # ------------------------------------------------------------------------ */ + + +/*========================================================================= Program: bbtk Module: $RCSfile: bbtkComplexBlackBox.cxx,v $ Language: C++ - Date: $Date: 2009/03/30 15:22:51 $ - Version: $Revision: 1.25 $ + Date: $Date: 2012/11/16 08:49:01 $ + Version: $Revision: 1.33 $ =========================================================================*/ -/* --------------------------------------------------------------------- - -* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) -* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux -* -* This software is governed by the CeCILL-B license under French law and -* abiding by the rules of distribution of free software. You can use, -* modify and/ or redistribute the software under the terms of the CeCILL-B -* license as circulated by CEA, CNRS and INRIA at the following URL -* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -* or in the file LICENSE.txt. -* -* As a counterpart to the access to the source code and rights to copy, -* modify and redistribute granted by the license, users are provided only -* with a limited warranty and the software's author, the holder of the -* economic rights, and the successive licensors have only limited -* liability. -* -* The fact that you are presently reading this means that you have had -* knowledge of the CeCILL-B license and that you accept its terms. -* ------------------------------------------------------------------------ */ /** @@ -35,8 +41,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 +72,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 +133,8 @@ namespace bbtk } bbAllocateConnectors(); - bbtkDebugMessage("object",3, - "<## ComplexBlackBox::ComplexBlackBox(\"" + bbtkBlackBoxDebugMessage("object",3, + "<## ComplexBlackBox(\"" < ComplexBlackBox::~ComplexBlackBox() [" - < ~ComplexBlackBox()" + <bbDesallocateConnectors(); - bbtkDebugMessage("object",3, - "<== ComplexBlackBox::~ComplexBlackBox() [" - < ComplexBlackBox::Clear() [" - < ComplexBlackBox::Clear()" + < Releasing connections"< Releasing boxes"< 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); } } @@ -289,21 +301,23 @@ namespace bbtk i->second->bbExecute(force); } } - + bbtkBlackBoxDebugMessage("process",2, + "<** ComplexBlackBox::bbExecute()" + <GetTarget())->bbGetOutput(d->GetOutput()); - - bbtkDebugDecTab("Data",7); return p; } //================================================================== @@ -332,9 +344,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; } //================================================================== @@ -351,9 +362,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); } //================================================================== @@ -370,16 +380,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); } //================================================================== @@ -390,10 +399,10 @@ namespace bbtk void* data, bool setModified) { - bbtkDebugMessageInc("Data",7, + bbtkBlackBoxDebugMessage("data",7, "ComplexBlackBox::bbBruteForceSetInputPointer('" - <GetInputDescriptor(name); @@ -402,7 +411,6 @@ namespace bbtk data, setModified); - bbtkDebugDecTab("Data",7); } //================================================================== @@ -410,10 +418,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()) ) { @@ -487,7 +493,6 @@ namespace bbtk b->bbSetParent(GetThisPointer()); mBlackBoxMap[b->bbGetName()] = b; - bbtkDebugDecTab("Kernel",7); } //================================================================== @@ -495,15 +500,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); } //================================================================== @@ -512,9 +516,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; } //================================================================== @@ -586,19 +587,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; } @@ -607,18 +605,16 @@ namespace bbtk //================================================================== void ComplexBlackBox::bbPrintBlackBoxes() { - bbtkDebugMessageInc("Kernel",9, - "ComplexBlackBox::PrintBlackBoxes() [" - <second->bbGetFullName()<second->bbGetFullName()<