X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkComplexBlackBoxDescriptor.cxx;h=b79fed3e10f1a81d3f5456a91313da7bd09651d2;hb=5d1ed845326cc292279254b1e8667cdf3c4311fc;hp=de6d2b70922fe06ff02e89c24ae5c258c1950ff8;hpb=98e18224b83c6955a804d79d4e7083626ea8afcd;p=bbtk.git diff --git a/kernel/src/bbtkComplexBlackBoxDescriptor.cxx b/kernel/src/bbtkComplexBlackBoxDescriptor.cxx index de6d2b7..b79fed3 100644 --- a/kernel/src/bbtkComplexBlackBoxDescriptor.cxx +++ b/kernel/src/bbtkComplexBlackBoxDescriptor.cxx @@ -1,32 +1,39 @@ -/*========================================================================= +/* + # --------------------------------------------------------------------- + # + # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image + # pour la SantÈ) + # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton + # Previous Authors : Laurent Guigues, Jean-Pierre Roux + # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil + # + # This software is governed by the CeCILL-B license under French law and + # abiding by the rules of distribution of free software. You can use, + # modify and/ or redistribute the software under the terms of the CeCILL-B + # license as circulated by CEA, CNRS and INRIA at the following URL + # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html + # or in the file LICENSE.txt. + # + # As a counterpart to the access to the source code and rights to copy, + # modify and redistribute granted by the license, users are provided only + # with a limited warranty and the software's author, the holder of the + # economic rights, and the successive licensors have only limited + # liability. + # + # The fact that you are presently reading this means that you have had + # knowledge of the CeCILL-B license and that you accept its terms. + # ------------------------------------------------------------------------ */ + + +/*========================================================================= Program: bbtk Module: $RCSfile: bbtkComplexBlackBoxDescriptor.cxx,v $ Language: C++ - Date: $Date: 2009/03/30 15:22:51 $ - Version: $Revision: 1.19 $ + Date: $Date: 2012/11/16 08:49:01 $ + Version: $Revision: 1.23 $ =========================================================================*/ -/* --------------------------------------------------------------------- - -* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) -* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux -* -* This software is governed by the CeCILL-B license under French law and -* abiding by the rules of distribution of free software. You can use, -* modify and/ or redistribute the software under the terms of the CeCILL-B -* license as circulated by CEA, CNRS and INRIA at the following URL -* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -* or in the file LICENSE.txt. -* -* As a counterpart to the access to the source code and rights to copy, -* modify and redistribute granted by the license, users are provided only -* with a limited warranty and the software's author, the holder of the -* economic rights, and the successive licensors have only limited -* liability. -* -* The fact that you are presently reading this means that you have had -* knowledge of the CeCILL-B license and that you accept its terms. -* ------------------------------------------------------------------------ */ + /** @@ -39,6 +46,11 @@ #include "bbtkMessageManager.h" #include "bbtkUtilities.h" +#define bbtkDMessage(key,level,mess) \ + bbtkMessage(key,level,"["< ComplexBlackBoxDescriptor::ComplexBlackBoxDescriptor(\""< ComplexBlackBoxDescriptor(\""<SetAsPrototype(); - bbtkDebugMessage("object",2,"<== ComplexBlackBoxDescriptor::ComplexBlackBoxDescriptor(\""< ComplexBlackBoxDescriptor::~ComplexBlackBoxDescriptor(\""<Delete(); + bbtkDDebugMessage("object",2,"==> ~ComplexBlackBoxDescriptor()"<bbClone(name); - bbtkDebugDecTab("Kernel",5); + } //======================================================================= @@ -120,10 +132,10 @@ namespace bbtk const std::string& name ) { - bbtkDebugMessageInc("Kernel",5, + bbtkDDebugMessage("kernel",5, "ComplexBlackBoxDescriptor::Add(\"" - <bbAddBlackBox ( GetFactory()->NewBlackBox(type,name) ); - bbtkDebugDecTab("Kernel",5); + } //======================================================================= @@ -157,10 +169,10 @@ namespace bbtk /// Adds a black box to the execution list void ComplexBlackBoxDescriptor::AddToExecutionList ( const std::string& box) { - bbtkDebugMessageInc("Kernel",5, - "ComplexBlackBoxDescriptor::AddToExecutionList(\"" - <bbUnsafeGetBlackBox( box ); if ( !b ) @@ -170,7 +182,7 @@ namespace bbtk // ok mPrototype->bbAddToExecutionList ( box ); - bbtkDebugDecTab("Kernel",5); + } @@ -182,12 +194,12 @@ namespace bbtk const std::string& input ) { - bbtkDebugMessageInc("Kernel",5, + bbtkDDebugMessage("kernel",5, "ComplexBlackBoxDescriptor::Connect(\"" <bbAddConnection(c); - bbtkDebugDecTab("Kernel",5); + } //======================================================================= @@ -224,12 +236,12 @@ namespace bbtk const std::string& input, const std::string& help) { - bbtkDebugMessageInc("Kernel",5, + bbtkDDebugMessage("kernel",5, "ComplexBlackBoxDescriptor::DefineInput(\"" <bbGetBlackBox( box ); if ( !bb ) @@ -255,7 +267,7 @@ namespace bbtk d->GetTypeInfo())); - bbtkDebugDecTab("Kernel",5); + } //======================================================================= @@ -266,12 +278,12 @@ namespace bbtk const std::string& output, const std::string& help) { - bbtkDebugMessageInc("Kernel",5, + bbtkDDebugMessage("kernel",5, "ComplexBlackBoxDescriptor::DefineOutput(\"" <bbGetBlackBox( box ); if ( !bb ) @@ -297,7 +309,7 @@ namespace bbtk d->GetTypeInfo())); - bbtkDebugDecTab("Kernel",5); + } //======================================================================= @@ -327,9 +339,9 @@ namespace bbtk int detail, int level, const std::string& output_dir, bool relative_link) { - bbtkDebugMessageInc("Kernel",9, - "ComplexBlackBoxDescriptor::InsertHtmlHelp() [" - <GetPackage(); std::string name = b->second->bbGetTypeName(); - + std::string url; if (relative_link) url = p->GetDocRelativeURL(); @@ -452,9 +464,15 @@ namespace bbtk std::string descr(in->second->GetDescription()); //Utilities::html_format(descr); +/*EED 10/11/2009 (s) << "
 "<"
 	  << "
 "<"
 	  << ""<\n";
+*/
+
+	(s) << "
 "<"
+	  << "
 "<"
+	  << ""<\n";
 	
       }
     //	(s) << "\n";
@@ -485,17 +503,22 @@ namespace bbtk
 	std::string descr(o->second->GetDescription());
 	//Utilities::html_format(descr);
 	
+/*EED 10/11/2009
 	(s) << "
 "<"
 	  << "
 "<"
 	  << ""<\n";
-	
+*/	
+	(s) << "
 "<"
+	  << "
 "<"
+	  << ""<\n";
+
       }
     (s) << "\n";
 
     //------------
     // End
 
-    bbtkDebugDecTab("Kernel",9);
+
    }
   //=========================================================================
  
@@ -503,16 +526,16 @@ namespace bbtk
   //=======================================================================
   void ComplexBlackBoxDescriptor::GetHelp(bool full) const
   {
-    if (full) bbtkMessage("Help",1,"Complex Black Box <"<<
+    if (full) bbtkMessage("help",1,"Complex Black Box <"<<
 			  GetPackage()->GetName()<<"::"
 			  <"<second->GetNature());
 	   nature += "]";
 	   nature.append(1+natlmax-nature.size(),' ');
-	   bbtkMessage("Help",1,
+	   bbtkMessage("help",1,
 		       "    '"<second->GetName());
@@ -575,7 +598,7 @@ namespace bbtk
 	     std::string nature(o->second->GetNature());
 	     nature += "]";
 	     nature.append(1+natlmax-nature.size(),' ');
-	     bbtkMessage("Help",1,
+	     bbtkMessage("help",1,
 		       "    '"<bbGetBlackBoxMap();
 	
 	   if (B.size()) 
-	     bbtkMessage("Help",1," * Boxes : "<second->bbGetName()<<
+	     bbtkMessage("help",1,"    '"<second->bbGetName()<<
 			 "' <"
 			 << b->second->bbGetDescriptor()->GetPackage()->GetName() 
 			 <<"::"
@@ -643,5 +666,60 @@ size_t  ComplexBlackBoxDescriptor::GetObjectInternalSize() const
     return s;
   }
   //==========================================================================
+void ComplexBlackBoxDescriptor::GetBoxesInside (NodeTreeC& tree, int cont) 
+	{
+		std::cout<<"getBoxesInside recursivo "<bbGetBlackBoxMap();
+
+		std::cout<<"----B size "<< B.size() << std::endl;
+		std::cout<<"----antes if "< pdeps;
+	   ComplexBlackBox::BlackBoxMapType::const_iterator b;
+			std::cout<<"----antes for "<second->bbGetDescriptor();
+				//std::cout<<"nombre objeto d "<< d->GetObjectName() <GetPackage();
+	      std::string nameBox = b->second->bbGetTypeName();
+				std::string packageBox = p->GetName();
+				tree.insertChild(nameBox);
+				std::cout<<"----2~ "<GetBoxesInside (tree.childs[k], cont);
+				std::cout<<"----3~ "<