From 64f450dfd133e2dcec792369d3e07a8255633597 Mon Sep 17 00:00:00 2001 From: rnv Date: Thu, 20 Jan 2022 18:09:27 +0300 Subject: [PATCH] Disable homard tool on Windows. --- CMakeLists.txt | 7 +++++++ SalomeSMESHConfig.cmake.in | 1 + src/SMESHGUI/SMESHGUI.cxx | 16 ++++++++++++++-- src/SMESH_I/MG_ADAPT_i.cxx | 4 +++- src/SMESH_I/SMESH_Homard_i.cxx | 13 +++++++++++-- 5 files changed, 36 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ddcef2ba0..c0a4f7d20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -246,14 +246,21 @@ ENDIF(WIN32) SET (SALOME_SMESH_DISABLE_MG_ADAPT OFF) +SET (SALOME_SMESH_DISABLE_HOMARD_ADAPT OFF) IF(WIN32) # On Windows temporarily disable MG_ADAPT SET (SALOME_SMESH_DISABLE_MG_ADAPT ON) + SET (SALOME_SMESH_DISABLE_HOMARD_ADAPT ON) ENDIF() IF(SALOME_SMESH_DISABLE_MG_ADAPT) ADD_DEFINITIONS(-DDISABLE_MG_ADAPT) ENDIF() +IF(SALOME_SMESH_DISABLE_HOMARD_ADAPT) + ADD_DEFINITIONS(-DDISABLE_HOMARD_ADAPT) +ENDIF() + + IF(SALOME_SMESH_ENABLE_MEFISTO) SET(MEFISTO2D_NAME "MEFISTO_2D") ELSE(SALOME_SMESH_ENABLE_MEFISTO) diff --git a/SalomeSMESHConfig.cmake.in b/SalomeSMESHConfig.cmake.in index 045516be6..3256e3624 100644 --- a/SalomeSMESHConfig.cmake.in +++ b/SalomeSMESHConfig.cmake.in @@ -60,6 +60,7 @@ 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@) +SET(SALOME_SMESH_DISABLE_HOMARD_ADAPT @SALOME_SMESH_DISABLE_HOMARD_ADAPT@) IF(SALOME_SMESH_DISABLE_MG_ADAPT) LIST(APPEND SMESH_DEFINITIONS "-DDISABLE_MG_ADAPT") ENDIF() diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 3bcce1287..46261a995 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -3030,6 +3030,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) break; } #endif +#ifndef DISABLE_HOMARD_ADAPT case SMESHOp::OpHomardAdapt: { if ( isStudyLocked() ) @@ -3051,6 +3052,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) } break; } +#endif // Adaptation - end case SMESHOp::OpSplitBiQuadratic: case SMESHOp::OpConvertMeshToQuadratic: @@ -4289,7 +4291,9 @@ void SMESHGUI::initialize( CAM_Application* app ) #ifndef DISABLE_MG_ADAPT createSMESHAction( SMESHOp::OpMGAdapt, "MG_ADAPT", "ICON_MG_ADAPT" ); #endif +#ifndef DISABLE_HOMARD_ADAPT createSMESHAction( SMESHOp::OpHomardAdapt, "HOMARD_ADAPT", "ICON_HOMARD_ADAPT" ); +#endif // Adaptation - end createSMESHAction( SMESHOp::OpMinimumDistance, "MEASURE_MIN_DIST", "ICON_MEASURE_MIN_DIST" ); @@ -4333,7 +4337,7 @@ void SMESHGUI::initialize( CAM_Application* app ) meshId = createMenu( tr( "MEN_MESH" ), -1, 70, 10 ), ctrlId = createMenu( tr( "MEN_CTRL" ), -1, 60, 10 ), modifyId = createMenu( tr( "MEN_MODIFY" ), -1, 40, 10 ), -#ifndef DISABLE_MG_ADAPT +#if !defined(DISABLE_MG_ADAPT) || !defined(DISABLE_HOMARD_ADAPT) adaptId = createMenu( tr( "MEN_ADAPT" ), -1, 80, 10 ), #endif measureId = createMenu( tr( "MEN_MEASURE" ), -1, 50, 10 ), @@ -4510,7 +4514,9 @@ void SMESHGUI::initialize( CAM_Application* app ) #ifndef DISABLE_MG_ADAPT createMenu( SMESHOp::OpMGAdapt, adaptId, -1 ); #endif +#ifndef DISABLE_HOMARD_ADAPT createMenu( SMESHOp::OpHomardAdapt, adaptId, -1 ); +#endif // Adaptation - end createMenu( SMESHOp::OpMinimumDistance, measureId, -1 ); @@ -4657,11 +4663,15 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpPatternMapping, modifyTb ); // Adaptation - begin -#ifndef DISABLE_MG_ADAPT +#if !defined(DISABLE_MG_ADAPT) || !defined(DISABLE_HOMARD_ADAPT) int adaptTb = createTool( tr( "TB_ADAPTATION" ), QString( "SMESHAdaptationToolbar" ) ) ; +#endif +#ifndef DISABLE_MG_ADAPT createTool( SMESHOp::OpMGAdapt, adaptTb ); #endif +#ifndef DISABLE_HOMARD_ADAPT createTool( SMESHOp::OpHomardAdapt, adaptTb ); +#endif // Adaptation - end int measuremTb = createTool( tr( "TB_MEASUREM" ), QString( "SMESHMeasurementsToolbar" ) ) ; @@ -4749,7 +4759,9 @@ void SMESHGUI::initialize( CAM_Application* app ) #ifndef DISABLE_MG_ADAPT createPopupItem( SMESHOp::OpMGAdapt, OB, mesh ); #endif +#ifndef DISABLE_HOMARD_ADAPT createPopupItem( SMESHOp::OpHomardAdapt, OB, mesh ); +#endif popupMgr()->insert( separator(), -1, 0 ); // Adaptation - end diff --git a/src/SMESH_I/MG_ADAPT_i.cxx b/src/SMESH_I/MG_ADAPT_i.cxx index 7950f58dd..f89f59fb7 100644 --- a/src/SMESH_I/MG_ADAPT_i.cxx +++ b/src/SMESH_I/MG_ADAPT_i.cxx @@ -127,10 +127,12 @@ SALOME::GenericObj_ptr SMESH_Gen_i::Adaptation( const char* adaptationType) return anObj._retn(); } #endif +#ifndef DISABLE_HOMARD_ADAPT if (!strcmp(adaptationType, "Uniform")) { return CreateHOMARD_ADAPT(); } - return SMESH::MG_ADAPT_OBJECT_ptr(); +#endif + return SALOME::GenericObj_ptr(); } //============================================================================= /*! diff --git a/src/SMESH_I/SMESH_Homard_i.cxx b/src/SMESH_I/SMESH_Homard_i.cxx index 55699404a..88a6cf88c 100644 --- a/src/SMESH_I/SMESH_Homard_i.cxx +++ b/src/SMESH_I/SMESH_Homard_i.cxx @@ -981,7 +981,7 @@ SMESHHOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::GetCase() return SMESHHOMARD::HOMARD_Cas::_duplicate(myCase); } //============================================================================= -HOMARD_Iteration_i* HOMARD_Gen_i::GetIteration(int numIter) +HOMARD_Iteration_i* HOMARD_Gen_i::GetIteration(CORBA::Long numIter) { if (numIter == 0) { ASSERT(myIteration0); @@ -1778,6 +1778,7 @@ CORBA::Long HOMARD_Gen_i::ComputeCAO() // A. Prealable // A.1. Bases int codret = 0; +#ifndef DISABLE_HOMARD_ADAPT // A.2. Le sous-répertoire de l'iteration en cours de traitement char* DirCompute = myIteration1->GetDirName(); // A.3. Le maillage résultat de l'iteration en cours de traitement @@ -1869,7 +1870,7 @@ CORBA::Long HOMARD_Gen_i::ComputeCAO() // de savoir le faire avec MEDCoupling MESSAGE (". Transfert des coordonnées"); codret = ComputeCAObis(); - +#endif return codret; } //============================================================================= @@ -1981,6 +1982,7 @@ CORBA::Long HOMARD_Gen_i::ComputeCAObis() //============================================================================= char* HOMARD_Gen_i::CreateDirNameIter(const char* nomrep, CORBA::Long num) { +#ifndef DISABLE_HOMARD_ADAPT MESSAGE ("CreateDirNameIter : nomrep ="<< nomrep << ", num = "<