]> Creatis software - crea.git/commitdiff
Feature #1711
authorDaniel Gonzalez <daniel.gonzalez@creatis.insa-lyon.fr>
Thu, 17 Jan 2013 19:05:53 +0000 (20:05 +0100)
committerDaniel Gonzalez <daniel.gonzalez@creatis.insa-lyon.fr>
Thu, 17 Jan 2013 19:05:53 +0000 (20:05 +0100)
CreaDevManager application implementation

-Project structure report implemented! available in project actions panel
-fixed bug when refreshing project with no open project.

23 files changed:
CMakeLists.txt
appli/creaDevManager/CMakeLists.txt
appli/creaDevManager/about.html [new file with mode: 0644]
install/CMakeLists.txt
lib/creaDevManagerLib/creaDevManagerIds.h
lib/creaDevManagerLib/modelCDMAppli.cpp
lib/creaDevManagerLib/modelCDMAppli.h
lib/creaDevManagerLib/modelCDMApplication.cpp
lib/creaDevManagerLib/modelCDMApplication.h
lib/creaDevManagerLib/modelCDMLib.cpp
lib/creaDevManagerLib/modelCDMLib.h
lib/creaDevManagerLib/modelCDMLibrary.cpp
lib/creaDevManagerLib/modelCDMLibrary.h
lib/creaDevManagerLib/modelCDMPackage.cpp
lib/creaDevManagerLib/modelCDMPackage.h
lib/creaDevManagerLib/modelCDMProject.cpp
lib/creaDevManagerLib/modelCDMProject.h
lib/creaDevManagerLib/wxCDMMainFrame.cpp
lib/creaDevManagerLib/wxCDMMainFrame.h
lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp
lib/creaDevManagerLib/wxCDMProjectActionsPanel.h
lib/creaDevManagerLib/wxCDMProjectStructureReportDialog.cpp [new file with mode: 0644]
lib/creaDevManagerLib/wxCDMProjectStructureReportDialog.h [new file with mode: 0644]

index 4393e64eb0d77258a4f7f8569da36efc91e751db..ca4303327a9a4463570299e703c664de0932c91f 100644 (file)
@@ -1,7 +1,7 @@
 # ---------------------------------------------------------------------
 #
 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
-#                        pour la Santé)
+#                        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
index bec75cdd6466807b6fc894381e5f58cf37892903..0a5320a56a51375c6944a52bca28848bb1026ded 100644 (file)
@@ -1,7 +1,7 @@
 # ---------------------------------------------------------------------
 #
 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
-#                        pour la Santé)
+#                        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
@@ -71,3 +71,9 @@ SET ( ${EXE_NAME}_LINK_LIBRARIES
 #-Creates and installs the exe-----------------------------------------------
 CREA_ADD_EXECUTABLE( ${EXE_NAME} )
 #============================================================================
+
+CONFIGURE_FILE(
+    ${CMAKE_CURRENT_SOURCE_DIR}/about.html
+    ${EXECUTABLE_OUTPUT_PATH}/about.html
+    @ONLY IMMEDIATE
+    )
diff --git a/appli/creaDevManager/about.html b/appli/creaDevManager/about.html
new file mode 100644 (file)
index 0000000..19d43e6
--- /dev/null
@@ -0,0 +1,31 @@
+<html>
+<body bgcolor="#3333CC">
+<table cellspacing=3 cellpadding=4 width="100%">
+  <tr>
+    <td bgcolor="#3333CC">
+    <center>
+    <font size=+2 color="#FFFFFF"><b>CREA Development Manager</b>
+    </font>
+    </center>
+    </td>
+  </tr>
+  <tr>
+    <td bgcolor="#FFFFFF">
+    <p><b><font size=+1>Creatis 2012 - Lyon, France</font></b></p>
+    <font size=-1>
+      <table cellpadding=0 cellspacing=0 width="100%">
+        <tr>
+          <td width="65%">
+            <p>Created by Daniel Gonz&aacute;lez - daniel.gonzalez@creatis.insa-lyon.fr</p>
+          </td>
+        </tr>
+      </table>
+      <font size=1>
+        <p>This software is governed by the CeCILL-B license under French law and abiding by the rules of distribution of free software.</p>
+      </font>
+    </font>
+    </td>
+  </tr>
+</table>
+</body>
+</html>
index d4620cdc694d97321073c4eb0f02854e76c4ced6..f003414a9a82210e78d87fa817dd2b974445f38d 100644 (file)
@@ -1,7 +1,7 @@
 # ---------------------------------------------------------------------
 #
 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
-#                        pour la Santé)
+#                        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
@@ -92,6 +92,7 @@ SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt")
 SET(CPACK_PACKAGE_VERSION_MAJOR ${crea_MAJOR_VERSION})
 SET(CPACK_PACKAGE_VERSION_MINOR ${crea_MINOR_VERSION})
 SET(CPACK_PACKAGE_VERSION_PATCH ${crea_BUILD_VERSION})
+
 IF(WIN32)
        SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CreaTools\\\\crea-${crea_MAJOR_VERSION}.${crea_MINOR_VERSION}.${crea_BUILD_VERSION}")
 ELSE(WIN32)
index f595934b75575095d74be82bad7a816b5cc904f1..4376d3eaf38135f889b1639d8873451d5bf110ab 100644 (file)
 #define ID_CHECKBOX_DISABLE_HELP        10335
 #define ID_CHECKBOX_TOGGLE_HELP         10335
 
+#define ID_BUTTON_CHECK_PROJECT         10336
+
 #endif /* CREADEVMANAGERIDS_H_ */
index 7669853356dd585c5e5a207abb3c7e82e1706221..586c550dcf01e0e1263297853403956d31839671 100644 (file)
@@ -36,6 +36,7 @@
 
 #include <iostream>
 #include <fstream>
+#include <sstream>
 #include <algorithm>
 
 #include "CDMUtilities.h"
@@ -303,3 +304,76 @@ const bool modelCDMAppli::Refresh(std::string*& result)
   std::sort(this->applications.begin(), this->applications.end(), CompareNodeItem);
   return true;
 }
+
+void modelCDMAppli::CheckStructure(std::map<std::string, bool>& properties)
+{
+  //check cmake exist
+  if(this->CMakeLists != NULL)
+    {
+      //set properties parameters based on model
+      for (int i = 0; i < this->applications.size(); i++)
+        properties["appli add " + this->applications[i]->GetName()] = false;
+
+      //open cmakelists
+      std::ifstream confFile;
+      confFile.open((this->CMakeLists->GetPath()).c_str());
+
+      //take everything that is not commented
+      std::string fileContent;
+
+      std::string word;
+      std::vector<std::string> words;
+      while(confFile.is_open() && !confFile.eof())
+        {
+          std::getline(confFile,word, '\n');
+          if(word[0] != '#')
+            {
+              CDMUtilities::splitter::split(words, word, "#", CDMUtilities::splitter::empties_ok);
+              if (words.size() > 0)
+                {
+                  word = words[0];
+                  CDMUtilities::splitter::split(words, word, " ", CDMUtilities::splitter::empties_ok);
+                  for (int i = 0; i < words.size(); i++)
+                    {
+                      if(words[i].substr(0,2) == "//")
+                        break;
+                      fileContent += words[i] + " ";
+                    }
+                }
+            }
+        }
+
+      //check every instruction
+      std::stringstream ss(fileContent);
+      while(!ss.eof())
+        {
+          std::getline(ss,word, '(');
+
+          //check instruction name
+          CDMUtilities::splitter::split(words, word, " ", CDMUtilities::splitter::no_empties);
+
+          //add instructions
+          if (words.size() > 0 && words[words.size()-1] == "ADD_SUBDIRECTORY")
+            {
+              std::getline(ss,word, ')');
+              //std::cout << word << std::endl;
+              CDMUtilities::splitter::split(words, word, " ", CDMUtilities::splitter::no_empties);
+
+              if (words.size() > 0)
+                {
+                  {
+                    properties["appli add " + words[0]] = true;
+                  }
+                }
+            }
+        }
+
+    }
+
+  //check libraries' structure
+  for (int i = 0; i < this->applications.size(); i++)
+    {
+      properties["application " + this->applications[i]->GetName()] = true;
+      this->applications[i]->CheckStructure(properties);
+    }
+}
index d5df81e501b70672da32cbbc8a91d43ad3a8e6a3..60d66d0683b0da91c1251c306135c1da97bca339 100644 (file)
@@ -37,6 +37,7 @@
 
 #include<iostream>
 #include<vector>
+#include<map>
 
 #include"modelCDMFolder.h"
 #include"modelCDMApplication.h"
@@ -56,6 +57,8 @@ public:
   );
   virtual const bool Refresh(std::string*& result);
 
+  void CheckStructure(std::map<std::string, bool>& properties);
+
 private:
   std::vector<modelCDMApplication*> applications;
 };
index 19cc293cd8543dca53f9a74e2fdb8d5ac8ce6566..56c9e08bbae20cdb00db5e66d2042c61c0368bd3 100644 (file)
@@ -35,6 +35,7 @@
 #include "modelCDMApplication.h"
 
 #include <fstream>
+#include <sstream>
 #include <algorithm>
 
 #include "CDMUtilities.h"
@@ -421,3 +422,90 @@ const bool modelCDMApplication::Refresh(std::string*& result)
   this->SortChildren();
   return true;
 }
+
+void modelCDMApplication::CheckStructure(std::map<std::string, bool>& properties)
+{
+  //check cmake exist
+  if(this->CMakeLists != NULL)
+    {
+      //set default properties
+      properties["application " + this->name + " lib ${crea_LIBRARIES}"] = false;
+      properties["application " + this->name + " lib ${WXWIDGETS_LIBRARIES}"] = false;
+      properties["application " + this->name + " lib ${KWWidgets_LIBRARIES}"] = false;
+      properties["application " + this->name + " lib ${VTK_LIBRARIES}"] = false;
+      properties["application " + this->name + " lib ${ITK_LIBRARIES}"] = false;
+      properties["application " + this->name + " lib ${GDCM_LIBRARIES}"] = false;
+      properties["application " + this->name + " lib ${BOOST_LIBRARIES}"] = false;
+
+      //open cmakelists
+      std::ifstream confFile;
+      confFile.open((this->CMakeLists->GetPath()).c_str());
+
+      //take everything that is not commented
+      std::string fileContent;
+
+      std::string word;
+      std::vector<std::string> words;
+      while(confFile.is_open() && !confFile.eof())
+        {
+          std::getline(confFile,word, '\n');
+          if(word[0] != '#')
+            {
+              CDMUtilities::splitter::split(words, word, "#", CDMUtilities::splitter::empties_ok);
+              if (words.size() > 0)
+                {
+                  word = words[0];
+                  CDMUtilities::splitter::split(words, word, " ", CDMUtilities::splitter::empties_ok);
+                  for (int i = 0; i < words.size(); i++)
+                    {
+                      if(words[i].substr(0,2) == "//")
+                        break;
+                      fileContent += words[i] + " ";
+                    }
+                }
+            }
+        }
+
+      //check every instruction
+      std::stringstream ss(fileContent);
+      while(!ss.eof())
+        {
+          std::getline(ss,word, '(');
+
+          //check instruction name
+          CDMUtilities::splitter::split(words, word, " ", CDMUtilities::splitter::no_empties);
+
+          //set instructions
+          if (words.size() > 0 && words[words.size()-1] == "SET")
+            {
+              std::getline(ss,word, ')');
+
+              CDMUtilities::splitter::split(words, word, " \t", CDMUtilities::splitter::no_empties);
+              if (words.size() > 1)
+                {
+                  if (words[0] == "${EXE_NAME}_LINK_LIBRARIES")
+                    {
+                      for (int i = 1; i < words.size(); i++)
+                        {
+                          properties["application " + this->name + " lib " + words[i]] = true;
+                        }
+                    }
+                }
+            }
+          else if (words.size() > 0 && words[words.size()-1] == "INCLUDE_DIRECTORIES")
+            {
+              std::getline(ss,word, ')');
+
+              CDMUtilities::splitter::split(words, word, " \t", CDMUtilities::splitter::no_empties);
+
+              for (int i = 0; i < words.size(); i++)
+                {
+                  properties["application " + this->name + " dir " + words[i]] = true;
+                }
+
+
+            }
+        }
+
+    }
+}
index 4935676ef0ee3c3c814e5bdec2d11923ba39d1c5..cf9747617c97c474a81c063b66f50467ab46b3dc 100644 (file)
@@ -37,6 +37,7 @@
 
 #include<iostream>
 #include<vector>
+#include<map>
 
 #include "modelCDMFolder.h"
 #include "modelCDMFile.h"
@@ -57,6 +58,8 @@ public:
 
   virtual const bool Refresh(std::string*& result);
 
+  void CheckStructure(std::map<std::string, bool>& properties);
+
 private:
   std::string executableName;
   modelCDMFile* mainFile;
index a040ae8b05ce283062bbb253792d723a4ea40001..e09cf2d978b3a4bb693ce4d6fb6c2f7dd9ee07db 100644 (file)
@@ -35,6 +35,7 @@
 #include "modelCDMLib.h"
 
 #include <fstream>
+#include <sstream>
 #include <algorithm>
 
 #include "CDMUtilities.h"
@@ -304,3 +305,76 @@ const bool modelCDMLib::Refresh(std::string*& result)
   std::sort(this->libraries.begin(), this->libraries.end(), CompareNodeItem);
   return true;
 }
+
+void modelCDMLib::CheckStructure(std::map<std::string, bool>& properties)
+{
+  //check cmake exist
+  if(this->CMakeLists != NULL)
+    {
+      //set properties parameters based on model
+      for (int i = 0; i < this->libraries.size(); i++)
+        properties["lib add " + libraries[i]->GetName()] = false;
+
+      //open cmakelists
+      std::ifstream confFile;
+      confFile.open((this->CMakeLists->GetPath()).c_str());
+
+      //take everything that is not commented
+      std::string fileContent;
+
+      std::string word;
+      std::vector<std::string> words;
+      while(confFile.is_open() && !confFile.eof())
+        {
+          std::getline(confFile,word, '\n');
+          if(word[0] != '#')
+            {
+              CDMUtilities::splitter::split(words, word, "#", CDMUtilities::splitter::empties_ok);
+              if (words.size() > 0)
+                {
+                  word = words[0];
+                  CDMUtilities::splitter::split(words, word, " ", CDMUtilities::splitter::empties_ok);
+                  for (int i = 0; i < words.size(); i++)
+                    {
+                      if(words[i].substr(0,2) == "//")
+                        break;
+                      fileContent += words[i] + " ";
+                    }
+                }
+            }
+        }
+
+      //check every instruction
+      std::stringstream ss(fileContent);
+      while(!ss.eof())
+        {
+          std::getline(ss,word, '(');
+
+          //check instruction name
+          CDMUtilities::splitter::split(words, word, " ", CDMUtilities::splitter::no_empties);
+
+          //add instructions
+          if (words.size() > 0 && words[words.size()-1] == "ADD_SUBDIRECTORY")
+            {
+              std::getline(ss,word, ')');
+              //std::cout << word << std::endl;
+              CDMUtilities::splitter::split(words, word, " ", CDMUtilities::splitter::no_empties);
+
+              if (words.size() > 0)
+                {
+                  {
+                    properties["lib add " + words[0]] = true;
+                  }
+                }
+            }
+        }
+
+    }
+
+  //check libraries' structure
+  for (int i = 0; i < this->libraries.size(); i++)
+    {
+      properties["library " + this->libraries[i]->GetName()] = true;
+      this->libraries[i]->CheckStructure(properties);
+    }
+}
index 49722b10b4d3618604a19625575a5bf21d0e0d29..6b96a76b1ba159f9c606fde0bca767b7f7d5d0f0 100644 (file)
@@ -37,6 +37,7 @@
 
 #include<iostream>
 #include<vector>
+#include<map>
 
 #include "modelCDMFolder.h"
 #include "modelCDMLibrary.h"
@@ -57,6 +58,8 @@ public:
 
   virtual const bool Refresh(std::string*& result);
 
+  void CheckStructure(std::map<std::string, bool>& properties);
+
 private:
   std::vector<modelCDMLibrary*> libraries;
 };
index 3e47717084a83704c810d283af8337df36b9eedf..f67999c06748b6441a43c538d07b7cbeb3a2c45c 100644 (file)
@@ -35,6 +35,7 @@
 #include "modelCDMLibrary.h"
 
 #include <fstream>
+#include <sstream>
 #include <algorithm>
 
 #include "CDMUtilities.h"
@@ -194,17 +195,17 @@ bool modelCDMLibrary::SetNameLibrary(const std::string& fileName, std::string*&
 modelCDMFolder* modelCDMLibrary::CreateFolder(const std::string& name, std::string*& result)
 {
   //TODO:: mkdir depending on OS
-    std::string command = "mkdir \"" + path + CDMUtilities::SLASH + name + "\"";
-    if(system(command.c_str()))
-      {
-        result = new std::string("Error executing: " + command + ".");
-        return NULL;
-      }
-    modelCDMFolder* folder = new modelCDMFolder(this, path + CDMUtilities::SLASH + name, name, level + 1);
-    this->folders.push_back(folder);
-    this->children.push_back(folder);
-
-    return folder;
+  std::string command = "mkdir \"" + path + CDMUtilities::SLASH + name + "\"";
+  if(system(command.c_str()))
+    {
+      result = new std::string("Error executing: " + command + ".");
+      return NULL;
+    }
+  modelCDMFolder* folder = new modelCDMFolder(this, path + CDMUtilities::SLASH + name, name, level + 1);
+  this->folders.push_back(folder);
+  this->children.push_back(folder);
+
+  return folder;
 }
 
 const bool modelCDMLibrary::Refresh(std::string*& result)
@@ -353,3 +354,78 @@ const bool modelCDMLibrary::Refresh(std::string*& result)
   std::sort(this->folders.begin(), this->folders.end(), CompareNodeItem);
   return true;
 }
+
+void modelCDMLibrary::CheckStructure(std::map<std::string, bool>& properties)
+{
+  //check cmake exist
+  if(this->CMakeLists != NULL)
+    {
+      //set default values
+      properties["library " + this->name + " lib ${crea_LIBRARIES}"] = false;
+      properties["library " + this->name + " lib ${WXWIDGETS_LIBRARIES}"] = false;
+      properties["library " + this->name + " lib ${KWWidgets_LIBRARIES}"] = false;
+      properties["library " + this->name + " lib ${VTK_LIBRARIES}"] = false;
+      properties["library " + this->name + " lib ${ITK_LIBRARIES}"] = false;
+      properties["library " + this->name + " lib ${GDCM_LIBRARIES}"] = false;
+      properties["library " + this->name + " lib ${BOOST_LIBRARIES}"] = false;
+
+
+      //open cmakelists
+      std::ifstream confFile;
+      confFile.open((this->CMakeLists->GetPath()).c_str());
+
+      //take everything that is not commented
+      std::string fileContent;
+
+      std::string word;
+      std::vector<std::string> words;
+      while(confFile.is_open() && !confFile.eof())
+        {
+          std::getline(confFile,word, '\n');
+          if(word[0] != '#')
+            {
+              CDMUtilities::splitter::split(words, word, "#", CDMUtilities::splitter::empties_ok);
+              if (words.size() > 0)
+                {
+                  word = words[0];
+                  CDMUtilities::splitter::split(words, word, " ", CDMUtilities::splitter::empties_ok);
+                  for (int i = 0; i < words.size(); i++)
+                    {
+                      if(words[i].substr(0,2) == "//")
+                        break;
+                      fileContent += words[i] + " ";
+                    }
+                }
+            }
+        }
+
+      //check every instruction
+      std::stringstream ss(fileContent);
+      while(!ss.eof())
+        {
+          std::getline(ss,word, '(');
+
+          //check instruction name
+          CDMUtilities::splitter::split(words, word, " ", CDMUtilities::splitter::no_empties);
+
+          //set instructions
+          if (words.size() > 0 && words[words.size()-1] == "SET")
+            {
+              std::getline(ss,word, ')');
+
+              CDMUtilities::splitter::split(words, word, " \t", CDMUtilities::splitter::no_empties);
+              if (words.size() > 1)
+                {
+                  if (words[0] == "${LIBRARY_NAME}_LINK_LIBRARIES")
+                    {
+                      for (int i = 1; i < words.size(); i++)
+                        {
+                          properties["library " + this->name + " lib " + words[i]] = true;
+                        }
+                    }
+                }
+            }
+        }
+
+    }
+}
index fb3b7d9224bd1a81907d4d9eb8af06105bc0fdac..2a64ff1076ea6d373c3dbb1192e452c1efdcbf63 100644 (file)
@@ -37,6 +37,7 @@
 
 #include<iostream>
 #include<vector>
+#include<map>
 
 #include "modelCDMFolder.h"
 
@@ -54,6 +55,8 @@ public:
 
   virtual const bool Refresh(std::string*& result);
 
+  void CheckStructure(std::map<std::string, bool>& properties);
+
 private:
   std::string nameLibrary;
   std::vector<modelCDMFolder*> folders;
index 093d610aff00757e6789523772ab6fb0d6025d4a..0f001bbde823b9733887cb11a3a282dc994b29ef 100644 (file)
@@ -35,6 +35,7 @@
 #include "modelCDMPackage.h"
 
 #include <fstream>
+#include <sstream>
 #include <algorithm>
 
 #include "creaWx.h"
@@ -568,3 +569,108 @@ const bool modelCDMPackage::Refresh(std::string*& result)
   this->SortChildren();
   return true;
 }
+
+void modelCDMPackage::CheckStructure(std::map<std::string, bool>& properties)
+{
+  //check cmake exist
+  if(this->CMakeLists != NULL)
+    {
+      //open cmakelists
+      std::ifstream confFile;
+      confFile.open((this->CMakeLists->GetPath()).c_str());
+
+      //take everything that is not commented
+      std::string fileContent;
+
+      std::string word;
+      std::vector<std::string> words;
+      while(confFile.is_open() && !confFile.eof())
+        {
+          std::getline(confFile,word, '\n');
+          if(word[0] != '#')
+            {
+              CDMUtilities::splitter::split(words, word, "#", CDMUtilities::splitter::empties_ok);
+              if (words.size() > 0)
+                {
+                  word = words[0];
+                  CDMUtilities::splitter::split(words, word, " ", CDMUtilities::splitter::empties_ok);
+                  for (int i = 0; i < words.size(); i++)
+                    {
+                      if(words[i].substr(0,2) == "//")
+                        break;
+                      fileContent += words[i] + " ";
+                    }
+                }
+            }
+        }
+
+      //check every instruction
+      std::stringstream ss(fileContent);
+      while(!ss.eof())
+        {
+          std::getline(ss,word, '(');
+
+          //check instruction name
+          CDMUtilities::splitter::split(words, word, " ", CDMUtilities::splitter::no_empties);
+
+          //set instructions
+          if (words.size() > 0 && words[words.size()-1] == "SET")
+            {
+              std::getline(ss,word, ')');
+
+              CDMUtilities::splitter::split(words, word, " \t", CDMUtilities::splitter::no_empties);
+              if (words.size() > 1)
+                {
+                  if (words[0] == "${BBTK_PACKAGE_NAME}_USE_VTK" && words[1] == "ON")
+                    {
+                      properties["package " + this->name + " set USE_VTK"] = true;
+                    }
+                  else if (words[0] == "${BBTK_PACKAGE_NAME}_USE_ITK" && words[1] == "ON")
+                    {
+                      properties["package " + this->name + " set USE_ITK"] = true;
+                    }
+                  else if (words[0] == "${BBTK_PACKAGE_NAME}_USE_GDCM" && words[1] == "ON")
+                    {
+                      properties["package " + this->name + " set USE_GDCM"] = true;
+                    }
+                  else if (words[0] == "${BBTK_PACKAGE_NAME}_USE_GDCM_VTK" && words[1] == "ON")
+                    {
+                      properties["package " + this->name + " set USE_GDCM_VTK"] = true;
+                    }
+                  else if (words[0] == "${BBTK_PACKAGE_NAME}_USE_GSMIS" && words[1] == "ON")
+                    {
+                      properties["package " + this->name + " set USE_GSMIS"] = true;
+                    }
+                  else if (words[0] == "${BBTK_PACKAGE_NAME}_USE_WXWIDGETS" && words[1] == "ON")
+                    {
+                      properties["package " + this->name + " set USE_WXWIDGETS"] = true;
+                    }
+                  else if (words[0] == "${BBTK_PACKAGE_NAME}_USE_KWWIDGETS" && words[1] == "ON")
+                    {
+                      properties["package " + this->name + " set USE_KWWIDGETS"] = true;
+                    }
+                  else if (words[0] == "USE_BOOST" && words[1] == "ON")
+                    {
+                      properties["package " + this->name + " set USE_BOOST"] = true;
+                    }
+                  else if (words[0] == "${BBTK_PACKAGE_NAME}_INCLUDE_DIRS")
+                    {
+                      for (int i = 1; i < words.size(); i++)
+                        {
+                          if(words[i].substr(0,2) == "${" || words[i].substr(0,2) == "..")
+                          properties["package " + this->name + " dir " + words[i]] = true;
+                        }
+                    }
+                  else if (words[0] == "${BBTK_PACKAGE_NAME}_LIBS")
+                    {
+                      for (int i = 1; i < words.size(); i++)
+                        {
+                          properties["package " + this->name + " lib " + words[i]] = true;
+                        }
+                    }
+                }
+            }
+        }
+
+    }
+}
index de1b0a9a6d855f1e98da4233a64ec7ef04a0fc45..471dbb35f6836e5d0f9e06a276d47375b8aeb813 100644 (file)
@@ -37,6 +37,7 @@
 
 #include<iostream>
 #include<vector>
+#include<map>
 
 #include"modelCDMFolder.h"
 #include"modelCDMPackageSrc.h"
@@ -73,6 +74,8 @@ public:
   );
   virtual const bool Refresh(std::string*& result);
 
+  void CheckStructure(std::map<std::string, bool>& properties);
+
 private:
   std::string namePackage;
   std::string authors;
index 501d059d9892e0bbc0742f8cfe82ccba3426263c..51f642a0b097068da7d779cccbb84a6e561620dc 100644 (file)
@@ -765,31 +765,166 @@ bool modelCDMProject::Build(std::string*& result, const std::string& line)
 bool modelCDMProject::Connect(std::string*& result)
 {
   //TODO: adjust for windows and mac
-  #ifdef _WIN32
-    // ------ Windows
-  #elif __APPLE__
-    // ------ Apple
-  #else
-    // ------ Linux
-    //open binary folder
-    wxDir dir(crea::std2wx((this->buildPath).c_str()));
-
-    //if binary folder can't be opened then return false
-    if (!dir.IsOpened())
-      {
-        result = new std::string("The build path could not be opened. Make sure to configure the project before compiling it");
-        return false;
-      }
-    //create plug command
-    std::string plugComm = "bbPlugPackage \"" + this->buildPath + "\" > \"" + this->buildPath + CDMUtilities::SLASH + "plugging.log\" 2>&1";
-    std::cout << "executing '" << plugComm << "'" << std::endl;
-    //execute plug command
-    if(system(plugComm.c_str()))
-      {
-        //if there was an error then report it
-        result = new std::string("There was an error plugging the packages of the project, please check the console to read more about the problem.");
-        return false;
-      }
-  #endif
-    return true;
+#ifdef _WIN32
+  // ------ Windows
+#elif __APPLE__
+  // ------ Apple
+#else
+  // ------ Linux
+  //open binary folder
+  wxDir dir(crea::std2wx((this->buildPath).c_str()));
+
+  //if binary folder can't be opened then return false
+  if (!dir.IsOpened())
+    {
+      result = new std::string("The build path could not be opened. Make sure to configure the project before compiling it");
+      return false;
+    }
+  //create plug command
+  std::string plugComm = "bbPlugPackage \"" + this->buildPath + "\" > \"" + this->buildPath + CDMUtilities::SLASH + "plugging.log\" 2>&1";
+  std::cout << "executing '" << plugComm << "'" << std::endl;
+  //execute plug command
+  if(system(plugComm.c_str()))
+    {
+      //if there was an error then report it
+      result = new std::string("There was an error plugging the packages of the project, please check the console to read more about the problem.");
+      return false;
+    }
+#endif
+  return true;
+}
+
+void modelCDMProject::CheckStructure(std::map<std::string, bool>& properties)
+{
+  //check cmake exist
+  if(this->CMakeLists != NULL)
+    {
+      //set properties parameters based on model
+      properties["project add appli"] = this->appli != NULL;
+      properties["project add lib"] = this->lib != NULL;
+      for (int i = 0; i < this->packages.size(); i++)
+        properties["project add " + packages[i]->GetName()] = false;
+
+      //open cmakelists
+      std::ifstream confFile;
+      confFile.open((this->CMakeLists->GetPath()).c_str());
+
+      //take everything that is not commented
+      std::string fileContent;
+
+      std::string word;
+      std::vector<std::string> words;
+      while(confFile.is_open() && !confFile.eof())
+        {
+          std::getline(confFile,word, '\n');
+          if(word[0] != '#')
+            {
+              CDMUtilities::splitter::split(words, word, "#", CDMUtilities::splitter::empties_ok);
+              if (words.size() > 0)
+                {
+                  word = words[0];
+                  CDMUtilities::splitter::split(words, word, " ", CDMUtilities::splitter::empties_ok);
+                  for (int i = 0; i < words.size(); i++)
+                    {
+                      if(words[i].substr(0,2) == "//")
+                        break;
+                      fileContent += words[i] + " ";
+                    }
+                }
+
+            }
+        }
+
+      //check every instruction
+      std::stringstream ss(fileContent);
+      while(!ss.eof())
+        {
+          std::getline(ss,word, '(');
+
+          //check instruction name
+          CDMUtilities::splitter::split(words, word, " ", CDMUtilities::splitter::no_empties);
+
+          //set instructions
+          if (words.size() > 0 && words[words.size()-1] == "SET")
+            {
+              std::getline(ss,word, ')');
+
+              CDMUtilities::splitter::split(words, word, " ", CDMUtilities::splitter::no_empties);
+              if (words.size() > 1)
+                {
+                  if (words[0] == "USE_CREA" && words[1] == "ON")
+                    {
+                      properties["project set USE_CREA"] = true;
+                    }
+                  else if (words[0] == "USE_GDCM" && words[1] == "ON")
+                    {
+                      properties["project set USE_GDCM"] = true;
+                    }
+                  else if (words[0] == "USE_GDCM_VTK" && words[1] == "ON")
+                    {
+                      properties["project set USE_GDCM_VTK"] = true;
+                    }
+                  else if (words[0] == "USE_GDCM2" && words[1] == "ON")
+                    {
+                      properties["project set USE_GDCM2"] = true;
+                    }
+                  else if (words[0] == "USE_WXWIDGETS" && words[1] == "ON")
+                    {
+                      properties["project set USE_WXWIDGETS"] = true;
+                    }
+                  else if (words[0] == "USE_KWWIDGETS" && words[1] == "ON")
+                    {
+                      properties["project set USE_KWWIDGETS"] = true;
+                    }
+                  else if (words[0] == "USE_VTK" && words[1] == "ON")
+                    {
+                      properties["project set USE_VTK"] = true;
+                    }
+                  else if (words[0] == "USE_ITK" && words[1] == "ON")
+                    {
+                      properties["project set USE_ITK"] = true;
+                    }
+                  else if (words[0] == "USE_BOOST" && words[1] == "ON")
+                    {
+                      properties["project set USE_BOOST"] = true;
+                    }
+                }
+            }
+          //add instructions
+          else if (words.size() > 0 && words[words.size()-1] == "ADD_SUBDIRECTORY")
+            {
+              std::getline(ss,word, ')');
+              //std::cout << word << std::endl;
+              CDMUtilities::splitter::split(words, word, " ", CDMUtilities::splitter::no_empties);
+
+              if (words.size() > 0)
+                {
+                  if(words[0] == "appli")
+                    {
+                      properties["project add "+words[0]] = this->appli != NULL;
+                    }
+                  else if(words[0] == "lib")
+                    {
+                      properties["project add "+words[0]] = this->lib != NULL;
+                    }
+                  else
+                    {
+                      properties["project add "+words[0]] = true;
+                    }
+                }
+            }
+        }
+
+    }
+
+  //check appli's structure
+  this->appli->CheckStructure(properties);
+  //check lib's structure
+  this->lib->CheckStructure(properties);
+  //check packages' structure
+  for (int i = 0; i < this->packages.size(); i++)
+    {
+      properties["package " + this->packages[i]->GetName()] = true;
+      this->packages[i]->CheckStructure(properties);
+    }
 }
index 87d1d3717a7f8db3b65df0f4f1938e7deea562a6..7e69c799fbcdd0000b252f4df7fc8c3b9a890852 100644 (file)
@@ -37,6 +37,7 @@
 
 #include<iostream>
 #include<vector>
+#include <map>
 
 #include "modelCDMFolder.h"
 #include "modelCDMLib.h"
@@ -68,11 +69,6 @@ public:
    */
   ~modelCDMProject();
 
-  /**
-   * Unimplemented.
-   */
-  void PopulateProject();
-
 
   //Getters
   /**
@@ -244,6 +240,12 @@ public:
    */
   bool Connect(std::string*& result);
 
+  /**
+   * Checks the CMakeLists files to see what's going to be compiled and what's not.
+   * @param properties Map containing the project compilation properties.
+   */
+  void CheckStructure(std::map<std::string, bool>& properties);
+
 
 private:
 
index 143d23977ce318ac20e1872eb64758304bbb624e..7f51fa05b728bbe1c0f990844f77f530d9fc9d26 100755 (executable)
 #include <iostream>
 
 #include <creaWx.h>
+#include "creaSystem.h"
 #include "wx/treectrl.h"
 #include "wx/treebase.h"
 #include "wx/tooltip.h"
+#include "wx/wxhtml.h"
+#include "wx/statline.h"
 #include "CDMUtilities.h"
 
 #include "creaDevManagerIds.h"
 BEGIN_EVENT_TABLE(wxCDMMainFrame, wxFrame)
 EVT_MENU(ID_MENU_NEW_PROJECT, wxCDMMainFrame::OnMenuNewProject)
 EVT_MENU(ID_MENU_OPEN_PROJECT, wxCDMMainFrame::OnMenuOpenProject)
-EVT_MENU(ID_MENU_OPEN_RECENT, wxCDMMainFrame::OnMenuOpenRecent)
 EVT_MENU(ID_MENU_CLOSE_PROJECT, wxCDMMainFrame::OnMenuCloseProject)
-EVT_MENU(ID_MENU_CLOSE_ALL_PROJECTS, wxCDMMainFrame::OnMenuCloseAllProjects)
 EVT_MENU(ID_MENU_EXPORT_HIERARCHY, wxCDMMainFrame::OnMenuExportHierarchy)
 EVT_MENU(ID_MENU_EXIT, wxCDMMainFrame::OnMenuExit)
 EVT_MENU(ID_MENU_REFRESH_PROJECT, wxCDMMainFrame::OnMenuRefreshProject)
-EVT_MENU(ID_MENU_CUT, wxCDMMainFrame::OnMenuMenuCut)
-EVT_MENU(ID_MENU_COPY, wxCDMMainFrame::OnMenuMenuCopy)
-EVT_MENU(ID_MENU_PASTE, wxCDMMainFrame::OnMenuMenuPaste)
-EVT_MENU(ID_MENU_DELETE, wxCDMMainFrame::OnMenuMenuDelete)
-EVT_MENU(ID_MENU_SELECT_ALL, wxCDMMainFrame::OnMenuSelectAll)
-EVT_MENU(ID_MENU_SELECT_NONE, wxCDMMainFrame::OnMenuSelectNone)
-EVT_MENU(ID_MENU_EVENT_LOG, wxCDMMainFrame::OnMenuEventLog)
 EVT_MENU(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxCDMMainFrame::OnMenuBBTKGraphicalEditor)
 EVT_MENU(ID_MENU_MINITOOLS, wxCDMMainFrame::OnMenuMiniTools)
 EVT_MENU(ID_MENU_CODE_EDITOR, wxCDMMainFrame::OnMenuCodeEditor)
@@ -160,10 +154,8 @@ void wxCDMMainFrame::CreateMenus()
   menu_File = new wxMenu();
   menu_File->Append(ID_MENU_NEW_PROJECT, wxT("&New Project..."));
   menu_File->Append(ID_MENU_OPEN_PROJECT, wxT("&Open Project..."));
-  menu_File->Append(ID_MENU_OPEN_RECENT, wxT("Open &Recent"));
   menu_File->AppendSeparator();
   menu_File->Append(ID_MENU_CLOSE_PROJECT, wxT("&Close Project"));
-  menu_File->Append(ID_MENU_CLOSE_ALL_PROJECTS, wxT("C&lose All Projects"));
   menu_File->AppendSeparator();
   menu_File->Append(ID_MENU_EXPORT_HIERARCHY, wxT("&Export Project Hierarchy..."));
   menu_File->AppendSeparator();
@@ -174,20 +166,11 @@ void wxCDMMainFrame::CreateMenus()
   //EditMenu
   menu_Edit = new wxMenu();
   menu_Edit->Append(ID_MENU_REFRESH_PROJECT, wxT("&Refresh Project"));
-  menu_Edit->AppendSeparator();
-  menu_Edit->Append(ID_MENU_CUT, wxT("Cu&t"));
-  menu_Edit->Append(ID_MENU_COPY, wxT("&Copy"));
-  menu_Edit->Append(ID_MENU_PASTE, wxT("&Paste"));
-  menu_Edit->AppendSeparator();
-  menu_Edit->Append(ID_MENU_DELETE, wxT("&Delete"));
-  menu_Edit->Append(ID_MENU_SELECT_ALL, wxT("Select &All"));
-  menu_Edit->Append(ID_MENU_SELECT_NONE, wxT("Ca&ncel Selection"));
 
   menuBar->Append(menu_Edit, wxT("&Edit"));
 
   //ToolsMenu
   menu_Tools = new wxMenu();
-  menu_Tools->Append(ID_MENU_EVENT_LOG, wxT("Event &Log"));
   menu_Tools->Append(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxT("BBTK &Graphical Editor"));
   menu_Tools->Append(ID_MENU_MINITOOLS, wxT("&MiniTools"));
   menu_Tools->Append(ID_MENU_CODE_EDITOR, wxT("&Code Editor"));
@@ -368,13 +351,13 @@ void wxCDMMainFrame::OnMenuOpenProject(wxCommandEvent& event)
 
       std::cout << "building ui" << std::endl;
 
-
       //populate tree control
       tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
       tree_Projects->SelectItem(this->model->GetProject()->GetId(), false);
       tree_Projects->SelectItem(this->model->GetProject()->GetId(), true);
 
 
+
       //change project's actions panel
       if(this->panel_ProjectActions!= NULL)
         {
@@ -398,16 +381,11 @@ void wxCDMMainFrame::OnMenuOpenProject(wxCommandEvent& event)
 
       auiManager.Update();
 
-
     }
 
   event.Skip();
 }
-void wxCDMMainFrame::OnMenuOpenRecent(wxCommandEvent& event)
-{
-  std::cerr << "Event OnMenuOpenRecent not implemented" << std::endl;
-  event.Skip();
-}
+
 void wxCDMMainFrame::OnMenuCloseProject(wxCommandEvent& event)
 {
   std::cout << "closing project" << std::endl;
@@ -447,44 +425,7 @@ void wxCDMMainFrame::OnMenuCloseProject(wxCommandEvent& event)
   auiManager.Update();
   event.Skip();
 }
-void wxCDMMainFrame::OnMenuCloseAllProjects(wxCommandEvent& event)
-{
-  std::cerr << "Event OnMenuCloseAllProjects closing only one project" << std::endl;
-  std::string* result;
-  if(!this->model->CloseProject(result))
-    {
-      std::cout << "error closing project: " << *result << std::endl;
-      wxMessageBox( crea::std2wx(result->c_str()), wxT("Close Project - Error"), wxICON_ERROR);
-    }
-  tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
-
-  if(this->panel_Properties != NULL)
-    {
-      auiManager.DetachPane(this->panel_Properties);
-      this->panel_Properties->Destroy();
-      this->panel_Properties = NULL;
-    }
-  if(this->panel_ProjectActions != NULL)
-    {
-      auiManager.DetachPane(this->panel_ProjectActions);
-      this->panel_ProjectActions->Destroy();
-      this->panel_ProjectActions = NULL;
-    }
-
-  this->panel_Properties = new wxCDMMainDescriptionPanel(
-      this,
-      ID_WINDOW_PROPERTIES,
-      wxT("Description Panel"),
-      wxDefaultPosition,
-      wxSize(600, 400),
-      0
-  );
-
-  auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400));
 
-  auiManager.Update();
-  event.Skip();
-}
 void wxCDMMainFrame::OnMenuExportHierarchy(wxCommandEvent& event)
 {
   std::cerr << "Event OnMenuExportHierarchy not implemented" << std::endl;
@@ -527,53 +468,17 @@ void wxCDMMainFrame::OnMenuRefreshProject(wxCommandEvent& event)
     {
       wxMessageBox( crea::std2wx(result->c_str()), wxT("Refresh Project - Error"), wxICON_ERROR);
     }
-  this->tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
-
-  this->auiManager.Update();
-
-  this->tree_Projects->SelectItem(this->model->GetProject()->GetId(), false);
-  this->tree_Projects->SelectItem(this->model->GetProject()->GetId(), true);
+  if(this->model->GetProject() != NULL)
+    {
+      this->tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
+      this->auiManager.Update();
 
-  //TODO: Show possible problems in CMakeLists files
-  event.Skip();
-}
-void wxCDMMainFrame::OnMenuMenuCut(wxCommandEvent& event)
-{
-  std::cerr << "Event OnMenuMenuCut not implemented" << std::endl;
-  event.Skip();
-}
-void wxCDMMainFrame::OnMenuMenuCopy(wxCommandEvent& event)
-{
-  std::cerr << "Event OnMenuMenuCopy not implemented" << std::endl;
-  event.Skip();
-}
-void wxCDMMainFrame::OnMenuMenuPaste(wxCommandEvent& event)
-{
-  std::cerr << "Event OnMenuMenuPaste not implemented" << std::endl;
-  event.Skip();
-}
-void wxCDMMainFrame::OnMenuMenuDelete(wxCommandEvent& event)
-{
-  std::cerr << "Event OnMenuMenuDelete not implemented" << std::endl;
-  event.Skip();
-}
-void wxCDMMainFrame::OnMenuSelectAll(wxCommandEvent& event)
-{
-  std::cerr << "Event OnMenuSelectAll not implemented" << std::endl;
-  event.Skip();
-}
-void wxCDMMainFrame::OnMenuSelectNone(wxCommandEvent& event)
-{
-  std::cerr << "Event OnMenuSelectNone not implemented" << std::endl;
+      this->tree_Projects->SelectItem(this->model->GetProject()->GetId(), false);
+      this->tree_Projects->SelectItem(this->model->GetProject()->GetId(), true);
+    }
   event.Skip();
 }
 
-//Tools Menu
-void wxCDMMainFrame::OnMenuEventLog(wxCommandEvent& event)
-{
-  std::cerr << "Event OnMenuEventLog not implemented" << std::endl;
-  event.Skip();
-}
 void wxCDMMainFrame::OnMenuBBTKGraphicalEditor(wxCommandEvent& event)
 {
   std::cerr << "Event OnMenuBBTKGraphicalEditor not implemented" << std::endl;
@@ -608,23 +513,45 @@ void wxCDMMainFrame::OnMenuCommandLine(wxCommandEvent& event)
 //Help Menu
 void wxCDMMainFrame::OnMenuHelp(wxCommandEvent& event)
 {
-  std::cerr << "Event OnMenuHelp not implemented" << std::endl;
-  event.Skip();
+  wxLaunchDefaultBrowser(_T("http://www.creatis.insa-lyon.fr/site/en/CreatoolsDocumentation"), 0);
 }
 void wxCDMMainFrame::OnMenuReportBug(wxCommandEvent& event)
 {
-  std::cerr << "Event OnMenuReportBug not implemented" << std::endl;
-  event.Skip();
+  wxLaunchDefaultBrowser(_T("http://vip.creatis.insa-lyon.fr:9002/projects/crea"), 0);
 }
 void wxCDMMainFrame::OnMenuAboutCreaDevManager(wxCommandEvent& event)
 {
-  std::cerr << "Event OnMenuAboutCreaDevManager not implemented" << std::endl;
-  event.Skip();
+  wxBoxSizer *topsizer;
+  wxHtmlWindow *html;
+  wxDialog dlg(this, wxID_ANY, wxString(_("About")));
+
+  topsizer = new wxBoxSizer(wxVERTICAL);
+
+  html = new wxHtmlWindow(&dlg, wxID_ANY, wxDefaultPosition, wxSize(380, 160), wxHW_SCROLLBAR_NEVER);
+  html -> SetBorders(0);
+  html -> LoadPage(wxT("about.html"));
+  html -> SetSize(html -> GetInternalRepresentation() -> GetWidth(),
+      html -> GetInternalRepresentation() -> GetHeight());
+
+  topsizer -> Add(html, 1, wxALL, 10);
+
+#if wxUSE_STATLINE
+  topsizer -> Add(new wxStaticLine(&dlg, wxID_ANY), 0, wxEXPAND | wxLEFT | wxRIGHT, 10);
+#endif // wxUSE_STATLINE
+
+  wxButton *bu1 = new wxButton(&dlg, wxID_OK, _("OK"));
+  bu1 -> SetDefault();
+
+  topsizer -> Add(bu1, 0, wxALL | wxALIGN_RIGHT, 15);
+
+  dlg.SetSizer(topsizer);
+  topsizer -> Fit(&dlg);
+
+  dlg.ShowModal();
 }
 void wxCDMMainFrame::OnMenuAboutCreatis(wxCommandEvent& event)
 {
-  std::cerr << "Event OnMenuAboutCreatis not implemented" << std::endl;
-  event.Skip();
+  wxLaunchDefaultBrowser(_T("http://www.creatis.insa-lyon.fr/site/en"), 0);
 }
 
 void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event)
index 64a316f6b6274e440d9bfb67381c0f477888af52..11aa60439ea0751914411875434d340b85a712a0 100755 (executable)
@@ -95,23 +95,14 @@ protected:
   //File
   void OnMenuNewProject(wxCommandEvent& event);
   void OnMenuOpenProject(wxCommandEvent& event);
-  void OnMenuOpenRecent(wxCommandEvent& event);
   void OnMenuCloseProject(wxCommandEvent& event);
-  void OnMenuCloseAllProjects(wxCommandEvent& event);
   void OnMenuExportHierarchy(wxCommandEvent& event);
   void OnMenuExit(wxCommandEvent& event);
 
   //Edit
   void OnMenuRefreshProject(wxCommandEvent& event);
-  void OnMenuMenuCut(wxCommandEvent& event);
-  void OnMenuMenuCopy(wxCommandEvent& event);
-  void OnMenuMenuPaste(wxCommandEvent& event);
-  void OnMenuMenuDelete(wxCommandEvent& event);
-  void OnMenuSelectAll(wxCommandEvent& event);
-  void OnMenuSelectNone(wxCommandEvent& event);
 
   //Tools
-  void OnMenuEventLog(wxCommandEvent& event);
   void OnMenuBBTKGraphicalEditor(wxCommandEvent& event);
   void OnMenuMiniTools(wxCommandEvent& event);
   void OnMenuCodeEditor(wxCommandEvent& event);
index 2d89a2df0f05e76a7fa4dbccbcbc89033138cf1e..30326590cdc0a764d84c1e217ccce019a927b6f7 100755 (executable)
 
 #include "creaDevManagerIds.h"
 
+#include <map>
+#include "wxCDMProjectStructureReportDialog.h"
+
 BEGIN_EVENT_TABLE(wxCDMProjectActionsPanel, wxPanel)
+EVT_BUTTON(ID_BUTTON_CHECK_PROJECT, wxCDMProjectActionsPanel::OnBtnCheckProjectStructure)
 EVT_BUTTON(ID_BUTTON_BUILD_PROJECT, wxCDMProjectActionsPanel::OnBtnBuildProject)
 EVT_BUTTON(ID_BUTTON_CONFIGURE_BUILD, wxCDMProjectActionsPanel::OnBtnConfigureBuild)
 EVT_BUTTON(ID_BUTTON_CONNECT_PROJECT, wxCDMProjectActionsPanel::OnBtnConnectProject)
@@ -81,17 +85,30 @@ bool wxCDMProjectActionsPanel::Create(
 
 void wxCDMProjectActionsPanel::CreateControls()
 {
-  wxButton* configurebt = new wxButton(this, ID_BUTTON_CONFIGURE_BUILD, _T("1. Configure Project (CMake)"));
-  configurebt->SetToolTip(wxT("This is the first step in order to execute the project. Make sure you have selected the desired Build location."));
-  wxButton* compilebt = new wxButton(this, ID_BUTTON_BUILD_PROJECT, _T("2. Compile Project"));
+  wxButton* checkStructbt = new wxButton(this, ID_BUTTON_CHECK_PROJECT, _T("1. Check Project Structure"));
+  checkStructbt->SetToolTip(wxT("This step checks the project structure and tells what is going to be compiled."));
+  wxButton* configurebt = new wxButton(this, ID_BUTTON_CONFIGURE_BUILD, _T("2. Configure Project (CMake)"));
+  configurebt->SetToolTip(wxT("This is the second step in order to execute the project. Make sure you have selected the desired Build location."));
+  wxButton* compilebt = new wxButton(this, ID_BUTTON_BUILD_PROJECT, _T("3. Compile Project"));
   compilebt->SetToolTip(wxT("This step should be done after configuring the project. This will create the executables."));
-  wxButton* plugbt = new wxButton(this, ID_BUTTON_CONNECT_PROJECT, _T("3. Plug Packages (BBTK)"));
+  wxButton* plugbt = new wxButton(this, ID_BUTTON_CONNECT_PROJECT, _T("4. Plug Packages (BBTK)"));
   plugbt->SetToolTip(wxT("This step should be done after compiling the project. This will allow to use the boxes in this project to be available in the bbEditor."));
+  this->GetSizer()->Add(checkStructbt, 0, wxALL, 5);
   this->GetSizer()->Add(configurebt, 0, wxALL, 5);
   this->GetSizer()->Add(compilebt, 0, wxALL, 5);
   this->GetSizer()->Add(plugbt, 0, wxALL, 5);
 }
 
+//check project structure
+void wxCDMProjectActionsPanel::OnBtnCheckProjectStructure(wxCommandEvent& event)
+{
+  std::map<std::string, bool> prjStruct;
+  this->project->CheckStructure(prjStruct);
+  std::cout << prjStruct.size() << std::endl;
+  wxCDMProjectStructureReportDialog* structure = new wxCDMProjectStructureReportDialog(this->GetParent(), prjStruct, wxID_ANY);
+  structure->Show(true);
+}
+
 //configure project
 void wxCDMProjectActionsPanel::OnBtnConfigureBuild(wxCommandEvent& event)
 {
index d01e9e5c0c0f1dd18452f3fae97a1f94c6d273b4..dc98709501961ba7ee3756231e0c19835c967141 100755 (executable)
@@ -67,6 +67,7 @@ public:
 protected:
   void CreateControls();
 
+  void OnBtnCheckProjectStructure(wxCommandEvent& event);
   void OnBtnConfigureBuild(wxCommandEvent& event);
   void OnBtnBuildProject(wxCommandEvent& event);
   void OnBtnConnectProject(wxCommandEvent& event);
diff --git a/lib/creaDevManagerLib/wxCDMProjectStructureReportDialog.cpp b/lib/creaDevManagerLib/wxCDMProjectStructureReportDialog.cpp
new file mode 100644 (file)
index 0000000..8c5ff80
--- /dev/null
@@ -0,0 +1,558 @@
+/*
+# ---------------------------------------------------------------------
+#
+# 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.
+# ------------------------------------------------------------------------ 
+ */
+
+
+/*
+ * wxCDMProjectStructureReportDialog.cpp
+ *
+ *  Created on: 17/1/2013
+ *      Author: Daniel Felipe Gonzalez Obando
+ */
+
+#include "wxCDMProjectStructureReportDialog.h"
+
+#include "creaDevManagerIds.h"
+
+#include <wx/html/htmlwin.h>
+#include <vector>
+#include "CDMUtilities.h"
+
+BEGIN_EVENT_TABLE(wxCDMProjectStructureReportDialog, wxDialog)
+EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMProjectStructureReportDialog::OnFinish)
+END_EVENT_TABLE()
+
+wxCDMProjectStructureReportDialog::wxCDMProjectStructureReportDialog(
+    wxWindow* parent,
+    const std::map<std::string, bool>& properties,
+    wxWindowID id,
+    const wxString& caption,
+    const wxPoint& position,
+    const wxSize& size,
+    long style
+)
+{
+  this->properties = properties;
+  wxCDMProjectStructureReportDialog::Create(parent, id, caption, position, size, style);
+}
+
+wxCDMProjectStructureReportDialog::~wxCDMProjectStructureReportDialog()
+{
+}
+
+bool wxCDMProjectStructureReportDialog::Create(
+    wxWindow* parent,
+    wxWindowID id,
+    const wxString& caption,
+    const wxPoint& position,
+    const wxSize& size,
+    long int style
+)
+{
+  wxDialog::Create(parent, id, caption, position, size, style);
+
+  this->CreateControls();
+
+  return TRUE;
+}
+
+void wxCDMProjectStructureReportDialog::CreateControls()
+{
+
+  wxBoxSizer* v_sizer1 = new wxBoxSizer(wxVERTICAL);
+
+  wxHtmlWindow* htmlWindow = new wxHtmlWindow(this, wxID_ANY);
+  htmlWindow->SetPage(this->GetContent());
+  v_sizer1->Add(htmlWindow, 1, wxEXPAND);
+  v_sizer1->Add(new wxButton(this, ID_BUTTON_CANCEL, wxT("Close")),0,wxEXPAND);
+
+  SetSizer(v_sizer1);
+}
+
+void wxCDMProjectStructureReportDialog::OnFinish(wxCommandEvent& event)
+{
+  this->EndDialog(wxID_CANCEL);
+}
+
+wxString wxCDMProjectStructureReportDialog::GetContent()
+{
+  std::map<std::string, bool>::iterator it, it2;
+  std::map<std::string, bool> pkgs;
+  std::map<std::string, bool> libs;
+  std::map<std::string, bool> applis;
+  for (it = this->properties.begin(); it != this->properties.end(); it++)
+    {
+      std::cout << it->first << " " << it->second << std::endl;
+      if(it->first.substr(0,7) == "package")
+        {
+          std::vector<std::string> words;
+          CDMUtilities::splitter::split(words, it->first, " ", CDMUtilities::splitter::no_empties);
+          pkgs[words[1]] = true;
+        }
+      else if(it->first.substr(0,7) == "library")
+        {
+          std::vector<std::string> words;
+          CDMUtilities::splitter::split(words, it->first, " ", CDMUtilities::splitter::no_empties);
+          libs[words[1]] = true;
+        }
+      else if(it->first.substr(0,11) == "application")
+        {
+          std::vector<std::string> words;
+          CDMUtilities::splitter::split(words, it->first, " ", CDMUtilities::splitter::no_empties);
+          applis[words[1]] = true;
+        }
+    }
+  std::string report = "";
+  report +=
+      "<html>"
+      "<head>"
+      "  <title>Project Structure Check Report</title>"
+      "</head>"
+      "<body>"
+      "  <h1>Project Structure Check Report</h1>"
+      "  <div id=\"projectChk\">"
+      "    <h3>Project CMakeLists.txt</h3>"
+      "    <p>"
+      "      Includes the following built-in libraries:"
+      "      <font color=\"#00CC00\"><ul>";
+  if(this->properties["project set USE_CREA"])
+    report +=
+        "        <li>Crea</li>";
+  if(this->properties["project set USE_GDCM"])
+    report +=
+        "        <li>GDCM</li>";
+  if(this->properties["project set USE_GDCM_VTK"])
+    report +=
+        "        <li>GDCM_VTK</li>";
+  if(this->properties["project set USE_GDCM2"])
+    report +=
+        "        <li>GDCM2</li>";
+  if(this->properties["project set USE_WXWIDGETS"])
+    report +=
+        "        <li>wxWidgets</li>";
+  if(this->properties["project set USE_KWWIDGETS"])
+    report +=
+        "        <li>kwWidgets</li>";
+  if(this->properties["project set USE_VTK"])
+    report +=
+        "        <li>VTK</li>";
+  if(this->properties["project set USE_ITK"])
+    report +=
+        "        <li>ITK</li>";
+  if(this->properties["project set USE_BOOST"])
+    report +=
+        "        <li>Boost</li>";
+  report+=
+      "      </ul></font>"
+      "    </p>"
+      "    <p>"
+      "      Doesn't include the following built-in libraries:"
+      "      <font color=\"#AAAA00\"><ul>";
+  if(!this->properties["project set USE_CREA"])
+    report +=
+        "        <li>Crea</li>";
+  if(!this->properties["project set USE_GDCM"])
+    report +=
+        "        <li>GDCM</li>";
+  if(!this->properties["project set USE_GDCM_VTK"])
+    report +=
+        "        <li>GDCM_VTK</li>";
+  if(!this->properties["project set USE_GDCM2"])
+    report +=
+        "        <li>GDCM2</li>";
+  if(!this->properties["project set USE_WXWIDGETS"])
+    report +=
+        "        <li>wxWidgets</li>";
+  if(!this->properties["project set USE_KWWIDGETS"])
+    report +=
+        "        <li>kwWidgets</li>";
+  if(!this->properties["project set USE_VTK"])
+    report +=
+        "        <li>VTK</li>";
+  if(!this->properties["project set USE_ITK"])
+    report +=
+        "        <li>ITK</li>";
+  if(!this->properties["project set USE_BOOST"])
+    report +=
+        "        <li>Boost</li>";
+  report+=
+      "      </ul></font>"
+      "    </p>"
+      "    <p>"
+      "      Includes:"
+      "      <font color=\"#00CC00\"><ul>";
+  if(this->properties["project add lib"])
+    report +=
+        "        <li>Lib</li>";
+  if(this->properties["project add appli"])
+    report +=
+        "        <li>Appli</li>";
+  for (it = this->properties.begin(); it != this->properties.end(); it++)
+    {
+      if(it->second == true && it->first.substr(0,11) == "project add")
+        {
+          std::string namePkg = it->first.substr(12);
+          if (namePkg.substr(0,4) == "bbtk")
+            report +=
+                "        <li>Package " + namePkg + "</li>";
+        }
+    }
+  report+=
+      "      </ul></font>"
+      "    </p>"
+      "    <p>Doesn't include:"
+      "      <font color=\"#FF0000\"><ul>";
+  if(!this->properties["project add lib"])
+    report +=
+        "        <li >"
+        "          Lib: use"
+        "          <blockquote>ADD_SUBDIRECTORY(lib)</blockquote>"
+        "          in the project CMakeLists file."
+        "        </li>";
+  if(!this->properties["project add appli"])
+    report +=
+        "        <li>"
+        "          Appli: use"
+        "          <blockquote>ADD_SUBDIRECTORY(appli)</blockquote>"
+        "          in the project CMakeLists file."
+        "        </li>";
+  for (it = this->properties.begin(); it != this->properties.end(); it++)
+    {
+      if(it->second == false && it->first.substr(0,11) == "project add")
+        {
+          std::string namePkg = it->first.substr(12);
+          report +=
+              "        <li>"
+              "          Package \"" + namePkg + "\": use"
+              "          <blockquote>ADD_SUBDIRECTORY(" + namePkg + ")</blockquote>"
+              "          in the project CMakeLists file."
+              "        </li>";
+        }
+    }
+  report+=
+      "      </ul></font>"
+      "    </p>"
+      "  </div>";
+
+  for (it = pkgs.begin(); it != pkgs.end(); it++)
+    {
+      report +=
+          "  <div id=\"package" + it->first + "Chk\">"
+          "    <h3>Package " + it->first + " CMakeLists.txt</h3>"
+          "    <p>"
+          "      Includes the following built-in libraries:"
+          "      <font color=\"#00CC00\"><ul>";
+      if(this->properties["package " + it->first + " set USE_VTK"])
+        report +=
+            "        <li>VTK</li>";
+      if(this->properties["package " + it->first + " set USE_ITK"])
+        report +=
+            "        <li>ITK</li>";
+      if(this->properties["package " + it->first + " set USE_GDCM"])
+        report +=
+            "        <li>GDCM</li>";
+      if(this->properties["package " + it->first + " set USE_GDC_VTK"])
+        report +=
+            "        <li>GDCM_VTK</li>";
+      if(this->properties["package " + it->first + " set USE_GSMIS"])
+        report +=
+            "        <li>GSMIS</li>";
+      if(this->properties["package " + it->first + " set USE_WXWIDGETS"])
+        report +=
+            "        <li>wxWidgets</li>";
+      if(this->properties["package " + it->first + " set USE_KWWIDGETS"])
+        report +=
+            "        <li>kwWidgets</li>";
+      report +=
+          "      </ul></font>"
+          "    </p>"
+          "    <p>"
+          "      Doesn't include the following built-in libraries:"
+          "      <font color=\"#AAAA00\"><ul>";
+      if(!this->properties["package " + it->first + " set USE_VTK"])
+        report +=
+            "        <li>VTK</li>";
+      if(!this->properties["package " + it->first + " set USE_ITK"])
+        report +=
+            "        <li>ITK</li>";
+      if(!this->properties["package " + it->first + " set USE_GDCM"])
+        report +=
+            "        <li>GDCM</li>";
+      if(!this->properties["package " + it->first + " set USE_GDC_VTK"])
+        report +=
+            "        <li>GDCM_VTK</li>";
+      if(!this->properties["package " + it->first + " set USE_GSMIS"])
+        report +=
+            "        <li>GSMIS</li>";
+      if(!this->properties["package " + it->first + " set USE_WXWIDGETS"])
+        report +=
+            "        <li>wxWidgets</li>";
+      if(!this->properties["package " + it->first + " set USE_KWWIDGETS"])
+        report +=
+            "        <li>kwWidgets</li>";
+      report +=
+          "      </ul></font>"
+          "    </p>"
+          "    <p>"
+          "      Includes the following additional directories:"
+          "      <font color=\"#00CC00\"><ul>";
+      for (it2 = this->properties.begin(); it2 != this->properties.end(); it2++)
+        {
+          std::string pkgname = "package " + it->first + " dir";
+          if(it2->first.substr(0,pkgname.size()) == pkgname)
+            {
+              std::string directoryName = it2->first.substr(pkgname.size()+1);
+              report +=
+                  "        <li>" + directoryName + "</li>";
+            }
+        }
+      report +=
+          "      </ul></font>"
+          "    </p>"
+          "    <p>"
+          "      Includes the following libraries:"
+          "      <font color=\"#00CC00\"><ul>";
+      for (it2 = this->properties.begin(); it2 != this->properties.end(); it2++)
+        {
+          std::string pkgname = "package " + it->first + " lib";
+          if(it2->first.substr(0,pkgname.size()) == pkgname)
+            {
+              std::string libraryName = it2->first.substr(pkgname.size()+1);
+              report +=
+                  "        <li>" + libraryName + "</li>";
+            }
+        }
+      report +=
+          "      </ul></font>"
+          "    </p>"
+          "    <p>"
+          "      <strong>Note:</strong><br>"
+          "      Please include the following lines in the package CMakeLists file in order to add a library:<br>"
+          "          - In section <strong>SET(${BBTK_PACKAGE_NAME}_INCLUDE_DIRS</strong> use:"
+          "          <blockquote>"
+          "            ../lib/[libraryFolderName]"
+          "          </blockquote>"
+          "          - In section <strong>SET(${BBTK_PACKAGE_NAME}_LIBS</strong> use:"
+          "          <blockquote>"
+          "            [libraryName]"
+          "          </blockquote>"
+          "    </p>"
+          "  </div>";
+    }
+  report +=
+      "  <div id=\"libChk\">"
+      "    <h3>Lib CMakeLists.txt</h3>"
+      "    <p>"
+      "      Includes libraries:"
+      "      <font color=\"#00CC00\"><ul>";
+  for (it = this->properties.begin(); it != this->properties.end(); it++)
+    {
+      if(it->second == true && it->first.substr(0, 7) == "lib add")
+        {
+          std::string nameLib = it->first.substr(8);
+          report +=
+              "        <li>" + nameLib + "</li>";
+        }
+    }
+  report +=
+      "      </ul></font>"
+      "    </p>"
+      "    <p>Doesn't include libraries:"
+      "      <font color=\"#FF0000\"><ul>";
+  for (it = this->properties.begin(); it != this->properties.end(); it++)
+    {
+      if(it->second == false && it->first.substr(0, 7) == "lib add")
+        {
+          std::string nameLib = it->first.substr(8);
+          report +=
+              "        <li>" + nameLib + "</li>";
+        }
+    }
+  report +=
+      "      </ul></font>"
+      "    </p>"
+      "    <p>"
+      "      <strong>Note:</strong><br>"
+      "      Please include the following lines in the lib CMakeLists file in order to add a library:"
+      "          <blockquote>ADD_SUBDIRECTORY([libraryName])</blockquote>"
+      "    </p>"
+      "  </div>";
+  for (it = libs.begin(); it != libs.end(); it++)
+    {
+      report +=
+          "  <div id=\"library" + it->first + "Chk\">"
+          "    <h3>Library " + it->first + " CMakeLists.txt</h3>"
+          "    <p>"
+          "      Includes the following libraries:"
+          "      <font color=\"#00CC00\"><ul>";
+      for (it2 = this->properties.begin(); it2 != this->properties.end(); it2++)
+        {
+          std::string libname = "library " + it->first + " lib";
+          if(it2->second == true && it2->first.substr(0,libname.size()) == libname)
+            {
+              std::string libraryName = it2->first.substr(libname.size()+1);
+              report +=
+                  "        <li>" + libraryName + "</li>";
+            }
+        }
+      report +=
+          "      </ul></font>"
+          "    </p>"
+          "    <p>"
+          "      Doesn't include the following libraries:"
+          "      <font color=\"#AAAA00\"><ul>";
+      for (it2 = this->properties.begin(); it2 != this->properties.end(); it2++)
+        {
+          std::string libname = "library " + it->first + " lib";
+          if(it2->second == false && it2->first.substr(0,libname.size()) == libname)
+            {
+              std::string libraryName = it2->first.substr(libname.size()+1);
+              report +=
+                  "        <li>" + libraryName + "</li>";
+            }
+        }
+      report +=
+          "      </ul></font>"
+          "    </p>"
+          "    <p>"
+          "      <strong>Note:</strong><br>"
+          "      Please include the following line in the library CMakeLists file in order to add a library:"
+          "          <blockquote>[libraryName]</blockquote>"
+          "      on <strong>SET ( ${LIBRARY_NAME}_LINK_LIBRARIES</strong> section if needed."
+          "    </p>"
+          "  </div>";
+    }
+  report +=
+      "  <div id=\"appliChk\">"
+      "    <h3>Appli CMakeLists.txt</h3>"
+      "    <p>"
+      "      Includes applications:"
+      "      <font color=\"#00CC00\"><ul>";
+  for (it = this->properties.begin(); it != this->properties.end(); it++)
+    {
+      if(it->second == true && it->first.substr(0, 9) == "appli add")
+        {
+          std::string nameAppli = it->first.substr(10);
+          report +=
+              "        <li>" + nameAppli + "</li>";
+        }
+    }
+  report +=
+      "      </ul></font>"
+      "    </p>"
+      "    <p>Doesn't include applications:"
+      "      <font color=\"#FF0000\"><ul>";
+  for (it = this->properties.begin(); it != this->properties.end(); it++)
+    {
+      if(it->second == false && it->first.substr(0, 9) == "appli add")
+        {
+          std::string nameAppli = it->first.substr(10);
+          report +=
+              "        <li>" + nameAppli + "</li>";
+        }
+    }
+  report +=
+      "      </ul></font>"
+      "    </p>"
+      "    <p>"
+      "      <strong>Note:</strong><br>"
+      "      Please include the following lines in the appli CMakeLists file in order to add an application:"
+      "          <blockquote>ADD_SUBDIRECTORY([applicationName])</blockquote>"
+      "    </p>"
+      "  </div>";
+  for (it = applis.begin(); it != applis.end(); it++)
+    {
+      report +=
+          "  <div id=\"application" + it->first + "Chk\">"
+          "    <h3>Application " + it->first + " CMakeLists.txt</h3>"
+          "    <p>"
+          "      Includes the following libraries:"
+          "      <font color=\"#00CC00\"><ul>";
+      for (it2 = this->properties.begin(); it2 != this->properties.end(); it2++)
+        {
+          std::string appliname = "application " + it->first + " dir";
+          if(it2->second && it2->first.substr(0,appliname.size()) == appliname)
+            {
+              std::string directoryName = it2->first.substr(appliname.size()+1);
+              report +=
+                  "        <li>" + directoryName + "</li>";
+            }
+        }
+      report +=
+          "      </ul></font>"
+          "    </p>"
+          "    <p>"
+          "      Includes the following libraries:"
+          "      <font color=\"#00CC00\"><ul>";
+      for (it2 = this->properties.begin(); it2 != this->properties.end(); it2++)
+        {
+          std::string appliname = "application " + it->first + " lib";
+          if(it2->second && it2->first.substr(0,appliname.size()) == appliname)
+            {
+              std::string libraryName = it2->first.substr(appliname.size()+1);
+              report +=
+                  "        <li>" + libraryName + "</li>";
+            }
+        }
+      report +=
+          "      </ul></font>"
+          "    </p>"
+          "    <p>"
+          "      Doesn't include the following libraries:"
+          "      <font color=\"#AAAA00\"><ul>";
+      for (it2 = this->properties.begin(); it2 != this->properties.end(); it2++)
+        {
+          std::string appliname = "application " + it->first + " lib";
+          if(it2->second == false && it2->first.substr(0,appliname.size()) == appliname)
+            {
+              std::string libraryName = it2->first.substr(appliname.size()+1);
+              report +=
+                  "        <li>" + libraryName + "</li>";
+            }
+        }
+      report +=
+          "      </ul></font>"
+          "    </p>"
+          "    <p>"
+          "      <strong>Note:</strong><br>"
+          "      Please include the following lines in the application CMakeLists file in order to add a library:<br>"
+          "          - In section <strong>INCLUDE_DIRECTORIES(</strong> use:"
+          "          <blockquote>"
+          "            ../lib/[libraryFolderName]"
+          "          </blockquote>"
+          "          - In section <strong>SET(${EXE_NAME}_LINK_LIBRARIES</strong> use:"
+          "          <blockquote>"
+          "            [libraryName]"
+          "          </blockquote>"
+          "    </p>"
+          "  </div>";
+    }
+  report +=
+      "</body>"
+      "</html>"
+      ;
+  return crea::std2wx(report);
+}
diff --git a/lib/creaDevManagerLib/wxCDMProjectStructureReportDialog.h b/lib/creaDevManagerLib/wxCDMProjectStructureReportDialog.h
new file mode 100644 (file)
index 0000000..1536e09
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+# ---------------------------------------------------------------------
+#
+# 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.
+# ------------------------------------------------------------------------ 
+*/ 
+
+
+/*
+ * wxCDMProjectStructureReportDialog.h
+ *
+ *  Created on: 3/1/2013
+ *      Author: Daniel Felipe Gonzalez Obando
+ */
+
+#ifndef WXCDMPROJECTSTRUCTUREREPORTDIALOG_H_
+#define WXCDMPROJECTSTRUCTUREREPORTDIALOG_H_
+
+#include <creaWx.h>
+#include <wx/dialog.h>
+
+#include <map>
+
+class wxCDMProjectStructureReportDialog : public wxDialog
+{
+  DECLARE_EVENT_TABLE()
+public:
+  wxCDMProjectStructureReportDialog(
+      wxWindow* parent,
+      const std::map<std::string, bool>& properties,
+      wxWindowID id = wxID_ANY,
+      const wxString& caption = wxT("Project Structure Report"),
+      const wxPoint& position = wxDefaultPosition,
+      const wxSize& size = wxSize(700,500),
+      long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER
+  );
+  ~wxCDMProjectStructureReportDialog();
+  bool Create(
+      wxWindow* parent,
+      wxWindowID id = wxID_ANY,
+      const wxString& caption = wxT("Project Structure Report"),
+      const wxPoint& position = wxDefaultPosition,
+      const wxSize& size = wxSize(700,500),
+      long style = wxDEFAULT_DIALOG_STYLE
+  );
+
+protected:
+  void CreateControls();
+
+//attributes
+private:
+  std::map<std::string, bool> properties;
+
+//handlers
+protected:
+  void OnFinish(wxCommandEvent& event);
+  wxString GetContent();
+};
+
+#endif /* WXCDMPROJECTSTRUCTUREREPORTDIALOG_H_ */