X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkComplexBlackBox.cxx;h=be9fec2b348034fd5492eb11817b8b3ca8cf4eec;hb=6ea571ab3b7a539aaaca066db3941f5017920209;hp=2c09e31427908e8054c3fd63cd72eea8dfe8d438;hpb=a26195c366a89795288009cf7e20f11afa494970;p=bbtk.git diff --git a/kernel/src/bbtkComplexBlackBox.cxx b/kernel/src/bbtkComplexBlackBox.cxx index 2c09e31..be9fec2 100644 --- a/kernel/src/bbtkComplexBlackBox.cxx +++ b/kernel/src/bbtkComplexBlackBox.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkComplexBlackBox.cxx,v $ Language: C++ -Date: $Date: 2008/01/22 15:02:00 $ -Version: $Revision: 1.1 $ +Date: $Date: 2008/02/19 18:40:10 $ +Version: $Revision: 1.6 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -37,11 +37,11 @@ namespace bbtk : BlackBox(name), mDescriptor(desc) { - bbtkDebugMessageInc("Core",9, + bbtkDebugMessageInc("Kernel",9, "ComplexBlackBox::ComplexBlackBox(\"" <first<<"\""<first<<"\""<second->bbClone(i->second->bbGetName()); bbUnsafeAddBlackBox(B); - bbtkDebugDecTab("Core",9); + bbtkDebugDecTab("Kernel",9); } - bbtkDebugDecTab("Core",9); + bbtkDebugDecTab("Kernel",9); - bbtkDebugMessageInc("Core",9,"* Cloning Connections"<GetFullName()<<"\""<GetBlackBoxFrom()->bbGetName() ); @@ -87,12 +87,12 @@ namespace bbtk bbAddConnection(c); - bbtkDebugDecTab("Core",9); + bbtkDebugDecTab("Kernel",9); } - bbtkDebugDecTab("Core",9); + bbtkDebugDecTab("Kernel",9); bbAllocateConnectors(); - bbtkDebugDecTab("Core",9); + bbtkDebugDecTab("Kernel",9); } //======================================================================= @@ -100,37 +100,37 @@ namespace bbtk /// Destructor ComplexBlackBox::~ComplexBlackBox() { - bbtkDebugMessageInc("Core",9, + bbtkDebugMessageInc("Kernel",9, "ComplexBlackBox::~ComplexBlackBox() [" <GetFullName()<<"\""<first<<"\""<first<<"\""<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 [" // <bbDesallocateConnectors(); - bbtkDebugDecTab("Core",9); + bbtkDebugDecTab("Kernel",9); } //======================================================================= @@ -138,7 +138,7 @@ namespace bbtk /// Allocates the i/o connectors of the black box void ComplexBlackBox::bbAllocateConnectors() { - bbtkDebugMessageInc("Core",8, + bbtkDebugMessageInc("Kernel",8, "ComplexBlackBox::bbAllocateConnectors() [" <first<<"\""<first<<"\""<first<<"\""<first<<"\""<second->GetName()] = c; //new BlackBoxOutputConnector(); } - bbtkDebugDecTab("Core",8); + bbtkDebugDecTab("Kernel",8); } //========================================================================= @@ -191,7 +191,7 @@ namespace bbtk /// Desallocates the i/o connectors of the black box void ComplexBlackBox::bbDesallocateConnectors() { - bbtkDebugMessageInc("Core",8, + bbtkDebugMessageInc("Kernel",8, "ComplexBlackBox::DesallocateConnectors()" <bbGetName() <<"\") [" <bbSetParent(this); mBlackBoxMap[b->bbGetName()] = b; - bbtkDebugDecTab("Core",7); + bbtkDebugDecTab("Kernel",7); } //================================================================== @@ -482,7 +482,7 @@ namespace bbtk /// Adds the black box to the complex box (unsafe) void ComplexBlackBox::bbUnsafeAddBlackBox( BlackBox* b) { - bbtkDebugMessageInc("Core",7, + bbtkDebugMessageInc("Kernel",7, "ComplexBlackBox::UnsafeAddBlackBox(\""<bbGetName() <<"\") [" <bbSetParent(this); mBlackBoxMap[b->bbGetName()] = b; - bbtkDebugDecTab("Core",7); + bbtkDebugDecTab("Kernel",7); } //================================================================== @@ -498,13 +498,13 @@ namespace bbtk /// Removes the black box from the complex box void ComplexBlackBox::bbRemoveBlackBox( const std::string& name ) { - bbtkDebugMessageInc("Core",7, + bbtkDebugMessageInc("Kernel",7, "ComplexBlackBox::RemoveBlackBox(\""< BlackBox* ComplexBlackBox::bbGetBlackBox( const std::string& name ) { - bbtkDebugMessageInc("Core",9, + bbtkDebugMessageInc("Kernel",9, "ComplexBlackBox::GetBlackBox(\""<second; } //================================================================== @@ -547,7 +547,7 @@ namespace bbtk /// 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(\""<second; } @@ -568,7 +568,7 @@ namespace bbtk //================================================================== void ComplexBlackBox::bbPrintBlackBoxes() { - bbtkDebugMessageInc("Core",9, + bbtkDebugMessageInc("Kernel",9, "ComplexBlackBox::PrintBlackBoxes() [" <second->bbGetFullName()<second; - if (restname!="") - { - blackbox = blackbox->bbFindBlackBox(restname); - } + { + blackbox = NULL; + } + else + { + blackbox = i->second; + if (restname!="") + { + blackbox = blackbox->bbFindBlackBox(restname); + } } return blackbox; } @@ -647,11 +649,11 @@ namespace bbtk 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"); @@ -701,13 +703,13 @@ namespace bbtk 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) << "\n\n"; // End @@ -728,38 +730,40 @@ namespace bbtk 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() ,";"); @@ -949,7 +953,6 @@ namespace bbtk } // if second } // for } // if parentblackbox - } //=========================================================================