From 5e8bf02e8ae2a833a81ce9c61210a053130630dd Mon Sep 17 00:00:00 2001 From: raphael Date: Mon, 8 Feb 2021 18:19:11 +0100 Subject: [PATCH] Add shaper standalone executable without CORBA --- src/Config/CMakeLists.txt | 6 ++- src/Config/Config_XMLReader.cpp | 4 +- src/SHAPERGUI/CMakeLists.txt | 8 +++ src/SHAPERGUI/SHAPERGUI.cpp | 5 +- src/SHAPERGUI/resources/LightShaperApp.xml.in | 49 +++++++++++++++++++ src/SHAPERGUI/resources/ShaperApp.xml | 3 ++ 6 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 src/SHAPERGUI/resources/LightShaperApp.xml.in create mode 100644 src/SHAPERGUI/resources/ShaperApp.xml diff --git a/src/Config/CMakeLists.txt b/src/Config/CMakeLists.txt index 0f427639d..29bcadc46 100644 --- a/src/Config/CMakeLists.txt +++ b/src/Config/CMakeLists.txt @@ -17,6 +17,9 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +# additional include directories +INCLUDE_DIRECTORIES(${QT_INCLUDES}) + INCLUDE(Common) INCLUDE(UnitTest) INCLUDE(XMLProcessing) @@ -24,7 +27,8 @@ FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/Events - ${PYTHON_INCLUDE_DIR}) + ${PYTHON_INCLUDE_DIR} + ${SALOME_GUI_INCLUDE}) SET(PROJECT_HEADERS Config_def.h diff --git a/src/Config/Config_XMLReader.cpp b/src/Config/Config_XMLReader.cpp index 8cba8cd4d..a2cd71328 100644 --- a/src/Config/Config_XMLReader.cpp +++ b/src/Config/Config_XMLReader.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -168,7 +169,8 @@ void Config_XMLReader::readAll() } // to load external modules dependencies (like GEOM for Connector Feature) - Config_ModuleReader::loadScript("salome.shaper.initConfig", false); + if(SUIT_Session::session()->executableAppName() == SUIT_Session::session()->salomeAppName()) + Config_ModuleReader::loadScript("salome.shaper.initConfig", false); for(int aSolution = 0; true; aSolution++) { std::string aFoundFile = findConfigFile(myRootFileName, aSolution); diff --git a/src/SHAPERGUI/CMakeLists.txt b/src/SHAPERGUI/CMakeLists.txt index a3f1c93ee..23d3b7995 100644 --- a/src/SHAPERGUI/CMakeLists.txt +++ b/src/SHAPERGUI/CMakeLists.txt @@ -59,7 +59,9 @@ SET(PROJECT_SOURCES SET(PROJECT_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/LightApp.xml + ${CMAKE_CURRENT_BINARY_DIR}/LightShaperApp.xml resources/SalomeApp.xml + resources/ShaperApp.xml resources/shaper.png ) @@ -132,6 +134,12 @@ CONFIGURE_FILE( "${CMAKE_CURRENT_BINARY_DIR}/LightApp.xml" ) +CONFIGURE_FILE( + "${CMAKE_CURRENT_SOURCE_DIR}/resources/LightShaperApp.xml.in" + "${CMAKE_CURRENT_BINARY_DIR}/LightShaperApp.xml" + ) + + INSTALL(TARGETS SHAPER DESTINATION ${SHAPER_INSTALL_BIN}) INSTALL(FILES ${PROJECT_RESOURCES} DESTINATION ${SHAPER_INSTALL_RESOURCES}) INSTALL(FILES ${QM_RESOURCES} DESTINATION ${SHAPER_INSTALL_QM_RESOURCES}) diff --git a/src/SHAPERGUI/SHAPERGUI.cpp b/src/SHAPERGUI/SHAPERGUI.cpp index f92d89f69..073083597 100644 --- a/src/SHAPERGUI/SHAPERGUI.cpp +++ b/src/SHAPERGUI/SHAPERGUI.cpp @@ -56,6 +56,7 @@ #include #include #include +#include #include #include @@ -1278,6 +1279,8 @@ void SHAPERGUI::resetToolbars() void SHAPERGUI::publishToStudy() { - if (isActiveModule() && ModelAPI_Session::get()->hasModuleDocument()) + if ( (SUIT_Session::session()->executableAppName() == SUIT_Session::session()->salomeAppName()) + // publish on salome executable mode + && isActiveModule() && ModelAPI_Session::get()->hasModuleDocument()) myWorkshop->module()->launchOperation("PublishToStudy", false); } diff --git a/src/SHAPERGUI/resources/LightShaperApp.xml.in b/src/SHAPERGUI/resources/LightShaperApp.xml.in new file mode 100644 index 000000000..c8570e220 --- /dev/null +++ b/src/SHAPERGUI/resources/LightShaperApp.xml.in @@ -0,0 +1,49 @@ + +
+ + +
+
+ + + + + +
+
+ + +
+
+ + + + + + +
+
+ + + + + + + + + + + + + + + + +
+
+ +
+
+ +
+
diff --git a/src/SHAPERGUI/resources/ShaperApp.xml b/src/SHAPERGUI/resources/ShaperApp.xml new file mode 100644 index 000000000..f306516c7 --- /dev/null +++ b/src/SHAPERGUI/resources/ShaperApp.xml @@ -0,0 +1,3 @@ + + + -- 2.39.2