From a0b731983012ed44d26e22bfd006531f30344627 Mon Sep 17 00:00:00 2001 From: Viktor Uzlov Date: Thu, 25 Mar 2021 00:31:38 +0300 Subject: [PATCH] disable MG_ADAPT for Windows #2 --- CMakeLists.txt | 14 ++++++++++---- SalomeSMESHConfig.cmake.in | 1 + src/SMESHGUI/SMESHGUI.cxx | 12 ++++++------ src/SMESH_I/MG_ADAPT_i.cxx | 6 +++--- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2935fe10c..854959040 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -240,10 +240,16 @@ IF(WIN32) ENDIF(${F2C_FOUND}) ENDIF(WIN32) -#On Linux enable MG_ADAPT -IF(NOT WIN32) - ADD_DEFINITIONS(-DMGADAPT_ENABLE) -ENDIF(NOT WIN32) + +SET (SALOME_SMESH_DISABLE_MG_ADAPT OFF) +IF(WIN32) + SET (SALOME_SMESH_DISABLE_MG_ADAPT ON) +ENDIF() + +#On Windows disable MG_ADAPT +IF(SALOME_SMESH_DISABLE_MG_ADAPT) + ADD_DEFINITIONS(-DDISABLE_MG_ADAPT) +ENDIF() IF(SALOME_SMESH_ENABLE_MEFISTO) SET(MEFISTO2D_NAME "MEFISTO_2D") diff --git a/SalomeSMESHConfig.cmake.in b/SalomeSMESHConfig.cmake.in index fba20e0cb..106114efd 100644 --- a/SalomeSMESHConfig.cmake.in +++ b/SalomeSMESHConfig.cmake.in @@ -59,6 +59,7 @@ SET(SALOME_SMESH_BUILD_GUI @SALOME_BUILD_GUI@) SET(SALOME_SMESH_USE_CGNS @SALOME_SMESH_USE_CGNS@) SET(SALOME_SMESH_USE_TBB @SALOME_SMESH_USE_TBB@) SET(SALOME_SMESH_ENABLE_MEFISTO @SALOME_SMESH_ENABLE_MEFISTO@) +SET(SALOME_SMESH_DISABLE_MG_ADAPT @SALOME_SMESH_DISABLE_MG_ADAPT@) IF(NOT WIN32) LIST(APPEND SMESH_DEFINITIONS "-DENABLE_MEFISTO") ENDIF(NOT WIN32) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 0b16abc3e..a5ca8c86e 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -3044,7 +3044,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) break; } // Adaptation - begin -#if defined(MGADAPT_ENABLE) +#ifndef DISABLE_MG_ADAPT case SMESHOp::OpMGAdapt: { if ( isStudyLocked() ) @@ -4296,7 +4296,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createSMESHAction( SMESHOp::OpDisableAutoColor, "DISABLE_AUTO_COLOR" ); // Adaptation - begin -#if defined(MGADAPT_ENABLE) +#ifndef DISABLE_MG_ADAPT createSMESHAction( SMESHOp::OpMGAdapt, "MG_ADAPT", "ICON_MG_ADAPT" ); #endif // Adaptation - end @@ -4516,7 +4516,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createMenu( SMESHOp::OpPatternMapping, modifyId, -1 ); // Adaptation - begin -#if defined(MGADAPT_ENABLE) +#ifndef DISABLE_MG_ADAPT createMenu( SMESHOp::OpMGAdapt, adaptId, -1 ); #endif // Adaptation - end @@ -4665,7 +4665,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpPatternMapping, modifyTb ); // Adaptation - begin -#if defined(MGADAPT_ENABLE) +#ifndef DISABLE_MG_ADAPT int adaptTb = createTool( tr( "TB_ADAPTATION" ),QString( "SMESHAdaptationToolbar" ) ) ; createTool( SMESHOp::OpMGAdapt, adaptTb ); #endif @@ -4753,7 +4753,7 @@ void SMESHGUI::initialize( CAM_Application* app ) popupMgr()->insert( separator(), -1, 0 ); // Adaptation - begin -#if defined(MGADAPT_ENABLE) +#ifndef DISABLE_MG_ADAPT createPopupItem( SMESHOp::OpMGAdapt, OB, mesh ); #endif // Adaptation - end @@ -6027,7 +6027,7 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const op = new SMESHGUI_Add0DElemsOnAllNodesOp(); break; // Adaptation - begin -#if defined(MGADAPT_ENABLE) +#ifndef DISABLE_MG_ADAPT case SMESHOp::OpMGAdapt: break; #endif diff --git a/src/SMESH_I/MG_ADAPT_i.cxx b/src/SMESH_I/MG_ADAPT_i.cxx index 8c20914f7..7654aba60 100644 --- a/src/SMESH_I/MG_ADAPT_i.cxx +++ b/src/SMESH_I/MG_ADAPT_i.cxx @@ -96,7 +96,7 @@ void MG_ADAPT_i::copyHypothesisDataFromImpl(const ::MG_ADAPT::MgAdaptHypothesisD SMESH::MG_ADAPT_ptr SMESH_Gen_i::CreateMG_ADAPT() { -#if defined(MGADAPT_ENABLE) +#ifndef DISABLE_MG_ADAPT SMESH::MG_ADAPT_i* aMGadapt = new SMESH::MG_ADAPT_i(); SMESH::MG_ADAPT_var anObj = aMGadapt->_this(); return anObj._retn(); @@ -106,7 +106,7 @@ SMESH::MG_ADAPT_ptr SMESH_Gen_i::CreateMG_ADAPT() } SMESH::MG_ADAPT_ptr SMESH_Gen_i::CreateAdaptationHypothesis() { -#if defined(MGADAPT_ENABLE) +#ifndef DISABLE_MG_ADAPT SMESH::MG_ADAPT_i* aMGadapt = new SMESH::MG_ADAPT_i(); SMESH::MG_ADAPT_var anObj = aMGadapt->_this(); return anObj._retn(); @@ -116,7 +116,7 @@ SMESH::MG_ADAPT_ptr SMESH_Gen_i::CreateAdaptationHypothesis() } SMESH::MG_ADAPT_OBJECT_ptr SMESH_Gen_i::Adaptation( const char* adaptationType) { -#if defined(MGADAPT_ENABLE) +#ifndef DISABLE_MG_ADAPT if (!strcmp(adaptationType, "MG_Adapt")) { SMESH::MG_ADAPT_OBJECT_i* mg_adapt_object = new SMESH::MG_ADAPT_OBJECT_i(); -- 2.39.2