Program: bbtk
Module: $RCSfile: bbtkComplexBlackBoxDescriptor.cxx,v $
Language: C++
- Date: $Date: 2008/02/07 11:06:37 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2008/03/07 10:21:30 $
+ Version: $Revision: 1.12 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//=======================================================================
/// Default ctor
ComplexBlackBoxDescriptor::ComplexBlackBoxDescriptor(const std::string& name)
- : BlackBoxDescriptor()
+ : BlackBoxDescriptor(),
+ mFactory(0)
{
bbtkDebugMessageInc("Kernel",9,"ComplexBlackBoxDescriptor::ComplexBlackBoxDescriptor(\""<<name<<"\")"<<std::endl);
SetTypeName(name);
<<type<<"\",\""<<name<<"\") ["
<<GetTypeName()<<"]"<<std::endl);
+ //
+ if (mFactory == 0)
+ {
+ bbtkError("ComplexBlackBoxDescriptor::Add : no factory set");
+ }
// Verify that a box with the same name does not exist already
if ( mPrototype->bbUnsafeGetBlackBox( name ) )
bbtkError("a black box \""<<name<<"\" already exists");
}
// ok : create new one
- mPrototype->bbAddBlackBox ( /*mFactory->Create*/ NewBlackBox(type,name) );
+ mPrototype->bbAddBlackBox ( mFactory->NewBlackBox(type,name) );
bbtkDebugDecTab("Kernel",5);
}
<<to<<"\",\""<<input
<<"\") ["
<<GetTypeName()<<"]"<<std::endl);
+ //
+ if (mFactory == 0)
+ {
+ bbtkError("ComplexBlackBoxDescriptor::Connect : no factory set");
+ }
+
+
// Verify that a box with the same name does not exist already
BlackBox* bbfrom = mPrototype->bbGetBlackBox( from );
if ( !bbfrom )
bbtkError("the black box \""<<to<<"\" does not exist");
}
- Connection* c = /*mFactory->*/ NewConnection( bbfrom, output, bbto, input );
+ Connection* c = mFactory->NewConnection( bbfrom, output, bbto, input );
mPrototype->bbAddConnection(c);
std::string author = GetAuthor();
Utilities::html_format(author);
- std::string category = GetCategory();
- Utilities::html_format(category);
+ std::vector<std::string> categories;
+ // Split the category string
+ std::string delimiters = ";,";
+ Utilities::SplitString(GetCategory(),
+ delimiters,categories);
+
(s) << "<p><TABLE cellspacing=0 cellpadding=3>\n";
(s) << "<TR><TD style='vertical-align: top;'><b> Description </b></TD><TD style='vertical-align: top;'> : </TD><TD style='vertical-align: top;'> "
(s) << "<TR><TD style='vertical-align: top;'><b> Author(s) </b></TD><TD style='vertical-align: top;'> : </TD><TD style='vertical-align: top;'> "
<< author << "</TD></TR>\n";
- (s) << "<TR><TD style='vertical-align: top;'><b> Category(s) </b></TD><TD style='vertical-align: top;'> : </TD><TD style='vertical-align: top;'> "
- << category << "</TD></TR>\n";
-
+ (s) << "<TR><TD style='vertical-align: top;'><b> Category(s) </b></TD><TD style='vertical-align: top;'> : </TD><TD style='vertical-align: top;'> ";
+ std::vector<std::string>::iterator ci;
+ for (ci=categories.begin(); ci!=categories.end(); ++ci)
+ {
+ s << "<a href=\"../index-category.html#"<< *ci <<"\">" << *ci
+ << "</a> \n";
+ }
+ s << "</TD></TR>\n";
std::string inc = GetScriptFileName();
if (inc.size()>0)
{
- (s) << "<TR><TD style='vertical-align: top;'><b> To use it </b></TD><TD style='vertical-align: top;'> : </TD><TD style='vertical-align: top;'> include "
- << inc << "</TD></TR>\n";
+ s << "<TR><TD style='vertical-align: top;'><b> To use it </b></TD><TD style='vertical-align: top;'> : </TD><TD style='vertical-align: top;'> include ";
+ s << inc << " <a href=\"../../../bbs/"<<inc<<"\">[source]</a>";
+ s << "</TD></TR>\n";
}
if (B.size())
{
- (s) << "<TR><TD style='vertical-align: top;'><b> Dependencies </b></TD><TD style='vertical-align: top;'> : </TD><TD style='vertical-align: top;'> ";
+ (s) << "<TR><TD style='vertical-align: top;'><b> Uses </b></TD><TD style='vertical-align: top;'> : </TD><TD style='vertical-align: top;'> ";
std::set<BlackBoxDescriptor*> pdeps;
ComplexBlackBox::BlackBoxMapType::const_iterator b;