X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkComplexBlackBoxDescriptor.cxx;h=679557533a763c58d095c50de67622675c931cf8;hb=c2a4b1893412e50a3d9abff221938a2d16c4a7cb;hp=8485061fde7bdf29ca43926ac542e9eab36905cc;hpb=6f678e6883d4d2734c81492412903c701c8e1f3c;p=bbtk.git diff --git a/kernel/src/bbtkComplexBlackBoxDescriptor.cxx b/kernel/src/bbtkComplexBlackBoxDescriptor.cxx index 8485061..6795575 100644 --- a/kernel/src/bbtkComplexBlackBoxDescriptor.cxx +++ b/kernel/src/bbtkComplexBlackBoxDescriptor.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkComplexBlackBoxDescriptor.cxx,v $ Language: C++ - Date: $Date: 2008/02/07 11:06:37 $ - Version: $Revision: 1.7 $ + Date: $Date: 2008/04/09 11:16:57 $ + Version: $Revision: 1.14 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -33,12 +33,14 @@ namespace bbtk //======================================================================= /// Default ctor ComplexBlackBoxDescriptor::ComplexBlackBoxDescriptor(const std::string& name) - : BlackBoxDescriptor() + : BlackBoxDescriptor(), + mFactory(0) { bbtkDebugMessageInc("Kernel",9,"ComplexBlackBoxDescriptor::ComplexBlackBoxDescriptor(\""<Reference(); bbtkDebugDecTab("Kernel",9); } //======================================================================= @@ -49,14 +51,22 @@ namespace bbtk /// Default dtor ComplexBlackBoxDescriptor::~ComplexBlackBoxDescriptor() { - bbtkDebugMessageInc("Kernel",9,"ComplexBlackBoxDescriptor::~ComplexBlackBoxDescriptor(\""<Check(recursive); + } + //========================================================================= //======================================================================= /// Creates an instance of name of the ComplexBlackBox of which this is the descriptor @@ -87,6 +97,11 @@ namespace bbtk <bbUnsafeGetBlackBox( name ) ) @@ -94,7 +109,7 @@ namespace bbtk bbtkError("a black box \""<bbAddBlackBox ( /*mFactory->Create*/ NewBlackBox(type,name) ); + mPrototype->bbAddBlackBox ( mFactory->NewBlackBox(type,name) ); bbtkDebugDecTab("Kernel",5); } @@ -135,6 +150,13 @@ namespace bbtk <bbGetBlackBox( from ); if ( !bbfrom ) @@ -147,7 +169,7 @@ namespace bbtk bbtkError("the black box \""<*/ NewConnection( bbfrom, output, bbto, input ); + Connection* c = mFactory->NewConnection( bbfrom, output, bbto, input ); mPrototype->bbAddConnection(c); @@ -182,13 +204,16 @@ namespace bbtk <bbGetDescriptor()->GetInputDescriptor(input); AddInputDescriptor ( new ComplexBlackBoxInputDescriptor ( typeid(ComplexBlackBoxDescriptor), name, help, + d->GetNature(), box, input, - bb->bbGetInputType(input))); + d->GetTypeInfo())); bbtkDebugDecTab("Kernel",5); @@ -221,13 +246,16 @@ namespace bbtk <bbGetDescriptor()->GetOutputDescriptor(output); AddOutputDescriptor ( new ComplexBlackBoxOutputDescriptor ( typeid(ComplexBlackBoxDescriptor), name, help, + d->GetNature(), box, output, - bb->bbGetOutputType(output))); + d->GetTypeInfo())); bbtkDebugDecTab("Kernel",5); @@ -286,8 +314,12 @@ namespace bbtk std::string author = GetAuthor(); Utilities::html_format(author); - std::string category = GetCategory(); - Utilities::html_format(category); + std::vector categories; + // Split the category string + std::string delimiters = ";,"; + Utilities::SplitString(GetCategory(), + delimiters,categories); + (s) << "

\n"; (s) << "\n"; - (s) << "\n"; - + (s) << "\n"; std::string inc = GetScriptFileName(); if (inc.size()>0) { - (s) << "\n"; + s << "\n"; } @@ -311,7 +349,7 @@ namespace bbtk if (B.size()) { - (s) << "
Description : " @@ -296,14 +328,20 @@ namespace bbtk (s) << "
Author(s) : " << author << "
Category(s) : " - << category << "
Category(s) : "; + std::vector::iterator ci; + for (ci=categories.begin(); ci!=categories.end(); ++ci) + { + s << "" << *ci + << " \n"; + } + s << "
To use it : include " - << inc << "
To use it : include "; + s << inc << "  [source]"; + s << "
Dependencies : "; + (s) << "
Uses : "; std::set pdeps; ComplexBlackBox::BlackBoxMapType::const_iterator b; @@ -437,12 +475,15 @@ namespace bbtk InputDescriptorMapType::const_iterator i; unsigned int namelmax = 0; unsigned int typelmax = 0; + unsigned int natlmax = 0; for ( i = mInput.begin(); i != mInput.end(); ++i ) { if (i->second->GetName().size()>namelmax) namelmax = i->second->GetName().size(); if (i->second->GetTypeName().size()>typelmax) typelmax = i->second->GetTypeName().size(); + if (i->second->GetNature().size()>natlmax) + natlmax = i->second->GetNature().size(); } OutputDescriptorMapType::const_iterator o; if (full) @@ -453,6 +494,8 @@ namespace bbtk namelmax = o->second->GetName().size(); if (o->second->GetTypeName().size()>typelmax) typelmax = o->second->GetTypeName().size(); + if (o->second->GetNature().size()>natlmax) + natlmax = o->second->GetNature().size(); } } // @@ -465,10 +508,14 @@ namespace bbtk std::string type(i->second->GetTypeName()); type += ">"; type.append(1+typelmax-type.size(),' '); + std::string nature(i->second->GetNature()); + nature += "]"; + nature.append(1+natlmax-nature.size(),' '); bbtkMessage("Help",1, - " '"<second->GetDescription()<second->GetDescription()<second->GetTypeName()); type += ">"; type.append(1+typelmax-type.size(),' '); + std::string nature(o->second->GetNature()); + nature += "]"; + nature.append(1+natlmax-nature.size(),' '); bbtkMessage("Help",1, - " '"<second->GetDescription()<