From: <yu...@us...> - 2009-07-24 23:36:08
|
Revision: 4097 http://hugin.svn.sourceforge.net/hugin/?rev=4097&view=rev Author: yuv Date: 2009-07-24 23:35:53 +0000 (Fri, 24 Jul 2009) Log Message: ----------- store celeste model in /usr/share/hugin/data/ to make packaging of CLI-tools separate from GUI-tools possible http://sourceforge.net/tracker/?func=detail&aid=2715400&group_id=77506&atid=550441 Modified Paths: -------------- hugin/trunk/CMakeLists.txt hugin/trunk/src/celeste/CMakeLists.txt hugin/trunk/src/celeste/Main.cpp hugin/trunk/src/hugin1/hugin/CPEditorPanel.cpp hugin/trunk/src/hugin1/hugin/ImagesPanel.cpp hugin/trunk/src/hugin1/hugin/huginApp.cpp hugin/trunk/src/hugin1/hugin/huginApp.h hugin/trunk/src/hugin_config.h.in.cmake Modified: hugin/trunk/CMakeLists.txt =================================================================== --- hugin/trunk/CMakeLists.txt 2009-07-24 18:05:41 UTC (rev 4096) +++ hugin/trunk/CMakeLists.txt 2009-07-24 23:35:53 UTC (rev 4097) @@ -251,6 +251,7 @@ SET(LINKDIR share/applications) SET(LIBDIR lib${LIB_SUFFIX}) SET(INSTALL_XRC_DIR ${CMAKE_INSTALL_PREFIX}/share/hugin/xrc) +SET(INSTALL_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/hugin/data) # setup bundle install prefix IF (APPLE) Modified: hugin/trunk/src/celeste/CMakeLists.txt =================================================================== --- hugin/trunk/src/celeste/CMakeLists.txt 2009-07-24 18:05:41 UTC (rev 4096) +++ hugin/trunk/src/celeste/CMakeLists.txt 2009-07-24 23:35:53 UTC (rev 4097) @@ -94,6 +94,6 @@ ) INSTALL(TARGETS celeste_standalone DESTINATION ${BINDIR}) -INSTALL(FILES ${CELESTE_MODEL} DESTINATION ${HUGINDATADIR}/xrc/data) +INSTALL(FILES ${CELESTE_MODEL} DESTINATION ${HUGINDATADIR}) add_subdirectory(training) Modified: hugin/trunk/src/celeste/Main.cpp =================================================================== --- hugin/trunk/src/celeste/Main.cpp 2009-07-24 18:05:41 UTC (rev 4096) +++ hugin/trunk/src/celeste/Main.cpp 2009-07-24 23:35:53 UTC (rev 4097) @@ -393,7 +393,7 @@ cout << endl << "Celeste: Removes cloud-like control points from Hugin project files and creates image masks" << endl; cout << "using Support Vector Machines." << endl; cout << endl << "Version " << VERSION << endl; - cout << endl << "Usage: celeste [options] image1 image2 [..]" << endl << endl; + cout << endl << "Usage: celeste_standalone [options] image1 image2 [..]" << endl << endl; cout << "Options:" << endl << endl; cout << " -i <filename> Input Hugin PTO file. Control points over SVM threshold will" << endl; cout << " be removed before being written to the output file. If -m is" << endl; @@ -428,7 +428,7 @@ vector<string> images_to_mask; string pto_file = (""),output_pto = (""); string mask_format = ("PNG"); - string model_file = ("data/celeste.model"); + string model_file = ("celeste.model"); int course_fine = 0; // Deal with arguments @@ -466,7 +466,7 @@ // Check model file if (!fileexists(model_file)){ - string install_path_model = (INSTALL_XRC_DIR); + string install_path_model = (INSTALL_DATA_DIR); install_path_model.append(model_file); if (!fileexists(install_path_model)){ Modified: hugin/trunk/src/hugin1/hugin/CPEditorPanel.cpp =================================================================== --- hugin/trunk/src/hugin1/hugin/CPEditorPanel.cpp 2009-07-24 18:05:41 UTC (rev 4096) +++ hugin/trunk/src/hugin1/hugin/CPEditorPanel.cpp 2009-07-24 23:35:53 UTC (rev 4097) @@ -2177,13 +2177,13 @@ // determine file name of SVM model file // get XRC path from application - wxString wxstrModelFileName = huginApp::Get()->GetXRCPath() + wxT("data/") + wxT(HUGIN_CELESTE_MODEL); + wxString wxstrModelFileName = huginApp::Get()->GetDataPath() + wxT(HUGIN_CELESTE_MODEL); // convert wxString to string string strModelFileName(wxstrModelFileName.mb_str(wxConvUTF8)); // SVM model file if (! wxFile::Exists(wxstrModelFileName) ) { - wxMessageBox(_("Celeste model file not found, Hugin needs to be properly installed." ), _("Fatal Error")); + wxMessageBox(_("Celeste model expected in ") + wxstrModelFileName +_(" not found, Hugin needs to be properly installed." ), _("Fatal Error")); return ; } Modified: hugin/trunk/src/hugin1/hugin/ImagesPanel.cpp =================================================================== --- hugin/trunk/src/hugin1/hugin/ImagesPanel.cpp 2009-07-24 18:05:41 UTC (rev 4096) +++ hugin/trunk/src/hugin1/hugin/ImagesPanel.cpp 2009-07-24 23:35:53 UTC (rev 4097) @@ -821,13 +821,13 @@ // determine file name of SVM model file // get XRC path from application - wxString wxstrModelFileName = huginApp::Get()->GetXRCPath() + wxT("data/") + wxT(HUGIN_CELESTE_MODEL); + wxString wxstrModelFileName = huginApp::Get()->GetDataPath() + wxT(HUGIN_CELESTE_MODEL); // convert wxString to string string strModelFileName(wxstrModelFileName.mb_str(wxConvUTF8)); // SVM model file if (! wxFile::Exists(wxstrModelFileName) ) { - wxMessageBox(_("Celeste model file not found, Hugin needs to be properly installed." ), _("Fatal Error")); + wxMessageBox(_("Celeste model expected in ") + wxstrModelFileName +_(" not found, Hugin needs to be properly installed." ), _("Fatal Error")); return ; } Modified: hugin/trunk/src/hugin1/hugin/huginApp.cpp =================================================================== --- hugin/trunk/src/hugin1/hugin/huginApp.cpp 2009-07-24 18:05:41 UTC (rev 4096) +++ hugin/trunk/src/hugin1/hugin/huginApp.cpp 2009-07-24 23:35:53 UTC (rev 4097) @@ -130,6 +130,7 @@ wxFileName::SplitPath( huginExeDir, &huginRoot, NULL, NULL ); m_xrcPrefix = huginRoot + wxT("/share/hugin/xrc/"); + m_DataDir = huginRoot + wxT("/data/"); m_utilsBinDir = huginRoot + wxT("/bin/"); // locale setup @@ -144,6 +145,7 @@ return false; } m_xrcPrefix = thePath + wxT("/"); + m_DataDir = thePath + wxT("/"); } { @@ -159,6 +161,7 @@ #else // add the locale directory specified during configure m_xrcPrefix = wxT(INSTALL_XRC_DIR); + m_DataDir = wxT(INSTALL_DATA_DIR); locale.AddCatalogLookupPathPrefix(wxT(INSTALL_LOCALE_DIR)); #endif Modified: hugin/trunk/src/hugin1/hugin/huginApp.h =================================================================== --- hugin/trunk/src/hugin1/hugin/huginApp.h 2009-07-24 18:05:41 UTC (rev 4096) +++ hugin/trunk/src/hugin1/hugin/huginApp.h 2009-07-24 23:35:53 UTC (rev 4097) @@ -90,6 +90,12 @@ return m_xrcPrefix; } + /** return the current data path */ + const wxString & GetDataPath() + { + return m_DataDir; + } + const wxString & GetUtilsBinDir() { return m_utilsBinDir; @@ -117,7 +123,11 @@ // the model Panorama pano; + // folder for xrc (GUI resources) wxString m_xrcPrefix; + // folder for data shared by CLI and GUI to enable separate packaging of CLI tools + wxString m_DataDir; + // folder for CLI tools wxString m_utilsBinDir; #ifdef __WXMAC__ Modified: hugin/trunk/src/hugin_config.h.in.cmake =================================================================== --- hugin/trunk/src/hugin_config.h.in.cmake 2009-07-24 18:05:41 UTC (rev 4096) +++ hugin/trunk/src/hugin_config.h.in.cmake 2009-07-24 23:35:53 UTC (rev 4097) @@ -47,6 +47,9 @@ /* locate of the xrc files, as defined during configuration */ #define INSTALL_LOCALE_DIR "${INSTALL_LOCALE_DIR}" +/* Location for data, as defined during configuration*/ +#define INSTALL_DATA_DIR "${INSTALL_DATA_DIR}/" + /* Location for XRC files and other data, as defined during configuration*/ #define INSTALL_XRC_DIR "${INSTALL_XRC_DIR}/" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |