# ---------------------------------------------------------------------
#
# 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
# ---------------------------------------------------------------------
#
# 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
#-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
+ )
--- /dev/null
+<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á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>
# ---------------------------------------------------------------------
#
# 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
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)
#define ID_CHECKBOX_DISABLE_HELP 10335
#define ID_CHECKBOX_TOGGLE_HELP 10335
+#define ID_BUTTON_CHECK_PROJECT 10336
+
#endif /* CREADEVMANAGERIDS_H_ */
#include <iostream>
#include <fstream>
+#include <sstream>
#include <algorithm>
#include "CDMUtilities.h"
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);
+ }
+}
#include<iostream>
#include<vector>
+#include<map>
#include"modelCDMFolder.h"
#include"modelCDMApplication.h"
);
virtual const bool Refresh(std::string*& result);
+ void CheckStructure(std::map<std::string, bool>& properties);
+
private:
std::vector<modelCDMApplication*> applications;
};
#include "modelCDMApplication.h"
#include <fstream>
+#include <sstream>
#include <algorithm>
#include "CDMUtilities.h"
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;
+ }
+
+
+ }
+ }
+
+ }
+}
#include<iostream>
#include<vector>
+#include<map>
#include "modelCDMFolder.h"
#include "modelCDMFile.h"
virtual const bool Refresh(std::string*& result);
+ void CheckStructure(std::map<std::string, bool>& properties);
+
private:
std::string executableName;
modelCDMFile* mainFile;
#include "modelCDMLib.h"
#include <fstream>
+#include <sstream>
#include <algorithm>
#include "CDMUtilities.h"
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);
+ }
+}
#include<iostream>
#include<vector>
+#include<map>
#include "modelCDMFolder.h"
#include "modelCDMLibrary.h"
virtual const bool Refresh(std::string*& result);
+ void CheckStructure(std::map<std::string, bool>& properties);
+
private:
std::vector<modelCDMLibrary*> libraries;
};
#include "modelCDMLibrary.h"
#include <fstream>
+#include <sstream>
#include <algorithm>
#include "CDMUtilities.h"
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)
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;
+ }
+ }
+ }
+ }
+ }
+
+ }
+}
#include<iostream>
#include<vector>
+#include<map>
#include "modelCDMFolder.h"
virtual const bool Refresh(std::string*& result);
+ void CheckStructure(std::map<std::string, bool>& properties);
+
private:
std::string nameLibrary;
std::vector<modelCDMFolder*> folders;
#include "modelCDMPackage.h"
#include <fstream>
+#include <sstream>
#include <algorithm>
#include "creaWx.h"
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;
+ }
+ }
+ }
+ }
+ }
+
+ }
+}
#include<iostream>
#include<vector>
+#include<map>
#include"modelCDMFolder.h"
#include"modelCDMPackageSrc.h"
);
virtual const bool Refresh(std::string*& result);
+ void CheckStructure(std::map<std::string, bool>& properties);
+
private:
std::string namePackage;
std::string authors;
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);
+ }
}
#include<iostream>
#include<vector>
+#include <map>
#include "modelCDMFolder.h"
#include "modelCDMLib.h"
*/
~modelCDMProject();
- /**
- * Unimplemented.
- */
- void PopulateProject();
-
//Getters
/**
*/
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:
#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)
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();
//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"));
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)
{
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;
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;
{
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;
//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)
//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);
#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)
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)
{
protected:
void CreateControls();
+ void OnBtnCheckProjectStructure(wxCommandEvent& event);
void OnBtnConfigureBuild(wxCommandEvent& event);
void OnBtnBuildProject(wxCommandEvent& event);
void OnBtnConnectProject(wxCommandEvent& event);
--- /dev/null
+/*
+# ---------------------------------------------------------------------
+#
+# 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);
+}
--- /dev/null
+/*
+# ---------------------------------------------------------------------
+#
+# 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_ */