Program: bbtk
Module: $RCSfile: bbtkComplexBlackBox.cxx,v $
Language: C++
-Date: $Date: 2008/01/22 15:02:00 $
-Version: $Revision: 1.1 $
+Date: $Date: 2008/03/07 10:21:30 $
+Version: $Revision: 1.7 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
: BlackBox(name),
mDescriptor(desc)
{
- bbtkDebugMessageInc("Core",9,
+ bbtkDebugMessageInc("Kernel",9,
"ComplexBlackBox::ComplexBlackBox(\""
<<name<<"\")"<<std::endl);
bbAllocateConnectors();
- bbtkDebugDecTab("Core",9);
+ bbtkDebugDecTab("Kernel",9);
}
//=======================================================================
mDescriptor(from.mDescriptor),
mExecutionList(from.mExecutionList)
{
- bbtkDebugMessageInc("Core",9,
+ bbtkDebugMessageInc("Kernel",9,
"ComplexBlackBox::ComplexBlackBox(\""
<<from.bbGetName()<<"\",\""
<<name<<"\")"<<std::endl);
- bbtkDebugMessageInc("Core",9,"* Cloning Black Boxes"<<std::endl);
+ bbtkDebugMessageInc("Kernel",9,"* Cloning Black Boxes"<<std::endl);
BlackBoxMapType::const_iterator i;
for ( i = from.mBlackBoxMap.begin(); i != from.mBlackBoxMap.end(); ++i )
{
- bbtkDebugMessageInc("Core",9,"* Cloning \""<<i->first<<"\""<<std::endl);
+ bbtkDebugMessageInc("Kernel",9,"* Cloning \""<<i->first<<"\""<<std::endl);
BlackBox* B = i->second->bbClone(i->second->bbGetName());
bbUnsafeAddBlackBox(B);
- bbtkDebugDecTab("Core",9);
+ bbtkDebugDecTab("Kernel",9);
}
- bbtkDebugDecTab("Core",9);
+ bbtkDebugDecTab("Kernel",9);
- bbtkDebugMessageInc("Core",9,"* Cloning Connections"<<std::endl);
+ bbtkDebugMessageInc("Kernel",9,"* Cloning Connections"<<std::endl);
ConnectionListType::const_iterator j;
for ( j = from.mConnectionList.begin(); j != from.mConnectionList.end(); ++j )
{
- bbtkDebugMessageInc("Core",9,"* Cloning \""<<
+ bbtkDebugMessageInc("Kernel",9,"* Cloning \""<<
(*j)->GetFullName()<<"\""<<std::endl);
BlackBox* bbfrom = bbGetBlackBox( (*j)->GetBlackBoxFrom()->bbGetName() );
BlackBox* bbto = bbGetBlackBox( (*j)->GetBlackBoxTo()->bbGetName() );
- Connection* c = /*mDescriptor->GetFactory()->Create*/
+ Connection* c = mDescriptor->GetFactory()->
NewConnection( bbfrom,
(*j)->GetBlackBoxFromOutput(),
bbto,
bbAddConnection(c);
- bbtkDebugDecTab("Core",9);
+ bbtkDebugDecTab("Kernel",9);
}
- bbtkDebugDecTab("Core",9);
+ bbtkDebugDecTab("Kernel",9);
bbAllocateConnectors();
- bbtkDebugDecTab("Core",9);
+ bbtkDebugDecTab("Kernel",9);
}
//=======================================================================
/// Destructor
ComplexBlackBox::~ComplexBlackBox()
{
- bbtkDebugMessageInc("Core",9,
+ bbtkDebugMessageInc("Kernel",9,
"ComplexBlackBox::~ComplexBlackBox() ["
<<bbGetFullName()<<"]"<<std::endl);
- bbtkDebugMessageInc("Core",9,"* Delete Connections"<<std::endl);
+ bbtkDebugMessageInc("Kernel",9,"* Delete Connections"<<std::endl);
ConnectionListType::iterator j;
for ( j = mConnectionList.begin(); j != mConnectionList.end(); ++j )
{
- bbtkDebugMessageInc("Core",9,"* Delete \""<<
+ bbtkDebugMessageInc("Kernel",9,"* Delete \""<<
(*j)->GetFullName()<<"\""<<std::endl);
delete *j;
- bbtkDebugDecTab("Core",9);
+ bbtkDebugDecTab("Kernel",9);
}
- bbtkDebugDecTab("Core",9);
+ bbtkDebugDecTab("Kernel",9);
- bbtkDebugMessageInc("Core",9,"* Delete Black Boxes"<<std::endl);
+ bbtkDebugMessageInc("Kernel",9,"* Delete Black Boxes"<<std::endl);
BlackBoxMapType::iterator i;
for ( i = mBlackBoxMap.begin(); i != mBlackBoxMap.end(); ++i )
{
- bbtkDebugMessageInc("Core",9,"* Delete \""<<i->first<<"\""<<std::endl);
+ bbtkDebugMessageInc("Kernel",9,"* Delete \""<<i->first<<"\""<<std::endl);
i->second->bbDelete();
- bbtkDebugDecTab("Core",9);
+ bbtkDebugDecTab("Kernel",9);
}
- bbtkDebugDecTab("Core",9);
- // bbtkDebugMessage("Core",9,"EO ComplexBlackBox::~ComplexBlackBox ["
+ bbtkDebugDecTab("Kernel",9);
+ // bbtkDebugMessage("Kernel",9,"EO ComplexBlackBox::~ComplexBlackBox ["
// <<bbGetFullName()<<"]"<<std::endl);
this->bbDesallocateConnectors();
- bbtkDebugDecTab("Core",9);
+ bbtkDebugDecTab("Kernel",9);
}
//=======================================================================
/// Allocates the i/o connectors of the black box
void ComplexBlackBox::bbAllocateConnectors()
{
- bbtkDebugMessageInc("Core",8,
+ bbtkDebugMessageInc("Kernel",8,
"ComplexBlackBox::bbAllocateConnectors() ["
<<bbGetFullName()<<"]"
<<std::endl);
BlackBoxDescriptor::InputDescriptorMapType::const_iterator i;
for ( i = imap.begin(); i != imap.end(); ++i )
{
- bbtkDebugMessage("Core",8,"* Allocate \""<<i->first<<"\""<<std::endl);
+ bbtkDebugMessage("Kernel",8,"* Allocate \""<<i->first<<"\""<<std::endl);
// Redirect the connector to the internal box connector
// Cast the BBInputDescriptor into a ComplexBBInputDescriptor
ComplexBlackBoxInputDescriptor* d =
BlackBoxDescriptor::OutputDescriptorMapType::const_iterator o;
for ( o = omap.begin(); o != omap.end(); ++o )
{
- bbtkDebugMessage("Core",8,"* Allocate \""<<o->first<<"\""<<std::endl);
+ bbtkDebugMessage("Kernel",8,"* Allocate \""<<o->first<<"\""<<std::endl);
// Redirect the connector to the internal box connector
// Cast the BBOutputDescriptor into a ComplexBBOutputDescriptor
ComplexBlackBoxOutputDescriptor* d =
bbGetOutputConnectorMap()[o->second->GetName()] = c;
//new BlackBoxOutputConnector();
}
- bbtkDebugDecTab("Core",8);
+ bbtkDebugDecTab("Kernel",8);
}
//=========================================================================
/// Desallocates the i/o connectors of the black box
void ComplexBlackBox::bbDesallocateConnectors()
{
- bbtkDebugMessageInc("Core",8,
+ bbtkDebugMessageInc("Kernel",8,
"ComplexBlackBox::DesallocateConnectors()"
<<std::endl);
bbGetInputConnectorMap().clear();
bbGetOutputConnectorMap().clear();
- bbtkDebugDecTab("Core",8);
+ bbtkDebugDecTab("Kernel",8);
}
//=========================================================================
//=======================================================================
BlackBox* ComplexBlackBox::bbClone(const std::string& name)
{
- bbtkDebugMessageInc("Core",9,
+ bbtkDebugMessageInc("Kernel",9,
"ComplexBlackBox::bbClone(\""<<name<<"\") ["
<<bbGetFullName()<<"]"<<std::endl);
ComplexBlackBox* CBB = new ComplexBlackBox(*this,name);
- bbtkDebugDecTab("Core",9);
+ bbtkDebugDecTab("Kernel",9);
return CBB;
}
"ComplexBlackBox::bbExecute() ["
<<bbGetFullName()<<"]"<<std::endl);
- wx::BeginBusyCursor();
+ Wx::BeginBusyCursor();
if (mExecutionList.size() != 0)
{
}
}
- wx::EndBusyCursor();
+ Wx::EndBusyCursor();
bbtkDebugDecTab("Process",1);
//==================================================================
void ComplexBlackBox::bbAddToExecutionList( const std::string& name )
{
- bbtkDebugMessageInc("Core",9,
+ bbtkDebugMessageInc("Kernel",9,
"ComplexBlackBox::bbAddToExecutionList(\""
<<name<<"\") ["
<<bbGetFullName()<<"]"<<std::endl);
mExecutionList.push_back( name );
- bbtkDebugDecTab("Core",9);
+ bbtkDebugDecTab("Kernel",9);
}
//==================================================================
/// Adds the black box to the complex box
void ComplexBlackBox::bbAddBlackBox( BlackBox* b)
{
- bbtkDebugMessageInc("Core",7,
+ bbtkDebugMessageInc("Kernel",7,
"ComplexBlackBox::AddBlackBox(\""<<b->bbGetName()
<<"\") ["
<<bbGetFullName()<<"]"<<std::endl);
b->bbSetParent(this);
mBlackBoxMap[b->bbGetName()] = b;
- bbtkDebugDecTab("Core",7);
+ bbtkDebugDecTab("Kernel",7);
}
//==================================================================
/// Adds the black box to the complex box (unsafe)
void ComplexBlackBox::bbUnsafeAddBlackBox( BlackBox* b)
{
- bbtkDebugMessageInc("Core",7,
+ bbtkDebugMessageInc("Kernel",7,
"ComplexBlackBox::UnsafeAddBlackBox(\""<<b->bbGetName()
<<"\") ["
<<bbGetFullName()<<"]"<<std::endl);
b->bbSetParent(this);
mBlackBoxMap[b->bbGetName()] = b;
- bbtkDebugDecTab("Core",7);
+ bbtkDebugDecTab("Kernel",7);
}
//==================================================================
/// Removes the black box from the complex box
void ComplexBlackBox::bbRemoveBlackBox( const std::string& name )
{
- bbtkDebugMessageInc("Core",7,
+ bbtkDebugMessageInc("Kernel",7,
"ComplexBlackBox::RemoveBlackBox(\""<<name<<"\") ["
<<bbGetFullName()<<"]"<<std::endl);
bbtkError("ComplexBlackBox::RemoveBlackBox not implemented");
- bbtkDebugDecTab("Core",7);
+ bbtkDebugDecTab("Kernel",7);
}
//==================================================================
/// Adds the connection to the complex box
void ComplexBlackBox::bbAddConnection( Connection* c)
{
- bbtkDebugMessageInc("Core",7,
+ bbtkDebugMessageInc("Kernel",7,
"ComplexBlackBox::AddConnection(\""<<"..."<<"\") ["
<<bbGetFullName()<<"]"<<std::endl);
mConnectionList.push_back(c);
- bbtkDebugDecTab("Core",7);
+ bbtkDebugDecTab("Kernel",7);
}
//==================================================================
// void RemoveConnection( );
/// Returns the black box with name <name>
BlackBox* ComplexBlackBox::bbGetBlackBox( const std::string& name )
{
- bbtkDebugMessageInc("Core",9,
+ bbtkDebugMessageInc("Kernel",9,
"ComplexBlackBox::GetBlackBox(\""<<name<<"\") ["
<<bbGetFullName()<<"]"<<std::endl);
bbtkError("the black box \""<<name<<"\" does not exist");
}
- bbtkDebugDecTab("Core",9);
+ bbtkDebugDecTab("Kernel",9);
return i->second;
}
//==================================================================
/// if it does not exist but return a null pointer
BlackBox* ComplexBlackBox::bbUnsafeGetBlackBox( const std::string& name )
{
- bbtkDebugMessageInc("Core",9,
+ bbtkDebugMessageInc("Kernel",9,
"ComplexBlackBox::UnsafeGetBlackBox(\""<<name<<"\") ["
<<bbGetFullName()<<"]"
<<std::endl);
BlackBoxMapType::iterator i = mBlackBoxMap.find(name);
if ( i == mBlackBoxMap.end() )
{
- bbtkDebugDecTab("Core",9);
+ bbtkDebugDecTab("Kernel",9);
return 0;
}
- bbtkDebugDecTab("Core",9);
+ bbtkDebugDecTab("Kernel",9);
return i->second;
}
//==================================================================
void ComplexBlackBox::bbPrintBlackBoxes()
{
- bbtkDebugMessageInc("Core",9,
+ bbtkDebugMessageInc("Kernel",9,
"ComplexBlackBox::PrintBlackBoxes() ["
<<bbGetFullName()<<"]"
<<std::endl);
bbtkMessage("Help",1,i->second->bbGetFullName()<<std::endl);
}
- bbtkDebugDecTab("Core",9);
+ bbtkDebugDecTab("Kernel",9);
}
//==================================================================
restname = blackboxname.substr(lastPos+pos - lastPos+1, 999);
if (restname==subname)
- {
- restname="";
- }
+ {
+ restname="";
+ }
BlackBoxMapType::iterator i = mBlackBoxMap.find(subname);
if ( i == mBlackBoxMap.end() )
- {
- blackbox = NULL;
- } else {
- blackbox = i->second;
- if (restname!="")
- {
- blackbox = blackbox->bbFindBlackBox(restname);
- }
+ {
+ blackbox = NULL;
+ }
+ else
+ {
+ blackbox = i->second;
+ if (restname!="")
+ {
+ blackbox = blackbox->bbFindBlackBox(restname);
+ }
}
return blackbox;
}
std::string directory(output_dir);
if (output_dir.length() == 0)
- {
- // Don't pollute the file store with "doc_tmp" directories ...
- std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_doc_tmp();
- directory = default_doc_dir + "/" + "doc_tmp";
- }
+ {
+ // Don't pollute the file store with "temp_dir" directories ...
+ std::string default_temp_dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
+ directory = default_temp_dir + "/" + "temp_dir";
+ }
std::string simplefilename (this->bbGetTypeName()+"_"+this->bbGetName());
std::string simplefilename_png (simplefilename+".png");
char c;
ff2=fopen(filename_cmap.c_str(),"r");
while (!feof(ff2))
- {
- c=fgetc(ff2);
- if (c!=-1)
- {
- (s) << c;
- }
- }
+ {
+ c=fgetc(ff2);
+ if (c!=-1)
+ {
+ (s) << c;
+ }
+ }
(s) << "</map>\n\n";
// End
Package *package = this->bbGetDescriptor()->GetPackage();
if (package!=NULL)
- {
- if (relative_link)
- tmp1 = this->bbGetDescriptor()->GetPackage()->GetDocRelativeURL();
- else
- tmp1 = this->bbGetDescriptor()->GetPackage()->GetDocURL();
- }
+ {
+ if (relative_link)
+ tmp1 = this->bbGetDescriptor()->GetPackage()->GetDocRelativeURL();
+ else
+ tmp1 = this->bbGetDescriptor()->GetPackage()->GetDocURL();
+ }
else
- {
- tmp1 = "Caspitas";
- }
+ {
+ tmp1 = "Caspitas";
+ }
std::string tmp2=bbGetTypeName();
std::string url(tmp1 + "#" + tmp2 );
fprintf( ff , "subgraph cluster_%s_%p {\n",bbGetName().c_str(),this);
if (!( (bbGetTypeName()=="workspace") && (bbGetName()=="workspacePrototype")) )
- {
- fprintf( ff , " URL = \"%s\" %s",url.c_str(),";");
- }
+ {
+ fprintf( ff , " URL = \"%s\" %s",url.c_str(),";");
+ }
std::string boxname="["+bbGetTypeName()+"]";
if (this!=parentblackbox)
- {
- if (detail==0)
- {
- boxname=bbGetName();
- } else {
- boxname = bbGetName();
- boxname = boxname + " [" +this->bbGetDescriptor()->GetPackage()->GetName()+"::"+ bbGetTypeName() + "]";
- }
+ {
+ if (detail==0)
+ {
+ boxname=bbGetName();
+ }
+ else
+ {
+ boxname = bbGetName();
+ boxname = boxname + " [" +this->bbGetDescriptor()->GetPackage()->GetName()+"::"+ bbGetTypeName() + "]";
+ }
- }
+ }
fprintf( ff , " label = \"%s\"%s\n", boxname.c_str() ,";");
} // if second
} // for
} // if parentblackbox
-
}
//=========================================================================