]> Creatis software - bbtk.git/commitdiff
*** empty log message ***
authorguigues <guigues>
Wed, 8 Oct 2008 14:46:35 +0000 (14:46 +0000)
committerguigues <guigues>
Wed, 8 Oct 2008 14:46:35 +0000 (14:46 +0000)
kernel/appli/bbRegeneratePackageDoc/bbRegeneratePackageDoc.cpp
kernel/src/bbtkWxGUIScriptingInterface.cxx
packages/vtk/src/bbvtkImagePlanes.cxx

index c2e403fb3459bd865c8180616d47449dd60b9b39..b5394d682855510d2913aceea329627fa0f974ad 100644 (file)
@@ -27,65 +27,68 @@ void RegenerateDoc ( bbtk::Package::Pointer p, std::string& doc_path )
        p->CreateHtmlPage(pack_index,"bbtk",pack_name,"","",0,0,false); //true);
 }
 
+
 //==========================================================================
 int main(int argc, char **argv)
 {
-       std::string pack("*");
-       if (argc==1)
-       {
-               /*
-               // TO DO : make a Wx app
-          wxString name = wxGetTextFromUser(_T("Enter package name (* for all)"),
-                            _T("Regenerate package doc"),
-                            _T(""));
-          if (name.IsEmpty()) return 0;
-          pack = bbtk::wx2std(name);
-       */
-       }
-       else if (argc==2) 
+  std::string pack("-a");
+  if (argc==1)
+    {
+      /*
+      // TO DO : make a Wx app
+      wxString name = wxGetTextFromUser(_T("Enter package name (* for all)"),
+      _T("Regenerate package doc"),
+      _T(""));
+      if (name.IsEmpty()) return 0;
+      pack = bbtk::wx2std(name);
+      */
+    }
+  else if (argc==2) 
+    {
+      pack = std::string(argv[1]);
+    }
+  else 
+    {
+      std::cout << "usage : bbRegeneratePackageDoc [<package name>|-a]" << std::endl;
+      return 0;
+    }
+  
+  try
+    {
+      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");
+      if (pack != "-a") 
        {
-               pack = std::string(argv[1]);
+         I->InterpretLine( "include "+pack);
+         I->InterpretLine( "include "+pack+"-appli");
+         RegenerateDoc(I->GetExecuter()->GetFactory()->GetPackage(pack),doc_path);
        }
-       else 
+      else
        {
-               std::cout << "usage : bbRegeneratePackageDoc [package-name]" << std::endl;
-               return 0;
+         I->InterpretLine( "include *");
+         bbtk::Factory::PackageMapType::const_iterator i;
+         for (i  = I->GetExecuter()->GetFactory()->GetPackageMap().begin();
+              i != I->GetExecuter()->GetFactory()->GetPackageMap().end();
+              ++i)
+           {
+             if (i->second->GetName()=="user") continue;
+             RegenerateDoc(i->second,doc_path);
+           }
        }
-
-       try
+    }
+  catch (bbtk::Exception e)
     {
-               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");
-               I->InterpretLine( "include "+pack);
-               if (pack != "*") 
-               {
-                       I->InterpretLine( "include "+pack+"-appli");
-                       RegenerateDoc(I->GetExecuter()->GetFactory()->GetPackage(pack),doc_path);
-               }
-               else
-               {
-                       bbtk::Factory::PackageMapType::const_iterator i;
-                       for (i  = I->GetExecuter()->GetFactory()->GetPackageMap().begin();
-                               i != I->GetExecuter()->GetFactory()->GetPackageMap().end();
-                               ++i)
-                       {
-                               RegenerateDoc(i->second,doc_path);
-                       }
-               }
-       }
-       catch (bbtk::Exception e)
-       {
-               std::cout << "* ERROR : "<<e.GetErrorMessage()<<std::endl;
-               return 1;
-       }
-       return 0;
+      std::cout << "* ERROR : "<<e.GetErrorMessage()<<std::endl;
+      return 1;
+    }
+  return 0;
 }
 //==========================================================================
 
index 1b48a2c9ab44a6e07cbf17c44b4e4f0be58b0a30..e0b39e2657a90ed279d9c06f50be126b86de6d44 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUIScriptingInterface.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/10/08 12:19:56 $
-  Version:   $Revision: 1.23 $
+  Date:      $Date: 2008/10/08 14:46:42 $
+  Version:   $Revision: 1.24 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -439,37 +439,39 @@ namespace bbtk
   //================================================================
   void WxGUIScriptingInterface::OnMenuRegeneratePackageDoc(wxCommandEvent& WXUNUSED(event))
   {
-    wxString name = wxGetTextFromUser(_T("Enter package name (* for all)"),
-                            _T("Regenerate package doc"),
-                            _T(""));
-       if (name.IsEmpty()) return;
-       std::string pack = bbtk::wx2std(name);
-
-       std::string command("cd \"");
-       command += ConfigurationFile::GetInstance().Get_bin_path();
-    command += "\" && bbRegeneratePackageDoc " + pack;
-       bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl);
-       
-       if ( ! system ( command.c_str() ) )
-    {
-       wxMessageBox(_T("Done !"),_T("Regenerate package '")+name+_T("' doc"),
-                   wxOK | wxICON_INFORMATION);
-     }
-   else 
-     {
-       wxString err(_T("An error occured while running '"));
-       err +=  bbtk::std2wx(command) + _T("'");
-       wxMessageBox(err,_T("Regenerate package doc"),wxOK | wxICON_ERROR);      
-     }
+    wxString name = wxGetTextFromUser(_T("Enter package name (-a for all)"),
+                                     _T("Regenerate package doc"),
+                                     _T(""));
+    if (name.IsEmpty()) return;
+    std::string pack = bbtk::wx2std(name);
+    
+    std::string command;
+    command = ConfigurationFile::GetInstance().Get_bin_path();
+    command += ConfigurationFile::GetInstance().Get_file_separator();
+    command += "bbRegeneratePackageDoc " + pack;
+    bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl);
+    
+    if ( ! system ( command.c_str() ) )
+      {
+       wxMessageBox(_T("Done !"),_T("Regenerate package '")+name+_T("' doc"),
+                    wxOK | wxICON_INFORMATION);
+      }
+    else 
+      {
+       wxString err(_T("An error occured while running '"));
+       err +=  bbtk::std2wx(command) + _T("'");
+       wxMessageBox(err,_T("Regenerate package doc"),wxOK | wxICON_ERROR);      
+      }
   }
   //================================================================
 
   //================================================================
   void WxGUIScriptingInterface::OnMenuRegenerateBoxesLists(wxCommandEvent& WXUNUSED(event))
   {
-       std::string command("cd \"");
-       command += ConfigurationFile::GetInstance().Get_bin_path();
-    command += "\" && bbRegenerateBoxesLists";
+    std::string command;
+    command = ConfigurationFile::GetInstance().Get_bin_path();
+    command += ConfigurationFile::GetInstance().Get_file_separator();
+    command += "bbRegenerateBoxesLists";
        bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl);
 
        if ( ! system ( command.c_str() ) )
@@ -489,9 +491,13 @@ namespace bbtk
   //================================================================
   void WxGUIScriptingInterface::OnMenuRegenerateAll(wxCommandEvent& WXUNUSED(event))
   {
-       std::string command("cd \"");
-       command += ConfigurationFile::GetInstance().Get_bin_path();
-    command += "\" && bbRegeneratePackageDoc * && bbRegenerateBoxesLists";
+    std::string command;
+    command = ConfigurationFile::GetInstance().Get_bin_path();
+    command += ConfigurationFile::GetInstance().Get_file_separator();
+    command += "bbRegeneratePackageDoc * && ";
+    command = ConfigurationFile::GetInstance().Get_bin_path();
+    command += ConfigurationFile::GetInstance().Get_file_separator();
+    command += "bbRegenerateBoxesLists";
        bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl);
 
        if ( ! system ( command.c_str() ) )
index 68bf8e97211a2c76575ea753a110c4a6edd734e8..c80aad8bfa36459e54991a59d7e2affac85febbb 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbvtkImagePlanes.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/10/06 09:39:36 $
-  Version:   $Revision: 1.6 $
+  Date:      $Date: 2008/10/08 14:46:44 $
+  Version:   $Revision: 1.7 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -109,17 +109,20 @@ namespace bbvtk
      bbSetOutputPlaneZ(planeWidgetZ);
 
      picker->UnRegister(NULL);
-       planeWidgetX->Register(NULL);
-       planeWidgetY->Register(NULL);
-       planeWidgetZ->Register(NULL);
+     //        planeWidgetX->Register(NULL);
+     //        planeWidgetY->Register(NULL);
+     //        planeWidgetZ->Register(NULL);
    }
 
 //---------------------------------------------------------------------
   void ImagePlanes::bbUserDestructor()
   {
-         planeWidgetX->UnRegister(NULL);//Delete();
-    planeWidgetY->UnRegister(NULL);//Delete();
-    planeWidgetZ->UnRegister(NULL);//Delete();
+    //planeWidgetX->UnRegister(NULL);//Delete();
+    //planeWidgetY->UnRegister(NULL);//Delete();
+    //planeWidgetZ->UnRegister(NULL);//Delete();
+    planeWidgetX->Delete();
+    planeWidgetY->Delete();
+    planeWidgetZ->Delete();
   }
   
 //---------------------------------------------------------------------