]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkFactory.cxx
*** empty log message ***
[bbtk.git] / kernel / src / bbtkFactory.cxx
index bd057e349e8aeaa24c19f58d148fe078074bd8b7..37563de8e3523386c3d7076837e0d32c0bf15a2c 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkFactory.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/05/28 14:22:10 $
-  Version:   $Revision: 1.44 $
+  Date:      $Date: 2009/06/08 14:50:03 $
+  Version:   $Revision: 1.45 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -390,8 +390,7 @@ namespace bbtk
 
 
   //===================================================================  
-  /// Displays the list of packages loaded
-  void Factory::PrintPackages(bool details, bool adaptors) const
+  void Factory::PrintHelpListPackages(bool details, bool adaptors) const
   {
     bbtkDebugMessageInc("kernel",9,"Factory::PrintPackages"<<std::endl);
 
@@ -400,7 +399,7 @@ namespace bbtk
     {
       bbtkMessage("help",1, i->first << std::endl);
       if (details) {
-         i->second->PrintBlackBoxes(false,adaptors);
+         i->second->PrintHelpListDescriptors(false,adaptors);
       }
     }
 
@@ -410,9 +409,10 @@ namespace bbtk
 
   //===================================================================  
   /// Displays help on a package
-  void Factory::HelpPackage(const std::string& name, bool adaptors) const
+  void Factory::PrintHelpPackage(const std::string& name, bool adaptors) const
   {
-    bbtkDebugMessageInc("kernel",9,"Factory::HelpPackage(\""<<name<<"\")"
+    bbtkDebugMessageInc("kernel",9,"Factory::PrintHelpPackage(\""
+                       <<name<<"\")"
                         <<std::endl);
 
     PackageMapType::const_iterator i = mPackageMap.find(name);
@@ -432,10 +432,10 @@ namespace bbtk
       bbtkMessageCont("help",1,std::endl);
       bbtkIncTab("help",1);
       bbtkMessage("help",1,i->second->GetDescription()<<std::endl);
-      if (i->second->GetNumberOfBlackBoxes()>0) 
+      if (i->second->GetNumberOfDescriptors()>0) 
         {
           bbtkMessage("help",1, "Black boxes : "<<std::endl);
-          i->second->PrintBlackBoxes(true,adaptors);
+          i->second->PrintHelpListDescriptors(true,adaptors);
         }
       else 
         {
@@ -456,20 +456,21 @@ namespace bbtk
   //===================================================================
   /// Prints help on the black box of type <name>
   /// Returns the package to which it belongs
-  void Factory::HelpBlackBox(const std::string& name, 
+  void Factory::PrintHelpDescriptor(const std::string& name, 
                             std::string& package,
                             bool full) const
   {
-    bbtkDebugMessageInc("kernel",9,"Factory::HelpBlackBox(\""<<name<<"\")"
+    bbtkDebugMessageInc("kernel",9,"Factory::PrintHelpDescriptor(\""
+                       <<name<<"\")"
                         <<std::endl);
 
     bool found = false;
     PackageMapType::const_iterator i;
     for (i = mPackageMap.begin(); i!=mPackageMap.end(); ++i )
       {
-      if (i->second->ContainsBlackBox(name)) 
+      if (i->second->ContainsDescriptor(name)) 
         {
-          i->second->HelpBlackBox(name,full);
+          i->second->PrintHelpDescriptor(name,full);
              package = i->second->GetName();
           found = true;
         }
@@ -784,14 +785,14 @@ namespace bbtk
   
 
   //===================================================================
-  void Factory::CheckPackages() const
+  void Factory::Check() const
   {
     bbtkMessage("debug",1,"****** Checking Factory "<<(void*)this
                 <<std::endl);
     PackageMapType::const_iterator i;
     for (i = mPackageMap.begin(); i!=mPackageMap.end(); ++i )
       {
-       i->second->CheckBoxes();
+       i->second->Check();
       }
     bbtkMessage("debug",1,"****** Checking Factory "<<(void*)this
                <<" ... OK"<<std::endl);
@@ -832,41 +833,41 @@ namespace bbtk
    PackageMapType::const_iterator i;
    for (i = mPackageMap.begin(); i!=mPackageMap.end(); ++i )
    {
-      if (i->second->ContainsBlackBox(name)) 
-      {
+     if (i->second->ContainsDescriptor(name)) 
+       {
          std::string separator = ConfigurationFile::GetInstance().Get_file_separator ();
-
-            // Don't pollute the file store with  "temp_dir" directories ...    
+        
+        // Don't pollute the file store with  "temp_dir" directories ...    
          std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
          std::string directory = "\"" + default_doc_dir + separator + "temp_dir"  +separator + "\"";
          std::string filename2 =  default_doc_dir + separator + "temp_dir" + separator + "tmp.html"; 
-
+        
 #if defined(_WIN32)  
-        std::string command("start \"Titre\" /D ");
+        std::string command("start \"Titre\" /D ");
 #else 
-        std::string command("gnome-open ");
+        std::string command("gnome-open ");
 #endif
-        command=command + directory +" tmp.html";
-        FILE *ff;
-        ff=fopen(filename2.c_str(),"w");
-
-        fprintf(ff,"<html><head><title>TMP</title> <script type=\"text/javascript\"> <!--\n");
-        fprintf(ff,"  window.location=\"%s#%s\";\n" , i->second->GetDocURL().c_str(),name.c_str() );
-        fprintf(ff,"//--></script></head><body></body></html>\n");
-
-
-        //fprintf(ff, "<a  href=\"%s#%s\">Link</a>\n", i->second->GetDocURL().c_str(),name.c_str() );
-        fclose(ff);
-        system( command.c_str() );      
-        found = true;
-     }
+        command=command + directory +" tmp.html";
+        FILE *ff;
+        ff=fopen(filename2.c_str(),"w");
+        
+        fprintf(ff,"<html><head><title>TMP</title> <script type=\"text/javascript\"> <!--\n");
+        fprintf(ff,"  window.location=\"%s#%s\";\n" , i->second->GetDocURL().c_str(),name.c_str() );
+        fprintf(ff,"//--></script></head><body></body></html>\n");
+        
+        
+        //fprintf(ff, "<a  href=\"%s#%s\">Link</a>\n", i->second->GetDocURL().c_str(),name.c_str() );
+        fclose(ff);
+        system( command.c_str() );      
+        found = true;
+       }
    }
-    
+   
    bbtkDebugDecTab("kernel",9);
    if (!found) 
    {
-      bbtkError("No package of the factory contains any black box <"
-                <<name<<">");
+     bbtkError("No package of the factory contains any black box <"
+              <<name<<">");
    }
  }
     
@@ -890,9 +891,9 @@ namespace bbtk
       {
        Package::Pointer pack = i->second;
        if (pack->GetName()=="user") continue;
-       Package::BlackBoxMapType::const_iterator j;
-       for (j = pack->GetBlackBoxMap().begin(); 
-            j!= pack->GetBlackBoxMap().end(); 
+       Package::DescriptorMapType::const_iterator j;
+       for (j = pack->GetDescriptorMap().begin(); 
+            j!= pack->GetDescriptorMap().end(); 
             ++j)
          {