]> Creatis software - bbtk.git/commitdiff
BUG MACOS
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Mon, 30 Mar 2009 15:22:46 +0000 (15:22 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Mon, 30 Mar 2009 15:22:46 +0000 (15:22 +0000)
kernel/appli/bbRegeneratePackageDoc/bbRegeneratePackageDoc.cpp
kernel/cmake/BBTKAddDefinitions.cmake
kernel/src/bbtkComplexBlackBox.cxx
kernel/src/bbtkComplexBlackBoxDescriptor.cxx
kernel/src/bbtkExecuter.cxx
kernel/src/bbtkFactory.cxx
kernel/src/bbtkWxGUIScriptingInterface.cxx

index 1f8249a731713ab528a5289d6a647a2b13c5e47a..cfae87e14c61df4804ee3c97759240b53a92ddac 100644 (file)
@@ -7,6 +7,7 @@
 //==========================================================================
 void RegenerateDoc ( bbtk::Package::Pointer p, std::string& doc_path )
 {
+       
   std::string pack_name(p->GetName());
   std::string pack_path = doc_path + pack_name;
   // Creating directory
@@ -24,7 +25,11 @@ void RegenerateDoc ( bbtk::Package::Pointer p, std::string& doc_path )
   
   p->SetDocURL(pack_index);
   p->SetDocRelativeURL("index.html");
-  p->CreateHtmlPage(pack_index,"bbtk",pack_name,"","",0,0,false); //true);
+       
+       
+  p->CreateHtmlPage(pack_index,"bbtk",pack_name,"","",0,0,true); //true);
+       
+       
 }
 
 
@@ -40,6 +45,7 @@ void Usage()
 //==========================================================================
 int main(int argc, char **argv)
 {
+
   std::string pack("-a");
   if (argc==2) 
     {
@@ -65,25 +71,27 @@ int main(int argc, char **argv)
   
   try
     {
-      std::string doc_path = bbtk::ConfigurationFile::GetInstance().Get_doc_path();
+               std::string doc_path = bbtk::ConfigurationFile::GetInstance().Get_doc_path();
       doc_path += bbtk::ConfigurationFile::GetInstance().Get_file_separator();
       doc_path += "bbdoc";
       doc_path += bbtk::ConfigurationFile::GetInstance().Get_file_separator();
-      
+                               
       bbtk::Interpreter::Pointer I = bbtk::Interpreter::New();
       I->SetCommandLine(true);
       I->SetThrow(false);
-      I->InterpretLine( "exec freeze_no_error");
+         I->InterpretLine( "exec freeze_no_error");
       if (pack != "-a") 
        {
-         I->InterpretLine( "include "+pack);
-         I->InterpretLine( "include "+pack+"-appli");
-         RegenerateDoc(I->GetExecuter()->GetFactory()->GetPackage(pack),doc_path);
+               I->InterpretLine( "include "+pack);
+               I->InterpretLine( "include "+pack+"-appli");
+               bbtk::Package::Pointer p = I->GetExecuter()->GetFactory()->GetPackage(pack);
+               
+               RegenerateDoc(I->GetExecuter()->GetFactory()->GetPackage(pack),doc_path);
        }
       else
        {
-         I->InterpretLine( "include *");
-         bbtk::Factory::PackageMapType::const_iterator i;
+I->InterpretLine( "include *");
+               bbtk::Factory::PackageMapType::const_iterator i;
          for (i  = I->GetExecuter()->GetFactory()->GetPackageMap().begin();
               i != I->GetExecuter()->GetFactory()->GetPackageMap().end();
               ++i)
@@ -98,7 +106,7 @@ int main(int argc, char **argv)
       std::cout << "* ERROR : "<<e.GetErrorMessage()<<std::endl;
       return 1;
     }
-  return 0;
+       return 0;
 }
 //==========================================================================
 
index 68b1506d212dccb5029f9e81ddcd0459c08a9a54..359b340718f1f06b03430e861f0948ca0486719e 100644 (file)
@@ -25,20 +25,5 @@ IF (BBTK_COMPILE_ERROR_MESSAGES)
 ENDIF (BBTK_COMPILE_ERROR_MESSAGES) 
 #-----------------------------------------------------------------------------
 
-IF(APPLE)
- CREA_DEFINE(MACOSX)
-ELSE(APPLE)
-  IF("${CMAKE_SYSTEM}" MATCHES "Linux")
-    CREA_DEFINE(LINUX)
-  ELSE("${CMAKE_SYSTEM}" MATCHES "Linux")
-    IF(WIN32)
-      CREA_DEFINE(WIN32)
-    ELSE(WIN32)
-      MESSAGE(FATAL_ERROR "${CMAKE_SYSTEM} unsupported ! Build at your own risks ! (remove this line from kernel/cmake/BBTKAddDefinitions.cmake)")
-    ENDIF(WIN32)
-  ENDIF("${CMAKE_SYSTEM}" MATCHES "Linux")
-ENDIF(APPLE) 
-#-----------------------------------------------------------------------------
-
 MESSAGE(STATUS "=======================================")
 MESSAGE(STATUS "")
index 47b983717e5b27d0b34b0c68470ca041fb499862..f3531fc5b301539336b3539d80f6c324767b1eec 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkComplexBlackBox.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/12/12 12:11:21 $
-  Version:   $Revision: 1.24 $
+  Date:      $Date: 2009/03/30 15:22:51 $
+  Version:   $Revision: 1.25 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -680,7 +680,6 @@ namespace bbtk
                                            const std::string& output_dir,
                                            bool relative_link )
   {
-    
     std::string directory(output_dir);
 
     if (output_dir.length() == 0) 
@@ -702,10 +701,10 @@ namespace bbtk
     std::string filename_dot2  ("\""   + filename_dot  + "\"");
     
 
-    std::string command1 ("dot -T png -o "  
-                         + filename_png2  + " " + filename_dot2);
+    std::string command1 ("dot -Tpng:quartz -o "  
+                         + filename_png2  + " " + filename_dot2 );
     std::string command1a("dot -T cmap -o " 
-                         + filename_cmap2 + " " + filename_dot2);
+                         + filename_cmap2 + " " + filename_dot2 );
 
     // 1. Generating .dot file
     FILE *ff;
@@ -739,14 +738,16 @@ namespace bbtk
     FILE *ff2;
     char c;
     ff2=fopen(filename_cmap.c_str(),"r");
-    while (!feof(ff2))
-    {
-          c=fgetc(ff2);
-          if (c!=-1)
-          {
-             (s) << c;
-          }
-    }
+       if (ff2!=NULL){
+               while (!feof(ff2))
+               {
+                       c=fgetc(ff2);
+                       if (c!=-1)
+                       {
+                               (s) << c;
+                       } // if 
+               } // while
+       } // if ff2
     (s) << "</map>\n\n";
     
     // End
index 2bc2e3ea6b67e106c6a5df7f611641aac2c6a63c..de6d2b70922fe06ff02e89c24ae5c258c1950ff8 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkComplexBlackBoxDescriptor.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/10/17 08:18:12 $
-  Version:   $Revision: 1.18 $
+  Date:      $Date: 2009/03/30 15:22:51 $
+  Version:   $Revision: 1.19 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -410,14 +410,14 @@ namespace bbtk
                 url = p->GetDocRelativeURL();
              else 
                 url = p->GetDocURL();
-
+                  
              s << "<a href=\"" <<url<<"#"<<name<<"\">" 
                << p->GetName()<<"::"<<name<<"</a>\n";
-           }   
+           }   // for
        
            (s) << "</TD></TR>\n";
 
-     }
+     } // If B.size
 
      (s) << "</TABLE>\n";
 
index 41ca9b6f13dd52dc0731551d68d832b179b078ea..519a264eec6eb7bb3017a38ae007d33df0cf4c89 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkExecuter.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/03/30 14:42:16 $
-  Version:   $Revision: 1.28 $
+  Date:      $Date: 2009/03/30 15:22:51 $
+  Version:   $Revision: 1.29 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -511,33 +511,7 @@ namespace bbtk
   {
     int detail =       atoi(detailStr.c_str());
     int level  =       atoi(levelStr.c_str());
-
-    std::string filename_rootHtml (output_html) ;
-    std::string simplefilename_rootHtml ( Utilities::get_file_name(output_html));
-
-    bool relative_link = true;
-
-    // No output provided : automatic generation
-    if (output_html.length() == 0)
-      {
-               // Don't pollute the file store with  "temp_dir" directories ...    
-               std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
-       
-               char c = default_doc_dir.c_str()[strlen(default_doc_dir.c_str())-1];
-       
-               std::string directory = default_doc_dir; 
-               if (c != '/' && c !='\\') directory = directory + "/";
-               directory = directory +  "temp_dir";    
-       
-               filename_rootHtml = directory + "/" + "User.html";
-               simplefilename_rootHtml = "User.html" ;
-
-               // Creating directory
-               std::string command0("mkdir \"" +directory + "\"");
-               system( command0.c_str() );
-
-               relative_link = false;
-      }
+         bool relative_link = true;
 
     Package::Pointer p;
     try
@@ -548,13 +522,30 @@ namespace bbtk
     {
       p = GetUserPackage();
     }
+         
+      std::string doc_path = bbtk::ConfigurationFile::GetInstance().Get_doc_path();
+      doc_path += bbtk::ConfigurationFile::GetInstance().Get_file_separator();
+      doc_path += "bbdoc";
+      doc_path += bbtk::ConfigurationFile::GetInstance().Get_file_separator();
+         
+         std::string pack_name(p->GetName());
+         std::string pack_path = doc_path + pack_name;
+         // Creating directory
+         if ( ! bbtk::Utilities::FileExists(pack_path) )
+         {
+                 std::string command("mkdir \"" +pack_path+ "\"");
+                 system( command.c_str() );
+         }
+         std::string pack_index(pack_path);
+         pack_index += bbtk::ConfigurationFile::GetInstance().Get_file_separator();
+         pack_index += "index.html"; 
+         
+         
     // Generating documentation-help of workspace
-    p->SetDocURL(filename_rootHtml);
-    p->SetDocRelativeURL(simplefilename_rootHtml);
-
-    p->CreateHtmlPage(filename_rootHtml,"bbtk","user package",custom_header,custom_title,detail,level,relative_link);
-
-    std::string page = filename_rootHtml;
+       p->SetDocURL(pack_index);
+    p->SetDocRelativeURL("index.html");
+       p->CreateHtmlPage(pack_index,"bbtk","user package",custom_header,custom_title,detail,level,relative_link);
+         
     /*
     try 
     {
@@ -566,7 +557,7 @@ namespace bbtk
        page = ShowGraphInstances(nameblackbox,detail,level,system_display);
     }
     */
-    return page;
+    return pack_index;
   }
   //=======================================================================
 
@@ -624,7 +615,6 @@ namespace bbtk
              } else {
              s << "<center>" << blackbox->bbGetName()<< "</center>";
            } 
-
            blackbox->bbInsertHTMLGraph( s, detail, level, true, directory, false );
            s << "</body></html>\n";
          }
index 3ba655b7df333da5c150070e05388d6029e605fd..ad64151ba1696592f5611f2095d42125f86b6155 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkFactory.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/02/27 11:20:25 $
-  Version:   $Revision: 1.41 $
+  Date:      $Date: 2009/03/30 15:22:51 $
+  Version:   $Revision: 1.42 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -39,6 +39,7 @@
 #include "bbtkConnection.h"
 #include "bbtkConfigurationFile.h"
 #include "bbtkUtilities.h"
+#include "bbtkConfigurationFile.h"
 
 #include <sys/stat.h> // for struct stat stFileInfo
 
@@ -1011,7 +1012,9 @@ namespace bbtk
            s << "&nbsp;&nbsp;-&nbsp;&nbsp;\n"; 
 
            s << "<a name=\"doxygen\"></a>\n"; 
-           s << "<a href=..\\doxygen\\" << ii->first << "/main.html>(Doxygen documentation of the source)</a>\n"; 
+//EED 26Mars2009                 
+               std::string bin_path = bbtk::ConfigurationFile::GetInstance().Get_bin_path();
+           s << "<a href=" << bin_path <<"/../share/bbtk/doc/doxygen/" << ii->first << "/main.html>(Doxygen documentation of the source)</a>\n"; 
          }
        else 
          {
index b6581d08788b1d939eda5d004622d40fa34d19a0..f06b07eced988fe2dac3cc031f485b96e31f7fcb 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUIScriptingInterface.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/03/24 13:42:59 $
-  Version:   $Revision: 1.35 $
+  Date:      $Date: 2009/03/30 15:22:51 $
+  Version:   $Revision: 1.36 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -519,14 +519,27 @@ namespace bbtk
   //================================================================
   void WxGUIScriptingInterface::OnMenuShowImageGraph(wxCommandEvent& WXUNUSED(event))
   {
-    std::string default_temp_dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
 
+      std::string doc_path = bbtk::ConfigurationFile::GetInstance().Get_doc_path();
+      doc_path += bbtk::ConfigurationFile::GetInstance().Get_file_separator();
+      doc_path += "bbdoc";
+      doc_path += bbtk::ConfigurationFile::GetInstance().Get_file_separator();
+         
+         std::string pack_name("User");
+         std::string pack_path = doc_path + pack_name;
+         
+         
 #if defined(WIN32)
     std::string strappli="start ";
 #else
-    std::string strappli="gnome-open ";
+  #if defined(MACOSX)
+      std::string strappli="open ";
+  #else
+      std::string strappli="gnome-open ";        
+  #endif
 #endif
-    std::string strcommand = strappli +default_temp_dir+"/temp_dir/workspace_workspacePrototype.png";
+         
+         std::string strcommand = strappli +pack_path+"/workspace_workspacePrototype.png";
     // std::cout << "system: " << strcommand << std::endl;
     system ( strcommand.c_str() );