/*========================================================================= Program: bbtk Module: $RCSfile: bbtkBlackBoxDescriptor.cxx,v $ Language: C++ Date: $Date: 2008/01/22 15:02:00 $ Version: $Revision: 1.1.1.1 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ /** * \file * \brief Class bbtk::BlackBoxDescriptor : (abstract) describes a BlackBox (name, description, author) and is able to create an instance of it. */ #include "bbtkBlackBoxDescriptor.h" #include "bbtkMessageManager.h" #include "bbtkPackage.h" #include "bbtkUtilities.h" namespace bbtk { //========================================================================= /// Default ctor BlackBoxDescriptor::BlackBoxDescriptor() : mTypeName("Unknown"), mDescription(""), mAuthor(""), mCategory(STANDARD), mPackage(NULL) { bbtkDebugMessage("Core",9, "BlackBoxDescriptor::BlackBoxDescriptor()"<second; OutputDescriptorMapType::iterator o; for (o=mOutput.begin(); o!=mOutput.end(); ++o) delete o->second; bbtkDebugDecTab("Core",9); } //========================================================================= //========================================================================= /// Adds the string to the BlackBox's description void BlackBoxDescriptor::AddToDescription( const std::string& s, bool clear) { bbtkDebugMessage("Core",9,"BlackBoxDescriptor::AddToDescription(\""<second; } //========================================================================= //========================================================================= const BlackBoxDescriptor::OutputDescriptor* BlackBoxDescriptor::GetOutputDescriptor(const std::string & name) const { bbtkDebugMessageInc("Core",9,"BlackBoxDescriptor::GetOutputDescriptor('" <second; } //========================================================================= //========================================================================= void BlackBoxDescriptor::GetHelp(bool full) const { bbtkDebugMessageInc("Core",9,"BlackBoxDescriptor::GetHelp() ["<GetName()<<"::"<"<"<second->GetName().size()>namelmax) namelmax = i->second->GetName().size(); if (i->second->GetHumanTypeName().size()>typelmax) typelmax = i->second->GetHumanTypeName().size(); } OutputDescriptorMapType::const_iterator o; for ( o = mOutput.begin(); o != mOutput.end(); ++o ) { if (o->second->GetName().size()>namelmax) namelmax = o->second->GetName().size(); if (o->second->GetHumanTypeName().size()>typelmax) typelmax = o->second->GetHumanTypeName().size(); } // for ( i = mInput.begin(); i != mInput.end(); ++i ) { std::string name(i->second->GetName()); name += "'"; name.append(1+namelmax-name.size(),' '); std::string type(i->second->GetHumanTypeName()); type += ">"; type.append(1+typelmax-type.size(),' '); bbtkMessage("Help",1, " '"<second->GetDescription()<second->GetName()); name += "'"; name.append(1+namelmax-name.size(),' '); std::string type(o->second->GetHumanTypeName()); type += ">"; type.append(1+typelmax-type.size(),' '); bbtkMessage("Help",1, " '"<second->GetDescription()<
\n"; (s) << "\n"; (s) << //"Top:  "Top\n"; // (s) << "Previous: (dir), // (s) << "Up: (dir) (s) << "

"<\n"; std::string descr = GetDescription(); //Utilities::html_format(descr); std::string author = GetAuthor(); Utilities::html_format(author); (s) << "

\n"; (s) << "\n"; (s) << "\n"; (s) << "
Description : " << descr << "
Author(s) : " << author << "
\n"; //------------- // Graph //i->second->InsertHTMLGraph( &s , detail,level,dir); //------------- // Inputs std::string col("#CCCCFF"); // (s) << "

Inputs

\n"; (s) << "

\n"; (s) << "\n"; const BlackBoxDescriptor::InputDescriptorMapType& imap = GetInputDescriptorMap(); InputDescriptorMapType::const_iterator in; for ( in = imap.begin(); in != imap.end(); ++in ) { std::string name(in->second->GetName()); Utilities::html_format(name); std::string type("<"); type += in->second->GetTypeName(); type += ">"; Utilities::html_format(type); std::string descr(in->second->GetDescription()); //Utilities::html_format(descr); (s) << "" << "" << "\n"; } // (s) << "
Inputs
 "<
 "<
"<
\n"; //------------- // Outputs // (s) << "

Outputs

\n"; // (s) << "\n"; (s) << "\n"; const BlackBoxDescriptor::OutputDescriptorMapType& omap = GetOutputDescriptorMap(); BlackBoxDescriptor::OutputDescriptorMapType::const_iterator o; for ( o = omap.begin(); o != omap.end(); ++o ) { std::string name(o->second->GetName()); Utilities::html_format(name); std::string type("<"); type += o->second->GetTypeName(); type += ">"; Utilities::html_format(type); std::string descr(o->second->GetDescription()); //Utilities::html_format(descr); (s) << "" << "" << "\n"; } (s) << "
Outputs
 "<
 "<
"<
\n"; //------------ // End bbtkDebugDecTab("Core",9); } //========================================================================= }