X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkBlackBox.cxx;h=94610b0645b0cde78dedb497d4466e5d10522ff3;hb=c03be5662c1ea498e612cbaa9f9b7a9988a65765;hp=ae3ea1f770e2cdaa517a3cf27417b44510e70796;hpb=5ca30b861f60def2666a1c675e8b45df0a713f95;p=bbtk.git diff --git a/kernel/src/bbtkBlackBox.cxx b/kernel/src/bbtkBlackBox.cxx index ae3ea1f..94610b0 100644 --- a/kernel/src/bbtkBlackBox.cxx +++ b/kernel/src/bbtkBlackBox.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkBlackBox.cxx,v $ Language: C++ -Date: $Date: 2008/02/08 10:05:38 $ -Version: $Revision: 1.3 $ +Date: $Date: 2008/03/07 08:40:14 $ +Version: $Revision: 1.6 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See doc/license.txt or @@ -465,10 +465,10 @@ namespace bbtk } if (reaction) bbGlobalProcessExecutionList(); - bbtkDebugMessageDec("Process",5, - "<= BlackBox::bbSignalOutputModification(" - <GetPackage(); + if ((p != 0) && ( ! p->GetFactorySet().empty() ) ) { - a = NewAdaptor( - bbGetOutputType(output), - typeid(std::string), - ""); - } catch (bbtk::Exception e) + Factory* f = *p->GetFactorySet().begin(); + BlackBox* a = 0; + try + { + a = f->NewAdaptor( + bbGetOutputType(output), + typeid(std::string), + ""); + } catch (bbtk::Exception e) + { + } + if (a!=NULL){ + // bbUpdate(); + a->bbSetInput("In",bbGetOutput(output)); + a->bbExecute(); + v = a->bbGetOutput("Out").unsafe_get() ; + } else { + v="? (no adaptor found)"; + } + } + else { + v="? (no factory found)"; } - if (a!=NULL){ - // bbUpdate(); - a->bbSetInput("In",bbGetOutput(output)); - a->bbExecute(); - v = a->bbGetOutput("Out").unsafe_get() ; - } else { - v="? (no adaptor found)"; - } - } else { - // bbUpdate(); - v = bbGetOutput(output).unsafe_get() ; - } + } + else + { + // bbUpdate(); + v = bbGetOutput(output).unsafe_get() ; + } return v; } //========================================================================= @@ -682,28 +694,38 @@ namespace bbtk // Looks for the adaptor if (bbGetInputType(input) != typeid(std::string)) { - BlackBox* a = 0; - try + // Look for factory + Package* p = bbGetDescriptor()->GetPackage(); + if ((p != 0) && ( ! p->GetFactorySet().empty() ) ) { - a = NewAdaptor( - bbGetInputType(input), - typeid(std::string), - ""); - }catch (bbtk::Exception e) - { - } - if (a!=NULL) - { - // bbUpdate(); - a->bbSetInput("In",bbGetInput(input)); - a->bbExecute(); - v = a->bbGetOutput("Out").unsafe_get() ; + Factory* f = *p->GetFactorySet().begin(); + BlackBox* a = 0; + try + { + a = f->NewAdaptor( + bbGetInputType(input), + typeid(std::string), + ""); + }catch (bbtk::Exception e) + { + } + if (a!=NULL) + { + // bbUpdate(); + a->bbSetInput("In",bbGetInput(input)); + a->bbExecute(); + v = a->bbGetOutput("Out").unsafe_get() ; + } + else + { + v="? (no adaptor found)"; + } } else { - v="? (no adaptor found)"; + v="? (no factory found)"; } - } + } else { v = bbGetInput(input).unsafe_get() ; @@ -758,17 +780,19 @@ namespace bbtk bool instanceOrtype, bool relative_link ) - { + { InputConnectorMapType::iterator i; // label std::string labelStr; std::string valueStr(""); - if (detail==0) - { - labelStr = bbGetName() ; - } else { - labelStr = bbGetName(); - labelStr = labelStr + " [" +this->bbGetDescriptor()->GetPackage()->GetName()+"::"+ bbGetTypeName() + "] "; + + if (detail==0) { + labelStr = bbGetName() ; +//EED 18 Fev 2008 + labelStr = labelStr + "\\n[" +this->bbGetDescriptor()->GetPackage()->GetName()+"::"+ bbGetTypeName() + "]"; + } else { + labelStr = bbGetName(); + labelStr = labelStr + " [" +this->bbGetDescriptor()->GetPackage()->GetName()+"::"+ bbGetTypeName() + "] "; } SubsBrackets(labelStr);