X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkBlackBoxDescriptor.cxx;h=f1fb6a003a7981f7e8c99d37e6586f31b485c53f;hb=5d503ab0e50fbae3cd2ebd26e6c815557abbe42e;hp=c81206d1c75946e72848571b71f6b419ce4c9ecb;hpb=7eba604321498f7ed6333b7cbe9bf2aceb4ec30e;p=bbtk.git diff --git a/kernel/src/bbtkBlackBoxDescriptor.cxx b/kernel/src/bbtkBlackBoxDescriptor.cxx index c81206d..f1fb6a0 100644 --- a/kernel/src/bbtkBlackBoxDescriptor.cxx +++ b/kernel/src/bbtkBlackBoxDescriptor.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkBlackBoxDescriptor.cxx,v $ Language: C++ - Date: $Date: 2008/02/06 14:14:22 $ - Version: $Revision: 1.9 $ + Date: $Date: 2008/05/14 10:26:29 $ + Version: $Revision: 1.18 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -24,12 +24,16 @@ #include "bbtkMessageManager.h" #include "bbtkPackage.h" #include "bbtkUtilities.h" -#include "bbtkUserBlackBoxDescriptor.h" +#include "bbtkAtomicBlackBoxDescriptor.h" #include "bbtkWxBlackBox.h" namespace bbtk { - + + typedef Package::Pointer PackagePointer; + + + //========================================================================= /// Default ctor BlackBoxDescriptor::BlackBoxDescriptor() @@ -38,20 +42,27 @@ namespace bbtk mAuthor(""), mCategory(""), mKind(STANDARD), - mPackage(NULL) + mPackage() { - bbtkDebugMessage("Kernel",9, - "BlackBoxDescriptor::BlackBoxDescriptor()"< BlackBoxDescriptor::BlackBoxDescriptor()"< BlackBoxDescriptor::~BlackBoxDescriptor() [" + <second; - bbtkDebugDecTab("Kernel",9); + bbtkDebugMessage("object",4, + "<== BlackBoxDescriptor::~BlackBoxDescriptor() [" + < BlackBoxDescriptor::Release('" + <GetTypeName()<<"')"< No more instance alive = releasing from package"<mPackage; + Package::ReleaseBlackBoxDescriptor(pack,desc); + } + else + { + bbtkMessage("object",2," --> Still some instances alive = Keeping it alive"<GetTypeName()<<"')"< Destructing BlackBoxDescriptor ["<GetName()<<"::"<"<"<"<second->GetName().size()>namelmax) namelmax = i->second->GetName().size(); if (i->second->GetHumanTypeName().size()>typelmax) typelmax = i->second->GetHumanTypeName().size(); + if (i->second->GetNature().size()>natlmax) + natlmax = i->second->GetNature().size(); } OutputDescriptorMapType::const_iterator o; for ( o = mOutput.begin(); o != mOutput.end(); ++o ) @@ -170,6 +232,8 @@ namespace bbtk namelmax = o->second->GetName().size(); if (o->second->GetHumanTypeName().size()>typelmax) typelmax = o->second->GetHumanTypeName().size(); + if (o->second->GetNature().size()>natlmax) + natlmax = o->second->GetNature().size(); } // for ( i = mInput.begin(); i != mInput.end(); ++i ) @@ -180,10 +244,14 @@ namespace bbtk std::string type(i->second->GetHumanTypeName()); 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->GetHumanTypeName()); 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()<second->GetDescription()<GetName() + "::" + mTypeName; + return "::" + mTypeName; + } + //========================================================================= + //========================================================================= void BlackBoxDescriptor::InsertHtmlHelp ( std::ofstream& s, int detail, int level, const std::string& output_dir, bool relative_link ) { - bbtkDebugMessageInc("Kernel",9,"BlackBoxDescriptor::InsertHtmlHelp() ["< categories; + // Split the category string + std::string delimiters = ";,"; + Utilities::SplitString(GetCategory(), + delimiters,categories); + (s) << "

\n"; (s) << "\n"; (s) << "\n"; - (s) << "\n"; + (s) << "\n"; + (s) << "\n"; (s) << "
Description : " << descr << "
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 " << GetPackage()->GetName() << "
\n"; @@ -280,7 +372,7 @@ namespace bbtk std::string col(usercol); int iotype = 0; if (in->second->GetCreatorTypeInfo() == - typeid(UserBlackBoxDescriptor)) + typeid(AtomicBlackBoxDescriptor)) { col = ubbcol; iotype = 1; @@ -343,7 +435,7 @@ namespace bbtk std::string col(usercol); int iotype = 0; if (o->second->GetCreatorTypeInfo() == - typeid(UserBlackBoxDescriptor)) + typeid(AtomicBlackBoxDescriptor)) { col = ubbcol; iotype = 1;