]> Creatis software - bbtk.git/commitdiff
modifs
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Thu, 14 Feb 2008 17:40:09 +0000 (17:40 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Thu, 14 Feb 2008 17:40:09 +0000 (17:40 +0000)
kernel/src/bbtkTranscriptor.cxx

index 48fffe21e9617add10a461884607ef4f0406b558..5eee475d6c77c840f87b9c63e1b83255c3afd77d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkTranscriptor.cxx,v $ $
   Language:  C++
-  Date:      $Date: 2008/02/14 13:53:01 $
-  Version:   $Revision: 1.3 $
+  Date:      $Date: 2008/02/14 17:40:09 $
+  Version:   $Revision: 1.4 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -93,7 +93,7 @@ namespace bbtk
   void Transcriptor::Reset()
   {
 
-     m_Fp << "e->Reset( );" << std::endl;
+     m_Fp << "  e->Reset( );" << std::endl;
   /*
     bbtkDebugMessageInc("Kernel",9,"Transcriptor::Reset()" <<std::endl);
 
@@ -149,16 +149,16 @@ namespace bbtk
      Package* p;
      try 
       {
-       p = GetGlobalFactory()->GetPackage(name);
+         p = GetGlobalFactory()->GetPackage(name);
       }
     catch (Exception e)
       {
-       p = new Package(name,
-                       "",
-                       "",
-                       "",
-                       BBTK_STRINGIFY_SYMBOL(BBTK_VERSION));
-       InsertPackage(p);
+         p = new Package(name,
+         "",
+         "",
+         "",
+         BBTK_STRINGIFY_SYMBOL(BBTK_VERSION));
+         InsertPackage(p);
       }
      mOpenPackage.push_back(p);
  */
@@ -171,13 +171,13 @@ namespace bbtk
   }
 
   void Transcriptor::Define (const std::string &name,
-                        const std::string &pack,
-                        const std::string &scriptfilename)
+                             const std::string &pack,
+                             const std::string &scriptfilename)
   {
      m_Fp << "// on Define, Define() called here" << std::endl;   
   /*
     bbtkDebugMessageInc("Kernel",9,"Executer::Define(\""<<name<<
-                       ","<<pack<<"\")" 
+                        ","<<pack<<"\")" 
                         <<std::endl);
 
     ComplexBlackBoxDescriptor* b = new ComplexBlackBoxDescriptor(name);
@@ -212,7 +212,7 @@ namespace bbtk
     {
       try
       {
-           p = GetGlobalFactory()->GetPackage(pname);
+         p = GetGlobalFactory()->GetPackage(pname);
       }
       catch (Exception e)
       {
@@ -226,7 +226,7 @@ namespace bbtk
     }
     else
     {
-          p = mOpenPackage.back();
+       p = mOpenPackage.back();
     }
     p->RegisterBlackBox(Current());
 
@@ -240,7 +240,7 @@ namespace bbtk
                               const std::string& nodeName)
   {
     // Current()->Add(nodeType,nodeName);\"
-     m_Fp << "e->Add(\"" << nodeType << "\", \"" <<  nodeName << "\");" << std::endl;
+     m_Fp << "  e->Add(\"" << nodeType << "\", \"" <<  nodeName << "\");" << std::endl;
   }
 
 
@@ -249,7 +249,7 @@ namespace bbtk
   {
     /// \todo Remove
     // Current()->RemoveBlackBox(nodeName);
-    //  m_Fp << "e->Remove(" <<  nodeName << ");" << std::endl;
+    //  m_Fp << "  e->Remove(" <<  nodeName << ");" << std::endl;
   }
   */ 
 
@@ -257,12 +257,12 @@ namespace bbtk
  *  
  */
   void Transcriptor::Connect (const std::string &nodeFrom, 
-                          const std::string &outputLabel, 
-                          const std::string &nodeTo, 
-                          const std::string &inputLabel)
+                              const std::string &outputLabel, 
+                              const std::string &nodeTo, 
+                              const std::string &inputLabel)
   {
     //Current()->Connect(nodeFrom, outputLabel, nodeTo, inputLabel);
-     m_Fp << "e->Connect("<< nodeFrom << "\", \"" <<  outputLabel << "\", \""
+     m_Fp << "  e->Connect(\""<< nodeFrom << "\", \"" <<  outputLabel << "\", \""
           << nodeTo  << "\", \"" << inputLabel<< "\");" << std::endl;
   }
 
@@ -277,32 +277,32 @@ namespace bbtk
         if (!mNoExecMode) 
         {
            //Current()->GetPrototype()->bbGetBlackBox(nodeName)->bbExecute(true);
-           m_Fp << "e->GetPrototype()->bbGetBlackBox(\"" << nodeName << "\", true );" << std::endl;
+           m_Fp << "  e->GetPrototype()->bbGetBlackBox(\"" << nodeName << "\", true );" << std::endl;
         }
      }
      else 
      {
         //Current()->AddToExecutionList(nodeName) ;
-       m_Fp << "e->AddToExecutionList(\"" << nodeName << "\");" << std::endl;
+        m_Fp << "  e->AddToExecutionList(\"" << nodeName << "\");" << std::endl;
      }
   }
-    
+
 /**
- *  
+ *
  */
   void Transcriptor::DefineInput ( const std::string &name,
-                               const std::string &box,
-                               const std::string &input,
-                               const std::string& help)
+                                   const std::string &box,
+                                   const std::string &input,
+                                   const std::string& help)
   {
     // If the input is defined in the Root box
-    if (Current()==mRoot) 
-    {  
+    if (Current()==mRoot)
+    {
        m_Fp << "// ==> Some extra work to do when Current()==mRoot" << std::endl;
 
     }
-       m_Fp << "e->DefineInput(\""<< name << "\", " <<  box << ", "
-            << input << ", \"" << help << "\");" << std::endl;
+    m_Fp << "  e->DefineInput(\""<< name << "\", " <<  box << ", "
+         << input << ", \"" << help << "\");" << std::endl;
 
 
   /*
@@ -359,12 +359,12 @@ namespace bbtk
  *  
  */ 
    void Transcriptor::DefineOutput ( const std::string &name,
-                                 const std::string &box,
-                                 const std::string &output,
-                                 const std::string& help)
+                                     const std::string &box,
+                                     const std::string &output,
+                                     const std::string& help)
   {
    // Current()->DefineOutput(name,box,output,help);
-       m_Fp << "e->DefineOutput(\""<< name << "\", \"" <<  box << "\", \""
+       m_Fp << "  e->DefineOutput(\""<< name << "\", \"" <<  box << "\", \""
             << output << "\", \"" << help << "\");" << std::endl;
   }
 
@@ -372,11 +372,13 @@ namespace bbtk
    *  
    */ 
   void Transcriptor::Set (const std::string &box,
-                      const std::string &input,
-                      const std::string &value)
+                          const std::string &input,
+                          const std::string &value)
   {
   
-    m_Fp << "// ==> Set() called here"                   << std::endl;  
+    m_Fp << "// ==> Set() called here"                   << std::endl; 
+    m_Fp << "  e->GetPrototype()->bbGetBlackBox(\""<< box << "\");" << std::endl;
 /*
     BlackBox* b = Current()->GetPrototype()->bbGetBlackBox(box);
     // Looks for the adaptor
@@ -411,7 +413,7 @@ namespace bbtk
    *  
    */ 
   std::string Transcriptor::Get(const std::string &box,
-                            const std::string &output)
+                                const std::string &output)
   {
   
     m_Fp << "// ==> Get() called here"                   << std::endl;  
@@ -459,29 +461,35 @@ namespace bbtk
 
   void Transcriptor::Author(const std::string &authorName)
   {
+  m_Fp << "  e->AddToAuthor(\"" << authorName << "\", true)" << std::endl;
+  return; // just to see
     //Current()->AddToAuthor(authorName,Current()==mRoot);
     if (Current()==mRoot)    
-       m_Fp << "e->AddToAuthor(\"" << authorName << "\", true)" << std::endl;
+       m_Fp << "  e->AddToAuthor(\"" << authorName << "\", true)" << std::endl;
     else
-       m_Fp << "e->AddToAuthor(\"" << authorName << "\", false)" << std::endl;
+       m_Fp << "  e->AddToAuthor(\"" << authorName << "\", false)" << std::endl;
   }
 
   void Transcriptor::Category(const std::string &category)
-  {           
+  {
+   m_Fp << "  e->AddToCategory(\"" << category << "\", true)" << std::endl;
+   return; // just to see            
     //Current()->AddToCategory(category,Current()==mRoot);
     if (Current()==mRoot)    
-       m_Fp << "e->AddToCategory(\"" << category << "\", true)" << std::endl;
+       m_Fp << "  e->AddToCategory(\"" << category << "\", true)" << std::endl;
     else
-       m_Fp << "e->AddToCategory(\"" << category << "\", false)" << std::endl;
+       m_Fp << "  e->AddToCategory(\"" << category << "\", false)" << std::endl;
   }
 
   void Transcriptor::Description(const std::string &d)
   {
+  m_Fp << "  e->AddToDescription(\"" << d << "\", true)" << std::endl;
+  return; // just to see
     // Current()->AddToDescription(d,Current()==mRoot);
     if (Current()==mRoot)    
-       m_Fp << "e->AddToDescription(\"" << d << "\", true)" << std::endl;
+       m_Fp << "  e->AddToDescription(\"" << d << "\", true)" << std::endl;
     else
-       m_Fp << "e->AddToDescription(\"" << d << "\", false)" << std::endl;    
+       m_Fp << "  e->AddToDescription(\"" << d << "\", false)" << std::endl;    
   }
 
 
@@ -540,11 +548,11 @@ namespace bbtk
     Package* p;
     try
     {
-          p = GetGlobalFactory()->GetPackage(nameblackbox);
+       p = GetGlobalFactory()->GetPackage(nameblackbox);
     }
     catch (Exception e)
     {
-          p = mPackage;
+       p = mPackage;
     }
     // Generating documentation-help of workspace
     p->SetDocURL(filename_rootHtml);
@@ -556,12 +564,12 @@ namespace bbtk
     /*
     try 
     {
-         ShowGraphTypes(nameblackbox);
+       ShowGraphTypes(nameblackbox);
     }
     catch (bbtk::Exception a)
     {
-         std::cout <<"EXC"<<std::endl;
-         page = ShowGraphInstances(nameblackbox,detail,level,system_display);
+       std::cout <<"EXC"<<std::endl;
+       page = ShowGraphInstances(nameblackbox,detail,level,system_display);
     }
     */
     return page;
@@ -569,17 +577,17 @@ namespace bbtk
 
   /// Generate a png file with the actual pipeline (Graphviz-dot needed)
   std::string Transcriptor::ShowGraphInstances(const std::string &nameblackbox, int detail, int level,
-                                   bool system_display)
+                                               bool system_display)
   {
 
     BlackBox* blackbox=NULL;
     if (nameblackbox==".")
     {
-         blackbox=Current()->GetPrototype();
+       blackbox=Current()->GetPrototype();
     }
     else 
     {
-         blackbox = Current()->GetPrototype()->bbFindBlackBox(nameblackbox);
+       blackbox = Current()->GetPrototype()->bbFindBlackBox(nameblackbox);
     }
     
     std::string page;
@@ -623,7 +631,7 @@ namespace bbtk
            } 
 
            blackbox->bbInsertHTMLGraph( s, detail, level, true, directory, false );
-           s << "</body></html>\n";      
+           s << "</body></html>\n";  
          }
        s.close();