From a1a1d918e496461ae0e97b178f1376b182b084ed Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Wed, 20 May 2020 10:44:56 +0200 Subject: [PATCH 001/100] Les icones du pilotage de l'adaptation --- resources/CMakeLists.txt | 5 +++++ resources/adapt_hom_iter_next.png | Bin 0 -> 369 bytes resources/adapt_hom_iter_poursuite.png | Bin 0 -> 613 bytes resources/adapt_mg_adapt.png | Bin 0 -> 2638 bytes resources/adapt_ref_all.png | Bin 0 -> 2641 bytes resources/adapt_ref_homard.png | Bin 0 -> 241 bytes 6 files changed, 5 insertions(+) create mode 100755 resources/adapt_hom_iter_next.png create mode 100755 resources/adapt_hom_iter_poursuite.png create mode 100755 resources/adapt_mg_adapt.png create mode 100755 resources/adapt_ref_all.png create mode 100755 resources/adapt_ref_homard.png diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index e6d26d4e4..bb493d7bb 100644 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -22,6 +22,11 @@ SET(SMESH_RESOURCES_FILES ModuleMesh.png + adapt_hom_iter_next.png + adapt_hom_iter_poursuite.png + adapt_mg_adapt.png + adapt_ref_all.png + adapt_ref_homard.png advanced_mesh_info.png bare_border_face.png bare_border_volume.png diff --git a/resources/adapt_hom_iter_next.png b/resources/adapt_hom_iter_next.png new file mode 100755 index 0000000000000000000000000000000000000000..3bbcbd640ad1a61ad98a7d2fdbcc775c87277c1a GIT binary patch literal 369 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 w;M1& literal 0 HcmV?d00001 diff --git a/resources/adapt_ref_all.png b/resources/adapt_ref_all.png new file mode 100755 index 0000000000000000000000000000000000000000..21b2841d16805379ca112364681d8ba4f8a258c6 GIT binary patch literal 2641 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 Date: Wed, 20 May 2020 10:47:58 +0200 Subject: [PATCH 002/100] Menu de pilotage global --- src/SMESHGUI/SMESHGUI.cxx | 62 +++++++++++++++++++++++++++ src/SMESHGUI/SMESHGUI_Operations.h | 10 +++++ src/SMESHGUI/SMESH_images.ts | 28 ++++++++++++ src/SMESHGUI/SMESH_msg_en.ts | 68 ++++++++++++++++++++++++++++++ src/SMESHGUI/SMESH_msg_fr.ts | 66 ++++++++++++++++++++++++++++- 5 files changed, 233 insertions(+), 1 deletion(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 28862787d..5704acc4d 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -3018,6 +3018,17 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) break; } case SMESHOp::OpSplitBiQuadratic: + + case SMESHOp::OpUniformRefinement: + case SMESHOp::OpHONewCase: + case SMESHOp::OpHOCaseFollow: + case SMESHOp::OpHONewIter: + case SMESHOp::OpHOIterCompute: + case SMESHOp::OpHOIterComputePublish: + case SMESHOp::OpHOEdit: + case SMESHOp::OpHODelete: + case SMESHOp::OpMGAdapt: + case SMESHOp::OpConvertMeshToQuadratic: case SMESHOp::OpCreateBoundaryElements: // create 2D mesh from 3D case SMESHOp::OpReorientFaces: @@ -4252,6 +4263,17 @@ void SMESHGUI::initialize( CAM_Application* app ) createSMESHAction( SMESHOp::OpAutoColor, "AUTO_COLOR" ); createSMESHAction( SMESHOp::OpDisableAutoColor, "DISABLE_AUTO_COLOR" ); +// Mesh adaptation + createSMESHAction( SMESHOp::OpUniformRefinement, "REF_ALL", "ICON_REF_ALL" ); + createSMESHAction( SMESHOp::OpHONewCase, "HOMARD_CREATE_CASE", "ICON_HOMARD_CREATE_CASE" ); + createSMESHAction( SMESHOp::OpHOCaseFollow, "HOMARD_FOLLOW_ITERATION", "ICON_HOMARD_FOLLOW_ITERATION" ); + createSMESHAction( SMESHOp::OpHONewIter, "HOMARD_NEW_ITERATION", "ICON_HOMARD_NEW_ITERATION" ); + createSMESHAction( SMESHOp::OpHOIterCompute, "HOMARD_COMPUTE", "ICON_HOMARD_COMPUTE" ); + createSMESHAction( SMESHOp::OpHOIterComputePublish, "HOMARD_COMPUTE_PUBLISH", "ICON_HOMARD_COMPUTE_PUBLISH" ); + createSMESHAction( SMESHOp::OpHOEdit, "EDIT", "ICON_DLG_EDIT_MESH" ); + createSMESHAction( SMESHOp::OpHODelete, "DELETE", "ICON_DELETE" ); + createSMESHAction( SMESHOp::OpMGAdapt, "MG_ADAPT", "ICON_MG_ADAPT" ); + createSMESHAction( SMESHOp::OpMinimumDistance, "MEASURE_MIN_DIST", "ICON_MEASURE_MIN_DIST" ); createSMESHAction( SMESHOp::OpBoundingBox, "MEASURE_BND_BOX", "ICON_MEASURE_BND_BOX" ); createSMESHAction( SMESHOp::OpPropertiesLength, "MEASURE_LENGTH", "ICON_MEASURE_LENGTH" ); @@ -4293,6 +4315,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 ), + adaptId = createMenu( tr( "MEN_ADAPT" ), -1, 80, 10 ), measureId = createMenu( tr( "MEN_MEASURE" ), -1, 50, 10 ), viewId = createMenu( tr( "MEN_VIEW" ), -1, 2 ); @@ -4310,6 +4333,7 @@ void SMESHGUI::initialize( CAM_Application* app ) removeId = createMenu( tr( "MEN_REMOVE" ), modifyId, 403 ), //renumId = createMenu( tr( "MEN_RENUM" ), modifyId, 404 ), transfId = createMenu( tr( "MEN_TRANSF" ), modifyId, 405 ), + refHomardId = createMenu( tr( "MEN_REF_HOMARD" ), adaptId, -1, 10 ), basicPropId = createMenu( tr( "MEN_BASIC_PROPERTIES" ), measureId, -1, 10 ); //createMenu( SMESHOp::OpImportDAT, importId, -1 ); @@ -4465,6 +4489,18 @@ void SMESHGUI::initialize( CAM_Application* app ) createMenu( SMESHOp::OpSmoothing, modifyId, -1 ); createMenu( SMESHOp::OpPatternMapping, modifyId, -1 ); + createMenu( SMESHOp::OpUniformRefinement, adaptId, -1 ); + createMenu( SMESHOp::OpHONewCase, refHomardId, -1 ); + createMenu( SMESHOp::OpHOCaseFollow, refHomardId, -1 ); + createMenu( separator(), refHomardId, -1 ); + createMenu( SMESHOp::OpHONewIter, refHomardId, -1 ); + createMenu( SMESHOp::OpHOIterCompute, refHomardId, -1 ); + createMenu( SMESHOp::OpHOIterComputePublish, refHomardId, -1 ); + createMenu( separator(), refHomardId, -1 ); + createMenu( SMESHOp::OpHOEdit, refHomardId, -1 ); + createMenu( SMESHOp::OpHODelete, refHomardId, -1 ); + createMenu( SMESHOp::OpMGAdapt, adaptId, -1 ); + createMenu( SMESHOp::OpMinimumDistance, measureId, -1 ); createMenu( SMESHOp::OpBoundingBox, measureId, -1 ); createMenu( SMESHOp::OpAngle, measureId, -1 ); @@ -4492,6 +4528,7 @@ void SMESHGUI::initialize( CAM_Application* app ) //renumbTb = createTool( tr( "TB_RENUMBER" ), QString( "SMESHRenumberingToolbar" ) ), transformTb = createTool( tr( "TB_TRANSFORM" ), QString( "SMESHTransformationToolbar" ) ), modifyTb = createTool( tr( "TB_MODIFY" ), QString( "SMESHModificationToolbar" ) ), +// adaptTb = createTool( tr( "TB_ADAPTATION" ),QString( "SMESHAdaptationToolbar" ) ), measuremTb = createTool( tr( "TB_MEASUREM" ), QString( "SMESHMeasurementsToolbar" ) ), dispModeTb = createTool( tr( "TB_DISP_MODE" ), QString( "SMESHDisplayModeToolbar" ) ); @@ -4611,6 +4648,10 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpSmoothing, modifyTb ); createTool( SMESHOp::OpPatternMapping, modifyTb ); +// createTool( SMESHOp::OpUniformRefinement, adaptTb ); +// createTool( SMESHOp::OpHOMARDRefinement, adaptTb ); +// createTool( SMESHOp::OpMGAdapt, adaptTb ); + createTool( SMESHOp::OpMinimumDistance, measuremTb ); createTool( SMESHOp::OpUpdate, dispModeTb ); @@ -4689,6 +4730,9 @@ void SMESHGUI::initialize( CAM_Application* app ) popupMgr()->insert( separator(), -1, 0 ); createPopupItem( SMESHOp::OpClearMesh, OB, mesh ); //popupMgr()->insert( separator(), -1, 0 ); +// createPopupItem( SMESHOp::OpUniformRefinement, OB, mesh ); +// createPopupItem( SMESHOp::OpHOMARDRefinement, OB, mesh ); +// createPopupItem( SMESHOp::OpMGAdapt, OB, mesh ); QString only_one_non_empty = QString( " && %1=1 && numberOfNodes>0" ).arg( dc ); QString multiple_non_empty = QString( " && %1>0 && numberOfNodes>0" ).arg( dc ); @@ -5834,6 +5878,24 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const case SMESHOp::OpSplitBiQuadratic: op = new SMESHGUI_SplitBiQuadOp(); break; + case SMESHOp::OpUniformRefinement: + break; + case SMESHOp::OpHONewCase: + break; + case SMESHOp::OpHOCaseFollow: + break; + case SMESHOp::OpHONewIter: + break; + case SMESHOp::OpHOIterCompute: + break; + case SMESHOp::OpHOIterComputePublish: + break; + case SMESHOp::OpHOEdit: + break; + case SMESHOp::OpHODelete: + break; + case SMESHOp::OpMGAdapt: + break; case SMESHOp::OpConvertMeshToQuadratic: op = new SMESHGUI_ConvToQuadOp(); break; diff --git a/src/SMESHGUI/SMESHGUI_Operations.h b/src/SMESHGUI/SMESHGUI_Operations.h index b81781593..75d22b7ff 100644 --- a/src/SMESHGUI/SMESHGUI_Operations.h +++ b/src/SMESHGUI/SMESHGUI_Operations.h @@ -184,6 +184,16 @@ namespace SMESHOp { OpConvertMeshToQuadratic = 4513, // MENU MODIFICATION - CONVERT TO/FROM QUADRATIC OpCreateBoundaryElements = 4514, // MENU MODIFICATION - CREATE BOUNDARY ELEMENTS OpSplitBiQuadratic = 4515, // MENU MODIFICATION - SPLIT BI-QUADRATIC TO LINEAR + // Adaptation ---------------------//-------------------------------- + OpUniformRefinement = 8000, // MENU ADAPTATION - HOMARD - UNIFORM REFINEMENT + OpHONewCase = 8011, // MENU ADAPTATION - HOMARD - FREE REFINEMENT - New Case + OpHOCaseFollow = 8012, // MENU ADAPTATION - HOMARD - FREE REFINEMENT - New Case Follow + OpHONewIter = 8013, // MENU ADAPTATION - HOMARD - FREE REFINEMENT - New Iteration + OpHOIterCompute = 8014, // MENU ADAPTATION - HOMARD - FREE REFINEMENT - Compute Iteration + OpHOIterComputePublish = 8015, // MENU ADAPTATION - HOMARD - FREE REFINEMENT - Compute Iteration and Publish + OpHOEdit = 8016, // MENU ADAPTATION - HOMARD - FREE REFINEMENT - Edit objects + OpHODelete = 8017, // MENU ADAPTATION - HOMARD - FREE REFINEMENT - Delete objects + OpMGAdapt = 8020, // MENU ADAPTATION - MG-ADAPT // Measurements -------------------//-------------------------------- OpPropertiesLength = 5000, // MENU MEASUREMENTS - BASIC PROPERTIES - LENGTH OpPropertiesArea = 5001, // MENU MEASUREMENTS - BASIC PROPERTIES - AREA diff --git a/src/SMESHGUI/SMESH_images.ts b/src/SMESHGUI/SMESH_images.ts index 9f0e4a777..44f701e94 100644 --- a/src/SMESHGUI/SMESH_images.ts +++ b/src/SMESHGUI/SMESH_images.ts @@ -79,6 +79,34 @@ ICON_CREATE_GEO_GROUP mesh_groups_from_gemetry.png + + ICON_REF_ALL + adapt_ref_all.png + + + ICON_HOMARD_CREATE_CASE + adapt_ref_homard.png + + + ICON_HOMARD_FOLLOW_ITERATION + adapt_hom_iter_poursuite.png + + + ICON_HOMARD_NEW_ITERATION + adapt_hom_iter_next + + + ICON_HOMARD_COMPUTE + mesh_compute.png + + + ICON_HOMARD_COMPUTE_PUBLISH + mesh_compute.png + + + ICON_MG_ADAPT + adapt_mg_adapt.png + ICON_CONV_TO_QUAD mesh_conv_to_quad.png diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index eba5718ed..da239a33b 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -332,6 +332,38 @@ MEN_CONSTRUCT_GROUP Construct Group + + MEN_REF_ALL + Uniform refinement + + + MEN_REF_HOMARD + Refinement with HOMARD + + + MEN_HOMARD_CREATE_CASE + New case + + + MEN_HOMARD_FOLLOW_ITERATION + Existing case + + + MEN_HOMARD_NEW_ITERATION + New iteration + + + MEN_HOMARD_COMPUTE + Compute + + + MEN_HOMARD_COMPUTE_PUBLISH + Compute and publish + + + MEN_MG_ADAPT + Remesh with MG_Adapt + MEN_CONV_TO_QUAD Convert to/from quadratic @@ -780,6 +812,10 @@ MEN_MODIFY Modification + + MEN_ADAPT + Adaptation + MEN_MEASURE Measurements @@ -1494,6 +1530,10 @@ Please enter correct values and try again SMESH_AVAILABLE Available + + SMESH_NOT_AVAILABLE + Not available + SMESH_AVAILABLE_ALGORITHMS Available algorithms @@ -3104,6 +3144,18 @@ Use Display Entity menu command to show them. STB_CONSTRUCT_GROUP Construct Group + + STB_REF_ALL + Uniform refinement + + + STB_REF_HOMARD + Refinement with HOMARD + + + STB_MG_ADAPT + Remesh with MG_Adapt + STB_CONV_TO_QUAD Convert to/from quadratic @@ -3700,6 +3752,10 @@ Use Display Entity menu command to show them. TB_CTRL3D Volume Controls Toolbar + + TB_ADAPTATION + Adaptation Toolbar + TB_MEASUREM Measurements Toolbar @@ -3804,6 +3860,18 @@ Use Display Entity menu command to show them. TOP_CONSTRUCT_GROUP Construct Group + + TOP_REF_ALL + Uniform refinement + + + TOP_REF_HOMARD + Refinement with HOMARD + + + TOP_MG_ADAPT + Remesh with MG_Adapt + TOP_CONV_TO_QUAD Convert to/from quadratic diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index f3ecad3be..4cfbce422 100644 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -474,7 +474,7 @@ MEN_EDIT - Edition + Editer MEN_EDIT_GROUP @@ -780,6 +780,10 @@ MEN_MODIFY Modification + + MEN_ADAPT + Adaptation + MEN_MEASURE Outils de mesure @@ -1108,6 +1112,38 @@ MEN_TRANSF Transformation + + MEN_REF_ALL + Raffinement uniforme + + + MEN_REF_HOMARD + Raffinement avec HOMARD + + + MEN_HOMARD_CREATE_CASE + Création d'un cas + + + MEN_HOMARD_FOLLOW_ITERATION + Poursuite d'une itération. + + + MEN_HOMARD_NEW_ITERATION + Création d'une itération + + + MEN_HOMARD_COMPUTE + Calculer + + + MEN_HOMARD_COMPUTE_PUBLISH + Calculer et publier + + + MEN_MG_ADAPT + Remaillage avec MG_Adapt + MEN_TRANSP Transparence @@ -3079,6 +3115,18 @@ Utilisez le menu "Visualiser une entité" pour les afficher. STB_CONSTRUCT_GROUP Construire un groupe + + STB_REF_ALL + Raffinement uniforme + + + STB_REF_HOMARD + Raffinement avec HOMARD + + + STB_MG_ADAPT + Remaillage avec MG_Adapt + STB_CONV_TO_QUAD Convertir vers/de quadratique @@ -3671,6 +3719,10 @@ Utilisez le menu "Visualiser une entité" pour les afficher. TB_CTRL3D Barre des contrôles des volumes + + TB_ADAPTATION + Barre de l'adaptation + TB_MEASUREM Barre des mesures @@ -3775,6 +3827,18 @@ Utilisez le menu "Visualiser une entité" pour les afficher. TOP_CONSTRUCT_GROUP Construire un groupe + + TOP_REF_ALL + Raffinement uniforme + + + TOP_REF_HOMARD + Raffinement avec HOMARD + + + TOP_MG_ADAPT + Remaillage avec MG_Adapt + TOP_CONV_TO_QUAD Convertir vers/de quadratique From b4bc7656bb79ac975d9bc94fbce4e2e7491bd918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Wed, 20 May 2020 16:05:25 +0200 Subject: [PATCH 003/100] idl pour HOMARD --- idl/CMakeLists.txt | 7 ++ idl/HOMARD_Boundary.idl | 99 ++++++++++++++++ idl/HOMARD_Cas.idl | 107 +++++++++++++++++ idl/HOMARD_Gen.idl | 233 ++++++++++++++++++++++++++++++++++++++ idl/HOMARD_Hypothesis.idl | 136 ++++++++++++++++++++++ idl/HOMARD_Iteration.idl | 130 +++++++++++++++++++++ idl/HOMARD_YACS.idl | 87 ++++++++++++++ idl/HOMARD_Zone.idl | 83 ++++++++++++++ 8 files changed, 882 insertions(+) create mode 100644 idl/HOMARD_Boundary.idl create mode 100644 idl/HOMARD_Cas.idl create mode 100644 idl/HOMARD_Gen.idl create mode 100644 idl/HOMARD_Hypothesis.idl create mode 100644 idl/HOMARD_Iteration.idl create mode 100644 idl/HOMARD_YACS.idl create mode 100644 idl/HOMARD_Zone.idl diff --git a/idl/CMakeLists.txt b/idl/CMakeLists.txt index 7ab17aef9..e870d89af 100644 --- a/idl/CMakeLists.txt +++ b/idl/CMakeLists.txt @@ -36,6 +36,13 @@ SET(SalomeIDLSMESH_IDLSOURCES SMESH_Pattern.idl SMESH_MeshEditor.idl SMESH_Measurements.idl + HOMARD_Boundary.idl + HOMARD_Cas.idl + HOMARD_Gen.idl + HOMARD_Hypothesis.idl + HOMARD_Iteration.idl + HOMARD_YACS.idl + HOMARD_Zone.idl ) SET(_idl_include_dirs diff --git a/idl/HOMARD_Boundary.idl b/idl/HOMARD_Boundary.idl new file mode 100644 index 000000000..d1a9e40da --- /dev/null +++ b/idl/HOMARD_Boundary.idl @@ -0,0 +1,99 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#ifndef _HOMARD_Boundary_IDL +#define _HOMARD_Boundary_IDL + +#include "SALOME_Component.idl" +#include "SALOME_Exception.idl" +#include "SALOMEDS.idl" + +#include "HOMARD_Cas.idl" +#include "HOMARD_Zone.idl" + + +module HOMARD +{ + interface HOMARD_Boundary : Engines::EngineComponent + { +// Generalites + void SetName(in string Name) raises (SALOME::SALOME_Exception); + string GetName() raises (SALOME::SALOME_Exception); + + long Delete() raises (SALOME::SALOME_Exception); + + string GetDumpPython() raises (SALOME::SALOME_Exception); + +// Caracteristiques + void SetType (in long Type) raises (SALOME::SALOME_Exception); + long GetType() raises (SALOME::SALOME_Exception); + + void SetDataFile(in string DataFile) raises (SALOME::SALOME_Exception); + string GetDataFile() raises (SALOME::SALOME_Exception); + + void SetMeshName(in string MeshName) raises (SALOME::SALOME_Exception); + string GetMeshName() raises (SALOME::SALOME_Exception); + + void SetCylinder (in double Xcentre, in double Ycentre, in double Zcentre, + in double Xaxe, in double Yaxe, in double Zaxe, in double rayon) + raises (SALOME::SALOME_Exception); + + void SetSphere (in double Xcentre, in double Ycentre, in double Zcentre, in double rayon) + raises (SALOME::SALOME_Exception); + + void SetConeR (in double Xcentre1, in double Ycentre1, in double Zcentre1, in double Rayon1, + in double Xcentre2, in double Ycentre2, in double Zcentre2, in double Rayon2) + raises (SALOME::SALOME_Exception); + + void SetConeA(in double Xaxe,in double Yaxe,in double Zaxe,in double Angle, + in double Xcentre,in double Ycentre,in double ZCentre) + raises (SALOME::SALOME_Exception); + + void SetTorus (in double Xcentre, in double Ycentre, in double Zcentre, + in double Xaxe, in double Yaxe, in double Zaxe, in double rayonRev, in double rayonPri) + raises (SALOME::SALOME_Exception); + + + HOMARD::double_array GetCoords() raises (SALOME::SALOME_Exception); + + void SetLimit (in double Xincr, in double Yincr, in double Zincr) + raises (SALOME::SALOME_Exception); + HOMARD::double_array GetLimit() raises (SALOME::SALOME_Exception); + + void AddGroup(in string LeGroupe) raises (SALOME::SALOME_Exception); + void SetGroups(in ListGroupType ListGroup) raises (SALOME::SALOME_Exception); + ListGroupType GetGroups() raises (SALOME::SALOME_Exception); + +// Liens avec les autres iterations + void SetCaseCreation(in string NomCas) raises (SALOME::SALOME_Exception); + string GetCaseCreation() raises (SALOME::SALOME_Exception); + + }; +}; +#endif diff --git a/idl/HOMARD_Cas.idl b/idl/HOMARD_Cas.idl new file mode 100644 index 000000000..7e8c1b8df --- /dev/null +++ b/idl/HOMARD_Cas.idl @@ -0,0 +1,107 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#ifndef _HOMARD_CAS_IDL +#define _HOMARD_CAS_IDL + +#include "SALOME_Component.idl" +#include "SALOME_Exception.idl" +#include "SALOMEDS.idl" + +#include "HOMARD_Iteration.idl" +#include "HOMARD_YACS.idl" + +module HOMARD +{ + typedef sequence extrema ; + typedef sequence ListGroupType ; + typedef sequence ListBoundaryGroupType ; + + + interface HOMARD_Cas : Engines::EngineComponent + { +// Generalites + void SetName(in string Name) raises (SALOME::SALOME_Exception); + string GetName() raises (SALOME::SALOME_Exception); + + long Delete(in long Option) raises (SALOME::SALOME_Exception); + + string GetDumpPython() raises (SALOME::SALOME_Exception); + +// Caracteristiques + void SetDirName(in string NomDir) raises (SALOME::SALOME_Exception); + string GetDirName() raises (SALOME::SALOME_Exception); + + long GetState() raises (SALOME::SALOME_Exception); + + long GetNumberofIter() raises (SALOME::SALOME_Exception); + + void SetConfType(in long ConfType) raises (SALOME::SALOME_Exception); + long GetConfType() raises (SALOME::SALOME_Exception); + + void SetExtType(in long ExtType) raises (SALOME::SALOME_Exception); + long GetExtType() raises (SALOME::SALOME_Exception); + + void SetBoundingBox(in extrema LesExtremes) raises (SALOME::SALOME_Exception); + extrema GetBoundingBox() raises (SALOME::SALOME_Exception); + + void AddGroup(in string Group) raises (SALOME::SALOME_Exception); + void SetGroups(in ListGroupType ListGroup) raises (SALOME::SALOME_Exception); + ListGroupType GetGroups() raises (SALOME::SALOME_Exception); + + void AddBoundary(in string BoundaryName) raises (SALOME::SALOME_Exception); + void AddBoundaryGroup(in string BoundaryName, in string Group) + raises (SALOME::SALOME_Exception); + ListBoundaryGroupType GetBoundaryGroup() raises (SALOME::SALOME_Exception); + void SupprBoundaryGroup() raises (SALOME::SALOME_Exception); + + void SetPyram(in long Pyram) raises (SALOME::SALOME_Exception); + long GetPyram() raises (SALOME::SALOME_Exception); + + void MeshInfo(in long Qual, in long Diam, in long Conn, in long Tail, in long Inte) + raises (SALOME::SALOME_Exception); + +// Liens avec les autres structures + string GetIter0Name () raises (SALOME::SALOME_Exception); + HOMARD_Iteration GetIter0 () raises (SALOME::SALOME_Exception); + + HOMARD_Iteration NextIteration(in string IterName) raises (SALOME::SALOME_Exception); + + HOMARD_Iteration LastIteration() raises (SALOME::SALOME_Exception); + + void AddIteration (in string IterName) raises (SALOME::SALOME_Exception); + +// YACS + HOMARD_YACS CreateYACSSchema(in string YACSName, in string ScriptFile, in string DirName, in string MeshFile) + raises (SALOME::SALOME_Exception); + + + }; +}; +#endif diff --git a/idl/HOMARD_Gen.idl b/idl/HOMARD_Gen.idl new file mode 100644 index 000000000..6571e5ba8 --- /dev/null +++ b/idl/HOMARD_Gen.idl @@ -0,0 +1,233 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef __HOMARD_GEN__ +#define __HOMARD_GEN__ + +#include "SALOME_Component.idl" +#include "SALOME_Exception.idl" +#include "SALOMEDS.idl" + +#include "HOMARD_Cas.idl" +#include "HOMARD_Hypothesis.idl" +#include "HOMARD_Iteration.idl" +#include "HOMARD_Zone.idl" +#include "HOMARD_Boundary.idl" +#include "HOMARD_YACS.idl" + +module HOMARD +{ + typedef sequence listeHypotheses; + typedef sequence listeZones; + typedef sequence listeIterations; + typedef sequence listeCases; + typedef sequence listeBoundarys; + typedef sequence listeYACSs; + + interface HOMARD_Gen : Engines::EngineComponent, SALOMEDS::Driver + { +// +// A. Les methodes qui suivent sont celles que l'on retrouvera dans +// le fichier resources/HOMARDCatalog.xml.in pour definir le composant HOMARD dans YACS +// A priori, ce sont les seules sont l'utilisateur doit connaitre l'existence. +// ATTENTION : si les noms des arguments changent dans les Createxxxx, il faudra les changer +// dans YACSDriver pour assurer la coherence +// +// A.1. Les creations +// + HOMARD_Boundary CreateBoundaryCAO (in string BoundaryName, in string FileName) + raises(SALOME::SALOME_Exception); + HOMARD_Boundary CreateBoundaryDi (in string BoundaryName, in string MeshName, in string FileName) + raises(SALOME::SALOME_Exception); + HOMARD_Boundary CreateBoundaryCylinder (in string BoundaryName, + in double Xcentre, in double Ycentre, in double Zcentre, + in double Xaxis, in double Yaxis, in double Zaxis, + in double Radius) + raises (SALOME::SALOME_Exception); + HOMARD_Boundary CreateBoundarySphere (in string BoundaryName, + in double Xcentre, in double Ycentre, in double Zcentre, + in double Radius) + raises(SALOME::SALOME_Exception); + HOMARD_Boundary CreateBoundaryConeR (in string BoundaryName, + in double Xcentre1, in double Ycentre1, in double Zcentre1, in double Radius1, + in double Xcentre2, in double Ycentre2, in double Zcentre2, in double Radius2) + raises(SALOME::SALOME_Exception); + HOMARD_Boundary CreateBoundaryConeA (in string BoundaryName, + in double Xaxis, in double Yaxis, in double Zaxis, in double Angle, + in double Xcentre, in double Ycentre, in double Zcentre) + raises(SALOME::SALOME_Exception); + HOMARD_Boundary CreateBoundaryTorus (in string BoundaryName, + in double Xcentre, in double Ycentre, in double Zcentre, + in double Xaxis, in double Yaxis, in double Zaxis, + in double RadiusRev, in double RadiusPri) + raises (SALOME::SALOME_Exception); + HOMARD_Cas CreateCase(in string CaseName, in string MeshName, in string FileName ) + raises(SALOME::SALOME_Exception); + HOMARD_Cas CreateCaseFromIteration(in string CaseName, in string DirNameStart ) + raises(SALOME::SALOME_Exception); + HOMARD_Cas CreateCaseFromCaseLastIteration(in string CaseName, in string DirNameStart ) + raises(SALOME::SALOME_Exception); + HOMARD_Cas CreateCaseFromCaseIteration(in string CaseName, in string DirNameStart, in long Number ) + raises(SALOME::SALOME_Exception); + HOMARD_Hypothesis CreateHypothesis(in string HypoName ) + raises(SALOME::SALOME_Exception); + HOMARD_Zone CreateZoneBox (in string ZoneName, + in double Xmini, in double Xmaxi, + in double Ymini, in double Ymaxi, + in double Zmini, in double Zmaxi) + raises(SALOME::SALOME_Exception); + HOMARD_Zone CreateZoneBox2D (in string ZoneName, + in double Umini, in double Umaxi, + in double Vmini, in double Vmaxi, + in long Orient) + raises(SALOME::SALOME_Exception); + HOMARD_Zone CreateZoneCylinder (in string ZoneName, + in double Xcentre, in double Ycentre, in double Zcentre, + in double Xaxis, in double Yaxis, in double Zaxis, + in double Radius, in double Height) + raises(SALOME::SALOME_Exception); + HOMARD_Zone CreateZoneDisk (in string ZoneName, + in double Ucentre, in double Vcentre, + in double Radius, in long Orient) + raises(SALOME::SALOME_Exception); + HOMARD_Zone CreateZoneDiskWithHole (in string ZoneName, + in double Ucentre, in double Vcentre, + in double Radius, in double InternalRadius, + in long Orient) + raises(SALOME::SALOME_Exception); + HOMARD_Zone CreateZonePipe (in string ZoneName, + in double Xcentre, in double Ycentre, in double Zcentre, + in double Xaxis, in double Yaxis, in double Zaxis, + in double Radius, in double Height, in double InternalRadius) + raises(SALOME::SALOME_Exception); + HOMARD_Zone CreateZoneSphere (in string ZoneName, + in double Xcentre, in double Ycentre, in double Zcentre, + in double Radius) + raises(SALOME::SALOME_Exception); +// +// A.2. Les informations +// + HOMARD_Boundary GetBoundary(in string BoundaryName) raises (SALOME::SALOME_Exception); + HOMARD_Cas GetCase(in string CaseName) raises (SALOME::SALOME_Exception); + HOMARD_Hypothesis GetHypothesis(in string HypoName) raises (SALOME::SALOME_Exception); + HOMARD_Iteration GetIteration(in string IterName) raises (SALOME::SALOME_Exception); + HOMARD_YACS GetYACS(in string YACSName) raises (SALOME::SALOME_Exception); + HOMARD_Zone GetZone(in string ZoneName) raises (SALOME::SALOME_Exception); + + listeBoundarys GetAllBoundarysName() raises (SALOME::SALOME_Exception); + listeCases GetAllCasesName() raises (SALOME::SALOME_Exception); + listeHypotheses GetAllHypothesesName() raises (SALOME::SALOME_Exception); + listeIterations GetAllIterationsName() raises (SALOME::SALOME_Exception); + listeYACSs GetAllYACSsName() raises (SALOME::SALOME_Exception); + listeZones GetAllZonesName() raises (SALOME::SALOME_Exception); + + void MeshInfo(in string CaseName, in string MeshName, in string FileName, in string DirName, in long Qual, in long Diam, in long Conn, in long Tail, in long Inte ) + raises(SALOME::SALOME_Exception); + + HOMARD_Iteration LastIteration(in string CaseName) raises (SALOME::SALOME_Exception); +// +// A.3. L'etude +// + void UpdateStudy() raises (SALOME::SALOME_Exception); +// +// A.4. Les caracteristiques generales +// + void SetLanguageShort (in string LanguageShort) raises (SALOME::SALOME_Exception); + string GetLanguageShort () raises (SALOME::SALOME_Exception); +// +// B. Les methodes qui suivent n'apparaissent pas dans le composant HOMARD dans YACS +// L'utilisateur ne devrait pas les connaitre (ni s'en servir, a fortiori) +// + HOMARD_Iteration CreateIteration(in string IterName, in string PreviousIterName ) + raises(SALOME::SALOME_Exception); +// + void InvalideBoundary (in string BoundaryName) raises (SALOME::SALOME_Exception); + void InvalideHypo (in string HypoName) raises (SALOME::SALOME_Exception); + void InvalideIter (in string IterName) raises (SALOME::SALOME_Exception); + void InvalideIterOption (in string IterName, in long Option) + raises(SALOME::SALOME_Exception); + void InvalideYACS (in string YacsName) raises (SALOME::SALOME_Exception); + void InvalideZone (in string ZoneName) raises (SALOME::SALOME_Exception); + + long DeleteBoundary (in string BoundaryName) raises (SALOME::SALOME_Exception); + long DeleteCase(in string CaseName, in long Option) + raises(SALOME::SALOME_Exception); + long DeleteHypo(in string HypoName) raises (SALOME::SALOME_Exception); + long DeleteIteration(in string IterName, in long Option) + raises(SALOME::SALOME_Exception); + long DeleteIterationOption(in string IterName, in long Option1, in long Option2) + raises(SALOME::SALOME_Exception); + long DeleteYACS(in string YacsName, in long Option) raises (SALOME::SALOME_Exception); + long DeleteZone (in string ZoneName) raises (SALOME::SALOME_Exception); +// + void AssociateIterHypo(in string IterName, in string HypoName) + raises(SALOME::SALOME_Exception); + +// + void AssociateHypoZone(in string HypoName, in string ZoneName, in long TypeUse) + raises(SALOME::SALOME_Exception); + void DissociateHypoZone(in string HypoName, in string ZoneName) + raises(SALOME::SALOME_Exception); + + long Compute (in string IterName, in long CleanOption, in long modeHOMARD, in long Option1, in long Option2) + raises(SALOME::SALOME_Exception); + +// + string CreateDirNameIter(in string NomDir, in long option ) + raises(SALOME::SALOME_Exception); + + string VerifieDir (in string NomDir) raises (SALOME::SALOME_Exception); + +// + void PublishFileUnderIteration(in string IterName, in string FileName, in string Comment) + raises(SALOME::SALOME_Exception); + void PublishBoundaryUnderCase(in string CaseName, in string BoundaryName) + raises(SALOME::SALOME_Exception); + void PublishResultInSmesh(in string FileName, in long Option) + raises(SALOME::SALOME_Exception); + void PublishMeshIterInSmesh (in string IterName) raises(SALOME::SALOME_Exception); + +// + +// +// La creation des schemas YACS + HOMARD_YACS CreateYACSSchema(in string YACSName, in string CaseName, in string ScriptFile, in string DirName, in string MeshFile) + raises(SALOME::SALOME_Exception); + long YACSWrite (in string YACSName) raises (SALOME::SALOME_Exception); + long YACSWriteOnFile (in string YACSName, in string YACSFile) + raises(SALOME::SALOME_Exception); + +// +// Les preferences + void SetPublisMesh (in long PublisMeshIN, in long PublisMeshOUT) + raises (SALOME::SALOME_Exception); + long GetPublisMeshIN () raises (SALOME::SALOME_Exception); + long GetPublisMeshOUT () raises (SALOME::SALOME_Exception); + void SetYACSMaximum(in long YACSMaxIter, in long YACSMaxNode, in long YACSMaxElem) + raises (SALOME::SALOME_Exception); + long GetYACSMaxIter() raises (SALOME::SALOME_Exception); + long GetYACSMaxNode() raises (SALOME::SALOME_Exception); + long GetYACSMaxElem() raises (SALOME::SALOME_Exception); + void SetYACSConvergenceType(in long TypeTest) raises (SALOME::SALOME_Exception); + long GetYACSConvergenceType() raises (SALOME::SALOME_Exception); + }; +}; + +#endif + diff --git a/idl/HOMARD_Hypothesis.idl b/idl/HOMARD_Hypothesis.idl new file mode 100644 index 000000000..7a95111ee --- /dev/null +++ b/idl/HOMARD_Hypothesis.idl @@ -0,0 +1,136 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#ifndef _HOMARD_HYPOTHESIS_IDL +#define _HOMARD_HYPOTHESIS_IDL + +#include "SALOME_Component.idl" +#include "SALOME_Exception.idl" +#include "SALOMEDS.idl" + +#include "HOMARD_Cas.idl" + +module HOMARD +{ + typedef sequence listeZonesHypo ; + typedef sequence listeIters ; + typedef sequence listeComposantsHypo ; + typedef sequence listeTypes ; + typedef sequence listeFieldInterpsHypo ; + + struct InfosHypo + { + string FieldName; + long UsCmpI; + long UsField; + long TypeThR; + double ThreshR; + long TypeThC; + double ThreshC; + }; + + interface HOMARD_Hypothesis : Engines::EngineComponent + { +// Generalites + void SetName(in string Name) raises (SALOME::SALOME_Exception); + string GetName() raises (SALOME::SALOME_Exception); + + long Delete() raises (SALOME::SALOME_Exception); + + string GetDumpPython() raises (SALOME::SALOME_Exception); + +// Caracteristiques + void SetUnifRefinUnRef(in long RaffDera) raises (SALOME::SALOME_Exception); + listeTypes GetAdapRefinUnRef() raises (SALOME::SALOME_Exception); + long GetAdapType() raises (SALOME::SALOME_Exception); + long GetRefinType() raises (SALOME::SALOME_Exception); + long GetUnRefType() raises (SALOME::SALOME_Exception); + + void SetField(in string FieldName) raises (SALOME::SALOME_Exception); + string GetFieldName() raises (SALOME::SALOME_Exception); + void SetUseField(in long UsField) raises (SALOME::SALOME_Exception); + InfosHypo GetField() raises (SALOME::SALOME_Exception); + + void SetUseComp(in long UsCmpI) raises (SALOME::SALOME_Exception); + void AddComp(in string NomComp) raises (SALOME::SALOME_Exception); + void SupprComp(in string NomComp) raises (SALOME::SALOME_Exception); + void SupprComps() raises (SALOME::SALOME_Exception); + listeComposantsHypo GetComps() raises (SALOME::SALOME_Exception); + + void SetRefinThr(in long TypeThR, in double ThreshR) + raises (SALOME::SALOME_Exception); + long GetRefinThrType() raises (SALOME::SALOME_Exception); + void SetUnRefThr(in long TypeThC, in double ThreshC) + raises (SALOME::SALOME_Exception); + long GetUnRefThrType() raises (SALOME::SALOME_Exception); + + void SetNivMax(in long NivMax) raises (SALOME::SALOME_Exception); + long GetNivMax() raises (SALOME::SALOME_Exception); + + void SetDiamMin(in double DiamMin) raises (SALOME::SALOME_Exception); + double GetDiamMin() raises (SALOME::SALOME_Exception); + + void SetAdapInit(in long AdapInit) raises (SALOME::SALOME_Exception); + long GetAdapInit() raises (SALOME::SALOME_Exception); + + void SetExtraOutput(in long ExtraOutput) raises (SALOME::SALOME_Exception); + long GetExtraOutput() raises (SALOME::SALOME_Exception); + + void AddGroup(in string LeGroupe) raises (SALOME::SALOME_Exception); + void SupprGroup(in string LeGroupe) raises (SALOME::SALOME_Exception); + void SupprGroups() raises (SALOME::SALOME_Exception); + void SetGroups(in ListGroupType ListGroup) raises (SALOME::SALOME_Exception); + ListGroupType GetGroups() raises (SALOME::SALOME_Exception); + + void SetTypeFieldInterp(in long TypeFieldInterp) raises (SALOME::SALOME_Exception); + long GetTypeFieldInterp() raises (SALOME::SALOME_Exception); + void AddFieldInterp(in string FieldInterp) raises (SALOME::SALOME_Exception); + void AddFieldInterpType(in string FieldInterp, in long TypeInterp) + raises (SALOME::SALOME_Exception); + void SupprFieldInterp(in string FieldInterp) raises (SALOME::SALOME_Exception); + void SupprFieldInterps() raises (SALOME::SALOME_Exception); + listeFieldInterpsHypo GetFieldInterps() raises (SALOME::SALOME_Exception); + +// Liens avec les autres structures + void SetCaseCreation(in string NomCas) raises (SALOME::SALOME_Exception); + string GetCaseCreation() raises (SALOME::SALOME_Exception); + + void LinkIteration(in string NomIteration) raises (SALOME::SALOME_Exception); + void UnLinkIteration(in string NomIteration) raises (SALOME::SALOME_Exception); + listeIters GetIterations() raises (SALOME::SALOME_Exception); + + void AddZone(in string NomZone, in long TypeUse) raises (SALOME::SALOME_Exception); + void AddZone0(in string NomZone, in long TypeUse) raises (SALOME::SALOME_Exception); + void SupprZone(in string NomZone) raises (SALOME::SALOME_Exception); + void SupprZones() raises (SALOME::SALOME_Exception); + listeZonesHypo GetZones() raises (SALOME::SALOME_Exception); + + }; +}; +#endif diff --git a/idl/HOMARD_Iteration.idl b/idl/HOMARD_Iteration.idl new file mode 100644 index 000000000..f33918cef --- /dev/null +++ b/idl/HOMARD_Iteration.idl @@ -0,0 +1,130 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#ifndef _HOMARD_ITERATION_IDL +#define _HOMARD_ITERATION_IDL + +#include "SALOME_Component.idl" +#include "SALOME_Exception.idl" +#include "SALOMEDS.idl" + +module HOMARD +{ + typedef sequence listeIterFilles ; + typedef sequence listeFieldInterpsIter ; + typedef sequence listeFieldInterpTSRsIter ; + + interface HOMARD_Iteration : Engines::EngineComponent + { +// Generalites + void SetName(in string Name) raises (SALOME::SALOME_Exception); + string GetName() raises (SALOME::SALOME_Exception); + + long Delete(in long Option) raises (SALOME::SALOME_Exception); + + string GetDumpPython() raises (SALOME::SALOME_Exception); + +// Caracteristiques + void SetDirNameLoc(in string NomDir) raises (SALOME::SALOME_Exception); + string GetDirNameLoc() raises (SALOME::SALOME_Exception); + + string GetDirName() raises (SALOME::SALOME_Exception); + + void SetNumber(in long NumIter) raises (SALOME::SALOME_Exception); + long GetNumber() raises (SALOME::SALOME_Exception); + + void SetState(in long State) raises (SALOME::SALOME_Exception); + long GetState() raises (SALOME::SALOME_Exception); + + void SetMeshName(in string NomMesh) raises (SALOME::SALOME_Exception); + string GetMeshName() raises (SALOME::SALOME_Exception); + + void SetMeshFile(in string MeshFile) raises (SALOME::SALOME_Exception); + string GetMeshFile() raises (SALOME::SALOME_Exception); + + void SetFieldFile(in string FieldFile) raises (SALOME::SALOME_Exception); + string GetFieldFile() raises (SALOME::SALOME_Exception); + +// Instants pour le champ de pilotage + void SetTimeStep(in long TimeStep) raises (SALOME::SALOME_Exception); + void SetTimeStepRank(in long TimeStep, in long Rank) + raises (SALOME::SALOME_Exception); + void SetTimeStepRankLast() raises (SALOME::SALOME_Exception); + long GetTimeStep() raises (SALOME::SALOME_Exception); + long GetRank() raises (SALOME::SALOME_Exception); + +// Instants pour un champ a interpoler + void SetFieldInterpTimeStep(in string FieldInterp, in long TimeStep) + raises (SALOME::SALOME_Exception); + void SetFieldInterpTimeStepRank(in string FieldInterp, in long TimeStep, in long Rank) + raises (SALOME::SALOME_Exception); + listeFieldInterpTSRsIter GetFieldInterpsTimeStepRank() raises (SALOME::SALOME_Exception); + void SetFieldInterp(in string FieldInterp) raises (SALOME::SALOME_Exception); + listeFieldInterpsIter GetFieldInterps() raises (SALOME::SALOME_Exception); + void SupprFieldInterps() raises (SALOME::SALOME_Exception); + +// Fichier des messages + void SetLogFile(in string LogFile) raises (SALOME::SALOME_Exception); + string GetLogFile() raises (SALOME::SALOME_Exception); + + long Compute(in long etatMenage, in long Option) raises (SALOME::SALOME_Exception); + + void MeshInfo(in long Qual, in long Diam, in long Conn, in long Tail, in long Inte) + raises (SALOME::SALOME_Exception); + void MeshInfoOption(in long Qual, in long Diam, in long Conn, in long Tail, in long Inte, in long Option) + raises (SALOME::SALOME_Exception); + + void SetFileInfo(in string FileInfo) raises (SALOME::SALOME_Exception); + string GetFileInfo() raises (SALOME::SALOME_Exception); + +// Liens avec les autres iterations + HOMARD_Iteration NextIteration(in string NomIter) raises (SALOME::SALOME_Exception); + + void LinkNextIteration(in string NomIter) raises (SALOME::SALOME_Exception); + void UnLinkNextIteration(in string NomIter) raises (SALOME::SALOME_Exception); + listeIterFilles GetIterations() raises (SALOME::SALOME_Exception); + + void SetIterParentName(in string NomIterParent) raises (SALOME::SALOME_Exception); + string GetIterParentName() raises (SALOME::SALOME_Exception); + HOMARD_Iteration GetIterParent() raises (SALOME::SALOME_Exception); + +// Liens avec les autres structures + void SetCaseName(in string NomCas) raises (SALOME::SALOME_Exception); + string GetCaseName() raises (SALOME::SALOME_Exception); + + void AssociateHypo(in string NomHypo) raises (SALOME::SALOME_Exception); + void SetHypoName(in string NomHypo) raises (SALOME::SALOME_Exception); + string GetHypoName() raises (SALOME::SALOME_Exception); + +// Divers + void SetInfoCompute(in long MessInfo) raises (SALOME::SALOME_Exception); + long GetInfoCompute() raises (SALOME::SALOME_Exception); + }; +}; +#endif diff --git a/idl/HOMARD_YACS.idl b/idl/HOMARD_YACS.idl new file mode 100644 index 000000000..29e27cb58 --- /dev/null +++ b/idl/HOMARD_YACS.idl @@ -0,0 +1,87 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#ifndef _HOMARD_YACS_IDL +#define _HOMARD_YACS_IDL + +#include "SALOME_Component.idl" +#include "SALOME_Exception.idl" +#include "SALOMEDS.idl" + +module HOMARD +{ + interface HOMARD_YACS : Engines::EngineComponent + { +// Generalites + void SetName(in string Name) raises (SALOME::SALOME_Exception); + string GetName() raises (SALOME::SALOME_Exception); + + long Delete(in long Option) raises (SALOME::SALOME_Exception); + + string GetDumpPython() raises (SALOME::SALOME_Exception); + +// Caracteristiques + void SetType (in long Type) raises (SALOME::SALOME_Exception); + long GetType() raises (SALOME::SALOME_Exception); + + void SetMaxIter (in long MaxIter) raises (SALOME::SALOME_Exception); + long GetMaxIter() raises (SALOME::SALOME_Exception); + void SetMaxNode (in long MaxNode) raises (SALOME::SALOME_Exception); + long GetMaxNode() raises (SALOME::SALOME_Exception); + void SetMaxElem (in long MaxElem) raises (SALOME::SALOME_Exception); + long GetMaxElem() raises (SALOME::SALOME_Exception); + + void SetTestConvergence (in long TypeTest, in double VRef) + raises (SALOME::SALOME_Exception); + long GetTestConvergenceType() raises (SALOME::SALOME_Exception); + double GetTestConvergenceVRef() raises (SALOME::SALOME_Exception); + + void SetDirName(in string NomDir) raises (SALOME::SALOME_Exception); + string GetDirName() raises (SALOME::SALOME_Exception); + + void SetMeshFile(in string MeshFile) raises (SALOME::SALOME_Exception); + string GetMeshFile() raises (SALOME::SALOME_Exception); + + void SetScriptFile(in string ScriptFile) raises (SALOME::SALOME_Exception); + string GetScriptFile() raises (SALOME::SALOME_Exception); + + void SetXMLFile(in string XMLFile) raises (SALOME::SALOME_Exception); + string GetXMLFile() raises (SALOME::SALOME_Exception); + + long Write() raises (SALOME::SALOME_Exception); + long WriteOnFile( in string YACSFile ) raises (SALOME::SALOME_Exception); + +// Liens avec les autres structures + void SetCaseName(in string NomCas) raises (SALOME::SALOME_Exception); + string GetCaseName() raises (SALOME::SALOME_Exception); + +// Divers + }; +}; +#endif diff --git a/idl/HOMARD_Zone.idl b/idl/HOMARD_Zone.idl new file mode 100644 index 000000000..7a5d3ea18 --- /dev/null +++ b/idl/HOMARD_Zone.idl @@ -0,0 +1,83 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#ifndef _HOMARD_Zone_IDL +#define _HOMARD_Zone_IDL + +#include "SALOME_Component.idl" +#include "SALOME_Exception.idl" +#include "SALOMEDS.idl" + +module HOMARD +{ + typedef sequence double_array ; + typedef sequence listeHypo ; + + interface HOMARD_Zone : Engines::EngineComponent + { +// Generalites + void SetName(in string Name) raises (SALOME::SALOME_Exception); + string GetName() raises (SALOME::SALOME_Exception); + + long Delete() raises (SALOME::SALOME_Exception); + + string GetDumpPython() raises (SALOME::SALOME_Exception); + +// Caracteristiques + void SetType (in long Type) raises (SALOME::SALOME_Exception); + long GetType() raises (SALOME::SALOME_Exception); + + void SetBox (in double Xmini, in double Xmaxi, in double Ymini, + in double Ymaxi, in double Zmini, in double Zmaxi) + raises (SALOME::SALOME_Exception); + void SetCylinder (in double Xcentre, in double Ycentre, in double Zcentre, + in double Xaxis, in double Yaxis, in double Zaxis, + in double Rayon, in double Haut) + raises (SALOME::SALOME_Exception); + void SetPipe( in double Xcentre, in double Ycentre, in double ZCentre, + in double Xaxis, in double Yaxis, in double Zaxis, + in double Rayon, in double Haut, in double Rayonint ) + raises (SALOME::SALOME_Exception); + void SetSphere (in double Xcentre, in double Ycentre, in double Zcentre, in double rayon) + raises (SALOME::SALOME_Exception); + + double_array GetCoords() raises (SALOME::SALOME_Exception); + + void SetLimit (in double Xincr, in double Yincr, in double Zincr) + raises (SALOME::SALOME_Exception); + double_array GetLimit() raises (SALOME::SALOME_Exception); + +// Liens avec les autres structures + void AddHypo(in string NomHypo) raises (SALOME::SALOME_Exception); + listeHypo GetHypo() raises (SALOME::SALOME_Exception); + void SupprHypo(in string NomHypo) raises (SALOME::SALOME_Exception); + + }; +}; +#endif From a174b69248f13abe64bb0939dfec3fc55ae78aec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Wed, 20 May 2020 17:28:22 +0200 Subject: [PATCH 004/100] Transfert brutal des sources du module HOMARD --- CMakeLists.txt | 10 + src/ADAPT/CMakeLists.txt | 75 + src/ADAPT/HOMARD.hxx | 53 + src/ADAPT/HOMARD_Boundary.cxx | 324 ++ src/ADAPT/HOMARD_Boundary.hxx | 111 + src/ADAPT/HOMARD_Cas.cxx | 283 ++ src/ADAPT/HOMARD_Cas.hxx | 112 + src/ADAPT/HOMARD_DriverTools.cxx | 840 ++++ src/ADAPT/HOMARD_DriverTools.hxx | 76 + src/ADAPT/HOMARD_Gen.cxx | 41 + src/ADAPT/HOMARD_Gen.hxx | 37 + src/ADAPT/HOMARD_Hypothesis.cxx | 524 +++ src/ADAPT/HOMARD_Hypothesis.hxx | 157 + src/ADAPT/HOMARD_Iteration.cxx | 394 ++ src/ADAPT/HOMARD_Iteration.hxx | 139 + src/ADAPT/HOMARD_YACS.cxx | 219 + src/ADAPT/HOMARD_YACS.hxx | 103 + src/ADAPT/HOMARD_Zone.cxx | 325 ++ src/ADAPT/HOMARD_Zone.hxx | 95 + src/ADAPT/HomardDriver.cxx | 1106 +++++ src/ADAPT/HomardDriver.hxx | 85 + src/ADAPT/YACSDriver.cxx | 684 +++ src/ADAPT/YACSDriver.hxx | 68 + src/ADAPTGUI/ADAPT_msg_en.ts | 459 ++ src/ADAPTGUI/ADAPT_msg_fr.ts | 1171 +++++ src/ADAPTGUI/ADAPT_msg_ja.ts | 1148 +++++ src/ADAPTGUI/CMakeLists.txt | 177 + src/ADAPTGUI/CreateBoundaryAn.ui | 1107 +++++ src/ADAPTGUI/CreateBoundaryCAO.ui | 133 + src/ADAPTGUI/CreateBoundaryDi.ui | 133 + src/ADAPTGUI/CreateCase.ui | 777 ++++ src/ADAPTGUI/CreateHypothesis.ui | 1111 +++++ src/ADAPTGUI/CreateIteration.ui | 600 +++ src/ADAPTGUI/CreateListGroup.ui | 121 + src/ADAPTGUI/CreateYACS.ui | 526 +++ src/ADAPTGUI/CreateZone.ui | 1139 +++++ src/ADAPTGUI/EditFile.ui | 115 + src/ADAPTGUI/HOMARDGUI.cxx | 909 ++++ src/ADAPTGUI/HOMARDGUI.h | 105 + src/ADAPTGUI/HOMARDGUI_Exports.hxx | 35 + src/ADAPTGUI/HOMARDGUI_Utils.cxx | 278 ++ src/ADAPTGUI/HOMARDGUI_Utils.h | 90 + src/ADAPTGUI/HomardQtCommun.cxx | 453 ++ src/ADAPTGUI/HomardQtCommun.h | 58 + src/ADAPTGUI/IterInfo.ui | 129 + src/ADAPTGUI/MeshInfo.ui | 285 ++ src/ADAPTGUI/MonCreateBoundaryAn.cxx | 809 ++++ src/ADAPTGUI/MonCreateBoundaryAn.h | 96 + src/ADAPTGUI/MonCreateBoundaryCAO.cxx | 202 + src/ADAPTGUI/MonCreateBoundaryCAO.h | 73 + src/ADAPTGUI/MonCreateBoundaryDi.cxx | 211 + src/ADAPTGUI/MonCreateBoundaryDi.h | 73 + src/ADAPTGUI/MonCreateCase.cxx | 694 +++ src/ADAPTGUI/MonCreateCase.h | 102 + src/ADAPTGUI/MonCreateHypothesis.cxx | 945 +++++ src/ADAPTGUI/MonCreateHypothesis.h | 138 + src/ADAPTGUI/MonCreateIteration.cxx | 339 ++ src/ADAPTGUI/MonCreateIteration.h | 78 + src/ADAPTGUI/MonCreateListGroup.cxx | 153 + src/ADAPTGUI/MonCreateListGroup.h | 64 + src/ADAPTGUI/MonCreateListGroupCAO.cxx | 150 + src/ADAPTGUI/MonCreateListGroupCAO.h | 64 + src/ADAPTGUI/MonCreateYACS.cxx | 342 ++ src/ADAPTGUI/MonCreateYACS.h | 84 + src/ADAPTGUI/MonCreateZone.cxx | 713 ++++ src/ADAPTGUI/MonCreateZone.h | 87 + src/ADAPTGUI/MonEditBoundaryAn.cxx | 399 ++ src/ADAPTGUI/MonEditBoundaryAn.h | 61 + src/ADAPTGUI/MonEditBoundaryCAO.cxx | 105 + src/ADAPTGUI/MonEditBoundaryCAO.h | 51 + src/ADAPTGUI/MonEditBoundaryDi.cxx | 105 + src/ADAPTGUI/MonEditBoundaryDi.h | 51 + src/ADAPTGUI/MonEditCase.cxx | 269 ++ src/ADAPTGUI/MonEditCase.h | 50 + src/ADAPTGUI/MonEditFile.cxx | 119 + src/ADAPTGUI/MonEditFile.h | 64 + src/ADAPTGUI/MonEditHypothesis.cxx | 463 ++ src/ADAPTGUI/MonEditHypothesis.h | 56 + src/ADAPTGUI/MonEditIteration.cxx | 186 + src/ADAPTGUI/MonEditIteration.h | 57 + src/ADAPTGUI/MonEditListGroup.cxx | 61 + src/ADAPTGUI/MonEditListGroup.h | 49 + src/ADAPTGUI/MonEditListGroupCAO.cxx | 61 + src/ADAPTGUI/MonEditListGroupCAO.h | 49 + src/ADAPTGUI/MonEditYACS.cxx | 148 + src/ADAPTGUI/MonEditYACS.h | 50 + src/ADAPTGUI/MonEditZone.cxx | 432 ++ src/ADAPTGUI/MonEditZone.h | 59 + src/ADAPTGUI/MonIterInfo.cxx | 175 + src/ADAPTGUI/MonIterInfo.h | 78 + src/ADAPTGUI/MonMeshInfo.cxx | 281 ++ src/ADAPTGUI/MonMeshInfo.h | 76 + src/ADAPTGUI/MonPursueIteration.cxx | 288 ++ src/ADAPTGUI/MonPursueIteration.h | 72 + src/ADAPTGUI/PursueIteration.ui | 252 ++ src/ADAPT_I/CMakeLists.txt | 93 + src/ADAPT_I/HOMARD_Boundary_i.cxx | 262 ++ src/ADAPT_I/HOMARD_Boundary_i.hxx | 112 + src/ADAPT_I/HOMARD_Cas_i.cxx | 599 +++ src/ADAPT_I/HOMARD_Cas_i.hxx | 119 + src/ADAPT_I/HOMARD_Gen_i.cxx | 5432 ++++++++++++++++++++++++ src/ADAPT_I/HOMARD_Gen_i.hxx | 347 ++ src/ADAPT_I/HOMARD_Hypothesis_i.cxx | 506 +++ src/ADAPT_I/HOMARD_Hypothesis_i.hxx | 138 + src/ADAPT_I/HOMARD_Iteration_i.cxx | 465 ++ src/ADAPT_I/HOMARD_Iteration_i.hxx | 145 + src/ADAPT_I/HOMARD_YACS_i.cxx | 279 ++ src/ADAPT_I/HOMARD_YACS_i.hxx | 112 + src/ADAPT_I/HOMARD_Zone_i.cxx | 218 + src/ADAPT_I/HOMARD_Zone_i.hxx | 104 + src/ADAPT_I/HOMARD_i.hxx | 35 + src/ADAPT_I/HomardMedCommun.cxx | 335 ++ src/ADAPT_I/HomardMedCommun.h | 32 + src/CMakeLists.txt | 3 + 114 files changed, 35840 insertions(+) create mode 100644 src/ADAPT/CMakeLists.txt create mode 100644 src/ADAPT/HOMARD.hxx create mode 100644 src/ADAPT/HOMARD_Boundary.cxx create mode 100644 src/ADAPT/HOMARD_Boundary.hxx create mode 100644 src/ADAPT/HOMARD_Cas.cxx create mode 100644 src/ADAPT/HOMARD_Cas.hxx create mode 100644 src/ADAPT/HOMARD_DriverTools.cxx create mode 100644 src/ADAPT/HOMARD_DriverTools.hxx create mode 100644 src/ADAPT/HOMARD_Gen.cxx create mode 100644 src/ADAPT/HOMARD_Gen.hxx create mode 100644 src/ADAPT/HOMARD_Hypothesis.cxx create mode 100644 src/ADAPT/HOMARD_Hypothesis.hxx create mode 100644 src/ADAPT/HOMARD_Iteration.cxx create mode 100644 src/ADAPT/HOMARD_Iteration.hxx create mode 100644 src/ADAPT/HOMARD_YACS.cxx create mode 100644 src/ADAPT/HOMARD_YACS.hxx create mode 100644 src/ADAPT/HOMARD_Zone.cxx create mode 100644 src/ADAPT/HOMARD_Zone.hxx create mode 100644 src/ADAPT/HomardDriver.cxx create mode 100644 src/ADAPT/HomardDriver.hxx create mode 100644 src/ADAPT/YACSDriver.cxx create mode 100644 src/ADAPT/YACSDriver.hxx create mode 100644 src/ADAPTGUI/ADAPT_msg_en.ts create mode 100644 src/ADAPTGUI/ADAPT_msg_fr.ts create mode 100644 src/ADAPTGUI/ADAPT_msg_ja.ts create mode 100644 src/ADAPTGUI/CMakeLists.txt create mode 100644 src/ADAPTGUI/CreateBoundaryAn.ui create mode 100644 src/ADAPTGUI/CreateBoundaryCAO.ui create mode 100644 src/ADAPTGUI/CreateBoundaryDi.ui create mode 100644 src/ADAPTGUI/CreateCase.ui create mode 100644 src/ADAPTGUI/CreateHypothesis.ui create mode 100644 src/ADAPTGUI/CreateIteration.ui create mode 100644 src/ADAPTGUI/CreateListGroup.ui create mode 100644 src/ADAPTGUI/CreateYACS.ui create mode 100644 src/ADAPTGUI/CreateZone.ui create mode 100644 src/ADAPTGUI/EditFile.ui create mode 100644 src/ADAPTGUI/HOMARDGUI.cxx create mode 100644 src/ADAPTGUI/HOMARDGUI.h create mode 100644 src/ADAPTGUI/HOMARDGUI_Exports.hxx create mode 100644 src/ADAPTGUI/HOMARDGUI_Utils.cxx create mode 100644 src/ADAPTGUI/HOMARDGUI_Utils.h create mode 100644 src/ADAPTGUI/HomardQtCommun.cxx create mode 100644 src/ADAPTGUI/HomardQtCommun.h create mode 100644 src/ADAPTGUI/IterInfo.ui create mode 100644 src/ADAPTGUI/MeshInfo.ui create mode 100644 src/ADAPTGUI/MonCreateBoundaryAn.cxx create mode 100644 src/ADAPTGUI/MonCreateBoundaryAn.h create mode 100644 src/ADAPTGUI/MonCreateBoundaryCAO.cxx create mode 100644 src/ADAPTGUI/MonCreateBoundaryCAO.h create mode 100644 src/ADAPTGUI/MonCreateBoundaryDi.cxx create mode 100644 src/ADAPTGUI/MonCreateBoundaryDi.h create mode 100644 src/ADAPTGUI/MonCreateCase.cxx create mode 100644 src/ADAPTGUI/MonCreateCase.h create mode 100644 src/ADAPTGUI/MonCreateHypothesis.cxx create mode 100644 src/ADAPTGUI/MonCreateHypothesis.h create mode 100644 src/ADAPTGUI/MonCreateIteration.cxx create mode 100644 src/ADAPTGUI/MonCreateIteration.h create mode 100644 src/ADAPTGUI/MonCreateListGroup.cxx create mode 100644 src/ADAPTGUI/MonCreateListGroup.h create mode 100644 src/ADAPTGUI/MonCreateListGroupCAO.cxx create mode 100644 src/ADAPTGUI/MonCreateListGroupCAO.h create mode 100644 src/ADAPTGUI/MonCreateYACS.cxx create mode 100644 src/ADAPTGUI/MonCreateYACS.h create mode 100644 src/ADAPTGUI/MonCreateZone.cxx create mode 100644 src/ADAPTGUI/MonCreateZone.h create mode 100644 src/ADAPTGUI/MonEditBoundaryAn.cxx create mode 100644 src/ADAPTGUI/MonEditBoundaryAn.h create mode 100644 src/ADAPTGUI/MonEditBoundaryCAO.cxx create mode 100644 src/ADAPTGUI/MonEditBoundaryCAO.h create mode 100644 src/ADAPTGUI/MonEditBoundaryDi.cxx create mode 100644 src/ADAPTGUI/MonEditBoundaryDi.h create mode 100644 src/ADAPTGUI/MonEditCase.cxx create mode 100644 src/ADAPTGUI/MonEditCase.h create mode 100644 src/ADAPTGUI/MonEditFile.cxx create mode 100644 src/ADAPTGUI/MonEditFile.h create mode 100644 src/ADAPTGUI/MonEditHypothesis.cxx create mode 100644 src/ADAPTGUI/MonEditHypothesis.h create mode 100644 src/ADAPTGUI/MonEditIteration.cxx create mode 100644 src/ADAPTGUI/MonEditIteration.h create mode 100644 src/ADAPTGUI/MonEditListGroup.cxx create mode 100644 src/ADAPTGUI/MonEditListGroup.h create mode 100644 src/ADAPTGUI/MonEditListGroupCAO.cxx create mode 100644 src/ADAPTGUI/MonEditListGroupCAO.h create mode 100644 src/ADAPTGUI/MonEditYACS.cxx create mode 100644 src/ADAPTGUI/MonEditYACS.h create mode 100644 src/ADAPTGUI/MonEditZone.cxx create mode 100644 src/ADAPTGUI/MonEditZone.h create mode 100644 src/ADAPTGUI/MonIterInfo.cxx create mode 100644 src/ADAPTGUI/MonIterInfo.h create mode 100644 src/ADAPTGUI/MonMeshInfo.cxx create mode 100644 src/ADAPTGUI/MonMeshInfo.h create mode 100644 src/ADAPTGUI/MonPursueIteration.cxx create mode 100644 src/ADAPTGUI/MonPursueIteration.h create mode 100644 src/ADAPTGUI/PursueIteration.ui create mode 100644 src/ADAPT_I/CMakeLists.txt create mode 100644 src/ADAPT_I/HOMARD_Boundary_i.cxx create mode 100644 src/ADAPT_I/HOMARD_Boundary_i.hxx create mode 100644 src/ADAPT_I/HOMARD_Cas_i.cxx create mode 100644 src/ADAPT_I/HOMARD_Cas_i.hxx create mode 100644 src/ADAPT_I/HOMARD_Gen_i.cxx create mode 100644 src/ADAPT_I/HOMARD_Gen_i.hxx create mode 100644 src/ADAPT_I/HOMARD_Hypothesis_i.cxx create mode 100644 src/ADAPT_I/HOMARD_Hypothesis_i.hxx create mode 100644 src/ADAPT_I/HOMARD_Iteration_i.cxx create mode 100644 src/ADAPT_I/HOMARD_Iteration_i.hxx create mode 100644 src/ADAPT_I/HOMARD_YACS_i.cxx create mode 100644 src/ADAPT_I/HOMARD_YACS_i.hxx create mode 100644 src/ADAPT_I/HOMARD_Zone_i.cxx create mode 100644 src/ADAPT_I/HOMARD_Zone_i.hxx create mode 100644 src/ADAPT_I/HOMARD_i.hxx create mode 100644 src/ADAPT_I/HomardMedCommun.cxx create mode 100644 src/ADAPT_I/HomardMedCommun.h diff --git a/CMakeLists.txt b/CMakeLists.txt index e2434f379..f41109eb9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -276,6 +276,16 @@ MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED) MARK_AS_ADVANCED(SALOME_INSTALL_AMCONFIG_LOCAL SALOME_INSTALL_DOC) MARK_AS_ADVANCED(SALOME_SMESH_INSTALL_RES_DATA SALOME_SMESH_INSTALL_PLUGINS) +# Specific to ADAPT: +# SET(SALOME_ADAPT_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/adapt" CACHE PATH +# "Install path: SALOME ADAPT specific data") +SET(SALOME_ADAPT_INSTALL_SAMPLES share/salome/adaptsamples CACHE PATH + "Install path: SALOME ADAPT samples") +SET(SALOME_ADAPT_INSTALL_TEST ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test CACHE PATH + "Install path: SALOME ADAPT Test files") +SET(SALOME_ADAPT_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/adapt" CACHE PATH + "Install path: SALOME ADAPT specific data") + # Accumulate environment variables for SMESH module SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS} ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON} diff --git a/src/ADAPT/CMakeLists.txt b/src/ADAPT/CMakeLists.txt new file mode 100644 index 000000000..bc90a1aa0 --- /dev/null +++ b/src/ADAPT/CMakeLists.txt @@ -0,0 +1,75 @@ +# Copyright (C) 2012-2020 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# --- options --- +# additional include directories +INCLUDE_DIRECTORIES( + ${KERNEL_INCLUDE_DIRS} +) + +# additional preprocessor / compiler flags +ADD_DEFINITIONS( + ${KERNEL_DEFINITIONS} +) + +# libraries to link to +SET(_link_LIBRARIES + ${KERNEL_SALOMELocalTrace} +) + +# --- headers --- + +# header files +SET(ADAPTImpl_HEADERS + HOMARD.hxx + HOMARD_Cas.hxx + HOMARD_Boundary.hxx + HOMARD_Hypothesis.hxx + HOMARD_Iteration.hxx + HOMARD_Zone.hxx + HOMARD_Gen.hxx + HOMARD_DriverTools.hxx + HOMARD_YACS.hxx + HomardDriver.hxx + YACSDriver.hxx +) + +# --- sources --- + +# sources / static +SET(ADAPTImpl_SOURCES + HOMARD_Cas.cxx + HOMARD_Boundary.cxx + HOMARD_Hypothesis.cxx + HOMARD_Iteration.cxx + HOMARD_Zone.cxx + HOMARD_Gen.cxx + HOMARD_DriverTools.cxx + HOMARD_YACS.cxx + HomardDriver.cxx + YACSDriver.cxx +) + +# --- rules --- + +ADD_LIBRARY(ADAPTImpl ${ADAPTImpl_SOURCES}) +TARGET_LINK_LIBRARIES(ADAPTImpl ${_link_LIBRARIES} ) +INSTALL(TARGETS ADAPTImpl EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) + +INSTALL(FILES ${ADAPTImpl_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) diff --git a/src/ADAPT/HOMARD.hxx b/src/ADAPT/HOMARD.hxx new file mode 100644 index 000000000..012f212b4 --- /dev/null +++ b/src/ADAPT/HOMARD.hxx @@ -0,0 +1,53 @@ +// HOMARD HOMARD : implementation of HOMARD idl descriptions +// +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : HOMARD.hxx +// Author : Gerald NICOLAS, EDF +// Module : HOMARD + +#ifndef _HOMARD_HXX_ +#define _HOMARD_HXX_ + +// C'est le ASSERT de SALOMELocalTrace/utilities.h dans KERNEL +#ifndef VERIFICATION +#define VERIFICATION(condition) \ + if (!(condition)){INTERRUPTION("CONDITION "<<#condition<<" NOT VERIFIED")} +#endif /* VERIFICATION */ + +#ifdef WIN32 + #if defined HOMARDIMPL_EXPORTS || defined HOMARDImpl_EXPORTS + #define HOMARDIMPL_EXPORT __declspec( dllexport ) + #else + #define HOMARDIMPL_EXPORT __declspec( dllimport ) + #endif +#else + #define HOMARDIMPL_EXPORT +#endif + +// La gestion des repertoires +#ifndef CHDIR + #ifdef WIN32 + #define CHDIR _chdir + #else + #define CHDIR chdir + #endif +#endif + +#endif diff --git a/src/ADAPT/HOMARD_Boundary.cxx b/src/ADAPT/HOMARD_Boundary.cxx new file mode 100644 index 000000000..0115278db --- /dev/null +++ b/src/ADAPT/HOMARD_Boundary.cxx @@ -0,0 +1,324 @@ +// HOMARD HOMARD : implementation of HOMARD idl descriptions +// +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : HOMARD_Boundary.cxx +// Author : Gerald NICOLAS, EDF +// Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier + +#include "HOMARD_Boundary.hxx" +#include "HOMARD.hxx" +#include "utilities.h" + +//============================================================================= +/*! + * default constructor: + */ +//============================================================================= +HOMARD_Boundary::HOMARD_Boundary(): + _Name( "" ),_Type( 1 ), + _Xmin( 0 ), _Xmax( 0 ), _Ymin( 0 ), _Ymax( 0 ), _Zmin( 0 ), _Zmax( 0 ), + _Xaxe( 0 ), _Yaxe( 0 ), _Zaxe( 0 ), + _Xcentre( 0 ), _Ycentre( 0 ), _Zcentre( 0 ), _rayon( 0 ), + _Xincr( 0 ), _Yincr( 0 ), _Zincr( 0 ) +{ + MESSAGE("HOMARD_Boundary"); +} + +//============================================================================= +HOMARD_Boundary::~HOMARD_Boundary() +{ + MESSAGE("~HOMARD_Boundary"); +} +//============================================================================= +//============================================================================= +// Generalites +//============================================================================= +//============================================================================= +void HOMARD_Boundary::SetName( const char* Name ) +{ + _Name = std::string( Name ); +} +//============================================================================= +std::string HOMARD_Boundary::GetName() const +{ + return _Name; +} +//============================================================================= +std::string HOMARD_Boundary::GetDumpPython() const +{ + std::ostringstream aScript; + aScript << "\n# Creation of the "; +// + switch (_Type) + { + case -1: + { + aScript << "CAO boundary " << _Name << "\n"; + aScript << "\t" << _Name << " = homard.CreateBoundaryCAO(\"" << _Name << "\", "; + aScript << "\"" << _DataFile << "\")\n"; + break ; + } + case 0: + { + aScript << "discrete boundary " << _Name << "\n"; + aScript << "\t" << _Name << " = homard.CreateBoundaryDi(\"" << _Name << "\", "; + aScript << "\"" << _MeshName << "\", "; + aScript << "\"" << _DataFile << "\")\n"; + break ; + } + case 1: + { + aScript << "cylinder " << _Name << "\n"; + aScript << "\t" << _Name << " = homard.CreateBoundaryCylinder(\"" << _Name << "\", "; + aScript << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Xaxe << ", " << _Yaxe << ", " << _Zaxe << ", " << _rayon << ")\n"; + break ; + } + case 2: + { + aScript << "sphere " << _Name << "\n"; + aScript << "\t" << _Name << " = homard.CreateBoundarySphere(\"" << _Name << "\", "; + aScript << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _rayon << ")\n"; + break ; + } + case 3: + { + aScript << "cone " << _Name << "\n"; + aScript << "\t" << _Name << " = homard.CreateBoundaryConeA(\"" << _Name << "\", "; + aScript << _Xaxe << ", " << _Yaxe << ", " << _Zaxe << ", " << _Angle << ", " << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ")\n"; + break ; + } + case 4: + { + aScript << "cone " << _Name << "\n"; + aScript << "\t" << _Name << " = homard.CreateBoundaryConeR(\"" << _Name << "\", "; + aScript << _Xcentre1 << ", " << _Ycentre1 << ", " << _Zcentre1 << ", " << _Rayon1 << ", " << _Xcentre2 << ", " << _Ycentre2 << ", " << _Zcentre2 << ", " << _Rayon2 << ")\n"; + break ; + } + case 5: + { + aScript << "tore " << _Name << "\n"; + aScript << "\t" << _Name << " = homard.CreateBoundaryTorus(\"" << _Name << "\", "; + aScript << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Xaxe << ", " << _Yaxe << ", " << _Zaxe << ", " << _Rayon1 << ", " << _Rayon2 << ")\n"; + break ; + } + } + + return aScript.str(); +} +//============================================================================= +//============================================================================= +// Caracteristiques +//============================================================================= +//============================================================================= +void HOMARD_Boundary::SetType( int Type ) +{ + _Type = Type; +} +//============================================================================= +int HOMARD_Boundary::GetType() const +{ + return _Type; +} +//============================================================================= +void HOMARD_Boundary::SetMeshName( const char* MeshName ) +{ + _MeshName = std::string( MeshName ); +} +//============================================================================= +std::string HOMARD_Boundary::GetMeshName() const +{ + return _MeshName; +} +//============================================================================= +void HOMARD_Boundary::SetDataFile( const char* DataFile ) +{ + _DataFile = std::string( DataFile ); +} +//============================================================================= +std::string HOMARD_Boundary::GetDataFile() const +{ + return _DataFile; +} +//======================================================================================= +void HOMARD_Boundary::SetCylinder( double X0, double X1, double X2, + double X3, double X4, double X5, double X6 ) +{ + _Xcentre = X0; _Ycentre = X1; _Zcentre = X2; + _Xaxe = X3; _Yaxe = X4; _Zaxe = X5; + _rayon = X6; +} +//====================================================================== +void HOMARD_Boundary::SetSphere( double X0, double X1, double X2, double X3 ) +{ + _Xcentre = X0; _Ycentre = X1; _Zcentre = X2; + _rayon = X3; +} +//====================================================================== +void HOMARD_Boundary::SetConeR( double Xcentre1, double Ycentre1, double Zcentre1, double Rayon1, + double Xcentre2, double Ycentre2, double Zcentre2, double Rayon2) +{ + _Xcentre1 = Xcentre1; _Ycentre1 = Ycentre1; _Zcentre1 = Zcentre1; + _Rayon1 = Rayon1; + _Xcentre2 = Xcentre2; _Ycentre2 = Ycentre2; _Zcentre2 = Zcentre2; + _Rayon2 = Rayon2; +} +//====================================================================== +void HOMARD_Boundary::SetConeA( double Xaxe, double Yaxe, double Zaxe, double Angle, + double Xcentre, double Ycentre, double Zcentre) +{ + _Xaxe = Xaxe; _Yaxe = Yaxe; _Zaxe = Zaxe; + _Angle = Angle; + _Xcentre = Xcentre; _Ycentre = Ycentre; _Zcentre = Zcentre; +} +//======================================================================================= +void HOMARD_Boundary::SetTorus( double X0, double X1, double X2, + double X3, double X4, double X5, double X6, double X7 ) +{ + _Xcentre = X0; _Ycentre = X1; _Zcentre = X2; + _Xaxe = X3; _Yaxe = X4; _Zaxe = X5; + _Rayon1 = X6; + _Rayon2 = X7; +} +//======================================================================================= +std::vector HOMARD_Boundary::GetCoords() const +{ + std::vector mesCoor; +// + switch (_Type) + { +// Cylindre + case 1: + { + mesCoor.push_back( _Xcentre ); + mesCoor.push_back( _Ycentre ); + mesCoor.push_back( _Zcentre ); + mesCoor.push_back( _Xaxe ); + mesCoor.push_back( _Yaxe ); + mesCoor.push_back( _Zaxe ); + mesCoor.push_back( _rayon ); + break ; + } +// Sphere + case 2: + { + mesCoor.push_back( _Xcentre ); + mesCoor.push_back( _Ycentre ); + mesCoor.push_back( _Zcentre ); + mesCoor.push_back( _rayon ); + break ; + } +// Cone defini par un axe et un angle + case 3: + { + mesCoor.push_back( _Xaxe ); + mesCoor.push_back( _Yaxe ); + mesCoor.push_back( _Zaxe ); + mesCoor.push_back( _Angle ); + mesCoor.push_back( _Xcentre ); + mesCoor.push_back( _Ycentre ); + mesCoor.push_back( _Zcentre ); + break ; + } +// Cone defini par les 2 rayons + case 4: + { + mesCoor.push_back( _Xcentre1 ); + mesCoor.push_back( _Ycentre1 ); + mesCoor.push_back( _Zcentre1 ); + mesCoor.push_back( _Rayon1 ); + mesCoor.push_back( _Xcentre2 ); + mesCoor.push_back( _Ycentre2 ); + mesCoor.push_back( _Zcentre2 ); + mesCoor.push_back( _Rayon2 ); + break ; + } +// Tore + case 5: + { + mesCoor.push_back( _Xcentre ); + mesCoor.push_back( _Ycentre ); + mesCoor.push_back( _Zcentre ); + mesCoor.push_back( _Xaxe ); + mesCoor.push_back( _Yaxe ); + mesCoor.push_back( _Zaxe ); + mesCoor.push_back( _Rayon1 ); + mesCoor.push_back( _Rayon2 ); + break ; + } + VERIFICATION( (_Type>=1) && (_Type<=5) ) ; + } + return mesCoor; +} +//====================================================================== +void HOMARD_Boundary::SetLimit( double X0, double X1, double X2 ) +{ + _Xincr = X0; _Yincr = X1; _Zincr = X2; +} +//======================================================================================= +std::vector HOMARD_Boundary::GetLimit() const +{ + std::vector mesLimit; + mesLimit.push_back( _Xincr ); + mesLimit.push_back( _Yincr ); + mesLimit.push_back( _Zincr ); + return mesLimit; +} +//============================================================================= +void HOMARD_Boundary::AddGroup( const char* Group) +{ + _ListGroupSelected.push_back(Group); +} +//============================================================================= +void HOMARD_Boundary::SetGroups( const std::list& ListGroup ) +{ + _ListGroupSelected.clear(); + std::list::const_iterator it = ListGroup.begin(); + while(it != ListGroup.end()) + _ListGroupSelected.push_back((*it++)); +} +//============================================================================= +const std::list& HOMARD_Boundary::GetGroups() const +{ + return _ListGroupSelected; +} +//============================================================================= +//============================================================================= +// Liens avec les autres structures +//============================================================================= +//============================================================================= +void HOMARD_Boundary::SetCaseCreation( const char* NomCasCreation ) +{ + _NomCasCreation = std::string( NomCasCreation ); +} +//============================================================================= +std::string HOMARD_Boundary::GetCaseCreation() const +{ + return _NomCasCreation; +} +//============================================================================= diff --git a/src/ADAPT/HOMARD_Boundary.hxx b/src/ADAPT/HOMARD_Boundary.hxx new file mode 100644 index 000000000..ddbffae6b --- /dev/null +++ b/src/ADAPT/HOMARD_Boundary.hxx @@ -0,0 +1,111 @@ +// HOMARD HOMARD : implementation of HOMARD idl descriptions +// +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : HOMARD_Boundary.hxx +// Author : Gerald NICOLAS, EDF +// Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier + +#ifndef _HOMARD_Boundary_HXX_ +#define _HOMARD_Boundary_HXX_ + +#include "HOMARD.hxx" + +#include +#include +#include + +#if defined WIN32 +#pragma warning ( disable: 4251 ) +#endif + +class HOMARDIMPL_EXPORT HOMARD_Boundary +{ +public: + HOMARD_Boundary(); + ~HOMARD_Boundary(); + +// Generalites + void SetName( const char* Name ); + std::string GetName() const; + + std::string GetDumpPython() const; + +// Caracteristiques + void SetType( int Type ); + int GetType() const; + + void SetMeshName( const char* MeshName ); + std::string GetMeshName() const; + + void SetDataFile( const char* DataFile ); + std::string GetDataFile() const; + + void SetCylinder( double X0, double X1, double X2, double X3, + double X4, double X5, double X6 ); + void SetSphere( double X0, double X1, double X2, double X3 ); + void SetConeR( double Xcentre1, double Ycentre1, double Zcentre1, double Rayon1, + double Xcentre2, double Ycentre2, double Zcentre2, double Rayon2); + void SetConeA( double Xaxe, double Yaxe, double Zaxe, double Angle, + double Xcentre, double Ycentre, double ZCentre); + void SetTorus( double X0, double X1, double X2, double X3, + double X4, double X5, double X6, double X7 ); + + std::vector GetCoords() const; + + void SetLimit( double X0, double X1, double X2 ); + std::vector GetLimit() const; + + void AddGroup( const char* LeGroupe); + void SetGroups(const std::list& ListGroup ); + const std::list& GetGroups() const; + +// Liens avec les autres structures + std::string GetCaseCreation() const; + void SetCaseCreation( const char* NomCasCreation ); + +private: + std::string _Name; + std::string _NomCasCreation; + std::string _DataFile; + std::string _MeshName; + int _Type; + double _Xmin, _Xmax, _Ymin, _Ymax, _Zmin, _Zmax; + double _Xaxe, _Yaxe, _Zaxe; + double _Xcentre, _Ycentre, _Zcentre, _rayon; + double _Xincr, _Yincr, _Zincr; + double _Xcentre1, _Ycentre1, _Zcentre1, _Rayon1; + double _Xcentre2, _Ycentre2, _Zcentre2, _Rayon2; + double _Angle; + + std::list _ListGroupSelected; + +}; + + +#endif diff --git a/src/ADAPT/HOMARD_Cas.cxx b/src/ADAPT/HOMARD_Cas.cxx new file mode 100644 index 000000000..1493c8ff1 --- /dev/null +++ b/src/ADAPT/HOMARD_Cas.cxx @@ -0,0 +1,283 @@ +// HOMARD HOMARD : implementation of HOMARD idl descriptions +// +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : HOMARD_Cas.cxx +// Author : Gerald NICOLAS, EDF +// Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier + +#include "HOMARD_Cas.hxx" +#include "utilities.h" +#include "HOMARD.hxx" +#include +#include + +#ifndef WIN32 +#include +#else +#include +#endif + +//============================================================================= +/*! + * default constructor: + * Par defaut, l'adaptation est conforme, sans suivi de frontiere + */ +//============================================================================= +HOMARD_Cas::HOMARD_Cas(): + _Name(""), _NomDir("/tmp"), _ConfType(0), _ExtType(0) +{ + MESSAGE("HOMARD_Cas"); +} +//============================================================================= +HOMARD_Cas::~HOMARD_Cas() +//============================================================================= +{ + MESSAGE("~HOMARD_Cas"); +} +//============================================================================= +//============================================================================= +// Generalites +//============================================================================= +//============================================================================= +void HOMARD_Cas::SetName( const char* Name ) +{ + _Name = std::string( Name ); +} +//============================================================================= +std::string HOMARD_Cas::GetName() const +{ + return _Name; +} +//============================================================================= +std::string HOMARD_Cas::GetDumpPython() const +{ + std::ostringstream aScript; + aScript << "\t" <<_Name << ".SetDirName(\""; + aScript << _NomDir << "\")\n"; + aScript << "\t" <<_Name << ".SetConfType("; + aScript << _ConfType << ")\n"; + aScript << "\t" <<_Name << ".SetExtType("; + aScript << _ExtType << ")\n"; +// Suivi de frontieres + std::list::const_iterator it = _ListBoundaryGroup.begin(); + while(it != _ListBoundaryGroup.end()) + { + aScript << "\t" <<_Name << ".AddBoundaryGroup(\""; + aScript << *it << "\", \""; + it++; + aScript << *it << "\")\n"; + it++; + } + if ( _Pyram > 0 ) + { + aScript << "\t" <<_Name << ".SetPyram("; + aScript << _Pyram << ")\n"; + } + + return aScript.str(); +} +//============================================================================= +//============================================================================= +// Caracteristiques +//============================================================================= +//============================================================================= +int HOMARD_Cas::SetDirName( const char* NomDir ) +{ +// MESSAGE("SetDirName, NomDir : "< 1 ) { erreur = 1 ; } + // Creation + if ( CHDIR(NomDir) == 0 ) + { _NomDir = std::string( NomDir ); } + else + { + +#ifndef WIN32 + if ( mkdir(NomDir, S_IRWXU|S_IRGRP|S_IXGRP) == 0 ) +#else + if ( _mkdir(NomDir) == 0 ) +#endif + { + if ( CHDIR(NomDir) == 0 ) { _NomDir = std::string( NomDir ); } + else { erreur = 2 ; } + } + else { erreur = 2 ; } + }; + return erreur ; +} +//============================================================================= +std::string HOMARD_Cas::GetDirName() const +{ + return _NomDir; +} +//============================================================================= +int HOMARD_Cas::GetNumberofIter() +{ + return _ListIter.size(); +} +// +// Le type de conformite ou non conformite +// +//============================================================================= +void HOMARD_Cas::SetConfType( int Conftype ) +{ +// VERIFICATION( (Conftype>=-2) && (Conftype<=3) ); + _ConfType = Conftype; +} +//============================================================================= +const int HOMARD_Cas::GetConfType() const +{ + return _ConfType; +} +// +// Le type exterieur +// +//============================================================================= +void HOMARD_Cas::SetExtType( int ExtType ) +{ +// VERIFICATION( (ExtType>=0) && (ExtType<=2) ); + _ExtType = ExtType; +} +//============================================================================= +const int HOMARD_Cas::GetExtType() const +{ + return _ExtType; +} +// +// La boite englobante +// +//============================================================================= +void HOMARD_Cas::SetBoundingBox( const std::vector& extremas ) +{ + _Boite.clear(); + _Boite.resize( extremas.size() ); + for ( int i = 0; i < extremas.size(); i++ ) + _Boite[i] = extremas[i]; +} +//============================================================================= +const std::vector& HOMARD_Cas::GetBoundingBox() const +{ + return _Boite; +} +// +// Les groupes +// +//============================================================================= +void HOMARD_Cas::AddGroup( const char* Group ) +{ + _ListGroup.push_back(Group); +} +//============================================================================= +void HOMARD_Cas::SetGroups( const std::list& ListGroup ) +{ + _ListGroup.clear(); + std::list::const_iterator it = ListGroup.begin(); + while(it != ListGroup.end()) + { + _ListGroup.push_back((*it++)); + } +} +//============================================================================= +const std::list& HOMARD_Cas::GetGroups() const +{ + return _ListGroup; +} +//============================================================================= +void HOMARD_Cas::SupprGroups() +{ + _ListGroup.clear(); +} +// +// Les frontieres +// +//============================================================================= +void HOMARD_Cas::AddBoundary( const char* Boundary ) +{ +// MESSAGE ( ". HOMARD_Cas::AddBoundary : Boundary = " << Boundary ); + const char* Group = ""; + AddBoundaryGroup( Boundary, Group ); +} +//============================================================================= +void HOMARD_Cas::AddBoundaryGroup( const char* Boundary, const char* Group ) +{ +// MESSAGE ( ". HOMARD_Cas::AddBoundaryGroup : Boundary = " << Boundary ); +// MESSAGE ( ". HOMARD_Cas::AddBoundaryGroup : Group = " << Group ); + _ListBoundaryGroup.push_back( Boundary ); + _ListBoundaryGroup.push_back( Group ); +} +//============================================================================= +const std::list& HOMARD_Cas::GetBoundaryGroup() const +{ + return _ListBoundaryGroup; +} +//============================================================================= +void HOMARD_Cas::SupprBoundaryGroup() +{ + _ListBoundaryGroup.clear(); +} +//============================================================================= +void HOMARD_Cas::SetPyram( int Pyram ) +{ + _Pyram = Pyram; +} +//============================================================================= +const int HOMARD_Cas::GetPyram() const +{ + return _Pyram; +} +//============================================================================= +//============================================================================= +// Liens avec les autres structures +//============================================================================= +//============================================================================= +std::string HOMARD_Cas::GetIter0Name() const +{ +// Par construction de la liste, l'iteration a ete mise en tete. + return (*(_ListIter.begin())); +} +//============================================================================= +void HOMARD_Cas::AddIteration( const char* NomIteration ) +{ + _ListIter.push_back( std::string( NomIteration ) ); +} +//============================================================================= +const std::list& HOMARD_Cas::GetIterations() const +{ + return _ListIter; +} +//============================================================================= +void HOMARD_Cas::SupprIterations() +{ + _ListIter.clear(); +} + + diff --git a/src/ADAPT/HOMARD_Cas.hxx b/src/ADAPT/HOMARD_Cas.hxx new file mode 100644 index 000000000..71127136e --- /dev/null +++ b/src/ADAPT/HOMARD_Cas.hxx @@ -0,0 +1,112 @@ +// HOMARD HOMARD : implementation of HOMARD idl descriptions +// +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : HOMARD_Cas.hxx +// Author : Gerald NICOLAS, EDF +// Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier + +#ifndef _HOMARD_CAS_HXX_ +#define _HOMARD_CAS_HXX_ + +#include "HOMARD.hxx" + +#include +#include +#include + +#if defined WIN32 +#pragma warning ( disable: 4251 ) +#endif + +class HOMARDIMPL_EXPORT HOMARD_Cas +{ +public: + HOMARD_Cas(); + ~HOMARD_Cas(); + +// Generalites + void SetName( const char* Name ); + std::string GetName() const; + + std::string GetDumpPython() const; + +// Caracteristiques + int SetDirName( const char* NomDir ); + std::string GetDirName() const; + + int GetNumberofIter(); + + void SetConfType( int ConfType ); + const int GetConfType() const; + + void SetExtType( int ExtType ); + const int GetExtType() const; + + void SetBoundingBox( const std::vector& extremas ); + const std::vector& GetBoundingBox() const; + + void AddGroup( const char* Group); + void SetGroups( const std::list& ListGroup ); + const std::list& GetGroups() const; + void SupprGroups(); + + void AddBoundary( const char* Boundary ); + void AddBoundaryGroup( const char* Boundary, const char* Group ); + const std::list& GetBoundaryGroup() const; + void SupprBoundaryGroup(); + + void SetPyram( int Pyram ); + const int GetPyram() const; + +// Liens avec les autres structures + std::string GetIter0Name() const; + + void AddIteration( const char* NomIteration ); + const std::list& GetIterations() const; + void SupprIterations(); + +private: + std::string _Name; + std::string _NomDir; + int _ConfType; + int _ExtType; + int _Etat; + + std::vector _Boite; // cf HomardQTCommun pour structure du vecteur + std::list _ListGroup; + std::list _ListBoundaryGroup; + + int _Pyram; + + typedef std::string IterName; + typedef std::list IterNames; + IterNames _ListIter; +}; + +#endif diff --git a/src/ADAPT/HOMARD_DriverTools.cxx b/src/ADAPT/HOMARD_DriverTools.cxx new file mode 100644 index 000000000..df7c5e6b2 --- /dev/null +++ b/src/ADAPT/HOMARD_DriverTools.cxx @@ -0,0 +1,840 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : HOMARD_DriverTools.cxx +// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) +// +// ---------------------------------------------------------------------------- + +#include "HOMARD_DriverTools.hxx" +#include "HOMARD_Boundary.hxx" +#include "HOMARD_Cas.hxx" +#include "HOMARD_Hypothesis.hxx" +#include "HOMARD_Iteration.hxx" +#include "HOMARD_Zone.hxx" +#include "HOMARD_YACS.hxx" +#include +#include +#include "utilities.h" + +namespace HOMARD +{ + + std::string SEPARATOR = "|" ; + + /*! + \brief Read next chunk of data from the string + \internal + + The function tries to read next chunk of the data from the input string \a str. + The parameter \a start specifies the start position of next chunk. If the operation + read the chunk successfully, after its completion this parameter will refer to the + start position of the next chunk. The function returns resulting chunk as a string. + The status of the operation is returned via \a ok parameter. + + \param str source data stream string + \param start start position to get next chunk + \param ok in this variable the status of the chunk reading operation is returned + \return next chunk read from the string + */ + static std::string getNextChunk( const std::string& str, std::string::size_type& start, bool& ok ) + { + std::string chunk = ""; + ok = false; + if ( start <= str.size() ) { + std::string::size_type end = str.find( separator(), start ); + chunk = str.substr( start, end == std::string::npos ? std::string::npos : end-start ); + start = end == std::string::npos ? str.size()+1 : end + separator().size(); + ok = true; + } + return chunk; + } + + /*! + \brief Get persistence signature + \param type persistence entity type + \return persistence signature + */ + std::string GetSignature( SignatureType type ) + { + std::string signature = ""; + switch ( type ) { + case Case: signature = "CASE"; break; + case Zone: signature = "ZONE"; break; + case Hypothesis: signature = "HYPO"; break; + case Iteration: signature = "ITER"; break; + case Boundary: signature = "BOUNDARY"; break; + case YACS: signature = "YACS"; break; + default: break; + } + signature += separator(); + return signature; + } + + /*! + \brief Get data separator + \return string that is used to separate data entities in the stream + */ + std::string separator() + { + return SEPARATOR ; + } + +// ======================= +// 1.1. Case +// ======================= + /*! + \brief Dump case to the string + \param cas case being dumped + \return string representation of the case + */ + std::string Dump( const HOMARD_Cas& cas ) + { + std::stringstream os; + std::string saux ; + // ... + MESSAGE( ". Sauvegarde du cas "< coor = cas.GetBoundingBox(); + os << separator() << coor.size(); + for ( int i = 0; i < coor.size(); i++ ) + os << separator() << coor[i]; + + std::list ListString = cas.GetIterations(); + os << separator() << ListString.size(); + std::list::const_iterator it; + for ( it = ListString.begin(); it != ListString.end(); ++it ) + os << separator() << *it; + + ListString = cas.GetGroups(); + os << separator() << ListString.size(); + for ( it = ListString.begin(); it != ListString.end(); ++it ) + os << separator() << *it; + ListString = cas.GetBoundaryGroup(); + os << separator() << ListString.size(); + for ( it = ListString.begin(); it != ListString.end(); ++it ) + os << separator() << *it; + + os << separator() << cas.GetPyram(); + + saux = os.str(); +// MESSAGE( ". Fin avec "< ListString = iteration.GetIterations(); + os << separator() << ListString.size(); + std::list::const_iterator it; + for ( it = ListString.begin(); it != ListString.end(); ++it ) + os << separator() << *it; + + os << separator() << iteration.GetHypoName(); + os << separator() << iteration.GetCaseName(); + os << separator() << iteration.GetDirNameLoc(); + + saux = os.str(); +// MESSAGE( ". Fin avec "< ListString = hypothesis.GetIterations(); + std::list::const_iterator it; + os << separator() << ListString.size(); + for ( it = ListString.begin(); it != ListString.end(); ++it ) + os << separator() << *it; + + ListString = hypothesis.GetZones(); + os << separator() << ListString.size(); + for ( it = ListString.begin(); it != ListString.end(); ++it ) + os << separator() << *it; + + ListString = hypothesis.GetComps(); + os << separator() << ListString.size(); + for ( it = ListString.begin(); it != ListString.end(); ++it ) + os << separator() << *it; + + ListString = hypothesis.GetGroups(); + os << separator() << ListString.size(); + for ( it = ListString.begin(); it != ListString.end(); ++it ) + os << separator() << *it; + + ListString = hypothesis.GetFieldInterps(); + os << separator() << ListString.size(); + for ( it = ListString.begin(); it != ListString.end(); ++it ) + os << separator() << *it; + + os << separator() << hypothesis.GetNivMax(); + os << separator() << hypothesis.GetDiamMin(); + os << separator() << hypothesis.GetAdapInit(); + os << separator() << hypothesis.GetExtraOutput(); + + saux = os.str(); +// MESSAGE( ". Fin avec "< coords = zone.GetCoords(); + for ( int i = 0; i < coords.size(); i++ ) + os << separator() << ( i < coords.size() ? coords[i] : 0. ); + + std::vector limit = zone.GetLimit(); + for ( int i = 0; i < 3; i++ ) + os << separator() << ( i < limit.size() ? limit[i] : 0. ); + + std::list hypos = zone.GetHypo(); + os << separator() << hypos.size(); + std::list::const_iterator it; + for ( it = hypos.begin(); it != hypos.end(); ++it ) + os << separator() << *it; + + saux = os.str(); +// MESSAGE( ". Fin avec "< coor = boundary.GetCoords() ; + for ( int i = 0; i < coor.size(); i++ ) + os << separator() << coor[i]; + std::vector limit = boundary.GetLimit(); + for ( int i = 0; i < limit.size(); i++ ) + os << separator() << limit[i]; + } + + std::list ListString = boundary.GetGroups(); + std::list::const_iterator it; + os << separator() << ListString.size(); + for ( it = ListString.begin(); it != ListString.end(); ++it ) + os << separator() << *it; + + saux = os.str(); +// MESSAGE( ". Fin avec "< boite; + boite.resize( size ); + for ( int i = 0; i < size; i++ ) { + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + boite[i] = strtod( chunk.c_str(), 0 ); + } + cas.SetBoundingBox( boite ); + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + + size = atoi( chunk.c_str() ); + for ( int i = 0; i < size; i++ ) { + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + cas.AddIteration( chunk.c_str() ); + } + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + size = atoi( chunk.c_str() ); + for ( int i = 0; i < size; i++ ) + { + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + cas.AddGroup( chunk.c_str() ); + } + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + size = atoi( chunk.c_str() ); + for ( int i = 0; i < size; i++ ) { + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + i++; + chunkNext = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + cas.AddBoundaryGroup( chunk.c_str(), chunkNext.c_str() ); + } + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + cas.SetPyram( atoi( chunk.c_str() ) ); + + return true; + } +// +// ============== +// 2.2. Iteration +// ============== + /*! + \brief Restore iteration from the string + \param iteration iteration being restored + \param stream string representation of the iteration + \return \c true if iteration is correctly restored or \c false otherwise + */ + bool Restore( HOMARD_Iteration& iteration, const std::string& stream ) + { + std::string::size_type start = 0; + std::string chunk; + bool ok; + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + + iteration.SetName( chunk.c_str() ); + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + iteration.SetState( atoi( chunk.c_str() ) ); + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + iteration.SetNumber( atoi( chunk.c_str() ) ); + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + iteration.SetMeshFile( chunk.c_str() ); + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + iteration.SetLogFile( chunk.c_str() ); + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + iteration.SetMeshName( chunk.c_str() ); + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + iteration.SetFieldFile( chunk.c_str() ); + // . + int timestep, rank; + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + timestep = atoi( chunk.c_str() ); + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + rank = atoi( chunk.c_str() ); + iteration.SetTimeStepRank( timestep, rank ); + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + iteration.SetIterParentName( chunk.c_str() ); + // + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + int size = atoi( chunk.c_str() ); + for ( int i = 0; i < size; i++ ) { + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + iteration.LinkNextIteration( chunk.c_str() ); + } + // + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + iteration.SetHypoName( chunk.c_str() ); + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + iteration.SetCaseName( chunk.c_str() ); + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + iteration.SetDirNameLoc( chunk.c_str() ); + return true; + } + +// +// ============== +// 2.3. hypothese +// ============== + /*! + \brief Restore hypothesis from the string + \param hypothesis hypothesis being restored + \param stream string representation of the hypothesis + \return \c true if hypothesis is correctly restored or \c false otherwise + */ + bool Restore( HOMARD_Hypothesis& hypothesis, const std::string& stream ) + { + std::string::size_type start = 0; + std::string chunk, chunkNext; + bool ok; + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + hypothesis.SetName( chunk.c_str() ); + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + hypothesis.SetCaseCreation( chunk.c_str() ); + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + hypothesis.SetAdapType( atoi( chunk.c_str() ) ); + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + int typeraff = atoi( chunk.c_str() ); + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + int typedera = atoi( chunk.c_str() ); + hypothesis.SetRefinTypeDera( typeraff, typedera ); + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + hypothesis.SetField( chunk.c_str() ); + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + int typethr = atoi( chunk.c_str() ); + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + double threshr = strtod( chunk.c_str(), 0 ); + hypothesis.SetRefinThr( typethr, threshr ); + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + int typethc = atoi( chunk.c_str() ); + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + double threshc = strtod( chunk.c_str(), 0 ); + hypothesis.SetUnRefThr( typethc, threshc ); + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + hypothesis.SetUseField(atoi(chunk.c_str())); + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + hypothesis.SetUseComp(atoi(chunk.c_str())); + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + hypothesis.SetTypeFieldInterp(atoi(chunk.c_str())); + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + int size = atoi( chunk.c_str() ); + for ( int i = 0; i < size; i++ ) { + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + hypothesis.LinkIteration( chunk.c_str() ); + } + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + size = atoi( chunk.c_str() ); + for ( int i = 0; i < size; i++ ) { + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + i++; + chunkNext = getNextChunk( stream, start, ok ); + int typeuse = atoi( chunkNext.c_str() ); + if ( !ok ) return false; + hypothesis.AddZone( chunk.c_str(), typeuse ); + } + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + size = atoi( chunk.c_str() ); + for ( int i = 0; i < size; i++ ) { + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + hypothesis.AddComp( chunk.c_str() ); + } + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + size = atoi( chunk.c_str() ); + for ( int i = 0; i < size; i++ ) { + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + hypothesis.AddGroup( chunk.c_str() ); + } + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + size = atoi( chunk.c_str() ); + for ( int i = 0; i < size; i++ ) { + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + i++; + chunkNext = getNextChunk( stream, start, ok ); + int TypeInterp = atoi( chunkNext.c_str() ); + if ( !ok ) return false; + hypothesis.AddFieldInterpType( chunk.c_str(), TypeInterp ); + } + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + hypothesis.SetNivMax( atoi( chunk.c_str() ) ); + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + hypothesis.SetDiamMin( strtod( chunk.c_str(), 0 ) ); + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + hypothesis.SetAdapInit( strtod( chunk.c_str(), 0 ) ); + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + hypothesis.SetExtraOutput( strtod( chunk.c_str(), 0 ) ); + + return true; + } + +// +// ========= +// 2.4. Zone +// ========= + /*! + \brief Restore zone from the string + \param zone zone being restored + \param stream string representation of the zone + \return \c true if zone is correctly restored or \c false otherwise + */ + bool Restore( HOMARD_Zone& zone, const std::string& stream ) + { + std::string::size_type start = 0; + std::string chunk; + bool ok; + // + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + zone.SetName( chunk.c_str() ); + // + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + int ZoneType = atoi( chunk.c_str() ) ; + zone.SetType( ZoneType ); + // Les coordonnees des zones : le nombre depend du type + std::vector coords; + int lgcoords ; + if ( ZoneType == 2 || ( ZoneType >= 11 && ZoneType <= 13 ) ) { lgcoords = 6 ; } + else if ( ZoneType == 4 ) { lgcoords = 4 ; } + else if ( ZoneType == 5 || ( ZoneType >= 31 && ZoneType <= 33 ) ) { lgcoords = 8 ; } + else if ( ZoneType == 7 || ( ZoneType >= 61 && ZoneType <= 63 ) ) { lgcoords = 9 ; } + else return false; + coords.resize( lgcoords ); + for ( int i = 0; i < lgcoords; i++ ) { + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + coords[i] = strtod( chunk.c_str(), 0 ); + } + if ( ZoneType == 2 || ( ZoneType >= 11 && ZoneType <= 13 ) ) + { zone.SetBox( coords[0], coords[1], coords[2], coords[3], coords[4], coords[5] ); } + else if ( ZoneType == 4 ) + { zone.SetSphere( coords[0], coords[1], coords[2], coords[3] ); } + else if ( ZoneType == 5 || ( ZoneType >= 31 && ZoneType <= 33 ) ) + { zone.SetCylinder( coords[0], coords[1], coords[2], coords[3], coords[4], coords[5], coords[6], coords[7] ); } + else if ( ZoneType == 7 || ( ZoneType >= 61 && ZoneType <= 63 ) ) + { zone.SetPipe( coords[0], coords[1], coords[2], coords[3], coords[4], coords[5], coords[6], coords[7], coords[8] ); } + // Remarque : la taille de coords est suffisante pour les limites + for ( int i = 0; i < 3; i++ ) { + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + coords[i] = strtod( chunk.c_str(), 0 ); + } + zone.SetLimit( coords[0], coords[1], coords[2]); + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + int size = atoi( chunk.c_str() ); + for ( int i = 0; i < size; i++ ) { + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + zone.AddHypo( chunk.c_str() ); + } + return true; + } + +// +// ================================= +// 2.5. Restauration d'une frontiere +// ================================= + + /*! + \brief Restore boundary from the string + \param boundary boundary being restored + \param stream string representation of the boundary + \return \c true if the boundary is correctly restored or \c false otherwise + */ + bool Restore( HOMARD_Boundary& boundary, const std::string& stream ) + { + std::string::size_type start = 0; + std::string chunk; + bool ok; + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + boundary.SetName( chunk.c_str() ); + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + int BoundaryType = atoi( chunk.c_str() ) ; + boundary.SetType( BoundaryType ); + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + boundary.SetCaseCreation( chunk.c_str() ); + + // Si analytique, les coordonnees des frontieres : le nombre depend du type + // Si discret, le maillage + // Si CAO, la géométrie + int lgcoords ; + if ( BoundaryType == -1 ) { lgcoords = -1 ; } + else if ( BoundaryType == 1 ) { lgcoords = 7 ; } + else if ( BoundaryType == 2 ) { lgcoords = 4 ; } + else { lgcoords = 0 ; } +// + if ( lgcoords == -1 ) + { + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + boundary.SetDataFile( chunk.c_str() ); + } + else if ( lgcoords == 0 ) + { + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + boundary.SetMeshName( chunk.c_str() ); + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + boundary.SetDataFile( chunk.c_str() ); + } + else + { std::vector coords; + coords.resize( lgcoords ); + for ( int i = 0; i < lgcoords; i++ ) { + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + coords[i] = strtod( chunk.c_str(), 0 ); + } + if ( BoundaryType == 1 ) + { boundary.SetCylinder(coords[0],coords[1],coords[2],coords[3],coords[4],coords[5],coords[6]); } + else if ( BoundaryType == 2 ) + { boundary.SetSphere( coords[0], coords[1], coords[2], coords[3]); } + else if ( BoundaryType == 3 ) + { boundary.SetConeA( coords[0], coords[1], coords[2], coords[3], coords[4], coords[5], coords[6]); } + else if ( BoundaryType == 4 ) + { boundary.SetConeR( coords[0], coords[1], coords[2], coords[3], coords[4], coords[5], coords[6], coords[7]); } + // Remarque : la taille de coords est suffisante pour les limites + for ( int i = 0; i < 3; i++ ) { + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + coords[i] = strtod( chunk.c_str(), 0 ); + } + boundary.SetLimit( coords[0], coords[1], coords[2]); + } + // Les groupes + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + int size = atoi( chunk.c_str() ); + for ( int i = 0; i < size; i++ ) { + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + boundary.AddGroup( chunk.c_str() ); + } + + return true; + } + +// +// ================================== +// 2.6. Restauration d'un schema YACS +// ================================== + + /*! + \brief Restore a schema YACS from the string + \param yacs yacs being restored + \param stream string representation of the schema yacs + \return \c true if yacs is correctly restored or \c false otherwise + */ + bool Restore( HOMARD_YACS& yacs, const std::string& stream ) + { + std::string::size_type start = 0; + std::string chunk; + bool ok; + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + yacs.SetName( chunk.c_str() ); + + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + int YACSType = atoi( chunk.c_str() ) ; + yacs.SetType( YACSType ); + + return true; + } + +} // namespace HOMARD /end/ diff --git a/src/ADAPT/HOMARD_DriverTools.hxx b/src/ADAPT/HOMARD_DriverTools.hxx new file mode 100644 index 000000000..887d5f35b --- /dev/null +++ b/src/ADAPT/HOMARD_DriverTools.hxx @@ -0,0 +1,76 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : HOMARD_DriverTools.hxx +// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) +// +// ---------------------------------------------------------------------------- + +#ifndef HOMARD_DRIVERTOOLS_H +#define HOMARD_DRIVERTOOLS_H + +#include "HOMARD.hxx" + +#include + +class HOMARD_Boundary; +class HOMARD_Cas; +class HOMARD_Iteration; +class HOMARD_Hypothesis; +class HOMARD_Zone; +class HOMARD_YACS; + +namespace HOMARD +{ + //! persistence entity type + typedef enum { Case, Zone, Hypothesis, Iteration, Boundary, YACS } SignatureType; + + //! get persistence signature + HOMARDIMPL_EXPORT std::string GetSignature( SignatureType type ); + + //! get data separator + HOMARDIMPL_EXPORT std::string separator(); + + //! dump boundary to the string + HOMARDIMPL_EXPORT std::string Dump( const ::HOMARD_Boundary& boundary ); + //! dump case to the string + HOMARDIMPL_EXPORT std::string Dump( const ::HOMARD_Cas& cas ); + //! dump iteration to the string + HOMARDIMPL_EXPORT std::string Dump( const ::HOMARD_Iteration& iteration ); + //! dump hypothesis to the string + HOMARDIMPL_EXPORT std::string Dump( const ::HOMARD_Hypothesis& hypothesis ); + //! dump zone to the string + HOMARDIMPL_EXPORT std::string Dump( const ::HOMARD_Zone& zone ); + //! dump yacs to the string + HOMARDIMPL_EXPORT std::string Dump( const ::HOMARD_YACS& yacs ); + + //! restore boundary from the string + HOMARDIMPL_EXPORT bool Restore( ::HOMARD_Boundary& boundary, const std::string& stream ); + //! restore case from the string + HOMARDIMPL_EXPORT bool Restore( ::HOMARD_Cas& cas, const std::string& stream ); + //! restore hypothesis from the string + HOMARDIMPL_EXPORT bool Restore( ::HOMARD_Hypothesis& hypothesis, const std::string& stream ); + //! restore iteration from the string + HOMARDIMPL_EXPORT bool Restore( ::HOMARD_Iteration& iteration, const std::string& stream ); + //! restore zone from the string + HOMARDIMPL_EXPORT bool Restore( ::HOMARD_Zone& zone, const std::string& stream ); + //! restore yacs from the string + HOMARDIMPL_EXPORT bool Restore( ::HOMARD_YACS& yacs, const std::string& stream ); +}; + +#endif // HOMARD_DRIVERTOOLS_H diff --git a/src/ADAPT/HOMARD_Gen.cxx b/src/ADAPT/HOMARD_Gen.cxx new file mode 100644 index 000000000..a9059a6ad --- /dev/null +++ b/src/ADAPT/HOMARD_Gen.cxx @@ -0,0 +1,41 @@ +// HOMARD HOMARD : implementation of HOMARD idl descriptions +// +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : HOMARD_Gen.cxx +// Author : Gerald NICOLAS, EDF +// Module : HOMARD + +#include "HOMARD_Gen.hxx" +#include "utilities.h" + +//============================================================================= +//============================================================================= +HOMARD_Gen::HOMARD_Gen() +{ + MESSAGE("HOMARD_Gen"); +} + +//============================================================================= +//============================================================================= +HOMARD_Gen::~HOMARD_Gen() +{ + MESSAGE("~HOMARD_Gen"); +} +//============================================================================= diff --git a/src/ADAPT/HOMARD_Gen.hxx b/src/ADAPT/HOMARD_Gen.hxx new file mode 100644 index 000000000..3ff864a14 --- /dev/null +++ b/src/ADAPT/HOMARD_Gen.hxx @@ -0,0 +1,37 @@ +// HOMARD HOMARD : implementation of HOMARD idl descriptions +// +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : HOMARD_Gen.hxx +// Author : Gerald NICOLAS, EDF +// Module : HOMARD + +#ifndef _HOMARD_GEN_HXX_ +#define _HOMARD_GEN_HXX_ + +#include "HOMARD.hxx" + +class HOMARDIMPL_EXPORT HOMARD_Gen +{ +public : + HOMARD_Gen(); + ~HOMARD_Gen(); +}; + +#endif diff --git a/src/ADAPT/HOMARD_Hypothesis.cxx b/src/ADAPT/HOMARD_Hypothesis.cxx new file mode 100644 index 000000000..a957b57ba --- /dev/null +++ b/src/ADAPT/HOMARD_Hypothesis.cxx @@ -0,0 +1,524 @@ +// HOMARD HOMARD : implementation of HOMARD idl descriptions +// +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : HOMARD_Hypothesis.cxx +// Author : Gerald NICOLAS, EDF +// Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier + +#include "HOMARD_Hypothesis.hxx" +#include "HOMARD.hxx" +#include "utilities.h" + +//============================================================================= +/*! + * default constructor: + */ +//============================================================================= +HOMARD_Hypothesis::HOMARD_Hypothesis(): + _Name(""), _NomCasCreation(""), + _TypeAdap(-1), _TypeRaff(0), _TypeDera(0), + _Field(""), + _TypeThR(0), _ThreshR(0), + _TypeThC(0), _ThreshC(0), + _UsField(0), _UsCmpI(0), _TypeFieldInterp(0) +{ + MESSAGE("HOMARD_Hypothesis"); +} + +//============================================================================= +/*! + */ +//============================================================================= +HOMARD_Hypothesis::~HOMARD_Hypothesis() +{ + MESSAGE("~HOMARD_Hypothesis"); +} +//============================================================================= +//============================================================================= +// Generalites +//============================================================================= +//============================================================================= +void HOMARD_Hypothesis::SetName( const char* Name ) +{ + _Name = std::string( Name ); +} +//============================================================================= +std::string HOMARD_Hypothesis::GetName() const +{ + return _Name; +} +//============================================================================= +std::string HOMARD_Hypothesis::GetDumpPython() const +{ + std::ostringstream aScript; + aScript << "\n# Creation of the hypothesis " << _Name << "\n" ; + aScript << "\t" << _Name << " = homard.CreateHypothesis(\"" << _Name << "\")\n"; + if ( _TypeAdap == -1 ) + { + int TypeRaffDera ; + if ( _TypeRaff == 1 ) { TypeRaffDera = 1 ; } + else { TypeRaffDera = -1 ; } + aScript << "\t" << _Name << ".SetUnifRefinUnRef(" << TypeRaffDera << ")\n"; + } + +// Raffinement selon des zones geometriques + std::list::const_iterator it = _ListZone.begin(); + int TypeUse ; + while(it != _ListZone.end()) + { + aScript << "\t" << _Name << ".AddZone(\"" << *it; + it++; + if ( *it == "1" ) { TypeUse = 1 ; } + else { TypeUse = -1 ; } + aScript << "\", " << TypeUse << ")\n"; + it++; + } + +// Raffinement selon un champ + if ( _TypeAdap == 1 ) + { + aScript << "\t" << _Name << ".SetField(\"" << _Field << "\")\n"; + aScript << "\t" << _Name << ".SetUseField(" << _UsField << ")\n"; + aScript << "\t" << _Name << ".SetUseComp(" << _UsCmpI << ")\n"; + std::list::const_iterator it_comp = _ListComp.begin(); + while(it_comp != _ListComp.end()) + { + aScript << "\t" << _Name << ".AddComp(\"" << *it_comp << "\")\n"; + it_comp++; + } + if ( _TypeRaff == 1 ) + { + aScript << "\t" << _Name << ".SetRefinThr(" << _TypeThR << ", " << _ThreshR << ")\n"; + } + if ( _TypeDera == 1 ) + { + aScript << "\t" << _Name << ".SetUnRefThr(" << _TypeThC << ", " << _ThreshC << ")\n"; + } + } + +// Filtrage du raffinement par des groupes + for ( it=_ListGroupSelected.begin(); it!=_ListGroupSelected.end();it++) + aScript << "\t" << _Name << ".AddGroup(\"" << (*it) << "\")\n" ; + +// Interpolation des champs + if ( _TypeFieldInterp == 2 ) + { + std::list::const_iterator it_champ = _ListFieldInterp.begin(); + while(it_champ != _ListFieldInterp.end()) + { + aScript << "\t" << _Name << ".AddFieldInterpType( \"" << *it_champ << "\" " ; + it_champ++; + aScript << ", " << *it_champ << ")\n"; + it_champ++; + } + } + else if ( _TypeFieldInterp != 0 ) + { + aScript << "\t" << _Name << ".SetTypeFieldInterp(" << _TypeFieldInterp << ")\n"; + } + if ( _NivMax > 0 ) + { + aScript << "\t" <<_Name << ".SetNivMax(" << _NivMax << ")\n"; + } + if ( _DiamMin > 0 ) + { + aScript << "\t" <<_Name << ".SetDiamMin(" << _DiamMin << ")\n"; + } + if ( _AdapInit != 0 ) + { + aScript << "\t" <<_Name << ".SetAdapInit(" << _AdapInit << ")\n"; + } + if ( _ExtraOutput != 1 ) + { + aScript << "\t" <<_Name << ".SetExtraOutput(" << _ExtraOutput << ")\n"; + } + + return aScript.str(); +} +//============================================================================= +//============================================================================= +// Caracteristiques +//============================================================================= +//============================================================================= +void HOMARD_Hypothesis::SetAdapType( int TypeAdap ) +{ + VERIFICATION( (TypeAdap>=-1) && (TypeAdap<=1) ); + _TypeAdap = TypeAdap; +} +//============================================================================= +int HOMARD_Hypothesis::GetAdapType() const +{ + return _TypeAdap; +} +//============================================================================= +void HOMARD_Hypothesis::SetRefinTypeDera( int TypeRaff, int TypeDera ) +{ + VERIFICATION( (TypeRaff>=-1) && (TypeRaff<=1) ); + _TypeRaff = TypeRaff; + VERIFICATION( (TypeDera>=-1) && (TypeDera<=1) ); + _TypeDera = TypeDera; +} +//============================================================================= +int HOMARD_Hypothesis::GetRefinType() const +{ + return _TypeRaff; +} +//============================================================================= +int HOMARD_Hypothesis::GetUnRefType() const +{ + return _TypeDera; +} +//============================================================================= +void HOMARD_Hypothesis::SetField( const char* FieldName ) +{ + _Field = std::string( FieldName ); + MESSAGE( "SetField : FieldName = " << FieldName ); +} +//============================================================================= +std::string HOMARD_Hypothesis::GetFieldName() const +{ + return _Field; +} +//============================================================================= +void HOMARD_Hypothesis::SetUseField( int UsField ) +{ + VERIFICATION( (UsField>=0) && (UsField<=1) ); + _UsField = UsField; +} +//============================================================================= +int HOMARD_Hypothesis::GetUseField() const +{ + return _UsField; +} +//============================================================================= +void HOMARD_Hypothesis::SetUseComp( int UsCmpI ) +{ + MESSAGE ("SetUseComp pour UsCmpI = "<=0) && (UsCmpI<=2) ); + _UsCmpI = UsCmpI; +} +//============================================================================= +int HOMARD_Hypothesis::GetUseComp() const +{ + return _UsCmpI; +} +//============================================================================= +void HOMARD_Hypothesis::AddComp( const char* NomComp ) +{ +// On commence par supprimer la composante au cas ou elle aurait deja ete inseree +// Cela peut se produire dans un schema YACS quand on repasse plusieurs fois par la +// definition de l'hypothese + SupprComp( NomComp ) ; +// Insertion veritable + _ListComp.push_back( std::string( NomComp ) ); +} +//============================================================================= +void HOMARD_Hypothesis::SupprComp( const char* NomComp ) +{ + MESSAGE ("SupprComp pour "<::iterator it = find( _ListComp.begin(), _ListComp.end(), NomComp ); + if ( it != _ListComp.end() ) { it = _ListComp.erase( it ); } +} +//============================================================================= +void HOMARD_Hypothesis::SupprComps() +{ + _ListComp.clear(); +} +//============================================================================= +const std::list& HOMARD_Hypothesis::GetComps() const +{ + return _ListComp; +} +//============================================================================= +void HOMARD_Hypothesis::SetRefinThr( int TypeThR, double ThreshR ) +{ + MESSAGE( "SetRefinThr : TypeThR = " << TypeThR << ", ThreshR = " << ThreshR ); + VERIFICATION( (TypeThR>=0) && (TypeThR<=4) ); + _TypeThR = TypeThR; + _ThreshR = ThreshR; +} +//============================================================================= +int HOMARD_Hypothesis::GetRefinThrType() const +{ + return _TypeThR; +} +//============================================================================= +double HOMARD_Hypothesis::GetThreshR() const +{ + return _ThreshR; +} +//============================================================================= +void HOMARD_Hypothesis::SetUnRefThr( int TypeThC, double ThreshC ) +{ + VERIFICATION( (TypeThC>=0) && (TypeThC<=4) ); + _TypeThC = TypeThC; + _ThreshC = ThreshC; +} +//============================================================================= +int HOMARD_Hypothesis::GetUnRefThrType() const +{ + return _TypeThC; +} +//============================================================================= +double HOMARD_Hypothesis::GetThreshC() const +{ + return _ThreshC; +} +//============================================================================= +void HOMARD_Hypothesis::SetNivMax( int NivMax ) +//============================================================================= +{ + _NivMax = NivMax; +} +//============================================================================= +const int HOMARD_Hypothesis::GetNivMax() const +//============================================================================= +{ + return _NivMax; +} +//============================================================================= +void HOMARD_Hypothesis::SetDiamMin( double DiamMin ) +//============================================================================= +{ + _DiamMin = DiamMin; +} +//============================================================================= +const double HOMARD_Hypothesis::GetDiamMin() const +//============================================================================= +{ + return _DiamMin; +} +//============================================================================= +void HOMARD_Hypothesis::SetAdapInit( int AdapInit ) +//============================================================================= +{ + _AdapInit = AdapInit; +} +//============================================================================= +const int HOMARD_Hypothesis::GetAdapInit() const +//============================================================================= +{ + return _AdapInit; +} +//============================================================================= +void HOMARD_Hypothesis::SetExtraOutput( int ExtraOutput ) +//============================================================================= +{ + _ExtraOutput = ExtraOutput; +} +//============================================================================= +const int HOMARD_Hypothesis::GetExtraOutput() const +//============================================================================= +{ + return _ExtraOutput; +} +//============================================================================= +void HOMARD_Hypothesis::AddGroup( const char* Group) +{ +// On commence par supprimer le groupe au cas ou il aurait deja ete insere +// Cela peut se produire dans un schema YACS quand on repasse plusieurs fois par la +// definition de l'hypothese + SupprGroup( Group ) ; +// Insertion veritable + _ListGroupSelected.push_back(Group); +} +//============================================================================= +void HOMARD_Hypothesis::SupprGroup( const char* Group ) +{ + MESSAGE ("SupprGroup pour "<::iterator it = find( _ListGroupSelected.begin(), _ListGroupSelected.end(), Group ); + if ( it != _ListGroupSelected.end() ) { it = _ListGroupSelected.erase( it ); } +} +//============================================================================= +void HOMARD_Hypothesis::SupprGroups() +{ + _ListGroupSelected.clear(); +} +//============================================================================= +void HOMARD_Hypothesis::SetGroups( const std::list& ListGroup ) +{ + _ListGroupSelected.clear(); + std::list::const_iterator it = ListGroup.begin(); + while(it != ListGroup.end()) + _ListGroupSelected.push_back((*it++)); +} +//============================================================================= +const std::list& HOMARD_Hypothesis::GetGroups() const +{ + return _ListGroupSelected; +} +//============================================================================= +// Type d'interpolation des champs : +// 0 : aucun champ n'est interpole +// 1 : tous les champs sont interpoles +// 2 : certains champs sont interpoles +void HOMARD_Hypothesis::SetTypeFieldInterp( int TypeFieldInterp ) +{ + VERIFICATION( (TypeFieldInterp>=0) && (TypeFieldInterp<=2) ); + _TypeFieldInterp = TypeFieldInterp; +} +//============================================================================= +int HOMARD_Hypothesis::GetTypeFieldInterp() const +{ + return _TypeFieldInterp; +} +//============================================================================= +void HOMARD_Hypothesis::AddFieldInterpType( const char* FieldInterp, int TypeInterp ) +{ + MESSAGE ("Dans AddFieldInterpType pour " << FieldInterp << " et TypeInterp = " << TypeInterp) ; +// On commence par supprimer le champ au cas ou il aurait deja ete insere +// Cela peut se produire dans un schema YACS quand on repasse plusieurs fois par la +// definition de l'hypothese + SupprFieldInterp( FieldInterp ) ; +// Insertion veritable +// . Nom du champ + _ListFieldInterp.push_back( std::string( FieldInterp ) ); +// . Usage du champ + std::stringstream saux1 ; + saux1 << TypeInterp ; + _ListFieldInterp.push_back( saux1.str() ); +// . Indication generale : certains champs sont a interpoler + SetTypeFieldInterp ( 2 ) ; +} +//============================================================================= +void HOMARD_Hypothesis::SupprFieldInterp( const char* FieldInterp ) +{ + MESSAGE ("Dans SupprFieldInterp pour " << FieldInterp) ; + std::list::iterator it = find( _ListFieldInterp.begin(), _ListFieldInterp.end(), FieldInterp ) ; +// Attention a supprimer le nom du champ et le type d'usage + if ( it != _ListFieldInterp.end() ) + { + it = _ListFieldInterp.erase( it ) ; + it = _ListFieldInterp.erase( it ) ; + } +// Decompte du nombre de champs restant a interpoler + it = _ListFieldInterp.begin() ; + int cpt = 0 ; + while(it != _ListFieldInterp.end()) + { + cpt += 1 ; + (*it++); + } + MESSAGE("Nombre de champ restants = "<& HOMARD_Hypothesis::GetFieldInterps() const +{ + return _ListFieldInterp; +} +//============================================================================= +//============================================================================= +// Liens avec les autres structures +//============================================================================= +//============================================================================= +void HOMARD_Hypothesis::SetCaseCreation( const char* NomCasCreation ) +{ + _NomCasCreation = std::string( NomCasCreation ); +} +//============================================================================= +std::string HOMARD_Hypothesis::GetCaseCreation() const +{ + return _NomCasCreation; +} +//============================================================================= +void HOMARD_Hypothesis::LinkIteration( const char* NomIteration ) +{ + _ListIter.push_back( std::string( NomIteration ) ); +} +//============================================================================= +void HOMARD_Hypothesis::UnLinkIteration( const char* NomIteration ) +{ + std::list::iterator it = find( _ListIter.begin(), _ListIter.end(), NomIteration ) ; + if ( it != _ListIter.end() ) + { + MESSAGE ("Dans UnLinkIteration pour " << NomIteration) ; + it = _ListIter.erase( it ) ; + } +} +//============================================================================= +void HOMARD_Hypothesis::UnLinkIterations() +{ + _ListIter.clear(); +} +//============================================================================= +const std::list& HOMARD_Hypothesis::GetIterations() const +{ + return _ListIter; +} +//============================================================================= +void HOMARD_Hypothesis::AddZone( const char* NomZone, int TypeUse ) +{ + MESSAGE ("Dans AddZone pour " << NomZone << " et TypeUse = " << TypeUse) ; +// On commence par supprimer la zone au cas ou elle aurait deja ete inseree +// Cela peut se produire dans un schema YACS quand on repasse plusieurs fois par la +// definition de l'hypothese + SupprZone( NomZone ) ; +// Insertion veritable +// . Nom de la zone + _ListZone.push_back( std::string( NomZone ) ); +// . Usage de la zone + std::stringstream saux1 ; + saux1 << TypeUse ; + _ListZone.push_back( saux1.str() ); +} +//============================================================================= +void HOMARD_Hypothesis::SupprZone( const char* NomZone ) +{ + MESSAGE ("Dans SupprZone pour " << NomZone) ; + std::list::iterator it = find( _ListZone.begin(), _ListZone.end(), NomZone ); +// Attention a supprimer le nom de zone et le type d'usage + if ( it != _ListZone.end() ) + { + it = _ListZone.erase( it ); + it = _ListZone.erase( it ); + } +} +//============================================================================= +void HOMARD_Hypothesis::SupprZones() +{ + _ListZone.clear(); +} +//============================================================================= +const std::list& HOMARD_Hypothesis::GetZones() const +{ + return _ListZone; +} diff --git a/src/ADAPT/HOMARD_Hypothesis.hxx b/src/ADAPT/HOMARD_Hypothesis.hxx new file mode 100644 index 000000000..8dd0492ab --- /dev/null +++ b/src/ADAPT/HOMARD_Hypothesis.hxx @@ -0,0 +1,157 @@ +// HOMARD HOMARD : implementation of HOMARD idl descriptions +// +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : HOMARD_Hypothesis.hxx +// Author : Gerald NICOLAS, EDF +// Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier + +#ifndef _HOMARD_HYPOTHESIS_HXX_ +#define _HOMARD_HYPOTHESIS_HXX_ + +#include "HOMARD.hxx" + +#include +#include + +#if defined WIN32 +#pragma warning ( disable: 4251 ) +#endif + +class HOMARDIMPL_EXPORT HOMARD_Hypothesis +{ +public: + HOMARD_Hypothesis(); + ~HOMARD_Hypothesis(); + +// Generalites + void SetName( const char* Name ); + std::string GetName() const; + + std::string GetDumpPython() const; + +// Caracteristiques + void SetAdapType( int TypeAdap ); + int GetAdapType() const; + void SetRefinTypeDera( int TypeRaff, int TypeDera ); + int GetRefinType() const; + int GetUnRefType() const; + + void SetField( const char* FieldName ); + std::string GetFieldName() const; + void SetUseField( int UsField ); + int GetUseField() const; + + void SetUseComp( int UsCmpI ); + int GetUseComp() const; + void AddComp( const char* NomComp ); + void SupprComp( const char* NomComp ); + void SupprComps(); + const std::list& GetComps() const; + + void SetRefinThr( int TypeThR, double ThreshR ); + int GetRefinThrType() const; + double GetThreshR() const; + void SetUnRefThr( int TypeThC, double ThreshC ); + int GetUnRefThrType() const; + double GetThreshC() const; + + void SetNivMax( int NivMax ); + const int GetNivMax() const; + + void SetDiamMin( double DiamMin ); + const double GetDiamMin() const; + + void SetAdapInit( int AdapInit ); + const int GetAdapInit() const; + + void SetExtraOutput( int ExtraOutput ); + const int GetExtraOutput() const; + + void AddGroup( const char* Group); + void SupprGroup( const char* Group ); + void SupprGroups(); + void SetGroups(const std::list& ListGroup ); + const std::list& GetGroups() const; + + void SetTypeFieldInterp( int TypeFieldInterp ); + int GetTypeFieldInterp() const; + void AddFieldInterpType( const char* FieldInterp, int TypeInterp ); + void SupprFieldInterp( const char* FieldInterp ); + void SupprFieldInterps(); + const std::list& GetFieldInterps() const; + +// Liens avec les autres structures + void SetCaseCreation( const char* NomCasCreation ); + std::string GetCaseCreation() const; + + void LinkIteration( const char* NomIter ); + void UnLinkIteration( const char* NomIter ); + void UnLinkIterations(); + const std::list& GetIterations() const; + + void AddZone( const char* NomZone, int TypeUse ); + void SupprZone( const char* NomZone ); + void SupprZones(); + const std::list& GetZones() const; + +private: + std::string _Name; + std::string _NomCasCreation; + + int _TypeAdap; // -1 pour une adapation Uniforme, + // 0 si l adaptation depend des zones, + // 1 pour des champs + + int _TypeRaff; + int _TypeDera; + + std::string _Field; + int _TypeThR; + int _TypeThC; + double _ThreshR; + double _ThreshC; + int _UsField; + int _UsCmpI; + int _TypeFieldInterp; // 0 pour aucune interpolation, + // 1 pour interpolation de tous les champs, + // 2 pour une liste + int _NivMax; + double _DiamMin; + int _AdapInit; + int _ExtraOutput; + + std::list _ListIter; + std::list _ListZone; + std::list _ListComp; + std::list _ListGroupSelected; + std::list _ListFieldInterp; + +}; + +#endif diff --git a/src/ADAPT/HOMARD_Iteration.cxx b/src/ADAPT/HOMARD_Iteration.cxx new file mode 100644 index 000000000..713a6b066 --- /dev/null +++ b/src/ADAPT/HOMARD_Iteration.cxx @@ -0,0 +1,394 @@ +// HOMARD HOMARD : implementation of HOMARD idl descriptions +// +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : HOMARD_Iteration.cxx +// Author : Gerald NICOLAS, EDF +// Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier + +#include "HOMARD_Iteration.hxx" +#include "HOMARD.hxx" +#include "utilities.h" + +//============================================================================= +/*! + * default constructor: + */ +//============================================================================= +HOMARD_Iteration::HOMARD_Iteration(): + _Name( "" ), _Etat( 0 ), + _NumIter( -1 ), + _NomMesh( "" ), _MeshFile( "" ), + _FieldFile( "" ), _TimeStep( -1 ), _Rank( -1 ), + _LogFile( "" ), + _IterParent( "" ), + _NomHypo( "" ), _NomCas( "" ), _NomDir( "" ), + _FileInfo( "" ), + _MessInfo( 1 ) +{ + MESSAGE("HOMARD_Iteration"); +} +//============================================================================= +/*! + * + */ +//============================================================================= +HOMARD_Iteration::~HOMARD_Iteration() +{ + MESSAGE("~HOMARD_Iteration"); +} +//============================================================================= +//============================================================================= +// Generalites +//============================================================================= +//============================================================================= +void HOMARD_Iteration::SetName( const char* Name ) +{ + _Name = std::string( Name ); +} +//============================================================================= +std::string HOMARD_Iteration::GetName() const +{ + return _Name; +} +//============================================================================= +std::string HOMARD_Iteration::GetDumpPython() const +{ + if (_IterParent == "") return std::string(" ") ; // Pas de creation explicite de iteration 0"; + + MESSAGE (". Ecriture de l iteration " << _Name ); + std::ostringstream aScript; + aScript << "\n# Creation of the iteration " << _Name << "\n"; + if( _NumIter == 1 ) + { + aScript << "\t" << _Name << " = " << _NomCas << ".NextIteration(\"" << _Name << "\")\n"; + } + else + { + aScript << "\t" << _Name << " = " << _IterParent << ".NextIteration(\"" << _Name << "\")\n"; + } +// L'hypothese (doit etre au debut) + aScript << "\t" << _Name << ".AssociateHypo(\"" << _NomHypo << "\")\n"; +// Le nom du maillage produit +// MESSAGE (".. maillage produit " << _NomMesh ); + aScript << "\t" << _Name << ".SetMeshName(\"" << _NomMesh << "\")\n" ; +// Le fichier du maillage produit + aScript << "\t" << _Name << ".SetMeshFile(\"" << _MeshFile << "\")\n"; +// Le fichier des champs + if ( _FieldFile != "" ) + { + aScript << "\t" << _Name << ".SetFieldFile(\"" << _FieldFile << "\")\n"; + } +// Si champ de pilotage, valeurs de pas de temps + MESSAGE (". champ de pilotage : _TimeStep = " << _TimeStep << ", _Rank : " << _Rank); + if ( _TimeStep != -1 ) + { + if ( _TimeStep == -2 ) { + aScript << "\t" << _Name << ".SetTimeStepRankLast()\n"; + } + else + { + if ( _TimeStep != -1 ) + { + if ( _Rank == -1 ) + { + aScript << "\t" << _Name << ".SetTimeStep( " << _TimeStep << " )\n"; + } + else + { + aScript << "\t" << _Name << ".SetTimeStepRank( " << _TimeStep << ", " << _Rank << " )\n"; + } + } + } + } +// Les instants d'interpolation + MESSAGE (". instants d'interpolation "); + std::list::const_iterator it = _ListFieldInterpTSR.begin() ; + while(it != _ListFieldInterpTSR.end()) + { + std::string FieldName = std::string((*it)) ; +// MESSAGE ("... FieldName = "<< FieldName); + (*it++); + std::string TimeStepstr = std::string((*it)) ; +// MESSAGE ("... TimeStepstr = "<< TimeStepstr); + (*it++); + std::string Rankstr = std::string((*it)) ; +// MESSAGE ("... Rankstr = "<< Rankstr); + (*it++); + aScript << "\t" << _Name << ".SetFieldInterpTimeStepRank( \"" << FieldName << "\"" ; + aScript << ", " << TimeStepstr ; + aScript << ", " << Rankstr << " )\n" ; + } + +// Compute + MESSAGE (". Compute "); + if ( _Etat == 2 ) { aScript << "\tcodret = " <<_Name << ".Compute(1, 1)\n"; } + else { aScript << "\t#codret = " <<_Name << ".Compute(1, 1)\n"; } +// MESSAGE (". Fin de l ecriture de l iteration " << _Name ); + + return aScript.str(); +} +//============================================================================= +//============================================================================= +// Caracteristiques +//============================================================================= +//============================================================================= +void HOMARD_Iteration::SetDirNameLoc( const char* NomDir ) +{ + _NomDir = std::string( NomDir ); +} +//============================================================================= +std::string HOMARD_Iteration::GetDirNameLoc() const +{ + return _NomDir; +} +//============================================================================= +void HOMARD_Iteration::SetNumber( int NumIter ) +{ + _NumIter = NumIter; +} +//============================================================================= +int HOMARD_Iteration::GetNumber() const +{ + return _NumIter; +} +//============================================================================= +void HOMARD_Iteration::SetState( int etat ) +{ + _Etat = etat; +} +//============================================================================= +int HOMARD_Iteration::GetState() const +{ + return _Etat; +} +//============================================================================= +void HOMARD_Iteration::SetMeshName( const char* NomMesh ) +{ + _NomMesh = std::string( NomMesh ); +} +//============================================================================= +std::string HOMARD_Iteration::GetMeshName() const +{ + return _NomMesh; +} +//============================================================================= +void HOMARD_Iteration::SetMeshFile( const char* MeshFile ) +{ + _MeshFile = std::string( MeshFile ); +} +//============================================================================= +std::string HOMARD_Iteration::GetMeshFile() const +{ + return _MeshFile; +} +//============================================================================= +void HOMARD_Iteration::SetFieldFile( const char* FieldFile ) +{ + _FieldFile = std::string( FieldFile ); +} +//============================================================================= +std::string HOMARD_Iteration::GetFieldFile() const +{ + return _FieldFile; +} +//============================================================================= +// Instants pour le champ de pilotage +//============================================================================= +void HOMARD_Iteration::SetTimeStep( int TimeStep ) +{ + _TimeStep = TimeStep; +} +//============================================================================= +void HOMARD_Iteration::SetTimeStepRank( int TimeStep, int Rank ) +{ + _TimeStep = TimeStep; + _Rank = Rank; +} +//============================================================================= +void HOMARD_Iteration::SetTimeStepRankLast() +{ + _TimeStep = -2; +} +//============================================================================= +int HOMARD_Iteration::GetTimeStep() const +{ + return _TimeStep; +} +//============================================================================= +int HOMARD_Iteration::GetRank() const +{ + return _Rank; +} +//============================================================================= +// Instants pour un champ a interpoler +//============================================================================= +void HOMARD_Iteration::SetFieldInterpTimeStep( const char* FieldInterp, int TimeStep ) +{ + SetFieldInterpTimeStepRank( FieldInterp, TimeStep, TimeStep ) ; +} +//============================================================================= +void HOMARD_Iteration::SetFieldInterpTimeStepRank( const char* FieldInterp, int TimeStep, int Rank ) +{ + MESSAGE("Champ " << FieldInterp << ", hypothese " << _NomHypo ) +// Verification de la presence du champ dans l'hypothese + std::list::iterator it = find( _ListFieldInterp.begin(), _ListFieldInterp.end(), FieldInterp ); + if ( it == _ListFieldInterp.end() ) + { + INFOS("Champ " << FieldInterp << " ; hypothese " << _NomHypo ) + VERIFICATION("Le champ est inconnu dans l'hypothese associee a cette iteration." == 0); + } + +// . Nom du champ + _ListFieldInterpTSR.push_back( std::string( FieldInterp ) ); +// . Pas de temps + std::stringstream saux1 ; + saux1 << TimeStep ; + _ListFieldInterpTSR.push_back( saux1.str() ); +// . Numero d'ordre + std::stringstream saux2 ; + saux2 << Rank ; + _ListFieldInterpTSR.push_back( saux2.str() ); +} +//============================================================================= +const std::list& HOMARD_Iteration::GetFieldInterpsTimeStepRank() const +{ + return _ListFieldInterpTSR; +} +//============================================================================= +void HOMARD_Iteration::SetFieldInterp( const char* FieldInterp ) +{ + _ListFieldInterp.push_back( std::string( FieldInterp ) ); +} +//============================================================================= +const std::list& HOMARD_Iteration::GetFieldInterps() const +{ + return _ListFieldInterp; +} +//============================================================================= +void HOMARD_Iteration::SupprFieldInterps() +{ + _ListFieldInterp.clear(); +} +//============================================================================= +void HOMARD_Iteration::SetLogFile( const char* LogFile ) +{ + _LogFile = std::string( LogFile ); +} +//============================================================================= +std::string HOMARD_Iteration::GetLogFile() const +{ + return _LogFile; +} +//============================================================================= +void HOMARD_Iteration::SetFileInfo( const char* FileInfo ) +{ + _FileInfo = std::string( FileInfo ); +} +//============================================================================= +std::string HOMARD_Iteration::GetFileInfo() const +{ + return _FileInfo; +} +//============================================================================= +//============================================================================= +// Liens avec les autres iterations +//============================================================================= +//============================================================================= +void HOMARD_Iteration::LinkNextIteration( const char* NomIteration ) +{ + _mesIterFilles.push_back( std::string( NomIteration ) ); +} +//============================================================================= +void HOMARD_Iteration::UnLinkNextIteration( const char* NomIteration ) +{ + std::list::iterator it = find( _mesIterFilles.begin(), _mesIterFilles.end(), NomIteration ) ; + if ( it != _mesIterFilles.end() ) + { + MESSAGE ("Dans UnLinkNextIteration pour " << NomIteration) ; + it = _mesIterFilles.erase( it ) ; + } +} +//============================================================================= +void HOMARD_Iteration::UnLinkNextIterations() +{ + _mesIterFilles.clear(); +} +//============================================================================= +const std::list& HOMARD_Iteration::GetIterations() const +{ + return _mesIterFilles; +} +//============================================================================= +void HOMARD_Iteration::SetIterParentName( const char* IterParent ) +{ + _IterParent = IterParent; +} +//============================================================================= +std::string HOMARD_Iteration::GetIterParentName() const +{ + return _IterParent; +} +//============================================================================= +//============================================================================= +// Liens avec les autres structures +//============================================================================= +//============================================================================= +void HOMARD_Iteration::SetCaseName( const char* NomCas ) +{ + _NomCas = std::string( NomCas ); +} +//============================================================================= +std::string HOMARD_Iteration::GetCaseName() const +{ + return _NomCas; +} +//============================================================================= +void HOMARD_Iteration::SetHypoName( const char* NomHypo ) +{ + _NomHypo = std::string( NomHypo ); +} +//============================================================================= +std::string HOMARD_Iteration::GetHypoName() const +{ + return _NomHypo; +} +//============================================================================= +//============================================================================= +// Divers +//============================================================================= +//============================================================================= +void HOMARD_Iteration::SetInfoCompute( int MessInfo ) +{ + _MessInfo = MessInfo; +} +//============================================================================= +int HOMARD_Iteration::GetInfoCompute() const +{ + return _MessInfo; +} diff --git a/src/ADAPT/HOMARD_Iteration.hxx b/src/ADAPT/HOMARD_Iteration.hxx new file mode 100644 index 000000000..cb0e3c72d --- /dev/null +++ b/src/ADAPT/HOMARD_Iteration.hxx @@ -0,0 +1,139 @@ +// HOMARD HOMARD : implementation of HOMARD idl descriptions +// +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : HOMARD_Iteration.hxx +// Author : Gerald NICOLAS, EDF +// Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier + +#ifndef _HOMARD_ITER_HXX_ +#define _HOMARD_ITER_HXX_ + +#include "HOMARD.hxx" + +#include +#include + +#if defined WIN32 +#pragma warning ( disable: 4251 ) +#endif + +class HOMARDIMPL_EXPORT HOMARD_Iteration +{ +public: + HOMARD_Iteration(); + ~HOMARD_Iteration(); + +// Generalites + void SetName( const char* Name ); + std::string GetName() const; + + std::string GetDumpPython() const; + +// Caracteristiques + void SetDirNameLoc( const char* NomDir ); + std::string GetDirNameLoc() const; + + void SetNumber( int NumIter ); + int GetNumber() const; + + void SetState( int etat ); + int GetState() const; + + void SetMeshName( const char* NomMesh ); + std::string GetMeshName() const; + + void SetMeshFile( const char* MeshFile ); + std::string GetMeshFile() const; + + void SetFieldFile( const char* FieldFile ); + std::string GetFieldFile() const; +// Instants pour le champ de pilotage + void SetTimeStep( int TimeStep ); + void SetTimeStepRank( int TimeStep, int Rank ); + void SetTimeStepRankLast(); + int GetTimeStep() const; + int GetRank() const; +// Instants pour un champ a interpoler + void SetFieldInterpTimeStep( const char* FieldInterp, int TimeStep ); + void SetFieldInterpTimeStepRank( const char* FieldInterp, int TimeStep, int Rank ); + const std::list& GetFieldInterpsTimeStepRank() const; + void SetFieldInterp( const char* FieldInterp ); + const std::list& GetFieldInterps() const; + void SupprFieldInterps(); + + void SetLogFile( const char* LogFile ); + std::string GetLogFile() const; + + void SetFileInfo( const char* FileInfo ); + std::string GetFileInfo() const; + +// Liens avec les autres iterations + void LinkNextIteration( const char* NomIteration ); + void UnLinkNextIteration( const char* NomIteration ); + void UnLinkNextIterations(); + const std::list& GetIterations() const; + + void SetIterParentName( const char* iterParent ); + std::string GetIterParentName() const; + +// Liens avec les autres structures + void SetCaseName( const char* NomCas ); + std::string GetCaseName() const; + + void SetHypoName( const char* NomHypo ); + std::string GetHypoName() const; + +// Divers + void SetInfoCompute( int MessInfo ); + int GetInfoCompute() const; + +private: + std::string _Name; + int _Etat; + int _NumIter; + std::string _NomMesh; + std::string _MeshFile; + std::string _FieldFile; + int _TimeStep; + int _Rank; + std::string _LogFile; + std::string _IterParent; + std::string _NomHypo; + std::string _NomCas; + std::string _NomDir; + std::list _mesIterFilles; + std::string _FileInfo; + int _MessInfo; + // La liste des champs retenus par l'hypothese + std::list _ListFieldInterp; + // La liste des triplets (champs, pas de temps, numero d'ordre) retenus par l'iteration + std::list _ListFieldInterpTSR; +}; + +#endif diff --git a/src/ADAPT/HOMARD_YACS.cxx b/src/ADAPT/HOMARD_YACS.cxx new file mode 100644 index 000000000..69c2a8189 --- /dev/null +++ b/src/ADAPT/HOMARD_YACS.cxx @@ -0,0 +1,219 @@ +// HOMARD HOMARD : implementation of HOMARD idl descriptions +// +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : HOMARD_YACS.cxx +// Author : Gerald NICOLAS, EDF +// Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier + +#include "HOMARD_YACS.hxx" +#include "utilities.h" + +//============================================================================= +/*! + * default constructor: + */ +//============================================================================= +HOMARD_YACS::HOMARD_YACS(): + _Name( "" ), + _NomCas( "" ), + _NomDir( "" ), + _MeshFile( "" ), + _ScriptFile( "" ) +{ + MESSAGE("HOMARD_YACS"); +} +//============================================================================= +/*! + * + */ +//============================================================================= +HOMARD_YACS::~HOMARD_YACS() +{ + MESSAGE("~HOMARD_YACS"); +} +//============================================================================= +//============================================================================= +// Generalites +//============================================================================= +//============================================================================= +void HOMARD_YACS::SetName( const char* Name ) +{ + _Name = std::string( Name ); +} +//============================================================================= +std::string HOMARD_YACS::GetName() const +{ + return _Name; +} +//============================================================================= +std::string HOMARD_YACS::GetDumpPython() const +{ + MESSAGE (". Ecriture du schema " << _Name ); + std::ostringstream aScript; + aScript << "\n# Creation of the schema " << _Name << "\n"; +// Creation du schema + aScript << "\t" << _Name << " = " << _NomCas << ".CreateYACSSchema(\"" << _Name << "\", \"" << _ScriptFile << "\", \"" << _NomDir << "\", \"" << _MeshFile << "\")\n"; +// Le type de schema + aScript << "\t" << _Name << ".SetType(" << _Type << ")\n"; +// Les controles de convergences + if ( _MaxIter > 0 ) { aScript << "\t" << _Name << ".SetMaxIter(" << _MaxIter << ")\n"; } + if ( _MaxNode > 0 ) { aScript << "\t" << _Name << ".SetMaxNode(" << _MaxNode << ")\n"; } + if ( _MaxElem > 0 ) { aScript << "\t" << _Name << ".SetMaxElem(" << _MaxElem << ")\n"; } + +// L'ecriture du schema + aScript << "\tcodret = " << _Name << ".Write()\n"; + + MESSAGE (". Fin de l ecriture du schema " << _Name ); + + return aScript.str(); +} +//============================================================================= +//============================================================================= +// Caracteristiques de la convergence +//============================================================================= +//============================================================================= +void HOMARD_YACS::SetType( int Type ) +{ + _Type = Type; +} +//============================================================================= +int HOMARD_YACS::GetType() const +{ + return _Type; +} +//============================================================================= +void HOMARD_YACS::SetMaxIter( int MaxIter ) +{ + _MaxIter = MaxIter; +} +//============================================================================= +int HOMARD_YACS::GetMaxIter() const +{ + return _MaxIter; +} +//============================================================================= +void HOMARD_YACS::SetMaxNode( int MaxNode ) +{ + _MaxNode = MaxNode; +} +//============================================================================= +int HOMARD_YACS::GetMaxNode() const +{ + return _MaxNode; +} +//============================================================================= +void HOMARD_YACS::SetMaxElem( int MaxElem ) +{ + _MaxElem = MaxElem; +} +//============================================================================= +int HOMARD_YACS::GetMaxElem() const +{ + return _MaxElem; +} +//============================================================================= +void HOMARD_YACS::SetTestConvergence( int TypeTest, double VRef ) +{ + _TypeTest = TypeTest; + _VRef = VRef; +} +//============================================================================= +int HOMARD_YACS::GetTestConvergenceType() const +{ + return _TypeTest; +} +//============================================================================= +double HOMARD_YACS::GetTestConvergenceVRef() const +{ + return _VRef; +} +//============================================================================= +//============================================================================= +// Repertoire et fichiers +//============================================================================= +//============================================================================= +//============================================================================= +void HOMARD_YACS::SetDirName( const char* NomDir ) +{ + _NomDir = std::string( NomDir ); +} +//============================================================================= +std::string HOMARD_YACS::GetDirName() const +{ + return _NomDir; +} +//============================================================================= +void HOMARD_YACS::SetMeshFile( const char* MeshFile ) +{ + _MeshFile = std::string( MeshFile ); +} +//============================================================================= +std::string HOMARD_YACS::GetMeshFile() const +{ + return _MeshFile; +} +//============================================================================= +void HOMARD_YACS::SetScriptFile( const char* ScriptFile ) +{ + _ScriptFile = std::string( ScriptFile ); +} +//============================================================================= +std::string HOMARD_YACS::GetScriptFile() const +{ + return _ScriptFile; +} +//============================================================================= +void HOMARD_YACS::SetXMLFile( const char* XMLFile ) +{ + _XMLFile = std::string( XMLFile ); +} +//============================================================================= +std::string HOMARD_YACS::GetXMLFile() const +{ + return _XMLFile; +} +//============================================================================= +//============================================================================= +// Liens avec les autres structures +//============================================================================= +//============================================================================= +void HOMARD_YACS::SetCaseName( const char* NomCas ) +{ + _NomCas = std::string( NomCas ); +} +//============================================================================= +std::string HOMARD_YACS::GetCaseName() const +{ + return _NomCas; +} +//============================================================================= +//============================================================================= +// Divers +//============================================================================= +//============================================================================= diff --git a/src/ADAPT/HOMARD_YACS.hxx b/src/ADAPT/HOMARD_YACS.hxx new file mode 100644 index 000000000..5f9141997 --- /dev/null +++ b/src/ADAPT/HOMARD_YACS.hxx @@ -0,0 +1,103 @@ +// HOMARD HOMARD : implementation of HOMARD idl descriptions +// +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : HOMARD_YACS.hxx +// Author : Gerald NICOLAS, EDF +// Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier + +#ifndef _HOMARD_YACS_HXX_ +#define _HOMARD_YACS_HXX_ + +#include "HOMARD.hxx" + +#include +#include + +class HOMARDIMPL_EXPORT HOMARD_YACS +{ +public: + HOMARD_YACS(); + ~HOMARD_YACS(); + +// Generalites + void SetName( const char* Name ); + std::string GetName() const; + + std::string GetDumpPython() const; + +// Caracteristiques + void SetType( int Type ); + int GetType() const; + + void SetMaxIter( int MaxIter ); + int GetMaxIter() const; + void SetMaxNode( int MaxNode ); + int GetMaxNode() const; + void SetMaxElem( int MaxElem ); + int GetMaxElem() const; + + void SetTestConvergence( int TypeTest, double VRef ); + int GetTestConvergenceType() const; + double GetTestConvergenceVRef() const; + + void SetDirName( const char* NomDir ); + std::string GetDirName() const; + + void SetMeshFile( const char* MeshFile ); + std::string GetMeshFile() const; + + void SetScriptFile( const char* ScriptFile ); + std::string GetScriptFile() const; + + void SetXMLFile( const char* XMLFile ); + std::string GetXMLFile() const; + +// Liens avec les autres structures + void SetCaseName( const char* NomCas ); + std::string GetCaseName() const; + + +// Divers + +private: + std::string _Name; + std::string _NomCas; + std::string _NomDir; + std::string _MeshFile; + std::string _ScriptFile; + int _Type; + int _MaxIter; + int _MaxNode; + int _MaxElem; + int _TypeTest; + double _VRef; + std::string _XMLFile; +}; + +#endif diff --git a/src/ADAPT/HOMARD_Zone.cxx b/src/ADAPT/HOMARD_Zone.cxx new file mode 100644 index 000000000..0d938a53b --- /dev/null +++ b/src/ADAPT/HOMARD_Zone.cxx @@ -0,0 +1,325 @@ +// HOMARD HOMARD : implementation of HOMARD idl descriptions +// +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : HOMARD_Zone.cxx +// Author : Gerald NICOLAS, EDF +// Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier + +#include "HOMARD_Zone.hxx" +#include "HOMARD.hxx" +#include "utilities.h" + +//============================================================================= +/*! + * default constructor: + */ +//============================================================================= +HOMARD_Zone::HOMARD_Zone(): + _Name( "" ),_Type( 2 ), + _Xmin( 0 ), _Xmax( 0 ), _Ymin( 0 ), _Ymax( 0 ), _Zmin( 0 ), _Zmax( 0 ), + _Xcentre( 0 ), _Ycentre( 0 ), _Zcentre( 0 ), _Rayon( 0 ), + _Xaxe( 0 ), _Yaxe( 0 ), _Zaxe( 0 ), _Haut( 0 ), + _Xincr( 0 ), _Yincr( 0 ), _Zincr( 0 ) +{ + MESSAGE("HOMARD_Zone") ; +} + +//============================================================================= +HOMARD_Zone::~HOMARD_Zone() +{ + MESSAGE("~HOMARD_Zone") ; +} +//============================================================================= +//============================================================================= +// Generalites +//============================================================================= +//============================================================================= +void HOMARD_Zone::SetName( const char* Name ) +{ + _Name = std::string( Name ); +} +//============================================================================= +std::string HOMARD_Zone::GetName() const +{ + return _Name; +} +//============================================================================= +std::string HOMARD_Zone::GetDumpPython() const +{ +// MESSAGE("GetDumpPython avec _Type " << _Type) ; +// MESSAGE("GetDumpPython avec _Name " << _Name) ; + std::ostringstream aScript; + aScript << "\n# Creation of the "; + if ( _Type >= 11 && _Type <= 13 ) { aScript << "rectangle " ; } + else if ( _Type == 2 ) { aScript << "box " ;} + else if ( _Type >= 31 && _Type <= 33 ) { aScript << "disk " ;} + else if ( _Type == 4 ) { aScript << "sphere " ; } + else if ( _Type == 5 ) { aScript << "cylinder " ; } + else if ( _Type >= 61 && _Type <= 63 ) { aScript << "disk with hole " ;} + else if ( _Type == 7 ) { aScript << "pipe " ; } + aScript << _Name << "\n" ; +// + aScript << "\t" << _Name << " = homard.CreateZone" ; +// + switch (_Type) + { + case 11: + { aScript << "Box2D( \"" << _Name << "\", " << _Xmin << ", " << _Xmax << ", " << _Ymin << ", " << _Ymax << ", 1 )\n"; + break ; + } + case 12: + { aScript << "Box2D( \"" << _Name << "\", " << _Ymin << ", " << _Ymax << ", " << _Zmin << ", " << _Zmax << ", 2 )\n"; + break ; + } + case 13: + { aScript << "Box2D( \"" << _Name << "\", " << _Zmin << ", " << _Zmax << ", " << _Xmin << ", " << _Xmax << ", 3 )\n"; + break ; + } + case 2: + { aScript << "Box( \"" << _Name << "\", " << _Xmin << ", " << _Xmax << ", " << _Ymin << ", " << _Ymax << ", " << _Zmin << ", " << _Zmax << ")\n"; + break ; + } + + case 4: + { aScript << "Sphere( \"" << _Name << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Rayon << ")\n"; + break ; + } + + case 31: + { aScript << "Disk( \"" << _Name << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Rayon << ", 1 )\n"; + break ; + } + case 32: + { aScript << "Disk( \"" << _Name << "\", " << _Ycentre << ", " << _Zcentre << ", " << _Rayon << ", 2 )\n"; + break ; + } + case 33: + { aScript << "Disk( \"" << _Name << "\", " << _Zcentre << ", " << _Xcentre << ", " << _Rayon << ", 3 )\n"; + break ; + } + case 5: + { aScript << "Cylinder( \"" << _Name << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Xaxe << ", " << _Yaxe << ", " << _Zaxe << ", " << _Rayon << ", " << _Haut << ")\n"; + break ; + } + + case 61: + { aScript << "DiskWithHole( \"" << _Name << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Rayon << ", " << _Rayonint << ", 1 )\n"; + break ; + } + case 62: + { aScript << "DiskWithHole( \"" << _Name << "\", " << _Ycentre << ", " << _Zcentre << ", " << _Rayon << ", " << _Rayonint << ", 2 )\n"; + break ; + } + case 63: + { aScript << "DiskWithHole( \"" << _Name << "\", " << _Zcentre << ", " << _Xcentre << ", " << _Rayon << ", " << _Rayonint << ", 3 )\n"; + break ; + } + case 7: + { aScript << "Pipe( \"" << _Name << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Xaxe << ", " << _Yaxe << ", " << _Zaxe << ", " << _Rayon << ", " << _Haut << ", " << _Rayonint << ")\n"; + break ; + } + } + + return aScript.str() ; +} +//============================================================================= +//============================================================================= +// Caracteristiques +//============================================================================= +//============================================================================= +void HOMARD_Zone::SetType( int Type ) +{ + _Type = Type; +} +//============================================================================= +int HOMARD_Zone::GetType() const +{ + return _Type; +} +//======================================================================================= +void HOMARD_Zone::SetBox( double X0, double X1, double X2, double X3, double X4, double X5 ) +{ + _Xmin = X0; _Xmax = X1; + _Ymin = X2; _Ymax = X3; + _Zmin = X4; _Zmax = X5; +} +//======================================================================================= +void HOMARD_Zone::SetCylinder( double X0, double X1, double X2, + double X3, double X4, double X5, double X6, double X7 ) +{ + _Xcentre = X0; + _Ycentre = X1; + _Zcentre = X2; + _Xaxe = X3; + _Yaxe = X4; + _Zaxe = X5; + _Rayon = X6; + _Haut = X7; +} +//======================================================================================= +void HOMARD_Zone::SetPipe( double X0, double X1, double X2, + double X3, double X4, double X5, double X6, double X7, double X8 ) +{ + _Xcentre = X0; + _Ycentre = X1; + _Zcentre = X2; + _Xaxe = X3; + _Yaxe = X4; + _Zaxe = X5; + _Rayon = X6; + _Haut = X7; + _Rayonint = X8; +} +//====================================================================== +void HOMARD_Zone::SetSphere( double X0, double X1, double X2, double X3 ) +{ + _Xcentre = X0; + _Ycentre = X1; + _Zcentre = X2; + _Rayon = X3; +} +//======================================================================================= +std::vector HOMARD_Zone::GetCoords() const +{ + std::vector mesCoor; +// + switch (_Type) + { +// Rectangle ou parallelepipede + case 11: + { } + case 12: + { } + case 13: + { } + case 2: + { + mesCoor.push_back( _Xmin ) ; + mesCoor.push_back( _Xmax ) ; + mesCoor.push_back( _Ymin ) ; + mesCoor.push_back( _Ymax ) ; + mesCoor.push_back( _Zmin ) ; + mesCoor.push_back( _Zmax ) ; + break ; + } +// Sphere + case 4: + { + mesCoor.push_back( _Xcentre ) ; + mesCoor.push_back( _Ycentre ) ; + mesCoor.push_back( _Zcentre ) ; + mesCoor.push_back( _Rayon ) ; + break ; + } +// Disque ou cylindre + case 31: + { } + case 32: + { } + case 33: + { } + case 5: + { + mesCoor.push_back( _Xcentre ) ; + mesCoor.push_back( _Ycentre ) ; + mesCoor.push_back( _Zcentre ) ; + mesCoor.push_back( _Xaxe ) ; + mesCoor.push_back( _Yaxe ) ; + mesCoor.push_back( _Zaxe ) ; + mesCoor.push_back( _Rayon ) ; + mesCoor.push_back( _Haut ) ; + break ; + } +// Disque avec trou ou tuyau + case 61: + { } + case 62: + { } + case 63: + { } + case 7: + { + mesCoor.push_back( _Xcentre ) ; + mesCoor.push_back( _Ycentre ) ; + mesCoor.push_back( _Zcentre ) ; + mesCoor.push_back( _Xaxe ) ; + mesCoor.push_back( _Yaxe ) ; + mesCoor.push_back( _Zaxe ) ; + mesCoor.push_back( _Rayon ) ; + mesCoor.push_back( _Haut ) ; + mesCoor.push_back( _Rayonint ) ; + break ; + } + VERIFICATION ( ( (_Type>10) && (_Type<14) ) || (_Type==2) || ( (_Type>30) && (_Type<34) ) || (_Type==4) || (_Type==5) || ( (_Type>60) && (_Type<64) ) || (_Type==7) ) ; + } + return mesCoor; +} +//====================================================================== +void HOMARD_Zone::SetLimit( double X0, double X1, double X2 ) +{ + _Xincr = X0; _Yincr = X1; _Zincr = X2; +} +//======================================================================================= +std::vector HOMARD_Zone::GetLimit() const +{ + std::vector mesLimit; + mesLimit.push_back( _Xincr ) ; + mesLimit.push_back( _Yincr ) ; + mesLimit.push_back( _Zincr ) ; + return mesLimit; +} +//============================================================================= +//============================================================================= +// Liens avec les autres structures +//============================================================================= +//============================================================================= +void HOMARD_Zone::AddHypo( const char* NomHypo ) +{ + _ListHypo.push_back( std::string( NomHypo ) ) ; +} +//============================================================================= +const std::list& HOMARD_Zone::GetHypo() const +{ + return _ListHypo; +} +//============================================================================= +void HOMARD_Zone::SupprHypo( const char* NomHypo ) +{ + std::list::iterator it = find( _ListHypo.begin(), _ListHypo.end(), NomHypo ) ; + if ( it != _ListHypo.end() ) + { + MESSAGE ("Dans SupprHypo pour " << NomHypo) ; + it = _ListHypo.erase( it ) ; + } +} +//============================================================================= +void HOMARD_Zone::SupprHypos() +{ + _ListHypo.clear() ; +} diff --git a/src/ADAPT/HOMARD_Zone.hxx b/src/ADAPT/HOMARD_Zone.hxx new file mode 100644 index 000000000..ace77905d --- /dev/null +++ b/src/ADAPT/HOMARD_Zone.hxx @@ -0,0 +1,95 @@ +// HOMARD HOMARD : implementation of HOMARD idl descriptions +// +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : HOMARD_Zone.hxx +// Author : Gerald NICOLAS, EDF +// Module : HOMARD +// +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier + +#ifndef _HOMARD_Zone_HXX_ +#define _HOMARD_Zone_HXX_ + +#include "HOMARD.hxx" + +#include +#include +#include + +#if defined WIN32 +#pragma warning ( disable: 4251 ) +#endif + +class HOMARDIMPL_EXPORT HOMARD_Zone +{ +public: + HOMARD_Zone(); + ~HOMARD_Zone(); + +// Generalites + void SetName( const char* Name ); + std::string GetName() const; + + std::string GetDumpPython() const; + +// Caracteristiques + void SetType( int Type ); + int GetType() const; + + void SetBox( double X0, double X1, double X2, + double X3, double X4, double X5 ); + + void SetCylinder( double X0, double X1, double X2, double X3, + double X4, double X5, double X6, double X7 ); + + void SetPipe( double X0, double X1, double X2, double X3, + double X4, double X5, double X6, double X7, double X8 ); + + void SetSphere( double X0, double X1, double X2, double X3 ); + + std::vector GetCoords() const; + + void SetLimit( double X0, double X1, double X2 ); + std::vector GetLimit() const; + +// Liens avec les autres structures + void AddHypo( const char* NomHypo ); + const std::list& GetHypo() const; + void SupprHypo( const char* NomHypo ); + void SupprHypos(); + +private: + std::string _Name; + int _Type; + std::list _ListHypo; + double _Xmin, _Xmax, _Ymin, _Ymax, _Zmin, _Zmax; + double _Xcentre, _Ycentre, _Zcentre, _Rayon, _Rayonint; + double _Xaxe, _Yaxe, _Zaxe, _Haut; + double _Xincr, _Yincr, _Zincr; +}; + +#endif diff --git a/src/ADAPT/HomardDriver.cxx b/src/ADAPT/HomardDriver.cxx new file mode 100644 index 000000000..f11b7a5e7 --- /dev/null +++ b/src/ADAPT/HomardDriver.cxx @@ -0,0 +1,1106 @@ +// HOMARD HOMARD : implementation of HOMARD idl descriptions +// +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Pilote l'ecriture du fichier de configuration pour lancer l'execution de HOMARD + +#include +#ifndef WIN32 +#include +#endif +#include + +#include "HomardDriver.hxx" +#include "Utils_SALOME_Exception.hxx" +#include "utilities.h" + +//============================================================================= +//============================================================================= +HomardDriver::HomardDriver(const std::string siter, const std::string siterp1): + _HOMARD_Exec( "" ), _NomDir( "" ), _NomFichierConfBase( "HOMARD.Configuration" ), + _NomFichierConf( "" ), _NomFichierDonn( "" ), _siter( "" ), _siterp1( "" ), + _Texte( "" ), _bLu( false ) +{ + MESSAGE("siter = "< _HOMARD_Exec ="<<_HOMARD_Exec) ; +// + _siter = siter ; + _siterp1 = siterp1 ; +} +//============================================================================= +//============================================================================= +HomardDriver::~HomardDriver() +{ +} +//=============================================================================== +// A. Generalites +//=============================================================================== +void HomardDriver::TexteInit( const std::string DirCompute, const std::string LogFile, const std::string Langue ) +{ + MESSAGE("TexteInit, DirCompute ="<0 signifie que l'on raffinera les mailles contenues dans la zone, +// <0 signifie que l'on deraffinera +// + int ZoneTypeHOMARD ; + if ( ZoneType >= 11 && ZoneType <= 13 ) { ZoneTypeHOMARD = 1 ; } + else if ( ZoneType >= 31 && ZoneType <= 33 ) { ZoneTypeHOMARD = 3 ; } + else if ( ZoneType >= 61 && ZoneType <= 63 ) { ZoneTypeHOMARD = 6 ; } + else { ZoneTypeHOMARD = ZoneType ; } +// + if ( TypeUse < 0 ) { ZoneTypeHOMARD = -ZoneTypeHOMARD ; } +// + std::stringstream saux1 ; + saux1 << NumeZone ; + saux = "#\n# Zone numero " + saux1.str() + "\n" ; +// + { std::stringstream saux1 ; + saux1 << NumeZone << " " << ZoneTypeHOMARD ; + saux += "ZoRaType " + saux1.str() + "\n" ; + } +// +// Cas du rectangle +// + if ( ZoneType == 11 ) // Z est constant X Homard <=> X Salome +// Y Homard <=> Y Salome + { + saux += "#Rectangle\n" ; + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x0 ; + saux += "ZoRaXmin " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x1 ; + saux += "ZoRaXmax " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x2 ; + saux += "ZoRaYmin " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x3 ; + saux += "ZoRaYmax " + saux1.str() + "\n" ; + } + } +// + else if ( ZoneType == 12 ) // X est constant X Homard <=> Y Salome +// Y Homard <=> Z Salome + { + saux += "#Rectangle\n" ; + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x2 ; + saux += "ZoRaXmin " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x3 ; + saux += "ZoRaXmax " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x4 ; + saux += "ZoRaYmin " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x5 ; + saux += "ZoRaYmax " + saux1.str() + "\n" ; + } + } +// + else if ( ZoneType == 13 ) // Y est constant X Homard <=> X Salome +// Y Homard <=> Z Salome + { + saux += "#Rectangle\n" ; + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x0 ; + saux += "ZoRaXmin " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x1 ; + saux += "ZoRaXmax " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x4 ; + saux += "ZoRaYmin " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x5 ; + saux += "ZoRaYmax " + saux1.str() + "\n" ; + } + } +// +// Cas du parallelepipede +// + else if ( ZoneType == 2 ) + { + saux += "# Boite\n" ; + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x0 ; + saux += "ZoRaXmin " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x1 ; + saux += "ZoRaXmax " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x2 ; + saux += "ZoRaYmin " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x3 ; + saux += "ZoRaYmax " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x4 ; + saux += "ZoRaZmin " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x5 ; + saux += "ZoRaZmax " + saux1.str() + "\n" ; + } + } +// +// Cas du disque +// + else if ( ZoneType == 31 || ZoneType == 61 ) + { + saux += "# Sphere\n" ; + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x0 ; + saux += "ZoRaXCen " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x1 ; + saux += "ZoRaYCen " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x6 ; + saux2 = saux1.str() ; + if ( ZoneType == 61 ) { saux += "ZoRaRayE " + saux2 + "\n" ; } + else { saux += "ZoRaRayo " + saux2 + "\n" ; } + } + if ( ZoneType == 61 ) + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x8 ; + saux += "ZoRaRayI " + saux1.str() + "\n" ; + } + } + else if ( ZoneType == 32 || ZoneType == 62 ) + { + saux += "# Sphere\n" ; + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x1 ; + saux += "ZoRaXCen " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x2 ; + saux += "ZoRaYCen " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x6 ; + saux2 = saux1.str() ; + if ( ZoneType == 62 ) { saux += "ZoRaRayE " + saux2 + "\n" ; } + else { saux += "ZoRaRayo " + saux2 + "\n" ; } + } + if ( ZoneType == 62 ) + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x8 ; + saux += "ZoRaRayI " + saux1.str() + "\n" ; + } + } + else if ( ZoneType == 33 || ZoneType == 63 ) + { + saux += "# Sphere\n" ; + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x0 ; + saux += "ZoRaXCen " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x2 ; + saux += "ZoRaYCen " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x6 ; + saux2 = saux1.str() ; + if ( ZoneType == 63 ) { saux += "ZoRaRayE " + saux2 + "\n" ; } + else { saux += "ZoRaRayo " + saux2 + "\n" ; } + } + if ( ZoneType == 63 ) + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x8 ; + saux += "ZoRaRayI " + saux1.str() + "\n" ; + } + } +// +// Cas de la sphere +// + else if ( ZoneType == 4 ) + { + saux += "# Sphere\n" ; + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x0 ; + saux += "ZoRaXCen " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x1 ; + saux += "ZoRaYCen " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x2 ; + saux += "ZoRaZCen " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x3 ; + saux += "ZoRaRayo " + saux1.str() + "\n" ; + } + } +// +// Cas du cylindre ou du tuyau +// + else if ( ZoneType == 5 || ZoneType == 7 ) + { + if ( ZoneType == 5 ) { saux += "# Cylindre\n" ; } + else { saux += "# Tuyau\n" ; } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x0 ; + saux += "ZoRaXBas " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x1 ; + saux += "ZoRaYBas " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x2 ; + saux += "ZoRaZBas " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x3 ; + saux += "ZoRaXAxe " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x4 ; + saux += "ZoRaYAxe " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x5 ; + saux += "ZoRaZAxe " + saux1.str() + "\n" ; + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x6 ; + saux2 = saux1.str() ; + if ( ZoneType == 5 ) { saux += "ZoRaRayo " + saux2 + "\n" ; } + else { saux += "ZoRaRayE " + saux2 + "\n" ; } + } + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x7 ; + saux += "ZoRaHaut " + saux1.str() + "\n" ; + } + if ( ZoneType == 7 ) + { std::stringstream saux1 ; + saux1 << NumeZone << " " << x8 ; + saux += "ZoRaRayI " + saux1.str() + "\n" ; + } + } +// + _Texte += saux + "#\n" ; +// +// MESSAGE("A la fin de HomardDriver::TexteZone, _Texte ="<<_Texte); +} +//=============================================================================== +void HomardDriver::TexteField( const std::string FieldName, const std::string FieldFile, int TimeStep, int Rank, + int TypeThR, double ThreshR, int TypeThC, double ThreshC, + int UsField, int UsCmpI ) +{ + MESSAGE("TexteField, FieldName = "<= 0 ) + { + { + std::stringstream saux1 ; + saux1 << TimeStep ; + saux2 = saux1.str() ; + _Texte += "CCNumPTI " + saux2 + "\n" ; + } + if ( Rank >= 0 ) + { + std::stringstream saux1 ; + saux1 << Rank ; + saux2 = saux1.str() ; + _Texte += "CCNumOrI " + saux2 + "\n" ; + } + } +// + saux = " " ; + if ( TypeThR == 1 ) + { saux = "Hau" ; } + if ( TypeThR == 2 ) + { saux = "HRe" ; } + if ( TypeThR == 3 ) + { saux = "HPE" ; } + if ( TypeThR == 4 ) + { saux = "HMS" ; } + if ( saux != " " ) + { + std::stringstream saux1 ; + saux1 << ThreshR ; + _Texte += "Seuil" + saux + " " + saux1.str() + "\n" ; + } +// + saux = " " ; + if ( TypeThC == 1 ) + { saux = "Bas" ; } + if ( TypeThC == 2 ) + { saux = "BRe" ; } + if ( TypeThC == 3 ) + { saux = "BPE" ; } + if ( TypeThC == 4 ) + { saux = "BMS" ; } + if ( saux != " " ) + { + std::stringstream saux1 ; + saux1 << ThreshC ; + _Texte += "Seuil" + saux + " " + saux1.str() + "\n" ; + } +// + saux = " " ; + if ( UsField == 0 ) + { saux = "MAILLE" ; } + if ( UsField == 1 ) + { saux = "SAUT" ; } + if ( saux != " " ) + { + _Texte += "CCModeFI " + saux + "\n" ; + } +// + saux = " " ; + if ( UsCmpI == 0 ) + { saux = "L2" ; } + if ( UsCmpI == 1 ) + { saux = "INFINI" ; } + if ( UsCmpI == 2 ) + { saux = "RELATIF" ; } + if ( saux != " " ) + { + _Texte += "CCUsCmpI " + saux + "\n" ; + } +} +//=============================================================================== +void HomardDriver::TexteGroup( const std::string GroupName ) +{ + MESSAGE("TexteGroup, GroupName = "<0 si pas de precision) +// Rank : numero d'ordre retenu +// +void HomardDriver::TexteFieldInterpNameType( int NumeChamp, const std::string FieldName, const std::string TypeInterp, int TimeStep, int Rank) +{ + MESSAGE("TexteFieldInterpNameType, NumeChamp = "<= 0 ) + { + { + std::stringstream saux1 ; + saux1 << TimeStep ; + _Texte += "CCChaPdT " + saux + " " + saux1.str() + "\n" ; + } + { + std::stringstream saux1 ; + saux1 << Rank ; + _Texte += "CCChaNuO " + saux + " " + saux1.str() + "\n" ; + } + } +} +//=============================================================================== +// F. Les options avancees +//=============================================================================== +void HomardDriver::TexteAdvanced( int Pyram, int NivMax, double DiamMin, int AdapInit, int ExtraOutput ) +{ + MESSAGE("TexteAdvanced, Pyram ="< 0 ) + { + _Texte += "# Niveaux extremes\n" ; + { std::stringstream saux1 ; + saux1 << NivMax ; + _Texte += "NiveauMa " + saux1.str() + "\n" ; + } + } + if ( DiamMin > 0 ) + { + _Texte += "# Diametre minimal\n" ; + { std::stringstream saux1 ; + saux1 << DiamMin ; + _Texte += "DiametMi " + saux1.str() + "\n" ; + } + } + if ( AdapInit != 0 ) + { + if ( AdapInit > 0 ) + { _Texte += "# Raffinement" ; } + else + { _Texte += "# Deraffinement" ; } + _Texte += " des regions sans indicateur\n" ; + { std::stringstream saux1 ; + saux1 << AdapInit ; + _Texte += "AdapInit " + saux1.str() + "\n" ; + } + } + if ( ExtraOutput % 2 == 0 ) + { + _Texte += "# Sortie des niveaux de raffinement\n" ; + _Texte += "NCNiveau NIVEAU\n" ; + } + if ( ExtraOutput % 3 == 0 ) + { + _Texte += "# Sortie des qualités des mailles\n" ; + _Texte += "NCQualit QUAL\n" ; + } + if ( ExtraOutput % 5 == 0 ) + { + _Texte += "# Sortie des diamètres des mailles\n" ; + _Texte += "NCDiamet DIAM\n" ; + } + if ( ExtraOutput % 7 == 0 ) + { + _Texte += "# Sortie des parents des mailles\n" ; + _Texte += "NCParent PARENT\n" ; + } + if ( ExtraOutput % 11 == 0 ) + { + _Texte += "# Volumes voisins par recollement\n" ; + _Texte += "NCVoisRc Voisin-Recollement\n" ; + } +} +//=============================================================================== +// G. Les messages +//=============================================================================== +void HomardDriver::TexteInfoCompute( int MessInfo ) +{ + MESSAGE("TexteAdvanced, MessInfo ="< +#include + +class HOMARDIMPL_EXPORT HomardDriver +{ +public: + HomardDriver(const std::string siter, const std::string siterp1); + ~HomardDriver(); + // + void TexteInit( const std::string DirCompute, const std::string LogFile, const std::string Langue ); + void TexteInfo( int TypeBila, int NumeIter ); + void TexteMajCoords( int NumeIter ); + void CreeFichierDonn(); + void TexteAdap( int ExtType ); + void CreeFichier(); + void TexteMaillage( const std::string NomMesh, const std::string MeshFile, int apres ); + void TexteMaillageHOMARD( const std::string Dir, const std::string liter, int apres ); + void TexteConfRaffDera( int ConfType, int TypeAdap, int TypeRaff, int TypeDera ); + void TexteZone( int NumeZone, int ZoneType, int TypeUse, double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8 ); + void TexteGroup( const std::string GroupName ); + void TexteField( const std::string FieldName, const std::string FieldFile, + int TimeStep, int Rank, + int TypeThR, double ThreshR, int TypeThC, double ThreshC, + int UsField, int UsCmpI ); + void TexteCompo( int NumeComp, const std::string NomCompo); + + void TexteBoundaryOption( int BoundaryOption ); + void TexteBoundaryCAOGr( const std::string GroupName ); + void TexteBoundaryDi( const std::string MeshName, const std::string MeshFile ); + void TexteBoundaryDiGr( const std::string GroupName ); + void TexteBoundaryAn( const std::string NameBoundary, int NumeBoundary, int BoundaryType, double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7 ); + void TexteBoundaryAnGr( const std::string NameBoundary, int NumeBoundary, const std::string GroupName ); + + void TexteFieldInterp( const std::string FieldFile, const std::string MeshFile ); + void TexteFieldInterpAll(); + void TexteFieldInterpNameType( int NumeChamp, const std::string FieldName, const std::string TypeInterp, int TimeStep, int Rank ); + void TexteAdvanced( int Pyram, int NivMax, double DiamMin, int AdapInit, int LevelOutput ); + void TexteInfoCompute( int MessInfo ); + // + int ExecuteHomard(int option); + // + +public: + int _modeHOMARD; + std::string _HOMARD_Exec; + std::string _NomDir; + std::string _NomFichierConfBase; + std::string _NomFichierConf; + std::string _NomFichierDonn; + std::string _siter; + std::string _siterp1; + std::string _Texte; + int _TimeStep; + int _Rank; + bool _bLu; + +}; + +# endif /* # ifndef _HOMARDDRIVER_HXX_ */ diff --git a/src/ADAPT/YACSDriver.cxx b/src/ADAPT/YACSDriver.cxx new file mode 100644 index 000000000..27910535d --- /dev/null +++ b/src/ADAPT/YACSDriver.cxx @@ -0,0 +1,684 @@ +// HOMARD HOMARD : implementation of HOMARD idl descriptions +// +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Pilote l'ecriture du fichier xml pour lancer un schema YACS + +#include +#ifndef WIN32 +#include +#endif +#include + +#include "YACSDriver.hxx" +#include "HOMARD.hxx" +#include "Utils_SALOME_Exception.hxx" +#include "utilities.h" + +//============================================================================= +//============================================================================= +YACSDriver::YACSDriver(const std::string XMLFile, const std::string DirName, const std::string LangueShort): + _XMLFile( "" ), _DirName( "" ), + _Texte( "" ), + _Texte_parametres( "" ), + _noeud_1( "CreateCase" ), + _LangueShort( "" ), + _bLu( false ) +{ + MESSAGE("XMLFile = "<" ; + _Texte += Meshfile ; + _Texte += "\n" ; +// +} +//=============================================================================== +// Le repertoire de calcul +// Le script de lancement +//=============================================================================== +void YACSDriver::Texte_Alternance_Calcul_HOMARD_Calcul( const std::string FileName ) +{ + MESSAGE("Texte_Alternance_Calcul_HOMARD_Calcul, FileName : "<\n" ; + INFOS("_LangueShort = "<<_LangueShort ); + if ( _LangueShort == "fr" ) { motcle = "Etude_Initialisation" ; } + else { motcle = "Study_Initialisation" ; } + INFOS("motcle = "<\n" ; + _Texte += " " + methode + "\n" ; +// 4. Les inports +// 4.1. Le nom de la zone + _Texte += Texte_inport( "string", "ZoneName" ) ; + TexteParametre( node, "ZoneName", "string", ZoneName ) ; +// 4.2. Les valeurs numeriques +// ATTENTION : les noms doivent etre les memes que dans Gen.xml, donc HOMARD_Gen.idl +// 4.2.1. Decodage des valeurs +// La chaine pythonStructure est de ce genre : +// CreateZoneBox( "Zone_1", 0.144, 0.216, 0.096, 0.1464, 0.076, 0.12) + std::string ligne = pythonStructure ; +// On commence par ne garder que ce qui suit la premiere virgule + ligne = GetStringInTexte( ligne, ",", 1 ); +// On boucle pour isoler toutes les chaines dans les virgules + std::string lignebis ; + std::string x0, x1, x2, x3, x4, x5, x6, x7, x8 ; + int iaux = 0 ; + while ( ligne != lignebis ) + { + lignebis = GetStringInTexte ( ligne, ",", 0 ) ; +// MESSAGE("lignebis = "< 10 ) && ( ZoneType < 14 ) ) + { + _Texte += Texte_inport( "double", "Umini" ) ; + _Texte += Texte_inport( "double", "Umaxi" ) ; + _Texte += Texte_inport( "double", "Vmini" ) ; + _Texte += Texte_inport( "double", "Vmaxi" ) ; + _Texte += Texte_inport( "long", "Orient" ) ; + TexteParametre( node, "Umini", "double", x0 ) ; + TexteParametre( node, "Umaxi", "double", x1 ) ; + TexteParametre( node, "Vmini", "double", x2 ) ; + TexteParametre( node, "Vmaxi", "double", x3 ) ; + TexteParametre( node, "Orient", "int", x8 ) ; + } +// +// 4.2.4. Cas du disque (31, 32, 33) ou du disque perce (61, 62, 63) + else if ( ( ( ZoneType > 30 ) && ( ZoneType < 34 ) ) || ( ( ZoneType > 60 ) && ( ZoneType < 64 ) ) ) + { + _Texte += Texte_inport( "double", "Ucentre" ) ; + _Texte += Texte_inport( "double", "Vcentre" ) ; + _Texte += Texte_inport( "double", "Radius" ) ; + TexteParametre( node, "Ucentre", "double", x0 ) ; + TexteParametre( node, "Vcentre", "double", x1 ) ; + TexteParametre( node, "Radius", "double", x2 ) ; + if ( ZoneType > 60 ) + { + _Texte += Texte_inport( "double", "InternalRadius" ) ; + TexteParametre( node, "InternalRadius", "double", x3 ) ; + } + _Texte += Texte_inport( "long", "Orient" ) ; + TexteParametre( node, "Orient", "int", x8 ) ; + } +// +// 4.2.5. Cas de la sphere (4) + else if ( ZoneType == 4 ) + { + _Texte += Texte_inport( "double", "Xcentre" ) ; + _Texte += Texte_inport( "double", "Ycentre" ) ; + _Texte += Texte_inport( "double", "Zcentre" ) ; + _Texte += Texte_inport( "double", "Radius" ) ; + TexteParametre( node, "Xcentre", "double", x0 ) ; + TexteParametre( node, "Ycentre", "double", x1 ) ; + TexteParametre( node, "Zcentre", "double", x2 ) ; + TexteParametre( node, "Radius", "double", x8 ) ; + } +// +// 4.2.6. Cas du cylindre (5) ou du tuyau (7) + else if ( ZoneType == 5 || ZoneType == 7 ) + { + _Texte += Texte_inport( "double", "Xcentre" ) ; + _Texte += Texte_inport( "double", "Ycentre" ) ; + _Texte += Texte_inport( "double", "Zcentre" ) ; + _Texte += Texte_inport( "double", "Xaxis" ) ; + _Texte += Texte_inport( "double", "Yaxis" ) ; + _Texte += Texte_inport( "double", "Zaxis" ) ; + _Texte += Texte_inport( "double", "Radius" ) ; + _Texte += Texte_inport( "double", "Height" ) ; + TexteParametre( node, "Xcentre", "double", x0 ) ; + TexteParametre( node, "Ycentre", "double", x1 ) ; + TexteParametre( node, "Zcentre", "double", x2 ) ; + TexteParametre( node, "Xaxis", "double", x3 ) ; + TexteParametre( node, "Yaxis", "double", x4 ) ; + TexteParametre( node, "Zaxis", "double", x5 ) ; + TexteParametre( node, "Radius", "double", x6 ) ; + if ( ZoneType == 5 ) + { + TexteParametre( node, "Height", "double", x8 ) ; + } + else + { + _Texte += Texte_inport( "double", "InternalRadius" ) ; + TexteParametre( node, "Height", "double", x7 ) ; + TexteParametre( node, "InternalRadius", "double", x8 ) ; + } + } +// +// 4.2.7. Erreur + else + { VERIFICATION("Type de zone inconnu." == 0); } + +// +// 5. La fin + _Texte += " \n" ; + _Texte += " \n" ; +// + return texte_control ; +// +} +//=============================================================================== +// La description des frontieres +// BoundaryType : le type de la frontiere +// pythonStructure : le python correspondant a la frontiere +// methode : methode associee a la creation de la frontiere +// BoundaryName : nom de la frontiere +// MeshName : nom du maillage dans le cas d'une frontiere discrete +// MeshFile : nom du fichier du maillage dans le cas d'une frontiere discrete +//=============================================================================== +std::string YACSDriver::Texte_Iter_1_Boundary( int BoundaryType, const std::string pythonStructure, const std::string methode, const std::string BoundaryName, const std::string MeshName, const std::string MeshFile ) +{ + MESSAGE("Texte_Iter_1_Boundary, BoundaryType = "<\n" ; + if ( _LangueShort == "fr" ) { motcle = "Etude_Initialisation" ; } + else { motcle = "Study_Initialisation" ; } + _Texte += " " + motcle + ".UpdateStudy\n" ; + _Texte += " " + methode + "\n" ; +// 4. Les inports +// ATTENTION : les noms doivent etre les memes que dans Gen.xml, donc HOMARD_Gen.idl +// 4.1. Le nom de la frontiere + _Texte += Texte_inport( "string", "BoundaryName" ) ; + TexteParametre( node, "BoundaryName", "string", BoundaryName ) ; +// 4.2. Cas d une frontiere discrete + if (BoundaryType == 0) + { + _Texte += Texte_inport( "string", "MeshName" ) ; + TexteParametre( node, "MeshName", "string", MeshName ) ; + _Texte += Texte_inport( "string", "FileName" ) ; + TexteParametre( node, "FileName", "string", MeshFile ) ; + } +// 4.3. Cas d'une frontiere analytique : les valeurs numeriques + else + { +// 4.3.1. Decodage des valeurs +// La chaine pythonStructure est de ce genre : +// CreateBoundaryCylinder('cyl_2', 17.5, -2.5, -12.5, -100., -75., -25., 50.) +// CreateBoundaryDi("intersection", "PIQUAGE", "/scratch/D68518/Salome/script/sfr_2d_piquage.fr.med") + std::string ligne = pythonStructure ; +// On commence par ne garder que ce qui suit la premiere virgule + ligne = GetStringInTexte( ligne, ",", 1 ); +// On boucle pour isoler toutes les chaines dans les virgules + std::string lignebis ; + std::string x0, x1, x2, x3, x4, x5, x6, x7 ; + int iaux = 0 ; + while ( ligne != lignebis ) + { + lignebis = GetStringInTexte ( ligne, ",", 0 ) ; +// MESSAGE("lignebis = "<\n" ; + _Texte += " \n" ; +// + return texte_control ; +// +} +//=============================================================================== +// Fin du controle des enchainements de noeud dans le noeud Iter_1 +//=============================================================================== + std::string YACSDriver::Texte_Iter_1_control() +{ + MESSAGE("Texte_Iter_1_control"); +// + std::string texte ; + texte = Texte_control (_noeud_1, "CreateHypothesis", 1) ; + texte += Texte_control ("CreateHypothesis", "Case_Options", 0) ; +// + return texte ; +// +} +//=============================================================================== +// Controle des enchainements de noeuds +// noeud_1 : noeud de depart +// noeud_2 : noeud d'arrivee +// option : 0 : sans caractere de saut de ligne a la fin +// 1 : avec caractere de saut de ligne a la fin +//=============================================================================== + std::string YACSDriver::Texte_control( const std::string noeud_1, const std::string noeud_2, int option ) +{ + MESSAGE("Texte_control, noeud_1 = "< " ; + texte += "" + noeud_1 + "" ; + texte += " " + noeud_2 + "" ; + texte += " " ; + if ( option == 1 ) { texte += "\n" ; } + + return texte ; +// +} +//=============================================================================== +// Inport +// inport_type : type de la donnee a importer +// inport_nom : nom de la donnee a importer +//=============================================================================== + std::string YACSDriver::Texte_inport( const std::string inport_type, const std::string inport_nom ) +{ +// MESSAGE("Texte_inport, inport_type = "< indice ) + { + int position = ligne.find_first_of( "." ) ; + MESSAGE("\nposition : "<< position); + if ( position > 0 ) + { + ligne_bis = ligne.substr( position ); + MESSAGE("\nligne_bis : "<< ligne_bis); + _Texte += concept + ligne_bis + "\n" ; + } + } + cptr += 1 ; + } +// +} +//=============================================================================== +// Manipulation des instructions python - 2 +// pythonTexte : le texte des instructions python a manipuler +// mot_cle : mot-cle dans les lignes a inserer +// concept : nom du concept a inserer +//=============================================================================== +void YACSDriver::Texte_python_2( const std::string pythonTexte, const std::string mot_cle, const std::string concept ) +{ + MESSAGE("Texte_python_2, pythonTexte\n"< 0 ) + { + int position = ligne.find_first_of( "." ) ; +// MESSAGE("\nposition : "<< position); + if ( position > 0 ) + { + ligne_bis = ligne.substr( position ); +// MESSAGE("\nligne_bis : "<< ligne_bis); + _Texte += concept + ligne_bis + "\n" ; + } + } + } +// +} +//=============================================================================== +// Parametres de tests de convergence +//=============================================================================== +void YACSDriver::TexteAnalyse_Test_Convergence( int MaxIter, int MaxNode, int MaxElem ) +{ +// +// MESSAGE("TexteAnalyse_Test_Convergence"); + std::string chaine ; + std::ostringstream oss1; + oss1 << MaxIter; + chaine = oss1.str(); + _Texte += "MaxIter = " + chaine + "\n" ; + std::ostringstream oss2; + oss2 << MaxNode; + chaine = oss2.str(); + _Texte += "MaxNode = " + chaine + "\n" ; + std::ostringstream oss3; + oss3 << MaxElem; + chaine = oss3.str(); + _Texte += "MaxElem = " + chaine + "\n" ; +// +} +//=============================================================================== +// Creation d'un parametre +//=============================================================================== +void YACSDriver::TexteParametre( const std::string node, const std::string port, const std::string type_value, const std::string value ) +{ +// +// MESSAGE("TexteParametre"); + _Texte_parametres += " \n" ; + _Texte_parametres += " " + node + "" ; + _Texte_parametres += "" + port + "\n" ; + _Texte_parametres += " <" + type_value + ">" + value + "\n" ; + _Texte_parametres += " \n" ; +// +} +//=============================================================================== +// Ajout des parametres +//=============================================================================== +void YACSDriver::TexteAddParametres( ) +{ +// + MESSAGE("TexteAddParametres"); + TexteAdd(_Texte_parametres) ; +// +} +//=============================================================================== +void YACSDriver::CreeFichier( ) +{ +// + MESSAGE("CreeFichier sur le fichier "<<_XMLFile); + std::ofstream Fic(_XMLFile.c_str(), std::ios::out ) ; + if (Fic.is_open() == true) { Fic << _Texte << std::endl ; } + Fic.close() ; +// +} +//=============================================================================== +// REMARQUE : on devrait utiliser le GetStringInTexte de HOMARD_Gen_i mais je ne sais pas +// comment l'appeler. ALors je clone. +// Recuperation de la chaine de caracteres par rapport l'apparition d'un texte +// ligne : la ligne a manipuler +// texte : le texte a reperer +// option : 0 : la chaine avant le texte +// 1 : la chaine apres le texte +// Si le texte est absent, on retourne la chaine totale +//=============================================================================== +std::string YACSDriver::GetStringInTexte( const std::string ligne, const std::string texte, int option ) +{ +// MESSAGE("GetStringInTexte, recherche de '"< +#include + +class HOMARDIMPL_EXPORT YACSDriver +{ +public: + YACSDriver(const std::string XMLFile, const std::string DirName, const std::string LangueShort) ; + ~YACSDriver() ; + // + void TexteAdd( const std::string ligne ) ; + void Texte_DataInit_MeshFile( const std::string Meshfile ) ; + void Texte_Alternance_Calcul_HOMARD_Calcul( const std::string FileName ) ; + void Texte_Iter_1_Case_Options( const std::string pythonCas ) ; + std::string Texte_Iter_1_Boundary( int BoundaryType, const std::string pythonStructure, const std::string methode, const std::string BoundaryName, const std::string MeshName, const std::string MeshFile ) ; + std::string Texte_Iter_1_Zone( int ZoneType, const std::string pythonStructure, const std::string methode, const std::string ZoneName ) ; + std::string Texte_Iter_1_control() ; + std::string Texte_control( const std::string noeud_1, const std::string noeud_2, int option ) ; + std::string Texte_inport( const std::string inport_type, const std::string inport_nom ) ; + void Texte_HOMARD_Exec_DirName( ) ; + void Texte_HOMARD_Exec_MeshName( const std::string MeshName ) ; + void Texte_python_1( const std::string pythonTexte, int indice, const std::string concept ) ; + void Texte_python_2( const std::string pythonTexte, const std::string mot_cle, const std::string concept ) ; + void TexteParametre( const std::string node, const std::string port, const std::string type_value, const std::string value ) ; + void TexteAnalyse_Test_Convergence( int MaxIter, int MaxNode, int MaxElem ) ; + void TexteAddParametres( ) ; + void CreeFichier() ; + // + +public: + std::string _XMLFile ; + std::string _DirName ; + std::string _Texte ; + std::string _Texte_parametres ; + std::string _noeud_1 ; + std::string _LangueShort ; + bool _bLu; + +private : + std::string GetStringInTexte( const std::string Texte, const std::string String, int option ) ; +}; + +# endif /* # ifndef __YACSDRIVER_H__ */ diff --git a/src/ADAPTGUI/ADAPT_msg_en.ts b/src/ADAPTGUI/ADAPT_msg_en.ts new file mode 100644 index 000000000..4d40ad891 --- /dev/null +++ b/src/ADAPTGUI/ADAPT_msg_en.ts @@ -0,0 +1,459 @@ + + + + + @default + + HOM_MEN_HOMARD + HOMARD + + + HOM_MEN_MODIFICATION + Modification + + + HOM_MEN_INFORMATION + Information + + + HOM_MEN_YACS + YACS + + + HOM_MEN_NEW_CASE + New case + + + HOM_MEN_NEW_ITERATION + Next iteration + + + HOM_MEN_PURSUE_ITERATION + Case: pursuit of a stored iteration + + + HOM_MEN_COMPUTE + Compute + + + HOM_MEN_COMPUTE_PUBLISH + Compute and publish + + + HOM_MEN_EDIT + Edit + + + HOM_MEN_DELETE + Delete + + + HOM_MEN_MESH_INFO + Mesh analysis + + + HOM_MEN_MESH_PUBLICATION + Mesh publication + + + HOM_MEN_EDIT_MESS_FILE + Show the file + + + HOM_MEN_WRITE + Write + + + HOM_TOP_HOMARD + HOMARD + + + HOM_TOP_NEW_CASE + New case + + + HOM_TOP_NEW_ITERATION + Next iteration + + + HOM_TOP_PURSUE_ITERATION + Case: pursuit of a stored iteration + + + HOM_TOP_COMPUTE + Compute + + + HOM_TOP_COMPUTE_PUBLISH + Compute and publish + + + HOM_TOP_EDIT + Edit + + + HOM_TOP_DELETE + Delete + + + HOM_TOP_EDIT_MESS_FILE + Show the file + + + HOM_STB_HOMARD + HOMARD + + + HOM_STB_NEW_CASE + New case + + + HOM_STB_NEW_ITERATION + Next iteration + + + HOM_STB_PURSUE_ITERATION + Case: pursuit of a stored iteration + + + HOM_STB_COMPUTE + Compute + + + HOM_STB_COMPUTE_PUBLISH + Compute and publish + + + HOM_STB_EDIT + Edit + + + HOM_STB_DELETE + Delete + + + HOM_STB_EDIT_MESS_FILE + Show the file + + + HOM_WARNING + Warning + + + HOM_ERROR + Error + + + HOM_INACTIVE_BUTTON + Inactive button + + + HOM_SELECT_OBJECT_1 + Select an object. + + + HOM_SELECT_OBJECT_2 + Select only one object. + + + HOM_SELECT_OBJECT_3 + Select an object with type %1. + + + HOM_SELECT_OBJECT_4 + The name of the object is already selected. Modify it or cancel. + + + HOM_SELECT_FILE_0 + File selection + + + HOM_SELECT_FILE_1 + Select a file. + + + HOM_SELECT_FILE_2 + Select only one file. + + + HOM_SELECT_FILE_3 + This file cannot be opened. + + + HOM_SCRIPT_FILE + A script file must be given. + + + HOM_MED_FILE_1 + This MED file cannot be read. + + + HOM_MED_FILE_2 + No mesh in this MED file. + + + HOM_MED_FILE_3 + More than one mesh in this MED file. + + + HOM_MED_FILE_4 + The mesh in this MED file cannot be read. + + + HOM_MED_FILE_5 + No field in this MED file. + + + HOM_MED_FILE_6 + The field(s) in this MED file cannot be read. + + + HOM_SELECT_STUDY + Select a study object with associated MED file \n or select a MED file. + + + HOM_CASE_NAME + The case must be named. + + + HOM_CASE_DIRECTORY_1 + A directory for the case must be selected. + + + HOM_CASE_DIRECTORY_2 + This directory is already used by the case + + + HOM_CASE_DIRECTORY_3 + A valid directory for the case must be selected. + + + HOM_CASE_DIRECTORY_4 + A directory for the computation must be selected. + + + HOM_START_DIRECTORY_1 + A starting directory for the pursuit must be selected. + + + HOM_START_DIRECTORY_3 + A valid directory for the pursuit must be selected. + + + HOM_CASE_MESH + The file of the initial mesh must be selected. + + + HOM_CASE_GROUP + The group "%1" cannot be given for more than 1 boundary. + + + HOM_CASE_EDIT_WINDOW_TITLE + Edition of a case + + + HOM_CASE_EDIT_STATE_0 + Initial mesh. + + + HOM_CASE_EDIT_STATE + Pursuit of an iteration. + + + HOM_CASE_PURSUE_WINDOW_TITLE + Case: pursuit of a stored iteration + + + HOM_ITER_NAME + The iteration must be named. + + + HOM_ITER_STARTING_POINT + The previous iteration must be given. + + + HOM_ITER_MESH + Give a name for the final mesh. + + + HOM_ITER_HYPO + A hypothesis must be selected. + + + HOM_ITER_FIELD_FILE + With this hypothesis, a file for the field must be given. + + + HOM_ITER_STARTING_POINT_0 + Mesh + + + HOM_ITER_STARTING_POINT_1 + First iteration of the case. + + + HOM_ITER_STARTING_POINT_2 + First iteration of the case for the pursuit. + + + HOM_ITER_EDIT_WINDOW_TITLE + Edition of an iteration + + + HOM_HYPO_NAME + The hypothesis must be named. + + + HOM_HYPO_FIELD_FILE + A file for the field must be given. + + + HOM_HYPO_ZONE_1 + A zone must be selected. + + + HOM_HYPO_ZONE_2 + At least, one zone must be selected. + + + HOM_HYPO_ZONE_3 + Either refinement or coarsening, but not both. + + + HOM_HYPO_NORM_L2 + L2 norm + + + HOM_HYPO_NORM_INF + Infinite norm + + + HOM_HYPO_NORM_ABS + Absolute + + + HOM_HYPO_NORM_REL + Relative + + + HOM_HYPO_COMP + At least, one component must be selected. + + + HOM_HYPO_EDIT_WINDOW_TITLE + Edition of a hypothesis + + + HOM_ZONE_NAME + The zone must be named. + + + HOM_ZONE_LIMIT + %1 maxi must be greater than %1 mini. + + + HOM_ZONE_RAYON + The external radius must be greater than the internal radius. + + + HOM_ZONE_EDIT_WINDOW_TITLE + Edition of a zone + + + HOM_BOUN_NAME + The boundary must be named. + + + HOM_BOUN_MESH + The file for the mesh of the boundary must be selected. + + + HOM_BOUN_CAO + The file for the CAO must be selected. + + + HOM_BOUN_CASE + The meshfile of the case is unknown. + + + HOM_AXE + The axis must be a non 0 vector. + + + HOM_BOUN_C_EDIT_WINDOW_TITLE + Edition of a CAO based boundary + + + HOM_BOUN_A_EDIT_WINDOW_TITLE + Edition of an analytical boundary + + + HOM_BOUN_D_EDIT_WINDOW_TITLE + Edition of a discrete boundary + + + HOM_GROU_EDIT_WINDOW_TITLE + Selected groups + + + HOM_MESH_INFO_0 + Mesh analysis + + + HOM_MESH_INFO_1 + Select at least one option. + + + HOM_MESH_INFO_2 + Analysis in the object browser, file + + + HOM_YACS_EDIT_WINDOW_TITLE + Edition of a schema YACS + + + PREF_TAB_GENERAL + General + + + PREF_PUBLICATION + Publication + + + PREF_PUBLICATION_MAILLAGE_IN + IN meshes + + + PREF_PUBLICATION_MAILLAGE_OUT + OUT meshes + + + PREF_YACS + YACS + + + PREF_YACS_MAX + Maximum numbers + + + PREF_YACS_MAX_ITER + Iterations + + + PREF_YACS_MAX_NODE + Nodes + + + PREF_YACS_MAX_ELEM + Elements + + + PREF_YACS_CONVERGENCE + Convergence + + + PREF_YACS_TYPE_TEST + Test type + + + diff --git a/src/ADAPTGUI/ADAPT_msg_fr.ts b/src/ADAPTGUI/ADAPT_msg_fr.ts new file mode 100644 index 000000000..3306a69e7 --- /dev/null +++ b/src/ADAPTGUI/ADAPT_msg_fr.ts @@ -0,0 +1,1171 @@ + + + + + @default + + HOM_MEN_HOMARD + HOMARD + + + HOM_MEN_MODIFICATION + Modification + + + HOM_MEN_INFORMATION + Information + + + HOM_MEN_YACS + YACS + + + HOM_MEN_NEW_CASE + Nouveau cas + + + HOM_MEN_NEW_ITERATION + Itération suivante + + + HOM_MEN_PURSUE_ITERATION + Cas de poursuite d'une itération + + + HOM_MEN_COMPUTE + Calculer + + + HOM_MEN_COMPUTE_PUBLISH + Calculer et publier + + + HOM_MEN_EDIT + Editer + + + HOM_MEN_DELETE + Supprimer + + + HOM_MEN_MESH_INFO + Analyse de maillage + + + HOM_MEN_MESH_PUBLICATION + Publication du maillage + + + HOM_MEN_EDIT_MESS_FILE + Afficher le fichier + + + HOM_MEN_WRITE + Ecrire + + + HOM_TOP_HOMARD + HOMARD + + + HOM_TOP_NEW_CASE + Nouveau cas + + + HOM_TOP_NEW_ITERATION + Itération suivante + + + HOM_TOP_PURSUE_ITERATION + Cas de poursuite d'une itération + + + HOM_TOP_COMPUTE + Calculer + + + HOM_TOP_COMPUTE_PUBLISH + Calculer et publier + + + HOM_TOP_EDIT + Editer + + + HOM_TOP_DELETE + Supprimer + + + HOM_TOP_EDIT_MESS_FILE + Afficher le fichier + + + HOM_STB_HOMARD + HOMARD + + + HOM_STB_NEW_CASE + Nouveau cas + + + HOM_STB_NEW_ITERATION + Itération suivante + + + HOM_STB_PURSUE_ITERATION + Cas de poursuite d'une itération + + + HOM_STB_COMPUTE + Calculer + + + HOM_STB_COMPUTE_PUBLISH + Calculer et publier + + + HOM_STB_EDIT + Editer + + + HOM_STB_DELETE + Supprimer + + + HOM_STB_EDIT_MESS_FILE + Afficher le fichier + + + HOM_WARNING + Avertissement + + + HOM_ERROR + Erreur + + + HOM_INACTIVE_BUTTON + Bouton inactif + + + OK + Appliquer et fermer + + + Apply + Appliquer + + + Cancel + Annuler + + + Help + Aide + + + New + Nouveau + + + Edit + Editer + + + Quit + Quitter + + + Name + Nom + + + Directory + Répertoire + + + Mesh + Maillage + + + Selection + Sélection + + + None + Aucun + + + All + Tout + + + HOM_SELECT_OBJECT_1 + Sélectionner un objet. + + + HOM_SELECT_OBJECT_2 + Sélectionner un seul objet. + + + HOM_SELECT_OBJECT_3 + Sélectionner un objet de type %1. + + + HOM_SELECT_OBJECT_4 + Le nom est déjà choisi. Modifiez le ou annulez la saisie. + + + HOM_SELECT_FILE_0 + Choix de fichier + + + HOM_SELECT_FILE_1 + Sélectionner un fichier. + + + HOM_SELECT_FILE_2 + Sélectionner un seul fichier. + + + HOM_SELECT_FILE_3 + Impossible d'ouvrir ce fichier. + + + HOM_SCRIPT_FILE + Il faut donner un fichier pour le script python. + + + HOM_MED_FILE_1 + Ce fichier MED est illisible. + + + HOM_MED_FILE_2 + Ce fichier MED ne contient aucun maillage. + + + HOM_MED_FILE_3 + Ce fichier MED contient plus d'un maillage. + + + HOM_MED_FILE_4 + Impossible de lire le maillage de ce fichier MED. + + + HOM_MED_FILE_5 + Ce fichier MED ne contient aucun champ. + + + HOM_MED_FILE_6 + Impossible de lire le(s) champ(s) de ce fichier MED. + + + HOM_SELECT_STUDY + Sélectionner une étude avec un fichier MED associé\n ou sélectionner un fichier MED. + + + Create a case + Création d'un cas + + + HOM_CASE_NAME + Il faut donner un nom au cas. + + + HOM_CASE_DIRECTORY_1 + Il faut choisir un répertoire de travail pour le cas. + + + HOM_CASE_DIRECTORY_2 + Ce répertoire est déjà utilisé par le cas + + + HOM_CASE_DIRECTORY_3 + Un répertoire valide doit être choisi. + + + HOM_CASE_DIRECTORY_4 + Il faut choisir un répertoire de travail pour le calcul. + + + HOM_START_DIRECTORY_1 + Il faut choisir un répertoire contenant l'itération à poursuivre. + + + HOM_START_DIRECTORY_3 + Un répertoire valide contenant l'itération à poursuivre doit être choisi. + + + HOM_CASE_MESH + Il faut choisir le maillage initial. + + + HOM_CASE_GROUP + Le groupe "%1" ne peut pas être attribué à plus d'une frontière. + + + HOM_CASE_EDIT_WINDOW_TITLE + Edition d'un cas + + + HOM_CASE_EDIT_STATE_0 + Maillage initial. + + + HOM_CASE_EDIT_STATE + Poursuite d'une itération. + + + HOM_CASE_PURSUE_WINDOW_TITLE + Cas de poursuite d'une itération + + + The configuration file cannot be found. + Le fichier de configuration de HOMARD est introuvable. + + + The configuration file cannot be read. + Le fichier de configuration de HOMARD est illisible. + + + The HOMARD mesh file cannot be found. + Le fichier de maillage de HOMARD est introuvable. + + + HOM_ITER_NAME + Il faut donner un nom à l'itération. + + + HOM_ITER_STARTING_POINT + Il faut désigner l'itération précédente. + + + HOM_ITER_MESH + Donner le nom du maillage final. + + + HOM_ITER_HYPO + Choisir une hypothèse. + + + HOM_ITER_FIELD_FILE + Avec cette hypothèse, il faut fournir le fichier du champ. + + + HOM_ITER_STARTING_POINT_0 + Maillage + + + HOM_ITER_STARTING_POINT_1 + Itération initiale du cas. + + + HOM_ITER_STARTING_POINT_2 + Itération initiale du cas pour la poursuite. + + + HOM_ITER_EDIT_WINDOW_TITLE + Edition d'une itération + + + Boundary type + Type de frontière + + + No boundary + Pas de frontière + + + Non CAO + Autre que CAO + + + Discrete boundary + Frontière discrète + + + Analytical boundary + Frontière analytique + + + Conformity type + Type de conformité + + + Conformal + Conforme + + + Non conformal + Non conforme + + + Non conformal option + Option de non conformité + + + Conformity + + Conformité + + + + Free + Libre + + + 1 hanging node per mesh + 1 noeud pendant par maille + + + 1 node per edge + 1 noeud pendant par arête + + + Advanced options + Options avancées + + + Authorized pyramids + Pyramides autorisées + + + Minimal diameter + Diamètre minimal + + + Initialization of adaptation + Initialisation de l'adaptation + + + Maximal level + Niveau maximal + + + Output of the level of refinement + Sortie du niveau de raffinement + + + Output of the qualities + Sortie des qualités + + + Output of the diameters + Sortie des diamètres + + + Output of the parents + Sortie des parents + + + Output of the neighbours + Sortie des voisins + + + Create an iteration + Création d'une itération + + + Iteration Name + Nom de l'itération + + + Previous iteration + Itération précédente + + + Invalid boundary + Frontière non valable + + + Invalid case + Cas non valable + + + Invalid case context + Cas contextuel non valable + + + Invalid hypothesis + Hypothèse non valable + + + Invalid iteration + Itération non valable + + + Invalid zone + Zone non valable + + + This boundary has already been defined. + Cette frontière est déjà définie. + + + This case has already been defined. + Ce cas est déjà défini. + + + This hypothesis has already been defined. + Cette hypothèse est déjà définie. + + + This iteration has already been defined. + Cette itération est déjà définie. + + + This zone has already been defined. + Cette zone est déjà définie. + + + The parent iteration is not defined. + L'itération parent n'est pas définie. + + + Unable to create the iteration. + Impossible de créer l'itération. + + + The directory for the computation cannot be created. + Impossible de créer le répertoire pour le calcul de l'itération. + + + This iteration is the first of the case and cannot be computed. + Cette itération définit le point de départ du cas. Elle ne peut pas être calculée. + + + This iteration does not have any associated hypothesis. + Cette itération n'est associée à aucune hypothèse. + + + The mesh file does not exist. + Le fichier du maillage n'existe pas. + + + The mesh file cannot be deleted. + Impossible de supprimer le fichier du maillage. + + + Mesh n + Maillage n + + + Mesh n+1 + Maillage n+1 + + + Field information + Information sur les champs + + + Field file + Fichier des champs + + + No time step + Sans pas de temps + + + Last time step + Dernier pas de temps + + + Chosen time step + Pas de temps choisi + + + Time step + Pas de temps + + + Rank + Numéro d'ordre + + + Hypothesis + Hypothèse + + + Create a hypothesis + Création d'une hypothèse + + + HOM_HYPO_NAME + Il faut donner un nom à l'hypothèse. + + + HOM_HYPO_FIELD_FILE + Il faut fournir le fichier du champ. + + + HOM_HYPO_ZONE_1 + Choisir une zone. + + + HOM_HYPO_ZONE_2 + Il faut choisir au moins une zone. + + + HOM_HYPO_ZONE_3 + Raffinement ou déraffinement, mais pas les deux. + + + HOM_HYPO_NORM_L2 + Norme L2 + + + HOM_HYPO_NORM_INF + Norme infinie + + + HOM_HYPO_NORM_ABS + Absolu + + + HOM_HYPO_NORM_REL + Relatif + + + HOM_HYPO_COMP + Il faut choisir au moins une composante. + + + HOM_HYPO_EDIT_WINDOW_TITLE + Edition d'une hypothèse + + + Type of adaptation + Type d'adaptation + + + Uniform + Uniforme + + + Driven by a field + Pilotage par un champ + + + With geometrical zones + Selon des zones géométriques + + + Uniform adaptation + Adaptation uniforme + + + Coarsening + Déraffinement + + + Refinement + Raffinement + + + Nothing + Rien + + + File of the fields + Fichier des champs + + + Governing field for the adaptation + Champ pilotant l'adaptation + + + Field name + Nom du champ + + + Jump between elements + Saut entre éléments + + + Component + Composante + + + Refinement threshold + Seuil de raffinement + + + Coarsening threshold + Seuil de déraffinement + + + Percentage of meshes + Pourcentage de mailles + + + Mean + n*(std deviation) + Moyenne + n*(ecart-type) + + + No refinement + Sans raffinement + + + Mean - n*(std deviation) + Moyenne - n*(ecart-type) + + + No coarsening + Sans déraffinement + + + Zone management + Gestion des zones + + + Zone name + Nom de la zone + + + Field Interpolation + Interpolation des champs + + + Chosen + Choisi + + + Create a zone + Création d'une zone + + + HOM_ZONE_NAME + Il faut donner un nom à la zone. + + + HOM_ZONE_LIMIT + %1 maxi doit être plus grand que %1 mini. + + + HOM_ZONE_RAYON + Le rayon externe doit être supérieur au rayon interne. + + + HOM_ZONE_EDIT_WINDOW_TITLE + Edition d'une zone + + + Type of zone + Type de la zone + + + Box + Boîte + + + Sphere + Sphère + + + Cylinder + Cylindre + + + Disk + Disque + + + Disk with hole + Disque avec trou + + + Pipe + Tuyau + + + Coordinates + Coordonnées + + + Get CAO + Acquisition de la CAO + + + Create an analytical boundary + Création d'une frontière analytique + + + Create a discrete boundary + Création d'une frontière discrète + + + Type of boundary + Type de la frontière + + + Torus + Tore + + + Radius + Rayon + + + Radius 1 + Rayon 1 + + + Radius 2 + Rayon 2 + + + External radius + Rayon externe + + + Internal radius + Rayon interne + + + Height + Hauteur + + + X axis + X axe + + + Y axis + Y axe + + + Z axis + Z axe + + + R revolution + R révolution + + + Primary R + R primaire + + + HOM_BOUN_NAME + Il faut donner un nom à la frontière. + + + HOM_BOUN_MESH + Il faut choisir le fichier qui contient le maillage de la frontière discrète. + + + HOM_BOUN_CAO + Il faut choisir le fichier qui contient la CAO. + + + HOM_BOUN_CASE + Le fichier du maillage du cas est inconnu. + + + HOM_AXE + L'axe doit être un vecteur non nul. + + + HOM_BOUN_C_EDIT_WINDOW_TITLE + Edition d'une frontière basée sur une CAO + + + HOM_BOUN_A_EDIT_WINDOW_TITLE + Edition d'une frontière analytique + + + HOM_BOUN_D_EDIT_WINDOW_TITLE + Edition d'une frontière discrète + + + HOM_GROU_EDIT_WINDOW_TITLE + Groupes choisis + + + The height must be positive. + La hauteur doit être positive. + + + The radius must be positive. + Un rayon doit être positif. + + + The axis must be a non 0 vector. + L'axe doit être un vecteur non nul. + + + The angle must be included higher than 0 degree and lower than 90 degrees. + L'angle doit être compris entre 0 et 90 degrés. + + + The radius must be different. + Les rayons doivent être différents. + + + The centers must be different. + Les centres doivent être différents. + + + The external radius must be higher than the internal radius. + Le rayon externe doit être supérieur au rayon interne. + + + The X coordinates are not coherent. + Les coordonnées en X ne sont pas cohérentes. + + + The Y coordinates are not coherent. + Les coordonnées en Y ne sont pas cohérentes. + + + The Z coordinates are not coherent. + Les coordonnées en Z ne sont pas cohérentes. + + + The first coordinates are not coherent. + Les premières coordonnées ne sont pas cohérentes. + + + The second coordinates are not coherent. + Les secondes coordonnées ne sont pas cohérentes. + + + The orientation must be 1, 2 or 3. + L'orientation vaut 1, 2 ou 3. + + + HOM_MESH_INFO_0 + Analyse de maillage + + + HOM_MESH_INFO_1 + Choisir au moins une option. + + + HOM_MESH_INFO_2 + Bilan de l'analyse dans l'arbre d'études, fichier + + + Filtering with groups + Filtrage par les groupes + + + Selection of groups + Choix des groupes + + + Selected groups + Groupes choisis + + + Group + Groupe + + + Information on a mesh + Analyse d'un maillage + + + Group size + Taille des domaines + + + Quality + Qualité + + + Connection + Connexité + + + Diametre + Diamètre + + + Entanglement + Interpénétration + + + No change is allowed in a boundary. Ask for evolution. + Impossible de changer une donnée dans une frontière. Demander une évolution. + + + This boundary is used in a case and cannot be deleted. + Cette frontière est utilisée dans un cas ; elle ne peut pas être détruite. + + + This hypothesis is used and cannot be deleted. + Cette hypothèse est utilisée dans une itération ; elle ne peut pas être détruite. + + + This iteration cannot be deleted. + Cette itération ne peut pas être détruite. + + + This zone is used in a hypothesis and cannot be deleted. + Cette zone est utilisée dans une hypothèse ; elle ne peut pas être détruite. + + + The directory for the calculation cannot be cleared. + Menage du repertoire de calcul impossible + + + Starting point + Point de départ + + + From an iteration + A partir d'une itération + + + From a case + A partir d'un cas + + + Iteration into the case + Choix d'une itération dans le cas + + + Last iteration + A partir de la dernière itération + + + Iteration number + A partir d'une itération numérotée + + + The directory of the case does not exist. + Le répertoire du cas n'existe pas. + + + The directory for the case cannot be modified because some iterations are already defined. + Impossible de changer le répertoire du cas car des itérations ont déjà été définies. + + + The directory for the case cannot be reached. + Impossible d'atteindre ce répertoire pour le cas. + + + The starting point for the case cannot be copied into the working directory. + Impossible de copier le point de départ du cas dans le répertoire de travail. + + + The starting point for the case cannot be moved into the new directory. + Impossible de déplacer le point de départ du cas dans le nouveau répertoire. + + + The directory of the case for the pursuit does not exist. + Le répertoire du cas de reprise n'existe pas. + + + The directory of the iteration does not exist. + Le répertoire de l'itération de reprise n'existe pas. + + + The number of iteration must be positive. + Le numéro de l'itération doit etre positif. + + + Number of iteration + Numéro de l'itération + + + Case + Cas + + + Mesh file + Maillage initial + + + Constant + Constant + + + Variable + Variable + + + Type of schema + Type de schema + + + Maximum of ... + Maximum de ... + + + Iterations + Itérations + + + Nodes + Noeuds + + + Elements + Eléments + + + Test of convergence + Test de convergence + + + Edit a file + Affichage d'un fichier + + + Print + Imprimer + + + Invalid study context + Etude contextuelle non valable + + + HOM_YACS_EDIT_WINDOW_TITLE + Edition d'un schéma YACS + + + PREF_TAB_GENERAL + Général + + + PREF_PUBLICATION + Publication + + + PREF_PUBLICATION_MAILLAGE_IN + Les maillages d'entrée + + + PREF_PUBLICATION_MAILLAGE_OUT + Les maillages de sortie + + + PREF_YACS + YACS + + + PREF_YACS_MAX + Nombres maximum + + + PREF_YACS_MAX_ITER + Itérations + + + PREF_YACS_MAX_NODE + Noeuds + + + PREF_YACS_MAX_ELEM + Eléments + + + PREF_YACS_CONVERGENCE + Convergence + + + PREF_YACS_TYPE_TEST + Type de test + + + diff --git a/src/ADAPTGUI/ADAPT_msg_ja.ts b/src/ADAPTGUI/ADAPT_msg_ja.ts new file mode 100644 index 000000000..e60a20c76 --- /dev/null +++ b/src/ADAPTGUI/ADAPT_msg_ja.ts @@ -0,0 +1,1148 @@ + + + + + @default + + HOM_MEN_HOMARD + ロブスター + + + HOM_MEN_MODIFICATION + 変更 + + + HOM_MEN_INFORMATION + 情報 + + + HOM_MEN_YACS + YACS + + + HOM_MEN_NEW_CASE + 新しいケース + + + HOM_MEN_NEW_ITERATION + 新しいイテレーション + + + HOM_MEN_PURSUE_ITERATION + イテレーションの追跡 + + + HOM_MEN_COMPUTE + 計算します。 + + + HOM_MEN_COMPUTE_PUBLISH + 計算と発行 + + + HOM_MEN_EDIT + 編集(&E) + + + HOM_MEN_DELETE + 削除 + + + HOM_MEN_MESH_INFO + メッシュの解析 + + + HOM_MEN_MESH_PUBLICATION + メッシュ発行 + + + HOM_MEN_EDIT_MESS_FILE + ファイルを表示します。 + + + HOM_MEN_WRITE + 書き込み + + + HOM_TOP_HOMARD + ロブスター + + + HOM_TOP_NEW_CASE + 新しいケース + + + HOM_TOP_NEW_ITERATION + 新しいイテレーション + + + HOM_TOP_PURSUE_ITERATION + イテレーションの追跡 + + + HOM_TOP_COMPUTE + 計算します。 + + + HOM_TOP_COMPUTE_PUBLISH + 計算と発行 + + + HOM_TOP_EDIT + 編集 + + + HOM_TOP_DELETE + 削除 + + + HOM_TOP_EDIT_MESS_FILE + ファイルを表示します。 + + + HOM_STB_HOMARD + ロブスター + + + HOM_STB_NEW_CASE + 新しいケース + + + HOM_STB_NEW_ITERATION + 新しいイテレーション + + + HOM_STB_PURSUE_ITERATION + イテレーションの追跡 + + + HOM_STB_COMPUTE + 計算 + + + HOM_STB_COMPUTE_PUBLISH + 計算と発行 + + + HOM_STB_EDIT + 編集 + + + HOM_STB_DELETE + 削除 + + + HOM_STB_EDIT_MESS_FILE + ファイルを表示します。 + + + HOM_WARNING + 警告 + + + HOM_ERROR + エラー + + + HOM_INACTIVE_BUTTON + アクティブでないボタン + + + OK + Ok + + + Apply + 適用 + + + Cancel + キャンセル + + + Help + ヘルプ + + + New + 新規 + + + Edit + 編集 + + + Quit + 終了 + + + Name + 名前 + + + Directory + ディレクトリ + + + Mesh + メッシュ + + + Selection + 選択 + + + None + なし + + + All + 全て + + + HOM_SELECT_OBJECT_1 + オブジェクトを選択します。 + + + HOM_SELECT_OBJECT_2 + 1 つのオブジェクトを選択します。 + + + HOM_SELECT_OBJECT_3 + 型 %1 のオブジェクトを選択します。 + + + HOM_SELECT_OBJECT_4 + The name of the object is already selected. Modify it or cancel. + + + HOM_SELECT_FILE_0 + ファイル選択 + + + HOM_SELECT_FILE_1 + ファイルを選択します。 + + + HOM_SELECT_FILE_2 + 1 つのファイルを選択します。 + + + HOM_SELECT_FILE_3 + このファイルを開くことができません。 + + + HOM_SCRIPT_FILE + 我々 は python スクリプトにファイルを与える必要があります。 + + + HOM_MED_FILE_1 + この医学ファイルは読み取り不可能です。 + + + HOM_MED_FILE_2 + この医学のファイルには、メッシュが含まれていません。 + + + HOM_MED_FILE_3 + この医学のファイルにはよりも 1 つのメッシュが含まれています。 + + + HOM_MED_FILE_4 + 音楽配信マック & ファイルのメッシュを読み取れませんでした。 + + + HOM_MED_FILE_5 + この医学のファイルには、フィールドが含まれていません。 + + + HOM_MED_FILE_6 + 医学ファイル (秒) (秒) フィールドを読み取ることができません。 + + + HOM_SELECT_STUDY + 研究医 associe + のファイルを選択または医学ファイルを選択します。 + + + Create a case + ケースの作成 + + + HOM_CASE_NAME + 場合に名前を付ける必要があります。 + + + HOM_CASE_DIRECTORY_1 + 1 つの場合を動作するようにディレクトリを選択する必要があります。 + + + HOM_CASE_DIRECTORY_2 + このディレクトリは、既に使用中です。 + + + HOM_CASE_DIRECTORY_3 + 有効なディレクトリを選択する必要があります。 + + + HOM_CASE_DIRECTORY_4 + 計算のための作業ディレクトリを選択する必要があります。 + + + HOM_START_DIRECTORY_1 + 追跡のため開始点を選択する必要があります。 + + + HOM_START_DIRECTORY_3 + 追跡のため有効な方向を選択する必要があります。 + + + HOM_CASE_MESH + 1 つは、初期のメッシュを選択する必要があります。 + + + HOM_CASE_GROUP + グループ"%1"は、以上の境界線に割り当てることはできません。 + + + HOM_CASE_EDIT_WINDOW_TITLE + 場合の編集 + + + HOM_CASE_EDIT_STATE_0 + 初期メッシュ。 + + + HOM_CASE_EDIT_STATE + イテレーションの継続。 + + + HOM_CASE_PURSUE_WINDOW_TITLE + イテレーションの追跡 + + + The configuration file cannot be found. + コンフィギュレーションファイルが見つかりません。 + + + The configuration file cannot be read. + コンフィギュレーションファイルが読み込めません。 + + + The HOMARD mesh file cannot be found. + HOMARDメッシュファイルが見つかりません。 + + + HOM_ITER_NAME + 名前を反復処理する必要があります。 + + + HOM_ITER_STARTING_POINT + これは、前のイテレーションを指定する必要があります。 + + + HOM_ITER_MESH + 最終的なメッシュの名前。 + + + HOM_ITER_HYPO + 仮説を選択します。 + + + HOM_ITER_FIELD_FILE + この前提には、ファイルのフィールドを指定する必要があります。 + + + HOM_ITER_STARTING_POINT_0 + メッシュ + + + HOM_ITER_STARTING_POINT_1 + ケースの最初のイテレーションです。 + + + HOM_ITER_STARTING_POINT_2 + 検察側の事件の最初のイテレーションです。 + + + HOM_ITER_EDIT_WINDOW_TITLE + イテレーションの編集 + + + Discrete boundary + 離散境界 + + + Analytical boundary + 解析的境界 + + + Conformity type + 適合タイプ + + + Conformal + 等角 + + + Non conformal + 非共形 + + + Non conformal option + 非共形オプション + + + Conformity + + 適合性 + + + + Free + Free + + + 1 hanging node per mesh + メッシュあたりの1接続節点 + + + 1 node per edge + エッジ辺りの1節点 + + + Advanced options + 詳細オプション + + + Authorized pyramids + 認定済みピラミッド + + + Minimal diameter + 最小径 + + + Initialization of adaptation + 適応の初期化 + + + Maximal level + 最大レベル + + + Output of the level of refinement + リファインレベルの出力 + + + Output of the qualities + 品質の出力 + + + Output of the diameters + 直径の出力 + + + Output of the parents + 親直径の出力 + + + Output of the neighbours + 隣の直径の出力 + + + Create an iteration + イテレーションの作成 + + + Iteration Name + イテレーションの名前 + + + Previous iteration + 以前のイテレーション + + + Invalid boundary + 無効な境界 + + + Invalid case + 無効なケース + + + Invalid case context + ケースの内容が無効です + + + Invalid hypothesis + 無効なhypothesis + + + Invalid iteration + 無効なイテレーション + + + Invalid zone + 無効なゾーン + + + This boundary has already been defined. + この境界は既に定義されています。 + + + This case has already been defined. + このケースは既に定義されています。 + + + This hypothesis has already been defined. + このhypothesisは既に定義されています。 + + + This iteration has already been defined. + このイテレーションは既に定義されています。 + + + This zone has already been defined. + このゾーンは既に定義されています。 + + + The parent iteration is not defined. + 親イテレーションは、定義されていません。 + + + Unable to create the iteration. + イテレーションを作成することができません。 + + + The directory for the computation cannot be created. + 計算のためのディレクトリを作成できません。 + + + This iteration is the first of the case and cannot be computed. + このイタレーションはケースの最初であり、計算できません。 + + + This iteration does not have any associated hypothesis. + このイタレーションは関連した hypothesis がありません。 + + + The mesh file does not exist. + メッシュ ファイルは存在しません。 + + + The mesh file cannot be deleted. + メッシュ ファイルを削除できません。 + + + Mesh n + メッシュ n + + + Mesh n+1 + メッシュ n + 1 + + + Field information + フィールド情報 + + + Field file + フィールド ファイル + + + No time step + タイムステップなし + + + Last time step + 最終タイムステップ + + + Chosen time step + 選択されたタイムステップ + + + Time step + タイムステップ + + + Rank + ランク + + + Hypothesis + Hypothesis + + + Create a hypothesis + hypothesis の作成 + + + HOM_HYPO_NAME + 仮説に名前を付ける必要があります。 + + + HOM_HYPO_FIELD_FILE + それはフィールドのファイルを提供する必要があります。 + + + HOM_HYPO_ZONE_1 + ゾーンを選択します。 + + + HOM_HYPO_ZONE_2 + 1 つは、少なくとも 1 つのゾーンを選択する必要があります。 + + + HOM_HYPO_ZONE_3 + 洗練された、または deraffinement、両方ではないです。 + + + HOM_HYPO_NORM_L2 + 標準の L2 + + + HOM_HYPO_NORM_INF + 無限の標準 + + + HOM_HYPO_NORM_ABS + 絶対値 + + + HOM_HYPO_NORM_REL + 関係 + + + HOM_HYPO_COMP + 1 つ以上のコンポーネントを選択する必要があります。 + + + HOM_HYPO_EDIT_WINDOW_TITLE + 仮説の編集 + + + Type of adaptation + 適合のタイプ + + + Uniform + 均一 + + + Driven by a field + フィールドによって駆動 + + + With geometrical zones + 幾何学的ゾーン使用 + + + Uniform adaptation + 均一な適応 + + + Coarsening + 粗大化 + + + Refinement + リファインメント + + + Nothing + なし + + + File of the fields + フィールドファイル + + + Governing field for the adaptation + 適合のためにフィールドを管理 + + + Field name + フィールド名 + + + Jump between elements + 要素間ジャンプ + + + Component + コンポーネント + + + Refinement threshold + リファインメント閾値 + + + Coarsening threshold + 粗大化閾値 + + + Percentage of meshes + メッシュの割合 + + + Mean + n*(std deviation) + 平均 + n * (標準偏差) + + + No refinement + リファインメントなし + + + Mean - n*(std deviation) + 平均 - n * (標準偏差) + + + No coarsening + 粗大化なし + + + Zone management + ゾーン管理 + + + Zone name + ゾーン名 + + + Field Interpolation + フィールド補間 + + + Chosen + 選択済み + + + Create a zone + ゾーンの作成 + + + HOM_ZONE_NAME + 領域に名前を必要があります。 + + + HOM_ZONE_LIMIT + 最大 %1 は %1 のミニよりも大きい必要があります。 + + + HOM_ZONE_RAYON + 外側の半径は、内側の半径よりも大きい必要があります。 + + + HOM_ZONE_EDIT_WINDOW_TITLE + 領域の編集 + + + Type of zone + ゾーンのタイプ + + + Box + Box + + + Sphere + + + + Cylinder + 円筒 + + + Disk + 円盤 + + + Disk with hole + 穴付き円盤 + + + Pipe + パイプ + + + Coordinates + 座標 + + + Create an analytical boundary + 分析境界の作成 + + + Create a discrete boundary + 離散境界の作成 + + + Type of boundary + 境界のタイプ + + + Torus + 環状体 + + + Radius + 半径 + + + Radius 1 + 半径1 + + + Radius 2 + 半径2 + + + External radius + 外半径 + + + Internal radius + 内半径 + + + Height + 高さ + + + X axis + X 軸 + + + Y axis + Y 軸 + + + Z axis + Z 軸 + + + R revolution + R 回転 + + + Primary R + 主 R + + + HOM_BOUN_NAME + 名前の国境に与えする必要があります。 + + + HOM_BOUN_MESH + 1 つの枠を含むメッシュを選択する必要があります。 + + + HOM_BOUN_CASE + 場合ファイルのメッシュが知られています。 + + + HOM_AXE + 軸は、ゼロ以外のベクトルでなければなりません。 + + + HOM_BOUN_A_EDIT_WINDOW_TITLE + 分析のフロンティアの編集 + + + HOM_BOUN_D_EDIT_WINDOW_TITLE + 離散境界の編集 + + + HOM_GROU_EDIT_WINDOW_TITLE + 選択したグループ + + + The height must be positive. + 高さは正でなければなりません。 + + + The radius must be positive. + 半径は正でなければなりません。 + + + The axis must be a non 0 vector. + 軸は非 0 のベクトルでなければなりません。 + + + The angle must be included higher than 0 degree and lower than 90 degrees. + 角度は0 °よりも大きく 90 °未満である必要があります。 + + + The radius must be different. + 半径が異なる必要があります。 + + + The centers must be different. + 中心が異なる必要があります。 + + + The external radius must be higher than the internal radius. + 外部の半径は内部の半径より大きい必要があります。 + + + The X coordinates are not coherent. + X座標は論理上問題があります。 + + + The Y coordinates are not coherent. + Y座標は論理上問題があります。 + + + The Z coordinates are not coherent. + Z座標は論理上問題があります。 + + + The first coordinates are not coherent. + 最初の座標に論理上問題があります。 + + + The second coordinates are not coherent. + 2番目の座標に論理上問題があります。 + + + The orientation must be 1, 2 or 3. + 方向は1、2、3のどれかにする必要があります。 + + + HOM_MESH_INFO_0 + メッシュの解析 + + + HOM_MESH_INFO_1 + 少なくとも 1 つのオプションを選択します。 + + + HOM_MESH_INFO_2 + バランス シート分析結果をスタディ ツリーで、ファイル + + + Filtering with groups + グループでフィルタリング + + + Selection of groups + グループの選択 + + + Selected groups + 選択されたグループ + + + Group + グループ : + + + Information on a mesh + メッシュに関する情報 + + + Group size + グループのサイズ + + + Quality + 品質 + + + Connection + 接続 + + + Diametre + 直径 + + + Entanglement + 縺れ合い + + + No change is allowed in a boundary. Ask for evolution. + 境界内に許可された変更はありません。旋回について尋ねます。 + + + This boundary is used in a case and cannot be deleted. + この境界はケースで使用されており、削除できません。 + + + This hypothesis is used and cannot be deleted. + このhypothesisは使用されており、削除できません。 + + + This iteration cannot be deleted. + このイテレーションは削除できません。 + + + This zone is used in a hypothesis and cannot be deleted. + このゾーンはhypothesisで使用されており、削除できません。 + + + The directory for the calculation cannot be cleared. + 計算用ディレクトリは削除できません。 + + + Starting point + 始点 + + + From an iteration + イテレーションから + + + From a case + ケースから + + + Iteration into the case + ケースへのイテレーション + + + Last iteration + 最後のイテレーション + + + Iteration number + イテレーション数 + + + The directory of the case does not exist. + ケースのディレクトリは存在しません。 + + + The directory for the case cannot be modified because some iterations are already defined. + いくつかのイテレーションが既に定義されているため、ケースのディレクトリを変更できません。 + + + The directory for the case cannot be reached. + ケースのディレクトリに到達できません。 + + + The starting point for the case cannot be copied into the working directory. + ケースの開始点は作業ディレクトリにコピーできません。 + + + The starting point for the case cannot be moved into the new directory. + ケースの開始点は新しいディレクトリに移動できません。 + + + The directory of the case for the pursuit does not exist. + 追跡用ケースのディレクトリは存在しません。 + + + The directory of the iteration does not exist. + イテレーションのディレクトリが存在しません。 + + + The number of iteration must be positive. + イテレーション数は正である必要があります。 + + + Number of iteration + イテレーション数 + + + Case + ケース + + + Mesh file + メッシュファイル + + + Constant + 定数 + + + Variable + 変数 + + + Type of schema + スキーマタイプ + + + Maximum of ... + 最大の... + + + Iterations + イテレーション + + + Nodes + 節点 + + + Elements + 要素 + + + Test of convergence + 収束テスト + + + Edit a file + ファイルの編集 + + + Print + 印刷 + + + Invalid study context + 無効なスタディの内容 + + + HOM_YACS_EDIT_WINDOW_TITLE + YACS スキーマ編集スキーマへんしゅう + + + PREF_TAB_GENERAL + 一般的な + + + PREF_PUBLICATION + 発行 + + + PREF_PUBLICATION_MAILLAGE_IN + メッシュ入力 + + + PREF_PUBLICATION_MAILLAGE_OUT + メッシュ出力 + + + PREF_YACS + YACS + + + PREF_YACS_MAX + 最大の数 + + + PREF_YACS_MAX_ITER + 繰り返し + + + PREF_YACS_MAX_NODE + 節点 + + + PREF_YACS_MAX_ELEM + 要素 + + + PREF_YACS_CONVERGENCE + 収束 + + + PREF_YACS_TYPE_TEST + テストタイプ + + + diff --git a/src/ADAPTGUI/CMakeLists.txt b/src/ADAPTGUI/CMakeLists.txt new file mode 100644 index 000000000..54cb7d0ff --- /dev/null +++ b/src/ADAPTGUI/CMakeLists.txt @@ -0,0 +1,177 @@ +# Copyright (C) 2012-2020 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +INCLUDE(UseQtExt) +INCLUDE(UsePyQt) + +# --- options --- + +# additional include directories +INCLUDE_DIRECTORIES( + ${QT_INCLUDES} + ${OpenCASCADE_INCLUDE_DIR} + ${PYTHON_INCLUDE_DIRS} + ${MEDFILE_INCLUDE_DIRS} + ${HDF5_INCLUDE_DIRS} + ${OMNIORB_INCLUDE_DIR} + ${KERNEL_INCLUDE_DIRS} + ${GUI_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${PROJECT_BINARY_DIR} + ${PROJECT_BINARY_DIR}/idl + ${PROJECT_BINARY_DIR}/adm_local/unix + ${PROJECT_SOURCE_DIR}/src/ADAPT + ${PROJECT_SOURCE_DIR}/src/ADAPT_I +) + +# additional preprocessor / compiler flags +ADD_DEFINITIONS( + ${OMNIORB_DEFINITIONS} + ${OpenCASCADE_DEFINITIONS} + ${KERNEL_DEFINITIONS} +) + +# libraries to link to +SET(_link_LIBRARIES + ${MEDFILE_C_LIBRARIES} + ${KERNEL_SalomeLifeCycleCORBA} + ${KERNEL_SalomeDS} + ${GUI_SalomeApp} + SalomeIDLADAPT + ADAPTEngine +) + +# --- resources --- + +# resource files / to be processed by lrelease +SET(_ts_RESOURCES + ADAPT_msg_en.ts + ADAPT_msg_fr.ts + ADAPT_msg_ja.ts +) + +# resource files / to be processed by uic +SET(_uic_FILES + CreateBoundaryCAO.ui + CreateBoundaryAn.ui + CreateBoundaryDi.ui + CreateCase.ui + CreateHypothesis.ui + CreateIteration.ui + CreateListGroup.ui + CreateYACS.ui + CreateZone.ui + EditFile.ui + IterInfo.ui + MeshInfo.ui + PursueIteration.ui +) + +# --- headers --- + +# header files / to be processed by moc +SET(_moc_HEADERS + HOMARDGUI.h + MonCreateBoundaryCAO.h + MonCreateBoundaryAn.h + MonCreateBoundaryDi.h + MonEditBoundaryCAO.h + MonEditBoundaryAn.h + MonEditBoundaryDi.h + MonCreateCase.h + MonEditCase.h + MonCreateZone.h + MonEditZone.h + MonCreateHypothesis.h + MonEditHypothesis.h + MonCreateListGroup.h + MonCreateListGroupCAO.h + MonEditListGroup.h + MonEditListGroupCAO.h + MonCreateIteration.h + MonEditIteration.h + MonPursueIteration.h + MonMeshInfo.h + MonIterInfo.h + MonCreateYACS.h + MonEditYACS.h + MonEditFile.h +) + +# header files / uic wrappings +QT_WRAP_UIC(_uic_HEADERS ${_uic_FILES}) + +# header files / static +SET(_other_HEADERS + HOMARDGUI_Utils.h + HomardQtCommun.h + HOMARDGUI_Exports.hxx +) + +# header files / to install +SET(ADAPT_HEADERS ${_other_HEADERS} ${_moc_HEADERS} ${_uic_HEADERS}) + +# --- sources --- + +# sources / moc wrappings +QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS}) + +# sources / static +SET(_other_SOURCES + HOMARDGUI.cxx + HOMARDGUI_Utils.cxx + MonCreateBoundaryCAO.cxx + MonCreateBoundaryAn.cxx + MonCreateBoundaryDi.cxx + MonEditBoundaryCAO.cxx + MonEditBoundaryAn.cxx + MonEditBoundaryDi.cxx + MonCreateCase.cxx + MonEditCase.cxx + MonCreateHypothesis.cxx + MonEditHypothesis.cxx + MonCreateListGroup.cxx + MonCreateListGroupCAO.cxx + MonEditListGroup.cxx + MonEditListGroupCAO.cxx + MonCreateIteration.cxx + MonEditIteration.cxx + MonPursueIteration.cxx + MonCreateZone.cxx + MonEditZone.cxx + MonMeshInfo.cxx + MonIterInfo.cxx + MonCreateYACS.cxx + MonEditYACS.cxx + MonEditFile.cxx + HomardQtCommun.cxx +) + +# sources / to compile +SET(ADAPT_SOURCES ${_other_SOURCES} ${_moc_SOURCES} ${_uic_HEADERS}) + +# --- rules --- + +ADD_LIBRARY(ADAPT ${ADAPT_SOURCES}) +TARGET_LINK_LIBRARIES(ADAPT ${_link_LIBRARIES} ) +INSTALL(TARGETS ADAPT EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) + +INSTALL(FILES ${ADAPT_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) +QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_ADAPT_INSTALL_RES_DATA}") diff --git a/src/ADAPTGUI/CreateBoundaryAn.ui b/src/ADAPTGUI/CreateBoundaryAn.ui new file mode 100644 index 000000000..ac291082d --- /dev/null +++ b/src/ADAPTGUI/CreateBoundaryAn.ui @@ -0,0 +1,1107 @@ + + + CreateBoundaryAn + + + + 0 + 0 + 522 + 835 + + + + Create an analytical boundary + + + true + + + true + + + + + + Name + + + + + + + 32 + + + + + + + + 0 + 0 + + + + + 340 + 0 + + + + Type of boundary + + + + + + Cylinder + + + + ../../resources/cylinderpointvector.png../../resources/cylinderpointvector.png + + + true + + + true + + + + + + + Sphere + + + + ../../resources/zone_spherepoint.png../../resources/zone_spherepoint.png + + + + + + + Cone + + + + ../../resources/cone.png../../resources/cone.png + + + + + + + Torus + + + + ../../resources/toruspointvector.png../../resources/toruspointvector.png + + + true + + + false + + + + + + + + + + + 0 + 0 + + + + Coordinates + + + + 9 + + + 6 + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + X centre + + + false + + + + + + + 5 + + + 1000000000.000000000000000 + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Radius + + + false + + + + + + + + 0 + 0 + + + + Z centre + + + false + + + + + + + + 0 + 0 + + + + Y centre + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + X axis + + + false + + + + + + + + 0 + 0 + + + + Y axis + + + false + + + + + + + + 0 + 0 + + + + Z axis + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + + + + 0 + 0 + + + + Coordinates + + + + 9 + + + 6 + + + + + 5 + + + 0.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Radius + + + false + + + + + + + + 0 + 0 + + + + Z centre + + + false + + + + + + + + 0 + 0 + + + + Y centre + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + X centre + + + false + + + + + + + + + + + 0 + 0 + + + + Coordinates + + + + + + Definition + + + + + + Radius + + + + ../../resources/conedxyz.png../../resources/conedxyz.png + + + true + + + + + + + Angle + + + + ../../resources/conepointvector.png../../resources/conepointvector.png + + + + + + + + + + + 0 + 0 + + + + X 1 + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + X 2 + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Y 1 + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Y 2 + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Z 1 + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Z 2 + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + V 1 + + + false + + + + + + + 5 + + + 1000000000.000000000000000 + + + + + + + + 0 + 0 + + + + V 2 + + + false + + + + + + + 5 + + + 1000000000.000000000000000 + + + + + + + + + + + 0 + 0 + + + + Coordinates + + + + + + + 0 + 0 + + + + X centre + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + X axis + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Y centre + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Y axis + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Z centre + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Z axis + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + R revolution + + + false + + + + + + + 5 + + + 1000000000.000000000000000 + + + + + + + + 0 + 0 + + + + Primary R + + + false + + + + + + + 5 + + + 1000000000.000000000000000 + + + + + + + + + + + 0 + 0 + + + + + + + + 9 + + + 6 + + + + + Help + + + + + + + Cancel + + + + + + + Apply + + + + + + + OK + + + + + + + + + + + diff --git a/src/ADAPTGUI/CreateBoundaryCAO.ui b/src/ADAPTGUI/CreateBoundaryCAO.ui new file mode 100644 index 000000000..c74c60122 --- /dev/null +++ b/src/ADAPTGUI/CreateBoundaryCAO.ui @@ -0,0 +1,133 @@ + + + CreateBoundaryCAO + + + + 0 + 0 + 566 + 195 + + + + + 0 + 0 + + + + Get CAO + + + true + + + true + + + + 9 + + + 6 + + + + + + + + + 9 + + + 6 + + + + + Help + + + + + + + Cancel + + + + + + + Apply + + + + + + + OK + + + + + + + + + + Filtering with groups + + + + + + + + 370 + 21 + + + + + + + + + + + + + + + XAO + + + + + + + + 382 + 21 + + + + 32 + + + + + + + Name + + + + + + + + diff --git a/src/ADAPTGUI/CreateBoundaryDi.ui b/src/ADAPTGUI/CreateBoundaryDi.ui new file mode 100644 index 000000000..b505ff869 --- /dev/null +++ b/src/ADAPTGUI/CreateBoundaryDi.ui @@ -0,0 +1,133 @@ + + + CreateBoundaryDi + + + + 0 + 0 + 566 + 169 + + + + + 0 + 0 + + + + Create a discrete boundary + + + true + + + true + + + + 9 + + + 6 + + + + + + + + + 9 + + + 6 + + + + + Help + + + + + + + Cancel + + + + + + + Apply + + + + + + + OK + + + + + + + + + + Filtering with groups + + + + + + + + 370 + 21 + + + + + + + + + + + + + + + Mesh + + + + + + + + 382 + 21 + + + + 32 + + + + + + + Name + + + + + + + + diff --git a/src/ADAPTGUI/CreateCase.ui b/src/ADAPTGUI/CreateCase.ui new file mode 100644 index 000000000..14fe44db9 --- /dev/null +++ b/src/ADAPTGUI/CreateCase.ui @@ -0,0 +1,777 @@ + + + CreateCase + + + + 0 + 0 + 600 + 1150 + + + + + 0 + 0 + + + + + 600 + 320 + + + + + 1 + 1 + + + + + 600 + 320 + + + + Create a case + + + true + + + + + + + + + Name + + + + + + + + + + + + + Qt::Horizontal + + + + 199 + 20 + + + + + + + + 6 + + + 0 + + + + + Directory + + + + + + + + + + false + + + + + + + + 382 + 21 + + + + + + + + + + Qt::Vertical + + + + 20 + 18 + + + + + + + + 6 + + + 0 + + + + + Mesh + + + + + + + + + + false + + + + + + + + 382 + 21 + + + + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + Conformity type + + + + 6 + + + 9 + + + + + Conformal + + + true + + + + + + + Non conformal + + + + + + + + + + Boundary type + + + + 6 + + + 9 + + + + + No boundary + + + true + + + + + + + CAO + + + false + + + + + + + Non CAO + + + + + + + + + + Qt::Vertical + + + + 20 + 1 + + + + + + + + 6 + + + 0 + + + + + Discrete boundary + + + + + + + Analytical boundary + + + + + + + + + + 0 + 0 + + + + CAO + + + + 9 + + + 6 + + + + + Edit + + + false + + + + + + + Help + + + false + + + + + + + -1 + + + QComboBox::AdjustToContents + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 13 + + + + + + + + New + + + false + + + + + + + + + + Qt::Vertical + + + + 20 + 2 + + + + + + + + + 0 + 0 + + + + Discrete boundary + + + + 9 + + + 6 + + + + + -1 + + + QComboBox::AdjustToContents + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 13 + + + + + + + + Edit + + + false + + + + + + + Help + + + false + + + + + + + New + + + false + + + + + + + + + + + 548 + 200 + + + + Analytical boundary + + + + + + QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked + + + true + + + 0 + + + 1 + + + + a_virer + + + + + + + + 0 + + + 6 + + + + + Edit + + + false + + + + + + + New + + + false + + + + + + + Help + + + false + + + + + + + + + + + + Qt::Vertical + + + + 239 + 41 + + + + + + + + Advanced options + + + + + + + Advanced options + + + + + + Authorized pyramids + + + + + + + Conformity + + + + + + + + + Standard + + + true + + + + + + + Box + + + false + + + + + + + 1 node per edge + + + + + + + Free + + + + + + + + + Format + + + + + + MED + + + true + + + + + + + Saturne + + + + + + + Saturne 2D + + + + + + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 128 + 13 + + + + + + + + Qt::Vertical + + + + 239 + 41 + + + + + + + + No comment. + + + + + + + Qt::Vertical + + + + 20 + 35 + + + + + + + + + + + + 9 + + + 6 + + + + + Help + + + false + + + + + + + Apply + + + false + + + + + + + OK + + + false + + + + + + + Cancel + + + false + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 128 + 25 + + + + + + WName + GBTypeConf + GBBoundaryD + GBBoundaryA + CBAdvanced + GBAdvancedOptions + Comment + GroupButtons + GBBoundaryC + GBTypeBoun + + + + diff --git a/src/ADAPTGUI/CreateHypothesis.ui b/src/ADAPTGUI/CreateHypothesis.ui new file mode 100644 index 000000000..53698b548 --- /dev/null +++ b/src/ADAPTGUI/CreateHypothesis.ui @@ -0,0 +1,1111 @@ + + + CreateHypothesis + + + + 0 + 0 + 848 + 1650 + + + + + 0 + 0 + + + + + 800 + 600 + + + + + 1 + 1 + + + + + 800 + 1200 + + + + Create a hypothesis + + + true + + + + + 0 + 0 + 844 + 1646 + + + + true + + + + + + + + + Name + + + + + + + + 282 + 31 + + + + + + + + + + + Qt::Horizontal + + + + 224 + 20 + + + + + + + + Type of adaptation + + + + 6 + + + 9 + + + + + Uniform + + + true + + + + + + + Driven by a field + + + + + + + With geometrical zones + + + + + + + + + + Qt::Horizontal + + + + 20 + 20 + + + + + + + + Filtering with groups + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Uniform adaptation + + + + 9 + + + 6 + + + + + Coarsening + + + + + + + Refinement + + + true + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + 9 + + + 6 + + + + + File of the fields + + + + + + + + 282 + 31 + + + + + + + + + + + + 0 + 0 + + + + Governing field for the adaptation + + + + 9 + + + 6 + + + + + 6 + + + 0 + + + + + Field name + + + + + + + + 0 + 0 + + + + false + + + QComboBox::AdjustToContents + + + + + + + Qt::Horizontal + + + + 48 + 20 + + + + + + + + + + 6 + + + 0 + + + + + QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked + + + true + + + 0 + + + 2 + + + + Selection + + + + + Component + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + 6 + + + 0 + + + + + 6 + + + 0 + + + + + L2 norm + + + true + + + + + + + Infinite norm + + + false + + + + + + + + + Jump between elements + + + + + + + + + + + 6 + + + 0 + + + + + + 0 + 0 + + + + Refinement threshold + + + + 9 + + + 6 + + + + + Percentage of meshes + + + true + + + true + + + + + + + % + + + 3 + + + 100.000000000000000 + + + 0.100000000000000 + + + 2.000000000000000 + + + + + + + Relative + + + + + + + false + + + % + + + 3 + + + 100.000000000000000 + + + 0.100000000000000 + + + + + + + Absolute + + + + + + + false + + + 8 + + + -1000000000000.000000000000000 + + + 1000000000000.000000000000000 + + + 0.100000000000000 + + + + + + + Mean + n*(std deviation) + + + + + + + false + + + 8 + + + -1000000000000.000000000000000 + + + 1000000000000.000000000000000 + + + 0.100000000000000 + + + 3.000000000000000 + + + + + + + No refinement + + + + + + + + + + Coarsening threshold + + + + 9 + + + 6 + + + + + Percentage of meshes + + + true + + + false + + + + + + + false + + + % + + + 3 + + + 100.000000000000000 + + + 0.100000000000000 + + + + + + + Relative + + + + + + + false + + + % + + + 3 + + + 100.000000000000000 + + + 0.100000000000000 + + + + + + + Absolute + + + + + + + false + + + 8 + + + -1000000000000.000000000000000 + + + 1000000000000.000000000000000 + + + 0.100000000000000 + + + + + + + Mean - n*(std deviation) + + + + + + + false + + + 8 + + + -1000000000000.000000000000000 + + + 1000000000000.000000000000000 + + + 0.100000000000000 + + + 4.000000000000000 + + + + + + + No coarsening + + + true + + + + + + + + + + + + + + + + 0 + 0 + + + + Zone management + + + + + + + 400 + 0 + + + + QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked + + + true + + + 0 + + + 3 + + + + Refinement + + + + + Coarsening + + + + + Zone name + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 6 + + + 0 + + + + + 6 + + + 0 + + + + + New + + + + + + + Edit + + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 48 + + + + + + + + + + + + + Field Interpolation + + + + 9 + + + 6 + + + + + 0 + + + 6 + + + + + None + + + true + + + + + + + All + + + false + + + + + + + Chosen + + + false + + + + + + + + + + Selection + + + + + Field Name + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Advanced options + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Advanced options + + + + + + + 0 + 0 + + + + Minimal diameter + + + false + + + + + + + 7 + + + + + + + + 0 + 0 + + + + Maximal level + + + false + + + + + + + 99 + + + + + + + Initialization of adaptation + + + + + + Nothing + + + true + + + + + + + Refinement + + + + + + + Coarsening + + + + + + + + + + Output of the level of refinement + + + + + + + Output of the qualities + + + + + + + Output of the diameters + + + + + + + Output of the parents + + + + + + + Output of the neighbours + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + 9 + + + 6 + + + + + OK + + + + + + + Apply + + + + + + + Cancel + + + + + + + Help + + + + + + + + + + + + diff --git a/src/ADAPTGUI/CreateIteration.ui b/src/ADAPTGUI/CreateIteration.ui new file mode 100644 index 000000000..2cc2827c6 --- /dev/null +++ b/src/ADAPTGUI/CreateIteration.ui @@ -0,0 +1,600 @@ + + + CreateIteration + + + + 0 + 0 + 777 + 668 + + + + + 0 + 0 + + + + + 750 + 400 + + + + + 1 + 1 + + + + + 750 + 400 + + + + Create an iteration + + + true + + + + + 0 + 0 + 773 + 664 + + + + true + + + + + + Iteration Name + + + + + + + Qt::Horizontal + + + + 117 + 20 + + + + + + + + + 290 + 21 + + + + 64 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Previous iteration + + + + + + + true + + + + 50 + 27 + + + + + + + + + + + + 0 + 21 + + + + 64 + + + true + + + + + + + Mesh n + + + + + + + Qt::Horizontal + + + + 117 + 20 + + + + + + + + + 290 + 21 + + + + 64 + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Mesh n+1 + + + + + + + Qt::Horizontal + + + + 117 + 20 + + + + + + + + + 290 + 21 + + + + 64 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Vertical + + + + 20 + 62 + + + + + + + + Field information + + + + 9 + + + 6 + + + + + + 282 + 21 + + + + + + + + Qt::Vertical + + + + 138 + 18 + + + + + + + + Chosen time step + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 255 + 13 + + + + + + + + -1 + + + 1010000 + + + -1 + + + + + + + Rank + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 13 + + + + + + + + -2 + + + 100000 + + + -1 + + + + + + + Time step + + + + + + + Qt::Vertical + + + + 138 + 28 + + + + + + + + Last time step + + + + + + + No time step + + + true + + + true + + + + + + + + + + + + + + Field file + + + + + + + + + + Qt::Horizontal + + + + 69 + 20 + + + + + + + + Qt::Vertical + + + + 20 + 22 + + + + + + + + Hypothesis + + + + 9 + + + 6 + + + + + -1 + + + QComboBox::AdjustToContents + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 13 + + + + + + + + Edit + + + + + + + New + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Vertical + + + + 20 + 21 + + + + + + + + + + + + 9 + + + 6 + + + + + OK + + + false + + + false + + + + + + + Apply + + + + + + + Cancel + + + + + + + Help + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 139 + 20 + + + + + + + + + + diff --git a/src/ADAPTGUI/CreateListGroup.ui b/src/ADAPTGUI/CreateListGroup.ui new file mode 100644 index 000000000..06c606110 --- /dev/null +++ b/src/ADAPTGUI/CreateListGroup.ui @@ -0,0 +1,121 @@ + + CreateListGroup + + + + 0 + 0 + 717 + 600 + + + + + 0 + 0 + 0 + 0 + + + + Selection of groups + + + true + + + true + + + + 9 + + + 6 + + + + + + + + + 9 + + + 6 + + + + + Help + + + + + + + Cancel + + + + + + + Apply + + + + + + + OK + + + + + + + + + + Selected groups + + + + 9 + + + 6 + + + + + true + + + 0 + + + 2 + + + + Selection + + + + + Group + + + + + + + + + + + + diff --git a/src/ADAPTGUI/CreateYACS.ui b/src/ADAPTGUI/CreateYACS.ui new file mode 100644 index 000000000..0e8f76c25 --- /dev/null +++ b/src/ADAPTGUI/CreateYACS.ui @@ -0,0 +1,526 @@ + + + CreateYACS + + + + 0 + 0 + 684 + 649 + + + + + 0 + 0 + + + + + 600 + 500 + + + + + 1 + 1 + + + + + 600 + 500 + + + + Create YACS + + + true + + + + + 0 + 0 + 680 + 645 + + + + true + + + + + + + + + Name + + + + + + + 32 + + + + + + + + + + Qt::Horizontal + + + + 131 + 20 + + + + + + + + + + Case + + + + + + + true + + + + 50 + 27 + + + + + + + + + + + + 382 + 21 + + + + + + + + + + 6 + + + 0 + + + + + Script + + + + + + + + + + false + + + + + + + + 382 + 21 + + + + + + + + + + 6 + + + 0 + + + + + Directory + + + + + + + + + + false + + + + + + + + 382 + 21 + + + + + + + + + + 6 + + + 0 + + + + + Mesh file + + + + + + + + + + false + + + + + + + + 382 + 21 + + + + + + + + + + Type of schema + + + + 6 + + + 9 + + + + + Constant + + + true + + + + + + + Variable + + + + + + + + + + Maximum of ... + + + + + + + 0 + 0 + + + + Iterations + + + false + + + + + + + 0 + + + 999999999 + + + 0 + + + + + + + + 0 + 0 + + + + Nodes + + + false + + + + + + + 0 + + + 999999999 + + + 1000 + + + 0 + + + + + + + + 0 + 0 + + + + Elements + + + false + + + + + + + 0 + + + 999999999 + + + 1000 + + + 0 + + + + + + + + + + Qt::Horizontal + + + + 269 + 20 + + + + + + + + Test of convergence + + + + + + None + + + true + + + + + + + Vtest > Vref + + + + + + + Vtest < Vref + + + + + + + Vref + + + + + + + 4 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + + + + + + + + Qt::Horizontal + + + + 269 + 20 + + + + + + + + + + + + 9 + + + 6 + + + + + Help + + + false + + + + + + + Apply + + + false + + + + + + + OK + + + false + + + + + + + Cancel + + + false + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 128 + 25 + + + + + + + + + + diff --git a/src/ADAPTGUI/CreateZone.ui b/src/ADAPTGUI/CreateZone.ui new file mode 100644 index 000000000..84a607516 --- /dev/null +++ b/src/ADAPTGUI/CreateZone.ui @@ -0,0 +1,1139 @@ + + + CreateZone + + + + 0 + 0 + 545 + 778 + + + + + 1 + 1 + + + + + 550 + 400 + + + + Create a zone + + + true + + + true + + + + + + Name + + + + + + + 32 + + + + + + + Qt::Horizontal + + + + 142 + 20 + + + + + + + + + 0 + 0 + + + + + 340 + 0 + + + + Type of zone + + + + 9 + + + 6 + + + + + Sphere + + + + ../../resources/zone_spherepoint.png../../resources/zone_spherepoint.png + + + + + + + Pipe + + + + ../../resources/pipe.png../../resources/pipe.png + + + + + + + Cylinder + + + + ../../resources/cylinderpointvector.png../../resources/cylinderpointvector.png + + + + + + + Box + + + + ../../resources/zone_boxdxyz.png../../resources/zone_boxdxyz.png + + + true + + + true + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Coordinates + + + + 9 + + + 6 + + + + + + 0 + 0 + + + + X mini + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Y mini + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Z mini + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + X maxi + + + false + + + + + + + + 0 + 0 + + + + Z maxi + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Y maxi + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + + + + 0 + 0 + + + + Coordinates + + + + 9 + + + 6 + + + + + + 0 + 0 + + + + X centre + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Y centre + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Radius + + + false + + + + + + + 5 + + + 0.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Z centre + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + + + + 0 + 0 + + + + Qt::TabFocus + + + Coordinates + + + + 9 + + + 6 + + + + + 5 + + + 1000000000.000000000000000 + + + + + + + + 0 + 0 + + + + Height + + + false + + + + + + + + 0 + 0 + + + + Radius + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Z axis + + + false + + + + + + + + 0 + 0 + + + + Y axis + + + false + + + + + + + + 0 + 0 + + + + X axis + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Y base + + + false + + + + + + + + 0 + 0 + + + + Z base + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + 5 + + + 1000000000.000000000000000 + + + + + + + + 0 + 0 + + + + X base + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + + + + 0 + 0 + + + + Coordinates + + + + 9 + + + 6 + + + + + + 0 + 0 + + + + Height + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + X base + + + false + + + + + + + 5 + + + 1000000000.000000000000000 + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + Internal radius + + + false + + + + + + + + 0 + 0 + + + + Z base + + + false + + + + + + + + 0 + 0 + + + + Y base + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + X axis + + + false + + + + + + + + 0 + 0 + + + + Y axis + + + false + + + + + + + + 0 + 0 + + + + Z axis + + + false + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + 5 + + + -999999999.000000000000000 + + + 999999999.000000000000000 + + + 0.000000000000000 + + + + + + + 5 + + + 1000000000.000000000000000 + + + + + + + + 0 + 0 + + + + External radius + + + false + + + + + + + 5 + + + 1000000000.000000000000000 + + + + + + + + + + + 0 + 0 + + + + + + + + 9 + + + 6 + + + + + Help + + + + + + + Cancel + + + + + + + Apply + + + + + + + OK + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + diff --git a/src/ADAPTGUI/EditFile.ui b/src/ADAPTGUI/EditFile.ui new file mode 100644 index 000000000..bfccdc178 --- /dev/null +++ b/src/ADAPTGUI/EditFile.ui @@ -0,0 +1,115 @@ + + + EditFile + + + + 0 + 0 + 675 + 901 + + + + Edit a file + + + + 9 + + + 6 + + + + + Qt::Horizontal + + + + 331 + 49 + + + + + + + + + + + + 9 + + + 6 + + + + + Print + + + false + + + false + + + false + + + + + + + Quit + + + false + + + true + + + false + + + + + + + + + + Qt::Vertical + + + + 20 + 14 + + + + + + + + + 530 + 800 + + + + + Courier New + + + + + + + + + diff --git a/src/ADAPTGUI/HOMARDGUI.cxx b/src/ADAPTGUI/HOMARDGUI.cxx new file mode 100644 index 000000000..8a726faac --- /dev/null +++ b/src/ADAPTGUI/HOMARDGUI.cxx @@ -0,0 +1,909 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// File : HOMARDGUI.cxx +// Author : Gerald NICOLAS, EDF +// Module : HOMARD + +#include "HOMARDGUI.h" + +// SALOME Includes +#include "Utils_ORB_INIT.hxx" +#include "Utils_SINGLETON.hxx" +#include "SALOME_LifeCycleCORBA.hxx" + +#include "SUIT_ResourceMgr.h" +#include "SUIT_MessageBox.h" +#include "SUIT_Session.h" +#include "SUIT_ViewWindow.h" +#include "SUIT_ViewManager.h" +#include + +#include "CAM_Module.h" +#include "OB_Browser.h" + +#include "SALOME_ListIO.hxx" + +#include "SalomeApp_Application.h" +#include "SalomeApp_DataModel.h" +#include "SalomeApp_Study.h" +#include "LightApp_SelectionMgr.h" +#include "LightApp_Selection.h" +#include +#include "SalomeApp_Module.h" +#include "SALOMEconfig.h" +#include + +#include + + +// QT Includes +#include +#include "MonCreateCase.h" +#include "MonCreateIteration.h" +#include "MonPursueIteration.h" +#include "MonCreateYACS.h" +#include "MonEditBoundaryCAO.h" +#include "MonEditBoundaryAn.h" +#include "MonEditBoundaryDi.h" +#include "MonEditCase.h" +#include "MonEditHypothesis.h" +#include "MonEditIteration.h" +#include "MonEditYACS.h" +#include "MonEditZone.h" +#include "MonMeshInfo.h" +#include "MonIterInfo.h" +#include "MonEditFile.h" +#include "HomardQtCommun.h" + +// BOOST Includes +#include + +//Pour le _CAST +#include "SALOMEDS_Study.hxx" +#include "HOMARDGUI_Utils.h" + +using namespace std; + +static CORBA::ORB_var _orb; + +//======================================================================= +// function : HOMARDGUI() +// purpose : Constructor +//======================================================================= +HOMARDGUI::HOMARDGUI(const QString&) : + SalomeApp_Module( "HOMARD" ) // default name +{ +} +//======================================================================= +// function : ~HOMARDGUI() +// purpose : Destructor +//======================================================================= +HOMARDGUI::~HOMARDGUI() +{ +} + +//======================================================================= +// function : InitHOMARDGen +// launch HOMARD component and return a handle +//======================================================================= +HOMARD::HOMARD_Gen_var HOMARDGUI::InitHOMARDGen(SalomeApp_Application* app) +{ + Engines::EngineComponent_var comp = app->lcc()->FindOrLoad_Component( "FactoryServer","HOMARD" ); + HOMARD::HOMARD_Gen_var clr = HOMARD::HOMARD_Gen::_narrow(comp); + ASSERT(!CORBA::is_nil(clr)); + return clr; +} + +//======================================================================= +// Module's initialization +void HOMARDGUI::initialize( CAM_Application* app ) +//======================================================================= +{ + SalomeApp_Module::initialize( app ); + InitHOMARDGen(dynamic_cast( app )); + anId = 0; + createActions(); + createMenus(); + recupPreferences(); +} + +//================================================ +// function : createHOMARDAction +// create an item in status bar and Homard menu +//================================================ +void HOMARDGUI::createHOMARDAction( const int id, const QString& po_id, const QString& icon_id, const int key, const bool toggle ) +{ +// MESSAGE("createHOMARDAction"); + QIcon icon; + QWidget* parent = application()->desktop(); + SUIT_ResourceMgr* resMgr = application()->resourceMgr(); + QPixmap pix; + if ( icon_id.length() ) + pix = resMgr->loadPixmap( "HOMARD", tr( icon_id .toLatin1().data()) ); + else + pix = resMgr->loadPixmap( "HOMARD", tr( QString( "ICO_%1" ).arg( po_id ).toLatin1().data()), false ); + if ( !pix.isNull() ) + icon = QIcon( pix ); + + QString tooltip = tr(QString( "HOM_TOP_%1" ).arg( po_id ).toLatin1().data()), + menu = tr(QString( "HOM_MEN_%1" ).arg( po_id ).toLatin1().data()), + status_bar = tr(QString( "HOM_STB_%1" ).arg( po_id ).toLatin1().data()); + + createAction( id, tooltip, icon, menu, status_bar, key, parent, toggle, this, SLOT( OnGUIEvent() ) ); +} + +//================================================ +// function : createAction +// constructs Homard menu +// calls createHOMARDAction for each item +//================================================ +void HOMARDGUI::createActions(){ +// + createHOMARDAction( 1101, "NEW_CASE", "cas_calcule.png" ); + createHOMARDAction( 1102, "PURSUE_ITERATION", "iter_poursuite.png" ); + createHOMARDAction( 1103, "NEW_ITERATION", "iter_next.png" ); + createHOMARDAction( 1111, "COMPUTE", "mesh_compute.png" ); + createHOMARDAction( 1112, "COMPUTE_PUBLISH", "mesh_compute.png" ); + createHOMARDAction( 1121, "MESH_INFO", "advanced_mesh_info.png" ); + createHOMARDAction( 1131, "MESH_PUBLICATION", "mesh_tree_mesh.png" ); +// + createHOMARDAction( 1201, "EDIT", "loop.png" ); + createHOMARDAction( 1211, "DELETE", "delete.png" ); +// + createHOMARDAction( 1301, "MESH_INFO", "advanced_mesh_info.png" ); + createHOMARDAction( 1302, "EDIT_MESS_FILE", "texte.png" ); +// + createHOMARDAction( 1401, "YACS", "table_view.png" ); +// +} + +//================================================ +// function : createPreferences +//================================================ +void HOMARDGUI::createPreferences() +{ + MESSAGE("createPreferences") + + int Onglet, Bloc, Pref ; + // 1. Generalites + Onglet = addPreference( tr( "PREF_TAB_GENERAL" ) ); +// Onglet = addPreference( tr( "PREF_TAB_SETTINGS" ) ) ; + + Bloc = addPreference( tr( "PREF_PUBLICATION" ), Onglet ); + setPreferenceProperty( Bloc, "columns", 1 ); + + Pref = addPreference( tr( "PREF_PUBLICATION_MAILLAGE_IN" ), Bloc, LightApp_Preferences::Bool, "HOMARD", "publish_mesh_in" ); + + Pref = addPreference( tr( "PREF_PUBLICATION_MAILLAGE_OUT" ), Bloc, LightApp_Preferences::Bool, "HOMARD", "publish_mesh_out" ); + + // 2. YACS + Onglet = addPreference( tr( "PREF_YACS" ) ) ; + + Bloc = addPreference( tr( "PREF_YACS_MAX" ), Onglet ); + setPreferenceProperty( Bloc, "columns", 1 ); + + Pref = addPreference( tr( "PREF_YACS_MAX_ITER" ), Bloc, LightApp_Preferences::IntSpin, "HOMARD", "yacs_max_iter" ); + setPreferenceProperty( Pref, "min", 0 ); + setPreferenceProperty( Pref, "max", 100000000 ); + setPreferenceProperty( Pref, "step", 1 ); + + Pref = addPreference( tr( "PREF_YACS_MAX_NODE" ), Bloc, LightApp_Preferences::IntSpin, "HOMARD", "yacs_max_node" ); + setPreferenceProperty( Pref, "min", 0 ); + setPreferenceProperty( Pref, "max", 100000000 ); + setPreferenceProperty( Pref, "step", 1000 ); + + Pref = addPreference( tr( "PREF_YACS_MAX_ELEM" ), Bloc, LightApp_Preferences::IntSpin, "HOMARD", "yacs_max_elem" ); + setPreferenceProperty( Pref, "min", 0 ); + setPreferenceProperty( Pref, "max", 100000000 ); + setPreferenceProperty( Pref, "step", 1000 ); + + Bloc = addPreference( tr( "PREF_YACS_CONVERGENCE" ), Onglet ); + setPreferenceProperty( Bloc, "columns", 1 ); + + Pref = addPreference( tr( "PREF_YACS_TYPE_TEST" ), Bloc, LightApp_Preferences::Selector, "HOMARD", "yacs_type_test" ); + QStringList aListOfTypeTest; + aListOfTypeTest << "None"; + aListOfTypeTest << "VTest > VRef"; + aListOfTypeTest << "VTest < VRef"; + setPreferenceProperty( Pref, "strings", aListOfTypeTest ); +} + + +//================================================ +// function : createMenus +//================================================ +void HOMARDGUI::createMenus() +{ + MESSAGE("createMenus") +// + int HOMARD_Id = createMenu( tr( "HOM_MEN_HOMARD" ), -1, 5, 10 ); + createMenu( 1101, HOMARD_Id, -1 ); //Create_Case + createMenu( 1102, HOMARD_Id, -1 ); //Pursue_Iteration + createMenu( separator(), HOMARD_Id,-1); + createMenu( 1103, HOMARD_Id, -1 ); //Create_Iteration + createMenu( 1111, HOMARD_Id, -1 ); //Compute + createMenu( 1112, HOMARD_Id, -1 ); //Compute and publish +// + HOMARD_Id = createMenu( tr( "HOM_MEN_MODIFICATION" ), -1, 5, 10 ); + createMenu( 1201, HOMARD_Id, -1 ); //Edit + createMenu( 1211, HOMARD_Id, -1 ); //Delete +// + HOMARD_Id = createMenu( tr( "HOM_MEN_INFORMATION" ), -1, 5, 10 ); + createMenu( 1301, HOMARD_Id, -1 ); //Information sur un maillage + createMenu( 1131, HOMARD_Id, -1 ); //Mesh publication + createMenu( separator(), HOMARD_Id,-1); + createMenu( 1302, HOMARD_Id, -1 ); //EditAsciiFile pour le fichier listeStd ou bilan + createMenu( separator(), HOMARD_Id,-1); + createMenu( 1201, HOMARD_Id, -1 ); //Edit + createMenu( separator(), HOMARD_Id,-1); +// + HOMARD_Id = createMenu( tr( "HOM_MEN_YACS" ), -1, 5, 10 ); + createMenu( 1401, HOMARD_Id, -1 ); // Création d'un schéma YACS + createMenu( separator(), HOMARD_Id,-1); +} + +//================================================ +// function : recupPreferences +// Pour chaque valeur, le defaut est la valeur definie dans HOMARD_Gen +// . Si la recuperation dans config/salome s'est bien passee a la creation de HOMARD_Gen, +// ces valeurs sont les valeurs definies. +// . Si cela ne s'est pas bien passe, ce sont les valeurs par defaut de HOMARD_Gen +//================================================ +void HOMARDGUI::recupPreferences() +{ + MESSAGE("recupPreferences") +// +// A. Declarations +// + SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( application() ); + HOMARD::HOMARD_Gen_var homardGen = HOMARDGUI::InitHOMARDGen(app); + int defaut_i ; + std::string defaut_s ; + QString QString_v ; +// +// B. Les valeurs +// B.1. La langue +// + defaut_s = homardGen->GetLanguageShort(); + SUIT_ResourceMgr* resMgr = getApp()->resourceMgr(); + _LanguageShort = resMgr->stringValue("language", "language", QString(defaut_s.c_str()) ); +// +// B.2. Les publications + bool publish_mesh ; +// + _PublisMeshIN = homardGen->GetPublisMeshIN(); + if ( _PublisMeshIN == 1 ) { publish_mesh = true ; } + else { publish_mesh = false ; } + publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_in", publish_mesh ); + if ( publish_mesh ) { _PublisMeshIN = 1 ; } + else { _PublisMeshIN = 0 ; } +// + _PublisMeshOUT = homardGen->GetPublisMeshOUT(); + if ( _PublisMeshOUT == 1 ) { publish_mesh = true ; } + else { publish_mesh = false ; } + publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_out", publish_mesh ); + if ( publish_mesh ) { _PublisMeshOUT = 1 ; } + else { _PublisMeshOUT = 0 ; } +// +// B.3. Les maximum pour YACS +// + defaut_i = homardGen->GetYACSMaxIter(); + _YACSMaxIter = resMgr->integerValue("HOMARD", "yacs_max_iter", defaut_i ); +// + defaut_i = homardGen->GetYACSMaxNode(); + _YACSMaxNode = resMgr->integerValue("HOMARD", "yacs_max_node", defaut_i ); +// + defaut_i = homardGen->GetYACSMaxElem(); + _YACSMaxElem = resMgr->integerValue("HOMARD", "yacs_max_elem", defaut_i ); +// +// B.4. La convergence pour YACS +// + defaut_i = homardGen->GetYACSConvergenceType(); + if ( defaut_i == 1 ) { QString_v = tr("VTest > VRef") ; } + else if ( defaut_i == 2 ) { QString_v = tr("VTest < VRef") ; } + else { QString_v = tr("None") ; } + QString_v = resMgr->stringValue ( "HOMARD", "yacs_type_test", QString_v ); + if ( ( QString_v == "VTest > VRef" ) || ( QString_v == "VTest > VRef" ) ) { _YACSTypeTest = 1 ; } + else if ( ( QString_v == "VTest < VRef" ) || ( QString_v == "VTest < VRef" ) ) { _YACSTypeTest = 2 ; } + else { _YACSTypeTest = 0 ; } +// +// C. Enregistrement dans l'objet general +// + MESSAGE ("Enregistrement de LanguageShort = " << _LanguageShort.toStdString().c_str() ); + MESSAGE ("Enregistrement de PublisMeshIN = " << _PublisMeshIN<<", PublisMeshOUT = "<< _PublisMeshOUT); + MESSAGE ("Enregistrement de YACSMaxIter = " << _YACSMaxIter<<", YACSMaxNode = "<< _YACSMaxNode<<", YACSMaxElem = "<< _YACSMaxElem); + MESSAGE ("Enregistrement de YACSTypeTest = " << _YACSTypeTest); +// + homardGen->SetLanguageShort(_LanguageShort.toStdString().c_str()); + homardGen->SetPublisMesh(_PublisMeshIN, _PublisMeshOUT); + homardGen->SetYACSMaximum(_YACSMaxIter, _YACSMaxNode, _YACSMaxElem); +// + homardGen->SetYACSConvergenceType(_YACSTypeTest); +} + +//================================================ +void HOMARDGUI::OnGUIEvent() +//================================================ +{ + MESSAGE("OnGUIEvent()") + setOrb(); + const QObject* obj = sender(); + if ( !obj || !obj->inherits( "QAction" ) ) { return; } + int id = actionId((QAction*)obj); + if ( id != -1 ) { bool ret = OnGUIEvent( id ); } + MESSAGE("Fin de OnGUIEvent()"); +} + +//======================================================================= +// Method OnGUIEvent pour Homard +//======================================================================= +bool HOMARDGUI::OnGUIEvent (int theCommandID) +{ + MESSAGE("OnGUIEvent avec theCommandID = "<( application() ); + if ( !app ) return false; + + SalomeApp_Study* stud = dynamic_cast ( app->activeStudy() ); + if ( !stud ) + { + MESSAGE ( "FAILED to cast active study to SalomeApp_Study" ); + return false; + } + + SUIT_Desktop* parent = application()->desktop(); + + HOMARD::HOMARD_Gen_var homardGen = HOMARDGUI::InitHOMARDGen(app); + + if (!CORBA::is_nil(homardGen)) + homardGen->UpdateStudy(); + + getApp()->updateObjectBrowser(); + +// B. Choix selon les commandes + SCRUTE(theCommandID); + switch (theCommandID) + { + case 1101: // Creation d un Cas + { + MESSAGE("command " << theCommandID << " activated"); + MonCreateCase *aDlg = new MonCreateCase( true, + HOMARD::HOMARD_Gen::_duplicate(homardGen) ) ; + aDlg->show(); + break; + } + + case 1102: // Poursuite d une iteration + { + MESSAGE("command " << theCommandID << " activated"); + MonPursueIteration *aDlg = new MonPursueIteration( true, + HOMARD::HOMARD_Gen::_duplicate(homardGen) ) ; + aDlg->show(); + break; + } + + case 1103: // Creation d une Iteration + { + MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); + MonCreateIteration *IterDlg = new MonCreateIteration( parent, true, + HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ; + IterDlg->show(); + break; + } + + case 1111: // Compute une iteration + { + MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); + try { homardGen->Compute(_ObjectName.toStdString().c_str(), 0, 1, -1, 1); } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + getApp()->updateObjectBrowser(); + return false; + } + break; + } + + case 1112: // Compute une iteration et publication + { + MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); + try { homardGen->Compute(_ObjectName.toStdString().c_str(), 0, 1, -1, 2); } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + getApp()->updateObjectBrowser(); + return false; + } + break; + } + + case 1121: // Information sur le maillage de l'iteration + { + MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); + MonIterInfo *IterDlg = new MonIterInfo( parent, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ; + IterDlg->show(); + break; + } + + case 1131: // Publication du maillage de l'iteration + { + MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); + homardGen->PublishMeshIterInSmesh(_ObjectName.toStdString().c_str()); + break; + } + + case 1132: // Publication du maillage de l'iteration a partir du fichier + { + MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); + homardGen->PublishResultInSmesh(_ObjectName.toStdString().c_str(), 1); + break; + } + + case 1201: // Edition d'un objet + { + MESSAGE("command " << theCommandID << " activated"); + QString nomObjet = HOMARD_QT_COMMUN::SelectionArbreEtude(QString(""), 1); + if (nomObjet == QString("")) break; + _PTR(SObject) obj = chercheMonObjet(); + if (obj) + { + // Edition d'une frontiere CAO + if (HOMARD_UTILS::isBoundaryCAO(obj)) + { + MonEditBoundaryCAO *aDlg = new MonEditBoundaryCAO(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; + aDlg->show(); + } + // Edition d'une frontiere discrete + else if (HOMARD_UTILS::isBoundaryDi(obj)) + { + MonEditBoundaryDi *aDlg = new MonEditBoundaryDi(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; + aDlg->show(); + } + // Edition d'une frontiere analytique + else if (HOMARD_UTILS::isBoundaryAn(obj)) + { + MonEditBoundaryAn *aDlg = new MonEditBoundaryAn(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; + aDlg->show(); + } + // Edition d'un cas + else if (HOMARD_UTILS::isCase(obj)) + { + MonEditCase *aDlg = new MonEditCase(true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ; + aDlg->show(); + } + // Edition d'une hypothese + else if (HOMARD_UTILS::isHypo(obj)) + { + MonEditHypothesis *aDlg = new MonEditHypothesis(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName, QString(""), QString("")) ; + aDlg->show(); + } + // Edition d'une iteration + else if (HOMARD_UTILS::isIter(obj)) + { + MonEditIteration *aDlg = new MonEditIteration(parent, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; + aDlg->show(); + } + // Edition d'un schema YACS + else if (HOMARD_UTILS::isYACS(obj)) + { + MESSAGE("appel de MonEditYACS"); + MonEditYACS *aDlg = new MonEditYACS(true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName) ; + aDlg->show(); + } + // Edition d'une zone + else if (HOMARD_UTILS::isZone(obj)) + { + MonEditZone *aDlg = new MonEditZone(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; + aDlg->show(); + } + } + break; + } + + case 1211: // Suppression d'un objet + { + MESSAGE("command " << theCommandID << " activated"); + QString nomObjet = HOMARD_QT_COMMUN::SelectionArbreEtude(QString(""), 1); + if (nomObjet == QString("")) break; + _PTR(SObject) obj = chercheMonObjet(); + if (obj) + { + // Suppression d'une frontiere + if ( HOMARD_UTILS::isBoundaryCAO(obj) || HOMARD_UTILS::isBoundaryDi(obj) || HOMARD_UTILS::isBoundaryAn(obj) ) + { + try + { homardGen->DeleteBoundary(_ObjectName.toStdString().c_str()); } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + getApp()->updateObjectBrowser(); + return false; + } + } + // Suppression d'un cas + else if (HOMARD_UTILS::isCase(obj)) + { + try + { homardGen->DeleteCase(_ObjectName.toStdString().c_str(), 1); } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + getApp()->updateObjectBrowser(); + return false; + } + } + // Suppression d'une hypothese + else if (HOMARD_UTILS::isHypo(obj)) + { + try + { homardGen->DeleteHypo(_ObjectName.toStdString().c_str()); } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + getApp()->updateObjectBrowser(); + return false; + } + } + // Suppression d'une iteration + else if (HOMARD_UTILS::isIter(obj)) + { + try + { homardGen->DeleteIteration(_ObjectName.toStdString().c_str(), 1); } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + getApp()->updateObjectBrowser(); + return false; + } + } + // Suppression d'un schema YACS + else if (HOMARD_UTILS::isYACS(obj)) + { + try + { homardGen->DeleteYACS(_ObjectName.toStdString().c_str(), 1); } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + getApp()->updateObjectBrowser(); + return false; + } + } + // Suppression d'une zone + else if (HOMARD_UTILS::isZone(obj)) + { + try + { homardGen->DeleteZone(_ObjectName.toStdString().c_str()); } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + getApp()->updateObjectBrowser(); + return false; + } + } + } + break; + } + + case 1301: // Information sur un maillage + { + MESSAGE("etape 1301") + MESSAGE("command " << theCommandID << " activated"); + MonMeshInfo *aDlg = new MonMeshInfo( parent, true, HOMARD::HOMARD_Gen::_duplicate(homardGen) ) ; + aDlg->show(); + break; + } + + case 1302: // Affichage de fichier texte + { + MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); + _PTR(SObject) obj = chercheMonObjet(); + if ( (obj) && ( HOMARD_UTILS::isFileType(obj,QString("log")) || HOMARD_UTILS::isFileType(obj,QString("Summary")) || HOMARD_UTILS::isFileType(obj,QString("xml")) ) ) + { + MonEditFile *aDlg = new MonEditFile( 0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName, 0 ) ; + if ( aDlg->_codret == 0 ) { aDlg->show(); } + } + break; + } + + case 1401: // Création d'un schema YACS + { + MESSAGE("etape 1401") + MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); + MonCreateYACS *aDlg = new MonCreateYACS( true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ; + aDlg->show(); + break; + } + + case 1402: // Ecriture d'un schéma YACS + { + MESSAGE("etape 1402") + MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); + try { homardGen->YACSWrite(_ObjectName.toStdString().c_str()); } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + getApp()->updateObjectBrowser(); + return false; + } + break; + } + + } + getApp()->updateObjectBrowser(); + return true; +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +// Module's engine IOR +//============================================================================= +QString HOMARDGUI::engineIOR() const +//============================================================================= +{ + CORBA::String_var anIOR = getApp()->orb()->object_to_string( InitHOMARDGen(getApp()) ); + return QString( anIOR.in() ); +} + +// Module's activation +//============================================================================= +bool HOMARDGUI::activateModule( SUIT_Study* theStudy ) +//============================================================================= +{ + bool bOk = SalomeApp_Module::activateModule( theStudy ); + + setMenuShown( true ); + setToolShown( true ); + + return bOk; +} + +// Module's deactivation +//============================================================================= +bool HOMARDGUI::deactivateModule( SUIT_Study* theStudy ) +//============================================================================= +{ + setMenuShown( false ); + setToolShown( false ); + + return SalomeApp_Module::deactivateModule( theStudy ); +} + +// Default windows +//============================================================================= +void HOMARDGUI::windows( QMap& theMap ) const +//============================================================================= +{ + theMap.clear(); + theMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea ); +#ifndef DISABLE_PYCONSOLE + theMap.insert( SalomeApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea ); +#endif +} + +//============================================================================= +void HOMARDGUI::setOrb() +//============================================================================= +{ + try + { + ORB_INIT &init = *SINGLETON_::Instance(); + ASSERT(SINGLETON_::IsAlreadyExisting()); + _orb = init( 0 , 0 ); + } + catch (...) + { + INFOS("internal error : orb not found"); + _orb = 0; + } + ASSERT(! CORBA::is_nil(_orb)); +} +//======================================== +_PTR(SObject) HOMARDGUI::chercheMonObjet() +//======================================== +{ + SALOMEDSClient_SObject* aSO = NULL; + _PTR(SObject) obj; + SALOME_ListIO lst; + getApp()->selectionMgr()->selectedObjects( lst ); + if ( lst.Extent() == 1 ) + { + Handle(SALOME_InteractiveObject) io = lst.First(); + SalomeApp_Study* appStudy = dynamic_cast( application()->activeStudy() ); + _PTR(Study) study = appStudy->studyDS(); + _PTR(SObject) obj = study->FindObjectID( io->getEntry() ); + _ObjectName = QString( obj->GetName().c_str() ); + return obj; + } + else { return _PTR(SObject)(aSO); } +} +//============================================================================= +void HOMARDGUI::contextMenuPopup( const QString& client, QMenu* menu, QString& title ) +//============================================================================= +{ + MESSAGE("Debut de contextMenuPopup"); + _PTR(SObject) obj = chercheMonObjet(); + if ( obj ) + { + title = QString( obj->GetName().c_str() ); + _ObjectName = title; + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); +// + QPixmap pix ; + bool DeleteObject = false ; + bool EditObject = false ; +// + if ( HOMARD_UTILS::isBoundaryCAO(obj) ) + { + EditObject = true ; + DeleteObject = true ; + } + else if ( HOMARD_UTILS::isBoundaryAn(obj) ) + { + EditObject = true ; + DeleteObject = true ; + } + else if ( HOMARD_UTILS::isBoundaryDi(obj) ) + { + EditObject = true ; + DeleteObject = true ; + } + else if ( HOMARD_UTILS::isCase(obj) ) + { + pix = resMgr->loadPixmap( "HOMARD", "table_view.png" ); + menu->addAction(QIcon(pix), tr(QString("HOM_MEN_YACS").toLatin1().data()), this, SLOT(YACSCreate())); + EditObject = true ; + DeleteObject = true ; + } + else if ( HOMARD_UTILS::isHypo(obj) ) + { + EditObject = true ; + DeleteObject = true ; + } + else if ( HOMARD_UTILS::isIter(obj) ) + { + pix = resMgr->loadPixmap( "HOMARD", "iter_next.png" ); + menu->addAction(QIcon(pix), tr(QString("HOM_MEN_NEW_ITERATION").toLatin1().data()), this, SLOT(NextIter())); + pix = resMgr->loadPixmap( "HOMARD", "mesh_compute.png" ); + menu->addAction(QIcon(pix), tr(QString("HOM_MEN_COMPUTE").toLatin1().data()), this, SLOT(LanceCalcul0())); + pix = resMgr->loadPixmap( "HOMARD", "mesh_compute.png" ); + menu->addAction(QIcon(pix), tr(QString("HOM_MEN_COMPUTE_PUBLISH").toLatin1().data()), this, SLOT(LanceCalcul1())); + pix = resMgr->loadPixmap( "HOMARD", "advanced_mesh_info.png" ); + menu->addAction(QIcon(pix), tr(QString("HOM_MEN_MESH_INFO").toLatin1().data()), this, SLOT(IterInfo())); + pix = resMgr->loadPixmap( "HOMARD", "mesh_tree_mesh.png" ); + menu->addAction(QIcon(pix), tr(QString("HOM_MEN_MESH_PUBLICATION").toLatin1().data()), this, SLOT(MeshPublish0())); + EditObject = true ; + DeleteObject = true ; + } + else if ( HOMARD_UTILS::isYACS(obj) ) + { + pix = resMgr->loadPixmap( "HOMARD", "write.png" ); + menu->addAction(QIcon(pix), tr(QString("HOM_MEN_WRITE").toLatin1().data()), this, SLOT(YACSWrite())); + EditObject = true ; + DeleteObject = true ; + } + else if ( HOMARD_UTILS::isZone(obj) ) + { + EditObject = true ; + DeleteObject = true ; + } + else if ( HOMARD_UTILS::isFileType(obj,QString("log")) || HOMARD_UTILS::isFileType(obj,QString("Summary")) || HOMARD_UTILS::isFileType(obj,QString("xml")) ) + { + pix = resMgr->loadPixmap( "HOMARD", "texte.png" ); + menu->addAction(QIcon(pix), tr(QString("HOM_MEN_EDIT_MESS_FILE").toLatin1().data()), this, SLOT(EditAsciiFile())); + } + else if ( HOMARD_UTILS::isFileType(obj,QString("Mesh")) ) + { + pix = resMgr->loadPixmap( "HOMARD", "mesh_tree_mesh.png" ); + menu->addAction(QIcon(pix), tr(QString("HOM_MEN_MESH_PUBLICATION").toLatin1().data()), this, SLOT(MeshPublish1())); + } +// Ajout d'un menu d'edition pour les objets qui le proposent + if ( EditObject ) + { + pix = resMgr->loadPixmap( "HOMARD", "loop.png" ); + menu->addAction(QIcon(pix), tr(QString("HOM_MEN_EDIT").toLatin1().data()), this, SLOT(Edit())); + } +// Ajout d'un menu de destruction pour les objets qui le proposent + if ( DeleteObject ) + { + pix = resMgr->loadPixmap( "HOMARD", "delete.png" ); + menu->addAction(QIcon(pix), tr(QString("HOM_MEN_DELETE").toLatin1().data()), this, SLOT(Delete())); + } + } +} + +void HOMARDGUI::NextIter() +{ + this->OnGUIEvent(1103); +} + +void HOMARDGUI::LanceCalcul0() +{ + this->OnGUIEvent(1111); +} + +void HOMARDGUI::LanceCalcul1() +{ + this->OnGUIEvent(1112); +} + +void HOMARDGUI::IterInfo() +{ + this->OnGUIEvent(1121); +} + +void HOMARDGUI::MeshPublish0() +{ + this->OnGUIEvent(1131); +} + +void HOMARDGUI::MeshPublish1() +{ + this->OnGUIEvent(1132); +} + +void HOMARDGUI::Edit() +{ + this->OnGUIEvent(1201); +} + +void HOMARDGUI::Delete() +{ + this->OnGUIEvent(1211); +} + +void HOMARDGUI::EditAsciiFile() +{ + this->OnGUIEvent(1302); +} + +void HOMARDGUI::YACSCreate() +{ + this->OnGUIEvent(1401); +} +void HOMARDGUI::YACSWrite() +{ + this->OnGUIEvent(1402); +} + + +// +//============================================================================= +// Export the module +//============================================================================= +extern "C" { + Standard_EXPORT CAM_Module* createModule() + { + return new HOMARDGUI(""); + } +} + diff --git a/src/ADAPTGUI/HOMARDGUI.h b/src/ADAPTGUI/HOMARDGUI.h new file mode 100644 index 000000000..0c0a36bdd --- /dev/null +++ b/src/ADAPTGUI/HOMARDGUI.h @@ -0,0 +1,105 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// HOMARDGUI : HOMARD component GUI implemetation +// + +#ifndef _HOMARDGUI_H_ +#define _HOMARDGUI_H_ + +#include "HOMARDGUI_Exports.hxx" + +#include +#include "SalomeApp_Study.h" + +#include +#include +#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(HOMARD_Cas) +#include CORBA_CLIENT_HEADER(HOMARD_Hypothesis) + +#include + +class SalomeApp_Application; + +class HOMARD_EXPORT HOMARDGUI: public SalomeApp_Module +{ + Q_OBJECT + +public: + HOMARDGUI(const QString&); + ~HOMARDGUI(); + + + + virtual bool OnGUIEvent (int theCommandID); + void initialize( CAM_Application* ); + QString engineIOR() const; + void windows( QMap& ) const; + + static HOMARD::HOMARD_Gen_var InitHOMARDGen(SalomeApp_Application* ); + + +public slots: + bool deactivateModule( SUIT_Study* ); + bool activateModule( SUIT_Study* ); + static void setOrb(); + +private slots: + void OnGUIEvent(); + void EditAsciiFile(); + void LanceCalcul0(); + void LanceCalcul1(); + void IterInfo(); + void NextIter(); + void MeshPublish0(); + void MeshPublish1(); + void YACSCreate(); + void YACSWrite(); + void Edit(); + void Delete(); + +public: + virtual void contextMenuPopup( const QString&, QMenu*, QString& ); + + +private: + void createHOMARDAction( const int id, const QString& po_id, const QString& icon_id = QString(""), + const int key = 0, const bool toggle = false ); + void createActions(); + void createMenus(); + void recupPreferences(); + void createPopupMenus(); + _PTR(SObject) chercheMonObjet(); + + virtual void createPreferences(); + HOMARD::HOMARD_Gen_var myComponentHomard; + + int anId; + QString _ObjectName; + QString _LanguageShort ; + int _PublisMeshIN ; + int _PublisMeshOUT ; + int _YACSMaxIter ; + int _YACSMaxNode ; + int _YACSMaxElem ; + int _YACSTypeTest ; +}; + +#endif diff --git a/src/ADAPTGUI/HOMARDGUI_Exports.hxx b/src/ADAPTGUI/HOMARDGUI_Exports.hxx new file mode 100644 index 000000000..193b8124b --- /dev/null +++ b/src/ADAPTGUI/HOMARDGUI_Exports.hxx @@ -0,0 +1,35 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef _HOMARDGUI_EXPORTS_H_ +#define _HOMARDGUI_EXPORTS_H_ + +#ifdef WIN32 + #if defined HOMARD_EXPORTS || defined Homard_EXPORTS + #define HOMARD_EXPORT __declspec( dllexport ) + #else + #define HOMARD_EXPORT __declspec( dllimport ) + #endif +#else + #define HOMARD_EXPORT +#endif + + +#endif //_HOMARDGUI_EXPORTS_H_ + diff --git a/src/ADAPTGUI/HOMARDGUI_Utils.cxx b/src/ADAPTGUI/HOMARDGUI_Utils.cxx new file mode 100644 index 000000000..f57ed0ef9 --- /dev/null +++ b/src/ADAPTGUI/HOMARDGUI_Utils.cxx @@ -0,0 +1,278 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + + +#include "HOMARDGUI_Utils.h" + +#include "OB_Browser.h" + +#include "SUIT_Desktop.h" +#include "SUIT_Application.h" +#include "SUIT_Session.h" + +#include "LightApp_SelectionMgr.h" +#include "SalomeApp_Application.h" +#include "SalomeApp_Module.h" +#include "SalomeApp_Study.h" + +#include "SALOME_ListIO.hxx" + +#include "SALOMEconfig.h" +#include "utilities.h" +#include +#include + + +#include +#include +#include +#ifndef WIN32 +#include +#endif + +SALOME_ListIO HOMARD_UTILS::mySelected; + +//================================================================ +// Function : GetActiveStudy +// Returne un pointeur sur l'etude active +//================================================================ +SUIT_Study* HOMARD_UTILS::GetActiveStudy() +{ + SUIT_Application* app = SUIT_Session::session()->activeApplication(); + if (app) + return app->activeStudy(); + else + return NULL; +} + +//================================================================ +// Function : getStudy +// Returne un pointeur sur l'etude active +//================================================================ +_PTR(Study) HOMARD_UTILS::getStudy() +{ + static _PTR(Study) _study; + if(!_study) + _study = SalomeApp_Application::getStudy(); + return _study; +} + +//================================================================ +// Function : updateObjBrowser +// Purpose : met a jour l arbre d 'etude pour Homard +//================================================================ +void HOMARD_UTILS::updateObjBrowser() +{ + SalomeApp_Application* app = dynamic_cast(SUIT_Session::session()->activeApplication()); + if (app) { + // Le nom identifiant doit etre la valeur du parametre + // name de la section HOMARD du fichier SalomeApp.xml + CAM_Module* module = app->module("Homard" ); + SalomeApp_Module* appMod = dynamic_cast( module ); + if ( appMod ) { + app->updateObjectBrowser(); + appMod->updateObjBrowser( true ); + } + else + MESSAGE( "--- HOMARD::updateObjBrowser: appMod = NULL"); + } +} + +//================================================================ +// Function : selectedIO +// Return the list of selected SALOME_InteractiveObject's +//================================================================ +const SALOME_ListIO& HOMARD_UTILS::selectedIO() +{ + SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* > ( SUIT_Session::session()->activeApplication() ); + LightApp_SelectionMgr* aSelectionMgr = app->selectionMgr(); + if( aSelectionMgr ) + { + aSelectionMgr->selectedObjects( mySelected ); + for (SALOME_ListIteratorOfListIO it (mySelected); it.More(); it.Next()) + SCRUTE(it.Value()->getEntry()); + }; + return mySelected; +} + +//================================================================ +// Function : IObjectCount +// Return the number of selected objects +//================================================================ +int HOMARD_UTILS::IObjectCount() +{ + SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); + LightApp_SelectionMgr* aSelectionMgr = app->selectionMgr(); + if( aSelectionMgr ) + { + aSelectionMgr->selectedObjects( mySelected ); + SCRUTE(mySelected.Extent()); + return mySelected.Extent(); + } + return 0; +} + +//================================================================ +// Function : firstIObject +// Purpose : Return the first selected object in the selected object list +//================================================================ +Handle(SALOME_InteractiveObject) HOMARD_UTILS::firstIObject() +{ + const SALOME_ListIO& aList = selectedIO(); + return aList.Extent() > 0 ? aList.First() : Handle(SALOME_InteractiveObject)(); +} + +//================================================================ +// Function : lastIObject +// Return the last selected object in the selected object list +//================================================================ +Handle(SALOME_InteractiveObject) HOMARD_UTILS::lastIObject() +{ + const SALOME_ListIO& aList = selectedIO(); + return aList.Extent() > 0 ? aList.Last() : Handle(SALOME_InteractiveObject)(); +} + +//================================================================ +// Retourne vrai si l'objet est du type voulu +// . Dans le cas d'un cas, d'une hypothese, d'une zone, on se contente +// d'une comparaison simple entre le type stocke et TypeObject. +// . Pour l'iteration, le type stocke en attribut est sous la forme +// "IterationHomard" + le nom de l'iteration precedente. +// Il faut donc regarder si la chaine commence par TypeObject. +// . Idem pour le fichier de messages : "Mess " + numero d'iteration +// +// On filtre ce genre de situation avec option : +// -1 : comparaison totale +// 0 : comparaison sur le debut de la chaine +//================================================================ +bool HOMARD_UTILS::isObject(_PTR(SObject) MonObj, QString TypeObject, int option) +{ +// MESSAGE("isObject, TypeObject = "<Value().c_str()); +// MESSAGE("Type = "<moduleName(aHomardGUI->moduleName()) : QString("") ; + // WARNING/ATTENTION : si on savait recuperer la langue depuis les preferences, on ne ferait pas le passage par argument +// SUIT_ResourceMgr* resMgr = getApp()->resourceMgr(); +// SUIT_ResourceMgr* resMgr = myModule->getApp()->resourceMgr(); +// QString langue = resMgr->stringValue("language", "language", "en"); +// QString langue = "fr" ; + MESSAGE(". LanguageShort " << LanguageShort.toStdString().c_str()) ; + // Complement du fichier + QString fichier = QString(LanguageShort+"/"+monFichierAide) ; + MESSAGE(". Appel de onHelpContextModule avec :"); + MESSAGE(" rep = "<< rep.toStdString().c_str()); + MESSAGE(" fichier = "<< fichier.toStdString().c_str()); + MESSAGE(" contexte = "<< contexte.toStdString().c_str()); + + app->onHelpContextModule(rep, fichier, contexte); + } +} +//========================================================================================================= diff --git a/src/ADAPTGUI/HOMARDGUI_Utils.h b/src/ADAPTGUI/HOMARDGUI_Utils.h new file mode 100644 index 000000000..d257dbb6f --- /dev/null +++ b/src/ADAPTGUI/HOMARDGUI_Utils.h @@ -0,0 +1,90 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef HOMARD_H_UTILS +#define HOMARD_H_UTILS + +#include "HOMARDGUI_Exports.hxx" + +#include + +#include +#include CORBA_CLIENT_HEADER(HOMARD_Cas) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) + +#include "SALOMEDSClient_definitions.hxx" +#include "SALOME_InteractiveObject.hxx" +#include "LightApp_DataOwner.h" +#include "SalomeApp_Application.h" +#include + +class QString; +class QStringList; + +class SUIT_ViewWindow; +class SUIT_Desktop; +class SUIT_Study; +class SUIT_ResourceMgr; + +class CAM_Module; + +class SALOMEDSClient_Study; +class SALOMEDSClient_SObject; + +class SalomeApp_Study; +class SalomeApp_Module; +class LightApp_SelectionMgr; + +namespace HOMARD_UTILS { + + HOMARD_EXPORT SUIT_Study* GetActiveStudy(); + HOMARD_EXPORT _PTR(Study) getStudy(); + + HOMARD_EXPORT void updateObjBrowser(); + + HOMARD_EXPORT const SALOME_ListIO& selectedIO(); // Function returns a list of SALOME_InteractiveObject's from + // selection manager in GUI + + HOMARD_EXPORT int IObjectCount() ; // Function returns the number of selected objects + + HOMARD_EXPORT Handle(SALOME_InteractiveObject) firstIObject() ; + // Function returns the first selected object in the list + // of selected objects + + HOMARD_EXPORT Handle(SALOME_InteractiveObject) lastIObject() ; + // Function returns the last selected object in the list + // of selected objects + + HOMARD_EXPORT bool isBoundaryCAO(_PTR(SObject) MonObj); + HOMARD_EXPORT bool isBoundaryAn(_PTR(SObject) MonObj); + HOMARD_EXPORT bool isBoundaryDi(_PTR(SObject) MonObj); + HOMARD_EXPORT bool isCase(_PTR(SObject) MonObj); + HOMARD_EXPORT bool isHypo(_PTR(SObject) MonObj); + HOMARD_EXPORT bool isIter(_PTR(SObject) MonObj); + HOMARD_EXPORT bool isYACS(_PTR(SObject) MonObj); + HOMARD_EXPORT bool isZone(_PTR(SObject) MonObj); + HOMARD_EXPORT bool isFileType(_PTR(SObject) MonObj, QString TypeFile); + HOMARD_EXPORT bool isObject(_PTR(SObject) MonObj, QString TypeObject, int option ); + + HOMARD_EXPORT void PushOnHelp(QString monFichierAide, QString contexte, QString LanguageShort); + + extern SALOME_ListIO mySelected; +} + +#endif // ifndef HOMARD_H_UTILS diff --git a/src/ADAPTGUI/HomardQtCommun.cxx b/src/ADAPTGUI/HomardQtCommun.cxx new file mode 100644 index 000000000..a5762d03f --- /dev/null +++ b/src/ADAPTGUI/HomardQtCommun.cxx @@ -0,0 +1,453 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "HomardQtCommun.h" +#include "HOMARDGUI_Utils.h" + +#include + +#include +#include +#include +#include +#include +#ifndef WIN32 +#include +#endif +#include + + +#include "SalomeApp_Tools.h" + +using namespace std; + +#include + +// ============================================================================ +QString HOMARD_QT_COMMUN::SelectionArbreEtude(QString commentaire, int option ) +// ============================================================================ +// Retourne l'objet selectionne dans l'arbre d'etudes +// commentaire : +// . si le commentaire est une chaine vide, on ne tient pas compte du type de l'objet +// et on retourne le nom de cet objet +// . sinon : +// . si l'objet est du type defini par commentaire, retourne le nom de cet objet +// . sinon on retourne une QString("") +// option : +// . Si option = 0, ce n'est pas grave de ne rien trouver ; aucun message n'est emis +// . Si option = 1, ce n'est pas grave de ne rien trouver mais on emet un message +{ +// MESSAGE("SelectionArbreEtude : commentaire = " << commentaire.toStdString().c_str() << " et option = " << option); + int nbSel = HOMARD_UTILS::IObjectCount() ; + if ( nbSel == 0 ) + { + if ( option == 1 ) + { + QMessageBox::warning( 0, QObject::tr("HOM_WARNING"), + QObject::tr("HOM_SELECT_OBJECT_1") ); + } + return QString(""); + } + if ( nbSel > 1 ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_SELECT_OBJECT_2") ); + return QString(""); + } +// + Handle(SALOME_InteractiveObject) aIO = HOMARD_UTILS::firstIObject(); + if ( aIO->hasEntry() ) + { +// MESSAGE("aIO->getEntry() = " << aIO->getEntry()); + _PTR(Study) aStudy = HOMARD_UTILS::getStudy(); + _PTR(SObject) aSO ( aStudy->FindObjectID( aIO->getEntry() ) ); + _PTR(GenericAttribute) anAttr; + if (aSO->FindAttribute(anAttr, "AttributeComment") ) + { + if ( commentaire != "" ) + { + _PTR(AttributeComment) attributComment = anAttr; + QString aComment= QString(attributComment->Value().data()); +// MESSAGE("... aComment = " << aComment.toStdString().c_str()); + int iaux = aComment.lastIndexOf(commentaire); +// MESSAGE("... iaux = " << iaux); + if ( iaux !=0 ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_SELECT_OBJECT_3").arg(commentaire) ); + return QString(""); + } + } + if (aSO->FindAttribute(anAttr, "AttributeName") ) + { + _PTR(AttributeName) attributName = anAttr; + QString aName= QString(attributName->Value().data()); + return aName; + } + } + } +// + return QString(""); +} + +// ======================================================================= +QString HOMARD_QT_COMMUN::SelectionCasEtude() +// ======================================================================= +{ + QString aName = QString(""); + int nbSel = HOMARD_UTILS::IObjectCount() ; + if ( nbSel == 0 ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_SELECT_OBJECT_1") ); + return QString(""); + } + if ( nbSel > 1 ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_SELECT_OBJECT_2") ); + return QString(""); + } + Handle(SALOME_InteractiveObject) aIO = HOMARD_UTILS::firstIObject(); + if ( aIO->hasEntry() ) + { + _PTR(Study) aStudy = HOMARD_UTILS::getStudy(); + _PTR(SObject) aSO ( aStudy->FindObjectID( aIO->getEntry() ) ); + _PTR(SObject) aSObjCas = aSO->GetFather(); + _PTR(GenericAttribute) anAttr; + if (aSObjCas->FindAttribute(anAttr, "AttributeName") ) + { + _PTR(AttributeName) attributName = anAttr; + aName= QString(attributName->Value().data()); + } + return aName; + } + return QString(""); +} + +// ======================================================================= +QString HOMARD_QT_COMMUN::PushNomFichier(bool avertir, QString TypeFichier) +// ======================================================================= +// Gestion les boutons qui permettent de +// 1) retourne le nom d'un fichier par une fenetre de dialogue si aucun +// objet est selectionne dans l arbre d etude +// 2) retourne le nom du fichier asocie a l objet +// selectionne dans l arbre d etude +{ +// MESSAGE("PushNomFichier avec avertir "<hasEntry() ) + { + _PTR(Study) aStudy = HOMARD_UTILS::getStudy(); + _PTR(SObject) aSO ( aStudy->FindObjectID( aIO->getEntry() ) ); + _PTR(GenericAttribute) anAttr; + _PTR(AttributeFileType) aFileType; + _PTR(AttributeExternalFileDef) aFileName; + if (aSO) { + if (aSO->FindAttribute(anAttr, "AttributeFileType") ) { + aFileType=anAttr; + QString fileType=QString(aFileType->Value().data()); + if ( fileType==QString("FICHIERMED")) { + if (aSO->FindAttribute(anAttr,"AttributeExternalFileDef")) { + aFileName=anAttr; + aFile= QString(aFileName->Value().data()); } + } + } + } + } + + if ( aFile==QString::null ) + { + if ( avertir ) { + QMessageBox::warning( 0, QObject::tr("HOM_WARNING"), + QObject::tr("HOM_SELECT_STUDY") ); + } + aFile = QFileDialog::getOpenFileName(0, QObject::tr("HOM_SELECT_FILE_0"), QString(""), filtre ); + } + } + // B.3. Bizarre + else + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_SELECT_FILE_2") ); + } + + return aFile; +} +// ======================================================================= +med_idt HOMARD_QT_COMMUN::OuvrirFichier(QString aFile) +// ======================================================================= +// renvoie le medId associe au fichier Med apres ouverture +{ + med_idt medIdt = MEDfileOpen(aFile.toStdString().c_str(),MED_ACC_RDONLY); + if (medIdt <0) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_MED_FILE_1") ); + } + return medIdt; +} + +// ====================================================== +QString HOMARD_QT_COMMUN::LireNomMaillage(QString aFile) +// ======================================================== +{ + QString nomMaillage = "" ; + int erreur = 0 ; + med_idt medIdt ; + while ( erreur == 0 ) + { + // Ouverture du fichier + medIdt = HOMARD_QT_COMMUN::OuvrirFichier(aFile); + if ( medIdt < 0 ) + { + erreur = 1 ; + break ; + } + med_int numberOfMeshes = MEDnMesh(medIdt) ; + if (numberOfMeshes == 0 ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_MED_FILE_2") ); + erreur = 2 ; + break ; + } + if (numberOfMeshes > 1 ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_MED_FILE_3") ); + erreur = 3 ; + break ; + } + + nomMaillage = HOMARD_QT_COMMUN::LireNomMaillage2(medIdt,1); + break ; + } + // Fermeture du fichier + if ( medIdt > 0 ) MEDfileClose(medIdt); + + return nomMaillage; +} +// ======================================================================= +QString HOMARD_QT_COMMUN::LireNomMaillage2(med_idt medIdt ,int meshId) +// ======================================================================= +{ + QString NomMaillage=QString::null; + char meshname[MED_NAME_SIZE+1]; + med_int spacedim,meshdim; + med_mesh_type meshtype; + char descriptionription[MED_COMMENT_SIZE+1]; + char dtunit[MED_SNAME_SIZE+1]; + med_sorting_type sortingtype; + med_int nstep; + med_axis_type axistype; + int naxis = MEDmeshnAxis(medIdt,1); + char *axisname=new char[naxis*MED_SNAME_SIZE+1]; + char *axisunit=new char[naxis*MED_SNAME_SIZE+1]; + med_err aRet = MEDmeshInfo(medIdt, + meshId, + meshname, + &spacedim, + &meshdim, + &meshtype, + descriptionription, + dtunit, + &sortingtype, + &nstep, + &axistype, + axisname, + axisunit); + + if ( aRet < 0 ) { QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), \ + QObject::tr("HOM_MED_FILE_4") ); } + else { NomMaillage=QString(meshname); } + + delete[] axisname ; + delete[] axisunit ; + + return NomMaillage; +} + + +// ======================================================================= +std::list HOMARD_QT_COMMUN::GetListeChamps(QString aFile) +// ======================================================================= +{ +// Il faut voir si plusieurs maillages + + MESSAGE("GetListeChamps"); + std::list ListeChamp ; + + med_err erreur = 0 ; + med_idt medIdt ; + + while ( erreur == 0 ) + { + // Ouverture du fichier + SCRUTE(aFile.toStdString()); + medIdt = HOMARD_QT_COMMUN::OuvrirFichier(aFile); + if ( medIdt < 0 ) + { + erreur = 1 ; + break ; + } + // Lecture du nombre de champs + med_int ncha = MEDnField(medIdt) ; + if (ncha < 1 ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_MED_FILE_5") ); + erreur = 2 ; + break ; + } + // Lecture des caracteristiques des champs + for (int i=0; i< ncha; i++) + { +// Lecture du nombre de composantes + med_int ncomp = MEDfieldnComponent(medIdt,i+1); +// Lecture du type du champ, des noms des composantes et du nom de l'unite + char nomcha [MED_NAME_SIZE+1]; + char meshname[MED_NAME_SIZE+1]; + char * comp = (char*) malloc(ncomp*MED_SNAME_SIZE+1); + char * unit = (char*) malloc(ncomp*MED_SNAME_SIZE+1); + char dtunit[MED_SNAME_SIZE+1]; + med_bool local; + med_field_type typcha; + med_int nbofcstp; + erreur = MEDfieldInfo(medIdt,i+1,nomcha,meshname,&local,&typcha,comp,unit,dtunit,&nbofcstp) ; + free(comp); + free(unit); + if ( erreur < 0 ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_MED_FILE_6") ); + break ; + } + ListeChamp.push_back(QString(nomcha)); + } + break ; + } + // Fermeture du fichier + if ( medIdt > 0 ) MEDfileClose(medIdt); + + return ListeChamp; +} + +// ====================================================================================== +std::list HOMARD_QT_COMMUN::GetListeComposants(QString aFile, QString aChamp) +// ====================================================================================== +{ + MESSAGE ( "GetListeComposants pour le fichier " << aFile.toStdString().c_str()); + MESSAGE ( "GetListeComposants pour le champ " << aChamp.toStdString().c_str()); + + std::list ListeComposants; + + med_err erreur = 0 ; + med_idt medIdt ; + + while ( erreur == 0 ) + { + // Ouverture du fichier + SCRUTE(aFile.toStdString()); + medIdt = HOMARD_QT_COMMUN::OuvrirFichier(aFile); + if ( medIdt < 0 ) + { + erreur = 1 ; + break ; + } + // Lecture du nombre de champs + med_int ncha = MEDnField(medIdt) ; + if (ncha < 1 ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_MED_FILE_5") ); + erreur = 2 ; + break ; + } + // Lecture des caracteristiques des champs + for (int i=0; i< ncha; i++) + { +// Lecture du nombre de composantes + med_int ncomp = MEDfieldnComponent(medIdt,i+1); +// Lecture du type du champ, des noms des composantes et du nom de l'unite + char nomcha [MED_NAME_SIZE+1]; + char meshname[MED_NAME_SIZE+1]; + char * comp = (char*) malloc(ncomp*MED_SNAME_SIZE+1); + char * unit = (char*) malloc(ncomp*MED_SNAME_SIZE+1); + char dtunit[MED_SNAME_SIZE+1]; + med_bool local; + med_field_type typcha; + med_int nbofcstp; + erreur = MEDfieldInfo(medIdt,i+1,nomcha,meshname,&local,&typcha,comp,unit,dtunit,&nbofcstp) ; + free(unit); + if ( erreur < 0 ) + { + free(comp); + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_MED_FILE_6") ); + break ; + } + // Lecture des composantes si c'est le bon champ + if ( QString(nomcha) == aChamp ) + { + for (int j = 0; j 0 ) MEDfileClose(medIdt); + + return ListeComposants; +} diff --git a/src/ADAPTGUI/HomardQtCommun.h b/src/ADAPTGUI/HomardQtCommun.h new file mode 100644 index 000000000..4587833e2 --- /dev/null +++ b/src/ADAPTGUI/HomardQtCommun.h @@ -0,0 +1,58 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef HOMARDQTCOMMUN_H +#define HOMARDQTCOMMUN_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include "SALOME_Selection.h" +#include + +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(HOMARD_Cas) + +#include +#include +#include + +class QComboBox; + + +namespace HOMARD_QT_COMMUN +{ + HOMARD_EXPORT QString PushNomFichier(bool avertir, QString TypeFichier=""); + HOMARD_EXPORT QString LireNomMaillage(QString aFile); + HOMARD_EXPORT QString LireNomMaillage2(med_idt Medidt,int MeshId); + + HOMARD_EXPORT med_idt OuvrirFichier(QString aFile); + + HOMARD_EXPORT std::list GetListeChamps(QString aFile); + HOMARD_EXPORT std::list GetListeComposants(QString aFile, QString aChamp); + + HOMARD_EXPORT QString SelectionArbreEtude(QString commentaire, int grave ); + HOMARD_EXPORT QString SelectionCasEtude(); + +}; + +#endif // HOMARDQTCOMMUN_H diff --git a/src/ADAPTGUI/IterInfo.ui b/src/ADAPTGUI/IterInfo.ui new file mode 100644 index 000000000..04b2664ae --- /dev/null +++ b/src/ADAPTGUI/IterInfo.ui @@ -0,0 +1,129 @@ + + + IterInfo + + + + 0 + 0 + 420 + 220 + + + + + 0 + 0 + + + + Information on a mesh + + + true + + + + + + Options + + + + + + Quality + + + + + + + Connection + + + + + + + Diametre + + + + + + + Group size + + + + + + + Entanglement + + + + + + + + + + + + + + 9 + + + 6 + + + + + Help + + + false + + + + + + + Apply + + + false + + + + + + + OK + + + false + + + + + + + Cancel + + + false + + + + + + + + + + + diff --git a/src/ADAPTGUI/MeshInfo.ui b/src/ADAPTGUI/MeshInfo.ui new file mode 100644 index 000000000..c3e55aa07 --- /dev/null +++ b/src/ADAPTGUI/MeshInfo.ui @@ -0,0 +1,285 @@ + + + MeshInfo + + + + 0 + 0 + 536 + 372 + + + + + 0 + 0 + + + + Information on a mesh + + + true + + + + + + 6 + + + 0 + + + + + Name + + + + + + + + 382 + 21 + + + + + + + + + + 6 + + + 0 + + + + + Directory + + + + + + + + + + false + + + + + + + + 382 + 21 + + + + + + + + + + Qt::Vertical + + + + 20 + 18 + + + + + + + + 6 + + + 0 + + + + + Mesh + + + + + + + + + + false + + + + + + + + 382 + 21 + + + + + + + + + + Qt::Vertical + + + + 20 + 1 + + + + + + + + Options + + + + + + Quality + + + + + + + Connection + + + + + + + Diametre + + + + + + + Group size + + + + + + + Entanglement + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + 9 + + + 6 + + + + + Help + + + false + + + + + + + Apply + + + false + + + + + + + OK + + + false + + + + + + + Cancel + + + false + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 128 + 25 + + + + + + + + + diff --git a/src/ADAPTGUI/MonCreateBoundaryAn.cxx b/src/ADAPTGUI/MonCreateBoundaryAn.cxx new file mode 100644 index 000000000..40fa47f4b --- /dev/null +++ b/src/ADAPTGUI/MonCreateBoundaryAn.cxx @@ -0,0 +1,809 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonCreateBoundaryAn.h" +#include "MonCreateCase.h" + +#include +#include + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include + +#include +#include +#include +#include +#include + +#include "math.h" +#define PI 3.141592653589793 + +using namespace std; + +// ------------------------------------------------------------------------------------------------------------------------ +MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen0, + QString caseName) : +// ------------------------------------------------------------------------------------------------------------------------------ +/* Constructs a MonCreateBoundaryAn + appele pour une vraie creation + initialise un cylindre et non une sphere +*/ + QDialog(0), Ui_CreateBoundaryAn(), + _parent(parent), + _Name (""), + _aCaseName(caseName), + _Xmin(0), _Xmax(0), _Xincr(0), _Ymin(0), _Ymax(0), _Yincr(0), _Zmin(0), _Zmax(0), _Zincr(0), _DMax(0), + _Type(1), + _BoundaryAnXcentre(0), _BoundaryAnYcentre(0), _BoundaryAnZcentre(0), _BoundaryAnRayon(0), + _BoundaryAnXaxis(0), _BoundaryAnYaxis(0), _BoundaryAnZaxis(0), + _Xcentre(0), _Ycentre(0), _Zcentre(0), _Rayon(0), + _BoundaryAnXcone1(0), _BoundaryAnYcone1(0), _BoundaryAnZcone1(0), _BoundaryAnRayon1(0), + _BoundaryAnXcone2(0), _BoundaryAnYcone2(0), _BoundaryAnZcone2(0), _BoundaryAnRayon2(0), + _BoundaryAnXaxisCone(0), _BoundaryAnYaxisCone(0), _BoundaryAnZaxisCone(0), + _BoundaryAngle(0), + _BoundaryAnToreXcentre(0), _BoundaryAnToreYcentre(0), _BoundaryAnToreZcentre(0), + _BoundaryAnToreXaxe(0), _BoundaryAnToreYaxe(0), _BoundaryAnToreZaxe(0), + _BoundaryAnToreRRev(0), _BoundaryAnToreRPri(0), + Chgt (false) + { + MESSAGE("Constructeur") ; + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); + setupUi(this); + setModal(modal); + + // Gestion des icones + QPixmap pix ; + QIcon IS ; + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + pix = resMgr->loadPixmap( "HOMARD", "spherepoint.png" ); + IS=QIcon(pix); + RBSphere->setIcon(IS); + pix = resMgr->loadPixmap( "HOMARD", "cylinderpointvector.png" ); + IS=QIcon(pix); + RBCylindre->setIcon(IS); + pix = resMgr->loadPixmap( "HOMARD", "cone.png" ); + IS=QIcon(pix); + RBCone->setIcon(IS); + pix = resMgr->loadPixmap( "HOMARD", "conepointvector.png" ); + IS=QIcon(pix); + RB_Def_angle->setIcon(IS); + pix = resMgr->loadPixmap( "HOMARD", "conedxyz.png" ); + IS=QIcon(pix); + RB_Def_radius->setIcon(IS); + pix = resMgr->loadPixmap( "HOMARD", "toruspointvector.png" ); + IS=QIcon(pix); + RBTore->setIcon(IS); + + InitConnect( ); + + SetNewName() ; + InitValBoundaryAn(); // Cherche les valeurs de la boite englobante le maillage + InitMinMax(); // Initialise les bornes des boutons + SetCylinder(); // Propose un cylindre en premier choix + } +// -------------------------------------------------------------------------------------------------------------- +MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, + HOMARD::HOMARD_Gen_var myHomardGen0, + QString caseName): +// -------------------------------------------------------------------------------------------------------------- +// + QDialog(0), Ui_CreateBoundaryAn(), + myHomardGen(myHomardGen0), + _parent(parent), + _Name (""), + _aCaseName(caseName), + _Type(1), + _BoundaryAnXcentre(0), _BoundaryAnYcentre(0), _BoundaryAnZcentre(0), _BoundaryAnRayon(0), + _BoundaryAnXaxis(0), _BoundaryAnYaxis(0), _BoundaryAnZaxis(0), + // Pour affichage lors de l edition d une BoundaryAn sans nom de Cas + _Xcentre(0), _Ycentre(0), _Zcentre(0), _Rayon(0), + _Xmin(1), _Xmax(1), _Xincr(1), _Ymin(1), _Ymax(1), _Yincr(1), _Zmin(1), _Zmax(1), _Zincr(1), _DMax(1), + Chgt (false) + { + // MESSAGE("Debut de MonCreateBoundaryAn") + setupUi(this); + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + QPixmap pix = resMgr->loadPixmap( "HOMARD", "spherepoint.png" ); + QIcon IS=QIcon(pix); + RBSphere->setIcon(IS); + QPixmap pix2 = resMgr->loadPixmap( "HOMARD", "cylinderpointvector.png" ); + QIcon IS2=QIcon(pix2); + RBCylindre->setIcon(IS2); + QPixmap pix3 = resMgr->loadPixmap( "HOMARD", "cone.png" ); + QIcon IS3=QIcon(pix3); + RBCone->setIcon(IS3); + QPixmap pix4 = resMgr->loadPixmap( "HOMARD", "conepointvector.png" ); + QIcon IS4=QIcon(pix4); + RB_Def_angle->setIcon(IS4); + QPixmap pix5 = resMgr->loadPixmap( "HOMARD", "conedxyz.png" ); + QIcon IS5=QIcon(pix5); + RB_Def_radius->setIcon(IS5); + setModal(true); + InitConnect(); + } + +// ------------------------------------------------------------------------ +MonCreateBoundaryAn::~MonCreateBoundaryAn() +// ------------------------------------------------------------------------ +{ + // no need to delete child widgets, Qt does it all for us +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryAn::InitConnect() +// ------------------------------------------------------------------------ +{ + connect( RBCylindre, SIGNAL(clicked()) , this, SLOT(SetCylinder()) ) ; + connect( RBSphere, SIGNAL(clicked()) , this, SLOT(SetSphere()) ) ; + connect( RBCone, SIGNAL(clicked()) , this, SLOT(SetCone()) ) ; + connect( RB_Def_radius, SIGNAL(clicked()) , this, SLOT(SetConeR()) ); + connect( RB_Def_angle, SIGNAL(clicked()) , this, SLOT(SetConeA()) ); + connect( RBTore, SIGNAL(clicked()) , this, SLOT(SetTore()) ) ; + connect( buttonOk, SIGNAL( pressed() ), this, SLOT( PushOnOK() ) ); + connect( buttonApply, SIGNAL( pressed() ), this, SLOT( PushOnApply() ) ); + connect( buttonCancel, SIGNAL( pressed() ), this, SLOT( close() ) ); + connect( buttonHelp, SIGNAL( pressed() ), this, SLOT( PushOnHelp() ) ); +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryAn::InitValBoundaryAn() +// ------------------------------------------------------------------------ +{ +// +// 1. Les coordonnees extremes du maillage +// + if (_aCaseName == QString("")) { return; } + + HOMARD::HOMARD_Cas_var aCas = myHomardGen->GetCase(_aCaseName.toStdString().c_str()); + HOMARD::extrema_var MesExtremes = aCas->GetBoundingBox(); + int num = MesExtremes->length() ; + ASSERT(num == 10); + _Xmin=MesExtremes[0]; _Xmax=MesExtremes[1]; _Xincr=MesExtremes[2]; + _Ymin=MesExtremes[3]; _Ymax=MesExtremes[4]; _Yincr=MesExtremes[5]; + _Zmin=MesExtremes[6]; _Zmax=MesExtremes[7]; _Zincr=MesExtremes[8]; + _DMax=MesExtremes[9]; + MESSAGE ("_Xmin : " << _Xmin << " _Xmax : " << _Xmax << " _Xincr : " << _Xincr ) ; + MESSAGE ("_Ymin : " << _Ymin << " _Ymax : " << _Ymax << " _Yincr : " << _Yincr ) ; + MESSAGE ("_Zmin : " << _Zmin << " _Zmax : " << _Zmax << " _Zincr : " << _Zincr) ; + MESSAGE ("_DMax : " << _DMax); + +// 2. Caracteristiques des frontieres +// en X + _Xcentre=(_Xmin + _Xmax)/2.; +// en Y + _Ycentre=(_Ymin + _Ymax)/2.; +// en Z + _Zcentre=(_Zmin + _Zmax)/2.; +// Rayon + _Rayon= _DMax/4.; +} + +// ------------------------------------------------------------------------ +void MonCreateBoundaryAn::InitMinMax() +// ------------------------------------------------------------------------ +{ + // Cylindre + // . X du centre + SpinBox_Xcent->setValue(_Xcentre); + SpinBox_Xcent->setSingleStep(_Xincr); + // . Y du centre + SpinBox_Ycent->setValue(_Ycentre); + SpinBox_Ycent->setSingleStep(_Yincr); + // . Z du centre + SpinBox_Zcent->setValue(_Zcentre); + SpinBox_Zcent->setSingleStep(_Zincr); + // . X de l'axe + SpinBox_Xaxis->setValue(0.); + SpinBox_Xaxis->setSingleStep(0.1); + // . Y de l'axe + SpinBox_Yaxis->setValue(0.); + SpinBox_Yaxis->setSingleStep(0.1); + // . Z de l'axe + SpinBox_Zaxis->setValue(1.); + SpinBox_Zaxis->setSingleStep(0.1); + // . Rayon + SpinBox_Radius->setValue(_Rayon); + SpinBox_Radius->setSingleStep(_Rayon/10.); + + // Sphere + // . X du centre + SpinBox_Xcentre->setValue(_Xcentre); + SpinBox_Xcentre->setSingleStep(_Xincr); + // . Y du centre + SpinBox_Ycentre->setValue(_Ycentre); + SpinBox_Ycentre->setSingleStep(_Yincr); + // . Z du centre + SpinBox_Zcentre->setValue(_Zcentre); + SpinBox_Zcentre->setSingleStep(_Zincr); + // . Rayon + SpinBox_Rayon->setValue(_Rayon); + SpinBox_Rayon->setSingleStep(_Rayon/10.); + + // Cone en rayons + // . X des centres + _BoundaryAnXcone1 = _Xcentre ; + SpinBox_Cone_X1->setSingleStep(_Xincr); + _BoundaryAnXcone2 = _Xcentre ; + SpinBox_Cone_X2->setSingleStep(_Xincr); + // . Y des centres + _BoundaryAnYcone1 = _Ycentre ; + SpinBox_Cone_Y1->setSingleStep(_Yincr); + _BoundaryAnYcone2 = _Ycentre ; + SpinBox_Cone_Y2->setSingleStep(_Yincr); + // . Z des centres + _BoundaryAnZcone1 = _Zmin ; + SpinBox_Cone_Z1->setSingleStep(_Zincr); + _BoundaryAnZcone2 = _Zmax ; + SpinBox_Cone_Z2->setSingleStep(_Zincr); + // . Rayons/Angles + _BoundaryAnRayon1 = 0. ; + _BoundaryAnRayon2 = _Rayon ; + SpinBox_Cone_V2->setSingleStep(_Rayon/10.); + + // Cone en angle + convertRayonAngle(1) ; + SpinBox_Cone_X1->setValue(_BoundaryAnXaxisCone); + SpinBox_Cone_Y1->setValue(_BoundaryAnYaxisCone); + SpinBox_Cone_Z1->setValue(_BoundaryAnZaxisCone); + SpinBox_Cone_V1->setValue(_BoundaryAngle); + SpinBox_Cone_X2->setValue(_BoundaryAnXorigCone); + SpinBox_Cone_Y2->setValue(_BoundaryAnYorigCone); + SpinBox_Cone_Z2->setValue(_BoundaryAnZorigCone); + + // Tore + // . X du centre + SpinBoxToreXcent->setValue(_Xcentre); + SpinBoxToreXcent->setSingleStep(_Xincr); + // . Y du centre + SpinBoxToreYcent->setValue(_Ycentre); + SpinBoxToreYcent->setSingleStep(_Yincr); + // . Z du centre + SpinBoxToreZcent->setValue(_Zcentre); + SpinBoxToreZcent->setSingleStep(_Zincr); + // . X de l'axe + SpinBoxToreXaxe->setValue(0.); + SpinBoxToreXaxe->setSingleStep(0.1); + // . Y de l'axe + SpinBoxToreYaxe->setValue(0.); + SpinBoxToreYaxe->setSingleStep(0.1); + // . Z de l'axe + SpinBoxToreZaxe->setValue(1.); + SpinBoxToreZaxe->setSingleStep(0.1); + // . Rayon de revolution + SpinBoxToreRRev->setValue(_Rayon); + SpinBoxToreRRev->setSingleStep(_Rayon/10.); + // . Rayon primaire + SpinBoxToreRPri->setValue(_Rayon/3.); + SpinBoxToreRPri->setSingleStep(_Rayon/20.); +} +// ------------------------------------------------------------------------ +bool MonCreateBoundaryAn::PushOnApply() +// ------------------------------------------------------------------------ +// Appele lorsque l'un des boutons Ok ou Apply est presse +// +{ + if (LEName->text().trimmed()=="") + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_BOUN_NAME") ); + return false; + } + + switch (_Type) + { + case 1 : // il s agit d un cylindre + { + if ((_BoundaryAnXcentre != SpinBox_Xcent->value()) || + (_BoundaryAnYcentre != SpinBox_Ycent->value()) || + (_BoundaryAnZcentre != SpinBox_Zcent->value()) || + (_BoundaryAnRayon != SpinBox_Radius->value()) || + (_BoundaryAnXaxis != SpinBox_Xaxis->value()) || + (_BoundaryAnYaxis != SpinBox_Yaxis->value()) || + (_BoundaryAnZaxis != SpinBox_Zaxis->value()) ) + { + Chgt = true; + _BoundaryAnXaxis= SpinBox_Xaxis->value(); + _BoundaryAnYaxis= SpinBox_Yaxis->value(); + _BoundaryAnZaxis= SpinBox_Zaxis->value(); + _BoundaryAnXcentre=SpinBox_Xcent->value(); + _BoundaryAnYcentre=SpinBox_Ycent->value(); + _BoundaryAnZcentre=SpinBox_Zcent->value(); + _BoundaryAnRayon=SpinBox_Radius->value(); + } + break; + } + + case 2 : // il s agit d une sphere + { + if ((_BoundaryAnXcentre != SpinBox_Xcentre->value()) || + (_BoundaryAnYcentre != SpinBox_Ycentre->value()) || + (_BoundaryAnZcentre != SpinBox_Zcentre->value()) || + (_BoundaryAnRayon != SpinBox_Rayon->value()) ) + { + Chgt = true; + _BoundaryAnXcentre=SpinBox_Xcentre->value(); + _BoundaryAnYcentre=SpinBox_Ycentre->value(); + _BoundaryAnZcentre=SpinBox_Zcentre->value(); + _BoundaryAnRayon=SpinBox_Rayon->value(); + } + break; + } + + case 3 : // il s agit d un cone defini par un axe et un angle + { + if ((_BoundaryAnXaxisCone != SpinBox_Cone_X1->value()) || + (_BoundaryAnYaxisCone != SpinBox_Cone_Y1->value()) || + (_BoundaryAnZaxisCone != SpinBox_Cone_Z1->value()) || + (_BoundaryAnXorigCone != SpinBox_Cone_X2->value()) || + (_BoundaryAnYorigCone != SpinBox_Cone_Y2->value()) || + (_BoundaryAnZorigCone != SpinBox_Cone_Z2->value()) || + (_BoundaryAngle != SpinBox_Cone_V1->value()) ) + { + Chgt = true; + _BoundaryAnXaxisCone = SpinBox_Cone_X1->value() ; + _BoundaryAnYaxisCone = SpinBox_Cone_Y1->value() ; + _BoundaryAnZaxisCone = SpinBox_Cone_Z1->value() ; + _BoundaryAnXorigCone = SpinBox_Cone_X2->value() ; + _BoundaryAnYorigCone = SpinBox_Cone_Y2->value() ; + _BoundaryAnZorigCone = SpinBox_Cone_Z2->value() ; + _BoundaryAngle = SpinBox_Cone_V1->value() ; + } + break; + } + + case 4 : // il s agit d un cone defini par les 2 rayons + { + if ((_BoundaryAnXcone1 != SpinBox_Cone_X1->value()) || + (_BoundaryAnYcone1 != SpinBox_Cone_Y1->value()) || + (_BoundaryAnZcone1 != SpinBox_Cone_Z1->value()) || + (_BoundaryAnRayon1 != SpinBox_Cone_V1->value()) || + (_BoundaryAnXcone2 != SpinBox_Cone_X2->value()) || + (_BoundaryAnYcone2 != SpinBox_Cone_Y2->value()) || + (_BoundaryAnZcone2 != SpinBox_Cone_Z2->value()) || + (_BoundaryAnRayon2 != SpinBox_Cone_V2->value()) ) + { + Chgt = true; + _BoundaryAnXcone1 = SpinBox_Cone_X1->value() ; + _BoundaryAnYcone1 = SpinBox_Cone_Y1->value() ; + _BoundaryAnZcone1 = SpinBox_Cone_Z1->value() ; + _BoundaryAnRayon1 = SpinBox_Cone_V1->value() ; + _BoundaryAnXcone2 = SpinBox_Cone_X2->value() ; + _BoundaryAnYcone2 = SpinBox_Cone_Y2->value() ; + _BoundaryAnZcone2 = SpinBox_Cone_Z2->value() ; + _BoundaryAnRayon2 = SpinBox_Cone_V2->value() ; + } + break; + } + case 5 : // il s agit d un tore + { + if ((_BoundaryAnToreXcentre != SpinBoxToreXcent->value()) || + (_BoundaryAnToreYcentre != SpinBoxToreYcent->value()) || + (_BoundaryAnToreZcentre != SpinBoxToreZcent->value()) || + (_BoundaryAnToreRRev != SpinBoxToreRRev->value()) || + (_BoundaryAnToreRPri != SpinBoxToreRPri->value()) || + (_BoundaryAnToreXaxe != SpinBoxToreXaxe->value()) || + (_BoundaryAnToreYaxe != SpinBoxToreYaxe->value()) || + (_BoundaryAnToreZaxe != SpinBoxToreZaxe->value()) ) + { + Chgt = true; + _BoundaryAnToreXcentre= SpinBoxToreXcent->value(); + _BoundaryAnToreYcentre= SpinBoxToreYcent->value(); + _BoundaryAnToreZcentre= SpinBoxToreZcent->value(); + _BoundaryAnToreRRev=SpinBoxToreRRev->value(); + _BoundaryAnToreRPri=SpinBoxToreRPri->value(); + _BoundaryAnToreXaxe=SpinBoxToreXaxe->value(); + _BoundaryAnToreYaxe=SpinBoxToreYaxe->value(); + _BoundaryAnToreZaxe=SpinBoxToreZaxe->value(); + } + break; + } + + } + +// Controles +// L'axe pour un cylindre + if ( _Type == 5 ) + { + double daux = _BoundaryAnXaxis*_BoundaryAnXaxis + _BoundaryAnYaxis*_BoundaryAnYaxis + _BoundaryAnZaxis*_BoundaryAnZaxis ; + if ( daux < 0.0000001 ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_AXE") ); + return false; + } + } + +// +// Création ou mise à jour de la frontière +// + bool bOK = CreateOrUpdateBoundaryAn(); + + if ( bOK ) { HOMARD_UTILS::updateObjBrowser() ; } + + return bOK; + +} +// --------------------------------------------------- +bool MonCreateBoundaryAn::CreateOrUpdateBoundaryAn() +//---------------------------------------------------- +// Creation de l'objet boundary +{ + MESSAGE("Debut de CreateOrUpdateBoundaryAn avec _Type ="<<_Type<<", _Name ="<<_Name.toStdString().c_str()<<" et LEName ="<text().trimmed().toStdString().c_str()); +// + if (_Name != LEName->text().trimmed()) + { + _Name = LEName->text().trimmed() ; + try + { + switch (_Type) + { + case 1 : // il s agit d un cylindre + { aBoundaryAn = myHomardGen->CreateBoundaryCylinder(CORBA::string_dup(_Name.toStdString().c_str()), \ + _BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnXaxis, _BoundaryAnYaxis, _BoundaryAnZaxis, _BoundaryAnRayon ); + break; + } + case 2 : // il s agit d une sphere + { aBoundaryAn = myHomardGen->CreateBoundarySphere(CORBA::string_dup(_Name.toStdString().c_str()), \ + _BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnRayon); + break; + } + case 3 : // il s agit d un cone defini par un axe et un angle + { aBoundaryAn = myHomardGen->CreateBoundaryConeA(CORBA::string_dup(_Name.toStdString().c_str()), \ + _BoundaryAnXaxisCone, _BoundaryAnYaxisCone, _BoundaryAnZaxisCone, _BoundaryAngle, \ + _BoundaryAnXorigCone, _BoundaryAnYorigCone, _BoundaryAnYorigCone); + break; + } + case 4 : // il s agit d un cone defini par les 2 rayons + { aBoundaryAn = myHomardGen->CreateBoundaryConeR(CORBA::string_dup(_Name.toStdString().c_str()), \ + _BoundaryAnXcone1, _BoundaryAnYcone1, _BoundaryAnZcone1, _BoundaryAnRayon1, \ + _BoundaryAnXcone2, _BoundaryAnYcone2, _BoundaryAnZcone2, _BoundaryAnRayon2); + break; + } + case 5 : // il s agit d un tore + { aBoundaryAn = myHomardGen->CreateBoundaryTorus(CORBA::string_dup(_Name.toStdString().c_str()), \ + _BoundaryAnToreXcentre, _BoundaryAnToreYcentre, _BoundaryAnToreZcentre, _BoundaryAnToreXaxe, _BoundaryAnToreYaxe, _BoundaryAnToreZaxe, _BoundaryAnToreRRev, _BoundaryAnToreRPri ); + break; + } + } + } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + return false ; + } + _parent->AddBoundaryAn(_Name); + + return true; + } + else { + QMessageBox::warning( 0, QObject::tr("HOM_WARNING"), + QObject::tr("HOM_SELECT_OBJECT_4") ); + return false ; + } + MESSAGE("Fin de CreateOrUpdateBoundaryAn"); +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryAn::PushOnOK() +// ------------------------------------------------------------------------ +{ + if (PushOnApply()) this->close(); +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryAn::PushOnHelp() +// ------------------------------------------------------------------------ +{ + std::string LanguageShort = myHomardGen->GetLanguageShort(); + HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("un-cylindre"), QString(LanguageShort.c_str())); +} + +// ----------------------------------- +void MonCreateBoundaryAn::SetNewName() +// ----------------------------------- +{ +// Recherche d'un nom par defaut qui n'existe pas encore + + HOMARD::listeBoundarys_var MyObjects = myHomardGen->GetAllBoundarysName(); + int num = 0; QString aName=""; + while (aName=="" ) + { + aName.setNum(num+1) ; + aName.insert(0, QString("Boun_")) ; + for ( int i=0; ilength(); i++) + { + if ( aName == QString(MyObjects[i])) + { + num ++ ; + aName = "" ; + break ; + } + } + } + LEName->setText(aName); +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryAn::SetCylinder() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetCylinder") + gBCylindre->setVisible(1); + gBSphere->setVisible(0); + gBCone->setVisible(0); + gBTore->setVisible(0); +// + _Type=1; +// + adjustSize(); +// MESSAGE("Fin de SetCylinder") +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryAn::SetSphere() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetSphere") + gBCylindre->setVisible(0); + gBSphere->setVisible(1); + gBCone->setVisible(0); + gBTore->setVisible(0); +// + _Type=2; +// + adjustSize(); +// MESSAGE("Fin de SetSphere") +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryAn::SetConeR() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetConeR") +// +// Stockage et conversion des valeurs si elles ont change + if ((_BoundaryAnXaxisCone != SpinBox_Cone_X1->value()) || + (_BoundaryAnYaxisCone != SpinBox_Cone_Y1->value()) || + (_BoundaryAnZaxisCone != SpinBox_Cone_Z1->value()) || + (_BoundaryAnXorigCone != SpinBox_Cone_X2->value()) || + (_BoundaryAnYorigCone != SpinBox_Cone_Y2->value()) || + (_BoundaryAnZorigCone != SpinBox_Cone_Z2->value()) || + (_BoundaryAngle != SpinBox_Cone_V1->value()) ) + { + MESSAGE("Stockage et conversion") + _BoundaryAnXaxisCone = SpinBox_Cone_X1->value() ; + _BoundaryAnYaxisCone = SpinBox_Cone_Y1->value() ; + _BoundaryAnZaxisCone = SpinBox_Cone_Z1->value() ; + _BoundaryAnXorigCone = SpinBox_Cone_X2->value() ; + _BoundaryAnYorigCone = SpinBox_Cone_Y2->value() ; + _BoundaryAnZorigCone = SpinBox_Cone_Z2->value() ; + _BoundaryAngle = SpinBox_Cone_V1->value() ; + convertRayonAngle(-1) ; + } +// + _Type=4; +// + TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X centre 1", 0)); + SpinBox_Cone_X1->setValue(_BoundaryAnXcone1); + TLCone_Y1->setText(QApplication::translate("CreateBoundaryAn", "Y centre 1", 0)); + SpinBox_Cone_Y1->setValue(_BoundaryAnYcone1); + TLCone_Z1->setText(QApplication::translate("CreateBoundaryAn", "Z centre 1", 0)); + SpinBox_Cone_Z1->setValue(_BoundaryAnZcone1); +// + TLCone_V1->setText(QApplication::translate("CreateBoundaryAn", "Radius 1", 0)); + SpinBox_Cone_V1->setSingleStep(_Rayon/10.); + SpinBox_Cone_V1->setMaximum(100000.*_DMax); + SpinBox_Cone_V1->setValue(_BoundaryAnRayon1); +// + TLCone_X2->setText(QApplication::translate("CreateBoundaryAn", "X centre 2", 0)); + SpinBox_Cone_X2->setValue(_BoundaryAnXcone2); + TLCone_Y2->setText(QApplication::translate("CreateBoundaryAn", "Y centre 2", 0)); + SpinBox_Cone_Y2->setValue(_BoundaryAnYcone2); + TLCone_Z2->setText(QApplication::translate("CreateBoundaryAn", "Z centre 2", 0)); + SpinBox_Cone_Z2->setValue(_BoundaryAnZcone2); +// + TLCone_V2->setVisible(1); + SpinBox_Cone_V2->setVisible(1); + TLCone_V2->setText(QApplication::translate("CreateBoundaryAn", "Radius 2", 0)); + SpinBox_Cone_V2->setValue(_BoundaryAnRayon2); +// +// MESSAGE("Fin de SetConeR") +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryAn::SetConeA() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetConeA") +// Stockage et conversion des valeurs si elles ont change + if ((_BoundaryAnXcone1 != SpinBox_Cone_X1->value()) || + (_BoundaryAnYcone1 != SpinBox_Cone_Y1->value()) || + (_BoundaryAnZcone1 != SpinBox_Cone_Z1->value()) || + (_BoundaryAnRayon1 != SpinBox_Cone_V1->value()) || + (_BoundaryAnXcone2 != SpinBox_Cone_X2->value()) || + (_BoundaryAnYcone2 != SpinBox_Cone_Y2->value()) || + (_BoundaryAnZcone2 != SpinBox_Cone_Z2->value()) || + (_BoundaryAnRayon2 != SpinBox_Cone_V2->value()) ) + { + MESSAGE("Stockage et conversion") + _BoundaryAnXcone1 = SpinBox_Cone_X1->value() ; + _BoundaryAnYcone1 = SpinBox_Cone_Y1->value() ; + _BoundaryAnZcone1 = SpinBox_Cone_Z1->value() ; + _BoundaryAnRayon1 = SpinBox_Cone_V1->value() ; + _BoundaryAnXcone2 = SpinBox_Cone_X2->value() ; + _BoundaryAnYcone2 = SpinBox_Cone_Y2->value() ; + _BoundaryAnZcone2 = SpinBox_Cone_Z2->value() ; + _BoundaryAnRayon2 = SpinBox_Cone_V2->value() ; + convertRayonAngle(1) ; + } +// + _Type=3; +// + TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X axis", 0)); + SpinBox_Cone_X1->setValue(_BoundaryAnXaxisCone); + TLCone_Y1->setText(QApplication::translate("CreateBoundaryAn", "Y axis", 0)); + SpinBox_Cone_Y1->setValue(_BoundaryAnYaxisCone); + TLCone_Z1->setText(QApplication::translate("CreateBoundaryAn", "Z axis", 0)); + SpinBox_Cone_Z1->setValue(_BoundaryAnZaxisCone); +// + TLCone_X2->setText(QApplication::translate("CreateBoundaryAn", "X centre", 0)); + SpinBox_Cone_X2->setValue(_BoundaryAnXorigCone); + TLCone_Y2->setText(QApplication::translate("CreateBoundaryAn", "Y centre", 0)); + SpinBox_Cone_Y2->setValue(_BoundaryAnYorigCone); + TLCone_Z2->setText(QApplication::translate("CreateBoundaryAn", "Z centre", 0)); + SpinBox_Cone_Z2->setValue(_BoundaryAnZorigCone); +// + TLCone_V1->setText(QApplication::translate("CreateBoundaryAn", "Angle", 0)); + SpinBox_Cone_V1->setValue(_BoundaryAngle); + SpinBox_Cone_V1->setSingleStep(1.); + SpinBox_Cone_V1->setMaximum(90.); +// + TLCone_V2->setVisible(0); + SpinBox_Cone_V2->setVisible(0); +// MESSAGE("Fin de SetConeA") +} + + +// ------------------------------------------------------------------------ +void MonCreateBoundaryAn::SetCone() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetCone") + gBCylindre->setVisible(0); + gBSphere->setVisible(0); + gBCone->setVisible(1); + gBTore->setVisible(0); +// + if ( RB_Def_radius->isChecked() ) + { + SetConeR(); + } + else + { + SetConeA(); + } +// + adjustSize(); +// MESSAGE("Fin de SetCone") +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryAn::SetTore() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetTore") + gBCylindre->setVisible(0); + gBSphere->setVisible(0); + gBCone->setVisible(0); + gBTore->setVisible(1); +// + _Type=5; +// + adjustSize(); +// MESSAGE("Fin de SetTore") +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryAn::convertRayonAngle(int option) +// ------------------------------------------------------------------------ +// Conversion entre les deux formulations du cone : +// par deux rayons ou avec un axe et un angle. +// Voir sfcoi1 de HOMARD +{ + MESSAGE("Debut de convertRayonAngle, option = "< BO = AB*RB/(RA-RB) +// Angle : tg(alpha) = RA/AO +// + double daux ; +// De rayon vers angle : + if ( option == 1 ) + { + double xa, ya, za, ra ; + double xb, yb, zb, rb ; +// Positionnement de A vers B, avec RA>RB + if ( _BoundaryAnRayon1 > _BoundaryAnRayon2 ) + { + xa = _BoundaryAnXcone1 ; + ya = _BoundaryAnYcone1 ; + za = _BoundaryAnZcone1 ; + ra = _BoundaryAnRayon1 ; + xb = _BoundaryAnXcone2 ; + yb = _BoundaryAnYcone2 ; + zb = _BoundaryAnZcone2 ; + rb = _BoundaryAnRayon2 ; + } + else + { + xa = _BoundaryAnXcone2 ; + ya = _BoundaryAnYcone2 ; + za = _BoundaryAnZcone2 ; + ra = _BoundaryAnRayon2 ; + xb = _BoundaryAnXcone1 ; + yb = _BoundaryAnYcone1 ; + zb = _BoundaryAnZcone1 ; + rb = _BoundaryAnRayon1 ; + } +// Axe : relie les deux centres, de A vers B. L'axe est normalise + _BoundaryAnXaxisCone = xb - xa ; + _BoundaryAnYaxisCone = yb - ya ; + _BoundaryAnZaxisCone = zb - za ; + daux = sqrt ( _BoundaryAnXaxisCone*_BoundaryAnXaxisCone + _BoundaryAnYaxisCone*_BoundaryAnYaxisCone + _BoundaryAnZaxisCone*_BoundaryAnZaxisCone ) ; + _BoundaryAnXaxisCone = _BoundaryAnXaxisCone/daux ; + _BoundaryAnYaxisCone = _BoundaryAnYaxisCone/daux ; + _BoundaryAnZaxisCone = _BoundaryAnZaxisCone/daux ; +// Origine + daux = daux * rb / (ra-rb) ; + _BoundaryAnXorigCone = xb + daux*_BoundaryAnXaxisCone ; + _BoundaryAnYorigCone = yb + daux*_BoundaryAnYaxisCone ; + _BoundaryAnZorigCone = zb + daux*_BoundaryAnZaxisCone ; +// Angle en degre + daux = ra / sqrt((_BoundaryAnXorigCone-xa)*(_BoundaryAnXorigCone-xa) + (_BoundaryAnYorigCone-ya)*(_BoundaryAnYorigCone-ya) + (_BoundaryAnZorigCone-za)*(_BoundaryAnZorigCone-za) ) ; + _BoundaryAngle = atan(daux)*180./PI ; + } +// D'angle vers rayon : + else + { + double xax, yax, zax ; +// L'axe est normalise + daux = sqrt ( _BoundaryAnXaxisCone*_BoundaryAnXaxisCone + _BoundaryAnYaxisCone*_BoundaryAnYaxisCone + _BoundaryAnZaxisCone*_BoundaryAnZaxisCone ) ; + xax = _BoundaryAnXaxisCone/daux ; + yax = _BoundaryAnYaxisCone/daux ; + zax = _BoundaryAnZaxisCone/daux ; +// Centre 1 : l'origine + _BoundaryAnXcone1 = _BoundaryAnXorigCone ; + _BoundaryAnYcone1 = _BoundaryAnYorigCone ; + _BoundaryAnZcone1 = _BoundaryAnZorigCone ; +// Rayon 1 : nul + _BoundaryAnRayon1 = 0. ; +// Centre 2 : l'origine decalee d'une longueur arbitraire le long de l'axe + _BoundaryAnXcone2 = _BoundaryAnXorigCone + _DMax*xax ; + _BoundaryAnYcone2 = _BoundaryAnYorigCone + _DMax*yax ; + _BoundaryAnZcone2 = _BoundaryAnZorigCone + _DMax*zax ; +// Rayon 2 : a calculer + _BoundaryAnRayon2 = _DMax*tan(_BoundaryAngle*PI/180.) ; + } +// MESSAGE("Fin de convertRayonAngle") +} + + diff --git a/src/ADAPTGUI/MonCreateBoundaryAn.h b/src/ADAPTGUI/MonCreateBoundaryAn.h new file mode 100644 index 000000000..46c838ac9 --- /dev/null +++ b/src/ADAPTGUI/MonCreateBoundaryAn.h @@ -0,0 +1,96 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_CREATEBOUNDARYAN_H +#define MON_CREATEBOUNDARYAN_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(HOMARD_Boundary) + +#include "ui_CreateBoundaryAn.h" +#include + +class MonCreateCase; +class HOMARD_EXPORT MonCreateBoundaryAn : public QDialog, public Ui_CreateBoundaryAn +{ + Q_OBJECT + +public: + MonCreateBoundaryAn( MonCreateCase* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString caseName); + virtual ~MonCreateBoundaryAn(); + +protected : + MonCreateBoundaryAn( MonCreateCase* parent, + HOMARD::HOMARD_Gen_var myHomardGen, + QString caseName); + + MonCreateCase * _parent; + + QString _Name; + QString _aCaseName; + + int _Type; + double _BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnRayon; + double _BoundaryAnXaxis, _BoundaryAnYaxis, _BoundaryAnZaxis; + double _Xcentre, _Ycentre, _Zcentre, _Rayon ; + double _Xmin, _Xmax, _Xincr, _Ymin, _Ymax, _Yincr, _Zmin, _Zmax, _Zincr, _DMax ; + double _BoundaryAnXcone1, _BoundaryAnYcone1, _BoundaryAnZcone1, _BoundaryAnRayon1; + double _BoundaryAnXcone2, _BoundaryAnYcone2, _BoundaryAnZcone2, _BoundaryAnRayon2; + double _BoundaryAnXaxisCone, _BoundaryAnYaxisCone, _BoundaryAnZaxisCone; + double _BoundaryAnXorigCone, _BoundaryAnYorigCone, _BoundaryAnZorigCone; + double _BoundaryAngle; + double _BoundaryAnToreXcentre, _BoundaryAnToreYcentre, _BoundaryAnToreZcentre; + double _BoundaryAnToreXaxe, _BoundaryAnToreYaxe, _BoundaryAnToreZaxe; + double _BoundaryAnToreRRev, _BoundaryAnToreRPri; + + + bool Chgt; + + HOMARD::HOMARD_Boundary_var aBoundaryAn ; + HOMARD::HOMARD_Gen_var myHomardGen; + + virtual void InitConnect(); + virtual void InitValBoundaryAn(); + virtual void InitMinMax(); + virtual void SetNewName(); + virtual bool CreateOrUpdateBoundaryAn(); + virtual void convertRayonAngle(int option); + +public slots: + virtual void SetCylinder(); + virtual void SetSphere(); + virtual void SetCone(); + virtual void SetConeR(); + virtual void SetConeA(); + virtual void SetTore(); + virtual void PushOnOK(); + virtual bool PushOnApply(); + virtual void PushOnHelp(); + +}; + +#endif // MON_CREATEBOUNDARYAN_H diff --git a/src/ADAPTGUI/MonCreateBoundaryCAO.cxx b/src/ADAPTGUI/MonCreateBoundaryCAO.cxx new file mode 100644 index 000000000..da07e84a5 --- /dev/null +++ b/src/ADAPTGUI/MonCreateBoundaryCAO.cxx @@ -0,0 +1,202 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonCreateBoundaryCAO.h" +#include "MonCreateListGroupCAO.h" +#include "MonCreateCase.h" + +#include +#include + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include + +using namespace std; + +// ------------------------------------------------------------------------------- +MonCreateBoundaryCAO::MonCreateBoundaryCAO(MonCreateCase* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen0, + QString caseName, QString aName) +// --------------------------------------------------------------------------------- +/* Constructs a MonCreateBoundaryCAO */ + : + QDialog(0), Ui_CreateBoundaryCAO(), + _parent(parent), _aName(aName), + myHomardGen(HOMARD::HOMARD_Gen::_duplicate(myHomardGen0)), + _aCaseName(caseName) + { + MESSAGE("Constructeur") ; + setupUi(this); + setModal(modal); + InitConnect(); + + if ( _aName == QString("") ) {SetNewName();}; + } + +// ------------------------------------------------------------------------ +MonCreateBoundaryCAO::~MonCreateBoundaryCAO() +// ------------------------------------------------------------------------ +{ + // no need to delete child widgets, Qt does it all for us +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryCAO::InitConnect() +// ------------------------------------------------------------------------ +{ + connect( PushFichier, SIGNAL(pressed()), this, SLOT(SetCAOFile())); + connect( buttonOk, SIGNAL(pressed()), this, SLOT( PushOnOK())); + connect( buttonApply, SIGNAL(pressed()), this, SLOT( PushOnApply())); + connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); + connect( buttonHelp, SIGNAL(pressed()), this, SLOT( PushOnHelp())); + connect( CBGroupe, SIGNAL(stateChanged(int)), this, SLOT( SetFiltrage())); +} + +// ------------------------------------------------------------------------ +bool MonCreateBoundaryCAO::PushOnApply() +// ------------------------------------------------------------------------ +// Appele lorsque l'un des boutons Ok ou Apply est presse +// +{ +// Verifications + + QString aName=LEName->text().trimmed(); + if (aName=="") { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_BOUN_NAME") ); + return false; + } + +// La CAO + QString aCAOFile=LEFileName->text().trimmed(); + if (aCAOFile ==QString("")) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_BOUN_CAO") ); + return false; + } + +// Creation de l'objet CORBA si ce n'est pas deja fait sous le meme nom + if ( _aName != aName ) + { + try + { + _aName=aName; + aBoundary=myHomardGen->CreateBoundaryCAO(CORBA::string_dup(_aName.toStdString().c_str()), aCAOFile.toStdString().c_str()); + _parent->AddBoundaryCAO(_aName); + aBoundary->SetCaseCreation(_aCaseName.toStdString().c_str()); + } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + return false; + } + } + +// Les groupes + AssocieLesGroupes(); + + HOMARD_UTILS::updateObjBrowser(); + return true; +} + + +// ------------------------------------------------------------------------ +void MonCreateBoundaryCAO::PushOnOK() +// ------------------------------------------------------------------------ +{ + if (PushOnApply()) this->close(); + if ( _parent ) { _parent->raise(); _parent->activateWindow(); }; +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryCAO::PushOnHelp() +// ------------------------------------------------------------------------ +{ + std::string LanguageShort = myHomardGen->GetLanguageShort(); + HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("CAO"), QString(LanguageShort.c_str())); +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryCAO::AssocieLesGroupes() +// ------------------------------------------------------------------------ +{ + HOMARD::ListGroupType_var aSeqGroupe = new HOMARD::ListGroupType; + aSeqGroupe->length(_listeGroupesBoundary.size()); + QStringList::const_iterator it; + int i=0; + for (it = _listeGroupesBoundary.constBegin(); it != _listeGroupesBoundary.constEnd(); it++) + aSeqGroupe[i++]=(*it).toStdString().c_str(); + aBoundary->SetGroups(aSeqGroupe); + +} + +// ------------------------------------------------- +void MonCreateBoundaryCAO::SetNewName() +// -------------------------------------------------- +{ + + HOMARD::listeBoundarys_var MyObjects = myHomardGen->GetAllBoundarysName(); + int num = 0; QString aName=""; + while (aName == QString("") ) + { + aName.setNum(num+1) ; + aName.insert(0, QString("Boun_")) ; + for ( int i=0; ilength(); i++) + { + if ( aName == QString(MyObjects[i])) + { + num ++ ; + aName = "" ; + break ; + } + } + } + LEName->setText(aName); +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryCAO::SetCAOFile() +// ------------------------------------------------------------------------ +{ + QString aCAOFile = HOMARD_QT_COMMUN::PushNomFichier( false, QString("xao") ); + if (!(aCAOFile.isEmpty())) LEFileName->setText(aCAOFile); +} + +// ------------------------------------------------------------------------ +void MonCreateBoundaryCAO::setGroups (QStringList listGroup) +// ------------------------------------------------------------------------ +{ + _listeGroupesBoundary = listGroup; +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryCAO::SetFiltrage() +// // ------------------------------------------------------------------------ +{ + if (!CBGroupe->isChecked()) return; + if (_aCaseName.toStdString().c_str() == QString()) { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_BOUN_CASE") ); + return; + } + + MonCreateListGroupCAO *aDlg = new MonCreateListGroupCAO(NULL, this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), + _aCaseName, _listeGroupesBoundary) ; + aDlg->show(); +} + diff --git a/src/ADAPTGUI/MonCreateBoundaryCAO.h b/src/ADAPTGUI/MonCreateBoundaryCAO.h new file mode 100644 index 000000000..1b6eff095 --- /dev/null +++ b/src/ADAPTGUI/MonCreateBoundaryCAO.h @@ -0,0 +1,73 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_CREATEBOUNDARYCAO_H +#define MON_CREATEBOUNDARYCAO_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(HOMARD_Boundary) + +#include "ui_CreateBoundaryCAO.h" +#include + +class MonCreateCase; +class HOMARD_EXPORT MonCreateBoundaryCAO : public QDialog, public Ui_CreateBoundaryCAO +{ + Q_OBJECT + +public: + MonCreateBoundaryCAO( MonCreateCase* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString caseName, QString BoundaryName ); + ~MonCreateBoundaryCAO(); + virtual void setGroups (QStringList listGroup); + +protected : + + MonCreateCase *_parent; + + QString _aName; + QString _aCaseName; + + + HOMARD::HOMARD_Boundary_var aBoundary; + HOMARD::HOMARD_Gen_var myHomardGen; + + QStringList _listeGroupesBoundary; + + virtual void AssocieLesGroupes(); + virtual void InitConnect(); + virtual void SetNewName(); + +public slots: + + virtual void SetCAOFile(); + virtual void SetFiltrage(); + virtual void PushOnOK(); + virtual bool PushOnApply(); + virtual void PushOnHelp(); +}; + +#endif // MON_CREATEBOUNDARYCAO_H diff --git a/src/ADAPTGUI/MonCreateBoundaryDi.cxx b/src/ADAPTGUI/MonCreateBoundaryDi.cxx new file mode 100644 index 000000000..f61b7653f --- /dev/null +++ b/src/ADAPTGUI/MonCreateBoundaryDi.cxx @@ -0,0 +1,211 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonCreateBoundaryDi.h" +#include "MonCreateListGroup.h" +#include "MonCreateCase.h" + +#include +#include + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include + +using namespace std; + +// ------------------------------------------------------------------------------- +MonCreateBoundaryDi::MonCreateBoundaryDi(MonCreateCase* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen0, + QString caseName, QString aName) +// --------------------------------------------------------------------------------- +/* Constructs a MonCreateBoundaryDi */ + : + QDialog(0), Ui_CreateBoundaryDi(), + _parent(parent), _aName(aName), + myHomardGen(HOMARD::HOMARD_Gen::_duplicate(myHomardGen0)), + _aCaseName(caseName) + { + MESSAGE("Constructeur") ; + setupUi(this); + setModal(modal); + InitConnect(); + + if ( _aName == QString("") ) {SetNewName();}; + } + +// ------------------------------------------------------------------------ +MonCreateBoundaryDi::~MonCreateBoundaryDi() +// ------------------------------------------------------------------------ +{ + // no need to delete child widgets, Qt does it all for us +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryDi::InitConnect() +// ------------------------------------------------------------------------ +{ + connect( PushFichier, SIGNAL(pressed()), this, SLOT(SetMeshFile())); + connect( buttonOk, SIGNAL(pressed()), this, SLOT( PushOnOK())); + connect( buttonApply, SIGNAL(pressed()), this, SLOT( PushOnApply())); + connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); + connect( buttonHelp, SIGNAL(pressed()), this, SLOT( PushOnHelp())); + connect( CBGroupe, SIGNAL(stateChanged(int)), this, SLOT( SetFiltrage())); +} + +// ------------------------------------------------------------------------ +bool MonCreateBoundaryDi::PushOnApply() +// ------------------------------------------------------------------------ +// Appele lorsque l'un des boutons Ok ou Apply est presse +// +{ +// Verifications + + QString aName=LEName->text().trimmed(); + if (aName=="") { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_BOUN_NAME") ); + return false; + } + +// Le maillage de la frontiere discrete + QString aMeshFile=LEFileName->text().trimmed(); + if (aMeshFile ==QString("")) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_BOUN_MESH") ); + return false; + } + +// Le nom du maillage de la frontiere discrete + QString aMeshName = HOMARD_QT_COMMUN::LireNomMaillage(aMeshFile); + if (aMeshName == "" ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_MED_FILE_2") ); + return false; + } + +// Creation de l'objet CORBA si ce n'est pas deja fait sous le meme nom + if ( _aName != aName ) + { + try + { + _aName=aName; + aBoundary=myHomardGen->CreateBoundaryDi(CORBA::string_dup(_aName.toStdString().c_str()), aMeshName.toStdString().c_str(), aMeshFile.toStdString().c_str()); + _parent->AddBoundaryDi(_aName); + aBoundary->SetCaseCreation(_aCaseName.toStdString().c_str()); + } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + return false; + } + } + +// Les groupes + AssocieLesGroupes(); + + HOMARD_UTILS::updateObjBrowser(); + return true; +} + + +// ------------------------------------------------------------------------ +void MonCreateBoundaryDi::PushOnOK() +// ------------------------------------------------------------------------ +{ + if (PushOnApply()) this->close(); + if ( _parent ) { _parent->raise(); _parent->activateWindow(); }; +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryDi::PushOnHelp() +// ------------------------------------------------------------------------ +{ + std::string LanguageShort = myHomardGen->GetLanguageShort(); + HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-discrete"), QString(LanguageShort.c_str())); +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryDi::AssocieLesGroupes() +// ------------------------------------------------------------------------ +{ + HOMARD::ListGroupType_var aSeqGroupe = new HOMARD::ListGroupType; + aSeqGroupe->length(_listeGroupesBoundary.size()); + QStringList::const_iterator it; + int i=0; + for (it = _listeGroupesBoundary.constBegin(); it != _listeGroupesBoundary.constEnd(); it++) + aSeqGroupe[i++]=(*it).toStdString().c_str(); + aBoundary->SetGroups(aSeqGroupe); + +} + +// ------------------------------------------------- +void MonCreateBoundaryDi::SetNewName() +// -------------------------------------------------- +{ + + HOMARD::listeBoundarys_var MyObjects = myHomardGen->GetAllBoundarysName(); + int num = 0; QString aName=""; + while (aName == QString("") ) + { + aName.setNum(num+1) ; + aName.insert(0, QString("Boun_")) ; + for ( int i=0; ilength(); i++) + { + if ( aName == QString(MyObjects[i])) + { + num ++ ; + aName = "" ; + break ; + } + } + } + LEName->setText(aName); +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryDi::SetMeshFile() +// ------------------------------------------------------------------------ +{ + QString aMeshFile = HOMARD_QT_COMMUN::PushNomFichier( false, QString("med") ); + if (!(aMeshFile.isEmpty())) LEFileName->setText(aMeshFile); +} + +// ------------------------------------------------------------------------ +void MonCreateBoundaryDi::setGroups (QStringList listGroup) +// ------------------------------------------------------------------------ +{ + _listeGroupesBoundary = listGroup; +} +// ------------------------------------------------------------------------ +void MonCreateBoundaryDi::SetFiltrage() +// // ------------------------------------------------------------------------ +{ + if (!CBGroupe->isChecked()) return; + if (_aCaseName.toStdString().c_str() == QString()) { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_BOUN_CASE") ); + return; + } + + MonCreateListGroup *aDlg = new MonCreateListGroup(NULL, this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), + _aCaseName, _listeGroupesBoundary) ; + aDlg->show(); +} + diff --git a/src/ADAPTGUI/MonCreateBoundaryDi.h b/src/ADAPTGUI/MonCreateBoundaryDi.h new file mode 100644 index 000000000..b81ef6a7c --- /dev/null +++ b/src/ADAPTGUI/MonCreateBoundaryDi.h @@ -0,0 +1,73 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_CREATEBOUNDARYDI_H +#define MON_CREATEBOUNDARYDI_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(HOMARD_Boundary) + +#include "ui_CreateBoundaryDi.h" +#include + +class MonCreateCase; +class HOMARD_EXPORT MonCreateBoundaryDi : public QDialog, public Ui_CreateBoundaryDi +{ + Q_OBJECT + +public: + MonCreateBoundaryDi( MonCreateCase* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString caseName, QString BoundaryName ); + ~MonCreateBoundaryDi(); + virtual void setGroups (QStringList listGroup); + +protected : + + MonCreateCase *_parent; + + QString _aName; + QString _aCaseName; + + + HOMARD::HOMARD_Boundary_var aBoundary; + HOMARD::HOMARD_Gen_var myHomardGen; + + QStringList _listeGroupesBoundary; + + virtual void AssocieLesGroupes(); + virtual void InitConnect(); + virtual void SetNewName(); + +public slots: + + virtual void SetMeshFile(); + virtual void SetFiltrage(); + virtual void PushOnOK(); + virtual bool PushOnApply(); + virtual void PushOnHelp(); +}; + +#endif // MON_CREATEBOUNDARYDI_H diff --git a/src/ADAPTGUI/MonCreateCase.cxx b/src/ADAPTGUI/MonCreateCase.cxx new file mode 100644 index 000000000..fa451efa7 --- /dev/null +++ b/src/ADAPTGUI/MonCreateCase.cxx @@ -0,0 +1,694 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonCreateCase.h" +#include "MonCreateBoundaryCAO.h" +#include "MonEditBoundaryCAO.h" +#include "MonCreateBoundaryAn.h" +#include "MonEditBoundaryAn.h" +#include "MonCreateBoundaryDi.h" +#include "MonEditBoundaryDi.h" +#include "HOMARD.hxx" + +#include +#include + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include + +#ifdef WIN32 +#include +#endif + +using namespace std; + +// ----------------------------------------------------------------------------------------- +/* Constructs a MonCreateCase + * Inherits from CasHomard + * Sets attributes to default values + */ +// ----------------------------------------------------------------------------------------- +MonCreateCase::MonCreateCase( bool modal, HOMARD::HOMARD_Gen_var myHomardGen0 ) + : + Ui_CreateCase(), + _aCaseName(""),_aDirName(""), + _ConfType(0), + _ExtType(0), + _Pyram(0) +{ + MESSAGE("Debut du constructeur de MonCreateCase"); + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); + setupUi(this); + setModal(modal); + InitConnect(); + + SetNewName() ; + + GBBoundaryC->setVisible(0); + GBBoundaryA->setVisible(0); + GBBoundaryD->setVisible(0); + + CBBoundaryA->setVisible(0); + CBBoundaryD->setVisible(0); + + GBAdvancedOptions->setVisible(0); + Comment->setVisible(0); + CBPyramid->setChecked(false); +// + adjustSize(); + +// MESSAGE("Fin du constructeur de MonCreateCase"); +} +// ------------------------------------------------------------------------ +MonCreateCase::~MonCreateCase() +// ------------------------------------------------------------------------ +{ + // no need to delete child widgets, Qt does it all for us +} +// ------------------------------------------------------------------------ +void MonCreateCase::InitConnect() +// ------------------------------------------------------------------------ +{ + connect( LEName, SIGNAL(textChanged(QString)), this, SLOT(CaseNameChanged())); + connect( PushDir, SIGNAL(pressed()), this, SLOT(SetDirName())); + connect( PushFichier, SIGNAL(pressed()), this, SLOT(SetFileName())); + + connect( RBConforme, SIGNAL(clicked()), this, SLOT(SetConforme())); + connect( RBNonConforme, SIGNAL(clicked()), this, SLOT(SetNonConforme())); + + connect( RBBoundaryNo, SIGNAL(clicked()), this, SLOT(SetBoundaryNo())); + connect( RBBoundaryCAO, SIGNAL(clicked()), this, SLOT(SetBoundaryCAO())); + connect( RBBoundaryNonCAO, SIGNAL(clicked()), this, SLOT(SetBoundaryNonCAO())); + + connect( PBBoundaryCAONew, SIGNAL(pressed()), this, SLOT(PushBoundaryCAONew())); + connect( PBBoundaryCAOEdit, SIGNAL(pressed()), this, SLOT(PushBoundaryCAOEdit()) ); + connect( PBBoundaryCAOHelp, SIGNAL(pressed()), this, SLOT(PushBoundaryCAOHelp()) ); + connect( CBBoundaryD, SIGNAL(stateChanged(int)), this, SLOT(SetBoundaryD())); + connect( PBBoundaryDiNew, SIGNAL(pressed()), this, SLOT(PushBoundaryDiNew())); + connect( PBBoundaryDiEdit, SIGNAL(pressed()), this, SLOT(PushBoundaryDiEdit()) ); + connect( PBBoundaryDiHelp, SIGNAL(pressed()), this, SLOT(PushBoundaryDiHelp()) ); + connect( CBBoundaryA, SIGNAL(stateChanged(int)), this, SLOT(SetBoundaryA())); + connect( PBBoundaryAnNew, SIGNAL(pressed()), this, SLOT(PushBoundaryAnNew())); + connect( PBBoundaryAnEdit, SIGNAL(pressed()), this, SLOT(PushBoundaryAnEdit()) ); + connect( PBBoundaryAnHelp, SIGNAL(pressed()), this, SLOT(PushBoundaryAnHelp()) ); + + connect( CBAdvanced, SIGNAL(stateChanged(int)), this, SLOT(SetAdvanced())); + connect( RBStandard, SIGNAL(clicked()), this, SLOT(SetStandard())); + connect( RBBox, SIGNAL(clicked()), this, SLOT(SetBox())); + connect( RBNC1NpA, SIGNAL(clicked()), this, SLOT(SetNC1NpA())); + connect( RBNCQuelconque, SIGNAL(clicked()), this, SLOT(SetNCQuelconque())); + + connect( RBMED, SIGNAL(clicked()), this, SLOT(SetMED())); + connect( RBSaturne, SIGNAL(clicked()), this, SLOT(SetSaturne())); + connect( RBSaturne2D, SIGNAL(clicked()), this, SLOT(SetSaturne2D())); + + connect( buttonOk, SIGNAL(pressed()), this, SLOT(PushOnOK())); + connect( buttonApply, SIGNAL(pressed()), this, SLOT(PushOnApply(0))); + connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); + connect( buttonHelp, SIGNAL(pressed()), this, SLOT(PushOnHelp())); +} +// ------------------------------------------------------------------------ +void MonCreateCase::InitBoundarys() +// ------------------------------------------------------------------------ +// Initialisation des menus avec les frontieres deja enregistrees +{ + MESSAGE("InitBoundarys"); +// Pour les frontieres analytiques : la colonne des groupes + HOMARD::ListGroupType_var _listeGroupesCas = aCase->GetGroups(); + QTableWidgetItem *__colItem = new QTableWidgetItem(); + __colItem->setText(QApplication::translate("CreateCase", "", 0)); + TWBoundary->setHorizontalHeaderItem(0, __colItem); + for ( int i = 0; i < _listeGroupesCas->length(); i++ ) + { + TWBoundary->insertRow(i); + TWBoundary->setItem( i, 0, new QTableWidgetItem(QString((_listeGroupesCas)[i]).trimmed())); + TWBoundary->item( i, 0 )->setFlags(Qt::ItemIsEnabled |Qt::ItemIsSelectable ); + } +// Pour les frontieres CAO : la liste a saisir +// Pour les frontieres discretes : la liste a saisir +// Pour les frontieres analytiques : les colonnes de chaque frontiere + HOMARD::HOMARD_Boundary_var myBoundary ; + HOMARD::listeBoundarys_var mesBoundarys = myHomardGen->GetAllBoundarysName(); +// MESSAGE("Nombre de frontieres enregistrees : "<length()); + for (int i=0; ilength(); i++) + { + myBoundary = myHomardGen->GetBoundary(mesBoundarys[i]); + int type_obj = myBoundary->GetType() ; + if ( type_obj==-1 ) { CBBoundaryCAO->addItem(QString(mesBoundarys[i])); } + else if ( type_obj==0 ) { CBBoundaryDi->addItem(QString(mesBoundarys[i])); } + else { AddBoundaryAn(QString(mesBoundarys[i])); } + } +// Ajustement + TWBoundary->resizeColumnsToContents(); + TWBoundary->resizeRowsToContents(); + TWBoundary->clearSelection(); +} +// ------------------------------- +bool MonCreateCase::PushOnApply(int option) +// -------------------------------- +{ + MESSAGE("PushOnApply"); + QString aCaseName=LEName->text().trimmed(); + if ( aCaseName == "" ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_CASE_NAME") ); + return false; + } + + QString aDirName=LEDirName->text().trimmed(); + if (aDirName == QString("")) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_CASE_DIRECTORY_1") ); + return false; + } + + if ( aDirName != _aDirName) + { QString CaseNameDir = myHomardGen->VerifieDir( aDirName.toStdString().c_str()) ; + if ( ( CaseNameDir != "" ) & ( CaseNameDir != aCaseName ) ) + { + QString texte ; + texte = QObject::tr("HOM_CASE_DIRECTORY_2") + CaseNameDir ; + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + texte ); + return false; + } + } + if (CHDIR(aDirName.toStdString().c_str()) != 0) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_CASE_DIRECTORY_3") ); + return false; + } + + QString aFileName=LEFileName->text().trimmed(); + if (aFileName ==QString("")) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_CASE_MESH") ); + return false; + } + + QString aMeshName = HOMARD_QT_COMMUN::LireNomMaillage(aFileName); + if (aMeshName == "" ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_MED_FILE_2") ); + return false; + } + +// On verifie qu'un groupe n'est pas associe a deux frontieres differentes + if (CBBoundaryA->isChecked()) + { + QStringList ListeGroup ; + QString NomGroup ; + int nbcol = TWBoundary->columnCount(); + int nbrow = TWBoundary->rowCount(); + for ( int col=1; col< nbcol; col++) + { + for ( int row=0; row< nbrow; row++) + { + if ( TWBoundary->item( row, col )->checkState() == Qt::Checked ) + { +// Nom du groupe + NomGroup = QString(TWBoundary->item(row, 0)->text()) ; +// MESSAGE("NomGroup "<CreateCase( \ + CORBA::string_dup(_aCaseName.toStdString().c_str()), \ + CORBA::string_dup(aMeshName.toStdString().c_str()), \ + CORBA::string_dup(aFileName.toStdString().c_str()) ); + } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + return false; + } + LEFileName->setReadOnly(true); + PushFichier->hide(); + InitBoundarys(); + } + +// Repertoire et type + aCase->SetDirName(aDirName.toStdString().c_str()); + _aDirName=aDirName; + aCase->SetConfType(_ConfType); + aCase->SetExtType(_ExtType); + +// Menage des eventuelles frontieres deja enregistrees + aCase->SupprBoundaryGroup() ; + + // Enregistrement et publication dans l'arbre d'etudes a la sortie definitive + if ( option > 0 ) + { + if (RBBoundaryCAO->isChecked()) + { + QString monBoundaryCAOName=CBBoundaryCAO->currentText(); + if (monBoundaryCAOName != "" ) + { + aCase->AddBoundary(monBoundaryCAOName.toStdString().c_str()); + } + } + if (CBBoundaryD->isChecked()) + { + QString monBoundaryDiName=CBBoundaryDi->currentText(); + if (monBoundaryDiName != "" ) + { + aCase->AddBoundary(monBoundaryDiName.toStdString().c_str()); + } + } + if (CBBoundaryA->isChecked()) + { + QString NomGroup ; + int nbcol = TWBoundary->columnCount(); + int nbrow = TWBoundary->rowCount(); + for ( int col=1; col< nbcol; col++) + { + for ( int row=0; row< nbrow; row++) + { + if ( TWBoundary->item( row, col )->checkState() == Qt::Checked ) + { + // Nom du groupe + NomGroup = QString(TWBoundary->item(row, 0)->text()) ; + // Nom de la frontiere + QTableWidgetItem *__colItem = new QTableWidgetItem(); + __colItem = TWBoundary->horizontalHeaderItem(col); + aCase->AddBoundaryGroup(QString(__colItem->text()).toStdString().c_str(), NomGroup.toStdString().c_str()); + } + } + } + } + } + + +// Options avancees + if (CBAdvanced->isChecked()) + { +// Autorisation des pyramides + if (CBPyramid->isChecked()) { _Pyram = 1 ; } + } + aCase->SetPyram(_Pyram); + + HOMARD_UTILS::updateObjBrowser(); + + return true; +} +// --------------------------- +void MonCreateCase::PushOnOK() +// --------------------------- +{ + bool bOK = PushOnApply(1); + if ( bOK ) this->close(); +} +//------------------------------ +void MonCreateCase::PushOnHelp() +//------------------------------- +{ + std::string LanguageShort = myHomardGen->GetLanguageShort(); + HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""), QString(LanguageShort.c_str())); +} +// --------------------------------- +void MonCreateCase::SetNewName() +// ------------------------------ +{ + HOMARD::listeCases_var MyCases = myHomardGen->GetAllCasesName(); + int num = 0; QString aCaseName=""; + while (aCaseName=="" ) + { + aCaseName.setNum(num+1) ; + aCaseName.insert(0, QString("Case_")) ; + for ( int i=0; ilength(); i++) + { + if ( aCaseName == QString((MyCases)[i])) + { + num ++ ; + aCaseName = "" ; + break ; + } + } + } + LEName->clear() ; + LEName->insert(aCaseName); +} + +// ------------------------------------------------------------------------ +void MonCreateCase::SetDirName() +// ------------------------------------------------------------------------ +{ + QString aDirName=QFileDialog::getExistingDirectory (); + if (!(aDirName.isEmpty()))LEDirName->setText(aDirName); +} +// ------------------------------------------------------------------------ +void MonCreateCase::SetFileName() +// ------------------------------------------------------------------------ +{ + QString fileName0 = LEFileName->text().trimmed(); + QString fileName = HOMARD_QT_COMMUN::PushNomFichier( false, QString("med") ) ; + if (fileName.isEmpty()) fileName = fileName0 ; + LEFileName->setText(fileName); +} +// ------------------------------------------------------------------------ +void MonCreateCase::SetConforme() +// ------------------------------------------------------------------------ +{ +// + _ConfType=0; + RBNC1NpA->setVisible(0); + RBNCQuelconque->setVisible(0); +// + adjustSize(); +} +// ------------------------------------------------------------------------ +void MonCreateCase::SetNonConforme() +// ------------------------------------------------------------------------ +{ +// + _ConfType=1; + RBNC1NpA->setVisible(1); + RBNCQuelconque->setVisible(1); +// + adjustSize(); +} +// ------------------------------------------------------------------------ +void MonCreateCase::SetStandard() +// ------------------------------------------------------------------------ +{ + if ( ( _ConfType == 0 ) || ( _ConfType == -1 ) ) { _ConfType = 0 ; } + else { _ConfType = 1 ; } + RBStandard->setChecked(true); +} +// ------------------------------------------------------------------------ +void MonCreateCase::SetBox() +// ------------------------------------------------------------------------ +{ + if ( ( _ConfType == 0 ) || ( _ConfType == -1 ) ) { _ConfType = -1 ; } + else { _ConfType = -2 ; } +} +// ------------------------------------------------------------------------ +void MonCreateCase::SetNC1NpA() +// ------------------------------------------------------------------------ +{ + _ConfType = 2; +} +// ------------------------------------------------------------------------ +void MonCreateCase::SetNCQuelconque() +// ------------------------------------------------------------------------ +{ + _ConfType = 3; +} +// ------------------------------------------------------------------------ +void MonCreateCase::SetMED() +// ------------------------------------------------------------------------ +{ + _ExtType = 0 ; + RBMED->setChecked(true); +} +// ------------------------------------------------------------------------ +void MonCreateCase::SetSaturne() +// ------------------------------------------------------------------------ +{ + _ExtType = 1 ; + RBSaturne->setChecked(true); +} +// ------------------------------------------------------------------------ +void MonCreateCase::SetSaturne2D() +// ------------------------------------------------------------------------ +{ + _ExtType = 2 ; + RBSaturne2D->setChecked(true); +} +// ------------------------------------------------------------------------ +void MonCreateCase::SetBoundaryNo() +// ------------------------------------------------------------------------ +{ +// + GBBoundaryC->setVisible(0); + GBBoundaryA->setVisible(0); + GBBoundaryD->setVisible(0); + CBBoundaryD->setVisible(0); + CBBoundaryA->setVisible(0); +// + adjustSize(); +} +// ------------------------------------------------------------------------ +void MonCreateCase::SetBoundaryCAO() +// ------------------------------------------------------------------------ +{ +// + GBBoundaryC->setVisible(1); + GBBoundaryA->setVisible(0); + GBBoundaryD->setVisible(0); + CBBoundaryD->setVisible(0); + CBBoundaryA->setVisible(0); +// + adjustSize(); +} +// ------------------------------------------------------------------------ +void MonCreateCase::SetBoundaryNonCAO() +// ------------------------------------------------------------------------ +{ +// + GBBoundaryC->setVisible(0); + CBBoundaryD->setVisible(1); + CBBoundaryA->setVisible(1); +// + adjustSize(); +} +// ------------------------------------------------------------------------ +void MonCreateCase::AddBoundaryCAO(QString newBoundary) +// ------------------------------------------------------------------------ +{ + CBBoundaryCAO->insertItem(0,newBoundary); + CBBoundaryCAO->setCurrentIndex(0); +} +// ------------------------------------------------------------------------ +void MonCreateCase::PushBoundaryCAONew() +// ------------------------------------------------------------------------ +{ + MonCreateBoundaryCAO *BoundaryDlg = new MonCreateBoundaryCAO(this, true, + HOMARD::HOMARD_Gen::_duplicate(myHomardGen), _aCaseName, "") ; + BoundaryDlg->show(); +} +// ------------------------------------------------------------------------ +void MonCreateCase::PushBoundaryCAOEdit() +// ------------------------------------------------------------------------ +{ + if (CBBoundaryCAO->currentText() == QString("")) return; + MonEditBoundaryCAO *BoundaryDlg = new MonEditBoundaryCAO(this, true, + HOMARD::HOMARD_Gen::_duplicate(myHomardGen), _aCaseName, CBBoundaryCAO->currentText() ) ; + BoundaryDlg->show(); +} +// ------------------------------------------------------------------------ +void MonCreateCase::PushBoundaryCAOHelp() +// ------------------------------------------------------------------------ +{ + std::string LanguageShort = myHomardGen->GetLanguageShort(); + HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("CAO"), QString(LanguageShort.c_str())); +} +// ------------------------------------------------------------------------ +void MonCreateCase::SetBoundaryD() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetBoundaryD "); + if (CBBoundaryD->isChecked()) + { + bool bOK = PushOnApply(0); + if (bOK) { GBBoundaryD->setVisible(1); } + else { GBBoundaryD->setVisible(0); + CBBoundaryD->setChecked(0); + CBBoundaryD->setCheckState(Qt::Unchecked); } + } + else { GBBoundaryD->setVisible(0); } +// + adjustSize(); +} +// ------------------------------------------------------------------------ +void MonCreateCase::AddBoundaryDi(QString newBoundary) +// ------------------------------------------------------------------------ +{ + CBBoundaryDi->insertItem(0,newBoundary); + CBBoundaryDi->setCurrentIndex(0); +} +// ------------------------------------------------------------------------ +void MonCreateCase::PushBoundaryDiNew() +// ------------------------------------------------------------------------ +{ + MonCreateBoundaryDi *BoundaryDlg = new MonCreateBoundaryDi(this, true, + HOMARD::HOMARD_Gen::_duplicate(myHomardGen), _aCaseName, "") ; + BoundaryDlg->show(); +} +// ------------------------------------------------------------------------ +void MonCreateCase::PushBoundaryDiEdit() +// ------------------------------------------------------------------------ +{ + if (CBBoundaryDi->currentText() == QString("")) return; + MonEditBoundaryDi *BoundaryDlg = new MonEditBoundaryDi(this, true, + HOMARD::HOMARD_Gen::_duplicate(myHomardGen), _aCaseName, CBBoundaryDi->currentText() ) ; + BoundaryDlg->show(); +} +// ------------------------------------------------------------------------ +void MonCreateCase::PushBoundaryDiHelp() +// ------------------------------------------------------------------------ +{ + std::string LanguageShort = myHomardGen->GetLanguageShort(); + HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-discrete"), QString(LanguageShort.c_str())); +} +// ------------------------------------------------------------------------ +void MonCreateCase::SetBoundaryA() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetBoundaryA "); + if (CBBoundaryA->isChecked()) + { + bool bOK = PushOnApply(0); + if (bOK) { GBBoundaryA->setVisible(1); } + else { GBBoundaryA->setVisible(0); + CBBoundaryA->setChecked(0); + CBBoundaryA->setCheckState(Qt::Unchecked); } + } + else { GBBoundaryA->setVisible(0); } +// + adjustSize(); +} +// ------------------------------------------------------------------------ +void MonCreateCase::AddBoundaryAn(QString newBoundary) +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de AddBoundaryAn "); +// Ajout d'une nouvelle colonne + int nbcol = TWBoundary->columnCount(); +// MESSAGE("nbcol " << nbcol); + nbcol += 1 ; + TWBoundary->setColumnCount ( nbcol ) ; + QTableWidgetItem *__colItem = new QTableWidgetItem(); + __colItem->setText(QApplication::translate("CreateCase", newBoundary.toStdString().c_str(), 0)); + TWBoundary->setHorizontalHeaderItem(nbcol-1, __colItem); +/* TWBoundary->horizontalHeaderItem(nbcol-1)->setFlags( Qt::ItemIsSelectable|Qt::ItemIsEnabled );*/ +// Chaque case est a cocher + int nbrow = TWBoundary->rowCount(); +// MESSAGE("nbrow " << nbrow); + for ( int i = 0; i < nbrow; i++ ) + { + TWBoundary->setItem( i, nbcol-1, new QTableWidgetItem( QString ("") ) ); + TWBoundary->item( i, nbcol-1 )->setFlags( 0 ); + TWBoundary->item( i, nbcol-1 )->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled ); + TWBoundary->item( i, nbcol-1 )->setCheckState( Qt::Unchecked ); + } + TWBoundary->resizeColumnToContents(nbcol-1); +// TWBoundary->resizeRowsToContents(); +// MESSAGE("Fin de AddBoundaryAn "); +} +// ------------------------------------------------------------------------ +void MonCreateCase::PushBoundaryAnNew() +// ------------------------------------------------------------------------ +{ + MonCreateBoundaryAn *BoundaryDlg = new MonCreateBoundaryAn(this, true, + HOMARD::HOMARD_Gen::_duplicate(myHomardGen), _aCaseName) ; + BoundaryDlg->show(); +} +// ------------------------------------------------------------------------ +void MonCreateCase::PushBoundaryAnEdit() +// ------------------------------------------------------------------------ +{ + QString nom=""; + int nbcol = TWBoundary->columnCount(); + for ( int i = 1; i < nbcol; i++ ) + { + QTableWidgetItem *__colItem = new QTableWidgetItem(); + __colItem = TWBoundary->horizontalHeaderItem(i); + nom = QString(__colItem->text()) ; + MESSAGE("nom "<show(); } + } +} +// ------------------------------------------------------------------------ +void MonCreateCase::PushBoundaryAnHelp() +// ------------------------------------------------------------------------ +{ + std::string LanguageShort = myHomardGen->GetLanguageShort(); + HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-analytique"), QString(LanguageShort.c_str())); +} +// ------------------------------------------------------------------------ +void MonCreateCase::CaseNameChanged() +// ------------------------------------------------------------------------ +{ + if (_aCaseName != LEName->text().trimmed()) + { + LEFileName->setReadOnly(false); + PushFichier->show(); + } +} +// ------------------------------------------------------------------------ +void MonCreateCase::SetAdvanced() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetAdvanced "); + if (CBAdvanced->isChecked()) + { GBAdvancedOptions->setVisible(1); + GBConforme->setVisible(1); + RBStandard->setVisible(1); + RBBox->setVisible(1); + if ( ( _ConfType == 0 ) || ( _ConfType == -1 ) ) + { RBNC1NpA->setVisible(0); + RBNCQuelconque->setVisible(0);} + else + { RBNC1NpA->setVisible(1); + RBNCQuelconque->setVisible(1);} + GBFormat->setVisible(1); + RBMED->setVisible(1); + RBSaturne2D->setVisible(1); + } + else + { GBAdvancedOptions->setVisible(0); + CBPyramid->setChecked(false); + _Pyram = 0 ; + SetStandard() ; + SetMED() ; + } +// + adjustSize(); +} diff --git a/src/ADAPTGUI/MonCreateCase.h b/src/ADAPTGUI/MonCreateCase.h new file mode 100644 index 000000000..ab1a2f4c1 --- /dev/null +++ b/src/ADAPTGUI/MonCreateCase.h @@ -0,0 +1,102 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_CREATECASE_H +#define MON_CREATECASE_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(HOMARD_Cas) + +#include "ui_CreateCase.h" +#include + +class HOMARD_EXPORT MonCreateCase : public QDialog, public Ui_CreateCase +{ + Q_OBJECT + +public: + MonCreateCase( bool modal, HOMARD::HOMARD_Gen_var myHomardGen ); + ~MonCreateCase(); + + void AddBoundaryCAO(QString newBoundary); + void AddBoundaryAn(QString newBoundary); + void AddBoundaryDi(QString newBoundary); + +protected : + QString _aCaseName; + QString _aDirName; + + int _ConfType; + int _ExtType; + + int _Pyram; + + HOMARD::HOMARD_Cas_var aCase ; + HOMARD::HOMARD_Gen_var myHomardGen; + + virtual void InitConnect(); + virtual void InitBoundarys(); + virtual void SetNewName(); + +public slots: + virtual void SetDirName(); + virtual void SetFileName(); + + virtual void SetConforme(); + virtual void SetNonConforme(); + virtual void SetStandard(); + virtual void SetBox(); + virtual void SetNC1NpA(); + virtual void SetNCQuelconque(); + + virtual void SetMED(); + virtual void SetSaturne(); + virtual void SetSaturne2D(); + + virtual void SetBoundaryNo(); + virtual void SetBoundaryCAO(); + virtual void SetBoundaryNonCAO(); + virtual void PushBoundaryCAONew(); + virtual void PushBoundaryCAOEdit(); + virtual void PushBoundaryCAOHelp(); + virtual void SetBoundaryD(); + virtual void PushBoundaryDiNew(); + virtual void PushBoundaryDiEdit(); + virtual void PushBoundaryDiHelp(); + virtual void SetBoundaryA(); + virtual void PushBoundaryAnNew(); + virtual void PushBoundaryAnEdit(); + virtual void PushBoundaryAnHelp(); + + virtual void SetAdvanced(); + + virtual void PushOnOK(); + virtual bool PushOnApply(int option); + virtual void PushOnHelp(); + + virtual void CaseNameChanged(); +}; + +#endif // MON_CREATECASE_H diff --git a/src/ADAPTGUI/MonCreateHypothesis.cxx b/src/ADAPTGUI/MonCreateHypothesis.cxx new file mode 100644 index 000000000..6b03def0e --- /dev/null +++ b/src/ADAPTGUI/MonCreateHypothesis.cxx @@ -0,0 +1,945 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonCreateHypothesis.h" +#include "MonCreateListGroup.h" +#include "MonCreateIteration.h" +#include "MonCreateZone.h" +#include "MonEditZone.h" + +#include +#include + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include + +using namespace std; + +// ------------------------------------------------------------------------------- +MonCreateHypothesis::MonCreateHypothesis(MonCreateIteration* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen0, + QString Name, + QString caseName, QString aFieldFile) +// --------------------------------------------------------------------------------- +/* Constructs a MonCreateHypothesis */ + : + QScrollArea(0), Ui_CreateHypothesis(), + _parent(parent), _Name(Name), + _aCaseName(caseName), _aFieldFile(aFieldFile), + _aFieldName(""), + _aTypeAdap(-2), _aTypeRaff(1), _aTypeDera(0), + _TypeThR(3), _ThreshR(0), + _TypeThC(0), _ThreshC(0), + _UsField(0), _UsCmpI(0), _TypeFieldInterp(0), + _NivMax(-1), + _DiamMin(-1.), + _AdapInit(0), + _ExtraOutput(1) + +{ + MESSAGE("Constructeur") ; + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); + setupUi(this); + if ( modal ) { setWindowModality(Qt::WindowModal); } + else { setWindowModality(Qt::NonModal); } + setWindowFlags( Qt::WindowStaysOnTopHint ) ; + InitConnect(); + + SetNewName(); + if (_aFieldFile != QString("")) + { RBChamp->setChecked(1); + SetChamp(); + } + else + { RBUniforme->setChecked(1); + SetUniforme(); + } + SetFieldNo(); + GBAdvancedOptions->setVisible(0); + CBOutputLevel->setChecked(false); + CBOutputQuality->setChecked(false); + CBOutputDiameter->setChecked(false); + CBOutputParent->setChecked(false); + CBOutputVoisins->setChecked(false); + _ExtraOutput = 1 ; +// + adjustSize(); +} + +// ------------------------------------------------------------------------ +MonCreateHypothesis::~MonCreateHypothesis() +// ------------------------------------------------------------------------ +{ + // no need to delete child widgets, Qt does it all for us +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::InitConnect() +// ------------------------------------------------------------------------ +{ + connect( RBUniforme, SIGNAL(clicked()), this, SLOT(SetUniforme())); + connect( RBChamp, SIGNAL(clicked()), this, SLOT(SetChamp())); + connect( RBZone, SIGNAL(clicked()), this, SLOT(SetZone())); + connect( RBUniRaff, SIGNAL(clicked()), this, SLOT(SetUniRaff())); + connect( RBUniDera, SIGNAL(clicked()), this, SLOT(SetUniDera())); + + connect( CBFieldName, SIGNAL(activated(int)), this, SLOT( SetFieldName())); + connect( RBRPE, SIGNAL(clicked()), this, SLOT(SetRPE())); + connect( RBRRel, SIGNAL(clicked()), this, SLOT(SetRRel())); + connect( RBRMuSigma, SIGNAL(clicked()), this, SLOT(SetRMS())); + connect( RBRAbs, SIGNAL(clicked()), this, SLOT(SetRAbs())); + connect( RBRNo, SIGNAL(clicked()), this, SLOT(SetRNo())); + connect( RBCPE, SIGNAL(clicked()), this, SLOT(SetCPE())); + connect( RBCRel, SIGNAL(clicked()), this, SLOT(SetCRel())); + connect( RBCMuSigma, SIGNAL(clicked()), this, SLOT(SetCMS())); + connect( RBCAbs, SIGNAL(clicked()), this, SLOT(SetCAbs())); + connect( RBCNo, SIGNAL(clicked()), this, SLOT(SetCNo())); + connect( RBL2, SIGNAL(clicked()), this, SLOT(SetUCL2())); + connect( RBInf, SIGNAL(clicked()), this, SLOT(SetUCInf())); + connect( CBJump, SIGNAL(stateChanged(int)), this, SLOT(SetUseField())); + connect( PBZoneNew, SIGNAL(pressed()), this, SLOT(PushZoneNew())); + connect( PBZoneEdit, SIGNAL(pressed()), this, SLOT(PushZoneEdit()) ); + connect( PBZoneDelete, SIGNAL(pressed()), this, SLOT(PushZoneDelete()) ); + connect( CBGroupe, SIGNAL(stateChanged(int)), this, SLOT(SetFiltrage())); + + connect( RBFieldNo, SIGNAL(clicked()), this, SLOT(SetFieldNo())); + connect( RBFieldAll, SIGNAL(clicked()), this, SLOT(SetFieldAll())); + connect( RBFieldChosen,SIGNAL(clicked()), this, SLOT(SetFieldChosen())); + + connect( CBAdvanced, SIGNAL(stateChanged(int)), this, SLOT(SetAdvanced())); + connect( RBAIN, SIGNAL(clicked()), this, SLOT(SetAIN())); + connect( RBAIR, SIGNAL(clicked()), this, SLOT(SetAIR())); + connect( RBAID, SIGNAL(clicked()), this, SLOT(SetAID())); + + connect( buttonOk, SIGNAL(pressed()), this, SLOT( PushOnOK())); + connect( buttonApply, SIGNAL(pressed()), this, SLOT( PushOnApply())); + connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); + connect( buttonHelp, SIGNAL(pressed()), this, SLOT( PushOnHelp())); +} + +// ------------------------------------------------------------------------ +bool MonCreateHypothesis::PushOnApply() +// ------------------------------------------------------------------------ +// Appele lorsque l'un des boutons Ok ou Apply est presse +// +{ +// Verifications + + + if (LEName->text().trimmed()=="") { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_HYPO_NAME") ); + return false; + } + + if (VerifieZone() == false) return false; + if (VerifieComposant() == false) return false; + +// Creation de l'objet CORBA si ce n'est pas deja fait sous le meme nom + if (LEName->text().trimmed() != _Name) + { + _Name=LEName->text().trimmed(); + try + { + aHypothesis=myHomardGen->CreateHypothesis(CORBA::string_dup(_Name.toStdString().c_str()) ); + _parent->addHypothese(_Name); + } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QString(CORBA::string_dup(S_ex.details.text)) ); + return false; + } + } + +// Mise en place des attributs + if ( _aTypeAdap == -1 ) + { + int TypeRaffDera ; + if ( _aTypeRaff == 1 ) { TypeRaffDera = 1 ; } + else { TypeRaffDera = -1 ; } + aHypothesis->SetUnifRefinUnRef(TypeRaffDera); + } + aHypothesis->SetTypeFieldInterp(_TypeFieldInterp); + aHypothesis->SetCaseCreation(_aCaseName.toStdString().c_str()); + + AssocieLesZones(); + AssocieComposants(); + AssocieLesGroupes(); + AssocieFieldInterp(); + +// Options avancees + if (CBAdvanced->isChecked()) + { +// Enregistrement du niveau maximal + _NivMax = SpinBoxNivMax->value() ; + aHypothesis->SetNivMax(_NivMax); +// Enregistrement du diametre minimal + _DiamMin = doubleSpinBoxDiamMin->value() ; + aHypothesis->SetDiamMin(_DiamMin); +// Enregistrement de l'intialisation de l'adaptation + aHypothesis->SetAdapInit(_AdapInit); +// Sortie optionnelle des niveaux de raffinement, des diametres, des qualites + _ExtraOutput = 1 ; + if (CBOutputLevel->isChecked()) { _ExtraOutput = 2 ; } + if (CBOutputQuality->isChecked()) { _ExtraOutput = 3*_ExtraOutput ; } + if (CBOutputDiameter->isChecked()) { _ExtraOutput = 5*_ExtraOutput ; } + if (CBOutputParent->isChecked()) { _ExtraOutput = 7*_ExtraOutput ; } + if (CBOutputVoisins->isChecked()) { _ExtraOutput = 11*_ExtraOutput ; } + aHypothesis->SetExtraOutput(_ExtraOutput); + } + + HOMARD_UTILS::updateObjBrowser() ; + + return true; +} + + +// ------------------------------------------------------------------------ +void MonCreateHypothesis::PushOnOK() +// ------------------------------------------------------------------------ +{ + if (PushOnApply()) this->close(); + if ( _parent ) { _parent->raise(); _parent->activateWindow(); }; +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::PushOnHelp() +// ------------------------------------------------------------------------ +{ + std::string LanguageShort = myHomardGen->GetLanguageShort(); + HOMARD_UTILS::PushOnHelp(QString("gui_create_hypothese.html"), QString(""), QString(LanguageShort.c_str())); +} +// ------------------------------------------------- +void MonCreateHypothesis::SetNewName() +// -------------------------------------------------- +{ + + HOMARD::listeHypotheses_var MyObjects = myHomardGen->GetAllHypothesesName(); + int num = 0;// + QString aName=""; + while (aName=="" ) + { + aName.setNum(num+1) ; + aName.insert(0, QString("Hypo_")) ; + for ( int i=0; ilength(); i++) + { + if ( aName == QString(MyObjects[i])) + { + num ++ ; + aName = "" ; + break ; + } + } + } + LEName->setText(aName); +} + +// +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetUniforme() +// ------------------------------------------------------------------------ +{ + GBFieldManagement->setVisible(0); + if ( _TypeFieldInterp == 0 ) { GBFieldFile->setVisible(0); } + else { GBFieldFile->setVisible(1); } + GBAreaManagement->setVisible(0); + GBUniform->setVisible(1); + + _aTypeAdap = -1 ; +// + adjustSize(); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetChamp() +// ------------------------------------------------------------------------ +{ + if (_aFieldFile == QString("")) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_HYPO_FIELD_FILE") ); + close(); + if ( _parent ) { _parent->raise(); _parent->activateWindow(); }; + return; + } + LEFieldFile->setText(_aFieldFile); + LEFieldFile->setReadOnly(1); + InitFields(); + GBUniform->setVisible(0); + GBAreaManagement->setVisible(0); + GBFieldManagement->setVisible(1); + GBFieldFile->setVisible(1); + + GBUniform->adjustSize(); + GBAreaManagement->adjustSize(); + GBFieldManagement->adjustSize(); + GBFieldFile->adjustSize(); + + _aTypeAdap = 1 ; +// + adjustSize(); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetZone() +// ------------------------------------------------------------------------ +{ + GetAllZones(); + GBUniform->setVisible(0); + GBFieldManagement->setVisible(0); + if ( _TypeFieldInterp == 0 ) { GBFieldFile->setVisible(0); } + else { GBFieldFile->setVisible(1); } + GBAreaManagement->setVisible(1); + + _aTypeRaff = 1 ; + _aTypeDera = 0 ; + _aTypeAdap = 0 ; +// + adjustSize(); +} + +// ------------------------------------------------------------------------ +void MonCreateHypothesis::PushZoneNew() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de MonCreateHypothesis::PushZoneNew") + MonCreateZone *aDlg = new MonCreateZone(this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), _aCaseName) ; + aDlg->show(); +} + +// ------------------------------------------------------------------------ +void MonCreateHypothesis::PushZoneEdit() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de MonCreateHypothesis::PushZoneEdit") + int colonne = TWZone->currentColumn(); + QTableWidgetItem * monItem = TWZone->currentItem(); + if (colonne !=2 || monItem == NULL) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_HYPO_ZONE_1") ); + return; + } + QString zoneName = monItem->text().trimmed(); + MonEditZone *aDlg = new MonEditZone(this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), _aCaseName, zoneName) ; + aDlg->show(); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::PushZoneDelete() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de MonCreateHypothesis::PushZoneDelete") + QMessageBox::warning( 0, QObject::tr("HOM_WARNING"), + QObject::tr("HOM_INACTIVE_BUTTON") ); + return; +} + +// ------------------------------------------------------------------------ +void MonCreateHypothesis::GetAllZones() +// ------------------------------------------------------------------------ +// Recuperation de toutes les zones enregistrees dans l'arbre d'etude +// et affichage dans le tableau +// Par defaut, aucune n'est selectionnee +{ + MESSAGE("Debut de GetAllZones") ; + HOMARD::listeZones_var mesZones = myHomardGen->GetAllZonesName(); + int nbrow=TWZone->rowCount(); + for ( int row=0; row< nbrow; row++) + { + TWZone->removeRow(row); + } + TWZone->setRowCount(0); + int row=0; + for (int i=0; ilength(); i++) + { + TWZone->insertRow(row); +// + TWZone->setItem( row, 0, new QTableWidgetItem( QString ("") ) ); + TWZone->item( row, 0 )->setFlags( 0 ); + TWZone->item( row, 0 )->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled ); + TWZone->item( row, 0 )->setCheckState( Qt::Unchecked ); +// + TWZone->setItem( row, 1, new QTableWidgetItem( QString ("") ) ); + TWZone->item( row, 1 )->setFlags( 0 ); + TWZone->item( row, 1 )->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled ); + TWZone->item( row, 1 )->setCheckState( Qt::Unchecked ); +// + TWZone->setItem( row, 2, new QTableWidgetItem(QString(mesZones[i]).trimmed())); + TWZone->item( row, 2 )->setFlags(Qt::ItemIsEnabled |Qt::ItemIsSelectable ); +// + row += 1; + } + TWZone->resizeColumnsToContents(); + TWZone->resizeRowsToContents(); + TWZone->clearSelection(); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::addZoneinTWZone(QString newZone) +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de addZoneinTWZone") ; + int row = TWZone->rowCount() ; +// Par defaut, on suppose qu'une nouvelle zone est destinee au raffinement + TWZone->setRowCount( row+1 ); +// + TWZone->setItem( row, 0, new QTableWidgetItem( QString ("") ) ); + TWZone->item( row, 0 )->setFlags( Qt::ItemIsEditable|Qt::ItemIsUserCheckable|Qt::ItemIsEnabled ); + TWZone->item( row, 0 )->setCheckState( Qt::Checked ); +// + TWZone->setItem( row, 1, new QTableWidgetItem( QString ("") ) ); + TWZone->item( row, 1 )->setFlags( Qt::ItemIsEditable|Qt::ItemIsUserCheckable|Qt::ItemIsEnabled ); + TWZone->item( row, 1 )->setCheckState( Qt::Unchecked ); +// + TWZone->setItem( row, 2, new QTableWidgetItem( newZone ) ); + TWZone->scrollToItem( TWZone->item( row, 2 ) ); +// + TWZone->resizeRowsToContents(); + TWZone->resizeColumnToContents(1); + TWZone->clearSelection(); +// + TWZone->item( row, 2 )->setFlags( Qt::ItemIsEnabled |Qt::ItemIsSelectable ); +} +// ------------------------------------------------------------------------ +QStringList MonCreateHypothesis::GetZonesChecked() +// ------------------------------------------------------------------------ +// Retourne les zones enregistrees +{ + MESSAGE("Debut de GetZonesChecked") ; + QStringList ListeZone ; +// On ne peut pas avoir selectionne les deux options + int Pbm = 0 ; + for ( int row=0; row< TWZone->rowCount(); row++) + { + if ( ( TWZone->item( row, 0 )->checkState() == Qt::Checked ) && ( TWZone->item( row, 1 )->checkState() == Qt::Checked ) ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_HYPO_ZONE_3") ); + Pbm = 1 ; + } + } +// Si tout va bien, on affecte +// Attention, on insere en tete, donc on commence d'inserer le type, psui le nom de la zone + if ( Pbm == 0 ) + { + QString Raff = "1" ; + QString Dera = "-1" ; + for ( int row=0; row< TWZone->rowCount(); row++) + { +// MESSAGE ("row "<item(row, 2)->text().toStdString()); +// En raffinement : + if ( TWZone->item(row,0)->checkState() == Qt::Checked ) + { ListeZone.insert(0, Raff) ; + ListeZone.insert(0, QString(TWZone->item(row, 2)->text()) ) ; } +// En deraffinement : + if ( TWZone->item(row,1)->checkState() == Qt::Checked ) + { ListeZone.insert(0, Dera) ; + ListeZone.insert(0, QString(TWZone->item(row, 2)->text()) ) ; } + } + MESSAGE("Fin de GetZonesChecked ; longueur de ListeZone : "<rowCount(); row++) + if ( TWCMP->item( row, 0 )->checkState() == Qt::Checked ) + ListeComposant.insert(0, QString(TWCMP->item(row, 1)->text()) ) ; + // Choix du texte des radio-boutons selon 1 ou plusieurs composantes + if ( ListeComposant.count() < 2 ) + { RBL2->setText(QObject::tr("HOM_HYPO_NORM_ABS")); + RBInf->setText(QObject::tr("HOM_HYPO_NORM_REL")); + } + else + { RBL2->setText(QObject::tr("HOM_HYPO_NORM_L2")); + RBInf->setText(QObject::tr("HOM_HYPO_NORM_INF")); + } + return ListeComposant ; +// +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::AssocieFieldInterp() +// ------------------------------------------------------------------------ +{ + if ( _TypeFieldInterp != 2 ) return; + for ( int row=0; row< TWField->rowCount(); row++) + { + if ( TWField->item( row, 0 )->checkState() == Qt::Checked ) + { + aHypothesis->AddFieldInterp(TWField->item(row, 1)->text().toStdString().c_str()); + } + } +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetUniRaff() +// ------------------------------------------------------------------------ +{ + _aTypeRaff = 1 ; + _aTypeDera = 0 ; +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetUniDera() +// ------------------------------------------------------------------------ +{ + _aTypeRaff = 0 ; + _aTypeDera = 1 ; +} + +// ------------------------------------------------------------------------ +void MonCreateHypothesis::InitFields() +// ------------------------------------------------------------------------ +{ + CBFieldName->clear(); + std::list listeChamp = HOMARD_QT_COMMUN::GetListeChamps(QString(_aFieldFile) ); + // Mise en place de la liste dans le menu pour l'indicateur d'erreur + std:: list::const_iterator it; + for ( it=listeChamp.begin() ; it != listeChamp.end(); it++) + { + CBFieldName->insertItem(0,QString(*it)); + } + SetFieldName(); +} +// --------------------------------------- +void MonCreateHypothesis::SetFieldName() +// ------------------------------------------- +{ + MESSAGE("Debut de SetFieldName"); + _aFieldName=CBFieldName->currentText(); + if (QString(_aFieldFile) == QString("") || QString(_aFieldName) == QString("") ) { return; } + + int nbrow= TWCMP->rowCount() ; + for ( int row=0; row < nbrow ; row++) + { + TWCMP->removeRow(row); + } + TWCMP->setRowCount(0); + //TWCMP->resizeRowsToContents(); + + std::list maListe =HOMARD_QT_COMMUN::GetListeComposants(_aFieldFile, _aFieldName); + std::list::const_iterator it; + for ( it=maListe.begin() ; it != maListe.end(); it++) + { + TWCMP->insertRow(0); + TWCMP->setItem( 0, 0, new QTableWidgetItem( QString ("") ) ); + TWCMP->item( 0, 0 )->setFlags( 0 ); + TWCMP->item( 0, 0 )->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled ); + TWCMP->item( 0, 0 )->setCheckState( Qt::Checked ); + TWCMP->setItem( 0, 1, new QTableWidgetItem(QString((*it)).trimmed())); + TWCMP->item( 0, 1 )->setFlags( Qt::ItemIsEnabled |Qt::ItemIsSelectable ); + } + TWCMP->resizeColumnsToContents(); + TWCMP->resizeRowsToContents(); + TWCMP->clearSelection(); + // Choix du texte des radio-boutons selon 1 ou plusieurs composantes + if ( TWCMP->rowCount() == 1 ) + { RBL2->setText(QObject::tr("HOM_HYPO_NORM_ABS")); + RBInf->setText(QObject::tr("HOM_HYPO_NORM_REL")); + } + else + { RBL2->setText(QObject::tr("HOM_HYPO_NORM_L2")); + RBInf->setText(QObject::tr("HOM_HYPO_NORM_INF")); + } + // Par defaut, on propose la valeur absolue / norme L2 + SetUCL2(); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetRPE() +// ------------------------------------------------------------------------ +{ + _aTypeRaff = 1 ; + _TypeThR = 3 ; + RBRPE->setChecked(true); + SpinBox_RPE->setEnabled(true); + SpinBox_RRel->setEnabled(false); + SpinBox_RAbs->setEnabled(false); + SpinBox_RMuSigma->setEnabled(false); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetRRel() +// ------------------------------------------------------------------------ +{ + _aTypeRaff = 1 ; + _TypeThR = 2 ; + RBRRel->setChecked(true); + SpinBox_RPE->setEnabled(false); + SpinBox_RRel->setEnabled(true); + SpinBox_RAbs->setEnabled(false); + SpinBox_RMuSigma->setEnabled(false); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetRAbs() +// ------------------------------------------------------------------------ +{ + _aTypeRaff = 1 ; + _TypeThR = 1 ; + RBRAbs->setChecked(true); + SpinBox_RPE->setEnabled(false); + SpinBox_RRel->setEnabled(false); + SpinBox_RAbs->setEnabled(true); + SpinBox_RMuSigma->setEnabled(false); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetRMS() +// ------------------------------------------------------------------------ +{ + _aTypeRaff = 1 ; + _TypeThR = 4 ; + RBRMuSigma->setChecked(true); + SpinBox_RPE->setEnabled(false); + SpinBox_RRel->setEnabled(false); + SpinBox_RAbs->setEnabled(false); + SpinBox_RMuSigma->setEnabled(true); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetRNo() +// ------------------------------------------------------------------------ +{ + _aTypeRaff = 0 ; + _TypeThR = 0; + RBRNo->setChecked(true); + SpinBox_RPE->setEnabled(false); + SpinBox_RRel->setEnabled(false); + SpinBox_RAbs->setEnabled(false); + SpinBox_RMuSigma->setEnabled(false); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetCPE() +// ------------------------------------------------------------------------ +{ + _aTypeDera = 1 ; + _TypeThC = 3 ; + RBCPE->setChecked(true); + SpinBox_CPE->setEnabled(true); + SpinBox_CRel->setEnabled(false); + SpinBox_CAbs->setEnabled(false); + SpinBox_CMuSigma->setEnabled(false); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetCRel() +// ------------------------------------------------------------------------ +{ + _aTypeDera = 1 ; + _TypeThC = 2 ; + RBCRel->setChecked(true); + SpinBox_CPE->setEnabled(false); + SpinBox_CRel->setEnabled(true); + SpinBox_CAbs->setEnabled(false); + SpinBox_CMuSigma->setEnabled(false); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetCAbs() +// ------------------------------------------------------------------------ +{ + _aTypeDera = 1 ; + _TypeThC = 1 ; + RBCAbs->setChecked(true); + SpinBox_CPE->setEnabled(false); + SpinBox_CRel->setEnabled(false); + SpinBox_CAbs->setEnabled(true); + SpinBox_CMuSigma->setEnabled(false); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetCMS() +// ------------------------------------------------------------------------ +{ + _aTypeDera = 1 ; + _TypeThC = 4 ; + RBCMuSigma->setChecked(true); + SpinBox_CPE->setEnabled(false); + SpinBox_CRel->setEnabled(false); + SpinBox_CAbs->setEnabled(false); + SpinBox_CMuSigma->setEnabled(true); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetCNo() +// ------------------------------------------------------------------------ +{ + _aTypeDera = 0 ; + _TypeThC = 0; + RBCNo->setChecked(true); + SpinBox_CPE->setEnabled(false); + SpinBox_CRel->setEnabled(false); + SpinBox_CAbs->setEnabled(false); + SpinBox_CMuSigma->setEnabled(false); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetUCL2() +// ------------------------------------------------------------------------ +{ + _UsCmpI = 0 ; + RBL2->setChecked(true); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetUCInf() +// ------------------------------------------------------------------------ +{ + if ( TWCMP->rowCount() == 1 ) { _UsCmpI = 2 ; } + else { _UsCmpI = 1 ; } + RBInf->setChecked(true); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetUseField() +// ------------------------------------------------------------------------ +{ + if ( CBJump->isChecked() ) { _UsField = 1 ; } + else { _UsField = 0 ; } +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetFiltrage() +// ------------------------------------------------------------------------ +{ + if (!CBGroupe->isChecked()) return; + MonCreateListGroup *aDlg = new MonCreateListGroup(this, NULL, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen),_aCaseName, _aListeGroupes) ; + aDlg->show(); +} + +// ------------------------------------------------------------------------ +void MonCreateHypothesis::setGroups(QStringList listGroup) +// ------------------------------------------------------------------------ +{ + _aListeGroupes=listGroup; +} +// ------------------------------------------------------------------------ +bool MonCreateHypothesis::VerifieZone() +// ------------------------------------------------------------------------ +{ + if ( _aTypeAdap != 0 ) return true; + MESSAGE("Debut de VerifieZone") ; + _aListeZone = GetZonesChecked() ; + MESSAGE(". Longueur de _aListeZone : "<<_aListeZone.count()) ; + if (_aListeZone.count() == 0) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_HYPO_ZONE_2") ); + return false; + } + MESSAGE("Fin de VerifieZone") ; + return true; +} +// ------------------------------------------------------------------------ +bool MonCreateHypothesis::VerifieComposant() +// ------------------------------------------------------------------------ +{ + if ( _aTypeAdap != 1 ) return true; + _aListeComposant = GetListCompChecked() ; + if (_aListeComposant.count() == 0) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_HYPO_COMP") ); + return false; + } + return true; +} + +// ------------------------------------------------------------------------ +void MonCreateHypothesis::AssocieLesZones() +// ------------------------------------------------------------------------ +{ + MESSAGE( "Debut de AssocieLesZones" ); + if ( _aTypeAdap != 0 ) return; + _aListeZone = GetZonesChecked() ; + MESSAGE(". Longueur de _aListeZone : "<<_aListeZone.count()) ; + QString Raff = "1" ; + int TypeUse ; + for ( int i=0 ; i< _aListeZone.count() ; i++ ) + { if ( _aListeZone[i+1] == Raff ) { TypeUse = 1 ; } + else { TypeUse = -1 ; } + aHypothesis->AddZone(_aListeZone[i].toStdString().c_str(), TypeUse); + i += 1 ; + } + MESSAGE( "Fin de AssocieLesZones" ); +}; +// ------------------------------------------------------------------------ +void MonCreateHypothesis::AssocieComposants() +// ------------------------------------------------------------------------ +{ + if ( _aTypeAdap != 1 ) return; + MESSAGE( "Dans AssocieComposants, _TypeThC : " << _TypeThC ); + MESSAGE( "Dans AssocieComposants, _TypeThR : " << _TypeThR ); + + _ThreshR = 0; + if ( _TypeThR == 1 ) { _ThreshR = SpinBox_RAbs->value();} + if ( _TypeThR == 2 ) { _ThreshR = SpinBox_RRel->value();} + if ( _TypeThR == 3 ) { _ThreshR = SpinBox_RPE->value(); } + if ( _TypeThR == 4 ) { _ThreshR = SpinBox_RMuSigma->value(); } + + _ThreshC = 0; + if ( _TypeThC == 1 ) { _ThreshC = SpinBox_CAbs->value();} + if ( _TypeThC == 2 ) { _ThreshC = SpinBox_CRel->value();} + if ( _TypeThC == 3 ) { _ThreshC = SpinBox_CPE->value(); } + if ( _TypeThC == 4 ) { _ThreshC = SpinBox_CMuSigma->value(); } + + _aFieldName=CBFieldName->currentText(); + aHypothesis->SetField(CORBA::string_dup(_aFieldName.toStdString().c_str()) ) ; + if ( _TypeThR > 0 ) { aHypothesis->SetRefinThr( _TypeThR, _ThreshR ) ; } + if ( _TypeThC > 0 ) { aHypothesis->SetUnRefThr( _TypeThC, _ThreshC ) ; } + aHypothesis->SetUseField( _UsField ) ; + aHypothesis->SetUseComp( _UsCmpI ) ; + _aListeComposant = GetListCompChecked() ; + for ( int i=0 ; i< _aListeComposant.count() ; i++ ) + { aHypothesis->AddComp(_aListeComposant[i].toStdString().c_str()); } +}; +// ------------------------------------------------------------------------ +void MonCreateHypothesis::AssocieLesGroupes() +// ------------------------------------------------------------------------ +{ + HOMARD::ListGroupType_var aSeqGroupe = new HOMARD::ListGroupType; + aSeqGroupe->length(_aListeGroupes.size()); + QStringList::const_iterator it; + int i=0; + for (it = _aListeGroupes.constBegin(); it != _aListeGroupes.constEnd(); it++) + aSeqGroupe[i++]=(*it).toStdString().c_str(); + aHypothesis->SetGroups(aSeqGroupe); + +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetFieldNo() +// ------------------------------------------------------------------------ +// Par defaut, on n'interpole rien +{ + if ( _aTypeAdap == 1 ) { GBFieldFile->setVisible(1); } + else { GBFieldFile->setVisible(0); } + TWField->setVisible(0); +// + _TypeFieldInterp = 0 ; +// + adjustSize(); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetFieldAll() +// ------------------------------------------------------------------------ +// Par defaut, on interpole tout +{ + if (_aFieldFile == QString("")) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_HYPO_FIELD_FILE") ); + close(); + if ( _parent ) { _parent->raise(); _parent->activateWindow(); }; + return; + } + LEFieldFile->setText(_aFieldFile); + LEFieldFile->setReadOnly(1); + GBFieldFile->setVisible(1); + TWField->setVisible(0); +// + _TypeFieldInterp = 1 ; +// + adjustSize(); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetFieldChosen() +// ------------------------------------------------------------------------ +{ + if (_aFieldFile == QString("")) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_HYPO_FIELD_FILE") ); + close(); + if ( _parent ) { _parent->raise(); _parent->activateWindow(); }; + return; + } + LEFieldFile->setText(_aFieldFile); + LEFieldFile->setReadOnly(1); + GBFieldFile->setVisible(1); + // Recuperation de la liste des champs contenus dans le fichier _aFieldFile + std::list listeChamp = HOMARD_QT_COMMUN::GetListeChamps(QString(_aFieldFile) ); + + // Initialisation de la table + TWField->clear(); + int nbrow=TWField->rowCount(); + for ( int row=0; row< nbrow; row++) + { + TWField->removeRow(row); + } + TWField->setRowCount(0); + std:: list::const_iterator it; + int row=0; + for ( it=listeChamp.begin() ; it != listeChamp.end(); it++) + { + TWField->insertRow(row); + TWField->setItem( row, 0, new QTableWidgetItem( QString ("") ) ); + TWField->item( row, 0 )->setFlags( 0 ); + TWField->item( row, 0 )->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled ); + TWField->item( row, 0 )->setCheckState( Qt::Unchecked ); + TWField->setItem( row, 1, new QTableWidgetItem(QString(*it).trimmed())); + TWField->item( row, 1 )->setFlags(Qt::ItemIsEnabled |Qt::ItemIsSelectable ); + row=row+1; + } + TWField->resizeColumnsToContents(); + TWField->resizeRowsToContents(); + TWField->clearSelection(); + TWField->setVisible(1); + + _TypeFieldInterp = 2 ; +// + adjustSize(); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetAdvanced() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetAdvanced "); + if (CBAdvanced->isChecked()) + { GBAdvancedOptions->setVisible(1); + if (_aFieldFile != QString("")) { GBAdapInit->setVisible(1) ; } + else { GBAdapInit->setVisible(0) ; } + } + else + { GBAdvancedOptions->setVisible(0); + _NivMax = -1 ; + _DiamMin = -1. ; + _AdapInit = 0 ; + CBOutputLevel->setChecked(false); + CBOutputQuality->setChecked(false); + CBOutputDiameter->setChecked(false); + CBOutputParent->setChecked(false); + CBOutputVoisins->setChecked(false); + _ExtraOutput = 1 ; + } +// + adjustSize(); +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetAIN() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetAIN "); + _AdapInit = 0 ; +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetAIR() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetAIR "); + _AdapInit = 1 ; +} +// ------------------------------------------------------------------------ +void MonCreateHypothesis::SetAID() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetAID "); + _AdapInit = -1 ; +} diff --git a/src/ADAPTGUI/MonCreateHypothesis.h b/src/ADAPTGUI/MonCreateHypothesis.h new file mode 100644 index 000000000..929ee30aa --- /dev/null +++ b/src/ADAPTGUI/MonCreateHypothesis.h @@ -0,0 +1,138 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_CREATEHYPOTHESIS_H +#define MON_CREATEHYPOTHESIS_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(HOMARD_Hypothesis) + +#include "ui_CreateHypothesis.h" +#include + +class MonCreateIteration; +class HOMARD_EXPORT MonCreateHypothesis : public QScrollArea, public Ui_CreateHypothesis +{ + Q_OBJECT + +public: + MonCreateHypothesis( MonCreateIteration* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, + QString aHypotheseName, QString caseName, QString aFieldFile); + ~MonCreateHypothesis(); + + virtual void addZoneinTWZone(QString newZone); + virtual void setGroups(QStringList listGroup); + +protected : + // MonCreateHypothesis( MonCreateIteration* parent, HOMARD::HOMARD_Gen_var myHomardGen, + // QString caseName, QString aFieldFile); + + MonCreateIteration *_parent; + + QString _Name; + QString _aFieldFile ; + QString _aFieldName; + QString _aCaseName; + + int _aTypeAdap; + int _aTypeRaff; + int _aTypeDera; + + int _TypeThR; + double _ThreshR; + int _TypeThC; + double _ThreshC; + + int _UsField; + int _UsCmpI; + int _TypeFieldInterp; + + int _NivMax; + double _DiamMin; + int _AdapInit; + int _ExtraOutput; + + HOMARD::HOMARD_Hypothesis_var aHypothesis; + HOMARD::HOMARD_Gen_var myHomardGen; + + QStringList _aListeZone; + QStringList _aListeComposant; + QStringList _aListeGroupes; + + virtual void InitConnect(); + virtual void InitFields(); + virtual void GetAllZones(); + virtual void SetNewName(); + + virtual void AssocieFieldInterp(); + virtual void AssocieLesZones(); + virtual void AssocieComposants(); + virtual void AssocieLesGroupes(); + virtual bool VerifieZone(); + virtual bool VerifieComposant(); + + virtual QStringList GetZonesChecked(); + virtual QStringList GetListCompChecked(); + +public slots: + + virtual void SetUniforme(); + virtual void SetChamp(); + virtual void SetZone(); + virtual void SetUniRaff(); + virtual void SetUniDera(); + virtual void SetFieldName(); + virtual void SetRPE(); + virtual void SetRAbs(); + virtual void SetRRel(); + virtual void SetRMS(); + virtual void SetRNo(); + virtual void SetCPE(); + virtual void SetCAbs(); + virtual void SetCRel(); + virtual void SetCMS(); + virtual void SetCNo(); + virtual void SetUCL2(); + virtual void SetUCInf(); + virtual void SetUseField(); + virtual void PushZoneNew(); + virtual void PushZoneEdit(); + virtual void PushZoneDelete(); + virtual void SetFiltrage(); + virtual void SetFieldNo(); + virtual void SetFieldAll(); + virtual void SetFieldChosen(); + + virtual void SetAdvanced(); + virtual void SetAIN(); + virtual void SetAIR(); + virtual void SetAID(); + + virtual void PushOnOK(); + virtual bool PushOnApply(); + virtual void PushOnHelp(); +}; + +#endif // MON_CREATEHYPOTHESIS_H diff --git a/src/ADAPTGUI/MonCreateIteration.cxx b/src/ADAPTGUI/MonCreateIteration.cxx new file mode 100644 index 000000000..99da0c955 --- /dev/null +++ b/src/ADAPTGUI/MonCreateIteration.cxx @@ -0,0 +1,339 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonCreateIteration.h" +#include "MonCreateHypothesis.h" +#include "MonEditHypothesis.h" + +#include +#include + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include + +using namespace std; + +// ----------------------------------------------------------------------------------------------------- +MonCreateIteration::MonCreateIteration(QWidget* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen0, QString IterParentName ): +// ----------------------------------------------------------------------------------------------------- +/* Constructs a MonCreateIteration + * Inherits from CasHomard + * Sets attributes to default values + */ + QScrollArea(0), + Ui_CreateIteration(), + _Name(""), + _IterParentName(IterParentName), + _CaseName("") + { + MESSAGE("Constructeur"); + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); + setupUi(this); + if ( modal ) { setWindowModality(Qt::WindowModal); } + else { setWindowModality(Qt::NonModal); } + InitConnect(); + + SetNewName(); + GetHypotheses(); + if (_IterParentName != QString("")) { SetIterParentName(); } + else { setWindowModality(Qt::NonModal) ; /* permet selection de l'iteration dans l arbre d etude */} + SetTSNo(); +// + adjustSize(); + } +// ------------------------------------------------------------------------ +MonCreateIteration::~MonCreateIteration() +// ------------------------------------------------------------------------ +{ + // no need to delete child widgets, Qt does it all for us +} +// ------------------------------------------------------------------------ +void MonCreateIteration::InitConnect() +// ------------------------------------------------------------------------ +{ + connect( PBIterParent, SIGNAL(pressed()), this, SLOT( SetIterParentName())); + connect( PBHypoEdit, SIGNAL(pressed()), this, SLOT( PushHypoEdit() ) ); + connect( PBHypoNew, SIGNAL(pressed()), this, SLOT( PushHypoNew() ) ); + connect( PushFieldFile, SIGNAL(pressed()), this, SLOT( SetFieldFile() ) ); + connect( RBNo, SIGNAL(clicked()), this, SLOT( SetTSNo())); + connect( RBLast, SIGNAL(clicked()), this, SLOT( SetTSLast())); + connect( RBChosen, SIGNAL(clicked()), this, SLOT( SetTSChosen())); + + connect( buttonOk, SIGNAL(pressed()), this, SLOT( PushOnOK() ) ); + connect( buttonApply, SIGNAL(pressed()), this, SLOT( PushOnApply() ) ); + connect( buttonCancel, SIGNAL(pressed()), this, SLOT( close() ) ); + connect( buttonHelp, SIGNAL(pressed()), this, SLOT( PushOnHelp() ) ); +} +// ------------------------------------------------------------------------ +void MonCreateIteration::GetHypotheses() +// ------------------------------------------------------------------------ +{ + HOMARD::listeHypotheses_var mesHypotheses = myHomardGen->GetAllHypothesesName(); + for (int i=0; ilength(); i++) + { + CBHypothese->addItem(QString(mesHypotheses[i])); + } +} +// ------------------------------------------------------------------------ +bool MonCreateIteration::PushOnApply() +// ------------------------------------------------------------------------ +// Appele lorsque l'un des boutons Ok ou Apply est presse +{ + MESSAGE("PushOnApply"); +// + QString aName = LEName->text().trimmed(); + if ( aName == QString ("")) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_ITER_NAME") ); + return false; + } + + if ( _IterParentName == QString ("")) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_ITER_STARTING_POINT") ); + return false; + } + QString aMeshName_np1=LEMeshName_np1->text().trimmed(); + if (aMeshName_np1 == "" ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_ITER_MESH") ); + return false; + } + QString monHypoName=CBHypothese->currentText(); + if (monHypoName == "" ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_ITER_HYPO") ); + return false; + } + HOMARD::HOMARD_Hypothesis_var _myHypothesis = myHomardGen->GetHypothesis(monHypoName.toStdString().c_str()); + HOMARD::listeTypes_var ListTypes (_myHypothesis->GetAdapRefinUnRef()); + int TypeAdap = ListTypes[0]; + if ( TypeAdap == 1 && LEFieldFile->text().trimmed() == QString("") ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_ITER_FIELD_FILE") ); + return false; + } + + MESSAGE ("aMeshName_np1.toStdString " << aMeshName_np1.toStdString()); + MESSAGE ("_CaseName.toStdString " << _CaseName.toStdString() ); + MESSAGE ("_IterParentName.toStdString " << _IterParentName.toStdString() ); + +// Creation de l'objet CORBA si ce n'est pas deja fait sous le meme nom + if (_Name != aName) + { + try + { + _Name = aName; + std::cerr << _Name.toStdString() << std::endl; + aIter = myHomardGen->CreateIteration( \ + CORBA::string_dup(_Name.toStdString().c_str()), + CORBA::string_dup(_IterParentName.toStdString().c_str())); + } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + return false; + } + } +// Mise en place des attributs + std::string IterName = aIter->GetName() ; + + if ( LEFieldFile->text().trimmed() != QString("")) + { + QString FieldFile=LEFieldFile->text().trimmed(); + aIter->SetFieldFile(CORBA::string_dup(FieldFile.toStdString().c_str())); + int rank = SpinBox_Rank->value(); + int step = SpinBox_TimeStep->value(); + if ( step == -2 ) { aIter->SetTimeStepRankLast(); } + else { aIter->SetTimeStepRank(step,rank); } + } + myHomardGen->AssociateIterHypo (IterName.c_str(), monHypoName.toStdString().c_str()); + aIter->SetMeshName(CORBA::string_dup(aMeshName_np1.toStdString().c_str())); + + HOMARD_UTILS::updateObjBrowser() ; + + return true; +} +// ------------------------------------------------------------------------ +void MonCreateIteration::PushOnOK() +// ------------------------------------------------------------------------ +{ + bool bOK = PushOnApply(); + if ( bOK ) this->close(); +} +// ------------------------------------------------------------------------ +void MonCreateIteration::PushOnHelp() +// ------------------------------------------------------------------------ +{ + std::string LanguageShort = myHomardGen->GetLanguageShort(); + HOMARD_UTILS::PushOnHelp(QString("gui_create_iteration.html"), QString(""), QString(LanguageShort.c_str())); +} +// ------------------------------------------------------------------------ +void MonCreateIteration::SetIterParentName() +// ------------------------------------------------------------------------ +{ + if (_IterParentName == QString("")) { + _IterParentName=HOMARD_QT_COMMUN::SelectionArbreEtude(QString("IterationHomard"), 1); + if (_IterParentName == QString("")) { raise();return;}; + } + _CaseName=HOMARD_QT_COMMUN::SelectionCasEtude(); + HOMARD::HOMARD_Iteration_var aIterParent = myHomardGen->GetIteration(_IterParentName.toStdString().c_str()) ; + QString MeshName = aIterParent->GetMeshName(); + + LEMeshName_n->setText(MeshName); + LEMeshName_n->setReadOnly(1); + LEMeshName_np1->setText(MeshName); + + LEIterationParentName->setText(_IterParentName); +} +// ------------------------------------------------- +void MonCreateIteration::SetNewName() +// -------------------------------------------------- +{ +// Recherche d'un nom par defaut qui n'existe pas encore + + HOMARD::listeIterations_var MyObjects=myHomardGen->GetAllIterationsName(); + int num = 0;// + QString aName=""; + while (aName=="" ) + { + aName.setNum(num+1) ; + aName.insert(0, QString("Iter_")); + for ( int i=0; i< MyObjects->length(); i++) + { + if ( aName == QString((MyObjects)[i])) + { + num ++ ; + aName = "" ; + break ; + } + } + } + LEName->setText(aName); +} +// ------------------------------------------------------------------------ +void MonCreateIteration::PushHypoEdit() +// ------------------------------------------------------------------------ +{ + if (CBHypothese->currentText() == QString("")) return; + if (_IterParentName == QString("")) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_ITER_STARTING_POINT") ); + raise(); + return; + } + QString aFieldFile=LEFieldFile->text().trimmed(); + MonEditHypothesis *HypoDlg = new MonEditHypothesis(this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen),CBHypothese->currentText(), _CaseName, aFieldFile) ; + HypoDlg->show(); +} + +// ------------------------------------------------------------------------ +void MonCreateIteration::addHypothese(QString newHypothese) +// ------------------------------------------------------------------------ +{ + CBHypothese->insertItem(0,newHypothese); + CBHypothese->setCurrentIndex(0); +} +// ------------------------------------------------------------------------ +void MonCreateIteration::PushHypoNew() +// ------------------------------------------------------------------------ +{ + if (_IterParentName == QString("")) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_ITER_STARTING_POINT") ); + raise(); + return; + } + if ( _CaseName == QString("")) + { + HOMARD::HOMARD_Iteration_var aIterParent = myHomardGen->GetIteration(_IterParentName.toStdString().c_str()) ; + _CaseName = aIterParent->GetCaseName(); + } + QString aFieldFile=LEFieldFile->text().trimmed(); + MonCreateHypothesis *HypoDlg = new MonCreateHypothesis(this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), QString(""), _CaseName, aFieldFile) ; + HypoDlg->show(); +} +// ------------------------------------------------------------------------ +void MonCreateIteration::SetFieldFile() +// ------------------------------------------------------------------------ +{ + QString fileName0 = LEFieldFile->text().trimmed(); + QString fileName = HOMARD_QT_COMMUN::PushNomFichier( false, QString("med") ) ; + if (fileName.isEmpty()) fileName = fileName0 ; + LEFieldFile->setText(fileName); + raise(); +} +// ------------------------------------------------------------------------ +void MonCreateIteration::SetTSNo() +// ------------------------------------------------------------------------ +// Si on ne tient pas compte du pas de temps, on declare que le pas de temps +// vaut -1, valeur par defaut de med +{ + Rank->setVisible(0); + SpinBox_Rank->setVisible(0); + SpinBox_Rank->setValue(-1); + + TimeStep->setVisible(0); + SpinBox_TimeStep->setVisible(0); + SpinBox_TimeStep->setValue(-1); +// + adjustSize(); +} +// ------------------------------------------------------------------------ +void MonCreateIteration::SetTSLast() +// ------------------------------------------------------------------------ +// Si on choisit le dernier instant, on declare que le pas de temps vaut -2 +{ + Rank->setVisible(0); + SpinBox_Rank->setVisible(0); + SpinBox_Rank->setValue(-2); + + TimeStep->setVisible(0); + SpinBox_TimeStep->setVisible(0); + SpinBox_TimeStep->setValue(-2); +// + adjustSize(); +} +// ------------------------------------------------------------------------ +void MonCreateIteration::SetTSChosen() +// ------------------------------------------------------------------------ +// Si choisit un instant, on prepositionne a 0 +{ + Rank->setVisible(1); + SpinBox_Rank->setVisible(1); + SpinBox_Rank->setValue(0); + + TimeStep->setVisible(1); + SpinBox_TimeStep->setVisible(1); + SpinBox_TimeStep->setValue(0); +// + adjustSize(); +} + diff --git a/src/ADAPTGUI/MonCreateIteration.h b/src/ADAPTGUI/MonCreateIteration.h new file mode 100644 index 000000000..7567c4866 --- /dev/null +++ b/src/ADAPTGUI/MonCreateIteration.h @@ -0,0 +1,78 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_CREATEITERATION_H +#define MON_CREATEITERATION_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(HOMARD_Cas) + +#include "ui_CreateIteration.h" +#include + +class HOMARD_EXPORT MonCreateIteration : public QScrollArea, public Ui_CreateIteration +{ + Q_OBJECT + +public: + MonCreateIteration( QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString IterParentName ); + ~MonCreateIteration(); + + void addHypothese(QString newHypothese); + + +protected : + MonCreateIteration( QWidget* parent, HOMARD::HOMARD_Gen_var myHomardGen, QString IterParentName ); + + QString _Name; + QString _IterParentName; + QString _CaseName; + + + HOMARD::HOMARD_Iteration_var aIter ; + HOMARD::HOMARD_Iteration_var aIterParent ; + HOMARD::HOMARD_Cas_var aCas ; + HOMARD::HOMARD_Gen_var myHomardGen; + + + virtual void InitConnect(); + virtual void GetHypotheses(); + virtual void SetNewName(); + +public slots: + virtual void SetIterParentName(); + virtual void PushHypoEdit(); + virtual void PushHypoNew(); + virtual void PushOnOK(); + virtual bool PushOnApply(); + virtual void PushOnHelp(); + virtual void SetFieldFile(); + virtual void SetTSNo(); + virtual void SetTSLast(); + virtual void SetTSChosen(); + +}; + +#endif // MON_CREATEITERATION_H diff --git a/src/ADAPTGUI/MonCreateListGroup.cxx b/src/ADAPTGUI/MonCreateListGroup.cxx new file mode 100644 index 000000000..28f93e315 --- /dev/null +++ b/src/ADAPTGUI/MonCreateListGroup.cxx @@ -0,0 +1,153 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonCreateListGroup.h" +#include "MonCreateHypothesis.h" +#include "MonCreateBoundaryDi.h" + +#include + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include + +#include +#include +#include +#include +#include + +using namespace std; + +// -------------------------------------------------------------------------------------------------------------- +MonCreateListGroup::MonCreateListGroup(MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen0, QString aCaseName, QStringList listeGroupesHypo) : +// -------------------------------------------------------------------------------------------------------------- +// + QDialog(0), Ui_CreateListGroup(), + _aCaseName (aCaseName), + _listeGroupesHypo (listeGroupesHypo), + _parentHyp(parentHyp), + _parentBound(parentBound) +{ + MESSAGE("Debut de MonCreateListGroup") + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); + setupUi(this); + setModal(modal); + InitConnect(); + InitGroupes(); +} +// -------------------------------------------------------------------------------------------------------------- +MonCreateListGroup::MonCreateListGroup(MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, + HOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo) : +// -------------------------------------------------------------------------------------------------------------- +// + QDialog(0), Ui_CreateListGroup(), + _aCaseName (aCaseName), + _listeGroupesHypo (listeGroupesHypo), + _parentHyp(parentHyp), + _parentBound(parentBound) +{ + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen); + setupUi(this); + InitConnect(); +} + +// ------------------------------------------------------------------------ +MonCreateListGroup::~MonCreateListGroup() +// ------------------------------------------------------------------------ +{ + // no need to delete child widgets, Qt does it all for us +} +// ------------------------------------------------------------------------ +void MonCreateListGroup::InitConnect() +// ------------------------------------------------------------------------ +{ + connect( buttonOk, SIGNAL( pressed() ), this, SLOT( PushOnOK() ) ); + connect( buttonApply, SIGNAL( pressed() ), this, SLOT( PushOnApply() ) ); + connect( buttonCancel, SIGNAL( pressed() ), this, SLOT( close() ) ); + connect( buttonHelp, SIGNAL( pressed() ), this, SLOT( PushOnHelp() ) ); +} +// ------------------------------------------------------------------------ +bool MonCreateListGroup::PushOnApply() +// ------------------------------------------------------------------------ +// Appele lorsque l'un des boutons Ok ou Apply est presse +// +{ + QStringList ListeGroup ; + for ( int row=0; row< TWGroupe->rowCount(); row++) + { + if ( TWGroupe->item( row, 0 )->checkState() == Qt::Checked ) + ListeGroup.insert(0, QString(TWGroupe->item(row, 1)->text()) ); + } + if ( _parentHyp ) { _parentHyp->setGroups(ListeGroup);}; + if ( _parentBound ) { _parentBound->setGroups(ListeGroup);}; + return true; +} + + +// ------------------------------------------------------------------------ +void MonCreateListGroup::PushOnOK() +// ------------------------------------------------------------------------ +{ + if (PushOnApply()) + { + this->close(); + if ( _parentHyp ) { _parentHyp->raise(); _parentHyp->activateWindow(); }; + if ( _parentBound ) { _parentBound->raise(); _parentBound->activateWindow(); }; + } +} +// ------------------------------------------------------------------------ +void MonCreateListGroup::PushOnHelp() +// ------------------------------------------------------------------------ +{ + std::string LanguageShort = myHomardGen->GetLanguageShort(); + HOMARD_UTILS::PushOnHelp(QString("gui_create_hypothese.html"), QString(""), QString(LanguageShort.c_str())); +} +// ------------------------------------------------------------------------ +void MonCreateListGroup::InitGroupes() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de MonCreateListGroup::InitGroupes "); + for ( int row=0; row< TWGroupe->rowCount(); row++) + TWGroupe->removeRow(row); + TWGroupe->setRowCount(0); + if (_aCaseName == QString("")) { return; }; + HOMARD::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str()); + HOMARD::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); + for ( int i = 0; i < _listeGroupesCas->length(); i++ ) + { + TWGroupe->insertRow(i); + TWGroupe->setItem( i, 0, new QTableWidgetItem( QString ("") ) ); + TWGroupe->item( i, 0 )->setFlags( 0 ); + TWGroupe->item( i, 0 )->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled ); + if (_listeGroupesHypo.contains (QString((_listeGroupesCas)[i]))) + {TWGroupe->item( i, 0 )->setCheckState( Qt::Checked );} + else + {TWGroupe->item( i, 0 )->setCheckState( Qt::Unchecked );} + TWGroupe->setItem( i, 1, new QTableWidgetItem(QString((_listeGroupesCas)[i]).trimmed())); + TWGroupe->item( i, 1 )->setFlags(Qt::ItemIsEnabled |Qt::ItemIsSelectable ); + } + TWGroupe->resizeColumnsToContents(); + TWGroupe->resizeRowsToContents(); + TWGroupe->clearSelection(); +// MESSAGE("Fin de MonCreateListGroup::InitGroupes "); +} + diff --git a/src/ADAPTGUI/MonCreateListGroup.h b/src/ADAPTGUI/MonCreateListGroup.h new file mode 100644 index 000000000..b0472d3b9 --- /dev/null +++ b/src/ADAPTGUI/MonCreateListGroup.h @@ -0,0 +1,64 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_CREATELISTGROUP_H +#define MON_CREATELISTGROUP_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) + +#include "ui_CreateListGroup.h" +#include + +class MonCreateHypothesis; +class MonCreateBoundaryDi; +class HOMARD_EXPORT MonCreateListGroup : public QDialog, public Ui_CreateListGroup +{ + Q_OBJECT + +public: + MonCreateListGroup( MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); + MonCreateListGroup( MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, HOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); + virtual ~MonCreateListGroup(); + +protected : + + HOMARD::HOMARD_Gen_var myHomardGen; + + MonCreateHypothesis * _parentHyp; + MonCreateBoundaryDi * _parentBound; + QString _aCaseName; + QStringList _listeGroupesHypo; + + virtual void InitConnect(); + virtual void InitGroupes(); + +public slots: + virtual void PushOnOK(); + virtual bool PushOnApply(); + virtual void PushOnHelp(); + +}; + +#endif // MON_CREATELISTGROUP_H diff --git a/src/ADAPTGUI/MonCreateListGroupCAO.cxx b/src/ADAPTGUI/MonCreateListGroupCAO.cxx new file mode 100644 index 000000000..796f2502d --- /dev/null +++ b/src/ADAPTGUI/MonCreateListGroupCAO.cxx @@ -0,0 +1,150 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonCreateListGroupCAO.h" +#include "MonCreateHypothesis.h" +#include "MonCreateBoundaryCAO.h" + +#include + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include + +#include +#include +#include +#include +#include + +using namespace std; + +// -------------------------------------------------------------------------------------------------------------- +MonCreateListGroupCAO::MonCreateListGroupCAO(MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen0, QString aCaseName, QStringList listeGroupesHypo) : +// -------------------------------------------------------------------------------------------------------------- +// + QDialog(0), Ui_CreateListGroup(), + _aCaseName (aCaseName), + _listeGroupesHypo (listeGroupesHypo), + _parentHyp(parentHyp), + _parentBound(parentBound) +{ + MESSAGE("Debut de MonCreateListGroupCAO") + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); + setupUi(this); + setModal(modal); + InitConnect(); + InitGroupes(); +} +// -------------------------------------------------------------------------------------------------------------- +MonCreateListGroupCAO::MonCreateListGroupCAO(MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, + HOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo) : +// -------------------------------------------------------------------------------------------------------------- +// + QDialog(0), Ui_CreateListGroup(), + _aCaseName (aCaseName), + _listeGroupesHypo (listeGroupesHypo), + _parentHyp(parentHyp), + _parentBound(parentBound) +{ + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen); + setupUi(this); + InitConnect(); +} + +// ------------------------------------------------------------------------ +MonCreateListGroupCAO::~MonCreateListGroupCAO() +// ------------------------------------------------------------------------ +{ + // no need to delete child widgets, Qt does it all for us +} +// ------------------------------------------------------------------------ +void MonCreateListGroupCAO::InitConnect() +// ------------------------------------------------------------------------ +{ + connect( buttonOk, SIGNAL( pressed() ), this, SLOT( PushOnOK() ) ); + connect( buttonApply, SIGNAL( pressed() ), this, SLOT( PushOnApply() ) ); + connect( buttonCancel, SIGNAL( pressed() ), this, SLOT( close() ) ); + connect( buttonHelp, SIGNAL( pressed() ), this, SLOT( PushOnHelp() ) ); +} +// ------------------------------------------------------------------------ +bool MonCreateListGroupCAO::PushOnApply() +// ------------------------------------------------------------------------ +// Appele lorsque l'un des boutons Ok ou Apply est presse +// +{ + QStringList ListeGroup ; + for ( int row=0; row< TWGroupe->rowCount(); row++) + { + if ( TWGroupe->item( row, 0 )->checkState() == Qt::Checked ) + ListeGroup.insert(0, QString(TWGroupe->item(row, 1)->text()) ); + } + if ( _parentHyp ) { _parentHyp->setGroups(ListeGroup);}; + if ( _parentBound ) { _parentBound->setGroups(ListeGroup);}; + return true; +} + + +// ------------------------------------------------------------------------ +void MonCreateListGroupCAO::PushOnOK() +// ------------------------------------------------------------------------ +{ + if (PushOnApply()) this->close(); + if ( _parentHyp ) { _parentHyp->raise(); _parentHyp->activateWindow(); }; + if ( _parentBound ) { _parentBound->raise(); _parentBound->activateWindow(); }; +} +// ------------------------------------------------------------------------ +void MonCreateListGroupCAO::PushOnHelp() +// ------------------------------------------------------------------------ +{ + std::string LanguageShort = myHomardGen->GetLanguageShort(); + HOMARD_UTILS::PushOnHelp(QString("gui_create_hypothese.html"), QString(""), QString(LanguageShort.c_str())); +} +// ------------------------------------------------------------------------ +void MonCreateListGroupCAO::InitGroupes() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de MonCreateListGroupCAO::InitGroupes "); + for ( int row=0; row< TWGroupe->rowCount(); row++) + TWGroupe->removeRow(row); + TWGroupe->setRowCount(0); + if (_aCaseName == QString("")) { return; }; + HOMARD::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str()); + HOMARD::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); + for ( int i = 0; i < _listeGroupesCas->length(); i++ ) + { + TWGroupe->insertRow(i); + TWGroupe->setItem( i, 0, new QTableWidgetItem( QString ("") ) ); + TWGroupe->item( i, 0 )->setFlags( 0 ); + TWGroupe->item( i, 0 )->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled ); + if (_listeGroupesHypo.contains (QString((_listeGroupesCas)[i]))) + {TWGroupe->item( i, 0 )->setCheckState( Qt::Checked );} + else + {TWGroupe->item( i, 0 )->setCheckState( Qt::Unchecked );} + TWGroupe->setItem( i, 1, new QTableWidgetItem(QString((_listeGroupesCas)[i]).trimmed())); + TWGroupe->item( i, 1 )->setFlags(Qt::ItemIsEnabled |Qt::ItemIsSelectable ); + } + TWGroupe->resizeColumnsToContents(); + TWGroupe->resizeRowsToContents(); + TWGroupe->clearSelection(); +// MESSAGE("Fin de MonCreateListGroupCAO::InitGroupes "); +} + diff --git a/src/ADAPTGUI/MonCreateListGroupCAO.h b/src/ADAPTGUI/MonCreateListGroupCAO.h new file mode 100644 index 000000000..898389b83 --- /dev/null +++ b/src/ADAPTGUI/MonCreateListGroupCAO.h @@ -0,0 +1,64 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_CREATELISTGROUPCAO_H +#define MON_CREATELISTGROUPCAO_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) + +#include "ui_CreateListGroup.h" +#include + +class MonCreateHypothesis; +class MonCreateBoundaryCAO; +class HOMARD_EXPORT MonCreateListGroupCAO : public QDialog, public Ui_CreateListGroup +{ + Q_OBJECT + +public: + MonCreateListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); + MonCreateListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, HOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); + virtual ~MonCreateListGroupCAO(); + +protected : + + HOMARD::HOMARD_Gen_var myHomardGen; + + MonCreateHypothesis * _parentHyp; + MonCreateBoundaryCAO * _parentBound; + QString _aCaseName; + QStringList _listeGroupesHypo; + + virtual void InitConnect(); + virtual void InitGroupes(); + +public slots: + virtual void PushOnOK(); + virtual bool PushOnApply(); + virtual void PushOnHelp(); + +}; + +#endif // MON_CREATELISTGROUPCAO_H diff --git a/src/ADAPTGUI/MonCreateYACS.cxx b/src/ADAPTGUI/MonCreateYACS.cxx new file mode 100644 index 000000000..4d1002798 --- /dev/null +++ b/src/ADAPTGUI/MonCreateYACS.cxx @@ -0,0 +1,342 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonCreateYACS.h" +#include "HOMARD.hxx" + +#include +#include + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include + +#ifdef WIN32 +#include +#endif +using namespace std; + +// ---------------------------------------------------------------------- +MonCreateYACS::MonCreateYACS (bool modal, HOMARD::HOMARD_Gen_var myHomardGen0, QString CaseName ): +// ---------------------------------------------------------------------- +/* Constructs a MonCreateYACS + * Sets attributes to default values + */ +// ---------------------------------------------------------------------- + Ui_CreateYACS(), + _aCaseName(CaseName), + _aScriptFile(""), + _aDirName(""), + _aMeshFile(""), + _Type(1) + // Les valeurs de _Type, _MaxIter, _MaxNode, _MaxElem doivent etre les memes que celles dans HOMARD_Gen_i::CreateYACSSchema + // et doivent correspondre aux defauts des boutons + { +// MESSAGE("Debut du constructeur de MonCreateYACS"); + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); + setupUi(this); + if ( modal ) { setWindowModality(Qt::WindowModal); } + else { setWindowModality(Qt::NonModal); } + + InitConnect(); + + SetNewName() ; + + if (_aCaseName != QString("")) { SetCaseName(); } + else { setWindowModality(Qt::NonModal); /* permet selection du cas dans l arbre d etude */} +// +// Les valeurs definies dans les preferences + _MaxIter = myHomardGen->GetYACSMaxIter(); + _MaxNode = myHomardGen->GetYACSMaxNode(); + _MaxElem = myHomardGen->GetYACSMaxElem(); + MESSAGE ("Valeur par defaut de MaxIter = " << _MaxIter<<", MaxNode = "<< _MaxNode<<", MaxElem = "<< _MaxElem); + SpinBoxMaxIter->setValue(_MaxIter) ; + SpinBoxMaxNode->setValue(_MaxNode) ; + SpinBoxMaxElem->setValue(_MaxElem) ; +// + adjustSize(); + } + +// ---------------------------------------------------------------------- +MonCreateYACS::MonCreateYACS(HOMARD::HOMARD_Gen_var myHomardGen0, + QString caseName): +// ---------------------------------------------------------------------- +// Constructeur appele par MonEditYACS +// +myHomardGen(myHomardGen0), +_Name (""), +Chgt (false) +{ +// MESSAGE("Debut du constructeur de MonCreateYACS appele par MonEditYACS"); + setupUi(this) ; + + setWindowModality(Qt::WindowModal); + InitConnect() ; +// + adjustSize(); +} +// ------------------------------------------------------------------------ +MonCreateYACS::~MonCreateYACS() +// ------------------------------------------------------------------------ +{ + // no need to delete child widgets, Qt does it all for us +} +// ------------------------------------------------------------------------ +void MonCreateYACS::InitConnect() +// ------------------------------------------------------------------------ +{ + connect( PBCaseName, SIGNAL(pressed()), this, SLOT(SetCaseName())); + connect( PBScriptFile, SIGNAL(pressed()), this, SLOT(SetScriptFile())); + connect( PBDir, SIGNAL(pressed()), this, SLOT(SetDirName())); + connect( PBMeshFile, SIGNAL(pressed()), this, SLOT(SetMeshFile())); + + connect( RBConstant, SIGNAL(clicked()), this, SLOT(SetConstant())); + connect( RBVariable, SIGNAL(clicked()), this, SLOT(SetVariable())); + + connect( buttonOk, SIGNAL(pressed()), this, SLOT(PushOnOK())); + connect( buttonApply, SIGNAL(pressed()), this, SLOT(PushOnApply())); + connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); + connect( buttonHelp, SIGNAL(pressed()), this, SLOT(PushOnHelp())); +} +// ------------------------------- +bool MonCreateYACS::PushOnApply() +// -------------------------------- +{ + MESSAGE("PushOnApply"); + +// Le fichier du script + QString aFileName=LEScriptFile->text().trimmed(); + if (aFileName ==QString("")) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_SCRIPT_FILE") ); + return false; + } + +// Le repertoire de calcul + QString aDirName=LEDirName->text().trimmed(); + if (aDirName == QString("")) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_CASE_DIRECTORY_4") ); + return false; + } + if ( aDirName != _aDirName) + { QString CaseNameDir = myHomardGen->VerifieDir( aDirName.toStdString().c_str()) ; + if ( CaseNameDir != "" ) + { + QString texte ; + texte = QObject::tr("HOM_CASE_DIRECTORY_2") + CaseNameDir ; + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + texte ); + return false; + } + } + if (CHDIR(aDirName.toStdString().c_str()) != 0) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_CASE_DIRECTORY_3") ); + return false; + } + +// Le fichier du tout premier maillage + aFileName=LEMeshFile->text().trimmed(); + if (aFileName ==QString("")) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_CASE_MESH") ); + return false; + } + QString aMeshName = HOMARD_QT_COMMUN::LireNomMaillage(aFileName); + if (aMeshName == "" ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_MED_FILE_2") ); + return false; + } + + bool bOK = CreateOrUpdate() ; + + if ( bOK ) { HOMARD_UTILS::updateObjBrowser() ; } + + return bOK; +} +// --------------------------------------------------- +bool MonCreateYACS:: CreateOrUpdate() +//---------------------------------------------------- +// Creation ou modification du schema +{ + MESSAGE("CreateOrUpdate"); + bool bOK = true ; + + // 1. Verification des donnees + // 1.1. Le cas + if ( _aCaseName == QString ("")) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_CASE_NAME") ); + return false; + } + // 1.2. Les donnees + QString aScriptFile=LEScriptFile->text().trimmed(); + if ( aScriptFile != _aScriptFile ) + { + _aScriptFile = aScriptFile ; + Chgt = true ; + } + QString aDirName=LEDirName->text().trimmed(); + if ( aDirName != _aDirName ) + { + _aDirName = aDirName ; + Chgt = true ; + } + QString aMeshFile=LEMeshFile->text().trimmed(); + if ( aMeshFile != _aMeshFile ) + { + _aMeshFile = aMeshFile ; + Chgt = true ; + } + + // 2. Creation de l'objet CORBA + try + { + _Name=LEName->text().trimmed(); + aYACS=myHomardGen->CreateYACSSchema(CORBA::string_dup(_Name.toStdString().c_str()), CORBA::string_dup(_aCaseName.toStdString().c_str()), CORBA::string_dup(_aScriptFile.toStdString().c_str()), CORBA::string_dup(_aDirName.toStdString().c_str()), CORBA::string_dup(_aMeshFile.toStdString().c_str())); + } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + bOK = false; + } + + // 3. Options + if ( bOK ) + { + // 3.1. Le type du schema + aYACS->SetType(_Type) ; + + // 3.2. Les maximums + _MaxIter = SpinBoxMaxIter->value() ; + aYACS->SetMaxIter(_MaxIter) ; + + _MaxNode = SpinBoxMaxNode->value() ; + aYACS->SetMaxNode(_MaxNode) ; + + _MaxElem = SpinBoxMaxElem->value() ; + aYACS->SetMaxElem(_MaxElem) ; + + } + + // 4. Ecriture du fichier + if ( bOK ) + { + int codret = aYACS->Write() ; + if ( codret != 0 ) { bOK = false ; } + } + + return bOK; +} +// --------------------------- +void MonCreateYACS::PushOnOK() +// --------------------------- +{ + bool bOK = PushOnApply(); + if ( bOK ) this->close(); +} +//------------------------------ +void MonCreateYACS::PushOnHelp() +//------------------------------- +{ + std::string LanguageShort = myHomardGen->GetLanguageShort(); + HOMARD_UTILS::PushOnHelp(QString("yacs.html"), QString(""), QString(LanguageShort.c_str())); +} +// ------------------------------------------------- +void MonCreateYACS::SetNewName() +// -------------------------------------------------- +{ + + HOMARD::listeYACSs_var MyObjects = myHomardGen->GetAllYACSsName(); + int num = 0; QString aName=""; + while (aName == QString("") ) + { + aName.setNum(num+1) ; + aName.insert(0, QString("YACS_")) ; + for ( int i=0; ilength(); i++) + { + if ( aName == QString(MyObjects[i])) + { + num ++ ; + aName = "" ; + break ; + } + } + } + LEName->setText(aName); +} +// ------------------------------------------------------------------------ +void MonCreateYACS::SetCaseName() +// ------------------------------------------------------------------------ +{ + MESSAGE ("SetCaseName avec _aCaseName = " << _aCaseName.toStdString() ); + if (_aCaseName == QString("")) + { + _aCaseName=HOMARD_QT_COMMUN::SelectionArbreEtude(QString("CasHomard"), 1); + if (_aCaseName == QString("")) { raise();return;}; + } + LECaseName->setText(_aCaseName); +} +// ------------------------------------------------------------------------ +void MonCreateYACS::SetDirName() +// ------------------------------------------------------------------------ +{ + QString aDirName=QFileDialog::getExistingDirectory (); + if (!(aDirName.isEmpty()))LEDirName->setText(aDirName); +} +// ------------------------------------------------------------------------ +void MonCreateYACS::SetScriptFile() +// ------------------------------------------------------------------------ +{ + QString fileName0 = LEScriptFile->text().trimmed(); + QString fileName = HOMARD_QT_COMMUN::PushNomFichier( false, QString("py") ) ; + if (fileName.isEmpty()) fileName = fileName0 ; + LEScriptFile->setText(fileName); +} +// ------------------------------------------------------------------------ +void MonCreateYACS::SetMeshFile() +// ------------------------------------------------------------------------ +{ + QString fileName0 = LEMeshFile->text().trimmed(); + QString fileName = HOMARD_QT_COMMUN::PushNomFichier( false, QString("med") ) ; + if (fileName.isEmpty()) fileName = fileName0 ; + LEMeshFile->setText(fileName); +} +// ------------------------------------------------------------------------ +void MonCreateYACS::SetConstant() +// ------------------------------------------------------------------------ +{ + _Type = 1 ; +} +// ------------------------------------------------------------------------ +void MonCreateYACS::SetVariable() +// ------------------------------------------------------------------------ +{ + _Type = 2 ; +} diff --git a/src/ADAPTGUI/MonCreateYACS.h b/src/ADAPTGUI/MonCreateYACS.h new file mode 100644 index 000000000..a0c5ba0f7 --- /dev/null +++ b/src/ADAPTGUI/MonCreateYACS.h @@ -0,0 +1,84 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_CREATEYACS_H +#define MON_CREATEYACS_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(HOMARD_Cas) + +#include "ui_CreateYACS.h" +#include + +class HOMARD_EXPORT MonCreateYACS : public QScrollArea, public Ui_CreateYACS +{ + Q_OBJECT + + public: + MonCreateYACS( bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString CaseName); + virtual ~MonCreateYACS(); + + protected : + MonCreateYACS( HOMARD::HOMARD_Gen_var myHomardGen, QString CaseName); + + QString _Name; + QString _aCaseName; + QString _aScriptFile; + QString _aDirName; + QString _aMeshFile; + + int _Type; + int _MaxIter; + int _MaxNode; + int _MaxElem; + + bool Chgt; + + HOMARD::HOMARD_YACS_var aYACS; + HOMARD::HOMARD_Gen_var myHomardGen; + + virtual void InitConnect(); + virtual bool CreateOrUpdate(); + + public slots: + virtual void SetNewName(); + + virtual void SetCaseName(); + virtual void SetDirName(); + + virtual void SetScriptFile(); + virtual void SetMeshFile(); + +// virtual void SetType(int Type); + virtual void SetConstant(); + virtual void SetVariable(); + + virtual void PushOnOK(); + virtual bool PushOnApply(); + virtual void PushOnHelp(); + +}; + +#endif // MON_CREATEYACS_H diff --git a/src/ADAPTGUI/MonCreateZone.cxx b/src/ADAPTGUI/MonCreateZone.cxx new file mode 100644 index 000000000..1adb91653 --- /dev/null +++ b/src/ADAPTGUI/MonCreateZone.cxx @@ -0,0 +1,713 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonCreateZone.h" +#include "MonCreateHypothesis.h" + +#include +#include + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include + +#include +#include +#include +#include +#include + +using namespace std; + +// ---------------------------------------------------------------------- +MonCreateZone::MonCreateZone(MonCreateHypothesis* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen0, + QString caseName) : +// ---------------------------------------------------------------------- +/* Constructs a MonCreateZone + appele pour une vraie creation + initialise une boite et non une sphere +*/ + QDialog(0), Ui_CreateZone(), + _parent(parent), + _Name (""), + _aCaseName(caseName), + _Orient(0), + _Type(2), + _Xcentre(0), _Ycentre(0), _Zcentre(0), _Rayon(0), + _ZoneXcentre(0), _ZoneYcentre(0), _ZoneZcentre(0), _ZoneRayon(0), + _Xmin(0), _Xmax(0), _Xincr(0), _Ymin(0), _Ymax(0), _Yincr(0), _Zmin(0), _Zmax(0), _Zincr(0), + _ZoneXmin(0), _ZoneXmax(0), _ZoneYmin(0), _ZoneYmax(0), _ZoneZmin(0), _ZoneZmax(0), + _Xaxis(0), _Yaxis(0), _Zaxis(0), _RayonInt(0), _Haut(0), + _ZoneXaxis(0), _ZoneYaxis(0), _ZoneZaxis(0), _ZoneRayonInt(0), _ZoneHaut(0), + _DMax(0), + Chgt (false) + { + MESSAGE("Constructeur") ; + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0) ; + setupUi(this) ; + setModal(modal) ; + InitConnect( ) ; + + SetNewName() ; + InitValZone() ; // Cherche les valeurs de la boite englobante le maillage + InitMinMax() ; // Initialise les bornes des boutons + SetBox() ; // Propose une boite en premier choix + + } +// ---------------------------------------------------------------------- +MonCreateZone::MonCreateZone(MonCreateHypothesis* parent, + HOMARD::HOMARD_Gen_var myHomardGen0, + QString caseName): +// ---------------------------------------------------------------------- +// Constructeur appele par MonEditZone +// + QDialog(0), Ui_CreateZone(), + myHomardGen(myHomardGen0), + _parent(parent), + _Name (""), + _aCaseName(caseName), + _Orient(0), + _Type(2), + _Xcentre(0), _Ycentre(0), _Zcentre(0), _Rayon(0), + _ZoneXcentre(0), _ZoneYcentre(0), _ZoneZcentre(0), _ZoneRayon(0), + _ZoneXmin(0), _ZoneXmax(0), _ZoneYmin(0), _ZoneYmax(0), _ZoneZmin(0), _ZoneZmax(0), + _Xaxis(0), _Yaxis(0), _Zaxis(0), _RayonInt(0), _Haut(0), + _ZoneXaxis(0), _ZoneYaxis(0), _ZoneZaxis(0), _ZoneRayonInt(0), _ZoneHaut(0), + // Pour affichage lors de l edition d une Zone sans nom de Cas + _Xmin(1), _Xmax(1), _Xincr(1), _Ymin(1), _Ymax(1), _Yincr(1), _Zmin(1), _Zmax(1), _Zincr(1), + _DMax(1), + Chgt (false) + { + // MESSAGE("Debut de MonCreateZone") + setupUi(this) ; + + setModal(true) ; + InitConnect() ; + } + +// ------------------------------------------------------------------------ +MonCreateZone::~MonCreateZone() +// ------------------------------------------------------------------------ +{ + // no need to delete child widgets, Qt does it all for us +} +// ------------------------------------------------------------------------ +void MonCreateZone::InitConnect() +// ------------------------------------------------------------------------ +{ + connect( RBBox, SIGNAL(clicked()) , this, SLOT(SetBox()) ) ; + connect( RBSphere, SIGNAL(clicked()) , this, SLOT(SetSphere()) ) ; + connect( RBCylinder, SIGNAL(clicked()) , this, SLOT(SetCylinder()) ) ; + connect( RBPipe, SIGNAL(clicked()) , this, SLOT(SetPipe()) ) ; + connect( buttonOk, SIGNAL( pressed() ), this, SLOT( PushOnOK() ) ) ; + connect( buttonApply, SIGNAL( pressed() ), this, SLOT( PushOnApply() ) ) ; + connect( buttonCancel, SIGNAL( pressed() ), this, SLOT( close() ) ) ; + connect( buttonHelp, SIGNAL( pressed() ), this, SLOT( PushOnHelp() ) ) ; +} +// ------------------------------------------------------------------------ +void MonCreateZone::InitValZone() +// ------------------------------------------------------------------------ +{ +// +// 1. Les coordonnees extremes du maillage +// + if (_aCaseName == QString("")) { return; } + + HOMARD::HOMARD_Cas_var aCas = myHomardGen->GetCase(_aCaseName.toStdString().c_str()) ; + HOMARD::extrema_var MesExtremes = aCas->GetBoundingBox() ; + int num = MesExtremes->length() ; + ASSERT(num == 10) ; + _Xmin=MesExtremes[0]; _Xmax=MesExtremes[1]; _Xincr=MesExtremes[2]; + _Ymin=MesExtremes[3]; _Ymax=MesExtremes[4]; _Yincr=MesExtremes[5]; + _Zmin=MesExtremes[6]; _Zmax=MesExtremes[7]; _Zincr=MesExtremes[8]; + _DMax=MesExtremes[9]; + if ( _Xincr < 0 ) { _Orient = 2 ; } + else if ( _Yincr < 0 ) { _Orient = 3 ; } + else if ( _Zincr < 0 ) { _Orient = 1 ; } + MESSAGE ("_Xmin : " << _Xmin << " _Xmax : " << _Xmax << " _Xincr : " << _Xincr ) ; + MESSAGE ("_Ymin : " << _Ymin << " _Ymax : " << _Ymax << " _Yincr : " << _Yincr ) ; + MESSAGE ("_Zmin : " << _Zmin << " _Zmax : " << _Zmax << " _Zincr : " << _Zincr) ; + MESSAGE ("_DMax : " << _DMax) ; + MESSAGE ("_Orient : " << _Orient) ; +// 2. Caracteristiques des zones +// en X + if ( _Xincr < 0 ) + { + _ZoneXmin = _Xmin; + _ZoneXmax = _Xmax; + } + else + { + _ZoneXmin = _Xmin - _Xincr; + _ZoneXmax = _Xmax + _Xincr; + } + _Xcentre=(_Xmin + _Xmax)/2.; +// en Y + if ( _Yincr < 0 ) + { + _ZoneYmin = _Ymin; + _ZoneYmax = _Ymax; + } + else + { + _ZoneYmin = _Ymin - _Yincr; + _ZoneYmax = _Ymax + _Yincr; + } + _Ycentre=(_Ymin + _Ymax)/2.; +// en Z + if ( _Zincr < 0 ) + { + _ZoneZmin = _Zmin; + _ZoneZmax = _Zmax; + } + else + { + _ZoneZmin = _Zmin - _Zincr; + _ZoneZmax = _Zmax + _Zincr; + } + _Zcentre=(_Zmin + _Zmax)/2.; +// Rayons + _Rayon= _DMax/4.; + _RayonInt= _DMax/8.; +// Axe et hauteur pour cylindre et tuyau + _Haut= _DMax/2.; +// 3. Gestion des icones + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr() ; + QPixmap pix = resMgr->loadPixmap( "HOMARD", "boxdxyz.png" ) ; + if ( _Orient == 0 ) { pix = resMgr->loadPixmap( "HOMARD", "boxdxyz.png" ) ; } + else { pix = resMgr->loadPixmap( "HOMARD", "boxdxy.png" ) ; } + QIcon IS=QIcon(pix) ; + RBBox->setIcon(IS) ; + + if ( _Orient == 0 ) { pix = resMgr->loadPixmap( "HOMARD", "cylinderpointvector.png" ) ; } + else { pix = resMgr->loadPixmap( "HOMARD", "disk.png" ) ; + RBCylinder->setText(QApplication::translate("CreateZone", "Disk", 0)); + TLXbase->setText(QApplication::translate("CreateZone", "X centre", 0)); + TLYbase->setText(QApplication::translate("CreateZone", "Y centre", 0)); + TLZbase->setText(QApplication::translate("CreateZone", "Z centre", 0)); } + IS=QIcon(pix) ; + RBCylinder->setIcon(IS) ; + + if ( _Orient == 0 ) { pix = resMgr->loadPixmap( "HOMARD", "pipe.png" ) ; } + else { pix = resMgr->loadPixmap( "HOMARD", "diskwithhole.png" ) ; + RBPipe->setText(QApplication::translate("CreateZone", "Disk with hole", 0)); + TLXbase_p->setText(QApplication::translate("CreateZone", "X centre", 0)); + TLYbase_p->setText(QApplication::translate("CreateZone", "Y centre", 0)); + TLZbase_p->setText(QApplication::translate("CreateZone", "Z centre", 0)); } + IS=QIcon(pix) ; + RBPipe->setIcon(IS) ; + + if ( _Orient == 0 ) { pix = resMgr->loadPixmap( "HOMARD", "spherepoint.png" ) ; + IS=QIcon(pix) ; + RBSphere->setIcon(IS) ; } + else { RBSphere->setVisible(0) ; } +} + +// ------------------------------------------------------------------------ +void MonCreateZone::InitMinMax() +// ------------------------------------------------------------------------ +{ +// en X + if ( _Xincr > 0) { + SpinBox_Xmini->setRange(_ZoneXmin,_ZoneXmax) ; + SpinBox_Xmaxi->setRange(_ZoneXmin,_ZoneXmax) ; + SpinBox_Xmini->setSingleStep(_Xincr) ; + SpinBox_Xmaxi->setSingleStep(_Xincr) ; + SpinBox_Xcentre->setSingleStep(_Xincr) ; + } + else { + SpinBox_Xmini->setValue(_ZoneXmin) ; + SpinBox_Xmaxi->setValue(_ZoneXmax) ; + SpinBox_Xcentre->setValue(_Xcentre) ; + SpinBox_Xbase->setValue(_Xcentre) ; + SpinBox_Xbase_p->setValue(_Xcentre) ; + SpinBox_Xmini->setEnabled(false) ; + SpinBox_Xmaxi->setEnabled(false) ; + SpinBox_Xcentre->setEnabled(false) ; + SpinBox_Xbase->setEnabled(false) ; + SpinBox_Xbase_p->setEnabled(false) ; + } +// en Y + if ( _Yincr > 0) { + SpinBox_Ymini->setRange(_ZoneYmin,_ZoneYmax) ; + SpinBox_Ymaxi->setRange(_ZoneYmin,_ZoneYmax) ; + SpinBox_Ymini->setSingleStep(_Yincr) ; + SpinBox_Ymaxi->setSingleStep(_Yincr) ; + SpinBox_Ycentre->setSingleStep(_Yincr) ; + } + else { + SpinBox_Ymini->setValue(_ZoneYmin) ; + SpinBox_Ymaxi->setValue(_ZoneYmax) ; + SpinBox_Ycentre->setValue(_Ycentre) ; + SpinBox_Ybase->setValue(_Ycentre) ; + SpinBox_Ybase_p->setValue(_Ycentre) ; + SpinBox_Ymini->setEnabled(false) ; + SpinBox_Ymaxi->setEnabled(false) ; + SpinBox_Ycentre->setEnabled(false) ; + SpinBox_Ybase->setEnabled(false) ; + SpinBox_Ybase_p->setEnabled(false) ; + } +// en Z + if ( _Zincr > 0) { + SpinBox_Zmini->setRange(_ZoneZmin,_ZoneZmax) ; + SpinBox_Zmaxi->setRange(_ZoneZmin,_ZoneZmax) ; + SpinBox_Zmini->setSingleStep(_Zincr) ; + SpinBox_Zmaxi->setSingleStep(_Zincr) ; + SpinBox_Zcentre->setSingleStep(_Zincr) ; + } + else { + SpinBox_Zmini->setValue(_ZoneZmin) ; + SpinBox_Zmaxi->setValue(_ZoneZmax) ; + SpinBox_Zcentre->setValue(_Zcentre) ; + SpinBox_Zbase->setValue(_Zcentre) ; + SpinBox_Zbase_p->setValue(_Zcentre) ; + SpinBox_Zmini->setEnabled(false) ; + SpinBox_Zmaxi->setEnabled(false) ; + SpinBox_Zcentre->setEnabled(false) ; + SpinBox_Zbase->setEnabled(false) ; + SpinBox_Zbase_p->setEnabled(false) ; + } +// Rayons + SpinBox_Rayon->setSingleStep(_Rayon/10.) ; + SpinBox_Radius->setSingleStep(_Rayon/10.) ; + SpinBox_Radius_int->setSingleStep(_Rayon/20.) ; + SpinBox_Radius_ext->setSingleStep(_Rayon/10.) ; +// Axe et hauteur +// Si une coordonnee est constante, inutile de demander l'axe et la hauteur + if ( _Orient > 0) { + SpinBox_Xaxis->setVisible(0) ; + SpinBox_Yaxis->setVisible(0) ; + SpinBox_Zaxis->setVisible(0) ; + SpinBox_Haut->setVisible(0) ; + TLXaxis->setVisible(0) ; + TLYaxis->setVisible(0) ; + TLZaxis->setVisible(0) ; + TLHaut->setVisible(0) ; + SpinBox_Xaxis_p->setVisible(0) ; + SpinBox_Yaxis_p->setVisible(0) ; + SpinBox_Zaxis_p->setVisible(0) ; + SpinBox_Haut_p->setVisible(0) ; + TLXaxis_p->setVisible(0) ; + TLYaxis_p->setVisible(0) ; + TLZaxis_p->setVisible(0) ; + TLHaut_p->setVisible(0) ; + } + else { + SpinBox_Haut->setSingleStep(_Rayon/10.) ; + SpinBox_Haut_p->setSingleStep(_Rayon/10.) ; + } +} +// ------------------------------------------------------------------------ +bool MonCreateZone::PushOnApply() +// ------------------------------------------------------------------------ +// Appele lorsque l'un des boutons Ok ou Apply est presse +// +{ + if (LEName->text().trimmed()=="") + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_ZONE_NAME") ) ; + return false; + } + + switch (_Type) + { + case 11 : // il s agit d un rectangle + { } + case 12 : // il s agit d un rectangle + { } + case 13 : // il s agit d un rectangle + { } + case 2 : // il s agit d un parallelipipede rectangle + { + if ( (_ZoneXmin != SpinBox_Xmini->value()) || + (_ZoneXmax != SpinBox_Xmaxi->value()) || + (_ZoneYmin != SpinBox_Ymini->value()) || + (_ZoneYmax != SpinBox_Ymaxi->value()) || + (_ZoneZmin != SpinBox_Zmini->value()) || + (_ZoneZmax != SpinBox_Zmaxi->value()) ) + { + Chgt = true; + _ZoneXmin= SpinBox_Xmini->value() ; _ZoneXmax= SpinBox_Xmaxi->value() ; + _ZoneYmin= SpinBox_Ymini->value() ; _ZoneYmax= SpinBox_Ymaxi->value() ; + _ZoneZmin= SpinBox_Zmini->value() ; _ZoneZmax= SpinBox_Zmaxi->value() ; + } + break ; + } + case 4 : // il s agit d une sphere + { + if ( (_ZoneXcentre != SpinBox_Xcentre->value()) || + (_ZoneYcentre != SpinBox_Ycentre->value()) || + (_ZoneZcentre != SpinBox_Zbase->value()) || + (_ZoneRayon != SpinBox_Rayon->value()) ) + { + Chgt = true; + _ZoneXcentre=SpinBox_Xcentre->value() ; + _ZoneYcentre=SpinBox_Ycentre->value() ; + _ZoneZcentre=SpinBox_Zcentre->value() ; + _ZoneRayon=SpinBox_Rayon->value() ; + } + break ; + } + case 31 : // il s agit d un disque issu d'un cylindre + { } + case 32 : // il s agit d un disque issu d'un cylindre + { } + case 33 : // il s agit d un disque issu d'un cylindre + { } + case 5 : // il s agit d un cylindre + { + if ( (_ZoneXcentre != SpinBox_Xbase->value()) || + (_ZoneYcentre != SpinBox_Ybase->value()) || + (_ZoneZcentre != SpinBox_Zbase->value()) || + (_ZoneRayon != SpinBox_Radius->value()) || + (_ZoneHaut != SpinBox_Haut->value()) || + (_ZoneXaxis != SpinBox_Xaxis->value()) || + (_ZoneYaxis != SpinBox_Yaxis->value()) || + (_ZoneZaxis != SpinBox_Zaxis->value()) ) + { + Chgt = true; + _ZoneXcentre=SpinBox_Xbase->value() ; + _ZoneYcentre=SpinBox_Ybase->value() ; + _ZoneZcentre=SpinBox_Zbase->value() ; + _ZoneXaxis=SpinBox_Xaxis->value() ; + _ZoneYaxis=SpinBox_Yaxis->value() ; + _ZoneZaxis=SpinBox_Zaxis->value() ; + _ZoneRayon=SpinBox_Radius->value() ; + _ZoneHaut=SpinBox_Haut->value() ; + } + break ; + } + case 61 : // il s agit d un disque avec trou + { } + case 62 : // il s agit d un disque avec trou + { } + case 63 : // il s agit d un disque avec trou + { } + case 7 : // il s agit d un tuyau + { + if ( (_ZoneXcentre != SpinBox_Xbase_p->value()) || + (_ZoneYcentre != SpinBox_Ybase_p->value()) || + (_ZoneZcentre != SpinBox_Zbase_p->value()) || + (_ZoneRayonInt != SpinBox_Radius_int->value()) || + (_ZoneRayon != SpinBox_Radius_ext->value()) || + (_ZoneHaut != SpinBox_Haut_p->value()) || + (_ZoneXaxis != SpinBox_Xaxis_p->value()) || + (_ZoneYaxis != SpinBox_Yaxis_p->value()) || + (_ZoneZaxis != SpinBox_Zaxis_p->value()) ) + { + Chgt = true; + _ZoneXcentre=SpinBox_Xbase_p->value() ; + _ZoneYcentre=SpinBox_Ybase_p->value() ; + _ZoneZcentre=SpinBox_Zbase_p->value() ; + _ZoneXaxis=SpinBox_Xaxis_p->value() ; + _ZoneYaxis=SpinBox_Yaxis_p->value() ; + _ZoneZaxis=SpinBox_Zaxis_p->value() ; + _ZoneRayonInt=SpinBox_Radius_int->value() ; + _ZoneRayon=SpinBox_Radius_ext->value() ; + _ZoneHaut=SpinBox_Haut_p->value() ; + } + break ; + } + } + +// Controles +// Pour un rectangle ou un parallelepipede : + if ( ( _Type >= 11 && _Type <= 13 ) || _Type == 2 ) + { + if ((_ZoneXmin >= _ZoneXmax) && (_Xincr > 0)) { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_ZONE_LIMIT").arg("X") ) ; + return false; } + + if ((_ZoneYmin >= _ZoneYmax) && (_Yincr > 0)) { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_ZONE_LIMIT").arg("Y") ) ; + return false; } + + if ((_ZoneZmin >= _ZoneZmax) && (_Zincr > 0)) { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_ZONE_LIMIT").arg("Z") ) ; + return false; } + } +// L'axe pour un cylindre ou un tuyau : + if ( _Type == 5 || _Type == 7 ) + { + double daux = _ZoneXaxis*_ZoneXaxis + _ZoneYaxis*_ZoneYaxis + _ZoneZaxis*_ZoneZaxis ; + if ( daux < 0.0000001 ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_AXE") ); + return false; + } + } +// Rayons pour disque avec trou ou un tuyau : + if ( ( _Type >= 61 && _Type <= 63 ) || _Type == 7 ) + { + if ( _ZoneRayonInt >= _ZoneRayon ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_ZONE_RAYON") ); + return false; + } + } +// +// Création ou mise à jour de la zone +// + bool bOK = CreateOrUpdateZone() ; + + if ( bOK ) { HOMARD_UTILS::updateObjBrowser() ; } + + return bOK; + +} +// --------------------------------------------------- +bool MonCreateZone::CreateOrUpdateZone() +//---------------------------------------------------- +// Creation de la zone +{ + MESSAGE("Debut de CreateOrUpdateZone avec _Type ="<<_Type<<", _Name ="<<_Name.toStdString().c_str()<<" et LEName ="<text().trimmed().toStdString().c_str()); +// + if (_Name != LEName->text().trimmed()) + { + _Name = LEName->text().trimmed() ; + try + { + switch (_Type) + { + case 11 : // il s agit d un rectangle, dans le plan (X,Y) + { aZone = myHomardGen->CreateZoneBox2D(CORBA::string_dup(_Name.toStdString().c_str()), \ + _ZoneXmin, _ZoneXmax, _ZoneYmin, _ZoneYmax, _Orient ); + break; + } + case 12 : // il s agit d un rectangle, dans le plan (Y,Z) + { aZone = myHomardGen->CreateZoneBox2D(CORBA::string_dup(_Name.toStdString().c_str()), \ + _ZoneYmin, _ZoneYmax, _ZoneZmin, _ZoneZmax, _Orient ); + break; + } + case 13 : // il s agit d un rectangle, dans le plan (Z,X) + { aZone = myHomardGen->CreateZoneBox2D(CORBA::string_dup(_Name.toStdString().c_str()), \ + _ZoneZmin, _ZoneZmax, _ZoneXmin, _ZoneXmax, _Orient ); + break; + } + case 2 : // il s agit d un parallelepipede + { aZone = myHomardGen->CreateZoneBox(CORBA::string_dup(_Name.toStdString().c_str()), \ + _ZoneXmin, _ZoneXmax, _ZoneYmin, _ZoneYmax, _ZoneZmin, _ZoneZmax ); + break; + } + case 4 : // il s agit d une sphere + { aZone = myHomardGen->CreateZoneSphere(CORBA::string_dup(_Name.toStdString().c_str()), \ + _ZoneXcentre, _ZoneYcentre, _ZoneZcentre, _ZoneRayon ); + break; + } + case 31 : // il s agit d un disque issu d'un cylindre, dans le plan (X,Y) + { aZone = myHomardGen->CreateZoneDisk(CORBA::string_dup(_Name.toStdString().c_str()), \ + _ZoneXcentre, _ZoneYcentre, _ZoneRayon, _Orient ); + break; + } + case 32 : // il s agit d un disque issu d'un cylindre, dans le plan (Y,Z) + { aZone = myHomardGen->CreateZoneDisk(CORBA::string_dup(_Name.toStdString().c_str()), \ + _ZoneYcentre, _ZoneZcentre, _ZoneRayon, _Orient ); + break; + } + case 33 : // il s agit d un disque issu d'un cylindre, dans le plan (Z,X) + { aZone = myHomardGen->CreateZoneDisk(CORBA::string_dup(_Name.toStdString().c_str()), \ + _ZoneZcentre, _ZoneXcentre, _ZoneRayon, _Orient ); + break; + } + case 5 : // il s agit d un cylindre + { aZone = myHomardGen->CreateZoneCylinder(CORBA::string_dup(_Name.toStdString().c_str()), \ + _ZoneXcentre, _ZoneYcentre, _ZoneZcentre, _ZoneXaxis, _ZoneYaxis, _ZoneZaxis, _ZoneRayon, _ZoneHaut ); + break; + } + case 61 : // il s agit d un disque avec trou, dans le plan (X,Y) + { aZone = myHomardGen->CreateZoneDiskWithHole(CORBA::string_dup(_Name.toStdString().c_str()), \ + _ZoneXcentre, _ZoneYcentre, _ZoneRayon, _ZoneRayonInt, _Orient ); + break; + } + case 62 : // il s agit d un disque avec trou, dans le plan (Y,Z) + { aZone = myHomardGen->CreateZoneDiskWithHole(CORBA::string_dup(_Name.toStdString().c_str()), \ + _ZoneYcentre, _ZoneZcentre, _ZoneRayon, _ZoneRayonInt, _Orient ); + break; + } + case 63 : // il s agit d un disque avec trou, dans le plan (Z,X) + { aZone = myHomardGen->CreateZoneDiskWithHole(CORBA::string_dup(_Name.toStdString().c_str()), \ + _ZoneZcentre, _ZoneXcentre, _ZoneRayon, _ZoneRayonInt, _Orient ); + break; + } + case 7 : // il s agit d un tuyau + { aZone = myHomardGen->CreateZonePipe(CORBA::string_dup(_Name.toStdString().c_str()), \ + _ZoneXcentre, _ZoneYcentre, _ZoneZcentre, _ZoneXaxis, _ZoneYaxis, _ZoneZaxis, _ZoneRayon, _ZoneHaut, _ZoneRayonInt ); + break; + } + } + } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + return false ; + } + _parent->addZoneinTWZone(_Name) ; +// Mise en place des attributs + aZone->SetLimit(_Xincr, _Yincr, _Zincr) ; + + return true; + } + else { + QMessageBox::warning( 0, QObject::tr("HOM_WARNING"), + QObject::tr("HOM_SELECT_OBJECT_4") ); + return false ; + } + MESSAGE("Fin de CreateOrUpdateZone"); +} +// ------------------------------------------------------------------------ +void MonCreateZone::PushOnOK() +// ------------------------------------------------------------------------ +{ + if (PushOnApply()) this->close() ; +} +// ------------------------------------------------------------------------ +void MonCreateZone::PushOnHelp() +// ------------------------------------------------------------------------ +{ + std::string LanguageShort = myHomardGen->GetLanguageShort(); + HOMARD_UTILS::PushOnHelp(QString("gui_create_zone.html"), QString(""), QString(LanguageShort.c_str())); +} + +// ----------------------------------- +void MonCreateZone::SetNewName() +// ----------------------------------- +{ + MESSAGE("SetNewName"); +// Recherche d'un nom par defaut qui n'existe pas encore + + HOMARD::listeZones_var MyObjects = myHomardGen->GetAllZonesName() ; + int num = 0; QString aName=""; + while (aName=="" ) + { + aName.setNum(num+1) ; + aName.insert(0, QString("Zone_")) ; + for ( int i=0; ilength() ; i++) + { + if ( aName == QString(MyObjects[i])) + { + num ++ ; + aName = "" ; + break ; + } + } + } + LEName->setText(aName); + MESSAGE("SetNewName aName ="<setVisible(1) ; + gBSphere->setVisible(0) ; + gBCylindre->setVisible(0) ; + gBPipe->setVisible(0) ; + adjustSize() ; + _Type=2; +// Sachant que l'increment est le 1/100eme de l'ecart (min/max), cela revient +// a initialiser la boite sur une boite 'centrale' comprise entre 2/5 et 3/5 + if ( _Xincr > 0 ) { SpinBox_Xmini->setValue(_Xcentre-10*_Xincr) ; + SpinBox_Xmaxi->setValue(_Xcentre+10*_Xincr) ; } + else { _Type=12 ; } + if ( _Yincr > 0 ) { SpinBox_Ymini->setValue(_Ycentre-10*_Yincr) ; + SpinBox_Ymaxi->setValue(_Ycentre+10*_Yincr) ; } + else { _Type=13 ; } + if ( _Zincr > 0 ) { SpinBox_Zmini->setValue(_Zcentre-10*_Zincr) ; + SpinBox_Zmaxi->setValue(_Zcentre+10*_Zincr) ; } + else { _Type=11 ; } + MESSAGE("Fin de SetBox") +} +// ------------------------------------------------------------------------ +void MonCreateZone::SetSphere() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetSphere") + gBBox->setVisible(0) ; + gBSphere->setVisible(1) ; + gBCylindre->setVisible(0) ; + gBPipe->setVisible(0) ; + adjustSize() ; + _Type=4; + SpinBox_Xcentre->setValue(_Xcentre) ; + SpinBox_Ycentre->setValue(_Ycentre) ; + SpinBox_Zcentre->setValue(_Zcentre) ; + SpinBox_Rayon->setValue(_Rayon) ; + MESSAGE("Fin de SetSphere") +} +// ------------------------------------------------------------------------ +void MonCreateZone::SetCylinder() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetCylinder") + gBBox->setVisible(0) ; + gBSphere->setVisible(0) ; + gBCylindre->setVisible(1) ; + gBPipe->setVisible(0) ; + adjustSize() ; + _Type=5; + if ( _Xincr > 0 ) { SpinBox_Xbase->setValue(_Xcentre) ; + SpinBox_Xaxis->setValue(0.) ; } + else { _Type=32 ; } + if ( _Yincr > 0 ) { SpinBox_Ybase->setValue(_Ycentre) ; + SpinBox_Yaxis->setValue(0.) ; } + else { _Type=33 ; } + if ( _Zincr > 0 ) { SpinBox_Zbase->setValue(_Zcentre) ; + SpinBox_Zaxis->setValue(1.) ; } + else { _Type=31 ; } + SpinBox_Radius->setValue(_Rayon) ; + SpinBox_Haut->setValue(_Haut) ; + MESSAGE("Fin de SetCylinder") +} +// ------------------------------------------------------------------------ +void MonCreateZone::SetPipe() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetPipe") + gBBox->setVisible(0) ; + gBSphere->setVisible(0) ; + gBCylindre->setVisible(0) ; + gBPipe->setVisible(1) ; + adjustSize() ; + _Type=7; + if ( _Xincr > 0 ) { SpinBox_Xbase_p->setValue(_Xcentre) ; + SpinBox_Xaxis_p->setValue(0.) ; } + else { _Type=62 ; } + if ( _Yincr > 0 ) { SpinBox_Ybase_p->setValue(_Ycentre) ; + SpinBox_Yaxis_p->setValue(0.) ; } + else { _Type=63 ; } + if ( _Zincr > 0 ) { SpinBox_Zbase_p->setValue(_Zcentre) ; + SpinBox_Zaxis_p->setValue(1.) ; } + else { _Type=61 ; } + SpinBox_Radius_int->setValue(_RayonInt) ; + SpinBox_Radius_ext->setValue(_Rayon) ; + SpinBox_Haut_p->setValue(_Haut) ; + MESSAGE("Fin de SetPipe") +} + + diff --git a/src/ADAPTGUI/MonCreateZone.h b/src/ADAPTGUI/MonCreateZone.h new file mode 100644 index 000000000..932e9965f --- /dev/null +++ b/src/ADAPTGUI/MonCreateZone.h @@ -0,0 +1,87 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_CREATEZONE_H +#define MON_CREATEZONE_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) + +#include "ui_CreateZone.h" +#include + +class MonCreateHypothesis; +class HOMARD_EXPORT MonCreateZone : public QDialog, public Ui_CreateZone +{ + Q_OBJECT + +public: + MonCreateZone( MonCreateHypothesis* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString caseName); + virtual ~MonCreateZone(); + +protected : + MonCreateZone( MonCreateHypothesis* parent, + HOMARD::HOMARD_Gen_var myHomardGen, + QString caseName); + + MonCreateHypothesis * _parent; + + QString _Name; + QString _aCaseName; + + int _Orient; + int _Type; + double _Xcentre, _Ycentre, _Zcentre, _Rayon ; + double _Xmin, _Xmax, _Xincr, _Ymin, _Ymax, _Yincr, _Zmin, _Zmax, _Zincr ; + double _ZoneXcentre, _ZoneYcentre, _ZoneZcentre, _ZoneRayon ; + double _ZoneXmin, _ZoneXmax, _ZoneYmin, _ZoneYmax, _ZoneZmin, _ZoneZmax ; + double _Xaxis, _Yaxis, _Zaxis, _RayonInt, _Haut ; + double _ZoneXaxis, _ZoneYaxis, _ZoneZaxis, _ZoneRayonInt, _ZoneHaut ; + double _DMax ; + + bool Chgt; + + HOMARD::HOMARD_Zone_var aZone ; + HOMARD::HOMARD_Gen_var myHomardGen; + + virtual void InitConnect(); + virtual void InitValZone(); + virtual void InitMinMax(); + virtual void SetNewName(); + virtual bool CreateOrUpdateZone(); + +public slots: + virtual void SetBox(); + virtual void SetSphere(); + virtual void SetCylinder(); + virtual void SetPipe(); + virtual void PushOnOK(); + virtual bool PushOnApply(); + virtual void PushOnHelp(); + +}; + +#endif // MON_CREATEZONE_H diff --git a/src/ADAPTGUI/MonEditBoundaryAn.cxx b/src/ADAPTGUI/MonEditBoundaryAn.cxx new file mode 100644 index 000000000..6f7889d94 --- /dev/null +++ b/src/ADAPTGUI/MonEditBoundaryAn.cxx @@ -0,0 +1,399 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonEditBoundaryAn.h" + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include + +using namespace std; + +// ------------------------------------------------------------------------ +MonEditBoundaryAn::MonEditBoundaryAn( MonCreateCase* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString caseName, QString Name ): +// ------------------------------------------------------------------------ +/* Constructs a MonEditBoundaryAn + herite de MonCreateBoundaryAn +*/ + MonCreateBoundaryAn(parent, myHomardGen, caseName) +{ + MESSAGE("Debut de MonEditBoundaryAn pour " << Name.toStdString().c_str()); + setWindowTitle(QObject::tr("HOM_BOUN_A_EDIT_WINDOW_TITLE")); + _Name=Name; + aBoundaryAn = myHomardGen->GetBoundary(_Name.toStdString().c_str()); + InitValEdit(); +} +// ------------------------------------------------------------------------ +MonEditBoundaryAn::~MonEditBoundaryAn() +// ------------------------------------------------------------------------ +{ + // no need to delete child widgets, Qt does it all for us +} +// ------------------------------------------------------------------------ +void MonEditBoundaryAn::InitValEdit() +// ------------------------------------------------------------------------ +{ + LEName->setText(_Name); + LEName->setReadOnly(true); + _Type = aBoundaryAn->GetType(); + MESSAGE("_Type : "<<_Type); + InitValBoundaryAnLimit(); + if (_aCaseName != QString("")) InitValBoundaryAn(); + switch (_Type) + { + case 1 : // il s agit d un cylindre + { + InitValBoundaryAnCylindre(); + SetCylinder(); + break; + } + case 2: // il s agit d une sphere + { + InitValBoundaryAnSphere(); + SetSphere(); + break; + } + case 3: // il s agit d un cone defini par un axe et un angle + { + InitValBoundaryAnConeA(); + SetConeA(); + break; + } + case 4: // il s agit d un cone defini par les 2 rayons + { + InitValBoundaryAnConeR(); + SetConeR(); + break; + } + case 5: // il s agit d un tore + { + InitValBoundaryAnTore(); + SetTore(); + break; + } + }; +} +// ------------------------------------------------------------------------ +void MonEditBoundaryAn::InitValBoundaryAnLimit() +// ------------------------------------------------------------------------ +{ + HOMARD::double_array_var mesCoordLimits = aBoundaryAn->GetLimit(); + ASSERT(mesCoordLimits->length() == 3 ); + _Xincr=mesCoordLimits[0]; + _Yincr=mesCoordLimits[1]; + _Zincr=mesCoordLimits[2]; +} +// ------------------------------------------------------------------------ +void MonEditBoundaryAn::InitValBoundaryAnCylindre() +// ------------------------------------------------------------------------ +{ + HOMARD::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords(); + ASSERT(mesCoordBoundary->length() == 7 ); + _BoundaryAnXcentre=mesCoordBoundary[0]; + _BoundaryAnYcentre=mesCoordBoundary[1]; + _BoundaryAnZcentre=mesCoordBoundary[2]; + _BoundaryAnXaxis=mesCoordBoundary[3]; + _BoundaryAnYaxis=mesCoordBoundary[4]; + _BoundaryAnZaxis=mesCoordBoundary[5]; + _BoundaryAnRayon=mesCoordBoundary[6]; +} +// ------------------------------------------------------------------------ +void MonEditBoundaryAn::InitValBoundaryAnSphere() +// ------------------------------------------------------------------------ +{ + HOMARD::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords(); + ASSERT(mesCoordBoundary->length() == 4 ); + _BoundaryAnXcentre=mesCoordBoundary[0]; + _BoundaryAnYcentre=mesCoordBoundary[1]; + _BoundaryAnZcentre=mesCoordBoundary[2]; + _BoundaryAnRayon=mesCoordBoundary[3]; +} +// ------------------------------------------------------------------------ +void MonEditBoundaryAn::InitValBoundaryAnConeA() +// ------------------------------------------------------------------------ +{ + HOMARD::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords(); + ASSERT(mesCoordBoundary->length() == 7 ); + _BoundaryAnXaxisCone=mesCoordBoundary[0]; + _BoundaryAnYaxisCone=mesCoordBoundary[1]; + _BoundaryAnZaxisCone=mesCoordBoundary[2]; + _BoundaryAngle=mesCoordBoundary[3]; + _BoundaryAnXorigCone=mesCoordBoundary[4]; + _BoundaryAnYorigCone=mesCoordBoundary[5]; + _BoundaryAnZorigCone=mesCoordBoundary[6]; + convertRayonAngle(-1) ; +} +// ------------------------------------------------------------------------ +void MonEditBoundaryAn::InitValBoundaryAnConeR() +// ------------------------------------------------------------------------ +{ + HOMARD::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords(); + ASSERT(mesCoordBoundary->length() == 8 ); + _BoundaryAnXcone1=mesCoordBoundary[0]; + _BoundaryAnYcone1=mesCoordBoundary[1]; + _BoundaryAnZcone1=mesCoordBoundary[2]; + _BoundaryAnRayon1=mesCoordBoundary[3]; + _BoundaryAnXcone2=mesCoordBoundary[4]; + _BoundaryAnYcone2=mesCoordBoundary[5]; + _BoundaryAnZcone2=mesCoordBoundary[6]; + _BoundaryAnRayon2=mesCoordBoundary[7]; + convertRayonAngle(1) ; +} +// ------------------------------------------------------------------------ +void MonEditBoundaryAn::InitValBoundaryAnTore() +// ------------------------------------------------------------------------ +{ + HOMARD::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords(); + ASSERT(mesCoordBoundary->length() == 8 ); + _BoundaryAnXcentre=mesCoordBoundary[0]; + _BoundaryAnYcentre=mesCoordBoundary[1]; + _BoundaryAnZcentre=mesCoordBoundary[2]; + _BoundaryAnXaxis=mesCoordBoundary[3]; + _BoundaryAnYaxis=mesCoordBoundary[4]; + _BoundaryAnZaxis=mesCoordBoundary[5]; + _BoundaryAnRayon1=mesCoordBoundary[6]; + _BoundaryAnRayon2=mesCoordBoundary[7]; +} +// ------------------------------------------------------------------------ +void MonEditBoundaryAn::SetCylinder() +// ------------------------------------------------------------------------ +{ + gBCylindre->setVisible(1); + gBSphere->setVisible(0); + gBCone->setVisible(0); + gBTore->setVisible(0); + RBCylindre->setChecked(1); + _Type=1; + RBSphere->setDisabled(true); + RBCone->setDisabled(true); + RBTore->setDisabled(true); + + SpinBox_Xcent->setValue(_BoundaryAnXcentre); + SpinBox_Ycent->setValue(_BoundaryAnYcentre); + SpinBox_Zcent->setValue(_BoundaryAnZcentre); + + SpinBox_Xaxis->setValue(_BoundaryAnXaxis); + SpinBox_Yaxis->setValue(_BoundaryAnYaxis); + SpinBox_Zaxis->setValue(_BoundaryAnZaxis); + + + SpinBox_Xaxis->setSingleStep(0.1); + SpinBox_Xcentre->setSingleStep(_Xincr); + SpinBox_Yaxis->setSingleStep(0.1); + SpinBox_Ycentre->setSingleStep(_Yincr); + SpinBox_Zaxis->setSingleStep(0.1); + SpinBox_Zcentre->setSingleStep(_Zincr); +// Rayon + SpinBox_Radius->setValue(_BoundaryAnRayon); + SpinBox_Radius->setSingleStep(_BoundaryAnRayon/10.); +// + adjustSize(); +} +// ------------------------------------------------------------------------ +void MonEditBoundaryAn::SetSphere() +// ------------------------------------------------------------------------ +{ + gBCylindre->setVisible(0); + gBSphere->setVisible(1); + RBSphere->setChecked(1); + gBCone->setVisible(0); + gBTore->setVisible(0); + RBCylindre->setDisabled(true); + RBCone->setDisabled(true); + RBTore->setDisabled(true); + _Type=2 ; + + SpinBox_Xcentre->setValue(_BoundaryAnXcentre); + if ( _Xincr > 0) { SpinBox_Xcentre->setSingleStep(_Xincr); } + else { SpinBox_Xcentre->setSingleStep(1) ; } + + SpinBox_Ycentre->setValue(_BoundaryAnYcentre); + if ( _Yincr > 0) { SpinBox_Ycentre->setSingleStep(_Yincr); } + else { SpinBox_Ycentre->setSingleStep(1) ; } + + SpinBox_Zcentre->setValue(_BoundaryAnZcentre); + if ( _Zincr > 0) { SpinBox_Zcentre->setSingleStep(_Zincr); } + else { SpinBox_Zcentre->setSingleStep(1);} + + SpinBox_Rayon->setValue(_BoundaryAnRayon); +// + adjustSize(); +} +// ------------------------------------------------------------------------ +void MonEditBoundaryAn::SetConeA() +// ------------------------------------------------------------------------ +{ + gBCylindre->setVisible(0); + gBSphere->setVisible(0); + gBCone->setVisible(1); + RBCone->setChecked(1); + gBTore->setVisible(0); + RB_Def_angle->setChecked(1); + RBCylindre->setDisabled(true); + RBSphere->setDisabled(true); + RBTore->setDisabled(true); + _Type=3; +// + TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X axis", 0)); + SpinBox_Cone_X1->setValue(_BoundaryAnXaxisCone); + TLCone_Y1->setText(QApplication::translate("CreateBoundaryAn", "Y axis", 0)); + SpinBox_Cone_Y1->setValue(_BoundaryAnYaxisCone); + TLCone_Z1->setText(QApplication::translate("CreateBoundaryAn", "Z axis", 0)); + SpinBox_Cone_Z1->setValue(_BoundaryAnZaxisCone); +// + TLCone_X2->setText(QApplication::translate("CreateBoundaryAn", "X centre", 0)); + SpinBox_Cone_X2->setValue(_BoundaryAnXorigCone); + TLCone_Y2->setText(QApplication::translate("CreateBoundaryAn", "Y centre", 0)); + SpinBox_Cone_Y2->setValue(_BoundaryAnYorigCone); + TLCone_Z2->setText(QApplication::translate("CreateBoundaryAn", "Z centre", 0)); + SpinBox_Cone_Z2->setValue(_BoundaryAnZorigCone); +// + TLCone_V1->setText(QApplication::translate("CreateBoundaryAn", "Angle", 0)); + SpinBox_Cone_V1->setValue(_BoundaryAngle); + SpinBox_Cone_V1->setSingleStep(1.); + SpinBox_Cone_V1->setMaximum(90.); +// + TLCone_V2->setVisible(0); + SpinBox_Cone_V2->setVisible(0); +// + adjustSize(); +} +// ------------------------------------------------------------------------ +void MonEditBoundaryAn::SetConeR() +// ------------------------------------------------------------------------ +{ + gBCylindre->setVisible(0); + gBSphere->setVisible(0); + gBCone->setVisible(1); + gBTore->setVisible(0); + RBCone->setChecked(1); + RB_Def_radius->setChecked(1); + RBCylindre->setDisabled(true); + RBSphere->setDisabled(true); + RBTore->setDisabled(true); + _Type=4; +// + TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X centre 1", 0)); + SpinBox_Cone_X1->setValue(_BoundaryAnXcone1); + TLCone_Y1->setText(QApplication::translate("CreateBoundaryAn", "Y centre 1", 0)); + SpinBox_Cone_Y1->setValue(_BoundaryAnYcone1); + TLCone_Z1->setText(QApplication::translate("CreateBoundaryAn", "Z centre 1", 0)); + SpinBox_Cone_Z1->setValue(_BoundaryAnZcone1); +// + TLCone_V1->setText(QApplication::translate("CreateBoundaryAn", "Radius 1", 0)); + SpinBox_Cone_V1->setSingleStep(_Rayon/10.); + SpinBox_Cone_V1->setMaximum(100000.*_DMax); + SpinBox_Cone_V1->setValue(_BoundaryAnRayon1); +// + TLCone_X2->setText(QApplication::translate("CreateBoundaryAn", "X centre 2", 0)); + SpinBox_Cone_X2->setValue(_BoundaryAnXcone2); + TLCone_Y2->setText(QApplication::translate("CreateBoundaryAn", "Y centre 2", 0)); + SpinBox_Cone_Y2->setValue(_BoundaryAnYcone2); + TLCone_Z2->setText(QApplication::translate("CreateBoundaryAn", "Z centre 2", 0)); + SpinBox_Cone_Z2->setValue(_BoundaryAnZcone2); +// + TLCone_V2->setVisible(1); + SpinBox_Cone_V2->setVisible(1); + TLCone_V2->setText(QApplication::translate("CreateBoundaryAn", "Radius 2", 0)); + SpinBox_Cone_V2->setValue(_BoundaryAnRayon2); +// + adjustSize(); +} +// ------------------------------------------------------------------------ +void MonEditBoundaryAn::SetTore() +// ------------------------------------------------------------------------ +{ + gBCylindre->setVisible(0); + gBSphere->setVisible(0); + gBCone->setVisible(0); + gBTore->setVisible(1); + RBTore->setChecked(1); + _Type=5; + RBCylindre->setDisabled(true); + RBSphere->setDisabled(true); + RBCone->setDisabled(true); + + SpinBoxToreXcent->setValue(_BoundaryAnXcentre); + SpinBoxToreYcent->setValue(_BoundaryAnYcentre); + SpinBoxToreZcent->setValue(_BoundaryAnZcentre); + + SpinBoxToreXaxe->setValue(_BoundaryAnXaxis); + SpinBoxToreYaxe->setValue(_BoundaryAnYaxis); + SpinBoxToreZaxe->setValue(_BoundaryAnZaxis); + + + SpinBoxToreXaxe->setSingleStep(0.1); + SpinBoxToreXcent->setSingleStep(_Xincr); + SpinBoxToreYaxe->setSingleStep(0.1); + SpinBoxToreYcent->setSingleStep(_Yincr); + SpinBoxToreZaxe->setSingleStep(0.1); + SpinBoxToreZcent->setSingleStep(_Zincr); +// Rayon de revolution + SpinBoxToreRRev->setValue(_BoundaryAnRayon1); + SpinBoxToreRRev->setSingleStep(_BoundaryAnRayon1/10.); +// Rayon primaire + SpinBoxToreRPri->setValue(_BoundaryAnRayon2); + SpinBoxToreRPri->setSingleStep(_BoundaryAnRayon2/10.); +// + adjustSize(); +} +// --------------------------------------------------- +bool MonEditBoundaryAn::CreateOrUpdateBoundaryAn() +//---------------------------------------------------- +// Mise a jour des attributs de la BoundaryAn +{ + switch (_Type) + { + case 1 : // il s agit d un cylindre + { + aBoundaryAn->SetCylinder(_BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnXaxis, _BoundaryAnYaxis, _BoundaryAnZaxis, _BoundaryAnRayon ); + break; + } + case 2 : // il s agit d une sphere + { + aBoundaryAn->SetSphere(_BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnRayon); + break; + } + case 3 : // il s agit d un cone defini par un axe et un angle + { + aBoundaryAn = myHomardGen->CreateBoundaryConeA(CORBA::string_dup(_Name.toStdString().c_str()), \ + _BoundaryAnXaxisCone, _BoundaryAnYaxisCone, _BoundaryAnZaxisCone, _BoundaryAngle, \ + _BoundaryAnXorigCone, _BoundaryAnYorigCone, _BoundaryAnYorigCone); + break; + } + case 4 : // il s agit d un cone defini par les 2 rayons + { + aBoundaryAn = myHomardGen->CreateBoundaryConeR(CORBA::string_dup(_Name.toStdString().c_str()), \ + _BoundaryAnXcone1, _BoundaryAnYcone1, _BoundaryAnZcone1, _BoundaryAnRayon1, \ + _BoundaryAnXcone2, _BoundaryAnYcone2, _BoundaryAnZcone2, _BoundaryAnRayon2); + break; + } + case 5 : // il s agit d un tore + { + aBoundaryAn->SetTorus(_BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnXaxis, _BoundaryAnYaxis, _BoundaryAnZaxis, _BoundaryAnRayon1, _BoundaryAnRayon2 ); + break; + } + } + if (Chgt) myHomardGen->InvalideBoundary(_Name.toStdString().c_str()); + HOMARD_UTILS::updateObjBrowser(); + return true; +} + diff --git a/src/ADAPTGUI/MonEditBoundaryAn.h b/src/ADAPTGUI/MonEditBoundaryAn.h new file mode 100644 index 000000000..ea98981e3 --- /dev/null +++ b/src/ADAPTGUI/MonEditBoundaryAn.h @@ -0,0 +1,61 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_EDITBOUNDARYAN_H +#define MON_EDITBOUNDARYAN_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) + +#include + +class HOMARD_EXPORT MonEditBoundaryAn : public MonCreateBoundaryAn +{ + Q_OBJECT +public: + MonEditBoundaryAn( MonCreateCase* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString caseName, QString Name); + virtual ~MonEditBoundaryAn(); + +protected : + bool CreateOrUpdateBoundaryAn(); + void InitValEdit(); + void InitValBoundaryAnLimit(); + void SetCylinder(); + void SetSphere(); + void SetConeR(); + void SetConeA(); + void SetTore(); + void InitValBoundaryAnCylindre(); + void InitValBoundaryAnSphere(); + void InitValBoundaryAnConeR(); + void InitValBoundaryAnConeA(); + void InitValBoundaryAnTore(); + +public slots: + +}; + +#endif // MON_EDITZONE_H diff --git a/src/ADAPTGUI/MonEditBoundaryCAO.cxx b/src/ADAPTGUI/MonEditBoundaryCAO.cxx new file mode 100644 index 000000000..36e3714ed --- /dev/null +++ b/src/ADAPTGUI/MonEditBoundaryCAO.cxx @@ -0,0 +1,105 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonEditBoundaryCAO.h" +#include "MonEditListGroupCAO.h" + +#include + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include + +using namespace std; + +// ------------------------------------------------------------------------------------------------------------------------------------- +MonEditBoundaryCAO::MonEditBoundaryCAO( MonCreateCase* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString caseName, QString Name): +// ------------------------------------------------------------------------------------------------------------------------------------- +/* Constructs a MonEditBoundaryCAO + herite de MonCreateBoundaryCAO +*/ + MonCreateBoundaryCAO(parent, modal, myHomardGen, caseName, Name) +{ + MESSAGE("Debut de Boundary pour " << Name.toStdString().c_str()); + setWindowTitle(QObject::tr("HOM_BOUN_C_EDIT_WINDOW_TITLE")); + try + { + aBoundary=myHomardGen->GetBoundary(CORBA::string_dup(_aName.toStdString().c_str())); + if (caseName==QString("")) { _aCaseName=aBoundary->GetCaseCreation();} + InitValEdit(); + } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + return; + } + + HOMARD::ListGroupType_var maListe = aBoundary->GetGroups(); + for ( int i = 0; i < maListe->length(); i++ ) + _listeGroupesBoundary << QString(maListe[i]); + +} +// ------------------------------ +MonEditBoundaryCAO::~MonEditBoundaryCAO() +// ------------------------------ +{ +} +// ------------------------------ +void MonEditBoundaryCAO::InitValEdit() +// ------------------------------ +{ + LEName->setText(_aName); + LEName->setReadOnly(true); + + QString aDataFile = aBoundary->GetDataFile(); + LEFileName->setText(aDataFile); + LEFileName->setReadOnly(1); + PushFichier->setVisible(0); +// + adjustSize(); +} +// ------------------------------ +bool MonEditBoundaryCAO::PushOnApply() +// ------------------------------ +{ + return true; +} +// ------------------------------------------------------------------------ +void MonEditBoundaryCAO::SetFiltrage() +// // ------------------------------------------------------------------------ +{ + if (!CBGroupe->isChecked()) return; + if (_aCaseName.toStdString().c_str() == QString()) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_BOUN_CASE") ); + return; + } + HOMARD::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str()); + HOMARD::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); + + MonEditListGroupCAO *aDlg = new MonEditListGroupCAO(NULL, this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), + _aCaseName, _listeGroupesBoundary) ; + aDlg->show(); +} + diff --git a/src/ADAPTGUI/MonEditBoundaryCAO.h b/src/ADAPTGUI/MonEditBoundaryCAO.h new file mode 100644 index 000000000..01ac507b8 --- /dev/null +++ b/src/ADAPTGUI/MonEditBoundaryCAO.h @@ -0,0 +1,51 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_EDITBOUNDARYCAO_H +#define MON_EDITBOUNDARYCAO_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) + +#include + +class HOMARD_EXPORT MonEditBoundaryCAO : public MonCreateBoundaryCAO +{ + Q_OBJECT +public: + MonEditBoundaryCAO( MonCreateCase* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString caseName, QString Name ); + virtual ~MonEditBoundaryCAO(); + +protected : + virtual void InitValEdit(); + virtual bool PushOnApply(); + virtual void SetFiltrage(); + +public slots: + +}; + +#endif diff --git a/src/ADAPTGUI/MonEditBoundaryDi.cxx b/src/ADAPTGUI/MonEditBoundaryDi.cxx new file mode 100644 index 000000000..d891732c0 --- /dev/null +++ b/src/ADAPTGUI/MonEditBoundaryDi.cxx @@ -0,0 +1,105 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonEditBoundaryDi.h" +#include "MonEditListGroup.h" + +#include + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include + +using namespace std; + +// ------------------------------------------------------------------------------------------------------------------------------------- +MonEditBoundaryDi::MonEditBoundaryDi( MonCreateCase* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString caseName, QString Name): +// ------------------------------------------------------------------------------------------------------------------------------------- +/* Constructs a MonEditBoundaryDi + herite de MonCreateBoundaryDi +*/ + MonCreateBoundaryDi(parent, modal, myHomardGen, caseName, Name) +{ + MESSAGE("Debut de Boundary pour " << Name.toStdString().c_str()); + setWindowTitle(QObject::tr("HOM_BOUN_D_EDIT_WINDOW_TITLE")); + try + { + aBoundary=myHomardGen->GetBoundary(CORBA::string_dup(_aName.toStdString().c_str())); + if (caseName==QString("")) { _aCaseName=aBoundary->GetCaseCreation();} + InitValEdit(); + } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + return; + } + + HOMARD::ListGroupType_var maListe = aBoundary->GetGroups(); + for ( int i = 0; i < maListe->length(); i++ ) + _listeGroupesBoundary << QString(maListe[i]); + +} +// ------------------------------ +MonEditBoundaryDi::~MonEditBoundaryDi() +// ------------------------------ +{ +} +// ------------------------------ +void MonEditBoundaryDi::InitValEdit() +// ------------------------------ +{ + LEName->setText(_aName); + LEName->setReadOnly(true); + + QString aDataFile = aBoundary->GetDataFile(); + LEFileName->setText(aDataFile); + LEFileName->setReadOnly(1); + PushFichier->setVisible(0); +// + adjustSize(); +} +// ------------------------------ +bool MonEditBoundaryDi::PushOnApply() +// ------------------------------ +{ + return true; +} +// ------------------------------------------------------------------------ +void MonEditBoundaryDi::SetFiltrage() +// // ------------------------------------------------------------------------ +{ + if (!CBGroupe->isChecked()) return; + if (_aCaseName.toStdString().c_str() == QString()) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_BOUN_CASE") ); + return; + } + HOMARD::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str()); + HOMARD::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); + + MonEditListGroup *aDlg = new MonEditListGroup(NULL, this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), + _aCaseName, _listeGroupesBoundary) ; + aDlg->show(); +} + diff --git a/src/ADAPTGUI/MonEditBoundaryDi.h b/src/ADAPTGUI/MonEditBoundaryDi.h new file mode 100644 index 000000000..123b12340 --- /dev/null +++ b/src/ADAPTGUI/MonEditBoundaryDi.h @@ -0,0 +1,51 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_EDITBOUNDARYDI_H +#define MON_EDITBOUNDARYDI_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) + +#include + +class HOMARD_EXPORT MonEditBoundaryDi : public MonCreateBoundaryDi +{ + Q_OBJECT +public: + MonEditBoundaryDi( MonCreateCase* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString caseName, QString Name ); + virtual ~MonEditBoundaryDi(); + +protected : + virtual void InitValEdit(); + virtual bool PushOnApply(); + virtual void SetFiltrage(); + +public slots: + +}; + +#endif diff --git a/src/ADAPTGUI/MonEditCase.cxx b/src/ADAPTGUI/MonEditCase.cxx new file mode 100644 index 000000000..d6304c54c --- /dev/null +++ b/src/ADAPTGUI/MonEditCase.cxx @@ -0,0 +1,269 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonEditCase.h" + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include + +using namespace std; + +// ------------------------------------------------------------- +/* Constructs a MonEditCase + herite de MonCreateCase +*/ +// ------------------------------------------------------------- +MonEditCase::MonEditCase ( bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString CaseName ): + MonCreateCase(modal, myHomardGen) +{ + MESSAGE("Debut de MonEditCase" << CaseName.toStdString().c_str()); + setWindowTitle(QObject::tr("HOM_CASE_EDIT_WINDOW_TITLE")); + _aCaseName = CaseName; + aCase = myHomardGen->GetCase(_aCaseName.toStdString().c_str()); + InitValEdit(); +} +// ------------------------------ +MonEditCase::~MonEditCase() +// ------------------------------ +{ +} +// ------------------------------ +void MonEditCase::InitValEdit() +// ------------------------------ +{ + MESSAGE("InitValEdit"); + LEName->setText(_aCaseName); + LEName->setReadOnly(true); + + QString aDirName = aCase->GetDirName(); + LEDirName->setText(aDirName); + LEDirName->setReadOnly(true); + PushDir->setVisible(0); + + QString _aitername=aCase->GetIter0Name(); + HOMARD::HOMARD_Iteration_var aIter = myHomardGen->GetIteration(_aitername.toStdString().c_str()); + QString aFileName = aIter->GetMeshFile(); + LEFileName->setText(aFileName); + LEFileName->setReadOnly(true); + PushFichier->setVisible(0); + + int ConfType=aCase->GetConfType(); + if ( ( ConfType == 0 ) || ( ConfType == -1 ) ) { RBConforme->setChecked(true); } + else { RBNonConforme->setChecked(true); }; + RBConforme->setEnabled(false); + RBNonConforme->setEnabled(false); + int ExtType=aCase->GetExtType(); + + +// Suivi de frontiere +// A priori, aucun affichage + GBTypeBoun->setVisible(0); + CBBoundaryD->setVisible(0); + CBBoundaryA->setVisible(0); + GBBoundaryC->setVisible(0); + GBBoundaryD->setVisible(0); + GBBoundaryA->setVisible(0); +// On passe en revue tous les couples (frontiere,groupe) du cas + HOMARD::ListBoundaryGroupType_var mesBoundarys = aCase->GetBoundaryGroup(); + if (mesBoundarys->length()>0) + { + QStringList ListeFron ; + QString NomFron ; + bool BounCAO = false ; + bool BounDi = false ; + bool BounAn = false ; + for (int i=0; ilength(); i++) + { +// Nom de la frontiere + NomFron = mesBoundarys[i++]; + MESSAGE("NomFron "<GetBoundary(NomFron.toStdString().c_str()); + int type_obj = myBoundary->GetType() ; + MESSAGE("type_obj "<addItem(NomFron); + } +// C'est une frontiere discrete +// Rermarque : on ne gere pas les groupes + else if ( type_obj==0 ) + { + BounDi = true ; + CBBoundaryDi->addItem(NomFron); + } +// C'est une frontiere analytique + else + { + BounAn = true ; + int nbcol = TWBoundary->columnCount(); +// On ajoute une ligne pour le groupe + TWBoundary->insertRow(0); +// La colonne 0 comporte le nom du groupe + TWBoundary->setItem( 0, 0, new QTableWidgetItem(QString(mesBoundarys[i]).trimmed())); +// TWBoundary->item( 0, 0 )->setFlags(Qt::ItemIsEnabled |Qt::ItemIsSelectable ); +// Chacune des colonnes suivantes est associé a une frontiere deja presente : on y met une +// case non cochee + for ( int j = 1; j < nbcol; j++ ) + { + TWBoundary->setItem( 0, j, new QTableWidgetItem( QString ("") ) ); + TWBoundary->item( 0, j )->setFlags( 0 ); + TWBoundary->item( 0, j )->setFlags( Qt::ItemIsUserCheckable ); + TWBoundary->item( 0, j )->setCheckState( Qt::Unchecked ); + } +// On cherche si la frontiere en cours d'examen a deja ete rencontree : +// si oui, on stocke son numero de colonne + int ok = -1 ; + for ( int nufr = 0 ; nufritem( 0, ok )->setCheckState( Qt::Checked ); + } + } + MESSAGE("BounCAO "<setVisible(1); + if ( BounCAO ) + { RBBoundaryCAO->setChecked(true); + GBBoundaryC->setVisible(1); + CBBoundaryCAO->setDisabled(true); + PBBoundaryCAONew->setVisible(0); + PBBoundaryCAOHelp->setVisible(0); } + if ( BounDi ) + { RBBoundaryNonCAO->setChecked(true); + GBBoundaryD->setVisible(1); + CBBoundaryDi->setDisabled(true); + PBBoundaryDiNew->setVisible(0); + PBBoundaryDiHelp->setVisible(0); } + if ( BounAn ) + { RBBoundaryNonCAO->setChecked(true); + GBBoundaryA->setVisible(1); +// On rend les cases non modifiables. +// On ne peut pas le faire pour tout le tableau sinon on perd l'ascenseur ! + int nbcol = TWBoundary->columnCount(); + int nbrow = TWBoundary->rowCount(); + for ( int i = 0; i < nbrow; i++ ) + { for ( int j = 0; j < nbcol; j++ ) TWBoundary->item( i, j )->setFlags( Qt::ItemIsSelectable ); } +// on met un nom blanc au coin + QTableWidgetItem *__colItem = new QTableWidgetItem(); + __colItem->setText(QApplication::translate("CreateCase", "", 0)); + TWBoundary->setHorizontalHeaderItem(0, __colItem); +// on cache les boutons inutiles + PBBoundaryAnNew->setVisible(0); + PBBoundaryAnHelp->setVisible(0); + } + RBBoundaryNo->setEnabled(false); + RBBoundaryCAO->setEnabled(false); + RBBoundaryNonCAO->setEnabled(false); + } +// +// Les options avancees (non modifiables) + CBAdvanced->setVisible(0) ; + CBAdvanced->setEnabled(false) ; + int Pyram = aCase->GetPyram(); + MESSAGE("Pyram "< 0 ) || ( ConfType < 0 ) || ( ConfType > 1 ) || ( ExtType > 0 ) ) + { GBAdvancedOptions->setVisible(1); +// + if ( Pyram > 0 ) + { CBPyramid->setChecked(true); + CBPyramid->setVisible(1); + } + else + { CBPyramid->setChecked(false); + CBPyramid->setVisible(0); + } + CBPyramid->setEnabled(false); +// + if ( ( ConfType == 0 ) || ( ConfType == -1 ) ) + { if ( ConfType == 0 ) { RBStandard->setChecked(true); } + else { RBBox->setChecked(true); } + RBStandard->setVisible(1); + RBBox->setVisible(1); + RBNC1NpA->setVisible(0); + RBNCQuelconque->setVisible(0); + } + else + { if (ConfType==-2) { RBBox->setChecked(true);}; + if (ConfType==1) { RBStandard->setChecked(true);}; + if (ConfType==2) { RBNC1NpA->setChecked(true);}; + if (ConfType==3) { RBNCQuelconque->setChecked(true);}; + RBStandard->setVisible(1); + RBBox->setVisible(1); + RBNC1NpA->setVisible(1); + RBNCQuelconque->setVisible(1); + } + RBStandard->setEnabled(false); + RBBox->setEnabled(false); + RBNC1NpA->setEnabled(false); + RBNCQuelconque->setEnabled(false); +// + if ( ExtType == 0 ) + { GBFormat->setVisible(0); + RBMED->setChecked(true); + } + else + { GBFormat->setVisible(1); + RBMED->setVisible(1); + RBSaturne->setVisible(1); + RBSaturne2D->setVisible(1); + if ( ExtType == 1 ) { RBSaturne->setChecked(true); } + else { RBSaturne2D->setChecked(true); } + } + RBMED->setEnabled(false); + RBSaturne->setEnabled(false); + RBSaturne2D->setEnabled(false); + } + else + { GBAdvancedOptions->setVisible(0); + CBPyramid->setChecked(false); + RBStandard->setChecked(true); + RBMED->setChecked(true); + } +// +// L'etat + int etat = aCase->GetState(); + MESSAGE("etat "<setText(QApplication::translate("CreateCase", "HOM_CASE_EDIT_STATE_0", 0)); } + else { Comment->setText(QApplication::translate("CreateCase", "HOM_CASE_EDIT_STATE", 0)); } + + Comment->setVisible(1); +// + adjustSize(); +} + +// ------------------------------------- +bool MonEditCase::PushOnApply() +// ------------------------------------- +{ + return true ; +}; diff --git a/src/ADAPTGUI/MonEditCase.h b/src/ADAPTGUI/MonEditCase.h new file mode 100644 index 000000000..52c2a2486 --- /dev/null +++ b/src/ADAPTGUI/MonEditCase.h @@ -0,0 +1,50 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_EDITCASE_H +#define MON_EDITCASE_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) + +#include + +class HOMARD_EXPORT MonEditCase : public MonCreateCase +{ + Q_OBJECT +public: + MonEditCase( bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString Name ); + virtual ~MonEditCase(); + +protected : + virtual void InitValEdit(); + virtual bool PushOnApply(); + +public slots: + +}; + +#endif diff --git a/src/ADAPTGUI/MonEditFile.cxx b/src/ADAPTGUI/MonEditFile.cxx new file mode 100644 index 000000000..773b9f394 --- /dev/null +++ b/src/ADAPTGUI/MonEditFile.cxx @@ -0,0 +1,119 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonEditFile.h" + +#include +#include +#include + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include + +using namespace std; + +/* --------------------------------------------------------- + * MonEditFile classe derivee de EditFile + * elle meme generee par uic + * Ouvre le fichier passe en parametre + * et affiche le texte correspondant dans la fenetre de log + * --------------------------------------------------------- + */ + +/* --------------------------------------------------------- + * MonEditFile Constructeur + * --------------------------------------------------------- + */ +MonEditFile::MonEditFile( QWidget* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString aFileName, int option): +// QWidget(0), + Ui_EditFile(), + _aFileName (aFileName), + _option (option), + _codret (0) +{ + MESSAGE("Debut de MonEditFile " << aFileName.toStdString().c_str()); + setupUi(this); + InitConnect(); + EditText(); +} +/* + * Destroys the object and frees any allocated resources + */ +MonEditFile::~MonEditFile() +{ + MESSAGE("Destructeur de ~MonEditFile"); +} +// ------------------------------------------------------------------------ +void MonEditFile::InitConnect() +// ------------------------------------------------------------------------ +{ + connect( buttonQuit, SIGNAL(pressed()), this, SLOT(close())); + connect( buttonPrint, SIGNAL(pressed()), this, SLOT(PushOnPrint())); +} +// ------------------------------------------------------------------------ +void MonEditFile::EditText() +// ------------------------------------------------------------------------ +{ +// Creation de l'objet fichier QT associe + QFile file( _aFileName ); +// Ouverture + bool bOpen = file.open( QIODevice::ReadOnly | QIODevice::Text ) ; +// + if ( bOpen ) + { +// Lecture +// Remarque : il serait plus clair de tout lire d'un coup mais cela ne marche pas ! +// alors on fait ligne par ligne et on cumule en ajoutant un saut de ligne. + QTextStream stream( &file ); + QString tout; + while ( !stream.atEnd() ) + { + tout = tout + stream.readLine() + "\n" ; + } +// tout = stream.readAll() ; + QTBEditFile->setPlainText( tout ); + } + else + { + // Option = 0 : emission d'un message d'erreur + if ( _option == 0 ) + { + MESSAGE( "EditText " << _aFileName.toStdString().c_str() << " est impossible a ouvrir "); + QMessageBox::warning( 0, QObject::tr("HOM_WARNING"), + QObject::tr("HOM_SELECT_FILE_3") ); + } + // Sinon : rien + _codret = 1 ; + } +} +// ------------------------------------------------------------------------ +void MonEditFile::PushOnPrint() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de MonEditFile::PushOnPrint") + QMessageBox::warning( 0, QObject::tr("HOM_WARNING"), + QObject::tr("HOM_INACTIVE_BUTTON") ); + return; +} + + diff --git a/src/ADAPTGUI/MonEditFile.h b/src/ADAPTGUI/MonEditFile.h new file mode 100644 index 000000000..62687b8be --- /dev/null +++ b/src/ADAPTGUI/MonEditFile.h @@ -0,0 +1,64 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_EDITFILE_H +#define MON_EDITFILE_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include "SALOME_Selection.h" +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(HOMARD_Cas) + +#include "ui_EditFile.h" +#include + +class QListBox; +class QDialog; + +class HOMARD_EXPORT MonEditFile : public QWidget, public Ui_EditFile +{ + Q_OBJECT + +public: + MonEditFile( QWidget* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString FileName, int option ); + ~MonEditFile(); + int _codret ; + +protected : + + HOMARD::HOMARD_Gen_var myHomardGen; + QString _aFileName ; + int _option ; + + virtual void InitConnect(); + virtual void EditText(); + +public slots: + virtual void PushOnPrint(); + +}; + +#endif // MON_EDITFILE_H diff --git a/src/ADAPTGUI/MonEditHypothesis.cxx b/src/ADAPTGUI/MonEditHypothesis.cxx new file mode 100644 index 000000000..d7dd550c7 --- /dev/null +++ b/src/ADAPTGUI/MonEditHypothesis.cxx @@ -0,0 +1,463 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonEditHypothesis.h" +#include "MonEditListGroup.h" + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include "HOMARD.hxx" +#include + +using namespace std; + +// ---------------------------------------------------------------------------- +MonEditHypothesis::MonEditHypothesis( MonCreateIteration* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString Name, + QString caseName, QString aFieldFile ): +// ---------------------------------------------------------------------------- +/* Constructs a MonEditHypothesis + herite de MonCreateHypothesis +*/ + MonCreateHypothesis(parent, modal,myHomardGen, Name, caseName, aFieldFile) +{ + MESSAGE("Hypothese " << Name.toStdString().c_str()); + setWindowTitle(QObject::tr("HOM_HYPO_EDIT_WINDOW_TITLE")); + aHypothesis = myHomardGen->GetHypothesis(_Name.toStdString().c_str()); + if (caseName == QString("") ){ _aCaseName = aHypothesis->GetCaseCreation();} + InitValEdit(); + InitGroupes(); +} +// ------------------------------ +MonEditHypothesis::~MonEditHypothesis() +// ------------------------------ +{ +} +// ------------------------------ +void MonEditHypothesis::InitGroupes() +// ------------------------------ +{ + HOMARD::ListGroupType_var maListe = aHypothesis->GetGroups(); + for ( int i = 0; i < maListe->length(); i++ ) + _aListeGroupes << QString(maListe[i]); + + if (maListe->length() == 0) { CBGroupe->hide();} +} + +// ------------------------------ +void MonEditHypothesis::InitValEdit() +// ------------------------------ +{ + MESSAGE("Debut de InitValEdit"); + LEName->setText(_Name); + LEName->setReadOnly(true); + HOMARD::listeTypes_var ListTypes (aHypothesis->GetAdapRefinUnRef()); + ASSERT( ListTypes->length()==3) ; + _aTypeAdap = ListTypes[0]; + _aTypeRaff = ListTypes[1]; + _aTypeDera = ListTypes[2]; + + if (_aTypeAdap == -1) InitAdaptUniforme(); + if (_aTypeAdap == 0) InitAdaptZone(); + if (_aTypeAdap == 1) InitAdaptChamps(); + + RBUniDera->setDisabled(true); + RBUniRaff->setDisabled(true); + + InitFieldInterp(); + + if (_aTypeAdap == 1 || _TypeFieldInterp >= 1 ) + { + if (_aFieldFile == QString("")) { GBFieldFile->setVisible(0); } + else + { + GBFieldFile->setVisible(1); + LEFieldFile->setText(_aFieldFile); + LEFieldFile->setReadOnly(1); + } + } + else + { + GBFieldFile->setVisible(0); + } +// Les options avancees (non modifiables) + CBAdvanced->setVisible(0) ; + int NivMax = aHypothesis->GetNivMax(); + double DiamMin = aHypothesis->GetDiamMin(); + int AdapInit = aHypothesis->GetAdapInit(); + int ExtraOutput = aHypothesis->GetExtraOutput(); + if ( NivMax > 0 || DiamMin > 0 || AdapInit != 0 || ExtraOutput != 1 ) + { GBAdvancedOptions->setVisible(1); + if ( NivMax > 0 ) + { SpinBoxNivMax->setValue(NivMax); + SpinBoxNivMax->setDisabled(true); } + else + { TLMaximalLevel->setVisible(0); + SpinBoxNivMax->setVisible(0); } + if ( DiamMin > 0 ) + { doubleSpinBoxDiamMin->setValue(DiamMin); + doubleSpinBoxDiamMin->setDisabled(true); } + else + { TLMinimalDiameter->setVisible(0); + doubleSpinBoxDiamMin->setVisible(0); } + if ( AdapInit != 0 ) + { + if ( AdapInit > 0 ) + { RBAIR->setChecked(true); } + else + { RBAID->setChecked(true); } + RBAIN->setEnabled(false); + RBAIR->setEnabled(false); + RBAID->setEnabled(false); + } + else + { GBAdapInit->setVisible(0) ; + } + if ( ExtraOutput % 2 == 0 ) + { + CBOutputLevel->setChecked(true); + CBOutputLevel->setEnabled(false); + } + else { CBOutputLevel->setVisible(0) ; } + if ( ExtraOutput % 3 == 0 ) + { + CBOutputQuality->setChecked(true); + CBOutputQuality->setEnabled(false); + } + else { CBOutputQuality->setVisible(0) ; } + if ( ExtraOutput % 5 == 0 ) + { + CBOutputDiameter->setChecked(true); + CBOutputDiameter->setEnabled(false); + } + else { CBOutputDiameter->setVisible(0) ; } + if ( ExtraOutput % 7 == 0 ) + { + CBOutputParent->setChecked(true); + CBOutputParent->setEnabled(false); + } + else { CBOutputParent->setVisible(0) ; } + if ( ExtraOutput % 11 == 0 ) + { + CBOutputVoisins->setChecked(true); + CBOutputVoisins->setEnabled(false); + } + else { CBOutputVoisins->setVisible(0) ; } + } + else + { GBAdvancedOptions->setVisible(0); } +// +} +// ---------------------------------------- +void MonEditHypothesis::InitAdaptUniforme() +// ---------------------------------------- +// Affichage des informations pour une adaptation uniforme +{ +// Choix des options generales + GBFieldManagement->setVisible(0); + GBAreaManagement->setVisible(0); + GBUniform->setVisible(1); + RBUniforme->setChecked(true); + RBUniforme->setEnabled(false); + RBChamp->setEnabled(false); + RBZone->setEnabled(false); +// +// Raffinement ou deraffinement ? + if (_aTypeDera == 0) + { + VERIFICATION(_aTypeRaff==1); + RBUniDera->setChecked(false); + RBUniRaff->setChecked(true); + } + if (_aTypeDera == 1) + { + VERIFICATION(_aTypeRaff==0); + RBUniDera->setChecked(true); + RBUniRaff->setChecked(false); + } +// + adjustSize(); +// +} +// ------------------------------------- +void MonEditHypothesis::InitAdaptZone() +// ------------------------------------- +// Affichage des informations pour une adaptation selon des zones : +{ + MESSAGE ("Debut de InitAdaptZone"); +// Choix des options generales + GBUniform->setVisible(0); + GBFieldManagement->setVisible(0); + GBAreaManagement->setVisible(1); + RBZone->setChecked(true); + RBChamp->setEnabled(false); + RBUniforme->setEnabled(false); + RBZone->setEnabled(false); + +// Recuperation de toutes les zones decrites et notation de celles retenues + GetAllZones(); + HOMARD::listeZonesHypo_var mesZonesAvant = aHypothesis->GetZones(); + for (int i=0; ilength(); i++) + { + MESSAGE ("i"<rowCount(); j++) + { + MESSAGE (". j"<item(j,2)->text().toStdString()); + if ( TWZone->item(j,2)->text().toStdString() == string(mesZonesAvant[i]) ) + { + MESSAGE ("OK avec "<item( j,0 )->setCheckState( Qt::Checked ); + TWZone->item( j,1 )->setCheckState( Qt::Unchecked ); } + else + { + MESSAGE ("... DERA"); + TWZone->item( j,0 )->setCheckState( Qt::Unchecked ); + TWZone->item( j,1 )->setCheckState( Qt::Checked ); } + break; + } + } + i += 1 ; + } +// +// Inactivation des choix + for ( int j =0 ; j < TWZone->rowCount(); j++) + { + TWZone->item( j, 0 )->setFlags(0); + TWZone->item( j, 1 )->setFlags(0); + } + PBZoneNew->setVisible(0); +// + adjustSize(); +// +} +// ------------------------------------- +void MonEditHypothesis::InitAdaptChamps() +// ------------------------------------- +// Affichage des informations pour une adaptation selon un champ : +// . Nom du champ +// . Composantes +// . Seuils +// . Absolu/relatif +{ + MESSAGE ("Debut de InitAdaptChamps"); +// Choix des options generales + GBUniform->setVisible(0); + GBAreaManagement->setVisible(0); + GBFieldManagement->setVisible(1); + RBChamp->setChecked(true); + RBUniforme->setEnabled(false); + RBChamp->setEnabled(false); + RBZone->setEnabled(false); + + HOMARD::InfosHypo_var aInfosHypo = aHypothesis->GetField(); + _aFieldName = aInfosHypo->FieldName; + _TypeThR = aInfosHypo->TypeThR; + _ThreshR = aInfosHypo->ThreshR; + _TypeThC = aInfosHypo->TypeThC; + _ThreshC = aInfosHypo->ThreshC; + _UsField = aInfosHypo->UsField; + _UsCmpI = aInfosHypo->UsCmpI; + + CBFieldName->insertItem(0,_aFieldName); + CBFieldName->setCurrentIndex(0); + CBFieldName->setEnabled(false); + //SetFieldName(Qt::Unchecked); + + HOMARD::listeComposantsHypo_var mesComposantsAvant = aHypothesis->GetComps(); + TWCMP->clear(); + TWCMP->setRowCount(0); + TWCMP->resizeRowsToContents(); + for (int i=0; ilength(); i++) + { + TWCMP->insertRow(0); + TWCMP->setItem( 0, 0, new QTableWidgetItem( QString ("") ) ); + TWCMP->item( 0, 0 )->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled); + TWCMP->item( 0, 0 )->setCheckState(Qt::Checked ); + TWCMP->item( 0, 0 )->setFlags( 0 ); + TWCMP->setItem( 0, 1, new QTableWidgetItem(QString(mesComposantsAvant[i]).trimmed())); + TWCMP->item( 0, 1 )->setFlags( Qt::ItemIsEnabled |Qt::ItemIsSelectable ); + } + TWCMP->resizeColumnsToContents(); + TWCMP->resizeRowsToContents(); + TWCMP->clearSelection(); + + // Les seuils de raffinement + RBRAbs->setEnabled(false) ; + RBRRel->setEnabled(false) ; + RBRPE->setEnabled(false) ; + RBRMuSigma->setEnabled(false) ; + RBRNo->setEnabled(false) ; + if (_aTypeRaff== 0 ) + { + SetRNo(); + RBRNo->setEnabled(true) ; + } + else + { + if ( _TypeThR == 1 ) { SpinBox_RAbs->setValue(_ThreshR); SetRAbs(); RBRAbs->setEnabled(true);} + if ( _TypeThR == 2 ) { SpinBox_RRel->setValue(_ThreshR); SetRRel(); RBRRel->setEnabled(true);} + if ( _TypeThR == 3 ) { SpinBox_RPE->setValue(_ThreshR); SetRPE(); RBRPE->setEnabled(true);} + if ( _TypeThR == 4 ) { SpinBox_RMuSigma->setValue(_ThreshR); SetRMS(); RBRMuSigma->setEnabled(true);} + } + + // Les seuils de deraffinement + RBCAbs->setEnabled(false) ; + RBCRel->setEnabled(false) ; + RBCPE->setEnabled(false) ; + RBCMuSigma->setEnabled(false) ; + RBCNo->setEnabled(false) ; + if (_aTypeDera== 0 ) + { + SetCNo(); + RBCNo->setEnabled(true) ; + } + else + { + if ( _TypeThC == 1 ) { SpinBox_CAbs->setValue(_ThreshC); SetCAbs(); RBCAbs->setEnabled(true);} + if ( _TypeThC == 2 ) { SpinBox_CRel->setValue(_ThreshC); SetCRel(); RBCRel->setEnabled(true);} + if ( _TypeThC == 3 ) { SpinBox_CPE->setValue(_ThreshC); SetCPE(); RBCPE->setEnabled(true);} + if ( _TypeThC == 4 ) { SpinBox_CMuSigma->setValue(_ThreshC); SetCMS(); RBCMuSigma->setEnabled(true);} + } + // Le choix de la prise en compte des composantes + if ( TWCMP->rowCount() == 1 ) + { RBL2->setText(QObject::tr("HOM_HYPO_NORM_ABS")); + RBInf->setText(QObject::tr("HOM_HYPO_NORM_REL")); + } + else + { RBL2->setText(QObject::tr("HOM_HYPO_NORM_L2")); + RBInf->setText(QObject::tr("HOM_HYPO_NORM_INF")); + } + if ( _UsField == 0 ) { CBJump->hide(); } + else + { + CBJump->setChecked(true); + CBJump->setEnabled(false); + } + if ( _UsCmpI == 0 ) + { + RBL2->setChecked(true); + RBL2->setEnabled(true); + RBInf->setEnabled(false) ; + } + else + { + RBL2->setEnabled(false) ; + RBInf->setChecked(true); + RBInf->setEnabled(true); + } +// + adjustSize(); +} +// ------------------------------------- +void MonEditHypothesis::InitFieldInterp() +// ------------------------------------- +// Affichage des informations pour les interpolations +{ + MESSAGE ("Debut de InitFieldInterp"); +// Choix des options generales + _TypeFieldInterp = aHypothesis->GetTypeFieldInterp(); + MESSAGE ("_TypeFieldInterp = " << _TypeFieldInterp); +// +// Aucune interpolation + if ( _TypeFieldInterp == 0 ) + { + RBFieldNo->setChecked(true); + TWField->setVisible(0); + } +// Interpolation de tous les champs + if ( _TypeFieldInterp == 1 ) + { + RBFieldAll->setChecked(true); + TWField->setVisible(0); + } +// Interpolation de champs choisis + if ( _TypeFieldInterp == 2 ) + { + RBFieldChosen->setChecked(true); +// + TWField->setVisible(1); + HOMARD::listeFieldInterpsHypo_var mesChampsAvant = aHypothesis->GetFieldInterps(); + TWField->clear(); + TWField->setRowCount(0); + TWField->resizeRowsToContents(); + for (int iaux=0; iauxlength(); iaux++) + { + TWField->insertRow(0); + TWField->setItem( 0, 0, new QTableWidgetItem( QString ("") ) ); + TWField->item( 0, 0 )->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled); + TWField->item( 0, 0 )->setCheckState(Qt::Checked ); + TWField->item( 0, 0 )->setFlags( 0 ); + TWField->setItem( 0, 1, new QTableWidgetItem(QString(mesChampsAvant[iaux]).trimmed())); + TWField->item( 0, 1 )->setFlags( Qt::ItemIsEnabled |Qt::ItemIsSelectable ); + iaux++; + } + TWField->resizeColumnsToContents(); + TWField->resizeRowsToContents(); + TWField->clearSelection(); + } + RBFieldNo->setEnabled(false) ; + RBFieldAll->setEnabled(false) ; + RBFieldChosen->setEnabled(false) ; +} + +// ------------------------------------- +bool MonEditHypothesis::PushOnApply() +// ------------------------------------- +{ +// Pour du raffinement selon un champ, les seuils ont-ils change ? + if ( _aTypeAdap == 1 ) + { + if (_aTypeRaff!= 0 ) + { + if (_TypeThR == 1) { _ThreshR = SpinBox_RAbs->value(); } + if (_TypeThR == 2) { _ThreshR = SpinBox_RRel->value(); } + if (_TypeThR == 3) { _ThreshR = SpinBox_RPE->value(); } + if (_TypeThR == 4) { _ThreshR = SpinBox_RMuSigma->value(); } + aHypothesis->SetRefinThr(_TypeThR, _ThreshR) ; + } + if (_aTypeDera!= 0 ) + { + if (_TypeThC == 1) { _ThreshC = SpinBox_CAbs->value() ; } + if (_TypeThC == 2) { _ThreshC = SpinBox_CRel->value() ; } + if (_TypeThC == 3) { _ThreshC = SpinBox_CPE->value() ; } + if (_TypeThC == 4) { _ThreshC = SpinBox_CMuSigma->value() ; } + aHypothesis->SetUnRefThr(_TypeThC, _ThreshC) ; + } + + myHomardGen->InvalideHypo(_Name.toStdString().c_str()); + HOMARD_UTILS::updateObjBrowser(); + } + return true; +}; +// ------------------------------------------------------------------------ +void MonEditHypothesis::SetFiltrage() +// ------------------------------------------------------------------------ +{ + if (CBGroupe->isChecked()) + { + MonEditListGroup *aDlg = new MonEditListGroup(this, NULL, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen),_aCaseName, _aListeGroupes) ; + aDlg->show(); + } +} + diff --git a/src/ADAPTGUI/MonEditHypothesis.h b/src/ADAPTGUI/MonEditHypothesis.h new file mode 100644 index 000000000..051365b01 --- /dev/null +++ b/src/ADAPTGUI/MonEditHypothesis.h @@ -0,0 +1,56 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_EDITHYPOTHESIS_H +#define MON_EDITHYPOTHESIS_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) + +#include + +class HOMARD_EXPORT MonEditHypothesis : public MonCreateHypothesis +{ + Q_OBJECT +public: + MonEditHypothesis( MonCreateIteration* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString caseName, QString Name, QString aFieldFile ); + virtual ~MonEditHypothesis(); + +protected : + virtual void InitValEdit(); + virtual void InitAdaptUniforme(); + virtual void InitAdaptZone(); + virtual void InitAdaptChamps(); + virtual void InitGroupes(); + virtual void InitFieldInterp(); + virtual void SetFiltrage(); + virtual bool PushOnApply(); + +public slots: + +}; + +#endif diff --git a/src/ADAPTGUI/MonEditIteration.cxx b/src/ADAPTGUI/MonEditIteration.cxx new file mode 100644 index 000000000..e158f27cf --- /dev/null +++ b/src/ADAPTGUI/MonEditIteration.cxx @@ -0,0 +1,186 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonEditIteration.h" + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include + +using namespace std; + +// ------------------------------------------------------------------------------------------------------------------------------------- +MonEditIteration::MonEditIteration ( QWidget* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString IterParentName, QString IterName ): +// ------------------------------------------------------------------------------------------------------------------------------------- +/* Constructs a MonEditIteration + herite de MonCreateIteration +*/ + MonCreateIteration(parent, modal, myHomardGen, IterParentName), + _rank(-1), _step(-1), _IterationName(""), _FieldFile(""),_aTypeAdap() +{ + MESSAGE("Debut de MonEditIteration" << IterName.toStdString().c_str()); + setWindowTitle(QObject::tr("HOM_ITER_EDIT_WINDOW_TITLE")); + _IterationName = IterName; + aIter = myHomardGen->GetIteration(_IterationName.toStdString().c_str()); + +// Attention au cas ou c'est une iteration initiale : il faut inhiber l'essentiel + int etat = aIter->GetState() ; + if ( etat <= 0 ) { InitValEdit0(etat); } + else { InitValEdit(); } +} +// ------------------------------ +MonEditIteration::~MonEditIteration() +// ------------------------------ +{ +} + +// ------------------------------ +void MonEditIteration::InitValEdit0(int etat) +// ------------------------------ +// Cas d'une iteration initiale d'un cas (initial ou poursuite) +{ +// + LEName->setText(_IterationName); + LEName->setReadOnly(true); + +// Invisibilite de l'iteration parent + Iter_Parent->setVisible(0); + PBIterParent->setVisible(0); + LEIterationParentName->setVisible(0); + +// Affichage bloque du nom du maillage de l'iteration courante + QString MeshName = aIter->GetMeshName(); + Mesh_n->setText(QObject::tr("HOM_ITER_STARTING_POINT_0")); + LEMeshName_n->setText(MeshName); + LEMeshName_n->setReadOnly(1); + +// Message general + if ( etat == 0 ) { Mesh_np1->setText(QObject::tr("HOM_ITER_STARTING_POINT_1")) ; } + else { Mesh_np1->setText(QObject::tr("HOM_ITER_STARTING_POINT_2")) ; } + LEMeshName_np1->setVisible(0); +// +// Invisibilite des hypotheses et des champs + Hypothese->setVisible(0); + GBField->setVisible(0); +// +} +// ------------------------------ +void MonEditIteration::InitValEdit() +// ------------------------------ +// Cas d'une iteration courante +{ +// Affichage bloque du nom de l'iteration + LEName->setText(_IterationName); + LEName->setReadOnly(true); + + // Affichage bloque du nom de l'iteration parent + _IterParentName = aIter->GetIterParentName(); + LEIterationParentName->setText(_IterParentName); + LEIterationParentName->setReadOnly(true); + PBIterParent->setEnabled(false); + PBIterParent->setVisible(0); + + // Affichage bloque du nom du maillage de l'iteration parent + aIterParent = myHomardGen->GetIteration(_IterParentName.toStdString().c_str()); + QString MeshNameParent = aIterParent->GetMeshName(); + LEMeshName_n->setText(MeshNameParent); + LEMeshName_n->setReadOnly(1); + + // Affichage bloque du nom du maillage de l'iteration courante + QString MeshName = aIter->GetMeshName(); + LEMeshName_np1->setText(MeshName); + LEMeshName_np1->setReadOnly(1); + + // Affichage de la bonne hypothese + QString HypoName = aIter->GetHypoName(); + CBHypothese->insertItem(0,HypoName); + CBHypothese->setCurrentIndex(0); + CBHypothese->setEnabled(false); + PBHypoNew->setVisible(0); + + // Pour une adaptation selon un champ + HOMARD::HOMARD_Hypothesis_var myHypo = myHomardGen->GetHypothesis(HypoName.toStdString().c_str()) ; + _aTypeAdap = myHypo->GetAdapType() ; + if ( _aTypeAdap == 1 ) + { + _FieldFile = aIter->GetFieldFile(); + LEFieldFile->setText(_FieldFile); + _step = aIter->GetTimeStep() ; + SpinBox_TimeStep->setValue(_step); + _rank = aIter->GetRank() ; + SpinBox_Rank->setValue(_rank); + + // Cas ou on prend le dernier pas de temps ou sans pas de temps + if ( _step <= -1 ) + { + Rank->setVisible(0); + SpinBox_Rank->setVisible(0); + TimeStep->setVisible(0); + SpinBox_TimeStep->setVisible(0); + + if ( _step == -2 ) { RBLast->setChecked(true); } + else { RBNo->setChecked(true); } + } + + // Cas avec pas de temps + else + { + Rank->setVisible(1); + SpinBox_Rank->setVisible(1); + TimeStep->setVisible(1); + SpinBox_TimeStep->setVisible(1); + RBChosen->setChecked(true); + } + } + else + { + GBField->setVisible(0); + } +// + adjustSize(); +// +} + +// ------------------------------------- +bool MonEditIteration::PushOnApply() +// ------------------------------------- +{ + if ( _aTypeAdap == 1) + { +// Pour du raffinement selon un champ, les instants ont-ils change ? + if ( (_FieldFile != LEFieldFile->text().trimmed()) || + ( _rank != SpinBox_Rank->value()) || + ( _step != SpinBox_TimeStep->value())) + { + _FieldFile = LEFieldFile->text().trimmed(); + aIter->SetFieldFile(CORBA::string_dup(_FieldFile.toStdString().c_str())); + _rank = SpinBox_Rank->value(); + _step = SpinBox_TimeStep->value(); + if ( _step == -2 ) { aIter->SetTimeStepRankLast(); } + else { aIter->SetTimeStepRank(_step, _rank); } + myHomardGen->InvalideIter(_IterationName.toStdString().c_str()); + HOMARD_UTILS::updateObjBrowser(); + } + } + return true; + +}; diff --git a/src/ADAPTGUI/MonEditIteration.h b/src/ADAPTGUI/MonEditIteration.h new file mode 100644 index 000000000..0107d4b26 --- /dev/null +++ b/src/ADAPTGUI/MonEditIteration.h @@ -0,0 +1,57 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_EDITITERATION_H +#define MON_EDITITERATION_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) + +#include + +class HOMARD_EXPORT MonEditIteration : public MonCreateIteration +{ + Q_OBJECT +public: + MonEditIteration( QWidget* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString IterParentName, QString Name ); + virtual ~MonEditIteration(); + +protected : + QString _FieldFile ; + QString _IterationName ; + int _aTypeAdap ; + int _rank ; + int _step ; + + virtual void InitValEdit(); + virtual void InitValEdit0(int etat); + virtual bool PushOnApply(); + +public slots: + +}; + +#endif diff --git a/src/ADAPTGUI/MonEditListGroup.cxx b/src/ADAPTGUI/MonEditListGroup.cxx new file mode 100644 index 000000000..d8a68150a --- /dev/null +++ b/src/ADAPTGUI/MonEditListGroup.cxx @@ -0,0 +1,61 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonEditListGroup.h" +#include + +using namespace std; +//--------------------------------------------------------------------- +MonEditListGroup::MonEditListGroup( MonCreateHypothesis* parentHyp, + MonCreateBoundaryDi* parentBound, + bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString aCaseName, + QStringList listeGroupesHypo): +//--------------------------------------------------------------------- +MonCreateListGroup(parentHyp,parentBound,myHomardGen,aCaseName,listeGroupesHypo) +{ + MESSAGE("Debut de MonEditListGroup"); + setWindowTitle(QObject::tr("HOM_GROU_EDIT_WINDOW_TITLE")); + setModal(true); + InitGroupes(); +} + +//------------------------------------ +MonEditListGroup:: ~MonEditListGroup() +//------------------------------------ +{ +} +// ------------------------------------- +void MonEditListGroup:: InitGroupes() +// ------------------------------------- +{ + for (int i = 0; i < _listeGroupesHypo.size(); i++ ) + { + std::cerr << _listeGroupesHypo[i].toStdString().c_str() << std::endl; + TWGroupe->insertRow(i); + TWGroupe->setItem( i, 0, new QTableWidgetItem( QString ("") ) ); + TWGroupe->item( i, 0 )->setFlags( 0 ); + TWGroupe->item( i, 0 )->setCheckState( Qt::Checked ); + TWGroupe->setItem( i, 1, new QTableWidgetItem(_listeGroupesHypo[i])); + } + TWGroupe->resizeRowsToContents(); +} + + diff --git a/src/ADAPTGUI/MonEditListGroup.h b/src/ADAPTGUI/MonEditListGroup.h new file mode 100644 index 000000000..8ea41c935 --- /dev/null +++ b/src/ADAPTGUI/MonEditListGroup.h @@ -0,0 +1,49 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_EDITLISTGROUP_H +#define MON_EDITLISTGROUP_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) + +#include + +class MonCreateHypothesis; +class MonCreateBoundaryDi; +class HOMARD_EXPORT MonEditListGroup : public MonCreateListGroup +{ + Q_OBJECT + +public: + MonEditListGroup( MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); + virtual ~MonEditListGroup(); + +protected : + + virtual void InitGroupes(); + +}; + +#endif // MON_EDITLISTGROUP_H diff --git a/src/ADAPTGUI/MonEditListGroupCAO.cxx b/src/ADAPTGUI/MonEditListGroupCAO.cxx new file mode 100644 index 000000000..5c942fd5a --- /dev/null +++ b/src/ADAPTGUI/MonEditListGroupCAO.cxx @@ -0,0 +1,61 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonEditListGroupCAO.h" +#include + +using namespace std; +//--------------------------------------------------------------------- +MonEditListGroupCAO::MonEditListGroupCAO( MonCreateHypothesis* parentHyp, + MonCreateBoundaryCAO* parentBound, + bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString aCaseName, + QStringList listeGroupesHypo): +//--------------------------------------------------------------------- +MonCreateListGroupCAO(parentHyp,parentBound,myHomardGen,aCaseName,listeGroupesHypo) +{ + MESSAGE("Debut de MonEditListGroupCAO"); + setWindowTitle(QObject::tr("HOM_GROU_EDIT_WINDOW_TITLE")); + setModal(true); + InitGroupes(); +} + +//------------------------------------ +MonEditListGroupCAO:: ~MonEditListGroupCAO() +//------------------------------------ +{ +} +// ------------------------------------- +void MonEditListGroupCAO:: InitGroupes() +// ------------------------------------- +{ + for (int i = 0; i < _listeGroupesHypo.size(); i++ ) + { + std::cerr << _listeGroupesHypo[i].toStdString().c_str() << std::endl; + TWGroupe->insertRow(i); + TWGroupe->setItem( i, 0, new QTableWidgetItem( QString ("") ) ); + TWGroupe->item( i, 0 )->setFlags( 0 ); + TWGroupe->item( i, 0 )->setCheckState( Qt::Checked ); + TWGroupe->setItem( i, 1, new QTableWidgetItem(_listeGroupesHypo[i])); + } + TWGroupe->resizeRowsToContents(); +} + + diff --git a/src/ADAPTGUI/MonEditListGroupCAO.h b/src/ADAPTGUI/MonEditListGroupCAO.h new file mode 100644 index 000000000..4f6ada6db --- /dev/null +++ b/src/ADAPTGUI/MonEditListGroupCAO.h @@ -0,0 +1,49 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_EDITLISTGROUPCAO_H +#define MON_EDITLISTGROUPCAO_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) + +#include + +class MonCreateHypothesis; +class MonCreateBoundaryCAO; +class HOMARD_EXPORT MonEditListGroupCAO : public MonCreateListGroupCAO +{ + Q_OBJECT + +public: + MonEditListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); + virtual ~MonEditListGroupCAO(); + +protected : + + virtual void InitGroupes(); + +}; + +#endif // MON_EDITLISTGROUPCAO_H diff --git a/src/ADAPTGUI/MonEditYACS.cxx b/src/ADAPTGUI/MonEditYACS.cxx new file mode 100644 index 000000000..0c41e5b56 --- /dev/null +++ b/src/ADAPTGUI/MonEditYACS.cxx @@ -0,0 +1,148 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonEditYACS.h" + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include + +using namespace std; + +// ------------------------------------------------------------- +/* Constructs a MonEditYACS + herite de MonCreateYACS +*/ +// ------------------------------------------------------------- +MonEditYACS::MonEditYACS ( bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString Name ): + MonCreateYACS(myHomardGen, Name) +{ + MESSAGE("Debut de MonEditYACS" << Name.toStdString().c_str()); + setWindowTitle(QObject::tr("HOM_YACS_EDIT_WINDOW_TITLE")); + _Name = Name; + aYACS = myHomardGen->GetYACS(_Name.toStdString().c_str()); + InitValEdit(); +} +// ------------------------------ +MonEditYACS::~MonEditYACS() +// ------------------------------ +{ +} +// ------------------------------ +void MonEditYACS::InitValEdit() +// ------------------------------ +{ + MESSAGE("InitValEdit"); + LEName->setText(_Name); + LEName->setReadOnly(true); + + _aCaseName = aYACS->GetCaseName(); + LECaseName->setText(_aCaseName); + LECaseName->setReadOnly(true); + PBCaseName->setVisible(0); + + _aScriptFile = aYACS->GetScriptFile(); + LEScriptFile->setText(_aScriptFile); + + _aDirName = aYACS->GetDirName(); + LEDirName->setText(_aDirName); + LEDirName->setReadOnly(true); + + _aMeshFile = aYACS->GetMeshFile(); + LEMeshFile->setText(_aMeshFile); + + _Type=aYACS->GetType(); + if(_Type==1) { RBConstant->setChecked(true); } + else { RBVariable->setChecked(true); }; + RBConstant->setEnabled(false); + RBVariable->setEnabled(false); + + _MaxIter = aYACS->GetMaxIter(); + SpinBoxMaxIter->setValue(_MaxIter) ; + _MaxNode = aYACS->GetMaxNode(); + SpinBoxMaxNode->setValue(_MaxNode) ; + _MaxElem = aYACS->GetMaxElem(); + SpinBoxMaxElem->setValue(_MaxElem) ; +// +} + +// --------------------------------------------------- +bool MonEditYACS:: CreateOrUpdate() +//---------------------------------------------------- +// Edition/modification du schema +{ + MESSAGE("CreateOrUpdate"); + bool chgt = false ; + int valeur_i ; + // A. Recuperation et comparaison des valeurs + // A.1. Le script de lancement + QString aScriptFile=LEScriptFile->text().trimmed(); + if ( aScriptFile != _aScriptFile ) + { +// MESSAGE("modification de ScriptFile : "<<_aScriptFile.toStdString()<<" devient "<SetScriptFile(CORBA::string_dup(_aScriptFile.toStdString().c_str())) ; + chgt = true ; + } + // A.2. Le maillage initial + QString aMeshFile=LEMeshFile->text().trimmed(); + if ( aMeshFile != _aMeshFile ) + { +// MESSAGE("modification de aMeshFile : "<<_aMeshFile.toStdString()<<" devient "<SetMeshFile(CORBA::string_dup(_aMeshFile.toStdString().c_str())) ; + chgt = true ; + } + // A.3. La convergence + valeur_i = SpinBoxMaxIter->value() ; + if ( valeur_i != _MaxIter ) + { +// MESSAGE("modification de MaxIter : "<<_MaxIter<<" devient "<SetMaxIter(_MaxIter) ; + chgt = true ; + } + valeur_i = SpinBoxMaxNode->value() ; + if ( valeur_i != _MaxNode ) + { +// MESSAGE("modification de MaxNode : "<<_MaxNode<<" devient "<SetMaxNode(_MaxNode) ; + chgt = true ; + } + valeur_i = SpinBoxMaxElem->value() ; + if ( valeur_i != _MaxElem ) + { +// MESSAGE("modification de MaxElem : "<<_MaxElem<<" devient "<SetMaxElem(_MaxElem) ; + chgt = true ; + } +// B. Si changement + if ( chgt ) + { + myHomardGen->InvalideYACS(_Name.toStdString().c_str()); + } + + HOMARD_UTILS::updateObjBrowser(); + return true ; +} diff --git a/src/ADAPTGUI/MonEditYACS.h b/src/ADAPTGUI/MonEditYACS.h new file mode 100644 index 000000000..11fe76d01 --- /dev/null +++ b/src/ADAPTGUI/MonEditYACS.h @@ -0,0 +1,50 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_EDITYACS_H +#define MON_EDITYACS_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) + +#include + +class HOMARD_EXPORT MonEditYACS : public MonCreateYACS +{ + Q_OBJECT +public: + MonEditYACS( bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString Name ); + virtual ~MonEditYACS(); + +protected : + virtual void InitValEdit(); + virtual bool CreateOrUpdate(); + +public slots: + +}; + +#endif diff --git a/src/ADAPTGUI/MonEditZone.cxx b/src/ADAPTGUI/MonEditZone.cxx new file mode 100644 index 000000000..acab891eb --- /dev/null +++ b/src/ADAPTGUI/MonEditZone.cxx @@ -0,0 +1,432 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonEditZone.h" + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include +#include +#include +#include +#include +#include + +using namespace std; + +// ------------------------------------------------------------------------ +MonEditZone::MonEditZone( MonCreateHypothesis* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString caseName, QString Name ): +// ------------------------------------------------------------------------ +/* Constructs a MonEditZone + herite de MonCreateZone +*/ + MonCreateZone(parent, myHomardGen, caseName) +{ + MESSAGE("Debut de MonEditZone pour " << Name.toStdString().c_str()); + setWindowTitle(QObject::tr("HOM_ZONE_EDIT_WINDOW_TITLE")); + _Name=Name; + aZone = myHomardGen->GetZone(_Name.toStdString().c_str()); + InitValEdit(); +} +// ------------------------------------------------------------------------ +MonEditZone::~MonEditZone() +// ------------------------------------------------------------------------ +{ + // no need to delete child widgets, Qt does it all for us +} +// ------------------------------------------------------------------------ +void MonEditZone::InitValEdit() +// ------------------------------------------------------------------------ +{ + MESSAGE("InitValEdit "); + LEName->setText(_Name); + LEName->setReadOnly(true); + _Type = aZone->GetType(); + MESSAGE("InitValEdit _Type ="<<_Type); + InitValZoneLimit(); + if (_aCaseName != QString("")) InitValZone(); + switch (_Type) + { + case 11 : // il s agit d un rectangle + { } + case 12 : // il s agit d un rectangle + { } + case 13 : // il s agit d un rectangle + { } + case 2 : // il s agit d une boite + { + InitValZoneBox(); + SetBox(); + break; + } + case 4 : // il s agit d une sphere + { + InitValZoneSphere(); + SetSphere(); + break; + } + case 31 : // il s agit d un cercle issu d'un cylindre + { } + case 32 : // il s agit d un cercle issu d'un cylindre + { } + case 33 : // il s agit d un cercle issu d'un cylindre + { } + case 5 : // il s agit d un cylindre + { + InitValZoneCylinder(); + SetCylinder(); + break; + } + case 61 : // il s agit d un disque avec trou issu d'un tuyau + { } + case 62 : // il s agit d un disque avec trou issu d'un tuyau + { } + case 63 : // il s agit d un disque avec trou issu d'un tuyau + { } + case 7 : // il s agit d un tuyau + { + InitValZonePipe(); + SetPipe(); + break; + } + }; +} +// ------------------------------------------------------------------------ +void MonEditZone::InitValZoneLimit() +// ------------------------------------------------------------------------ +{ + HOMARD::double_array_var mesCoordLimits = aZone->GetLimit(); + ASSERT(mesCoordLimits->length() == 3 ); + _Xincr=mesCoordLimits[0]; + _Yincr=mesCoordLimits[1]; + _Zincr=mesCoordLimits[2]; +} +// ------------------------------------------------------------------------ +void MonEditZone::InitValZoneBox() +// ------------------------------------------------------------------------ +{ + HOMARD::double_array_var mesCoordZones = aZone->GetCoords(); + ASSERT(mesCoordZones->length() == 6 ); + _ZoneXmin=mesCoordZones[0]; + _ZoneXmax=mesCoordZones[1]; + _ZoneYmin=mesCoordZones[2]; + _ZoneYmax=mesCoordZones[3]; + _ZoneZmin=mesCoordZones[4]; + _ZoneZmax=mesCoordZones[5]; +} +// ------------------------------------------------------------------------ +void MonEditZone::InitValZoneSphere() +// ------------------------------------------------------------------------ +{ + HOMARD::double_array_var mesCoordZones = aZone->GetCoords(); + ASSERT(mesCoordZones->length() == 4 ); + _ZoneXcentre=mesCoordZones[0]; + _ZoneYcentre=mesCoordZones[1]; + _ZoneZcentre=mesCoordZones[2]; + _ZoneRayon=mesCoordZones[3]; + +} +// ------------------------------------------------------------------------ +void MonEditZone::InitValZoneCylinder() +// ------------------------------------------------------------------------ +{ + HOMARD::double_array_var mesCoordZones = aZone->GetCoords(); + ASSERT(mesCoordZones->length() == 8 ); + _ZoneXcentre=mesCoordZones[0]; + _ZoneYcentre=mesCoordZones[1]; + _ZoneZcentre=mesCoordZones[2]; + _ZoneXaxis=mesCoordZones[3]; + _ZoneYaxis=mesCoordZones[4]; + _ZoneZaxis=mesCoordZones[5]; + _ZoneRayon=mesCoordZones[6]; + _ZoneHaut=mesCoordZones[7]; +} +// ------------------------------------------------------------------------ +void MonEditZone::InitValZonePipe() +// ------------------------------------------------------------------------ +{ + HOMARD::double_array_var mesCoordZones = aZone->GetCoords(); + ASSERT(mesCoordZones->length() == 9 ); + _ZoneXcentre=mesCoordZones[0]; + _ZoneYcentre=mesCoordZones[1]; + _ZoneZcentre=mesCoordZones[2]; + _ZoneXaxis=mesCoordZones[3]; + _ZoneYaxis=mesCoordZones[4]; + _ZoneZaxis=mesCoordZones[5]; + _ZoneRayon=mesCoordZones[6]; + _ZoneHaut=mesCoordZones[7]; + _ZoneRayonInt=mesCoordZones[8]; +} +// ------------------------------------------------------------------------ +void MonEditZone::SetBox() +// ------------------------------------------------------------------------ +{ + MESSAGE("SetBox "); + gBBox->setVisible(1); + gBSphere->setVisible(0); + gBCylindre->setVisible(0) ; + gBPipe->setVisible(0) ; + RBBox->setChecked(1); + adjustSize(); + RBCylinder->setDisabled(true); + RBPipe->setDisabled(true); + if ( _Type == 2 ) { RBSphere->setDisabled(true); } + else { RBSphere->setVisible(0); + RBPipe->setText(QApplication::translate("CreateZone", "Disk with hole", 0)); + RBCylinder->setText(QApplication::translate("CreateZone", "Disk", 0)); + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr() ; + QPixmap pix = resMgr->loadPixmap( "HOMARD", "boxdxy.png" ) ; + QIcon IS=QIcon(pix) ; + RBBox->setIcon(IS) ; } + adjustSize(); + + SpinBox_Xmini->setValue(_ZoneXmin); + SpinBox_Xmaxi->setValue(_ZoneXmax); + + double incr ; + if ( _Xincr > 0 ) {incr=_Xincr;} else{incr=1.;} + SpinBox_Xmini->setSingleStep(incr); + SpinBox_Xmaxi->setSingleStep(incr); + + SpinBox_Ymini->setValue(_ZoneYmin); + SpinBox_Ymaxi->setValue(_ZoneYmax); + if ( _Yincr > 0 ) {incr=_Yincr;} else{incr=1.;} + SpinBox_Ymini->setSingleStep(incr); + SpinBox_Ymaxi->setSingleStep(incr); + + SpinBox_Zmini->setValue(_ZoneZmin); + SpinBox_Zmaxi->setValue(_ZoneZmax); + if ( _Zincr > 0 ) {incr=_Zincr;} else{incr=1.;} + SpinBox_Zmini->setSingleStep(incr); + SpinBox_Zmaxi->setSingleStep(incr); + + if ( _Type == 12 ) { SpinBox_Xmini->setDisabled(true) ; + SpinBox_Xmaxi->setDisabled(true) ; } + else if ( _Type == 13 ) { SpinBox_Ymini->setDisabled(true) ; + SpinBox_Ymaxi->setDisabled(true) ; } + else if ( _Type == 11 ) { SpinBox_Zmini->setDisabled(true) ; + SpinBox_Zmaxi->setDisabled(true) ; } + +} +// ------------------------------------------------------------------------ +void MonEditZone::SetSphere() +// ------------------------------------------------------------------------ +{ + gBBox->setVisible(0); + gBSphere->setVisible(1); + gBCylindre->setVisible(0) ; + gBPipe->setVisible(0) ; + RBSphere->setChecked(1); + RBBox->setDisabled(true); + RBCylinder->setDisabled(true); + RBPipe->setDisabled(true); + adjustSize(); + + SpinBox_Xcentre->setValue(_ZoneXcentre); + if ( _Xincr > 0) { SpinBox_Xcentre->setSingleStep(_Xincr); } + else { SpinBox_Xcentre->setSingleStep(1) ; } + + SpinBox_Ycentre->setValue(_ZoneYcentre); + if ( _Yincr > 0) { SpinBox_Ycentre->setSingleStep(_Yincr); } + else { SpinBox_Ycentre->setSingleStep(1) ; } + + SpinBox_Zcentre->setValue(_ZoneZcentre); + if ( _Zincr > 0) { SpinBox_Zcentre->setSingleStep(_Zincr); } + else { SpinBox_Zcentre->setSingleStep(1);} + + SpinBox_Rayon->setValue(_ZoneRayon); +} +// ------------------------------------------------------------------------ +void MonEditZone::SetCylinder() +// ------------------------------------------------------------------------ +{ + MESSAGE("SetCylinder _Xincr ="<<_Xincr<< " _Yincr ="<<_Yincr<< " _Zincr ="<<_Zincr); + gBBox->setVisible(0); + gBSphere->setVisible(0); + gBCylindre->setVisible(1) ; + gBPipe->setVisible(0) ; + RBCylinder->setChecked(1); + RBBox->setDisabled(true); + RBPipe->setDisabled(true); + if ( _Type == 5 ) { RBSphere->setDisabled(true); } + else { RBSphere->setVisible(0); + RBPipe->setText(QApplication::translate("CreateZone", "Disk with hole", 0)); + RBCylinder->setText(QApplication::translate("CreateZone", "Disk", 0)); + TLXbase->setText(QApplication::translate("CreateZone", "X centre", 0)); + TLYbase->setText(QApplication::translate("CreateZone", "Y centre", 0)); + TLZbase->setText(QApplication::translate("CreateZone", "Z centre", 0)); + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr() ; + QPixmap pix = resMgr->loadPixmap( "HOMARD", "disk.png" ) ; + QIcon IS=QIcon(pix) ; + RBCylinder->setIcon(IS) ; } + adjustSize(); + + SpinBox_Xbase->setValue(_ZoneXcentre); + if ( _Xincr > 0) { SpinBox_Xbase->setSingleStep(_Xincr); } + else { SpinBox_Xbase->setSingleStep(1) ; } + + SpinBox_Ybase->setValue(_ZoneYcentre); + if ( _Yincr > 0) { SpinBox_Ybase->setSingleStep(_Yincr); } + else { SpinBox_Ybase->setSingleStep(1) ; } + + SpinBox_Zbase->setValue(_ZoneZcentre); + if ( _Zincr > 0) { SpinBox_Zbase->setSingleStep(_Zincr); } + else { SpinBox_Zbase->setSingleStep(1) ;} + + SpinBox_Radius->setValue(_ZoneRayon); + + if ( _Type == 5 ) + { SpinBox_Xaxis->setValue(_ZoneXaxis) ; + SpinBox_Yaxis->setValue(_ZoneYaxis) ; + SpinBox_Zaxis->setValue(_ZoneZaxis) ; + SpinBox_Haut->setValue(_ZoneHaut) ; + } + else + { SpinBox_Xaxis->setVisible(0) ; + SpinBox_Yaxis->setVisible(0) ; + SpinBox_Zaxis->setVisible(0) ; + SpinBox_Haut->setVisible(0) ; + TLXaxis->setVisible(0) ; + TLYaxis->setVisible(0) ; + TLZaxis->setVisible(0) ; + TLHaut->setVisible(0) ; + if ( _Type == 32 ) { SpinBox_Xbase->setDisabled(true) ; } + else if ( _Type == 33 ) { SpinBox_Ybase->setDisabled(true) ; } + else if ( _Type == 31 ) { SpinBox_Zbase->setDisabled(true) ; } + } +} +// ------------------------------------------------------------------------ +void MonEditZone::SetPipe() +// ------------------------------------------------------------------------ +{ + MESSAGE("SetPipe _Xincr ="<<_Xincr<< " _Yincr ="<<_Yincr<< " _Zincr ="<<_Zincr); + gBBox->setVisible(0); + gBSphere->setVisible(0); + gBCylindre->setVisible(0) ; + gBPipe->setVisible(1) ; + RBPipe->setChecked(1); + RBBox->setDisabled(true); + RBCylinder->setDisabled(true); + if ( _Type == 7 ) { RBSphere->setDisabled(true); } + else { RBSphere->setVisible(0); + RBPipe->setText(QApplication::translate("CreateZone", "Disk with hole", 0)); + RBCylinder->setText(QApplication::translate("CreateZone", "Disk", 0)); + TLXbase_p->setText(QApplication::translate("CreateZone", "X centre", 0)); + TLYbase_p->setText(QApplication::translate("CreateZone", "Y centre", 0)); + TLZbase_p->setText(QApplication::translate("CreateZone", "Z centre", 0)); + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr() ; + QPixmap pix = resMgr->loadPixmap( "HOMARD", "diskwithhole.png" ) ; + QIcon IS=QIcon(pix) ; + RBPipe->setIcon(IS) ; } + adjustSize(); + + SpinBox_Xbase_p->setValue(_ZoneXcentre); + if ( _Xincr > 0) { SpinBox_Xbase_p->setSingleStep(_Xincr); } + else { SpinBox_Xbase_p->setSingleStep(1) ; } + + SpinBox_Ybase_p->setValue(_ZoneYcentre); + if ( _Yincr > 0) { SpinBox_Ybase_p->setSingleStep(_Yincr); } + else { SpinBox_Ybase_p->setSingleStep(1) ; } + + SpinBox_Zbase_p->setValue(_ZoneZcentre); + if ( _Zincr > 0) { SpinBox_Zbase_p->setSingleStep(_Zincr); } + else { SpinBox_Zbase_p->setSingleStep(1) ;} + + SpinBox_Radius_int->setValue(_ZoneRayonInt); + SpinBox_Radius_ext->setValue(_ZoneRayon); + + if ( _Type == 7 ) + { SpinBox_Xaxis_p->setValue(_ZoneXaxis) ; + SpinBox_Yaxis_p->setValue(_ZoneYaxis) ; + SpinBox_Zaxis_p->setValue(_ZoneZaxis) ; + SpinBox_Haut_p->setValue(_ZoneHaut) ; + } + else + { SpinBox_Xaxis_p->setVisible(0) ; + SpinBox_Yaxis_p->setVisible(0) ; + SpinBox_Zaxis_p->setVisible(0) ; + SpinBox_Haut_p->setVisible(0) ; + TLXaxis_p->setVisible(0) ; + TLYaxis_p->setVisible(0) ; + TLZaxis_p->setVisible(0) ; + TLHaut_p->setVisible(0) ; + if ( _Type == 62 ) { SpinBox_Xbase_p->setDisabled(true) ; } + else if ( _Type == 63 ) { SpinBox_Ybase_p->setDisabled(true) ; } + else if ( _Type == 61 ) { SpinBox_Zbase_p->setDisabled(true) ; } + } +} + + +// --------------------------------------------------- +bool MonEditZone::CreateOrUpdateZone() +//---------------------------------------------------- +// Pas de Creation de la zone +// Mise a jour des attributs de la Zone +{ + try + { + switch (_Type) + { + case 11 : // il s agit d un rectangle + { } + case 12 : // il s agit d un rectangle + { } + case 13 : // il s agit d un rectangle + { } + case 2 : // il s agit d un parallelepipede + { aZone->SetBox( _ZoneXmin, _ZoneXmax, _ZoneYmin, _ZoneYmax, _ZoneZmin, _ZoneZmax ); + break; + } + case 4 : // il s agit d une sphere + { aZone->SetSphere( _ZoneXcentre, _ZoneYcentre, _ZoneZcentre, _ZoneRayon ); + break; + } + case 31 : // il s agit d un disque issu d'un cylindre + { } + case 32 : // il s agit d un disque issu d'un cylindre + { } + case 33 : // il s agit d un disque issu d'un cylindre + { } + case 5 : // il s agit d un cylindre + { aZone->SetCylinder( _ZoneXcentre, _ZoneYcentre, _ZoneZcentre, _ZoneXaxis, _ZoneYaxis, _ZoneZaxis, _ZoneRayon, _ZoneHaut ); + break; + } + case 61 : // il s agit d un disque issu d'un cylindre + { } + case 62 : // il s agit d un disque issu d'un cylindre + { } + case 63 : // il s agit d un disque issu d'un cylindre + { } + case 7 : // il s agit d un tuyau + { aZone->SetPipe( _ZoneXcentre, _ZoneYcentre, _ZoneZcentre, _ZoneXaxis, _ZoneYaxis, _ZoneZaxis, _ZoneRayon, _ZoneHaut, _ZoneRayonInt ); + break; + } + } + if (Chgt) myHomardGen->InvalideZone(_Name.toStdString().c_str()); + HOMARD_UTILS::updateObjBrowser(); + } + catch( const SALOME::SALOME_Exception& S_ex ) { + SalomeApp_Tools::QtCatchCorbaException( S_ex ); + return false; + } + return true; +} + diff --git a/src/ADAPTGUI/MonEditZone.h b/src/ADAPTGUI/MonEditZone.h new file mode 100644 index 000000000..6570d263e --- /dev/null +++ b/src/ADAPTGUI/MonEditZone.h @@ -0,0 +1,59 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_EDITZONE_H +#define MON_EDITZONE_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) + +#include + +class HOMARD_EXPORT MonEditZone : public MonCreateZone +{ + Q_OBJECT +public: + MonEditZone( MonCreateHypothesis* parent, bool modal, + HOMARD::HOMARD_Gen_var myHomardGen, + QString caseName, QString Name); + virtual ~MonEditZone(); + +protected : + void SetBox(); + void SetSphere(); + void SetCylinder(); + void SetPipe(); + bool CreateOrUpdateZone(); + void InitValEdit(); + void InitValZoneLimit(); + void InitValZoneBox(); + void InitValZoneSphere(); + void InitValZoneCylinder(); + void InitValZonePipe(); + +public slots: + +}; + +#endif // MON_EDITZONE_H diff --git a/src/ADAPTGUI/MonIterInfo.cxx b/src/ADAPTGUI/MonIterInfo.cxx new file mode 100644 index 000000000..b361d29e8 --- /dev/null +++ b/src/ADAPTGUI/MonIterInfo.cxx @@ -0,0 +1,175 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonIterInfo.h" + +#include +#include +#include +#include + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include "MonEditFile.h" +#include + +using namespace std; + +// ----------------------------------------------------------------------------------------- +MonIterInfo::MonIterInfo(QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen0, QString IterName) +// ----------------------------------------------------------------------------------------- +/* Constructs a MonIterInfo + * Inherits from CasHomard + * Sets attributes to default values + */ + : + Ui_IterInfo(), + _IterName(IterName), + _aCaseName(""), + _BlockSize(0), + _Connection(0), + _Diametre(0), + _Entanglement(0), + _Quality(0), + _Option(-1) +{ + MESSAGE("appel de _duplicate"); + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); + setupUi(this); + setModal(modal); + InitConnect(); + + adjustSize(); +} + +// ------------------------------------------------------------------------ +MonIterInfo::~MonIterInfo() +// ------------------------------------------------------------------------ +{ + // no need to delete child widgets, Qt does it all for us +} +// ------------------------------------------------------------------------ +void MonIterInfo::InitConnect() +// ------------------------------------------------------------------------ +{ + MESSAGE("InitConnect"); + connect( CBBlockSize, SIGNAL(stateChanged(int)), this, SLOT(SetBlockSize())); + connect( CBConnection, SIGNAL(stateChanged(int)), this, SLOT(SetConnection())); + connect( CBDiametre, SIGNAL(stateChanged(int)), this, SLOT(SetDiametre())); + connect( CBEntanglement, SIGNAL(stateChanged(int)), this, SLOT(SetEntanglement())); + connect( CBQuality, SIGNAL(stateChanged(int)), this, SLOT(SetQuality())); + + connect( buttonOk, SIGNAL(pressed()), this, SLOT(PushOnOK())); + connect( buttonApply, SIGNAL(pressed()), this, SLOT(PushOnApply())); + connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); + connect( buttonHelp, SIGNAL(pressed()), this, SLOT(PushOnHelp())); +} +// ------------------------------- +bool MonIterInfo::PushOnApply() +// -------------------------------- +{ + MESSAGE("PushOnApply"); + + // Au moins une option a ete choisie + if ( ( _Quality == 0 ) && ( _Diametre == 0 ) && ( _Connection == 0 ) && ( _BlockSize == 0 ) && ( _Entanglement == 0 ) ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_MESH_INFO_1") ); + return false; + } + + // Recuperation de l'iteration + aIter = myHomardGen->GetIteration(_IterName.toStdString().c_str()) ; + + // Lancement de l'analyse + try + { + aIter->MeshInfoOption( _Quality, _Diametre, _Connection, _BlockSize, _Entanglement, _Option ); + } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + return false; + } + + // Le bilan de l'analyse a afficher + QString aFileName = aIter->GetFileInfo() ; + MonEditFile *aDlg = new MonEditFile( 0, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), aFileName, 0 ) ; + if ( aDlg->_codret == 0 ) { aDlg->show(); } + + + HOMARD_UTILS::updateObjBrowser(); + return true; +} +// --------------------------- +void MonIterInfo::PushOnOK() +// --------------------------- +{ + bool bOK = PushOnApply(); + if ( bOK ) this->close(); +} +//------------------------------ +void MonIterInfo::PushOnHelp() +//------------------------------- +{ + std::string LanguageShort = myHomardGen->GetLanguageShort(); + HOMARD_UTILS::PushOnHelp(QString("gui_mesh_info.html"), QString(""), QString(LanguageShort.c_str())); +} +// ------------------------------------------------------------------------ +void MonIterInfo::SetBlockSize() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetBlockSize "); + if ( CBBlockSize->isChecked() ) { _BlockSize = 1 ; } + else { _BlockSize = 0 ; } +} +// ------------------------------------------------------------------------ +void MonIterInfo::SetConnection() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetConnection "); + if ( CBConnection->isChecked() ) { _Connection = 1 ; } + else { _Connection = 0 ; } +} +// ------------------------------------------------------------------------ +void MonIterInfo::SetDiametre() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetDiametre "); + if ( CBDiametre->isChecked() ) { _Diametre = 1 ; } + else { _Diametre = 0 ; } +} +// ------------------------------------------------------------------------ +void MonIterInfo::SetEntanglement() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetEntanglement "); + if ( CBEntanglement->isChecked() ) { _Entanglement = 1 ; } + else { _Entanglement = 0 ; } +} +// ------------------------------------------------------------------------ +void MonIterInfo::SetQuality() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetQuality "); + if ( CBQuality->isChecked() ) { _Quality = 1 ; } + else { _Quality = 0 ; } +} diff --git a/src/ADAPTGUI/MonIterInfo.h b/src/ADAPTGUI/MonIterInfo.h new file mode 100644 index 000000000..358c3baf4 --- /dev/null +++ b/src/ADAPTGUI/MonIterInfo.h @@ -0,0 +1,78 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_ITERINFO_H +#define MON_ITERINFO_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(HOMARD_Cas) + +#include "ui_IterInfo.h" +#include +#include + +class QListBox; + +class HOMARD_EXPORT MonIterInfo : public QDialog, public Ui_IterInfo +{ + Q_OBJECT + +public: + MonIterInfo( QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString IterName); + ~MonIterInfo(); + +protected : + MonIterInfo( QWidget* parent, HOMARD::HOMARD_Gen_var myHomardGen, QString IterName ); + + QString _IterName; + QString _aCaseName; + + int _BlockSize; + int _Connection; + int _Diametre; + int _Entanglement; + int _Quality; + int _Option; + + HOMARD::HOMARD_Iteration_var aIter ; + HOMARD::HOMARD_Gen_var myHomardGen; + + virtual void InitConnect(); + +public slots: + + virtual void SetBlockSize(); + virtual void SetConnection(); + virtual void SetEntanglement(); + virtual void SetDiametre(); + virtual void SetQuality(); + + virtual void PushOnOK(); + virtual bool PushOnApply(); + virtual void PushOnHelp(); + +}; + +#endif // MON_ITERINFO_H diff --git a/src/ADAPTGUI/MonMeshInfo.cxx b/src/ADAPTGUI/MonMeshInfo.cxx new file mode 100644 index 000000000..7c5e92899 --- /dev/null +++ b/src/ADAPTGUI/MonMeshInfo.cxx @@ -0,0 +1,281 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonMeshInfo.h" +#include "HOMARD.hxx" + +#include +#include + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include "MonEditFile.h" +#include + +#ifdef WIN32 +#include +#endif + +using namespace std; + +// ----------------------------------------------------------------------------------------- +MonMeshInfo::MonMeshInfo(QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen0) +// ----------------------------------------------------------------------------------------- +/* Constructs a MonMeshInfo + * Inherits from CasHomard + * Sets attributes to default values + */ + : + Ui_MeshInfo(), + _aCaseName(""),_aDirName(""), + _BlockSize(0), + _Connection(0), + _Diametre(0), + _Entanglement(0), + _Quality(0) +{ + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); + setupUi(this); + setModal(modal); + InitConnect(); + + SetNewCaseName() ; + adjustSize(); +} + +// ------------------------------------------------------------------------ +MonMeshInfo::~MonMeshInfo() +// ------------------------------------------------------------------------ +{ + // no need to delete child widgets, Qt does it all for us +} +// ------------------------------------------------------------------------ +void MonMeshInfo::InitConnect() +// ------------------------------------------------------------------------ +{ + connect( LECaseName, SIGNAL(textChanged(QString)), this, SLOT(CaseNameChanged())); + connect( PushDir, SIGNAL(pressed()), this, SLOT(SetDirName())); + connect( PushFichier, SIGNAL(pressed()), this, SLOT(SetFileName())); + + connect( CBBlockSize, SIGNAL(stateChanged(int)), this, SLOT(SetBlockSize())); + connect( CBConnection, SIGNAL(stateChanged(int)), this, SLOT(SetConnection())); + connect( CBDiametre, SIGNAL(stateChanged(int)), this, SLOT(SetDiametre())); + connect( CBEntanglement, SIGNAL(stateChanged(int)), this, SLOT(SetEntanglement())); + connect( CBQuality, SIGNAL(stateChanged(int)), this, SLOT(SetQuality())); + + connect( buttonOk, SIGNAL(pressed()), this, SLOT(PushOnOK())); + connect( buttonApply, SIGNAL(pressed()), this, SLOT(PushOnApply())); + connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); + connect( buttonHelp, SIGNAL(pressed()), this, SLOT(PushOnHelp())); +} +// ------------------------------- +bool MonMeshInfo::PushOnApply() +// -------------------------------- +{ + MESSAGE("PushOnApply"); + QString aCaseName=LECaseName->text().trimmed(); + if ( aCaseName == "" ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_CASE_NAME") ); + return false; + } + + QString aDirName=LEDirName->text().trimmed(); + if (aDirName == QString("")) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_CASE_DIRECTORY_1") ); + return false; + } + if ( aDirName != _aDirName) + { QString CaseNameDir = myHomardGen->VerifieDir( aDirName.toStdString().c_str()) ; + if ( CaseNameDir != "" ) + { + QString texte ; + texte = QObject::tr("HOM_CASE_DIRECTORY_2") + CaseNameDir ; + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + texte ); + return false; + } + } + if (CHDIR(aDirName.toStdString().c_str()) != 0) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_CASE_DIRECTORY_3") ); + return false; + } + + QString aFileName=LEFileName->text().trimmed(); + if (aFileName ==QString("")) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_CASE_MESH") ); + return false; + } + + QString aMeshName = HOMARD_QT_COMMUN::LireNomMaillage(aFileName); + if (aMeshName == "" ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_MED_FILE_2") ); + return false; + } + if ( ( _Quality == 0 ) && ( _Diametre == 0 ) && ( _Connection == 0 ) && ( _BlockSize == 0 ) && ( _Entanglement == 0 ) ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_MESH_INFO") ); + return false; + } + + if (aCaseName != _aCaseName ) + { + _aCaseName = aCaseName; + try + { + myHomardGen->MeshInfo( \ + CORBA::string_dup(_aCaseName.toStdString().c_str()), \ + CORBA::string_dup(aMeshName.toStdString().c_str()), \ + CORBA::string_dup(aFileName.toStdString().c_str()), \ + CORBA::string_dup(aDirName.toStdString().c_str()), \ + _Quality, _Diametre, _Connection, _BlockSize, _Entanglement ); + } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + return false; + } + } + + // Le bilan de l'analyse a afficher + aCase = myHomardGen->GetCase(_aCaseName.toStdString().c_str()); + string iter0 = aCase->GetIter0Name(); + HOMARD::HOMARD_Iteration_var aIter = myHomardGen->GetIteration(iter0.c_str()); + aFileName = aIter->GetFileInfo() ; + MonEditFile *aDlg = new MonEditFile( 0, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), aFileName, 1 ) ; + if ( aDlg->_codret == 0 ) { aDlg->show(); } + +HOMARD_UTILS::updateObjBrowser(); + return true; +} +// --------------------------- +void MonMeshInfo::PushOnOK() +// --------------------------- +{ + bool bOK = PushOnApply(); + if ( bOK ) this->close(); +} +//------------------------------ +void MonMeshInfo::PushOnHelp() +//------------------------------- +{ + std::string LanguageShort = myHomardGen->GetLanguageShort(); + HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""), QString(LanguageShort.c_str())); +} +// --------------------------------- +void MonMeshInfo::SetNewCaseName() +// ------------------------------ +{ + HOMARD::listeCases_var MyCases = myHomardGen->GetAllCasesName(); + int num = 0; QString aCaseName=""; + while (aCaseName=="" ) + { + aCaseName.setNum(num+1) ; + aCaseName.insert(0, QString("Case_")) ; + for ( int i=0; ilength(); i++) + { + if ( aCaseName == QString((MyCases)[i]) ) + { + num ++ ; + aCaseName = "" ; + break ; + } + } + } + LECaseName->clear() ; + LECaseName->insert(aCaseName); +} +// ------------------------------------------------------------------------ +void MonMeshInfo::SetDirName() +// ------------------------------------------------------------------------ +{ + QString aDirName=QFileDialog::getExistingDirectory (); + if (!(aDirName.isEmpty()))LEDirName->setText(aDirName); +} +// ------------------------------------------------------------------------ +void MonMeshInfo::SetFileName() +// ------------------------------------------------------------------------ +{ + QString fileName0 = LEFileName->text().trimmed(); + QString fileName = HOMARD_QT_COMMUN::PushNomFichier( false, QString("med") ) ; + if (fileName.isEmpty()) fileName = fileName0 ; + LEFileName->setText(fileName); +} +// ------------------------------------------------------------------------ +void MonMeshInfo::CaseNameChanged() +// ------------------------------------------------------------------------ +{ + if (_aCaseName != LECaseName->text().trimmed()) + { + LEFileName->setReadOnly(false); + PushFichier->show(); + } +} +// ------------------------------------------------------------------------ +void MonMeshInfo::SetBlockSize() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetBlockSize "); + if ( CBBlockSize->isChecked() ) { _BlockSize = 1 ; } + else { _BlockSize = 0 ; } +} +// ------------------------------------------------------------------------ +void MonMeshInfo::SetConnection() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetConnection "); + if ( CBConnection->isChecked() ) { _Connection = 1 ; } + else { _Connection = 0 ; } +} +// ------------------------------------------------------------------------ +void MonMeshInfo::SetDiametre() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetDiametre "); + if ( CBDiametre->isChecked() ) { _Diametre = 1 ; } + else { _Diametre = 0 ; } +} +// ------------------------------------------------------------------------ +void MonMeshInfo::SetEntanglement() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetEntanglement "); + if ( CBEntanglement->isChecked() ) { _Entanglement = 1 ; } + else { _Entanglement = 0 ; } +} +// ------------------------------------------------------------------------ +void MonMeshInfo::SetQuality() +// ------------------------------------------------------------------------ +{ + MESSAGE("Debut de SetQuality "); + if ( CBQuality->isChecked() ) { _Quality = 1 ; } + else { _Quality = 0 ; } +} diff --git a/src/ADAPTGUI/MonMeshInfo.h b/src/ADAPTGUI/MonMeshInfo.h new file mode 100644 index 000000000..55a31fe34 --- /dev/null +++ b/src/ADAPTGUI/MonMeshInfo.h @@ -0,0 +1,76 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_MESHINFO_H +#define MON_MESHINFO_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(HOMARD_Cas) + +#include "ui_MeshInfo.h" +#include + +class HOMARD_EXPORT MonMeshInfo : public QDialog, public Ui_MeshInfo +{ + Q_OBJECT + +public: + MonMeshInfo( QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen); + ~MonMeshInfo(); + +protected : + QString _aCaseName; + QString _aDirName; + + int _BlockSize; + int _Connection; + int _Diametre; + int _Entanglement; + int _Quality; + + HOMARD::HOMARD_Cas_var aCase ; + HOMARD::HOMARD_Gen_var myHomardGen; + + virtual void InitConnect(); + virtual void SetNewCaseName(); + +public slots: + virtual void SetDirName(); + virtual void SetFileName(); + + virtual void SetBlockSize(); + virtual void SetConnection(); + virtual void SetEntanglement(); + virtual void SetDiametre(); + virtual void SetQuality(); + + virtual void PushOnOK(); + virtual bool PushOnApply(); + virtual void PushOnHelp(); + + virtual void CaseNameChanged(); +}; + +#endif // MON_MESHINFO_H diff --git a/src/ADAPTGUI/MonPursueIteration.cxx b/src/ADAPTGUI/MonPursueIteration.cxx new file mode 100644 index 000000000..b6c76d407 --- /dev/null +++ b/src/ADAPTGUI/MonPursueIteration.cxx @@ -0,0 +1,288 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MonPursueIteration.h" +#include "HOMARD.hxx" + +#include +#include + +#include "SalomeApp_Tools.h" +#include "HOMARDGUI_Utils.h" +#include "HomardQtCommun.h" +#include + +#ifdef WIN32 +#include +#endif + +using namespace std; + +// ----------------------------------------------------------------------------------------- +/* Constructs a MonPursueIteration + * Sets attributes to default values + */ +// ----------------------------------------------------------------------------------------- +MonPursueIteration::MonPursueIteration ( bool modal, HOMARD::HOMARD_Gen_var myHomardGen0 ) + : + Ui_PursueIteration(), + _aCaseName(""), _aDirName(""), _aDirNameStart("") +{ + MESSAGE("Debut du constructeur de MonPursueIteration"); + myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); + setupUi(this); + setModal(modal); + + InitConnect(); + + SetNewCaseName() ; + _Type = 1 ; + GBIterationintoCase->setVisible(0); + SpinBoxNumber->setVisible(0); + + adjustSize(); + MESSAGE("Fin du constructeur de MonPursueIteration"); +} + +// ------------------------------------------------------------------------ +MonPursueIteration::~MonPursueIteration() +// ------------------------------------------------------------------------ +{ + // no need to delete child widgets, Qt does it all for us +} +// ------------------------------------------------------------------------ +void MonPursueIteration::InitConnect() +// ------------------------------------------------------------------------ +{ + connect( PushDir, SIGNAL(pressed()), this, SLOT(SetDirName())); + + connect( RBIteration, SIGNAL(clicked()), this, SLOT(FromIteration())); + connect( RBCase, SIGNAL(clicked()), this, SLOT(FromCase())); + connect( PushDirStart, SIGNAL(pressed()), this, SLOT(SetDirNameStart())); + + connect( RBCaseLastIteration, SIGNAL(clicked()), this, SLOT(CaseLastIteration())); + connect( RBCaseNIteration, SIGNAL(clicked()), this, SLOT(CaseNIteration())); + + connect( buttonOk, SIGNAL(pressed()), this, SLOT(PushOnOK())); + connect( buttonApply, SIGNAL(pressed()), this, SLOT(PushOnApply())); + connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); + connect( buttonHelp, SIGNAL(pressed()), this, SLOT(PushOnHelp())); +} +// ------------------------------- +bool MonPursueIteration::PushOnApply() +// -------------------------------- +{ + MESSAGE("PushOnApply"); +// 1. Enregistrement du repertoire du cas + QString aDirName=LEDirName->text().trimmed(); + if (aDirName == QString("")) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_CASE_DIRECTORY_1") ); + return false; + } + if ( aDirName != _aDirName) + { QString CaseNameDir = myHomardGen->VerifieDir( aDirName.toStdString().c_str()) ; + if ( CaseNameDir != "" ) + { + QString texte ; + texte = QObject::tr("HOM_CASE_DIRECTORY_2") + CaseNameDir ; + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + texte ); + return false; + } + } + if (CHDIR(aDirName.toStdString().c_str()) != 0) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_CASE_DIRECTORY_3") ); + return false; + } +// 2. Enregistrement du repertoire de depart + QString aDirNameStart=LEDirNameStart->text().trimmed(); + if (aDirNameStart == QString("")) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_START_DIRECTORY_1") ); + return false; + } + if (CHDIR(aDirNameStart.toStdString().c_str()) != 0) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr("HOM_START_DIRECTORY_3") ); + return false; + } + +// 3. Enregistrement du numero d'iteration + int Number ; + if ( _Type == 3 ) { Number = SpinBoxNumber->value() ; } + +// 4. Creation du cas + QString _aCaseName=LECaseName->text().trimmed(); + _aDirNameStart=aDirNameStart; + + MESSAGE("_aCaseName = "<<_aCaseName.toStdString().c_str()); + MESSAGE("_aDirNameStart = "<<_aDirNameStart.toStdString().c_str()); + MESSAGE("_Type = "<<_Type); + switch (_Type) + { + case 1 : // Poursuite a partir d'une iteration + { + try + { + MESSAGE("Poursuite a partir d'une iteration"); + aCase = myHomardGen->CreateCaseFromIteration( \ + CORBA::string_dup(_aCaseName.toStdString().c_str()), \ + CORBA::string_dup(_aDirNameStart.toStdString().c_str()) ); + } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + return false ; + } + break; + } + case 2 : // Poursuite a partir de la derniere iteration dans un cas + { + try + { + MESSAGE("Poursuite a partir de la derniere iteration dans un cas"); + aCase = myHomardGen->CreateCaseFromCaseLastIteration( \ + CORBA::string_dup(_aCaseName.toStdString().c_str()), \ + CORBA::string_dup(_aDirNameStart.toStdString().c_str()) ); + } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + return false ; + } + break; + } + case 3 : // Poursuite a partir d'une iteration dans un cas + { + try + { + MESSAGE("Poursuite a partir d'une iteration dans un cas"); + aCase = myHomardGen->CreateCaseFromCaseIteration( \ + CORBA::string_dup(_aCaseName.toStdString().c_str()), \ + CORBA::string_dup(_aDirNameStart.toStdString().c_str()), \ + Number ); + } + catch( SALOME::SALOME_Exception& S_ex ) + { + QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), + QObject::tr(CORBA::string_dup(S_ex.details.text)) ); + return false ; + } + break; + } + } + + aCase->SetDirName(aDirName.toStdString().c_str()); + _aDirName=aDirName; + + HOMARD_UTILS::updateObjBrowser(); + + return true; +} +// --------------------------- +void MonPursueIteration::PushOnOK() +// --------------------------- +{ + bool bOK = PushOnApply(); + if ( bOK ) this->close(); +} +//------------------------------ +void MonPursueIteration::PushOnHelp() +//------------------------------- +{ + std::string LanguageShort = myHomardGen->GetLanguageShort(); + HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""), QString(LanguageShort.c_str())); +} +// --------------------------------- +void MonPursueIteration::SetNewCaseName() +// ------------------------------ +{ + HOMARD::listeCases_var MyCases = myHomardGen->GetAllCasesName(); + int num = 0; QString aCaseName=""; + while (aCaseName=="" ) + { + aCaseName.setNum(num+1) ; + aCaseName.insert(0, QString("Case_")) ; + for ( int i=0; ilength(); i++) + { + if ( aCaseName == QString((MyCases)[i])) + { + num ++ ; + aCaseName = "" ; + break ; + } + } + } + LECaseName->clear() ; + LECaseName->insert(aCaseName); +} +// ------------------------------------------------------------------------ +void MonPursueIteration::SetDirName() +// ------------------------------------------------------------------------ +{ + QString aDirName=QFileDialog::getExistingDirectory (); + if (!(aDirName.isEmpty()))LEDirName->setText(aDirName); +} +// ------------------------------------------------------------------------ +void MonPursueIteration::SetDirNameStart() +// ------------------------------------------------------------------------ +{ + QString aDirName=QFileDialog::getExistingDirectory (); + if (!(aDirName.isEmpty()))LEDirNameStart->setText(aDirName); +} +// ------------------------------------------------------------------------ +void MonPursueIteration::FromIteration() +// ------------------------------------------------------------------------ +{ + GBIterationintoCase->setVisible(0); + SpinBoxNumber->setVisible(0); + _Type = 1 ; + adjustSize(); +} +// ------------------------------------------------------------------------ +void MonPursueIteration::FromCase() +// ------------------------------------------------------------------------ +{ + GBIterationintoCase->setVisible(1); + CaseLastIteration(); +} +// ------------------------------------------------------------------------ +void MonPursueIteration::CaseLastIteration() +// ------------------------------------------------------------------------ +{ + SpinBoxNumber->setVisible(0); + _Type = 2 ; + adjustSize(); +} +// ------------------------------------------------------------------------ +void MonPursueIteration::CaseNIteration() +// ------------------------------------------------------------------------ +{ + SpinBoxNumber->setVisible(1); + _Type = 3 ; + adjustSize(); +} diff --git a/src/ADAPTGUI/MonPursueIteration.h b/src/ADAPTGUI/MonPursueIteration.h new file mode 100644 index 000000000..fbeda6f75 --- /dev/null +++ b/src/ADAPTGUI/MonPursueIteration.h @@ -0,0 +1,72 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef MON_PURSUEITERATION_H +#define MON_PURSUEITERATION_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include + +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(HOMARD_Cas) + +#include "ui_PursueIteration.h" +#include + +class HOMARD_EXPORT MonPursueIteration : public QDialog, public Ui_PursueIteration +{ + Q_OBJECT + + public: + MonPursueIteration( bool modal, HOMARD::HOMARD_Gen_var myHomardGen ); + virtual ~MonPursueIteration(); + + protected : + QString _aCaseName; + QString _aDirName; + QString _aDirNameStart; + + int _Type ; + + HOMARD::HOMARD_Cas_var aCase ; + HOMARD::HOMARD_Gen_var myHomardGen; + + virtual void InitConnect(); + virtual void SetNewCaseName(); + + public slots: + virtual void SetDirName(); + + virtual void FromIteration(); + virtual void FromCase(); + virtual void SetDirNameStart(); + + virtual void CaseLastIteration(); + virtual void CaseNIteration(); + + virtual void PushOnOK(); + virtual bool PushOnApply(); + virtual void PushOnHelp(); + +}; + +#endif // MON_PURSUEITERATION_H diff --git a/src/ADAPTGUI/PursueIteration.ui b/src/ADAPTGUI/PursueIteration.ui new file mode 100644 index 000000000..ad3de2352 --- /dev/null +++ b/src/ADAPTGUI/PursueIteration.ui @@ -0,0 +1,252 @@ + + + PursueIteration + + + + 0 + 0 + 601 + 300 + + + + + 0 + 0 + + + + Pursue an iteration + + + true + + + + + + 6 + + + 0 + + + + + Name + + + + + + + + 382 + 21 + + + + + + + + + + 6 + + + 0 + + + + + Directory + + + + + + + + + + false + + + + + + + + 382 + 21 + + + + + + + + + + From an iteration + + + true + + + + + + + From a case + + + + + + + 6 + + + 0 + + + + + Directory + + + + + + + + + + false + + + + + + + + 382 + 21 + + + + + + + + + + Iteration into the case + + + + + + Last iteration + + + true + + + + + + + Iteration number + + + + + + + 1789 + + + + + + + + + + + + + + 9 + + + 6 + + + + + Help + + + false + + + + + + + Apply + + + false + + + + + + + OK + + + false + + + + + + + Cancel + + + false + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 128 + 25 + + + + + + + + + diff --git a/src/ADAPT_I/CMakeLists.txt b/src/ADAPT_I/CMakeLists.txt new file mode 100644 index 000000000..f571c2158 --- /dev/null +++ b/src/ADAPT_I/CMakeLists.txt @@ -0,0 +1,93 @@ +# Copyright (C) 2012-2020 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# --- options --- +# additional include directories +INCLUDE_DIRECTORIES( + ${OMNIORB_INCLUDE_DIR} + ${KERNEL_INCLUDE_DIRS} + ${MEDFILE_INCLUDE_DIRS} + ${SMESH_INCLUDE_DIRS} + ${GEOM_INCLUDE_DIRS} + ${HDF5_INCLUDE_DIRS} + ${PROJECT_BINARY_DIR} + ${PROJECT_BINARY_DIR}/idl + ${PROJECT_BINARY_DIR}/adm_local/unix + ${PROJECT_SOURCE_DIR}/src/FrontTrack + ${PROJECT_SOURCE_DIR}/src/ADAPT + ${PROJECT_SOURCE_DIR}/src/ADAPTGUI +) +# additional preprocessor / compiler flags +ADD_DEFINITIONS( + ${OMNIORB_DEFINITIONS} +) + +# libraries to link to +SET(_link_LIBRARIES + ${MEDFILE_C_LIBRARIES} + ${KERNEL_SalomeContainer} + ${KERNEL_SalomeNS} + ${KERNEL_Registry} + ${KERNEL_SalomeHDFPersist} + ${KERNEL_SalomeLifeCycleCORBA} + ${KERNEL_TOOLSDS} + ${KERNEL_SalomeGenericObj} + ${SMESH_SalomeIDLSMESH} + ${SMESH_SMESHEngine} + FrontTrack + SalomeIDLADAPT + ADAPTImpl +) + +# --- headers --- + +# header files / no moc processing +SET(ADAPTEngine_HEADERS + HOMARD_Cas_i.hxx + HOMARD_Hypothesis_i.hxx + HOMARD_Iteration_i.hxx + HOMARD_Zone_i.hxx + HOMARD_Gen_i.hxx + HOMARD_Boundary_i.hxx + HOMARD_YACS_i.hxx + HomardMedCommun.h + HOMARD_i.hxx +) + +# --- sources --- + +# sources / static +SET(ADAPTEngine_SOURCES + HOMARD_Cas_i.cxx + HOMARD_Hypothesis_i.cxx + HOMARD_Iteration_i.cxx + HOMARD_Gen_i.cxx + HOMARD_Zone_i.cxx + HOMARD_Boundary_i.cxx + HOMARD_YACS_i.cxx + HomardMedCommun.cxx +) + +# --- rules --- + +ADD_LIBRARY(ADAPTEngine ${ADAPTEngine_SOURCES}) +TARGET_LINK_LIBRARIES(ADAPTEngine ${_link_LIBRARIES} ) +INSTALL(TARGETS ADAPTEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) + +INSTALL(FILES ${ADAPTEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) diff --git a/src/ADAPT_I/HOMARD_Boundary_i.cxx b/src/ADAPT_I/HOMARD_Boundary_i.cxx new file mode 100644 index 000000000..ef80c35b5 --- /dev/null +++ b/src/ADAPT_I/HOMARD_Boundary_i.cxx @@ -0,0 +1,262 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// +#include "HOMARD_Boundary_i.hxx" +#include "HOMARD_Gen_i.hxx" +#include "HOMARD_Boundary.hxx" +#include "HOMARD_DriverTools.hxx" + +#include "utilities.h" + +//============================================================================= +/*! + * standard constructor + */ +//============================================================================= +HOMARD_Boundary_i::HOMARD_Boundary_i() +{ + MESSAGE( "Default constructor, not for use" ); + ASSERT( 0 ); +} +//============================================================================= +/*! + * standard constructor + */ +//============================================================================= +HOMARD_Boundary_i::HOMARD_Boundary_i( CORBA::ORB_ptr orb, + HOMARD::HOMARD_Gen_var engine ) +{ + MESSAGE( "HOMARD_Boundary_i" ); + _gen_i = engine; + _orb = orb; + myHomardBoundary = new ::HOMARD_Boundary(); + ASSERT( myHomardBoundary ); +} +//============================================================================= +/*! + * standard destructor + */ +//============================================================================= +HOMARD_Boundary_i::~HOMARD_Boundary_i() +{ +} +//============================================================================= +//============================================================================= +// Generalites +//============================================================================= +//============================================================================= +void HOMARD_Boundary_i::SetName( const char* Name ) +{ + ASSERT( myHomardBoundary ); + myHomardBoundary->SetName( Name ); +} +//============================================================================= +char* HOMARD_Boundary_i::GetName() +{ + ASSERT( myHomardBoundary ); + return CORBA::string_dup( myHomardBoundary->GetName().c_str() ); +} +//============================================================================= +CORBA::Long HOMARD_Boundary_i::Delete() +{ + ASSERT( myHomardBoundary ); + char* BoundaryName = GetName() ; + MESSAGE ( "Delete : destruction de la frontiere " << BoundaryName ); + return _gen_i->DeleteBoundary(BoundaryName) ; +} +//============================================================================= +char* HOMARD_Boundary_i::GetDumpPython() +{ + ASSERT( myHomardBoundary ); + return CORBA::string_dup( myHomardBoundary->GetDumpPython().c_str() ); +} +//============================================================================= +std::string HOMARD_Boundary_i::Dump() const +{ + return HOMARD::Dump( *myHomardBoundary ); +} +//============================================================================= +bool HOMARD_Boundary_i::Restore( const std::string& stream ) +{ + return HOMARD::Restore( *myHomardBoundary, stream ); +} +//============================================================================= +//============================================================================= +// Caracteristiques +//============================================================================= +//============================================================================= +void HOMARD_Boundary_i::SetType( CORBA::Long Type ) +{ + ASSERT( myHomardBoundary ); + myHomardBoundary->SetType( Type ); +} +//============================================================================= +CORBA::Long HOMARD_Boundary_i::GetType() +{ + ASSERT( myHomardBoundary ); + return CORBA::Long( myHomardBoundary->GetType() ); +} +//============================================================================= +void HOMARD_Boundary_i::SetMeshName( const char* MeshName ) +{ + ASSERT( myHomardBoundary ); + myHomardBoundary->SetMeshName( MeshName ); +} +//============================================================================= +char* HOMARD_Boundary_i::GetMeshName() +{ + ASSERT( myHomardBoundary ); + return CORBA::string_dup( myHomardBoundary->GetMeshName().c_str() ); +} +//============================================================================= +void HOMARD_Boundary_i::SetDataFile( const char* DataFile ) +{ + ASSERT( myHomardBoundary ); + myHomardBoundary->SetDataFile( DataFile ); + int PublisMeshIN = _gen_i->GetPublisMeshIN () ; + if ( PublisMeshIN != 0 ) { _gen_i->PublishResultInSmesh(DataFile, 0); } +} +//============================================================================= +char* HOMARD_Boundary_i::GetDataFile() +{ + ASSERT( myHomardBoundary ); + return CORBA::string_dup( myHomardBoundary->GetDataFile().c_str() ); +} +//============================================================================= +void HOMARD_Boundary_i::SetCylinder( double X0, double X1, double X2, double X3, double X4, double X5, double X6 ) +{ + ASSERT( myHomardBoundary ); + myHomardBoundary->SetCylinder( X0, X1, X2, X3, X4, X5, X6 ); +} +//============================================================================= +void HOMARD_Boundary_i::SetSphere( double Xcentre, double Ycentre, double ZCentre, double rayon ) +{ + ASSERT( myHomardBoundary ); + myHomardBoundary->SetSphere( Xcentre, Ycentre, ZCentre, rayon ); +} +//============================================================================= +void HOMARD_Boundary_i::SetConeR( double Xcentre1, double Ycentre1, double Zcentre1, double Rayon1, double Xcentre2, double Ycentre2, double Zcentre2, double Rayon2) +{ + ASSERT( myHomardBoundary ); + myHomardBoundary->SetConeR( Xcentre1, Ycentre1, Zcentre1, Rayon1, Xcentre2, Ycentre2, Zcentre2, Rayon2 ); +} +//============================================================================= +void HOMARD_Boundary_i::SetConeA( double Xaxe, double Yaxe, double Zaxe, double Angle, double Xcentre, double Ycentre, double Zcentre) +{ + ASSERT( myHomardBoundary ); + myHomardBoundary->SetConeA( Xaxe, Yaxe, Zaxe, Angle, Xcentre, Ycentre, Zcentre ); +} +//============================================================================= +void HOMARD_Boundary_i::SetTorus( double X0, double X1, double X2, double X3, double X4, double X5, double X6, double X7 ) +{ + ASSERT( myHomardBoundary ); + myHomardBoundary->SetTorus( X0, X1, X2, X3, X4, X5, X6, X7 ); +} +//============================================================================= +HOMARD::double_array* HOMARD_Boundary_i::GetCoords() +{ + ASSERT( myHomardBoundary ); + HOMARD::double_array_var aResult = new HOMARD::double_array(); + std::vector mesCoor = myHomardBoundary->GetCoords(); + aResult->length( mesCoor .size() ); + std::vector::const_iterator it; + int i = 0; + for ( it = mesCoor.begin(); it != mesCoor.end(); it++ ) + aResult[i++] = (*it); + return aResult._retn(); +} +//============================================================================= +void HOMARD_Boundary_i::SetLimit( double Xincr, double Yincr, double Zincr ) +{ + ASSERT( myHomardBoundary ); + myHomardBoundary->SetLimit( Xincr, Yincr, Zincr ); +} +//============================================================================= +HOMARD::double_array* HOMARD_Boundary_i::GetLimit() +{ + ASSERT( myHomardBoundary ); + HOMARD::double_array_var aResult = new HOMARD::double_array(); + std::vector mesCoor = myHomardBoundary->GetLimit(); + aResult->length( mesCoor .size() ); + std::vector::const_iterator it; + int i = 0; + for ( it = mesCoor.begin(); it != mesCoor.end(); it++ ) + aResult[i++] = (*it); + return aResult._retn(); +} +//============================================================================= +void HOMARD_Boundary_i::AddGroup( const char* Group) +{ + ASSERT( myHomardBoundary ); + myHomardBoundary->AddGroup( Group ); +} +//============================================================================= +void HOMARD_Boundary_i::SetGroups(const HOMARD::ListGroupType& ListGroup) +{ + ASSERT( myHomardBoundary ); + std::list ListString; + for ( int i = 0; i < ListGroup.length(); i++ ) + { + ListString.push_back(std::string(ListGroup[i])); + } + myHomardBoundary->SetGroups( ListString ); +} +//============================================================================= +HOMARD::ListGroupType* HOMARD_Boundary_i::GetGroups() +{ + ASSERT( myHomardBoundary ); + const std::list& ListString = myHomardBoundary->GetGroups(); + HOMARD::ListGroupType_var aResult = new HOMARD::ListGroupType; + aResult->length( ListString.size() ); + std::list::const_iterator it; + int i = 0; + for ( it = ListString.begin(); it != ListString.end(); it++ ) + { + aResult[i++] = CORBA::string_dup( (*it).c_str() ); + } + return aResult._retn(); +} +//============================================================================= +//============================================================================= +// Liens avec les autres structures +//============================================================================= +//============================================================================= +void HOMARD_Boundary_i::SetCaseCreation( const char* NomCaseCreation ) +{ + ASSERT( myHomardBoundary ); + myHomardBoundary->SetCaseCreation( NomCaseCreation ); +} +//============================================================================= +char* HOMARD_Boundary_i::GetCaseCreation() +{ + ASSERT( myHomardBoundary ); + return CORBA::string_dup( myHomardBoundary->GetCaseCreation().c_str() ); +} + + + diff --git a/src/ADAPT_I/HOMARD_Boundary_i.hxx b/src/ADAPT_I/HOMARD_Boundary_i.hxx new file mode 100644 index 000000000..eaac61af3 --- /dev/null +++ b/src/ADAPT_I/HOMARD_Boundary_i.hxx @@ -0,0 +1,112 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#ifndef _HOMARD_Boundary_I_HXX_ +#define _HOMARD_Boundary_I_HXX_ + +#include +#include CORBA_SERVER_HEADER(HOMARD_Gen) +#include CORBA_SERVER_HEADER(HOMARD_Boundary) + +#include "HOMARD_i.hxx" +#include "SALOME_Component_i.hxx" +#include "SALOME_NamingService.hxx" +#include "Utils_CorbaException.hxx" + +#include + +class HOMARD_Boundary; + +class HOMARDENGINE_EXPORT HOMARD_Boundary_i: + public virtual Engines_Component_i, + public virtual POA_HOMARD::HOMARD_Boundary, + public virtual PortableServer::ServantBase +{ +public: + HOMARD_Boundary_i( CORBA::ORB_ptr orb, HOMARD::HOMARD_Gen_var gen_i ); + HOMARD_Boundary_i(); + + virtual ~HOMARD_Boundary_i(); + +// Generalites + void SetName( const char* Name ); + char* GetName(); + + CORBA::Long Delete(); + + char* GetDumpPython(); + + std::string Dump() const; + bool Restore( const std::string& stream ); + +// Caracteristiques + void SetType( CORBA::Long Type ); + CORBA::Long GetType(); + + void SetMeshName( const char* MeshName ); + char* GetMeshName(); + + void SetDataFile( const char* DataFile ); + char* GetDataFile(); + + void SetCylinder( double Xcentre, double Ycentre, double ZCentre, + double Xaxe, double Yaxe, double Zaxe, + double rayon ); + void SetSphere( double Xcentre, double Ycentre, double ZCentre, + double rayon ); + void SetConeR( double Xcentre1, double Ycentre1, double Zcentre1, double Rayon1, + double Xcentre2, double Ycentre2, double Zcentre2, double Rayon2); + void SetConeA( double Xaxe, double Yaxe, double Zaxe, double Angle, + double Xcentre, double Ycentre, double ZCentre); + void SetTorus( double Xcentre, double Ycentre, double ZCentre, + double Xaxe, double Yaxe, double Zaxe, + double rayonRev, double rayonPri ); + + HOMARD::double_array* GetCoords(); + + void SetLimit( double Xincr, double Yincr, double Zincr); + HOMARD::double_array* GetLimit(); + + void AddGroup( const char* Group); + void SetGroups(const HOMARD::ListGroupType& ListGroup); + HOMARD::ListGroupType* GetGroups(); + +// Liens avec les autres structures + void SetCaseCreation( const char* NomCaseCreation ); + char* GetCaseCreation(); + + +private: + ::HOMARD_Boundary* myHomardBoundary; + + CORBA::ORB_ptr _orb; + HOMARD::HOMARD_Gen_var _gen_i; +}; + +#endif diff --git a/src/ADAPT_I/HOMARD_Cas_i.cxx b/src/ADAPT_I/HOMARD_Cas_i.cxx new file mode 100644 index 000000000..036dacef1 --- /dev/null +++ b/src/ADAPT_I/HOMARD_Cas_i.cxx @@ -0,0 +1,599 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#include "HOMARD_Cas_i.hxx" +#include "HOMARD_Gen_i.hxx" +#include "HOMARD_Cas.hxx" +#include "HOMARD_DriverTools.hxx" +#include "HOMARD.hxx" + +#include "utilities.h" +#include +#include + +#ifdef WIN32 +#include +#endif + +//============================================================================= +/*! + * standard constructor + */ +//============================================================================= +HOMARD_Cas_i::HOMARD_Cas_i() +{ + MESSAGE( "Default constructor, not for use" ); + ASSERT( 0 ); +} + +//============================================================================= +/*! + * standard constructor + */ +//============================================================================= +HOMARD_Cas_i::HOMARD_Cas_i( CORBA::ORB_ptr orb, + HOMARD::HOMARD_Gen_var engine ) +{ + MESSAGE( "HOMARD_Cas_i" ); + _gen_i = engine; + _orb = orb; + myHomardCas = new ::HOMARD_Cas(); + ASSERT( myHomardCas ); +} + +//============================================================================= +/*! + * standard destructor + */ +//============================================================================= +HOMARD_Cas_i::~HOMARD_Cas_i() +{ +} +//============================================================================= +//============================================================================= +// Generalites +//============================================================================= +//============================================================================= +void HOMARD_Cas_i::SetName( const char* Name ) +{ + ASSERT( myHomardCas ); + myHomardCas->SetName( Name ); +} +//============================================================================= +char* HOMARD_Cas_i::GetName() +{ + ASSERT( myHomardCas ); + return CORBA::string_dup( myHomardCas->GetName().c_str() ); +} +//============================================================================= +CORBA::Long HOMARD_Cas_i::Delete( CORBA::Long Option ) +{ + ASSERT( myHomardCas ); + char* CaseName = GetName() ; + MESSAGE ( "Delete : destruction du cas " << CaseName << ", Option = " << Option ); + return _gen_i->DeleteCase(CaseName, Option) ; +} +//============================================================================= +char* HOMARD_Cas_i::GetDumpPython() +{ + ASSERT( myHomardCas ); + return CORBA::string_dup( myHomardCas->GetDumpPython().c_str() ); +} +//============================================================================= +std::string HOMARD_Cas_i::Dump() const +{ + return HOMARD::Dump( *myHomardCas ); +} +//============================================================================= +bool HOMARD_Cas_i::Restore( const std::string& stream ) +{ + return HOMARD::Restore( *myHomardCas, stream ); +} +//============================================================================= +//============================================================================= +// Caracteristiques +//============================================================================= +//============================================================================= +void HOMARD_Cas_i::SetDirName( const char* NomDir ) +{ + ASSERT( myHomardCas ); + int codret ; + // A. recuperation du nom ; on ne fait rien si c'est le meme + char* oldrep = GetDirName() ; + if ( strcmp(oldrep,NomDir) == 0 ) + { + return ; + } + MESSAGE ( "SetDirName : passage de oldrep = "<< oldrep << " a NomDir = "<VerifieDir(NomDir) ; + if ( ( std::string(casenamedir).size() > 0 ) & ( strcmp(CaseName,casenamedir)!=0 ) ) + { + INFOS ( "Le repertoire " << NomDir << " est deja utilise pour le cas "<< casenamedir ); + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + std::string text ; + text = "The directory " + std::string(NomDir) + " is already used for the case " + std::string(casenamedir) ; + es.text = CORBA::string_dup(text.c_str()); + throw SALOME::SALOME_Exception(es); + } + // C. Changement/creation du repertoire + codret = myHomardCas->SetDirName( NomDir ); + if ( codret != 0 ) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + std::string text ; + if ( codret == 1 ) { text = "The directory for the case cannot be modified because some iterations are already defined." ; } + else { text = "The directory for the case cannot be reached." ; } + es.text = CORBA::string_dup(text.c_str()); + throw SALOME::SALOME_Exception(es); + } + // D. En cas de reprise, deplacement du point de depart + if ( GetState() != 0 ) + { + MESSAGE ( "etat : " << GetState() ) ; + // D.1. Nom local du repertoire de l'iteration de depart dans le repertoire actuel du cas + HOMARD::HOMARD_Iteration_ptr Iter = GetIter0() ; + char* DirNameIter = Iter->GetDirNameLoc() ; + MESSAGE ( "SetDirName : nom actuel pour le repertoire de l iteration, DirNameIter = "<< DirNameIter); + // D.2. Recherche d'un nom local pour l'iteration de depart dans le futur repertoire du cas + char* nomDirIter = _gen_i->CreateDirNameIter(NomDir, 0 ); + MESSAGE ( "SetDirName : nom futur pour le repertoire de l iteration, nomDirIter = "<< nomDirIter); + // D.3. Creation du futur repertoire local pour l'iteration de depart + std::string nomDirIterTotal ; + nomDirIterTotal = std::string(NomDir) + "/" + std::string(nomDirIter) ; +#ifndef WIN32 + if (mkdir(nomDirIterTotal.c_str(), S_IRWXU|S_IRGRP|S_IXGRP) != 0) +#else + if (_mkdir(nomDirIterTotal.c_str()) != 0) +#endif + { + MESSAGE ( "nomDirIterTotal : " << nomDirIterTotal ) ; + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + std::string text = "The directory for the starting iteration cannot be created." ; + es.text = CORBA::string_dup(text.c_str()); + throw SALOME::SALOME_Exception(es); + } + // D.4. Deplacement du contenu du repertoire + std::string oldnomDirIterTotal ; + oldnomDirIterTotal = std::string(oldrep) + "/" + std::string(DirNameIter) ; + std::string commande = "mv " + std::string(oldnomDirIterTotal) + "/*" + " " + std::string(nomDirIterTotal) ; + codret = system(commande.c_str()) ; + if ( codret != 0 ) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + std::string text = "The starting point for the case cannot be moved into the new directory." ; + es.text = CORBA::string_dup(text.c_str()); + throw SALOME::SALOME_Exception(es); + } + commande = "rm -rf " + std::string(oldnomDirIterTotal) ; + codret = system(commande.c_str()) ; + if ( codret != 0 ) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + std::string text = "The starting point for the case cannot be deleted." ; + es.text = CORBA::string_dup(text.c_str()); + throw SALOME::SALOME_Exception(es); + } + // D.5. Memorisation du nom du repertoire de l'iteration + Iter->SetDirNameLoc(nomDirIter) ; + } + return ; +} +//============================================================================= +char* HOMARD_Cas_i::GetDirName() +{ + ASSERT( myHomardCas ); + return CORBA::string_dup( myHomardCas->GetDirName().c_str() ); +} +//============================================================================= +CORBA::Long HOMARD_Cas_i::GetState() +{ + ASSERT( myHomardCas ); +// Nom de l'iteration initiale + char* Iter0Name = GetIter0Name() ; + HOMARD::HOMARD_Iteration_ptr Iter = _gen_i->GetIteration(Iter0Name) ; + int state = Iter->GetNumber() ; + return state ; +} +//============================================================================= +CORBA::Long HOMARD_Cas_i::GetNumberofIter() +{ + ASSERT( myHomardCas ); + return myHomardCas->GetNumberofIter(); +} +//============================================================================= +void HOMARD_Cas_i::SetConfType( CORBA::Long ConfType ) +{ + ASSERT( myHomardCas ); +// VERIFICATION( (ConfType>=-2) && (ConfType<=3) ); + myHomardCas->SetConfType( ConfType ); +} +//============================================================================= +CORBA::Long HOMARD_Cas_i::GetConfType() +{ + ASSERT( myHomardCas ); + return myHomardCas->GetConfType(); +} +//============================================================================= +void HOMARD_Cas_i::SetExtType( CORBA::Long ExtType ) +{ + ASSERT( myHomardCas ); +// VERIFICATION( (ExtType>=0) && (ExtType<=2) ); + myHomardCas->SetExtType( ExtType ); +} +//============================================================================= +CORBA::Long HOMARD_Cas_i::GetExtType() +{ + ASSERT( myHomardCas ); + return myHomardCas->GetExtType(); +} +//============================================================================= +void HOMARD_Cas_i::SetBoundingBox( const HOMARD::extrema& LesExtrema ) +{ + ASSERT( myHomardCas ); + std::vector VExtrema; + ASSERT( LesExtrema.length() == 10 ); + VExtrema.resize( LesExtrema.length() ); + for ( int i = 0; i < LesExtrema.length(); i++ ) + { + VExtrema[i] = LesExtrema[i]; + } + myHomardCas->SetBoundingBox( VExtrema ); +} +//============================================================================= +HOMARD::extrema* HOMARD_Cas_i::GetBoundingBox() +{ + ASSERT(myHomardCas ); + HOMARD::extrema_var aResult = new HOMARD::extrema(); + std::vector LesExtremes = myHomardCas->GetBoundingBox(); + ASSERT( LesExtremes.size() == 10 ); + aResult->length( 10 ); + for ( int i = 0; i < LesExtremes.size(); i++ ) + { + aResult[i] = LesExtremes[i]; + } + return aResult._retn(); +} +//============================================================================= +void HOMARD_Cas_i::AddGroup( const char* Group) +{ + ASSERT( myHomardCas ); + myHomardCas->AddGroup( Group ); +} +//============================================================================= +void HOMARD_Cas_i::SetGroups( const HOMARD::ListGroupType& ListGroup ) +{ + ASSERT( myHomardCas ); + std::list ListString ; + for ( int i = 0; i < ListGroup.length(); i++ ) + { + ListString.push_back(std::string(ListGroup[i])); + } + myHomardCas->SetGroups( ListString ); +} +//============================================================================= +HOMARD::ListGroupType* HOMARD_Cas_i::GetGroups() +{ + ASSERT(myHomardCas ); + const std::list& ListString = myHomardCas->GetGroups(); + HOMARD::ListGroupType_var aResult = new HOMARD::ListGroupType(); + aResult->length( ListString.size() ); + std::list::const_iterator it; + int i = 0; + for ( it = ListString.begin(); it != ListString.end(); it++ ) + { + aResult[i++] = CORBA::string_dup( (*it).c_str() ); + } + return aResult._retn(); +} +//============================================================================= +void HOMARD_Cas_i::AddBoundary(const char* BoundaryName) +{ + MESSAGE ("HOMARD_Cas_i::AddBoundary : BoundaryName = "<< BoundaryName ); + const char * Group = "" ; + AddBoundaryGroup( BoundaryName, Group) ; +} +//============================================================================= +void HOMARD_Cas_i::AddBoundaryGroup( const char* BoundaryName, const char* Group) +{ + MESSAGE ("HOMARD_Cas_i::AddBoundaryGroup : BoundaryName = "<< BoundaryName << ", Group = " << Group ); + ASSERT( myHomardCas ); + // A. Préalables + // A.1. Caractéristiques de la frontière à ajouter + HOMARD::HOMARD_Boundary_ptr myBoundary = _gen_i->GetBoundary(BoundaryName) ; + ASSERT(!CORBA::is_nil(myBoundary)); + int BoundaryType = myBoundary->GetType(); + MESSAGE ( ". BoundaryType = " << BoundaryType ); + // A.2. La liste des frontiere+groupes + const std::list& ListBoundaryGroup = myHomardCas->GetBoundaryGroup(); + std::list::const_iterator it; + // B. Controles + const char * boun ; + int erreur = 0 ; + while ( erreur == 0 ) + { + // B.1. Si on ajoute une frontière CAO, elle doit être la seule frontière + if ( BoundaryType == -1 ) + { + for ( it = ListBoundaryGroup.begin(); it != ListBoundaryGroup.end(); it++ ) + { + boun = (*it).c_str() ; + MESSAGE (".. Frontiere enregistrée : "<< boun ); + if ( *it != BoundaryName ) + { erreur = 1 ; + break ; } + // On saute le nom du groupe + it++ ; + } + } + if ( erreur != 0 ) { break ; } + // B.2. Si on ajoute une frontière non CAO, il ne doit pas y avoir de frontière CAO + if ( BoundaryType != -1 ) + { + for ( it = ListBoundaryGroup.begin(); it != ListBoundaryGroup.end(); it++ ) + { + boun = (*it).c_str() ; + MESSAGE (".. Frontiere enregistrée : "<< boun ); + HOMARD::HOMARD_Boundary_ptr myBoundary_0 = _gen_i->GetBoundary(boun) ; + int BoundaryType_0 = myBoundary_0->GetType(); + MESSAGE ( ".. BoundaryType_0 = " << BoundaryType_0 ); + if ( BoundaryType_0 == -1 ) + { erreur = 2 ; + break ; } + // On saute le nom du groupe + it++ ; + } + if ( erreur != 0 ) { break ; } + } + // B.3. Si on ajoute une frontière discrète, il ne doit pas y avoir d'autre frontière discrète + if ( BoundaryType == 0 ) + { + for ( it = ListBoundaryGroup.begin(); it != ListBoundaryGroup.end(); it++ ) + { + boun = (*it).c_str() ; + MESSAGE (".. Frontiere enregistrée : "<< boun ); + if ( boun != BoundaryName ) + { + HOMARD::HOMARD_Boundary_ptr myBoundary_0 = _gen_i->GetBoundary(boun) ; + int BoundaryType_0 = myBoundary_0->GetType(); + MESSAGE ( ".. BoundaryType_0 = " << BoundaryType_0 ); + if ( BoundaryType_0 == 0 ) + { erreur = 3 ; + break ; } + } + // On saute le nom du groupe + it++ ; + } + if ( erreur != 0 ) { break ; } + } + // B.4. Pour une nouvelle frontiere, publication dans l'arbre d'etudes sous le cas + bool existe = false ; + for ( it = ListBoundaryGroup.begin(); it != ListBoundaryGroup.end(); it++ ) + { + MESSAGE (".. Frontiere : "<< *it ); + if ( *it == BoundaryName ) { existe = true ; } + // On saute le nom du groupe + it++ ; + } + if ( !existe ) + { + char* CaseName = GetName() ; + MESSAGE ( "AddBoundaryGroup : insertion de la frontiere dans l'arbre de " << CaseName ); + _gen_i->PublishBoundaryUnderCase(CaseName, BoundaryName) ; + } + // B.5. Le groupe est-il deja enregistre pour une frontiere de ce cas ? + for ( it = ListBoundaryGroup.begin(); it != ListBoundaryGroup.end(); it++ ) + { + boun = (*it).c_str() ; + it++ ; + MESSAGE (".. Groupe enregistré : "<< *it ); + if ( *it == Group ) + { erreur = 5 ; + break ; } + } + if ( erreur != 0 ) { break ; } + // + break ; + } + // F. Si aucune erreur, enregistrement du couple (frontiere,groupe) dans la reference du cas + // Sinon, arrêt + if ( erreur == 0 ) + { myHomardCas->AddBoundaryGroup( BoundaryName, Group ); } + else + { + std::stringstream ss; + ss << erreur; + std::string str = ss.str(); + std::string texte ; + texte = "Erreur numéro " + str + " pour la frontière à enregistrer : " + std::string(BoundaryName) ; + if ( erreur == 1 ) { texte += "\nIl existe déjà la frontière " ; } + else if ( erreur == 2 ) { texte += "\nIl existe déjà la frontière CAO " ; } + else if ( erreur == 3 ) { texte += "\nIl existe déjà une frontière discrète : " ; } + else if ( erreur == 5 ) { texte += "\nLe groupe " + std::string(Group) + " est déjà enregistré pour la frontière " ; } + texte += std::string(boun) ; + // + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; +#ifdef _DEBUG_ + texte += "\nInvalid AddBoundaryGroup"; +#endif + INFOS(texte) ; + es.text = CORBA::string_dup(texte.c_str()); + throw SALOME::SALOME_Exception(es); + } +} +//============================================================================= +HOMARD::ListBoundaryGroupType* HOMARD_Cas_i::GetBoundaryGroup() +{ + MESSAGE ("GetBoundaryGroup"); + ASSERT(myHomardCas ); + const std::list& ListBoundaryGroup = myHomardCas->GetBoundaryGroup(); + HOMARD::ListBoundaryGroupType_var aResult = new HOMARD::ListBoundaryGroupType(); + aResult->length( ListBoundaryGroup.size() ); + std::list::const_iterator it; + int i = 0; + for ( it = ListBoundaryGroup.begin(); it != ListBoundaryGroup.end(); it++ ) + { + aResult[i++] = CORBA::string_dup( (*it).c_str() ); + } + return aResult._retn(); +} +//============================================================================= +void HOMARD_Cas_i::SupprBoundaryGroup() +{ + MESSAGE ("SupprBoundaryGroup"); + ASSERT(myHomardCas ); + myHomardCas->SupprBoundaryGroup(); +} +//============================================================================= +void HOMARD_Cas_i::SetPyram( CORBA::Long Pyram ) +{ + MESSAGE ("SetPyram, Pyram = " << Pyram ); + ASSERT( myHomardCas ); + myHomardCas->SetPyram( Pyram ); +} +//============================================================================= +CORBA::Long HOMARD_Cas_i::GetPyram() +{ + MESSAGE ("GetPyram"); + ASSERT( myHomardCas ); + return myHomardCas->GetPyram(); +} +//============================================================================= +void HOMARD_Cas_i::MeshInfo(CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte) +{ + MESSAGE ( "MeshInfo : information sur le maillage initial du cas" ); + ASSERT( myHomardCas ); +// +// Nom de l'iteration + char* IterName = GetIter0Name() ; + CORBA::Long etatMenage = -1 ; + CORBA::Long modeHOMARD = 7 ; + CORBA::Long Option1 = 1 ; + CORBA::Long Option2 = 1 ; + if ( Qual != 0 ) { modeHOMARD = modeHOMARD*5 ; } + if ( Diam != 0 ) { modeHOMARD = modeHOMARD*19 ; } + if ( Conn != 0 ) { modeHOMARD = modeHOMARD*11 ; } + if ( Tail != 0 ) { modeHOMARD = modeHOMARD*13 ; } + if ( Inte != 0 ) { modeHOMARD = modeHOMARD*3 ; } + CORBA::Long codret = _gen_i->Compute(IterName, etatMenage, modeHOMARD, Option1, Option2) ; + MESSAGE ( "MeshInfo : codret = " << codret ); + return ; +} +//============================================================================= +//============================================================================= +// Liens avec les autres structures +//============================================================================= +//============================================================================= +char* HOMARD_Cas_i::GetIter0Name() +{ + ASSERT( myHomardCas ); + return CORBA::string_dup( myHomardCas->GetIter0Name().c_str() ); +} +//============================================================================= +HOMARD::HOMARD_Iteration_ptr HOMARD_Cas_i::GetIter0() +{ +// Nom de l'iteration initiale + char* Iter0Name = GetIter0Name() ; + MESSAGE ( "GetIter0 : Iter0Name = " << Iter0Name ); + return _gen_i->GetIteration(Iter0Name) ; +} +//============================================================================= +HOMARD::HOMARD_Iteration_ptr HOMARD_Cas_i::NextIteration( const char* IterName ) +{ +// Nom de l'iteration parent + char* NomIterParent = GetIter0Name() ; + MESSAGE ( "NextIteration : IterName = " << IterName ); + MESSAGE ( "NextIteration : NomIterParent = " << NomIterParent ); + return _gen_i->CreateIteration(IterName, NomIterParent) ; +} +//============================================================================= +HOMARD::HOMARD_Iteration_ptr HOMARD_Cas_i::LastIteration( ) +{ + HOMARD::HOMARD_Iteration_ptr Iter ; + HOMARD::listeIterFilles_var ListeIterFilles ; + char* IterName ; +// Iteration initiale du cas + IterName = GetIter0Name() ; +// On va explorer la descendance de cette iteration initiale +// jusqu'a trouver celle qui n'a pas de filles + int nbiterfilles = 1 ; + while ( nbiterfilles == 1 ) + { +// L'iteration associee +// MESSAGE ( ".. IterName = " << IterName ); + Iter = _gen_i->GetIteration(IterName) ; +// Les filles de cette iteration + ListeIterFilles = Iter->GetIterations() ; + nbiterfilles = ListeIterFilles->length() ; +// MESSAGE ( ".. nbiterfilles = " << nbiterfilles ); +// S'il y a au moins 2 filles, arret : on ne sait pas faire + VERIFICATION( nbiterfilles <= 1 ) ; +// S'il y a une fille unique, on recupere le nom de la fille et on recommence + if ( nbiterfilles == 1 ) + { IterName = ListeIterFilles[0] ; } + } +// + return Iter ; +} +//============================================================================= +void HOMARD_Cas_i::AddIteration( const char* NomIteration ) +{ + ASSERT( myHomardCas ); + myHomardCas->AddIteration( NomIteration ); +} +//============================================================================= +//============================================================================= +// YACS +//============================================================================= +//============================================================================= +//============================================================================= +// Creation d'un schema YACS +// YACSName : nom du schema +// ScriptFile : nom du fichier contenant le script de lancement du calcul +// DirName : le repertoire de lancement des calculs du sch?ma +// MeshFile : nom du fichier contenant le maillage pour le premier calcul +//============================================================================= +HOMARD::HOMARD_YACS_ptr HOMARD_Cas_i::CreateYACSSchema( const char* YACSName, const char* ScriptFile, const char* DirName, const char* MeshFile ) +{ +// Nom du cas + const char* CaseName = GetName() ; + MESSAGE ( "CreateYACSSchema : Schema YACS pour le cas " << YACSName); + MESSAGE ( "nomCas : " << CaseName); + MESSAGE ( "ScriptFile : " << ScriptFile); + MESSAGE ( "DirName : " << DirName); + MESSAGE ( "MeshFile : " << MeshFile); + return _gen_i->CreateYACSSchema(YACSName, CaseName, ScriptFile, DirName, MeshFile) ; +} diff --git a/src/ADAPT_I/HOMARD_Cas_i.hxx b/src/ADAPT_I/HOMARD_Cas_i.hxx new file mode 100644 index 000000000..94d17f857 --- /dev/null +++ b/src/ADAPT_I/HOMARD_Cas_i.hxx @@ -0,0 +1,119 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#ifndef _HOMARD_CAS_I_HXX_ +#define _HOMARD_CAS_I_HXX_ + +#include +#include CORBA_SERVER_HEADER(HOMARD_Gen) +#include CORBA_SERVER_HEADER(HOMARD_Cas) + +#include "HOMARD_i.hxx" +#include "SALOME_Component_i.hxx" +#include "SALOME_NamingService.hxx" +#include "Utils_CorbaException.hxx" + +#include + +class HOMARD_Cas; + +class HOMARDENGINE_EXPORT HOMARD_Cas_i: + public virtual Engines_Component_i, + public virtual POA_HOMARD::HOMARD_Cas, + public virtual PortableServer::ServantBase +{ +public: + HOMARD_Cas_i( CORBA::ORB_ptr orb, HOMARD::HOMARD_Gen_var gen_i ); + HOMARD_Cas_i(); + + virtual ~HOMARD_Cas_i(); + +// Generalites + void SetName( const char* Name ); + char* GetName(); + + CORBA::Long Delete( CORBA::Long Option ); + + char* GetDumpPython(); + + std::string Dump() const; + bool Restore( const std::string& stream ); + +// Caracteristiques + void SetDirName( const char* NomDir ); + char* GetDirName(); + + CORBA::Long GetState(); + + CORBA::Long GetNumberofIter(); + + void SetConfType( CORBA::Long ConfType ); + CORBA::Long GetConfType(); + + void SetExtType( CORBA::Long ExtType ); + CORBA::Long GetExtType(); + + void SetBoundingBox( const HOMARD::extrema& LesExtremes ); + HOMARD::extrema* GetBoundingBox(); + + void AddGroup( const char* Group); + void SetGroups(const HOMARD::ListGroupType& ListGroup); + HOMARD::ListGroupType* GetGroups(); + + void AddBoundary(const char* Boundary); + void AddBoundaryGroup(const char* Boundary, const char* Group); + HOMARD::ListBoundaryGroupType* GetBoundaryGroup(); + void SupprBoundaryGroup( ); + + void SetPyram( CORBA::Long Pyram ); + CORBA::Long GetPyram(); + + void MeshInfo(CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte); + +// Liens avec les autres structures + char* GetIter0Name(); + HOMARD::HOMARD_Iteration_ptr GetIter0() ; + + HOMARD::HOMARD_Iteration_ptr NextIteration( const char* Name ) ; + + HOMARD::HOMARD_Iteration_ptr LastIteration() ; + + void AddIteration( const char* NomIteration ); + +// YACS + HOMARD::HOMARD_YACS_ptr CreateYACSSchema( const char* YACSName, const char* ScriptFile, const char* DirName, const char* MeshFile ); + +private: + ::HOMARD_Cas* myHomardCas; + + CORBA::ORB_ptr _orb; + HOMARD::HOMARD_Gen_var _gen_i; +}; + +#endif diff --git a/src/ADAPT_I/HOMARD_Gen_i.cxx b/src/ADAPT_I/HOMARD_Gen_i.cxx new file mode 100644 index 000000000..dde42a691 --- /dev/null +++ b/src/ADAPT_I/HOMARD_Gen_i.cxx @@ -0,0 +1,5432 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "HOMARD_Gen_i.hxx" +#include "HOMARD_Cas_i.hxx" +#include "HOMARD_Hypothesis_i.hxx" +#include "HOMARD_Iteration_i.hxx" +#include "HOMARD_Boundary_i.hxx" +#include "HOMARD_Zone_i.hxx" +#include "HOMARD_YACS_i.hxx" +#include "HomardDriver.hxx" +#include "HOMARD_DriverTools.hxx" +#include "HomardMedCommun.h" +#include "YACSDriver.hxx" +#include "HOMARD.hxx" + +#include "FrontTrack.hxx" + +#include "HOMARD_version.h" + +#include "utilities.h" +#include "Basics_Utils.hxx" +#include "Basics_DirUtils.hxx" +#include "Utils_SINGLETON.hxx" +#include "Utils_CorbaException.hxx" +#include "SALOMEDS_Tool.hxx" +#include "SALOME_LifeCycleCORBA.hxx" +#include "SALOMEconfig.h" +#include +#include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog) +#include CORBA_CLIENT_HEADER(SMESH_Gen) + +#include +#include +#include +#ifndef WIN32 +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef WIN32 +#include +#endif + +using namespace std; + +//============================================================================= +//functions +//============================================================================= +std::string RemoveTabulation( std::string theScript ) +{ + std::string::size_type aPos = 0; + while( aPos < theScript.length() ) + { + aPos = theScript.find( "\n\t", aPos ); + if( aPos == std::string::npos ) + break; + theScript.replace( aPos, 2, "\n" ); + aPos++; + } + return theScript; +} +//============================================================================= +/*! + * standard constructor + */ +//============================================================================= +HOMARD_Gen_i::HOMARD_Gen_i( CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName) : +Engines_Component_i(orb, poa, contId, instanceName, interfaceName) +{ + MESSAGE("constructor"); + _thisObj = this; + _id = _poa->activate_object(_thisObj); + + myHomard = new ::HOMARD_Gen(); + _NS = SINGLETON_::Instance(); + ASSERT(SINGLETON_::IsAlreadyExisting()); + _NS->init_orb(_orb); + + myStudy = SALOMEDS::Study::_duplicate( SMESH_Gen_i::getStudyServant() ); + + _tag_gene = 0 ; + _tag_boun = 0 ; + _tag_hypo = 0 ; + _tag_yacs = 0 ; + _tag_zone = 0 ; + + SetPreferences( ) ; +} +//================================= +/*! + * standard destructor + */ +//================================ +HOMARD_Gen_i::~HOMARD_Gen_i() +{ +} +//============================================================================= +//============================================================================= +// Utilitaires pour l'étude +//============================================================================= +//============================================================================= +void HOMARD_Gen_i::UpdateStudy() +{ + ASSERT(!CORBA::is_nil(myStudy)); + SALOMEDS::StudyBuilder_var myBuilder = myStudy->NewBuilder(); + + // Create SComponent labelled 'homard' if it doesn't already exit + SALOMEDS::SComponent_var homardFather = myStudy->FindComponent(ComponentDataType()); + if (CORBA::is_nil(homardFather)) + { + myBuilder->NewCommand(); + MESSAGE("Add Component HOMARD"); + + bool aLocked = myStudy->GetProperties()->IsLocked(); + if (aLocked) myStudy->GetProperties()->SetLocked(false); + + homardFather = myBuilder->NewComponent(ComponentDataType()); + SALOMEDS::GenericAttribute_var anAttr = myBuilder->FindOrCreateAttribute(homardFather,"AttributeName"); + SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr); + CORBA::Object_var objVarN = _NS->Resolve("/Kernel/ModulCatalog"); + SALOME_ModuleCatalog::ModuleCatalog_var Catalogue = + SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN); + SALOME_ModuleCatalog::Acomponent_var Comp = Catalogue->GetComponent(ComponentDataType()); + if (!Comp->_is_nil()) + { + aName->SetValue(ComponentDataType()); + } + + anAttr = myBuilder->FindOrCreateAttribute(homardFather,"AttributePixMap"); + SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); + aPixmap->SetPixMap("HOMARD_2.png"); + myBuilder->DefineComponentInstance(homardFather, HOMARD_Gen::_this()); + + if (aLocked) myStudy->GetProperties()->SetLocked(true); + myBuilder->CommitCommand(); + } +} + +//============================================================================= +//============================================================================= +// Utilitaires pour l'iteration +//============================================================================= +//============================================================================= +void HOMARD_Gen_i::SetEtatIter(const char* nomIter, const CORBA::Long Etat) +//===================================================================================== +{ + MESSAGE( "SetEtatIter : affectation de l'etat " << Etat << " a l'iteration " << nomIter ); + HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; + if (CORBA::is_nil(myIteration)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid iteration"; + throw SALOME::SALOME_Exception(es); + return ; + }; + + myIteration->SetState(Etat); + + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); + SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration))); + + std::string icone ; + if ( Etat <= 0 ) + icone = "iter0.png" ; + else if ( Etat == 2 ) + icone = "iter_calculee.png" ; + else + icone = "iter_non_calculee.png" ; + PublishInStudyAttr(aStudyBuilder, aIterSO, NULL , NULL, icone.c_str(), NULL) ; + + aStudyBuilder->CommitCommand(); + +} +//============================================================================= +//============================================================================= +// +//============================================================================= +//============================================================================= +// Destruction des structures identifiees par leurs noms +//============================================================================= +//============================================================================= +CORBA::Long HOMARD_Gen_i::DeleteBoundary(const char* BoundaryName) +{ + MESSAGE ( "DeleteBoundary : BoundaryName = " << BoundaryName ); + HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; + if (CORBA::is_nil(myBoundary)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid boundary"; + throw SALOME::SALOME_Exception(es); + return 1 ; + }; + +// On verifie que la frontiere n'est plus utilisee + HOMARD::listeCases* maListe = GetAllCasesName(); + int numberOfCases = maListe->length(); + MESSAGE ( ".. Nombre de cas = " << numberOfCases ); + std::string CaseName ; + HOMARD::ListBoundaryGroupType* ListBoundaryGroupType ; + int numberOfitems ; + HOMARD::HOMARD_Cas_var myCase ; + for (int NumeCas = 0; NumeCas< numberOfCases; NumeCas++) + { + CaseName = std::string((*maListe)[NumeCas]); + MESSAGE ( "... Examen du cas = " << CaseName.c_str() ); + myCase = myStudyContext._mesCas[CaseName]; + ASSERT(!CORBA::is_nil(myCase)); + ListBoundaryGroupType = myCase->GetBoundaryGroup(); + numberOfitems = ListBoundaryGroupType->length(); + MESSAGE ( "... number of string for Boundary+Group = " << numberOfitems); + for (int NumBoundary = 0; NumBoundary< numberOfitems; NumBoundary=NumBoundary+2) + { + if ( std::string((*ListBoundaryGroupType)[NumBoundary]) == BoundaryName ) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "This boundary is used in a case and cannot be deleted."; + throw SALOME::SALOME_Exception(es); + return 2 ; + }; + }; + } + + // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete + myStudyContext._mesBoundarys.erase(BoundaryName); + SALOMEDS::Study::ListOfSObject_var listSO = myStudy->FindObjectByName(BoundaryName, ComponentDataType()); + SALOMEDS::SObject_var aSO =listSO[0]; + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); + myStudy->NewBuilder()->RemoveObjectWithChildren(aSO); + + return 0 ; +} +//============================================================================= +CORBA::Long HOMARD_Gen_i::DeleteCase(const char* nomCas, CORBA::Long Option) +{ + // Pour detruire un cas + MESSAGE ( "DeleteCase : nomCas = " << nomCas << ", avec option = " << Option ); + HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; + if (CORBA::is_nil(myCase)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid case context"; + throw SALOME::SALOME_Exception(es); + return 1; + }; + // On commence par detruire toutes les iterations en partant de l'initiale et y compris elle + CORBA::String_var nomIter = myCase->GetIter0Name(); + CORBA::Long Option1 = 0 ; + if ( DeleteIterationOption(nomIter, Option1, Option) != 0 ) + { + return 2; + }; + + // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete + myStudyContext._mesCas.erase(nomCas); + SALOMEDS::Study::ListOfSObject_var listSO = myStudy->FindObjectByName(nomCas, ComponentDataType()); + SALOMEDS::SObject_var aSO =listSO[0]; + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); + myStudy->NewBuilder()->RemoveObjectWithChildren(aSO); + + return 0 ; +} +//============================================================================= +CORBA::Long HOMARD_Gen_i::DeleteHypo(const char* nomHypo) +{ + MESSAGE ( "DeleteHypo : nomHypo = " << nomHypo ); + HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; + if (CORBA::is_nil(myHypo)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid hypothesis"; + throw SALOME::SALOME_Exception(es); + return 1 ; + }; + +// On verifie que l'hypothese n'est plus utilisee + HOMARD::listeIters* maListeIter = myHypo->GetIterations(); + int numberOfIter = maListeIter->length(); + if ( numberOfIter > 0 ) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "This hypothesis is used in an iteration and cannot be deleted."; + throw SALOME::SALOME_Exception(es); + return 2 ; + }; + + // suppression du lien avec les zones eventuelles + HOMARD::listeZonesHypo* maListe = myHypo->GetZones(); + int numberOfZones = maListe->length(); + MESSAGE ( ".. Nombre de zones = " << numberOfZones ); + for (int NumeZone = 0; NumeZone< numberOfZones; NumeZone++) + { + std::string ZoneName = std::string((*maListe)[NumeZone]); + MESSAGE ( ".. suppression du lien avec la zone = " << ZoneName.c_str() ); + DissociateHypoZone(nomHypo, ZoneName.c_str()) ; + NumeZone += 1 ; + } + + // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete + myStudyContext._mesHypotheses.erase(nomHypo); + SALOMEDS::Study::ListOfSObject_var listSO = myStudy->FindObjectByName(nomHypo, ComponentDataType()); + SALOMEDS::SObject_var aSO =listSO[0]; + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); + myStudy->NewBuilder()->RemoveObjectWithChildren(aSO); + + return 0 ; +} +//============================================================================= +CORBA::Long HOMARD_Gen_i::DeleteIteration(const char* nomIter, CORBA::Long Option) +{ + // Option = 0 : On ne supprime pas le fichier du maillage associe + // Option = 1 : On supprime le fichier du maillage associe + // Pour detruire une iteration courante + MESSAGE ( "DeleteIteration : nomIter = " << nomIter << ", avec option = " << Option ); + CORBA::Long Option1 = 1 ; + return DeleteIterationOption(nomIter, Option1, Option); +} +//============================================================================= +CORBA::Long HOMARD_Gen_i::DeleteIterationOption(const char* nomIter, CORBA::Long Option1, CORBA::Long Option2) +{ + // Option1 = 0 : On autorise la destruction de l'iteration 0 + // Option1 = 1 : On interdit la destruction de l'iteration 0 + + // Option2 = 0 : On ne supprime pas le fichier du maillage associe + // Option2 = 1 : On supprime le fichier du maillage associe + MESSAGE ( "DeleteIterationOption : nomIter = " << nomIter << ", avec options = " << Option1<< ", " << Option2 ); + HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; + if (CORBA::is_nil(myIteration)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid iteration"; + throw SALOME::SALOME_Exception(es); + return 1 ; + }; + + int numero = myIteration->GetNumber(); + MESSAGE ( "DeleteIterationOption : numero = " << numero ); + if ( numero == 0 && Option1 == 1 ) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "This iteration cannot be deleted."; + throw SALOME::SALOME_Exception(es); + return 2 ; + }; + + // On detruit recursivement toutes les filles + HOMARD::listeIterFilles* maListe = myIteration->GetIterations(); + int numberOfIter = maListe->length(); + for (int NumeIter = 0; NumeIter< numberOfIter; NumeIter++) + { + std::string nomIterFille = std::string((*maListe)[NumeIter]); + MESSAGE ( ".. appel recursif de DeleteIterationOption pour nomIter = " << nomIterFille.c_str() ); + DeleteIterationOption(nomIterFille.c_str(), Option1, Option2); + } + + // On arrive ici pour une iteration sans fille + MESSAGE ( "Destruction effective de " << nomIter ); + // On commence par invalider l'iteration pour faire le menage des dependances + // et eventuellement du maillage associe + int option ; + if ( numero == 0 ) { option = 0 ; } + else { option = Option2 ; } + InvalideIterOption(nomIter, option) ; + + // Retrait dans la descendance de l'iteration parent + if ( numero > 0 ) + { + std::string nomIterationParent = myIteration->GetIterParentName(); + MESSAGE ( "Retrait dans la descendance de nomIterationParent " << nomIterationParent ); + HOMARD::HOMARD_Iteration_var myIterationParent = myStudyContext._mesIterations[nomIterationParent]; + if (CORBA::is_nil(myIterationParent)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid iteration"; + throw SALOME::SALOME_Exception(es); + return 3 ; + }; + myIterationParent->UnLinkNextIteration(nomIter); + } + + // suppression du lien avec l'hypothese + if ( numero > 0 ) + { + std::string nomHypo = myIteration->GetHypoName(); + HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; + ASSERT(!CORBA::is_nil(myHypo)); + myHypo->UnLinkIteration(nomIter); + } + + // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete + myStudyContext._mesIterations.erase(nomIter); + SALOMEDS::Study::ListOfSObject_var listSO = myStudy->FindObjectByName(nomIter, ComponentDataType()); + SALOMEDS::SObject_var aSO =listSO[0]; + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); + myStudy->NewBuilder()->RemoveObjectWithChildren(aSO); + // on peut aussi faire RemoveObject +// MESSAGE ( "Au final" ); +// HOMARD::listeIterations* Liste = GetAllIterationsName() ; +// numberOfIter = Liste->length(); +// for (int NumeIter = 0; NumeIter< numberOfIter; NumeIter++) +// { +// std::string nomIterFille = std::string((*Liste)[NumeIter]); +// MESSAGE ( ".. nomIter = " << nomIterFille.c_str() ); +// } + + return 0 ; +} +//============================================================================= +CORBA::Long HOMARD_Gen_i::DeleteYACS(const char* nomYACS, CORBA::Long Option) +{ + // Option = 0 : On ne supprime pas le fichier du schema associe + // Option = 1 : On supprime le fichier du schema associe + MESSAGE ( "DeleteYACS : nomYACS = " << nomYACS << ", avec option = " << Option ); + HOMARD::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; + if (CORBA::is_nil(myYACS)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid schema YACS"; + throw SALOME::SALOME_Exception(es); + return 1 ; + }; + // Suppression eventuelle du fichier XML + if ( Option == 1 ) + { + std::string nomFichier = myYACS->GetXMLFile(); + std::string commande = "rm -rf " + nomFichier ; + MESSAGE ( "commande = " << commande ); + if ((system(commande.c_str())) != 0) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "The xml file for the schema YACS cannot be removed." ; + throw SALOME::SALOME_Exception(es); + return 2 ; + } + } + // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete + myStudyContext._mesYACSs.erase(nomYACS); + SALOMEDS::Study::ListOfSObject_var listSO = myStudy->FindObjectByName(nomYACS, ComponentDataType()); + SALOMEDS::SObject_var aSO =listSO[0]; + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); + myStudy->NewBuilder()->RemoveObjectWithChildren(aSO); + + return 0 ; +} +//============================================================================= +CORBA::Long HOMARD_Gen_i::DeleteZone(const char* nomZone) +{ + MESSAGE ( "DeleteZone : nomZone = " << nomZone ); + HOMARD::HOMARD_Zone_var myZone = myStudyContext._mesZones[nomZone]; + if (CORBA::is_nil(myZone)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid zone"; + throw SALOME::SALOME_Exception(es); + return 1 ; + }; + +// On verifie que la zone n'est plus utilisee + HOMARD::listeHypo* maListe = myZone->GetHypo(); + int numberOfHypo = maListe->length(); + MESSAGE ( ".. Nombre d'hypotheses = " << numberOfHypo ); + if ( numberOfHypo > 0 ) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "This zone is used in a hypothesis and cannot be deleted."; + throw SALOME::SALOME_Exception(es); + return 2 ; + }; +// + // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete + myStudyContext._mesZones.erase(nomZone); + SALOMEDS::Study::ListOfSObject_var listSO = myStudy->FindObjectByName(nomZone, ComponentDataType()); + SALOMEDS::SObject_var aSO =listSO[0]; + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); + myStudy->NewBuilder()->RemoveObjectWithChildren(aSO); + + return 0 ; +} +//============================================================================= +//============================================================================= +// +//============================================================================= +//============================================================================= +// Invalidation des structures identifiees par leurs noms +//============================================================================= +//============================================================================= +void HOMARD_Gen_i::InvalideBoundary(const char* BoundaryName) +{ + MESSAGE( "InvalideBoundary : BoundaryName = " << BoundaryName ); + HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; + if (CORBA::is_nil(myBoundary)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid boundary"; + throw SALOME::SALOME_Exception(es); + return ; + } + else + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "No change is allowed in a boundary. Ask for evolution."; + throw SALOME::SALOME_Exception(es); + return ; + }; +} +//============================================================================= +void HOMARD_Gen_i::InvalideHypo(const char* nomHypo) +{ + MESSAGE( "InvalideHypo : nomHypo = " << nomHypo ); + HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; + if (CORBA::is_nil(myHypo)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid hypothesis"; + throw SALOME::SALOME_Exception(es); + return ; + }; + + HOMARD::listeIters* maListe = myHypo->GetIterations(); + int numberOfIter = maListe->length(); + for (int NumeIter = 0; NumeIter< numberOfIter; NumeIter++) + { + std::string nomIter = std::string((*maListe)[NumeIter]); + MESSAGE( ".. nomIter = " << nomIter ); + InvalideIter(nomIter.c_str()); + } +} +//============================================================================= +void HOMARD_Gen_i::InvalideIter(const char* nomIter) +{ + MESSAGE("InvalideIter : nomIter = " << nomIter); + // Pour invalider totalement une iteration courante + CORBA::Long Option = 1 ; + return InvalideIterOption(nomIter, Option); +} +//============================================================================= +void HOMARD_Gen_i::InvalideIterOption(const char* nomIter, CORBA::Long Option) +{ + // Option = 0 : On ne supprime pas le fichier du maillage associe + // Option = 1 : On supprime le fichier du maillage associe + MESSAGE ( "InvalideIterOption : nomIter = " << nomIter << ", avec option = " << Option ); + HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; + if (CORBA::is_nil(myIteration)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid iteration"; + throw SALOME::SALOME_Exception(es); + return ; + }; + + HOMARD::listeIterFilles* maListe = myIteration->GetIterations(); + int numberOfIter = maListe->length(); + for (int NumeIter = 0; NumeIter< numberOfIter; NumeIter++) + { + std::string nomIterFille = std::string((*maListe)[NumeIter]); + MESSAGE ( ".. appel recursif de InvalideIter pour nomIter = " << nomIterFille.c_str() ); + InvalideIter(nomIterFille.c_str()); + } + + // On arrive ici pour une iteration sans fille + MESSAGE ( "Invalidation effective de " << nomIter ); + SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration))); + SALOMEDS::ChildIterator_var aIter = myStudy->NewChildIterator(aIterSO); + for (; aIter->More(); aIter->Next()) + { + SALOMEDS::SObject_var so = aIter->Value(); + SALOMEDS::GenericAttribute_var anAttr; + if (!so->FindAttribute(anAttr, "AttributeComment")) continue; + SALOMEDS::AttributeComment_var aCommentAttr = SALOMEDS::AttributeComment::_narrow(anAttr); + std::string value (aCommentAttr->Value()); + if(value == std::string("IterationHomard")) continue; + if(value == std::string("HypoHomard")) continue; + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); + aStudyBuilder->RemoveObject(so); + } + + int etat = myIteration->GetState(); + if ( etat > 0 ) + { + SetEtatIter(nomIter,1); + const char * nomCas = myIteration->GetCaseName(); + HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; + if (CORBA::is_nil(myCase)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid case context"; + throw SALOME::SALOME_Exception(es); + return ; + }; + std::string nomDir = myIteration->GetDirName(); + std::string nomFichier = myIteration->GetMeshFile(); + std::string commande = "rm -rf " + std::string(nomDir); + if ( Option == 1 ) { commande = commande + ";rm -rf " + std::string(nomFichier) ; } + MESSAGE ( "commande = " << commande ); + if ((system(commande.c_str())) != 0) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "The directory for the calculation cannot be cleared." ; + throw SALOME::SALOME_Exception(es); + return ; + } + // Suppression du maillage publie dans SMESH + std::string MeshName = myIteration->GetMeshName() ; + DeleteResultInSmesh(nomFichier, MeshName) ; + }; + +} +//============================================================================= +void HOMARD_Gen_i::InvalideIterInfo(const char* nomIter) +{ + MESSAGE("InvalideIterInfo : nomIter = " << nomIter); + HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; + if (CORBA::is_nil(myIteration)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid iteration"; + throw SALOME::SALOME_Exception(es); + return ; + }; + + SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration))); + SALOMEDS::ChildIterator_var aIter = myStudy->NewChildIterator(aIterSO); + for (; aIter->More(); aIter->Next()) + { + SALOMEDS::SObject_var so = aIter->Value(); + SALOMEDS::GenericAttribute_var anAttr; + if (!so->FindAttribute(anAttr, "AttributeComment")) continue; + SALOMEDS::AttributeComment_var aCommentAttr = SALOMEDS::AttributeComment::_narrow(anAttr); + std::string value (aCommentAttr->Value()); +/* MESSAGE("... value = " << value);*/ + if( (value == std::string("logInfo")) || ( value == std::string("SummaryInfo")) ) + { + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); + aStudyBuilder->RemoveObject(so); + } + } + + const char * nomCas = myIteration->GetCaseName(); + HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; + if (CORBA::is_nil(myCase)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid case context"; + throw SALOME::SALOME_Exception(es); + return ; + }; + const char* nomDir = myIteration->GetDirName(); + std::string commande = "rm -f " + std::string(nomDir) + "/info* " ; + commande += std::string(nomDir) + "/Liste.*info" ; +/* MESSAGE ( "commande = " << commande );*/ + if ((system(commande.c_str())) != 0) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "The directory for the calculation cannot be cleared." ; + throw SALOME::SALOME_Exception(es); + return ; + } +} +//============================================================================= +void HOMARD_Gen_i::InvalideYACS(const char* YACSName) +{ + MESSAGE( "InvalideYACS : YACSName = " << YACSName ); + HOMARD::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[YACSName]; + if (CORBA::is_nil(myYACS)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid schema YACS"; + throw SALOME::SALOME_Exception(es); + return ; + }; + // + SALOMEDS::SObject_var aYACSSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myYACS))); + SALOMEDS::ChildIterator_var aYACS = myStudy->NewChildIterator(aYACSSO); + for (; aYACS->More(); aYACS->Next()) + { + SALOMEDS::SObject_var so = aYACS->Value(); + SALOMEDS::GenericAttribute_var anAttr; + if (!so->FindAttribute(anAttr, "AttributeComment")) continue; + SALOMEDS::AttributeComment_var aCommentAttr = SALOMEDS::AttributeComment::_narrow(anAttr); + std::string value (aCommentAttr->Value()); + if( value == std::string("xml") ) + { + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); + aStudyBuilder->RemoveObject(so); + } + } + std::string nomFichier = myYACS->GetXMLFile(); + std::string commande = "rm -rf " + std::string(nomFichier) ; + MESSAGE ( "commande = " << commande ); + if ((system(commande.c_str())) != 0) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "The XML file for the schema YACS cannot be removed." ; + throw SALOME::SALOME_Exception(es); + return ; + } +} +//============================================================================= +void HOMARD_Gen_i::InvalideZone(const char* ZoneName) +{ + MESSAGE( "InvalideZone : ZoneName = " << ZoneName ); + HOMARD::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName]; + if (CORBA::is_nil(myZone)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid zone"; + throw SALOME::SALOME_Exception(es); + return ; + }; + HOMARD::listeHypo* maListe = myZone->GetHypo(); + int numberOfHypo = maListe->length(); + MESSAGE( ".. numberOfHypo = " << numberOfHypo ); + for (int NumeHypo = 0; NumeHypo< numberOfHypo; NumeHypo++) + { + std::string nomHypo = std::string((*maListe)[NumeHypo]); + MESSAGE( ".. nomHypo = " << nomHypo ); + InvalideHypo(nomHypo.c_str()); + } +} +//============================================================================= +//============================================================================= +// +//============================================================================= +//============================================================================= +// Association de lien entre des structures identifiees par leurs noms +//============================================================================= +//============================================================================= +void HOMARD_Gen_i::AssociateCaseIter(const char* nomCas, const char* nomIter, const char* labelIter) +{ + MESSAGE( "AssociateCaseIter : " << nomCas << ", " << nomIter << ", " << labelIter ); + + HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; + if (CORBA::is_nil(myCase)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid case"; + throw SALOME::SALOME_Exception(es); + return ; + }; + + HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; + if (CORBA::is_nil(myIteration)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid iteration"; + throw SALOME::SALOME_Exception(es); + return ; + }; + + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); + SALOMEDS::SObject_var aCasSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myCase))); + if (CORBA::is_nil(aCasSO)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid case"; + throw SALOME::SALOME_Exception(es); + return ; + }; + + aStudyBuilder->NewCommand(); + SALOMEDS::SObject_var newStudyIter = aStudyBuilder->NewObject(aCasSO); + PublishInStudyAttr(aStudyBuilder, newStudyIter, nomIter , labelIter, + "iter_non_calculee.png", _orb->object_to_string(myIteration)) ; + aStudyBuilder->CommitCommand(); + + myCase->AddIteration(nomIter); + myIteration->SetCaseName(nomCas); +} +//===================================================================================== +void HOMARD_Gen_i::AssociateHypoZone(const char* nomHypothesis, const char* ZoneName, CORBA::Long TypeUse) +{ + MESSAGE ( "AssociateHypoZone : nomHypo = " << nomHypothesis << ", ZoneName= " << ZoneName << ", TypeUse = " << TypeUse); + + HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypothesis]; + ASSERT(!CORBA::is_nil(myHypo)); + SALOMEDS::SObject_var aHypoSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myHypo))); + ASSERT(!CORBA::is_nil(aHypoSO)); + + HOMARD::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName]; + ASSERT(!CORBA::is_nil(myZone)); + SALOMEDS::SObject_var aZoneSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myZone))); + ASSERT(!CORBA::is_nil(aZoneSO)); + + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); + + aStudyBuilder->NewCommand(); + + SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aHypoSO); + aStudyBuilder->Addreference(aSubSO, aZoneSO); + + aStudyBuilder->CommitCommand(); + + myZone->AddHypo(nomHypothesis); + myHypo->AddZone0(ZoneName, TypeUse); +}; +//============================================================================= +void HOMARD_Gen_i::AssociateIterHypo(const char* nomIter, const char* nomHypo) +{ + MESSAGE("AssociateIterHypo : nomHypo = " << nomHypo << " nomIter = " << nomIter); + + // Verification de l'existence de l'hypothese + HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; + ASSERT(!CORBA::is_nil(myHypo)); + SALOMEDS::SObject_var aHypoSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myHypo))); + ASSERT(!CORBA::is_nil(aHypoSO)); + + // Verification de l'existence de l'iteration + HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; + ASSERT(!CORBA::is_nil(myIteration)); + SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration))); + ASSERT(!CORBA::is_nil(aIterSO)); + + // Gestion de l'arbre d'etudes + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); + aStudyBuilder->NewCommand(); + SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aIterSO); + aStudyBuilder->Addreference(aSubSO, aHypoSO); + aStudyBuilder->CommitCommand(); + + // Liens reciproques + myIteration->SetHypoName(nomHypo); + myHypo->LinkIteration(nomIter); + + // On stocke les noms des champ a interpoler pour le futur controle de la donnée des pas de temps + myIteration->SupprFieldInterps() ; + HOMARD::listeFieldInterpsHypo* ListField = myHypo->GetFieldInterps(); + int numberOfFieldsx2 = ListField->length(); + for (int iaux = 0; iaux< numberOfFieldsx2; iaux++) + { + std::string FieldName = std::string((*ListField)[iaux]) ; + myIteration->SetFieldInterp(FieldName.c_str()) ; + iaux++ ; + } +}; +//============================================================================= +//============================================================================= +// +//============================================================================= +//============================================================================= +// Dissociation de lien entre des structures identifiees par leurs noms +//============================================================================= +//============================================================================= +void HOMARD_Gen_i::DissociateHypoZone(const char* nomHypothesis, const char* ZoneName) +{ + MESSAGE ( "DissociateHypoZone : ZoneName= " << ZoneName << ", nomHypo = " << nomHypothesis); + + HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypothesis]; + ASSERT(!CORBA::is_nil(myHypo)); + SALOMEDS::SObject_var aHypoSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myHypo))); + ASSERT(!CORBA::is_nil(aHypoSO)); + + HOMARD::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName]; + ASSERT(!CORBA::is_nil(myZone)); + SALOMEDS::SObject_var aZoneSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myZone))); + ASSERT(!CORBA::is_nil(aZoneSO)); + + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); + + SALOMEDS::ChildIterator_var it = myStudy->NewChildIterator(aHypoSO); + for (; it->More(); it->Next()) + { + SALOMEDS::SObject_var aHypObj = it->Value(); + SALOMEDS::SObject_var ptrObj; + if (aHypObj->ReferencedObject(ptrObj)) + { + if (std::string(ptrObj->GetName()) == std::string(aZoneSO->GetName())) + { + aStudyBuilder->NewCommand(); + aStudyBuilder->RemoveObject(aHypObj); + aStudyBuilder->CommitCommand(); + break; + } + } + } + + myZone->SupprHypo(nomHypothesis); + myHypo->SupprZone(ZoneName); +}; +//============================================================================= +//============================================================================= +// + +//============================================================================= +//============================================================================= +// Recuperation des listes +//============================================================================= +//============================================================================= +HOMARD::listeBoundarys* HOMARD_Gen_i::GetAllBoundarysName() +{ + MESSAGE("GetAllBoundarysName"); + IsValidStudy () ; + + HOMARD::listeBoundarys_var ret = new HOMARD::listeBoundarys; + ret->length(myStudyContext._mesBoundarys.size()); + std::map::const_iterator it; + int i = 0; + for (it = myStudyContext._mesBoundarys.begin(); + it != myStudyContext._mesBoundarys.end(); it++) + { + ret[i++] = CORBA::string_dup((*it).first.c_str()); + } + + return ret._retn(); +} +//============================================================================= +HOMARD::listeCases* HOMARD_Gen_i::GetAllCasesName() +{ + MESSAGE("GetAllCasesName"); + IsValidStudy () ; + + HOMARD::listeCases_var ret = new HOMARD::listeCases; + ret->length(myStudyContext._mesCas.size()); + std::map::const_iterator it; + int i = 0; + for (it = myStudyContext._mesCas.begin(); + it != myStudyContext._mesCas.end(); it++) + { + ret[i++] = CORBA::string_dup((*it).first.c_str()); + } + + return ret._retn(); +} +//============================================================================= +HOMARD::listeHypotheses* HOMARD_Gen_i::GetAllHypothesesName() +{ + MESSAGE("GetAllHypothesesName"); + IsValidStudy () ; + + HOMARD::listeHypotheses_var ret = new HOMARD::listeHypotheses; + ret->length(myStudyContext._mesHypotheses.size()); + std::map::const_iterator it; + int i = 0; + for (it = myStudyContext._mesHypotheses.begin(); + it != myStudyContext._mesHypotheses.end(); it++) + { + ret[i++] = CORBA::string_dup((*it).first.c_str()); + } + + return ret._retn(); +} +//============================================================================= +HOMARD::listeIterations* HOMARD_Gen_i::GetAllIterationsName() +{ + MESSAGE("GetAllIterationsName"); + IsValidStudy () ; + + HOMARD::listeIterations_var ret = new HOMARD::listeIterations; + ret->length(myStudyContext._mesIterations.size()); + std::map::const_iterator it; + int i = 0; + for (it = myStudyContext._mesIterations.begin(); + it != myStudyContext._mesIterations.end(); it++) + { + ret[i++] = CORBA::string_dup((*it).first.c_str()); + } + + return ret._retn(); +} +//============================================================================= +HOMARD::listeYACSs* HOMARD_Gen_i::GetAllYACSsName() +{ + MESSAGE("GetAllYACSsName"); + IsValidStudy () ; + + HOMARD::listeYACSs_var ret = new HOMARD::listeYACSs; + ret->length(myStudyContext._mesYACSs.size()); + std::map::const_iterator it; + int i = 0; + for (it = myStudyContext._mesYACSs.begin(); + it != myStudyContext._mesYACSs.end(); it++) + { + ret[i++] = CORBA::string_dup((*it).first.c_str()); + } + + return ret._retn(); +} +//============================================================================= +HOMARD::listeZones* HOMARD_Gen_i::GetAllZonesName() +{ + MESSAGE("GetAllZonesName"); + IsValidStudy () ; + + HOMARD::listeZones_var ret = new HOMARD::listeZones; + ret->length(myStudyContext._mesZones.size()); + std::map::const_iterator it; + int i = 0; + for (it = myStudyContext._mesZones.begin(); + it != myStudyContext._mesZones.end(); it++) + { + ret[i++] = CORBA::string_dup((*it).first.c_str()); + } + + return ret._retn(); +} +//============================================================================= +//============================================================================= + +//============================================================================= +//============================================================================= +// Recuperation des structures identifiees par leurs noms +//============================================================================= +//============================================================================= +HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::GetBoundary(const char* nomBoundary) +{ + HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[nomBoundary]; + ASSERT(!CORBA::is_nil(myBoundary)); + return HOMARD::HOMARD_Boundary::_duplicate(myBoundary); +} +//============================================================================= +HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::GetCase(const char* nomCas) +{ + HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; + ASSERT(!CORBA::is_nil(myCase)); + return HOMARD::HOMARD_Cas::_duplicate(myCase); +} +//============================================================================= +HOMARD::HOMARD_Hypothesis_ptr HOMARD_Gen_i::GetHypothesis(const char* nomHypothesis) +{ + HOMARD::HOMARD_Hypothesis_var myHypothesis = myStudyContext._mesHypotheses[nomHypothesis]; + ASSERT(!CORBA::is_nil(myHypothesis)); + return HOMARD::HOMARD_Hypothesis::_duplicate(myHypothesis); +} +//============================================================================= +HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::GetIteration(const char* NomIterationation) +{ + HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[NomIterationation]; + ASSERT(!CORBA::is_nil(myIteration)); + return HOMARD::HOMARD_Iteration::_duplicate(myIteration); +} +//============================================================================= +HOMARD::HOMARD_YACS_ptr HOMARD_Gen_i::GetYACS(const char* nomYACS) +{ + HOMARD::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; + ASSERT(!CORBA::is_nil(myYACS)); + return HOMARD::HOMARD_YACS::_duplicate(myYACS); +} +//============================================================================= +HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::GetZone(const char* ZoneName) +{ + HOMARD::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName]; + ASSERT(!CORBA::is_nil(myZone)); + return HOMARD::HOMARD_Zone::_duplicate(myZone); +} +//============================================================================= +//============================================================================= + +//============================================================================= +//============================================================================= +// Informations +//============================================================================= +//============================================================================= +void HOMARD_Gen_i::MeshInfo(const char* nomCas, const char* MeshName, const char* MeshFile, const char* DirName, CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte) +{ + INFOS ( "MeshInfo : nomCas = " << nomCas << ", MeshName = " << MeshName << ", MeshFile = " << MeshFile ); + INFOS ( "Qual = " << Qual << ", Diam = " << Diam << ", Conn = " << Conn << ", Tail = " << Tail << ", Inte = " << Inte ); + IsValidStudy () ; + +// Creation du cas + int option = 1 ; + if ( _PublisMeshIN != 0 ) option = 2 ; + HOMARD::HOMARD_Cas_ptr myCase = CreateCase0(nomCas, MeshName, MeshFile, 1, 0, option) ; + myCase->SetDirName(DirName) ; +// Analyse + myCase->MeshInfo(Qual, Diam, Conn, Tail, Inte) ; + + return ; +} +//============================================================================= +//============================================================================= + +//============================================================================= +//============================================================================= +// Recuperation des structures par le contexte +//============================================================================= +//============================================================================= +HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::LastIteration(const char* nomCas) +{ + HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; + ASSERT(!CORBA::is_nil(myCase)); +// + HOMARD::HOMARD_Iteration_var myIteration = myCase->LastIteration(); + ASSERT(!CORBA::is_nil(myIteration)); +// + return HOMARD::HOMARD_Iteration::_duplicate(myIteration); +} +//============================================================================= +//============================================================================= + +//============================================================================= +//============================================================================= +// Nouvelles structures +//============================================================================= +//============================================================================= +HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::newCase() +{ + HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); + HOMARD_Cas_i* aServant = new HOMARD_Cas_i(_orb, engine); + HOMARD::HOMARD_Cas_var aCase = HOMARD::HOMARD_Cas::_narrow(aServant->_this()); + return aCase._retn(); +} +//============================================================================= +HOMARD::HOMARD_Hypothesis_ptr HOMARD_Gen_i::newHypothesis() +{ + HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); + HOMARD_Hypothesis_i* aServant = new HOMARD_Hypothesis_i(_orb, engine); + HOMARD::HOMARD_Hypothesis_var aHypo = HOMARD::HOMARD_Hypothesis::_narrow(aServant->_this()); + return aHypo._retn(); +} +//============================================================================= +HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::newIteration() +{ + HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); + HOMARD_Iteration_i* aServant = new HOMARD_Iteration_i(_orb, engine); + HOMARD::HOMARD_Iteration_var aIter = HOMARD::HOMARD_Iteration::_narrow(aServant->_this()); + return aIter._retn(); +} +//============================================================================= +HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::newBoundary() +{ + HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); + HOMARD_Boundary_i* aServant = new HOMARD_Boundary_i(_orb, engine); + HOMARD::HOMARD_Boundary_var aBoundary = HOMARD::HOMARD_Boundary::_narrow(aServant->_this()); + return aBoundary._retn(); +} +//============================================================================= +HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::newZone() +{ + HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); + HOMARD_Zone_i* aServant = new HOMARD_Zone_i(_orb, engine); + HOMARD::HOMARD_Zone_var aZone = HOMARD::HOMARD_Zone::_narrow(aServant->_this()); + return aZone._retn(); +} +//============================================================================= +HOMARD::HOMARD_YACS_ptr HOMARD_Gen_i::newYACS() +{ + HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); + HOMARD_YACS_i* aServant = new HOMARD_YACS_i(_orb, engine); + HOMARD::HOMARD_YACS_var aYACS = HOMARD::HOMARD_YACS::_narrow(aServant->_this()); + return aYACS._retn(); +} +//============================================================================= +//============================================================================= + +//============================================================================= +//============================================================================= +// Creation des structures identifiees par leurs noms +//============================================================================= +//============================================================================= +HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCase(const char* nomCas, const char* MeshName, const char* MeshFile) +// +// Creation d'un cas initial +// nomCas : nom du cas a creer +// MeshName, MeshFile : nom et fichier du maillage correspondant +// +{ + INFOS ( "CreateCase : nomCas = " << nomCas << ", MeshName = " << MeshName << ", MeshFile = " << MeshFile ); + + int option = 1 ; + if ( _PublisMeshIN != 0 ) option = 2 ; + HOMARD::HOMARD_Cas_ptr myCase = CreateCase0(nomCas, MeshName, MeshFile, 0, 0, option) ; + +// Valeurs par defaut des filtrages + myCase->SetPyram(0); + + return HOMARD::HOMARD_Cas::_duplicate(myCase); +} +//============================================================================= +HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas, const char* DirNameStart) +// +// nomCas : nom du cas a creer +// DirNameStart : nom du répertoire contenant l'iteration de reprise +// +{ + INFOS ( "CreateCaseFromIteration : nomCas = " << nomCas << ", DirNameStart = " << DirNameStart ); + std::string nomDirWork = getenv("PWD") ; + int codret ; + + // A. Decodage du point de reprise + // A.1. Controle du répertoire de depart de l'iteration + codret = CHDIR(DirNameStart) ; + if ( codret != 0 ) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "The directory of the iteration does not exist."; + throw SALOME::SALOME_Exception(es); + return 0; + }; + // A.2. Reperage des fichiers du répertoire de reprise + std::string file_configuration = "" ; + std::string file_maillage_homard = "" ; + int bilan ; +#ifndef WIN32 + DIR *dp; + struct dirent *dirp; + dp = opendir(DirNameStart); + while ( (dirp = readdir(dp)) != NULL ) + { + std::string file_name(dirp->d_name); +// MESSAGE ( file_name ); + bilan = file_name.find("HOMARD.Configuration.") ; + if ( bilan != string::npos ) { file_configuration = file_name ; } + bilan = file_name.find("maill.") ; + if ( bilan != string::npos ) + { + bilan = file_name.find(".hom.med") ; + if ( bilan != string::npos ) { file_maillage_homard = file_name ; } + } + } + closedir(dp); +#else + HANDLE hFind = INVALID_HANDLE_VALUE; + WIN32_FIND_DATA ffd; + hFind = FindFirstFile(DirNameStart, &ffd); + if (INVALID_HANDLE_VALUE != hFind) { + while (FindNextFile(hFind, &ffd) != 0) { + if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories + std::string file_name(ffd.cFileName); + bilan = file_name.find("HOMARD.Configuration.") ; + if ( bilan != string::npos ) { file_configuration = file_name ; } + bilan = file_name.find("maill.") ; + if ( bilan != string::npos ) + { + bilan = file_name.find(".hom.med") ; + if ( bilan != string::npos ) { file_maillage_homard = file_name ; } + } + } + FindClose(hFind); + } +#endif + MESSAGE ( "==> file_configuration : " << file_configuration ) ; + MESSAGE ( "==> file_maillage_homard : " << file_maillage_homard ) ; + // A.3. Controle + if ( ( file_configuration == "" ) || ( file_maillage_homard == "" ) ) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + std::string text ; + if ( file_configuration == "" ) { text = "The configuration file cannot be found." ; } + else { text = "The HOMARD mesh file cannot be found." ; } + es.text = CORBA::string_dup(text.c_str()); + throw SALOME::SALOME_Exception(es); + } + + // B. Lecture du fichier de configuration + // ATTENTION : on doit veiller a la coherence entre HomardDriver et CreateCaseFromIteration + int NumeIter ; + int TypeExt = 0 ; + int TypeConf = 0 ; + int Pyram = 0 ; + char* MeshName ; + char* MeshFile ; + // le constructeur de ifstream permet d'ouvrir un fichier en lecture + std::ifstream fichier( file_configuration.c_str() ); + if ( fichier ) // ce test échoue si le fichier n'est pas ouvert + { + std::string ligne; // variable contenant chaque ligne lue + std::string mot_cle; + std::string argument; + int decalage; + // cette boucle sur les lignes s'arrête dès qu'une erreur de lecture survient + while ( std::getline( fichier, ligne ) ) + { + // B.1. Pour la ligne courante, on identifie le premier mot : le mot-cle + std::istringstream ligne_bis(ligne); // variable contenant chaque ligne sous forme de flux + ligne_bis >> mot_cle ; + // B.2. Des valeurs entieres : le second bloc de la ligne + if ( mot_cle == "NumeIter" ) + { + ligne_bis >> NumeIter ; + NumeIter += 1 ; + } + // B.3. Des valeurs caracteres brutes : le second bloc de la ligne est la valeur + else if ( ( mot_cle == "TypeConf" ) || ( mot_cle == "TypeElem" ) ) + { + ligne_bis >> argument ; + + if ( mot_cle == "TypeConf" ) + { + if ( argument == "conforme" ) { TypeConf = 1 ; } + else if ( argument == "non_conforme_1_noeud" ) { TypeConf = 2 ; } + else if ( argument == "non_conforme_1_arete" ) { TypeConf = 3 ; } + else if ( argument == "non_conforme_indicateur" ) { TypeConf = 4 ; } + } + else if ( mot_cle == "TypeElem" ) + { + if ( argument == "ignore_pyra" ) { Pyram = 1 ; } + else if ( argument == "HOMARD" ) { Pyram = 0 ; } + } + } + // B.4. Des valeurs caracteres : le deuxieme bloc de la ligne peut etre encadre par des quotes : + // il faut les supprimer + else if ( ( mot_cle == "CCNoMNP1" ) || ( mot_cle == "CCMaiNP1" ) ) + { + ligne_bis >> argument ; + if ( argument[0] == '"' ) { decalage = 1 ; } + else { decalage = 0 ; } + size_t size = argument.size() + 1 - 2*decalage ; + + if ( mot_cle == "CCNoMNP1" ) + { + MeshName = new char[ size ]; + strncpy( MeshName, argument.c_str()+decalage, size ); + MeshName[size-1] = '\0' ; + } + else if ( mot_cle == "CCMaiNP1" ) + { + MeshFile = new char[ size ]; + strncpy( MeshFile, argument.c_str()+decalage, size ); + MeshFile[size-1] = '\0' ; + } + } + } + MESSAGE ( "==> TypeConf : " << TypeConf ) ; + MESSAGE ( "==> MeshName : " << MeshName ) ; + MESSAGE ( "==> MeshFile : " << MeshFile ) ; + MESSAGE ( "==> NumeIter : " << NumeIter ) ; + MESSAGE ( "==> Pyram : " << Pyram ) ; + } + else + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + std::string text = "The configuration file cannot be read." ; + es.text = CORBA::string_dup(text.c_str()); + throw SALOME::SALOME_Exception(es); + } + + // C. Creation effective du cas + + int option = 1 ; + if ( _PublisMeshIN != 0 ) option = 2 ; + HOMARD::HOMARD_Cas_ptr myCase = CreateCase0(nomCas, MeshName, MeshFile, 1, NumeIter, option) ; + + // D. Parametrages lus dans le fichier de configuration + + myCase->SetConfType (TypeConf) ; + myCase->SetExtType (TypeExt) ; + myCase->SetPyram (Pyram) ; + + // E. Copie du fichier de maillage homard + // E.1. Répertoire associe au cas + char* nomDirCase = myCase->GetDirName() ; + // E.2. Répertoire associe a l'iteration de ce cas + char* IterName ; + IterName = myCase->GetIter0Name() ; + HOMARD::HOMARD_Iteration_var Iter = GetIteration(IterName) ; + char* nomDirIter = CreateDirNameIter(nomDirCase, 0 ); + Iter->SetDirNameLoc(nomDirIter); + std::string nomDirIterTotal ; + nomDirIterTotal = std::string(nomDirCase) + "/" + std::string(nomDirIter) ; +#ifndef WIN32 + if (mkdir(nomDirIterTotal.c_str(), S_IRWXU|S_IRGRP|S_IXGRP) != 0) +#else + if (_mkdir(nomDirIterTotal.c_str()) != 0) +#endif + { + MESSAGE ( "nomDirIterTotal : " << nomDirIterTotal ) ; + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + std::string text = "The directory for the computation cannot be created." ; + es.text = CORBA::string_dup(text.c_str()); + throw SALOME::SALOME_Exception(es); + } + // E.3. Copie du maillage HOMARD au format MED + codret = CHDIR(DirNameStart) ; + std::string commande = "cp " + file_maillage_homard + " " + nomDirIterTotal ; + MESSAGE ( "commande : " << commande ) ; + codret = system(commande.c_str()) ; + MESSAGE ( "codret : " << codret ) ; + if ( codret != 0 ) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "The starting point for the case cannot be copied into the working directory."; + throw SALOME::SALOME_Exception(es); + return 0; + }; + + // F. Menage + + delete[] MeshName ; + delete[] MeshFile ; + + CHDIR(nomDirWork.c_str()); + return HOMARD::HOMARD_Cas::_duplicate(myCase); +} +//============================================================================= +HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromCaseLastIteration(const char* nomCas, const char* DirNameStart) +// +// nomCas : nom du cas a creer +// DirNameStart : nom du répertoire du cas contenant l'iteration de reprise +// +{ + INFOS ( "CreateCaseFromCaseLastIteration : nomCas = " << nomCas << ", DirNameStart = " << DirNameStart ); + + std::string DirNameStartIter = CreateCase1(DirNameStart, -1) ; + + DirNameStartIter = string(DirNameStart) + "/" + DirNameStartIter ; + HOMARD::HOMARD_Cas_ptr myCase = CreateCaseFromIteration(nomCas, DirNameStartIter.c_str()) ; + + return HOMARD::HOMARD_Cas::_duplicate(myCase); +} +//============================================================================= +HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromCaseIteration(const char* nomCas, const char* DirNameStart, CORBA::Long Number) +// +// nomCas : nom du cas a creer +// DirNameStart : nom du répertoire du cas contenant l'iteration de reprise +// Number : numero de l'iteration de depart +// +{ + INFOS ( "CreateCaseFromCaseIteration : nomCas = " << nomCas << ", DirNameStart = " << DirNameStart << ", Number = " << Number ); + if ( Number < 0 ) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "The number of iteration must be positive."; + throw SALOME::SALOME_Exception(es); + return 0; + }; + + std::string DirNameStartIter = CreateCase1(DirNameStart, Number) ; + + DirNameStartIter = string(DirNameStart) + "/" + DirNameStartIter ; + HOMARD::HOMARD_Cas_ptr myCase = CreateCaseFromIteration(nomCas, DirNameStartIter.c_str()) ; + + return HOMARD::HOMARD_Cas::_duplicate(myCase); +} +//============================================================================= +std::string HOMARD_Gen_i::CreateCase1(const char* DirNameStart, CORBA::Long Number) +// +// Retourne le nom du répertoire ou se trouve l'iteration voulue. +// DirNameStart : nom du répertoire du cas contenant l'iteration de reprise +// Number : numero de l'iteration de depart ou -1 si on cherche la derniere +// +{ + MESSAGE ( "CreateCase1 : DirNameStart = " << DirNameStart << ", Number = " << Number ); + std::string nomDirWork = getenv("PWD") ; + std::string DirNameStartIter ; + int codret ; + int NumeIterMax = -1 ; + + // A.1. Controle du répertoire de depart du cas + codret = CHDIR(DirNameStart) ; + if ( codret != 0 ) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "The directory of the case for the pursuit does not exist."; + throw SALOME::SALOME_Exception(es); + return 0; + }; + // A.2. Reperage des sous-répertoire du répertoire de reprise + bool existe = false ; +#ifndef WIN32 + DIR *dp; + struct dirent *dirp; + dp = opendir(DirNameStart); + while ( (dirp = readdir(dp)) != NULL ) { + std::string DirName_1(dirp->d_name); +#else + HANDLE hFind = INVALID_HANDLE_VALUE; + WIN32_FIND_DATA ffd; + hFind = FindFirstFile(DirNameStart, &ffd); + if (INVALID_HANDLE_VALUE != hFind) { + while (FindNextFile(hFind, &ffd) != 0) { + std::string DirName_1 = ""; + if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + DirName_1 = std::string(ffd.cFileName); + } +#endif + if ( ( DirName_1 != "." ) && ( DirName_1 != ".." ) ) + { + if ( CHDIR(DirName_1.c_str()) == 0 ) + { +// On cherche le fichier de configuration dans ce sous-répertoire + codret = CHDIR(DirNameStart); +#ifndef WIN32 + DIR *dp_1; + struct dirent *dirp_1; + dp_1 = opendir(DirName_1.c_str()) ; + while ( (dirp_1 = readdir(dp_1)) != NULL ) + { + std::string file_name_1(dirp_1->d_name); +#else + HANDLE hFind1 = INVALID_HANDLE_VALUE; + WIN32_FIND_DATA ffd1; + hFind1 = FindFirstFile(DirName_1.c_str(), &ffd1); + while (FindNextFile(hFind1, &ffd1) != 0) + { + if (ffd1.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories + std::string file_name_1(ffd1.cFileName); +#endif + int bilan = file_name_1.find("HOMARD.Configuration.") ; + if ( bilan != string::npos ) + { + // Decodage du fichier pour trouver le numero d'iteration + CHDIR(DirName_1.c_str()) ; + + std::ifstream fichier( file_name_1.c_str() ); + if ( fichier ) // ce test échoue si le fichier n'est pas ouvert + { + int NumeIter ; + std::string ligne; // variable contenant chaque ligne lue + std::string mot_cle; + // cette boucle sur les lignes s'arrête dès qu'une erreur de lecture survient + while ( std::getline( fichier, ligne ) ) + { + // B.1. Pour la ligne courante, on identifie le premier mot : le mot-cle + std::istringstream ligne_bis(ligne); // variable contenant chaque ligne sous forme de flux + ligne_bis >> mot_cle ; + if ( mot_cle == "NumeIter" ) + { + ligne_bis >> NumeIter ; + NumeIter += 1 ; +// MESSAGE ( "==> NumeIter : " << NumeIter ) ; + if ( Number == - 1 ) + { + if ( NumeIter >= NumeIterMax ) + { + NumeIterMax = NumeIter ; + DirNameStartIter = DirName_1 ; + } + } + else + { + if ( NumeIter == Number ) + { + DirNameStartIter = DirName_1 ; + existe = true ; + break ; + } + } + } + } + } + else + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + std::string text = "The configuration file cannot be read." ; + es.text = CORBA::string_dup(text.c_str()); + throw SALOME::SALOME_Exception(es); + } + CHDIR(DirNameStart) ; + } + if ( existe ) { break ; } + } +#ifndef WIN32 + closedir(dp_1); +#else + FindClose(hFind1); +#endif + if ( existe ) { break ; } + } + } + } +#ifndef WIN32 + closedir(dp); +#else + FindClose(hFind); +#endif + CHDIR(nomDirWork.c_str()); + + if ( ( Number >= 0 && ( !existe ) ) || ( Number < 0 && ( NumeIterMax == -1 ) ) ) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "The directory of the iteration does not exist."; + throw SALOME::SALOME_Exception(es); + return 0; + }; + + return DirNameStartIter ; +} +//============================================================================= +HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCase0(const char* nomCas, const char* MeshName, const char* MeshFile, CORBA::Long MeshOption, CORBA::Long NumeIter, CORBA::Long Option) +// +// nomCas : nom du cas a creer +// MeshName, MeshFile : nom et fichier du maillage correspondant +// MeshOption : 0 : le maillage fourni est obligatoirement present ==> erreur si absent +// 1 : le maillage fourni peut ne pas exister ==> on continue si absent +// -1 : le maillage n'est pas fourni +// NumeIter : numero de l'iteration correspondante : 0, pour un depart, n>0 pour une poursuite +// Option : multiple de nombres premiers +// 1 : aucune option +// x2 : publication du maillage dans SMESH +{ + MESSAGE ( "CreateCase0 : nomCas = " << nomCas ); + MESSAGE ( "CreateCase0 : MeshName = " << MeshName << ", MeshFile = " << MeshFile << ", MeshOption = " << MeshOption ); + MESSAGE ( "CreateCase0 : NumeIter = " << NumeIter << ", Option = " << Option ); +// + // A. Controles + // A.1. L'etude + IsValidStudy () ; + + // A.2. Controle du nom : + if ((myStudyContext._mesCas).find(nomCas)!=(myStudyContext._mesCas).end()) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "This case has already been defined."; + throw SALOME::SALOME_Exception(es); + return 0; + }; + + // A.3. Controle du fichier du maillage + int existeMeshFile ; + if ( MeshOption >= 0 ) + { + existeMeshFile = MEDFileExist ( MeshFile ) ; + MESSAGE ( "CreateCase0 : existeMeshFile = " << existeMeshFile ); + if ( ( existeMeshFile == 0 ) && ( MeshOption == 0 ) ) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "The mesh file does not exist."; + throw SALOME::SALOME_Exception(es); + return 0; + } + } + else { existeMeshFile = 0 ; } + + // B. Creation de l'objet cas et publication +// MESSAGE ( "CreateCase0 : Creation de l'objet" ); + HOMARD::HOMARD_Cas_var myCase = newCase(); + myCase->SetName(nomCas); + SALOMEDS::SObject_var aSO; + SALOMEDS::SObject_var aResultSO=PublishInStudy(aSO, myCase, nomCas); + myStudyContext._mesCas[nomCas] = myCase; + + // C. Caracteristiques du maillage + if ( existeMeshFile != 0 ) + { + // Les valeurs extremes des coordonnées +// MESSAGE ( "CreateCase0 : Les valeurs extremes des coordonnées" ); + std::vector LesExtremes =GetBoundingBoxInMedFile(MeshFile) ; + HOMARD::extrema_var aSeq = new HOMARD::extrema() ; + if (LesExtremes.size()!=10) { return 0; } + aSeq->length(10) ; + for (int i =0 ; i< LesExtremes.size() ; i++) + aSeq[i]=LesExtremes[i] ; + myCase->SetBoundingBox(aSeq) ; + // Les groupes +// MESSAGE ( "CreateCase0 : Les groupes" ); + std::set LesGroupes =GetListeGroupesInMedFile(MeshFile) ; + HOMARD::ListGroupType_var aSeqGroupe = new HOMARD::ListGroupType ; + aSeqGroupe->length(LesGroupes.size()); + std::set::const_iterator it ; + int i = 0 ; + for (it=LesGroupes.begin() ; it != LesGroupes.end() ; it++) + aSeqGroupe[i++]=(*it).c_str() ; + myCase->SetGroups(aSeqGroupe) ; + } + + // D. L'iteration initiale du cas + MESSAGE ( "CreateCase0 : iteration initiale du cas" ); + // D.1. Recherche d'un nom : par defaut, on prend le nom du maillage correspondant. + // Si ce nom d'iteration existe deja, on incremente avec 0, 1, 2, etc. + int monNum = 0; + std::string NomIteration = std::string(MeshName) ; + while ( (myStudyContext._mesIterations).find(NomIteration) != (myStudyContext._mesIterations.end()) ) + { + std::ostringstream nom; + nom << MeshName << monNum; + NomIteration = nom.str(); + monNum += 1; + } + MESSAGE ( "CreateCas0 : ==> NomIteration = " << NomIteration ); + + // D.2. Creation de l'iteration + HOMARD::HOMARD_Iteration_var anIter = newIteration(); + myStudyContext._mesIterations[NomIteration] = anIter; + anIter->SetName(NomIteration.c_str()); + AssociateCaseIter (nomCas, NomIteration.c_str(), "IterationHomard"); + + // D.4. Maillage correspondant + if ( existeMeshFile != 0 ) + { + anIter->SetMeshFile(MeshFile); + if ( Option % 2 == 0 ) { PublishResultInSmesh(MeshFile, 0); } + } + anIter->SetMeshName(MeshName); + + // D.5. Numero d'iteration + anIter->SetNumber(NumeIter); + + // D.6. Etat + SetEtatIter(NomIteration.c_str(), -NumeIter); +// + + return HOMARD::HOMARD_Cas::_duplicate(myCase); +} +//============================================================================= +HOMARD::HOMARD_Hypothesis_ptr HOMARD_Gen_i::CreateHypothesis(const char* nomHypothesis) +{ + INFOS ( "CreateHypothesis : nomHypothesis = " << nomHypothesis ); + IsValidStudy () ; + + // A. Controle du nom : + if ((myStudyContext._mesHypotheses).find(nomHypothesis) != (myStudyContext._mesHypotheses).end()) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "This hypothesis has already been defined."; + throw SALOME::SALOME_Exception(es); + return 0; + } + + // B. Creation de l'objet + HOMARD::HOMARD_Hypothesis_var myHypothesis = newHypothesis(); + if (CORBA::is_nil(myHypothesis)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Unable to create the hypothesis"; + throw SALOME::SALOME_Exception(es); + return 0; + }; + myHypothesis->SetName(nomHypothesis); + + // C. Enregistrement + myStudyContext._mesHypotheses[nomHypothesis] = myHypothesis; + + SALOMEDS::SObject_var aSO; + SALOMEDS::SObject_var aResultSO=PublishInStudy(aSO, myHypothesis, nomHypothesis); + + // D. Valeurs par defaut des options avancees + myHypothesis->SetNivMax(-1); + myHypothesis->SetDiamMin(-1.0); + myHypothesis->SetAdapInit(0); + myHypothesis->SetExtraOutput(1); + + return HOMARD::HOMARD_Hypothesis::_duplicate(myHypothesis); +} + +//============================================================================= +HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration(const char* NomIteration, const char* nomIterParent) +//============================================================================= +{ + INFOS ("CreateIteration : NomIteration = " << NomIteration << ", nomIterParent = " << nomIterParent); + IsValidStudy () ; + + HOMARD::HOMARD_Iteration_var myIterationParent = myStudyContext._mesIterations[nomIterParent]; + if (CORBA::is_nil(myIterationParent)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "The parent iteration is not defined."; + throw SALOME::SALOME_Exception(es); + return 0; + }; + + const char* nomCas = myIterationParent->GetCaseName(); + MESSAGE ("CreateIteration : nomCas = " << nomCas); + HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; + if (CORBA::is_nil(myCase)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid case context"; + throw SALOME::SALOME_Exception(es); + return 0; + }; + const char* nomDirCase = myCase->GetDirName(); + + // Controle du nom : + if ((myStudyContext._mesIterations).find(NomIteration)!=(myStudyContext._mesIterations).end()) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "This iteration has already been defined."; + throw SALOME::SALOME_Exception(es); + return 0; + }; + + HOMARD::HOMARD_Iteration_var myIteration = newIteration(); + if (CORBA::is_nil(myIteration)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Unable to create the iteration"; + throw SALOME::SALOME_Exception(es); + return 0; + }; + myStudyContext._mesIterations[std::string(NomIteration)] = myIteration; +// Nom de l'iteration et du maillage + myIteration->SetName(NomIteration); + myIteration->SetMeshName(NomIteration); + myIteration->SetState(1); + + int numero = myIterationParent->GetNumber() + 1; + myIteration->SetNumber(numero); + +// Nombre d'iterations deja connues pour le cas, permettant +// la creation d'un sous-répertoire unique + int nbitercase = myCase->GetNumberofIter(); + char* nomDirIter = CreateDirNameIter(nomDirCase, nbitercase ); + myIteration->SetDirNameLoc(nomDirIter); + +// Le nom du fichier du maillage MED est indice par le nombre d'iterations du cas. +// Si on a une chaine unique depuis le depart, ce nombre est le meme que le +// numero d'iteration dans la sucession : maill.01.med, maill.02.med, etc... C'est la +// situation la plus frequente. +// Si on a plusieurs branches, donc des iterations du meme niveau d'adaptation, utiliser +// le nombre d'iterations du cas permet d'eviter les collisions. + int jaux ; + if ( nbitercase < 100 ) { jaux = 2 ; } + else if ( nbitercase < 1000 ) { jaux = 3 ; } + else if ( nbitercase < 10000 ) { jaux = 4 ; } + else if ( nbitercase < 100000 ) { jaux = 5 ; } + else { jaux = 9 ; } + std::ostringstream iaux ; + iaux << std::setw(jaux) << std::setfill('0') << nbitercase ; + std::stringstream MeshFile; + MeshFile << nomDirCase << "/maill." << iaux.str() << ".med"; + myIteration->SetMeshFile(MeshFile.str().c_str()); + +// Association avec le cas + std::string label = "IterationHomard_" + std::string(nomIterParent); + AssociateCaseIter(nomCas, NomIteration, label.c_str()); +// Lien avec l'iteration precedente + myIterationParent->LinkNextIteration(NomIteration); + myIteration->SetIterParentName(nomIterParent); + // Gestion de l'arbre d'etudes + SALOMEDS::SObject_var aIterSOParent = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIterationParent))); + SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration))); + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); + aStudyBuilder->NewCommand(); + SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aIterSO); + aStudyBuilder->Addreference(aSubSO, aIterSOParent); + aStudyBuilder->CommitCommand(); + + return HOMARD::HOMARD_Iteration::_duplicate(myIteration); +} +//============================================================================= +HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundary(const char* BoundaryName, CORBA::Long BoundaryType) +{ + MESSAGE ("CreateBoundary : BoundaryName = " << BoundaryName << ", BoundaryType = " << BoundaryType); + IsValidStudy () ; + + // Controle du nom : + if ((myStudyContext._mesBoundarys).find(BoundaryName)!=(myStudyContext._mesBoundarys).end()) + { + MESSAGE ("CreateBoundary : la frontiere " << BoundaryName << " existe deja"); + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "This boundary has already been defined"; + throw SALOME::SALOME_Exception(es); + return 0; + }; + + HOMARD::HOMARD_Boundary_var myBoundary = newBoundary(); + myBoundary->SetName(BoundaryName); + myBoundary->SetType(BoundaryType); + + myStudyContext._mesBoundarys[BoundaryName] = myBoundary; + + SALOMEDS::SObject_var aSO; + SALOMEDS::SObject_var aResultSO=PublishInStudy(aSO, myBoundary, BoundaryName); + + return HOMARD::HOMARD_Boundary::_duplicate(myBoundary); +} +//============================================================================= +HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundaryCAO(const char* BoundaryName, const char* CAOFile) +{ + INFOS ("CreateBoundaryCAO : BoundaryName = " << BoundaryName << ", CAOFile = " << CAOFile ); + HOMARD::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, -1); + myBoundary->SetDataFile( CAOFile ) ; + + return HOMARD::HOMARD_Boundary::_duplicate(myBoundary); +} +//============================================================================= +HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundaryDi(const char* BoundaryName, const char* MeshName, const char* MeshFile) +{ + INFOS ("CreateBoundaryDi : BoundaryName = " << BoundaryName << ", MeshName = " << MeshName << ", MeshFile = " << MeshFile ); + HOMARD::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 0); + myBoundary->SetDataFile( MeshFile ) ; + myBoundary->SetMeshName( MeshName ) ; + + return HOMARD::HOMARD_Boundary::_duplicate(myBoundary); +} +//============================================================================= +HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundaryCylinder(const char* BoundaryName, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, + CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, + CORBA::Double Rayon) +{ + INFOS ("CreateBoundaryCylinder : BoundaryName = " << BoundaryName ) ; +// + SALOME::ExceptionStruct es; + int error = 0 ; + if ( Rayon <= 0.0 ) + { es.text = "The radius must be positive." ; + error = 1 ; } + double daux = fabs(Xaxe) + fabs(Yaxe) + fabs(Zaxe) ; + if ( daux < 0.0000001 ) + { es.text = "The axis must be a non 0 vector." ; + error = 2 ; } + if ( error != 0 ) + { + es.type = SALOME::BAD_PARAM; + throw SALOME::SALOME_Exception(es); + return 0; + }; +// + HOMARD::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 1) ; + myBoundary->SetCylinder( Xcentre, Ycentre, Zcentre, Xaxe, Yaxe, Zaxe, Rayon ) ; + + return HOMARD::HOMARD_Boundary::_duplicate(myBoundary) ; +} +//============================================================================= +HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundarySphere(const char* BoundaryName, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, + CORBA::Double Rayon) +{ + INFOS ("CreateBoundarySphere : BoundaryName = " << BoundaryName ) ; +// + SALOME::ExceptionStruct es; + int error = 0 ; + if ( Rayon <= 0.0 ) + { es.text = "The radius must be positive." ; + error = 1 ; } + if ( error != 0 ) + { + es.type = SALOME::BAD_PARAM; + throw SALOME::SALOME_Exception(es); + return 0; + }; +// + HOMARD::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 2) ; + myBoundary->SetSphere( Xcentre, Ycentre, Zcentre, Rayon ) ; + + return HOMARD::HOMARD_Boundary::_duplicate(myBoundary) ; +} +//============================================================================= +HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundaryConeA(const char* BoundaryName, + CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, CORBA::Double Angle, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre) +{ + INFOS ("CreateBoundaryConeA : BoundaryName = " << BoundaryName ) ; +// + SALOME::ExceptionStruct es; + int error = 0 ; + if ( Angle <= 0.0 || Angle >= 90.0 ) + { es.text = "The angle must be included higher than 0 degree and lower than 90 degrees." ; + error = 1 ; } + double daux = fabs(Xaxe) + fabs(Yaxe) + fabs(Zaxe) ; + if ( daux < 0.0000001 ) + { es.text = "The axis must be a non 0 vector." ; + error = 2 ; } + if ( error != 0 ) + { + es.type = SALOME::BAD_PARAM; + throw SALOME::SALOME_Exception(es); + return 0; + }; +// + HOMARD::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 3) ; + myBoundary->SetConeA( Xaxe, Yaxe, Zaxe, Angle, Xcentre, Ycentre, Zcentre ) ; + + return HOMARD::HOMARD_Boundary::_duplicate(myBoundary) ; +} +//============================================================================= +HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundaryConeR(const char* BoundaryName, + CORBA::Double Xcentre1, CORBA::Double Ycentre1, CORBA::Double Zcentre1, CORBA::Double Rayon1, + CORBA::Double Xcentre2, CORBA::Double Ycentre2, CORBA::Double Zcentre2, CORBA::Double Rayon2) +{ + INFOS ("CreateBoundaryConeR : BoundaryName = " << BoundaryName ) ; +// + SALOME::ExceptionStruct es; + int error = 0 ; + if ( Rayon1 < 0.0 || Rayon2 < 0.0 ) + { es.text = "The radius must be positive." ; + error = 1 ; } + double daux = fabs(Rayon2-Rayon1) ; + if ( daux < 0.0000001 ) + { es.text = "The radius must be different." ; + error = 2 ; } + daux = fabs(Xcentre2-Xcentre1) + fabs(Ycentre2-Ycentre1) + fabs(Zcentre2-Zcentre1) ; + if ( daux < 0.0000001 ) + { es.text = "The centers must be different." ; + error = 3 ; } + if ( error != 0 ) + { + es.type = SALOME::BAD_PARAM; + throw SALOME::SALOME_Exception(es); + return 0; + }; +// + HOMARD::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 4) ; + myBoundary->SetConeR( Xcentre1, Ycentre1, Zcentre1, Rayon1, Xcentre2, Ycentre2, Zcentre2, Rayon2 ) ; + + return HOMARD::HOMARD_Boundary::_duplicate(myBoundary) ; +} +//============================================================================= +HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundaryTorus(const char* BoundaryName, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, + CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, + CORBA::Double RayonRev, CORBA::Double RayonPri) +{ + INFOS ("CreateBoundaryTorus : BoundaryName = " << BoundaryName ) ; +// + SALOME::ExceptionStruct es; + int error = 0 ; + if ( ( RayonRev <= 0.0 ) || ( RayonPri <= 0.0 ) ) + { es.text = "The radius must be positive." ; + error = 1 ; } + double daux = fabs(Xaxe) + fabs(Yaxe) + fabs(Zaxe) ; + if ( daux < 0.0000001 ) + { es.text = "The axis must be a non 0 vector." ; + error = 2 ; } + if ( error != 0 ) + { + es.type = SALOME::BAD_PARAM; + throw SALOME::SALOME_Exception(es); + return 0; + }; +// + HOMARD::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 5) ; + myBoundary->SetTorus( Xcentre, Ycentre, Zcentre, Xaxe, Yaxe, Zaxe, RayonRev, RayonPri ) ; + + return HOMARD::HOMARD_Boundary::_duplicate(myBoundary) ; +} +//============================================================================= +HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZone(const char* ZoneName, CORBA::Long ZoneType) +{ + MESSAGE ("CreateZone : ZoneName = " << ZoneName << ", ZoneType = " << ZoneType); + IsValidStudy () ; + + // Controle du nom : + if ((myStudyContext._mesZones).find(ZoneName)!=(myStudyContext._mesZones).end()) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "This zone has already been defined"; + throw SALOME::SALOME_Exception(es); + return 0; + }; + + HOMARD::HOMARD_Zone_var myZone = newZone(); + myZone->SetName(ZoneName); + myZone->SetType(ZoneType); + + myStudyContext._mesZones[ZoneName] = myZone; + + SALOMEDS::SObject_var aSO; + SALOMEDS::SObject_var aResultSO=PublishInStudy(aSO, myZone, ZoneName); + + return HOMARD::HOMARD_Zone::_duplicate(myZone); +} +//============================================================================= +HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneBox(const char* ZoneName, + CORBA::Double Xmini, CORBA::Double Xmaxi, + CORBA::Double Ymini, CORBA::Double Ymaxi, + CORBA::Double Zmini, CORBA::Double Zmaxi) +{ + INFOS ("CreateZoneBox : ZoneName = " << ZoneName ) ; +// + SALOME::ExceptionStruct es; + int error = 0 ; + if ( Xmini > Xmaxi ) + { es.text = "The X coordinates are not coherent." ; + error = 1 ; } + if ( Ymini > Ymaxi ) + { es.text = "The Y coordinates are not coherent." ; + error = 2 ; } + if ( Zmini > Zmaxi ) + { es.text = "The Z coordinates are not coherent." ; + error = 3 ; } + if ( error != 0 ) + { + es.type = SALOME::BAD_PARAM; + throw SALOME::SALOME_Exception(es); + return 0; + }; +// + HOMARD::HOMARD_Zone_var myZone = CreateZone(ZoneName, 2) ; + myZone->SetBox ( Xmini, Xmaxi, Ymini, Ymaxi, Zmini, Zmaxi) ; + + return HOMARD::HOMARD_Zone::_duplicate(myZone) ; +} +//============================================================================= +HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneSphere(const char* ZoneName, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, CORBA::Double Rayon) +{ + INFOS ("CreateZoneSphere : ZoneName = " << ZoneName ) ; +// + SALOME::ExceptionStruct es; + int error = 0 ; + if ( Rayon <= 0.0 ) + { es.text = "The radius must be positive." ; + error = 1 ; } + if ( error != 0 ) + { + es.type = SALOME::BAD_PARAM; + throw SALOME::SALOME_Exception(es); + return 0; + }; +// + HOMARD::HOMARD_Zone_var myZone = CreateZone(ZoneName, 4) ; + myZone->SetSphere( Xcentre, Ycentre, Zcentre, Rayon ) ; + + return HOMARD::HOMARD_Zone::_duplicate(myZone) ; +} +//============================================================================= +HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneCylinder(const char* ZoneName, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, + CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, + CORBA::Double Rayon, CORBA::Double Haut) +{ + INFOS ("CreateZoneCylinder : ZoneName = " << ZoneName ) ; +// + SALOME::ExceptionStruct es; + int error = 0 ; + if ( Rayon <= 0.0 ) + { es.text = "The radius must be positive." ; + error = 1 ; } + double daux = fabs(Xaxe) + fabs(Yaxe) + fabs(Zaxe) ; + if ( daux < 0.0000001 ) + { es.text = "The axis must be a non 0 vector." ; + error = 2 ; } + if ( Haut <= 0.0 ) + { es.text = "The height must be positive." ; + error = 3 ; } + if ( error != 0 ) + { + es.type = SALOME::BAD_PARAM; + throw SALOME::SALOME_Exception(es); + return 0; + }; +// + HOMARD::HOMARD_Zone_var myZone = CreateZone(ZoneName, 5) ; + myZone->SetCylinder( Xcentre, Ycentre, Zcentre, Xaxe, Yaxe, Zaxe, Rayon, Haut ) ; + + return HOMARD::HOMARD_Zone::_duplicate(myZone) ; +} +//============================================================================= +HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZonePipe(const char* ZoneName, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, + CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, + CORBA::Double Rayon, CORBA::Double Haut, CORBA::Double Rayonint) +{ + INFOS ("CreateZonePipe : ZoneName = " << ZoneName ) ; +// + SALOME::ExceptionStruct es; + int error = 0 ; + if ( Rayon <= 0.0 || Rayonint <= 0.0 ) + { es.text = "The radius must be positive." ; + error = 1 ; } + double daux = fabs(Xaxe) + fabs(Yaxe) + fabs(Zaxe) ; + if ( daux < 0.0000001 ) + { es.text = "The axis must be a non 0 vector." ; + error = 2 ; } + if ( Haut <= 0.0 ) + { es.text = "The height must be positive." ; + error = 3 ; } + if ( Rayon <= Rayonint ) + { es.text = "The external radius must be higher than the internal radius." ; + error = 4 ; } + if ( error != 0 ) + { + es.type = SALOME::BAD_PARAM; + throw SALOME::SALOME_Exception(es); + return 0; + }; +// + HOMARD::HOMARD_Zone_var myZone = CreateZone(ZoneName, 7) ; + myZone->SetPipe( Xcentre, Ycentre, Zcentre, Xaxe, Yaxe, Zaxe, Rayon, Haut, Rayonint ) ; + + return HOMARD::HOMARD_Zone::_duplicate(myZone) ; +} +//============================================================================= +HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneBox2D(const char* ZoneName, + CORBA::Double Umini, CORBA::Double Umaxi, + CORBA::Double Vmini, CORBA::Double Vmaxi, + CORBA::Long Orient) +{ + INFOS ("CreateZoneBox2D : ZoneName = " << ZoneName ) ; +// MESSAGE ("Umini = " << Umini << ", Umaxi =" << Umaxi ) ; +// MESSAGE ("Vmini = " << Vmini << ", Vmaxi =" << Vmaxi ) ; +// MESSAGE ("Orient = " << Orient ) ; +// + SALOME::ExceptionStruct es; + int error = 0 ; + if ( Umini > Umaxi ) + { es.text = "The first coordinates are not coherent." ; + error = 1 ; } + if ( Vmini > Vmaxi ) + { es.text = "The second coordinates are not coherent." ; + error = 2 ; } + if ( Orient < 1 || Orient > 3 ) + { es.text = "The orientation must be 1, 2 or 3." ; + error = 3 ; } + if ( error != 0 ) + { + es.type = SALOME::BAD_PARAM; + throw SALOME::SALOME_Exception(es); + return 0; + }; +// + double Xmini, Xmaxi ; + double Ymini, Ymaxi ; + double Zmini, Zmaxi ; + if ( Orient == 1 ) + { Xmini = Umini ; + Xmaxi = Umaxi ; + Ymini = Vmini ; + Ymaxi = Vmaxi ; + Zmini = 0. ; + Zmaxi = 0. ; } + else if ( Orient == 2 ) + { Xmini = 0. ; + Xmaxi = 0. ; + Ymini = Umini ; + Ymaxi = Umaxi ; + Zmini = Vmini ; + Zmaxi = Vmaxi ; } + else if ( Orient == 3 ) + { Xmini = Vmini ; + Xmaxi = Vmaxi ; + Ymini = 0. ; + Ymaxi = 0. ; + Zmini = Umini ; + Zmaxi = Umaxi ; } + else { VERIFICATION( (Orient>=1) && (Orient<=3) ) ; } + + HOMARD::HOMARD_Zone_var myZone = CreateZone(ZoneName, 10+Orient) ; + myZone->SetBox ( Xmini, Xmaxi, Ymini, Ymaxi, Zmini, Zmaxi) ; + + return HOMARD::HOMARD_Zone::_duplicate(myZone) ; +} +//============================================================================= +HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneDisk(const char* ZoneName, + CORBA::Double Ucentre, CORBA::Double Vcentre, + CORBA::Double Rayon, + CORBA::Long Orient) +{ + INFOS ("CreateZoneDisk : ZoneName = " << ZoneName ) ; +// + SALOME::ExceptionStruct es; + int error = 0 ; + if ( Rayon <= 0.0 ) + { es.text = "The radius must be positive." ; + error = 1 ; } + if ( Orient < 1 || Orient > 3 ) + { es.text = "The orientation must be 1, 2 or 3." ; + error = 3 ; } + if ( error != 0 ) + { + es.type = SALOME::BAD_PARAM; + throw SALOME::SALOME_Exception(es); + return 0; + }; +// + double Xcentre ; + double Ycentre ; + double Zcentre ; + if ( Orient == 1 ) + { Xcentre = Ucentre ; + Ycentre = Vcentre ; + Zcentre = 0. ; } + else if ( Orient == 2 ) + { Xcentre = 0. ; + Ycentre = Ucentre ; + Zcentre = Vcentre ; } + else if ( Orient == 3 ) + { Xcentre = Vcentre ; + Ycentre = 0. ; + Zcentre = Ucentre ; } + else { VERIFICATION( (Orient>=1) && (Orient<=3) ) ; } + + HOMARD::HOMARD_Zone_var myZone = CreateZone(ZoneName, 30+Orient) ; + myZone->SetCylinder( Xcentre, Ycentre, Zcentre, 0., 0., 1., Rayon, 1. ) ; + + return HOMARD::HOMARD_Zone::_duplicate(myZone) ; +} +//============================================================================= +HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneDiskWithHole(const char* ZoneName, + CORBA::Double Ucentre, CORBA::Double Vcentre, + CORBA::Double Rayon, CORBA::Double Rayonint, + CORBA::Long Orient) +{ + INFOS ("CreateZoneDiskWithHole : ZoneName = " << ZoneName ) ; +// + SALOME::ExceptionStruct es; + int error = 0 ; + if ( Rayon <= 0.0 || Rayonint <= 0.0 ) + { es.text = "The radius must be positive." ; + error = 1 ; } + if ( Orient < 1 || Orient > 3 ) + { es.text = "The orientation must be 1, 2 or 3." ; + error = 3 ; } + if ( Rayon <= Rayonint ) + { es.text = "The external radius must be higher than the internal radius." ; + error = 4 ; } + if ( error != 0 ) + { + es.type = SALOME::BAD_PARAM; + throw SALOME::SALOME_Exception(es); + return 0; + }; +// + double Xcentre ; + double Ycentre ; + double Zcentre ; + if ( Orient == 1 ) + { Xcentre = Ucentre ; + Ycentre = Vcentre ; + Zcentre = 0. ; } + else if ( Orient == 2 ) + { Xcentre = 0. ; + Ycentre = Ucentre ; + Zcentre = Vcentre ; } + else if ( Orient == 3 ) + { Xcentre = Vcentre ; + Ycentre = 0. ; + Zcentre = Ucentre ; } + else { VERIFICATION( (Orient>=1) && (Orient<=3) ) ; } + + HOMARD::HOMARD_Zone_var myZone = CreateZone(ZoneName, 60+Orient) ; + myZone->SetPipe( Xcentre, Ycentre, Zcentre, 0., 0., 1., Rayon, 1., Rayonint ) ; + + return HOMARD::HOMARD_Zone::_duplicate(myZone) ; +} +//============================================================================= +//============================================================================= + + + + +//============================================================================= +//============================================================================= +// Traitement d'une iteration +// etatMenage = 1 : destruction du répertoire d'execution +// modeHOMARD = 1 : adaptation +// != 1 : information avec les options modeHOMARD +// Option1 >0 : appel depuis python +// <0 : appel depuis GUI +// Option2 : multiple de nombres premiers +// 1 : aucune option +// x2 : publication du maillage dans SMESH +//============================================================================= +CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMenage, CORBA::Long modeHOMARD, CORBA::Long Option1, CORBA::Long Option2) +{ + INFOS ( "Compute : traitement de " << NomIteration << ", avec modeHOMARD = " << modeHOMARD << ", Option1 = " << Option1 << ", Option2 = " << Option2 ); + + // A. Prealable + int codret = 0; + + // A.1. L'objet iteration + HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[NomIteration]; + ASSERT(!CORBA::is_nil(myIteration)); + + // A.2. Controle de la possibilite d'agir + // A.2.1. Etat de l'iteration + int etat = myIteration->GetState(); + MESSAGE ( "etat = "<GetNumber(); + std::string siterp1 ; + std::stringstream saux1 ; + saux1 << NumeIter ; + siterp1 = saux1.str() ; + if (NumeIter < 10) { siterp1 = "0" + siterp1 ; } + + std::string siter ; + if ( modeHOMARD==1 ) + { + std::stringstream saux0 ; + int iaux = max(0, NumeIter-1) ; + saux0 << iaux ; + siter = saux0.str() ; + if (NumeIter < 11) { siter = "0" + siter ; } + } + else + { siter = siterp1 ; } + + // A.4. Le cas + const char* nomCas = myIteration->GetCaseName(); + HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; + ASSERT(!CORBA::is_nil(myCase)); + + // B. Les répertoires + // B.1. Le répertoire courant + std::string nomDirWork = getenv("PWD") ; + // B.2. Le sous-répertoire de l'iteration a traiter + char* DirCompute = ComputeDirManagement(myCase, myIteration, etatMenage); + MESSAGE( ". DirCompute = " << DirCompute ); + + // C. Le fichier des messages + // C.1. Le deroulement de l'execution de HOMARD + std::string LogFile = DirCompute ; + LogFile += "/Liste" ; + if ( modeHOMARD == 1 ) { LogFile += "." + siter + ".vers." + siterp1 ; } + LogFile += ".log" ; + MESSAGE (". LogFile = " << LogFile); + if ( modeHOMARD == 1 ) { myIteration->SetLogFile(LogFile.c_str()); } + // C.2. Le bilan de l'analyse du maillage + std::string FileInfo = DirCompute ; + FileInfo += "/" ; + if ( modeHOMARD == 1 ) { FileInfo += "apad" ; } + else + { if ( NumeIter == 0 ) { FileInfo += "info_av" ; } + else { FileInfo += "info_ap" ; } + } + FileInfo += "." + siterp1 + ".bilan" ; + myIteration->SetFileInfo(FileInfo.c_str()); + + // D. On passe dans le répertoire de l'iteration a calculer + MESSAGE ( ". On passe dans DirCompute = " << DirCompute ); + CHDIR(DirCompute); + + // E. Les données de l'exécution HOMARD + // E.1. L'objet du texte du fichier de configuration + HomardDriver* myDriver = new HomardDriver(siter, siterp1); + myDriver->TexteInit(DirCompute, LogFile, _Langue); + + // E.2. Le maillage associe a l'iteration + const char* NomMesh = myIteration->GetMeshName(); + MESSAGE ( ". NomMesh = " << NomMesh ); + const char* MeshFile = myIteration->GetMeshFile(); + MESSAGE ( ". MeshFile = " << MeshFile ); + + // E.3. Les données du traitement HOMARD + int iaux ; + if ( modeHOMARD == 1 ) + { + iaux = 1 ; + myDriver->TexteMaillageHOMARD( DirCompute, siterp1, iaux ) ; + myDriver->TexteMaillage(NomMesh, MeshFile, 1); + codret = ComputeAdap(myCase, myIteration, etatMenage, myDriver, Option1, Option2) ; + } + else + { + InvalideIterInfo(NomIteration); + myDriver->TexteInfo( modeHOMARD, NumeIter ) ; + iaux = 0 ; + myDriver->TexteMaillageHOMARD( DirCompute, siterp1, iaux ) ; + myDriver->TexteMaillage(NomMesh, MeshFile, 0); + myDriver->CreeFichierDonn(); + } + + // E.4. Ajout des informations liees a l'eventuel suivi de frontiere + int BoundaryOption = DriverTexteBoundary(myCase, myDriver) ; + + // E.5. Ecriture du texte dans le fichier + MESSAGE ( ". Ecriture du texte dans le fichier de configuration ; codret = "<CreeFichier(); } + +// G. Execution +// + int codretexec = 1789 ; + if (codret == 0) + { + codretexec = myDriver->ExecuteHomard(Option1); +// + MESSAGE ( "Erreur en executant HOMARD : " << codretexec ); + // En mode adaptation, on ajuste l'etat de l'iteration + if ( modeHOMARD == 1 ) + { + if (codretexec == 0) { SetEtatIter(NomIteration,2); } + else { SetEtatIter(NomIteration,1); } + // GERALD -- QMESSAGE BOX + } + } + + // H. Gestion des resultats + if (codret == 0) + { + std::string Commentaire ; + // H.1. Le fichier des messages, dans tous les cas + Commentaire = "log" ; + if ( modeHOMARD == 1 ) { Commentaire += " " + siterp1 ; } + else { Commentaire += "Info" ; } + PublishFileUnderIteration(NomIteration, LogFile.c_str(), Commentaire.c_str()); + + // H.2. Si tout s'est bien passe : + if (codretexec == 0) + { + // H.2.1. Le fichier de bilan + Commentaire = "Summary" ; + if ( modeHOMARD == 1 ) { Commentaire += " " + siterp1 ; } + else { Commentaire += "Info" ; } + PublishFileUnderIteration(NomIteration, FileInfo.c_str(), Commentaire.c_str()); + // H.2.2. Le fichier de maillage obtenu + if ( modeHOMARD == 1 ) + { + std::stringstream saux0 ; + Commentaire = "Mesh" ; + Commentaire += " " + siterp1 ; + PublishFileUnderIteration(NomIteration, MeshFile, Commentaire.c_str()); + if ( Option2 % 2 == 0 ) { PublishResultInSmesh(MeshFile, 1); } + } + } + // H.3 Message d'erreur + if (codretexec != 0) + { + std::string text = "" ; + // Message d'erreur en cas de probleme en adaptation + if ( modeHOMARD == 1 ) + { + text = "Error during the adaptation.\n" ; + bool stopvu = false ; + std::ifstream fichier( LogFile.c_str() ); + if ( fichier ) // ce test échoue si le fichier n'est pas ouvert + { + std::string ligne; // variable contenant chaque ligne lue + while ( std::getline( fichier, ligne ) ) + { +// INFOS(ligne); + if ( stopvu ) + { text += ligne+ "\n"; } + else + { + int position = ligne.find( "===== HOMARD ===== STOP =====" ) ; + if ( position > 0 ) { stopvu = true ; } + } + } + } + } + text += "\n\nSee the file " + LogFile + "\n" ; + INFOS ( text ) ; + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = CORBA::string_dup(text.c_str()); + throw SALOME::SALOME_Exception(es); +// + // En mode information, on force le succes pour pouvoir consulter le fichier log + if ( modeHOMARD != 1 ) { codretexec = 0 ; } + } + } + + // I. Menage et retour dans le répertoire du cas + if (codret == 0) + { + delete myDriver; + MESSAGE ( ". On retourne dans nomDirWork = " << nomDirWork ); + + CHDIR(nomDirWork.c_str()); + } + + // J. Suivi de la frontière CAO +// std::cout << "- codret : " << codret << std::endl; +// std::cout << "- modeHOMARD : " << modeHOMARD << std::endl; +// std::cout << "- BoundaryOption : " << BoundaryOption << std::endl; +// std::cout << "- codretexec : " << codretexec << std::endl; + if (codret == 0) + { + if ( ( modeHOMARD == 1 ) && ( BoundaryOption % 5 == 0 ) && (codretexec == 0) ) + { + INFOS ( "Suivi de frontière CAO" ); + codret = ComputeCAO(myCase, myIteration, Option1, Option2) ; + } + } + + return codretexec ; +} +//============================================================================= +// Calcul d'une iteration : partie spécifique à l'adaptation +//============================================================================= +CORBA::Long HOMARD_Gen_i::ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOMARD_Iteration_var myIteration, CORBA::Long etatMenage, HomardDriver* myDriver, CORBA::Long Option1, CORBA::Long Option2) +{ + MESSAGE ( "ComputeAdap avec Option1 = " << Option1 << ", Option2 = " << Option2 ); + + // A. Prealable + // A.1. Bases + int codret = 0; + // Numero de l'iteration + int NumeIter = myIteration->GetNumber(); + std::stringstream saux0 ; + saux0 << NumeIter-1 ; + std::string siter = saux0.str() ; + if (NumeIter < 11) { siter = "0" + siter ; } + + // A.2. On verifie qu il y a une hypothese (erreur improbable); + const char* nomHypo = myIteration->GetHypoName(); + if (std::string(nomHypo) == std::string("")) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "This iteration does not have any associated hypothesis."; + throw SALOME::SALOME_Exception(es); + return 2; + }; + HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; + ASSERT(!CORBA::is_nil(myHypo)); + + // B. L'iteration parent + const char* nomIterationParent = myIteration->GetIterParentName(); + HOMARD::HOMARD_Iteration_var myIterationParent = myStudyContext._mesIterations[nomIterationParent]; + ASSERT(!CORBA::is_nil(myIterationParent)); + // Si l'iteration parent n'est pas calculee, on le fait (recursivite amont) + if ( myIterationParent->GetState() == 1 ) + { + int iaux = 1 ; + int codret = Compute(nomIterationParent, etatMenage, iaux, Option1, Option2); + if (codret != 0) + { + // GERALD -- QMESSAGE BOX + VERIFICATION("Pb au calcul de l'iteration precedente" == 0); + } + }; + + // C. Le sous-répertoire de l'iteration precedente + char* DirComputePa = ComputeDirPaManagement(myCase, myIteration); + MESSAGE( ". DirComputePa = " << DirComputePa ); + + // D. Les données de l'adaptation HOMARD + // D.1. Le type de conformite + int ConfType = myCase->GetConfType(); + MESSAGE ( ". ConfType = " << ConfType ); + + // D.1. Le type externe + int ExtType = myCase->GetExtType(); + MESSAGE ( ". ExtType = " << ExtType ); + + // D.3. Le maillage de depart + const char* NomMeshParent = myIterationParent->GetMeshName(); + MESSAGE ( ". NomMeshParent = " << NomMeshParent ); + const char* MeshFileParent = myIterationParent->GetMeshFile(); + MESSAGE ( ". MeshFileParent = " << MeshFileParent ); + + // D.4. Le maillage associe a l'iteration + const char* MeshFile = myIteration->GetMeshFile(); + MESSAGE ( ". MeshFile = " << MeshFile ); + FILE *file = fopen(MeshFile,"r"); + if (file != NULL) + { + fclose(file); + if (etatMenage == 0) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + std::string text = "MeshFile : " + std::string(MeshFile) + " already exists "; + es.text = CORBA::string_dup(text.c_str()); + throw SALOME::SALOME_Exception(es); + return 4; + } + else + { + std::string commande = "rm -f " + std::string(MeshFile); + codret = system(commande.c_str()); + if (codret != 0) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "The mesh file cannot be deleted."; + throw SALOME::SALOME_Exception(es); + return 5; + } + } + } + + // D.5. Les types de raffinement et de deraffinement + // Les appels corba sont lourds, il vaut mieux les grouper + HOMARD::listeTypes* ListTypes = myHypo->GetAdapRefinUnRef(); + ASSERT(ListTypes->length() == 3); + int TypeAdap = (*ListTypes)[0]; + int TypeRaff = (*ListTypes)[1]; + int TypeDera = (*ListTypes)[2]; +// MESSAGE ( ". TypeAdap = " << TypeAdap << ", TypeRaff = " << TypeRaff << ", TypeDera = " << TypeDera ); + + // E. Texte du fichier de configuration + // E.1. Incontournables du texte + myDriver->TexteAdap(ExtType); + int iaux = 0 ; + myDriver->TexteMaillageHOMARD( DirComputePa, siter, iaux ) ; + myDriver->TexteMaillage(NomMeshParent, MeshFileParent, 0); + myDriver->TexteConfRaffDera(ConfType, TypeAdap, TypeRaff, TypeDera); + + // E.2. Ajout des informations liees aux zones eventuelles + if ( TypeAdap == 0 ) + { DriverTexteZone(myHypo, myDriver) ; } + + // E.3. Ajout des informations liees aux champs eventuels + if ( TypeAdap == 1 ) + { DriverTexteField(myIteration, myHypo, myDriver) ; } + + // E.4. Ajout des informations liees au filtrage eventuel par les groupes + HOMARD::ListGroupType* listeGroupes = myHypo->GetGroups(); + int numberOfGroups = listeGroupes->length(); + MESSAGE( ". Filtrage par " << numberOfGroups << " groupes"); + if (numberOfGroups > 0) + { + for (int NumGroup = 0; NumGroup< numberOfGroups; NumGroup++) + { + std::string GroupName = std::string((*listeGroupes)[NumGroup]); + MESSAGE( "... GroupName = " << GroupName ); + myDriver->TexteGroup(GroupName); + } + } + + // E.5. Ajout des informations liees a l'eventuelle interpolation des champs + DriverTexteFieldInterp(myIteration, myHypo, myDriver) ; + + // E.6. Ajout des options avancees + int Pyram = myCase->GetPyram(); + MESSAGE ( ". Pyram = " << Pyram ); + int NivMax = myHypo->GetNivMax(); + MESSAGE ( ". NivMax = " << NivMax ); + double DiamMin = myHypo->GetDiamMin() ; + MESSAGE ( ". DiamMin = " << DiamMin ); + int AdapInit = myHypo->GetAdapInit(); + MESSAGE ( ". AdapInit = " << AdapInit ); + int ExtraOutput = myHypo->GetExtraOutput(); + MESSAGE ( ". ExtraOutput = " << ExtraOutput ); + myDriver->TexteAdvanced(Pyram, NivMax, DiamMin, AdapInit, ExtraOutput); + + // E.7. Ajout des informations sur le deroulement de l'execution + int MessInfo = myIteration->GetInfoCompute(); + MESSAGE ( ". MessInfo = " << MessInfo ); + myDriver->TexteInfoCompute(MessInfo); + + return codret ; +} +//============================================================================= +// Calcul d'une iteration : partie spécifique au suivi de frontière CAO +//============================================================================= +CORBA::Long HOMARD_Gen_i::ComputeCAO(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOMARD_Iteration_var myIteration, CORBA::Long Option1, CORBA::Long Option2) +{ + MESSAGE ( "ComputeCAO avec Option1 = " << Option1 << ", Option2 = " << Option2 ); + + // A. Prealable + // A.1. Bases + int codret = 0; + // A.2. Le sous-répertoire de l'iteration en cours de traitement + char* DirCompute = myIteration->GetDirName(); + // A.3. Le maillage résultat de l'iteration en cours de traitement + char* MeshFile = myIteration->GetMeshFile(); + + // B. Les données pour FrontTrack + // B.1. Le maillage à modifier + const std::string theInputMedFile = MeshFile; + MESSAGE ( ". theInputMedFile = " << theInputMedFile ); + + // B.2. Le maillage après modification : fichier identique + const std::string theOutputMedFile = MeshFile ; + MESSAGE ( ". theOutputMedFile = " << theInputMedFile ); + + // B.3. La liste des fichiers contenant les numéros des noeuds à bouger + std::vector< std::string > theInputNodeFiles ; + MESSAGE ( ". DirCompute = " << DirCompute ); + int bilan ; + int icpt = 0 ; +#ifndef WIN32 + DIR *dp; + struct dirent *dirp; + dp = opendir(DirCompute); + while ( (dirp = readdir(dp)) != NULL ) + { + std::string file_name(dirp->d_name); + bilan = file_name.find("fr") ; + if ( bilan != string::npos ) + { + std::stringstream filename_total ; + filename_total << DirCompute << "/" << file_name ; + theInputNodeFiles.push_back(filename_total.str()) ; + icpt += 1 ; + } + } +#else + HANDLE hFind = INVALID_HANDLE_VALUE; + WIN32_FIND_DATA ffd; + hFind = FindFirstFile(DirNameStart, &ffd); + if (INVALID_HANDLE_VALUE != hFind) { + while (FindNextFile(hFind, &ffd) != 0) { + std::string file_name(ffd.cFileName); + bilan = file_name.find("fr") ; + if ( bilan != string::npos ) + { + std::stringstream filename_total ; + filename_total << DirCompute << "/" << file_name ; + theInputNodeFiles.push_back(filename_total.str()) ; + icpt += 1 ; + } + } + FindClose(hFind); + } +#endif + for ( int i = 0; i < icpt; i++ ) + { MESSAGE ( ". theInputNodeFiles["<< i << "] = " << theInputNodeFiles[i] ); } + + // B.4. Le fichier de la CAO + HOMARD::ListBoundaryGroupType* ListBoundaryGroupType = myCase->GetBoundaryGroup(); + std::string BoundaryName = std::string((*ListBoundaryGroupType)[0]); + MESSAGE ( ". BoundaryName = " << BoundaryName ); + HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; + const std::string theXaoFileName = myBoundary->GetDataFile(); + MESSAGE ( ". theXaoFileName = " << theXaoFileName ); + + // B.5. Parallélisme + bool theIsParallel = false; + + // C. Lancement des projections + MESSAGE ( ". Lancement des projections" ); + FrontTrack* myFrontTrack = new FrontTrack(); + myFrontTrack->track(theInputMedFile, theOutputMedFile, theInputNodeFiles, theXaoFileName, theIsParallel); + + // D. Transfert des coordonnées modifiées dans le fichier historique de HOMARD + // On lance une exécution spéciale de HOMARD en attendant de savoir le faire avec MEDCoupling + MESSAGE ( ". Transfert des coordonnées" ); + codret = ComputeCAObis(myIteration, Option1, Option2) ; + + return codret ; +} +//============================================================================= +//============================================================================= +// Transfert des coordonnées en suivi de frontière CAO +// Option1 >0 : appel depuis python +// <0 : appel depuis GUI +// Option2 : multiple de nombres premiers +// 1 : aucune option +// x2 : publication du maillage dans SMESH +//============================================================================= +CORBA::Long HOMARD_Gen_i::ComputeCAObis(HOMARD::HOMARD_Iteration_var myIteration, CORBA::Long Option1, CORBA::Long Option2) +{ + MESSAGE ( "ComputeCAObis, avec Option1 = " << Option1 << ", Option2 = " << Option2 ); + + // A. Prealable + int codret = 0; + + // A.1. Controle de la possibilite d'agir + // A.1.1. Etat de l'iteration + int etat = myIteration->GetState(); + MESSAGE ( "etat = "<GetNumber(); + std::string siterp1 ; + std::stringstream saux1 ; + saux1 << NumeIter ; + siterp1 = saux1.str() ; + if (NumeIter < 10) { siterp1 = "0" + siterp1 ; } + MESSAGE ( "siterp1 = "<GetCaseName(); + HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[CaseName]; + ASSERT(!CORBA::is_nil(myCase)); + + // A.4. Le sous-répertoire de l'iteration a traiter + char* DirCompute = myIteration->GetDirName(); + MESSAGE( ". DirCompute = " << DirCompute ); + + // C. Le fichier des messages + std::string LogFile = DirCompute ; + LogFile += "/Liste." + siterp1 + ".maj_coords.log" ; + MESSAGE (". LogFile = " << LogFile); + myIteration->SetFileInfo(LogFile.c_str()); + + // D. On passe dans le répertoire de l'iteration a calculer + MESSAGE ( ". On passe dans DirCompute = " << DirCompute ); + CHDIR(DirCompute); + + // E. Les données de l'exécution HOMARD + // E.1. L'objet du texte du fichier de configuration + HomardDriver* myDriver = new HomardDriver("", siterp1); + myDriver->TexteInit(DirCompute, LogFile, _Langue); + + // E.2. Le maillage associe a l'iteration + const char* NomMesh = myIteration->GetMeshName(); + MESSAGE ( ". NomMesh = " << NomMesh ); + const char* MeshFile = myIteration->GetMeshFile(); + MESSAGE ( ". MeshFile = " << MeshFile ); + + // E.3. Les données du traitement HOMARD + int iaux ; + myDriver->TexteMajCoords( NumeIter ) ; + iaux = 0 ; + myDriver->TexteMaillageHOMARD( DirCompute, siterp1, iaux ) ; + myDriver->TexteMaillage(NomMesh, MeshFile, 0); +// + // E.4. Ecriture du texte dans le fichier + MESSAGE ( ". Ecriture du texte dans le fichier de configuration ; codret = "<CreeFichier(); } + +// F. Execution +// + int codretexec = 1789 ; + if (codret == 0) + { + codretexec = myDriver->ExecuteHomard(Option1); + MESSAGE ( "Erreur en executant HOMARD : " << codretexec ); + } + + // G. Gestion des resultats + if (codret == 0) + { + // G.1. Le fichier des messages, dans tous les cas + const char* NomIteration = myIteration->GetName(); + std::string Commentaire = "logmaj_coords" ; + PublishFileUnderIteration(NomIteration, LogFile.c_str(), Commentaire.c_str()); + // G.2 Message d'erreur + if (codretexec != 0) + { + std::string text = "\n\nSee the file " + LogFile + "\n" ; + INFOS ( text ) ; + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = CORBA::string_dup(text.c_str()); + throw SALOME::SALOME_Exception(es); + + // On force le succes pour pouvoir consulter le fichier log + codretexec = 0 ; + } + } + + // H. Menage et retour dans le répertoire du cas + if (codret == 0) { delete myDriver; } + + return codret ; +} +//============================================================================= +// Creation d'un nom de sous-répertoire pour l'iteration au sein d'un répertoire parent +// nomrep : nom du répertoire parent +// num : le nom du sous-répertoire est sous la forme 'In', n est >= num +//============================================================================= +char* HOMARD_Gen_i::CreateDirNameIter(const char* nomrep, CORBA::Long num ) +{ + MESSAGE ( "CreateDirNameIter : nomrep ="<< nomrep << ", num = "<d_name); +#else + HANDLE hFind = INVALID_HANDLE_VALUE; + WIN32_FIND_DATA ffd; + hFind = FindFirstFile(nomrep, &ffd); + if (INVALID_HANDLE_VALUE != hFind) { + while (FindNextFile(hFind, &ffd) != 0) { + if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories + std::string file_name(ffd.cFileName); +#endif + if ( file_name == DirNameA.str() ) { existe = true ; } + } +#ifndef WIN32 + closedir(dp); +#else + FindClose(hFind); +#endif + if ( !existe ) + { + DirName = DirNameA.str() ; + a_chercher = false ; + break ; + } + } + num += 1; + } + + MESSAGE ( "==> DirName = " << DirName); + MESSAGE ( ". On retourne dans nomDirActuel = " << nomDirActuel ); + CHDIR(nomDirActuel.c_str()); + return CORBA::string_dup( DirName.c_str() ); +} +//============================================================================= +// Calcul d'une iteration : gestion du répertoire de calcul +// Si le sous-répertoire existe : +// etatMenage = 0 : on sort en erreur si le répertoire n'est pas vide +// etatMenage = 1 : on fait le menage du répertoire +// etatMenage = -1 : on ne fait rien +//============================================================================= +char* HOMARD_Gen_i::ComputeDirManagement(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOMARD_Iteration_var myIteration, CORBA::Long etatMenage) +{ + MESSAGE ( "ComputeDirManagement : répertoires pour le calcul" ); + // B.2. Le répertoire du cas + const char* nomDirCase = myCase->GetDirName(); + MESSAGE ( ". nomDirCase = " << nomDirCase ); + + // B.3. Le sous-répertoire de l'iteration a calculer, puis le répertoire complet a creer + // B.3.1. Le nom du sous-répertoire + const char* nomDirIt = myIteration->GetDirNameLoc(); + + // B.3.2. Le nom complet du sous-répertoire + std::stringstream DirCompute ; + DirCompute << nomDirCase << "/" << nomDirIt; + MESSAGE (". DirCompute = " << DirCompute.str() ); + + // B.3.3. Si le sous-répertoire n'existe pas, on le cree + if (CHDIR(DirCompute.str().c_str()) != 0) + { +#ifndef WIN32 + if (mkdir(DirCompute.str().c_str(), S_IRWXU|S_IRGRP|S_IXGRP) != 0) +#else + if (_mkdir(DirCompute.str().c_str()) != 0) +#endif + { + // GERALD -- QMESSAGE BOX + std::cerr << "Pb Creation du répertoire DirCompute = " << DirCompute.str() << std::endl; + VERIFICATION("Pb a la creation du répertoire" == 0); + } + } + else + { +// Le répertoire existe +// On demande de faire le menage de son contenu : + if (etatMenage == 1) + { + MESSAGE (". Menage du répertoire DirCompute = " << DirCompute.str()); + std::string commande = "rm -rf " + DirCompute.str()+"/*" ; + int codret = system(commande.c_str()); + if (codret != 0) + { + // GERALD -- QMESSAGE BOX + std::cerr << ". Menage du répertoire de calcul" << DirCompute.str() << std::endl; + VERIFICATION("Pb au menage du répertoire de calcul" == 0); + } + } +// On n'a pas demande de faire le menage de son contenu : on sort en erreur : + else + { + if (etatMenage == 0) + { +#ifndef WIN32 + DIR *dp; + struct dirent *dirp; + dp = opendir(DirCompute.str().c_str()); + bool result = true; + while ((dirp = readdir(dp)) != NULL && result ) + { + std::string file_name(dirp->d_name); + result = file_name.empty() || file_name == "." || file_name == ".."; //if any file - break and return false + } + closedir(dp); +#else + HANDLE hFind = INVALID_HANDLE_VALUE; + WIN32_FIND_DATA ffd; + hFind = FindFirstFile(DirCompute.str().c_str(), &ffd); + bool result = true; + if (INVALID_HANDLE_VALUE != hFind) { + while (FindNextFile(hFind, &ffd) != 0) { + if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories + std::string file_name(ffd.cFileName); + result = file_name.empty() || file_name == "." || file_name == ".."; //if any file - break and return false + } + } + FindClose(hFind); +#endif + if ( result == false) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + std::string text = "Directory : " + DirCompute.str() + " is not empty"; + es.text = CORBA::string_dup(text.c_str()); + throw SALOME::SALOME_Exception(es); + VERIFICATION("Directory is not empty" == 0); + } + } + } + } + + return CORBA::string_dup( DirCompute.str().c_str() ); +} +//============================================================================= +// Calcul d'une iteration : gestion du répertoire de calcul de l'iteration parent +//============================================================================= +char* HOMARD_Gen_i::ComputeDirPaManagement(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOMARD_Iteration_var myIteration) +{ + MESSAGE ( "ComputeDirPaManagement : répertoires pour le calcul" ); + // Le répertoire du cas + const char* nomDirCase = myCase->GetDirName(); + MESSAGE ( ". nomDirCase = " << nomDirCase ); + + // Le sous-répertoire de l'iteration precedente + + const char* nomIterationParent = myIteration->GetIterParentName(); + HOMARD::HOMARD_Iteration_var myIterationParent = myStudyContext._mesIterations[nomIterationParent]; + const char* nomDirItPa = myIterationParent->GetDirNameLoc(); + std::stringstream DirComputePa ; + DirComputePa << nomDirCase << "/" << nomDirItPa; + MESSAGE( ". nomDirItPa = " << nomDirItPa); + MESSAGE( ". DirComputePa = " << DirComputePa.str() ); + + return CORBA::string_dup( DirComputePa.str().c_str() ); +} +//============================================================================= +// Calcul d'une iteration : ecriture des zones dans le fichier de configuration +//============================================================================= +void HOMARD_Gen_i::DriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver) +{ + MESSAGE ( "... DriverTexteZone" ); + HOMARD::listeZonesHypo* ListZone = myHypo->GetZones(); + int numberOfZonesx2 = ListZone->length(); + int NumZone ; + + for (int iaux = 0; iaux< numberOfZonesx2; iaux++) + { + std::string ZoneName = std::string((*ListZone)[iaux]); + MESSAGE ( "... ZoneName = " << ZoneName); + HOMARD::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName]; + ASSERT(!CORBA::is_nil(myZone)); + + int ZoneType = myZone->GetType(); + std::string TypeUsestr = std::string((*ListZone)[iaux+1]); + int TypeUse = atoi( TypeUsestr.c_str() ); + MESSAGE ( "... ZoneType = " << ZoneType << ", TypeUse = "<GetCoords(); + if ( ZoneType == 2 || ( ZoneType>=11 && ZoneType <=13 ) ) // Cas d un parallelepipede ou d'un rectangle + { myDriver->TexteZone(NumZone, ZoneType, TypeUse, (*zone)[0], (*zone)[1], (*zone)[2], (*zone)[3], (*zone)[4], (*zone)[5], 0., 0., 0.); } + else if ( ZoneType == 4 ) // Cas d une sphere + { myDriver->TexteZone(NumZone, ZoneType, TypeUse, (*zone)[0], (*zone)[1], (*zone)[2], (*zone)[3], 0., 0., 0., 0., 0.); } + else if ( ZoneType == 5 || ( ZoneType>=31 && ZoneType <=33 ) ) // Cas d un cylindre ou d'un disque + { myDriver->TexteZone(NumZone, ZoneType, TypeUse, (*zone)[0], (*zone)[1], (*zone)[2], (*zone)[3], (*zone)[4], (*zone)[5], (*zone)[6], (*zone)[7], 0.); } + else if ( ZoneType == 7 || ( ZoneType>=61 && ZoneType <=63 ) ) // Cas d un tuyau ou disque perce + { myDriver->TexteZone(NumZone, ZoneType, TypeUse, (*zone)[0], (*zone)[1], (*zone)[2], (*zone)[3], (*zone)[4], (*zone)[5], (*zone)[6], (*zone)[7], (*zone)[8]); } + else { VERIFICATION("ZoneType est incorrect." == 0) ; } + iaux += 1 ; + } + return ; +} +//============================================================================= +// Calcul d'une iteration : ecriture des champs dans le fichier de configuration +//============================================================================= +void HOMARD_Gen_i::DriverTexteField(HOMARD::HOMARD_Iteration_var myIteration, HOMARD::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver) +{ + MESSAGE ( "... DriverTexteField" ); +// Le fichier du champ + char* FieldFile = myIteration->GetFieldFile(); + MESSAGE ( ". FieldFile = " << FieldFile ); + if (strlen(FieldFile) == 0) + { + // GERALD -- QMESSAGE BOX + std::cerr << "Le fichier du champ n'a pas ete fourni." << std::endl; + VERIFICATION("The file for the field is not given." == 0); + } +// Les caracteristiques d'instants du champ de pilotage + int TimeStep = myIteration->GetTimeStep(); + MESSAGE( ". TimeStep = " << TimeStep ); + int Rank = myIteration->GetRank(); + MESSAGE( ". Rank = " << Rank ); +// Les informations sur les champs + HOMARD::InfosHypo* aInfosHypo = myHypo->GetField(); +// Le nom + const char* FieldName = aInfosHypo->FieldName; +// Les seuils + int TypeThR = aInfosHypo->TypeThR; + double ThreshR = aInfosHypo->ThreshR; + int TypeThC = aInfosHypo->TypeThC; + double ThreshC = aInfosHypo->ThreshC; +// Saut entre mailles ou non ? + int UsField = aInfosHypo->UsField; + MESSAGE( ". UsField = " << UsField ); +// L'usage des composantes + int UsCmpI = aInfosHypo->UsCmpI; + MESSAGE( ". UsCmpI = " << UsCmpI ); +// + myDriver->TexteField(FieldName, FieldFile, TimeStep, Rank, TypeThR, ThreshR, TypeThC, ThreshC, UsField, UsCmpI); +// +// Les composantes + HOMARD::listeComposantsHypo* mescompo = myHypo->GetComps(); + int numberOfCompos = mescompo->length(); + MESSAGE( ". numberOfCompos = " << numberOfCompos ); + for (int NumeComp = 0; NumeComp< numberOfCompos; NumeComp++) + { + std::string nomCompo = std::string((*mescompo)[NumeComp]); + MESSAGE( "... nomCompo = " << nomCompo ); + myDriver->TexteCompo(NumeComp, nomCompo); + } + return ; +} +//============================================================================= +// Calcul d'une iteration : ecriture des frontieres dans le fichier de configuration +// On ecrit dans l'ordre : +// 1. la definition des frontieres +// 2. les liens avec les groupes +// 3. un entier resumant le type de comportement pour les frontieres +//============================================================================= +int HOMARD_Gen_i::DriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, HomardDriver* myDriver) +{ + MESSAGE ( "... DriverTexteBoundary" ); + // 1. Recuperation des frontieres + std::list ListeBoundaryTraitees ; + HOMARD::ListBoundaryGroupType* ListBoundaryGroupType = myCase->GetBoundaryGroup(); + int numberOfitems = ListBoundaryGroupType->length(); + MESSAGE ( "... number of string for Boundary+Group = " << numberOfitems); + int BoundaryOption = 1 ; + // 2. Parcours des frontieres pour ecrire leur description + int NumBoundaryAnalytical = 0 ; + for (int NumBoundary = 0; NumBoundary< numberOfitems; NumBoundary=NumBoundary+2) + { + std::string BoundaryName = std::string((*ListBoundaryGroupType)[NumBoundary]); + MESSAGE ( "... BoundaryName = " << BoundaryName); + // 2.1. La frontiere a-t-elle deja ete ecrite ? + // Cela arrive quand elle est liee a plusieurs groupes. Il ne faut l'ecrire que la premiere fois + int A_faire = 1 ; + std::list::const_iterator it = ListeBoundaryTraitees.begin(); + while (it != ListeBoundaryTraitees.end()) + { + MESSAGE ( "..... BoundaryNameTraitee = " << *it); + if ( BoundaryName == *it ) { A_faire = 0 ; } + it++; + } + // 2.2. Ecriture de la frontiere + if ( A_faire == 1 ) + { + // 2.2.1. Caracteristiques de la frontiere + HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; + ASSERT(!CORBA::is_nil(myBoundary)); + int BoundaryType = myBoundary->GetType(); + MESSAGE ( "... BoundaryType = " << BoundaryType ); + // 2.2.2. Ecriture selon le type + // 2.2.2.1. Cas d une frontiere CAO + if (BoundaryType == -1) + { +// const char* CAOFile = myBoundary->GetDataFile() ; +// MESSAGE ( ". CAOFile = " << CAOFile ); + if ( BoundaryOption % 5 != 0 ) { BoundaryOption = BoundaryOption*5 ; } + } + // 2.2.2.2. Cas d une frontiere discrete + else if (BoundaryType == 0) + { + const char* MeshName = myBoundary->GetMeshName() ; + MESSAGE ( ". MeshName = " << MeshName ); + const char* MeshFile = myBoundary->GetDataFile() ; + MESSAGE ( ". MeshFile = " << MeshFile ); + myDriver->TexteBoundaryDi( MeshName, MeshFile); + if ( BoundaryOption % 2 != 0 ) { BoundaryOption = BoundaryOption*2 ; } + } + // 2.2.2.3. Cas d une frontiere analytique + else + { + NumBoundaryAnalytical++ ; + HOMARD::double_array* coor = myBoundary->GetCoords(); + if (BoundaryType == 1) // Cas d un cylindre + { + myDriver->TexteBoundaryAn(BoundaryName, NumBoundaryAnalytical, BoundaryType, (*coor)[0], (*coor)[1], (*coor)[2], (*coor)[3], (*coor)[4], (*coor)[5], (*coor)[6], 0.); + if ( BoundaryOption % 3 != 0 ) { BoundaryOption = BoundaryOption*3 ; } + } + else if (BoundaryType == 2) // Cas d une sphere + { + myDriver->TexteBoundaryAn(BoundaryName, NumBoundaryAnalytical, BoundaryType, (*coor)[0], (*coor)[1], (*coor)[2], (*coor)[3], 0., 0., 0., 0.); + if ( BoundaryOption % 3 != 0 ) { BoundaryOption = BoundaryOption*3 ; } + } + else if (BoundaryType == 3) // Cas d un cone defini par un axe et un angle + { + myDriver->TexteBoundaryAn(BoundaryName, NumBoundaryAnalytical, BoundaryType, (*coor)[0], (*coor)[1], (*coor)[2], (*coor)[3], (*coor)[4], (*coor)[5], (*coor)[6], 0.); + if ( BoundaryOption % 3 != 0 ) { BoundaryOption = BoundaryOption*3 ; } + } + else if (BoundaryType == 4) // Cas d un cone defini par les 2 rayons + { + myDriver->TexteBoundaryAn(BoundaryName, NumBoundaryAnalytical, BoundaryType, (*coor)[0], (*coor)[1], (*coor)[2], (*coor)[3], (*coor)[4], (*coor)[5], (*coor)[6], (*coor)[7]); + if ( BoundaryOption % 3 != 0 ) { BoundaryOption = BoundaryOption*3 ; } + } + else if (BoundaryType == 5) // Cas d un tore + { + myDriver->TexteBoundaryAn(BoundaryName, NumBoundaryAnalytical, BoundaryType, (*coor)[0], (*coor)[1], (*coor)[2], (*coor)[3], (*coor)[4], (*coor)[5], (*coor)[6], (*coor)[7]); + if ( BoundaryOption % 3 != 0 ) { BoundaryOption = BoundaryOption*3 ; } + } + } + // 2.2.3. Memorisation du traitement + ListeBoundaryTraitees.push_back( BoundaryName ); + } + } + // 3. Parcours des frontieres pour ecrire les liens avec les groupes + NumBoundaryAnalytical = 0 ; + for (int NumBoundary = 0; NumBoundary< numberOfitems; NumBoundary=NumBoundary+2) + { + std::string BoundaryName = std::string((*ListBoundaryGroupType)[NumBoundary]); + MESSAGE ( "... BoundaryName = " << BoundaryName); + HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; + ASSERT(!CORBA::is_nil(myBoundary)); + int BoundaryType = myBoundary->GetType(); + MESSAGE ( "... BoundaryType = " << BoundaryType ); + // 3.1. Recuperation du nom du groupe + std::string GroupName = std::string((*ListBoundaryGroupType)[NumBoundary+1]); + MESSAGE ( "... GroupName = " << GroupName); + // 3.2. Cas d une frontiere CAO + if ( BoundaryType == -1 ) + { + if ( GroupName.size() > 0 ) { myDriver->TexteBoundaryCAOGr ( GroupName ) ; } + } + // 3.3. Cas d une frontiere discrete + else if ( BoundaryType == 0 ) + { + if ( GroupName.size() > 0 ) { myDriver->TexteBoundaryDiGr ( GroupName ) ; } + } + // 3.4. Cas d une frontiere analytique + else + { + NumBoundaryAnalytical++ ; + myDriver->TexteBoundaryAnGr ( BoundaryName, NumBoundaryAnalytical, GroupName ) ; + } + } + // 4. Ecriture de l'option finale + myDriver->TexteBoundaryOption(BoundaryOption); +// + return BoundaryOption ; +} +//============================================================================= +// Calcul d'une iteration : ecriture des interpolations dans le fichier de configuration +//============================================================================= +void HOMARD_Gen_i::DriverTexteFieldInterp(HOMARD::HOMARD_Iteration_var myIteration, HOMARD::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver) +{ + MESSAGE ( "... DriverTexteFieldInterp" ); + int TypeFieldInterp = myHypo->GetTypeFieldInterp(); + MESSAGE ( "... TypeFieldInterp = " << TypeFieldInterp); + if (TypeFieldInterp != 0) + { +// Le fichier des champs + char* FieldFile = myIteration->GetFieldFile(); + MESSAGE ( ". FieldFile = " << FieldFile ); + if (strlen(FieldFile) == 0) + { + // GERALD -- QMESSAGE BOX + VERIFICATION("The file for the field is not given." == 0); + } + // + const char* MeshFile = myIteration->GetMeshFile(); + myDriver->TexteFieldInterp(FieldFile, MeshFile); + + // Les champs + // Interpolation de tous les champs + if ( TypeFieldInterp == 1 ) + { + myDriver->TexteFieldInterpAll(); + } + // Interpolation de certains champs + else if (TypeFieldInterp == 2) + { + // Les champs et leurs instants pour l'iteration + HOMARD::listeFieldInterpTSRsIter* ListFieldTSR = myIteration->GetFieldInterpsTimeStepRank(); + int numberOfFieldsx3 = ListFieldTSR->length(); + MESSAGE( ". pour iteration, numberOfFields = " << numberOfFieldsx3/3 ); + // Les champs pour l'hypothese + HOMARD::listeFieldInterpsHypo* ListField = myHypo->GetFieldInterps(); + int numberOfFieldsx2 = ListField->length(); + MESSAGE( ". pour hypothese, numberOfFields = " << numberOfFieldsx2/2 ); + // On parcourt tous les champs de l'hypothese + int NumField = 0 ; + for (int iaux = 0; iaux< numberOfFieldsx2; iaux++) + { + // Le nom du champ + std::string FieldName = std::string((*ListField)[iaux]) ; + // Le type d'interpolation + std::string TypeInterpstr = std::string((*ListField)[iaux+1]) ; + MESSAGE( "... FieldName = " << FieldName << ", TypeInterp = " << TypeInterpstr ); + // On cherche ?? savoir si des instants ont ??t?? pr??cis??s pour cette it??ration + int tsrvu = 0; + for (int jaux = 0; jaux< numberOfFieldsx3; jaux++) + { + // Le nom du champ + std::string FieldName2 = std::string((*ListFieldTSR)[jaux]) ; + MESSAGE( "..... FieldName2 = " << FieldName2 ); + // Quand c'est le bon champ, on ecrit le pas de temps + if ( FieldName == FieldName2 ) + { + tsrvu = 1 ; + // Le pas de temps + std::string TimeStepstr = std::string((*ListFieldTSR)[jaux+1]) ; + // Le numero d'ordre + std::string Rankstr = std::string((*ListFieldTSR)[jaux+2]) ; + MESSAGE( "..... TimeStepstr = " << TimeStepstr <<", Rankstr = "<TexteFieldInterpNameType(NumField, FieldName, TypeInterpstr, TimeStep, Rank); + } + jaux += 2 ; + } + // Si aucun instant n'a été défini + if ( tsrvu == 0 ) + { + NumField += 1 ; + myDriver->TexteFieldInterpNameType(NumField, FieldName, TypeInterpstr, -1, -1); + } + iaux++ ; + } + } + } + return ; +} +//=========================================================================== +//=========================================================================== + + +//=========================================================================== +//=========================================================================== +// Publications +//=========================================================================== +//=========================================================================== +SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr theSObject, + CORBA::Object_ptr theObject, + const char* theName) +{ + MESSAGE("PublishInStudy pour " << theName); + SALOMEDS::SObject_var aResultSO; + if (CORBA::is_nil(myStudy)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid study context"; + throw SALOME::SALOME_Exception(es); + return 0; + }; + +// Recuperation de l'objet correspondant, en essayant chacun des types possibles +// Rq : Iteration est publiee ailleurs + HOMARD::HOMARD_Boundary_var aBoundary = HOMARD::HOMARD_Boundary::_narrow(theObject); + HOMARD::HOMARD_Cas_var aCase = HOMARD::HOMARD_Cas::_narrow(theObject); + HOMARD::HOMARD_Hypothesis_var aHypo = HOMARD::HOMARD_Hypothesis::_narrow(theObject); + HOMARD::HOMARD_YACS_var aYACS = HOMARD::HOMARD_YACS::_narrow(theObject); + HOMARD::HOMARD_Zone_var aZone = HOMARD::HOMARD_Zone::_narrow(theObject); + + UpdateStudy(); + +// Controle de la non publication d'un objet de meme nom + if ( (!aBoundary->_is_nil()) || (!aHypo->_is_nil()) || (!aYACS->_is_nil()) || (!aZone->_is_nil()) ) + { + SALOMEDS::Study::ListOfSObject_var listSO = myStudy->FindObjectByName(theName, ComponentDataType()); + if (listSO->length() >= 1) + { + MESSAGE("This name "<length()<<" time(s)"); + aResultSO = listSO[0]; + return aResultSO._retn(); + } + } + + // Caracteristiques de l'etude + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); + aStudyBuilder->NewCommand(); + if(!aBoundary->_is_nil()) + aResultSO = PublishBoundaryInStudy(aStudyBuilder, aBoundary, theName); + else if(!aCase->_is_nil()) + aResultSO = PublishCaseInStudy(aStudyBuilder, aCase, theName); + else if(!aHypo->_is_nil()) + aResultSO = PublishHypotheseInStudy(aStudyBuilder, aHypo, theName); + else if(!aYACS->_is_nil()) + aResultSO = PublishYACSInStudy(aStudyBuilder, aYACS, theName); + else if(!aZone->_is_nil()) + aResultSO = PublishZoneInStudy(aStudyBuilder, aZone, theName); + + aStudyBuilder->CommitCommand(); + + return aResultSO._retn(); +}; +//============================================================================= +SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishBoundaryInStudy( SALOMEDS::StudyBuilder_var aStudyBuilder, + HOMARD::HOMARD_Boundary_ptr theObject, const char* theName) +{ + MESSAGE("PublishBoundaryStudy pour "<FindComponent(ComponentDataType()); + if (theFatherHomard->_is_nil()) + { + MESSAGE("theFatherHomard->_is_nil()"); + return aResultSO._retn(); + } + + // On ajoute la categorie des boundarys dans l etude si necessaire + if ( _tag_boun == 0 ) + { + _tag_gene += 1 ; + _tag_boun = _tag_gene ; + } + MESSAGE("PublishBoundaryInStudy _tag_gene = "<<_tag_gene << ", _tag_boun = "<<_tag_boun ); + SALOMEDS::SObject_var aSObject; + if (!theFatherHomard->FindSubObject(_tag_boun, aSObject)) + { + MESSAGE("Ajout de la categorie des boundarys"); + aSObject = aStudyBuilder->NewObjectToTag(theFatherHomard, _tag_boun); + PublishInStudyAttr(aStudyBuilder, aSObject, "Boundaries", "BoundList", "zone_icone_2.png", NULL ) ; + } + else { MESSAGE("La categorie des boundarys existe deja."); } + + CORBA::Long BoundaryType = myBoundary->GetType(); +// MESSAGE("BoundaryType : "<NewObject(aSObject); + PublishInStudyAttr(aStudyBuilder, aResultSO, theName, value.c_str(), icone.c_str(), _orb->object_to_string(theObject)); + return aResultSO._retn(); +} +//============================================================================= +SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishCaseInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, + HOMARD::HOMARD_Cas_ptr theObject, const char* theName) +{ + MESSAGE("PublishCaseInStudy pour "<_is_nil()"); + return aResultSO._retn(); + } + if (myStudy->_is_nil()) { + MESSAGE("HOMARD_Gen_i::myStudy->_is_nil()"); + return aResultSO._retn(); + } + + // On recupere le module pere dans l etude + SALOMEDS::SComponent_var theFatherHomard = myStudy->FindComponent(ComponentDataType()); + if (theFatherHomard->_is_nil()) + { + MESSAGE("theFatherHomard->_is_nil()"); + return aResultSO._retn(); + } + + _tag_gene += 1 ; + MESSAGE("PublishCaseInStudy _tag_gene = "<<_tag_gene ); + aResultSO = aStudyBuilder->NewObject(theFatherHomard); + PublishInStudyAttr(aStudyBuilder, aResultSO, theName, "CasHomard", "cas_calcule.png", + _orb->object_to_string(theObject) ) ; + + return aResultSO._retn(); +} +//============================================================================= +SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishHypotheseInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, + HOMARD::HOMARD_Hypothesis_ptr theObject, const char* theName) +{ + MESSAGE("PublishHypotheseInStudy pour "<FindComponent(ComponentDataType()); + if (theFatherHomard->_is_nil()) + { + MESSAGE("theFatherHomard->_is_nil()"); + return aResultSO._retn(); + } + + // On ajoute la categorie des hypotheses dans l etude si necessaire + SALOMEDS::SObject_var aSObject; + if ( _tag_hypo == 0 ) + { + _tag_gene += 1 ; + _tag_hypo = _tag_gene ; + } + MESSAGE("PublishHypotheseInStudy _tag_gene = "<<_tag_gene << ", _tag_hypo = "<<_tag_hypo ); + if (!theFatherHomard->FindSubObject(_tag_hypo, aSObject)) + { + MESSAGE("Ajout de la categorie des hypotheses"); + aSObject = aStudyBuilder->NewObjectToTag(theFatherHomard, _tag_hypo); + PublishInStudyAttr(aStudyBuilder, aSObject, "Hypothesis", "HypoList", "hypotheses.png", NULL); + } + else { MESSAGE("La categorie des hypotheses existe deja."); } + +// Creation du resultat dans l'etude + aResultSO = aStudyBuilder->NewObject(aSObject); + PublishInStudyAttr(aStudyBuilder, aResultSO, theName, "HypoHomard", NULL, _orb->object_to_string(theObject) ) ; + + return aResultSO._retn(); +} +//============================================================================= +SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishYACSInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, + HOMARD::HOMARD_YACS_ptr theObject, const char* theName) +{ + MESSAGE("PublishYACSInStudy pour "<FindComponent(ComponentDataType()); + if (theFatherHomard->_is_nil()) + { + MESSAGE("theFatherHomard->_is_nil()"); + return aResultSO._retn(); + } + // On ajoute la categorie des schemas YACS dans l etude si necessaire + if ( _tag_yacs == 0 ) + { + _tag_gene += 1 ; + _tag_yacs = _tag_gene ; + } + MESSAGE("PublishZoneStudy _tag_gene = "<<_tag_gene << ", _tag_yacs = "<<_tag_yacs ); + SALOMEDS::SObject_var aSObject; + if (!theFatherHomard->FindSubObject(_tag_yacs, aSObject)) + { + MESSAGE("Ajout de la categorie des schemas YACS"); + aSObject = aStudyBuilder->NewObjectToTag(theFatherHomard, _tag_yacs); + PublishInStudyAttr(aStudyBuilder, aSObject, "YACS", "YACSList", "full_view.png", NULL); + } + else { MESSAGE("La categorie des schemas YACS existe deja."); } + +// Creation du resultat dans l'etude + aResultSO = aStudyBuilder->NewObject(aSObject); + PublishInStudyAttr(aStudyBuilder, aResultSO, theName, "YACSHomard", "schema.png", _orb->object_to_string(theObject) ) ; + + return aResultSO._retn(); +} + +//============================================================================= +SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishZoneInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, + HOMARD::HOMARD_Zone_ptr theObject, const char* theName) +{ + MESSAGE("PublishZoneStudy pour "<_is_nil()"); + return aResultSO._retn(); + } + if (myStudy->_is_nil()) + { + MESSAGE("PublishZoneInStudy : myStudy->_is_nil()"); + return aResultSO._retn(); + } + SALOMEDS::SComponent_var theFatherHomard = myStudy->FindComponent(ComponentDataType()); + if (theFatherHomard->_is_nil()) + { + MESSAGE("PublishZoneInStudy : theFatherHomard->_is_nil()"); + return aResultSO._retn(); + } + + // Caracteristique de la zone + HOMARD::HOMARD_Zone_var myZone = myStudyContext._mesZones[theName]; + CORBA::Long ZoneType = myZone->GetType(); + + // On ajoute la categorie des zones dans l etude si necessaire + if ( _tag_zone == 0 ) + { + _tag_gene += 1 ; + _tag_zone = _tag_gene ; + } + MESSAGE("PublishZoneStudy _tag_gene = "<<_tag_gene << ", _tag_zone = "<<_tag_zone ); + SALOMEDS::SObject_var aSObject; + if (!theFatherHomard->FindSubObject(_tag_zone, aSObject)) + { + MESSAGE("Ajout de la categorie des zones"); + aSObject = aStudyBuilder->NewObjectToTag(theFatherHomard, _tag_zone); + PublishInStudyAttr(aStudyBuilder, aSObject, "Zones", "ZoneList", "zone_icone_2.png", NULL ) ; + } + else { MESSAGE("La categorie des zones existe deja."); } + + aResultSO = aStudyBuilder->NewObject(aSObject); + std::string icone ; + switch (ZoneType) + { + case 11 : + { } + case 12 : + { } + case 13 : + { icone = "boxdxy_2.png" ; + break ; + } + case 2 : + { icone = "boxdxyz_2.png" ; + break ; + } + case 31 : + { } + case 32 : + { } + case 33 : + { icone = "disk_2.png" ; + break ; + } + case 4 : + { icone = "spherepoint_2.png" ; + break ; + } + case 5 : + { icone = "cylinderpointvector_2.png" ; + break ; + } + case 61 : + { } + case 62 : + { } + case 63 : + { icone = "diskwithhole_2.png" ; + break ; + } + case 7 : + { icone = "pipe_2.png" ; + break ; + } + } + PublishInStudyAttr(aStudyBuilder, aResultSO, theName, "ZoneHomard", icone.c_str(), _orb->object_to_string(theObject) ) ; + + return aResultSO._retn(); +} +//=========================================================================== +void HOMARD_Gen_i::PublishInStudyAttr(SALOMEDS::StudyBuilder_var aStudyBuilder, + SALOMEDS::SObject_var aResultSO, + const char* name, const char* comment, const char* icone, const char* ior) +{ + MESSAGE("PublishInStudyAttr pour name = "<SetValue(name); + } + +// Ajout du commentaire + if ( comment != NULL ) + { + anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeComment"); + SALOMEDS::AttributeComment_var aCommentAttrib = SALOMEDS::AttributeComment::_narrow(anAttr); + aCommentAttrib->SetValue(comment); + } + +// Ajout de l'icone + if ( icone != NULL ) + { + anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributePixMap"); + SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); + aPixmap->SetPixMap(icone); + } + +// Ajout de l ior + if ( ior != NULL ) + { + anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeIOR"); + SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); + anIOR->SetValue(ior); + } +}; + +//===================================================================================== +void HOMARD_Gen_i::PublishBoundaryUnderCase(const char* CaseName, const char* BoundaryName) +{ + MESSAGE ( "PublishBoundaryUnderCase : CaseName = " << CaseName << ", BoundaryName= " << BoundaryName ); + + HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[CaseName]; + ASSERT(!CORBA::is_nil(myCase)); + SALOMEDS::SObject_var aCaseSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myCase))); + ASSERT(!CORBA::is_nil(aCaseSO)); + + HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; + ASSERT(!CORBA::is_nil(myBoundary)); + SALOMEDS::SObject_var aBoundarySO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myBoundary))); + ASSERT(!CORBA::is_nil(aBoundarySO)); + + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); + + aStudyBuilder->NewCommand(); + + SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aCaseSO); + aStudyBuilder->Addreference(aSubSO, aBoundarySO); +// aStudyBuilder->RemoveReference(aSubSO); + + aStudyBuilder->CommitCommand(); + +}; +//===================================================================================== +void HOMARD_Gen_i::PublishCaseUnderYACS(const char* nomYACS, const char* CaseName) +{ + MESSAGE ( "PublishCaseUnderYACS : nomYACS = " << nomYACS << ", CaseName= " << CaseName ); + + HOMARD::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; + ASSERT(!CORBA::is_nil(myYACS)); + SALOMEDS::SObject_var aYACSSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myYACS))); + ASSERT(!CORBA::is_nil(aYACSSO)); + + HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[CaseName]; + ASSERT(!CORBA::is_nil(myCase)); + SALOMEDS::SObject_var aCaseSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myCase))); + ASSERT(!CORBA::is_nil(aCaseSO)); + + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); + + aStudyBuilder->NewCommand(); + + SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aYACSSO); + aStudyBuilder->Addreference(aSubSO, aCaseSO); + + aStudyBuilder->CommitCommand(); + +}; +//============================================================================= +void HOMARD_Gen_i::PublishResultInSmesh(const char* NomFich, CORBA::Long Option) +// Option = 0 : fichier issu d'une importation +// Option = 1 : fichier issu d'une execution HOMARD +{ + MESSAGE( "PublishResultInSmesh " << NomFich << ", avec Option = " << Option); + if (CORBA::is_nil(myStudy)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid study context"; + throw SALOME::SALOME_Exception(es); + return ; + }; + +// Le module SMESH est-il actif ? + SALOMEDS::SObject_var aSmeshSO = myStudy->FindComponent("SMESH"); +// + if (!CORBA::is_nil(aSmeshSO)) + { +// On verifie que le fichier n est pas deja publie + SALOMEDS::ChildIterator_var aIter = myStudy->NewChildIterator(aSmeshSO); + for (; aIter->More(); aIter->Next()) + { + SALOMEDS::SObject_var aSO = aIter->Value(); + SALOMEDS::GenericAttribute_var aGAttr; + if (aSO->FindAttribute(aGAttr,"AttributeExternalFileDef")) + { + SALOMEDS::AttributeExternalFileDef_var anAttr = SALOMEDS::AttributeExternalFileDef::_narrow(aGAttr); + CORBA::String_var value=anAttr->Value(); + if (strcmp((const char*)value,NomFich) == 0) + { + MESSAGE ( "PublishResultInSmesh : le fichier " << NomFich << " est deja publie." ); + // Pour un fichier importe, on ne republie pas + if ( Option == 0 ) { return; } + // Pour un fichier calcule, on commence par faire la depublication + else + { + MESSAGE ( "PublishResultInSmesh : depublication" ); + SALOMEDS::AttributeName_var anAttr2 = SALOMEDS::AttributeName::_narrow(aGAttr); + CORBA::String_var value2=anAttr2->Value(); + std::string MeshName = string(value2) ; + MESSAGE ( "PublishResultInSmesh : depublication de " << MeshName ); + DeleteResultInSmesh(NomFich, MeshName) ; + } + } + } + } + } + +// On enregistre le fichier + MESSAGE( "Enregistrement du fichier"); + SALOME_LifeCycleCORBA* myLCC = new SALOME_LifeCycleCORBA(_NS); + SMESH::SMESH_Gen_var aSmeshEngine = SMESH::SMESH_Gen::_narrow(myLCC->FindOrLoad_Component("FactoryServer","SMESH")); + ASSERT(!CORBA::is_nil(aSmeshEngine)); + aSmeshEngine->UpdateStudy(); + SMESH::DriverMED_ReadStatus theStatus; + //aSmeshEngine->CreateMeshesFromMED(NomFich, theStatus); + +// On met a jour les attributs AttributeExternalFileDef et AttributePixMap + SMESH::mesh_array* mesMaillages=aSmeshEngine->CreateMeshesFromMED(NomFich, theStatus); + for (int i = 0; i < mesMaillages->length(); i++) + { + MESSAGE( ". Mise a jour des attributs du maillage"); + SMESH::SMESH_Mesh_var monMaillage= (*mesMaillages)[i]; + SALOMEDS::SObject_var aSO=SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(monMaillage))); + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); + SALOMEDS::GenericAttribute_var aGAttr = aStudyBuilder->FindOrCreateAttribute(aSO, "AttributeExternalFileDef"); + SALOMEDS::AttributeExternalFileDef_var anAttr = SALOMEDS::AttributeExternalFileDef::_narrow(aGAttr); + anAttr->SetValue(NomFich); + SALOMEDS::GenericAttribute_var aPixMap = aStudyBuilder->FindOrCreateAttribute(aSO, "AttributePixMap" ); + SALOMEDS::AttributePixMap_var anAttr2 = SALOMEDS::AttributePixMap::_narrow(aPixMap); + const char* icone ; + if ( Option == 0 ) { icone = "mesh_tree_importedmesh.png" ; } + else { icone = "mesh_tree_mesh.png" ; } + anAttr2->SetPixMap( icone ); + } + +} +//============================================================================= +void HOMARD_Gen_i::DeleteResultInSmesh(std::string NomFich, std::string MeshName) +{ + MESSAGE ("DeleteResultInSmesh pour le maillage " << MeshName << " dans le fichier " << NomFich ); + if (CORBA::is_nil(myStudy)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid study context"; + throw SALOME::SALOME_Exception(es); + return ; + }; + +// Le module SMESH est-il actif ? + SALOMEDS::SObject_var aSmeshSO = myStudy->FindComponent("SMESH"); +// + if (CORBA::is_nil(aSmeshSO)) + { + return ; + }; +// On verifie que le fichier est deja publie + SALOMEDS::StudyBuilder_var myBuilder = myStudy->NewBuilder(); + SALOMEDS::ChildIterator_var aIter = myStudy->NewChildIterator(aSmeshSO); + for (; aIter->More(); aIter->Next()) + { + SALOMEDS::SObject_var aSO = aIter->Value(); + SALOMEDS::GenericAttribute_var aGAttr; + if (aSO->FindAttribute(aGAttr,"AttributeExternalFileDef")) + { + SALOMEDS::AttributeExternalFileDef_var anAttr = SALOMEDS::AttributeExternalFileDef::_narrow(aGAttr); + CORBA::String_var value=anAttr->Value(); + if (strcmp((const char*)value,NomFich.c_str()) == 0) + { + if (aSO->FindAttribute(aGAttr,"AttributeName")) + { + SALOMEDS::AttributeName_var anAttr2 = SALOMEDS::AttributeName::_narrow(aGAttr); + CORBA::String_var value2=anAttr2->Value(); + if (strcmp((const char*)value2,MeshName.c_str()) == 0) + { + myBuilder->RemoveObjectWithChildren( aSO ) ; + } + } + } + } + } + return ; +} +//============================================================================= +void HOMARD_Gen_i::PublishMeshIterInSmesh(const char* NomIter) +{ + MESSAGE( "PublishMeshIterInSmesh " << NomIter); + HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[NomIter]; + + SALOMEDS::SObject_var aIterSO=SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration))); + if (CORBA::is_nil(myIteration)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid iterationStudy Object"; + throw SALOME::SALOME_Exception(es); + return ; + }; + const char* MeshFile = myIteration->GetMeshFile() ; + const char* MeshName = myIteration->GetMeshName() ; + CORBA::Long Option = -1 ; + int etat = myIteration->GetState(); +// Iteration initiale + if ( etat <= 0 ) { Option = 0 ; } +// ou iteration calculee + else if ( etat == 2 ) { Option = 1 ; } +// Publication effective apres menage eventuel + if ( Option >= 0 ) + { + DeleteResultInSmesh(MeshFile, MeshName) ; + PublishResultInSmesh(MeshFile, Option) ; + } + +} +//============================================================================= +void HOMARD_Gen_i::PublishFileUnderIteration(const char* NomIter, const char* NomFich, const char* Commentaire) +{ +// MESSAGE ("PublishFileUnderIteration pour l'iteration " << NomIter << " du fichier " << NomFich << " avec le commentaire " << Commentaire ); + HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[NomIter]; + + SALOMEDS::SObject_var aIterSO=SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration))); + if (CORBA::is_nil(myIteration)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid iterationStudy Object"; + throw SALOME::SALOME_Exception(es); + return ; + }; + + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); + + aStudyBuilder->NewCommand(); + + SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aIterSO); +// Pour les fichiers med, on affiche une icone de maillage +// Pour les fichiers qui sont du texte, on affiche une icone de fichier texte 'texte' +// Le reperage se fait par la 1ere lettre du commentaire : I pour Iteration n + std::string icone ; + std::string ior = " " ; + if ( Commentaire[0] == 'M' ) + { icone = "med.png" ; } + else + { icone = "texte_2.png" ; } + PublishInStudyAttr(aStudyBuilder, aSubSO, NomFich, Commentaire, icone.c_str(), ior.c_str() ) ; + + aStudyBuilder->CommitCommand(); +} +// +//============================================================================= +void HOMARD_Gen_i::PublishFileUnderYACS(const char* nomYACS, const char* NomFich, const char* Commentaire) +{ +// MESSAGE ("PublishFileUnderYACS pour le schema " << nomYACS << " du fichier " << NomFich << " avec le commentaire " << Commentaire ); + HOMARD::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; + + SALOMEDS::SObject_var aYACSSO=SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myYACS))); + if (CORBA::is_nil(myYACS)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Invalid YACSStudy Object"; + throw SALOME::SALOME_Exception(es); + return ; + }; + + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); + + aStudyBuilder->NewCommand(); + + SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aYACSSO); + std::string icone = "texte_2.png" ; + std::string ior = " " ; + PublishInStudyAttr(aStudyBuilder, aSubSO, NomFich, Commentaire, icone.c_str(), ior.c_str() ) ; + + aStudyBuilder->CommitCommand(); +} +// +//============================================================================= +//============================================================================= +// YACS +//============================================================================= +//============================================================================= +//============================================================================= +// Creation d'un schema YACS +// nomCas : nom du cas a traiter +// FileName : nom du fichier contenant le script de lancement du calcul +// DirName : le répertoire de lancement des calculs du schéma +//============================================================================= +HOMARD::HOMARD_YACS_ptr HOMARD_Gen_i::CreateYACSSchema (const char* nomYACS, const char* nomCas, const char* ScriptFile, const char* DirName, const char* MeshFile) +{ + INFOS ( "CreateYACSSchema : Schema YACS " << nomYACS ); + INFOS ( ". nomCas : " << nomCas); + INFOS ( ". ScriptFile : " << ScriptFile); + INFOS ( ". DirName : " << DirName); + INFOS ( ". MeshFile : " << MeshFile); + + // A. Controle du nom : + if ((myStudyContext._mesYACSs).find(nomYACS) != (myStudyContext._mesYACSs).end()) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "This schema YACS has already been defined."; + throw SALOME::SALOME_Exception(es); + return 0; + } + + // B. Creation de l'objet + HOMARD::HOMARD_YACS_var myYACS = newYACS(); + if (CORBA::is_nil(myYACS)) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = "Unable to create the schema YACS"; + throw SALOME::SALOME_Exception(es); + return 0; + }; + myYACS->SetName( nomYACS ) ; + + // C. Enregistrement + myStudyContext._mesYACSs[nomYACS] = myYACS; + + SALOMEDS::SObject_var aSO; + SALOMEDS::SObject_var aResultSO=PublishInStudy(aSO, myYACS, nomYACS); + + PublishCaseUnderYACS(nomYACS, nomCas); + + // D. Caracterisation + // D.1. Options + myYACS->SetDirName( DirName ) ; + myYACS->SetMeshFile( MeshFile ) ; + myYACS->SetScriptFile( ScriptFile ) ; + myYACS->SetCaseName( nomCas ) ; + // D.2. Defaut + int defaut_i ; + // D.2.1. Type constant + myYACS->SetType( 1 ) ; + // D.2.2. Convergence + defaut_i = GetYACSMaxIter() ; + myYACS->SetMaxIter( defaut_i ) ; + defaut_i = GetYACSMaxNode() ; + myYACS->SetMaxNode( defaut_i ) ; + defaut_i = GetYACSMaxElem() ; + myYACS->SetMaxElem( defaut_i ) ; + // D.3. Fichier de sauvegarde dans le répertoire du cas + HOMARD::HOMARD_Cas_ptr caseyacs = GetCase(nomCas) ; + std::string dirnamecase = caseyacs->GetDirName() ; + std::string XMLFile ; + XMLFile = dirnamecase + "/schema.xml" ; + myYACS->SetXMLFile( XMLFile.c_str() ) ; + + return HOMARD::HOMARD_YACS::_duplicate(myYACS); +} +//============================================================================= +// Ecriture d'un schema YACS +//============================================================================= +CORBA::Long HOMARD_Gen_i::YACSWrite(const char* nomYACS) +{ + INFOS ( "YACSWrite : Ecriture de " << nomYACS ); +// Le répertoire du cas + HOMARD::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; + ASSERT(!CORBA::is_nil(myYACS)); +// Le nom du fichier du schema + std::string XMLFile ; + XMLFile = myYACS->GetXMLFile() ; + + int codret = YACSWriteOnFile(nomYACS, XMLFile.c_str()) ; + + return codret ; +} +//============================================================================= +// Ecriture d'un schema YACS sur un fichier donne +//============================================================================= +CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* XMLFile) +{ + INFOS ( "YACSWriteOnFile : Ecriture de " << nomYACS << " sur " << XMLFile ); + + // A. Prealable + int codret = 0; + + // B. L'objet YACS + // B.1. L'objet + HOMARD::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; + ASSERT(!CORBA::is_nil(myYACS)); + // B.2. Les caracteristiques + std::string DirName = myYACS->GetDirName() ; + std::string MeshFile = myYACS->GetMeshFile() ; + std::string ScriptFile = myYACS->GetScriptFile() ; + // B.3. Les caracteristiques de convergence + int MaxIter = myYACS->GetMaxIter() ; + int MaxNode = myYACS->GetMaxNode() ; + int MaxElem = myYACS->GetMaxElem() ; + + // C. Le cas + // C.1. L'objet cas + const char* nomCas = myYACS->GetCaseName(); + HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; + ASSERT(!CORBA::is_nil(myCase)); + // C.2. Les instructions python associees au cas + CORBA::String_var dumpCorbaCase = myCase->GetDumpPython(); + std::string pythonCas = dumpCorbaCase.in(); + MESSAGE ("pythonCas :\n"<GetIter0() ; + std::string Iter0Name = myCase->GetIter0Name() ; + MESSAGE (". Iter0Name = " << Iter0Name); + std::string MeshName = Iter0->GetMeshName(); + MESSAGE (". MeshName = " << MeshName); + // D.2. L'iteration numero 1 + HOMARD::listeIterFilles* maListe = Iter0->GetIterations(); + int numberOfIter = maListe->length(); + if ( numberOfIter > 1 ) + { + MESSAGE (". numberOfIter = " << numberOfIter); + SALOME::ExceptionStruct es ; + es.type = SALOME::BAD_PARAM; + std::string text = "Une seule iteration est permise." ; + es.text = CORBA::string_dup(text.c_str()); + throw SALOME::SALOME_Exception(es); + return 0; + } + std::string Iter1Name = std::string((*maListe)[0]); + MESSAGE ("... Iter1Name = " << Iter1Name); + HOMARD::HOMARD_Iteration_var Iter1 = GetIteration(Iter1Name.c_str()) ; + // D.3. Les instructions python associees a l'iteration + CORBA::String_var dumpCorbaIter = Iter1->GetDumpPython(); + std::string pythonIter = dumpCorbaIter.in(); + MESSAGE ("pythonIter :\n"<GetHypoName(); + MESSAGE (". nomHypo = " << nomHypo); + HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; + ASSERT(!CORBA::is_nil(myHypo)); + // E.2. Les caracteristiques de l'adaptation + HOMARD::listeTypes* ListTypes = myHypo->GetAdapRefinUnRef(); + ASSERT(ListTypes->length() == 3); + int TypeAdap = (*ListTypes)[0]; +// int TypeRaff = (*ListTypes)[1]; +// int TypeDera = (*ListTypes)[2]; + // E.3. Les instructions python associees a l'hypothese + CORBA::String_var dumpCorbaHypo = myHypo->GetDumpPython(); + std::string pythonHypo = dumpCorbaHypo.in(); + MESSAGE ("pythonHypo :\n"<Texte_DataInit_MeshFile(MeshFile); } + // G.1.3. Le script de lancement + else if ( mot_cle == "Alternance_Calcul_HOMARD_Calcul" ) + { myDriver->Texte_Alternance_Calcul_HOMARD_Calcul(ScriptFile); } + // G.1.4. Les options du cas + else if ( mot_cle == "Iter_1_Case_Options" ) + { myDriver->Texte_Iter_1_Case_Options(pythonCas); } + // G.1.5. Execution de HOMARD : le répertoire du cas + else if ( mot_cle == "HOMARD_Exec_DirName" ) + { myDriver->Texte_HOMARD_Exec_DirName(); } + // G.1.6. Execution de HOMARD : le nom du maillage + else if ( mot_cle == "HOMARD_Exec_MeshName" ) + { + myDriver->Texte_HOMARD_Exec_MeshName(MeshName); + std::string node ; + if ( _LangueShort == "fr" ) { node = "Boucle_de_convergence.Alternance_Calcul_HOMARD" ; } + else { node = "Convergence_Loop.Alternation_Computation_HOMARD" ; } + node += ".Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase" ; + myDriver->TexteParametre( node, "MeshName", "string", MeshName ) ; + } + // G.1.7. Execution de HOMARD : les options de l'hypothese + else if ( mot_cle == "HOMARD_Exec_Hypo_Options" ) + { myDriver->Texte_python_1( pythonHypo, 3, "Hypo" ) ; } + // G.1.8. Execution de HOMARD : les options de l'iteration + else if ( mot_cle == "HOMARD_Exec_Iter_Options" ) + { myDriver->Texte_python_2( pythonIter, "TimeStep", "Iter" ) ; } + // G.1.9. a. Creation eventuelles des zones et frontieres + // b. Enchainement + else if ( mot_cle == "Iter_1" ) + { + std::string texte_control = "" ; + if ( TypeAdap == 0 ) { texte_control += YACSDriverTexteZone( myHypo, myDriver ) ; } + texte_control += YACSDriverTexteBoundary( myCase, myDriver ) ; + texte_control += myDriver->Texte_Iter_1_control() ; + myDriver->TexteAdd(texte_control); + } + // G.1.10. Les tests de convergence + else if ( mot_cle == "Analyse_Test_Convergence" ) + { myDriver->TexteAnalyse_Test_Convergence(MaxIter, MaxNode, MaxElem); } + // G.1.11. Les parametres + else if ( mot_cle == "PARAMETRES" ) + { myDriver->TexteAddParametres(); } + // G.1.n. La ligne est recopiee telle quelle + else { myDriver->TexteAdd(ligne); } + } + // G.2. Ecriture du texte dans le fichier + if ( codret == 0 ) + { myDriver->CreeFichier(); } + } + else + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + std::string text = "The reference file for the YACS schema cannot be read." ; + es.text = CORBA::string_dup(text.c_str()); + throw SALOME::SALOME_Exception(es); + } + + delete myDriver; + + // H. Publication du fichier dans l'arbre + + std::string Commentaire = "xml" ; + PublishFileUnderYACS(nomYACS, XMLFile, Commentaire.c_str()); + + return codret ; +} +//============================================================================= +// Ecriture d'un schema YACS : ecriture des zones associees a une hypothese +//============================================================================= +std::string HOMARD_Gen_i::YACSDriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, YACSDriver* myDriver) +{ + MESSAGE ( "YACSDriverTexteZone" ); + // A. Les zones associees a cette hypothese + HOMARD::listeZonesHypo* ListZone = myHypo->GetZones(); + int numberOfZonesx2 = ListZone->length(); + + // B. Parcours des zones + std::string texte_control ; + for (int iaux = 0; iaux< numberOfZonesx2; iaux++) + { + // 1. Reperage de la zone + std::string ZoneName = std::string((*ListZone)[iaux]); + MESSAGE ( "\n. ZoneName = " << ZoneName << " - " <GetDumpPython(); + std::string pythonStructure_0 = dumpCorbaZone.in(); + MESSAGE ("pythonStructure_0 :"<GetBoundaryGroup(); + int numberOfitems = ListBoundaryGroupType->length(); + + // B. Parcours des frontieres + std::string texte_control ; + std::list ListeBoundaryTraitees ; + for (int NumBoundary = 0; NumBoundary< numberOfitems; NumBoundary=NumBoundary+2) + { + std::string BoundaryName = std::string((*ListBoundaryGroupType)[NumBoundary]); + MESSAGE ( "... BoundaryName = " << BoundaryName); + // Attention a n'ecrire la definition qu'une seule fois car elle peut se trouver + // plusieurs fois dans la definition du cas, d'ou la liste ListeBoundaryTraitees + int A_faire = 1 ; + std::list::const_iterator it = ListeBoundaryTraitees.begin(); + while (it != ListeBoundaryTraitees.end()) + { + MESSAGE ( "..... BoundaryNameTraitee = " << *it); + if ( BoundaryName == *it ) { A_faire = 0 ; } + it++; + } + if ( A_faire == 1 ) + { + // 1. Caracteristiques de la frontiere + HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; + ASSERT(!CORBA::is_nil(myBoundary)); + // 2. Les instructions python associees a la frontiere + // La premiere ligne est un commentaire a eliminer + // La seconde ligne est l'instruction a proprement parler ; on ne garde que ce qui suit le "." + CORBA::String_var dumpCorbaBoundary = myBoundary->GetDumpPython(); + std::string pythonStructure_0 = dumpCorbaBoundary.in(); + MESSAGE ("pythonStructure_0 :"<URL())); + aFileName += "_HOMARD.dat"; + + // initialize sequence of file names + SALOMEDS_Tool::ListOfFiles aFileSeq; + aFileSeq.reserve(1); + aFileSeq.push_back(CORBA::string_dup(aFileName.c_str())) ; + + // get full path to the data file + aFileName = tmpDir + aFileName; + + // save data + // -> create file + std::ofstream f(aFileName.c_str()); + + // clear temporary id map + context._idmap.clear(); + + int id = 1; + + // -> save cases + std::map::const_iterator it_case; + for (it_case = context._mesCas.begin(); it_case != context._mesCas.end(); ++it_case) { + HOMARD::HOMARD_Cas_var aCas = it_case->second; + PortableServer::ServantBase_var aServant = GetServant(aCas); + HOMARD_Cas_i* aCasServant = dynamic_cast(aServant.in()); + if (aCasServant) { + f << HOMARD::GetSignature(HOMARD::Case) << aCasServant->Dump() << std::endl; + context._idmap[id++] = dynamic_cast(aCasServant); + } + } + // -> save zones + std::map::const_iterator it_zone; + for (it_zone = context._mesZones.begin(); it_zone != context._mesZones.end(); ++it_zone) { + HOMARD::HOMARD_Zone_var aZone = it_zone->second; + PortableServer::ServantBase_var aServant = GetServant(aZone); + HOMARD_Zone_i* aZoneServant = dynamic_cast(aServant.in()); + if (aZoneServant) { + f << HOMARD::GetSignature(HOMARD::Zone) << aZoneServant->Dump() << std::endl; + context._idmap[id++] = dynamic_cast(aZoneServant); + } + } + // -> save hypotheses + std::map::const_iterator it_hypo; + for (it_hypo = context._mesHypotheses.begin(); it_hypo != context._mesHypotheses.end(); ++it_hypo) { + HOMARD::HOMARD_Hypothesis_var aHypo = it_hypo->second; + PortableServer::ServantBase_var aServant = GetServant(aHypo); + HOMARD_Hypothesis_i* aHypoServant = dynamic_cast(aServant.in()); + if (aHypoServant) { + f << HOMARD::GetSignature(HOMARD::Hypothesis) << aHypoServant->Dump() << std::endl; + context._idmap[id++] = dynamic_cast(aHypoServant); + } + } + // -> save iterations + std::map::const_iterator it_iter; + for (it_iter = context._mesIterations.begin(); it_iter != context._mesIterations.end(); ++it_iter) { + HOMARD::HOMARD_Iteration_var aIter = it_iter->second; + PortableServer::ServantBase_var aServant = GetServant(aIter); + HOMARD_Iteration_i* aIterServant = dynamic_cast(aServant.in()); + if (aIterServant) { + f << HOMARD::GetSignature(HOMARD::Iteration) << aIterServant->Dump() << std::endl; + context._idmap[id++] = dynamic_cast(aIterServant); + } + } + // -> save boundaries + std::map::const_iterator it_boundary; + for (it_boundary = context._mesBoundarys.begin(); it_boundary != context._mesBoundarys.end(); ++it_boundary) { + HOMARD::HOMARD_Boundary_var aBoundary = it_boundary->second; + PortableServer::ServantBase_var aServant = GetServant(aBoundary); + HOMARD_Boundary_i* aBoundaryServant = dynamic_cast(aServant.in()); + if (aBoundaryServant) { + f << HOMARD::GetSignature(HOMARD::Boundary) << aBoundaryServant->Dump() << std::endl; + context._idmap[id++] = dynamic_cast(aBoundaryServant); + } + } + // -> close file + MESSAGE ("close file"); + f.close(); + + // put temporary files to the stream + MESSAGE ("put temporary files to the stream"); + aStreamFile = SALOMEDS_Tool::PutFilesToStream(tmpDir.c_str(), aFileSeq, isMultiFile); + + // remove temporary files + MESSAGE ("remove temporary files"); + if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(tmpDir.c_str(), aFileSeq, true); + + // return data stream + MESSAGE ("return data stream"); + return aStreamFile._retn(); +}; + +//=========================================================================== +SALOMEDS::TMPFile* HOMARD_Gen_i::SaveASCII(SALOMEDS::SComponent_ptr theComponent, + const char* theURL, + CORBA::Boolean isMultiFile) +{ + // No specific ASCII persistence + SALOMEDS::TMPFile_var aStreamFile = Save(theComponent, theURL, isMultiFile); + return aStreamFile._retn(); +}; + +//=========================================================================== +CORBA::Boolean HOMARD_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, + const SALOMEDS::TMPFile& theStream, + const char* theURL, + CORBA::Boolean isMultiFile) +{ + MESSAGE ("Load pour theURL = "<< theURL); + + // set current study + if (myStudy->_is_nil()) + UpdateStudy(); + + // get temporary directory name + std::string tmpDir = isMultiFile ? std::string(theURL) : SALOMEDS_Tool::GetTmpDir(); + + // Convert the stream into sequence of files to process + SALOMEDS_Tool::ListOfFiles aFileSeq = SALOMEDS_Tool::PutStreamToFiles(theStream, + tmpDir.c_str(), + isMultiFile); + // HOMARD data file name + std::string aFileName = ""; + if (isMultiFile) + aFileName = SALOMEDS_Tool::GetNameFromPath(Kernel_Utils::encode(SMESH_Gen_i::getStudyServant()->URL())); + aFileName = tmpDir + aFileName + "_HOMARD.dat"; + + StudyContext& context = myStudyContext; + + // save data + // -> create file + std::ifstream f(aFileName.c_str()); + + // clear context + context._mesCas.clear(); + context._mesHypotheses.clear(); + context._mesIterations.clear(); + context._mesZones.clear(); + context._mesBoundarys.clear(); + context._idmap.clear(); + + int id = 1; + std::string line; + + while (f) { + std::getline(f, line); + std::string bounSignature = HOMARD::GetSignature(HOMARD::Boundary); + std::string caseSignature = HOMARD::GetSignature(HOMARD::Case); + std::string hypoSignature = HOMARD::GetSignature(HOMARD::Hypothesis); + std::string iterSignature = HOMARD::GetSignature(HOMARD::Iteration); + std::string zoneSignature = HOMARD::GetSignature(HOMARD::Zone); + std::string yacsSignature = HOMARD::GetSignature(HOMARD::YACS); + if (line.substr(0, bounSignature.size()) == bounSignature) { + // re-create boundary + MESSAGE ("Recreation de la frontiere" ); + HOMARD::HOMARD_Boundary_var aBoundary = newBoundary(); + PortableServer::ServantBase_var aServant = GetServant(aBoundary); + HOMARD_Boundary_i* aBoundaryServant = dynamic_cast(aServant.in()); + if (aBoundaryServant && aBoundaryServant->Restore(line.substr(bounSignature.size()))) { + context._mesBoundarys[aBoundary->GetName()] = aBoundary; + context._idmap[id] = dynamic_cast(aBoundaryServant); + } + } + else if (line.substr(0, caseSignature.size()) == caseSignature) { + // re-create case + MESSAGE ("Recreation du cas" ); + HOMARD::HOMARD_Cas_var aCase = newCase(); + PortableServer::ServantBase_var aServant = GetServant(aCase); + HOMARD_Cas_i* aCaseServant = dynamic_cast(aServant.in()); + if (aCaseServant && aCaseServant->Restore(line.substr(caseSignature.size()))) { + context._mesCas[aCase->GetName()] = aCase; + context._idmap[id] = dynamic_cast(aCaseServant); + } + } + else if (line.substr(0, hypoSignature.size()) == hypoSignature) { + // re-create hypothesis + MESSAGE ("Recreation de l hypothese" ); + HOMARD::HOMARD_Hypothesis_var aHypo = newHypothesis(); + PortableServer::ServantBase_var aServant = GetServant(aHypo); + HOMARD_Hypothesis_i* aHypoServant = dynamic_cast(aServant.in()); + if (aHypoServant && aHypoServant->Restore(line.substr(hypoSignature.size()))) { + context._mesHypotheses[aHypo->GetName()] = aHypo; + context._idmap[id] = dynamic_cast(aHypoServant); + } + } + else if (line.substr(0, iterSignature.size()) == iterSignature) { + // re-create iteration + MESSAGE ("Recreation de l'iteration" ); + HOMARD::HOMARD_Iteration_var aIter = newIteration(); + PortableServer::ServantBase_var aServant = GetServant(aIter); + HOMARD_Iteration_i* aIterServant = dynamic_cast(aServant.in()); + if (aIterServant && aIterServant->Restore(line.substr(iterSignature.size()))) { + context._mesIterations[aIter->GetName()] = aIter; + context._idmap[id] = dynamic_cast(aIterServant); + } + } + else if (line.substr(0, zoneSignature.size()) == zoneSignature) { + MESSAGE ("Recreation de la zone" ); + // re-create zone + HOMARD::HOMARD_Zone_var aZone = newZone(); + PortableServer::ServantBase_var aServant = GetServant(aZone); + HOMARD_Zone_i* aZoneServant = dynamic_cast(aServant.in()); + if (aZoneServant && aZoneServant->Restore(line.substr(zoneSignature.size()))) { + context._mesZones[aZone->GetName()] = aZone; + context._idmap[id] = dynamic_cast(aZoneServant); + } + } + else if (line.substr(0, zoneSignature.size()) == yacsSignature) { + MESSAGE ("Recreation du schema YACS" ); + // re-create YACS + HOMARD::HOMARD_YACS_var aYACS = newYACS(); + PortableServer::ServantBase_var aServant = GetServant(aYACS); + HOMARD_YACS_i* aYACSServant = dynamic_cast(aServant.in()); + if (aYACSServant && aYACSServant->Restore(line.substr(yacsSignature.size()))) { + context._mesYACSs[aYACS->GetName()] = aYACS; + context._idmap[id] = dynamic_cast(aYACSServant); + } + } + id++; + } + + // -> close file + f.close(); + + // Remove temporary files created from the stream + if (!isMultiFile) + SALOMEDS_Tool::RemoveTemporaryFiles(tmpDir.c_str(), aFileSeq, true); + + return true; +}; + +//=========================================================================== +CORBA::Boolean HOMARD_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent, + const SALOMEDS::TMPFile& theStream, + const char* theURL, + CORBA::Boolean isMultiFile) +{ + // No specific ASCII persistence + return Load(theComponent, theStream, theURL, isMultiFile); +}; + +//=========================================================================== +void HOMARD_Gen_i::Close(SALOMEDS::SComponent_ptr theComponent) +{ +}; + +//=========================================================================== +char* HOMARD_Gen_i::ComponentDataType() +{ + return CORBA::string_dup("HOMARD"); +}; + +//=========================================================================== +char* HOMARD_Gen_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject, + const char* IORString, + CORBA::Boolean isMultiFile, + CORBA::Boolean isASCII) +{ + CORBA::String_var aString(""); + if (!CORBA::is_nil(theSObject) && strcmp(IORString, "") != 0) { + StudyContext context = myStudyContext; + CORBA::Object_var anObj = _orb->string_to_object(IORString); + if (!CORBA::is_nil(anObj)) { + PortableServer::ServantBase_var aServant = GetServant(anObj); + PortableServer::ServantBase* aStorable = dynamic_cast(aServant.in()); + if (aStorable) { + std::map::const_iterator it; + for (it = context._idmap.begin(); it != context._idmap.end(); ++it) { + if (it->second == aStorable) { + std::stringstream os; + os << it->first; + aString = CORBA::string_dup(os.str().c_str()); + } + } + } + } + } + return aString._retn(); +}; + +//=========================================================================== +char* HOMARD_Gen_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, + const char* aLocalPersistentID, + CORBA::Boolean isMultiFile, + CORBA::Boolean isASCII) +{ + CORBA::String_var aString(""); + if (!CORBA::is_nil(theSObject) && strcmp(aLocalPersistentID, "") != 0) { + StudyContext context = myStudyContext; + int id = atoi(aLocalPersistentID); + if (id > 0 && context._idmap.find(id) != context._idmap.end()) { + CORBA::Object_var object = _poa->servant_to_reference(context._idmap[ id ]); + if (!CORBA::is_nil(object)) { + aString = _orb->object_to_string(object); + } + } + } + return aString._retn(); +}; + +//=========================================================================== +CORBA::Boolean HOMARD_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR) +{ + if(CORBA::is_nil(myStudy)) + return false; + + HOMARD::HOMARD_Cas_var aCas = HOMARD::HOMARD_Cas::_narrow(theIOR); + if(!aCas->_is_nil()) + return true; + + HOMARD::HOMARD_Hypothesis_var aHypo = HOMARD::HOMARD_Hypothesis::_narrow(theIOR); + if(!aHypo->_is_nil()) + return true; + + HOMARD::HOMARD_Zone_var aZone = HOMARD::HOMARD_Zone::_narrow(theIOR); + if(!aZone->_is_nil()) + return true; + + HOMARD::HOMARD_Boundary_var aBoundary = HOMARD::HOMARD_Boundary::_narrow(theIOR); + if(!aBoundary->_is_nil()) + return true; + + /* Iteration is not published directly + HOMARD::HOMARD_Iteration_var aIter = HOMARD::HOMARD_Iteration::_narrow(theIOR); + if(!aIter->_is_nil()) + return true; + */ + return false; +}; + +//=========================================================================== +CORBA::Boolean HOMARD_Gen_i::CanCopy(SALOMEDS::SObject_ptr theObject) +{ + // No Copy/Paste support + return false; +}; + +//=========================================================================== +SALOMEDS::TMPFile* HOMARD_Gen_i::CopyFrom(SALOMEDS::SObject_ptr theObject, + CORBA::Long& theObjectID) +{ + // No Copy/Paste support + SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0); + return aStreamFile._retn(); +}; + +//=========================================================================== +CORBA::Boolean HOMARD_Gen_i::CanPaste(const char *theComponentName, + CORBA::Long theObjectID) +{ + // No Copy/Paste support + return false; +}; + +//=========================================================================== +SALOMEDS::SObject_ptr HOMARD_Gen_i::PasteInto(const SALOMEDS::TMPFile& theStream, + CORBA::Long theObjectID, + SALOMEDS::SObject_ptr theSObject) +{ + // No Copy/Paste support + SALOMEDS::SObject_var aResultSO; + return aResultSO._retn(); +}; + +//=========================================================================== +PortableServer::ServantBase_var HOMARD_Gen_i::GetServant(CORBA::Object_ptr theObject) +{ + PortableServer::Servant aServant = 0; + if (!CORBA::is_nil(theObject)) { + try { + aServant = _poa->reference_to_servant(theObject); + } + catch (...) { + } + } + return aServant; +} + +//========================================================================== +Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Boolean isPublished, + CORBA::Boolean isMultiFile, + CORBA::Boolean& isValidScript) +{ + MESSAGE ("Entree dans DumpPython"); + isValidScript=1; + + SALOMEDS::SObject_var aSO = SMESH_Gen_i::getStudyServant()->FindComponent("HOMARD"); + if(CORBA::is_nil(aSO)) + return new Engines::TMPFile(0); + + std::string aScript = "\"\"\"\n"; + aScript += "Python script for HOMARD\n"; + aScript += "Copyright 1996, 2011, 2015 EDF\n"; + aScript += "\"\"\"\n"; + aScript += "__revision__ = \"V1.2\"\n"; + aScript += "import HOMARD\n"; + if( isMultiFile ) + aScript += "import salome\n"; + aScript += "homard = salome.lcc.FindOrLoadComponent('FactoryServer','HOMARD')\n"; + aScript += "\thomard.UpdateStudy()\n"; + MESSAGE (". Au depart \n"< 0) + { + MESSAGE (". Ecritures des frontieres"); + aScript += "#\n# Creation of the boundaries"; + aScript += "\n# =========================="; + } + std::map::const_iterator it_boundary; + for (it_boundary = myStudyContext._mesBoundarys.begin(); + it_boundary != myStudyContext._mesBoundarys.end(); ++it_boundary) + { + HOMARD::HOMARD_Boundary_var maBoundary = (*it_boundary).second; + CORBA::String_var dumpCorbaBoundary = maBoundary->GetDumpPython(); + std::string dumpBoundary = dumpCorbaBoundary.in(); + MESSAGE (dumpBoundary<<"\n"); + aScript += dumpBoundary; + } + + + if (myStudyContext._mesZones.size() > 0) + { + MESSAGE (". Ecritures des zones"); + aScript += "#\n# Creation of the zones"; + aScript += "\n# ====================="; + } + std::map::const_iterator it_zone; + for ( it_zone = myStudyContext._mesZones.begin(); + it_zone != myStudyContext._mesZones.end(); ++it_zone) + { + HOMARD::HOMARD_Zone_var myZone = (*it_zone).second; + CORBA::String_var dumpCorbaZone = myZone->GetDumpPython(); + std::string dumpZone = dumpCorbaZone.in(); + MESSAGE (dumpZone<<"\n"); + aScript += dumpZone; + } + + + if (myStudyContext._mesHypotheses.size() > 0) + { + MESSAGE (". Ecritures des hypotheses"); + aScript += "#\n# Creation of the hypotheses"; + aScript += "\n# =========================="; + } + std::map::const_iterator it_hypo; + for ( it_hypo = myStudyContext._mesHypotheses.begin(); + it_hypo != myStudyContext._mesHypotheses.end(); it_hypo++) + { + HOMARD::HOMARD_Hypothesis_var monHypo = (*it_hypo).second; + CORBA::String_var dumpCorbaHypo = monHypo->GetDumpPython(); + std::string dumpHypo = dumpCorbaHypo.in(); + MESSAGE (dumpHypo<<"\n"); + aScript += dumpHypo; + } + + + if (myStudyContext._mesCas.size() > 0) + { + MESSAGE (". Ecritures des cas"); + aScript += "#\n# Creation of the cases"; + aScript += "\n# ====================="; + } + std::map::const_iterator it_cas; + for (it_cas = myStudyContext._mesCas.begin(); + it_cas != myStudyContext._mesCas.end(); it_cas++) + { + std::string nomCas = (*it_cas).first; + std::string dumpCas = std::string("\n# Creation of the case ") ; + dumpCas += nomCas + std::string("\n"); + dumpCas += std::string("\t") + nomCas; + dumpCas += std::string(" = homard.CreateCase(\"") + nomCas + std::string("\", \""); + + HOMARD::HOMARD_Cas_var myCase = (*it_cas).second; + CORBA::String_var cIter0= myCase->GetIter0Name(); + std::string iter0 = cIter0.in(); + + HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[iter0]; + CORBA::String_var cMesh0= myIteration->GetMeshFile(); + std::string mesh0 = cMesh0.in(); + CORBA::String_var cMeshName0= myIteration->GetMeshName(); + std::string meshName0 = cMeshName0.in(); + dumpCas += meshName0 + std::string("\", \"")+ mesh0 + std::string("\")\n"); + CORBA::String_var dumpCorbaCase = myCase->GetDumpPython(); + std::string dumpCas2= dumpCorbaCase.in(); + + MESSAGE (dumpCas< 0) + { + MESSAGE (". Ecritures des iterations"); + aScript += "#\n# Creation of the iterations" ; + aScript += "\n# =========================="; + } + std::map::const_iterator it_iter; + for (it_iter = myStudyContext._mesIterations.begin(); + it_iter != myStudyContext._mesIterations.end(); ++it_iter) + { + HOMARD::HOMARD_Iteration_var aIter = (*it_iter).second; + CORBA::String_var dumpCorbaIter = aIter->GetDumpPython(); + std::string dumpIter = dumpCorbaIter.in(); + MESSAGE (dumpIter<<"\n"); + aScript += dumpIter; + } + + + if (myStudyContext._mesYACSs.size() > 0) + { + MESSAGE (". Ecritures des schemas YACS"); + aScript += "#\n# Creation of the schemas YACS"; + aScript += "\n# ============================"; + } + std::map::const_iterator it_yacs; + for ( it_yacs = myStudyContext._mesYACSs.begin(); + it_yacs != myStudyContext._mesYACSs.end(); ++it_yacs) + { + HOMARD::HOMARD_YACS_var myYACS = (*it_yacs).second; + CORBA::String_var dumpCorbaYACS = myYACS->GetDumpPython(); + std::string dumpYACS = dumpCorbaYACS.in(); + MESSAGE (dumpYACS<<"\n"); + aScript += dumpYACS; + } + + MESSAGE (". Ecritures finales"); + if( isMultiFile ) + aScript += "\n\tpass"; + aScript += "\n"; + + if( !isMultiFile ) // remove unnecessary tabulation + aScript = RemoveTabulation( aScript ); + +// MESSAGE ("A ecrire \n"<::const_iterator it; + for (it = myStudyContext._mesCas.begin(); + it != myStudyContext._mesCas.end(); it++) + { + if (std::string(nomDir) == std::string(it->second->GetDirName())) + { + casename = std::string(it->second->GetName()) ; + break ; + } + } + return CORBA::string_dup( casename.c_str() ); +} +/*//============================================================================= +void SALOMEException( std::string message ) +{ + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + es.text = message; + throw SALOME::SALOME_Exception(es); + return ; +}*/ +//============================================================================= +char* HOMARD_Gen_i::getVersion() +{ +#if HOMARD_DEVELOPMENT + return CORBA::string_dup(HOMARD_VERSION_STR"dev"); +#else + return CORBA::string_dup(HOMARD_VERSION_STR); +#endif +} +//=============================================================================== +// Recuperation de la chaine de caracteres par rapport a l'apparition d'un caractere +// ligne : la ligne a manipuler +// caractere : le caractere a reperer +// option : 0 : la chaine avant la premiere apparition du caractere +// 1 : la chaine apres la premiere apparition du caractere +// 2 : la chaine avant la derniere apparition du caractere +// 3 : la chaine apres la derniere apparition du caractere +// Si le caractere est absent, on retourne la chaine totale +//=============================================================================== +std::string HOMARD_Gen_i::GetStringInTexte( const std::string ligne, const std::string caractere, int option ) +{ +// MESSAGE("GetStringInTexte, recherche de '"<> mot_cle ; + chaine = GetStringInTexte ( mot_cle, "\"", 1 ) ; + chaine = GetStringInTexte ( chaine, "\"", 0 ) ; + if ( chaine == "language" ) { section_langue = true ; } + if ( chaine == "HOMARD" ) { section_homard = true ; } + // MESSAGE ( "section_langue = "<" ) + { /*MESSAGE ( "Fin de la section : "<< ligne<<", section_langue = "<> PublisMeshIN ; } + if ( chaine2 == "publish_mesh_out" ) { chainebis >> PublisMeshOUT ; } + // 3.2.2. Les maximum pour YACS + if ( chaine2 == "yacs_max_iter" ) { chainebis >> YACSMaxIter ; } + if ( chaine2 == "yacs_max_node" ) { chainebis >> YACSMaxNode ; } + if ( chaine2 == "yacs_max_elem" ) { chainebis >> YACSMaxElem ; } + if ( chaine2 == "yacs_type_test" ) { YACSTypeTestchaine = chaine ; } + } + } + } + } + } + + // C. Enregistrements + MESSAGE ("Enregistrement de LanguageShort = " << LanguageShort ); + SetLanguageShort( LanguageShort.c_str() ) ; + + MESSAGE ("Enregistrement de PublisMeshIN = " << PublisMeshIN<<", PublisMeshOUT = "<< PublisMeshOUT); + SetPublisMesh(PublisMeshIN, PublisMeshOUT) ; + + MESSAGE ("Enregistrement de YACSMaxIter = " << YACSMaxIter<<", YACSMaxNode = "<< YACSMaxNode<<", YACSMaxElem = "<< YACSMaxElem); + SetYACSMaximum(YACSMaxIter, YACSMaxNode, YACSMaxElem) ; + + MESSAGE ("Enregistrement de TypeTest = " << YACSTypeTestchaine.c_str() ); + int YACSTypeTest ; + if ( ( YACSTypeTestchaine == "VTest > VRef" ) || ( YACSTypeTestchaine == "VTest > VRef" ) ) { YACSTypeTest = 1 ; } + else if ( ( YACSTypeTestchaine == "VTest < VRef" ) || ( YACSTypeTestchaine == "VTest < VRef" ) ) { YACSTypeTest = 2 ; } + else { YACSTypeTest = 0 ; } + MESSAGE ("==> TypeTest = " << YACSTypeTest ); + SetYACSConvergenceType( YACSTypeTest ) ; + + return ; +} +//=============================================================================== +// Langue de SALOME +//=============================================================================== +void HOMARD_Gen_i::SetLanguageShort(const char* LanguageShort) +{ +// MESSAGE ("SetLanguageShort pour LanguageShort = " << LanguageShort ); + _LangueShort = LanguageShort ; + if ( _LangueShort == "fr" ) { _Langue = "Francais" ; } + else { _Langue = "English" ; } + return ; +} +char* HOMARD_Gen_i::GetLanguageShort() +{ +// MESSAGE ("GetLanguageShort"); + return CORBA::string_dup( _LangueShort.c_str() ); +} +//=============================================================================== +// Options de publications +//=============================================================================== +void HOMARD_Gen_i::SetPublisMesh(CORBA::Long PublisMeshIN, CORBA::Long PublisMeshOUT) +{ + _PublisMeshIN = PublisMeshIN ; + _PublisMeshOUT = PublisMeshOUT ; + return ; +} +CORBA::Long HOMARD_Gen_i::GetPublisMeshIN() +{ + return _PublisMeshIN ; +} +CORBA::Long HOMARD_Gen_i::GetPublisMeshOUT() +{ + return _PublisMeshOUT ; +} +//=============================================================================== +// YACS - test de convergence +//=============================================================================== +void HOMARD_Gen_i::SetYACSMaximum(CORBA::Long YACSMaxIter, CORBA::Long YACSMaxNode, CORBA::Long YACSMaxElem) +{ + _YACSMaxIter = YACSMaxIter ; + _YACSMaxNode = YACSMaxNode ; + _YACSMaxElem = YACSMaxElem ; + return ; +} +CORBA::Long HOMARD_Gen_i::GetYACSMaxIter() +{ + return _YACSMaxIter ; +} +CORBA::Long HOMARD_Gen_i::GetYACSMaxNode() +{ + return _YACSMaxNode ; +} +CORBA::Long HOMARD_Gen_i::GetYACSMaxElem() +{ + return _YACSMaxElem ; +} +void HOMARD_Gen_i::SetYACSConvergenceType(CORBA::Long YACSTypeTest) +{ + _YACSTypeTest = YACSTypeTest ; + return ; +} +CORBA::Long HOMARD_Gen_i::GetYACSConvergenceType() +{ + return _YACSTypeTest ; +} + +//============================================================================= +extern "C" +{ + HOMARDENGINE_EXPORT + PortableServer::ObjectId* HOMARDEngine_factory(CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + PortableServer::ObjectId* contId, + const char* instanceName, + const char* interfaceName) + { + MESSAGE("PortableServer::ObjectId* HOMARDEngine_factory()"); + HOMARD_Gen_i* myHOMARD_Gen = new HOMARD_Gen_i(orb, poa, contId, instanceName, interfaceName); + return myHOMARD_Gen->getId(); + } +} diff --git a/src/ADAPT_I/HOMARD_Gen_i.hxx b/src/ADAPT_I/HOMARD_Gen_i.hxx new file mode 100644 index 000000000..10c07cec4 --- /dev/null +++ b/src/ADAPT_I/HOMARD_Gen_i.hxx @@ -0,0 +1,347 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef _HOMARD_GEN_I_HXX_ +#define _HOMARD_GEN_I_HXX_ + +#include +#include CORBA_SERVER_HEADER(HOMARD_Gen) +#include CORBA_SERVER_HEADER(HOMARD_Cas) +#include CORBA_SERVER_HEADER(HOMARD_Hypothesis) +#include CORBA_SERVER_HEADER(HOMARD_Iteration) +#include CORBA_SERVER_HEADER(HOMARD_Zone) +#include CORBA_SERVER_HEADER(HOMARD_Boundary) +#include CORBA_SERVER_HEADER(HOMARD_YACS) +#include CORBA_CLIENT_HEADER(SALOMEDS) +#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) + +#include "HOMARD_i.hxx" +#include "HOMARD_Gen.hxx" +#include "HomardDriver.hxx" +#include "YACSDriver.hxx" +#include "FrontTrack.hxx" +#include "SALOME_Component_i.hxx" +#include "SALOME_NamingService.hxx" +#include "Utils_CorbaException.hxx" + +#include +#include + +class HOMARDENGINE_EXPORT HOMARD_Gen_i: + public virtual Engines_Component_i, + public virtual POA_HOMARD::HOMARD_Gen +{ +public: + HOMARD_Gen_i( CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + PortableServer::ObjectId* contId, + const char* instanceName, + const char* interfaceName ); + virtual ~HOMARD_Gen_i(); + + +// Generalites + +// Les creations + HOMARD::HOMARD_Boundary_ptr CreateBoundary (const char* nomBoundary, CORBA::Long typeBoundary); + HOMARD::HOMARD_Boundary_ptr CreateBoundaryCAO(const char* nomBoundary, + const char* DataFile); + HOMARD::HOMARD_Boundary_ptr CreateBoundaryDi (const char* nomBoundary, + const char* MeshName, const char* DataFile); + HOMARD::HOMARD_Boundary_ptr CreateBoundaryCylinder (const char* nomBoundary, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, + CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis, + CORBA::Double Rayon); + HOMARD::HOMARD_Boundary_ptr CreateBoundarySphere (const char* nomBoundary, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, + CORBA::Double Rayon); + HOMARD::HOMARD_Boundary_ptr CreateBoundaryConeR (const char* nomBoundary, + CORBA::Double Xcentre1, CORBA::Double Ycentre1, CORBA::Double Zcentre1, CORBA::Double Rayon1, + CORBA::Double Xcentre2, CORBA::Double Ycentre2, CORBA::Double Zcentre2, CORBA::Double Rayon2); + HOMARD::HOMARD_Boundary_ptr CreateBoundaryConeA (const char* nomBoundary, + CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis, CORBA::Double Angle, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre); + HOMARD::HOMARD_Boundary_ptr CreateBoundaryTorus (const char* nomBoundary, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, + CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis, + CORBA::Double RayonRev, CORBA::Double RayonPri); + + HOMARD::HOMARD_Cas_ptr CreateCase (const char* nomCas, const char* MeshName, const char* FileName); + HOMARD::HOMARD_Cas_ptr CreateCaseFromIteration (const char* nomCas, const char* DirNameStart); + HOMARD::HOMARD_Cas_ptr CreateCaseFromCaseLastIteration (const char* nomCas, const char* DirNameStart); + HOMARD::HOMARD_Cas_ptr CreateCaseFromCaseIteration (const char* nomCas, const char* DirNameStart, CORBA::Long Number); + HOMARD::HOMARD_Cas_ptr CreateCase0 (const char* nomCas, const char* MeshName, const char* FileName, CORBA::Long MeshOption, CORBA::Long NumeIter, CORBA::Long Option); + std::string CreateCase1 (const char* DirNameStart, CORBA::Long Number); + + HOMARD::HOMARD_Hypothesis_ptr CreateHypothesis(const char* nomHypothesis); + + HOMARD::HOMARD_Iteration_ptr CreateIteration (const char* nomIter, const char* nomIterParent); + + HOMARD::HOMARD_Zone_ptr CreateZone (const char* nomZone, CORBA::Long typeZone); + HOMARD::HOMARD_Zone_ptr CreateZoneBox (const char* nomZone, + CORBA::Double Xmini, CORBA::Double Xmaxi, + CORBA::Double Ymini, CORBA::Double Ymaxi, + CORBA::Double Zmini, CORBA::Double Zmaxi); + HOMARD::HOMARD_Zone_ptr CreateZoneBox2D (const char* nomZone, + CORBA::Double Umini, CORBA::Double Umaxi, + CORBA::Double Vmini, CORBA::Double Vmaxi, + CORBA::Long Orient); + HOMARD::HOMARD_Zone_ptr CreateZoneCylinder (const char* nomZone, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, + CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, + CORBA::Double Rayon, CORBA::Double Haut); + HOMARD::HOMARD_Zone_ptr CreateZoneDisk (const char* nomZone, + CORBA::Double Ucentre, CORBA::Double Vcentre, + CORBA::Double Rayon, + CORBA::Long Orient); + HOMARD::HOMARD_Zone_ptr CreateZoneDiskWithHole (const char* nomZone, + CORBA::Double Ucentre, CORBA::Double Vcentre, + CORBA::Double Rayon, CORBA::Double Rayonint, + CORBA::Long Orient); + HOMARD::HOMARD_Zone_ptr CreateZonePipe (const char* nomZone, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, + CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, + CORBA::Double Rayon, CORBA::Double Haut, CORBA::Double Rayonint); + HOMARD::HOMARD_Zone_ptr CreateZoneSphere (const char* nomZone, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, CORBA::Double Rayon); + +// Les informations + HOMARD::HOMARD_Boundary_ptr GetBoundary (const char* nomBoundary); + HOMARD::HOMARD_Cas_ptr GetCase (const char* nomCas); + HOMARD::HOMARD_Hypothesis_ptr GetHypothesis (const char* nomHypothesis); + HOMARD::HOMARD_Iteration_ptr GetIteration (const char* nomIteration); + HOMARD::HOMARD_YACS_ptr GetYACS (const char* nomYACS); + HOMARD::HOMARD_Zone_ptr GetZone (const char* nomZone); + + HOMARD::listeBoundarys* GetAllBoundarysName(); + HOMARD::listeCases* GetAllCasesName(); + HOMARD::listeHypotheses* GetAllHypothesesName(); + HOMARD::listeIterations* GetAllIterationsName(); + HOMARD::listeYACSs* GetAllYACSsName(); + HOMARD::listeZones* GetAllZonesName(); + + void MeshInfo (const char* nomCas, + const char* MeshName, const char* FileName, const char* DirName, + CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte); + + HOMARD::HOMARD_Iteration_ptr LastIteration (const char* nomCas); + +// L'etude + void UpdateStudy(); + void IsValidStudy(); + +// Liens entre structures + void InvalideBoundary(const char* nomBoundary); + void InvalideHypo(const char* nomHypo); + void InvalideIter(const char* nomIter); + void InvalideIterOption(const char* nomIter, CORBA::Long Option); + void InvalideIterInfo(const char* nomIter); + void InvalideYACS(const char* nomYACS); + void InvalideZone(const char* nomZone); + + CORBA::Long DeleteBoundary(const char* nomBoundary); + CORBA::Long DeleteCase(const char* nomCas, CORBA::Long Option); + CORBA::Long DeleteHypo(const char* nomHypothesis); + CORBA::Long DeleteIteration(const char* nomIter, CORBA::Long Option); + CORBA::Long DeleteIterationOption(const char* nomIter, CORBA::Long Option1, CORBA::Long Option2); + CORBA::Long DeleteYACS(const char* nomYACS, CORBA::Long Option); + CORBA::Long DeleteZone(const char* nomZone); + + void AssociateIterHypo(const char* nomIter, const char* nomHypothesis); + + void AssociateHypoZone(const char* nomHypothesis, const char* nomZone, CORBA::Long TypeUse); + void DissociateHypoZone(const char* nomHypothesis, const char* nomZone); + + void AssociateCaseIter(const char* nomCas, const char* nomIter, + const char* labelIter); + +// Actions + void SetEtatIter(const char* nomIter,const CORBA::Long Etat); + char* CreateDirNameIter(const char* nomrep, CORBA::Long num ); + + CORBA::Long Compute(const char* nomIteration, CORBA::Long etatMenage, CORBA::Long modeHOMARD, CORBA::Long Option1, CORBA::Long Option2); + CORBA::Long ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOMARD_Iteration_var myIteration, CORBA::Long etatMenage, HomardDriver* myDriver, CORBA::Long Option1, CORBA::Long Option2); + CORBA::Long ComputeCAO(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOMARD_Iteration_var myIteration, CORBA::Long Option1, CORBA::Long Option2); + CORBA::Long ComputeCAObis(HOMARD::HOMARD_Iteration_var myIteration, CORBA::Long Option1, CORBA::Long Option2); + char* ComputeDirManagement(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOMARD_Iteration_var myIteration, CORBA::Long etatMenage); + char* ComputeDirPaManagement(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOMARD_Iteration_var myIteration); + void DriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver); + void DriverTexteField(HOMARD::HOMARD_Iteration_var myIteration, HOMARD::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver); + int DriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, HomardDriver* myDriver); + void DriverTexteFieldInterp(HOMARD::HOMARD_Iteration_var myIteration, HOMARD::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver); + + char* VerifieDir(const char* nomDir); + + void PublishFileUnderIteration(const char* NomIter, const char* NomFich, const char* Commentaire); + void PublishFileUnderYACS(const char* NomYACS, const char* NomFich, const char* Commentaire); + void PublishBoundaryUnderCase(const char* CaseName, const char* BoundaryName); + void PublishCaseUnderYACS(const char* YACSName, const char* CaseName); + void PublishResultInSmesh(const char* NomFich, CORBA::Long Option); + void DeleteResultInSmesh(std::string NomFich, std::string MeshName); + void PublishMeshIterInSmesh(const char* NomIter); + +// YACS + HOMARD::HOMARD_YACS_ptr CreateYACSSchema (const char* YACSName, const char* nomCas, const char* ScriptFile, const char* DirName, const char* MeshFile); + CORBA::Long YACSWrite(const char* nomYACS); + CORBA::Long YACSWriteOnFile(const char* nomYACS, const char* XMLFile); + std::string YACSDriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, YACSDriver* myDriver); + std::string YACSDriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, YACSDriver* myDriver); + +// Preferences + void SetPreferences() ; + void SetLanguageShort(const char* LanguageShort); + char* GetLanguageShort(); + void SetPublisMesh(CORBA::Long PublisMeshIN, CORBA::Long PublisMeshOUT); + CORBA::Long GetPublisMeshIN(); + CORBA::Long GetPublisMeshOUT(); + void SetYACSMaximum(CORBA::Long YACSMaxIter, CORBA::Long YACSMaxNode, CORBA::Long YACSMaxElem); + CORBA::Long GetYACSMaxIter(); + CORBA::Long GetYACSMaxNode(); + CORBA::Long GetYACSMaxElem(); + void SetYACSConvergenceType(CORBA::Long YACSTypeTest); + CORBA::Long GetYACSConvergenceType(); + + + // --------------------------------------------------------------- + // next functions are inherited from SALOMEDS::Driver interface + // --------------------------------------------------------------- + + // --> Persistence + virtual SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent, + const char* theURL, + CORBA::Boolean isMultiFile); + + virtual SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent, + const char* theURL, + CORBA::Boolean isMultiFile); + + virtual CORBA::Boolean Load(SALOMEDS::SComponent_ptr theComponent, + const SALOMEDS::TMPFile& theStream, + const char* theURL, + CORBA::Boolean isMultiFile); + + virtual CORBA::Boolean LoadASCII(SALOMEDS::SComponent_ptr theComponent, + const SALOMEDS::TMPFile& theStream, + const char* theURL, + CORBA::Boolean isMultiFile); + + virtual void Close(SALOMEDS::SComponent_ptr IORSComponent); + + virtual char* ComponentDataType(); + + virtual char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject, + const char* IORString, + CORBA::Boolean isMultiFile, + CORBA::Boolean isASCII); + + virtual char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, + const char* aLocalPersistentID, + CORBA::Boolean isMultiFile, + CORBA::Boolean isASCII); + + // --> Data publishing + virtual CORBA::Boolean CanPublishInStudy(CORBA::Object_ptr theIOR); + + virtual SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::SObject_ptr theSObject, + CORBA::Object_ptr theObject, + const char* theName); + + // --> Copy/Paste + virtual CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject); + + virtual SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, + CORBA::Long& theObjectID); + + virtual CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID); + + virtual SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream, + CORBA::Long theObjectID, + SALOMEDS::SObject_ptr theObject); + +// virtual void SALOMEException( std::string message ); + +private: + SALOMEDS::SObject_ptr PublishBoundaryInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, + HOMARD::HOMARD_Boundary_ptr theObject, const char* theName); + SALOMEDS::SObject_ptr PublishCaseInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, + HOMARD::HOMARD_Cas_ptr theObject, const char* theName); + SALOMEDS::SObject_ptr PublishHypotheseInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, + HOMARD::HOMARD_Hypothesis_ptr theObject, const char* theName); + SALOMEDS::SObject_ptr PublishYACSInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, + HOMARD::HOMARD_YACS_ptr theObject, const char* theName); + SALOMEDS::SObject_ptr PublishZoneInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, + HOMARD::HOMARD_Zone_ptr theObject, const char* theName); + virtual void PublishInStudyAttr(SALOMEDS::StudyBuilder_var aStudyBuilder, + SALOMEDS::SObject_var aResultSO, + const char* theName, const char* comment, const char* icone, const char* ior); + + PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject); + + HOMARD::HOMARD_Boundary_ptr newBoundary(); + HOMARD::HOMARD_Cas_ptr newCase(); + HOMARD::HOMARD_Hypothesis_ptr newHypothesis(); + HOMARD::HOMARD_Iteration_ptr newIteration(); + HOMARD::HOMARD_YACS_ptr newYACS(); + HOMARD::HOMARD_Zone_ptr newZone(); + + + virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished, + CORBA::Boolean isMultiFile, + CORBA::Boolean& isValidScript); + + virtual char* getVersion(); + std::string GetStringInTexte( const std::string Texte, const std::string String, int option ) ; + +private: + struct StudyContext + { + std::map _mesBoundarys; + std::map _mesCas; + std::map _mesHypotheses; + std::map _mesIterations; + std::map _mesYACSs; + std::map _mesZones; + std::map _idmap; + }; + + ::HOMARD_Gen* myHomard; + SALOMEDS::Study_var myStudy; + StudyContext myStudyContext; + SALOME_NamingService* _NS; + + int _tag_gene ; + int _tag_boun ; + int _tag_hypo ; + int _tag_yacs ; + int _tag_zone ; + +// Preferences + std::string _Langue ; + std::string _LangueShort ; + int _PublisMeshIN ; + int _PublisMeshOUT ; + int _YACSMaxIter ; + int _YACSMaxNode ; + int _YACSMaxElem ; + int _YACSTypeTest ; + ; + +}; + +#endif diff --git a/src/ADAPT_I/HOMARD_Hypothesis_i.cxx b/src/ADAPT_I/HOMARD_Hypothesis_i.cxx new file mode 100644 index 000000000..f9c5249f7 --- /dev/null +++ b/src/ADAPT_I/HOMARD_Hypothesis_i.cxx @@ -0,0 +1,506 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#include "HOMARD_Hypothesis_i.hxx" +#include "HOMARD_Gen_i.hxx" +#include "HOMARD_Hypothesis.hxx" +#include "HOMARD_DriverTools.hxx" + +#include "utilities.h" + +//============================================================================= +/*! + * standard constructor + */ +//============================================================================= +HOMARD_Hypothesis_i::HOMARD_Hypothesis_i() +{ + MESSAGE( "Default constructor, not for use" ); + ASSERT( 0 ); +} + +//============================================================================= +/*! + * standard constructor + */ +//============================================================================= +HOMARD_Hypothesis_i::HOMARD_Hypothesis_i( CORBA::ORB_ptr orb, + HOMARD::HOMARD_Gen_var engine ) +{ + MESSAGE( "standard constructor" ); + _gen_i = engine; + _orb = orb; + myHomardHypothesis = new ::HOMARD_Hypothesis(); + ASSERT( myHomardHypothesis ); +} + +//============================================================================= +/*! + * standard destructor + */ +//============================================================================= +HOMARD_Hypothesis_i::~HOMARD_Hypothesis_i() +{ +} +//============================================================================= +//============================================================================= +// Generalites +//============================================================================= +//============================================================================= +void HOMARD_Hypothesis_i::SetName( const char* Name ) +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->SetName( Name ); +} +//============================================================================= +char* HOMARD_Hypothesis_i::GetName() +{ + ASSERT( myHomardHypothesis ); + return CORBA::string_dup( myHomardHypothesis->GetName().c_str() ); +} +//============================================================================= +CORBA::Long HOMARD_Hypothesis_i::Delete() +{ + ASSERT( myHomardHypothesis ); + char* HypoName = GetName() ; + MESSAGE ( "Delete : destruction de l'hypothese " << HypoName ); + return _gen_i->DeleteHypo(HypoName) ; +} +//============================================================================= +char* HOMARD_Hypothesis_i::GetDumpPython() +{ + ASSERT( myHomardHypothesis ); + return CORBA::string_dup( myHomardHypothesis->GetDumpPython().c_str() ); +} +//============================================================================= +std::string HOMARD_Hypothesis_i::Dump() const +{ + return HOMARD::Dump( *myHomardHypothesis ); +} +//============================================================================= +bool HOMARD_Hypothesis_i::Restore( const std::string& stream ) +{ + return HOMARD::Restore( *myHomardHypothesis, stream ); +} +//============================================================================= +//============================================================================= +// Caracteristiques +//============================================================================= +//============================================================================= +void HOMARD_Hypothesis_i::SetUnifRefinUnRef( CORBA::Long TypeRaffDera ) +{ + ASSERT( myHomardHypothesis ); + VERIFICATION( (TypeRaffDera==1) || (TypeRaffDera==-1) ); + int TypeRaff, TypeDera ; + if ( TypeRaffDera == 1 ) + { + TypeRaff = 1 ; + TypeDera = 0 ; + } + else if ( TypeRaffDera == -1 ) + { + TypeRaff = 0 ; + TypeDera = 1 ; + } + myHomardHypothesis->SetAdapType( -1 ); + myHomardHypothesis->SetRefinTypeDera( TypeRaff, TypeDera ); +} +//============================================================================= +HOMARD::listeTypes* HOMARD_Hypothesis_i::GetAdapRefinUnRef() +{ + ASSERT( myHomardHypothesis ); + HOMARD::listeTypes_var aResult = new HOMARD::listeTypes; + aResult->length( 3 ); + aResult[0] = CORBA::Long( myHomardHypothesis->GetAdapType() ); + aResult[1] = CORBA::Long( myHomardHypothesis->GetRefinType() ); + aResult[2] = CORBA::Long( myHomardHypothesis->GetUnRefType() ); + return aResult._retn(); +} +//============================================================================= +CORBA::Long HOMARD_Hypothesis_i::GetAdapType() +{ + ASSERT( myHomardHypothesis ); + return CORBA::Long( myHomardHypothesis->GetAdapType() ); +} +//============================================================================= +CORBA::Long HOMARD_Hypothesis_i::GetRefinType() +{ + ASSERT( myHomardHypothesis ); + return CORBA::Long( myHomardHypothesis->GetRefinType() ); +} +//============================================================================= +CORBA::Long HOMARD_Hypothesis_i::GetUnRefType() +{ + ASSERT( myHomardHypothesis ); + return CORBA::Long( myHomardHypothesis->GetUnRefType() ); +} +//============================================================================= +void HOMARD_Hypothesis_i::SetField( const char* FieldName ) +{ + myHomardHypothesis->SetField( FieldName ); +} +//============================================================================= +char* HOMARD_Hypothesis_i::GetFieldName() +{ + ASSERT( myHomardHypothesis ); + return CORBA::string_dup( myHomardHypothesis->GetFieldName().c_str() ); +} +//============================================================================= +void HOMARD_Hypothesis_i::SetUseField( CORBA::Long UsField ) +{ + myHomardHypothesis->SetUseField( UsField ); +} +//============================================================================= +HOMARD::InfosHypo* HOMARD_Hypothesis_i::GetField() +{ + ASSERT( myHomardHypothesis ); + HOMARD::InfosHypo* aInfosHypo = new HOMARD::InfosHypo(); + aInfosHypo->FieldName = CORBA::string_dup( myHomardHypothesis->GetFieldName().c_str() ); + aInfosHypo->TypeThR = CORBA::Long( myHomardHypothesis->GetRefinThrType() ); + aInfosHypo->ThreshR = CORBA::Double( myHomardHypothesis->GetThreshR() ); + aInfosHypo->TypeThC = CORBA::Long( myHomardHypothesis->GetUnRefThrType() ); + aInfosHypo->ThreshC = CORBA::Double( myHomardHypothesis->GetThreshC() ); + aInfosHypo->UsField = CORBA::Long( myHomardHypothesis->GetUseField() ); + aInfosHypo->UsCmpI = CORBA::Long( myHomardHypothesis->GetUseComp() ); + return aInfosHypo; +} +//============================================================================= +void HOMARD_Hypothesis_i::SetUseComp( CORBA::Long UsCmpI ) +{ + myHomardHypothesis->SetUseComp( UsCmpI ); +} +//============================================================================= +void HOMARD_Hypothesis_i::AddComp( const char* NomComp ) +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->AddComp( NomComp ); +} +//============================================================================= +void HOMARD_Hypothesis_i::SupprComp( const char* NomComp ) +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->SupprComp(NomComp); +} +//============================================================================= +void HOMARD_Hypothesis_i::SupprComps() +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->SupprComps(); +} +//============================================================================= +HOMARD::listeComposantsHypo* HOMARD_Hypothesis_i::GetComps() +{ + ASSERT( myHomardHypothesis ); + const std::list& ListString = myHomardHypothesis->GetComps(); + HOMARD::listeComposantsHypo_var aResult = new HOMARD::listeComposantsHypo; + aResult->length( ListString.size() ); + std::list::const_iterator it; + int i = 0; + for ( it = ListString.begin(); it != ListString.end(); it++ ) + { + aResult[i++] = CORBA::string_dup( (*it).c_str() ); + } + return aResult._retn(); +} +//============================================================================= +void HOMARD_Hypothesis_i::SetRefinThr( CORBA::Long TypeThR, CORBA::Double ThreshR ) +{ + myHomardHypothesis->SetAdapType( 1 ); + if ( TypeThR > 0 ) + { + int TypeDera = myHomardHypothesis->GetUnRefType() ; + myHomardHypothesis->SetRefinTypeDera( 1, TypeDera ); + } + myHomardHypothesis->SetRefinThr( TypeThR, ThreshR ); +} +//============================================================================= +CORBA::Long HOMARD_Hypothesis_i::GetRefinThrType() +{ + ASSERT( myHomardHypothesis ); + return CORBA::Long( myHomardHypothesis->GetRefinThrType() ); +} +//============================================================================= +void HOMARD_Hypothesis_i::SetUnRefThr( CORBA::Long TypeThC, CORBA::Double ThreshC ) +{ + myHomardHypothesis->SetAdapType( 1 ); + if ( TypeThC > 0 ) + { + int TypeRaff = myHomardHypothesis->GetRefinType() ; + myHomardHypothesis->SetRefinTypeDera( TypeRaff, 1 ); + } + myHomardHypothesis->SetUnRefThr( TypeThC, ThreshC ); +} +//============================================================================= +CORBA::Long HOMARD_Hypothesis_i::GetUnRefThrType() +{ + ASSERT( myHomardHypothesis ); + return CORBA::Long( myHomardHypothesis->GetUnRefThrType() ); +} +//============================================================================= +void HOMARD_Hypothesis_i::SetNivMax( CORBA::Long NivMax ) +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->SetNivMax( NivMax ); +} +//============================================================================= +CORBA::Long HOMARD_Hypothesis_i::GetNivMax() +{ + ASSERT( myHomardHypothesis ); + return myHomardHypothesis->GetNivMax(); +} +//============================================================================= +void HOMARD_Hypothesis_i::SetDiamMin( CORBA::Double DiamMin ) +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->SetDiamMin( DiamMin ); +} +//============================================================================= +CORBA::Double HOMARD_Hypothesis_i::GetDiamMin() +{ + ASSERT( myHomardHypothesis ); + return myHomardHypothesis->GetDiamMin(); +} +//============================================================================= +void HOMARD_Hypothesis_i::SetAdapInit( CORBA::Long AdapInit ) +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->SetAdapInit( AdapInit ); +} +//============================================================================= +CORBA::Long HOMARD_Hypothesis_i::GetAdapInit() +{ + ASSERT( myHomardHypothesis ); + return myHomardHypothesis->GetAdapInit(); +} +//============================================================================= +void HOMARD_Hypothesis_i::SetExtraOutput( CORBA::Long ExtraOutput ) +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->SetExtraOutput( ExtraOutput ); +} +//============================================================================= +CORBA::Long HOMARD_Hypothesis_i::GetExtraOutput() +{ + ASSERT( myHomardHypothesis ); + return myHomardHypothesis->GetExtraOutput(); +} +//============================================================================= +void HOMARD_Hypothesis_i::AddGroup( const char* Group) +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->AddGroup( Group ); +} +//============================================================================= +void HOMARD_Hypothesis_i::SupprGroup( const char* Group ) +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->SupprGroup(Group); +} +//============================================================================= +void HOMARD_Hypothesis_i::SupprGroups() +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->SupprGroups(); +} +//============================================================================= +void HOMARD_Hypothesis_i::SetGroups(const HOMARD::ListGroupType& ListGroup) +{ + ASSERT( myHomardHypothesis ); + std::list ListString; + for ( int i = 0; i < ListGroup.length(); i++ ) + { + ListString.push_back(std::string(ListGroup[i])); + } + myHomardHypothesis->SetGroups( ListString ); +} +//============================================================================= +HOMARD::ListGroupType* HOMARD_Hypothesis_i::GetGroups() +{ + ASSERT( myHomardHypothesis ); + const std::list& ListString = myHomardHypothesis->GetGroups(); + HOMARD::ListGroupType_var aResult = new HOMARD::ListGroupType; + aResult->length( ListString.size() ); + std::list::const_iterator it; + int i = 0; + for ( it = ListString.begin(); it != ListString.end(); it++ ) + { + aResult[i++] = CORBA::string_dup( (*it).c_str() ); + } + return aResult._retn(); +} +//============================================================================= +void HOMARD_Hypothesis_i::SetTypeFieldInterp( CORBA::Long TypeFieldInterp ) +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->SetTypeFieldInterp( TypeFieldInterp ); +} +//============================================================================= +CORBA::Long HOMARD_Hypothesis_i::GetTypeFieldInterp() +{ + ASSERT( myHomardHypothesis ); + return CORBA::Long( myHomardHypothesis->GetTypeFieldInterp() ); +} +//============================================================================= +void HOMARD_Hypothesis_i::AddFieldInterp( const char* FieldInterp ) +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->AddFieldInterpType( FieldInterp, 0 ); +} +//============================================================================= +void HOMARD_Hypothesis_i::AddFieldInterpType( const char* FieldInterp, CORBA::Long TypeInterp ) +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->AddFieldInterpType( FieldInterp, TypeInterp ); +} +//============================================================================= +void HOMARD_Hypothesis_i::SupprFieldInterp( const char* FieldInterp ) +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->SupprFieldInterp(FieldInterp); +} +//============================================================================= +void HOMARD_Hypothesis_i::SupprFieldInterps() +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->SupprFieldInterps(); +} +//============================================================================= +HOMARD::listeFieldInterpsHypo* HOMARD_Hypothesis_i::GetFieldInterps() +{ + ASSERT( myHomardHypothesis ); + const std::list& ListString = myHomardHypothesis->GetFieldInterps(); + HOMARD::listeFieldInterpsHypo_var aResult = new HOMARD::listeFieldInterpsHypo; + aResult->length( ListString.size() ); + std::list::const_iterator it; + int i = 0; + for ( it = ListString.begin(); it != ListString.end(); it++ ) + { + aResult[i++] = CORBA::string_dup( (*it).c_str() ); + } + return aResult._retn(); +} +//============================================================================= +//============================================================================= +// Liens avec les autres structures +//============================================================================= +//============================================================================= +void HOMARD_Hypothesis_i::SetCaseCreation( const char* NomCaseCreation ) +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->SetCaseCreation( NomCaseCreation ); +} +//============================================================================= +char* HOMARD_Hypothesis_i::GetCaseCreation() +{ + ASSERT( myHomardHypothesis ); + return CORBA::string_dup( myHomardHypothesis->GetCaseCreation().c_str() ); +} +//============================================================================= +void HOMARD_Hypothesis_i::LinkIteration( const char* NomIteration ) +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->LinkIteration( NomIteration ); +} +//============================================================================= +void HOMARD_Hypothesis_i::UnLinkIteration( const char* NomIteration ) +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->UnLinkIteration( NomIteration ); +} +//============================================================================= +HOMARD::listeIters* HOMARD_Hypothesis_i::GetIterations() +{ + ASSERT( myHomardHypothesis ); + const std::list& ListString = myHomardHypothesis->GetIterations(); + HOMARD::listeIters_var aResult = new HOMARD::listeIters; + aResult->length( ListString.size() ); + std::list::const_iterator it; + int i = 0; + for ( it = ListString.begin(); it != ListString.end(); it++ ) + { + aResult[i++] = CORBA::string_dup( (*it).c_str() ); + } + return aResult._retn(); +} +//============================================================================= +void HOMARD_Hypothesis_i::AddZone( const char* NomZone, CORBA::Long TypeUse ) +{ + MESSAGE ("Dans AddZone pour " << NomZone << " et TypeUse = " << TypeUse ) ; + ASSERT( myHomardHypothesis ); + VERIFICATION( (TypeUse==1) || (TypeUse==-1) ); + myHomardHypothesis->SetAdapType( 0 ); + int TypeRaff, TypeDera ; + if ( TypeUse == 1 ) + { + TypeRaff = 1 ; + TypeDera = myHomardHypothesis->GetUnRefType() ; + } + else if ( TypeUse == -1 ) + { + TypeRaff = myHomardHypothesis->GetRefinType() ; + TypeDera = 1 ; + } + myHomardHypothesis->SetRefinTypeDera( TypeRaff, TypeDera ); + char* NomHypo = GetName() ; + return _gen_i->AssociateHypoZone(NomHypo, NomZone, TypeUse) ; +} +//============================================================================= +void HOMARD_Hypothesis_i::AddZone0( const char* NomZone, CORBA::Long TypeUse ) +{ + MESSAGE ("Dans AddZone0 pour " << NomZone) ; + ASSERT( myHomardHypothesis ); + myHomardHypothesis->AddZone( NomZone, TypeUse ); +} +//============================================================================= +void HOMARD_Hypothesis_i::SupprZone(const char * NomZone) +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->SupprZone( NomZone); +} +//============================================================================= +void HOMARD_Hypothesis_i::SupprZones() +{ + ASSERT( myHomardHypothesis ); + myHomardHypothesis->SupprZones(); +} +//============================================================================= +HOMARD::listeZonesHypo* HOMARD_Hypothesis_i::GetZones() +{ + ASSERT( myHomardHypothesis ); + const std::list& ListString = myHomardHypothesis->GetZones(); + HOMARD::listeZonesHypo_var aResult = new HOMARD::listeZonesHypo; + aResult->length( ListString.size() ); + std::list::const_iterator it; + int i = 0; + for ( it = ListString.begin(); it != ListString.end(); it++ ) + { + aResult[i++] = CORBA::string_dup( (*it).c_str() ); + } + return aResult._retn(); +} diff --git a/src/ADAPT_I/HOMARD_Hypothesis_i.hxx b/src/ADAPT_I/HOMARD_Hypothesis_i.hxx new file mode 100644 index 000000000..79c4e6b24 --- /dev/null +++ b/src/ADAPT_I/HOMARD_Hypothesis_i.hxx @@ -0,0 +1,138 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#ifndef _HOMARD_HYPOTHESIS_I_HXX_ +#define _HOMARD_HYPOTHESIS_I_HXX_ + +#include +#include CORBA_SERVER_HEADER(HOMARD_Gen) +#include CORBA_SERVER_HEADER(HOMARD_Hypothesis) + +#include "HOMARD_i.hxx" +#include "SALOME_Component_i.hxx" +#include "SALOME_NamingService.hxx" +#include "Utils_CorbaException.hxx" + +#include + +class HOMARD_Hypothesis; + +class HOMARDENGINE_EXPORT HOMARD_Hypothesis_i: + public virtual Engines_Component_i, + public virtual POA_HOMARD::HOMARD_Hypothesis, + public virtual PortableServer::ServantBase +{ +public: + HOMARD_Hypothesis_i( CORBA::ORB_ptr orb, HOMARD::HOMARD_Gen_var gen_i ); + HOMARD_Hypothesis_i(); + + virtual ~HOMARD_Hypothesis_i(); + +// Generalites + void SetName( const char* Name ); + char* GetName(); + + CORBA::Long Delete(); + + char* GetDumpPython(); + + std::string Dump() const; + bool Restore( const std::string& stream ); + +// Caracteristiques + void SetUnifRefinUnRef( CORBA::Long TypeRaffDera ); + HOMARD::listeTypes* GetAdapRefinUnRef(); + CORBA::Long GetAdapType(); + CORBA::Long GetRefinType(); + CORBA::Long GetUnRefType(); + + void SetField( const char* FieldName ); + char* GetFieldName(); + void SetUseField(CORBA::Long UsField); + HOMARD::InfosHypo* GetField(); + + void SetUseComp(CORBA::Long UsCmpI); + void AddComp( const char* NomComp ); + void SupprComp( const char* NomComp ); + void SupprComps(); + HOMARD::listeComposantsHypo* GetComps(); + + void SetRefinThr(CORBA::Long TypeThR, CORBA::Double ThreshR); + CORBA::Long GetRefinThrType(); + void SetUnRefThr(CORBA::Long TypeThC, CORBA::Double ThreshC); + CORBA::Long GetUnRefThrType(); + + void SetNivMax( CORBA::Long NivMax ); + CORBA::Long GetNivMax(); + + void SetDiamMin( CORBA::Double DiamMin ); + CORBA::Double GetDiamMin(); + + void SetAdapInit( CORBA::Long AdapInit ); + CORBA::Long GetAdapInit(); + + void SetExtraOutput( CORBA::Long ExtraOutput ); + CORBA::Long GetExtraOutput(); + + void AddGroup( const char* Group); + void SupprGroup( const char* Group ); + void SupprGroups(); + void SetGroups(const HOMARD::ListGroupType& ListGroup); + HOMARD::ListGroupType* GetGroups(); + + void SetTypeFieldInterp( CORBA::Long TypeFieldInterp ); + CORBA::Long GetTypeFieldInterp(); + void AddFieldInterp( const char* FieldInterp ); + void AddFieldInterpType( const char* FieldInterp, CORBA::Long TypeInterp ); + void SupprFieldInterp( const char* FieldInterp ); + void SupprFieldInterps(); + HOMARD::listeFieldInterpsHypo* GetFieldInterps(); + +// Liens avec les autres structures + void SetCaseCreation( const char* NomCaseCreation ); + char* GetCaseCreation(); + + void LinkIteration( const char* NomIteration ); + void UnLinkIteration( const char* NomIteration ); + HOMARD::listeIters* GetIterations(); + + void AddZone( const char* NomZone, CORBA::Long TypeUse ); + void AddZone0( const char* NomZone, CORBA::Long TypeUse ); + void SupprZone( const char* NomZone ); + void SupprZones(); + HOMARD::listeZonesHypo* GetZones(); + +private: + ::HOMARD_Hypothesis* myHomardHypothesis; + + CORBA::ORB_ptr _orb; + HOMARD::HOMARD_Gen_var _gen_i; +}; + +#endif diff --git a/src/ADAPT_I/HOMARD_Iteration_i.cxx b/src/ADAPT_I/HOMARD_Iteration_i.cxx new file mode 100644 index 000000000..640c13062 --- /dev/null +++ b/src/ADAPT_I/HOMARD_Iteration_i.cxx @@ -0,0 +1,465 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#include "HOMARD_Iteration_i.hxx" +#include "HOMARD_Gen_i.hxx" +#include "HOMARD_Iteration.hxx" +#include "HOMARD_DriverTools.hxx" + +#include "SALOMEDS_Tool.hxx" + +#include "utilities.h" + +//============================================================================= +/*! + * standard constructor + */ +//============================================================================= +HOMARD_Iteration_i::HOMARD_Iteration_i() +{ + MESSAGE( "Default constructor, not for use" ); + ASSERT( 0 ); +} +//============================================================================= +/*! + * standard constructor + */ +//============================================================================= +HOMARD_Iteration_i::HOMARD_Iteration_i( CORBA::ORB_ptr orb, + HOMARD::HOMARD_Gen_var engine ) +{ + MESSAGE("constructor"); + _gen_i = engine; + _orb = orb; + myHomardIteration = new ::HOMARD_Iteration(); + ASSERT( myHomardIteration ); +} +//============================================================================= +/*! + * standard destructor + */ +//============================================================================= +HOMARD_Iteration_i::~HOMARD_Iteration_i() +{ +} +//============================================================================= +//============================================================================= +// Generalites +//============================================================================= +//============================================================================= +void HOMARD_Iteration_i::SetName( const char* Name ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetName( Name ); +} +//============================================================================= +char* HOMARD_Iteration_i::GetName() +{ + ASSERT( myHomardIteration ); + return CORBA::string_dup( myHomardIteration->GetName().c_str() ); +} +//============================================================================= +CORBA::Long HOMARD_Iteration_i::Delete( CORBA::Long Option ) +{ + ASSERT( myHomardIteration ); + char* IterName = GetName() ; + MESSAGE ( "Delete : destruction de l'iteration " << IterName << ", Option = " << Option ); + return _gen_i->DeleteIteration(IterName, Option) ; +} +//============================================================================= +char* HOMARD_Iteration_i::GetDumpPython() +{ + ASSERT( myHomardIteration ); + return CORBA::string_dup( myHomardIteration->GetDumpPython().c_str() ); +} +//============================================================================= +std::string HOMARD_Iteration_i::Dump() const +{ + return HOMARD::Dump( *myHomardIteration ); +} +//============================================================================= +bool HOMARD_Iteration_i::Restore( const std::string& stream ) +{ + return HOMARD::Restore( *myHomardIteration, stream ); +} +//============================================================================= +//============================================================================= +// Caracteristiques +//============================================================================= +//============================================================================= +void HOMARD_Iteration_i::SetDirNameLoc( const char* NomDir ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetDirNameLoc( NomDir ); +} +//============================================================================= +char* HOMARD_Iteration_i::GetDirNameLoc() +{ + ASSERT( myHomardIteration ); + return CORBA::string_dup( myHomardIteration->GetDirNameLoc().c_str() ); +} +//============================================================================= +char* HOMARD_Iteration_i::GetDirName() +{ + ASSERT( myHomardIteration ); + std::string casename = myHomardIteration->GetCaseName() ; + HOMARD::HOMARD_Cas_ptr caseiter = _gen_i->GetCase(casename.c_str()) ; + std::string dirnamecase = caseiter->GetDirName() ; + std::string dirname = dirnamecase + "/" + GetDirNameLoc() ; + return CORBA::string_dup( dirname.c_str() ); +} +//============================================================================= +void HOMARD_Iteration_i::SetNumber( CORBA::Long NumIter ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetNumber( NumIter ); +} +//============================================================================= +CORBA::Long HOMARD_Iteration_i::GetNumber() +{ + ASSERT( myHomardIteration ); + return myHomardIteration->GetNumber() ; +} +//============================================================================= +void HOMARD_Iteration_i::SetState( CORBA::Long Etat ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetState( Etat ); +} +//============================================================================= +CORBA::Long HOMARD_Iteration_i::GetState() +{ + ASSERT( myHomardIteration ); + return myHomardIteration->GetState() ; +} +//============================================================================= +void HOMARD_Iteration_i::SetMeshName( const char* NomMesh ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetMeshName( NomMesh ); +} +//============================================================================= +char* HOMARD_Iteration_i::GetMeshName() +{ + ASSERT( myHomardIteration ); + return CORBA::string_dup( myHomardIteration->GetMeshName().c_str() ); +} +//============================================================================= +void HOMARD_Iteration_i::SetMeshFile( const char* MeshFile ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetMeshFile( MeshFile ); +} +//============================================================================= +char* HOMARD_Iteration_i::GetMeshFile() +{ + ASSERT( myHomardIteration ); + return CORBA::string_dup( myHomardIteration->GetMeshFile().c_str() ); +} +//============================================================================= +void HOMARD_Iteration_i::SetFieldFile( const char* FieldFile ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetFieldFile( FieldFile ); +} +//============================================================================= +char* HOMARD_Iteration_i::GetFieldFile() +{ + ASSERT( myHomardIteration ); + return CORBA::string_dup( myHomardIteration->GetFieldFile().c_str() ); +} +//============================================================================= +// Instants pour le champ de pilotage +//============================================================================= +void HOMARD_Iteration_i::SetTimeStep( CORBA::Long TimeStep ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetTimeStep( TimeStep ); +} +//============================================================================= +void HOMARD_Iteration_i::SetTimeStepRank( CORBA::Long TimeStep, CORBA::Long Rank ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetTimeStepRank( TimeStep, Rank ); +} +//============================================================================= +void HOMARD_Iteration_i::SetTimeStepRankLast() +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetTimeStepRankLast(); +} +//============================================================================= +CORBA::Long HOMARD_Iteration_i::GetTimeStep() +{ + ASSERT( myHomardIteration ); + return CORBA::Long( myHomardIteration->GetTimeStep() ); +} +//============================================================================= +CORBA::Long HOMARD_Iteration_i::GetRank() +{ + ASSERT( myHomardIteration ); + return CORBA::Long( myHomardIteration->GetRank() ); +} +//============================================================================= +// Instants pour un champ a interpoler +//============================================================================= +void HOMARD_Iteration_i::SetFieldInterpTimeStep( const char* FieldInterp, CORBA::Long TimeStep ) +{ + SetFieldInterpTimeStepRank( FieldInterp, TimeStep, TimeStep ); +} +//============================================================================= +void HOMARD_Iteration_i::SetFieldInterpTimeStepRank( const char* FieldInterp, CORBA::Long TimeStep, CORBA::Long Rank ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetFieldInterpTimeStepRank( FieldInterp, TimeStep, Rank ); +} +//============================================================================= +HOMARD::listeFieldInterpTSRsIter* HOMARD_Iteration_i::GetFieldInterpsTimeStepRank() +{ + ASSERT( myHomardIteration ); + const std::list& ListString = myHomardIteration->GetFieldInterpsTimeStepRank(); + HOMARD::listeFieldInterpTSRsIter_var aResult = new HOMARD::listeFieldInterpTSRsIter; + aResult->length( ListString.size() ); + std::list::const_iterator it; + int i = 0; + for ( it = ListString.begin(); it != ListString.end(); it++ ) + { + aResult[i++] = CORBA::string_dup( (*it).c_str() ); + } + return aResult._retn(); +} +//============================================================================= +void HOMARD_Iteration_i::SetFieldInterp( const char* FieldInterp ) +{ + myHomardIteration->SetFieldInterp( FieldInterp ); +} +//============================================================================= +HOMARD::listeFieldInterpsIter* HOMARD_Iteration_i::GetFieldInterps() +{ + ASSERT( myHomardIteration ); + const std::list& ListString = myHomardIteration->GetFieldInterps(); + HOMARD::listeFieldInterpsIter_var aResult = new HOMARD::listeFieldInterpsIter; + aResult->length( ListString.size() ); + std::list::const_iterator it; + int i = 0; + for ( it = ListString.begin(); it != ListString.end(); it++ ) + { + aResult[i++] = CORBA::string_dup( (*it).c_str() ); + } + return aResult._retn(); +} +//============================================================================= +void HOMARD_Iteration_i::SupprFieldInterps() +{ + ASSERT( myHomardIteration ); + myHomardIteration->SupprFieldInterps(); +} +//============================================================================= +void HOMARD_Iteration_i::SetLogFile( const char* LogFile ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetLogFile( LogFile ); +} +//============================================================================= +char* HOMARD_Iteration_i::GetLogFile() +{ + ASSERT( myHomardIteration ); + return CORBA::string_dup( myHomardIteration->GetLogFile().c_str() ); +} +//============================================================================= +CORBA::Long HOMARD_Iteration_i::Compute(CORBA::Long etatMenage, CORBA::Long Option) +{ + MESSAGE ( "Compute : calcul d'une iteration, etatMenage = "<Compute(IterName, etatMenage, modeHOMARD, Option1, Option) ; +} +//============================================================================= +void HOMARD_Iteration_i::MeshInfo(CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte) +{ + MESSAGE ( "MeshInfo : information sur le maillage associe a une iteration" ); + ASSERT( myHomardIteration ); +// + int Option = 1 ; + MeshInfoOption( Qual, Diam, Conn, Tail, Inte, Option ) ; +// + return ; +} +//============================================================================= +void HOMARD_Iteration_i::MeshInfoOption(CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte, CORBA::Long Option) +{ + MESSAGE ( "MeshInfoOption : information sur le maillage associe a une iteration" ); + ASSERT( myHomardIteration ); +// +// Nom de l'iteration + char* IterName = GetName() ; + CORBA::Long etatMenage = -1 ; + CORBA::Long modeHOMARD = 7 ; + if ( Qual != 0 ) { modeHOMARD = modeHOMARD*5 ; } + if ( Diam != 0 ) { modeHOMARD = modeHOMARD*19 ; } + if ( Conn != 0 ) { modeHOMARD = modeHOMARD*11 ; } + if ( Tail != 0 ) { modeHOMARD = modeHOMARD*13 ; } + if ( Inte != 0 ) { modeHOMARD = modeHOMARD*3 ; } + MESSAGE ( "MeshInfoOption : information sur le maillage de l'iteration " << IterName ); + CORBA::Long Option2 = 1 ; + CORBA::Long codret = _gen_i->Compute(IterName, etatMenage, modeHOMARD, Option, Option2) ; + MESSAGE ( "MeshInfoOption : codret = " << codret ); +// + return ; +} +//============================================================================= +void HOMARD_Iteration_i::SetFileInfo( const char* FileInfo ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetFileInfo( FileInfo ); +} +//============================================================================= +char* HOMARD_Iteration_i::GetFileInfo() +{ + ASSERT( myHomardIteration ); + return CORBA::string_dup( myHomardIteration->GetFileInfo().c_str() ); +} +//============================================================================= +//============================================================================= +// Liens avec les autres iterations +//============================================================================= +//============================================================================= +HOMARD::HOMARD_Iteration_ptr HOMARD_Iteration_i::NextIteration( const char* IterName ) +{ +// Nom de l'iteration parent + char* NomIterParent = GetName() ; + MESSAGE ( "NextIteration : creation de l'iteration " << IterName << " comme fille de " << NomIterParent ); + return _gen_i->CreateIteration(IterName, NomIterParent) ; +} +//============================================================================= +void HOMARD_Iteration_i::LinkNextIteration( const char* NomIteration ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->LinkNextIteration( NomIteration ); +} +//============================================================================= +void HOMARD_Iteration_i::UnLinkNextIteration( const char* NomIteration ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->UnLinkNextIteration( NomIteration ); +} +//============================================================================= +HOMARD::listeIterFilles* HOMARD_Iteration_i::GetIterations() +{ + ASSERT( myHomardIteration ); + const std::list& maListe = myHomardIteration->GetIterations(); + HOMARD::listeIterFilles_var aResult = new HOMARD::listeIterFilles; + aResult->length( maListe.size() ); + std::list::const_iterator it; + int i = 0; + for ( it = maListe.begin(); it != maListe.end(); it++ ) + { + aResult[i++] = CORBA::string_dup( (*it).c_str() ); + } + return aResult._retn(); +} +//============================================================================= +void HOMARD_Iteration_i::SetIterParentName( const char* NomIterParent ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetIterParentName( NomIterParent ); +} +//============================================================================= +char* HOMARD_Iteration_i::GetIterParentName() +{ + ASSERT( myHomardIteration ); + return CORBA::string_dup( myHomardIteration->GetIterParentName().c_str() ); +} +//============================================================================= +HOMARD::HOMARD_Iteration_ptr HOMARD_Iteration_i::GetIterParent() +{ +// Nom de l'iteration parent + char* NomIterParent = GetIterParentName() ; + MESSAGE ( "GetIterParent : NomIterParent = " << NomIterParent ); + return _gen_i->GetIteration(NomIterParent) ; +} +//============================================================================= +//============================================================================= +// Liens avec les autres structures +//============================================================================= +//============================================================================= +void HOMARD_Iteration_i::SetCaseName( const char* NomCas ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetCaseName( NomCas ); +} +//============================================================================= +char* HOMARD_Iteration_i::GetCaseName() +{ + ASSERT( myHomardIteration ); + return CORBA::string_dup( myHomardIteration->GetCaseName().c_str() ); +} +//============================================================================= +void HOMARD_Iteration_i::AssociateHypo( const char* NomHypo ) +{ + ASSERT( myHomardIteration ); +// +// Nom de l'iteration + char* IterName = GetName() ; + MESSAGE ( ". IterName = " << IterName ); + return _gen_i->AssociateIterHypo(IterName, NomHypo) ; +} +//============================================================================= +void HOMARD_Iteration_i::SetHypoName( const char* NomHypo ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetHypoName( NomHypo ); +} +//============================================================================= +char* HOMARD_Iteration_i::GetHypoName() +{ + ASSERT( myHomardIteration ); + return CORBA::string_dup( myHomardIteration->GetHypoName().c_str() ); +} +//============================================================================= +//============================================================================= +// Divers +//============================================================================= +//============================================================================= +void HOMARD_Iteration_i::SetInfoCompute( CORBA::Long MessInfo ) +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetInfoCompute( MessInfo ); +} +//============================================================================= +CORBA::Long HOMARD_Iteration_i::GetInfoCompute() +{ + ASSERT( myHomardIteration ); + return myHomardIteration->GetInfoCompute() ; +} diff --git a/src/ADAPT_I/HOMARD_Iteration_i.hxx b/src/ADAPT_I/HOMARD_Iteration_i.hxx new file mode 100644 index 000000000..1cc30b67e --- /dev/null +++ b/src/ADAPT_I/HOMARD_Iteration_i.hxx @@ -0,0 +1,145 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#ifndef _HOMARD_ITERATION_I_HXX_ +#define _HOMARD_ITERATION_I_HXX_ + +#include +#include CORBA_SERVER_HEADER(HOMARD_Gen) +#include CORBA_SERVER_HEADER(HOMARD_Iteration) + +#include "HOMARD_i.hxx" +#include "SALOME_Component_i.hxx" +#include "SALOME_NamingService.hxx" +#include "Utils_CorbaException.hxx" + +#include + +class HOMARD_Iteration; + +class HOMARDENGINE_EXPORT HOMARD_Iteration_i: + public virtual Engines_Component_i, + public virtual POA_HOMARD::HOMARD_Iteration, + public virtual PortableServer::ServantBase +{ +public: + HOMARD_Iteration_i( CORBA::ORB_ptr orb, + HOMARD::HOMARD_Gen_var gen_i ); + HOMARD_Iteration_i(); + + virtual ~HOMARD_Iteration_i(); + +// Generalites + void SetName( const char* Name ); + char* GetName(); + + CORBA::Long Delete( CORBA::Long Option ); + + char* GetDumpPython(); + + std::string Dump() const; + bool Restore( const std::string& stream ); + +// Caracteristiques + void SetDirNameLoc( const char* NomDir ); + char* GetDirNameLoc(); + + char* GetDirName(); + + void SetNumber( CORBA::Long NumIter ); + CORBA::Long GetNumber(); + + void SetState( CORBA::Long etat ); + CORBA::Long GetState(); + + void SetMeshName( const char* NomMesh ); + char* GetMeshName(); + + void SetMeshFile( const char* MeshFile ); + char* GetMeshFile(); + + void SetFieldFile( const char* FieldFile ); + char* GetFieldFile(); +// Instants pour le champ de pilotage + void SetTimeStep( CORBA::Long TimeStep ); + void SetTimeStepRank( CORBA::Long TimeStep, CORBA::Long Rank ); + void SetTimeStepRankLast(); + CORBA::Long GetTimeStep(); + CORBA::Long GetRank(); +// Instants pour un champ a interpoler + void SetFieldInterpTimeStep( const char* FieldInterp, CORBA::Long TimeStep ); + void SetFieldInterpTimeStepRank( const char* FieldInterp, CORBA::Long TimeStep, CORBA::Long Rank ); + HOMARD::listeFieldInterpTSRsIter* GetFieldInterpsTimeStepRank(); + void SetFieldInterp( const char* FieldInterp ); + HOMARD::listeFieldInterpsIter* GetFieldInterps(); + void SupprFieldInterps(); + + void SetLogFile( const char* LogFile ); + char* GetLogFile(); + + CORBA::Long Compute(CORBA::Long etatMenage, CORBA::Long Option); + + void MeshInfo(CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte); + + void MeshInfoOption(CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte, CORBA::Long Option); + + void SetFileInfo( const char* FileInfo ); + char* GetFileInfo(); + + // Liens avec les autres iterations + HOMARD::HOMARD_Iteration_ptr NextIteration( const char* Name) ; + + void LinkNextIteration( const char* NomIteration ); + void UnLinkNextIteration( const char* NomIteration ); + HOMARD::listeIterFilles* GetIterations(); + + void SetIterParentName( const char* NomIterParent ); + char* GetIterParentName(); + HOMARD::HOMARD_Iteration_ptr GetIterParent() ; + +// Liens avec les autres structures + void SetCaseName( const char* NomCas ); + char* GetCaseName(); + + void AssociateHypo( const char* NomHypo); + void SetHypoName( const char* NomHypo ); + char* GetHypoName(); + +// Divers + void SetInfoCompute( CORBA::Long MessInfo ); + CORBA::Long GetInfoCompute(); + +private: + ::HOMARD_Iteration* myHomardIteration; + + CORBA::ORB_ptr _orb; + HOMARD::HOMARD_Gen_var _gen_i; +}; + +#endif diff --git a/src/ADAPT_I/HOMARD_YACS_i.cxx b/src/ADAPT_I/HOMARD_YACS_i.cxx new file mode 100644 index 000000000..749d60d71 --- /dev/null +++ b/src/ADAPT_I/HOMARD_YACS_i.cxx @@ -0,0 +1,279 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#include "HOMARD_YACS_i.hxx" +#include "HOMARD_Gen_i.hxx" +#include "HOMARD_YACS.hxx" +#include "HOMARD_DriverTools.hxx" + +#include "SALOMEDS_Tool.hxx" + +#include "utilities.h" + +//============================================================================= +/*! + * standard constructor + */ +//============================================================================= +HOMARD_YACS_i::HOMARD_YACS_i() +{ + MESSAGE( "Default constructor, not for use" ); + ASSERT( 0 ); +} +//============================================================================= +/*! + * standard constructor + */ +//============================================================================= +HOMARD_YACS_i::HOMARD_YACS_i( CORBA::ORB_ptr orb, + HOMARD::HOMARD_Gen_var engine ) +{ + MESSAGE("constructor"); + _gen_i = engine; + _orb = orb; + myHomardYACS = new ::HOMARD_YACS(); + ASSERT( myHomardYACS ); +} +//============================================================================= +/*! + * standard destructor + */ +//============================================================================= +HOMARD_YACS_i::~HOMARD_YACS_i() +{ +} +//============================================================================= +//============================================================================= +// Generalites +//============================================================================= +//============================================================================= +void HOMARD_YACS_i::SetName( const char* Name ) +{ + ASSERT( myHomardYACS ); + myHomardYACS->SetName( Name ); +} +//============================================================================= +char* HOMARD_YACS_i::GetName() +{ + ASSERT( myHomardYACS ); + return CORBA::string_dup( myHomardYACS->GetName().c_str() ); +} +//============================================================================= +CORBA::Long HOMARD_YACS_i::Delete( CORBA::Long Option ) +{ + ASSERT( myHomardYACS ); + char* YACSName = GetName() ; + MESSAGE ( "Delete : destruction du schema " << YACSName << ", Option = " << Option ); + return _gen_i->DeleteYACS(YACSName, Option) ; +} +//============================================================================= +char* HOMARD_YACS_i::GetDumpPython() +{ + ASSERT( myHomardYACS ); + return CORBA::string_dup( myHomardYACS->GetDumpPython().c_str() ); +} +//============================================================================= +std::string HOMARD_YACS_i::Dump() const +{ + return HOMARD::Dump( *myHomardYACS ); +} +//============================================================================= +bool HOMARD_YACS_i::Restore( const std::string& stream ) +{ + return HOMARD::Restore( *myHomardYACS, stream ); +} +//============================================================================= +//============================================================================= +// Caracteristiques +//============================================================================= +//============================================================================= +void HOMARD_YACS_i::SetType( CORBA::Long Type ) +{ + ASSERT( myHomardYACS ); + myHomardYACS->SetType( Type ); +} +//============================================================================= +CORBA::Long HOMARD_YACS_i::GetType() +{ + ASSERT( myHomardYACS ); + return CORBA::Long( myHomardYACS->GetType() ); +} +//============================================================================= +//============================================================================= +// Caracteristiques de la convergence +//============================================================================= +//============================================================================= +void HOMARD_YACS_i::SetMaxIter( CORBA::Long MaxIter ) +{ + ASSERT( myHomardYACS ); + myHomardYACS->SetMaxIter( MaxIter ); +} +//============================================================================= +CORBA::Long HOMARD_YACS_i::GetMaxIter() +{ + ASSERT( myHomardYACS ); + return CORBA::Long( myHomardYACS->GetMaxIter() ); +} +//============================================================================= +void HOMARD_YACS_i::SetMaxNode( CORBA::Long MaxNode ) +{ + ASSERT( myHomardYACS ); + myHomardYACS->SetMaxNode( MaxNode ); +} +//============================================================================= +CORBA::Long HOMARD_YACS_i::GetMaxNode() +{ + ASSERT( myHomardYACS ); + return CORBA::Long( myHomardYACS->GetMaxNode() ); +} +//============================================================================= +void HOMARD_YACS_i::SetMaxElem( CORBA::Long MaxElem ) +{ + ASSERT( myHomardYACS ); + myHomardYACS->SetMaxElem( MaxElem ); +} +//============================================================================= +CORBA::Long HOMARD_YACS_i::GetMaxElem() +{ + ASSERT( myHomardYACS ); + return CORBA::Long( myHomardYACS->GetMaxElem() ); +} +//============================================================================= +void HOMARD_YACS_i::SetTestConvergence( CORBA::Long TypeTest, CORBA::Double VRef) +{ + ASSERT( myHomardYACS ); + myHomardYACS->SetTestConvergence( TypeTest, VRef ); +} +//============================================================================= +CORBA::Long HOMARD_YACS_i::GetTestConvergenceType() +{ + ASSERT( myHomardYACS ); + return CORBA::Long( myHomardYACS->GetTestConvergenceType() ); +} +//============================================================================= +CORBA::Double HOMARD_YACS_i::GetTestConvergenceVRef() +{ + ASSERT( myHomardYACS ); + return CORBA::Long( myHomardYACS->GetTestConvergenceVRef() ); +} +//============================================================================= +//============================================================================= +// Repertoire et fichiers +//============================================================================= +//============================================================================= +void HOMARD_YACS_i::SetDirName( const char* NomDir ) +{ + ASSERT( myHomardYACS ); + myHomardYACS->SetDirName( NomDir ); +} +//============================================================================= +char* HOMARD_YACS_i::GetDirName() +{ + ASSERT( myHomardYACS ); + return CORBA::string_dup( myHomardYACS->GetDirName().c_str() ); +} +//============================================================================= +void HOMARD_YACS_i::SetMeshFile( const char* MeshFile ) +{ + ASSERT( myHomardYACS ); + myHomardYACS->SetMeshFile( MeshFile ); +} +//============================================================================= +char* HOMARD_YACS_i::GetMeshFile() +{ + ASSERT( myHomardYACS ); + return CORBA::string_dup( myHomardYACS->GetMeshFile().c_str() ); +} +//============================================================================= +void HOMARD_YACS_i::SetScriptFile( const char* ScriptFile ) +{ + ASSERT( myHomardYACS ); + myHomardYACS->SetScriptFile( ScriptFile ); +} +//============================================================================= +char* HOMARD_YACS_i::GetScriptFile() +{ + ASSERT( myHomardYACS ); + return CORBA::string_dup( myHomardYACS->GetScriptFile().c_str() ); +} +//============================================================================= +void HOMARD_YACS_i::SetXMLFile( const char* XMLFile ) +{ + ASSERT( myHomardYACS ); + MESSAGE ( "SetXMLFile : SetXMLFile = " << XMLFile ); + myHomardYACS->SetXMLFile( XMLFile ); +} +//============================================================================= +char* HOMARD_YACS_i::GetXMLFile() +{ + ASSERT( myHomardYACS ); + return CORBA::string_dup( myHomardYACS->GetXMLFile().c_str() ); +} +//============================================================================= +//============================================================================= +// Liens avec les autres structures +//============================================================================= +//============================================================================= +void HOMARD_YACS_i::SetCaseName( const char* NomCas ) +{ + ASSERT( myHomardYACS ); + myHomardYACS->SetCaseName( NomCas ); +} +//============================================================================= +char* HOMARD_YACS_i::GetCaseName() +{ + ASSERT( myHomardYACS ); + return CORBA::string_dup( myHomardYACS->GetCaseName().c_str() ); +} +//============================================================================= +CORBA::Long HOMARD_YACS_i::Write() +{ +// + char* nomYACS = GetName() ; + return _gen_i->YACSWrite(nomYACS) ; +} +//============================================================================= +CORBA::Long HOMARD_YACS_i::WriteOnFile( const char* XMLFile ) +{ + MESSAGE ( "WriteOnFile : ecriture du schema sur " << XMLFile ); + ASSERT( myHomardYACS ); +// +// Memorisation du fichier associe + SetXMLFile( XMLFile ) ; +// +// Nom du schema + char* nomYACS = GetName() ; + return _gen_i->YACSWriteOnFile(nomYACS, XMLFile) ; +} +//============================================================================= +//============================================================================= +//============================================================================= +// Divers +//============================================================================= +//============================================================================= diff --git a/src/ADAPT_I/HOMARD_YACS_i.hxx b/src/ADAPT_I/HOMARD_YACS_i.hxx new file mode 100644 index 000000000..806602423 --- /dev/null +++ b/src/ADAPT_I/HOMARD_YACS_i.hxx @@ -0,0 +1,112 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#ifndef _HOMARD_YACS_I_HXX_ +#define _HOMARD_YACS_I_HXX_ + +#include +#include CORBA_SERVER_HEADER(HOMARD_Gen) +#include CORBA_SERVER_HEADER(HOMARD_YACS) + +#include "HOMARD_i.hxx" +#include "SALOME_Component_i.hxx" +#include "SALOME_NamingService.hxx" +#include "Utils_CorbaException.hxx" + +#include + +class HOMARD_YACS; + +class HOMARDENGINE_EXPORT HOMARD_YACS_i: + public virtual Engines_Component_i, + public virtual POA_HOMARD::HOMARD_YACS, + public virtual PortableServer::ServantBase +{ +public: + HOMARD_YACS_i( CORBA::ORB_ptr orb, + HOMARD::HOMARD_Gen_var gen_i ); + HOMARD_YACS_i(); + + virtual ~HOMARD_YACS_i(); + +// Generalites + void SetName( const char* Name ); + char* GetName(); + + CORBA::Long Delete( CORBA::Long Option ); + + char* GetDumpPython(); + + std::string Dump() const; + bool Restore( const std::string& stream ); + +// Caracteristiques + void SetType( CORBA::Long Type ); + CORBA::Long GetType(); + + void SetMaxIter( CORBA::Long MaxIter ); + CORBA::Long GetMaxIter(); + void SetMaxNode( CORBA::Long MaxNode ); + CORBA::Long GetMaxNode(); + void SetMaxElem( CORBA::Long MaxElem ); + CORBA::Long GetMaxElem(); + + void SetTestConvergence( CORBA::Long TypeTest, CORBA::Double VRef ); + CORBA::Long GetTestConvergenceType(); + CORBA::Double GetTestConvergenceVRef(); + + void SetDirName( const char* NomDir ); + char* GetDirName(); + + void SetMeshFile( const char* MeshFile ); + char* GetMeshFile(); + + void SetScriptFile( const char* ScriptFile ); + char* GetScriptFile(); + + void SetXMLFile( const char* XMLFile ); + char* GetXMLFile(); + + CORBA::Long Write() ; + CORBA::Long WriteOnFile( const char* XMLFile ) ; + + // Liens avec les autres structures + void SetCaseName( const char* NomCas ); + char* GetCaseName(); + +// Divers + +private: + ::HOMARD_YACS* myHomardYACS; + + CORBA::ORB_ptr _orb; + HOMARD::HOMARD_Gen_var _gen_i; +}; + +#endif diff --git a/src/ADAPT_I/HOMARD_Zone_i.cxx b/src/ADAPT_I/HOMARD_Zone_i.cxx new file mode 100644 index 000000000..4a16ee5dd --- /dev/null +++ b/src/ADAPT_I/HOMARD_Zone_i.cxx @@ -0,0 +1,218 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#include "HOMARD_Zone_i.hxx" +#include "HOMARD_Gen_i.hxx" +#include "HOMARD_Zone.hxx" +#include "HOMARD_DriverTools.hxx" + +#include "utilities.h" + +//============================================================================= +/*! + * standard constructor + */ +//============================================================================= +HOMARD_Zone_i::HOMARD_Zone_i() +{ + MESSAGE( "Default constructor, not for use" ); + ASSERT( 0 ); +} + +//============================================================================= +/*! + * standard constructor + */ +//============================================================================= +HOMARD_Zone_i::HOMARD_Zone_i( CORBA::ORB_ptr orb, + HOMARD::HOMARD_Gen_var engine ) +{ + MESSAGE( "HOMARD_Zone_i" ); + _gen_i = engine; + _orb = orb; + myHomardZone = new ::HOMARD_Zone(); + ASSERT( myHomardZone ); +} +//============================================================================= +/*! + * standard destructor + */ +//============================================================================= + +HOMARD_Zone_i::~HOMARD_Zone_i() +{ +} +//============================================================================= +//============================================================================= +// Generalites +//============================================================================= +//============================================================================= +void HOMARD_Zone_i::SetName( const char* Name ) +{ + ASSERT( myHomardZone ); + myHomardZone->SetName( Name ); +} +//============================================================================= +char* HOMARD_Zone_i::GetName() +{ + ASSERT( myHomardZone ); + return CORBA::string_dup( myHomardZone->GetName().c_str() ); +} +//============================================================================= +CORBA::Long HOMARD_Zone_i::Delete() +{ + ASSERT( myHomardZone ); + char* ZoneName = GetName() ; + MESSAGE ( "Delete : destruction de la zone " << ZoneName ); + return _gen_i->DeleteZone(ZoneName) ; +} +//============================================================================= +char* HOMARD_Zone_i::GetDumpPython() +{ + ASSERT( myHomardZone ); + return CORBA::string_dup( myHomardZone->GetDumpPython().c_str() ); +} +//============================================================================= +std::string HOMARD_Zone_i::Dump() const +{ + return HOMARD::Dump( *myHomardZone ); +} +//============================================================================= +bool HOMARD_Zone_i::Restore( const std::string& stream ) +{ + return HOMARD::Restore( *myHomardZone, stream ); +} +//============================================================================= +//============================================================================= +// Caracteristiques +//============================================================================= +//============================================================================= +void HOMARD_Zone_i::SetType( CORBA::Long Type ) +{ + ASSERT( myHomardZone ); + myHomardZone->SetType( Type ); +} +//============================================================================= +CORBA::Long HOMARD_Zone_i::GetType() +{ + ASSERT( myHomardZone ); + return CORBA::Long( myHomardZone->GetType() ); +} +//============================================================================= +void HOMARD_Zone_i::SetBox( double X0, double X1, double X2, double X3, double X4, double X5 ) +{ + ASSERT( myHomardZone ); + myHomardZone->SetBox( X0, X1, X2, X3, X4, X5 ); +} +//============================================================================= +void HOMARD_Zone_i::SetCylinder( double Xcentre, double Ycentre, double Zcentre, + double Xaxis, double Yaxis, double Zaxis, + double Rayon, double Haut ) +{ + ASSERT( myHomardZone ); + myHomardZone->SetCylinder( Xcentre, Ycentre, Zcentre, Xaxis, Yaxis, Zaxis, Rayon, Haut ); +} +//============================================================================= +void HOMARD_Zone_i::SetPipe( double Xcentre, double Ycentre, double Zcentre, + double Xaxis, double Yaxis, double Zaxis, + double Rayon, double Haut, double Rayonint ) +{ + ASSERT( myHomardZone ); + myHomardZone->SetPipe( Xcentre, Ycentre, Zcentre, Xaxis, Yaxis, Zaxis, Rayon, Haut, Rayonint ); +} +//============================================================================= +void HOMARD_Zone_i::SetSphere( double Xcentre, double Ycentre, double Zcentre, double Rayon ) +{ + ASSERT( myHomardZone ); + myHomardZone->SetSphere( Xcentre, Ycentre, Zcentre, Rayon ); +} +//============================================================================= +HOMARD::double_array* HOMARD_Zone_i::GetCoords() +{ + ASSERT( myHomardZone ); + HOMARD::double_array_var aResult = new HOMARD::double_array(); + std::vector mesCoor = myHomardZone->GetCoords(); + aResult->length( mesCoor .size() ); + std::vector::const_iterator it; + int i = 0; + for ( it = mesCoor.begin(); it != mesCoor.end(); it++ ) + aResult[i++] = (*it); + return aResult._retn(); +} +//============================================================================= +void HOMARD_Zone_i::SetLimit( double Xincr, double Yincr, double Zincr ) +{ + MESSAGE ("SetLimit, Xincr : " << Xincr << ", Yincr : " << Yincr << ", Zincr : " << Zincr) ; + ASSERT( myHomardZone ); + myHomardZone->SetLimit( Xincr, Yincr, Zincr ); +} +//============================================================================= +HOMARD::double_array* HOMARD_Zone_i::GetLimit() +{ + ASSERT( myHomardZone ); + HOMARD::double_array_var aResult = new HOMARD::double_array(); + std::vector mesCoor = myHomardZone->GetLimit(); + aResult->length( mesCoor .size() ); + std::vector::const_iterator it; + int i = 0; + for ( it = mesCoor.begin(); it != mesCoor.end(); it++ ) + aResult[i++] = (*it); + return aResult._retn(); +} +//============================================================================= +//============================================================================= +// Liens avec les autres structures +//============================================================================= +//============================================================================= +void HOMARD_Zone_i::AddHypo( const char* NomHypo ) +{ + MESSAGE ( " AddHypo, NomHypo= " << NomHypo); + ASSERT( myHomardZone ); + myHomardZone->AddHypo( NomHypo ); +} +//============================================================================= +HOMARD::listeHypo* HOMARD_Zone_i::GetHypo() +{ + ASSERT( myHomardZone ); + const std::list& maListe = myHomardZone->GetHypo(); + HOMARD::listeHypo_var aResult = new HOMARD::listeHypo; + aResult->length( maListe.size() ); + std:: list::const_iterator it; + int i = 0; + for ( it = maListe.begin(); it != maListe.end(); it++ ) + aResult[i++] = CORBA::string_dup( (*it).c_str() ); + return aResult._retn(); +} +//============================================================================= +void HOMARD_Zone_i::SupprHypo( const char* NomHypo ) +{ + ASSERT( myHomardZone ); + myHomardZone->SupprHypo( NomHypo ); +} + diff --git a/src/ADAPT_I/HOMARD_Zone_i.hxx b/src/ADAPT_I/HOMARD_Zone_i.hxx new file mode 100644 index 000000000..84c2d5c00 --- /dev/null +++ b/src/ADAPT_I/HOMARD_Zone_i.hxx @@ -0,0 +1,104 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#ifndef _HOMARD_Zone_I_HXX_ +#define _HOMARD_Zone_I_HXX_ + +#include +#include CORBA_SERVER_HEADER(HOMARD_Gen) +#include CORBA_SERVER_HEADER(HOMARD_Zone) + +#include "HOMARD_i.hxx" +#include "SALOME_Component_i.hxx" +#include "SALOME_NamingService.hxx" +#include "Utils_CorbaException.hxx" + +#include + +class HOMARD_Zone; + +class HOMARDENGINE_EXPORT HOMARD_Zone_i: + public virtual Engines_Component_i, + public virtual POA_HOMARD::HOMARD_Zone, + public virtual PortableServer::ServantBase +{ +public: + HOMARD_Zone_i( CORBA::ORB_ptr orb, HOMARD::HOMARD_Gen_var gen_i ); + HOMARD_Zone_i(); + + virtual ~HOMARD_Zone_i(); + +// Generalites + void SetName( const char* Name ); + char* GetName(); + + CORBA::Long Delete(); + + char* GetDumpPython(); + + std::string Dump() const; + bool Restore( const std::string& stream ); + +// Caracteristiques + void SetType( CORBA::Long Type ); + CORBA::Long GetType(); + + void SetBox( double Xmini, double Xmaxi, + double Ymini, double Ymaxi, + double Zmini, double Zmaxi ); + + void SetCylinder( double Xcentre, double Ycentre, double ZCentre, + double Xaxis, double Yaxis, double Zaxis, + double Rayon, double Haut ); + + void SetPipe( double Xcentre, double Ycentre, double ZCentre, + double Xaxis, double Yaxis, double Zaxis, + double Rayon, double Haut, double Rayonint ); + + void SetSphere( double Xcentre, double Ycentre, double ZCentre, + double Rayon ); + + HOMARD::double_array* GetCoords(); + + void SetLimit( double Xincr, double Yincr, double Zincr); + HOMARD::double_array* GetLimit(); + +// Liens avec les autres structures + void AddHypo( const char *NomHypo ); + HOMARD::listeHypo* GetHypo(); + void SupprHypo( const char *NomHypo ); + +private: + ::HOMARD_Zone* myHomardZone; + + CORBA::ORB_ptr _orb; + HOMARD::HOMARD_Gen_var _gen_i; +}; + +#endif diff --git a/src/ADAPT_I/HOMARD_i.hxx b/src/ADAPT_I/HOMARD_i.hxx new file mode 100644 index 000000000..2f6aad6bd --- /dev/null +++ b/src/ADAPT_I/HOMARD_i.hxx @@ -0,0 +1,35 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef _HOMARD_I_HXX_ +#define _HOMARD_I_HXX_ + +#ifdef WIN32 + #if defined HOMARDENGINE_EXPORTS || defined HOMARDEngine_EXPORTS + #define HOMARDENGINE_EXPORT __declspec( dllexport ) + #else + #define HOMARDENGINE_EXPORT __declspec( dllimport ) + #endif +#else + #define HOMARDENGINE_EXPORT +#endif + +#endif //_HOMARD_I_HXX_ + + diff --git a/src/ADAPT_I/HomardMedCommun.cxx b/src/ADAPT_I/HomardMedCommun.cxx new file mode 100644 index 000000000..4fc06c891 --- /dev/null +++ b/src/ADAPT_I/HomardMedCommun.cxx @@ -0,0 +1,335 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "HomardMedCommun.h" + +#include +#include +#include +#include +#include + +#include + +#include "utilities.h" +// ======================================================================= +int MEDFileExist( const char * aFile ) +// Retourne 1 si le fichier existe, 0 sinon +// ======================================================================= +{ + int existe ; + med_idt medIdt = MEDfileOpen(aFile,MED_ACC_RDONLY); + if ( medIdt < 0 ) { existe = 0 ; } + else { MEDfileClose(medIdt); + existe = 1 ; } + return existe ; +} +// ======================================================================= +std::set GetListeGroupesInMedFile(const char * aFile) +// ======================================================================= +{ + std::set ListeGroupes; + med_err erreur = 0 ; + med_idt medIdt ; + while ( erreur == 0 ) + { + // Ouverture du fichier + medIdt = MEDfileOpen(aFile,MED_ACC_RDONLY); + if ( medIdt < 0 ) + { + erreur = 1 ; + break ; + } + // Caracteristiques du maillage + char meshname[MED_NAME_SIZE+1]; + med_int spacedim,meshdim; + med_mesh_type meshtype; + char descriptionription[MED_COMMENT_SIZE+1]; + char dtunit[MED_SNAME_SIZE+1]; + med_sorting_type sortingtype; + med_int nstep; + med_axis_type axistype; + int naxis = MEDmeshnAxis(medIdt,1); + char *axisname=new char[naxis*MED_SNAME_SIZE+1]; + char *axisunit=new char[naxis*MED_SNAME_SIZE+1]; + erreur = MEDmeshInfo(medIdt, + 1, + meshname, + &spacedim, + &meshdim, + &meshtype, + descriptionription, + dtunit, + &sortingtype, + &nstep, + &axistype, + axisname, + axisunit); + delete[] axisname ; + delete[] axisunit ; + if ( erreur < 0 ) { break ; } + // Nombre de familles + med_int nfam ; + nfam = MEDnFamily(medIdt,meshname) ; + if ( nfam < 0 ) + { + erreur = 2 ; + break ; + } + // Lecture des caracteristiques des familles + for (int i=0;i 0 ) + { + char familyname[MED_NAME_SIZE+1]; + med_int numfam; + char* gro = (char*) malloc(MED_LNAME_SIZE*ngro+1); + erreur = MEDfamilyInfo(medIdt, + meshname, + i+1, + familyname, + &numfam, + gro); + if ( erreur < 0 ) + { + free(gro); + break ; + } + // Lecture des groupes pour une famille de mailles + if ( numfam < 0) + { + for (int j=0;j 0 ) MEDfileClose(medIdt); + + return ListeGroupes; +} + +// ======================================================================= +std::vector GetBoundingBoxInMedFile(const char * aFile) +// ======================================================================= +{ +// Le vecteur en retour contiendra les informations suivantes : +// en position 0 et 1 Xmin, Xmax et en position 2 Dx si < 0 2D +// en position 3 et 4 Ymin, Ymax et en position 5 Dy si < 0 2D +// en position 6 et 7 Zmin, Zmax et en position 8 Dz si < 0 2D +// 9 distance max dans le maillage + + std::vector LesExtremes; + med_err erreur = 0 ; + med_idt medIdt ; + while ( erreur == 0 ) + { + // Ouverture du fichier + medIdt = MEDfileOpen(aFile,MED_ACC_RDONLY); + if ( medIdt < 0 ) + { + erreur = 1 ; + break ; + } + //Nombre de maillage : on ne peut en lire qu'un seul + med_int numberOfMeshes = MEDnMesh(medIdt) ; + if (numberOfMeshes != 1 ) + { + erreur = 2 ; + break ; + } + // Caracteristiques du maillage + char meshname[MED_NAME_SIZE+1]; + med_int spacedim,meshdim; + med_mesh_type meshtype; + char descriptionription[MED_COMMENT_SIZE+1]; + char dtunit[MED_SNAME_SIZE+1]; + med_sorting_type sortingtype; + med_int nstep; + med_axis_type axistype; + int naxis = MEDmeshnAxis(medIdt,1); + char *axisname=new char[naxis*MED_SNAME_SIZE+1]; + char *axisunit=new char[naxis*MED_SNAME_SIZE+1]; + erreur = MEDmeshInfo(medIdt, + 1, + meshname, + &spacedim, + &meshdim, + &meshtype, + descriptionription, + dtunit, + &sortingtype, + &nstep, + &axistype, + axisname, + axisunit); + delete[] axisname ; + delete[] axisunit ; + if ( erreur < 0 ) { break ; } + + // Nombre de noeuds + med_bool chgt,trsf; + med_int nnoe = MEDmeshnEntity(medIdt, + meshname, + MED_NO_DT, + MED_NO_IT, + MED_NODE, + MED_NO_GEOTYPE, + MED_COORDINATE, + MED_NO_CMODE, + &chgt, + &trsf); + if ( nnoe < 0 ) + { + erreur = 4; + break ; + } + + // Les coordonnees + med_float* coo = (med_float*) malloc(sizeof(med_float)*nnoe*spacedim); + + erreur = MEDmeshNodeCoordinateRd(medIdt, + meshname, + MED_NO_DT, + MED_NO_IT, + MED_NO_INTERLACE, + coo); + if ( erreur < 0 ) + { + free(coo) ; + break ; + } + + // Calcul des extremes + med_float xmin,xmax,ymin,ymax,zmin,zmax; + + xmin=coo[0]; + xmax=coo[0]; + for (int i=1;i 1) + { + ymin=coo[nnoe]; ymax=coo[nnoe]; + for (int i=nnoe+1;i<2*nnoe;i++) + { + ymin = std::min(ymin,coo[i]); + ymax = std::max(ymax,coo[i]); + } + } + else + { + ymin=0; + ymax=0; + zmin=0; + zmax=0; + } +// + if (spacedim > 2) + { + zmin=coo[2*nnoe]; zmax=coo[2*nnoe]; + for (int i=2*nnoe+1;i<3*nnoe;i++) + { + zmin = std::min(zmin,coo[i]); + zmax = std::max(zmax,coo[i]); + } + } + else + { + zmin=0; + zmax=0; + } + + MESSAGE( "_______________________________________"); + MESSAGE( "xmin : " << xmin << " xmax : " << xmax ); + MESSAGE( "ymin : " << ymin << " ymax : " << ymax ); + MESSAGE( "zmin : " << zmin << " zmax : " << zmax ); + MESSAGE( "_______________________________________" ); + double epsilon = 1.e-6 ; + LesExtremes.push_back(xmin); + LesExtremes.push_back(xmax); + LesExtremes.push_back(0); + LesExtremes.push_back(ymin); + LesExtremes.push_back(ymax); + LesExtremes.push_back(0); + LesExtremes.push_back(zmin); + LesExtremes.push_back(zmax); + LesExtremes.push_back(0); + + + double max1=std::max ( LesExtremes[1] - LesExtremes[0] , LesExtremes[4] - LesExtremes[3] ) ; + double max2=std::max ( max1 , LesExtremes[7] - LesExtremes[6] ) ; + LesExtremes.push_back(max2); + +// LesExtremes[0] = Xmini du maillage +// LesExtremes[1] = Xmaxi du maillage +// LesExtremes[2] = increment de progression en X +// LesExtremes[3,4,5] : idem pour Y +// LesExtremes[6,7,8] : idem pour Z +// LesExtremes[9] = ecart maximal entre coordonnees +// On fait un traitement pour dans le cas d'une coordonnee constante +// inhiber ce cas en mettant un increment negatif +// + double diff = LesExtremes[1] - LesExtremes[0]; + if ( fabs(diff) > epsilon*max2 ) { LesExtremes[2] = diff/100.; } + else { LesExtremes[2] = -1. ; } + + diff = LesExtremes[4] - LesExtremes[3]; + if ( fabs(diff) > epsilon*max2 ) { LesExtremes[5]=diff/100.; } + else { LesExtremes[5] = -1. ; } + + diff = LesExtremes[7] - LesExtremes[6]; + if ( fabs(diff) > epsilon*max2 ) { LesExtremes[8]=diff/100.; } + else { LesExtremes[8] = -1. ; } + + MESSAGE ( "_______________________________________" ); + MESSAGE ( "xmin : " << LesExtremes[0] << " xmax : " << LesExtremes[1] << " xincr : " << LesExtremes[2] ); + MESSAGE ( "ymin : " << LesExtremes[3] << " ymax : " << LesExtremes[4] << " yincr : " << LesExtremes[5] ); + MESSAGE ( "zmin : " << LesExtremes[6] << " zmax : " << LesExtremes[7] << " zincr : " << LesExtremes[8] ); + MESSAGE ( "dmax : " << LesExtremes[9] ); + MESSAGE ( "_______________________________________" ); + + free(coo) ; + break ; + } + // Fermeture du fichier + if ( medIdt > 0 ) MEDfileClose(medIdt); + + return LesExtremes; +} + diff --git a/src/ADAPT_I/HomardMedCommun.h b/src/ADAPT_I/HomardMedCommun.h new file mode 100644 index 000000000..0ab2a3ff3 --- /dev/null +++ b/src/ADAPT_I/HomardMedCommun.h @@ -0,0 +1,32 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef HOMARDMEDCOMMUN_H +#define HOMARDMEDCOMMUN_H + +#include "HOMARD_i.hxx" +#include +#include +#include + +HOMARDENGINE_EXPORT int MEDFileExist( const char * aFile ); +HOMARDENGINE_EXPORT std::vector GetBoundingBoxInMedFile( const char * aFile); +HOMARDENGINE_EXPORT std::set GetListeGroupesInMedFile(const char * aFile); + +#endif // HOMARD%MEDCOMMUN_H diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 88405aed6..80fa00a42 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -40,6 +40,8 @@ SET(SUBDIRS_COMMON StdMeshers_I SMESH_PY Tools + ADAPT + ADAPT_I ) IF(SALOME_SMESH_ENABLE_MEFISTO) @@ -65,6 +67,7 @@ IF(SALOME_BUILD_GUI) PluginUtils SMESH_SWIG_WITHIHM StdMeshersGUI + ADAPTGUI ) ENDIF(SALOME_BUILD_GUI) From 7132a233f498a4f47a3740e3b69257c1b9382fdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Wed, 20 May 2020 17:36:39 +0200 Subject: [PATCH 005/100] =?UTF-8?q?Suivi=20de=20fronti=C3=A8re=20-=20d?= =?UTF-8?q?=C3=A9part?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ADAPTFrontTrack/CMakeLists.txt | 73 ++ src/ADAPTFrontTrack/FrontTrack.cxx | 164 +++ src/ADAPTFrontTrack/FrontTrack.hxx | 54 + src/ADAPTFrontTrack/FrontTrack_NodeGroups.cxx | 134 +++ src/ADAPTFrontTrack/FrontTrack_NodeGroups.hxx | 76 ++ .../FrontTrack_NodesOnGeom.cxx | 511 ++++++++++ .../FrontTrack_NodesOnGeom.hxx | 117 +++ src/ADAPTFrontTrack/FrontTrack_Projector.cxx | 947 ++++++++++++++++++ src/ADAPTFrontTrack/FrontTrack_Projector.hxx | 95 ++ src/ADAPTFrontTrack/FrontTrack_Utils.cxx | 164 +++ src/ADAPTFrontTrack/FrontTrack_Utils.hxx | 72 ++ src/ADAPTFrontTrack_SWIG/CMakeLists.txt | 83 ++ src/ADAPTFrontTrack_SWIG/FrontTrack.i | 67 ++ 13 files changed, 2557 insertions(+) create mode 100644 src/ADAPTFrontTrack/CMakeLists.txt create mode 100644 src/ADAPTFrontTrack/FrontTrack.cxx create mode 100644 src/ADAPTFrontTrack/FrontTrack.hxx create mode 100644 src/ADAPTFrontTrack/FrontTrack_NodeGroups.cxx create mode 100644 src/ADAPTFrontTrack/FrontTrack_NodeGroups.hxx create mode 100644 src/ADAPTFrontTrack/FrontTrack_NodesOnGeom.cxx create mode 100644 src/ADAPTFrontTrack/FrontTrack_NodesOnGeom.hxx create mode 100644 src/ADAPTFrontTrack/FrontTrack_Projector.cxx create mode 100644 src/ADAPTFrontTrack/FrontTrack_Projector.hxx create mode 100644 src/ADAPTFrontTrack/FrontTrack_Utils.cxx create mode 100644 src/ADAPTFrontTrack/FrontTrack_Utils.hxx create mode 100644 src/ADAPTFrontTrack_SWIG/CMakeLists.txt create mode 100644 src/ADAPTFrontTrack_SWIG/FrontTrack.i diff --git a/src/ADAPTFrontTrack/CMakeLists.txt b/src/ADAPTFrontTrack/CMakeLists.txt new file mode 100644 index 000000000..b19d068e7 --- /dev/null +++ b/src/ADAPTFrontTrack/CMakeLists.txt @@ -0,0 +1,73 @@ +# Copyright (C) 2017-2020 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# --- options --- +# additional include directories +INCLUDE_DIRECTORIES( + ${OpenCASCADE_INCLUDE_DIR} + ${GEOM_INCLUDE_DIRS} + ${MEDFILE_INCLUDE_DIRS} + ${MEDCOUPLING_INCLUDE_DIRS} + ${TBB_INCLUDE_DIRS} +) + +# additional preprocessor / compiler flags +ADD_DEFINITIONS( + ${OpenCASCADE_DEFINITIONS} +) + +IF(ADAPTFRONTTRACK_USE_TBB) + SET(TBB_LIBS ${TBB_LIBRARIES}) +ENDIF(ADAPTFRONTTRACK_USE_TBB) + +# libraries to link to +SET(_link_LIBRARIES + ${OpenCASCADE_FoundationClasses_LIBRARIES} + ${OpenCASCADE_ModelingAlgorithms_LIBRARIES} + ${OpenCASCADE_ModelingData_LIBRARIES} + ${GEOM_XAO} + ${MEDCoupling_medloader} + ${TBB_LIBS} +) + +# --- headers --- + +# header files +SET(ADAPTFRONTTRACK_HEADERS + FrontTrack.hxx +) + +# --- sources --- + +# sources / static +SET(ADAPTFRONTTRACK_SOURCES + FrontTrack.cxx + FrontTrack_NodeGroups.cxx + FrontTrack_NodesOnGeom.cxx + FrontTrack_Projector.cxx + FrontTrack_Utils.cxx +) + +# --- rules --- + +ADD_LIBRARY(ADAPTFrontTrack ${ADAPTFRONTTRACK_SOURCES}) +TARGET_LINK_LIBRARIES(ADAPTFrontTrack ${_link_LIBRARIES} ) +INSTALL(TARGETS ADAPTFrontTrack EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) + +INSTALL(FILES ${ADAPTFRONTTRACK_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) diff --git a/src/ADAPTFrontTrack/FrontTrack.cxx b/src/ADAPTFrontTrack/FrontTrack.cxx new file mode 100644 index 000000000..91eb4b606 --- /dev/null +++ b/src/ADAPTFrontTrack/FrontTrack.cxx @@ -0,0 +1,164 @@ +// Copyright (C) 2017-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : FrontTrack.cxx +// Created : Tue Apr 25 17:20:28 2017 +// Author : Edward AGAPOV (eap) + +#include "FrontTrack.hxx" +#include "FrontTrack_NodeGroups.hxx" +#include "FrontTrack_Utils.hxx" + +#include +#include +#include + +#include +#include + +#include + +#include + +/*! + * \brief Relocate nodes to lie on geometry + * \param [in] theInputMedFile - a MED file holding a mesh including nodes that will be + * moved onto the geometry + * \param [in] theOutputMedFile - a MED file to create, that will hold a modified mesh + * \param [in] theInputNodeFiles - an array of names of files describing groups of nodes that + * will be moved onto the geometry + * \param [in] theXaoFileName - a path to a file in XAO format holding the geometry and + * the geometrical groups. + * \param [in] theIsParallel - if \c true, all processors are used to treat boundary shapes + * in parallel. + */ +void FrontTrack::track( const std::string& theInputMedFile, + const std::string& theOutputMedFile, + const std::vector< std::string > & theInputNodeFiles, + const std::string& theXaoFileName, + bool theIsParallel ) +{ + // check arguments +#ifdef _DEBUG_ + std::cout << "FrontTrack::track" << std::endl; +#endif + + if ( theInputNodeFiles.empty() ) + return; + +#ifdef _DEBUG_ + std::cout << "Input MED file: " << theInputMedFile << std::endl; +#endif + if ( !FT_Utils::fileExists( theInputMedFile )) + throw std::invalid_argument( "Input MED file does not exist: " + theInputMedFile ); + +#ifdef _DEBUG_ + std::cout << "Output MED file: " << theOutputMedFile << std::endl; +#endif + if ( !FT_Utils::canWrite( theOutputMedFile )) + throw std::invalid_argument( "Can't create the output MED file: " + theOutputMedFile ); + + std::vector< std::string > theNodeFiles ; + for ( size_t i = 0; i < theInputNodeFiles.size(); ++i ) + { +#ifdef _DEBUG_ + std::cout << "Initial input node file #"<1 + // keep only files with more than 1 line: + std::ifstream fichier(theInputNodeFiles[i].c_str()); + std::string s; + unsigned int nb_lines = 0; + while(std::getline(fichier,s)) ++nb_lines; +// std::cout << ". nb_lines: " << nb_lines << std::endl; + if ( nb_lines >= 2 ) { theNodeFiles.push_back( theInputNodeFiles[i] ); } + } +#ifdef _DEBUG_ + for ( size_t i = 0; i < theNodeFiles.size(); ++i ) + { std::cout << "Valid input node file #"< + mfMesh( MEDCoupling::MEDFileUMesh::New( theInputMedFile )); + if ( mfMesh.isNull() ) + throw std::invalid_argument( "Failed to read the input MED file: " + theInputMedFile ); + + MEDCoupling::DataArrayDouble * nodeCoords = mfMesh->getCoords(); + if ( !nodeCoords || nodeCoords->empty() ) + throw std::invalid_argument( "No nodes in the input mesh" ); + + + // read a geometry + +#ifdef _DEBUG_ + std::cout << "Lecture de la geometrie" << std::endl; +#endif + XAO::Xao xao; + if ( !xao.importXAO( theXaoFileName ) || !xao.getGeometry() ) + throw std::invalid_argument( "Failed to read the XAO input file: " + theXaoFileName ); + +#ifdef _DEBUG_ + std::cout << "Conversion en BREP" << std::endl; +#endif + XAO::BrepGeometry* xaoGeom = dynamic_cast( xao.getGeometry() ); + if ( !xaoGeom || xaoGeom->getTopoDS_Shape().IsNull() ) + throw std::invalid_argument( "Failed to get a BREP shape from the XAO input file" ); + + + // read groups of nodes and associate them with boundary shapes using names (no projection so far) + +#ifdef _DEBUG_ + std::cout << "Lecture des groupes" << std::endl; +#endif + FT_NodeGroups nodeGroups; + nodeGroups.read( theNodeFiles, &xao, nodeCoords ); +#ifdef _DEBUG_ + std::cout << "Nombre de groupes : " << nodeGroups.nbOfGroups() << std::endl; +#endif + + // project nodes to the boundary shapes and change their coordinates + +#ifdef _DEBUG_ + std::cout << "Projection des noeuds, theIsParallel=" << theIsParallel << std::endl; +#endif + OSD_Parallel::For( 0, nodeGroups.nbOfGroups(), nodeGroups, !theIsParallel ); + + // save the modified mesh + +#ifdef _DEBUG_ + std::cout << "Ecriture du maillage" << std::endl; +#endif + const int erase = 2; + mfMesh->write( theOutputMedFile, /*mode=*/erase ); + + if ( !nodeGroups.isOK() ) + throw std::runtime_error("Unable to project some nodes"); +} diff --git a/src/ADAPTFrontTrack/FrontTrack.hxx b/src/ADAPTFrontTrack/FrontTrack.hxx new file mode 100644 index 000000000..fa033161c --- /dev/null +++ b/src/ADAPTFrontTrack/FrontTrack.hxx @@ -0,0 +1,54 @@ +// Copyright (C) 2017-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : FrontTrack.hxx +// Created : Tue Apr 25 17:08:52 2017 +// Author : Edward AGAPOV (eap) + + +#ifndef __FrontTrack_HXX__ +#define __FrontTrack_HXX__ + +#include +#include + +class FrontTrack +{ +public: + + /*! + * \brief Relocate nodes to lie on geometry + * \param [in] theInputMedFile - a MED file holding a mesh including nodes that will be + * moved onto the geometry + * \param [in] theOutputMedFile - a MED file to create, that will hold a modified mesh + * \param [in] theInputNodeFiles - an array of names of files describing groups of nodes that + * will be moved onto the geometry + * \param [in] theXaoFileName - a path to a file in XAO format holding the geometry and + * the geometrical groups. + * \param [in] theIsParallel - if \c true, all processors are used to treat boundary shapes + * in parallel. + */ + void track( const std::string& theInputMedFile, + const std::string& theOutputMedFile, + const std::vector< std::string > & theInputNodeFiles, + const std::string& theXaoFileName, + bool theIsParallel=true); + +}; + +#endif diff --git a/src/ADAPTFrontTrack/FrontTrack_NodeGroups.cxx b/src/ADAPTFrontTrack/FrontTrack_NodeGroups.cxx new file mode 100644 index 000000000..247def290 --- /dev/null +++ b/src/ADAPTFrontTrack/FrontTrack_NodeGroups.cxx @@ -0,0 +1,134 @@ +// Copyright (C) 2017-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : FrontTrack_NodeGroups.cxx +// Created : Tue Apr 25 19:17:47 2017 +// Author : Edward AGAPOV (eap) + +#include "FrontTrack_NodeGroups.hxx" +#include "FrontTrack_Projector.hxx" +#include "FrontTrack_Utils.hxx" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace +{ + //================================================================================ + /*! + * \brief Initialize FT_Projector's with all sub-shapes of given type + * \param [in] theMainShape - the shape to explore + * \param [in] theSubType - the type of sub-shapes + * \param [out] theProjectors - the projectors + */ + //================================================================================ + + void getProjectors( const TopoDS_Shape& theMainShape, + const TopAbs_ShapeEnum theSubType, + std::vector< FT_Projector > & theProjectors ) + { + TopTools_IndexedMapOfShape subShapes; + TopExp::MapShapes( theMainShape, theSubType, subShapes ); +#ifdef _DEBUG_ + std::cout << ". Nombre de subShapes : " << subShapes.Size() << std::endl; +#endif + + theProjectors.resize( subShapes.Size() ); + for ( int i = 1; i <= subShapes.Size(); ++i ) + theProjectors[ i-1 ].setBoundaryShape( subShapes( i )); + } +} + +//================================================================================ +/*! + * \brief Load node groups from files + * \param [in] theNodeFiles - an array of names of files describing groups of nodes that + * will be moved onto geometry + * \param [in] theXaoGeom - the whole geometry to project on + * \param [inout] theNodeCoords - array of node coordinates + */ +//================================================================================ + +void FT_NodeGroups::read( const std::vector< std::string >& theNodeFiles, + const XAO::Xao* theXao, + MEDCoupling::DataArrayDouble* theNodeCoords ) +{ + // get projectors for all boundary sub-shapes; + // index of a projector in the vector corresponds to a XAO index of a sub-shape + XAO::BrepGeometry* xaoGeom = dynamic_cast( theXao->getGeometry() ); + getProjectors( xaoGeom->getTopoDS_Shape(), TopAbs_EDGE, _projectors[0] ); + getProjectors( xaoGeom->getTopoDS_Shape(), TopAbs_FACE, _projectors[1] ); + + _nodesOnGeom.resize( theNodeFiles.size() ); + + // read node IDs and look for projectors to boundary sub-shapes by group name + FT_Utils::XaoGroups xaoGroups( theXao ); + for ( size_t i = 0; i < theNodeFiles.size(); ++i ) + { + _nodesOnGeom[i].read( theNodeFiles[i], xaoGroups, theNodeCoords, _projectors ); + } +} + +//================================================================================ +/*! + * \brief Project and move nodes of a given group of nodes + */ +//================================================================================ + +void FT_NodeGroups::projectAndMove( const int groupIndex ) +{ + _nodesOnGeom[ groupIndex ].projectAndMove(); +} + +//================================================================================ +/*! + * \brief Return true if all nodes were successfully relocated + */ +//================================================================================ + +bool FT_NodeGroups::isOK() const +{ + for ( size_t i = 0; i < _nodesOnGeom.size(); ++i ) + if ( ! _nodesOnGeom[ i ].isOK() ) + return false; + + return true; +} + +//================================================================================ +/*! + * \brief Print some statistics on node groups + */ +//================================================================================ + +void FT_NodeGroups::dumpStat() const +{ + for ( size_t i = 0; i < _nodesOnGeom.size(); ++i ) + { + std::cout << _nodesOnGeom[i].getShapeDim() << "D " + << _nodesOnGeom[i].nbNodes() << " nodes" << std::endl; + } +} diff --git a/src/ADAPTFrontTrack/FrontTrack_NodeGroups.hxx b/src/ADAPTFrontTrack/FrontTrack_NodeGroups.hxx new file mode 100644 index 000000000..9204ac8af --- /dev/null +++ b/src/ADAPTFrontTrack/FrontTrack_NodeGroups.hxx @@ -0,0 +1,76 @@ +// Copyright (C) 2017-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : FrontTrack_NodeGroups.hxx +// Created : Tue Apr 25 19:02:49 2017 +// Author : Edward AGAPOV (eap) + +#ifndef __FrontTrack_NodeGroups_HXX__ +#define __FrontTrack_NodeGroups_HXX__ + +#include "FrontTrack_NodesOnGeom.hxx" +#include "FrontTrack_Projector.hxx" + +#include +#include + +namespace MEDCoupling { + class DataArrayDouble; +} +namespace XAO { + class Xao; +} + +/*! + * \brief Container of node groups. + */ +class FT_NodeGroups +{ +public: + + // Load node groups from files + void read( const std::vector< std::string >& nodeFiles, + const XAO::Xao* xaoGeom, + MEDCoupling::DataArrayDouble* nodeCoords ); + + // return number of groups of nodes to move + int nbOfGroups() const { return _nodesOnGeom.size(); } + + // Move nodes of a group in parallel mode + void operator() ( const int groupIndex ) const + { + const_cast< FT_NodeGroups* >( this )->projectAndMove( groupIndex ); + } + + // Project and move nodes of a given group of nodes + void projectAndMove( const int groupIndex ); + + // return true if all nodes were successfully relocated + bool isOK() const; + + // print some statistics on node groups + void dumpStat() const; + +private: + + std::vector< FT_NodesOnGeom > _nodesOnGeom; + std::vector< FT_Projector > _projectors[2]; // curves and surfaces separately + +}; + +#endif diff --git a/src/ADAPTFrontTrack/FrontTrack_NodesOnGeom.cxx b/src/ADAPTFrontTrack/FrontTrack_NodesOnGeom.cxx new file mode 100644 index 000000000..16422348e --- /dev/null +++ b/src/ADAPTFrontTrack/FrontTrack_NodesOnGeom.cxx @@ -0,0 +1,511 @@ +// Copyright (C) 2017-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : FrontTrack_NodesOnGeom.cxx +// Created : Tue Apr 25 20:48:23 2017 +// Author : Edward AGAPOV (eap) + +#include "FrontTrack_NodesOnGeom.hxx" +#include "FrontTrack_Utils.hxx" + +#include + +#include +#include +#include +#include + +namespace +{ + /*! + * \brief Close a file at destruction + */ + struct FileCloser + { + FILE * _file; + + FileCloser( FILE * file ): _file( file ) {} + ~FileCloser() { if ( _file ) ::fclose( _file ); } + }; +} + +//================================================================================ +/*! + * \brief Read node ids from a file and find shapes for projection + * \param [in] theNodeFile - a name of file holding IDs of nodes that + * will be moved onto geometry + * \param [in] theXaoGroups - a tool returning FT_Projector's by XAO group name + * \param [inout] theNodeCoords - array of node coordinates + * \param [in] theAllProjectorsByDim - all projectors of 2 dimensions, ordered so that + * a vector index corresponds to a XAO sub-shape ID + */ +//================================================================================ + +void FT_NodesOnGeom::read( const std::string& theNodeFile, + const FT_Utils::XaoGroups& theXaoGroups, + MEDCoupling::DataArrayDouble* theNodeCoords, + std::vector< FT_Projector > * theAllProjectorsByDim ) +{ + _nodeCoords = theNodeCoords; + + FILE * file = ::fopen( theNodeFile.c_str(), "r" ); + if ( !file ) + throw std::invalid_argument( "Can't open an input node file: " + theNodeFile ); + + FileCloser fileCloser( file ); + + // ------------------------------------- + // get shape dimension by the file name + // ------------------------------------- + + // hope the file name is something like "frnD.**" with n in (1,2) + int dimPos = theNodeFile.size() - 5; + if ( theNodeFile[ dimPos ] == '2' ) + _shapeDim = 2; + else if ( theNodeFile[ dimPos ] == '1' ) + _shapeDim = 1; + else + throw std::invalid_argument( "Can't define dimension by node file name " + theNodeFile ); +#ifdef _DEBUG_ + std::cout << ". Dimension of the file " << theNodeFile << ": " << _shapeDim << std::endl; +#endif + + // ------------------------------------- + // read geom group names; several lines + // ------------------------------------- + + std::vector< std::string > geomNames; + + const int maxLineLen = 256; + char line[ maxLineLen ]; + + long int pos = ::ftell( file ); + while ( ::fgets( line, maxLineLen, file )) // read a line + { + if ( ::feof( file )) + { + return; // no nodes in the file + } + + // check if the line describes node ids in format 3I10 (e.g. " 120 1 43\n") + size_t lineLen = strlen( line ); + if ( lineLen >= 31 && + ::isdigit( line[9] ) && + line[10] == ' ' && + ::isdigit( line[19] ) && + line[20] == ' ' && + ::isdigit( line[29] ) && + ::isspace( line[30] )) + break; + + geomNames.push_back( line + 1 ); // skip the 1st white space + + pos = ::ftell( file ); // remember the position to return if the next line holds node ids + } + + ::fseek( file, pos, SEEK_SET ); // return to the 1st line holding nodes ids + + + // -------------- + // read node ids + // -------------- + + FT_NodeToMove nodeIds; + std::vector< int > ids; + + const int nbNodes = theNodeCoords->getNumberOfTuples(); // to check validity of node IDs + + while ( ::fgets( line, maxLineLen, file )) // read a line + { + // find node ids in the line + + char *beg = line, *end = 0; + long int id; + + ids.clear(); + while (( id = ::strtol( beg, &end, 10 )) && + ( beg != end )) + { + ids.push_back( id ); + if ( id > nbNodes ) + throw std::invalid_argument( "Too large node ID: " + FT_Utils::toStr( id )); + beg = end; + } + + if ( ids.size() >= 3 ) + { + std::vector< int >::iterator i = ids.begin(); + nodeIds._nodeToMove = *i; + nodeIds._neighborNodes.assign( ++i, ids.end() ); + + _nodes.push_back( nodeIds ); + } + + if ( ::feof( file )) + break; + } + + // ----------------------------------------------------------------- + // try to find FT_Projector's to boundary sub-shapes by group names + // ----------------------------------------------------------------- + + _allProjectors = & theAllProjectorsByDim[ _shapeDim - 1 ]; + + _projectors.reserve( geomNames.size() ); + std::vector< const FT_Projector* > projectors; + + for ( size_t i = 0; i < geomNames.size(); ++i ) + { + std::string & groupName = geomNames[i]; +#ifdef _DEBUG_ + std::cout << ". Group name: " << groupName << std::endl; +#endif + + // remove trailing white spaces + for ( int iC = groupName.size() - 1; iC >= 0; --iC ) + { + if ( ::isspace( groupName[iC] ) ) + groupName.resize( iC ); + else + break; + } + if ( groupName.empty() ) + continue; + + _groupNames.push_back( groupName ); // keep _groupNames for easier debug :) + + // get projectors by group name + theXaoGroups.getProjectors( groupName, _shapeDim, + theAllProjectorsByDim[ _shapeDim-1 ], projectors ); + } + + // ------------------------------ + // check the found FT_Projector's + // ------------------------------ + + if ( projectors.size() == 1 ) + { + _projectors.push_back( *projectors[ 0 ]); + } + else + { + Bnd_Box nodesBox; + for ( size_t i = 0; i < _nodes.size(); ++i ) + nodesBox.Add( getPoint( _nodes[i]._nodeToMove )); + + if ( projectors.size() > 1 ) + { + // more than one boundary shape; + // try to filter off unnecessary projectors using a bounding box of nodes + for ( size_t i = 0; i < projectors.size(); ++i ) + if ( !nodesBox.IsOut( projectors[ i ]->getBoundingBox() )) + _projectors.push_back( *projectors[ i ]); + } + + if ( _projectors.empty() ) + { + // select projectors using a bounding box of nodes + std::vector< FT_Projector > & allProjectors = *_allProjectors; + for ( size_t i = 0; i < allProjectors.size(); ++i ) + if ( !nodesBox.IsOut( allProjectors[ i ].getBoundingBox() )) + _projectors.push_back( allProjectors[ i ]); + + if ( _projectors.empty() && !_nodes.empty() ) + throw std::runtime_error("No boundary shape found for nodes in file " + theNodeFile ); + } + } + + // prepare for projection - create real projectors + for ( size_t i = 0; i < _projectors.size(); ++i ) + _projectors[ i ].prepareForProjection(); + +} + +//================================================================================ +/*! + * \brief Project nodes to the shapes and move them to new positions + */ +//================================================================================ + +void FT_NodesOnGeom::projectAndMove() +{ + _OK = true; +// +// 1. Préalables +// + // check if all the shapes are planar + bool isAllPlanar = true; + for ( size_t i = 0; i < _projectors.size() && isAllPlanar; ++i ) + isAllPlanar = _projectors[i].isPlanarBoundary(); + if ( isAllPlanar ) + return; + + // set nodes in the order suitable for optimal projection + putNodesInOrder(); + + // project and move nodes + + std::vector< FT_NodeToMove* > notProjectedNodes; + size_t iP, iProjector; + gp_Pnt newXyz; + +#ifdef _DEBUG_ + std::cout << ".. _projectors.size() = " << _projectors.size() << std::endl; + std::cout << ".. _nodesOrder.size() = " << _nodesOrder.size() << std::endl; +#endif +// +// 2. Calculs +// 2.1. Avec plusieurs shapes +// + if ( _projectors.size() > 1 ) + { + // the nodes are to be projected onto several boundary shapes; + // in addition to the projecting, classification on a shape is necessary + // in order to find out on which of the shapes a node is to be projected + + iProjector = 0; + for ( size_t i = 0; i < _nodesOrder.size(); ++i ) + { + FT_NodeToMove& nn = _nodes[ _nodesOrder[ i ]]; + gp_Pnt xyz = getPoint( nn._nodeToMove ); + gp_Pnt xyz1 = getPoint( nn._neighborNodes[0] ); + gp_Pnt xyz2 = getPoint( nn._neighborNodes[1] ); + double maxDist2 = xyz1.SquareDistance( xyz2 ) / 4.; + if ( _projectors[ iProjector ].projectAndClassify( xyz, maxDist2, newXyz, + nn._params, nn._nearParams )) + { + moveNode( nn._nodeToMove, newXyz ); + } + else // a node is not on iProjector-th shape, find the shape it is on + { + for ( iP = 1; iP < _projectors.size(); ++iP ) // check _projectors other than iProjector + { + iProjector = ( iProjector + 1 ) % _projectors.size(); + if ( _projectors[ iProjector ].projectAndClassify( xyz, maxDist2, newXyz, + nn._params, nn._nearParams )) + { + moveNode( nn._nodeToMove, newXyz ); + break; + } + } + if ( iP == _projectors.size() ) + { + notProjectedNodes.push_back( &nn ); + +#ifdef _DEBUG_ + std::cerr << "Warning: no shape found for node " << nn._nodeToMove << std::endl; + if ( !_groupNames.empty() ) + std::cerr << "Warning: group -- " << _groupNames[0] << std::endl; +#endif + } + } + } + } +// +// 2.2. Avec une seule shape +// + else // one shape + { + for ( size_t i = 0; i < _nodesOrder.size(); ++i ) + { + FT_NodeToMove& nn = _nodes[ _nodesOrder[ i ]]; + gp_Pnt xyz = getPoint( nn._nodeToMove ); + gp_Pnt xyz1 = getPoint( nn._neighborNodes[0] ); + gp_Pnt xyz2 = getPoint( nn._neighborNodes[1] ); + +// maxDist2 : le quart du carré de la distance entre les deux voisins du noeud à bouger + double maxDist2 = xyz1.SquareDistance( xyz2 ) / 4.; +#ifdef _DEBUG_ + std::cout << "\n.. maxDist2 = " << maxDist2 << " entre " << nn._neighborNodes[0] << " et " << nn._neighborNodes[1] << " - milieu " << nn._nodeToMove << " - d/2 = " << sqrt(maxDist2) << " - d = " << sqrt(xyz1.SquareDistance( xyz2 )) << std::endl; +#endif + if ( _projectors[ 0 ].project( xyz, maxDist2, newXyz, + nn._params, nn._nearParams )) + moveNode( nn._nodeToMove, newXyz ); + else + notProjectedNodes.push_back( &nn ); + } + } +// +// 3. Bilan +// + if ( !notProjectedNodes.empty() ) + { + // project nodes that are not projected by any of _projectors; + // a proper projector is selected by evaluation of a distance between neighbor nodes + // and a shape + + std::vector< FT_Projector > & projectors = *_allProjectors; + + iProjector = 0; + for ( size_t i = 0; i < notProjectedNodes.size(); ++i ) + { + FT_NodeToMove& nn = *notProjectedNodes[ i ]; + gp_Pnt xyz = getPoint( nn._nodeToMove ); + gp_Pnt xyz1 = getPoint( nn._neighborNodes[0] ); + gp_Pnt xyz2 = getPoint( nn._neighborNodes[1] ); + double maxDist2 = xyz1.SquareDistance( xyz2 ) / 4.; + double tol2 = 1e-6 * maxDist2; + + bool ok; + for ( iP = 0; iP < projectors.size(); ++iP ) + { + projectors[ iProjector ].prepareForProjection(); + projectors[ iProjector ].tryWithoutPrevSolution( true ); + + if (( ok = projectors[ iProjector ].isOnShape( xyz1, tol2, nn._params, nn._nearParams )) && + ( ok = projectors[ iProjector ].isOnShape( xyz2, tol2, nn._params, nn._params ))) + { + if ( nn._neighborNodes.size() == 4 ) + { + gp_Pnt xyz1 = getPoint( nn._neighborNodes[2] ); + gp_Pnt xyz2 = getPoint( nn._neighborNodes[3] ); + if (( ok = projectors[ iProjector ].isOnShape( xyz1, tol2, nn._params, nn._params ))) + ok = projectors[ iProjector ].isOnShape( xyz2, tol2, nn._params, nn._params ); + } + } + + if ( ok && projectors[iProjector].project( xyz, maxDist2, newXyz, nn._params, nn._params )) + { + moveNode( nn._nodeToMove, newXyz ); + break; + } + iProjector = ( iProjector + 1 ) % projectors.size(); + } + if ( iP == projectors.size() ) + { + _OK = false; + + std::cerr << "Error: not projected node " << nn._nodeToMove << std::endl; + } + } + } +} + +//================================================================================ +/*! + * \brief Put nodes in the order for optimal projection and set FT_NodeToMove::_nearParams + * to point to a FT_NodeToMove::_params of a node that will be projected earlier + */ +//================================================================================ + +void FT_NodesOnGeom::putNodesInOrder() +{ + if ( !_nodesOrder.empty() ) + return; + + // check if any of projectors can use parameters of a previously projected node on a shape + // to speed up projection + + bool isPrevSolutionUsed = false; + for ( size_t i = 0; i < _projectors.size() && !isPrevSolutionUsed; ++i ) + isPrevSolutionUsed = _projectors[i].canUsePrevSolution(); + + if ( !isPrevSolutionUsed ) + { + _nodesOrder.resize( _nodes.size() ); + for ( size_t i = 0; i < _nodesOrder.size(); ++i ) + _nodesOrder[ i ] = i; + return; + } + + // make a map to find a neighbor projected node + + // map of { FT_NodeToMove::_neighborNodes[i] } to { FT_NodeToMove* }; + // here we call FT_NodeToMove a 'link' as this data links a _neighborNodes[i] node to other nodes + typedef NCollection_DataMap< int, std::vector< FT_NodeToMove* > > TNodeIDToLinksMap; + TNodeIDToLinksMap neigborsMap; + + int mapSize = ( _shapeDim == 1 ) ? _nodes.size() + 1 : _nodes.size() * 3; + neigborsMap.Clear(); + neigborsMap.ReSize( mapSize ); + + std::vector< FT_NodeToMove* > linkVec, *linkVecPtr; + const int maxNbLinks = ( _shapeDim == 1 ) ? 2 : 6; // usual nb of links + + for ( size_t i = 0; i < _nodes.size(); ++i ) + { + FT_NodeToMove& nn = _nodes[i]; + for ( size_t iN = 0; iN < nn._neighborNodes.size(); ++iN ) + { + if ( !( linkVecPtr = neigborsMap.ChangeSeek( nn._neighborNodes[ iN ] ))) + { + linkVecPtr = neigborsMap.Bound( nn._neighborNodes[ iN ], linkVec ); + linkVecPtr->reserve( maxNbLinks ); + } + linkVecPtr->push_back( & nn ); + } + } + + // fill in _nodesOrder + + _nodesOrder.reserve( _nodes.size() ); + + std::list< FT_NodeToMove* > queue; + queue.push_back( &_nodes[0] ); + _nodes[0]._nearParams = _nodes[0]._params; // to avoid re-adding to the queue + + while ( !queue.empty() ) + { + FT_NodeToMove* nn = queue.front(); + queue.pop_front(); + + _nodesOrder.push_back( nn - & _nodes[0] ); + + // add neighbors to the queue and set their _nearParams = nn->_params + for ( size_t iN = 0; iN < nn->_neighborNodes.size(); ++iN ) + { + std::vector< FT_NodeToMove* >& linkVec = neigborsMap( nn->_neighborNodes[ iN ]); + for ( size_t iL = 0; iL < linkVec.size(); ++iL ) + { + FT_NodeToMove* nnn = linkVec[ iL ]; + if ( nnn != nn && nnn->_nearParams == 0 ) + { + nnn->_nearParams = nn->_params; + queue.push_back( nnn ); + } + } + } + } + _nodes[0]._nearParams = 0; // reset +} + +//================================================================================ +/*! + * \brief Get node coordinates. Node IDs count from a unit + */ +//================================================================================ + +gp_Pnt FT_NodesOnGeom::getPoint( const int nodeID ) +{ + const size_t dim = _nodeCoords->getNumberOfComponents(); + const double * xyz = _nodeCoords->getConstPointer() + ( dim * ( nodeID - 1 )); + return gp_Pnt( xyz[0], xyz[1], dim == 2 ? 0 : xyz[2] ); +} + +//================================================================================ +/*! + * \brief change node coordinates + */ +//================================================================================ + +void FT_NodesOnGeom::moveNode( const int nodeID, const gp_Pnt& newXyz ) +{ + const size_t dim = _nodeCoords->getNumberOfComponents(); + double z, *xyz = _nodeCoords->getPointer() + ( dim * ( nodeID - 1 )); + newXyz.Coord( xyz[0], xyz[1], dim == 2 ? z : xyz[2] ); +} diff --git a/src/ADAPTFrontTrack/FrontTrack_NodesOnGeom.hxx b/src/ADAPTFrontTrack/FrontTrack_NodesOnGeom.hxx new file mode 100644 index 000000000..08db0e1de --- /dev/null +++ b/src/ADAPTFrontTrack/FrontTrack_NodesOnGeom.hxx @@ -0,0 +1,117 @@ +// Copyright (C) 2017-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : FrontTrack_NodesOnGeom.hxx +// Created : Tue Apr 25 19:12:25 2017 +// Author : Edward AGAPOV (eap) + + +#ifndef __FrontTrack_NodesOnGeom_HXX__ +#define __FrontTrack_NodesOnGeom_HXX__ + +#include "FrontTrack_Projector.hxx" + +#include +#include +#include +#include + +#include +#include + +namespace FT_Utils { + struct XaoGroups; +} +namespace MEDCoupling { + class DataArrayDouble; +} +namespace XAO { + class BrepGeometry; +} + + //-------------------------------------------------------------------------------------------- +/*! + * \brief Node group and geometry to project onto + */ +class FT_NodesOnGeom +{ +public: + + // read node IDs form a file and try to find a boundary sub-shape by name + void read( const std::string& nodesFile, + const FT_Utils::XaoGroups& xaoGroups, + MEDCoupling::DataArrayDouble* nodeCoords, + std::vector< FT_Projector > * allProjectorsByDim); + + // chose boundary shapes by evaluating distance between nodes and shapes + //void choseShape( const std::vector< FT_Utils::ShapeAndBndBox >& shapeAndBoxList ); + + // project nodes to the shapes and move them to new positions + void projectAndMove(); + + // return true if all nodes were successfully relocated + bool isOK() const { return _OK; } + + // return dimension of boundary shapes + int getShapeDim() const { return _shapeDim; } + + // return nb of nodes to move + int nbNodes() const { return _nodes.size(); } + + +private: + + // put nodes in the order for optimal projection + void putNodesInOrder(); + + // get node coordinates + gp_Pnt getPoint( const int nodeID ); + + // change node coordinates + void moveNode( const int nodeID, const gp_Pnt& xyz ); + + + // Ids of a node to move and its 2 or 4 neighbors + struct FT_NodeToMove + { + int _nodeToMove; + std::vector< int > _neighborNodes; + + double _params[2]; // parameters on shape (U or UV) found by projection + double *_nearParams; // _params of a neighbor already projected node + + FT_NodeToMove(): _nearParams(0) {} + }; + + std::vector< std::string > _groupNames; + int _shapeDim; // dimension of boundary shapes + std::vector< FT_NodeToMove > _nodes; // ids of nodes to move and their neighbors + std::vector< FT_Projector > _projectors; // FT_Projector's initialized with boundary shapes + std::vector< FT_Projector > * _allProjectors; // FT_Projector's for all shapes of _shapeDim + MEDCoupling::DataArrayDouble* _nodeCoords; + bool _OK; // projecting is successful + + // map of { FT_NodeToMove::_neighborNodes[i] } to { FT_NodeToMove* } + // this map is used to find neighbor nodes + typedef NCollection_DataMap< int, std::vector< FT_NodeToMove* > > TNodeIDToLinksMap; + TNodeIDToLinksMap _neigborsMap; + std::vector _nodesOrder; + +}; + +#endif diff --git a/src/ADAPTFrontTrack/FrontTrack_Projector.cxx b/src/ADAPTFrontTrack/FrontTrack_Projector.cxx new file mode 100644 index 000000000..a3bbfc614 --- /dev/null +++ b/src/ADAPTFrontTrack/FrontTrack_Projector.cxx @@ -0,0 +1,947 @@ +// Copyright (C) 2017-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : FrontTrack_Projector.cxx +// Created : Wed Apr 26 20:33:55 2017 +// Author : Edward AGAPOV (eap) + +#include "FrontTrack_Projector.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +//----------------------------------------------------------------------------- +/*! + * \brief Root class of a projector of a point to a boundary shape + */ +struct FT_RealProjector +{ + virtual ~FT_RealProjector() {} + + /*! + * \brief Project a point to a boundary shape + * \param [in] point - the point to project + * \param [out] newSolution - position on the shape (U or UV) found during the projection + * \param [in] prevSolution - position already found during the projection of a neighbor point + * \return gp_Pnt - the projection point + */ + virtual gp_Pnt project( const gp_Pnt& point, + double* newSolution, + const double* prevSolution = 0) = 0; + + /*! + * \brief Project a point to a boundary shape and check if the projection is within + * the shape boundary + * \param [in] point - the point to project + * \param [in] maxDist2 - the maximal allowed square distance between point and projection + * \param [out] projection - the projection point + * \param [out] newSolution - position on the shape (U or UV) found during the projection + * \param [in] prevSolution - position already found during the projection of a neighbor point + * \return bool - false if the projection point lies out of the shape boundary or + the distance the point and the projection is more than sqrt(maxDist2) + */ + virtual bool projectAndClassify( const gp_Pnt& point, + const double maxDist2, + gp_Pnt& projection, + double* newSolution, + const double* prevSolution = 0) = 0; + + // return true if a previously found solution can be used to speed up the projection + + virtual bool canUsePrevSolution() const { return false; } + + + double _dist; // distance between the point being projected and its projection +}; + +namespace // actual projection algorithms +{ + const double theEPS = 1e-12; + + //================================================================================ + /*! + * \brief Projector to any curve + */ + //================================================================================ + + struct CurveProjector : public FT_RealProjector + { + BRepAdaptor_Curve _curve; + double _tol; + ShapeAnalysis_Curve _projector; + double _uRange[2]; + + //----------------------------------------------------------------------------- + CurveProjector( const TopoDS_Edge& e, const double tol ): + _curve( e ), _tol( tol ) + { + BRep_Tool::Range( e, _uRange[0], _uRange[1] ); + } + + //----------------------------------------------------------------------------- + // project a point to the curve + virtual gp_Pnt project( const gp_Pnt& P, + double* newSolution, + const double* prevSolution = 0) + { +#ifdef _DEBUG_ + std::cout << ".. project a point to the curve prevSolution = " << prevSolution << std::endl; +#endif + gp_Pnt proj; + Standard_Real param; + + if ( prevSolution ) + { + _dist = _projector.NextProject( prevSolution[0], _curve, P, _tol, proj, param ); + } + else + { + _dist = _projector.Project( _curve, P, _tol, proj, param, false ); + } +#ifdef _DEBUG_ + std::cout << ".. _dist : " << _dist << std::endl; +#endif + proj = _curve.Value( param ); + + newSolution[0] = param; + + return proj; + } + + //----------------------------------------------------------------------------- + // project a point to a curve and check if the projection is within the curve boundary + virtual bool projectAndClassify( const gp_Pnt& point, + const double maxDist2, + gp_Pnt& projection, + double* newSolution, + const double* prevSolution = 0) + { +#ifdef _DEBUG_ + std::cout << ".. project a point to a curve and check " << std::endl; +#endif + projection = project( point, newSolution, prevSolution ); + return ( _uRange[0] < newSolution[0] && newSolution[0] < _uRange[1] && + _dist * _dist < maxDist2 ); + } + + //----------------------------------------------------------------------------- + // return true if a previously found solution can be used to speed up the projection + virtual bool canUsePrevSolution() const { return true; } + }; + + //================================================================================ + /*! + * \brief Projector to a straight curve. Don't project, classify only + */ + //================================================================================ + + struct LineProjector : public FT_RealProjector + { + gp_Pnt _p0, _p1; + + //----------------------------------------------------------------------------- + LineProjector( TopoDS_Edge e ) + { + e.Orientation( TopAbs_FORWARD ); + _p0 = BRep_Tool::Pnt( TopExp::FirstVertex( e )); + _p1 = BRep_Tool::Pnt( TopExp::LastVertex ( e )); + } + + //----------------------------------------------------------------------------- + // does nothing + virtual gp_Pnt project( const gp_Pnt& P, + double* newSolution, + const double* prevSolution = 0) + { + return P; + } + //----------------------------------------------------------------------------- + // check if a point lies within the line segment + virtual bool projectAndClassify( const gp_Pnt& point, + const double maxDist2, + gp_Pnt& projection, + double* newSolution, + const double* prevSolution = 0) + { + gp_Vec edge( _p0, _p1 ); + gp_Vec p0p ( _p0, point ); + double u = ( edge * p0p ) / edge.SquareMagnitude(); // param [0,1] on the edge + projection = ( 1. - u ) * _p0.XYZ() + u * _p1.XYZ(); // projection of the point on the edge + if ( u < 0 || 1 < u ) + return false; + + // check distance + return point.SquareDistance( projection ) < theEPS * theEPS; + } + }; + + //================================================================================ + /*! + * \brief Projector to a circular edge + */ + //================================================================================ + + struct CircleProjector : public FT_RealProjector + { + gp_Circ _circle; + double _uRange[2]; + + //----------------------------------------------------------------------------- + CircleProjector( const gp_Circ& c, const double f, const double l ): + _circle( c ) + { + _uRange[0] = f; + _uRange[1] = l; + } + + //----------------------------------------------------------------------------- + // project a point to the circle + virtual gp_Pnt project( const gp_Pnt& P, + double* newSolution, + const double* prevSolution = 0) + { + // assume that P is already on the the plane of circle, since + // it is in the middle of two points lying on the circle + + // move P to the circle + const gp_Pnt& O = _circle.Location(); + gp_Vec radiusVec( O, P ); + double radius = radiusVec.Magnitude(); + if ( radius < std::numeric_limits::min() ) + return P; // P in on the axe + + gp_Pnt proj = O.Translated( radiusVec.Multiplied( _circle.Radius() / radius )); + + _dist = _circle.Radius() - radius; + + return proj; + } + + //----------------------------------------------------------------------------- + // project and check if a projection lies within the circular edge + virtual bool projectAndClassify( const gp_Pnt& point, + const double maxDist2, + gp_Pnt& projection, + double* newSolution, + const double* prevSolution = 0) + { + _dist = -1; + projection = project( point, newSolution ); + if ( _dist < 0 || // ? + _dist * _dist > maxDist2 ) + return false; + + newSolution[0] = ElCLib::Parameter( _circle, projection ); + return ( _uRange[0] < newSolution[0] && newSolution[0] < _uRange[1] ); + } + }; + + //================================================================================ + /*! + * \brief Projector to any surface + */ + //================================================================================ + + struct SurfaceProjector : public FT_RealProjector + { + ShapeAnalysis_Surface _projector; + double _tol; + BRepTopAdaptor_FClass2d* _classifier; + + //----------------------------------------------------------------------------- + SurfaceProjector( const TopoDS_Face& face, const double tol, BRepTopAdaptor_FClass2d* cls ): + _projector( BRep_Tool::Surface( face )), + _tol( tol ), + _classifier( cls ) + { + } + //----------------------------------------------------------------------------- + // delete _classifier + ~SurfaceProjector() + { + delete _classifier; + } + + //----------------------------------------------------------------------------- + // project a point to a surface + virtual gp_Pnt project( const gp_Pnt& P, + double* newSolution, + const double* prevSolution = 0) + { + gp_Pnt2d uv; + + if ( prevSolution ) + { + gp_Pnt2d prevUV( prevSolution[0], prevSolution[1] ); + uv = _projector.NextValueOfUV( prevUV, P, _tol ); + } + else + { + uv = _projector.ValueOfUV( P, _tol ); + } + + uv.Coord( newSolution[0], newSolution[1] ); + + gp_Pnt proj = _projector.Value( uv ); + + _dist = _projector.Gap(); + + return proj; + } + + //----------------------------------------------------------------------------- + // project a point to a surface and check if the projection is within the surface boundary + virtual bool projectAndClassify( const gp_Pnt& point, + const double maxDist2, + gp_Pnt& projection, + double* newSolution, + const double* prevSolution = 0) + { + projection = project( point, newSolution, prevSolution ); + return ( _dist * _dist < maxDist2 ) && classify( newSolution ); + } + + //----------------------------------------------------------------------------- + // check if the projection is within the shape boundary + bool classify( const double* newSolution ) + { + TopAbs_State state = _classifier->Perform( gp_Pnt2d( newSolution[0], newSolution[1]) ); + return ( state != TopAbs_OUT ); + } + + //----------------------------------------------------------------------------- + // return true if a previously found solution can be used to speed up the projection + virtual bool canUsePrevSolution() const { return true; } + }; + + //================================================================================ + /*! + * \brief Projector to a plane. Don't project, classify only + */ + //================================================================================ + + struct PlaneProjector : public SurfaceProjector + { + gp_Pln _plane; + bool _isRealPlane; // false means that a surface is planar but parametrization is different + + //----------------------------------------------------------------------------- + PlaneProjector( const gp_Pln& pln, + const TopoDS_Face& face, + BRepTopAdaptor_FClass2d* cls, + bool isRealPlane=true): + SurfaceProjector( face, 0, cls ), + _plane( pln ), + _isRealPlane( isRealPlane ) + {} + + //----------------------------------------------------------------------------- + // does nothing + virtual gp_Pnt project( const gp_Pnt& P, + double* newSolution, + const double* prevSolution = 0) + { + return P; + } + //----------------------------------------------------------------------------- + // check if a point lies within the boundry of the planar face + virtual bool projectAndClassify( const gp_Pnt& point, + const double maxDist2, + gp_Pnt& projection, + double* newSolution, + const double* prevSolution = 0) + { + if ( _isRealPlane ) + { + ElSLib::PlaneParameters( _plane.Position(), point, newSolution[0], newSolution[1]); + projection = ElSLib::PlaneValue ( newSolution[0], newSolution[1], _plane.Position() ); + if ( projection.SquareDistance( point ) > theEPS * theEPS ) + return false; + + return SurfaceProjector::classify( newSolution ); + } + else + { + return SurfaceProjector::projectAndClassify( point, maxDist2, projection, + newSolution, prevSolution ); + } + } + //----------------------------------------------------------------------------- + // return true if a previously found solution can be used to speed up the projection + virtual bool canUsePrevSolution() const { return false; } + }; + + //================================================================================ + /*! + * \brief Projector to a cylinder + */ + //================================================================================ + + struct CylinderProjector : public SurfaceProjector + { + gp_Cylinder _cylinder; + + //----------------------------------------------------------------------------- + CylinderProjector( const gp_Cylinder& c, + const TopoDS_Face& face, + BRepTopAdaptor_FClass2d* cls ): + SurfaceProjector( face, 0, cls ), + _cylinder( c ) + {} + + //----------------------------------------------------------------------------- + // project a point to the cylinder + virtual gp_Pnt project( const gp_Pnt& P, + double* newSolution, + const double* prevSolution = 0) + { + // project the point P to the cylinder axis -> Pp + const gp_Pnt& O = _cylinder.Position().Location(); + const gp_Dir& axe = _cylinder.Position().Direction(); + gp_Vec trsl = gp_Vec( axe ).Multiplied( gp_Vec( O, P ).Dot( axe )); + gp_Pnt Pp = O.Translated( trsl ); + + // move Pp to the cylinder + gp_Vec radiusVec( Pp, P ); + double radius = radiusVec.Magnitude(); + if ( radius < std::numeric_limits::min() ) + return P; // P in on the axe + + gp_Pnt proj = Pp.Translated( radiusVec.Multiplied( _cylinder.Radius() / radius )); + + _dist = _cylinder.Radius() - radius; + + return proj; + } + //----------------------------------------------------------------------------- + // project a point to the cylinder and check if the projection is within the surface boundary + virtual bool projectAndClassify( const gp_Pnt& point, + const double maxDist2, + gp_Pnt& projection, + double* newSolution, + const double* prevSolution = 0) + { + ElSLib::CylinderParameters( _cylinder.Position(), _cylinder.Radius(), point, + newSolution[0], newSolution[1]); + projection = ElSLib::CylinderValue( newSolution[0], newSolution[1], + _cylinder.Position(), _cylinder.Radius() ); + + return ( _dist * _dist < maxDist2 ) && SurfaceProjector::classify( newSolution ); + } + //----------------------------------------------------------------------------- + // return true if a previously found solution can be used to speed up the projection + virtual bool canUsePrevSolution() const { return false; } + }; + + //================================================================================ + /*! + * \brief Projector to a cone + */ + //================================================================================ + + struct ConeProjector : public SurfaceProjector + { + gp_Cone _cone; + + //----------------------------------------------------------------------------- + ConeProjector( const gp_Cone& c, + const TopoDS_Face& face, + BRepTopAdaptor_FClass2d* cls ): + SurfaceProjector( face, 0, cls ), + _cone( c ) + {} + + //----------------------------------------------------------------------------- + // project a point to the cone + virtual gp_Pnt project( const gp_Pnt& point, + double* newSolution, + const double* prevSolution = 0) + { + ElSLib::ConeParameters( _cone.Position(), _cone.RefRadius(), _cone.SemiAngle(), + point, newSolution[0], newSolution[1]); + gp_Pnt proj = ElSLib::ConeValue( newSolution[0], newSolution[1], + _cone.Position(), _cone.RefRadius(), _cone.SemiAngle() ); + _dist = point.Distance( proj ); + + return proj; + } + + //----------------------------------------------------------------------------- + // project a point to the cone and check if the projection is within the surface boundary + virtual bool projectAndClassify( const gp_Pnt& point, + const double maxDist2, + gp_Pnt& projection, + double* newSolution, + const double* prevSolution = 0) + { + projection = project( point, newSolution, prevSolution ); + + return ( _dist * _dist < maxDist2 ) && SurfaceProjector::classify( newSolution ); + } + //----------------------------------------------------------------------------- + // return true if a previously found solution can be used to speed up the projection + virtual bool canUsePrevSolution() const { return false; } + }; + + //================================================================================ + /*! + * \brief Projector to a sphere + */ + //================================================================================ + + struct SphereProjector : public SurfaceProjector + { + gp_Sphere _sphere; + + //----------------------------------------------------------------------------- + SphereProjector( const gp_Sphere& s, + const TopoDS_Face& face, + BRepTopAdaptor_FClass2d* cls ): + SurfaceProjector( face, 0, cls ), + _sphere( s ) + {} + + //----------------------------------------------------------------------------- + // project a point to the sphere + virtual gp_Pnt project( const gp_Pnt& P, + double* newSolution, + const double* prevSolution = 0) + { + // move Pp to the Sphere + const gp_Pnt& O = _sphere.Location(); + gp_Vec radiusVec( O, P ); + double radius = radiusVec.Magnitude(); + if ( radius < std::numeric_limits::min() ) + return P; // P is on O + + gp_Pnt proj = O.Translated( radiusVec.Multiplied( _sphere.Radius() / radius )); + + _dist = _sphere.Radius() - radius; + + return proj; + } + + //----------------------------------------------------------------------------- + // project a point to the sphere and check if the projection is within the surface boundary + virtual bool projectAndClassify( const gp_Pnt& point, + const double maxDist2, + gp_Pnt& projection, + double* newSolution, + const double* prevSolution = 0) + { + ElSLib::SphereParameters( _sphere.Position(), _sphere.Radius(), point, + newSolution[0], newSolution[1]); + projection = ElSLib::SphereValue( newSolution[0], newSolution[1], + _sphere.Position(), _sphere.Radius() ); + + return ( _dist * _dist < maxDist2 ) && SurfaceProjector::classify( newSolution ); + } + //----------------------------------------------------------------------------- + // return true if a previously found solution can be used to speed up the projection + virtual bool canUsePrevSolution() const { return false; } + }; + + //================================================================================ + /*! + * \brief Projector to a torus + */ + //================================================================================ + + struct TorusProjector : public SurfaceProjector + { + gp_Torus _torus; + + //----------------------------------------------------------------------------- + TorusProjector( const gp_Torus& t, + const TopoDS_Face& face, + BRepTopAdaptor_FClass2d* cls ): + SurfaceProjector( face, 0, cls ), + _torus( t ) + {} + + //----------------------------------------------------------------------------- + // project a point to the torus + virtual gp_Pnt project( const gp_Pnt& point, + double* newSolution, + const double* prevSolution = 0) + { + ElSLib::TorusParameters( _torus.Position(), _torus.MajorRadius(), _torus.MinorRadius(), + point, newSolution[0], newSolution[1]); + gp_Pnt proj = ElSLib::TorusValue( newSolution[0], newSolution[1], + _torus.Position(), _torus.MajorRadius(), _torus.MinorRadius() ); + _dist = point.Distance( proj ); + + return proj; + } + + //----------------------------------------------------------------------------- + // project a point to the torus and check if the projection is within the surface boundary + virtual bool projectAndClassify( const gp_Pnt& point, + const double maxDist2, + gp_Pnt& projection, + double* newSolution, + const double* prevSolution = 0) + { + projection = project( point, newSolution, prevSolution ); + + return ( _dist * _dist < maxDist2 ) && SurfaceProjector::classify( newSolution ); + } + //----------------------------------------------------------------------------- + // return true if a previously found solution can be used to speed up the projection + virtual bool canUsePrevSolution() const { return false; } + }; + + //================================================================================ + /*! + * \brief Check if a curve can be considered straight + */ + //================================================================================ + + bool isStraight( const GeomAdaptor_Curve& curve, const double tol ) + { + // rough check: evaluate how far from a straight line connecting the curve ends + // stand several internal points of the curve + + const double f = curve.FirstParameter(); + const double l = curve.LastParameter(); + const gp_Pnt pf = curve.Value( f ); + const gp_Pnt pl = curve.Value( l ); + const gp_Vec lineVec( pf, pl ); + const double lineLen2 = lineVec.SquareMagnitude(); + if ( lineLen2 < std::numeric_limits< double >::min() ) + return false; // E seems closed + + const double nbSamples = 7; + for ( int i = 0; i < nbSamples; ++i ) + { + const double r = ( i + 1 ) / nbSamples; + const gp_Pnt pi = curve.Value( f * r + l * ( 1 - r )); + const gp_Vec vi( pf, pi ); + const double h2 = lineVec.Crossed( vi ).SquareMagnitude() / lineLen2; + if ( h2 > tol * tol ) + return false; + } + + // thorough check + GCPnts_UniformDeflection divider( curve, tol ); + return ( divider.IsDone() && divider.NbPoints() < 3 ); + } +} + +//================================================================================ +/*! + * \brief Initialize with a boundary shape + */ +//================================================================================ + +FT_Projector::FT_Projector(const TopoDS_Shape& shape) +{ + _realProjector = 0; + setBoundaryShape( shape ); + _tryWOPrevSolution = false; +} + +//================================================================================ +/*! + * \brief Copy another projector + */ +//================================================================================ + +FT_Projector::FT_Projector(const FT_Projector& other) +{ + _realProjector = 0; + _shape = other._shape; + _bndBox = other._bndBox; + _tryWOPrevSolution = false; +} + +//================================================================================ +/*! + * \brief Destructor. Delete _realProjector + */ +//================================================================================ + +FT_Projector::~FT_Projector() +{ + delete _realProjector; +} + +//================================================================================ +/*! + * \brief Initialize with a boundary shape. Compute the bounding box + */ +//================================================================================ + +void FT_Projector::setBoundaryShape(const TopoDS_Shape& shape) +{ + delete _realProjector; _realProjector = 0; + _shape = shape; + if ( shape.IsNull() ) + return; + + BRepBndLib::Add( shape, _bndBox ); + _bndBox.Enlarge( 1e-5 * sqrt( _bndBox.SquareExtent() )); +} + +//================================================================================ +/*! + * \brief Create a real projector + */ +//================================================================================ + +void FT_Projector::prepareForProjection() +{ + if ( _shape.IsNull() || _realProjector ) + return; + + if ( _shape.ShapeType() == TopAbs_EDGE ) + { + const TopoDS_Edge& edge = TopoDS::Edge( _shape ); + + double tol = 1e-6 * sqrt( _bndBox.SquareExtent() ); + + double f,l; + Handle(Geom_Curve) curve = BRep_Tool::Curve( edge, f,l ); + if ( curve.IsNull() ) + return; // degenerated edge + + GeomAdaptor_Curve acurve( curve, f, l ); + switch ( acurve.GetType() ) + { + case GeomAbs_Line: + _realProjector = new LineProjector( edge ); + break; + case GeomAbs_Circle: + _realProjector = new CircleProjector( acurve.Circle(), f, l ); + break; + case GeomAbs_BezierCurve: + case GeomAbs_BSplineCurve: + case GeomAbs_OffsetCurve: + case GeomAbs_OtherCurve: + if ( isStraight( acurve, tol )) + { + _realProjector = new LineProjector( edge ); + break; + } + case GeomAbs_Ellipse: + case GeomAbs_Hyperbola: + case GeomAbs_Parabola: + _realProjector = new CurveProjector( edge, tol ); + } + } + else if ( _shape.ShapeType() == TopAbs_FACE ) + { + TopoDS_Face face = TopoDS::Face( _shape ); + + Handle(Geom_Surface) surface = BRep_Tool::Surface( face ); + if ( surface.IsNull() ) + return; + + GeomAdaptor_Surface asurface( surface ); + Standard_Real tol = BRep_Tool::Tolerance( face ); + Standard_Real toluv = Min( asurface.UResolution( tol ), asurface.VResolution( tol )); + BRepTopAdaptor_FClass2d* classifier = new BRepTopAdaptor_FClass2d( face, toluv ); + + switch ( asurface.GetType() ) + { + case GeomAbs_Plane: + _realProjector = new PlaneProjector( asurface.Plane(), face, classifier ); + break; + case GeomAbs_Cylinder: + _realProjector = new CylinderProjector( asurface.Cylinder(), face, classifier ); + break; + case GeomAbs_Sphere: + _realProjector = new SphereProjector( asurface.Sphere(), face, classifier ); + break; + case GeomAbs_Cone: + _realProjector = new ConeProjector( asurface.Cone(), face, classifier ); + break; + case GeomAbs_Torus: + _realProjector = new TorusProjector( asurface.Torus(), face, classifier ); + break; + case GeomAbs_BezierSurface: + case GeomAbs_BSplineSurface: + case GeomAbs_SurfaceOfRevolution: + case GeomAbs_SurfaceOfExtrusion: + case GeomAbs_OffsetSurface: + case GeomAbs_OtherSurface: + GeomLib_IsPlanarSurface isPlaneCheck( surface, tol ); + if ( isPlaneCheck.IsPlanar() ) + { + _realProjector = new PlaneProjector( isPlaneCheck.Plan(), face, classifier, + /*isRealPlane=*/false); + } + else + { + _realProjector = new SurfaceProjector( face, tol, classifier ); + } + break; + } + + if ( !_realProjector ) + delete classifier; + } +} + +//================================================================================ +/*! + * \brief Return true if projection is not needed + */ +//================================================================================ + +bool FT_Projector::isPlanarBoundary() const +{ + return ( dynamic_cast< LineProjector* >( _realProjector ) || + dynamic_cast< PlaneProjector* >( _realProjector ) ); +} + +//================================================================================ +/*! + * \brief Check if a point lies on the boundary shape + * \param [in] point - the point to check + * \param [in] tol2 - a square tolerance allowing to decide whether a point is on the shape + * \param [in] newSolution - position on the shape (U or UV) of the point found + * during projecting + * \param [in] prevSolution - position on the shape (U or UV) of a neighbor point + * \return bool - \c true if the point lies on the boundary shape + * + * This method is used to select a shape by checking if all neighbor nodes of a node to move + * lie on a shape. + */ +//================================================================================ + +bool FT_Projector::isOnShape( const gp_Pnt& point, + const double tol2, + double* newSolution, + const double* prevSolution) +{ + if ( _bndBox.IsOut( point ) || !_realProjector ) + return false; + + gp_Pnt proj; + if ( isPlanarBoundary() ) + return projectAndClassify( point, tol2, proj, newSolution, prevSolution ); + + return project( point, tol2, proj, newSolution, prevSolution ); +} + +//================================================================================ +/*! + * \brief Project a point to the boundary shape + * \param [in] point - the point to project + * \param [in] maxDist2 - the maximal square distance between the point and the projection + * \param [out] projection - the projection + * \param [out] newSolution - position on the shape (U or UV) of the point found + * during projecting + * \param [in] prevSolution - already found position on the shape (U or UV) of a neighbor point + * \return bool - false if the distance between the point and the projection + * is more than sqrt(maxDist2) + * + * This method is used to project a node in the case where only one shape is found by name + */ +//================================================================================ + +bool FT_Projector::project( const gp_Pnt& point, + const double maxDist2, + gp_Pnt& projection, + double* newSolution, + const double* prevSolution) +{ + if ( !_realProjector ) + return false; + + _realProjector->_dist = 1e100; + projection = _realProjector->project( point, newSolution, prevSolution ); + + bool ok = ( _realProjector->_dist * _realProjector->_dist < maxDist2 ); + if ( !ok && _tryWOPrevSolution && prevSolution ) + { + projection = _realProjector->project( point, newSolution ); + ok = ( _realProjector->_dist * _realProjector->_dist < maxDist2 ); + } + return ok; +} + +//================================================================================ +/*! + * \brief Project a point to the boundary shape and check if the projection lies within + * the shape boundary + * \param [in] point - the point to project + * \param [in] maxDist2 - the maximal square distance between the point and the projection + * \param [out] projection - the projection + * \param [out] newSolution - position on the shape (U or UV) of the point found + * during projecting + * \param [in] prevSolution - already found position on the shape (U or UV) of a neighbor point + * \return bool - false if the projection point lies out of the shape boundary or + * the distance between the point and the projection is more than sqrt(maxDist2) + * + * This method is used to project a node in the case where several shapes are selected for + * projection of a node group + */ +//================================================================================ + +bool FT_Projector::projectAndClassify( const gp_Pnt& point, + const double maxDist2, + gp_Pnt& projection, + double* newSolution, + const double* prevSolution) +{ + if ( _bndBox.IsOut( point ) || !_realProjector ) + return false; + + bool ok = _realProjector->projectAndClassify( point, maxDist2, projection, + newSolution, prevSolution ); + if ( !ok && _tryWOPrevSolution && prevSolution ) + ok = _realProjector->projectAndClassify( point, maxDist2, projection, newSolution ); + + return ok; +} + +//================================================================================ +/*! + * \brief Return true if a previously found solution can be used to speed up the projection + */ +//================================================================================ + +bool FT_Projector::canUsePrevSolution() const +{ + return ( _realProjector && _realProjector->canUsePrevSolution() ); +} diff --git a/src/ADAPTFrontTrack/FrontTrack_Projector.hxx b/src/ADAPTFrontTrack/FrontTrack_Projector.hxx new file mode 100644 index 000000000..82578e252 --- /dev/null +++ b/src/ADAPTFrontTrack/FrontTrack_Projector.hxx @@ -0,0 +1,95 @@ +// Copyright (C) 2017-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : FrontTrack_Projector.hxx +// Created : Wed Apr 26 20:12:13 2017 +// Author : Edward AGAPOV (eap) + +#ifndef __FrontTrack_Projector_HXX__ +#define __FrontTrack_Projector_HXX__ + +#include +#include + +struct FT_RealProjector; + +/*! + * \brief Projector of a point to a boundary shape. Wrapper of a real projection algo + */ +class FT_Projector +{ +public: + + FT_Projector(const TopoDS_Shape& shape = TopoDS_Shape()); + FT_Projector(const FT_Projector& other); + ~FT_Projector(); + + // initialize with a boundary shape, compute the bounding box + void setBoundaryShape(const TopoDS_Shape& shape); + + // return the boundary shape + const TopoDS_Shape& getShape() const { return _shape; } + + // return the bounding box + const Bnd_Box getBoundingBox() const { return _bndBox; } + + + // create a real projector + void prepareForProjection(); + + // return true if a previously found solution can be used to speed up the projection + bool canUsePrevSolution() const; + + // return true if projection is not needed + bool isPlanarBoundary() const; + + + // switch a mode of usage of prevSolution. + // If projection fails, to try to project without usage of prevSolution. + // By default this mode is off + void tryWithoutPrevSolution( bool toTry ) { _tryWOPrevSolution = toTry; } + + // project a point to the boundary shape + bool project( const gp_Pnt& point, + const double maxDist2, + gp_Pnt& projection, + double* newSolution, + const double* prevSolution = 0); + + // project a point to the boundary shape and check if the projection is within the shape boundary + bool projectAndClassify( const gp_Pnt& point, + const double maxDist2, + gp_Pnt& projection, + double* newSolution, + const double* prevSolution = 0); + + // check if a point lies on the boundary shape + bool isOnShape( const gp_Pnt& point, + const double tol2, + double* newSolution, + const double* prevSolution = 0); + +private: + + FT_RealProjector* _realProjector; + Bnd_Box _bndBox; + TopoDS_Shape _shape; + bool _tryWOPrevSolution; +}; + +#endif diff --git a/src/ADAPTFrontTrack/FrontTrack_Utils.cxx b/src/ADAPTFrontTrack/FrontTrack_Utils.cxx new file mode 100644 index 000000000..e74072ac0 --- /dev/null +++ b/src/ADAPTFrontTrack/FrontTrack_Utils.cxx @@ -0,0 +1,164 @@ +// Copyright (C) 2017-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : FrontTrack_Utils.cxx +// Created : Tue Apr 25 17:28:58 2017 +// Author : Edward AGAPOV (eap) + +#include "FrontTrack_Utils.hxx" + +#include +#include + +#include +#include + +namespace boofs = boost::filesystem; + +//================================================================================ +/* + * \brief Check if a file exists + */ +//================================================================================ + +bool FT_Utils::fileExists( const std::string& path ) +{ + if ( path.empty() ) + return false; + + boost::system::error_code err; + bool res = boofs::exists( path, err ); + + return err ? false : res; +} + +//================================================================================ +/*! + * \brief Check if a file can be created/overwritten + */ +//================================================================================ + +bool FT_Utils::canWrite( const std::string& path ) +{ + if ( path.empty() ) + return false; + + bool can = false; +#ifdef WIN32 + + HANDLE file = CreateFile( path.c_str(), // name of the write + GENERIC_WRITE, // open for writing + 0, // do not share + NULL, // default security + OPEN_ALWAYS, // CREATE NEW or OPEN EXISTING + FILE_ATTRIBUTE_NORMAL, // normal file + NULL); // no attr. template + can = ( file != INVALID_HANDLE_VALUE ); + CloseHandle( file ); + +#else + + int file = ::open( path.c_str(), + O_WRONLY | O_CREAT, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ); // rw-r--r-- + can = ( file >= 0 ); + +#endif + + return can; +} + +//================================================================================ +/*! + * \brief Make a map of XAO groups + */ +//================================================================================ + +FT_Utils::XaoGroups::XaoGroups( const XAO::Xao* theXao ) +{ + XAO::Xao* xao = const_cast< XAO::Xao* >( theXao ); + + for ( int iG = 0; iG < theXao->countGroups(); ++iG ) + { + XAO::Group* group = xao->getGroup( iG ); + + if ( group->getDimension() == 1 ) + + _xaoGroups[ 0 ].insert( std::make_pair( group->getName(), group )); + + else if ( group->getDimension() == 2 ) + + _xaoGroups[ 1 ].insert( std::make_pair( group->getName(), group )); + } +} + +//================================================================================ +/*! + * \brief Return FT_Projector's by a group name + * \param [in] groupName - the group name + * \param [in] dim - the group dimension + * \param [in] allProjectors - the projector of all shapes of \a dim dimension + * \param [out] groupProjectors - projectors to shapes of the group + * \return int - number of found shapes + */ +//================================================================================ + +int FT_Utils::XaoGroups::getProjectors( const std::string& groupName, + const int dim, + const std::vector< FT_Projector > & allProjectors, + std::vector< const FT_Projector* > & groupProjectors) const +{ + // get namesake groups + + const TGroupByNameMap* groupMap = 0; + if ( dim == 1 ) + groupMap = &_xaoGroups[ 0 ]; + else if ( dim == 2 ) + groupMap = &_xaoGroups[ 1 ]; + else + return 0; + + TGroupByNameMap::const_iterator name2gr = groupMap->find( groupName ); + if ( name2gr == groupMap->end() ) + return 0; + + std::vector< XAO::Group* > groups; + groups.push_back( name2gr->second ); + + for ( ++name2gr; name2gr != groupMap->end(); ++name2gr ) + { + if ( name2gr->second->getName() == groupName ) + groups.push_back( name2gr->second ); + else + break; + } + + // get projectors + + int nbFound = 0; + for ( size_t i = 0; i < groups.size(); ++i ) + { + // IDs in XAO correspond to indices of allProjectors + std::set::iterator id = groups[i]->begin(), end = groups[i]->end(); + for ( ; id != end; ++id, ++nbFound ) + if ( *id < (int) allProjectors.size() ) + groupProjectors.push_back ( & allProjectors[ *id ]); + } + + return nbFound; +} diff --git a/src/ADAPTFrontTrack/FrontTrack_Utils.hxx b/src/ADAPTFrontTrack/FrontTrack_Utils.hxx new file mode 100644 index 000000000..38817cb59 --- /dev/null +++ b/src/ADAPTFrontTrack/FrontTrack_Utils.hxx @@ -0,0 +1,72 @@ +// Copyright (C) 2017-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : FrontTrack_Utils.hxx +// Created : Tue Apr 25 17:23:33 2017 +// Author : Edward AGAPOV (eap) + +#ifndef __FrontTrack_Utils_HXX__ +#define __FrontTrack_Utils_HXX__ + +#include "FrontTrack_Projector.hxx" + +#include +#include +#include + +namespace XAO { + class Xao; + class Group; +} + +namespace FT_Utils +{ + // Check if a file exists + bool fileExists( const std::string& path ); + + // Check if a file can be created/overwritten + bool canWrite( const std::string& path ); + + // Transform anything printable to a string + template< typename T> std::string toStr( const T& t ) + { + std::ostringstream s; + s << t; + return s.str(); + } + + //-------------------------------------------------------------------------------------------- + /*! + * \brief Return projectors by group name + */ + struct XaoGroups + { + XaoGroups( const XAO::Xao* xao ); + + int getProjectors( const std::string& groupName, + const int dim, + const std::vector< FT_Projector > & allProjectors, + std::vector< const FT_Projector* > & groupProjectors ) const; + private: + + typedef std::multimap< std::string, XAO::Group* > TGroupByNameMap; + TGroupByNameMap _xaoGroups[ 2 ]; // by dim + }; +} + +#endif diff --git a/src/ADAPTFrontTrack_SWIG/CMakeLists.txt b/src/ADAPTFrontTrack_SWIG/CMakeLists.txt new file mode 100644 index 000000000..11543824f --- /dev/null +++ b/src/ADAPTFrontTrack_SWIG/CMakeLists.txt @@ -0,0 +1,83 @@ +# Copyright (C) 2017-2020 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +INCLUDE(${SWIG_USE_FILE}) + +# --- options --- +# additional include directories +INCLUDE_DIRECTORIES( + ${PYTHON_INCLUDE_DIRS} + ${PTHREAD_INCLUDE_DIR} # pthread dependancy due to python2.7 library + ${CMAKE_CURRENT_SOURCE_DIR} + ${PROJECT_SOURCE_DIR}/src/ADAPTFrontTrack +) + +# additional preprocessor / compiler flags +ADD_DEFINITIONS( + ${PYTHON_DEFINITIONS} +) + +# libraries to link to +SET(_link_LIBRARIES + ${PYTHON_LIBRARIES} + ${PLATFORM_LIBS} + ADAPTFrontTrack +) + +# --- headers --- + +# header files / to be processed by moc +SET(ADAPTFrontTrack_Swig_HEADERS + FrontTrack_Swig.i +) + +# --- sources --- + +# sources / static +SET(ADAPTFrontTrack_Swig_SOURCES + ${ADAPTFrontTrack_Swig_HEADERS} +) + +# swig flags +SET_SOURCE_FILES_PROPERTIES(FrontTrack_Swig.i PROPERTIES CPLUSPLUS ON) +SET_SOURCE_FILES_PROPERTIES(FrontTrack_Swig.i PROPERTIES SWIG_DEFINITIONS "-shadow") + +# --- scripts --- + +# scripts / swig wrappings +SET(_swig_SCRIPTS + ${CMAKE_CURRENT_BINARY_DIR}/FrontTrack.py +) + +# --- rules --- +IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") + SWIG_ADD_MODULE(FrontTrack_Swig python ${ADAPTFrontTrack_Swig_SOURCES}) +ELSE() + SWIG_ADD_LIBRARY(FrontTrack_Swig LANGUAGE python SOURCES ${ADAPTFrontTrack_Swig_SOURCES}) +ENDIF() + +SWIG_LINK_LIBRARIES(FrontTrack_Swig ${_link_LIBRARIES}) +SWIG_CHECK_GENERATION(FrontTrack_Swig) +IF(WIN32) + SET_TARGET_PROPERTIES(_FrontTrack_Swig PROPERTIES DEBUG_OUTPUT_NAME _FrontTrack_Swig_d) +ENDIF(WIN32) + +INSTALL(TARGETS ${SWIG_MODULE_FrontTrack_Swig_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON}) + +SALOME_INSTALL_SCRIPTS("${_swig_SCRIPTS}" ${SALOME_INSTALL_PYTHON} EXTRA_DPYS "${SWIG_MODULE_FrontTrack_Swig_REAL_NAME}") diff --git a/src/ADAPTFrontTrack_SWIG/FrontTrack.i b/src/ADAPTFrontTrack_SWIG/FrontTrack.i new file mode 100644 index 000000000..50c6c2066 --- /dev/null +++ b/src/ADAPTFrontTrack_SWIG/FrontTrack.i @@ -0,0 +1,67 @@ +// Copyright (C) 2017-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : FrontTrack.i +// Created : Fri Apr 28 17:36:20 2017 +// Author : Edward AGAPOV (eap) + +%module FrontTrack + +%{ +#include "FrontTrack.hxx" +#include +#include +#include + +static PyObject* setOCCException(Standard_Failure& ex) +{ + std::string msg(ex.DynamicType()->Name()); + if ( ex.GetMessageString() && strlen( ex.GetMessageString() )) { + msg += ": "; + msg += ex.GetMessageString(); + } + PyErr_SetString(PyExc_Exception, msg.c_str() ); + return NULL; +} + +%} + + +%exception +{ + try { + OCC_CATCH_SIGNALS; + $action } + catch (Standard_Failure& ex) { + return setOCCException(ex); + } + catch (std::exception& ex) { + PyErr_SetString(PyExc_Exception, ex.what() ); + return NULL; + } +} + +%include +%include + +%template(svec) std::vector; + +//%feature("autodoc", "1"); +//%feature("docstring"); + +%include "FrontTrack.hxx" From e48a18b261c8ca83190b2b449060c2f315ca9fe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Wed, 20 May 2020 17:54:52 +0200 Subject: [PATCH 006/100] =?UTF-8?q?compl=C3=A9ments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ADAPTGUI/CMakeLists.txt | 54 ++++++++++++++++++------------------- src/ADAPT_I/CMakeLists.txt | 11 +++++--- 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/src/ADAPTGUI/CMakeLists.txt b/src/ADAPTGUI/CMakeLists.txt index 54cb7d0ff..700628787 100644 --- a/src/ADAPTGUI/CMakeLists.txt +++ b/src/ADAPTGUI/CMakeLists.txt @@ -54,36 +54,10 @@ SET(_link_LIBRARIES ${KERNEL_SalomeLifeCycleCORBA} ${KERNEL_SalomeDS} ${GUI_SalomeApp} - SalomeIDLADAPT + ${SMESH_SalomeIDLSMESH} ADAPTEngine ) -# --- resources --- - -# resource files / to be processed by lrelease -SET(_ts_RESOURCES - ADAPT_msg_en.ts - ADAPT_msg_fr.ts - ADAPT_msg_ja.ts -) - -# resource files / to be processed by uic -SET(_uic_FILES - CreateBoundaryCAO.ui - CreateBoundaryAn.ui - CreateBoundaryDi.ui - CreateCase.ui - CreateHypothesis.ui - CreateIteration.ui - CreateListGroup.ui - CreateYACS.ui - CreateZone.ui - EditFile.ui - IterInfo.ui - MeshInfo.ui - PursueIteration.ui -) - # --- headers --- # header files / to be processed by moc @@ -167,6 +141,32 @@ SET(_other_SOURCES # sources / to compile SET(ADAPT_SOURCES ${_other_SOURCES} ${_moc_SOURCES} ${_uic_HEADERS}) +# --- resources --- + +# resource files / to be processed by lrelease +SET(_ts_RESOURCES + ADAPT_msg_en.ts + ADAPT_msg_fr.ts + ADAPT_msg_ja.ts +) + +# resource files / to be processed by uic +SET(_uic_FILES + CreateBoundaryCAO.ui + CreateBoundaryAn.ui + CreateBoundaryDi.ui + CreateCase.ui + CreateHypothesis.ui + CreateIteration.ui + CreateListGroup.ui + CreateYACS.ui + CreateZone.ui + EditFile.ui + IterInfo.ui + MeshInfo.ui + PursueIteration.ui +) + # --- rules --- ADD_LIBRARY(ADAPT ${ADAPT_SOURCES}) diff --git a/src/ADAPT_I/CMakeLists.txt b/src/ADAPT_I/CMakeLists.txt index f571c2158..b569b1e3d 100644 --- a/src/ADAPT_I/CMakeLists.txt +++ b/src/ADAPT_I/CMakeLists.txt @@ -29,9 +29,14 @@ INCLUDE_DIRECTORIES( ${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}/idl ${PROJECT_BINARY_DIR}/adm_local/unix - ${PROJECT_SOURCE_DIR}/src/FrontTrack + ${PROJECT_SOURCE_DIR}/src/ADAPTFrontTrack ${PROJECT_SOURCE_DIR}/src/ADAPT ${PROJECT_SOURCE_DIR}/src/ADAPTGUI + ${PROJECT_SOURCE_DIR}/src/SMESH_I + ${PROJECT_SOURCE_DIR}/src/SMESH + ${PROJECT_SOURCE_DIR}/src/SMESHDS + ${PROJECT_SOURCE_DIR}/src/SMDS + ${PROJECT_SOURCE_DIR}/src/SMESHUtils ) # additional preprocessor / compiler flags ADD_DEFINITIONS( @@ -50,9 +55,9 @@ SET(_link_LIBRARIES ${KERNEL_SalomeGenericObj} ${SMESH_SalomeIDLSMESH} ${SMESH_SMESHEngine} - FrontTrack - SalomeIDLADAPT + ADAPTFrontTrack ADAPTImpl + SMESHimpl ) # --- headers --- From ad3b3a2bbf307b43f9bd027673dd8d1eccf86b50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Wed, 20 May 2020 18:06:11 +0200 Subject: [PATCH 007/100] Version et engine --- src/ADAPT_I/HOMARD_Gen_i.cxx | 10 +++++----- src/ADAPT_I/HOMARD_i.hxx | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ADAPT_I/HOMARD_Gen_i.cxx b/src/ADAPT_I/HOMARD_Gen_i.cxx index dde42a691..35cca098a 100644 --- a/src/ADAPT_I/HOMARD_Gen_i.cxx +++ b/src/ADAPT_I/HOMARD_Gen_i.cxx @@ -32,7 +32,7 @@ #include "FrontTrack.hxx" -#include "HOMARD_version.h" +#include "SMESH_version.h" #include "utilities.h" #include "Basics_Utils.hxx" @@ -5174,9 +5174,9 @@ void SALOMEException( std::string message ) char* HOMARD_Gen_i::getVersion() { #if HOMARD_DEVELOPMENT - return CORBA::string_dup(HOMARD_VERSION_STR"dev"); + return CORBA::string_dup(SMESH_VERSION_STR"dev"); #else - return CORBA::string_dup(HOMARD_VERSION_STR); + return CORBA::string_dup(SMESH_VERSION_STR); #endif } //=============================================================================== @@ -5419,13 +5419,13 @@ CORBA::Long HOMARD_Gen_i::GetYACSConvergenceType() extern "C" { HOMARDENGINE_EXPORT - PortableServer::ObjectId* HOMARDEngine_factory(CORBA::ORB_ptr orb, + PortableServer::ObjectId* ADAPTEngine_factory(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId* contId, const char* instanceName, const char* interfaceName) { - MESSAGE("PortableServer::ObjectId* HOMARDEngine_factory()"); + MESSAGE("PortableServer::ObjectId* ADAPTEngine_factory()"); HOMARD_Gen_i* myHOMARD_Gen = new HOMARD_Gen_i(orb, poa, contId, instanceName, interfaceName); return myHOMARD_Gen->getId(); } diff --git a/src/ADAPT_I/HOMARD_i.hxx b/src/ADAPT_I/HOMARD_i.hxx index 2f6aad6bd..359e33143 100644 --- a/src/ADAPT_I/HOMARD_i.hxx +++ b/src/ADAPT_I/HOMARD_i.hxx @@ -21,7 +21,7 @@ #define _HOMARD_I_HXX_ #ifdef WIN32 - #if defined HOMARDENGINE_EXPORTS || defined HOMARDEngine_EXPORTS + #if defined HOMARDENGINE_EXPORTS || defined ADAPTEngine_EXPORTS #define HOMARDENGINE_EXPORT __declspec( dllexport ) #else #define HOMARDENGINE_EXPORT __declspec( dllimport ) From a619ad25da76e6a31abf4334b5acc63a7ec884d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Mon, 25 May 2020 11:02:20 +0200 Subject: [PATCH 008/100] MEDCoupling indispensable --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f41109eb9..cf1162252 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -191,6 +191,15 @@ IF(NOT WITH_SHAPER_STUDY AND SALOME_BUILD_TESTS) MESSAGE(WARNING "SHAPERSTUDY is not found; the corresponding tests will be omitted") ENDIF() +# Find MEDCoupling +# ================ +SET(MEDCOUPLING_ROOT_DIR $ENV{MEDCOUPLING_ROOT_DIR} CACHE PATH "Path to the MEDCoupling tool") +IF(EXISTS ${MEDCOUPLING_ROOT_DIR}) + FIND_PACKAGE(SalomeMEDCoupling REQUIRED) # will reload HDF5, MEDFile, XDR, etc ... +ELSE(EXISTS ${MEDCOUPLING_ROOT_DIR}) + MESSAGE(FATAL_ERROR "We absolutely need the MEDCoupling tool, please define MEDCOUPLING_ROOT_DIR !") +ENDIF(EXISTS ${MEDCOUPLING_ROOT_DIR}) + ## ## SMESH specifics ## From a284639387524353a2774d79a5c947ef99d5cc5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Mon, 25 May 2020 11:02:54 +0200 Subject: [PATCH 009/100] oubli de FrontTrack --- src/ADAPTFrontTrack_SWIG/CMakeLists.txt | 4 ++-- src/CMakeLists.txt | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ADAPTFrontTrack_SWIG/CMakeLists.txt b/src/ADAPTFrontTrack_SWIG/CMakeLists.txt index 11543824f..82beb4d4d 100644 --- a/src/ADAPTFrontTrack_SWIG/CMakeLists.txt +++ b/src/ADAPTFrontTrack_SWIG/CMakeLists.txt @@ -44,7 +44,7 @@ SET(_link_LIBRARIES # header files / to be processed by moc SET(ADAPTFrontTrack_Swig_HEADERS - FrontTrack_Swig.i + FrontTrack.i ) # --- sources --- @@ -62,7 +62,7 @@ SET_SOURCE_FILES_PROPERTIES(FrontTrack_Swig.i PROPERTIES SWIG_DEFINITIONS "-shad # scripts / swig wrappings SET(_swig_SCRIPTS - ${CMAKE_CURRENT_BINARY_DIR}/FrontTrack.py + ${CMAKE_CURRENT_BINARY_DIR}/FrontTrack.py ) # --- rules --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 80fa00a42..1142d5784 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -42,6 +42,8 @@ SET(SUBDIRS_COMMON Tools ADAPT ADAPT_I + ADAPTFrontTrack + ADAPTFrontTrack_SWIG ) IF(SALOME_SMESH_ENABLE_MEFISTO) @@ -52,7 +54,7 @@ ENDIF(SALOME_SMESH_ENABLE_MEFISTO) # CGNS ## IF(SALOME_SMESH_USE_CGNS) - SET(SUBDIRS_CGNS + SET(SUBDIRS_CGNS DriverCGNS ) ENDIF(SALOME_SMESH_USE_CGNS) @@ -61,9 +63,9 @@ ENDIF(SALOME_SMESH_USE_CGNS) # GUI ## IF(SALOME_BUILD_GUI) - SET(SUBDIRS_GUI OBJECT - SMESHFiltersSelection - SMESHGUI + SET(SUBDIRS_GUI OBJECT + SMESHFiltersSelection + SMESHGUI PluginUtils SMESH_SWIG_WITHIHM StdMeshersGUI From c047fd2702fe87a7d78c12fbb53d936deefd4dbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Mon, 25 May 2020 11:23:56 +0200 Subject: [PATCH 010/100] Coquille --- src/ADAPTFrontTrack_SWIG/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ADAPTFrontTrack_SWIG/CMakeLists.txt b/src/ADAPTFrontTrack_SWIG/CMakeLists.txt index 82beb4d4d..5b9a4a901 100644 --- a/src/ADAPTFrontTrack_SWIG/CMakeLists.txt +++ b/src/ADAPTFrontTrack_SWIG/CMakeLists.txt @@ -55,8 +55,8 @@ SET(ADAPTFrontTrack_Swig_SOURCES ) # swig flags -SET_SOURCE_FILES_PROPERTIES(FrontTrack_Swig.i PROPERTIES CPLUSPLUS ON) -SET_SOURCE_FILES_PROPERTIES(FrontTrack_Swig.i PROPERTIES SWIG_DEFINITIONS "-shadow") +SET_SOURCE_FILES_PROPERTIES(FrontTrack.i PROPERTIES CPLUSPLUS ON) +SET_SOURCE_FILES_PROPERTIES(FrontTrack.i PROPERTIES SWIG_DEFINITIONS "-shadow") # --- scripts --- From 8d8960f24f138accde50dbfc3a72589129850f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Mon, 25 May 2020 11:44:25 +0200 Subject: [PATCH 011/100] Ordre correct pour les.ui --- src/ADAPTGUI/CMakeLists.txt | 52 ++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/ADAPTGUI/CMakeLists.txt b/src/ADAPTGUI/CMakeLists.txt index 700628787..eb518d3a1 100644 --- a/src/ADAPTGUI/CMakeLists.txt +++ b/src/ADAPTGUI/CMakeLists.txt @@ -58,6 +58,32 @@ SET(_link_LIBRARIES ADAPTEngine ) +# --- resources --- + +# resource files / to be processed by lrelease +SET(_ts_RESOURCES + ADAPT_msg_en.ts + ADAPT_msg_fr.ts + ADAPT_msg_ja.ts +) + +# resource files / to be processed by uic +SET(_uic_FILES + CreateBoundaryCAO.ui + CreateBoundaryAn.ui + CreateBoundaryDi.ui + CreateCase.ui + CreateHypothesis.ui + CreateIteration.ui + CreateListGroup.ui + CreateYACS.ui + CreateZone.ui + EditFile.ui + IterInfo.ui + MeshInfo.ui + PursueIteration.ui +) + # --- headers --- # header files / to be processed by moc @@ -141,32 +167,6 @@ SET(_other_SOURCES # sources / to compile SET(ADAPT_SOURCES ${_other_SOURCES} ${_moc_SOURCES} ${_uic_HEADERS}) -# --- resources --- - -# resource files / to be processed by lrelease -SET(_ts_RESOURCES - ADAPT_msg_en.ts - ADAPT_msg_fr.ts - ADAPT_msg_ja.ts -) - -# resource files / to be processed by uic -SET(_uic_FILES - CreateBoundaryCAO.ui - CreateBoundaryAn.ui - CreateBoundaryDi.ui - CreateCase.ui - CreateHypothesis.ui - CreateIteration.ui - CreateListGroup.ui - CreateYACS.ui - CreateZone.ui - EditFile.ui - IterInfo.ui - MeshInfo.ui - PursueIteration.ui -) - # --- rules --- ADD_LIBRARY(ADAPT ${ADAPT_SOURCES}) From 9bad31fec2371857d4024bcc86a7f4a7e8017a83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Mon, 25 May 2020 14:11:11 +0200 Subject: [PATCH 012/100] Messages des sous-menus --- src/SMESHGUI/SMESH_msg_en.ts | 24 ++++++++++++++++++++++++ src/SMESHGUI/SMESH_msg_fr.ts | 24 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index da239a33b..559c7e297 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -3152,6 +3152,30 @@ Use Display Entity menu command to show them. STB_REF_HOMARD Refinement with HOMARD + + STB_HOMARD_CREATE_CASE + Creation of a new case + + + STB_HOMARD_FOLLOW_ITERATION + Creation of a new case: pursuit of a stored iteration + + + STB_HOMARD_NEW_ITERATION + Creation of a next iteration + + + STB_HOMARD_COMPUTE + Compute the refinement + + + STB_HOMARD_COMPUTE_PUBLISH + Compute the refinement and publish the final mesh + + + STB_EDIT + Edit + STB_MG_ADAPT Remesh with MG_Adapt diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index 4cfbce422..18f64d3d3 100644 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -3123,6 +3123,30 @@ Utilisez le menu "Visualiser une entité" pour les afficher. STB_REF_HOMARD Raffinement avec HOMARD + + STB_HOMARD_CREATE_CASE + Création d'un nouveau cas + + + STB_HOMARD_FOLLOW_ITERATION + Création d'un nouveau cas : poursuite d'une itération stockée + + + STB_HOMARD_NEW_ITERATION + Création d'une nouvelle itération + + + STB_HOMARD_COMPUTE + Calcule le raffinement + + + STB_HOMARD_COMPUTE_PUBLISH + Calcule le raffinement et publie le maillage résultat + + + STB_EDIT + Edit + STB_MG_ADAPT Remaillage avec MG_Adapt From c75229490671ab94cf647671ac3f17fb7415fde6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Mon, 25 May 2020 14:29:23 +0200 Subject: [PATCH 013/100] Changement de nom HOMARDGUI ==> ADAPTGUI --- src/ADAPTGUI/{HOMARDGUI.cxx => ADAPTGUI.cxx} | 72 ++++++++++---------- src/ADAPTGUI/{HOMARDGUI.h => ADAPTGUI.h} | 12 ++-- src/ADAPTGUI/CMakeLists.txt | 4 +- src/ADAPTGUI/HOMARDGUI_Utils.cxx | 4 +- 4 files changed, 46 insertions(+), 46 deletions(-) rename src/ADAPTGUI/{HOMARDGUI.cxx => ADAPTGUI.cxx} (95%) rename src/ADAPTGUI/{HOMARDGUI.h => ADAPTGUI.h} (92%) diff --git a/src/ADAPTGUI/HOMARDGUI.cxx b/src/ADAPTGUI/ADAPTGUI.cxx similarity index 95% rename from src/ADAPTGUI/HOMARDGUI.cxx rename to src/ADAPTGUI/ADAPTGUI.cxx index 8a726faac..5b5fae290 100644 --- a/src/ADAPTGUI/HOMARDGUI.cxx +++ b/src/ADAPTGUI/ADAPTGUI.cxx @@ -17,11 +17,11 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// File : HOMARDGUI.cxx +// File : ADAPTGUI.cxx // Author : Gerald NICOLAS, EDF // Module : HOMARD -#include "HOMARDGUI.h" +#include "ADAPTGUI.h" // SALOME Includes #include "Utils_ORB_INIT.hxx" @@ -84,18 +84,18 @@ using namespace std; static CORBA::ORB_var _orb; //======================================================================= -// function : HOMARDGUI() +// function : ADAPTGUI() // purpose : Constructor //======================================================================= -HOMARDGUI::HOMARDGUI(const QString&) : +ADAPTGUI::ADAPTGUI(const QString&) : SalomeApp_Module( "HOMARD" ) // default name { } //======================================================================= -// function : ~HOMARDGUI() +// function : ~ADAPTGUI() // purpose : Destructor //======================================================================= -HOMARDGUI::~HOMARDGUI() +ADAPTGUI::~ADAPTGUI() { } @@ -103,7 +103,7 @@ HOMARDGUI::~HOMARDGUI() // function : InitHOMARDGen // launch HOMARD component and return a handle //======================================================================= -HOMARD::HOMARD_Gen_var HOMARDGUI::InitHOMARDGen(SalomeApp_Application* app) +HOMARD::HOMARD_Gen_var ADAPTGUI::InitHOMARDGen(SalomeApp_Application* app) { Engines::EngineComponent_var comp = app->lcc()->FindOrLoad_Component( "FactoryServer","HOMARD" ); HOMARD::HOMARD_Gen_var clr = HOMARD::HOMARD_Gen::_narrow(comp); @@ -113,7 +113,7 @@ HOMARD::HOMARD_Gen_var HOMARDGUI::InitHOMARDGen(SalomeApp_Application* app) //======================================================================= // Module's initialization -void HOMARDGUI::initialize( CAM_Application* app ) +void ADAPTGUI::initialize( CAM_Application* app ) //======================================================================= { SalomeApp_Module::initialize( app ); @@ -128,7 +128,7 @@ void HOMARDGUI::initialize( CAM_Application* app ) // function : createHOMARDAction // create an item in status bar and Homard menu //================================================ -void HOMARDGUI::createHOMARDAction( const int id, const QString& po_id, const QString& icon_id, const int key, const bool toggle ) +void ADAPTGUI::createHOMARDAction( const int id, const QString& po_id, const QString& icon_id, const int key, const bool toggle ) { // MESSAGE("createHOMARDAction"); QIcon icon; @@ -154,7 +154,7 @@ void HOMARDGUI::createHOMARDAction( const int id, const QString& po_id, const QS // constructs Homard menu // calls createHOMARDAction for each item //================================================ -void HOMARDGUI::createActions(){ +void ADAPTGUI::createActions(){ // createHOMARDAction( 1101, "NEW_CASE", "cas_calcule.png" ); createHOMARDAction( 1102, "PURSUE_ITERATION", "iter_poursuite.png" ); @@ -177,7 +177,7 @@ void HOMARDGUI::createActions(){ //================================================ // function : createPreferences //================================================ -void HOMARDGUI::createPreferences() +void ADAPTGUI::createPreferences() { MESSAGE("createPreferences") @@ -229,7 +229,7 @@ void HOMARDGUI::createPreferences() //================================================ // function : createMenus //================================================ -void HOMARDGUI::createMenus() +void ADAPTGUI::createMenus() { MESSAGE("createMenus") // @@ -266,14 +266,14 @@ void HOMARDGUI::createMenus() // ces valeurs sont les valeurs definies. // . Si cela ne s'est pas bien passe, ce sont les valeurs par defaut de HOMARD_Gen //================================================ -void HOMARDGUI::recupPreferences() +void ADAPTGUI::recupPreferences() { MESSAGE("recupPreferences") // // A. Declarations // SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( application() ); - HOMARD::HOMARD_Gen_var homardGen = HOMARDGUI::InitHOMARDGen(app); + HOMARD::HOMARD_Gen_var homardGen = ADAPTGUI::InitHOMARDGen(app); int defaut_i ; std::string defaut_s ; QString QString_v ; @@ -339,7 +339,7 @@ void HOMARDGUI::recupPreferences() } //================================================ -void HOMARDGUI::OnGUIEvent() +void ADAPTGUI::OnGUIEvent() //================================================ { MESSAGE("OnGUIEvent()") @@ -354,7 +354,7 @@ void HOMARDGUI::OnGUIEvent() //======================================================================= // Method OnGUIEvent pour Homard //======================================================================= -bool HOMARDGUI::OnGUIEvent (int theCommandID) +bool ADAPTGUI::OnGUIEvent (int theCommandID) { MESSAGE("OnGUIEvent avec theCommandID = "<desktop(); - HOMARD::HOMARD_Gen_var homardGen = HOMARDGUI::InitHOMARDGen(app); + HOMARD::HOMARD_Gen_var homardGen = ADAPTGUI::InitHOMARDGen(app); if (!CORBA::is_nil(homardGen)) homardGen->UpdateStudy(); @@ -667,7 +667,7 @@ bool HOMARDGUI::OnGUIEvent (int theCommandID) // Module's engine IOR //============================================================================= -QString HOMARDGUI::engineIOR() const +QString ADAPTGUI::engineIOR() const //============================================================================= { CORBA::String_var anIOR = getApp()->orb()->object_to_string( InitHOMARDGen(getApp()) ); @@ -676,7 +676,7 @@ QString HOMARDGUI::engineIOR() const // Module's activation //============================================================================= -bool HOMARDGUI::activateModule( SUIT_Study* theStudy ) +bool ADAPTGUI::activateModule( SUIT_Study* theStudy ) //============================================================================= { bool bOk = SalomeApp_Module::activateModule( theStudy ); @@ -689,7 +689,7 @@ bool HOMARDGUI::activateModule( SUIT_Study* theStudy ) // Module's deactivation //============================================================================= -bool HOMARDGUI::deactivateModule( SUIT_Study* theStudy ) +bool ADAPTGUI::deactivateModule( SUIT_Study* theStudy ) //============================================================================= { setMenuShown( false ); @@ -700,7 +700,7 @@ bool HOMARDGUI::deactivateModule( SUIT_Study* theStudy ) // Default windows //============================================================================= -void HOMARDGUI::windows( QMap& theMap ) const +void ADAPTGUI::windows( QMap& theMap ) const //============================================================================= { theMap.clear(); @@ -711,7 +711,7 @@ void HOMARDGUI::windows( QMap& theMap ) const } //============================================================================= -void HOMARDGUI::setOrb() +void ADAPTGUI::setOrb() //============================================================================= { try @@ -728,7 +728,7 @@ void HOMARDGUI::setOrb() ASSERT(! CORBA::is_nil(_orb)); } //======================================== -_PTR(SObject) HOMARDGUI::chercheMonObjet() +_PTR(SObject) ADAPTGUI::chercheMonObjet() //======================================== { SALOMEDSClient_SObject* aSO = NULL; @@ -747,7 +747,7 @@ _PTR(SObject) HOMARDGUI::chercheMonObjet() else { return _PTR(SObject)(aSO); } } //============================================================================= -void HOMARDGUI::contextMenuPopup( const QString& client, QMenu* menu, QString& title ) +void ADAPTGUI::contextMenuPopup( const QString& client, QMenu* menu, QString& title ) //============================================================================= { MESSAGE("Debut de contextMenuPopup"); @@ -841,56 +841,56 @@ void HOMARDGUI::contextMenuPopup( const QString& client, QMenu* menu, QString& t } } -void HOMARDGUI::NextIter() +void ADAPTGUI::NextIter() { this->OnGUIEvent(1103); } -void HOMARDGUI::LanceCalcul0() +void ADAPTGUI::LanceCalcul0() { this->OnGUIEvent(1111); } -void HOMARDGUI::LanceCalcul1() +void ADAPTGUI::LanceCalcul1() { this->OnGUIEvent(1112); } -void HOMARDGUI::IterInfo() +void ADAPTGUI::IterInfo() { this->OnGUIEvent(1121); } -void HOMARDGUI::MeshPublish0() +void ADAPTGUI::MeshPublish0() { this->OnGUIEvent(1131); } -void HOMARDGUI::MeshPublish1() +void ADAPTGUI::MeshPublish1() { this->OnGUIEvent(1132); } -void HOMARDGUI::Edit() +void ADAPTGUI::Edit() { this->OnGUIEvent(1201); } -void HOMARDGUI::Delete() +void ADAPTGUI::Delete() { this->OnGUIEvent(1211); } -void HOMARDGUI::EditAsciiFile() +void ADAPTGUI::EditAsciiFile() { this->OnGUIEvent(1302); } -void HOMARDGUI::YACSCreate() +void ADAPTGUI::YACSCreate() { this->OnGUIEvent(1401); } -void HOMARDGUI::YACSWrite() +void ADAPTGUI::YACSWrite() { this->OnGUIEvent(1402); } @@ -903,7 +903,7 @@ void HOMARDGUI::YACSWrite() extern "C" { Standard_EXPORT CAM_Module* createModule() { - return new HOMARDGUI(""); + return new ADAPTGUI(""); } } diff --git a/src/ADAPTGUI/HOMARDGUI.h b/src/ADAPTGUI/ADAPTGUI.h similarity index 92% rename from src/ADAPTGUI/HOMARDGUI.h rename to src/ADAPTGUI/ADAPTGUI.h index 0c0a36bdd..d86a72991 100644 --- a/src/ADAPTGUI/HOMARDGUI.h +++ b/src/ADAPTGUI/ADAPTGUI.h @@ -17,11 +17,11 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// HOMARDGUI : HOMARD component GUI implemetation +// ADAPTGUI : HOMARD component GUI implemetation // -#ifndef _HOMARDGUI_H_ -#define _HOMARDGUI_H_ +#ifndef _ADAPTGUI_H_ +#define _ADAPTGUI_H_ #include "HOMARDGUI_Exports.hxx" @@ -38,13 +38,13 @@ class SalomeApp_Application; -class HOMARD_EXPORT HOMARDGUI: public SalomeApp_Module +class HOMARD_EXPORT ADAPTGUI: public SalomeApp_Module { Q_OBJECT public: - HOMARDGUI(const QString&); - ~HOMARDGUI(); + ADAPTGUI(const QString&); + ~ADAPTGUI(); diff --git a/src/ADAPTGUI/CMakeLists.txt b/src/ADAPTGUI/CMakeLists.txt index eb518d3a1..d71b88b22 100644 --- a/src/ADAPTGUI/CMakeLists.txt +++ b/src/ADAPTGUI/CMakeLists.txt @@ -88,7 +88,7 @@ SET(_uic_FILES # header files / to be processed by moc SET(_moc_HEADERS - HOMARDGUI.h + ADAPTGUI.h MonCreateBoundaryCAO.h MonCreateBoundaryAn.h MonCreateBoundaryDi.h @@ -135,7 +135,7 @@ QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS}) # sources / static SET(_other_SOURCES - HOMARDGUI.cxx + ADAPTGUI.cxx HOMARDGUI_Utils.cxx MonCreateBoundaryCAO.cxx MonCreateBoundaryAn.cxx diff --git a/src/ADAPTGUI/HOMARDGUI_Utils.cxx b/src/ADAPTGUI/HOMARDGUI_Utils.cxx index f57ed0ef9..562546eec 100644 --- a/src/ADAPTGUI/HOMARDGUI_Utils.cxx +++ b/src/ADAPTGUI/HOMARDGUI_Utils.cxx @@ -36,7 +36,7 @@ #include "SALOMEconfig.h" #include "utilities.h" #include -#include +#include #include @@ -256,7 +256,7 @@ void HOMARD_UTILS::PushOnHelp(QString monFichierAide, QString contexte, QString LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); if (app) { - HOMARDGUI* aHomardGUI = dynamic_cast( app->module( "Homard" ) ); + ADAPTGUI* aHomardGUI = dynamic_cast( app->module( "Homard" ) ); // Repertoire de reference de la documentation QString rep = aHomardGUI ? app->moduleName(aHomardGUI->moduleName()) : QString("") ; // WARNING/ATTENTION : si on savait recuperer la langue depuis les preferences, on ne ferait pas le passage par argument From d05e8d51119b29c2e259a4543d28752f0abc4a39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Mon, 25 May 2020 16:01:16 +0200 Subject: [PATCH 014/100] =?UTF-8?q?pr=C3=A9f=C3=A9rences?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ADAPTGUI/ADAPT_msg_en.ts | 44 ------------------------------------ src/ADAPTGUI/ADAPT_msg_fr.ts | 44 ------------------------------------ src/SMESHGUI/CMakeLists.txt | 1 + src/SMESHGUI/SMESHGUI.cxx | 42 +++++++++++++++++++++++++++------- src/SMESHGUI/SMESH_msg_en.ts | 40 ++++++++++++++++++++++++++++++++ src/SMESHGUI/SMESH_msg_fr.ts | 40 ++++++++++++++++++++++++++++++++ 6 files changed, 115 insertions(+), 96 deletions(-) diff --git a/src/ADAPTGUI/ADAPT_msg_en.ts b/src/ADAPTGUI/ADAPT_msg_en.ts index 4d40ad891..1567033d6 100644 --- a/src/ADAPTGUI/ADAPT_msg_en.ts +++ b/src/ADAPTGUI/ADAPT_msg_en.ts @@ -411,49 +411,5 @@ HOM_YACS_EDIT_WINDOW_TITLE Edition of a schema YACS - - PREF_TAB_GENERAL - General - - - PREF_PUBLICATION - Publication - - - PREF_PUBLICATION_MAILLAGE_IN - IN meshes - - - PREF_PUBLICATION_MAILLAGE_OUT - OUT meshes - - - PREF_YACS - YACS - - - PREF_YACS_MAX - Maximum numbers - - - PREF_YACS_MAX_ITER - Iterations - - - PREF_YACS_MAX_NODE - Nodes - - - PREF_YACS_MAX_ELEM - Elements - - - PREF_YACS_CONVERGENCE - Convergence - - - PREF_YACS_TYPE_TEST - Test type - diff --git a/src/ADAPTGUI/ADAPT_msg_fr.ts b/src/ADAPTGUI/ADAPT_msg_fr.ts index 3306a69e7..f36da7b24 100644 --- a/src/ADAPTGUI/ADAPT_msg_fr.ts +++ b/src/ADAPTGUI/ADAPT_msg_fr.ts @@ -1123,49 +1123,5 @@ HOM_YACS_EDIT_WINDOW_TITLE Edition d'un schéma YACS - - PREF_TAB_GENERAL - Général - - - PREF_PUBLICATION - Publication - - - PREF_PUBLICATION_MAILLAGE_IN - Les maillages d'entrée - - - PREF_PUBLICATION_MAILLAGE_OUT - Les maillages de sortie - - - PREF_YACS - YACS - - - PREF_YACS_MAX - Nombres maximum - - - PREF_YACS_MAX_ITER - Itérations - - - PREF_YACS_MAX_NODE - Noeuds - - - PREF_YACS_MAX_ELEM - Eléments - - - PREF_YACS_CONVERGENCE - Convergence - - - PREF_YACS_TYPE_TEST - Type de test - diff --git a/src/SMESHGUI/CMakeLists.txt b/src/SMESHGUI/CMakeLists.txt index 5bd61d945..c0252dca4 100644 --- a/src/SMESHGUI/CMakeLists.txt +++ b/src/SMESHGUI/CMakeLists.txt @@ -42,6 +42,7 @@ INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/src/Controls ${PROJECT_SOURCE_DIR}/src/SMESHClient ${PROJECT_SOURCE_DIR}/src/MEDWrapper + ${PROJECT_SOURCE_DIR}/src/ADAPTGUI ${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}/idl ) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 5704acc4d..18ce3d638 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -94,6 +94,7 @@ #include "SMESHGUI_TransparencyDlg.h" #include "SMESHGUI_Utils.h" #include "SMESHGUI_VTKUtils.h" +#include "ADAPTGUI.h" #include "SMESH_version.h" @@ -5713,6 +5714,38 @@ void SMESHGUI::createPreferences() setPreferenceProperty( coloringType, "indexes", indices ); addPreference( tr( "SMESH_DISTRIBUTION_COLOR" ), distributionGr, LightApp_Preferences::Color, "SMESH", "distribution_color" ); + // Adaptation tab ------------------------------------------------------------------------ + int adaptTab = addPreference( tr( "ADAPT_PREF_TAB_GENERAL" ) ); + int bloc, pref ; + // Refinement with HOMARD + bloc = addPreference( tr( "ADAPT_PREF_PUBLICATION" ), adaptTab ); + setPreferenceProperty( bloc, "columns", 1 ); + pref = addPreference( tr( "ADAPT_PREF_PUBLICATION_MAILLAGE_IN" ), bloc, LightApp_Preferences::Bool, "HOMARD", "publish_mesh_in" ); + pref = addPreference( tr( "ADAPT_PREF_PUBLICATION_MAILLAGE_OUT" ), bloc, LightApp_Preferences::Bool, "HOMARD", "publish_mesh_out" ); + + bloc = addPreference( tr( "ADAPT_PREF_YACS_MAX" ), adaptTab ); + setPreferenceProperty( bloc, "columns", 1 ); + pref = addPreference( tr( "ADAPT_PREF_YACS_MAX_ITER" ), bloc, LightApp_Preferences::IntSpin, "HOMARD", "yacs_max_iter" ); + setPreferenceProperty( pref, "min", 0 ); + setPreferenceProperty( pref, "max", 100000000 ); + setPreferenceProperty( pref, "step", 1 ); + pref = addPreference( tr( "ADAPT_PREF_YACS_MAX_NODE" ), bloc, LightApp_Preferences::IntSpin, "HOMARD", "yacs_max_node" ); + setPreferenceProperty( pref, "min", 0 ); + setPreferenceProperty( pref, "max", 100000000 ); + setPreferenceProperty( pref, "step", 1000 ); + pref = addPreference( tr( "ADAPT_PREF_YACS_MAX_ELEM" ), bloc, LightApp_Preferences::IntSpin, "HOMARD", "yacs_max_elem" ); + setPreferenceProperty( pref, "min", 0 ); + setPreferenceProperty( pref, "max", 100000000 ); + setPreferenceProperty( pref, "step", 1000 ); + bloc = addPreference( tr( "ADAPT_PREF_YACS_CONVERGENCE" ), adaptTab ); + setPreferenceProperty( bloc, "columns", 1 ); + pref = addPreference( tr( "ADAPT_PREF_YACS_TYPE_TEST" ), bloc, LightApp_Preferences::Selector, "HOMARD", "yacs_type_test" ); + QStringList aListOfTypeTest; + aListOfTypeTest << "None"; + aListOfTypeTest << "VTest > VRef"; + aListOfTypeTest << "VTest < VRef"; + setPreferenceProperty( pref, "strings", aListOfTypeTest ); + } void SMESHGUI::preferencesChanged( const QString& sect, const QString& name ) @@ -5879,22 +5912,15 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const op = new SMESHGUI_SplitBiQuadOp(); break; case SMESHOp::OpUniformRefinement: - break; case SMESHOp::OpHONewCase: - break; case SMESHOp::OpHOCaseFollow: - break; case SMESHOp::OpHONewIter: - break; case SMESHOp::OpHOIterCompute: - break; case SMESHOp::OpHOIterComputePublish: - break; case SMESHOp::OpHOEdit: - break; case SMESHOp::OpHODelete: - break; case SMESHOp::OpMGAdapt: +// op = new ADAPTGUI( id ); break; case SMESHOp::OpConvertMeshToQuadratic: op = new SMESHGUI_ConvToQuadOp(); diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index 559c7e297..dcb378274 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -2929,6 +2929,46 @@ Check algorithm documentation for supported geometry SMESH_MULTICOLOR Multicolor + + ADAPT_PREF_TAB_GENERAL + Adaptation + + + ADAPT_PREF_PUBLICATION + Publication + + + ADAPT_PREF_PUBLICATION_MAILLAGE_IN + IN meshes + + + ADAPT_PREF_PUBLICATION_MAILLAGE_OUT + OUT meshes + + + ADAPT_PREF_YACS_MAX + Maximum numbers + + + ADAPT_PREF_YACS_MAX_ITER + Iterations + + + ADAPT_PREF_YACS_MAX_NODE + Nodes + + + ADAPT_PREF_YACS_MAX_ELEM + Elements + + + ADAPT_PREF_YACS_CONVERGENCE + Convergence + + + ADAPT_PREF_YACS_TYPE_TEST + Test type + SMESH_VISU_PROBLEM Mesh visualization failed diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index 18f64d3d3..809f898d9 100644 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -2899,6 +2899,46 @@ Référez-vous à la documentation sur l'algorithme et la géométrie suppo SMESH_MULTICOLOR Multicouleur + + ADAPT_PREF_TAB_GENERAL + Adaptation + + + ADAPT_PREF_PUBLICATION + Publication + + + ADAPT_PREF_PUBLICATION_MAILLAGE_IN + Les maillages d'entrée + + + ADAPT_PREF_PUBLICATION_MAILLAGE_OUT + Les maillages de sortie + + + ADAPT_PREF_YACS_MAX + Nombres maximaux + + + ADAPT_PREF_YACS_MAX_ITER + Itérations + + + ADAPT_PREF_YACS_MAX_NODE + Noeuds + + + ADAPT_PREF_YACS_MAX_ELEM + Eléments + + + ADAPT_PREF_YACS_CONVERGENCE + Convergence + + + ADAPT_PREF_YACS_TYPE_TEST + Type de test + SMESH_VISU_PROBLEM Impossible de visualiser le maillage, probablement à cause d'un manque de mémoire From 870e3ff8748402d40ebaaa01e6b0a50788c88d48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Mon, 25 May 2020 16:24:20 +0200 Subject: [PATCH 015/100] =?UTF-8?q?compl=C3=A9ment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SMESHGUI/SMESH_msg_fr.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index 809f898d9..2423b0912 100644 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -2917,7 +2917,7 @@ Référez-vous à la documentation sur l'algorithme et la géométrie suppo ADAPT_PREF_YACS_MAX - Nombres maximaux + Nombres maximaux pour un schéma YACS avec HOMARD ADAPT_PREF_YACS_MAX_ITER @@ -2937,7 +2937,7 @@ Référez-vous à la documentation sur l'algorithme et la géométrie suppo ADAPT_PREF_YACS_TYPE_TEST - Type de test + Type de test pour un schéma YACS avec HOMARD SMESH_VISU_PROBLEM From 0df363832a6b968e60a1971e932711287ced5c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Mon, 25 May 2020 16:24:40 +0200 Subject: [PATCH 016/100] =?UTF-8?q?compl=C3=A9ment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SMESHGUI/SMESH_msg_en.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index dcb378274..835ba01b3 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -2947,7 +2947,7 @@ Check algorithm documentation for supported geometry ADAPT_PREF_YACS_MAX - Maximum numbers + Maximum numbers for a YACS schema with HOMARD ADAPT_PREF_YACS_MAX_ITER @@ -2967,7 +2967,7 @@ Check algorithm documentation for supported geometry ADAPT_PREF_YACS_TYPE_TEST - Test type + Test type for a YACS schema with HOMARD SMESH_VISU_PROBLEM From bb0c73cad0102749536b3ca64f0423f05dfce3df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Mon, 25 May 2020 17:14:06 +0200 Subject: [PATCH 017/100] Dialogue pour l'adaptation --- src/SMESHGUI/CMakeLists.txt | 2 + src/SMESHGUI/SMESHGUI.cxx | 5 +- src/SMESHGUI/SMESHGUI_AdaptDlg.cxx | 911 +++++++++++++++++++++++++++++ src/SMESHGUI/SMESHGUI_AdaptDlg.h | 107 ++++ 4 files changed, 1023 insertions(+), 2 deletions(-) create mode 100644 src/SMESHGUI/SMESHGUI_AdaptDlg.cxx create mode 100644 src/SMESHGUI/SMESHGUI_AdaptDlg.h diff --git a/src/SMESHGUI/CMakeLists.txt b/src/SMESHGUI/CMakeLists.txt index c0252dca4..9797f9199 100644 --- a/src/SMESHGUI/CMakeLists.txt +++ b/src/SMESHGUI/CMakeLists.txt @@ -146,6 +146,7 @@ SET(_moc_HEADERS SMESHGUI_SplitBiQuad.h SMESHGUI_IdPreview.h SMESHGUI_PreVisualObj.h + SMESHGUI_AdaptDlg.h ) # header files / no moc processing @@ -261,6 +262,7 @@ SET(_other_SOURCES SMESHGUI_SplitBiQuad.cxx SMESHGUI_PreVisualObj.cxx SMESHGUI_IdPreview.cxx + SMESHGUI_AdaptDlg.cxx ) # sources / to compile diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 18ce3d638..d81a58941 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -30,6 +30,7 @@ // SMESH includes #include "SMESHGUI.h" +#include "SMESHGUI_AdaptDlg.h" #include "SMESHGUI_Add0DElemsOnAllNodesDlg.h" #include "SMESHGUI_AddMeshElementDlg.h" #include "SMESHGUI_AddQuadraticElementDlg.h" @@ -94,7 +95,6 @@ #include "SMESHGUI_TransparencyDlg.h" #include "SMESHGUI_Utils.h" #include "SMESHGUI_VTKUtils.h" -#include "ADAPTGUI.h" #include "SMESH_version.h" @@ -5920,7 +5920,8 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const case SMESHOp::OpHOEdit: case SMESHOp::OpHODelete: case SMESHOp::OpMGAdapt: -// op = new ADAPTGUI( id ); + SMESHGUI_GroupDlg *aDlg = new SMESHGUI_AdaptDlg( this, id); + aDlg->show(); break; case SMESHOp::OpConvertMeshToQuadratic: op = new SMESHGUI_ConvToQuadOp(); diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx new file mode 100644 index 000000000..c279949db --- /dev/null +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx @@ -0,0 +1,911 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// SMESH SMESHGUI : GUI for the adaptation in the SMESH component +// File : SMESHGUI_AdaptDlg.cxx +// Author : Gerald NICOLAS, EDF +// ADAPTGUI includes +// +#include "SMESHGUI_AdaptDlg.h" + +// SALOME Includes +#include "Utils_ORB_INIT.hxx" +#include "Utils_SINGLETON.hxx" +#include "SALOME_LifeCycleCORBA.hxx" + +#include +#include +#include +#include +#include +#include "SUIT_ViewWindow.h" +#include "SUIT_ViewManager.h" + +#include "CAM_Module.h" +#include "OB_Browser.h" + +#include "SALOME_ListIO.hxx" + +#include "SalomeApp_Application.h" +#include "SalomeApp_DataModel.h" +#include "SalomeApp_Study.h" +#include "LightApp_SelectionMgr.h" +#include "LightApp_Selection.h" +#include +#include "SalomeApp_Module.h" +#include "SALOMEconfig.h" +#include + +#include + + +// QT Includes +#include +#include "MonCreateCase.h" +#include "MonCreateIteration.h" +#include "MonPursueIteration.h" +#include "MonCreateYACS.h" +#include "MonEditBoundaryCAO.h" +#include "MonEditBoundaryAn.h" +#include "MonEditBoundaryDi.h" +#include "MonEditCase.h" +#include "MonEditHypothesis.h" +#include "MonEditIteration.h" +#include "MonEditYACS.h" +#include "MonEditZone.h" +#include "MonMeshInfo.h" +#include "MonIterInfo.h" +#include "MonEditFile.h" +#include "HomardQtCommun.h" + +// BOOST Includes +#include + +//Pour le _CAST +#include "SALOMEDS_Study.hxx" +#include "HOMARDGUI_Utils.h" + +using namespace std; + +static CORBA::ORB_var _orb; + +//================================================================================= +// function : SMESHGUI_AdaptDlg() +// purpose : +//================================================================================= +SMESHGUI_AdaptDlg::SMESHGUI_AdaptDlg( SMESHGUI* theModule, + int theCommandID ) +{ +} +//======================================================================= +// function : ~SMESHGUI_AdaptDlg() +// purpose : Destructor +//======================================================================= +SMESHGUI_AdaptDlg::~SMESHGUI_AdaptDlg() +{ +} + +// //======================================================================= +// // function : InitHOMARDGen +// // launch HOMARD component and return a handle +// //======================================================================= +// HOMARD::HOMARD_Gen_var SMESHGUI_AdaptDlg::InitHOMARDGen(SalomeApp_Application* app) +// { +// Engines::EngineComponent_var comp = app->lcc()->FindOrLoad_Component( "FactoryServer","HOMARD" ); +// HOMARD::HOMARD_Gen_var clr = HOMARD::HOMARD_Gen::_narrow(comp); +// ASSERT(!CORBA::is_nil(clr)); +// return clr; +// } +// +// //======================================================================= +// // Module's initialization +// void SMESHGUI_AdaptDlg::initialize( CAM_Application* app ) +// //======================================================================= +// { +// SalomeApp_Module::initialize( app ); +// InitHOMARDGen(dynamic_cast( app )); +// anId = 0; +// // createActions(); +// // createMenus(); +// recupPreferences(); +// } +// +// // //================================================ +// // // function : createHOMARDAction +// // // create an item in status bar and Homard menu +// // //================================================ +// // void SMESHGUI_AdaptDlg::createHOMARDAction( const int id, const QString& po_id, const QString& icon_id, const int key, const bool toggle ) +// // { +// // // MESSAGE("createHOMARDAction"); +// // QIcon icon; +// // QWidget* parent = application()->desktop(); +// // SUIT_ResourceMgr* resMgr = application()->resourceMgr(); +// // QPixmap pix; +// // if ( icon_id.length() ) +// // pix = resMgr->loadPixmap( "HOMARD", tr( icon_id .toLatin1().data()) ); +// // else +// // pix = resMgr->loadPixmap( "HOMARD", tr( QString( "ICO_%1" ).arg( po_id ).toLatin1().data()), false ); +// // if ( !pix.isNull() ) +// // icon = QIcon( pix ); +// // +// // QString tooltip = tr(QString( "HOM_TOP_%1" ).arg( po_id ).toLatin1().data()), +// // menu = tr(QString( "HOM_MEN_%1" ).arg( po_id ).toLatin1().data()), +// // status_bar = tr(QString( "HOM_STB_%1" ).arg( po_id ).toLatin1().data()); +// // +// // createAction( id, tooltip, icon, menu, status_bar, key, parent, toggle, this, SLOT( OnGUIEvent() ) ); +// // } +// +// // //================================================ +// // // function : createAction +// // // constructs Homard menu +// // // calls createHOMARDAction for each item +// // //================================================ +// // void SMESHGUI_AdaptDlg::createActions(){ +// // // +// // createHOMARDAction( 8011, "NEW_CASE", "cas_calcule.png" ); +// // createHOMARDAction( 8012, "PURSUE_ITERATION", "iter_poursuite.png" ); +// // createHOMARDAction( 8013, "NEW_ITERATION", "iter_next.png" ); +// // createHOMARDAction( 8014, "COMPUTE", "mesh_compute.png" ); +// // createHOMARDAction( 8015, "COMPUTE_PUBLISH", "mesh_compute.png" ); +// // createHOMARDAction( 1121, "MESH_INFO", "advanced_mesh_info.png" ); +// // createHOMARDAction( 1131, "MESH_PUBLICATION", "mesh_tree_mesh.png" ); +// // // +// // createHOMARDAction( 8016, "EDIT", "loop.png" ); +// // createHOMARDAction( 8017, "DELETE", "delete.png" ); +// // // +// // createHOMARDAction( 1301, "MESH_INFO", "advanced_mesh_info.png" ); +// // createHOMARDAction( 1302, "EDIT_MESS_FILE", "texte.png" ); +// // // +// // createHOMARDAction( 1401, "YACS", "table_view.png" ); +// // // +// // } +// +// //================================================ +// // function : createPreferences +// //================================================ +// void SMESHGUI_AdaptDlg::createPreferences() +// { +// MESSAGE("createPreferences") +// +// int Onglet, Bloc, Pref ; +// // 1. Generalites +// Onglet = addPreference( tr( "PREF_TAB_GENERAL" ) ); +// // Onglet = addPreference( tr( "PREF_TAB_SETTINGS" ) ) ; +// +// Bloc = addPreference( tr( "PREF_PUBLICATION" ), Onglet ); +// setPreferenceProperty( Bloc, "columns", 1 ); +// +// Pref = addPreference( tr( "PREF_PUBLICATION_MAILLAGE_IN" ), Bloc, LightApp_Preferences::Bool, "HOMARD", "publish_mesh_in" ); +// +// Pref = addPreference( tr( "PREF_PUBLICATION_MAILLAGE_OUT" ), Bloc, LightApp_Preferences::Bool, "HOMARD", "publish_mesh_out" ); +// +// // 2. YACS +// Onglet = addPreference( tr( "PREF_YACS" ) ) ; +// +// Bloc = addPreference( tr( "PREF_YACS_MAX" ), Onglet ); +// setPreferenceProperty( Bloc, "columns", 1 ); +// +// Pref = addPreference( tr( "PREF_YACS_MAX_ITER" ), Bloc, LightApp_Preferences::IntSpin, "HOMARD", "yacs_max_iter" ); +// setPreferenceProperty( Pref, "min", 0 ); +// setPreferenceProperty( Pref, "max", 100000000 ); +// setPreferenceProperty( Pref, "step", 1 ); +// +// Pref = addPreference( tr( "PREF_YACS_MAX_NODE" ), Bloc, LightApp_Preferences::IntSpin, "HOMARD", "yacs_max_node" ); +// setPreferenceProperty( Pref, "min", 0 ); +// setPreferenceProperty( Pref, "max", 100000000 ); +// setPreferenceProperty( Pref, "step", 1000 ); +// +// Pref = addPreference( tr( "PREF_YACS_MAX_ELEM" ), Bloc, LightApp_Preferences::IntSpin, "HOMARD", "yacs_max_elem" ); +// setPreferenceProperty( Pref, "min", 0 ); +// setPreferenceProperty( Pref, "max", 100000000 ); +// setPreferenceProperty( Pref, "step", 1000 ); +// +// Bloc = addPreference( tr( "PREF_YACS_CONVERGENCE" ), Onglet ); +// setPreferenceProperty( Bloc, "columns", 1 ); +// +// Pref = addPreference( tr( "PREF_YACS_TYPE_TEST" ), Bloc, LightApp_Preferences::Selector, "HOMARD", "yacs_type_test" ); +// QStringList aListOfTypeTest; +// aListOfTypeTest << "None"; +// aListOfTypeTest << "VTest > VRef"; +// aListOfTypeTest << "VTest < VRef"; +// setPreferenceProperty( Pref, "strings", aListOfTypeTest ); +// } +// +// +// // //================================================ +// // // function : createMenus +// // //================================================ +// // void SMESHGUI_AdaptDlg::createMenus() +// // { +// // MESSAGE("createMenus") +// // // +// // int HOMARD_Id = createMenu( tr( "HOM_MEN_HOMARD" ), -1, 5, 10 ); +// // createMenu( 8011, HOMARD_Id, -1 ); //Create_Case +// // createMenu( 8012, HOMARD_Id, -1 ); //Pursue_Iteration +// // createMenu( separator(), HOMARD_Id,-1); +// // createMenu( 8013, HOMARD_Id, -1 ); //Create_Iteration +// // createMenu( 8014, HOMARD_Id, -1 ); //Compute +// // createMenu( 8015, HOMARD_Id, -1 ); //Compute and publish +// // // +// // HOMARD_Id = createMenu( tr( "HOM_MEN_MODIFICATION" ), -1, 5, 10 ); +// // createMenu( 8016, HOMARD_Id, -1 ); //Edit +// // createMenu( 8017, HOMARD_Id, -1 ); //Delete +// // // +// // HOMARD_Id = createMenu( tr( "HOM_MEN_INFORMATION" ), -1, 5, 10 ); +// // createMenu( 1301, HOMARD_Id, -1 ); //Information sur un maillage +// // createMenu( 1131, HOMARD_Id, -1 ); //Mesh publication +// // createMenu( separator(), HOMARD_Id,-1); +// // createMenu( 1302, HOMARD_Id, -1 ); //EditAsciiFile pour le fichier listeStd ou bilan +// // createMenu( separator(), HOMARD_Id,-1); +// // createMenu( 8016, HOMARD_Id, -1 ); //Edit +// // createMenu( separator(), HOMARD_Id,-1); +// // // +// // HOMARD_Id = createMenu( tr( "HOM_MEN_YACS" ), -1, 5, 10 ); +// // createMenu( 1401, HOMARD_Id, -1 ); // Création d'un schéma YACS +// // createMenu( separator(), HOMARD_Id,-1); +// // } +// +// //================================================ +// // function : recupPreferences +// // Pour chaque valeur, le defaut est la valeur definie dans HOMARD_Gen +// // . Si la recuperation dans config/salome s'est bien passee a la creation de HOMARD_Gen, +// // ces valeurs sont les valeurs definies. +// // . Si cela ne s'est pas bien passe, ce sont les valeurs par defaut de HOMARD_Gen +// //================================================ +// void SMESHGUI_AdaptDlg::recupPreferences() +// { +// MESSAGE("recupPreferences") +// // +// // A. Declarations +// // +// SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( application() ); +// HOMARD::HOMARD_Gen_var homardGen = SMESHGUI_AdaptDlg::InitHOMARDGen(app); +// int defaut_i ; +// std::string defaut_s ; +// QString QString_v ; +// // +// // B. Les valeurs +// // B.1. La langue +// // +// defaut_s = homardGen->GetLanguageShort(); +// SUIT_ResourceMgr* resMgr = getApp()->resourceMgr(); +// _LanguageShort = resMgr->stringValue("language", "language", QString(defaut_s.c_str()) ); +// // +// // B.2. Les publications +// bool publish_mesh ; +// // +// _PublisMeshIN = homardGen->GetPublisMeshIN(); +// if ( _PublisMeshIN == 1 ) { publish_mesh = true ; } +// else { publish_mesh = false ; } +// publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_in", publish_mesh ); +// if ( publish_mesh ) { _PublisMeshIN = 1 ; } +// else { _PublisMeshIN = 0 ; } +// // +// _PublisMeshOUT = homardGen->GetPublisMeshOUT(); +// if ( _PublisMeshOUT == 1 ) { publish_mesh = true ; } +// else { publish_mesh = false ; } +// publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_out", publish_mesh ); +// if ( publish_mesh ) { _PublisMeshOUT = 1 ; } +// else { _PublisMeshOUT = 0 ; } +// // +// // B.3. Les maximum pour YACS +// // +// defaut_i = homardGen->GetYACSMaxIter(); +// _YACSMaxIter = resMgr->integerValue("HOMARD", "yacs_max_iter", defaut_i ); +// // +// defaut_i = homardGen->GetYACSMaxNode(); +// _YACSMaxNode = resMgr->integerValue("HOMARD", "yacs_max_node", defaut_i ); +// // +// defaut_i = homardGen->GetYACSMaxElem(); +// _YACSMaxElem = resMgr->integerValue("HOMARD", "yacs_max_elem", defaut_i ); +// // +// // B.4. La convergence pour YACS +// // +// defaut_i = homardGen->GetYACSConvergenceType(); +// if ( defaut_i == 1 ) { QString_v = tr("VTest > VRef") ; } +// else if ( defaut_i == 2 ) { QString_v = tr("VTest < VRef") ; } +// else { QString_v = tr("None") ; } +// QString_v = resMgr->stringValue ( "HOMARD", "yacs_type_test", QString_v ); +// if ( ( QString_v == "VTest > VRef" ) || ( QString_v == "VTest > VRef" ) ) { _YACSTypeTest = 1 ; } +// else if ( ( QString_v == "VTest < VRef" ) || ( QString_v == "VTest < VRef" ) ) { _YACSTypeTest = 2 ; } +// else { _YACSTypeTest = 0 ; } +// // +// // C. Enregistrement dans l'objet general +// // +// MESSAGE ("Enregistrement de LanguageShort = " << _LanguageShort.toStdString().c_str() ); +// MESSAGE ("Enregistrement de PublisMeshIN = " << _PublisMeshIN<<", PublisMeshOUT = "<< _PublisMeshOUT); +// MESSAGE ("Enregistrement de YACSMaxIter = " << _YACSMaxIter<<", YACSMaxNode = "<< _YACSMaxNode<<", YACSMaxElem = "<< _YACSMaxElem); +// MESSAGE ("Enregistrement de YACSTypeTest = " << _YACSTypeTest); +// // +// homardGen->SetLanguageShort(_LanguageShort.toStdString().c_str()); +// homardGen->SetPublisMesh(_PublisMeshIN, _PublisMeshOUT); +// homardGen->SetYACSMaximum(_YACSMaxIter, _YACSMaxNode, _YACSMaxElem); +// // +// homardGen->SetYACSConvergenceType(_YACSTypeTest); +// } +// +// //================================================ +// void SMESHGUI_AdaptDlg::OnGUIEvent() +// //================================================ +// { +// MESSAGE("OnGUIEvent()") +// setOrb(); +// const QObject* obj = sender(); +// if ( !obj || !obj->inherits( "QAction" ) ) { return; } +// int id = actionId((QAction*)obj); +// if ( id != -1 ) { bool ret = OnGUIEvent( id ); } +// MESSAGE("Fin de OnGUIEvent()"); +// } +// +// //======================================================================= +// // Method OnGUIEvent pour Homard +// //======================================================================= +// bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) +// { +// MESSAGE("OnGUIEvent avec theCommandID = "<( application() ); +// if ( !app ) return false; +// +// SalomeApp_Study* stud = dynamic_cast ( app->activeStudy() ); +// if ( !stud ) +// { +// MESSAGE ( "FAILED to cast active study to SalomeApp_Study" ); +// return false; +// } +// +// SUIT_Desktop* parent = application()->desktop(); +// +// HOMARD::HOMARD_Gen_var homardGen = SMESHGUI_AdaptDlg::InitHOMARDGen(app); +// +// if (!CORBA::is_nil(homardGen)) +// homardGen->UpdateStudy(); +// +// getApp()->updateObjectBrowser(); +// +// // B. Choix selon les commandes +// SCRUTE(theCommandID); +// switch (theCommandID) +// { +// case 8011: // Creation d un Cas +// { +// MESSAGE("command " << theCommandID << " activated"); +// MonCreateCase *aDlg = new MonCreateCase( true, +// HOMARD::HOMARD_Gen::_duplicate(homardGen) ) ; +// aDlg->show(); +// break; +// } +// +// case 8012: // Poursuite d une iteration +// { +// MESSAGE("command " << theCommandID << " activated"); +// MonPursueIteration *aDlg = new MonPursueIteration( true, +// HOMARD::HOMARD_Gen::_duplicate(homardGen) ) ; +// aDlg->show(); +// break; +// } +// +// case 8013: // Creation d une Iteration +// { +// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// MonCreateIteration *IterDlg = new MonCreateIteration( parent, true, +// HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ; +// IterDlg->show(); +// break; +// } +// +// case 8014: // Compute une iteration +// { +// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// try { homardGen->Compute(_ObjectName.toStdString().c_str(), 0, 1, -1, 1); } +// catch( SALOME::SALOME_Exception& S_ex ) +// { +// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), +// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); +// getApp()->updateObjectBrowser(); +// return false; +// } +// break; +// } +// +// case 8015: // Compute une iteration et publication +// { +// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// try { homardGen->Compute(_ObjectName.toStdString().c_str(), 0, 1, -1, 2); } +// catch( SALOME::SALOME_Exception& S_ex ) +// { +// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), +// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); +// getApp()->updateObjectBrowser(); +// return false; +// } +// break; +// } +// +// case 1121: // Information sur le maillage de l'iteration +// { +// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// MonIterInfo *IterDlg = new MonIterInfo( parent, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ; +// IterDlg->show(); +// break; +// } +// +// case 1131: // Publication du maillage de l'iteration +// { +// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// homardGen->PublishMeshIterInSmesh(_ObjectName.toStdString().c_str()); +// break; +// } +// +// case 1132: // Publication du maillage de l'iteration a partir du fichier +// { +// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// homardGen->PublishResultInSmesh(_ObjectName.toStdString().c_str(), 1); +// break; +// } +// +// case 8016: // Edition d'un objet +// { +// MESSAGE("command " << theCommandID << " activated"); +// QString nomObjet = HOMARD_QT_COMMUN::SelectionArbreEtude(QString(""), 1); +// if (nomObjet == QString("")) break; +// _PTR(SObject) obj = chercheMonObjet(); +// if (obj) +// { +// // Edition d'une frontiere CAO +// if (HOMARD_UTILS::isBoundaryCAO(obj)) +// { +// MonEditBoundaryCAO *aDlg = new MonEditBoundaryCAO(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; +// aDlg->show(); +// } +// // Edition d'une frontiere discrete +// else if (HOMARD_UTILS::isBoundaryDi(obj)) +// { +// MonEditBoundaryDi *aDlg = new MonEditBoundaryDi(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; +// aDlg->show(); +// } +// // Edition d'une frontiere analytique +// else if (HOMARD_UTILS::isBoundaryAn(obj)) +// { +// MonEditBoundaryAn *aDlg = new MonEditBoundaryAn(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; +// aDlg->show(); +// } +// // Edition d'un cas +// else if (HOMARD_UTILS::isCase(obj)) +// { +// MonEditCase *aDlg = new MonEditCase(true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ; +// aDlg->show(); +// } +// // Edition d'une hypothese +// else if (HOMARD_UTILS::isHypo(obj)) +// { +// MonEditHypothesis *aDlg = new MonEditHypothesis(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName, QString(""), QString("")) ; +// aDlg->show(); +// } +// // Edition d'une iteration +// else if (HOMARD_UTILS::isIter(obj)) +// { +// MonEditIteration *aDlg = new MonEditIteration(parent, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; +// aDlg->show(); +// } +// // Edition d'un schema YACS +// else if (HOMARD_UTILS::isYACS(obj)) +// { +// MESSAGE("appel de MonEditYACS"); +// MonEditYACS *aDlg = new MonEditYACS(true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName) ; +// aDlg->show(); +// } +// // Edition d'une zone +// else if (HOMARD_UTILS::isZone(obj)) +// { +// MonEditZone *aDlg = new MonEditZone(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; +// aDlg->show(); +// } +// } +// break; +// } +// +// case 8017: // Suppression d'un objet +// { +// MESSAGE("command " << theCommandID << " activated"); +// QString nomObjet = HOMARD_QT_COMMUN::SelectionArbreEtude(QString(""), 1); +// if (nomObjet == QString("")) break; +// _PTR(SObject) obj = chercheMonObjet(); +// if (obj) +// { +// // Suppression d'une frontiere +// if ( HOMARD_UTILS::isBoundaryCAO(obj) || HOMARD_UTILS::isBoundaryDi(obj) || HOMARD_UTILS::isBoundaryAn(obj) ) +// { +// try +// { homardGen->DeleteBoundary(_ObjectName.toStdString().c_str()); } +// catch( SALOME::SALOME_Exception& S_ex ) +// { +// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), +// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); +// getApp()->updateObjectBrowser(); +// return false; +// } +// } +// // Suppression d'un cas +// else if (HOMARD_UTILS::isCase(obj)) +// { +// try +// { homardGen->DeleteCase(_ObjectName.toStdString().c_str(), 1); } +// catch( SALOME::SALOME_Exception& S_ex ) +// { +// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), +// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); +// getApp()->updateObjectBrowser(); +// return false; +// } +// } +// // Suppression d'une hypothese +// else if (HOMARD_UTILS::isHypo(obj)) +// { +// try +// { homardGen->DeleteHypo(_ObjectName.toStdString().c_str()); } +// catch( SALOME::SALOME_Exception& S_ex ) +// { +// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), +// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); +// getApp()->updateObjectBrowser(); +// return false; +// } +// } +// // Suppression d'une iteration +// else if (HOMARD_UTILS::isIter(obj)) +// { +// try +// { homardGen->DeleteIteration(_ObjectName.toStdString().c_str(), 1); } +// catch( SALOME::SALOME_Exception& S_ex ) +// { +// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), +// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); +// getApp()->updateObjectBrowser(); +// return false; +// } +// } +// // Suppression d'un schema YACS +// else if (HOMARD_UTILS::isYACS(obj)) +// { +// try +// { homardGen->DeleteYACS(_ObjectName.toStdString().c_str(), 1); } +// catch( SALOME::SALOME_Exception& S_ex ) +// { +// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), +// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); +// getApp()->updateObjectBrowser(); +// return false; +// } +// } +// // Suppression d'une zone +// else if (HOMARD_UTILS::isZone(obj)) +// { +// try +// { homardGen->DeleteZone(_ObjectName.toStdString().c_str()); } +// catch( SALOME::SALOME_Exception& S_ex ) +// { +// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), +// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); +// getApp()->updateObjectBrowser(); +// return false; +// } +// } +// } +// break; +// } +// +// case 1301: // Information sur un maillage +// { +// MESSAGE("etape 1301") +// MESSAGE("command " << theCommandID << " activated"); +// MonMeshInfo *aDlg = new MonMeshInfo( parent, true, HOMARD::HOMARD_Gen::_duplicate(homardGen) ) ; +// aDlg->show(); +// break; +// } +// +// case 1302: // Affichage de fichier texte +// { +// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// _PTR(SObject) obj = chercheMonObjet(); +// if ( (obj) && ( HOMARD_UTILS::isFileType(obj,QString("log")) || HOMARD_UTILS::isFileType(obj,QString("Summary")) || HOMARD_UTILS::isFileType(obj,QString("xml")) ) ) +// { +// MonEditFile *aDlg = new MonEditFile( 0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName, 0 ) ; +// if ( aDlg->_codret == 0 ) { aDlg->show(); } +// } +// break; +// } +// +// case 1401: // Création d'un schema YACS +// { +// MESSAGE("etape 1401") +// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// MonCreateYACS *aDlg = new MonCreateYACS( true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ; +// aDlg->show(); +// break; +// } +// +// case 1402: // Ecriture d'un schéma YACS +// { +// MESSAGE("etape 1402") +// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// try { homardGen->YACSWrite(_ObjectName.toStdString().c_str()); } +// catch( SALOME::SALOME_Exception& S_ex ) +// { +// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), +// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); +// getApp()->updateObjectBrowser(); +// return false; +// } +// break; +// } +// +// } +// getApp()->updateObjectBrowser(); +// return true; +// } +// +// //============================================================================= +// /*! +// * +// */ +// //============================================================================= +// +// // Module's engine IOR +// //============================================================================= +// QString SMESHGUI_AdaptDlg::engineIOR() const +// //============================================================================= +// { +// CORBA::String_var anIOR = getApp()->orb()->object_to_string( InitHOMARDGen(getApp()) ); +// return QString( anIOR.in() ); +// } +// +// // Module's activation +// //============================================================================= +// bool SMESHGUI_AdaptDlg::activateModule( SUIT_Study* theStudy ) +// //============================================================================= +// { +// bool bOk = SalomeApp_Module::activateModule( theStudy ); +// +// setMenuShown( true ); +// setToolShown( true ); +// +// return bOk; +// } +// +// // Module's deactivation +// //============================================================================= +// bool SMESHGUI_AdaptDlg::deactivateModule( SUIT_Study* theStudy ) +// //============================================================================= +// { +// setMenuShown( false ); +// setToolShown( false ); +// +// return SalomeApp_Module::deactivateModule( theStudy ); +// } +// +// // Default windows +// //============================================================================= +// void SMESHGUI_AdaptDlg::windows( QMap& theMap ) const +// //============================================================================= +// { +// theMap.clear(); +// theMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea ); +// #ifndef DISABLE_PYCONSOLE +// theMap.insert( SalomeApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea ); +// #endif +// } +// +// //============================================================================= +// void SMESHGUI_AdaptDlg::setOrb() +// //============================================================================= +// { +// try +// { +// ORB_INIT &init = *SINGLETON_::Instance(); +// ASSERT(SINGLETON_::IsAlreadyExisting()); +// _orb = init( 0 , 0 ); +// } +// catch (...) +// { +// INFOS("internal error : orb not found"); +// _orb = 0; +// } +// ASSERT(! CORBA::is_nil(_orb)); +// } +// //======================================== +// _PTR(SObject) SMESHGUI_AdaptDlg::chercheMonObjet() +// //======================================== +// { +// SALOMEDSClient_SObject* aSO = NULL; +// _PTR(SObject) obj; +// SALOME_ListIO lst; +// getApp()->selectionMgr()->selectedObjects( lst ); +// if ( lst.Extent() == 1 ) +// { +// Handle(SALOME_InteractiveObject) io = lst.First(); +// SalomeApp_Study* appStudy = dynamic_cast( application()->activeStudy() ); +// _PTR(Study) study = appStudy->studyDS(); +// _PTR(SObject) obj = study->FindObjectID( io->getEntry() ); +// _ObjectName = QString( obj->GetName().c_str() ); +// return obj; +// } +// else { return _PTR(SObject)(aSO); } +// } +// //============================================================================= +// void SMESHGUI_AdaptDlg::contextMenuPopup( const QString& client, QMenu* menu, QString& title ) +// //============================================================================= +// { +// MESSAGE("Debut de contextMenuPopup"); +// _PTR(SObject) obj = chercheMonObjet(); +// if ( obj ) +// { +// title = QString( obj->GetName().c_str() ); +// _ObjectName = title; +// SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); +// // +// QPixmap pix ; +// bool DeleteObject = false ; +// bool EditObject = false ; +// // +// if ( HOMARD_UTILS::isBoundaryCAO(obj) ) +// { +// EditObject = true ; +// DeleteObject = true ; +// } +// else if ( HOMARD_UTILS::isBoundaryAn(obj) ) +// { +// EditObject = true ; +// DeleteObject = true ; +// } +// else if ( HOMARD_UTILS::isBoundaryDi(obj) ) +// { +// EditObject = true ; +// DeleteObject = true ; +// } +// else if ( HOMARD_UTILS::isCase(obj) ) +// { +// pix = resMgr->loadPixmap( "HOMARD", "table_view.png" ); +// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_YACS").toLatin1().data()), this, SLOT(YACSCreate())); +// EditObject = true ; +// DeleteObject = true ; +// } +// else if ( HOMARD_UTILS::isHypo(obj) ) +// { +// EditObject = true ; +// DeleteObject = true ; +// } +// else if ( HOMARD_UTILS::isIter(obj) ) +// { +// pix = resMgr->loadPixmap( "HOMARD", "iter_next.png" ); +// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_NEW_ITERATION").toLatin1().data()), this, SLOT(NextIter())); +// pix = resMgr->loadPixmap( "HOMARD", "mesh_compute.png" ); +// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_COMPUTE").toLatin1().data()), this, SLOT(LanceCalcul0())); +// pix = resMgr->loadPixmap( "HOMARD", "mesh_compute.png" ); +// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_COMPUTE_PUBLISH").toLatin1().data()), this, SLOT(LanceCalcul1())); +// pix = resMgr->loadPixmap( "HOMARD", "advanced_mesh_info.png" ); +// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_MESH_INFO").toLatin1().data()), this, SLOT(IterInfo())); +// pix = resMgr->loadPixmap( "HOMARD", "mesh_tree_mesh.png" ); +// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_MESH_PUBLICATION").toLatin1().data()), this, SLOT(MeshPublish0())); +// EditObject = true ; +// DeleteObject = true ; +// } +// else if ( HOMARD_UTILS::isYACS(obj) ) +// { +// pix = resMgr->loadPixmap( "HOMARD", "write.png" ); +// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_WRITE").toLatin1().data()), this, SLOT(YACSWrite())); +// EditObject = true ; +// DeleteObject = true ; +// } +// else if ( HOMARD_UTILS::isZone(obj) ) +// { +// EditObject = true ; +// DeleteObject = true ; +// } +// else if ( HOMARD_UTILS::isFileType(obj,QString("log")) || HOMARD_UTILS::isFileType(obj,QString("Summary")) || HOMARD_UTILS::isFileType(obj,QString("xml")) ) +// { +// pix = resMgr->loadPixmap( "HOMARD", "texte.png" ); +// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_EDIT_MESS_FILE").toLatin1().data()), this, SLOT(EditAsciiFile())); +// } +// else if ( HOMARD_UTILS::isFileType(obj,QString("Mesh")) ) +// { +// pix = resMgr->loadPixmap( "HOMARD", "mesh_tree_mesh.png" ); +// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_MESH_PUBLICATION").toLatin1().data()), this, SLOT(MeshPublish1())); +// } +// // Ajout d'un menu d'edition pour les objets qui le proposent +// if ( EditObject ) +// { +// pix = resMgr->loadPixmap( "HOMARD", "loop.png" ); +// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_EDIT").toLatin1().data()), this, SLOT(Edit())); +// } +// // Ajout d'un menu de destruction pour les objets qui le proposent +// if ( DeleteObject ) +// { +// pix = resMgr->loadPixmap( "HOMARD", "delete.png" ); +// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_DELETE").toLatin1().data()), this, SLOT(Delete())); +// } +// } +// } +// +// void SMESHGUI_AdaptDlg::NextIter() +// { +// this->OnGUIEvent(8013); +// } +// +// void SMESHGUI_AdaptDlg::LanceCalcul0() +// { +// this->OnGUIEvent(8014); +// } +// +// void SMESHGUI_AdaptDlg::LanceCalcul1() +// { +// this->OnGUIEvent(8015); +// } +// +// void SMESHGUI_AdaptDlg::IterInfo() +// { +// this->OnGUIEvent(1121); +// } +// +// void SMESHGUI_AdaptDlg::MeshPublish0() +// { +// this->OnGUIEvent(1131); +// } +// +// void SMESHGUI_AdaptDlg::MeshPublish1() +// { +// this->OnGUIEvent(1132); +// } +// +// void SMESHGUI_AdaptDlg::Edit() +// { +// this->OnGUIEvent(8016); +// } +// +// void SMESHGUI_AdaptDlg::Delete() +// { +// this->OnGUIEvent(8017); +// } +// +// void SMESHGUI_AdaptDlg::EditAsciiFile() +// { +// this->OnGUIEvent(1302); +// } +// +// void SMESHGUI_AdaptDlg::YACSCreate() +// { +// this->OnGUIEvent(1401); +// } +// void SMESHGUI_AdaptDlg::YACSWrite() +// { +// this->OnGUIEvent(1402); +// } +// + +// +//============================================================================= +// Export the module +//============================================================================= +extern "C" { + Standard_EXPORT CAM_Module* createModule() + { + return new SMESHGUI_AdaptDlg(""); + } +} + diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.h b/src/SMESHGUI/SMESHGUI_AdaptDlg.h new file mode 100644 index 000000000..45cbe28bf --- /dev/null +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.h @@ -0,0 +1,107 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// SMESH SMESHGUI : GUI for the adaptation in the SMESH component +// File : SMESHGUI_AdaptDlg.h +// Author : Gérald NICOLAS, EDF +// +#ifndef SMESHGUI_ADAPTDLG_H +#define SMESHGUI_ADAPTDLG_H + +#include "HOMARDGUI_Exports.hxx" + +#include +#include "SalomeApp_Study.h" + +#include +#include +#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(HOMARD_Cas) +#include CORBA_CLIENT_HEADER(HOMARD_Hypothesis) + +#include + +//================================================================================= +// class : SMESHGUI_AdaptDlg +// purpose : +//================================================================================= +class SMESHGUI_EXPORT SMESHGUI_AdaptDlg: public QDialog +{ + Q_OBJECT + +public: + SMESHGUI_AdaptDlg( SMESHGUI*, + int theCommandID); + ~SMESHGUI_AdaptDlg(); + + virtual bool OnGUIEvent (int theCommandID); + void initialize( CAM_Application* ); + QString engineIOR() const; + void windows( QMap& ) const; + + static HOMARD::HOMARD_Gen_var InitHOMARDGen(SalomeApp_Application* ); + + +public slots: + bool deactivateModule( SUIT_Study* ); + bool activateModule( SUIT_Study* ); + static void setOrb(); + +private slots: + void OnGUIEvent(); + void EditAsciiFile(); + void LanceCalcul0(); + void LanceCalcul1(); + void IterInfo(); + void NextIter(); + void MeshPublish0(); + void MeshPublish1(); + void YACSCreate(); + void YACSWrite(); + void Edit(); + void Delete(); + +public: + virtual void contextMenuPopup( const QString&, QMenu*, QString& ); + + +private: + void createHOMARDAction( const int id, const QString& po_id, const QString& icon_id = QString(""), + const int key = 0, const bool toggle = false ); + void createActions(); + void createMenus(); + void recupPreferences(); + void createPopupMenus(); + _PTR(SObject) chercheMonObjet(); + + virtual void createPreferences(); + HOMARD::HOMARD_Gen_var myComponentHomard; + + int anId; + QString _ObjectName; + QString _LanguageShort ; + int _PublisMeshIN ; + int _PublisMeshOUT ; + int _YACSMaxIter ; + int _YACSMaxNode ; + int _YACSMaxElem ; + int _YACSTypeTest ; +}; + +#endif // SMESHGUI_ADAPTDLG_H From 1e51d8ea8931447dfd75e631b0f20908c2353df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Tue, 26 May 2020 09:48:59 +0200 Subject: [PATCH 018/100] =?UTF-8?q?Pilotage=20des=20biblioth=C3=A8ques?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 3 ++- src/ADAPTGUI/CMakeLists.txt | 6 +++--- src/SMESHGUI/CMakeLists.txt | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cf1162252..ad268dcd0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -334,6 +334,7 @@ SET(_${PROJECT_NAME}_exposed_targets SMDS SMESHimpl SMESHEngine SMESHClient SMESHDS SMESHUtils StdMeshers StdMeshersEngine MeshJobManagerEngine SPADDERPluginTesterEngine SalomeIDLSMESH SalomeIDLSPADDER + ADAPTEngine ADAPTFrontTrack ADAPTImpl ) IF(SALOME_SMESH_ENABLE_MEFISTO) @@ -343,7 +344,7 @@ ENDIF(SALOME_SMESH_ENABLE_MEFISTO) IF(SALOME_BUILD_GUI) LIST(APPEND _${PROJECT_NAME}_exposed_targets - SMESHObject SMESHFiltersSelection SMESH PluginUtils StdMeshersGUI + SMESHObject SMESHFiltersSelection SMESH PluginUtils StdMeshersGUI ADAPTGUI ) ENDIF(SALOME_BUILD_GUI) diff --git a/src/ADAPTGUI/CMakeLists.txt b/src/ADAPTGUI/CMakeLists.txt index d71b88b22..ee193c6af 100644 --- a/src/ADAPTGUI/CMakeLists.txt +++ b/src/ADAPTGUI/CMakeLists.txt @@ -169,9 +169,9 @@ SET(ADAPT_SOURCES ${_other_SOURCES} ${_moc_SOURCES} ${_uic_HEADERS}) # --- rules --- -ADD_LIBRARY(ADAPT ${ADAPT_SOURCES}) -TARGET_LINK_LIBRARIES(ADAPT ${_link_LIBRARIES} ) -INSTALL(TARGETS ADAPT EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) +ADD_LIBRARY(ADAPTGUI ${ADAPT_SOURCES}) +TARGET_LINK_LIBRARIES(ADAPTGUI ${_link_LIBRARIES} ) +INSTALL(TARGETS ADAPTGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) INSTALL(FILES ${ADAPT_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_ADAPT_INSTALL_RES_DATA}") diff --git a/src/SMESHGUI/CMakeLists.txt b/src/SMESHGUI/CMakeLists.txt index 9797f9199..53f99bf29 100644 --- a/src/SMESHGUI/CMakeLists.txt +++ b/src/SMESHGUI/CMakeLists.txt @@ -74,6 +74,7 @@ SET(_link_LIBRARIES SMDS SMESHControls SMESHObject + ADAPTGUI ) # --- headers --- From ed1a6f1c4d02ce9510dedb0f174c0535967d1d75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Tue, 26 May 2020 10:46:55 +0200 Subject: [PATCH 019/100] Lancement des menus pour l'adaptation --- src/SMESHGUI/SMESHGUI.cxx | 17 +- src/SMESHGUI/SMESHGUI_AdaptDlg.cxx | 3522 +++++++++++++++++++++------- src/SMESHGUI/SMESHGUI_AdaptDlg.h | 236 +- 3 files changed, 2854 insertions(+), 921 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index d81a58941..13eff94c0 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -3018,8 +3018,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) } break; } - case SMESHOp::OpSplitBiQuadratic: + // Adaptation - begin case SMESHOp::OpUniformRefinement: case SMESHOp::OpHONewCase: case SMESHOp::OpHOCaseFollow: @@ -3029,7 +3029,14 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) case SMESHOp::OpHOEdit: case SMESHOp::OpHODelete: case SMESHOp::OpMGAdapt: + { + SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_nil(); + SMESHGUI_AdaptDlg *aDlg = new SMESHGUI_AdaptDlg( this, theCommandID, aMesh); + aDlg->show(); + } + // Adaptation - end + case SMESHOp::OpSplitBiQuadratic: case SMESHOp::OpConvertMeshToQuadratic: case SMESHOp::OpCreateBoundaryElements: // create 2D mesh from 3D case SMESHOp::OpReorientFaces: @@ -5908,9 +5915,6 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const // to do : create operation here switch( id ) { - case SMESHOp::OpSplitBiQuadratic: - op = new SMESHGUI_SplitBiQuadOp(); - break; case SMESHOp::OpUniformRefinement: case SMESHOp::OpHONewCase: case SMESHOp::OpHOCaseFollow: @@ -5920,8 +5924,9 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const case SMESHOp::OpHOEdit: case SMESHOp::OpHODelete: case SMESHOp::OpMGAdapt: - SMESHGUI_GroupDlg *aDlg = new SMESHGUI_AdaptDlg( this, id); - aDlg->show(); + break; + case SMESHOp::OpSplitBiQuadratic: + op = new SMESHGUI_SplitBiQuadOp(); break; case SMESHOp::OpConvertMeshToQuadratic: op = new SMESHGUI_ConvToQuadOp(); diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx index c279949db..6c1e74514 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx @@ -17,895 +17,2699 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// SMESH SMESHGUI : GUI for the adaptation in the SMESH component +// SMESH SMESHGUI : GUI for the adaptation in the SMESH component // File : SMESHGUI_AdaptDlg.cxx // Author : Gerald NICOLAS, EDF // ADAPTGUI includes // #include "SMESHGUI_AdaptDlg.h" -// SALOME Includes -#include "Utils_ORB_INIT.hxx" -#include "Utils_SINGLETON.hxx" -#include "SALOME_LifeCycleCORBA.hxx" +#include "SMESHGUI.h" +#include "SMESHGUI_Utils.h" +#include "SMESHGUI_VTKUtils.h" +#include "SMESHGUI_GroupUtils.h" +#include "SMESHGUI_FilterUtils.h" +#include "SMESHGUI_GEOMGenUtils.h" +#include "SMESHGUI_FilterDlg.h" +#include "SMESHGUI_ShapeByMeshDlg.h" + +#include +#include +//#include +#include + +// SALOME GEOM includes +#include +#include +#include + +// SALOME GUI includes +#include #include #include #include #include #include -#include "SUIT_ViewWindow.h" -#include "SUIT_ViewManager.h" -#include "CAM_Module.h" -#include "OB_Browser.h" +#include +#include +#include +#include -#include "SALOME_ListIO.hxx" +#include -#include "SalomeApp_Application.h" -#include "SalomeApp_DataModel.h" -#include "SalomeApp_Study.h" -#include "LightApp_SelectionMgr.h" -#include "LightApp_Selection.h" -#include -#include "SalomeApp_Module.h" -#include "SALOMEconfig.h" -#include +#include -#include +#include +// SALOME KERNEL includes +#include -// QT Includes +// VTK Includes +#include +#include + +// OCCT includes +#include + +// Qt includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include "MonCreateCase.h" -#include "MonCreateIteration.h" -#include "MonPursueIteration.h" -#include "MonCreateYACS.h" -#include "MonEditBoundaryCAO.h" -#include "MonEditBoundaryAn.h" -#include "MonEditBoundaryDi.h" -#include "MonEditCase.h" -#include "MonEditHypothesis.h" -#include "MonEditIteration.h" -#include "MonEditYACS.h" -#include "MonEditZone.h" -#include "MonMeshInfo.h" -#include "MonIterInfo.h" -#include "MonEditFile.h" -#include "HomardQtCommun.h" -// BOOST Includes -#include +// STL includes +#include +#include +#include -//Pour le _CAST -#include "SALOMEDS_Study.hxx" -#include "HOMARDGUI_Utils.h" +#define SPACING 6 +#define MARGIN 11 -using namespace std; - -static CORBA::ORB_var _orb; +enum grpSelectionMode { + grpNoSelection = -1, + grpNodeSelection = 0, + grp0DSelection = 1, + grpBallSelection = 2, + grpEdgeSelection = 3, + grpFaceSelection = 4, + grpVolumeSelection = 5, + grpSubMeshSelection = 6, + grpGroupSelection = 7, + grpMeshSelection = 8, + grpGeomSelection = 9, + grpAllSelection = 10, +}; //================================================================================= // function : SMESHGUI_AdaptDlg() // purpose : //================================================================================= SMESHGUI_AdaptDlg::SMESHGUI_AdaptDlg( SMESHGUI* theModule, - int theCommandID ) + int theCommandID, + SMESH::SMESH_Mesh_ptr theMesh ) + : QDialog( SMESH::GetDesktop( theModule ) ), + mySMESHGUI( theModule ), + mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), myStoredShownEntity(0), + mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ), + myIsBusy( false ), + myNameChanged( false ), + myNbChangesOfContents(0), + myIsApplyAndClose( false ) { -} -//======================================================================= -// function : ~SMESHGUI_AdaptDlg() -// purpose : Destructor -//======================================================================= -SMESHGUI_AdaptDlg::~SMESHGUI_AdaptDlg() -{ -} - -// //======================================================================= -// // function : InitHOMARDGen -// // launch HOMARD component and return a handle -// //======================================================================= -// HOMARD::HOMARD_Gen_var SMESHGUI_AdaptDlg::InitHOMARDGen(SalomeApp_Application* app) -// { -// Engines::EngineComponent_var comp = app->lcc()->FindOrLoad_Component( "FactoryServer","HOMARD" ); -// HOMARD::HOMARD_Gen_var clr = HOMARD::HOMARD_Gen::_narrow(comp); -// ASSERT(!CORBA::is_nil(clr)); -// return clr; -// } -// -// //======================================================================= -// // Module's initialization -// void SMESHGUI_AdaptDlg::initialize( CAM_Application* app ) -// //======================================================================= -// { -// SalomeApp_Module::initialize( app ); -// InitHOMARDGen(dynamic_cast( app )); -// anId = 0; -// // createActions(); -// // createMenus(); -// recupPreferences(); -// } -// -// // //================================================ -// // // function : createHOMARDAction -// // // create an item in status bar and Homard menu -// // //================================================ -// // void SMESHGUI_AdaptDlg::createHOMARDAction( const int id, const QString& po_id, const QString& icon_id, const int key, const bool toggle ) -// // { -// // // MESSAGE("createHOMARDAction"); -// // QIcon icon; -// // QWidget* parent = application()->desktop(); -// // SUIT_ResourceMgr* resMgr = application()->resourceMgr(); -// // QPixmap pix; -// // if ( icon_id.length() ) -// // pix = resMgr->loadPixmap( "HOMARD", tr( icon_id .toLatin1().data()) ); -// // else -// // pix = resMgr->loadPixmap( "HOMARD", tr( QString( "ICO_%1" ).arg( po_id ).toLatin1().data()), false ); -// // if ( !pix.isNull() ) -// // icon = QIcon( pix ); -// // -// // QString tooltip = tr(QString( "HOM_TOP_%1" ).arg( po_id ).toLatin1().data()), -// // menu = tr(QString( "HOM_MEN_%1" ).arg( po_id ).toLatin1().data()), -// // status_bar = tr(QString( "HOM_STB_%1" ).arg( po_id ).toLatin1().data()); -// // -// // createAction( id, tooltip, icon, menu, status_bar, key, parent, toggle, this, SLOT( OnGUIEvent() ) ); -// // } -// -// // //================================================ -// // // function : createAction -// // // constructs Homard menu -// // // calls createHOMARDAction for each item -// // //================================================ -// // void SMESHGUI_AdaptDlg::createActions(){ -// // // -// // createHOMARDAction( 8011, "NEW_CASE", "cas_calcule.png" ); -// // createHOMARDAction( 8012, "PURSUE_ITERATION", "iter_poursuite.png" ); -// // createHOMARDAction( 8013, "NEW_ITERATION", "iter_next.png" ); -// // createHOMARDAction( 8014, "COMPUTE", "mesh_compute.png" ); -// // createHOMARDAction( 8015, "COMPUTE_PUBLISH", "mesh_compute.png" ); -// // createHOMARDAction( 1121, "MESH_INFO", "advanced_mesh_info.png" ); -// // createHOMARDAction( 1131, "MESH_PUBLICATION", "mesh_tree_mesh.png" ); -// // // -// // createHOMARDAction( 8016, "EDIT", "loop.png" ); -// // createHOMARDAction( 8017, "DELETE", "delete.png" ); -// // // -// // createHOMARDAction( 1301, "MESH_INFO", "advanced_mesh_info.png" ); -// // createHOMARDAction( 1302, "EDIT_MESS_FILE", "texte.png" ); -// // // -// // createHOMARDAction( 1401, "YACS", "table_view.png" ); -// // // -// // } -// -// //================================================ -// // function : createPreferences -// //================================================ -// void SMESHGUI_AdaptDlg::createPreferences() -// { -// MESSAGE("createPreferences") -// -// int Onglet, Bloc, Pref ; -// // 1. Generalites -// Onglet = addPreference( tr( "PREF_TAB_GENERAL" ) ); -// // Onglet = addPreference( tr( "PREF_TAB_SETTINGS" ) ) ; -// -// Bloc = addPreference( tr( "PREF_PUBLICATION" ), Onglet ); -// setPreferenceProperty( Bloc, "columns", 1 ); -// -// Pref = addPreference( tr( "PREF_PUBLICATION_MAILLAGE_IN" ), Bloc, LightApp_Preferences::Bool, "HOMARD", "publish_mesh_in" ); -// -// Pref = addPreference( tr( "PREF_PUBLICATION_MAILLAGE_OUT" ), Bloc, LightApp_Preferences::Bool, "HOMARD", "publish_mesh_out" ); -// -// // 2. YACS -// Onglet = addPreference( tr( "PREF_YACS" ) ) ; -// -// Bloc = addPreference( tr( "PREF_YACS_MAX" ), Onglet ); -// setPreferenceProperty( Bloc, "columns", 1 ); -// -// Pref = addPreference( tr( "PREF_YACS_MAX_ITER" ), Bloc, LightApp_Preferences::IntSpin, "HOMARD", "yacs_max_iter" ); -// setPreferenceProperty( Pref, "min", 0 ); -// setPreferenceProperty( Pref, "max", 100000000 ); -// setPreferenceProperty( Pref, "step", 1 ); -// -// Pref = addPreference( tr( "PREF_YACS_MAX_NODE" ), Bloc, LightApp_Preferences::IntSpin, "HOMARD", "yacs_max_node" ); -// setPreferenceProperty( Pref, "min", 0 ); -// setPreferenceProperty( Pref, "max", 100000000 ); -// setPreferenceProperty( Pref, "step", 1000 ); -// -// Pref = addPreference( tr( "PREF_YACS_MAX_ELEM" ), Bloc, LightApp_Preferences::IntSpin, "HOMARD", "yacs_max_elem" ); -// setPreferenceProperty( Pref, "min", 0 ); -// setPreferenceProperty( Pref, "max", 100000000 ); -// setPreferenceProperty( Pref, "step", 1000 ); -// -// Bloc = addPreference( tr( "PREF_YACS_CONVERGENCE" ), Onglet ); -// setPreferenceProperty( Bloc, "columns", 1 ); -// -// Pref = addPreference( tr( "PREF_YACS_TYPE_TEST" ), Bloc, LightApp_Preferences::Selector, "HOMARD", "yacs_type_test" ); -// QStringList aListOfTypeTest; -// aListOfTypeTest << "None"; -// aListOfTypeTest << "VTest > VRef"; -// aListOfTypeTest << "VTest < VRef"; -// setPreferenceProperty( Pref, "strings", aListOfTypeTest ); -// } -// -// -// // //================================================ -// // // function : createMenus -// // //================================================ -// // void SMESHGUI_AdaptDlg::createMenus() -// // { -// // MESSAGE("createMenus") -// // // -// // int HOMARD_Id = createMenu( tr( "HOM_MEN_HOMARD" ), -1, 5, 10 ); -// // createMenu( 8011, HOMARD_Id, -1 ); //Create_Case -// // createMenu( 8012, HOMARD_Id, -1 ); //Pursue_Iteration -// // createMenu( separator(), HOMARD_Id,-1); -// // createMenu( 8013, HOMARD_Id, -1 ); //Create_Iteration -// // createMenu( 8014, HOMARD_Id, -1 ); //Compute -// // createMenu( 8015, HOMARD_Id, -1 ); //Compute and publish -// // // -// // HOMARD_Id = createMenu( tr( "HOM_MEN_MODIFICATION" ), -1, 5, 10 ); -// // createMenu( 8016, HOMARD_Id, -1 ); //Edit -// // createMenu( 8017, HOMARD_Id, -1 ); //Delete -// // // -// // HOMARD_Id = createMenu( tr( "HOM_MEN_INFORMATION" ), -1, 5, 10 ); -// // createMenu( 1301, HOMARD_Id, -1 ); //Information sur un maillage -// // createMenu( 1131, HOMARD_Id, -1 ); //Mesh publication -// // createMenu( separator(), HOMARD_Id,-1); -// // createMenu( 1302, HOMARD_Id, -1 ); //EditAsciiFile pour le fichier listeStd ou bilan -// // createMenu( separator(), HOMARD_Id,-1); -// // createMenu( 8016, HOMARD_Id, -1 ); //Edit -// // createMenu( separator(), HOMARD_Id,-1); -// // // -// // HOMARD_Id = createMenu( tr( "HOM_MEN_YACS" ), -1, 5, 10 ); -// // createMenu( 1401, HOMARD_Id, -1 ); // Création d'un schéma YACS -// // createMenu( separator(), HOMARD_Id,-1); -// // } -// -// //================================================ -// // function : recupPreferences -// // Pour chaque valeur, le defaut est la valeur definie dans HOMARD_Gen -// // . Si la recuperation dans config/salome s'est bien passee a la creation de HOMARD_Gen, -// // ces valeurs sont les valeurs definies. -// // . Si cela ne s'est pas bien passe, ce sont les valeurs par defaut de HOMARD_Gen -// //================================================ -// void SMESHGUI_AdaptDlg::recupPreferences() -// { -// MESSAGE("recupPreferences") -// // -// // A. Declarations -// // -// SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( application() ); -// HOMARD::HOMARD_Gen_var homardGen = SMESHGUI_AdaptDlg::InitHOMARDGen(app); -// int defaut_i ; -// std::string defaut_s ; -// QString QString_v ; -// // -// // B. Les valeurs -// // B.1. La langue -// // -// defaut_s = homardGen->GetLanguageShort(); -// SUIT_ResourceMgr* resMgr = getApp()->resourceMgr(); -// _LanguageShort = resMgr->stringValue("language", "language", QString(defaut_s.c_str()) ); -// // -// // B.2. Les publications -// bool publish_mesh ; -// // -// _PublisMeshIN = homardGen->GetPublisMeshIN(); -// if ( _PublisMeshIN == 1 ) { publish_mesh = true ; } -// else { publish_mesh = false ; } -// publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_in", publish_mesh ); -// if ( publish_mesh ) { _PublisMeshIN = 1 ; } -// else { _PublisMeshIN = 0 ; } -// // -// _PublisMeshOUT = homardGen->GetPublisMeshOUT(); -// if ( _PublisMeshOUT == 1 ) { publish_mesh = true ; } -// else { publish_mesh = false ; } -// publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_out", publish_mesh ); -// if ( publish_mesh ) { _PublisMeshOUT = 1 ; } -// else { _PublisMeshOUT = 0 ; } -// // -// // B.3. Les maximum pour YACS -// // -// defaut_i = homardGen->GetYACSMaxIter(); -// _YACSMaxIter = resMgr->integerValue("HOMARD", "yacs_max_iter", defaut_i ); -// // -// defaut_i = homardGen->GetYACSMaxNode(); -// _YACSMaxNode = resMgr->integerValue("HOMARD", "yacs_max_node", defaut_i ); -// // -// defaut_i = homardGen->GetYACSMaxElem(); -// _YACSMaxElem = resMgr->integerValue("HOMARD", "yacs_max_elem", defaut_i ); -// // -// // B.4. La convergence pour YACS -// // -// defaut_i = homardGen->GetYACSConvergenceType(); -// if ( defaut_i == 1 ) { QString_v = tr("VTest > VRef") ; } -// else if ( defaut_i == 2 ) { QString_v = tr("VTest < VRef") ; } -// else { QString_v = tr("None") ; } -// QString_v = resMgr->stringValue ( "HOMARD", "yacs_type_test", QString_v ); -// if ( ( QString_v == "VTest > VRef" ) || ( QString_v == "VTest > VRef" ) ) { _YACSTypeTest = 1 ; } -// else if ( ( QString_v == "VTest < VRef" ) || ( QString_v == "VTest < VRef" ) ) { _YACSTypeTest = 2 ; } -// else { _YACSTypeTest = 0 ; } -// // -// // C. Enregistrement dans l'objet general -// // -// MESSAGE ("Enregistrement de LanguageShort = " << _LanguageShort.toStdString().c_str() ); -// MESSAGE ("Enregistrement de PublisMeshIN = " << _PublisMeshIN<<", PublisMeshOUT = "<< _PublisMeshOUT); -// MESSAGE ("Enregistrement de YACSMaxIter = " << _YACSMaxIter<<", YACSMaxNode = "<< _YACSMaxNode<<", YACSMaxElem = "<< _YACSMaxElem); -// MESSAGE ("Enregistrement de YACSTypeTest = " << _YACSTypeTest); -// // -// homardGen->SetLanguageShort(_LanguageShort.toStdString().c_str()); -// homardGen->SetPublisMesh(_PublisMeshIN, _PublisMeshOUT); -// homardGen->SetYACSMaximum(_YACSMaxIter, _YACSMaxNode, _YACSMaxElem); -// // -// homardGen->SetYACSConvergenceType(_YACSTypeTest); -// } -// -// //================================================ -// void SMESHGUI_AdaptDlg::OnGUIEvent() -// //================================================ -// { -// MESSAGE("OnGUIEvent()") -// setOrb(); -// const QObject* obj = sender(); -// if ( !obj || !obj->inherits( "QAction" ) ) { return; } -// int id = actionId((QAction*)obj); -// if ( id != -1 ) { bool ret = OnGUIEvent( id ); } -// MESSAGE("Fin de OnGUIEvent()"); -// } -// -// //======================================================================= -// // Method OnGUIEvent pour Homard -// //======================================================================= -// bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) -// { -// MESSAGE("OnGUIEvent avec theCommandID = "<( application() ); -// if ( !app ) return false; -// -// SalomeApp_Study* stud = dynamic_cast ( app->activeStudy() ); -// if ( !stud ) -// { -// MESSAGE ( "FAILED to cast active study to SalomeApp_Study" ); -// return false; -// } -// -// SUIT_Desktop* parent = application()->desktop(); -// -// HOMARD::HOMARD_Gen_var homardGen = SMESHGUI_AdaptDlg::InitHOMARDGen(app); -// -// if (!CORBA::is_nil(homardGen)) -// homardGen->UpdateStudy(); -// -// getApp()->updateObjectBrowser(); -// -// // B. Choix selon les commandes -// SCRUTE(theCommandID); -// switch (theCommandID) -// { -// case 8011: // Creation d un Cas -// { -// MESSAGE("command " << theCommandID << " activated"); -// MonCreateCase *aDlg = new MonCreateCase( true, -// HOMARD::HOMARD_Gen::_duplicate(homardGen) ) ; -// aDlg->show(); -// break; -// } -// -// case 8012: // Poursuite d une iteration -// { -// MESSAGE("command " << theCommandID << " activated"); -// MonPursueIteration *aDlg = new MonPursueIteration( true, -// HOMARD::HOMARD_Gen::_duplicate(homardGen) ) ; -// aDlg->show(); -// break; -// } -// -// case 8013: // Creation d une Iteration -// { -// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// MonCreateIteration *IterDlg = new MonCreateIteration( parent, true, -// HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ; -// IterDlg->show(); -// break; -// } -// -// case 8014: // Compute une iteration -// { -// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// try { homardGen->Compute(_ObjectName.toStdString().c_str(), 0, 1, -1, 1); } -// catch( SALOME::SALOME_Exception& S_ex ) -// { -// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), -// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// getApp()->updateObjectBrowser(); -// return false; -// } -// break; -// } -// -// case 8015: // Compute une iteration et publication -// { -// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// try { homardGen->Compute(_ObjectName.toStdString().c_str(), 0, 1, -1, 2); } -// catch( SALOME::SALOME_Exception& S_ex ) -// { -// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), -// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// getApp()->updateObjectBrowser(); -// return false; -// } -// break; -// } -// -// case 1121: // Information sur le maillage de l'iteration -// { -// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// MonIterInfo *IterDlg = new MonIterInfo( parent, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ; -// IterDlg->show(); -// break; -// } -// -// case 1131: // Publication du maillage de l'iteration -// { -// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// homardGen->PublishMeshIterInSmesh(_ObjectName.toStdString().c_str()); -// break; -// } -// -// case 1132: // Publication du maillage de l'iteration a partir du fichier -// { -// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// homardGen->PublishResultInSmesh(_ObjectName.toStdString().c_str(), 1); -// break; -// } -// -// case 8016: // Edition d'un objet -// { -// MESSAGE("command " << theCommandID << " activated"); -// QString nomObjet = HOMARD_QT_COMMUN::SelectionArbreEtude(QString(""), 1); -// if (nomObjet == QString("")) break; -// _PTR(SObject) obj = chercheMonObjet(); -// if (obj) -// { -// // Edition d'une frontiere CAO -// if (HOMARD_UTILS::isBoundaryCAO(obj)) -// { -// MonEditBoundaryCAO *aDlg = new MonEditBoundaryCAO(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; -// aDlg->show(); -// } -// // Edition d'une frontiere discrete -// else if (HOMARD_UTILS::isBoundaryDi(obj)) -// { -// MonEditBoundaryDi *aDlg = new MonEditBoundaryDi(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; -// aDlg->show(); -// } -// // Edition d'une frontiere analytique -// else if (HOMARD_UTILS::isBoundaryAn(obj)) -// { -// MonEditBoundaryAn *aDlg = new MonEditBoundaryAn(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; -// aDlg->show(); -// } -// // Edition d'un cas -// else if (HOMARD_UTILS::isCase(obj)) -// { -// MonEditCase *aDlg = new MonEditCase(true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ; -// aDlg->show(); -// } -// // Edition d'une hypothese -// else if (HOMARD_UTILS::isHypo(obj)) -// { -// MonEditHypothesis *aDlg = new MonEditHypothesis(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName, QString(""), QString("")) ; -// aDlg->show(); -// } -// // Edition d'une iteration -// else if (HOMARD_UTILS::isIter(obj)) -// { -// MonEditIteration *aDlg = new MonEditIteration(parent, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; -// aDlg->show(); -// } -// // Edition d'un schema YACS -// else if (HOMARD_UTILS::isYACS(obj)) -// { -// MESSAGE("appel de MonEditYACS"); -// MonEditYACS *aDlg = new MonEditYACS(true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName) ; -// aDlg->show(); -// } -// // Edition d'une zone -// else if (HOMARD_UTILS::isZone(obj)) -// { -// MonEditZone *aDlg = new MonEditZone(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; -// aDlg->show(); -// } -// } -// break; -// } -// -// case 8017: // Suppression d'un objet -// { -// MESSAGE("command " << theCommandID << " activated"); -// QString nomObjet = HOMARD_QT_COMMUN::SelectionArbreEtude(QString(""), 1); -// if (nomObjet == QString("")) break; -// _PTR(SObject) obj = chercheMonObjet(); -// if (obj) -// { -// // Suppression d'une frontiere -// if ( HOMARD_UTILS::isBoundaryCAO(obj) || HOMARD_UTILS::isBoundaryDi(obj) || HOMARD_UTILS::isBoundaryAn(obj) ) -// { -// try -// { homardGen->DeleteBoundary(_ObjectName.toStdString().c_str()); } -// catch( SALOME::SALOME_Exception& S_ex ) -// { -// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), -// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// getApp()->updateObjectBrowser(); -// return false; -// } -// } -// // Suppression d'un cas -// else if (HOMARD_UTILS::isCase(obj)) -// { -// try -// { homardGen->DeleteCase(_ObjectName.toStdString().c_str(), 1); } -// catch( SALOME::SALOME_Exception& S_ex ) -// { -// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), -// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// getApp()->updateObjectBrowser(); -// return false; -// } -// } -// // Suppression d'une hypothese -// else if (HOMARD_UTILS::isHypo(obj)) -// { -// try -// { homardGen->DeleteHypo(_ObjectName.toStdString().c_str()); } -// catch( SALOME::SALOME_Exception& S_ex ) -// { -// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), -// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// getApp()->updateObjectBrowser(); -// return false; -// } -// } -// // Suppression d'une iteration -// else if (HOMARD_UTILS::isIter(obj)) -// { -// try -// { homardGen->DeleteIteration(_ObjectName.toStdString().c_str(), 1); } -// catch( SALOME::SALOME_Exception& S_ex ) -// { -// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), -// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// getApp()->updateObjectBrowser(); -// return false; -// } -// } -// // Suppression d'un schema YACS -// else if (HOMARD_UTILS::isYACS(obj)) -// { -// try -// { homardGen->DeleteYACS(_ObjectName.toStdString().c_str(), 1); } -// catch( SALOME::SALOME_Exception& S_ex ) -// { -// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), -// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// getApp()->updateObjectBrowser(); -// return false; -// } -// } -// // Suppression d'une zone -// else if (HOMARD_UTILS::isZone(obj)) -// { -// try -// { homardGen->DeleteZone(_ObjectName.toStdString().c_str()); } -// catch( SALOME::SALOME_Exception& S_ex ) -// { -// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), -// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// getApp()->updateObjectBrowser(); -// return false; -// } -// } -// } -// break; -// } -// -// case 1301: // Information sur un maillage -// { -// MESSAGE("etape 1301") -// MESSAGE("command " << theCommandID << " activated"); -// MonMeshInfo *aDlg = new MonMeshInfo( parent, true, HOMARD::HOMARD_Gen::_duplicate(homardGen) ) ; -// aDlg->show(); -// break; -// } -// -// case 1302: // Affichage de fichier texte -// { -// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// _PTR(SObject) obj = chercheMonObjet(); -// if ( (obj) && ( HOMARD_UTILS::isFileType(obj,QString("log")) || HOMARD_UTILS::isFileType(obj,QString("Summary")) || HOMARD_UTILS::isFileType(obj,QString("xml")) ) ) -// { -// MonEditFile *aDlg = new MonEditFile( 0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName, 0 ) ; -// if ( aDlg->_codret == 0 ) { aDlg->show(); } -// } -// break; -// } -// -// case 1401: // Création d'un schema YACS -// { -// MESSAGE("etape 1401") -// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// MonCreateYACS *aDlg = new MonCreateYACS( true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ; -// aDlg->show(); -// break; -// } -// -// case 1402: // Ecriture d'un schéma YACS -// { -// MESSAGE("etape 1402") -// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// try { homardGen->YACSWrite(_ObjectName.toStdString().c_str()); } -// catch( SALOME::SALOME_Exception& S_ex ) -// { -// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), -// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// getApp()->updateObjectBrowser(); -// return false; -// } -// break; -// } -// -// } -// getApp()->updateObjectBrowser(); -// return true; -// } -// -// //============================================================================= -// /*! -// * -// */ -// //============================================================================= -// -// // Module's engine IOR -// //============================================================================= -// QString SMESHGUI_AdaptDlg::engineIOR() const -// //============================================================================= -// { -// CORBA::String_var anIOR = getApp()->orb()->object_to_string( InitHOMARDGen(getApp()) ); -// return QString( anIOR.in() ); -// } -// -// // Module's activation -// //============================================================================= -// bool SMESHGUI_AdaptDlg::activateModule( SUIT_Study* theStudy ) -// //============================================================================= -// { -// bool bOk = SalomeApp_Module::activateModule( theStudy ); -// -// setMenuShown( true ); -// setToolShown( true ); -// -// return bOk; -// } -// -// // Module's deactivation -// //============================================================================= -// bool SMESHGUI_AdaptDlg::deactivateModule( SUIT_Study* theStudy ) -// //============================================================================= -// { -// setMenuShown( false ); -// setToolShown( false ); -// -// return SalomeApp_Module::deactivateModule( theStudy ); -// } -// -// // Default windows -// //============================================================================= -// void SMESHGUI_AdaptDlg::windows( QMap& theMap ) const -// //============================================================================= -// { -// theMap.clear(); -// theMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea ); -// #ifndef DISABLE_PYCONSOLE -// theMap.insert( SalomeApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea ); -// #endif -// } -// -// //============================================================================= -// void SMESHGUI_AdaptDlg::setOrb() -// //============================================================================= -// { -// try -// { -// ORB_INIT &init = *SINGLETON_::Instance(); -// ASSERT(SINGLETON_::IsAlreadyExisting()); -// _orb = init( 0 , 0 ); -// } -// catch (...) -// { -// INFOS("internal error : orb not found"); -// _orb = 0; -// } -// ASSERT(! CORBA::is_nil(_orb)); -// } -// //======================================== -// _PTR(SObject) SMESHGUI_AdaptDlg::chercheMonObjet() -// //======================================== -// { -// SALOMEDSClient_SObject* aSO = NULL; -// _PTR(SObject) obj; -// SALOME_ListIO lst; -// getApp()->selectionMgr()->selectedObjects( lst ); -// if ( lst.Extent() == 1 ) -// { -// Handle(SALOME_InteractiveObject) io = lst.First(); -// SalomeApp_Study* appStudy = dynamic_cast( application()->activeStudy() ); -// _PTR(Study) study = appStudy->studyDS(); -// _PTR(SObject) obj = study->FindObjectID( io->getEntry() ); -// _ObjectName = QString( obj->GetName().c_str() ); -// return obj; -// } -// else { return _PTR(SObject)(aSO); } -// } -// //============================================================================= -// void SMESHGUI_AdaptDlg::contextMenuPopup( const QString& client, QMenu* menu, QString& title ) -// //============================================================================= -// { -// MESSAGE("Debut de contextMenuPopup"); -// _PTR(SObject) obj = chercheMonObjet(); -// if ( obj ) -// { -// title = QString( obj->GetName().c_str() ); -// _ObjectName = title; -// SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); -// // -// QPixmap pix ; -// bool DeleteObject = false ; -// bool EditObject = false ; -// // -// if ( HOMARD_UTILS::isBoundaryCAO(obj) ) -// { -// EditObject = true ; -// DeleteObject = true ; -// } -// else if ( HOMARD_UTILS::isBoundaryAn(obj) ) -// { -// EditObject = true ; -// DeleteObject = true ; -// } -// else if ( HOMARD_UTILS::isBoundaryDi(obj) ) -// { -// EditObject = true ; -// DeleteObject = true ; -// } -// else if ( HOMARD_UTILS::isCase(obj) ) -// { -// pix = resMgr->loadPixmap( "HOMARD", "table_view.png" ); -// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_YACS").toLatin1().data()), this, SLOT(YACSCreate())); -// EditObject = true ; -// DeleteObject = true ; -// } -// else if ( HOMARD_UTILS::isHypo(obj) ) -// { -// EditObject = true ; -// DeleteObject = true ; -// } -// else if ( HOMARD_UTILS::isIter(obj) ) -// { -// pix = resMgr->loadPixmap( "HOMARD", "iter_next.png" ); -// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_NEW_ITERATION").toLatin1().data()), this, SLOT(NextIter())); -// pix = resMgr->loadPixmap( "HOMARD", "mesh_compute.png" ); -// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_COMPUTE").toLatin1().data()), this, SLOT(LanceCalcul0())); -// pix = resMgr->loadPixmap( "HOMARD", "mesh_compute.png" ); -// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_COMPUTE_PUBLISH").toLatin1().data()), this, SLOT(LanceCalcul1())); -// pix = resMgr->loadPixmap( "HOMARD", "advanced_mesh_info.png" ); -// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_MESH_INFO").toLatin1().data()), this, SLOT(IterInfo())); -// pix = resMgr->loadPixmap( "HOMARD", "mesh_tree_mesh.png" ); -// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_MESH_PUBLICATION").toLatin1().data()), this, SLOT(MeshPublish0())); -// EditObject = true ; -// DeleteObject = true ; -// } -// else if ( HOMARD_UTILS::isYACS(obj) ) -// { -// pix = resMgr->loadPixmap( "HOMARD", "write.png" ); -// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_WRITE").toLatin1().data()), this, SLOT(YACSWrite())); -// EditObject = true ; -// DeleteObject = true ; -// } -// else if ( HOMARD_UTILS::isZone(obj) ) -// { -// EditObject = true ; -// DeleteObject = true ; -// } -// else if ( HOMARD_UTILS::isFileType(obj,QString("log")) || HOMARD_UTILS::isFileType(obj,QString("Summary")) || HOMARD_UTILS::isFileType(obj,QString("xml")) ) -// { -// pix = resMgr->loadPixmap( "HOMARD", "texte.png" ); -// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_EDIT_MESS_FILE").toLatin1().data()), this, SLOT(EditAsciiFile())); -// } -// else if ( HOMARD_UTILS::isFileType(obj,QString("Mesh")) ) -// { -// pix = resMgr->loadPixmap( "HOMARD", "mesh_tree_mesh.png" ); -// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_MESH_PUBLICATION").toLatin1().data()), this, SLOT(MeshPublish1())); -// } -// // Ajout d'un menu d'edition pour les objets qui le proposent -// if ( EditObject ) -// { -// pix = resMgr->loadPixmap( "HOMARD", "loop.png" ); -// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_EDIT").toLatin1().data()), this, SLOT(Edit())); -// } -// // Ajout d'un menu de destruction pour les objets qui le proposent -// if ( DeleteObject ) -// { -// pix = resMgr->loadPixmap( "HOMARD", "delete.png" ); -// menu->addAction(QIcon(pix), tr(QString("HOM_MEN_DELETE").toLatin1().data()), this, SLOT(Delete())); -// } -// } -// } -// -// void SMESHGUI_AdaptDlg::NextIter() -// { -// this->OnGUIEvent(8013); -// } -// -// void SMESHGUI_AdaptDlg::LanceCalcul0() -// { -// this->OnGUIEvent(8014); -// } -// -// void SMESHGUI_AdaptDlg::LanceCalcul1() -// { -// this->OnGUIEvent(8015); -// } -// -// void SMESHGUI_AdaptDlg::IterInfo() -// { -// this->OnGUIEvent(1121); -// } -// -// void SMESHGUI_AdaptDlg::MeshPublish0() -// { -// this->OnGUIEvent(1131); -// } -// -// void SMESHGUI_AdaptDlg::MeshPublish1() -// { -// this->OnGUIEvent(1132); -// } -// -// void SMESHGUI_AdaptDlg::Edit() -// { -// this->OnGUIEvent(8016); -// } -// -// void SMESHGUI_AdaptDlg::Delete() -// { -// this->OnGUIEvent(8017); -// } -// -// void SMESHGUI_AdaptDlg::EditAsciiFile() -// { -// this->OnGUIEvent(1302); -// } -// -// void SMESHGUI_AdaptDlg::YACSCreate() -// { -// this->OnGUIEvent(1401); -// } -// void SMESHGUI_AdaptDlg::YACSWrite() -// { -// this->OnGUIEvent(1402); -// } -// - -// -//============================================================================= -// Export the module -//============================================================================= -extern "C" { - Standard_EXPORT CAM_Module* createModule() + std::cout << "theCommandID : " << theCommandID << std::endl; + initDialog( true ); + if ( !theMesh->_is_nil() ) + init( theMesh ); + else { - return new SMESHGUI_AdaptDlg(""); + mySelectSubMesh->setEnabled( false ); + mySelectGroup->setEnabled( false ); + myGeomGroupBtn->setEnabled( false ); + myGeomGroupLine->setEnabled( false ); } } +//================================================================================= +// function : SMESHGUI_AdaptDlg() +// purpose : +//================================================================================= +void SMESHGUI_AdaptDlg::initDialog( bool create) +{ + setModal( false ); + setAttribute( Qt::WA_DeleteOnClose, true ); + + myFilterDlg = 0; + myCreate = create; + myCurrentLineEdit = 0; + + myShapeByMeshOp = 0; + myGeomPopup = 0; + myGeomObjects = new GEOM::ListOfGO(); + myGeomObjects->length( 0 ); + + QPixmap image0( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH", tr( "ICON_SELECT" ) ) ); + + setWindowTitle( create ? tr( "SMESH_CREATE_GROUP_TITLE" ) : tr( "SMESH_EDIT_GROUP_TITLE" ) ); + myHelpFileName = create ? "creating_groups.html" : "editing_groups.html"; + + setSizeGripEnabled( true); + + QGridLayout* aMainLayout = new QGridLayout( this ); + aMainLayout->setMargin( MARGIN ); + aMainLayout->setSpacing( SPACING ); + + /***************************************************************/ + QLabel* meshGroupLab = new QLabel( create ? tr( "SMESH_MESH" ) : tr( "SMESH_GROUP" ), this ); + myMeshGroupBtn = new QPushButton( this ); + myMeshGroupBtn->setIcon( image0 ); + myMeshGroupLine = new QLineEdit( this ); + myMeshGroupLine->setReadOnly( true ); + + /***************************************************************/ + QGroupBox* aTypeBox = new QGroupBox( tr( "SMESH_ELEMENTS_TYPE" ), this ); + myTypeGroup = new QButtonGroup( this ); + QHBoxLayout* aTypeBoxLayout = new QHBoxLayout( aTypeBox ); + aTypeBoxLayout->setMargin( MARGIN ); + aTypeBoxLayout->setSpacing( SPACING ); + + QStringList types; + types.append( tr( "MESH_NODE" ) ); + types.append( tr( "SMESH_ELEM0D" ) ); + types.append( tr( "SMESH_BALL_ELEM" ) ); + types.append( tr( "SMESH_EDGE" ) ); + types.append( tr( "SMESH_FACE" ) ); + types.append( tr( "SMESH_VOLUME" ) ); + QRadioButton* rb; + for ( int i = 0; i < types.count(); i++ ) + { + rb = new QRadioButton( types[i], aTypeBox ); + myTypeGroup->addButton( rb, i ); + aTypeBoxLayout->addWidget( rb ); + } + aTypeBox->setEnabled( create ); + myTypeId = -1; + + /***************************************************************/ + QLabel* aName = new QLabel( tr( "SMESH_NAME" ), this ); + aName->setMinimumWidth( 50 ); + myName = new QLineEdit( this ); + + /***************************************************************/ + QGroupBox* aGrpTypeBox = new QGroupBox( tr( "SMESH_GROUP_TYPE" ), this ); + myGrpTypeGroup = new QButtonGroup( this ); + QHBoxLayout* aGrpTypeBoxLayout = new QHBoxLayout( aGrpTypeBox ); + aGrpTypeBoxLayout->setMargin( MARGIN ); + aGrpTypeBoxLayout->setSpacing( SPACING ); + + QRadioButton* rb1 = new QRadioButton( tr( "SMESH_GROUP_STANDALONE" ), aGrpTypeBox ); + QRadioButton* rb2 = new QRadioButton( tr( "SMESH_GROUP_GEOMETRY" ), aGrpTypeBox ); + QRadioButton* rb3 = new QRadioButton( tr( "SMESH_GROUP_FILTER" ), aGrpTypeBox ); + myGrpTypeGroup->addButton( rb1, 0 ); + myGrpTypeGroup->addButton( rb2, 1 ); + myGrpTypeGroup->addButton( rb3, 2 ); + aGrpTypeBoxLayout->addWidget( rb1 ); + aGrpTypeBoxLayout->addWidget( rb2 ); + aGrpTypeBoxLayout->addWidget( rb3 ); + aGrpTypeBox->setEnabled( create ); + myGrpTypeId = -1; + + /***************************************************************/ + myWGStack = new QStackedWidget( this ); + QWidget* wg1 = new QWidget( myWGStack ); + QWidget* wg2 = new QWidget( myWGStack ); + QWidget* wg3 = new QWidget( myWGStack ); + + /***************************************************************/ + QGroupBox* aContentBox = new QGroupBox( tr( "SMESH_CONTENT" ), wg1 ); + QGridLayout* aContentBoxLayout = new QGridLayout( aContentBox ); + aContentBoxLayout->setMargin( MARGIN ); + aContentBoxLayout->setSpacing( SPACING ); + + mySelectAll = new QCheckBox( tr( "SELECT_ALL" ), aContentBox ); + myAllowElemsModif = new QCheckBox( tr( "ALLOW_ELEM_LIST_MODIF" ), aContentBox ); + + myElementsLab = new QLabel( tr( "SMESH_ID_ELEMENTS" ), aContentBox ); + myElements = new QListWidget( aContentBox ); + myElements->setSelectionMode( QListWidget::ExtendedSelection ); + + myFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), aContentBox ); + myAddBtn = new QPushButton( tr( "SMESH_BUT_ADD" ), aContentBox ); + myRemoveBtn = new QPushButton( tr( "SMESH_BUT_REMOVE" ), aContentBox ); + mySortBtn = new QPushButton( tr( "SMESH_BUT_SORT" ), aContentBox ); + + aContentBoxLayout->addWidget( mySelectAll, 0, 0 ); + aContentBoxLayout->addWidget( myAllowElemsModif, 1, 0 ); + aContentBoxLayout->addWidget( myFilterBtn, 1, 1 ); + aContentBoxLayout->addWidget( myElementsLab, 2, 0 ); + aContentBoxLayout->addWidget( myElements, 3, 0, 6, 1 ); + aContentBoxLayout->addWidget( myAddBtn, 3, 1 ); + aContentBoxLayout->addWidget( myRemoveBtn, 4, 1 ); + aContentBoxLayout->addWidget( mySortBtn, 8, 1 ); + + aContentBoxLayout->setColumnStretch( 0, 1 ); + aContentBoxLayout->setRowStretch( 3, 1 ); + aContentBoxLayout->setRowStretch( 6, 1 ); + + /***************************************************************/ + mySelectBox = new QGroupBox( tr( "SMESH_SELECT_FROM" ), wg1 ); + QGridLayout* mySelectBoxLayout = new QGridLayout( mySelectBox ); + mySelectBoxLayout->setMargin( MARGIN ); + mySelectBoxLayout->setSpacing( SPACING ); + + mySelectSubMesh = new QCheckBox( tr( "SMESH_SUBMESH" ), mySelectBox ); + mySubMeshBtn = new QPushButton( mySelectBox ); + mySubMeshBtn->setIcon( image0 ); + mySubMeshLine = new QLineEdit( mySelectBox ); + mySubMeshLine->setReadOnly( true ); + onSelectSubMesh( false ); + + mySelectGroup = new QCheckBox( tr( "SMESH_GROUP" ), mySelectBox ); + myGroupBtn = new QPushButton( mySelectBox ); + myGroupBtn->setIcon( image0 ); + myGroupLine = new QLineEdit( mySelectBox ); + myGroupLine->setReadOnly( true ); + onSelectGroup( false ); + + mySelectBoxLayout->addWidget( mySelectSubMesh, 0, 0 ); + mySelectBoxLayout->addWidget( mySubMeshBtn, 0, 1 ); + mySelectBoxLayout->addWidget( mySubMeshLine, 0, 2 ); + mySelectBoxLayout->addWidget( mySelectGroup, 1, 0 ); + mySelectBoxLayout->addWidget( myGroupBtn, 1, 1 ); + mySelectBoxLayout->addWidget( myGroupLine, 1, 2 ); + + /***************************************************************/ + QVBoxLayout* wg1Layout = new QVBoxLayout( wg1 ); + wg1Layout->setMargin( 0 ); + wg1Layout->setSpacing( SPACING ); + wg1Layout->addWidget( aContentBox ); + wg1Layout->addWidget( mySelectBox ); + wg1Layout->setStretchFactor( aContentBox, 10 ); + + /***************************************************************/ + QLabel* geomObject = new QLabel( tr( "SMESH_OBJECT_GEOM" ), wg2 ); + myGeomGroupBtn = new QToolButton( wg2 ); + myGeomGroupBtn->setIcon( image0 ); + myGeomGroupBtn->setCheckable( true ); + myGeomGroupLine = new QLineEdit( wg2 ); + myGeomGroupLine->setReadOnly( true ); //VSR ??? + onSelectGeomGroup( false ); + + myGeomGroupBtn->setEnabled( create ); + myGeomGroupLine->setEnabled( create ); + + /***************************************************************/ + QGridLayout* wg2Layout = new QGridLayout( wg2 ); + wg2Layout->setMargin( 0 ); + wg2Layout->setSpacing( SPACING ); + wg2Layout->addWidget( geomObject, 0, 0 ); + wg2Layout->addWidget( myGeomGroupBtn, 0, 1 ); + wg2Layout->addWidget( myGeomGroupLine,0, 2 ); + wg2Layout->setRowStretch( 1, 5 ); + + /***************************************************************/ + QPushButton * aFilter2 = new QPushButton( tr( "SMESH_BUT_FILTER" ), wg3 ); + QGridLayout* wg3Layout = new QGridLayout( wg3 ); + wg3Layout->setMargin( 0 ); + wg3Layout->setSpacing( SPACING ); + wg3Layout->addWidget( aFilter2, 0, 0 ); + wg3Layout->setRowStretch( 1, 5 ); + + /***************************************************************/ + myWGStack->insertWidget( 0, wg1 ); + myWGStack->insertWidget( 1, wg2 ); + myWGStack->insertWidget( 2, wg3 ); + + /***************************************************************/ + QGroupBox* aColorBox = new QGroupBox(tr( "SMESH_SET_COLOR" ), this); + QHBoxLayout* aColorBoxLayout = new QHBoxLayout(aColorBox); + aColorBoxLayout->setMargin(MARGIN); + aColorBoxLayout->setSpacing(SPACING); + + QLabel* aColorLab = new QLabel(tr( "SMESH_CHECK_COLOR" ), aColorBox ); + myColorBtn = new QtxColorButton(aColorBox); + myColorBtn->setSizePolicy( QSizePolicy::MinimumExpanding, + myColorBtn->sizePolicy().verticalPolicy() ); + + aColorBoxLayout->addWidget(aColorLab); + aColorBoxLayout->addWidget(myColorBtn); + + /***************************************************************/ + + QFrame* aButtons = new QFrame(this); + aButtons->setFrameStyle( QFrame::Box | QFrame::Sunken ); + QHBoxLayout* aBtnLayout = new QHBoxLayout(aButtons); + aBtnLayout->setMargin(MARGIN); + aBtnLayout->setSpacing(SPACING); + + myOKBtn = new QPushButton(tr( "SMESH_BUT_APPLY_AND_CLOSE" ), aButtons); + myOKBtn->setAutoDefault(true); + myOKBtn->setDefault(true); + myApplyBtn = new QPushButton(tr( "SMESH_BUT_APPLY" ), aButtons); + myApplyBtn->setAutoDefault(true); + myCloseBtn = new QPushButton(tr( "SMESH_BUT_CLOSE" ), aButtons); + myCloseBtn->setAutoDefault(true); + myHelpBtn = new QPushButton(tr( "SMESH_BUT_HELP" ), aButtons); + myHelpBtn->setAutoDefault(true); + + aBtnLayout->addWidget(myOKBtn); + aBtnLayout->addSpacing(10); + aBtnLayout->addWidget(myApplyBtn); + aBtnLayout->addSpacing(10); + aBtnLayout->addStretch(); + aBtnLayout->addWidget(myCloseBtn); + aBtnLayout->addWidget(myHelpBtn); + + /***************************************************************/ + aMainLayout->addWidget(meshGroupLab, 0, 0); + aMainLayout->addWidget(myMeshGroupBtn, 0, 1); + aMainLayout->addWidget(myMeshGroupLine, 0, 2); + aMainLayout->addWidget(aTypeBox, 1, 0, 1, 3); + aMainLayout->addWidget(aName, 2, 0); + aMainLayout->addWidget(myName, 2, 2); + aMainLayout->addWidget(aGrpTypeBox, 3, 0, 1, 3); + aMainLayout->addWidget(myWGStack, 4, 0, 1, 3); + aMainLayout->addWidget(aColorBox, 5, 0, 1, 3); + aMainLayout->addWidget(aButtons, 6, 0, 1, 3); + + /* signals and slots connections */ + connect(myMeshGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection())); + connect(myGrpTypeGroup, SIGNAL(buttonClicked(int)), this, SLOT(onGrpTypeChanged(int))); + connect(myTypeGroup, SIGNAL(buttonClicked(int)), this, SLOT(onTypeChanged(int))); + + connect(myName, SIGNAL(textChanged(const QString&)), this, SLOT(onNameChanged(const QString&))); + connect(myElements, SIGNAL(itemSelectionChanged()), this, SLOT(onListSelectionChanged())); + + connect(myFilterBtn, SIGNAL(clicked()), this, SLOT(setFilters())); + connect(aFilter2, SIGNAL(clicked()), this, SLOT(setFilters())); + connect(mySelectAll, SIGNAL(toggled(bool)), this, SLOT(onSelectAll())); + connect(myAllowElemsModif,SIGNAL(toggled(bool)), this, SLOT(onSelectAll())); + connect(myAddBtn, SIGNAL(clicked()), this, SLOT(onAdd())); + connect(myRemoveBtn, SIGNAL(clicked()), this, SLOT(onRemove())); + connect(mySortBtn, SIGNAL(clicked()), this, SLOT(onSort())); + + connect(mySelectSubMesh, SIGNAL(toggled(bool)), this, SLOT(onSelectSubMesh(bool))); + connect(mySelectGroup, SIGNAL(toggled(bool)), this, SLOT(onSelectGroup(bool))); + connect(mySubMeshBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection())); + connect(myGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection())); + connect(myGeomGroupBtn, SIGNAL(toggled(bool)), this, SLOT(onGeomSelectionButton(bool))); + + connect(myColorBtn, SIGNAL(changed( QColor )), this, SLOT(onColorChanged( QColor ))); + + connect(myOKBtn, SIGNAL(clicked()), this, SLOT(onOK())); + connect(myApplyBtn, SIGNAL(clicked()), this, SLOT(onApply())); + connect(myCloseBtn, SIGNAL(clicked()), this, SLOT(reject())); + connect(myHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp())); + + /* Init selection */ + mySMESHGUI->SetActiveDialogBox(this); + + SalomeApp_Study* aStudy = dynamic_cast( mySMESHGUI->application()->activeStudy() ); + mySelectionMode = grpNoSelection; + + myMeshFilter = new SMESH_TypeFilter(SMESH::MESH); + mySubMeshFilter = new SMESH_LogicalFilter(QList(), + SMESH_LogicalFilter::LO_OR, + /*takeOwnership=*/true); + myGroupFilter = new SMESH_LogicalFilter(QList(), + SMESH_LogicalFilter::LO_OR, + /*takeOwnership=*/true); + myGeomFilter = new GEOM_SelectionFilter( aStudy, true ); + + connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(onDeactivate())); + connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject())); + connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onObjectSelectionChanged())); + connect(mySMESHGUI, SIGNAL(SignalVisibilityChanged()), this, SLOT(onVisibilityChanged())); + connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), this, SLOT(onOpenView())); + connect(mySMESHGUI, SIGNAL(SignalCloseView()), this, SLOT(onCloseView())); + rb1->setChecked(true); // VSR !!! + onGrpTypeChanged(0); // VSR!!! + + if (myMesh->_is_nil() ) + myTypeGroup->button(0)->setChecked(true); + + onSelectAll(); //updateButtons(); +} + +//================================================================================= +// function : ~SMESHGUI_AdaptDlg() +// purpose : Destroys the object and frees any allocated resources +//================================================================================= +SMESHGUI_AdaptDlg::~SMESHGUI_AdaptDlg() +{ + // no need to delete child widgets, Qt does it all for us + if ( myFilterDlg != 0 ) { + myFilterDlg->setParent( 0 ); + delete myFilterDlg; + } + if ( myMeshFilter ) delete myMeshFilter; + if ( mySubMeshFilter ) delete mySubMeshFilter; + if ( myGroupFilter ) delete myGroupFilter; + if ( myGeomFilter ) delete myGeomFilter; +} + +//================================================================================= +// function : GetDefaultName() +// purpose : Get the Group Name if Create new Group +//================================================================================= +QString SMESHGUI_AdaptDlg::GetDefaultName(const QString& theOperation) +{ + QString aName = ""; + + // collect all object names of SMESH component + _PTR(Study) aStudy = SMESH::getStudy(); + + std::set aSet; + _PTR(SComponent) aMeshCompo (aStudy->FindComponent( "SMESH" )); + if (aMeshCompo) { + _PTR(ChildIterator) it (aStudy->NewChildIterator(aMeshCompo)); + _PTR(SObject) obj; + for (it->InitEx(true); it->More(); it->Next()) { + obj = it->Value(); + aSet.insert(obj->GetName()); + } + } + + // build a unique name + int aNumber = 0; + bool isUnique = false; + while (!isUnique) { + aName = theOperation + "_" + QString::number(++aNumber); + isUnique = (aSet.count(std::string(aName.toUtf8().constData())) == 0); + } + + return aName; +} + +void SMESHGUI_AdaptDlg::setDefaultName() const +{ + QString aResName; + int i=1; + QString aPrefix ="Group_"; + _PTR(SObject) anObj; + do + { + aResName = aPrefix + QString::number( i++ ); + anObj = SMESH::getStudy()->FindObject( aResName.toUtf8().constData() ); + } + while ( anObj ); + myName->setText(aResName); +} + +//================================================================================= +// function : Init() +// purpose : +//================================================================================= +void SMESHGUI_AdaptDlg::init (SMESH::SMESH_Mesh_ptr theMesh) +{ + mySelectionMgr->installFilter(myMeshFilter); + + /* init data from current selection */ + restoreShowEntityMode(); + myMesh = SMESH::SMESH_Mesh::_duplicate(theMesh); + setShowEntityMode(); + myGroup = SMESH::SMESH_Group::_nil(); + myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); + myGroupOnFilter = SMESH::SMESH_GroupOnFilter::_nil(); + + // NPAL19389: create a group with a selection in another group + // set actor of myMesh, if it is visible, else try + // any visible actor of group or submesh of myMesh + SetAppropriateActor(); + + setDefaultGroupColor(); + setDefaultName(); + + + SALOME_ListIO aList; + mySelectionMgr->selectedObjects( aList ); + if( !aList.IsEmpty() ) + { + QString aName = aList.First()->getName(); + myMeshGroupLine->setText(aName);//?????? + myMeshGroupLine->home( false ); + } + + myCurrentLineEdit = 0; + + myTypeGroup->button(0)->setChecked(true); + onTypeChanged(0); +} + +//================================================================================= +// function : Init() +// purpose : +//================================================================================= +void SMESHGUI_AdaptDlg::init (SMESH::SMESH_GroupBase_ptr theGroup) +{ + restoreShowEntityMode(); + myMesh = theGroup->GetMesh(); + setShowEntityMode(); + + myNameChanged = true; + myName->blockSignals(true); + myName->setText(SMESH::fromUtf8(theGroup->GetName())); + myName->blockSignals(false); + myName->home(false); + + SALOMEDS::Color aColor = theGroup->GetColor(); + setGroupColor( aColor ); + + myMeshGroupLine->setText(theGroup->GetName()); + + int aType = 0; + switch(theGroup->GetType()) { + case SMESH::NODE: aType = grpNodeSelection; break; + case SMESH::ELEM0D: aType = grp0DSelection; break; + case SMESH::BALL: aType = grpBallSelection; break; + case SMESH::EDGE: aType = grpEdgeSelection; break; + case SMESH::FACE: aType = grpFaceSelection; break; + case SMESH::VOLUME: aType = grpVolumeSelection; break; + case SMESH::ALL: + case SMESH::NB_ELEMENT_TYPES: break; + } + myTypeGroup->button(aType)->setChecked(true); + + myGroup = SMESH::SMESH_Group::_narrow( theGroup ); + myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_narrow( theGroup ); + myGroupOnFilter = SMESH::SMESH_GroupOnFilter::_narrow( theGroup ); + myFilter = SMESH::Filter::_nil(); + + if (myGroup->_is_nil() && myGroupOnGeom->_is_nil() && myGroupOnFilter->_is_nil() ) + return; + + // NPAL19389: create a group with a selection in another group + // set actor of myMesh, if it is visible, else set + // actor of theGroup, if it is visible, else try + // any visible actor of group or submesh of myMesh + // commented, because an attempt to set selection on not displayed cells leads to error + SetAppropriateActor(); + + /* SMESH_Actor* anActor = SMESH::FindActorByObject(myMesh); + if ( !anActor ) + anActor = SMESH::FindActorByObject(theGroup); + SMESH::SetPickable(anActor);*/ + int grpType = (!myGroup->_is_nil() ? 0 : (false ? 0 : myGroupOnGeom->_is_nil() ? 2 : 1)); + myGrpTypeGroup->button(grpType)->setChecked(true); + onGrpTypeChanged(grpType); + + myTypeId = aType; + if ( grpType == 0 ) { // standalone group + myCurrentLineEdit = 0; + myElements->clear(); + myAllowElemsModif->setChecked( true ); + + setSelectionMode(aType); + + setShowEntityMode(); // depends on myTypeId + + myIdList.clear(); + if (!theGroup->IsEmpty()) { + SMESH::long_array_var anElements = theGroup->GetListOfID(); + int k = anElements->length(); + for (int i = 0; i < k; i++) { + myIdList.append(anElements[i]); + myElements->addItem(QString::number(anElements[i])); + } + myElements->selectAll(); + } + } + else if ( grpType == 1 ) // group on geom + { + QString aShapeName( "" ); + _PTR(Study) aStudy = SMESH::getStudy(); + GEOM::GEOM_Object_var aGroupShape = myGroupOnGeom->GetShape(); + if (!aGroupShape->_is_nil()) + { + _PTR(SObject) aGroupShapeSO = aStudy->FindObjectID(aGroupShape->GetStudyEntry()); + if ( aGroupShapeSO ) + aShapeName = aGroupShapeSO->GetName().c_str(); + } + myGeomGroupLine->setText( aShapeName ); + } + else // group on filter + { + myFilter = myGroupOnFilter->GetFilter(); + if ( !myFilter->_is_nil() ) { + SMESH::Predicate_var perdicate = myFilter->GetPredicate(); + if ( perdicate->_is_nil() ) + myFilter = SMESH::Filter::_nil(); + } + } + + if ( grpType != 0 ) + { + myNameChanged = true; + myName->blockSignals(true); + myName->setText(theGroup->GetName()); + myName->blockSignals(false); + } + + onSelectAll(); //updateButtons(); +} + +//================================================================================= +// function : updateButtons() +// purpose : +//================================================================================= +void SMESHGUI_AdaptDlg::updateButtons() +{ + bool enable = !myName->text().trimmed().isEmpty(); + if ( enable ) + { + if (myGrpTypeId == 0) { // standalone + if ( !mySelectAll->isChecked() ) + { + if ( myAllowElemsModif->isChecked() ) + { + enable = ( myElements->count() > 0 ); + } + else if ((enable = !myFilter->_is_nil() )) + { + SMESH::array_of_ElementType_var types = myFilter->GetTypes(); + enable = types->length(); + } + } + enable = enable && (!myGroup->_is_nil() || !myMesh->_is_nil()); + } + else if (myGrpTypeId == 1) // on geom + { + if (CORBA::is_nil(myGroupOnGeom)) // creation mode + enable = ( myGeomObjects->length() > 0 && !myMesh->_is_nil() ); + } + else if (myGrpTypeId == 2) // on filter + { + if (( enable = !myFilter->_is_nil() )) + if (CORBA::is_nil(myGroupOnFilter) ) // creation mode + enable = !myMesh->_is_nil(); + } + } + + bool meshHasGeom = ( myMesh->_is_nil() || myMesh->HasShapeToMesh() ); + if ( myGrpTypeId != 1 ) + { + myGrpTypeGroup->button(1)->setEnabled( meshHasGeom ); + } + else + { + myGeomGroupBtn->setEnabled( meshHasGeom ); + myGeomGroupLine->setEnabled( meshHasGeom ); + } + + myOKBtn->setEnabled(enable); + myApplyBtn->setEnabled(enable); +} + +//================================================================================= +// function : onNameChanged() +// purpose : +//================================================================================= +void SMESHGUI_AdaptDlg::onNameChanged (const QString& text) +{ + myOldName = myName->text(); + updateButtons(); + myNameChanged = !myName->text().trimmed().isEmpty(); +} + +//================================================================================= +// function : onTypeChanged() +// purpose : Group elements type radio button management +//================================================================================= +void SMESHGUI_AdaptDlg::onTypeChanged (int id) +{ + if (myTypeId != id) { + myElements->clear(); + myTypeId = id; + if ( myGrpTypeId == 0 && myCurrentLineEdit == 0) + setSelectionMode(id); + else + setSelectionMode( mySelectionMode++ ); // update according to mySelectionMode + + onObjectSelectionChanged(); + setShowEntityMode(); + } +} + +//================================================================================= +// function : onGrpTypeChanged() +// purpose : Group type radio button management +//================================================================================= +void SMESHGUI_AdaptDlg::onGrpTypeChanged (int id) +{ + if (myGrpTypeId != id) { + myGrpTypeId = id; + myWGStack->setCurrentIndex( id ); + myName->blockSignals(true); + myName->setText(myOldName); + myName->blockSignals(false); + onSelectGeomGroup(id != 0); + } + updateButtons(); +} + +//================================================================================= +// function : onColorChanged() +// purpose : Color button management +//================================================================================= +void SMESHGUI_AdaptDlg::onColorChanged(QColor theColor) +{ + updateButtons(); +} + +//================================================================================= +// function : setSelectionMode() +// purpose : Radio button management +//================================================================================= +void SMESHGUI_AdaptDlg::setSelectionMode (int theMode) +{ + // PAL7314 + if (myMesh->_is_nil()) + return; + SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ); + bool isSelectAll = mySelectAll->isChecked() || !myAllowElemsModif->isChecked() || myGrpTypeId != 0; + if (mySelectionMode != theMode) { + // [PAL10408] mySelectionMgr->clearSelected(); + mySelectionMgr->clearFilters(); + SMESH::RemoveFilters(); + + if (myActorsList.count() > 0) + for (QListIterator it( myActorsList ); it.hasNext(); ) + it.next()->SetPointRepresentation(false); + else + SMESH::SetPointRepresentation(false); + + switch (theMode) { + case grpNodeSelection: + if ( myGrpTypeId == 0 ) // standalone + { + if (myActorsList.count() > 0) + for (QListIterator it( myActorsList ); it.hasNext(); ) + it.next()->SetPointRepresentation(true); + else + SMESH::SetPointRepresentation(true); + } + if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : NodeSelection); + break; + case grpEdgeSelection: + if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : EdgeSelection); + break; + case grpBallSelection: + if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : BallSelection); + break; + case grp0DSelection: + if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : Elem0DSelection); + break; + case grpFaceSelection: + if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : FaceSelection); + break; + case grpVolumeSelection: + if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : VolumeSelection); + break; + case grpSubMeshSelection: { + + SMESH_TypeFilter* f = 0; + switch (myTypeId) { + case grpNodeSelection: f = new SMESH_TypeFilter(SMESH::SUBMESH); break; + case grpEdgeSelection: f = new SMESH_TypeFilter(SMESH::SUBMESH_EDGE); break; + case grpFaceSelection: f = new SMESH_TypeFilter(SMESH::SUBMESH_FACE); break; + case grpVolumeSelection: f = new SMESH_TypeFilter(SMESH::SUBMESH_SOLID); break; + default: f = new SMESH_TypeFilter(SMESH::SUBMESH); + } + QList filtList; + filtList.append( f ); + filtList.append( new SMESH_TypeFilter(SMESH::SUBMESH_COMPOUND)); + mySubMeshFilter->setFilters( filtList ); + + mySelectionMgr->installFilter( mySubMeshFilter ); + + if ( aViewWindow ) aViewWindow->SetSelectionMode(ActorSelection); + break; + } + case grpGroupSelection: { + + SMESH_TypeFilter* f = 0; + switch (myTypeId) { + case grpNodeSelection: f = new SMESH_TypeFilter(SMESH::GROUP_NODE); break; + case grp0DSelection: f = new SMESH_TypeFilter(SMESH::GROUP_0D); break; + case grpBallSelection: f = new SMESH_TypeFilter(SMESH::GROUP_BALL); break; + case grpEdgeSelection: f = new SMESH_TypeFilter(SMESH::GROUP_EDGE); break; + case grpFaceSelection: f = new SMESH_TypeFilter(SMESH::GROUP_FACE); break; + case grpVolumeSelection: f = new SMESH_TypeFilter(SMESH::GROUP_VOLUME); break; + default: f = new SMESH_TypeFilter(SMESH::GROUP); + } + QList filtList; + filtList.append( f ); + myGroupFilter->setFilters( filtList ); + + mySelectionMgr->installFilter(myGroupFilter); + if ( aViewWindow ) aViewWindow->SetSelectionMode(ActorSelection); + break; + } + case grpMeshSelection: + mySelectionMgr->installFilter(myMeshFilter); + if ( aViewWindow ) aViewWindow->SetSelectionMode(ActorSelection); + break; + case grpGeomSelection: + mySelectionMgr->installFilter(myGeomFilter); + if ( aViewWindow ) aViewWindow->SetSelectionMode(ActorSelection); + break; + default: + if ( aViewWindow ) aViewWindow->SetSelectionMode(ActorSelection); + break; + } + if ( aViewWindow ) aViewWindow->Repaint(); + mySelectionMode = theMode; + } +} + +//================================================================================= +// function : onApply() +// purpose : +//================================================================================= +bool SMESHGUI_AdaptDlg::onApply() +{ + if (SMESHGUI::isStudyLocked()) + return false; + + if (myName->text().trimmed().isEmpty()) + return false; + + SMESH::ElementType aType = SMESH::ALL; + switch (myTypeId) { + case grpNodeSelection: aType = SMESH::NODE; break; + case grp0DSelection: aType = SMESH::ELEM0D; break; + case grpBallSelection: aType = SMESH::BALL; break; + case grpEdgeSelection: aType = SMESH::EDGE; break; + case grpFaceSelection: aType = SMESH::FACE; break; + case grpVolumeSelection: aType = SMESH::VOLUME; break; + } + + bool anIsOk = false; + QStringList anEntryList; + + SMESH::SMESH_GroupBase_var resultGroup; + bool isCreation = false, isConversion = false; + + SUIT_OverrideCursor wc; + + if (myGrpTypeId == 0) // standalone + { + if (!mySelectAll->isChecked() && !myElements->count() && myAllowElemsModif->isChecked()) + return false; + + mySelectionMgr->clearSelected(); + + if (myGroup->_is_nil()) { // creation or conversion + // check if group on geometry is not null + if (!myGroupOnGeom->_is_nil() || !myGroupOnFilter->_is_nil()) { + if (myMesh->_is_nil()) + return false; + if ( myGroupOnGeom->_is_nil() ) + myGroup = myMesh->ConvertToStandalone( myGroupOnFilter ); + else + myGroup = myMesh->ConvertToStandalone( myGroupOnGeom ); + + myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); + myGroupOnFilter = SMESH::SMESH_GroupOnFilter::_nil(); + isConversion = true; + } + } + + if (myGroup->_is_nil()) { // creation + if (myMesh->_is_nil()) + return false; + + myGroup = SMESH::AddGroup(myMesh, aType, myName->text()); + + resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroup ); + isCreation = true; + + if ( mySelectAll->isChecked() ) { + // select all + myGroup->AddFrom(myMesh.in()); + } + else { + // select manually + + if ( !myFilter->_is_nil() && + ( myNbChangesOfContents == 1 || !myAllowElemsModif->isChecked())) + { + myGroup->AddFrom( myFilter ); + } + else + { + SMESH::long_array_var anIdList = new SMESH::long_array; + int i, k = myElements->count(); + anIdList->length(k); + for (i = 0; i < k; i++) { + anIdList[i] = myElements->item(i)->text().toInt(); + } + myGroup->Add(anIdList.inout()); + } + } + + + } else { // edition + + resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroup ); + isCreation = false; + + if ( mySelectAll->isChecked() ) { + // select all + myGroup->Clear(); + myGroup->AddFrom(myMesh.in()); + } + else { + QList aAddList; + + int i, total = myElements->count(); + for (i = 0; i < total; i++) { + int anId = myElements->item(i)->text().toInt(); + int idx = myIdList.indexOf(anId); + if ( idx == -1 ) + aAddList.append(anId); + else + myIdList.removeAt(idx); + } + if (!aAddList.empty()) { + SMESH::long_array_var anIdList = new SMESH::long_array; + int added = aAddList.count(); + anIdList->length(added); + for (i = 0; i < added; i++) + anIdList[i] = aAddList[i]; + myGroup->Add(anIdList.inout()); + } + if (!myIdList.empty()) { + SMESH::long_array_var anIdList = new SMESH::long_array; + int removed = myIdList.count(); + anIdList->length(removed); + for (i = 0; i < removed; i++) + anIdList[i] = myIdList[i]; + myGroup->Remove(anIdList.inout()); + } + /* init for next operation */ + myIdList.clear(); + for (i = 0; i < total; i++) { + myIdList.append(myElements->item(i)->text().toInt()); + } + } + } + + anIsOk = true; + } + else if (myGrpTypeId == 1) // on geom object + { + if (CORBA::is_nil(myGroupOnGeom)) { // creation + if (myMesh->_is_nil() || !myGeomObjects->length()) + return false; + + _PTR(Study) aStudy = SMESH::getStudy(); + + if (myGeomObjects->length() == 1) { + myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType, + myName->text().toUtf8(), + myGeomObjects[0]); + } + else { + SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen(); + if ( aSMESHGen->_is_nil() || myGeomObjects->length() == 0 ) + return false; + + // create a geometry group + GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen( myGeomObjects[0] ); + if (geomGen->_is_nil()) + return false; + + GEOM::GEOM_IGroupOperations_wrap op = geomGen->GetIGroupOperations(); + if (op->_is_nil()) + return false; + + // check and add all selected GEOM objects: they must be + // a sub-shapes of the main GEOM and must be of one type + TopAbs_ShapeEnum aGroupType = TopAbs_SHAPE; + for ( CORBA::ULong i =0; i < myGeomObjects->length(); i++) + { + TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)myGeomObjects[i]->GetShapeType(); + if ( i == 0 ) + aGroupType = aSubShapeType; + else if ( aSubShapeType != aGroupType ) { + aGroupType = TopAbs_SHAPE; + break; + } + } + + GEOM::GEOM_Object_var aMeshShape = myMesh->GetShapeToMesh(); + GEOM::GEOM_Object_wrap aGroupVar = op->CreateGroup(aMeshShape, aGroupType); + if ( aGroupVar->_is_nil() ) + return false; + op->UnionList(aGroupVar, myGeomObjects); + + if (op->IsDone()) { + // publish the GEOM group in study + QString aNewGeomGroupName ( "Auto_group_for_" ); + aNewGeomGroupName += myName->text(); + SALOMEDS::SObject_var aNewGroupSO = + geomGen->AddInStudy(aGroupVar, + aNewGeomGroupName.toUtf8(), aMeshShape); + } + + myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType, + myName->text().toUtf8(), + aGroupVar); + } + resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnGeom ); + isCreation = true; + + } + else { // edition + + resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnGeom ); + isCreation = false; + } + anIsOk = true; + } + if (myGrpTypeId == 2) // group on filter + { + if ( myFilter->_is_nil() ) return false; + + if (CORBA::is_nil(myGroupOnFilter)) // creation + { + if (myMesh->_is_nil()) + return false; + + myGroupOnFilter = myMesh->CreateGroupFromFilter(aType, + myName->text().toUtf8(), + myFilter); + resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnFilter ); + isCreation = true; + } + else + { + myGroupOnFilter->SetFilter( myFilter ); + + resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnFilter ); + isCreation = false; + } + anIsOk = true; + } + + if ( anIsOk ) + { + SALOMEDS::Color aColor = getGroupColor(); + resultGroup->SetColor(aColor); + + _PTR(SObject) aMeshGroupSO = SMESH::FindSObject( resultGroup ); + if( aMeshGroupSO ) + anEntryList.append( aMeshGroupSO->GetID().c_str() ); + + resultGroup->SetName(myName->text().trimmed().toUtf8()); + + if ( isCreation ) + { + SMESH::setFileType ( aMeshGroupSO, "COULEURGROUP" ); + + /* init for the next operation */ + setDefaultName(); + myElements->clear(); + myGroup = SMESH::SMESH_Group::_nil(); + myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); + myGroupOnFilter = SMESH::SMESH_GroupOnFilter::_nil(); + myFilter = SMESH::Filter::_nil(); + + setDefaultGroupColor(); // reset color for case if 'auto-color' feature is enabled. + } + else + { + if ( aMeshGroupSO ) + { + if ( SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) + { + Handle(SALOME_InteractiveObject) anIO = anActor->getIO(); + if ( isConversion ) { // need to reset TVisualObj and actor + SMESH::RemoveVisualObjectWithActors( anIO->getEntry(), true ); + SMESH::Update( anIO,true); + myActorsList.clear(); + anActor = SMESH::FindActorByEntry( anIO->getEntry() ); + if ( !anActor ) return false; + myActorsList.append( anActor ); + } + anActor->setName(myName->text().toUtf8()); + QColor c; + int delta; + switch ( myTypeId ) { + case grpNodeSelection: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break; + case grp0DSelection: anActor->Set0DColor ( aColor.R, aColor.G, aColor.B ); break; + case grpBallSelection: anActor->SetBallColor( aColor.R, aColor.G, aColor.B ); break; + case grpEdgeSelection: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break; + case grpVolumeSelection: + SMESH::GetColor("SMESH", "volume_color", c , delta, "255,0,170|-100"); + anActor->SetVolumeColor( aColor.R, aColor.G, aColor.B, delta ); break; + break; + case grpFaceSelection: + default: + SMESH::GetColor("SMESH", "fill_color", c , delta, "0,170,255|-100"); + anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B, delta ); break; + break; + } + // update a visible group according to a changed contents + if ( !isConversion && anActor->GetVisibility() ) + { + SMESH::Update( anIO, true ); + SMESH::RepaintCurrentView(); + } + } + } + } + SMESHGUI::Modified(); + mySMESHGUI->updateObjBrowser(true); + mySelectionMgr->clearSelected(); + + if( LightApp_Application* anApp = + dynamic_cast( SUIT_Session::session()->activeApplication() ) ) + myObjectToSelect = anApp->browseObjects( anEntryList, isApplyAndClose() ); + } + return anIsOk; +} + +//================================================================================= +// function : onOK() +// purpose : +//================================================================================= +void SMESHGUI_AdaptDlg::onOK() +{ + setIsApplyAndClose( true ); + if ( onApply() ) + reject(); + setIsApplyAndClose( false ); + + if ( myFilterDlg ) myFilterDlg->UnRegisterFilters(); +} + +//================================================================================= +// function : onListSelectionChanged() +// purpose : Called when selection in element list is changed +//================================================================================= +void SMESHGUI_AdaptDlg::onListSelectionChanged() +{ + //MESSAGE( "SMESHGUI_AdaptDlg::onListSelectionChanged(); myActorsList.count() = " << myActorsList.count()); + if( myIsBusy || myActorsList.count() == 0 ) return; + myIsBusy = true; + + if (myCurrentLineEdit == 0) { + mySelectionMgr->clearSelected(); + TColStd_MapOfInteger aIndexes; + QList selItems = myElements->selectedItems(); + QListWidgetItem* anItem; + foreach(anItem, selItems) aIndexes.Add(anItem->text().toInt()); + mySelector->AddOrRemoveIndex(myActorsList.first()->getIO(), aIndexes, false); + SALOME_ListIO aList; + aList.Append(myActorsList.first()->getIO()); + mySelectionMgr->setSelectedObjects(aList,false); + } + myIsBusy = false; +} + +//================================================================================= +// function : onObjectSelectionChanged() +// purpose : Called when selection in 3D view or ObjectBrowser is changed +//================================================================================= +void SMESHGUI_AdaptDlg::onObjectSelectionChanged() +{ + if ( myIsBusy || !isEnabled()) return; + if (myCurrentLineEdit == myGeomGroupLine && !myGeomGroupBtn->isChecked()) return; + + myIsBusy = true; + + SALOME_ListIO aList; + mySelectionMgr->selectedObjects( aList ); + + int aNbSel = aList.Extent(); + myElements->clearSelection(); + + if (myCurrentLineEdit) + { + myCurrentLineEdit->setText( "" ); + QString aString = ""; + + if (myCurrentLineEdit == myMeshGroupLine) + { + mySelectSubMesh->setEnabled(false); + mySelectGroup->setEnabled(false); + myGroupLine->setText( "" ); + mySubMeshLine->setText( "" ); + + myGeomGroupBtn->setEnabled(false); + myGeomGroupLine->setEnabled(false); + myGeomGroupLine->setText( "" ); + myGeomObjects = new GEOM::ListOfGO(); + myGeomObjects->length(0); + + if (myGeomGroupBtn->isChecked()) + myGeomGroupBtn->setChecked(false); + if (!myCreate) + myName->setText( "" ); + + myElements->clear(); + + if (aNbSel != 1 ) { + myGroup = SMESH::SMESH_Group::_nil(); + myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); + restoreShowEntityMode(); + myMesh = SMESH::SMESH_Mesh::_nil(); + updateGeomPopup(); + updateButtons(); + myIsBusy = false; + return; + } + Handle(SALOME_InteractiveObject) IO = aList.First(); + + if (myCreate) { + restoreShowEntityMode(); + myMesh = SMESH::IObjectToInterface(IO); + setShowEntityMode(); + updateGeomPopup(); + if (myMesh->_is_nil()) + { + updateButtons(); + myIsBusy = false; + return; + } + + if ( myFilterDlg && !myMesh->_is_nil()){ + myFilterDlg->SetMesh( myMesh ); + } + myGroup = SMESH::SMESH_Group::_nil(); + + // NPAL19389: create a group with a selection in another group + // set actor of myMesh, if it is visible, else try + // any visible actor of group or submesh of myMesh + SetAppropriateActor(); + + setDefaultGroupColor(); + if (myName->text().isEmpty()) + setDefaultName(); + + aString = aList.First()->getName(); + myMeshGroupLine->setText(aString); + myMeshGroupLine->home( false ); + + mySelectSubMesh->setEnabled(true); + mySelectGroup->setEnabled(true); + myGeomGroupBtn->setEnabled(true); + myGeomGroupLine->setEnabled(true); + updateButtons(); + } + else { + SMESH::SMESH_GroupBase_var aGroup = SMESH::IObjectToInterface(IO); + if (aGroup->_is_nil()) + { + myIsBusy = false; + return; + } + myIsBusy = false; + + myGroup = SMESH::SMESH_Group::_nil(); + myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); + + init(aGroup); + myIsBusy = true; + mySelectSubMesh->setEnabled(true); + mySelectGroup->setEnabled(true); + } + myCurrentLineEdit = 0; + myIsBusy = false; + if (!myCreate) + return; + + if (myGrpTypeId == 0) + { + if (myTypeId == -1) + onTypeChanged(0); + else + { + myElements->clear(); + setSelectionMode(myTypeId); + } + } + + myIsBusy = false; + return; + + } + else if (myCurrentLineEdit == myGeomGroupLine) + { + myGeomObjects = new GEOM::ListOfGO(); + + // The mesh SObject + _PTR(SObject) aMeshSO = SMESH::FindSObject(myMesh); + + if (aNbSel == 0 || !aMeshSO) + { + myGeomObjects->length(0); + updateButtons(); + myIsBusy = false; + return; + } + + myGeomObjects->length(aNbSel); + + GEOM::GEOM_Object_var aGeomGroup; + int i = 0; + + SALOME_ListIteratorOfListIO anIt (aList); + for (; anIt.More(); anIt.Next()) + { + aGeomGroup = GEOMBase::ConvertIOinGEOMObject(anIt.Value()); + + // Check if the object is a geometry group + if (CORBA::is_nil(aGeomGroup)) + continue; + + // Check if group constructed on the same shape as a mesh or on its child + + // The main shape of the group + GEOM::GEOM_Object_var aGroupMainShape; + if (aGeomGroup->GetType() == 37) + { + GEOM::GEOM_IGroupOperations_wrap anOp = + SMESH::GetGEOMGen( aGeomGroup )->GetIGroupOperations(); + aGroupMainShape = anOp->GetMainShape( aGeomGroup ); + // aGroupMainShape is an existing servant => GEOM_Object_var not GEOM_Object_wrap + } + else + { + aGroupMainShape = aGeomGroup; + aGroupMainShape->Register(); + } + CORBA::String_var entry = aGroupMainShape->GetStudyEntry(); + _PTR(SObject) aGroupMainShapeSO = + SMESH::getStudy()->FindObjectID( entry.in() ); + + _PTR(SObject) anObj, aRef; + bool isRefOrSubShape = false; + if (aMeshSO->FindSubObject(1, anObj) && anObj->ReferencedObject(aRef)) { + if (aRef->GetID() == aGroupMainShapeSO->GetID()) { + isRefOrSubShape = true; + } else { + _PTR(SObject) aFather = aGroupMainShapeSO->GetFather(); + _PTR(SComponent) aComponent = aGroupMainShapeSO->GetFatherComponent(); + while (!isRefOrSubShape && aFather->GetID() != aComponent->GetID()) { + if (aRef->GetID() == aFather->GetID()) + isRefOrSubShape = true; + else + aFather = aFather->GetFather(); + } + } + } + if (isRefOrSubShape) + myGeomObjects[i++] = aGeomGroup; + } + + myGeomObjects->length(i); + if ( i == 0 ) + { + myIsBusy = false; + return; + } + + aNbSel = i; + } + + if (aNbSel >= 1) { + if (aNbSel > 1) { + if (myCurrentLineEdit == mySubMeshLine) + aString = tr( "SMESH_SUBMESH_SELECTED" ).arg(aNbSel); + else if (myCurrentLineEdit == myGroupLine) + aString = tr( "SMESH_GROUP_SELECTED" ).arg(aNbSel); + else if (myCurrentLineEdit == myGeomGroupLine) + aString = tr( "%1 Objects" ).arg(aNbSel); + } + else { + aString = aList.First()->getName(); + } + } + + myCurrentLineEdit->setText(aString); + myCurrentLineEdit->home(false); + // 07.06.2008 skl for IPAL19574: + // change name of group only if it is empty + if( myName->text().trimmed().isEmpty() || !myNameChanged ) { + myOldName = myName->text(); + myName->blockSignals(true); + myName->setText(aString); + myName->blockSignals(false); + } + + updateButtons(); + } + else // !myCurrentLineEdit: local selection of nodes or elements + { + if (aNbSel == 1 && myActorsList.count() > 0 ) + { + // NPAL19389: create a group with a selection in another group + // Switch myActor to the newly selected one, if the last + // is visible and belongs to group or submesh of myMesh + /* Handle(SALOME_InteractiveObject) curIO = myActor->getIO(); + Handle(SALOME_InteractiveObject) selIO = aList.First(); + if (curIO->hasEntry() && selIO->hasEntry()) { + const char* selEntry = selIO->getEntry(); + if (strcmp(curIO->getEntry(), selEntry) != 0) { + // different objects: selected and myActor + SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView(); + if (aViewWindow && aViewWindow->isVisible(selIO)) { + // newly selected actor is visible + + // mesh entry + _PTR(SObject) aSObject = SMESH::FindSObject(myMesh); + if (aSObject) { + CORBA::String_var meshEntry = aSObject->GetID().c_str(); + int len = strlen(meshEntry); + + if (strncmp(selEntry, meshEntry, len) == 0) { + // selected object is myMesh or a part of it + SMESH_Actor* anActor = SMESH::FindActorByEntry(selEntry); + if (anActor) { + myActor = anActor; + SMESH::SetPickable(myActor); + } + } + } + } + } + }*/ + // NPAL19389 END + + QString aListStr = ""; + int aNbItems = 0; + if (myTypeId == 0) { + QListIterator it( myActorsList ); + while ( it.hasNext() ) { + QString tmpStr; + aNbItems += SMESH::GetNameOfSelectedNodes(mySelector, it.next()->getIO(), tmpStr); + aListStr += tmpStr; + } + } else { + QListIterator it( myActorsList ); + while ( it.hasNext() ) { + QString tmpStr; + aNbItems += SMESH::GetNameOfSelectedElements(mySelector, it.next()->getIO(), tmpStr); + aListStr += tmpStr; + } + } + if (aNbItems > 0) { + QListWidgetItem* anItem; + QList listItemsToSel; + QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts); + for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) { + QList found = myElements->findItems(*it, Qt::MatchExactly); + foreach(anItem, found) + if (!anItem->isSelected()) + listItemsToSel.push_back(anItem); + } + bool blocked = myElements->signalsBlocked(); + myElements->blockSignals(true); + foreach(anItem, listItemsToSel) anItem->setSelected(true); + myElements->blockSignals(blocked); + onListSelectionChanged(); + listItemsToSel.clear(); + } + } + } + + if (myActorsList.count() == 0) { + if (!myGroup->_is_nil()) { + SMESH_Actor* anActor = SMESH::FindActorByObject(myGroup); + if ( anActor ) + myActorsList.append( anActor ); + } + else if(!myGroupOnGeom->_is_nil()) { + SMESH_Actor* anActor = SMESH::FindActorByObject(myGroupOnGeom); + if ( anActor ) + myActorsList.append( anActor ); + } + else { + SMESH_Actor* anActor = SMESH::FindActorByObject( myMesh ); + if ( anActor ) + myActorsList.append( anActor ); + } + } + + // somehow, if we display the mesh, while selecting from another actor, + // the mesh becomes pickable, and there is no way to select any element + if (myActorsList.count() > 0) { + QListIterator it( myActorsList ); + while ( it.hasNext() ) { + SMESH_Actor* anActor = it.next(); + if ( IsActorVisible(anActor) ) + anActor->SetPickable(true); + } + } + + myIsBusy = false; +} + +//================================================================================= +// function : onSelectAll() +// purpose : Called when "Select all" is checked +//================================================================================= +void SMESHGUI_AdaptDlg::onSelectAll() +{ + bool noElemsModif = ( mySelectAll->isChecked() || !myAllowElemsModif->isChecked() ); + + myElementsLab->setEnabled( !noElemsModif ); + myElements->setEnabled ( !noElemsModif ); + myFilterBtn->setEnabled ( !noElemsModif ); + myAddBtn->setEnabled ( !noElemsModif ); + myRemoveBtn->setEnabled ( !noElemsModif ); + mySortBtn->setEnabled ( !noElemsModif ); + mySelectBox->setEnabled ( !noElemsModif ); + myAllowElemsModif->setEnabled( !mySelectAll->isChecked() ); + if ( noElemsModif ) mySMESHGUI->ResetState(); + else mySMESHGUI->SetState(800); + + int selMode = mySelectionMode; + mySelectionMode = grpNoSelection; + setSelectionMode( selMode ); + updateButtons(); +} + +//================================================================================= +// function : onSelectSubMesh() +// purpose : Called when selection in 3D view or ObjectBrowser is changed +//================================================================================= +void SMESHGUI_AdaptDlg::onSelectSubMesh(bool on) +{ + if (on) { + if (mySelectGroup->isChecked()) { + mySelectGroup->setChecked(false); + } + //VSR: else if (mySelectGeomGroup->isChecked()) { + //VSR: mySelectGeomGroup->setChecked(false); + //VSR: } + myCurrentLineEdit = mySubMeshLine; + setSelectionMode(grpSubMeshSelection); + } + else { + mySubMeshLine->setText( "" ); + myCurrentLineEdit = 0; + if (myTypeId != -1) + setSelectionMode(myTypeId); + } + mySubMeshBtn->setEnabled(on); + mySubMeshLine->setEnabled(on); +} + + +//================================================================================= +// function : (onSelectGroup) +// purpose : Called when selection in 3D view or ObjectBrowser is changed +//================================================================================= +void SMESHGUI_AdaptDlg::onSelectGroup(bool on) +{ + if (on) { + if (mySelectSubMesh->isChecked()) { + mySelectSubMesh->setChecked(false); + } + myCurrentLineEdit = myGroupLine; + setSelectionMode(grpGroupSelection); + } + else { + myGroupLine->setText( "" ); + myCurrentLineEdit = 0; + if (myTypeId != -1) + setSelectionMode(myTypeId); + } + myGroupBtn->setEnabled(on); + myGroupLine->setEnabled(on); +} + + +//================================================================================= +// function : (onSelectGeomGroup) +// purpose : Called when group type changed. on == "on geometry" or "on filter" +//================================================================================= +void SMESHGUI_AdaptDlg::onSelectGeomGroup(bool on) +{ + if (on) { + if (mySelectSubMesh->isChecked()) { + mySelectSubMesh->setChecked(false); + } + else if (mySelectGroup->isChecked()) { + mySelectGroup->setChecked(false); + } + if ( myGrpTypeId == 1 ) { // on geometry + myCurrentLineEdit = myGeomGroupLine; + updateGeomPopup(); + } + else { // on filter + myCurrentLineEdit = 0; + } + setSelectionMode(grpAllSelection); + } + else { + myGeomGroupBtn->setChecked(false); + myGeomObjects->length(0); + myGeomGroupLine->setText( "" ); + myCurrentLineEdit = 0; + if (myTypeId != -1) + setSelectionMode( myTypeId ); + } +} + +//================================================================================= +// function : setCurrentSelection() +// purpose : +//================================================================================= +void SMESHGUI_AdaptDlg::setCurrentSelection() +{ + QPushButton* send = (QPushButton*)sender(); + myCurrentLineEdit = 0; + if (send == myMeshGroupBtn) { + disconnect(myMeshGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection())); + mySelectionMgr->clearSelected(); + if (myCreate) + setSelectionMode(grpMeshSelection); + else + setSelectionMode(grpGroupSelection); + connect(myMeshGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection())); + myCurrentLineEdit = myMeshGroupLine; + onObjectSelectionChanged(); + } + else if (send == mySubMeshBtn) { + myCurrentLineEdit = mySubMeshLine; + onObjectSelectionChanged(); + } + else if (send == myGroupBtn) { + myCurrentLineEdit = myGroupLine; + onObjectSelectionChanged(); + } +} + + +//================================================================================= +// function : setFilters() +// purpose : SLOT. Called when "Filter" button pressed. +//================================================================================= +void SMESHGUI_AdaptDlg::setFilters() +{ + if(myMesh->_is_nil()) { + SUIT_MessageBox::critical(this, + tr("SMESH_ERROR"), + tr("NO_MESH_SELECTED")); + return; + } + + SMESH::ElementType aType = SMESH::ALL; + switch ( myTypeId ) + { + case grpNodeSelection: aType = SMESH::NODE; break; + case grp0DSelection: aType = SMESH::ELEM0D; break; + case grpBallSelection: aType = SMESH::BALL; break; + case grpEdgeSelection: aType = SMESH::EDGE; break; + case grpFaceSelection: aType = SMESH::FACE; break; + case grpVolumeSelection: aType = SMESH::VOLUME; break; + default: return; + } + + if ( myFilterDlg == 0 ) + { + myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, aType ); + connect( myFilterDlg, SIGNAL( Accepted() ), SLOT( onFilterAccepted() ) ); + } + else + myFilterDlg->Init( aType ); + + if ( !myGroupOnFilter->_is_nil() ) + { + myFilterDlg->SetFilter( myFilter, aType ); + myFilterDlg->Init( aType ); + } + + bool isStandalone = ( sender() == myFilterBtn ); + myFilterDlg->SetEnabled( /*setInViewer=*/isStandalone, + /*diffSources=*/isStandalone ); + myFilterDlg->SetMesh( myMesh ); + myFilterDlg->SetGroup( myGroupOnFilter ); + myFilterDlg->SetSelection(); + myFilterDlg->SetSourceWg( myElements, false ); + + myFilterDlg->show(); +} + +//================================================================================= +// function : onFilterAccepted() +// purpose : SLOT. Called when Filter dlg closed with OK button. +// Uncheck "Select submesh" and "Select group" checkboxes +//================================================================================= +void SMESHGUI_AdaptDlg::onFilterAccepted() +{ + if ( mySelectSubMesh->isChecked() || mySelectGroup->isChecked() ) + { + mySelectionMode = myTypeId; + mySelectSubMesh->setChecked( false ); + mySelectGroup->setChecked( false ); + } + // get a filter from myFilterDlg + myFilter = myFilterDlg->GetFilter(); + if ( !myFilter->_is_nil() ) { + SMESH::Predicate_var perdicate = myFilter->GetPredicate(); + if ( perdicate->_is_nil() ) + myFilter = SMESH::Filter::_nil(); + } + // set mesh to myFilter + if ( !myFilter->_is_nil() ) { + SMESH::SMESH_Mesh_var mesh = myMesh; + if ( mesh->_is_nil() ) { + if ( !myGroup->_is_nil() ) + mesh = myGroup->GetMesh(); + else if ( !myGroupOnGeom->_is_nil() ) + mesh = myGroupOnGeom->GetMesh(); + else if ( !myGroupOnFilter->_is_nil() ) + mesh = myGroupOnFilter->GetMesh(); + } + myFilter->SetMesh( mesh ); + + // highlight ids if selection changed in the Viewer (IPAL52924) + myCurrentLineEdit = 0; + onObjectSelectionChanged(); + } + + updateButtons(); +} + +//================================================================================= +// function : onAdd() +// purpose : +//================================================================================= +void SMESHGUI_AdaptDlg::onAdd() +{ + SALOME_ListIO aList; + mySelectionMgr->selectedObjects( aList ); + + int aNbSel = aList.Extent(); + + if (aNbSel == 0 || myActorsList.count() == 0 || myMesh->_is_nil()) return; + + SUIT_OverrideCursor wc; + + myIsBusy = true; + int sizeBefore = myElements->count(); + + SMESH::ElementType aType = SMESH::ALL; + switch(myTypeId) { + case grpNodeSelection: + aType = SMESH::NODE; + mySelector->SetSelectionMode(NodeSelection); + break; + case grpBallSelection: + aType = SMESH::BALL; + mySelector->SetSelectionMode(BallSelection); + break; + case grp0DSelection: + aType = SMESH::ELEM0D; + mySelector->SetSelectionMode(Elem0DSelection); + break; + case grpEdgeSelection: + aType = SMESH::EDGE; + mySelector->SetSelectionMode(EdgeSelection); + break; + case grpFaceSelection: + aType = SMESH::FACE; + mySelector->SetSelectionMode(FaceSelection); + break; + case grpVolumeSelection: + aType = SMESH::VOLUME; + mySelector->SetSelectionMode(VolumeSelection); + break; + default: + mySelector->SetSelectionMode(ActorSelection); + } + + QListWidgetItem* anItem = 0; + QList listItemsToSel; + + if ( myCurrentLineEdit == 0 ) + { + //if (aNbSel != 1) { myIsBusy = false; return; } + QString aListStr = ""; + int aNbItems = 0; + if (myTypeId == 0) { + QListIterator it( myActorsList ); + while ( it.hasNext() ) { + QString tmpStr; + aNbItems += SMESH::GetNameOfSelectedNodes(mySelector, it.next()->getIO(), tmpStr); + aListStr += tmpStr; + } + } + else { + QListIterator it( myActorsList ); + while ( it.hasNext() ) { + QString tmpStr; + aNbItems += SMESH::GetNameOfSelectedElements(mySelector, it.next()->getIO(), tmpStr); + aListStr += tmpStr; + } + } + if (aNbItems > 0) { + QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts); + for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) { + QList found = myElements->findItems(*it, Qt::MatchExactly); + if (found.count() == 0) { + anItem = new QListWidgetItem(*it); + myElements->addItem(anItem); + if (!anItem->isSelected()) + listItemsToSel.push_back(anItem); + } + else { + foreach(anItem, found) + if (!anItem->isSelected()) + listItemsToSel.push_back(anItem); + } + } + bool blocked = myElements->signalsBlocked(); + myElements->blockSignals(true); + foreach(anItem, listItemsToSel) anItem->setSelected(true); + myElements->blockSignals(blocked); + onListSelectionChanged(); + listItemsToSel.clear(); + } + } + else if ( myCurrentLineEdit == mySubMeshLine ) + { + //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects()); + + SALOME_ListIO aList; + mySelectionMgr->selectedObjects( aList ); + + SALOME_ListIteratorOfListIO anIt (aList); + for ( ; anIt.More(); anIt.Next()) { + SMESH::SMESH_subMesh_var aSubMesh = + SMESH::IObjectToInterface(anIt.Value()); + if (!aSubMesh->_is_nil()) { + // check if mesh is the same + if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) { + try { + SMESH::long_array_var anElements = aSubMesh->GetElementsByType(aType); + int k = anElements->length(); + for (int i = 0; i < k; i++) { + QString aText = QString::number(anElements[i]); + QList found = myElements->findItems(aText, Qt::MatchExactly); + if (found.count() == 0) { + anItem = new QListWidgetItem(aText); + myElements->addItem(anItem); + if (!anItem->isSelected()) + listItemsToSel.push_back(anItem); + } + else { + foreach(anItem, found) + if (!anItem->isSelected()) + listItemsToSel.push_back(anItem); + } + } + bool blocked = myElements->signalsBlocked(); + myElements->blockSignals(true); + foreach(anItem, listItemsToSel) anItem->setSelected(true); + myElements->blockSignals(blocked); + onListSelectionChanged(); + listItemsToSel.clear(); + } + catch (const SALOME::SALOME_Exception& ex) { + SalomeApp_Tools::QtCatchCorbaException(ex); + } + } + } + } + mySelectSubMesh->setChecked(false); + myIsBusy = false; + onListSelectionChanged(); + + } + else if ( myCurrentLineEdit == myGroupLine ) + { + //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects()); + SALOME_ListIO aList; + mySelectionMgr->selectedObjects( aList ); + + SALOME_ListIteratorOfListIO anIt (aList); + for ( ; anIt.More(); anIt.Next()) { + SMESH::SMESH_GroupBase_var aGroup = + SMESH::IObjectToInterface(anIt.Value()); + if (!aGroup->_is_nil()) { + // check if mesh is the same + if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) { + SMESH::long_array_var anElements = aGroup->GetListOfID(); + int k = anElements->length(); + for (int i = 0; i < k; i++) { + QString aText = QString::number(anElements[i]); + QList found = myElements->findItems(aText, Qt::MatchExactly); + if (found.count() == 0) { + anItem = new QListWidgetItem(aText); + myElements->addItem(anItem); + if (!anItem->isSelected()) + listItemsToSel.push_back(anItem); + } + else { + foreach(anItem, found) + if (!anItem->isSelected()) + listItemsToSel.push_back(anItem); + } + } + bool blocked = myElements->signalsBlocked(); + myElements->blockSignals(true); + foreach(anItem, listItemsToSel) anItem->setSelected(true); + myElements->blockSignals(blocked); + onListSelectionChanged(); + listItemsToSel.clear(); + } + } + } + mySelectGroup->setChecked(false); + myIsBusy = false; + onListSelectionChanged(); + + } + else if ( myCurrentLineEdit == myGeomGroupLine && myGeomObjects->length() == 1 ) + { + GEOM::GEOM_IGroupOperations_wrap aGroupOp = + SMESH::GetGEOMGen( myGeomObjects[0] )->GetIGroupOperations(); + + SMESH::ElementType aGroupType = SMESH::ALL; + switch(aGroupOp->GetType(myGeomObjects[0])) { + case TopAbs_VERTEX: aGroupType = SMESH::NODE; break; + case TopAbs_EDGE: aGroupType = SMESH::EDGE; break; + case TopAbs_FACE: aGroupType = SMESH::FACE; break; + case TopAbs_SOLID: aGroupType = SMESH::VOLUME; break; + default: myIsBusy = false; return; + } + + if (aGroupType == aType) { + _PTR(SObject) aGroupSO = + //SMESH::getStudy()->FindObjectIOR(SMESH::getStudy()->ConvertObjectToIOR(myGeomGroup)); + SMESH::getStudy()->FindObjectID(myGeomObjects[0]->GetStudyEntry()); + // Construct filter + SMESH::FilterManager_var aFilterMgr = SMESH::GetFilterManager(); + SMESH::Filter_var aFilter = aFilterMgr->CreateFilter(); + SMESH::BelongToGeom_var aBelongToGeom = aFilterMgr->CreateBelongToGeom(); + aBelongToGeom->SetGeom(myGeomObjects[0]); + aBelongToGeom->SetShapeName(aGroupSO->GetName().c_str()); + aBelongToGeom->SetElementType(aType); + aFilter->SetPredicate(aBelongToGeom); + + SMESH::long_array_var anElements = aFilter->GetElementsId(myMesh); + + int k = anElements->length(); + for (int i = 0; i < k; i++) { + QString aText = QString::number(anElements[i]); + QList found = myElements->findItems(aText, Qt::MatchExactly); + if (found.count() == 0) { + anItem = new QListWidgetItem(aText); + myElements->addItem(anItem); + if (!anItem->isSelected()) + listItemsToSel.push_back(anItem); + } + else { + foreach(anItem, found) + if (!anItem->isSelected()) + listItemsToSel.push_back(anItem); + } + } + bool blocked = myElements->signalsBlocked(); + myElements->blockSignals(true); + foreach(anItem, listItemsToSel) anItem->setSelected(true); + myElements->blockSignals(blocked); + onListSelectionChanged(); + listItemsToSel.clear(); + } + + //VSR: mySelectGeomGroup->setChecked(false); + myIsBusy = false; + onListSelectionChanged(); + } + myIsBusy = false; + if ( sizeBefore < myElements->count() ) + ++myNbChangesOfContents; + // mySelectionMgr->clearSelected(); + updateButtons(); +} + +//================================================================================= +// function : onRemove() +// purpose : +//================================================================================= +void SMESHGUI_AdaptDlg::onRemove() +{ + myIsBusy = true; + int sizeBefore = myElements->count(); + + if (myCurrentLineEdit == 0) { + QList selItems = myElements->selectedItems(); + QListWidgetItem* item; + foreach(item, selItems) delete item; + } else { + SALOME_ListIO aList; + mySelectionMgr->selectedObjects( aList ); + + int aNbSel = aList.Extent(); + + if (aNbSel == 0) { myIsBusy = false; return; } + + SMESH::ElementType aType = SMESH::ALL; + switch(myTypeId) { + case grpNodeSelection: aType = SMESH::NODE; break; + case grp0DSelection: aType = SMESH::ELEM0D; break; + case grpBallSelection: aType = SMESH::BALL; break; + case grpEdgeSelection: aType = SMESH::EDGE; break; + case grpFaceSelection: aType = SMESH::FACE; break; + case grpVolumeSelection: aType = SMESH::VOLUME; break; + } + + if (myCurrentLineEdit == mySubMeshLine) { + //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects()); + SALOME_ListIO aList; + mySelectionMgr->selectedObjects( aList ); + + SALOME_ListIteratorOfListIO anIt (aList); + for ( ; anIt.More(); anIt.Next()) { + SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface(anIt.Value()); + if (!aSubMesh->_is_nil()) { + // check if mesh is the same + if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) { + if (aType == SMESH::NODE) { + try { + SMESH::long_array_var anElements = aSubMesh->GetNodesId(); + int k = anElements->length(); + for (int i = 0; i < k; i++) { + QList found = + myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly); + QListWidgetItem* anItem; + foreach(anItem, found) delete anItem; + } + } + catch (const SALOME::SALOME_Exception& ex) { + SalomeApp_Tools::QtCatchCorbaException(ex); + } + } + else { + try { + SMESH::long_array_var anElements = aSubMesh->GetElementsId(); + int k = anElements->length(); + for (int i = 0; i < k; i++) { + QList found = + myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly); + QListWidgetItem* anItem; + foreach(anItem, found) delete anItem; + } + } + catch (const SALOME::SALOME_Exception& ex) { + SalomeApp_Tools::QtCatchCorbaException(ex); + } + } + } + } + } + } + else if (myCurrentLineEdit == myGroupLine) { + SALOME_ListIO aList; + mySelectionMgr->selectedObjects( aList ); + + SALOME_ListIteratorOfListIO anIt (aList); + for ( ; anIt.More(); anIt.Next()) { + SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface(anIt.Value()); + if (!aGroup->_is_nil()) { + // check if mesh is the same + if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) { + SMESH::long_array_var anElements = aGroup->GetListOfID(); + int k = anElements->length(); + for (int i = 0; i < k; i++) { + QList found = + myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly); + QListWidgetItem* anItem; + foreach(anItem, found) delete anItem; + } + } + } + } + } + } + myIsBusy = false; + if ( sizeBefore > myElements->count() ) + myNbChangesOfContents += 2; // it's used to detect that "Add" was only once + updateButtons(); +} + +//================================================================================= +// function : onSort() +// purpose : +//================================================================================= +void SMESHGUI_AdaptDlg::onSort() +{ + // PAL5412: sorts items in ascending by "string" value + // myElements->sort(true); + // myElements->update(); + int i, k = myElements->count(); + if (k > 0) { + myIsBusy = true; + QList aSelected; + std::vector anArray(k); + // QMemArray anArray(k); + // fill the array + for (i = 0; i < k; i++) { + int id = myElements->item(i)->text().toInt(); + anArray[i] = id; + if (myElements->item(i)->isSelected()) + aSelected.append(id); + } + // sort & update list + std::sort(anArray.begin(), anArray.end()); + // anArray.sort(); + myElements->clear(); + QListWidgetItem* anItem; + QList listItemsToSel; + for (i = 0; i < k; i++) { + anItem = new QListWidgetItem(QString::number(anArray[i])); + myElements->addItem(anItem); + if (aSelected.contains(anArray[i])) + listItemsToSel.push_back(anItem); + } + bool blocked = myElements->signalsBlocked(); + myElements->blockSignals(true); + foreach(anItem, listItemsToSel) anItem->setSelected(true); + myElements->blockSignals(blocked); + listItemsToSel.clear(); + myIsBusy = false; + } +} + +//================================================================================= +// function : onVisibilityChanged() +// purpose : +//================================================================================= +void SMESHGUI_AdaptDlg::onVisibilityChanged() +{ + SetAppropriateActor(); +} + +//================================================================================= +// function : SMESHGUI_AdaptDlg::reject +// purpose : SLOT called when "Close" button pressed. Close dialog +//================================================================================= +void SMESHGUI_AdaptDlg::reject() +{ + if (SMESH::GetCurrentVtkView()) { + SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters + SMESH::SetPointRepresentation(false); + SMESH::SetPickable(); + restoreShowEntityMode(); + } + + if( isApplyAndClose() && !myObjectToSelect.isEmpty() ) { + SUIT_DataOwnerPtrList aList; + aList.append( new LightApp_DataOwner( myObjectToSelect ) ); + mySelectionMgr->setSelected( aList ); + } + else + mySelectionMgr->clearSelected(); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); + mySelectionMgr->clearFilters(); + mySMESHGUI->ResetState(); + + QDialog::reject(); + + if ( myFilterDlg ) myFilterDlg->UnRegisterFilters(); +} + +//================================================================================= +// function : onOpenView() +// purpose : +//================================================================================= +void SMESHGUI_AdaptDlg::onOpenView() +{ + if ( mySelector ) { + SMESH::SetPointRepresentation(false); + } + else { + mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector(); + mySMESHGUI->EmitSignalDeactivateDialog(); + setEnabled(true); + } +} + +//================================================================================= +// function : onCloseView() +// purpose : +//================================================================================= +void SMESHGUI_AdaptDlg::onCloseView() +{ + onDeactivate(); + mySelector = 0; +} + +//================================================================================= +// function : onHelp() +// purpose : +//================================================================================= +void SMESHGUI_AdaptDlg::onHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + { + app->onHelpContextModule + ( mySMESHGUI ? app->moduleName( mySMESHGUI->moduleName() ) : QString(""), myHelpFileName ); + } + else + { +#ifdef WIN32 + QString platform = "winapplication"; +#else + QString platform = "application"; +#endif + SUIT_MessageBox::warning(this, tr( "WRN_WARNING" ), + tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ). + arg(app->resourceMgr()->stringValue( "ExternalBrowser", platform)). + arg(myHelpFileName)); + } +} + +//================================================================================= +// function : SMESHGUI_AdaptDlg::onDeactivate +// purpose : SLOT called when dialog must be deactivated +//================================================================================= +void SMESHGUI_AdaptDlg::onDeactivate() +{ + mySMESHGUI->ResetState(); + setEnabled(false); +} + +//================================================================================= +// function : SMESHGUI_AdaptDlg::enterEvent +// purpose : Event filter +//================================================================================= +void SMESHGUI_AdaptDlg::enterEvent (QEvent*) +{ + if (!isEnabled()) { + SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ); + if ( aViewWindow && !mySelector) { + mySelector = aViewWindow->GetSelector(); + } + mySMESHGUI->EmitSignalDeactivateDialog(); + setEnabled(true); + mySelectionMode = grpNoSelection; + setSelectionMode(myTypeId); + mySMESHGUI->SetActiveDialogBox(this); + if ( mySelectBox->isEnabled() ) mySMESHGUI->SetState(800); + else mySMESHGUI->ResetState(); + } +} + +//================================================================================= +// function : keyPressEvent() +// purpose : +//================================================================================= +void SMESHGUI_AdaptDlg::keyPressEvent( QKeyEvent* e ) +{ + QDialog::keyPressEvent( e ); + if ( e->isAccepted() ) + return; + + if ( e->key() == Qt::Key_F1 ) + { + e->accept(); + onHelp(); + } +} + +//================================================================================ +/*! + * \brief Enable showing of the popup when Geometry selection btn is clicked + * \param enable - true to enable + */ +//================================================================================ + +enum { DIRECT_GEOM_INDEX = 0, GEOM_BY_MESH_INDEX }; + +void SMESHGUI_AdaptDlg::updateGeomPopup() +{ + bool enable = false; + + if ( !myMesh->_is_nil() ) + enable = myMesh->NbEdges() > 0; + + if ( myGeomGroupBtn ) + { + disconnect( myGeomGroupBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) )); + if ( enable ) { + if ( !myGeomPopup ) { + myGeomPopup = new QMenu(this); + myActions[myGeomPopup->addAction( tr( "DIRECT_GEOM_SELECTION" ) )] = DIRECT_GEOM_INDEX; + myActions[myGeomPopup->addAction( tr( "GEOM_BY_MESH_ELEM_SELECTION" ) )] = GEOM_BY_MESH_INDEX; + connect( myGeomPopup, SIGNAL( triggered( QAction* ) ), SLOT( onGeomPopup( QAction* ) ) ); + } + connect( myGeomGroupBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) )); + } + } +} + + +//================================================================================= +// function : onGeomSelectionButton() +// purpose : +//================================================================================= +void SMESHGUI_AdaptDlg::onGeomSelectionButton(bool isBtnOn) +{ + if ( myGeomPopup && isBtnOn ) + { + myCurrentLineEdit = myGeomGroupLine; + QAction* a = myGeomPopup->exec( QCursor::pos() ); + if (!a || myActions[a] == DIRECT_GEOM_INDEX) + setSelectionMode(grpGeomSelection); + } + else if (!isBtnOn) + { + myCurrentLineEdit = 0; + setSelectionMode(grpAllSelection); + } +} + +//================================================================================= +// function : onGeomPopup() +// purpose : +//================================================================================= +void SMESHGUI_AdaptDlg::onGeomPopup( QAction* a ) +{ + int index = myActions[a]; + if ( index == GEOM_BY_MESH_INDEX ) + { + mySelectionMode = grpNoSelection; + if ( !myShapeByMeshOp ) { + myShapeByMeshOp = new SMESHGUI_ShapeByMeshOp(true); + connect(myShapeByMeshOp, SIGNAL(committed(SUIT_Operation*)), + SLOT(onPublishShapeByMeshDlg(SUIT_Operation*))); + connect(myShapeByMeshOp, SIGNAL(aborted(SUIT_Operation*)), + SLOT(onCloseShapeByMeshDlg(SUIT_Operation*))); + } + // set mesh object to SMESHGUI_ShapeByMeshOp and start it + if ( !myMesh->_is_nil() ) { + myIsBusy = true; + hide(); // stop processing selection + myIsBusy = false; + myShapeByMeshOp->setModule( mySMESHGUI ); + myShapeByMeshOp->setStudy( 0 ); // it's really necessary + myShapeByMeshOp->SetMesh( myMesh ); + myShapeByMeshOp->start(); + } + } +} + +//================================================================================ +/*! + * \brief SLOT. Is called when Ok is pressed in SMESHGUI_ShapeByMeshDlg + */ +//================================================================================ + +void SMESHGUI_AdaptDlg::onPublishShapeByMeshDlg(SUIT_Operation* op) +{ + if ( myShapeByMeshOp == op ) { + mySMESHGUI->getApp()->updateObjectBrowser(); + show(); + // Select a found geometry object + GEOM::GEOM_Object_var aGeomVar = myShapeByMeshOp->GetShape(); + if ( !aGeomVar->_is_nil() ) + { + QString ID = aGeomVar->GetStudyEntry(); + if ( _PTR(SObject) aGeomSO = SMESH::getStudy()->FindObjectID( ID.toLatin1().data() )) { + SALOME_ListIO anIOList; + Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject + ( aGeomSO->GetID().c_str(), "SMESH", aGeomSO->GetName().c_str() ); + anIOList.Append( anIO ); + mySelectionMgr->setSelectedObjects( anIOList, false ); + onObjectSelectionChanged(); + } + } + } +} + +//================================================================================ +/*! + * \brief SLOT. Is called when Close is pressed in SMESHGUI_ShapeByMeshDlg + */ +//================================================================================ + +void SMESHGUI_AdaptDlg::onCloseShapeByMeshDlg(SUIT_Operation* op) +{ + if ( myShapeByMeshOp == op ) + { + show(); + setSelectionMode(grpGeomSelection); + } +} + +//================================================================================= +// function : setGroupColor() +// purpose : +//================================================================================= +void SMESHGUI_AdaptDlg::setGroupColor( const SALOMEDS::Color& theColor ) +{ + QColor aQColor( (int)( theColor.R * 255.0 ), + (int)( theColor.G * 255.0 ), + (int)( theColor.B * 255.0 ) ); + setGroupQColor( aQColor ); +} + +//================================================================================= +// function : getGroupColor() +// purpose : +//================================================================================= +SALOMEDS::Color SMESHGUI_AdaptDlg::getGroupColor() const +{ + QColor aQColor = getGroupQColor(); + + SALOMEDS::Color aColor; + aColor.R = (float)aQColor.red() / 255.0; + aColor.G = (float)aQColor.green() / 255.0; + aColor.B = (float)aQColor.blue() / 255.0; + + return aColor; +} + +//================================================================================= +// function : setGroupQColor() +// purpose : +//================================================================================= +void SMESHGUI_AdaptDlg::setGroupQColor( const QColor& theColor ) +{ + if( theColor.isValid() ) + myColorBtn->setColor( theColor ); +} + +//================================================================================= +// function : getGroupQColor() +// purpose : +//================================================================================= +QColor SMESHGUI_AdaptDlg::getGroupQColor() const +{ + return myColorBtn->color(); +} + +//================================================================================= +// function : setDefaultGroupColor() +// purpose : +//================================================================================= +void SMESHGUI_AdaptDlg::setDefaultGroupColor() +{ + if( myMesh->_is_nil() ) + return; + + bool isAutoColor = myMesh->GetAutoColor(); + + QColor aQColor = myColorBtn->color(); + if( !isAutoColor ) + { + if ( !aQColor.isValid() ) { + int r = 0, g = 0, b = 0; + SMESH::GetColor( "SMESH", "default_grp_color", r, g, b, QColor( 255, 170, 0 ) ); + aQColor.setRgb( r, g, b ); + } + } + else + { +#ifdef SIMPLE_AUTOCOLOR // simplified algorithm for auto-colors + SALOMEDS::Color aColor = SMESHGUI::getPredefinedUniqueColor(); +#else // old algorithm for auto-colors + SMESH::ListOfGroups aListOfGroups = *myMesh->GetGroups(); + + QList aReservedColors; + for( int i = 0, n = aListOfGroups.length(); i < n; i++ ) + { + SMESH::SMESH_GroupBase_var aGroupObject = aListOfGroups[i]; + SALOMEDS::Color aReservedColor = aGroupObject->GetColor(); + aReservedColors.append( aReservedColor ); + } + + SALOMEDS::Color aColor = SMESHGUI::getUniqueColor( aReservedColors ); +#endif // SIMPLE_AUTOCOLOR + + aQColor.setRgb( (int)( aColor.R * 255.0 ), + (int)( aColor.G * 255.0 ), + (int)( aColor.B * 255.0 ) ); + + } + + setGroupQColor( aQColor ); +} + +//================================================================================= +// function : SetAppropriateActor() +// purpose : Find more appropriate of visible actors, set it to myActor, allow picking +// NPAL19389: create a group with a selection in another group. +// if mesh actor is not visible - find any first visible group or sub-mesh +//================================================================================= +bool SMESHGUI_AdaptDlg::SetAppropriateActor() +{ + bool isActor = false; + myActorsList.clear(); + + if (myMesh->_is_nil()) return false; + + SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView(); + + if (myGrpTypeGroup->checkedId() > 0) { // try current group on geometry actor + SMESH_Actor* anActor = 0; + if (!myGroupOnGeom->_is_nil()) + anActor = SMESH::FindActorByObject(myGroupOnGeom); + if (!myGroupOnFilter->_is_nil()) + anActor = SMESH::FindActorByObject(myGroupOnFilter); + if (anActor && anActor->hasIO()) + { + isActor = true; + if (aViewWindow && !aViewWindow->isVisible(anActor->getIO())) + isActor = false; + else + myActorsList.append(anActor); + } + return anActor; + } + else { + // try mesh actor + SMESH_Actor* anActor = SMESH::FindActorByObject(myMesh); + if (anActor && anActor->hasIO()) { + isActor = true; + if (aViewWindow && !aViewWindow->isVisible(anActor->getIO())) + isActor = false; + else + myActorsList.append(anActor); + } + + // try group actor + SMESH_Actor* aGroupActor = 0; + if (!isActor && !myGroup->_is_nil()) { + aGroupActor = SMESH::FindActorByObject(myGroup); + if (aGroupActor && aGroupActor->hasIO()) + myActorsList.append(aGroupActor); + } + + // try any visible actor of group or sub-mesh of current mesh + if (aViewWindow) { + // mesh entry + _PTR(SObject) aSObject = SMESH::FindSObject(myMesh); + if (aSObject) { + CORBA::String_var meshEntry = aSObject->GetID().c_str(); + int len = strlen(meshEntry); + + // iterate on all actors in current view window, search for + // any visible actor, that belongs to group or submesh of current mesh + VTK::ActorCollectionCopy aCopy(aViewWindow->getRenderer()->GetActors()); + vtkActorCollection *aCollection = aCopy.GetActors(); + int nbItems = aCollection->GetNumberOfItems(); + for (int i=0; i(aCollection->GetItemAsObject(i)); + if (anActor && anActor->hasIO()) { + Handle(SALOME_InteractiveObject) anIO = anActor->getIO(); + if (aViewWindow->isVisible(anIO)) { + if (anIO->hasEntry() && strncmp(anIO->getEntry(), meshEntry, len) == 0 && !myActorsList.contains(anActor) ) + myActorsList.append(anActor); + } + } + } + } + } + + // Show a standalone group if nothing else is visible (IPAL52227) + if ( myActorsList.count() == 1 && + myActorsList[0] == aGroupActor && + aViewWindow && !aViewWindow->isVisible(aGroupActor->getIO())) + SMESH::UpdateView( aViewWindow, SMESH::eDisplay, aGroupActor->getIO()->getEntry() ); + } + + + if (myActorsList.count() > 0) { + QListIterator it( myActorsList ); + while ( it.hasNext() ) { + SMESH_Actor* anActor = it.next(); + if ( IsActorVisible(anActor) ) + anActor->SetPickable(true); + } + } + + return ( isActor || (myActorsList.count() > 0) ); +} + +//======================================================================= +//function : setShowEntityMode +//purpose : make shown only entity corresponding to my type +//======================================================================= +void SMESHGUI_AdaptDlg::setShowEntityMode() +{ + if ( !myMesh->_is_nil() ) { + if ( SMESH_Actor* actor = SMESH::FindActorByObject(myMesh) ) { + if (!myStoredShownEntity) + myStoredShownEntity = actor->GetEntityMode(); + switch ( myTypeId ) { + case grpNodeSelection: restoreShowEntityMode(); break; + case grp0DSelection: actor->SetEntityMode( SMESH_Actor::e0DElements ); break; + case grpBallSelection: actor->SetEntityMode( SMESH_Actor::eBallElem ); break; + case grpEdgeSelection: actor->SetEntityMode( SMESH_Actor::eEdges ); break; + case grpFaceSelection: actor->SetEntityMode( SMESH_Actor::eFaces ); break; + case grpVolumeSelection: actor->SetEntityMode( SMESH_Actor::eVolumes ); break; + } + } + } +} + +//======================================================================= +//function : restoreShowEntityMode +//purpose : restore ShowEntity mode of myActor +//======================================================================= +void SMESHGUI_AdaptDlg::restoreShowEntityMode() +{ + if ( myStoredShownEntity && !myMesh->_is_nil() ) { + if ( SMESH_Actor* actor = SMESH::FindActorByObject(myMesh) ) { + actor->SetEntityMode(myStoredShownEntity); + } + } + myStoredShownEntity = 0; +} + +//======================================================================= +//function : IsActorVisible +//purpose : return visibility of the actor +//======================================================================= +bool SMESHGUI_AdaptDlg::IsActorVisible( SMESH_Actor* theActor ) +{ + SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView(); + if (theActor && aViewWindow) + return aViewWindow->isVisible(theActor->getIO()); + return false; +} + +//================================================================ +//function : setIsApplyAndClose +//purpose : Set value of the flag indicating that the dialog is +// accepted by Apply & Close button +//================================================================ +void SMESHGUI_AdaptDlg::setIsApplyAndClose( const bool theFlag ) +{ + myIsApplyAndClose = theFlag; +} + +//================================================================ +//function : isApplyAndClose +//purpose : Get value of the flag indicating that the dialog is +// accepted by Apply & Close button +//================================================================ +bool SMESHGUI_AdaptDlg::isApplyAndClose() const +{ + return myIsApplyAndClose; +} diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.h b/src/SMESHGUI/SMESHGUI_AdaptDlg.h index 45cbe28bf..7c140ef21 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.h +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.h @@ -24,84 +24,208 @@ #ifndef SMESHGUI_ADAPTDLG_H #define SMESHGUI_ADAPTDLG_H -#include "HOMARDGUI_Exports.hxx" +// SMESH includes +#include "SMESH_SMESHGUI.hxx" -#include -#include "SalomeApp_Study.h" +// Qt includes +#include +#include +#include +// IDL includes #include -#include -#include CORBA_CLIENT_HEADER(HOMARD_Gen) -#include CORBA_CLIENT_HEADER(HOMARD_Cas) -#include CORBA_CLIENT_HEADER(HOMARD_Hypothesis) +#include CORBA_SERVER_HEADER(SMESH_Mesh) +#include CORBA_SERVER_HEADER(SMESH_Group) +#include CORBA_SERVER_HEADER(SMESH_Filter) -#include +class QGroupBox; +class QLabel; +class QLineEdit; +class QButtonGroup; +class QListWidget; +class QMenu; +class QPushButton; +class QToolButton; +class QCheckBox; +class QStackedWidget; +class QAction; +class SMESHGUI; +class SMESH_Actor; +class SMESHGUI_FilterDlg; +class SMESHGUI_ShapeByMeshOp; +class QtxColorButton; +class SUIT_Operation; +class SVTK_Selector; +class SUIT_SelectionFilter; +class LightApp_SelectionMgr; +class SMESH_LogicalFilter; //================================================================================= // class : SMESHGUI_AdaptDlg // purpose : //================================================================================= -class SMESHGUI_EXPORT SMESHGUI_AdaptDlg: public QDialog +class SMESHGUI_EXPORT SMESHGUI_AdaptDlg : public QDialog { Q_OBJECT public: - SMESHGUI_AdaptDlg( SMESHGUI*, - int theCommandID); + SMESHGUI_AdaptDlg( SMESHGUI*, + int theCommandID, + SMESH::SMESH_Mesh_ptr = SMESH::SMESH_Mesh::_nil() ); ~SMESHGUI_AdaptDlg(); - - virtual bool OnGUIEvent (int theCommandID); - void initialize( CAM_Application* ); - QString engineIOR() const; - void windows( QMap& ) const; - - static HOMARD::HOMARD_Gen_var InitHOMARDGen(SalomeApp_Application* ); - - + + static QString GetDefaultName( const QString& ); + public slots: - bool deactivateModule( SUIT_Study* ); - bool activateModule( SUIT_Study* ); - static void setOrb(); + void onAdd(); + void onRemove(); + +protected slots: + virtual void reject(); private slots: - void OnGUIEvent(); - void EditAsciiFile(); - void LanceCalcul0(); - void LanceCalcul1(); - void IterInfo(); - void NextIter(); - void MeshPublish0(); - void MeshPublish1(); - void YACSCreate(); - void YACSWrite(); - void Edit(); - void Delete(); - -public: - virtual void contextMenuPopup( const QString&, QMenu*, QString& ); + void onTypeChanged( int ); + void onGrpTypeChanged( int ); + void onColorChanged( QColor ); + + void onOK(); + bool onApply(); + void onHelp(); + void onDeactivate(); + void onVisibilityChanged(); + + void onListSelectionChanged(); + void onObjectSelectionChanged(); + + void onSelectAll(); + void onSelectSubMesh( bool ); + void onSelectGroup( bool ); + void onSelectGeomGroup( bool ); + void setCurrentSelection(); + + void setFilters(); + void onSort(); + + void onNameChanged( const QString& ); + void onFilterAccepted(); + + void onGeomPopup( QAction* ); + void onGeomSelectionButton( bool ); + + void onPublishShapeByMeshDlg( SUIT_Operation* ); + void onCloseShapeByMeshDlg( SUIT_Operation* ); + void onOpenView(); + void onCloseView(); private: - void createHOMARDAction( const int id, const QString& po_id, const QString& icon_id = QString(""), - const int key = 0, const bool toggle = false ); - void createActions(); - void createMenus(); - void recupPreferences(); - void createPopupMenus(); - _PTR(SObject) chercheMonObjet(); + void initDialog( bool ); + void init( SMESH::SMESH_Mesh_ptr ); + void init( SMESH::SMESH_GroupBase_ptr ); + void enterEvent( QEvent* ); + void keyPressEvent( QKeyEvent* ); + void setSelectionMode( int ); + void updateButtons(); + void updateGeomPopup(); + bool SetAppropriateActor(); + void setShowEntityMode(); + void restoreShowEntityMode(); - virtual void createPreferences(); - HOMARD::HOMARD_Gen_var myComponentHomard; + bool IsActorVisible( SMESH_Actor* ); + + void setGroupColor( const SALOMEDS::Color& ); + SALOMEDS::Color getGroupColor() const; + + void setGroupQColor( const QColor& ); + QColor getGroupQColor() const; + void setDefaultName() const; + void setDefaultGroupColor(); - int anId; - QString _ObjectName; - QString _LanguageShort ; - int _PublisMeshIN ; - int _PublisMeshOUT ; - int _YACSMaxIter ; - int _YACSMaxNode ; - int _YACSMaxElem ; - int _YACSTypeTest ; + void setIsApplyAndClose( const bool theFlag ); + bool isApplyAndClose() const; + + private: + + SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */ + LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */ + int myGrpTypeId; /* Current group type id : standalone or group on geometry */ + int myTypeId; /* Current type id = radio button id */ + int myStoredShownEntity; /* Store ShowEntity mode of myMesh */ + QLineEdit* myCurrentLineEdit; /* Current LineEdit */ + SVTK_Selector* mySelector; + + QPushButton* myMeshGroupBtn; + QLineEdit* myMeshGroupLine; + + QButtonGroup* myTypeGroup; + QLineEdit* myName; + QString myOldName; + + QButtonGroup* myGrpTypeGroup; + + QStackedWidget* myWGStack; + QCheckBox* mySelectAll; + QCheckBox* myAllowElemsModif; + QLabel* myElementsLab; + QListWidget* myElements; + QPushButton* myFilterBtn; + QPushButton* myAddBtn; + QPushButton* myRemoveBtn; + QPushButton* mySortBtn; + + QGroupBox* mySelectBox; + QCheckBox* mySelectSubMesh; + QPushButton* mySubMeshBtn; + QLineEdit* mySubMeshLine; + QCheckBox* mySelectGroup; + QPushButton* myGroupBtn; + QLineEdit* myGroupLine; + + QtxColorButton* myColorBtn; + + QCheckBox* mySelectGeomGroup; + QToolButton* myGeomGroupBtn; + QLineEdit* myGeomGroupLine; + QMenu* myGeomPopup; + + QPushButton* myOKBtn; + QPushButton* myApplyBtn; + QPushButton* myCloseBtn; + QPushButton* myHelpBtn; + + SMESHGUI_ShapeByMeshOp* myShapeByMeshOp; + + SMESH::SMESH_Mesh_var myMesh; + QList myActorsList; + SMESH::SMESH_Group_var myGroup; + SMESH::SMESH_GroupOnGeom_var myGroupOnGeom; + SMESH::SMESH_GroupOnFilter_var myGroupOnFilter; + SMESH::Filter_var myFilter; + QList myIdList; + GEOM::ListOfGO_var myGeomObjects; + + int mySelectionMode; + //Handle(SMESH_TypeFilter) myMeshFilter; + //Handle(SMESH_TypeFilter) mySubMeshFilter; + //Handle(SMESH_TypeFilter) myGroupFilter; + SUIT_SelectionFilter* myMeshFilter; + SMESH_LogicalFilter* mySubMeshFilter; + SMESH_LogicalFilter* myGroupFilter; + SUIT_SelectionFilter* myGeomFilter; + + SMESHGUI_FilterDlg* myFilterDlg; + + bool myCreate, myIsBusy; + + QString myHelpFileName; + + QMap myActions; + + bool myNameChanged; //added by skl for IPAL19574 + int myNbChangesOfContents; // nb add's and remove's + + QString myObjectToSelect; + bool myIsApplyAndClose; }; #endif // SMESHGUI_ADAPTDLG_H From 3f56f1610c1bd4780a34e83807f5bf943b9998f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Tue, 26 May 2020 11:29:01 +0200 Subject: [PATCH 020/100] Changement du nom du module --- idl/HOMARD_Boundary.idl | 6 +++--- idl/HOMARD_Cas.idl | 2 +- idl/HOMARD_Gen.idl | 2 +- idl/HOMARD_Hypothesis.idl | 2 +- idl/HOMARD_Iteration.idl | 2 +- idl/HOMARD_YACS.idl | 2 +- idl/HOMARD_Zone.idl | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/idl/HOMARD_Boundary.idl b/idl/HOMARD_Boundary.idl index d1a9e40da..aa7baea61 100644 --- a/idl/HOMARD_Boundary.idl +++ b/idl/HOMARD_Boundary.idl @@ -38,7 +38,7 @@ #include "HOMARD_Zone.idl" -module HOMARD +module ADAPT { interface HOMARD_Boundary : Engines::EngineComponent { @@ -80,11 +80,11 @@ module HOMARD raises (SALOME::SALOME_Exception); - HOMARD::double_array GetCoords() raises (SALOME::SALOME_Exception); + ADAPT::double_array GetCoords() raises (SALOME::SALOME_Exception); void SetLimit (in double Xincr, in double Yincr, in double Zincr) raises (SALOME::SALOME_Exception); - HOMARD::double_array GetLimit() raises (SALOME::SALOME_Exception); + ADAPT::double_array GetLimit() raises (SALOME::SALOME_Exception); void AddGroup(in string LeGroupe) raises (SALOME::SALOME_Exception); void SetGroups(in ListGroupType ListGroup) raises (SALOME::SALOME_Exception); diff --git a/idl/HOMARD_Cas.idl b/idl/HOMARD_Cas.idl index 7e8c1b8df..1e07cc69a 100644 --- a/idl/HOMARD_Cas.idl +++ b/idl/HOMARD_Cas.idl @@ -37,7 +37,7 @@ #include "HOMARD_Iteration.idl" #include "HOMARD_YACS.idl" -module HOMARD +module ADAPT { typedef sequence extrema ; typedef sequence ListGroupType ; diff --git a/idl/HOMARD_Gen.idl b/idl/HOMARD_Gen.idl index 6571e5ba8..797b3f8c4 100644 --- a/idl/HOMARD_Gen.idl +++ b/idl/HOMARD_Gen.idl @@ -31,7 +31,7 @@ #include "HOMARD_Boundary.idl" #include "HOMARD_YACS.idl" -module HOMARD +module ADAPT { typedef sequence listeHypotheses; typedef sequence listeZones; diff --git a/idl/HOMARD_Hypothesis.idl b/idl/HOMARD_Hypothesis.idl index 7a95111ee..2e8bd1190 100644 --- a/idl/HOMARD_Hypothesis.idl +++ b/idl/HOMARD_Hypothesis.idl @@ -36,7 +36,7 @@ #include "HOMARD_Cas.idl" -module HOMARD +module ADAPT { typedef sequence listeZonesHypo ; typedef sequence listeIters ; diff --git a/idl/HOMARD_Iteration.idl b/idl/HOMARD_Iteration.idl index f33918cef..67512a6a4 100644 --- a/idl/HOMARD_Iteration.idl +++ b/idl/HOMARD_Iteration.idl @@ -34,7 +34,7 @@ #include "SALOME_Exception.idl" #include "SALOMEDS.idl" -module HOMARD +module ADAPT { typedef sequence listeIterFilles ; typedef sequence listeFieldInterpsIter ; diff --git a/idl/HOMARD_YACS.idl b/idl/HOMARD_YACS.idl index 29e27cb58..538e0ec20 100644 --- a/idl/HOMARD_YACS.idl +++ b/idl/HOMARD_YACS.idl @@ -34,7 +34,7 @@ #include "SALOME_Exception.idl" #include "SALOMEDS.idl" -module HOMARD +module ADAPT { interface HOMARD_YACS : Engines::EngineComponent { diff --git a/idl/HOMARD_Zone.idl b/idl/HOMARD_Zone.idl index 7a5d3ea18..691246ea4 100644 --- a/idl/HOMARD_Zone.idl +++ b/idl/HOMARD_Zone.idl @@ -34,7 +34,7 @@ #include "SALOME_Exception.idl" #include "SALOMEDS.idl" -module HOMARD +module ADAPT { typedef sequence double_array ; typedef sequence listeHypo ; From 93ad4359b074e4a3743dc485affbd865163f71e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Tue, 26 May 2020 14:36:52 +0200 Subject: [PATCH 021/100] Changements de noms HOMARD ==> ADAPT --- idl/{HOMARD_Gen.idl => ADAPT_Gen.idl} | 6 +- idl/CMakeLists.txt | 2 +- src/ADAPT/{HOMARD_Gen.cxx => ADAPT_Gen.cxx} | 12 +- src/ADAPT/{HOMARD_Gen.hxx => ADAPT_Gen.hxx} | 12 +- src/ADAPT/CMakeLists.txt | 4 +- src/ADAPT/HOMARD_DriverTools.cxx | 4 +- src/ADAPT/HOMARD_DriverTools.hxx | 2 +- src/ADAPT/YACSDriver.cxx | 6 +- src/ADAPTGUI/ADAPTGUI.cxx | 44 +- src/ADAPTGUI/ADAPTGUI.h | 6 +- src/ADAPTGUI/HOMARDGUI_Utils.cxx | 2 +- src/ADAPTGUI/HOMARDGUI_Utils.h | 2 +- src/ADAPTGUI/HomardQtCommun.h | 2 +- src/ADAPTGUI/MonCreateBoundaryAn.cxx | 12 +- src/ADAPTGUI/MonCreateBoundaryAn.h | 10 +- src/ADAPTGUI/MonCreateBoundaryCAO.cxx | 10 +- src/ADAPTGUI/MonCreateBoundaryCAO.h | 8 +- src/ADAPTGUI/MonCreateBoundaryDi.cxx | 10 +- src/ADAPTGUI/MonCreateBoundaryDi.h | 8 +- src/ADAPTGUI/MonCreateCase.cxx | 24 +- src/ADAPTGUI/MonCreateCase.h | 8 +- src/ADAPTGUI/MonCreateHypothesis.cxx | 16 +- src/ADAPTGUI/MonCreateHypothesis.h | 10 +- src/ADAPTGUI/MonCreateIteration.cxx | 20 +- src/ADAPTGUI/MonCreateIteration.h | 14 +- src/ADAPTGUI/MonCreateListGroup.cxx | 12 +- src/ADAPTGUI/MonCreateListGroup.h | 8 +- src/ADAPTGUI/MonCreateListGroupCAO.cxx | 12 +- src/ADAPTGUI/MonCreateListGroupCAO.h | 8 +- src/ADAPTGUI/MonCreateYACS.cxx | 10 +- src/ADAPTGUI/MonCreateYACS.h | 10 +- src/ADAPTGUI/MonCreateZone.cxx | 12 +- src/ADAPTGUI/MonCreateZone.h | 10 +- src/ADAPTGUI/MonEditBoundaryAn.cxx | 14 +- src/ADAPTGUI/MonEditBoundaryAn.h | 4 +- src/ADAPTGUI/MonEditBoundaryCAO.cxx | 10 +- src/ADAPTGUI/MonEditBoundaryCAO.h | 4 +- src/ADAPTGUI/MonEditBoundaryDi.cxx | 10 +- src/ADAPTGUI/MonEditBoundaryDi.h | 4 +- src/ADAPTGUI/MonEditCase.cxx | 8 +- src/ADAPTGUI/MonEditCase.h | 4 +- src/ADAPTGUI/MonEditFile.cxx | 2 +- src/ADAPTGUI/MonEditFile.h | 6 +- src/ADAPTGUI/MonEditHypothesis.cxx | 16 +- src/ADAPTGUI/MonEditHypothesis.h | 4 +- src/ADAPTGUI/MonEditIteration.cxx | 4 +- src/ADAPTGUI/MonEditIteration.h | 4 +- src/ADAPTGUI/MonEditListGroup.cxx | 2 +- src/ADAPTGUI/MonEditListGroup.h | 4 +- src/ADAPTGUI/MonEditListGroupCAO.cxx | 2 +- src/ADAPTGUI/MonEditListGroupCAO.h | 4 +- src/ADAPTGUI/MonEditYACS.cxx | 2 +- src/ADAPTGUI/MonEditYACS.h | 4 +- src/ADAPTGUI/MonEditZone.cxx | 12 +- src/ADAPTGUI/MonEditZone.h | 4 +- src/ADAPTGUI/MonIterInfo.cxx | 6 +- src/ADAPTGUI/MonIterInfo.h | 10 +- src/ADAPTGUI/MonMeshInfo.cxx | 10 +- src/ADAPTGUI/MonMeshInfo.h | 8 +- src/ADAPTGUI/MonPursueIteration.cxx | 6 +- src/ADAPTGUI/MonPursueIteration.h | 8 +- .../{HOMARD_Gen_i.cxx => ADAPT_Gen_i.cxx} | 728 +++++++++--------- .../{HOMARD_Gen_i.hxx => ADAPT_Gen_i.hxx} | 148 ++-- src/ADAPT_I/CMakeLists.txt | 4 +- src/ADAPT_I/HOMARD_Boundary_i.cxx | 22 +- src/ADAPT_I/HOMARD_Boundary_i.hxx | 16 +- src/ADAPT_I/HOMARD_Cas_i.cxx | 46 +- src/ADAPT_I/HOMARD_Cas_i.hxx | 26 +- src/ADAPT_I/HOMARD_Hypothesis_i.cxx | 38 +- src/ADAPT_I/HOMARD_Hypothesis_i.hxx | 24 +- src/ADAPT_I/HOMARD_Iteration_i.cxx | 26 +- src/ADAPT_I/HOMARD_Iteration_i.hxx | 18 +- src/ADAPT_I/HOMARD_YACS_i.cxx | 8 +- src/ADAPT_I/HOMARD_YACS_i.hxx | 8 +- src/ADAPT_I/HOMARD_Zone_i.cxx | 20 +- src/ADAPT_I/HOMARD_Zone_i.hxx | 14 +- 76 files changed, 829 insertions(+), 829 deletions(-) rename idl/{HOMARD_Gen.idl => ADAPT_Gen.idl} (99%) rename src/ADAPT/{HOMARD_Gen.cxx => ADAPT_Gen.cxx} (90%) rename src/ADAPT/{HOMARD_Gen.hxx => ADAPT_Gen.hxx} (87%) rename src/ADAPT_I/{HOMARD_Gen_i.cxx => ADAPT_Gen_i.cxx} (87%) rename src/ADAPT_I/{HOMARD_Gen_i.hxx => ADAPT_Gen_i.hxx} (68%) diff --git a/idl/HOMARD_Gen.idl b/idl/ADAPT_Gen.idl similarity index 99% rename from idl/HOMARD_Gen.idl rename to idl/ADAPT_Gen.idl index 797b3f8c4..83114652e 100644 --- a/idl/HOMARD_Gen.idl +++ b/idl/ADAPT_Gen.idl @@ -17,8 +17,8 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -#ifndef __HOMARD_GEN__ -#define __HOMARD_GEN__ +#ifndef __ADAPT_GEN__ +#define __ADAPT_GEN__ #include "SALOME_Component.idl" #include "SALOME_Exception.idl" @@ -40,7 +40,7 @@ module ADAPT typedef sequence listeBoundarys; typedef sequence listeYACSs; - interface HOMARD_Gen : Engines::EngineComponent, SALOMEDS::Driver + interface ADAPT_Gen : Engines::EngineComponent, SALOMEDS::Driver { // // A. Les methodes qui suivent sont celles que l'on retrouvera dans diff --git a/idl/CMakeLists.txt b/idl/CMakeLists.txt index e870d89af..7aabfb53b 100644 --- a/idl/CMakeLists.txt +++ b/idl/CMakeLists.txt @@ -38,7 +38,7 @@ SET(SalomeIDLSMESH_IDLSOURCES SMESH_Measurements.idl HOMARD_Boundary.idl HOMARD_Cas.idl - HOMARD_Gen.idl + ADAPT_Gen.idl HOMARD_Hypothesis.idl HOMARD_Iteration.idl HOMARD_YACS.idl diff --git a/src/ADAPT/HOMARD_Gen.cxx b/src/ADAPT/ADAPT_Gen.cxx similarity index 90% rename from src/ADAPT/HOMARD_Gen.cxx rename to src/ADAPT/ADAPT_Gen.cxx index a9059a6ad..94e762ed5 100644 --- a/src/ADAPT/HOMARD_Gen.cxx +++ b/src/ADAPT/ADAPT_Gen.cxx @@ -18,24 +18,24 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// File : HOMARD_Gen.cxx +// File : ADAPT_Gen.cxx // Author : Gerald NICOLAS, EDF // Module : HOMARD -#include "HOMARD_Gen.hxx" +#include "ADAPT_Gen.hxx" #include "utilities.h" //============================================================================= //============================================================================= -HOMARD_Gen::HOMARD_Gen() +ADAPT_Gen::ADAPT_Gen() { - MESSAGE("HOMARD_Gen"); + MESSAGE("ADAPT_Gen"); } //============================================================================= //============================================================================= -HOMARD_Gen::~HOMARD_Gen() +ADAPT_Gen::~ADAPT_Gen() { - MESSAGE("~HOMARD_Gen"); + MESSAGE("~ADAPT_Gen"); } //============================================================================= diff --git a/src/ADAPT/HOMARD_Gen.hxx b/src/ADAPT/ADAPT_Gen.hxx similarity index 87% rename from src/ADAPT/HOMARD_Gen.hxx rename to src/ADAPT/ADAPT_Gen.hxx index 3ff864a14..7a7d05098 100644 --- a/src/ADAPT/HOMARD_Gen.hxx +++ b/src/ADAPT/ADAPT_Gen.hxx @@ -18,20 +18,20 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// File : HOMARD_Gen.hxx +// File : ADAPT_Gen.hxx // Author : Gerald NICOLAS, EDF // Module : HOMARD -#ifndef _HOMARD_GEN_HXX_ -#define _HOMARD_GEN_HXX_ +#ifndef _ADAPT_GEN_HXX_ +#define _ADAPT_GEN_HXX_ #include "HOMARD.hxx" -class HOMARDIMPL_EXPORT HOMARD_Gen +class HOMARDIMPL_EXPORT ADAPT_Gen { public : - HOMARD_Gen(); - ~HOMARD_Gen(); + ADAPT_Gen(); + ~ADAPT_Gen(); }; #endif diff --git a/src/ADAPT/CMakeLists.txt b/src/ADAPT/CMakeLists.txt index bc90a1aa0..728d7203d 100644 --- a/src/ADAPT/CMakeLists.txt +++ b/src/ADAPT/CMakeLists.txt @@ -43,7 +43,7 @@ SET(ADAPTImpl_HEADERS HOMARD_Hypothesis.hxx HOMARD_Iteration.hxx HOMARD_Zone.hxx - HOMARD_Gen.hxx + ADAPT_Gen.hxx HOMARD_DriverTools.hxx HOMARD_YACS.hxx HomardDriver.hxx @@ -59,7 +59,7 @@ SET(ADAPTImpl_SOURCES HOMARD_Hypothesis.cxx HOMARD_Iteration.cxx HOMARD_Zone.cxx - HOMARD_Gen.cxx + ADAPT_Gen.cxx HOMARD_DriverTools.cxx HOMARD_YACS.cxx HomardDriver.cxx diff --git a/src/ADAPT/HOMARD_DriverTools.cxx b/src/ADAPT/HOMARD_DriverTools.cxx index df7c5e6b2..74ec51209 100644 --- a/src/ADAPT/HOMARD_DriverTools.cxx +++ b/src/ADAPT/HOMARD_DriverTools.cxx @@ -32,7 +32,7 @@ #include #include "utilities.h" -namespace HOMARD +namespace ADAPT { std::string SEPARATOR = "|" ; @@ -837,4 +837,4 @@ namespace HOMARD return true; } -} // namespace HOMARD /end/ +} // namespace ADAPT /end/ diff --git a/src/ADAPT/HOMARD_DriverTools.hxx b/src/ADAPT/HOMARD_DriverTools.hxx index 887d5f35b..e7aff54f8 100644 --- a/src/ADAPT/HOMARD_DriverTools.hxx +++ b/src/ADAPT/HOMARD_DriverTools.hxx @@ -35,7 +35,7 @@ class HOMARD_Hypothesis; class HOMARD_Zone; class HOMARD_YACS; -namespace HOMARD +namespace ADAPT { //! persistence entity type typedef enum { Case, Zone, Hypothesis, Iteration, Boundary, YACS } SignatureType; diff --git a/src/ADAPT/YACSDriver.cxx b/src/ADAPT/YACSDriver.cxx index 27910535d..864803db8 100644 --- a/src/ADAPT/YACSDriver.cxx +++ b/src/ADAPT/YACSDriver.cxx @@ -144,7 +144,7 @@ std::string YACSDriver::Texte_Iter_1_Zone( int ZoneType, const std::string pytho _Texte += Texte_inport( "string", "ZoneName" ) ; TexteParametre( node, "ZoneName", "string", ZoneName ) ; // 4.2. Les valeurs numeriques -// ATTENTION : les noms doivent etre les memes que dans Gen.xml, donc HOMARD_Gen.idl +// ATTENTION : les noms doivent etre les memes que dans Gen.xml, donc ADAPT_Gen.idl // 4.2.1. Decodage des valeurs // La chaine pythonStructure est de ce genre : // CreateZoneBox( "Zone_1", 0.144, 0.216, 0.096, 0.1464, 0.076, 0.12) @@ -312,7 +312,7 @@ std::string YACSDriver::Texte_Iter_1_Boundary( int BoundaryType, const std::stri _Texte += " " + motcle + ".UpdateStudy\n" ; _Texte += " " + methode + "\n" ; // 4. Les inports -// ATTENTION : les noms doivent etre les memes que dans Gen.xml, donc HOMARD_Gen.idl +// ATTENTION : les noms doivent etre les memes que dans Gen.xml, donc ADAPT_Gen.idl // 4.1. Le nom de la frontiere _Texte += Texte_inport( "string", "BoundaryName" ) ; TexteParametre( node, "BoundaryName", "string", BoundaryName ) ; @@ -658,7 +658,7 @@ void YACSDriver::CreeFichier( ) // } //=============================================================================== -// REMARQUE : on devrait utiliser le GetStringInTexte de HOMARD_Gen_i mais je ne sais pas +// REMARQUE : on devrait utiliser le GetStringInTexte de ADAPT_Gen_i mais je ne sais pas // comment l'appeler. ALors je clone. // Recuperation de la chaine de caracteres par rapport l'apparition d'un texte // ligne : la ligne a manipuler diff --git a/src/ADAPTGUI/ADAPTGUI.cxx b/src/ADAPTGUI/ADAPTGUI.cxx index 5b5fae290..ed8cf6b51 100644 --- a/src/ADAPTGUI/ADAPTGUI.cxx +++ b/src/ADAPTGUI/ADAPTGUI.cxx @@ -103,10 +103,10 @@ ADAPTGUI::~ADAPTGUI() // function : InitHOMARDGen // launch HOMARD component and return a handle //======================================================================= -HOMARD::HOMARD_Gen_var ADAPTGUI::InitHOMARDGen(SalomeApp_Application* app) +ADAPT::ADAPT_Gen_var ADAPTGUI::InitHOMARDGen(SalomeApp_Application* app) { Engines::EngineComponent_var comp = app->lcc()->FindOrLoad_Component( "FactoryServer","HOMARD" ); - HOMARD::HOMARD_Gen_var clr = HOMARD::HOMARD_Gen::_narrow(comp); + ADAPT::ADAPT_Gen_var clr = ADAPT::ADAPT_Gen::_narrow(comp); ASSERT(!CORBA::is_nil(clr)); return clr; } @@ -261,10 +261,10 @@ void ADAPTGUI::createMenus() //================================================ // function : recupPreferences -// Pour chaque valeur, le defaut est la valeur definie dans HOMARD_Gen -// . Si la recuperation dans config/salome s'est bien passee a la creation de HOMARD_Gen, +// Pour chaque valeur, le defaut est la valeur definie dans ADAPT_Gen +// . Si la recuperation dans config/salome s'est bien passee a la creation de ADAPT_Gen, // ces valeurs sont les valeurs definies. -// . Si cela ne s'est pas bien passe, ce sont les valeurs par defaut de HOMARD_Gen +// . Si cela ne s'est pas bien passe, ce sont les valeurs par defaut de ADAPT_Gen //================================================ void ADAPTGUI::recupPreferences() { @@ -273,7 +273,7 @@ void ADAPTGUI::recupPreferences() // A. Declarations // SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( application() ); - HOMARD::HOMARD_Gen_var homardGen = ADAPTGUI::InitHOMARDGen(app); + ADAPT::ADAPT_Gen_var homardGen = ADAPTGUI::InitHOMARDGen(app); int defaut_i ; std::string defaut_s ; QString QString_v ; @@ -370,7 +370,7 @@ bool ADAPTGUI::OnGUIEvent (int theCommandID) SUIT_Desktop* parent = application()->desktop(); - HOMARD::HOMARD_Gen_var homardGen = ADAPTGUI::InitHOMARDGen(app); + ADAPT::ADAPT_Gen_var homardGen = ADAPTGUI::InitHOMARDGen(app); if (!CORBA::is_nil(homardGen)) homardGen->UpdateStudy(); @@ -385,7 +385,7 @@ bool ADAPTGUI::OnGUIEvent (int theCommandID) { MESSAGE("command " << theCommandID << " activated"); MonCreateCase *aDlg = new MonCreateCase( true, - HOMARD::HOMARD_Gen::_duplicate(homardGen) ) ; + ADAPT::ADAPT_Gen::_duplicate(homardGen) ) ; aDlg->show(); break; } @@ -394,7 +394,7 @@ bool ADAPTGUI::OnGUIEvent (int theCommandID) { MESSAGE("command " << theCommandID << " activated"); MonPursueIteration *aDlg = new MonPursueIteration( true, - HOMARD::HOMARD_Gen::_duplicate(homardGen) ) ; + ADAPT::ADAPT_Gen::_duplicate(homardGen) ) ; aDlg->show(); break; } @@ -403,7 +403,7 @@ bool ADAPTGUI::OnGUIEvent (int theCommandID) { MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); MonCreateIteration *IterDlg = new MonCreateIteration( parent, true, - HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ; + ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName ) ; IterDlg->show(); break; } @@ -439,7 +439,7 @@ bool ADAPTGUI::OnGUIEvent (int theCommandID) case 1121: // Information sur le maillage de l'iteration { MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); - MonIterInfo *IterDlg = new MonIterInfo( parent, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ; + MonIterInfo *IterDlg = new MonIterInfo( parent, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName ) ; IterDlg->show(); break; } @@ -469,50 +469,50 @@ bool ADAPTGUI::OnGUIEvent (int theCommandID) // Edition d'une frontiere CAO if (HOMARD_UTILS::isBoundaryCAO(obj)) { - MonEditBoundaryCAO *aDlg = new MonEditBoundaryCAO(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; + MonEditBoundaryCAO *aDlg = new MonEditBoundaryCAO(0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; aDlg->show(); } // Edition d'une frontiere discrete else if (HOMARD_UTILS::isBoundaryDi(obj)) { - MonEditBoundaryDi *aDlg = new MonEditBoundaryDi(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; + MonEditBoundaryDi *aDlg = new MonEditBoundaryDi(0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; aDlg->show(); } // Edition d'une frontiere analytique else if (HOMARD_UTILS::isBoundaryAn(obj)) { - MonEditBoundaryAn *aDlg = new MonEditBoundaryAn(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; + MonEditBoundaryAn *aDlg = new MonEditBoundaryAn(0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; aDlg->show(); } // Edition d'un cas else if (HOMARD_UTILS::isCase(obj)) { - MonEditCase *aDlg = new MonEditCase(true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ; + MonEditCase *aDlg = new MonEditCase(true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName ) ; aDlg->show(); } // Edition d'une hypothese else if (HOMARD_UTILS::isHypo(obj)) { - MonEditHypothesis *aDlg = new MonEditHypothesis(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName, QString(""), QString("")) ; + MonEditHypothesis *aDlg = new MonEditHypothesis(0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName, QString(""), QString("")) ; aDlg->show(); } // Edition d'une iteration else if (HOMARD_UTILS::isIter(obj)) { - MonEditIteration *aDlg = new MonEditIteration(parent, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; + MonEditIteration *aDlg = new MonEditIteration(parent, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; aDlg->show(); } // Edition d'un schema YACS else if (HOMARD_UTILS::isYACS(obj)) { MESSAGE("appel de MonEditYACS"); - MonEditYACS *aDlg = new MonEditYACS(true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName) ; + MonEditYACS *aDlg = new MonEditYACS(true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName) ; aDlg->show(); } // Edition d'une zone else if (HOMARD_UTILS::isZone(obj)) { - MonEditZone *aDlg = new MonEditZone(0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; + MonEditZone *aDlg = new MonEditZone(0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; aDlg->show(); } } @@ -613,7 +613,7 @@ bool ADAPTGUI::OnGUIEvent (int theCommandID) { MESSAGE("etape 1301") MESSAGE("command " << theCommandID << " activated"); - MonMeshInfo *aDlg = new MonMeshInfo( parent, true, HOMARD::HOMARD_Gen::_duplicate(homardGen) ) ; + MonMeshInfo *aDlg = new MonMeshInfo( parent, true, ADAPT::ADAPT_Gen::_duplicate(homardGen) ) ; aDlg->show(); break; } @@ -624,7 +624,7 @@ bool ADAPTGUI::OnGUIEvent (int theCommandID) _PTR(SObject) obj = chercheMonObjet(); if ( (obj) && ( HOMARD_UTILS::isFileType(obj,QString("log")) || HOMARD_UTILS::isFileType(obj,QString("Summary")) || HOMARD_UTILS::isFileType(obj,QString("xml")) ) ) { - MonEditFile *aDlg = new MonEditFile( 0, true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName, 0 ) ; + MonEditFile *aDlg = new MonEditFile( 0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName, 0 ) ; if ( aDlg->_codret == 0 ) { aDlg->show(); } } break; @@ -634,7 +634,7 @@ bool ADAPTGUI::OnGUIEvent (int theCommandID) { MESSAGE("etape 1401") MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); - MonCreateYACS *aDlg = new MonCreateYACS( true, HOMARD::HOMARD_Gen::_duplicate(homardGen), _ObjectName ) ; + MonCreateYACS *aDlg = new MonCreateYACS( true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName ) ; aDlg->show(); break; } diff --git a/src/ADAPTGUI/ADAPTGUI.h b/src/ADAPTGUI/ADAPTGUI.h index d86a72991..82b71aa79 100644 --- a/src/ADAPTGUI/ADAPTGUI.h +++ b/src/ADAPTGUI/ADAPTGUI.h @@ -30,7 +30,7 @@ #include #include -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include CORBA_CLIENT_HEADER(HOMARD_Cas) #include CORBA_CLIENT_HEADER(HOMARD_Hypothesis) @@ -53,7 +53,7 @@ public: QString engineIOR() const; void windows( QMap& ) const; - static HOMARD::HOMARD_Gen_var InitHOMARDGen(SalomeApp_Application* ); + static ADAPT::ADAPT_Gen_var InitHOMARDGen(SalomeApp_Application* ); public slots: @@ -89,7 +89,7 @@ private: _PTR(SObject) chercheMonObjet(); virtual void createPreferences(); - HOMARD::HOMARD_Gen_var myComponentHomard; + ADAPT::ADAPT_Gen_var myComponentHomard; int anId; QString _ObjectName; diff --git a/src/ADAPTGUI/HOMARDGUI_Utils.cxx b/src/ADAPTGUI/HOMARDGUI_Utils.cxx index 562546eec..5358c5c32 100644 --- a/src/ADAPTGUI/HOMARDGUI_Utils.cxx +++ b/src/ADAPTGUI/HOMARDGUI_Utils.cxx @@ -90,7 +90,7 @@ void HOMARD_UTILS::updateObjBrowser() appMod->updateObjBrowser( true ); } else - MESSAGE( "--- HOMARD::updateObjBrowser: appMod = NULL"); + MESSAGE( "--- ADAPT::updateObjBrowser: appMod = NULL"); } } diff --git a/src/ADAPTGUI/HOMARDGUI_Utils.h b/src/ADAPTGUI/HOMARDGUI_Utils.h index d257dbb6f..a2f24a6e2 100644 --- a/src/ADAPTGUI/HOMARDGUI_Utils.h +++ b/src/ADAPTGUI/HOMARDGUI_Utils.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(HOMARD_Cas) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include "SALOMEDSClient_definitions.hxx" #include "SALOME_InteractiveObject.hxx" diff --git a/src/ADAPTGUI/HomardQtCommun.h b/src/ADAPTGUI/HomardQtCommun.h index 4587833e2..32f32deff 100644 --- a/src/ADAPTGUI/HomardQtCommun.h +++ b/src/ADAPTGUI/HomardQtCommun.h @@ -29,7 +29,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include CORBA_CLIENT_HEADER(HOMARD_Cas) #include diff --git a/src/ADAPTGUI/MonCreateBoundaryAn.cxx b/src/ADAPTGUI/MonCreateBoundaryAn.cxx index 40fa47f4b..a9a4880ee 100644 --- a/src/ADAPTGUI/MonCreateBoundaryAn.cxx +++ b/src/ADAPTGUI/MonCreateBoundaryAn.cxx @@ -41,7 +41,7 @@ using namespace std; // ------------------------------------------------------------------------------------------------------------------------ MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen0, + ADAPT::ADAPT_Gen_var myHomardGen0, QString caseName) : // ------------------------------------------------------------------------------------------------------------------------------ /* Constructs a MonCreateBoundaryAn @@ -67,7 +67,7 @@ MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, bool modal, Chgt (false) { MESSAGE("Constructeur") ; - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); + myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0); setupUi(this); setModal(modal); @@ -103,7 +103,7 @@ MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, bool modal, } // -------------------------------------------------------------------------------------------------------------- MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, - HOMARD::HOMARD_Gen_var myHomardGen0, + ADAPT::ADAPT_Gen_var myHomardGen0, QString caseName): // -------------------------------------------------------------------------------------------------------------- // @@ -172,8 +172,8 @@ void MonCreateBoundaryAn::InitValBoundaryAn() // if (_aCaseName == QString("")) { return; } - HOMARD::HOMARD_Cas_var aCas = myHomardGen->GetCase(_aCaseName.toStdString().c_str()); - HOMARD::extrema_var MesExtremes = aCas->GetBoundingBox(); + ADAPT::HOMARD_Cas_var aCas = myHomardGen->GetCase(_aCaseName.toStdString().c_str()); + ADAPT::extrema_var MesExtremes = aCas->GetBoundingBox(); int num = MesExtremes->length() ; ASSERT(num == 10); _Xmin=MesExtremes[0]; _Xmax=MesExtremes[1]; _Xincr=MesExtremes[2]; @@ -521,7 +521,7 @@ void MonCreateBoundaryAn::SetNewName() { // Recherche d'un nom par defaut qui n'existe pas encore - HOMARD::listeBoundarys_var MyObjects = myHomardGen->GetAllBoundarysName(); + ADAPT::listeBoundarys_var MyObjects = myHomardGen->GetAllBoundarysName(); int num = 0; QString aName=""; while (aName=="" ) { diff --git a/src/ADAPTGUI/MonCreateBoundaryAn.h b/src/ADAPTGUI/MonCreateBoundaryAn.h index 46c838ac9..2576d14fd 100644 --- a/src/ADAPTGUI/MonCreateBoundaryAn.h +++ b/src/ADAPTGUI/MonCreateBoundaryAn.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include CORBA_CLIENT_HEADER(HOMARD_Boundary) #include "ui_CreateBoundaryAn.h" @@ -39,13 +39,13 @@ class HOMARD_EXPORT MonCreateBoundaryAn : public QDialog, public Ui_CreateBounda public: MonCreateBoundaryAn( MonCreateCase* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString caseName); virtual ~MonCreateBoundaryAn(); protected : MonCreateBoundaryAn( MonCreateCase* parent, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString caseName); MonCreateCase * _parent; @@ -70,8 +70,8 @@ protected : bool Chgt; - HOMARD::HOMARD_Boundary_var aBoundaryAn ; - HOMARD::HOMARD_Gen_var myHomardGen; + ADAPT::HOMARD_Boundary_var aBoundaryAn ; + ADAPT::ADAPT_Gen_var myHomardGen; virtual void InitConnect(); virtual void InitValBoundaryAn(); diff --git a/src/ADAPTGUI/MonCreateBoundaryCAO.cxx b/src/ADAPTGUI/MonCreateBoundaryCAO.cxx index da07e84a5..da3f9d31e 100644 --- a/src/ADAPTGUI/MonCreateBoundaryCAO.cxx +++ b/src/ADAPTGUI/MonCreateBoundaryCAO.cxx @@ -33,14 +33,14 @@ using namespace std; // ------------------------------------------------------------------------------- MonCreateBoundaryCAO::MonCreateBoundaryCAO(MonCreateCase* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen0, + ADAPT::ADAPT_Gen_var myHomardGen0, QString caseName, QString aName) // --------------------------------------------------------------------------------- /* Constructs a MonCreateBoundaryCAO */ : QDialog(0), Ui_CreateBoundaryCAO(), _parent(parent), _aName(aName), - myHomardGen(HOMARD::HOMARD_Gen::_duplicate(myHomardGen0)), + myHomardGen(ADAPT::ADAPT_Gen::_duplicate(myHomardGen0)), _aCaseName(caseName) { MESSAGE("Constructeur") ; @@ -137,7 +137,7 @@ void MonCreateBoundaryCAO::PushOnHelp() void MonCreateBoundaryCAO::AssocieLesGroupes() // ------------------------------------------------------------------------ { - HOMARD::ListGroupType_var aSeqGroupe = new HOMARD::ListGroupType; + ADAPT::ListGroupType_var aSeqGroupe = new ADAPT::ListGroupType; aSeqGroupe->length(_listeGroupesBoundary.size()); QStringList::const_iterator it; int i=0; @@ -152,7 +152,7 @@ void MonCreateBoundaryCAO::SetNewName() // -------------------------------------------------- { - HOMARD::listeBoundarys_var MyObjects = myHomardGen->GetAllBoundarysName(); + ADAPT::listeBoundarys_var MyObjects = myHomardGen->GetAllBoundarysName(); int num = 0; QString aName=""; while (aName == QString("") ) { @@ -195,7 +195,7 @@ void MonCreateBoundaryCAO::SetFiltrage() return; } - MonCreateListGroupCAO *aDlg = new MonCreateListGroupCAO(NULL, this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), + MonCreateListGroupCAO *aDlg = new MonCreateListGroupCAO(NULL, this, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen), _aCaseName, _listeGroupesBoundary) ; aDlg->show(); } diff --git a/src/ADAPTGUI/MonCreateBoundaryCAO.h b/src/ADAPTGUI/MonCreateBoundaryCAO.h index 1b6eff095..1d5b646e1 100644 --- a/src/ADAPTGUI/MonCreateBoundaryCAO.h +++ b/src/ADAPTGUI/MonCreateBoundaryCAO.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include CORBA_CLIENT_HEADER(HOMARD_Boundary) #include "ui_CreateBoundaryCAO.h" @@ -39,7 +39,7 @@ class HOMARD_EXPORT MonCreateBoundaryCAO : public QDialog, public Ui_CreateBound public: MonCreateBoundaryCAO( MonCreateCase* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString caseName, QString BoundaryName ); ~MonCreateBoundaryCAO(); virtual void setGroups (QStringList listGroup); @@ -52,8 +52,8 @@ protected : QString _aCaseName; - HOMARD::HOMARD_Boundary_var aBoundary; - HOMARD::HOMARD_Gen_var myHomardGen; + ADAPT::HOMARD_Boundary_var aBoundary; + ADAPT::ADAPT_Gen_var myHomardGen; QStringList _listeGroupesBoundary; diff --git a/src/ADAPTGUI/MonCreateBoundaryDi.cxx b/src/ADAPTGUI/MonCreateBoundaryDi.cxx index f61b7653f..8d1158c72 100644 --- a/src/ADAPTGUI/MonCreateBoundaryDi.cxx +++ b/src/ADAPTGUI/MonCreateBoundaryDi.cxx @@ -33,14 +33,14 @@ using namespace std; // ------------------------------------------------------------------------------- MonCreateBoundaryDi::MonCreateBoundaryDi(MonCreateCase* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen0, + ADAPT::ADAPT_Gen_var myHomardGen0, QString caseName, QString aName) // --------------------------------------------------------------------------------- /* Constructs a MonCreateBoundaryDi */ : QDialog(0), Ui_CreateBoundaryDi(), _parent(parent), _aName(aName), - myHomardGen(HOMARD::HOMARD_Gen::_duplicate(myHomardGen0)), + myHomardGen(ADAPT::ADAPT_Gen::_duplicate(myHomardGen0)), _aCaseName(caseName) { MESSAGE("Constructeur") ; @@ -146,7 +146,7 @@ void MonCreateBoundaryDi::PushOnHelp() void MonCreateBoundaryDi::AssocieLesGroupes() // ------------------------------------------------------------------------ { - HOMARD::ListGroupType_var aSeqGroupe = new HOMARD::ListGroupType; + ADAPT::ListGroupType_var aSeqGroupe = new ADAPT::ListGroupType; aSeqGroupe->length(_listeGroupesBoundary.size()); QStringList::const_iterator it; int i=0; @@ -161,7 +161,7 @@ void MonCreateBoundaryDi::SetNewName() // -------------------------------------------------- { - HOMARD::listeBoundarys_var MyObjects = myHomardGen->GetAllBoundarysName(); + ADAPT::listeBoundarys_var MyObjects = myHomardGen->GetAllBoundarysName(); int num = 0; QString aName=""; while (aName == QString("") ) { @@ -204,7 +204,7 @@ void MonCreateBoundaryDi::SetFiltrage() return; } - MonCreateListGroup *aDlg = new MonCreateListGroup(NULL, this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), + MonCreateListGroup *aDlg = new MonCreateListGroup(NULL, this, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen), _aCaseName, _listeGroupesBoundary) ; aDlg->show(); } diff --git a/src/ADAPTGUI/MonCreateBoundaryDi.h b/src/ADAPTGUI/MonCreateBoundaryDi.h index b81ef6a7c..de99a1120 100644 --- a/src/ADAPTGUI/MonCreateBoundaryDi.h +++ b/src/ADAPTGUI/MonCreateBoundaryDi.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include CORBA_CLIENT_HEADER(HOMARD_Boundary) #include "ui_CreateBoundaryDi.h" @@ -39,7 +39,7 @@ class HOMARD_EXPORT MonCreateBoundaryDi : public QDialog, public Ui_CreateBounda public: MonCreateBoundaryDi( MonCreateCase* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString caseName, QString BoundaryName ); ~MonCreateBoundaryDi(); virtual void setGroups (QStringList listGroup); @@ -52,8 +52,8 @@ protected : QString _aCaseName; - HOMARD::HOMARD_Boundary_var aBoundary; - HOMARD::HOMARD_Gen_var myHomardGen; + ADAPT::HOMARD_Boundary_var aBoundary; + ADAPT::ADAPT_Gen_var myHomardGen; QStringList _listeGroupesBoundary; diff --git a/src/ADAPTGUI/MonCreateCase.cxx b/src/ADAPTGUI/MonCreateCase.cxx index fa451efa7..3943d3ed4 100644 --- a/src/ADAPTGUI/MonCreateCase.cxx +++ b/src/ADAPTGUI/MonCreateCase.cxx @@ -46,7 +46,7 @@ using namespace std; * Sets attributes to default values */ // ----------------------------------------------------------------------------------------- -MonCreateCase::MonCreateCase( bool modal, HOMARD::HOMARD_Gen_var myHomardGen0 ) +MonCreateCase::MonCreateCase( bool modal, ADAPT::ADAPT_Gen_var myHomardGen0 ) : Ui_CreateCase(), _aCaseName(""),_aDirName(""), @@ -55,7 +55,7 @@ MonCreateCase::MonCreateCase( bool modal, HOMARD::HOMARD_Gen_var myHomardGen0 ) _Pyram(0) { MESSAGE("Debut du constructeur de MonCreateCase"); - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); + myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0); setupUi(this); setModal(modal); InitConnect(); @@ -132,7 +132,7 @@ void MonCreateCase::InitBoundarys() { MESSAGE("InitBoundarys"); // Pour les frontieres analytiques : la colonne des groupes - HOMARD::ListGroupType_var _listeGroupesCas = aCase->GetGroups(); + ADAPT::ListGroupType_var _listeGroupesCas = aCase->GetGroups(); QTableWidgetItem *__colItem = new QTableWidgetItem(); __colItem->setText(QApplication::translate("CreateCase", "", 0)); TWBoundary->setHorizontalHeaderItem(0, __colItem); @@ -145,8 +145,8 @@ void MonCreateCase::InitBoundarys() // Pour les frontieres CAO : la liste a saisir // Pour les frontieres discretes : la liste a saisir // Pour les frontieres analytiques : les colonnes de chaque frontiere - HOMARD::HOMARD_Boundary_var myBoundary ; - HOMARD::listeBoundarys_var mesBoundarys = myHomardGen->GetAllBoundarysName(); + ADAPT::HOMARD_Boundary_var myBoundary ; + ADAPT::listeBoundarys_var mesBoundarys = myHomardGen->GetAllBoundarysName(); // MESSAGE("Nombre de frontieres enregistrees : "<length()); for (int i=0; ilength(); i++) { @@ -352,7 +352,7 @@ void MonCreateCase::PushOnHelp() void MonCreateCase::SetNewName() // ------------------------------ { - HOMARD::listeCases_var MyCases = myHomardGen->GetAllCasesName(); + ADAPT::listeCases_var MyCases = myHomardGen->GetAllCasesName(); int num = 0; QString aCaseName=""; while (aCaseName=="" ) { @@ -507,7 +507,7 @@ void MonCreateCase::PushBoundaryCAONew() // ------------------------------------------------------------------------ { MonCreateBoundaryCAO *BoundaryDlg = new MonCreateBoundaryCAO(this, true, - HOMARD::HOMARD_Gen::_duplicate(myHomardGen), _aCaseName, "") ; + ADAPT::ADAPT_Gen::_duplicate(myHomardGen), _aCaseName, "") ; BoundaryDlg->show(); } // ------------------------------------------------------------------------ @@ -516,7 +516,7 @@ void MonCreateCase::PushBoundaryCAOEdit() { if (CBBoundaryCAO->currentText() == QString("")) return; MonEditBoundaryCAO *BoundaryDlg = new MonEditBoundaryCAO(this, true, - HOMARD::HOMARD_Gen::_duplicate(myHomardGen), _aCaseName, CBBoundaryCAO->currentText() ) ; + ADAPT::ADAPT_Gen::_duplicate(myHomardGen), _aCaseName, CBBoundaryCAO->currentText() ) ; BoundaryDlg->show(); } // ------------------------------------------------------------------------ @@ -555,7 +555,7 @@ void MonCreateCase::PushBoundaryDiNew() // ------------------------------------------------------------------------ { MonCreateBoundaryDi *BoundaryDlg = new MonCreateBoundaryDi(this, true, - HOMARD::HOMARD_Gen::_duplicate(myHomardGen), _aCaseName, "") ; + ADAPT::ADAPT_Gen::_duplicate(myHomardGen), _aCaseName, "") ; BoundaryDlg->show(); } // ------------------------------------------------------------------------ @@ -564,7 +564,7 @@ void MonCreateCase::PushBoundaryDiEdit() { if (CBBoundaryDi->currentText() == QString("")) return; MonEditBoundaryDi *BoundaryDlg = new MonEditBoundaryDi(this, true, - HOMARD::HOMARD_Gen::_duplicate(myHomardGen), _aCaseName, CBBoundaryDi->currentText() ) ; + ADAPT::ADAPT_Gen::_duplicate(myHomardGen), _aCaseName, CBBoundaryDi->currentText() ) ; BoundaryDlg->show(); } // ------------------------------------------------------------------------ @@ -624,7 +624,7 @@ void MonCreateCase::PushBoundaryAnNew() // ------------------------------------------------------------------------ { MonCreateBoundaryAn *BoundaryDlg = new MonCreateBoundaryAn(this, true, - HOMARD::HOMARD_Gen::_duplicate(myHomardGen), _aCaseName) ; + ADAPT::ADAPT_Gen::_duplicate(myHomardGen), _aCaseName) ; BoundaryDlg->show(); } // ------------------------------------------------------------------------ @@ -641,7 +641,7 @@ void MonCreateCase::PushBoundaryAnEdit() MESSAGE("nom "<show(); } } } diff --git a/src/ADAPTGUI/MonCreateCase.h b/src/ADAPTGUI/MonCreateCase.h index ab1a2f4c1..03178ef2e 100644 --- a/src/ADAPTGUI/MonCreateCase.h +++ b/src/ADAPTGUI/MonCreateCase.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include CORBA_CLIENT_HEADER(HOMARD_Cas) #include "ui_CreateCase.h" @@ -37,7 +37,7 @@ class HOMARD_EXPORT MonCreateCase : public QDialog, public Ui_CreateCase Q_OBJECT public: - MonCreateCase( bool modal, HOMARD::HOMARD_Gen_var myHomardGen ); + MonCreateCase( bool modal, ADAPT::ADAPT_Gen_var myHomardGen ); ~MonCreateCase(); void AddBoundaryCAO(QString newBoundary); @@ -53,8 +53,8 @@ protected : int _Pyram; - HOMARD::HOMARD_Cas_var aCase ; - HOMARD::HOMARD_Gen_var myHomardGen; + ADAPT::HOMARD_Cas_var aCase ; + ADAPT::ADAPT_Gen_var myHomardGen; virtual void InitConnect(); virtual void InitBoundarys(); diff --git a/src/ADAPTGUI/MonCreateHypothesis.cxx b/src/ADAPTGUI/MonCreateHypothesis.cxx index 6b03def0e..add1122ee 100644 --- a/src/ADAPTGUI/MonCreateHypothesis.cxx +++ b/src/ADAPTGUI/MonCreateHypothesis.cxx @@ -35,7 +35,7 @@ using namespace std; // ------------------------------------------------------------------------------- MonCreateHypothesis::MonCreateHypothesis(MonCreateIteration* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen0, + ADAPT::ADAPT_Gen_var myHomardGen0, QString Name, QString caseName, QString aFieldFile) // --------------------------------------------------------------------------------- @@ -56,7 +56,7 @@ MonCreateHypothesis::MonCreateHypothesis(MonCreateIteration* parent, bool modal, { MESSAGE("Constructeur") ; - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); + myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0); setupUi(this); if ( modal ) { setWindowModality(Qt::WindowModal); } else { setWindowModality(Qt::NonModal); } @@ -231,7 +231,7 @@ void MonCreateHypothesis::SetNewName() // -------------------------------------------------- { - HOMARD::listeHypotheses_var MyObjects = myHomardGen->GetAllHypothesesName(); + ADAPT::listeHypotheses_var MyObjects = myHomardGen->GetAllHypothesesName(); int num = 0;// QString aName=""; while (aName=="" ) @@ -318,7 +318,7 @@ void MonCreateHypothesis::PushZoneNew() // ------------------------------------------------------------------------ { MESSAGE("Debut de MonCreateHypothesis::PushZoneNew") - MonCreateZone *aDlg = new MonCreateZone(this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), _aCaseName) ; + MonCreateZone *aDlg = new MonCreateZone(this, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen), _aCaseName) ; aDlg->show(); } @@ -336,7 +336,7 @@ void MonCreateHypothesis::PushZoneEdit() return; } QString zoneName = monItem->text().trimmed(); - MonEditZone *aDlg = new MonEditZone(this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), _aCaseName, zoneName) ; + MonEditZone *aDlg = new MonEditZone(this, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen), _aCaseName, zoneName) ; aDlg->show(); } // ------------------------------------------------------------------------ @@ -357,7 +357,7 @@ void MonCreateHypothesis::GetAllZones() // Par defaut, aucune n'est selectionnee { MESSAGE("Debut de GetAllZones") ; - HOMARD::listeZones_var mesZones = myHomardGen->GetAllZonesName(); + ADAPT::listeZones_var mesZones = myHomardGen->GetAllZonesName(); int nbrow=TWZone->rowCount(); for ( int row=0; row< nbrow; row++) { @@ -711,7 +711,7 @@ void MonCreateHypothesis::SetFiltrage() // ------------------------------------------------------------------------ { if (!CBGroupe->isChecked()) return; - MonCreateListGroup *aDlg = new MonCreateListGroup(this, NULL, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen),_aCaseName, _aListeGroupes) ; + MonCreateListGroup *aDlg = new MonCreateListGroup(this, NULL, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen),_aCaseName, _aListeGroupes) ; aDlg->show(); } @@ -805,7 +805,7 @@ void MonCreateHypothesis::AssocieComposants() void MonCreateHypothesis::AssocieLesGroupes() // ------------------------------------------------------------------------ { - HOMARD::ListGroupType_var aSeqGroupe = new HOMARD::ListGroupType; + ADAPT::ListGroupType_var aSeqGroupe = new ADAPT::ListGroupType; aSeqGroupe->length(_aListeGroupes.size()); QStringList::const_iterator it; int i=0; diff --git a/src/ADAPTGUI/MonCreateHypothesis.h b/src/ADAPTGUI/MonCreateHypothesis.h index 929ee30aa..a760fcfef 100644 --- a/src/ADAPTGUI/MonCreateHypothesis.h +++ b/src/ADAPTGUI/MonCreateHypothesis.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include CORBA_CLIENT_HEADER(HOMARD_Hypothesis) #include "ui_CreateHypothesis.h" @@ -38,7 +38,7 @@ class HOMARD_EXPORT MonCreateHypothesis : public QScrollArea, public Ui_CreateHy Q_OBJECT public: - MonCreateHypothesis( MonCreateIteration* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, + MonCreateHypothesis( MonCreateIteration* parent, bool modal, ADAPT::ADAPT_Gen_var myHomardGen, QString aHypotheseName, QString caseName, QString aFieldFile); ~MonCreateHypothesis(); @@ -46,7 +46,7 @@ public: virtual void setGroups(QStringList listGroup); protected : - // MonCreateHypothesis( MonCreateIteration* parent, HOMARD::HOMARD_Gen_var myHomardGen, + // MonCreateHypothesis( MonCreateIteration* parent, ADAPT::ADAPT_Gen_var myHomardGen, // QString caseName, QString aFieldFile); MonCreateIteration *_parent; @@ -74,8 +74,8 @@ protected : int _AdapInit; int _ExtraOutput; - HOMARD::HOMARD_Hypothesis_var aHypothesis; - HOMARD::HOMARD_Gen_var myHomardGen; + ADAPT::HOMARD_Hypothesis_var aHypothesis; + ADAPT::ADAPT_Gen_var myHomardGen; QStringList _aListeZone; QStringList _aListeComposant; diff --git a/src/ADAPTGUI/MonCreateIteration.cxx b/src/ADAPTGUI/MonCreateIteration.cxx index 99da0c955..8d4d200d3 100644 --- a/src/ADAPTGUI/MonCreateIteration.cxx +++ b/src/ADAPTGUI/MonCreateIteration.cxx @@ -33,7 +33,7 @@ using namespace std; // ----------------------------------------------------------------------------------------------------- MonCreateIteration::MonCreateIteration(QWidget* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen0, QString IterParentName ): + ADAPT::ADAPT_Gen_var myHomardGen0, QString IterParentName ): // ----------------------------------------------------------------------------------------------------- /* Constructs a MonCreateIteration * Inherits from CasHomard @@ -46,7 +46,7 @@ MonCreateIteration::MonCreateIteration(QWidget* parent, bool modal, _CaseName("") { MESSAGE("Constructeur"); - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); + myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0); setupUi(this); if ( modal ) { setWindowModality(Qt::WindowModal); } else { setWindowModality(Qt::NonModal); } @@ -87,7 +87,7 @@ void MonCreateIteration::InitConnect() void MonCreateIteration::GetHypotheses() // ------------------------------------------------------------------------ { - HOMARD::listeHypotheses_var mesHypotheses = myHomardGen->GetAllHypothesesName(); + ADAPT::listeHypotheses_var mesHypotheses = myHomardGen->GetAllHypothesesName(); for (int i=0; ilength(); i++) { CBHypothese->addItem(QString(mesHypotheses[i])); @@ -128,8 +128,8 @@ bool MonCreateIteration::PushOnApply() QObject::tr("HOM_ITER_HYPO") ); return false; } - HOMARD::HOMARD_Hypothesis_var _myHypothesis = myHomardGen->GetHypothesis(monHypoName.toStdString().c_str()); - HOMARD::listeTypes_var ListTypes (_myHypothesis->GetAdapRefinUnRef()); + ADAPT::HOMARD_Hypothesis_var _myHypothesis = myHomardGen->GetHypothesis(monHypoName.toStdString().c_str()); + ADAPT::listeTypes_var ListTypes (_myHypothesis->GetAdapRefinUnRef()); int TypeAdap = ListTypes[0]; if ( TypeAdap == 1 && LEFieldFile->text().trimmed() == QString("") ) { @@ -202,7 +202,7 @@ void MonCreateIteration::SetIterParentName() if (_IterParentName == QString("")) { raise();return;}; } _CaseName=HOMARD_QT_COMMUN::SelectionCasEtude(); - HOMARD::HOMARD_Iteration_var aIterParent = myHomardGen->GetIteration(_IterParentName.toStdString().c_str()) ; + ADAPT::HOMARD_Iteration_var aIterParent = myHomardGen->GetIteration(_IterParentName.toStdString().c_str()) ; QString MeshName = aIterParent->GetMeshName(); LEMeshName_n->setText(MeshName); @@ -217,7 +217,7 @@ void MonCreateIteration::SetNewName() { // Recherche d'un nom par defaut qui n'existe pas encore - HOMARD::listeIterations_var MyObjects=myHomardGen->GetAllIterationsName(); + ADAPT::listeIterations_var MyObjects=myHomardGen->GetAllIterationsName(); int num = 0;// QString aName=""; while (aName=="" ) @@ -249,7 +249,7 @@ void MonCreateIteration::PushHypoEdit() return; } QString aFieldFile=LEFieldFile->text().trimmed(); - MonEditHypothesis *HypoDlg = new MonEditHypothesis(this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen),CBHypothese->currentText(), _CaseName, aFieldFile) ; + MonEditHypothesis *HypoDlg = new MonEditHypothesis(this, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen),CBHypothese->currentText(), _CaseName, aFieldFile) ; HypoDlg->show(); } @@ -273,11 +273,11 @@ void MonCreateIteration::PushHypoNew() } if ( _CaseName == QString("")) { - HOMARD::HOMARD_Iteration_var aIterParent = myHomardGen->GetIteration(_IterParentName.toStdString().c_str()) ; + ADAPT::HOMARD_Iteration_var aIterParent = myHomardGen->GetIteration(_IterParentName.toStdString().c_str()) ; _CaseName = aIterParent->GetCaseName(); } QString aFieldFile=LEFieldFile->text().trimmed(); - MonCreateHypothesis *HypoDlg = new MonCreateHypothesis(this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), QString(""), _CaseName, aFieldFile) ; + MonCreateHypothesis *HypoDlg = new MonCreateHypothesis(this, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen), QString(""), _CaseName, aFieldFile) ; HypoDlg->show(); } // ------------------------------------------------------------------------ diff --git a/src/ADAPTGUI/MonCreateIteration.h b/src/ADAPTGUI/MonCreateIteration.h index 7567c4866..a10f48d91 100644 --- a/src/ADAPTGUI/MonCreateIteration.h +++ b/src/ADAPTGUI/MonCreateIteration.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include CORBA_CLIENT_HEADER(HOMARD_Cas) #include "ui_CreateIteration.h" @@ -37,24 +37,24 @@ class HOMARD_EXPORT MonCreateIteration : public QScrollArea, public Ui_CreateIte Q_OBJECT public: - MonCreateIteration( QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString IterParentName ); + MonCreateIteration( QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myHomardGen, QString IterParentName ); ~MonCreateIteration(); void addHypothese(QString newHypothese); protected : - MonCreateIteration( QWidget* parent, HOMARD::HOMARD_Gen_var myHomardGen, QString IterParentName ); + MonCreateIteration( QWidget* parent, ADAPT::ADAPT_Gen_var myHomardGen, QString IterParentName ); QString _Name; QString _IterParentName; QString _CaseName; - HOMARD::HOMARD_Iteration_var aIter ; - HOMARD::HOMARD_Iteration_var aIterParent ; - HOMARD::HOMARD_Cas_var aCas ; - HOMARD::HOMARD_Gen_var myHomardGen; + ADAPT::HOMARD_Iteration_var aIter ; + ADAPT::HOMARD_Iteration_var aIterParent ; + ADAPT::HOMARD_Cas_var aCas ; + ADAPT::ADAPT_Gen_var myHomardGen; virtual void InitConnect(); diff --git a/src/ADAPTGUI/MonCreateListGroup.cxx b/src/ADAPTGUI/MonCreateListGroup.cxx index 28f93e315..7664a01fe 100644 --- a/src/ADAPTGUI/MonCreateListGroup.cxx +++ b/src/ADAPTGUI/MonCreateListGroup.cxx @@ -38,7 +38,7 @@ using namespace std; // -------------------------------------------------------------------------------------------------------------- MonCreateListGroup::MonCreateListGroup(MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen0, QString aCaseName, QStringList listeGroupesHypo) : + ADAPT::ADAPT_Gen_var myHomardGen0, QString aCaseName, QStringList listeGroupesHypo) : // -------------------------------------------------------------------------------------------------------------- // QDialog(0), Ui_CreateListGroup(), @@ -48,7 +48,7 @@ MonCreateListGroup::MonCreateListGroup(MonCreateHypothesis* parentHyp, MonCreate _parentBound(parentBound) { MESSAGE("Debut de MonCreateListGroup") - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); + myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0); setupUi(this); setModal(modal); InitConnect(); @@ -56,7 +56,7 @@ MonCreateListGroup::MonCreateListGroup(MonCreateHypothesis* parentHyp, MonCreate } // -------------------------------------------------------------------------------------------------------------- MonCreateListGroup::MonCreateListGroup(MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, - HOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo) : + ADAPT::ADAPT_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo) : // -------------------------------------------------------------------------------------------------------------- // QDialog(0), Ui_CreateListGroup(), @@ -65,7 +65,7 @@ MonCreateListGroup::MonCreateListGroup(MonCreateHypothesis* parentHyp, MonCreate _parentHyp(parentHyp), _parentBound(parentBound) { - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen); + myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen); setupUi(this); InitConnect(); } @@ -130,8 +130,8 @@ void MonCreateListGroup::InitGroupes() TWGroupe->removeRow(row); TWGroupe->setRowCount(0); if (_aCaseName == QString("")) { return; }; - HOMARD::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str()); - HOMARD::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); + ADAPT::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str()); + ADAPT::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); for ( int i = 0; i < _listeGroupesCas->length(); i++ ) { TWGroupe->insertRow(i); diff --git a/src/ADAPTGUI/MonCreateListGroup.h b/src/ADAPTGUI/MonCreateListGroup.h index b0472d3b9..4aa8a159e 100644 --- a/src/ADAPTGUI/MonCreateListGroup.h +++ b/src/ADAPTGUI/MonCreateListGroup.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include "ui_CreateListGroup.h" #include @@ -38,13 +38,13 @@ class HOMARD_EXPORT MonCreateListGroup : public QDialog, public Ui_CreateListGro Q_OBJECT public: - MonCreateListGroup( MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); - MonCreateListGroup( MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, HOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); + MonCreateListGroup( MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, bool modal, ADAPT::ADAPT_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); + MonCreateListGroup( MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, ADAPT::ADAPT_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); virtual ~MonCreateListGroup(); protected : - HOMARD::HOMARD_Gen_var myHomardGen; + ADAPT::ADAPT_Gen_var myHomardGen; MonCreateHypothesis * _parentHyp; MonCreateBoundaryDi * _parentBound; diff --git a/src/ADAPTGUI/MonCreateListGroupCAO.cxx b/src/ADAPTGUI/MonCreateListGroupCAO.cxx index 796f2502d..a630d4558 100644 --- a/src/ADAPTGUI/MonCreateListGroupCAO.cxx +++ b/src/ADAPTGUI/MonCreateListGroupCAO.cxx @@ -38,7 +38,7 @@ using namespace std; // -------------------------------------------------------------------------------------------------------------- MonCreateListGroupCAO::MonCreateListGroupCAO(MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen0, QString aCaseName, QStringList listeGroupesHypo) : + ADAPT::ADAPT_Gen_var myHomardGen0, QString aCaseName, QStringList listeGroupesHypo) : // -------------------------------------------------------------------------------------------------------------- // QDialog(0), Ui_CreateListGroup(), @@ -48,7 +48,7 @@ MonCreateListGroupCAO::MonCreateListGroupCAO(MonCreateHypothesis* parentHyp, Mon _parentBound(parentBound) { MESSAGE("Debut de MonCreateListGroupCAO") - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); + myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0); setupUi(this); setModal(modal); InitConnect(); @@ -56,7 +56,7 @@ MonCreateListGroupCAO::MonCreateListGroupCAO(MonCreateHypothesis* parentHyp, Mon } // -------------------------------------------------------------------------------------------------------------- MonCreateListGroupCAO::MonCreateListGroupCAO(MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, - HOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo) : + ADAPT::ADAPT_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo) : // -------------------------------------------------------------------------------------------------------------- // QDialog(0), Ui_CreateListGroup(), @@ -65,7 +65,7 @@ MonCreateListGroupCAO::MonCreateListGroupCAO(MonCreateHypothesis* parentHyp, Mon _parentHyp(parentHyp), _parentBound(parentBound) { - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen); + myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen); setupUi(this); InitConnect(); } @@ -127,8 +127,8 @@ void MonCreateListGroupCAO::InitGroupes() TWGroupe->removeRow(row); TWGroupe->setRowCount(0); if (_aCaseName == QString("")) { return; }; - HOMARD::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str()); - HOMARD::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); + ADAPT::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str()); + ADAPT::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); for ( int i = 0; i < _listeGroupesCas->length(); i++ ) { TWGroupe->insertRow(i); diff --git a/src/ADAPTGUI/MonCreateListGroupCAO.h b/src/ADAPTGUI/MonCreateListGroupCAO.h index 898389b83..8917c4136 100644 --- a/src/ADAPTGUI/MonCreateListGroupCAO.h +++ b/src/ADAPTGUI/MonCreateListGroupCAO.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include "ui_CreateListGroup.h" #include @@ -38,13 +38,13 @@ class HOMARD_EXPORT MonCreateListGroupCAO : public QDialog, public Ui_CreateList Q_OBJECT public: - MonCreateListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); - MonCreateListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, HOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); + MonCreateListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, bool modal, ADAPT::ADAPT_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); + MonCreateListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, ADAPT::ADAPT_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); virtual ~MonCreateListGroupCAO(); protected : - HOMARD::HOMARD_Gen_var myHomardGen; + ADAPT::ADAPT_Gen_var myHomardGen; MonCreateHypothesis * _parentHyp; MonCreateBoundaryCAO * _parentBound; diff --git a/src/ADAPTGUI/MonCreateYACS.cxx b/src/ADAPTGUI/MonCreateYACS.cxx index 4d1002798..9572db73a 100644 --- a/src/ADAPTGUI/MonCreateYACS.cxx +++ b/src/ADAPTGUI/MonCreateYACS.cxx @@ -34,7 +34,7 @@ using namespace std; // ---------------------------------------------------------------------- -MonCreateYACS::MonCreateYACS (bool modal, HOMARD::HOMARD_Gen_var myHomardGen0, QString CaseName ): +MonCreateYACS::MonCreateYACS (bool modal, ADAPT::ADAPT_Gen_var myHomardGen0, QString CaseName ): // ---------------------------------------------------------------------- /* Constructs a MonCreateYACS * Sets attributes to default values @@ -46,11 +46,11 @@ MonCreateYACS::MonCreateYACS (bool modal, HOMARD::HOMARD_Gen_var myHomardGen0, Q _aDirName(""), _aMeshFile(""), _Type(1) - // Les valeurs de _Type, _MaxIter, _MaxNode, _MaxElem doivent etre les memes que celles dans HOMARD_Gen_i::CreateYACSSchema + // Les valeurs de _Type, _MaxIter, _MaxNode, _MaxElem doivent etre les memes que celles dans ADAPT_Gen_i::CreateYACSSchema // et doivent correspondre aux defauts des boutons { // MESSAGE("Debut du constructeur de MonCreateYACS"); - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); + myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0); setupUi(this); if ( modal ) { setWindowModality(Qt::WindowModal); } else { setWindowModality(Qt::NonModal); } @@ -75,7 +75,7 @@ MonCreateYACS::MonCreateYACS (bool modal, HOMARD::HOMARD_Gen_var myHomardGen0, Q } // ---------------------------------------------------------------------- -MonCreateYACS::MonCreateYACS(HOMARD::HOMARD_Gen_var myHomardGen0, +MonCreateYACS::MonCreateYACS(ADAPT::ADAPT_Gen_var myHomardGen0, QString caseName): // ---------------------------------------------------------------------- // Constructeur appele par MonEditYACS @@ -273,7 +273,7 @@ void MonCreateYACS::SetNewName() // -------------------------------------------------- { - HOMARD::listeYACSs_var MyObjects = myHomardGen->GetAllYACSsName(); + ADAPT::listeYACSs_var MyObjects = myHomardGen->GetAllYACSsName(); int num = 0; QString aName=""; while (aName == QString("") ) { diff --git a/src/ADAPTGUI/MonCreateYACS.h b/src/ADAPTGUI/MonCreateYACS.h index a0c5ba0f7..f932b704e 100644 --- a/src/ADAPTGUI/MonCreateYACS.h +++ b/src/ADAPTGUI/MonCreateYACS.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include CORBA_CLIENT_HEADER(HOMARD_Cas) #include "ui_CreateYACS.h" @@ -37,11 +37,11 @@ class HOMARD_EXPORT MonCreateYACS : public QScrollArea, public Ui_CreateYACS Q_OBJECT public: - MonCreateYACS( bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString CaseName); + MonCreateYACS( bool modal, ADAPT::ADAPT_Gen_var myHomardGen, QString CaseName); virtual ~MonCreateYACS(); protected : - MonCreateYACS( HOMARD::HOMARD_Gen_var myHomardGen, QString CaseName); + MonCreateYACS( ADAPT::ADAPT_Gen_var myHomardGen, QString CaseName); QString _Name; QString _aCaseName; @@ -56,8 +56,8 @@ class HOMARD_EXPORT MonCreateYACS : public QScrollArea, public Ui_CreateYACS bool Chgt; - HOMARD::HOMARD_YACS_var aYACS; - HOMARD::HOMARD_Gen_var myHomardGen; + ADAPT::HOMARD_YACS_var aYACS; + ADAPT::ADAPT_Gen_var myHomardGen; virtual void InitConnect(); virtual bool CreateOrUpdate(); diff --git a/src/ADAPTGUI/MonCreateZone.cxx b/src/ADAPTGUI/MonCreateZone.cxx index 1adb91653..b07d87e0b 100644 --- a/src/ADAPTGUI/MonCreateZone.cxx +++ b/src/ADAPTGUI/MonCreateZone.cxx @@ -38,7 +38,7 @@ using namespace std; // ---------------------------------------------------------------------- MonCreateZone::MonCreateZone(MonCreateHypothesis* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen0, + ADAPT::ADAPT_Gen_var myHomardGen0, QString caseName) : // ---------------------------------------------------------------------- /* Constructs a MonCreateZone @@ -61,7 +61,7 @@ MonCreateZone::MonCreateZone(MonCreateHypothesis* parent, bool modal, Chgt (false) { MESSAGE("Constructeur") ; - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0) ; + myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0) ; setupUi(this) ; setModal(modal) ; InitConnect( ) ; @@ -74,7 +74,7 @@ MonCreateZone::MonCreateZone(MonCreateHypothesis* parent, bool modal, } // ---------------------------------------------------------------------- MonCreateZone::MonCreateZone(MonCreateHypothesis* parent, - HOMARD::HOMARD_Gen_var myHomardGen0, + ADAPT::ADAPT_Gen_var myHomardGen0, QString caseName): // ---------------------------------------------------------------------- // Constructeur appele par MonEditZone @@ -131,8 +131,8 @@ void MonCreateZone::InitValZone() // if (_aCaseName == QString("")) { return; } - HOMARD::HOMARD_Cas_var aCas = myHomardGen->GetCase(_aCaseName.toStdString().c_str()) ; - HOMARD::extrema_var MesExtremes = aCas->GetBoundingBox() ; + ADAPT::HOMARD_Cas_var aCas = myHomardGen->GetCase(_aCaseName.toStdString().c_str()) ; + ADAPT::extrema_var MesExtremes = aCas->GetBoundingBox() ; int num = MesExtremes->length() ; ASSERT(num == 10) ; _Xmin=MesExtremes[0]; _Xmax=MesExtremes[1]; _Xincr=MesExtremes[2]; @@ -600,7 +600,7 @@ void MonCreateZone::SetNewName() MESSAGE("SetNewName"); // Recherche d'un nom par defaut qui n'existe pas encore - HOMARD::listeZones_var MyObjects = myHomardGen->GetAllZonesName() ; + ADAPT::listeZones_var MyObjects = myHomardGen->GetAllZonesName() ; int num = 0; QString aName=""; while (aName=="" ) { diff --git a/src/ADAPTGUI/MonCreateZone.h b/src/ADAPTGUI/MonCreateZone.h index 932e9965f..099c063e3 100644 --- a/src/ADAPTGUI/MonCreateZone.h +++ b/src/ADAPTGUI/MonCreateZone.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include "ui_CreateZone.h" #include @@ -38,13 +38,13 @@ class HOMARD_EXPORT MonCreateZone : public QDialog, public Ui_CreateZone public: MonCreateZone( MonCreateHypothesis* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString caseName); virtual ~MonCreateZone(); protected : MonCreateZone( MonCreateHypothesis* parent, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString caseName); MonCreateHypothesis * _parent; @@ -64,8 +64,8 @@ protected : bool Chgt; - HOMARD::HOMARD_Zone_var aZone ; - HOMARD::HOMARD_Gen_var myHomardGen; + ADAPT::HOMARD_Zone_var aZone ; + ADAPT::ADAPT_Gen_var myHomardGen; virtual void InitConnect(); virtual void InitValZone(); diff --git a/src/ADAPTGUI/MonEditBoundaryAn.cxx b/src/ADAPTGUI/MonEditBoundaryAn.cxx index 6f7889d94..bb9a8c340 100644 --- a/src/ADAPTGUI/MonEditBoundaryAn.cxx +++ b/src/ADAPTGUI/MonEditBoundaryAn.cxx @@ -27,7 +27,7 @@ using namespace std; // ------------------------------------------------------------------------ MonEditBoundaryAn::MonEditBoundaryAn( MonCreateCase* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString caseName, QString Name ): // ------------------------------------------------------------------------ /* Constructs a MonEditBoundaryAn @@ -95,7 +95,7 @@ void MonEditBoundaryAn::InitValEdit() void MonEditBoundaryAn::InitValBoundaryAnLimit() // ------------------------------------------------------------------------ { - HOMARD::double_array_var mesCoordLimits = aBoundaryAn->GetLimit(); + ADAPT::double_array_var mesCoordLimits = aBoundaryAn->GetLimit(); ASSERT(mesCoordLimits->length() == 3 ); _Xincr=mesCoordLimits[0]; _Yincr=mesCoordLimits[1]; @@ -105,7 +105,7 @@ void MonEditBoundaryAn::InitValBoundaryAnLimit() void MonEditBoundaryAn::InitValBoundaryAnCylindre() // ------------------------------------------------------------------------ { - HOMARD::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords(); + ADAPT::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords(); ASSERT(mesCoordBoundary->length() == 7 ); _BoundaryAnXcentre=mesCoordBoundary[0]; _BoundaryAnYcentre=mesCoordBoundary[1]; @@ -119,7 +119,7 @@ void MonEditBoundaryAn::InitValBoundaryAnCylindre() void MonEditBoundaryAn::InitValBoundaryAnSphere() // ------------------------------------------------------------------------ { - HOMARD::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords(); + ADAPT::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords(); ASSERT(mesCoordBoundary->length() == 4 ); _BoundaryAnXcentre=mesCoordBoundary[0]; _BoundaryAnYcentre=mesCoordBoundary[1]; @@ -130,7 +130,7 @@ void MonEditBoundaryAn::InitValBoundaryAnSphere() void MonEditBoundaryAn::InitValBoundaryAnConeA() // ------------------------------------------------------------------------ { - HOMARD::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords(); + ADAPT::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords(); ASSERT(mesCoordBoundary->length() == 7 ); _BoundaryAnXaxisCone=mesCoordBoundary[0]; _BoundaryAnYaxisCone=mesCoordBoundary[1]; @@ -145,7 +145,7 @@ void MonEditBoundaryAn::InitValBoundaryAnConeA() void MonEditBoundaryAn::InitValBoundaryAnConeR() // ------------------------------------------------------------------------ { - HOMARD::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords(); + ADAPT::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords(); ASSERT(mesCoordBoundary->length() == 8 ); _BoundaryAnXcone1=mesCoordBoundary[0]; _BoundaryAnYcone1=mesCoordBoundary[1]; @@ -161,7 +161,7 @@ void MonEditBoundaryAn::InitValBoundaryAnConeR() void MonEditBoundaryAn::InitValBoundaryAnTore() // ------------------------------------------------------------------------ { - HOMARD::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords(); + ADAPT::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords(); ASSERT(mesCoordBoundary->length() == 8 ); _BoundaryAnXcentre=mesCoordBoundary[0]; _BoundaryAnYcentre=mesCoordBoundary[1]; diff --git a/src/ADAPTGUI/MonEditBoundaryAn.h b/src/ADAPTGUI/MonEditBoundaryAn.h index ea98981e3..f43764b8e 100644 --- a/src/ADAPTGUI/MonEditBoundaryAn.h +++ b/src/ADAPTGUI/MonEditBoundaryAn.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include @@ -35,7 +35,7 @@ class HOMARD_EXPORT MonEditBoundaryAn : public MonCreateBoundaryAn Q_OBJECT public: MonEditBoundaryAn( MonCreateCase* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString caseName, QString Name); virtual ~MonEditBoundaryAn(); diff --git a/src/ADAPTGUI/MonEditBoundaryCAO.cxx b/src/ADAPTGUI/MonEditBoundaryCAO.cxx index 36e3714ed..e9ab43a93 100644 --- a/src/ADAPTGUI/MonEditBoundaryCAO.cxx +++ b/src/ADAPTGUI/MonEditBoundaryCAO.cxx @@ -31,7 +31,7 @@ using namespace std; // ------------------------------------------------------------------------------------------------------------------------------------- MonEditBoundaryCAO::MonEditBoundaryCAO( MonCreateCase* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString caseName, QString Name): // ------------------------------------------------------------------------------------------------------------------------------------- /* Constructs a MonEditBoundaryCAO @@ -54,7 +54,7 @@ MonEditBoundaryCAO::MonEditBoundaryCAO( MonCreateCase* parent, bool modal, return; } - HOMARD::ListGroupType_var maListe = aBoundary->GetGroups(); + ADAPT::ListGroupType_var maListe = aBoundary->GetGroups(); for ( int i = 0; i < maListe->length(); i++ ) _listeGroupesBoundary << QString(maListe[i]); @@ -95,10 +95,10 @@ void MonEditBoundaryCAO::SetFiltrage() QObject::tr("HOM_BOUN_CASE") ); return; } - HOMARD::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str()); - HOMARD::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); + ADAPT::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str()); + ADAPT::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); - MonEditListGroupCAO *aDlg = new MonEditListGroupCAO(NULL, this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), + MonEditListGroupCAO *aDlg = new MonEditListGroupCAO(NULL, this, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen), _aCaseName, _listeGroupesBoundary) ; aDlg->show(); } diff --git a/src/ADAPTGUI/MonEditBoundaryCAO.h b/src/ADAPTGUI/MonEditBoundaryCAO.h index 01ac507b8..d8131825d 100644 --- a/src/ADAPTGUI/MonEditBoundaryCAO.h +++ b/src/ADAPTGUI/MonEditBoundaryCAO.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include @@ -35,7 +35,7 @@ class HOMARD_EXPORT MonEditBoundaryCAO : public MonCreateBoundaryCAO Q_OBJECT public: MonEditBoundaryCAO( MonCreateCase* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString caseName, QString Name ); virtual ~MonEditBoundaryCAO(); diff --git a/src/ADAPTGUI/MonEditBoundaryDi.cxx b/src/ADAPTGUI/MonEditBoundaryDi.cxx index d891732c0..fa92cc174 100644 --- a/src/ADAPTGUI/MonEditBoundaryDi.cxx +++ b/src/ADAPTGUI/MonEditBoundaryDi.cxx @@ -31,7 +31,7 @@ using namespace std; // ------------------------------------------------------------------------------------------------------------------------------------- MonEditBoundaryDi::MonEditBoundaryDi( MonCreateCase* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString caseName, QString Name): // ------------------------------------------------------------------------------------------------------------------------------------- /* Constructs a MonEditBoundaryDi @@ -54,7 +54,7 @@ MonEditBoundaryDi::MonEditBoundaryDi( MonCreateCase* parent, bool modal, return; } - HOMARD::ListGroupType_var maListe = aBoundary->GetGroups(); + ADAPT::ListGroupType_var maListe = aBoundary->GetGroups(); for ( int i = 0; i < maListe->length(); i++ ) _listeGroupesBoundary << QString(maListe[i]); @@ -95,10 +95,10 @@ void MonEditBoundaryDi::SetFiltrage() QObject::tr("HOM_BOUN_CASE") ); return; } - HOMARD::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str()); - HOMARD::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); + ADAPT::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str()); + ADAPT::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); - MonEditListGroup *aDlg = new MonEditListGroup(NULL, this, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), + MonEditListGroup *aDlg = new MonEditListGroup(NULL, this, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen), _aCaseName, _listeGroupesBoundary) ; aDlg->show(); } diff --git a/src/ADAPTGUI/MonEditBoundaryDi.h b/src/ADAPTGUI/MonEditBoundaryDi.h index 123b12340..97cdc7fe4 100644 --- a/src/ADAPTGUI/MonEditBoundaryDi.h +++ b/src/ADAPTGUI/MonEditBoundaryDi.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include @@ -35,7 +35,7 @@ class HOMARD_EXPORT MonEditBoundaryDi : public MonCreateBoundaryDi Q_OBJECT public: MonEditBoundaryDi( MonCreateCase* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString caseName, QString Name ); virtual ~MonEditBoundaryDi(); diff --git a/src/ADAPTGUI/MonEditCase.cxx b/src/ADAPTGUI/MonEditCase.cxx index d6304c54c..4ed612213 100644 --- a/src/ADAPTGUI/MonEditCase.cxx +++ b/src/ADAPTGUI/MonEditCase.cxx @@ -32,7 +32,7 @@ using namespace std; */ // ------------------------------------------------------------- MonEditCase::MonEditCase ( bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString CaseName ): MonCreateCase(modal, myHomardGen) { @@ -61,7 +61,7 @@ void MonEditCase::InitValEdit() PushDir->setVisible(0); QString _aitername=aCase->GetIter0Name(); - HOMARD::HOMARD_Iteration_var aIter = myHomardGen->GetIteration(_aitername.toStdString().c_str()); + ADAPT::HOMARD_Iteration_var aIter = myHomardGen->GetIteration(_aitername.toStdString().c_str()); QString aFileName = aIter->GetMeshFile(); LEFileName->setText(aFileName); LEFileName->setReadOnly(true); @@ -84,7 +84,7 @@ void MonEditCase::InitValEdit() GBBoundaryD->setVisible(0); GBBoundaryA->setVisible(0); // On passe en revue tous les couples (frontiere,groupe) du cas - HOMARD::ListBoundaryGroupType_var mesBoundarys = aCase->GetBoundaryGroup(); + ADAPT::ListBoundaryGroupType_var mesBoundarys = aCase->GetBoundaryGroup(); if (mesBoundarys->length()>0) { QStringList ListeFron ; @@ -98,7 +98,7 @@ void MonEditCase::InitValEdit() NomFron = mesBoundarys[i++]; MESSAGE("NomFron "<GetBoundary(NomFron.toStdString().c_str()); + ADAPT::HOMARD_Boundary_var myBoundary = myHomardGen->GetBoundary(NomFron.toStdString().c_str()); int type_obj = myBoundary->GetType() ; MESSAGE("type_obj "< #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include @@ -35,7 +35,7 @@ class HOMARD_EXPORT MonEditCase : public MonCreateCase Q_OBJECT public: MonEditCase( bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString Name ); virtual ~MonEditCase(); diff --git a/src/ADAPTGUI/MonEditFile.cxx b/src/ADAPTGUI/MonEditFile.cxx index 773b9f394..b1ee709ee 100644 --- a/src/ADAPTGUI/MonEditFile.cxx +++ b/src/ADAPTGUI/MonEditFile.cxx @@ -43,7 +43,7 @@ using namespace std; * --------------------------------------------------------- */ MonEditFile::MonEditFile( QWidget* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString aFileName, int option): // QWidget(0), Ui_EditFile(), diff --git a/src/ADAPTGUI/MonEditFile.h b/src/ADAPTGUI/MonEditFile.h index 62687b8be..cf34d7f2e 100644 --- a/src/ADAPTGUI/MonEditFile.h +++ b/src/ADAPTGUI/MonEditFile.h @@ -27,7 +27,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include CORBA_CLIENT_HEADER(HOMARD_Cas) #include "ui_EditFile.h" @@ -42,14 +42,14 @@ class HOMARD_EXPORT MonEditFile : public QWidget, public Ui_EditFile public: MonEditFile( QWidget* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString FileName, int option ); ~MonEditFile(); int _codret ; protected : - HOMARD::HOMARD_Gen_var myHomardGen; + ADAPT::ADAPT_Gen_var myHomardGen; QString _aFileName ; int _option ; diff --git a/src/ADAPTGUI/MonEditHypothesis.cxx b/src/ADAPTGUI/MonEditHypothesis.cxx index d7dd550c7..35fd32103 100644 --- a/src/ADAPTGUI/MonEditHypothesis.cxx +++ b/src/ADAPTGUI/MonEditHypothesis.cxx @@ -30,7 +30,7 @@ using namespace std; // ---------------------------------------------------------------------------- MonEditHypothesis::MonEditHypothesis( MonCreateIteration* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString Name, QString caseName, QString aFieldFile ): // ---------------------------------------------------------------------------- @@ -55,7 +55,7 @@ MonEditHypothesis::~MonEditHypothesis() void MonEditHypothesis::InitGroupes() // ------------------------------ { - HOMARD::ListGroupType_var maListe = aHypothesis->GetGroups(); + ADAPT::ListGroupType_var maListe = aHypothesis->GetGroups(); for ( int i = 0; i < maListe->length(); i++ ) _aListeGroupes << QString(maListe[i]); @@ -69,7 +69,7 @@ void MonEditHypothesis::InitValEdit() MESSAGE("Debut de InitValEdit"); LEName->setText(_Name); LEName->setReadOnly(true); - HOMARD::listeTypes_var ListTypes (aHypothesis->GetAdapRefinUnRef()); + ADAPT::listeTypes_var ListTypes (aHypothesis->GetAdapRefinUnRef()); ASSERT( ListTypes->length()==3) ; _aTypeAdap = ListTypes[0]; _aTypeRaff = ListTypes[1]; @@ -214,7 +214,7 @@ void MonEditHypothesis::InitAdaptZone() // Recuperation de toutes les zones decrites et notation de celles retenues GetAllZones(); - HOMARD::listeZonesHypo_var mesZonesAvant = aHypothesis->GetZones(); + ADAPT::listeZonesHypo_var mesZonesAvant = aHypothesis->GetZones(); for (int i=0; ilength(); i++) { MESSAGE ("i"<setEnabled(false); RBZone->setEnabled(false); - HOMARD::InfosHypo_var aInfosHypo = aHypothesis->GetField(); + ADAPT::InfosHypo_var aInfosHypo = aHypothesis->GetField(); _aFieldName = aInfosHypo->FieldName; _TypeThR = aInfosHypo->TypeThR; _ThreshR = aInfosHypo->ThreshR; @@ -284,7 +284,7 @@ void MonEditHypothesis::InitAdaptChamps() CBFieldName->setEnabled(false); //SetFieldName(Qt::Unchecked); - HOMARD::listeComposantsHypo_var mesComposantsAvant = aHypothesis->GetComps(); + ADAPT::listeComposantsHypo_var mesComposantsAvant = aHypothesis->GetComps(); TWCMP->clear(); TWCMP->setRowCount(0); TWCMP->resizeRowsToContents(); @@ -397,7 +397,7 @@ void MonEditHypothesis::InitFieldInterp() RBFieldChosen->setChecked(true); // TWField->setVisible(1); - HOMARD::listeFieldInterpsHypo_var mesChampsAvant = aHypothesis->GetFieldInterps(); + ADAPT::listeFieldInterpsHypo_var mesChampsAvant = aHypothesis->GetFieldInterps(); TWField->clear(); TWField->setRowCount(0); TWField->resizeRowsToContents(); @@ -456,7 +456,7 @@ void MonEditHypothesis::SetFiltrage() { if (CBGroupe->isChecked()) { - MonEditListGroup *aDlg = new MonEditListGroup(this, NULL, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen),_aCaseName, _aListeGroupes) ; + MonEditListGroup *aDlg = new MonEditListGroup(this, NULL, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen),_aCaseName, _aListeGroupes) ; aDlg->show(); } } diff --git a/src/ADAPTGUI/MonEditHypothesis.h b/src/ADAPTGUI/MonEditHypothesis.h index 051365b01..7bf402e9a 100644 --- a/src/ADAPTGUI/MonEditHypothesis.h +++ b/src/ADAPTGUI/MonEditHypothesis.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include @@ -35,7 +35,7 @@ class HOMARD_EXPORT MonEditHypothesis : public MonCreateHypothesis Q_OBJECT public: MonEditHypothesis( MonCreateIteration* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString caseName, QString Name, QString aFieldFile ); virtual ~MonEditHypothesis(); diff --git a/src/ADAPTGUI/MonEditIteration.cxx b/src/ADAPTGUI/MonEditIteration.cxx index e158f27cf..2a5203af5 100644 --- a/src/ADAPTGUI/MonEditIteration.cxx +++ b/src/ADAPTGUI/MonEditIteration.cxx @@ -28,7 +28,7 @@ using namespace std; // ------------------------------------------------------------------------------------------------------------------------------------- MonEditIteration::MonEditIteration ( QWidget* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString IterParentName, QString IterName ): // ------------------------------------------------------------------------------------------------------------------------------------- /* Constructs a MonEditIteration @@ -118,7 +118,7 @@ void MonEditIteration::InitValEdit() PBHypoNew->setVisible(0); // Pour une adaptation selon un champ - HOMARD::HOMARD_Hypothesis_var myHypo = myHomardGen->GetHypothesis(HypoName.toStdString().c_str()) ; + ADAPT::HOMARD_Hypothesis_var myHypo = myHomardGen->GetHypothesis(HypoName.toStdString().c_str()) ; _aTypeAdap = myHypo->GetAdapType() ; if ( _aTypeAdap == 1 ) { diff --git a/src/ADAPTGUI/MonEditIteration.h b/src/ADAPTGUI/MonEditIteration.h index 0107d4b26..3fa4084b7 100644 --- a/src/ADAPTGUI/MonEditIteration.h +++ b/src/ADAPTGUI/MonEditIteration.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include @@ -35,7 +35,7 @@ class HOMARD_EXPORT MonEditIteration : public MonCreateIteration Q_OBJECT public: MonEditIteration( QWidget* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString IterParentName, QString Name ); virtual ~MonEditIteration(); diff --git a/src/ADAPTGUI/MonEditListGroup.cxx b/src/ADAPTGUI/MonEditListGroup.cxx index d8a68150a..19f096138 100644 --- a/src/ADAPTGUI/MonEditListGroup.cxx +++ b/src/ADAPTGUI/MonEditListGroup.cxx @@ -25,7 +25,7 @@ using namespace std; MonEditListGroup::MonEditListGroup( MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo): //--------------------------------------------------------------------- diff --git a/src/ADAPTGUI/MonEditListGroup.h b/src/ADAPTGUI/MonEditListGroup.h index 8ea41c935..d789abf48 100644 --- a/src/ADAPTGUI/MonEditListGroup.h +++ b/src/ADAPTGUI/MonEditListGroup.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include @@ -37,7 +37,7 @@ class HOMARD_EXPORT MonEditListGroup : public MonCreateListGroup Q_OBJECT public: - MonEditListGroup( MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); + MonEditListGroup( MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, bool modal, ADAPT::ADAPT_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); virtual ~MonEditListGroup(); protected : diff --git a/src/ADAPTGUI/MonEditListGroupCAO.cxx b/src/ADAPTGUI/MonEditListGroupCAO.cxx index 5c942fd5a..18a0d3f52 100644 --- a/src/ADAPTGUI/MonEditListGroupCAO.cxx +++ b/src/ADAPTGUI/MonEditListGroupCAO.cxx @@ -25,7 +25,7 @@ using namespace std; MonEditListGroupCAO::MonEditListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo): //--------------------------------------------------------------------- diff --git a/src/ADAPTGUI/MonEditListGroupCAO.h b/src/ADAPTGUI/MonEditListGroupCAO.h index 4f6ada6db..90dfb1967 100644 --- a/src/ADAPTGUI/MonEditListGroupCAO.h +++ b/src/ADAPTGUI/MonEditListGroupCAO.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include @@ -37,7 +37,7 @@ class HOMARD_EXPORT MonEditListGroupCAO : public MonCreateListGroupCAO Q_OBJECT public: - MonEditListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); + MonEditListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, bool modal, ADAPT::ADAPT_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); virtual ~MonEditListGroupCAO(); protected : diff --git a/src/ADAPTGUI/MonEditYACS.cxx b/src/ADAPTGUI/MonEditYACS.cxx index 0c41e5b56..51fff9cb3 100644 --- a/src/ADAPTGUI/MonEditYACS.cxx +++ b/src/ADAPTGUI/MonEditYACS.cxx @@ -32,7 +32,7 @@ using namespace std; */ // ------------------------------------------------------------- MonEditYACS::MonEditYACS ( bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString Name ): MonCreateYACS(myHomardGen, Name) { diff --git a/src/ADAPTGUI/MonEditYACS.h b/src/ADAPTGUI/MonEditYACS.h index 11fe76d01..f8d3a48d5 100644 --- a/src/ADAPTGUI/MonEditYACS.h +++ b/src/ADAPTGUI/MonEditYACS.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include @@ -35,7 +35,7 @@ class HOMARD_EXPORT MonEditYACS : public MonCreateYACS Q_OBJECT public: MonEditYACS( bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString Name ); virtual ~MonEditYACS(); diff --git a/src/ADAPTGUI/MonEditZone.cxx b/src/ADAPTGUI/MonEditZone.cxx index acab891eb..3bb2c98da 100644 --- a/src/ADAPTGUI/MonEditZone.cxx +++ b/src/ADAPTGUI/MonEditZone.cxx @@ -32,7 +32,7 @@ using namespace std; // ------------------------------------------------------------------------ MonEditZone::MonEditZone( MonCreateHypothesis* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString caseName, QString Name ): // ------------------------------------------------------------------------ /* Constructs a MonEditZone @@ -113,7 +113,7 @@ void MonEditZone::InitValEdit() void MonEditZone::InitValZoneLimit() // ------------------------------------------------------------------------ { - HOMARD::double_array_var mesCoordLimits = aZone->GetLimit(); + ADAPT::double_array_var mesCoordLimits = aZone->GetLimit(); ASSERT(mesCoordLimits->length() == 3 ); _Xincr=mesCoordLimits[0]; _Yincr=mesCoordLimits[1]; @@ -123,7 +123,7 @@ void MonEditZone::InitValZoneLimit() void MonEditZone::InitValZoneBox() // ------------------------------------------------------------------------ { - HOMARD::double_array_var mesCoordZones = aZone->GetCoords(); + ADAPT::double_array_var mesCoordZones = aZone->GetCoords(); ASSERT(mesCoordZones->length() == 6 ); _ZoneXmin=mesCoordZones[0]; _ZoneXmax=mesCoordZones[1]; @@ -136,7 +136,7 @@ void MonEditZone::InitValZoneBox() void MonEditZone::InitValZoneSphere() // ------------------------------------------------------------------------ { - HOMARD::double_array_var mesCoordZones = aZone->GetCoords(); + ADAPT::double_array_var mesCoordZones = aZone->GetCoords(); ASSERT(mesCoordZones->length() == 4 ); _ZoneXcentre=mesCoordZones[0]; _ZoneYcentre=mesCoordZones[1]; @@ -148,7 +148,7 @@ void MonEditZone::InitValZoneSphere() void MonEditZone::InitValZoneCylinder() // ------------------------------------------------------------------------ { - HOMARD::double_array_var mesCoordZones = aZone->GetCoords(); + ADAPT::double_array_var mesCoordZones = aZone->GetCoords(); ASSERT(mesCoordZones->length() == 8 ); _ZoneXcentre=mesCoordZones[0]; _ZoneYcentre=mesCoordZones[1]; @@ -163,7 +163,7 @@ void MonEditZone::InitValZoneCylinder() void MonEditZone::InitValZonePipe() // ------------------------------------------------------------------------ { - HOMARD::double_array_var mesCoordZones = aZone->GetCoords(); + ADAPT::double_array_var mesCoordZones = aZone->GetCoords(); ASSERT(mesCoordZones->length() == 9 ); _ZoneXcentre=mesCoordZones[0]; _ZoneYcentre=mesCoordZones[1]; diff --git a/src/ADAPTGUI/MonEditZone.h b/src/ADAPTGUI/MonEditZone.h index 6570d263e..726a1d933 100644 --- a/src/ADAPTGUI/MonEditZone.h +++ b/src/ADAPTGUI/MonEditZone.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include @@ -35,7 +35,7 @@ class HOMARD_EXPORT MonEditZone : public MonCreateZone Q_OBJECT public: MonEditZone( MonCreateHypothesis* parent, bool modal, - HOMARD::HOMARD_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myHomardGen, QString caseName, QString Name); virtual ~MonEditZone(); diff --git a/src/ADAPTGUI/MonIterInfo.cxx b/src/ADAPTGUI/MonIterInfo.cxx index b361d29e8..4a789439c 100644 --- a/src/ADAPTGUI/MonIterInfo.cxx +++ b/src/ADAPTGUI/MonIterInfo.cxx @@ -33,7 +33,7 @@ using namespace std; // ----------------------------------------------------------------------------------------- -MonIterInfo::MonIterInfo(QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen0, QString IterName) +MonIterInfo::MonIterInfo(QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myHomardGen0, QString IterName) // ----------------------------------------------------------------------------------------- /* Constructs a MonIterInfo * Inherits from CasHomard @@ -51,7 +51,7 @@ MonIterInfo::MonIterInfo(QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myH _Option(-1) { MESSAGE("appel de _duplicate"); - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); + myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0); setupUi(this); setModal(modal); InitConnect(); @@ -112,7 +112,7 @@ bool MonIterInfo::PushOnApply() // Le bilan de l'analyse a afficher QString aFileName = aIter->GetFileInfo() ; - MonEditFile *aDlg = new MonEditFile( 0, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), aFileName, 0 ) ; + MonEditFile *aDlg = new MonEditFile( 0, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen), aFileName, 0 ) ; if ( aDlg->_codret == 0 ) { aDlg->show(); } diff --git a/src/ADAPTGUI/MonIterInfo.h b/src/ADAPTGUI/MonIterInfo.h index 358c3baf4..5ce8cf742 100644 --- a/src/ADAPTGUI/MonIterInfo.h +++ b/src/ADAPTGUI/MonIterInfo.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include CORBA_CLIENT_HEADER(HOMARD_Cas) #include "ui_IterInfo.h" @@ -40,11 +40,11 @@ class HOMARD_EXPORT MonIterInfo : public QDialog, public Ui_IterInfo Q_OBJECT public: - MonIterInfo( QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, QString IterName); + MonIterInfo( QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myHomardGen, QString IterName); ~MonIterInfo(); protected : - MonIterInfo( QWidget* parent, HOMARD::HOMARD_Gen_var myHomardGen, QString IterName ); + MonIterInfo( QWidget* parent, ADAPT::ADAPT_Gen_var myHomardGen, QString IterName ); QString _IterName; QString _aCaseName; @@ -56,8 +56,8 @@ protected : int _Quality; int _Option; - HOMARD::HOMARD_Iteration_var aIter ; - HOMARD::HOMARD_Gen_var myHomardGen; + ADAPT::HOMARD_Iteration_var aIter ; + ADAPT::ADAPT_Gen_var myHomardGen; virtual void InitConnect(); diff --git a/src/ADAPTGUI/MonMeshInfo.cxx b/src/ADAPTGUI/MonMeshInfo.cxx index 7c5e92899..b172e38e1 100644 --- a/src/ADAPTGUI/MonMeshInfo.cxx +++ b/src/ADAPTGUI/MonMeshInfo.cxx @@ -36,7 +36,7 @@ using namespace std; // ----------------------------------------------------------------------------------------- -MonMeshInfo::MonMeshInfo(QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen0) +MonMeshInfo::MonMeshInfo(QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myHomardGen0) // ----------------------------------------------------------------------------------------- /* Constructs a MonMeshInfo * Inherits from CasHomard @@ -51,7 +51,7 @@ MonMeshInfo::MonMeshInfo(QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myH _Entanglement(0), _Quality(0) { - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); + myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0); setupUi(this); setModal(modal); InitConnect(); @@ -168,9 +168,9 @@ bool MonMeshInfo::PushOnApply() // Le bilan de l'analyse a afficher aCase = myHomardGen->GetCase(_aCaseName.toStdString().c_str()); string iter0 = aCase->GetIter0Name(); - HOMARD::HOMARD_Iteration_var aIter = myHomardGen->GetIteration(iter0.c_str()); + ADAPT::HOMARD_Iteration_var aIter = myHomardGen->GetIteration(iter0.c_str()); aFileName = aIter->GetFileInfo() ; - MonEditFile *aDlg = new MonEditFile( 0, true, HOMARD::HOMARD_Gen::_duplicate(myHomardGen), aFileName, 1 ) ; + MonEditFile *aDlg = new MonEditFile( 0, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen), aFileName, 1 ) ; if ( aDlg->_codret == 0 ) { aDlg->show(); } HOMARD_UTILS::updateObjBrowser(); @@ -194,7 +194,7 @@ void MonMeshInfo::PushOnHelp() void MonMeshInfo::SetNewCaseName() // ------------------------------ { - HOMARD::listeCases_var MyCases = myHomardGen->GetAllCasesName(); + ADAPT::listeCases_var MyCases = myHomardGen->GetAllCasesName(); int num = 0; QString aCaseName=""; while (aCaseName=="" ) { diff --git a/src/ADAPTGUI/MonMeshInfo.h b/src/ADAPTGUI/MonMeshInfo.h index 55a31fe34..132ce89de 100644 --- a/src/ADAPTGUI/MonMeshInfo.h +++ b/src/ADAPTGUI/MonMeshInfo.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include CORBA_CLIENT_HEADER(HOMARD_Cas) #include "ui_MeshInfo.h" @@ -37,7 +37,7 @@ class HOMARD_EXPORT MonMeshInfo : public QDialog, public Ui_MeshInfo Q_OBJECT public: - MonMeshInfo( QWidget* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen); + MonMeshInfo( QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myHomardGen); ~MonMeshInfo(); protected : @@ -50,8 +50,8 @@ protected : int _Entanglement; int _Quality; - HOMARD::HOMARD_Cas_var aCase ; - HOMARD::HOMARD_Gen_var myHomardGen; + ADAPT::HOMARD_Cas_var aCase ; + ADAPT::ADAPT_Gen_var myHomardGen; virtual void InitConnect(); virtual void SetNewCaseName(); diff --git a/src/ADAPTGUI/MonPursueIteration.cxx b/src/ADAPTGUI/MonPursueIteration.cxx index b6c76d407..b929d5810 100644 --- a/src/ADAPTGUI/MonPursueIteration.cxx +++ b/src/ADAPTGUI/MonPursueIteration.cxx @@ -39,13 +39,13 @@ using namespace std; * Sets attributes to default values */ // ----------------------------------------------------------------------------------------- -MonPursueIteration::MonPursueIteration ( bool modal, HOMARD::HOMARD_Gen_var myHomardGen0 ) +MonPursueIteration::MonPursueIteration ( bool modal, ADAPT::ADAPT_Gen_var myHomardGen0 ) : Ui_PursueIteration(), _aCaseName(""), _aDirName(""), _aDirNameStart("") { MESSAGE("Debut du constructeur de MonPursueIteration"); - myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0); + myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0); setupUi(this); setModal(modal); @@ -221,7 +221,7 @@ void MonPursueIteration::PushOnHelp() void MonPursueIteration::SetNewCaseName() // ------------------------------ { - HOMARD::listeCases_var MyCases = myHomardGen->GetAllCasesName(); + ADAPT::listeCases_var MyCases = myHomardGen->GetAllCasesName(); int num = 0; QString aCaseName=""; while (aCaseName=="" ) { diff --git a/src/ADAPTGUI/MonPursueIteration.h b/src/ADAPTGUI/MonPursueIteration.h index fbeda6f75..367f9141d 100644 --- a/src/ADAPTGUI/MonPursueIteration.h +++ b/src/ADAPTGUI/MonPursueIteration.h @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(HOMARD_Gen) +#include CORBA_CLIENT_HEADER(ADAPT_Gen) #include CORBA_CLIENT_HEADER(HOMARD_Cas) #include "ui_PursueIteration.h" @@ -37,7 +37,7 @@ class HOMARD_EXPORT MonPursueIteration : public QDialog, public Ui_PursueIterati Q_OBJECT public: - MonPursueIteration( bool modal, HOMARD::HOMARD_Gen_var myHomardGen ); + MonPursueIteration( bool modal, ADAPT::ADAPT_Gen_var myHomardGen ); virtual ~MonPursueIteration(); protected : @@ -47,8 +47,8 @@ class HOMARD_EXPORT MonPursueIteration : public QDialog, public Ui_PursueIterati int _Type ; - HOMARD::HOMARD_Cas_var aCase ; - HOMARD::HOMARD_Gen_var myHomardGen; + ADAPT::HOMARD_Cas_var aCase ; + ADAPT::ADAPT_Gen_var myHomardGen; virtual void InitConnect(); virtual void SetNewCaseName(); diff --git a/src/ADAPT_I/HOMARD_Gen_i.cxx b/src/ADAPT_I/ADAPT_Gen_i.cxx similarity index 87% rename from src/ADAPT_I/HOMARD_Gen_i.cxx rename to src/ADAPT_I/ADAPT_Gen_i.cxx index 35cca098a..6b055fd62 100644 --- a/src/ADAPT_I/HOMARD_Gen_i.cxx +++ b/src/ADAPT_I/ADAPT_Gen_i.cxx @@ -17,7 +17,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -#include "HOMARD_Gen_i.hxx" +#include "ADAPT_Gen_i.hxx" #include "HOMARD_Cas_i.hxx" #include "HOMARD_Hypothesis_i.hxx" #include "HOMARD_Iteration_i.hxx" @@ -88,7 +88,7 @@ std::string RemoveTabulation( std::string theScript ) * standard constructor */ //============================================================================= -HOMARD_Gen_i::HOMARD_Gen_i( CORBA::ORB_ptr orb, +ADAPT_Gen_i::ADAPT_Gen_i( CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId * contId, const char *instanceName, @@ -99,7 +99,7 @@ Engines_Component_i(orb, poa, contId, instanceName, interfaceName) _thisObj = this; _id = _poa->activate_object(_thisObj); - myHomard = new ::HOMARD_Gen(); + myHomard = new ::ADAPT_Gen(); _NS = SINGLETON_::Instance(); ASSERT(SINGLETON_::IsAlreadyExisting()); _NS->init_orb(_orb); @@ -119,7 +119,7 @@ Engines_Component_i(orb, poa, contId, instanceName, interfaceName) * standard destructor */ //================================ -HOMARD_Gen_i::~HOMARD_Gen_i() +ADAPT_Gen_i::~ADAPT_Gen_i() { } //============================================================================= @@ -127,7 +127,7 @@ HOMARD_Gen_i::~HOMARD_Gen_i() // Utilitaires pour l'étude //============================================================================= //============================================================================= -void HOMARD_Gen_i::UpdateStudy() +void ADAPT_Gen_i::UpdateStudy() { ASSERT(!CORBA::is_nil(myStudy)); SALOMEDS::StudyBuilder_var myBuilder = myStudy->NewBuilder(); @@ -157,7 +157,7 @@ void HOMARD_Gen_i::UpdateStudy() anAttr = myBuilder->FindOrCreateAttribute(homardFather,"AttributePixMap"); SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); aPixmap->SetPixMap("HOMARD_2.png"); - myBuilder->DefineComponentInstance(homardFather, HOMARD_Gen::_this()); + myBuilder->DefineComponentInstance(homardFather, ADAPT_Gen::_this()); if (aLocked) myStudy->GetProperties()->SetLocked(true); myBuilder->CommitCommand(); @@ -169,11 +169,11 @@ void HOMARD_Gen_i::UpdateStudy() // Utilitaires pour l'iteration //============================================================================= //============================================================================= -void HOMARD_Gen_i::SetEtatIter(const char* nomIter, const CORBA::Long Etat) +void ADAPT_Gen_i::SetEtatIter(const char* nomIter, const CORBA::Long Etat) //===================================================================================== { MESSAGE( "SetEtatIter : affectation de l'etat " << Etat << " a l'iteration " << nomIter ); - HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; + ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; if (CORBA::is_nil(myIteration)) { SALOME::ExceptionStruct es; @@ -208,10 +208,10 @@ void HOMARD_Gen_i::SetEtatIter(const char* nomIter, const CORBA::Long Etat) // Destruction des structures identifiees par leurs noms //============================================================================= //============================================================================= -CORBA::Long HOMARD_Gen_i::DeleteBoundary(const char* BoundaryName) +CORBA::Long ADAPT_Gen_i::DeleteBoundary(const char* BoundaryName) { MESSAGE ( "DeleteBoundary : BoundaryName = " << BoundaryName ); - HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; + ADAPT::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; if (CORBA::is_nil(myBoundary)) { SALOME::ExceptionStruct es; @@ -222,13 +222,13 @@ CORBA::Long HOMARD_Gen_i::DeleteBoundary(const char* BoundaryName) }; // On verifie que la frontiere n'est plus utilisee - HOMARD::listeCases* maListe = GetAllCasesName(); + ADAPT::listeCases* maListe = GetAllCasesName(); int numberOfCases = maListe->length(); MESSAGE ( ".. Nombre de cas = " << numberOfCases ); std::string CaseName ; - HOMARD::ListBoundaryGroupType* ListBoundaryGroupType ; + ADAPT::ListBoundaryGroupType* ListBoundaryGroupType ; int numberOfitems ; - HOMARD::HOMARD_Cas_var myCase ; + ADAPT::HOMARD_Cas_var myCase ; for (int NumeCas = 0; NumeCas< numberOfCases; NumeCas++) { CaseName = std::string((*maListe)[NumeCas]); @@ -261,11 +261,11 @@ CORBA::Long HOMARD_Gen_i::DeleteBoundary(const char* BoundaryName) return 0 ; } //============================================================================= -CORBA::Long HOMARD_Gen_i::DeleteCase(const char* nomCas, CORBA::Long Option) +CORBA::Long ADAPT_Gen_i::DeleteCase(const char* nomCas, CORBA::Long Option) { // Pour detruire un cas MESSAGE ( "DeleteCase : nomCas = " << nomCas << ", avec option = " << Option ); - HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; + ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; if (CORBA::is_nil(myCase)) { SALOME::ExceptionStruct es; @@ -292,10 +292,10 @@ CORBA::Long HOMARD_Gen_i::DeleteCase(const char* nomCas, CORBA::Long Option) return 0 ; } //============================================================================= -CORBA::Long HOMARD_Gen_i::DeleteHypo(const char* nomHypo) +CORBA::Long ADAPT_Gen_i::DeleteHypo(const char* nomHypo) { MESSAGE ( "DeleteHypo : nomHypo = " << nomHypo ); - HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; + ADAPT::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; if (CORBA::is_nil(myHypo)) { SALOME::ExceptionStruct es; @@ -306,7 +306,7 @@ CORBA::Long HOMARD_Gen_i::DeleteHypo(const char* nomHypo) }; // On verifie que l'hypothese n'est plus utilisee - HOMARD::listeIters* maListeIter = myHypo->GetIterations(); + ADAPT::listeIters* maListeIter = myHypo->GetIterations(); int numberOfIter = maListeIter->length(); if ( numberOfIter > 0 ) { @@ -318,7 +318,7 @@ CORBA::Long HOMARD_Gen_i::DeleteHypo(const char* nomHypo) }; // suppression du lien avec les zones eventuelles - HOMARD::listeZonesHypo* maListe = myHypo->GetZones(); + ADAPT::listeZonesHypo* maListe = myHypo->GetZones(); int numberOfZones = maListe->length(); MESSAGE ( ".. Nombre de zones = " << numberOfZones ); for (int NumeZone = 0; NumeZone< numberOfZones; NumeZone++) @@ -339,7 +339,7 @@ CORBA::Long HOMARD_Gen_i::DeleteHypo(const char* nomHypo) return 0 ; } //============================================================================= -CORBA::Long HOMARD_Gen_i::DeleteIteration(const char* nomIter, CORBA::Long Option) +CORBA::Long ADAPT_Gen_i::DeleteIteration(const char* nomIter, CORBA::Long Option) { // Option = 0 : On ne supprime pas le fichier du maillage associe // Option = 1 : On supprime le fichier du maillage associe @@ -349,7 +349,7 @@ CORBA::Long HOMARD_Gen_i::DeleteIteration(const char* nomIter, CORBA::Long Optio return DeleteIterationOption(nomIter, Option1, Option); } //============================================================================= -CORBA::Long HOMARD_Gen_i::DeleteIterationOption(const char* nomIter, CORBA::Long Option1, CORBA::Long Option2) +CORBA::Long ADAPT_Gen_i::DeleteIterationOption(const char* nomIter, CORBA::Long Option1, CORBA::Long Option2) { // Option1 = 0 : On autorise la destruction de l'iteration 0 // Option1 = 1 : On interdit la destruction de l'iteration 0 @@ -357,7 +357,7 @@ CORBA::Long HOMARD_Gen_i::DeleteIterationOption(const char* nomIter, CORBA::Long // Option2 = 0 : On ne supprime pas le fichier du maillage associe // Option2 = 1 : On supprime le fichier du maillage associe MESSAGE ( "DeleteIterationOption : nomIter = " << nomIter << ", avec options = " << Option1<< ", " << Option2 ); - HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; + ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; if (CORBA::is_nil(myIteration)) { SALOME::ExceptionStruct es; @@ -379,7 +379,7 @@ CORBA::Long HOMARD_Gen_i::DeleteIterationOption(const char* nomIter, CORBA::Long }; // On detruit recursivement toutes les filles - HOMARD::listeIterFilles* maListe = myIteration->GetIterations(); + ADAPT::listeIterFilles* maListe = myIteration->GetIterations(); int numberOfIter = maListe->length(); for (int NumeIter = 0; NumeIter< numberOfIter; NumeIter++) { @@ -402,7 +402,7 @@ CORBA::Long HOMARD_Gen_i::DeleteIterationOption(const char* nomIter, CORBA::Long { std::string nomIterationParent = myIteration->GetIterParentName(); MESSAGE ( "Retrait dans la descendance de nomIterationParent " << nomIterationParent ); - HOMARD::HOMARD_Iteration_var myIterationParent = myStudyContext._mesIterations[nomIterationParent]; + ADAPT::HOMARD_Iteration_var myIterationParent = myStudyContext._mesIterations[nomIterationParent]; if (CORBA::is_nil(myIterationParent)) { SALOME::ExceptionStruct es; @@ -418,7 +418,7 @@ CORBA::Long HOMARD_Gen_i::DeleteIterationOption(const char* nomIter, CORBA::Long if ( numero > 0 ) { std::string nomHypo = myIteration->GetHypoName(); - HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; + ADAPT::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; ASSERT(!CORBA::is_nil(myHypo)); myHypo->UnLinkIteration(nomIter); } @@ -431,7 +431,7 @@ CORBA::Long HOMARD_Gen_i::DeleteIterationOption(const char* nomIter, CORBA::Long myStudy->NewBuilder()->RemoveObjectWithChildren(aSO); // on peut aussi faire RemoveObject // MESSAGE ( "Au final" ); -// HOMARD::listeIterations* Liste = GetAllIterationsName() ; +// ADAPT::listeIterations* Liste = GetAllIterationsName() ; // numberOfIter = Liste->length(); // for (int NumeIter = 0; NumeIter< numberOfIter; NumeIter++) // { @@ -442,12 +442,12 @@ CORBA::Long HOMARD_Gen_i::DeleteIterationOption(const char* nomIter, CORBA::Long return 0 ; } //============================================================================= -CORBA::Long HOMARD_Gen_i::DeleteYACS(const char* nomYACS, CORBA::Long Option) +CORBA::Long ADAPT_Gen_i::DeleteYACS(const char* nomYACS, CORBA::Long Option) { // Option = 0 : On ne supprime pas le fichier du schema associe // Option = 1 : On supprime le fichier du schema associe MESSAGE ( "DeleteYACS : nomYACS = " << nomYACS << ", avec option = " << Option ); - HOMARD::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; + ADAPT::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; if (CORBA::is_nil(myYACS)) { SALOME::ExceptionStruct es; @@ -481,10 +481,10 @@ CORBA::Long HOMARD_Gen_i::DeleteYACS(const char* nomYACS, CORBA::Long Option) return 0 ; } //============================================================================= -CORBA::Long HOMARD_Gen_i::DeleteZone(const char* nomZone) +CORBA::Long ADAPT_Gen_i::DeleteZone(const char* nomZone) { MESSAGE ( "DeleteZone : nomZone = " << nomZone ); - HOMARD::HOMARD_Zone_var myZone = myStudyContext._mesZones[nomZone]; + ADAPT::HOMARD_Zone_var myZone = myStudyContext._mesZones[nomZone]; if (CORBA::is_nil(myZone)) { SALOME::ExceptionStruct es; @@ -495,7 +495,7 @@ CORBA::Long HOMARD_Gen_i::DeleteZone(const char* nomZone) }; // On verifie que la zone n'est plus utilisee - HOMARD::listeHypo* maListe = myZone->GetHypo(); + ADAPT::listeHypo* maListe = myZone->GetHypo(); int numberOfHypo = maListe->length(); MESSAGE ( ".. Nombre d'hypotheses = " << numberOfHypo ); if ( numberOfHypo > 0 ) @@ -524,10 +524,10 @@ CORBA::Long HOMARD_Gen_i::DeleteZone(const char* nomZone) // Invalidation des structures identifiees par leurs noms //============================================================================= //============================================================================= -void HOMARD_Gen_i::InvalideBoundary(const char* BoundaryName) +void ADAPT_Gen_i::InvalideBoundary(const char* BoundaryName) { MESSAGE( "InvalideBoundary : BoundaryName = " << BoundaryName ); - HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; + ADAPT::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; if (CORBA::is_nil(myBoundary)) { SALOME::ExceptionStruct es; @@ -546,10 +546,10 @@ void HOMARD_Gen_i::InvalideBoundary(const char* BoundaryName) }; } //============================================================================= -void HOMARD_Gen_i::InvalideHypo(const char* nomHypo) +void ADAPT_Gen_i::InvalideHypo(const char* nomHypo) { MESSAGE( "InvalideHypo : nomHypo = " << nomHypo ); - HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; + ADAPT::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; if (CORBA::is_nil(myHypo)) { SALOME::ExceptionStruct es; @@ -559,7 +559,7 @@ void HOMARD_Gen_i::InvalideHypo(const char* nomHypo) return ; }; - HOMARD::listeIters* maListe = myHypo->GetIterations(); + ADAPT::listeIters* maListe = myHypo->GetIterations(); int numberOfIter = maListe->length(); for (int NumeIter = 0; NumeIter< numberOfIter; NumeIter++) { @@ -569,7 +569,7 @@ void HOMARD_Gen_i::InvalideHypo(const char* nomHypo) } } //============================================================================= -void HOMARD_Gen_i::InvalideIter(const char* nomIter) +void ADAPT_Gen_i::InvalideIter(const char* nomIter) { MESSAGE("InvalideIter : nomIter = " << nomIter); // Pour invalider totalement une iteration courante @@ -577,12 +577,12 @@ void HOMARD_Gen_i::InvalideIter(const char* nomIter) return InvalideIterOption(nomIter, Option); } //============================================================================= -void HOMARD_Gen_i::InvalideIterOption(const char* nomIter, CORBA::Long Option) +void ADAPT_Gen_i::InvalideIterOption(const char* nomIter, CORBA::Long Option) { // Option = 0 : On ne supprime pas le fichier du maillage associe // Option = 1 : On supprime le fichier du maillage associe MESSAGE ( "InvalideIterOption : nomIter = " << nomIter << ", avec option = " << Option ); - HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; + ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; if (CORBA::is_nil(myIteration)) { SALOME::ExceptionStruct es; @@ -592,7 +592,7 @@ void HOMARD_Gen_i::InvalideIterOption(const char* nomIter, CORBA::Long Option) return ; }; - HOMARD::listeIterFilles* maListe = myIteration->GetIterations(); + ADAPT::listeIterFilles* maListe = myIteration->GetIterations(); int numberOfIter = maListe->length(); for (int NumeIter = 0; NumeIter< numberOfIter; NumeIter++) { @@ -623,7 +623,7 @@ void HOMARD_Gen_i::InvalideIterOption(const char* nomIter, CORBA::Long Option) { SetEtatIter(nomIter,1); const char * nomCas = myIteration->GetCaseName(); - HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; + ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; if (CORBA::is_nil(myCase)) { SALOME::ExceptionStruct es; @@ -652,10 +652,10 @@ void HOMARD_Gen_i::InvalideIterOption(const char* nomIter, CORBA::Long Option) } //============================================================================= -void HOMARD_Gen_i::InvalideIterInfo(const char* nomIter) +void ADAPT_Gen_i::InvalideIterInfo(const char* nomIter) { MESSAGE("InvalideIterInfo : nomIter = " << nomIter); - HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; + ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; if (CORBA::is_nil(myIteration)) { SALOME::ExceptionStruct es; @@ -683,7 +683,7 @@ void HOMARD_Gen_i::InvalideIterInfo(const char* nomIter) } const char * nomCas = myIteration->GetCaseName(); - HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; + ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; if (CORBA::is_nil(myCase)) { SALOME::ExceptionStruct es; @@ -706,10 +706,10 @@ void HOMARD_Gen_i::InvalideIterInfo(const char* nomIter) } } //============================================================================= -void HOMARD_Gen_i::InvalideYACS(const char* YACSName) +void ADAPT_Gen_i::InvalideYACS(const char* YACSName) { MESSAGE( "InvalideYACS : YACSName = " << YACSName ); - HOMARD::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[YACSName]; + ADAPT::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[YACSName]; if (CORBA::is_nil(myYACS)) { SALOME::ExceptionStruct es; @@ -747,10 +747,10 @@ void HOMARD_Gen_i::InvalideYACS(const char* YACSName) } } //============================================================================= -void HOMARD_Gen_i::InvalideZone(const char* ZoneName) +void ADAPT_Gen_i::InvalideZone(const char* ZoneName) { MESSAGE( "InvalideZone : ZoneName = " << ZoneName ); - HOMARD::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName]; + ADAPT::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName]; if (CORBA::is_nil(myZone)) { SALOME::ExceptionStruct es; @@ -759,7 +759,7 @@ void HOMARD_Gen_i::InvalideZone(const char* ZoneName) throw SALOME::SALOME_Exception(es); return ; }; - HOMARD::listeHypo* maListe = myZone->GetHypo(); + ADAPT::listeHypo* maListe = myZone->GetHypo(); int numberOfHypo = maListe->length(); MESSAGE( ".. numberOfHypo = " << numberOfHypo ); for (int NumeHypo = 0; NumeHypo< numberOfHypo; NumeHypo++) @@ -777,11 +777,11 @@ void HOMARD_Gen_i::InvalideZone(const char* ZoneName) // Association de lien entre des structures identifiees par leurs noms //============================================================================= //============================================================================= -void HOMARD_Gen_i::AssociateCaseIter(const char* nomCas, const char* nomIter, const char* labelIter) +void ADAPT_Gen_i::AssociateCaseIter(const char* nomCas, const char* nomIter, const char* labelIter) { MESSAGE( "AssociateCaseIter : " << nomCas << ", " << nomIter << ", " << labelIter ); - HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; + ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; if (CORBA::is_nil(myCase)) { SALOME::ExceptionStruct es; @@ -791,7 +791,7 @@ void HOMARD_Gen_i::AssociateCaseIter(const char* nomCas, const char* nomIter, co return ; }; - HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; + ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; if (CORBA::is_nil(myIteration)) { SALOME::ExceptionStruct es; @@ -822,16 +822,16 @@ void HOMARD_Gen_i::AssociateCaseIter(const char* nomCas, const char* nomIter, co myIteration->SetCaseName(nomCas); } //===================================================================================== -void HOMARD_Gen_i::AssociateHypoZone(const char* nomHypothesis, const char* ZoneName, CORBA::Long TypeUse) +void ADAPT_Gen_i::AssociateHypoZone(const char* nomHypothesis, const char* ZoneName, CORBA::Long TypeUse) { MESSAGE ( "AssociateHypoZone : nomHypo = " << nomHypothesis << ", ZoneName= " << ZoneName << ", TypeUse = " << TypeUse); - HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypothesis]; + ADAPT::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypothesis]; ASSERT(!CORBA::is_nil(myHypo)); SALOMEDS::SObject_var aHypoSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myHypo))); ASSERT(!CORBA::is_nil(aHypoSO)); - HOMARD::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName]; + ADAPT::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName]; ASSERT(!CORBA::is_nil(myZone)); SALOMEDS::SObject_var aZoneSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myZone))); ASSERT(!CORBA::is_nil(aZoneSO)); @@ -849,18 +849,18 @@ void HOMARD_Gen_i::AssociateHypoZone(const char* nomHypothesis, const char* Zone myHypo->AddZone0(ZoneName, TypeUse); }; //============================================================================= -void HOMARD_Gen_i::AssociateIterHypo(const char* nomIter, const char* nomHypo) +void ADAPT_Gen_i::AssociateIterHypo(const char* nomIter, const char* nomHypo) { MESSAGE("AssociateIterHypo : nomHypo = " << nomHypo << " nomIter = " << nomIter); // Verification de l'existence de l'hypothese - HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; + ADAPT::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; ASSERT(!CORBA::is_nil(myHypo)); SALOMEDS::SObject_var aHypoSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myHypo))); ASSERT(!CORBA::is_nil(aHypoSO)); // Verification de l'existence de l'iteration - HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; + ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; ASSERT(!CORBA::is_nil(myIteration)); SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration))); ASSERT(!CORBA::is_nil(aIterSO)); @@ -878,7 +878,7 @@ void HOMARD_Gen_i::AssociateIterHypo(const char* nomIter, const char* nomHypo) // On stocke les noms des champ a interpoler pour le futur controle de la donnée des pas de temps myIteration->SupprFieldInterps() ; - HOMARD::listeFieldInterpsHypo* ListField = myHypo->GetFieldInterps(); + ADAPT::listeFieldInterpsHypo* ListField = myHypo->GetFieldInterps(); int numberOfFieldsx2 = ListField->length(); for (int iaux = 0; iaux< numberOfFieldsx2; iaux++) { @@ -895,16 +895,16 @@ void HOMARD_Gen_i::AssociateIterHypo(const char* nomIter, const char* nomHypo) // Dissociation de lien entre des structures identifiees par leurs noms //============================================================================= //============================================================================= -void HOMARD_Gen_i::DissociateHypoZone(const char* nomHypothesis, const char* ZoneName) +void ADAPT_Gen_i::DissociateHypoZone(const char* nomHypothesis, const char* ZoneName) { MESSAGE ( "DissociateHypoZone : ZoneName= " << ZoneName << ", nomHypo = " << nomHypothesis); - HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypothesis]; + ADAPT::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypothesis]; ASSERT(!CORBA::is_nil(myHypo)); SALOMEDS::SObject_var aHypoSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myHypo))); ASSERT(!CORBA::is_nil(aHypoSO)); - HOMARD::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName]; + ADAPT::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName]; ASSERT(!CORBA::is_nil(myZone)); SALOMEDS::SObject_var aZoneSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myZone))); ASSERT(!CORBA::is_nil(aZoneSO)); @@ -940,14 +940,14 @@ void HOMARD_Gen_i::DissociateHypoZone(const char* nomHypothesis, const char* Zon // Recuperation des listes //============================================================================= //============================================================================= -HOMARD::listeBoundarys* HOMARD_Gen_i::GetAllBoundarysName() +ADAPT::listeBoundarys* ADAPT_Gen_i::GetAllBoundarysName() { MESSAGE("GetAllBoundarysName"); IsValidStudy () ; - HOMARD::listeBoundarys_var ret = new HOMARD::listeBoundarys; + ADAPT::listeBoundarys_var ret = new ADAPT::listeBoundarys; ret->length(myStudyContext._mesBoundarys.size()); - std::map::const_iterator it; + std::map::const_iterator it; int i = 0; for (it = myStudyContext._mesBoundarys.begin(); it != myStudyContext._mesBoundarys.end(); it++) @@ -958,14 +958,14 @@ HOMARD::listeBoundarys* HOMARD_Gen_i::GetAllBoundarysName() return ret._retn(); } //============================================================================= -HOMARD::listeCases* HOMARD_Gen_i::GetAllCasesName() +ADAPT::listeCases* ADAPT_Gen_i::GetAllCasesName() { MESSAGE("GetAllCasesName"); IsValidStudy () ; - HOMARD::listeCases_var ret = new HOMARD::listeCases; + ADAPT::listeCases_var ret = new ADAPT::listeCases; ret->length(myStudyContext._mesCas.size()); - std::map::const_iterator it; + std::map::const_iterator it; int i = 0; for (it = myStudyContext._mesCas.begin(); it != myStudyContext._mesCas.end(); it++) @@ -976,14 +976,14 @@ HOMARD::listeCases* HOMARD_Gen_i::GetAllCasesName() return ret._retn(); } //============================================================================= -HOMARD::listeHypotheses* HOMARD_Gen_i::GetAllHypothesesName() +ADAPT::listeHypotheses* ADAPT_Gen_i::GetAllHypothesesName() { MESSAGE("GetAllHypothesesName"); IsValidStudy () ; - HOMARD::listeHypotheses_var ret = new HOMARD::listeHypotheses; + ADAPT::listeHypotheses_var ret = new ADAPT::listeHypotheses; ret->length(myStudyContext._mesHypotheses.size()); - std::map::const_iterator it; + std::map::const_iterator it; int i = 0; for (it = myStudyContext._mesHypotheses.begin(); it != myStudyContext._mesHypotheses.end(); it++) @@ -994,14 +994,14 @@ HOMARD::listeHypotheses* HOMARD_Gen_i::GetAllHypothesesName() return ret._retn(); } //============================================================================= -HOMARD::listeIterations* HOMARD_Gen_i::GetAllIterationsName() +ADAPT::listeIterations* ADAPT_Gen_i::GetAllIterationsName() { MESSAGE("GetAllIterationsName"); IsValidStudy () ; - HOMARD::listeIterations_var ret = new HOMARD::listeIterations; + ADAPT::listeIterations_var ret = new ADAPT::listeIterations; ret->length(myStudyContext._mesIterations.size()); - std::map::const_iterator it; + std::map::const_iterator it; int i = 0; for (it = myStudyContext._mesIterations.begin(); it != myStudyContext._mesIterations.end(); it++) @@ -1012,14 +1012,14 @@ HOMARD::listeIterations* HOMARD_Gen_i::GetAllIterationsName() return ret._retn(); } //============================================================================= -HOMARD::listeYACSs* HOMARD_Gen_i::GetAllYACSsName() +ADAPT::listeYACSs* ADAPT_Gen_i::GetAllYACSsName() { MESSAGE("GetAllYACSsName"); IsValidStudy () ; - HOMARD::listeYACSs_var ret = new HOMARD::listeYACSs; + ADAPT::listeYACSs_var ret = new ADAPT::listeYACSs; ret->length(myStudyContext._mesYACSs.size()); - std::map::const_iterator it; + std::map::const_iterator it; int i = 0; for (it = myStudyContext._mesYACSs.begin(); it != myStudyContext._mesYACSs.end(); it++) @@ -1030,14 +1030,14 @@ HOMARD::listeYACSs* HOMARD_Gen_i::GetAllYACSsName() return ret._retn(); } //============================================================================= -HOMARD::listeZones* HOMARD_Gen_i::GetAllZonesName() +ADAPT::listeZones* ADAPT_Gen_i::GetAllZonesName() { MESSAGE("GetAllZonesName"); IsValidStudy () ; - HOMARD::listeZones_var ret = new HOMARD::listeZones; + ADAPT::listeZones_var ret = new ADAPT::listeZones; ret->length(myStudyContext._mesZones.size()); - std::map::const_iterator it; + std::map::const_iterator it; int i = 0; for (it = myStudyContext._mesZones.begin(); it != myStudyContext._mesZones.end(); it++) @@ -1055,46 +1055,46 @@ HOMARD::listeZones* HOMARD_Gen_i::GetAllZonesName() // Recuperation des structures identifiees par leurs noms //============================================================================= //============================================================================= -HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::GetBoundary(const char* nomBoundary) +ADAPT::HOMARD_Boundary_ptr ADAPT_Gen_i::GetBoundary(const char* nomBoundary) { - HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[nomBoundary]; + ADAPT::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[nomBoundary]; ASSERT(!CORBA::is_nil(myBoundary)); - return HOMARD::HOMARD_Boundary::_duplicate(myBoundary); + return ADAPT::HOMARD_Boundary::_duplicate(myBoundary); } //============================================================================= -HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::GetCase(const char* nomCas) +ADAPT::HOMARD_Cas_ptr ADAPT_Gen_i::GetCase(const char* nomCas) { - HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; + ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; ASSERT(!CORBA::is_nil(myCase)); - return HOMARD::HOMARD_Cas::_duplicate(myCase); + return ADAPT::HOMARD_Cas::_duplicate(myCase); } //============================================================================= -HOMARD::HOMARD_Hypothesis_ptr HOMARD_Gen_i::GetHypothesis(const char* nomHypothesis) +ADAPT::HOMARD_Hypothesis_ptr ADAPT_Gen_i::GetHypothesis(const char* nomHypothesis) { - HOMARD::HOMARD_Hypothesis_var myHypothesis = myStudyContext._mesHypotheses[nomHypothesis]; + ADAPT::HOMARD_Hypothesis_var myHypothesis = myStudyContext._mesHypotheses[nomHypothesis]; ASSERT(!CORBA::is_nil(myHypothesis)); - return HOMARD::HOMARD_Hypothesis::_duplicate(myHypothesis); + return ADAPT::HOMARD_Hypothesis::_duplicate(myHypothesis); } //============================================================================= -HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::GetIteration(const char* NomIterationation) +ADAPT::HOMARD_Iteration_ptr ADAPT_Gen_i::GetIteration(const char* NomIterationation) { - HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[NomIterationation]; + ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[NomIterationation]; ASSERT(!CORBA::is_nil(myIteration)); - return HOMARD::HOMARD_Iteration::_duplicate(myIteration); + return ADAPT::HOMARD_Iteration::_duplicate(myIteration); } //============================================================================= -HOMARD::HOMARD_YACS_ptr HOMARD_Gen_i::GetYACS(const char* nomYACS) +ADAPT::HOMARD_YACS_ptr ADAPT_Gen_i::GetYACS(const char* nomYACS) { - HOMARD::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; + ADAPT::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; ASSERT(!CORBA::is_nil(myYACS)); - return HOMARD::HOMARD_YACS::_duplicate(myYACS); + return ADAPT::HOMARD_YACS::_duplicate(myYACS); } //============================================================================= -HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::GetZone(const char* ZoneName) +ADAPT::HOMARD_Zone_ptr ADAPT_Gen_i::GetZone(const char* ZoneName) { - HOMARD::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName]; + ADAPT::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName]; ASSERT(!CORBA::is_nil(myZone)); - return HOMARD::HOMARD_Zone::_duplicate(myZone); + return ADAPT::HOMARD_Zone::_duplicate(myZone); } //============================================================================= //============================================================================= @@ -1104,7 +1104,7 @@ HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::GetZone(const char* ZoneName) // Informations //============================================================================= //============================================================================= -void HOMARD_Gen_i::MeshInfo(const char* nomCas, const char* MeshName, const char* MeshFile, const char* DirName, CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte) +void ADAPT_Gen_i::MeshInfo(const char* nomCas, const char* MeshName, const char* MeshFile, const char* DirName, CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte) { INFOS ( "MeshInfo : nomCas = " << nomCas << ", MeshName = " << MeshName << ", MeshFile = " << MeshFile ); INFOS ( "Qual = " << Qual << ", Diam = " << Diam << ", Conn = " << Conn << ", Tail = " << Tail << ", Inte = " << Inte ); @@ -1113,7 +1113,7 @@ void HOMARD_Gen_i::MeshInfo(const char* nomCas, const char* MeshName, const char // Creation du cas int option = 1 ; if ( _PublisMeshIN != 0 ) option = 2 ; - HOMARD::HOMARD_Cas_ptr myCase = CreateCase0(nomCas, MeshName, MeshFile, 1, 0, option) ; + ADAPT::HOMARD_Cas_ptr myCase = CreateCase0(nomCas, MeshName, MeshFile, 1, 0, option) ; myCase->SetDirName(DirName) ; // Analyse myCase->MeshInfo(Qual, Diam, Conn, Tail, Inte) ; @@ -1128,15 +1128,15 @@ void HOMARD_Gen_i::MeshInfo(const char* nomCas, const char* MeshName, const char // Recuperation des structures par le contexte //============================================================================= //============================================================================= -HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::LastIteration(const char* nomCas) +ADAPT::HOMARD_Iteration_ptr ADAPT_Gen_i::LastIteration(const char* nomCas) { - HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; + ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; ASSERT(!CORBA::is_nil(myCase)); // - HOMARD::HOMARD_Iteration_var myIteration = myCase->LastIteration(); + ADAPT::HOMARD_Iteration_var myIteration = myCase->LastIteration(); ASSERT(!CORBA::is_nil(myIteration)); // - return HOMARD::HOMARD_Iteration::_duplicate(myIteration); + return ADAPT::HOMARD_Iteration::_duplicate(myIteration); } //============================================================================= //============================================================================= @@ -1146,51 +1146,51 @@ HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::LastIteration(const char* nomCas) // Nouvelles structures //============================================================================= //============================================================================= -HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::newCase() +ADAPT::HOMARD_Cas_ptr ADAPT_Gen_i::newCase() { - HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); + ADAPT::ADAPT_Gen_var engine = POA_ADAPT::ADAPT_Gen::_this(); HOMARD_Cas_i* aServant = new HOMARD_Cas_i(_orb, engine); - HOMARD::HOMARD_Cas_var aCase = HOMARD::HOMARD_Cas::_narrow(aServant->_this()); + ADAPT::HOMARD_Cas_var aCase = ADAPT::HOMARD_Cas::_narrow(aServant->_this()); return aCase._retn(); } //============================================================================= -HOMARD::HOMARD_Hypothesis_ptr HOMARD_Gen_i::newHypothesis() +ADAPT::HOMARD_Hypothesis_ptr ADAPT_Gen_i::newHypothesis() { - HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); + ADAPT::ADAPT_Gen_var engine = POA_ADAPT::ADAPT_Gen::_this(); HOMARD_Hypothesis_i* aServant = new HOMARD_Hypothesis_i(_orb, engine); - HOMARD::HOMARD_Hypothesis_var aHypo = HOMARD::HOMARD_Hypothesis::_narrow(aServant->_this()); + ADAPT::HOMARD_Hypothesis_var aHypo = ADAPT::HOMARD_Hypothesis::_narrow(aServant->_this()); return aHypo._retn(); } //============================================================================= -HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::newIteration() +ADAPT::HOMARD_Iteration_ptr ADAPT_Gen_i::newIteration() { - HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); + ADAPT::ADAPT_Gen_var engine = POA_ADAPT::ADAPT_Gen::_this(); HOMARD_Iteration_i* aServant = new HOMARD_Iteration_i(_orb, engine); - HOMARD::HOMARD_Iteration_var aIter = HOMARD::HOMARD_Iteration::_narrow(aServant->_this()); + ADAPT::HOMARD_Iteration_var aIter = ADAPT::HOMARD_Iteration::_narrow(aServant->_this()); return aIter._retn(); } //============================================================================= -HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::newBoundary() +ADAPT::HOMARD_Boundary_ptr ADAPT_Gen_i::newBoundary() { - HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); + ADAPT::ADAPT_Gen_var engine = POA_ADAPT::ADAPT_Gen::_this(); HOMARD_Boundary_i* aServant = new HOMARD_Boundary_i(_orb, engine); - HOMARD::HOMARD_Boundary_var aBoundary = HOMARD::HOMARD_Boundary::_narrow(aServant->_this()); + ADAPT::HOMARD_Boundary_var aBoundary = ADAPT::HOMARD_Boundary::_narrow(aServant->_this()); return aBoundary._retn(); } //============================================================================= -HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::newZone() +ADAPT::HOMARD_Zone_ptr ADAPT_Gen_i::newZone() { - HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); + ADAPT::ADAPT_Gen_var engine = POA_ADAPT::ADAPT_Gen::_this(); HOMARD_Zone_i* aServant = new HOMARD_Zone_i(_orb, engine); - HOMARD::HOMARD_Zone_var aZone = HOMARD::HOMARD_Zone::_narrow(aServant->_this()); + ADAPT::HOMARD_Zone_var aZone = ADAPT::HOMARD_Zone::_narrow(aServant->_this()); return aZone._retn(); } //============================================================================= -HOMARD::HOMARD_YACS_ptr HOMARD_Gen_i::newYACS() +ADAPT::HOMARD_YACS_ptr ADAPT_Gen_i::newYACS() { - HOMARD::HOMARD_Gen_var engine = POA_HOMARD::HOMARD_Gen::_this(); + ADAPT::ADAPT_Gen_var engine = POA_ADAPT::ADAPT_Gen::_this(); HOMARD_YACS_i* aServant = new HOMARD_YACS_i(_orb, engine); - HOMARD::HOMARD_YACS_var aYACS = HOMARD::HOMARD_YACS::_narrow(aServant->_this()); + ADAPT::HOMARD_YACS_var aYACS = ADAPT::HOMARD_YACS::_narrow(aServant->_this()); return aYACS._retn(); } //============================================================================= @@ -1201,7 +1201,7 @@ HOMARD::HOMARD_YACS_ptr HOMARD_Gen_i::newYACS() // Creation des structures identifiees par leurs noms //============================================================================= //============================================================================= -HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCase(const char* nomCas, const char* MeshName, const char* MeshFile) +ADAPT::HOMARD_Cas_ptr ADAPT_Gen_i::CreateCase(const char* nomCas, const char* MeshName, const char* MeshFile) // // Creation d'un cas initial // nomCas : nom du cas a creer @@ -1212,15 +1212,15 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCase(const char* nomCas, const char* int option = 1 ; if ( _PublisMeshIN != 0 ) option = 2 ; - HOMARD::HOMARD_Cas_ptr myCase = CreateCase0(nomCas, MeshName, MeshFile, 0, 0, option) ; + ADAPT::HOMARD_Cas_ptr myCase = CreateCase0(nomCas, MeshName, MeshFile, 0, 0, option) ; // Valeurs par defaut des filtrages myCase->SetPyram(0); - return HOMARD::HOMARD_Cas::_duplicate(myCase); + return ADAPT::HOMARD_Cas::_duplicate(myCase); } //============================================================================= -HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas, const char* DirNameStart) +ADAPT::HOMARD_Cas_ptr ADAPT_Gen_i::CreateCaseFromIteration(const char* nomCas, const char* DirNameStart) // // nomCas : nom du cas a creer // DirNameStart : nom du répertoire contenant l'iteration de reprise @@ -1385,7 +1385,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas, int option = 1 ; if ( _PublisMeshIN != 0 ) option = 2 ; - HOMARD::HOMARD_Cas_ptr myCase = CreateCase0(nomCas, MeshName, MeshFile, 1, NumeIter, option) ; + ADAPT::HOMARD_Cas_ptr myCase = CreateCase0(nomCas, MeshName, MeshFile, 1, NumeIter, option) ; // D. Parametrages lus dans le fichier de configuration @@ -1399,7 +1399,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas, // E.2. Répertoire associe a l'iteration de ce cas char* IterName ; IterName = myCase->GetIter0Name() ; - HOMARD::HOMARD_Iteration_var Iter = GetIteration(IterName) ; + ADAPT::HOMARD_Iteration_var Iter = GetIteration(IterName) ; char* nomDirIter = CreateDirNameIter(nomDirCase, 0 ); Iter->SetDirNameLoc(nomDirIter); std::string nomDirIterTotal ; @@ -1438,10 +1438,10 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas, delete[] MeshFile ; CHDIR(nomDirWork.c_str()); - return HOMARD::HOMARD_Cas::_duplicate(myCase); + return ADAPT::HOMARD_Cas::_duplicate(myCase); } //============================================================================= -HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromCaseLastIteration(const char* nomCas, const char* DirNameStart) +ADAPT::HOMARD_Cas_ptr ADAPT_Gen_i::CreateCaseFromCaseLastIteration(const char* nomCas, const char* DirNameStart) // // nomCas : nom du cas a creer // DirNameStart : nom du répertoire du cas contenant l'iteration de reprise @@ -1452,12 +1452,12 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromCaseLastIteration(const char* std::string DirNameStartIter = CreateCase1(DirNameStart, -1) ; DirNameStartIter = string(DirNameStart) + "/" + DirNameStartIter ; - HOMARD::HOMARD_Cas_ptr myCase = CreateCaseFromIteration(nomCas, DirNameStartIter.c_str()) ; + ADAPT::HOMARD_Cas_ptr myCase = CreateCaseFromIteration(nomCas, DirNameStartIter.c_str()) ; - return HOMARD::HOMARD_Cas::_duplicate(myCase); + return ADAPT::HOMARD_Cas::_duplicate(myCase); } //============================================================================= -HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromCaseIteration(const char* nomCas, const char* DirNameStart, CORBA::Long Number) +ADAPT::HOMARD_Cas_ptr ADAPT_Gen_i::CreateCaseFromCaseIteration(const char* nomCas, const char* DirNameStart, CORBA::Long Number) // // nomCas : nom du cas a creer // DirNameStart : nom du répertoire du cas contenant l'iteration de reprise @@ -1477,12 +1477,12 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromCaseIteration(const char* nom std::string DirNameStartIter = CreateCase1(DirNameStart, Number) ; DirNameStartIter = string(DirNameStart) + "/" + DirNameStartIter ; - HOMARD::HOMARD_Cas_ptr myCase = CreateCaseFromIteration(nomCas, DirNameStartIter.c_str()) ; + ADAPT::HOMARD_Cas_ptr myCase = CreateCaseFromIteration(nomCas, DirNameStartIter.c_str()) ; - return HOMARD::HOMARD_Cas::_duplicate(myCase); + return ADAPT::HOMARD_Cas::_duplicate(myCase); } //============================================================================= -std::string HOMARD_Gen_i::CreateCase1(const char* DirNameStart, CORBA::Long Number) +std::string ADAPT_Gen_i::CreateCase1(const char* DirNameStart, CORBA::Long Number) // // Retourne le nom du répertoire ou se trouve l'iteration voulue. // DirNameStart : nom du répertoire du cas contenant l'iteration de reprise @@ -1629,7 +1629,7 @@ std::string HOMARD_Gen_i::CreateCase1(const char* DirNameStart, CORBA::Long Numb return DirNameStartIter ; } //============================================================================= -HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCase0(const char* nomCas, const char* MeshName, const char* MeshFile, CORBA::Long MeshOption, CORBA::Long NumeIter, CORBA::Long Option) +ADAPT::HOMARD_Cas_ptr ADAPT_Gen_i::CreateCase0(const char* nomCas, const char* MeshName, const char* MeshFile, CORBA::Long MeshOption, CORBA::Long NumeIter, CORBA::Long Option) // // nomCas : nom du cas a creer // MeshName, MeshFile : nom et fichier du maillage correspondant @@ -1678,7 +1678,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCase0(const char* nomCas, const char* // B. Creation de l'objet cas et publication // MESSAGE ( "CreateCase0 : Creation de l'objet" ); - HOMARD::HOMARD_Cas_var myCase = newCase(); + ADAPT::HOMARD_Cas_var myCase = newCase(); myCase->SetName(nomCas); SALOMEDS::SObject_var aSO; SALOMEDS::SObject_var aResultSO=PublishInStudy(aSO, myCase, nomCas); @@ -1690,7 +1690,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCase0(const char* nomCas, const char* // Les valeurs extremes des coordonnées // MESSAGE ( "CreateCase0 : Les valeurs extremes des coordonnées" ); std::vector LesExtremes =GetBoundingBoxInMedFile(MeshFile) ; - HOMARD::extrema_var aSeq = new HOMARD::extrema() ; + ADAPT::extrema_var aSeq = new ADAPT::extrema() ; if (LesExtremes.size()!=10) { return 0; } aSeq->length(10) ; for (int i =0 ; i< LesExtremes.size() ; i++) @@ -1699,7 +1699,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCase0(const char* nomCas, const char* // Les groupes // MESSAGE ( "CreateCase0 : Les groupes" ); std::set LesGroupes =GetListeGroupesInMedFile(MeshFile) ; - HOMARD::ListGroupType_var aSeqGroupe = new HOMARD::ListGroupType ; + ADAPT::ListGroupType_var aSeqGroupe = new ADAPT::ListGroupType ; aSeqGroupe->length(LesGroupes.size()); std::set::const_iterator it ; int i = 0 ; @@ -1724,7 +1724,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCase0(const char* nomCas, const char* MESSAGE ( "CreateCas0 : ==> NomIteration = " << NomIteration ); // D.2. Creation de l'iteration - HOMARD::HOMARD_Iteration_var anIter = newIteration(); + ADAPT::HOMARD_Iteration_var anIter = newIteration(); myStudyContext._mesIterations[NomIteration] = anIter; anIter->SetName(NomIteration.c_str()); AssociateCaseIter (nomCas, NomIteration.c_str(), "IterationHomard"); @@ -1744,10 +1744,10 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCase0(const char* nomCas, const char* SetEtatIter(NomIteration.c_str(), -NumeIter); // - return HOMARD::HOMARD_Cas::_duplicate(myCase); + return ADAPT::HOMARD_Cas::_duplicate(myCase); } //============================================================================= -HOMARD::HOMARD_Hypothesis_ptr HOMARD_Gen_i::CreateHypothesis(const char* nomHypothesis) +ADAPT::HOMARD_Hypothesis_ptr ADAPT_Gen_i::CreateHypothesis(const char* nomHypothesis) { INFOS ( "CreateHypothesis : nomHypothesis = " << nomHypothesis ); IsValidStudy () ; @@ -1763,7 +1763,7 @@ HOMARD::HOMARD_Hypothesis_ptr HOMARD_Gen_i::CreateHypothesis(const char* nomHypo } // B. Creation de l'objet - HOMARD::HOMARD_Hypothesis_var myHypothesis = newHypothesis(); + ADAPT::HOMARD_Hypothesis_var myHypothesis = newHypothesis(); if (CORBA::is_nil(myHypothesis)) { SALOME::ExceptionStruct es; @@ -1786,17 +1786,17 @@ HOMARD::HOMARD_Hypothesis_ptr HOMARD_Gen_i::CreateHypothesis(const char* nomHypo myHypothesis->SetAdapInit(0); myHypothesis->SetExtraOutput(1); - return HOMARD::HOMARD_Hypothesis::_duplicate(myHypothesis); + return ADAPT::HOMARD_Hypothesis::_duplicate(myHypothesis); } //============================================================================= -HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration(const char* NomIteration, const char* nomIterParent) +ADAPT::HOMARD_Iteration_ptr ADAPT_Gen_i::CreateIteration(const char* NomIteration, const char* nomIterParent) //============================================================================= { INFOS ("CreateIteration : NomIteration = " << NomIteration << ", nomIterParent = " << nomIterParent); IsValidStudy () ; - HOMARD::HOMARD_Iteration_var myIterationParent = myStudyContext._mesIterations[nomIterParent]; + ADAPT::HOMARD_Iteration_var myIterationParent = myStudyContext._mesIterations[nomIterParent]; if (CORBA::is_nil(myIterationParent)) { SALOME::ExceptionStruct es; @@ -1808,7 +1808,7 @@ HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration(const char* NomIterat const char* nomCas = myIterationParent->GetCaseName(); MESSAGE ("CreateIteration : nomCas = " << nomCas); - HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; + ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; if (CORBA::is_nil(myCase)) { SALOME::ExceptionStruct es; @@ -1829,7 +1829,7 @@ HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration(const char* NomIterat return 0; }; - HOMARD::HOMARD_Iteration_var myIteration = newIteration(); + ADAPT::HOMARD_Iteration_var myIteration = newIteration(); if (CORBA::is_nil(myIteration)) { SALOME::ExceptionStruct es; @@ -1886,10 +1886,10 @@ HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration(const char* NomIterat aStudyBuilder->Addreference(aSubSO, aIterSOParent); aStudyBuilder->CommitCommand(); - return HOMARD::HOMARD_Iteration::_duplicate(myIteration); + return ADAPT::HOMARD_Iteration::_duplicate(myIteration); } //============================================================================= -HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundary(const char* BoundaryName, CORBA::Long BoundaryType) +ADAPT::HOMARD_Boundary_ptr ADAPT_Gen_i::CreateBoundary(const char* BoundaryName, CORBA::Long BoundaryType) { MESSAGE ("CreateBoundary : BoundaryName = " << BoundaryName << ", BoundaryType = " << BoundaryType); IsValidStudy () ; @@ -1905,7 +1905,7 @@ HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundary(const char* BoundaryNam return 0; }; - HOMARD::HOMARD_Boundary_var myBoundary = newBoundary(); + ADAPT::HOMARD_Boundary_var myBoundary = newBoundary(); myBoundary->SetName(BoundaryName); myBoundary->SetType(BoundaryType); @@ -1914,29 +1914,29 @@ HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundary(const char* BoundaryNam SALOMEDS::SObject_var aSO; SALOMEDS::SObject_var aResultSO=PublishInStudy(aSO, myBoundary, BoundaryName); - return HOMARD::HOMARD_Boundary::_duplicate(myBoundary); + return ADAPT::HOMARD_Boundary::_duplicate(myBoundary); } //============================================================================= -HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundaryCAO(const char* BoundaryName, const char* CAOFile) +ADAPT::HOMARD_Boundary_ptr ADAPT_Gen_i::CreateBoundaryCAO(const char* BoundaryName, const char* CAOFile) { INFOS ("CreateBoundaryCAO : BoundaryName = " << BoundaryName << ", CAOFile = " << CAOFile ); - HOMARD::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, -1); + ADAPT::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, -1); myBoundary->SetDataFile( CAOFile ) ; - return HOMARD::HOMARD_Boundary::_duplicate(myBoundary); + return ADAPT::HOMARD_Boundary::_duplicate(myBoundary); } //============================================================================= -HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundaryDi(const char* BoundaryName, const char* MeshName, const char* MeshFile) +ADAPT::HOMARD_Boundary_ptr ADAPT_Gen_i::CreateBoundaryDi(const char* BoundaryName, const char* MeshName, const char* MeshFile) { INFOS ("CreateBoundaryDi : BoundaryName = " << BoundaryName << ", MeshName = " << MeshName << ", MeshFile = " << MeshFile ); - HOMARD::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 0); + ADAPT::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 0); myBoundary->SetDataFile( MeshFile ) ; myBoundary->SetMeshName( MeshName ) ; - return HOMARD::HOMARD_Boundary::_duplicate(myBoundary); + return ADAPT::HOMARD_Boundary::_duplicate(myBoundary); } //============================================================================= -HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundaryCylinder(const char* BoundaryName, +ADAPT::HOMARD_Boundary_ptr ADAPT_Gen_i::CreateBoundaryCylinder(const char* BoundaryName, CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, CORBA::Double Rayon) @@ -1959,13 +1959,13 @@ HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundaryCylinder(const char* Bou return 0; }; // - HOMARD::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 1) ; + ADAPT::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 1) ; myBoundary->SetCylinder( Xcentre, Ycentre, Zcentre, Xaxe, Yaxe, Zaxe, Rayon ) ; - return HOMARD::HOMARD_Boundary::_duplicate(myBoundary) ; + return ADAPT::HOMARD_Boundary::_duplicate(myBoundary) ; } //============================================================================= -HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundarySphere(const char* BoundaryName, +ADAPT::HOMARD_Boundary_ptr ADAPT_Gen_i::CreateBoundarySphere(const char* BoundaryName, CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, CORBA::Double Rayon) { @@ -1983,13 +1983,13 @@ HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundarySphere(const char* Bound return 0; }; // - HOMARD::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 2) ; + ADAPT::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 2) ; myBoundary->SetSphere( Xcentre, Ycentre, Zcentre, Rayon ) ; - return HOMARD::HOMARD_Boundary::_duplicate(myBoundary) ; + return ADAPT::HOMARD_Boundary::_duplicate(myBoundary) ; } //============================================================================= -HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundaryConeA(const char* BoundaryName, +ADAPT::HOMARD_Boundary_ptr ADAPT_Gen_i::CreateBoundaryConeA(const char* BoundaryName, CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, CORBA::Double Angle, CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre) { @@ -2011,13 +2011,13 @@ HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundaryConeA(const char* Bounda return 0; }; // - HOMARD::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 3) ; + ADAPT::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 3) ; myBoundary->SetConeA( Xaxe, Yaxe, Zaxe, Angle, Xcentre, Ycentre, Zcentre ) ; - return HOMARD::HOMARD_Boundary::_duplicate(myBoundary) ; + return ADAPT::HOMARD_Boundary::_duplicate(myBoundary) ; } //============================================================================= -HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundaryConeR(const char* BoundaryName, +ADAPT::HOMARD_Boundary_ptr ADAPT_Gen_i::CreateBoundaryConeR(const char* BoundaryName, CORBA::Double Xcentre1, CORBA::Double Ycentre1, CORBA::Double Zcentre1, CORBA::Double Rayon1, CORBA::Double Xcentre2, CORBA::Double Ycentre2, CORBA::Double Zcentre2, CORBA::Double Rayon2) { @@ -2043,13 +2043,13 @@ HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundaryConeR(const char* Bounda return 0; }; // - HOMARD::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 4) ; + ADAPT::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 4) ; myBoundary->SetConeR( Xcentre1, Ycentre1, Zcentre1, Rayon1, Xcentre2, Ycentre2, Zcentre2, Rayon2 ) ; - return HOMARD::HOMARD_Boundary::_duplicate(myBoundary) ; + return ADAPT::HOMARD_Boundary::_duplicate(myBoundary) ; } //============================================================================= -HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundaryTorus(const char* BoundaryName, +ADAPT::HOMARD_Boundary_ptr ADAPT_Gen_i::CreateBoundaryTorus(const char* BoundaryName, CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, CORBA::Double RayonRev, CORBA::Double RayonPri) @@ -2072,13 +2072,13 @@ HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundaryTorus(const char* Bounda return 0; }; // - HOMARD::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 5) ; + ADAPT::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 5) ; myBoundary->SetTorus( Xcentre, Ycentre, Zcentre, Xaxe, Yaxe, Zaxe, RayonRev, RayonPri ) ; - return HOMARD::HOMARD_Boundary::_duplicate(myBoundary) ; + return ADAPT::HOMARD_Boundary::_duplicate(myBoundary) ; } //============================================================================= -HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZone(const char* ZoneName, CORBA::Long ZoneType) +ADAPT::HOMARD_Zone_ptr ADAPT_Gen_i::CreateZone(const char* ZoneName, CORBA::Long ZoneType) { MESSAGE ("CreateZone : ZoneName = " << ZoneName << ", ZoneType = " << ZoneType); IsValidStudy () ; @@ -2093,7 +2093,7 @@ HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZone(const char* ZoneName, CORBA::Lo return 0; }; - HOMARD::HOMARD_Zone_var myZone = newZone(); + ADAPT::HOMARD_Zone_var myZone = newZone(); myZone->SetName(ZoneName); myZone->SetType(ZoneType); @@ -2102,10 +2102,10 @@ HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZone(const char* ZoneName, CORBA::Lo SALOMEDS::SObject_var aSO; SALOMEDS::SObject_var aResultSO=PublishInStudy(aSO, myZone, ZoneName); - return HOMARD::HOMARD_Zone::_duplicate(myZone); + return ADAPT::HOMARD_Zone::_duplicate(myZone); } //============================================================================= -HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneBox(const char* ZoneName, +ADAPT::HOMARD_Zone_ptr ADAPT_Gen_i::CreateZoneBox(const char* ZoneName, CORBA::Double Xmini, CORBA::Double Xmaxi, CORBA::Double Ymini, CORBA::Double Ymaxi, CORBA::Double Zmini, CORBA::Double Zmaxi) @@ -2130,13 +2130,13 @@ HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneBox(const char* ZoneName, return 0; }; // - HOMARD::HOMARD_Zone_var myZone = CreateZone(ZoneName, 2) ; + ADAPT::HOMARD_Zone_var myZone = CreateZone(ZoneName, 2) ; myZone->SetBox ( Xmini, Xmaxi, Ymini, Ymaxi, Zmini, Zmaxi) ; - return HOMARD::HOMARD_Zone::_duplicate(myZone) ; + return ADAPT::HOMARD_Zone::_duplicate(myZone) ; } //============================================================================= -HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneSphere(const char* ZoneName, +ADAPT::HOMARD_Zone_ptr ADAPT_Gen_i::CreateZoneSphere(const char* ZoneName, CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, CORBA::Double Rayon) { INFOS ("CreateZoneSphere : ZoneName = " << ZoneName ) ; @@ -2153,13 +2153,13 @@ HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneSphere(const char* ZoneName, return 0; }; // - HOMARD::HOMARD_Zone_var myZone = CreateZone(ZoneName, 4) ; + ADAPT::HOMARD_Zone_var myZone = CreateZone(ZoneName, 4) ; myZone->SetSphere( Xcentre, Ycentre, Zcentre, Rayon ) ; - return HOMARD::HOMARD_Zone::_duplicate(myZone) ; + return ADAPT::HOMARD_Zone::_duplicate(myZone) ; } //============================================================================= -HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneCylinder(const char* ZoneName, +ADAPT::HOMARD_Zone_ptr ADAPT_Gen_i::CreateZoneCylinder(const char* ZoneName, CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, CORBA::Double Rayon, CORBA::Double Haut) @@ -2185,13 +2185,13 @@ HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneCylinder(const char* ZoneName, return 0; }; // - HOMARD::HOMARD_Zone_var myZone = CreateZone(ZoneName, 5) ; + ADAPT::HOMARD_Zone_var myZone = CreateZone(ZoneName, 5) ; myZone->SetCylinder( Xcentre, Ycentre, Zcentre, Xaxe, Yaxe, Zaxe, Rayon, Haut ) ; - return HOMARD::HOMARD_Zone::_duplicate(myZone) ; + return ADAPT::HOMARD_Zone::_duplicate(myZone) ; } //============================================================================= -HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZonePipe(const char* ZoneName, +ADAPT::HOMARD_Zone_ptr ADAPT_Gen_i::CreateZonePipe(const char* ZoneName, CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, CORBA::Double Rayon, CORBA::Double Haut, CORBA::Double Rayonint) @@ -2220,13 +2220,13 @@ HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZonePipe(const char* ZoneName, return 0; }; // - HOMARD::HOMARD_Zone_var myZone = CreateZone(ZoneName, 7) ; + ADAPT::HOMARD_Zone_var myZone = CreateZone(ZoneName, 7) ; myZone->SetPipe( Xcentre, Ycentre, Zcentre, Xaxe, Yaxe, Zaxe, Rayon, Haut, Rayonint ) ; - return HOMARD::HOMARD_Zone::_duplicate(myZone) ; + return ADAPT::HOMARD_Zone::_duplicate(myZone) ; } //============================================================================= -HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneBox2D(const char* ZoneName, +ADAPT::HOMARD_Zone_ptr ADAPT_Gen_i::CreateZoneBox2D(const char* ZoneName, CORBA::Double Umini, CORBA::Double Umaxi, CORBA::Double Vmini, CORBA::Double Vmaxi, CORBA::Long Orient) @@ -2280,13 +2280,13 @@ HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneBox2D(const char* ZoneName, Zmaxi = Umaxi ; } else { VERIFICATION( (Orient>=1) && (Orient<=3) ) ; } - HOMARD::HOMARD_Zone_var myZone = CreateZone(ZoneName, 10+Orient) ; + ADAPT::HOMARD_Zone_var myZone = CreateZone(ZoneName, 10+Orient) ; myZone->SetBox ( Xmini, Xmaxi, Ymini, Ymaxi, Zmini, Zmaxi) ; - return HOMARD::HOMARD_Zone::_duplicate(myZone) ; + return ADAPT::HOMARD_Zone::_duplicate(myZone) ; } //============================================================================= -HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneDisk(const char* ZoneName, +ADAPT::HOMARD_Zone_ptr ADAPT_Gen_i::CreateZoneDisk(const char* ZoneName, CORBA::Double Ucentre, CORBA::Double Vcentre, CORBA::Double Rayon, CORBA::Long Orient) @@ -2325,13 +2325,13 @@ HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneDisk(const char* ZoneName, Zcentre = Ucentre ; } else { VERIFICATION( (Orient>=1) && (Orient<=3) ) ; } - HOMARD::HOMARD_Zone_var myZone = CreateZone(ZoneName, 30+Orient) ; + ADAPT::HOMARD_Zone_var myZone = CreateZone(ZoneName, 30+Orient) ; myZone->SetCylinder( Xcentre, Ycentre, Zcentre, 0., 0., 1., Rayon, 1. ) ; - return HOMARD::HOMARD_Zone::_duplicate(myZone) ; + return ADAPT::HOMARD_Zone::_duplicate(myZone) ; } //============================================================================= -HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneDiskWithHole(const char* ZoneName, +ADAPT::HOMARD_Zone_ptr ADAPT_Gen_i::CreateZoneDiskWithHole(const char* ZoneName, CORBA::Double Ucentre, CORBA::Double Vcentre, CORBA::Double Rayon, CORBA::Double Rayonint, CORBA::Long Orient) @@ -2373,10 +2373,10 @@ HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneDiskWithHole(const char* ZoneNam Zcentre = Ucentre ; } else { VERIFICATION( (Orient>=1) && (Orient<=3) ) ; } - HOMARD::HOMARD_Zone_var myZone = CreateZone(ZoneName, 60+Orient) ; + ADAPT::HOMARD_Zone_var myZone = CreateZone(ZoneName, 60+Orient) ; myZone->SetPipe( Xcentre, Ycentre, Zcentre, 0., 0., 1., Rayon, 1., Rayonint ) ; - return HOMARD::HOMARD_Zone::_duplicate(myZone) ; + return ADAPT::HOMARD_Zone::_duplicate(myZone) ; } //============================================================================= //============================================================================= @@ -2396,7 +2396,7 @@ HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZoneDiskWithHole(const char* ZoneNam // 1 : aucune option // x2 : publication du maillage dans SMESH //============================================================================= -CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMenage, CORBA::Long modeHOMARD, CORBA::Long Option1, CORBA::Long Option2) +CORBA::Long ADAPT_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMenage, CORBA::Long modeHOMARD, CORBA::Long Option1, CORBA::Long Option2) { INFOS ( "Compute : traitement de " << NomIteration << ", avec modeHOMARD = " << modeHOMARD << ", Option1 = " << Option1 << ", Option2 = " << Option2 ); @@ -2404,7 +2404,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena int codret = 0; // A.1. L'objet iteration - HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[NomIteration]; + ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[NomIteration]; ASSERT(!CORBA::is_nil(myIteration)); // A.2. Controle de la possibilite d'agir @@ -2471,7 +2471,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena // A.4. Le cas const char* nomCas = myIteration->GetCaseName(); - HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; + ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; ASSERT(!CORBA::is_nil(myCase)); // B. Les répertoires @@ -2653,7 +2653,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena //============================================================================= // Calcul d'une iteration : partie spécifique à l'adaptation //============================================================================= -CORBA::Long HOMARD_Gen_i::ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOMARD_Iteration_var myIteration, CORBA::Long etatMenage, HomardDriver* myDriver, CORBA::Long Option1, CORBA::Long Option2) +CORBA::Long ADAPT_Gen_i::ComputeAdap(ADAPT::HOMARD_Cas_var myCase, ADAPT::HOMARD_Iteration_var myIteration, CORBA::Long etatMenage, HomardDriver* myDriver, CORBA::Long Option1, CORBA::Long Option2) { MESSAGE ( "ComputeAdap avec Option1 = " << Option1 << ", Option2 = " << Option2 ); @@ -2677,12 +2677,12 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOM throw SALOME::SALOME_Exception(es); return 2; }; - HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; + ADAPT::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; ASSERT(!CORBA::is_nil(myHypo)); // B. L'iteration parent const char* nomIterationParent = myIteration->GetIterParentName(); - HOMARD::HOMARD_Iteration_var myIterationParent = myStudyContext._mesIterations[nomIterationParent]; + ADAPT::HOMARD_Iteration_var myIterationParent = myStudyContext._mesIterations[nomIterationParent]; ASSERT(!CORBA::is_nil(myIterationParent)); // Si l'iteration parent n'est pas calculee, on le fait (recursivite amont) if ( myIterationParent->GetState() == 1 ) @@ -2748,7 +2748,7 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOM // D.5. Les types de raffinement et de deraffinement // Les appels corba sont lourds, il vaut mieux les grouper - HOMARD::listeTypes* ListTypes = myHypo->GetAdapRefinUnRef(); + ADAPT::listeTypes* ListTypes = myHypo->GetAdapRefinUnRef(); ASSERT(ListTypes->length() == 3); int TypeAdap = (*ListTypes)[0]; int TypeRaff = (*ListTypes)[1]; @@ -2772,7 +2772,7 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOM { DriverTexteField(myIteration, myHypo, myDriver) ; } // E.4. Ajout des informations liees au filtrage eventuel par les groupes - HOMARD::ListGroupType* listeGroupes = myHypo->GetGroups(); + ADAPT::ListGroupType* listeGroupes = myHypo->GetGroups(); int numberOfGroups = listeGroupes->length(); MESSAGE( ". Filtrage par " << numberOfGroups << " groupes"); if (numberOfGroups > 0) @@ -2811,7 +2811,7 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOM //============================================================================= // Calcul d'une iteration : partie spécifique au suivi de frontière CAO //============================================================================= -CORBA::Long HOMARD_Gen_i::ComputeCAO(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOMARD_Iteration_var myIteration, CORBA::Long Option1, CORBA::Long Option2) +CORBA::Long ADAPT_Gen_i::ComputeCAO(ADAPT::HOMARD_Cas_var myCase, ADAPT::HOMARD_Iteration_var myIteration, CORBA::Long Option1, CORBA::Long Option2) { MESSAGE ( "ComputeCAO avec Option1 = " << Option1 << ", Option2 = " << Option2 ); @@ -2876,10 +2876,10 @@ CORBA::Long HOMARD_Gen_i::ComputeCAO(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOMA { MESSAGE ( ". theInputNodeFiles["<< i << "] = " << theInputNodeFiles[i] ); } // B.4. Le fichier de la CAO - HOMARD::ListBoundaryGroupType* ListBoundaryGroupType = myCase->GetBoundaryGroup(); + ADAPT::ListBoundaryGroupType* ListBoundaryGroupType = myCase->GetBoundaryGroup(); std::string BoundaryName = std::string((*ListBoundaryGroupType)[0]); MESSAGE ( ". BoundaryName = " << BoundaryName ); - HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; + ADAPT::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; const std::string theXaoFileName = myBoundary->GetDataFile(); MESSAGE ( ". theXaoFileName = " << theXaoFileName ); @@ -2907,7 +2907,7 @@ CORBA::Long HOMARD_Gen_i::ComputeCAO(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOMA // 1 : aucune option // x2 : publication du maillage dans SMESH //============================================================================= -CORBA::Long HOMARD_Gen_i::ComputeCAObis(HOMARD::HOMARD_Iteration_var myIteration, CORBA::Long Option1, CORBA::Long Option2) +CORBA::Long ADAPT_Gen_i::ComputeCAObis(ADAPT::HOMARD_Iteration_var myIteration, CORBA::Long Option1, CORBA::Long Option2) { MESSAGE ( "ComputeCAObis, avec Option1 = " << Option1 << ", Option2 = " << Option2 ); @@ -2939,7 +2939,7 @@ CORBA::Long HOMARD_Gen_i::ComputeCAObis(HOMARD::HOMARD_Iteration_var myIteration // A.3. Le cas const char* CaseName = myIteration->GetCaseName(); - HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[CaseName]; + ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[CaseName]; ASSERT(!CORBA::is_nil(myCase)); // A.4. Le sous-répertoire de l'iteration a traiter @@ -3020,7 +3020,7 @@ CORBA::Long HOMARD_Gen_i::ComputeCAObis(HOMARD::HOMARD_Iteration_var myIteration // nomrep : nom du répertoire parent // num : le nom du sous-répertoire est sous la forme 'In', n est >= num //============================================================================= -char* HOMARD_Gen_i::CreateDirNameIter(const char* nomrep, CORBA::Long num ) +char* ADAPT_Gen_i::CreateDirNameIter(const char* nomrep, CORBA::Long num ) { MESSAGE ( "CreateDirNameIter : nomrep ="<< nomrep << ", num = "<GetIterParentName(); - HOMARD::HOMARD_Iteration_var myIterationParent = myStudyContext._mesIterations[nomIterationParent]; + ADAPT::HOMARD_Iteration_var myIterationParent = myStudyContext._mesIterations[nomIterationParent]; const char* nomDirItPa = myIterationParent->GetDirNameLoc(); std::stringstream DirComputePa ; DirComputePa << nomDirCase << "/" << nomDirItPa; @@ -3219,10 +3219,10 @@ char* HOMARD_Gen_i::ComputeDirPaManagement(HOMARD::HOMARD_Cas_var myCase, HOMARD //============================================================================= // Calcul d'une iteration : ecriture des zones dans le fichier de configuration //============================================================================= -void HOMARD_Gen_i::DriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver) +void ADAPT_Gen_i::DriverTexteZone(ADAPT::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver) { MESSAGE ( "... DriverTexteZone" ); - HOMARD::listeZonesHypo* ListZone = myHypo->GetZones(); + ADAPT::listeZonesHypo* ListZone = myHypo->GetZones(); int numberOfZonesx2 = ListZone->length(); int NumZone ; @@ -3230,7 +3230,7 @@ void HOMARD_Gen_i::DriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, HomardD { std::string ZoneName = std::string((*ListZone)[iaux]); MESSAGE ( "... ZoneName = " << ZoneName); - HOMARD::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName]; + ADAPT::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName]; ASSERT(!CORBA::is_nil(myZone)); int ZoneType = myZone->GetType(); @@ -3238,7 +3238,7 @@ void HOMARD_Gen_i::DriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, HomardD int TypeUse = atoi( TypeUsestr.c_str() ); MESSAGE ( "... ZoneType = " << ZoneType << ", TypeUse = "<GetCoords(); + ADAPT::double_array* zone = myZone->GetCoords(); if ( ZoneType == 2 || ( ZoneType>=11 && ZoneType <=13 ) ) // Cas d un parallelepipede ou d'un rectangle { myDriver->TexteZone(NumZone, ZoneType, TypeUse, (*zone)[0], (*zone)[1], (*zone)[2], (*zone)[3], (*zone)[4], (*zone)[5], 0., 0., 0.); } else if ( ZoneType == 4 ) // Cas d une sphere @@ -3255,7 +3255,7 @@ void HOMARD_Gen_i::DriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, HomardD //============================================================================= // Calcul d'une iteration : ecriture des champs dans le fichier de configuration //============================================================================= -void HOMARD_Gen_i::DriverTexteField(HOMARD::HOMARD_Iteration_var myIteration, HOMARD::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver) +void ADAPT_Gen_i::DriverTexteField(ADAPT::HOMARD_Iteration_var myIteration, ADAPT::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver) { MESSAGE ( "... DriverTexteField" ); // Le fichier du champ @@ -3273,7 +3273,7 @@ void HOMARD_Gen_i::DriverTexteField(HOMARD::HOMARD_Iteration_var myIteration, HO int Rank = myIteration->GetRank(); MESSAGE( ". Rank = " << Rank ); // Les informations sur les champs - HOMARD::InfosHypo* aInfosHypo = myHypo->GetField(); + ADAPT::InfosHypo* aInfosHypo = myHypo->GetField(); // Le nom const char* FieldName = aInfosHypo->FieldName; // Les seuils @@ -3291,7 +3291,7 @@ void HOMARD_Gen_i::DriverTexteField(HOMARD::HOMARD_Iteration_var myIteration, HO myDriver->TexteField(FieldName, FieldFile, TimeStep, Rank, TypeThR, ThreshR, TypeThC, ThreshC, UsField, UsCmpI); // // Les composantes - HOMARD::listeComposantsHypo* mescompo = myHypo->GetComps(); + ADAPT::listeComposantsHypo* mescompo = myHypo->GetComps(); int numberOfCompos = mescompo->length(); MESSAGE( ". numberOfCompos = " << numberOfCompos ); for (int NumeComp = 0; NumeComp< numberOfCompos; NumeComp++) @@ -3309,12 +3309,12 @@ void HOMARD_Gen_i::DriverTexteField(HOMARD::HOMARD_Iteration_var myIteration, HO // 2. les liens avec les groupes // 3. un entier resumant le type de comportement pour les frontieres //============================================================================= -int HOMARD_Gen_i::DriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, HomardDriver* myDriver) +int ADAPT_Gen_i::DriverTexteBoundary(ADAPT::HOMARD_Cas_var myCase, HomardDriver* myDriver) { MESSAGE ( "... DriverTexteBoundary" ); // 1. Recuperation des frontieres std::list ListeBoundaryTraitees ; - HOMARD::ListBoundaryGroupType* ListBoundaryGroupType = myCase->GetBoundaryGroup(); + ADAPT::ListBoundaryGroupType* ListBoundaryGroupType = myCase->GetBoundaryGroup(); int numberOfitems = ListBoundaryGroupType->length(); MESSAGE ( "... number of string for Boundary+Group = " << numberOfitems); int BoundaryOption = 1 ; @@ -3338,7 +3338,7 @@ int HOMARD_Gen_i::DriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, HomardDrive if ( A_faire == 1 ) { // 2.2.1. Caracteristiques de la frontiere - HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; + ADAPT::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; ASSERT(!CORBA::is_nil(myBoundary)); int BoundaryType = myBoundary->GetType(); MESSAGE ( "... BoundaryType = " << BoundaryType ); @@ -3364,7 +3364,7 @@ int HOMARD_Gen_i::DriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, HomardDrive else { NumBoundaryAnalytical++ ; - HOMARD::double_array* coor = myBoundary->GetCoords(); + ADAPT::double_array* coor = myBoundary->GetCoords(); if (BoundaryType == 1) // Cas d un cylindre { myDriver->TexteBoundaryAn(BoundaryName, NumBoundaryAnalytical, BoundaryType, (*coor)[0], (*coor)[1], (*coor)[2], (*coor)[3], (*coor)[4], (*coor)[5], (*coor)[6], 0.); @@ -3401,7 +3401,7 @@ int HOMARD_Gen_i::DriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, HomardDrive { std::string BoundaryName = std::string((*ListBoundaryGroupType)[NumBoundary]); MESSAGE ( "... BoundaryName = " << BoundaryName); - HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; + ADAPT::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; ASSERT(!CORBA::is_nil(myBoundary)); int BoundaryType = myBoundary->GetType(); MESSAGE ( "... BoundaryType = " << BoundaryType ); @@ -3433,7 +3433,7 @@ int HOMARD_Gen_i::DriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, HomardDrive //============================================================================= // Calcul d'une iteration : ecriture des interpolations dans le fichier de configuration //============================================================================= -void HOMARD_Gen_i::DriverTexteFieldInterp(HOMARD::HOMARD_Iteration_var myIteration, HOMARD::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver) +void ADAPT_Gen_i::DriverTexteFieldInterp(ADAPT::HOMARD_Iteration_var myIteration, ADAPT::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver) { MESSAGE ( "... DriverTexteFieldInterp" ); int TypeFieldInterp = myHypo->GetTypeFieldInterp(); @@ -3462,11 +3462,11 @@ void HOMARD_Gen_i::DriverTexteFieldInterp(HOMARD::HOMARD_Iteration_var myIterati else if (TypeFieldInterp == 2) { // Les champs et leurs instants pour l'iteration - HOMARD::listeFieldInterpTSRsIter* ListFieldTSR = myIteration->GetFieldInterpsTimeStepRank(); + ADAPT::listeFieldInterpTSRsIter* ListFieldTSR = myIteration->GetFieldInterpsTimeStepRank(); int numberOfFieldsx3 = ListFieldTSR->length(); MESSAGE( ". pour iteration, numberOfFields = " << numberOfFieldsx3/3 ); // Les champs pour l'hypothese - HOMARD::listeFieldInterpsHypo* ListField = myHypo->GetFieldInterps(); + ADAPT::listeFieldInterpsHypo* ListField = myHypo->GetFieldInterps(); int numberOfFieldsx2 = ListField->length(); MESSAGE( ". pour hypothese, numberOfFields = " << numberOfFieldsx2/2 ); // On parcourt tous les champs de l'hypothese @@ -3522,7 +3522,7 @@ void HOMARD_Gen_i::DriverTexteFieldInterp(HOMARD::HOMARD_Iteration_var myIterati // Publications //=========================================================================== //=========================================================================== -SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr theSObject, +SALOMEDS::SObject_ptr ADAPT_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr theSObject, CORBA::Object_ptr theObject, const char* theName) { @@ -3539,11 +3539,11 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr theSObj // Recuperation de l'objet correspondant, en essayant chacun des types possibles // Rq : Iteration est publiee ailleurs - HOMARD::HOMARD_Boundary_var aBoundary = HOMARD::HOMARD_Boundary::_narrow(theObject); - HOMARD::HOMARD_Cas_var aCase = HOMARD::HOMARD_Cas::_narrow(theObject); - HOMARD::HOMARD_Hypothesis_var aHypo = HOMARD::HOMARD_Hypothesis::_narrow(theObject); - HOMARD::HOMARD_YACS_var aYACS = HOMARD::HOMARD_YACS::_narrow(theObject); - HOMARD::HOMARD_Zone_var aZone = HOMARD::HOMARD_Zone::_narrow(theObject); + ADAPT::HOMARD_Boundary_var aBoundary = ADAPT::HOMARD_Boundary::_narrow(theObject); + ADAPT::HOMARD_Cas_var aCase = ADAPT::HOMARD_Cas::_narrow(theObject); + ADAPT::HOMARD_Hypothesis_var aHypo = ADAPT::HOMARD_Hypothesis::_narrow(theObject); + ADAPT::HOMARD_YACS_var aYACS = ADAPT::HOMARD_YACS::_narrow(theObject); + ADAPT::HOMARD_Zone_var aZone = ADAPT::HOMARD_Zone::_narrow(theObject); UpdateStudy(); @@ -3578,14 +3578,14 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr theSObj return aResultSO._retn(); }; //============================================================================= -SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishBoundaryInStudy( SALOMEDS::StudyBuilder_var aStudyBuilder, - HOMARD::HOMARD_Boundary_ptr theObject, const char* theName) +SALOMEDS::SObject_ptr ADAPT_Gen_i::PublishBoundaryInStudy( SALOMEDS::StudyBuilder_var aStudyBuilder, + ADAPT::HOMARD_Boundary_ptr theObject, const char* theName) { MESSAGE("PublishBoundaryStudy pour "<FindComponent(ComponentDataType()); @@ -3658,18 +3658,18 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishBoundaryInStudy( SALOMEDS::StudyBuild return aResultSO._retn(); } //============================================================================= -SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishCaseInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, - HOMARD::HOMARD_Cas_ptr theObject, const char* theName) +SALOMEDS::SObject_ptr ADAPT_Gen_i::PublishCaseInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, + ADAPT::HOMARD_Cas_ptr theObject, const char* theName) { MESSAGE("PublishCaseInStudy pour "<_is_nil()"); + MESSAGE("ADAPT_Gen_i::theObject->_is_nil()"); return aResultSO._retn(); } if (myStudy->_is_nil()) { - MESSAGE("HOMARD_Gen_i::myStudy->_is_nil()"); + MESSAGE("ADAPT_Gen_i::myStudy->_is_nil()"); return aResultSO._retn(); } @@ -3690,8 +3690,8 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishCaseInStudy(SALOMEDS::StudyBuilder_va return aResultSO._retn(); } //============================================================================= -SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishHypotheseInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, - HOMARD::HOMARD_Hypothesis_ptr theObject, const char* theName) +SALOMEDS::SObject_ptr ADAPT_Gen_i::PublishHypotheseInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, + ADAPT::HOMARD_Hypothesis_ptr theObject, const char* theName) { MESSAGE("PublishHypotheseInStudy pour "<GetType(); // On ajoute la categorie des zones dans l etude si necessaire @@ -3858,7 +3858,7 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishZoneInStudy(SALOMEDS::StudyBuilder_va return aResultSO._retn(); } //=========================================================================== -void HOMARD_Gen_i::PublishInStudyAttr(SALOMEDS::StudyBuilder_var aStudyBuilder, +void ADAPT_Gen_i::PublishInStudyAttr(SALOMEDS::StudyBuilder_var aStudyBuilder, SALOMEDS::SObject_var aResultSO, const char* name, const char* comment, const char* icone, const char* ior) { @@ -3900,16 +3900,16 @@ void HOMARD_Gen_i::PublishInStudyAttr(SALOMEDS::StudyBuilder_var aStudyBuilder, }; //===================================================================================== -void HOMARD_Gen_i::PublishBoundaryUnderCase(const char* CaseName, const char* BoundaryName) +void ADAPT_Gen_i::PublishBoundaryUnderCase(const char* CaseName, const char* BoundaryName) { MESSAGE ( "PublishBoundaryUnderCase : CaseName = " << CaseName << ", BoundaryName= " << BoundaryName ); - HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[CaseName]; + ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[CaseName]; ASSERT(!CORBA::is_nil(myCase)); SALOMEDS::SObject_var aCaseSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myCase))); ASSERT(!CORBA::is_nil(aCaseSO)); - HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; + ADAPT::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; ASSERT(!CORBA::is_nil(myBoundary)); SALOMEDS::SObject_var aBoundarySO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myBoundary))); ASSERT(!CORBA::is_nil(aBoundarySO)); @@ -3926,16 +3926,16 @@ void HOMARD_Gen_i::PublishBoundaryUnderCase(const char* CaseName, const char* Bo }; //===================================================================================== -void HOMARD_Gen_i::PublishCaseUnderYACS(const char* nomYACS, const char* CaseName) +void ADAPT_Gen_i::PublishCaseUnderYACS(const char* nomYACS, const char* CaseName) { MESSAGE ( "PublishCaseUnderYACS : nomYACS = " << nomYACS << ", CaseName= " << CaseName ); - HOMARD::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; + ADAPT::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; ASSERT(!CORBA::is_nil(myYACS)); SALOMEDS::SObject_var aYACSSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myYACS))); ASSERT(!CORBA::is_nil(aYACSSO)); - HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[CaseName]; + ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[CaseName]; ASSERT(!CORBA::is_nil(myCase)); SALOMEDS::SObject_var aCaseSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myCase))); ASSERT(!CORBA::is_nil(aCaseSO)); @@ -3951,7 +3951,7 @@ void HOMARD_Gen_i::PublishCaseUnderYACS(const char* nomYACS, const char* CaseNam }; //============================================================================= -void HOMARD_Gen_i::PublishResultInSmesh(const char* NomFich, CORBA::Long Option) +void ADAPT_Gen_i::PublishResultInSmesh(const char* NomFich, CORBA::Long Option) // Option = 0 : fichier issu d'une importation // Option = 1 : fichier issu d'une execution HOMARD { @@ -4030,7 +4030,7 @@ void HOMARD_Gen_i::PublishResultInSmesh(const char* NomFich, CORBA::Long Option) } //============================================================================= -void HOMARD_Gen_i::DeleteResultInSmesh(std::string NomFich, std::string MeshName) +void ADAPT_Gen_i::DeleteResultInSmesh(std::string NomFich, std::string MeshName) { MESSAGE ("DeleteResultInSmesh pour le maillage " << MeshName << " dans le fichier " << NomFich ); if (CORBA::is_nil(myStudy)) @@ -4077,10 +4077,10 @@ void HOMARD_Gen_i::DeleteResultInSmesh(std::string NomFich, std::string MeshName return ; } //============================================================================= -void HOMARD_Gen_i::PublishMeshIterInSmesh(const char* NomIter) +void ADAPT_Gen_i::PublishMeshIterInSmesh(const char* NomIter) { MESSAGE( "PublishMeshIterInSmesh " << NomIter); - HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[NomIter]; + ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[NomIter]; SALOMEDS::SObject_var aIterSO=SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration))); if (CORBA::is_nil(myIteration)) @@ -4108,10 +4108,10 @@ void HOMARD_Gen_i::PublishMeshIterInSmesh(const char* NomIter) } //============================================================================= -void HOMARD_Gen_i::PublishFileUnderIteration(const char* NomIter, const char* NomFich, const char* Commentaire) +void ADAPT_Gen_i::PublishFileUnderIteration(const char* NomIter, const char* NomFich, const char* Commentaire) { // MESSAGE ("PublishFileUnderIteration pour l'iteration " << NomIter << " du fichier " << NomFich << " avec le commentaire " << Commentaire ); - HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[NomIter]; + ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[NomIter]; SALOMEDS::SObject_var aIterSO=SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration))); if (CORBA::is_nil(myIteration)) @@ -4143,10 +4143,10 @@ void HOMARD_Gen_i::PublishFileUnderIteration(const char* NomIter, const char* No } // //============================================================================= -void HOMARD_Gen_i::PublishFileUnderYACS(const char* nomYACS, const char* NomFich, const char* Commentaire) +void ADAPT_Gen_i::PublishFileUnderYACS(const char* nomYACS, const char* NomFich, const char* Commentaire) { // MESSAGE ("PublishFileUnderYACS pour le schema " << nomYACS << " du fichier " << NomFich << " avec le commentaire " << Commentaire ); - HOMARD::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; + ADAPT::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; SALOMEDS::SObject_var aYACSSO=SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myYACS))); if (CORBA::is_nil(myYACS)) @@ -4181,7 +4181,7 @@ void HOMARD_Gen_i::PublishFileUnderYACS(const char* nomYACS, const char* NomFich // FileName : nom du fichier contenant le script de lancement du calcul // DirName : le répertoire de lancement des calculs du schéma //============================================================================= -HOMARD::HOMARD_YACS_ptr HOMARD_Gen_i::CreateYACSSchema (const char* nomYACS, const char* nomCas, const char* ScriptFile, const char* DirName, const char* MeshFile) +ADAPT::HOMARD_YACS_ptr ADAPT_Gen_i::CreateYACSSchema (const char* nomYACS, const char* nomCas, const char* ScriptFile, const char* DirName, const char* MeshFile) { INFOS ( "CreateYACSSchema : Schema YACS " << nomYACS ); INFOS ( ". nomCas : " << nomCas); @@ -4200,7 +4200,7 @@ HOMARD::HOMARD_YACS_ptr HOMARD_Gen_i::CreateYACSSchema (const char* nomYACS, con } // B. Creation de l'objet - HOMARD::HOMARD_YACS_var myYACS = newYACS(); + ADAPT::HOMARD_YACS_var myYACS = newYACS(); if (CORBA::is_nil(myYACS)) { SALOME::ExceptionStruct es; @@ -4237,22 +4237,22 @@ HOMARD::HOMARD_YACS_ptr HOMARD_Gen_i::CreateYACSSchema (const char* nomYACS, con defaut_i = GetYACSMaxElem() ; myYACS->SetMaxElem( defaut_i ) ; // D.3. Fichier de sauvegarde dans le répertoire du cas - HOMARD::HOMARD_Cas_ptr caseyacs = GetCase(nomCas) ; + ADAPT::HOMARD_Cas_ptr caseyacs = GetCase(nomCas) ; std::string dirnamecase = caseyacs->GetDirName() ; std::string XMLFile ; XMLFile = dirnamecase + "/schema.xml" ; myYACS->SetXMLFile( XMLFile.c_str() ) ; - return HOMARD::HOMARD_YACS::_duplicate(myYACS); + return ADAPT::HOMARD_YACS::_duplicate(myYACS); } //============================================================================= // Ecriture d'un schema YACS //============================================================================= -CORBA::Long HOMARD_Gen_i::YACSWrite(const char* nomYACS) +CORBA::Long ADAPT_Gen_i::YACSWrite(const char* nomYACS) { INFOS ( "YACSWrite : Ecriture de " << nomYACS ); // Le répertoire du cas - HOMARD::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; + ADAPT::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; ASSERT(!CORBA::is_nil(myYACS)); // Le nom du fichier du schema std::string XMLFile ; @@ -4265,7 +4265,7 @@ CORBA::Long HOMARD_Gen_i::YACSWrite(const char* nomYACS) //============================================================================= // Ecriture d'un schema YACS sur un fichier donne //============================================================================= -CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* XMLFile) +CORBA::Long ADAPT_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* XMLFile) { INFOS ( "YACSWriteOnFile : Ecriture de " << nomYACS << " sur " << XMLFile ); @@ -4274,7 +4274,7 @@ CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* XMLFi // B. L'objet YACS // B.1. L'objet - HOMARD::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; + ADAPT::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; ASSERT(!CORBA::is_nil(myYACS)); // B.2. Les caracteristiques std::string DirName = myYACS->GetDirName() ; @@ -4288,7 +4288,7 @@ CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* XMLFi // C. Le cas // C.1. L'objet cas const char* nomCas = myYACS->GetCaseName(); - HOMARD::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; + ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; ASSERT(!CORBA::is_nil(myCase)); // C.2. Les instructions python associees au cas CORBA::String_var dumpCorbaCase = myCase->GetDumpPython(); @@ -4297,13 +4297,13 @@ CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* XMLFi // D. Les iterations // D.1. L'iteration initiale - HOMARD::HOMARD_Iteration_var Iter0 = myCase->GetIter0() ; + ADAPT::HOMARD_Iteration_var Iter0 = myCase->GetIter0() ; std::string Iter0Name = myCase->GetIter0Name() ; MESSAGE (". Iter0Name = " << Iter0Name); std::string MeshName = Iter0->GetMeshName(); MESSAGE (". MeshName = " << MeshName); // D.2. L'iteration numero 1 - HOMARD::listeIterFilles* maListe = Iter0->GetIterations(); + ADAPT::listeIterFilles* maListe = Iter0->GetIterations(); int numberOfIter = maListe->length(); if ( numberOfIter > 1 ) { @@ -4317,7 +4317,7 @@ CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* XMLFi } std::string Iter1Name = std::string((*maListe)[0]); MESSAGE ("... Iter1Name = " << Iter1Name); - HOMARD::HOMARD_Iteration_var Iter1 = GetIteration(Iter1Name.c_str()) ; + ADAPT::HOMARD_Iteration_var Iter1 = GetIteration(Iter1Name.c_str()) ; // D.3. Les instructions python associees a l'iteration CORBA::String_var dumpCorbaIter = Iter1->GetDumpPython(); std::string pythonIter = dumpCorbaIter.in(); @@ -4327,10 +4327,10 @@ CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* XMLFi // E.1. La structure std::string nomHypo = Iter1->GetHypoName(); MESSAGE (". nomHypo = " << nomHypo); - HOMARD::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; + ADAPT::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; ASSERT(!CORBA::is_nil(myHypo)); // E.2. Les caracteristiques de l'adaptation - HOMARD::listeTypes* ListTypes = myHypo->GetAdapRefinUnRef(); + ADAPT::listeTypes* ListTypes = myHypo->GetAdapRefinUnRef(); ASSERT(ListTypes->length() == 3); int TypeAdap = (*ListTypes)[0]; // int TypeRaff = (*ListTypes)[1]; @@ -4442,11 +4442,11 @@ CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* XMLFi //============================================================================= // Ecriture d'un schema YACS : ecriture des zones associees a une hypothese //============================================================================= -std::string HOMARD_Gen_i::YACSDriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, YACSDriver* myDriver) +std::string ADAPT_Gen_i::YACSDriverTexteZone(ADAPT::HOMARD_Hypothesis_var myHypo, YACSDriver* myDriver) { MESSAGE ( "YACSDriverTexteZone" ); // A. Les zones associees a cette hypothese - HOMARD::listeZonesHypo* ListZone = myHypo->GetZones(); + ADAPT::listeZonesHypo* ListZone = myHypo->GetZones(); int numberOfZonesx2 = ListZone->length(); // B. Parcours des zones @@ -4456,7 +4456,7 @@ std::string HOMARD_Gen_i::YACSDriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHy // 1. Reperage de la zone std::string ZoneName = std::string((*ListZone)[iaux]); MESSAGE ( "\n. ZoneName = " << ZoneName << " - " <GetBoundaryGroup(); + ADAPT::ListBoundaryGroupType* ListBoundaryGroupType = myCase->GetBoundaryGroup(); int numberOfitems = ListBoundaryGroupType->length(); // B. Parcours des frontieres @@ -4515,7 +4515,7 @@ std::string HOMARD_Gen_i::YACSDriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, if ( A_faire == 1 ) { // 1. Caracteristiques de la frontiere - HOMARD::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; + ADAPT::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; ASSERT(!CORBA::is_nil(myBoundary)); // 2. Les instructions python associees a la frontiere // La premiere ligne est un commentaire a eliminer @@ -4565,7 +4565,7 @@ std::string HOMARD_Gen_i::YACSDriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, // Next functions are inherited from SALOMEDS::Driver interface //============================================================================= //============================================================================= -SALOMEDS::TMPFile* HOMARD_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, +SALOMEDS::TMPFile* ADAPT_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, const char* theURL, CORBA::Boolean isMultiFile) { @@ -4601,57 +4601,57 @@ SALOMEDS::TMPFile* HOMARD_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, int id = 1; // -> save cases - std::map::const_iterator it_case; + std::map::const_iterator it_case; for (it_case = context._mesCas.begin(); it_case != context._mesCas.end(); ++it_case) { - HOMARD::HOMARD_Cas_var aCas = it_case->second; + ADAPT::HOMARD_Cas_var aCas = it_case->second; PortableServer::ServantBase_var aServant = GetServant(aCas); HOMARD_Cas_i* aCasServant = dynamic_cast(aServant.in()); if (aCasServant) { - f << HOMARD::GetSignature(HOMARD::Case) << aCasServant->Dump() << std::endl; + f << ADAPT::GetSignature(ADAPT::Case) << aCasServant->Dump() << std::endl; context._idmap[id++] = dynamic_cast(aCasServant); } } // -> save zones - std::map::const_iterator it_zone; + std::map::const_iterator it_zone; for (it_zone = context._mesZones.begin(); it_zone != context._mesZones.end(); ++it_zone) { - HOMARD::HOMARD_Zone_var aZone = it_zone->second; + ADAPT::HOMARD_Zone_var aZone = it_zone->second; PortableServer::ServantBase_var aServant = GetServant(aZone); HOMARD_Zone_i* aZoneServant = dynamic_cast(aServant.in()); if (aZoneServant) { - f << HOMARD::GetSignature(HOMARD::Zone) << aZoneServant->Dump() << std::endl; + f << ADAPT::GetSignature(ADAPT::Zone) << aZoneServant->Dump() << std::endl; context._idmap[id++] = dynamic_cast(aZoneServant); } } // -> save hypotheses - std::map::const_iterator it_hypo; + std::map::const_iterator it_hypo; for (it_hypo = context._mesHypotheses.begin(); it_hypo != context._mesHypotheses.end(); ++it_hypo) { - HOMARD::HOMARD_Hypothesis_var aHypo = it_hypo->second; + ADAPT::HOMARD_Hypothesis_var aHypo = it_hypo->second; PortableServer::ServantBase_var aServant = GetServant(aHypo); HOMARD_Hypothesis_i* aHypoServant = dynamic_cast(aServant.in()); if (aHypoServant) { - f << HOMARD::GetSignature(HOMARD::Hypothesis) << aHypoServant->Dump() << std::endl; + f << ADAPT::GetSignature(ADAPT::Hypothesis) << aHypoServant->Dump() << std::endl; context._idmap[id++] = dynamic_cast(aHypoServant); } } // -> save iterations - std::map::const_iterator it_iter; + std::map::const_iterator it_iter; for (it_iter = context._mesIterations.begin(); it_iter != context._mesIterations.end(); ++it_iter) { - HOMARD::HOMARD_Iteration_var aIter = it_iter->second; + ADAPT::HOMARD_Iteration_var aIter = it_iter->second; PortableServer::ServantBase_var aServant = GetServant(aIter); HOMARD_Iteration_i* aIterServant = dynamic_cast(aServant.in()); if (aIterServant) { - f << HOMARD::GetSignature(HOMARD::Iteration) << aIterServant->Dump() << std::endl; + f << ADAPT::GetSignature(ADAPT::Iteration) << aIterServant->Dump() << std::endl; context._idmap[id++] = dynamic_cast(aIterServant); } } // -> save boundaries - std::map::const_iterator it_boundary; + std::map::const_iterator it_boundary; for (it_boundary = context._mesBoundarys.begin(); it_boundary != context._mesBoundarys.end(); ++it_boundary) { - HOMARD::HOMARD_Boundary_var aBoundary = it_boundary->second; + ADAPT::HOMARD_Boundary_var aBoundary = it_boundary->second; PortableServer::ServantBase_var aServant = GetServant(aBoundary); HOMARD_Boundary_i* aBoundaryServant = dynamic_cast(aServant.in()); if (aBoundaryServant) { - f << HOMARD::GetSignature(HOMARD::Boundary) << aBoundaryServant->Dump() << std::endl; + f << ADAPT::GetSignature(ADAPT::Boundary) << aBoundaryServant->Dump() << std::endl; context._idmap[id++] = dynamic_cast(aBoundaryServant); } } @@ -4673,7 +4673,7 @@ SALOMEDS::TMPFile* HOMARD_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, }; //=========================================================================== -SALOMEDS::TMPFile* HOMARD_Gen_i::SaveASCII(SALOMEDS::SComponent_ptr theComponent, +SALOMEDS::TMPFile* ADAPT_Gen_i::SaveASCII(SALOMEDS::SComponent_ptr theComponent, const char* theURL, CORBA::Boolean isMultiFile) { @@ -4683,7 +4683,7 @@ SALOMEDS::TMPFile* HOMARD_Gen_i::SaveASCII(SALOMEDS::SComponent_ptr theComponent }; //=========================================================================== -CORBA::Boolean HOMARD_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, +CORBA::Boolean ADAPT_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, const SALOMEDS::TMPFile& theStream, const char* theURL, CORBA::Boolean isMultiFile) @@ -4726,16 +4726,16 @@ CORBA::Boolean HOMARD_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, while (f) { std::getline(f, line); - std::string bounSignature = HOMARD::GetSignature(HOMARD::Boundary); - std::string caseSignature = HOMARD::GetSignature(HOMARD::Case); - std::string hypoSignature = HOMARD::GetSignature(HOMARD::Hypothesis); - std::string iterSignature = HOMARD::GetSignature(HOMARD::Iteration); - std::string zoneSignature = HOMARD::GetSignature(HOMARD::Zone); - std::string yacsSignature = HOMARD::GetSignature(HOMARD::YACS); + std::string bounSignature = ADAPT::GetSignature(ADAPT::Boundary); + std::string caseSignature = ADAPT::GetSignature(ADAPT::Case); + std::string hypoSignature = ADAPT::GetSignature(ADAPT::Hypothesis); + std::string iterSignature = ADAPT::GetSignature(ADAPT::Iteration); + std::string zoneSignature = ADAPT::GetSignature(ADAPT::Zone); + std::string yacsSignature = ADAPT::GetSignature(ADAPT::YACS); if (line.substr(0, bounSignature.size()) == bounSignature) { // re-create boundary MESSAGE ("Recreation de la frontiere" ); - HOMARD::HOMARD_Boundary_var aBoundary = newBoundary(); + ADAPT::HOMARD_Boundary_var aBoundary = newBoundary(); PortableServer::ServantBase_var aServant = GetServant(aBoundary); HOMARD_Boundary_i* aBoundaryServant = dynamic_cast(aServant.in()); if (aBoundaryServant && aBoundaryServant->Restore(line.substr(bounSignature.size()))) { @@ -4746,7 +4746,7 @@ CORBA::Boolean HOMARD_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, else if (line.substr(0, caseSignature.size()) == caseSignature) { // re-create case MESSAGE ("Recreation du cas" ); - HOMARD::HOMARD_Cas_var aCase = newCase(); + ADAPT::HOMARD_Cas_var aCase = newCase(); PortableServer::ServantBase_var aServant = GetServant(aCase); HOMARD_Cas_i* aCaseServant = dynamic_cast(aServant.in()); if (aCaseServant && aCaseServant->Restore(line.substr(caseSignature.size()))) { @@ -4757,7 +4757,7 @@ CORBA::Boolean HOMARD_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, else if (line.substr(0, hypoSignature.size()) == hypoSignature) { // re-create hypothesis MESSAGE ("Recreation de l hypothese" ); - HOMARD::HOMARD_Hypothesis_var aHypo = newHypothesis(); + ADAPT::HOMARD_Hypothesis_var aHypo = newHypothesis(); PortableServer::ServantBase_var aServant = GetServant(aHypo); HOMARD_Hypothesis_i* aHypoServant = dynamic_cast(aServant.in()); if (aHypoServant && aHypoServant->Restore(line.substr(hypoSignature.size()))) { @@ -4768,7 +4768,7 @@ CORBA::Boolean HOMARD_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, else if (line.substr(0, iterSignature.size()) == iterSignature) { // re-create iteration MESSAGE ("Recreation de l'iteration" ); - HOMARD::HOMARD_Iteration_var aIter = newIteration(); + ADAPT::HOMARD_Iteration_var aIter = newIteration(); PortableServer::ServantBase_var aServant = GetServant(aIter); HOMARD_Iteration_i* aIterServant = dynamic_cast(aServant.in()); if (aIterServant && aIterServant->Restore(line.substr(iterSignature.size()))) { @@ -4779,7 +4779,7 @@ CORBA::Boolean HOMARD_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, else if (line.substr(0, zoneSignature.size()) == zoneSignature) { MESSAGE ("Recreation de la zone" ); // re-create zone - HOMARD::HOMARD_Zone_var aZone = newZone(); + ADAPT::HOMARD_Zone_var aZone = newZone(); PortableServer::ServantBase_var aServant = GetServant(aZone); HOMARD_Zone_i* aZoneServant = dynamic_cast(aServant.in()); if (aZoneServant && aZoneServant->Restore(line.substr(zoneSignature.size()))) { @@ -4790,7 +4790,7 @@ CORBA::Boolean HOMARD_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, else if (line.substr(0, zoneSignature.size()) == yacsSignature) { MESSAGE ("Recreation du schema YACS" ); // re-create YACS - HOMARD::HOMARD_YACS_var aYACS = newYACS(); + ADAPT::HOMARD_YACS_var aYACS = newYACS(); PortableServer::ServantBase_var aServant = GetServant(aYACS); HOMARD_YACS_i* aYACSServant = dynamic_cast(aServant.in()); if (aYACSServant && aYACSServant->Restore(line.substr(yacsSignature.size()))) { @@ -4812,7 +4812,7 @@ CORBA::Boolean HOMARD_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, }; //=========================================================================== -CORBA::Boolean HOMARD_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent, +CORBA::Boolean ADAPT_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent, const SALOMEDS::TMPFile& theStream, const char* theURL, CORBA::Boolean isMultiFile) @@ -4822,18 +4822,18 @@ CORBA::Boolean HOMARD_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent, }; //=========================================================================== -void HOMARD_Gen_i::Close(SALOMEDS::SComponent_ptr theComponent) +void ADAPT_Gen_i::Close(SALOMEDS::SComponent_ptr theComponent) { }; //=========================================================================== -char* HOMARD_Gen_i::ComponentDataType() +char* ADAPT_Gen_i::ComponentDataType() { return CORBA::string_dup("HOMARD"); }; //=========================================================================== -char* HOMARD_Gen_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject, +char* ADAPT_Gen_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject, const char* IORString, CORBA::Boolean isMultiFile, CORBA::Boolean isASCII) @@ -4861,7 +4861,7 @@ char* HOMARD_Gen_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject, }; //=========================================================================== -char* HOMARD_Gen_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, +char* ADAPT_Gen_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, const char* aLocalPersistentID, CORBA::Boolean isMultiFile, CORBA::Boolean isASCII) @@ -4881,29 +4881,29 @@ char* HOMARD_Gen_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, }; //=========================================================================== -CORBA::Boolean HOMARD_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR) +CORBA::Boolean ADAPT_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR) { if(CORBA::is_nil(myStudy)) return false; - HOMARD::HOMARD_Cas_var aCas = HOMARD::HOMARD_Cas::_narrow(theIOR); + ADAPT::HOMARD_Cas_var aCas = ADAPT::HOMARD_Cas::_narrow(theIOR); if(!aCas->_is_nil()) return true; - HOMARD::HOMARD_Hypothesis_var aHypo = HOMARD::HOMARD_Hypothesis::_narrow(theIOR); + ADAPT::HOMARD_Hypothesis_var aHypo = ADAPT::HOMARD_Hypothesis::_narrow(theIOR); if(!aHypo->_is_nil()) return true; - HOMARD::HOMARD_Zone_var aZone = HOMARD::HOMARD_Zone::_narrow(theIOR); + ADAPT::HOMARD_Zone_var aZone = ADAPT::HOMARD_Zone::_narrow(theIOR); if(!aZone->_is_nil()) return true; - HOMARD::HOMARD_Boundary_var aBoundary = HOMARD::HOMARD_Boundary::_narrow(theIOR); + ADAPT::HOMARD_Boundary_var aBoundary = ADAPT::HOMARD_Boundary::_narrow(theIOR); if(!aBoundary->_is_nil()) return true; /* Iteration is not published directly - HOMARD::HOMARD_Iteration_var aIter = HOMARD::HOMARD_Iteration::_narrow(theIOR); + ADAPT::HOMARD_Iteration_var aIter = ADAPT::HOMARD_Iteration::_narrow(theIOR); if(!aIter->_is_nil()) return true; */ @@ -4911,14 +4911,14 @@ CORBA::Boolean HOMARD_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR) }; //=========================================================================== -CORBA::Boolean HOMARD_Gen_i::CanCopy(SALOMEDS::SObject_ptr theObject) +CORBA::Boolean ADAPT_Gen_i::CanCopy(SALOMEDS::SObject_ptr theObject) { // No Copy/Paste support return false; }; //=========================================================================== -SALOMEDS::TMPFile* HOMARD_Gen_i::CopyFrom(SALOMEDS::SObject_ptr theObject, +SALOMEDS::TMPFile* ADAPT_Gen_i::CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID) { // No Copy/Paste support @@ -4927,7 +4927,7 @@ SALOMEDS::TMPFile* HOMARD_Gen_i::CopyFrom(SALOMEDS::SObject_ptr theObject, }; //=========================================================================== -CORBA::Boolean HOMARD_Gen_i::CanPaste(const char *theComponentName, +CORBA::Boolean ADAPT_Gen_i::CanPaste(const char *theComponentName, CORBA::Long theObjectID) { // No Copy/Paste support @@ -4935,7 +4935,7 @@ CORBA::Boolean HOMARD_Gen_i::CanPaste(const char *theComponentName, }; //=========================================================================== -SALOMEDS::SObject_ptr HOMARD_Gen_i::PasteInto(const SALOMEDS::TMPFile& theStream, +SALOMEDS::SObject_ptr ADAPT_Gen_i::PasteInto(const SALOMEDS::TMPFile& theStream, CORBA::Long theObjectID, SALOMEDS::SObject_ptr theSObject) { @@ -4945,7 +4945,7 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PasteInto(const SALOMEDS::TMPFile& theStream }; //=========================================================================== -PortableServer::ServantBase_var HOMARD_Gen_i::GetServant(CORBA::Object_ptr theObject) +PortableServer::ServantBase_var ADAPT_Gen_i::GetServant(CORBA::Object_ptr theObject) { PortableServer::Servant aServant = 0; if (!CORBA::is_nil(theObject)) { @@ -4959,7 +4959,7 @@ PortableServer::ServantBase_var HOMARD_Gen_i::GetServant(CORBA::Object_ptr theOb } //========================================================================== -Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Boolean isPublished, +Engines::TMPFile* ADAPT_Gen_i::DumpPython(CORBA::Boolean isPublished, CORBA::Boolean isMultiFile, CORBA::Boolean& isValidScript) { @@ -4989,11 +4989,11 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Boolean isPublished, aScript += "#\n# Creation of the boundaries"; aScript += "\n# =========================="; } - std::map::const_iterator it_boundary; + std::map::const_iterator it_boundary; for (it_boundary = myStudyContext._mesBoundarys.begin(); it_boundary != myStudyContext._mesBoundarys.end(); ++it_boundary) { - HOMARD::HOMARD_Boundary_var maBoundary = (*it_boundary).second; + ADAPT::HOMARD_Boundary_var maBoundary = (*it_boundary).second; CORBA::String_var dumpCorbaBoundary = maBoundary->GetDumpPython(); std::string dumpBoundary = dumpCorbaBoundary.in(); MESSAGE (dumpBoundary<<"\n"); @@ -5007,11 +5007,11 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Boolean isPublished, aScript += "#\n# Creation of the zones"; aScript += "\n# ====================="; } - std::map::const_iterator it_zone; + std::map::const_iterator it_zone; for ( it_zone = myStudyContext._mesZones.begin(); it_zone != myStudyContext._mesZones.end(); ++it_zone) { - HOMARD::HOMARD_Zone_var myZone = (*it_zone).second; + ADAPT::HOMARD_Zone_var myZone = (*it_zone).second; CORBA::String_var dumpCorbaZone = myZone->GetDumpPython(); std::string dumpZone = dumpCorbaZone.in(); MESSAGE (dumpZone<<"\n"); @@ -5025,11 +5025,11 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Boolean isPublished, aScript += "#\n# Creation of the hypotheses"; aScript += "\n# =========================="; } - std::map::const_iterator it_hypo; + std::map::const_iterator it_hypo; for ( it_hypo = myStudyContext._mesHypotheses.begin(); it_hypo != myStudyContext._mesHypotheses.end(); it_hypo++) { - HOMARD::HOMARD_Hypothesis_var monHypo = (*it_hypo).second; + ADAPT::HOMARD_Hypothesis_var monHypo = (*it_hypo).second; CORBA::String_var dumpCorbaHypo = monHypo->GetDumpPython(); std::string dumpHypo = dumpCorbaHypo.in(); MESSAGE (dumpHypo<<"\n"); @@ -5043,7 +5043,7 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Boolean isPublished, aScript += "#\n# Creation of the cases"; aScript += "\n# ====================="; } - std::map::const_iterator it_cas; + std::map::const_iterator it_cas; for (it_cas = myStudyContext._mesCas.begin(); it_cas != myStudyContext._mesCas.end(); it_cas++) { @@ -5053,11 +5053,11 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Boolean isPublished, dumpCas += std::string("\t") + nomCas; dumpCas += std::string(" = homard.CreateCase(\"") + nomCas + std::string("\", \""); - HOMARD::HOMARD_Cas_var myCase = (*it_cas).second; + ADAPT::HOMARD_Cas_var myCase = (*it_cas).second; CORBA::String_var cIter0= myCase->GetIter0Name(); std::string iter0 = cIter0.in(); - HOMARD::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[iter0]; + ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[iter0]; CORBA::String_var cMesh0= myIteration->GetMeshFile(); std::string mesh0 = cMesh0.in(); CORBA::String_var cMeshName0= myIteration->GetMeshName(); @@ -5077,11 +5077,11 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Boolean isPublished, aScript += "#\n# Creation of the iterations" ; aScript += "\n# =========================="; } - std::map::const_iterator it_iter; + std::map::const_iterator it_iter; for (it_iter = myStudyContext._mesIterations.begin(); it_iter != myStudyContext._mesIterations.end(); ++it_iter) { - HOMARD::HOMARD_Iteration_var aIter = (*it_iter).second; + ADAPT::HOMARD_Iteration_var aIter = (*it_iter).second; CORBA::String_var dumpCorbaIter = aIter->GetDumpPython(); std::string dumpIter = dumpCorbaIter.in(); MESSAGE (dumpIter<<"\n"); @@ -5095,11 +5095,11 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Boolean isPublished, aScript += "#\n# Creation of the schemas YACS"; aScript += "\n# ============================"; } - std::map::const_iterator it_yacs; + std::map::const_iterator it_yacs; for ( it_yacs = myStudyContext._mesYACSs.begin(); it_yacs != myStudyContext._mesYACSs.end(); ++it_yacs) { - HOMARD::HOMARD_YACS_var myYACS = (*it_yacs).second; + ADAPT::HOMARD_YACS_var myYACS = (*it_yacs).second; CORBA::String_var dumpCorbaYACS = myYACS->GetDumpPython(); std::string dumpYACS = dumpCorbaYACS.in(); MESSAGE (dumpYACS<<"\n"); @@ -5132,7 +5132,7 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Boolean isPublished, // Utilitaires //============================================================================= //============================================================================= -void HOMARD_Gen_i::IsValidStudy( ) +void ADAPT_Gen_i::IsValidStudy( ) { // MESSAGE( "IsValidStudy" ); if (CORBA::is_nil(SMESH_Gen_i::getStudyServant())) @@ -5146,10 +5146,10 @@ void HOMARD_Gen_i::IsValidStudy( ) } //============================================================================= -char* HOMARD_Gen_i::VerifieDir(const char* nomDir) +char* ADAPT_Gen_i::VerifieDir(const char* nomDir) { std::string casename = std::string("") ; - std::map::const_iterator it; + std::map::const_iterator it; for (it = myStudyContext._mesCas.begin(); it != myStudyContext._mesCas.end(); it++) { @@ -5171,7 +5171,7 @@ void SALOMEException( std::string message ) return ; }*/ //============================================================================= -char* HOMARD_Gen_i::getVersion() +char* ADAPT_Gen_i::getVersion() { #if HOMARD_DEVELOPMENT return CORBA::string_dup(SMESH_VERSION_STR"dev"); @@ -5189,7 +5189,7 @@ char* HOMARD_Gen_i::getVersion() // 3 : la chaine apres la derniere apparition du caractere // Si le caractere est absent, on retourne la chaine totale //=============================================================================== -std::string HOMARD_Gen_i::GetStringInTexte( const std::string ligne, const std::string caractere, int option ) +std::string ADAPT_Gen_i::GetStringInTexte( const std::string ligne, const std::string caractere, int option ) { // MESSAGE("GetStringInTexte, recherche de '"<getId(); + ADAPT_Gen_i* myADAPT_Gen = new ADAPT_Gen_i(orb, poa, contId, instanceName, interfaceName); + return myADAPT_Gen->getId(); } } diff --git a/src/ADAPT_I/HOMARD_Gen_i.hxx b/src/ADAPT_I/ADAPT_Gen_i.hxx similarity index 68% rename from src/ADAPT_I/HOMARD_Gen_i.hxx rename to src/ADAPT_I/ADAPT_Gen_i.hxx index 10c07cec4..4ef3172f1 100644 --- a/src/ADAPT_I/HOMARD_Gen_i.hxx +++ b/src/ADAPT_I/ADAPT_Gen_i.hxx @@ -17,11 +17,11 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -#ifndef _HOMARD_GEN_I_HXX_ -#define _HOMARD_GEN_I_HXX_ +#ifndef _ADAPT_GEN_I_HXX_ +#define _ADAPT_GEN_I_HXX_ #include -#include CORBA_SERVER_HEADER(HOMARD_Gen) +#include CORBA_SERVER_HEADER(ADAPT_Gen) #include CORBA_SERVER_HEADER(HOMARD_Cas) #include CORBA_SERVER_HEADER(HOMARD_Hypothesis) #include CORBA_SERVER_HEADER(HOMARD_Iteration) @@ -32,7 +32,7 @@ #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) #include "HOMARD_i.hxx" -#include "HOMARD_Gen.hxx" +#include "ADAPT_Gen.hxx" #include "HomardDriver.hxx" #include "YACSDriver.hxx" #include "FrontTrack.hxx" @@ -43,104 +43,104 @@ #include #include -class HOMARDENGINE_EXPORT HOMARD_Gen_i: +class HOMARDENGINE_EXPORT ADAPT_Gen_i: public virtual Engines_Component_i, - public virtual POA_HOMARD::HOMARD_Gen + public virtual POA_ADAPT::ADAPT_Gen { public: - HOMARD_Gen_i( CORBA::ORB_ptr orb, + ADAPT_Gen_i( CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId* contId, const char* instanceName, const char* interfaceName ); - virtual ~HOMARD_Gen_i(); + virtual ~ADAPT_Gen_i(); // Generalites // Les creations - HOMARD::HOMARD_Boundary_ptr CreateBoundary (const char* nomBoundary, CORBA::Long typeBoundary); - HOMARD::HOMARD_Boundary_ptr CreateBoundaryCAO(const char* nomBoundary, + ADAPT::HOMARD_Boundary_ptr CreateBoundary (const char* nomBoundary, CORBA::Long typeBoundary); + ADAPT::HOMARD_Boundary_ptr CreateBoundaryCAO(const char* nomBoundary, const char* DataFile); - HOMARD::HOMARD_Boundary_ptr CreateBoundaryDi (const char* nomBoundary, + ADAPT::HOMARD_Boundary_ptr CreateBoundaryDi (const char* nomBoundary, const char* MeshName, const char* DataFile); - HOMARD::HOMARD_Boundary_ptr CreateBoundaryCylinder (const char* nomBoundary, + ADAPT::HOMARD_Boundary_ptr CreateBoundaryCylinder (const char* nomBoundary, CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis, CORBA::Double Rayon); - HOMARD::HOMARD_Boundary_ptr CreateBoundarySphere (const char* nomBoundary, + ADAPT::HOMARD_Boundary_ptr CreateBoundarySphere (const char* nomBoundary, CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, CORBA::Double Rayon); - HOMARD::HOMARD_Boundary_ptr CreateBoundaryConeR (const char* nomBoundary, + ADAPT::HOMARD_Boundary_ptr CreateBoundaryConeR (const char* nomBoundary, CORBA::Double Xcentre1, CORBA::Double Ycentre1, CORBA::Double Zcentre1, CORBA::Double Rayon1, CORBA::Double Xcentre2, CORBA::Double Ycentre2, CORBA::Double Zcentre2, CORBA::Double Rayon2); - HOMARD::HOMARD_Boundary_ptr CreateBoundaryConeA (const char* nomBoundary, + ADAPT::HOMARD_Boundary_ptr CreateBoundaryConeA (const char* nomBoundary, CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis, CORBA::Double Angle, CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre); - HOMARD::HOMARD_Boundary_ptr CreateBoundaryTorus (const char* nomBoundary, + ADAPT::HOMARD_Boundary_ptr CreateBoundaryTorus (const char* nomBoundary, CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis, CORBA::Double RayonRev, CORBA::Double RayonPri); - HOMARD::HOMARD_Cas_ptr CreateCase (const char* nomCas, const char* MeshName, const char* FileName); - HOMARD::HOMARD_Cas_ptr CreateCaseFromIteration (const char* nomCas, const char* DirNameStart); - HOMARD::HOMARD_Cas_ptr CreateCaseFromCaseLastIteration (const char* nomCas, const char* DirNameStart); - HOMARD::HOMARD_Cas_ptr CreateCaseFromCaseIteration (const char* nomCas, const char* DirNameStart, CORBA::Long Number); - HOMARD::HOMARD_Cas_ptr CreateCase0 (const char* nomCas, const char* MeshName, const char* FileName, CORBA::Long MeshOption, CORBA::Long NumeIter, CORBA::Long Option); + ADAPT::HOMARD_Cas_ptr CreateCase (const char* nomCas, const char* MeshName, const char* FileName); + ADAPT::HOMARD_Cas_ptr CreateCaseFromIteration (const char* nomCas, const char* DirNameStart); + ADAPT::HOMARD_Cas_ptr CreateCaseFromCaseLastIteration (const char* nomCas, const char* DirNameStart); + ADAPT::HOMARD_Cas_ptr CreateCaseFromCaseIteration (const char* nomCas, const char* DirNameStart, CORBA::Long Number); + ADAPT::HOMARD_Cas_ptr CreateCase0 (const char* nomCas, const char* MeshName, const char* FileName, CORBA::Long MeshOption, CORBA::Long NumeIter, CORBA::Long Option); std::string CreateCase1 (const char* DirNameStart, CORBA::Long Number); - HOMARD::HOMARD_Hypothesis_ptr CreateHypothesis(const char* nomHypothesis); + ADAPT::HOMARD_Hypothesis_ptr CreateHypothesis(const char* nomHypothesis); - HOMARD::HOMARD_Iteration_ptr CreateIteration (const char* nomIter, const char* nomIterParent); + ADAPT::HOMARD_Iteration_ptr CreateIteration (const char* nomIter, const char* nomIterParent); - HOMARD::HOMARD_Zone_ptr CreateZone (const char* nomZone, CORBA::Long typeZone); - HOMARD::HOMARD_Zone_ptr CreateZoneBox (const char* nomZone, + ADAPT::HOMARD_Zone_ptr CreateZone (const char* nomZone, CORBA::Long typeZone); + ADAPT::HOMARD_Zone_ptr CreateZoneBox (const char* nomZone, CORBA::Double Xmini, CORBA::Double Xmaxi, CORBA::Double Ymini, CORBA::Double Ymaxi, CORBA::Double Zmini, CORBA::Double Zmaxi); - HOMARD::HOMARD_Zone_ptr CreateZoneBox2D (const char* nomZone, + ADAPT::HOMARD_Zone_ptr CreateZoneBox2D (const char* nomZone, CORBA::Double Umini, CORBA::Double Umaxi, CORBA::Double Vmini, CORBA::Double Vmaxi, CORBA::Long Orient); - HOMARD::HOMARD_Zone_ptr CreateZoneCylinder (const char* nomZone, + ADAPT::HOMARD_Zone_ptr CreateZoneCylinder (const char* nomZone, CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, CORBA::Double Rayon, CORBA::Double Haut); - HOMARD::HOMARD_Zone_ptr CreateZoneDisk (const char* nomZone, + ADAPT::HOMARD_Zone_ptr CreateZoneDisk (const char* nomZone, CORBA::Double Ucentre, CORBA::Double Vcentre, CORBA::Double Rayon, CORBA::Long Orient); - HOMARD::HOMARD_Zone_ptr CreateZoneDiskWithHole (const char* nomZone, + ADAPT::HOMARD_Zone_ptr CreateZoneDiskWithHole (const char* nomZone, CORBA::Double Ucentre, CORBA::Double Vcentre, CORBA::Double Rayon, CORBA::Double Rayonint, CORBA::Long Orient); - HOMARD::HOMARD_Zone_ptr CreateZonePipe (const char* nomZone, + ADAPT::HOMARD_Zone_ptr CreateZonePipe (const char* nomZone, CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, CORBA::Double Rayon, CORBA::Double Haut, CORBA::Double Rayonint); - HOMARD::HOMARD_Zone_ptr CreateZoneSphere (const char* nomZone, + ADAPT::HOMARD_Zone_ptr CreateZoneSphere (const char* nomZone, CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, CORBA::Double Rayon); // Les informations - HOMARD::HOMARD_Boundary_ptr GetBoundary (const char* nomBoundary); - HOMARD::HOMARD_Cas_ptr GetCase (const char* nomCas); - HOMARD::HOMARD_Hypothesis_ptr GetHypothesis (const char* nomHypothesis); - HOMARD::HOMARD_Iteration_ptr GetIteration (const char* nomIteration); - HOMARD::HOMARD_YACS_ptr GetYACS (const char* nomYACS); - HOMARD::HOMARD_Zone_ptr GetZone (const char* nomZone); + ADAPT::HOMARD_Boundary_ptr GetBoundary (const char* nomBoundary); + ADAPT::HOMARD_Cas_ptr GetCase (const char* nomCas); + ADAPT::HOMARD_Hypothesis_ptr GetHypothesis (const char* nomHypothesis); + ADAPT::HOMARD_Iteration_ptr GetIteration (const char* nomIteration); + ADAPT::HOMARD_YACS_ptr GetYACS (const char* nomYACS); + ADAPT::HOMARD_Zone_ptr GetZone (const char* nomZone); - HOMARD::listeBoundarys* GetAllBoundarysName(); - HOMARD::listeCases* GetAllCasesName(); - HOMARD::listeHypotheses* GetAllHypothesesName(); - HOMARD::listeIterations* GetAllIterationsName(); - HOMARD::listeYACSs* GetAllYACSsName(); - HOMARD::listeZones* GetAllZonesName(); + ADAPT::listeBoundarys* GetAllBoundarysName(); + ADAPT::listeCases* GetAllCasesName(); + ADAPT::listeHypotheses* GetAllHypothesesName(); + ADAPT::listeIterations* GetAllIterationsName(); + ADAPT::listeYACSs* GetAllYACSsName(); + ADAPT::listeZones* GetAllZonesName(); void MeshInfo (const char* nomCas, const char* MeshName, const char* FileName, const char* DirName, CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte); - HOMARD::HOMARD_Iteration_ptr LastIteration (const char* nomCas); + ADAPT::HOMARD_Iteration_ptr LastIteration (const char* nomCas); // L'etude void UpdateStudy(); @@ -176,15 +176,15 @@ public: char* CreateDirNameIter(const char* nomrep, CORBA::Long num ); CORBA::Long Compute(const char* nomIteration, CORBA::Long etatMenage, CORBA::Long modeHOMARD, CORBA::Long Option1, CORBA::Long Option2); - CORBA::Long ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOMARD_Iteration_var myIteration, CORBA::Long etatMenage, HomardDriver* myDriver, CORBA::Long Option1, CORBA::Long Option2); - CORBA::Long ComputeCAO(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOMARD_Iteration_var myIteration, CORBA::Long Option1, CORBA::Long Option2); - CORBA::Long ComputeCAObis(HOMARD::HOMARD_Iteration_var myIteration, CORBA::Long Option1, CORBA::Long Option2); - char* ComputeDirManagement(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOMARD_Iteration_var myIteration, CORBA::Long etatMenage); - char* ComputeDirPaManagement(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOMARD_Iteration_var myIteration); - void DriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver); - void DriverTexteField(HOMARD::HOMARD_Iteration_var myIteration, HOMARD::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver); - int DriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, HomardDriver* myDriver); - void DriverTexteFieldInterp(HOMARD::HOMARD_Iteration_var myIteration, HOMARD::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver); + CORBA::Long ComputeAdap(ADAPT::HOMARD_Cas_var myCase, ADAPT::HOMARD_Iteration_var myIteration, CORBA::Long etatMenage, HomardDriver* myDriver, CORBA::Long Option1, CORBA::Long Option2); + CORBA::Long ComputeCAO(ADAPT::HOMARD_Cas_var myCase, ADAPT::HOMARD_Iteration_var myIteration, CORBA::Long Option1, CORBA::Long Option2); + CORBA::Long ComputeCAObis(ADAPT::HOMARD_Iteration_var myIteration, CORBA::Long Option1, CORBA::Long Option2); + char* ComputeDirManagement(ADAPT::HOMARD_Cas_var myCase, ADAPT::HOMARD_Iteration_var myIteration, CORBA::Long etatMenage); + char* ComputeDirPaManagement(ADAPT::HOMARD_Cas_var myCase, ADAPT::HOMARD_Iteration_var myIteration); + void DriverTexteZone(ADAPT::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver); + void DriverTexteField(ADAPT::HOMARD_Iteration_var myIteration, ADAPT::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver); + int DriverTexteBoundary(ADAPT::HOMARD_Cas_var myCase, HomardDriver* myDriver); + void DriverTexteFieldInterp(ADAPT::HOMARD_Iteration_var myIteration, ADAPT::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver); char* VerifieDir(const char* nomDir); @@ -197,11 +197,11 @@ public: void PublishMeshIterInSmesh(const char* NomIter); // YACS - HOMARD::HOMARD_YACS_ptr CreateYACSSchema (const char* YACSName, const char* nomCas, const char* ScriptFile, const char* DirName, const char* MeshFile); + ADAPT::HOMARD_YACS_ptr CreateYACSSchema (const char* YACSName, const char* nomCas, const char* ScriptFile, const char* DirName, const char* MeshFile); CORBA::Long YACSWrite(const char* nomYACS); CORBA::Long YACSWriteOnFile(const char* nomYACS, const char* XMLFile); - std::string YACSDriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, YACSDriver* myDriver); - std::string YACSDriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, YACSDriver* myDriver); + std::string YACSDriverTexteZone(ADAPT::HOMARD_Hypothesis_var myHypo, YACSDriver* myDriver); + std::string YACSDriverTexteBoundary(ADAPT::HOMARD_Cas_var myCase, YACSDriver* myDriver); // Preferences void SetPreferences() ; @@ -278,27 +278,27 @@ public: private: SALOMEDS::SObject_ptr PublishBoundaryInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, - HOMARD::HOMARD_Boundary_ptr theObject, const char* theName); + ADAPT::HOMARD_Boundary_ptr theObject, const char* theName); SALOMEDS::SObject_ptr PublishCaseInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, - HOMARD::HOMARD_Cas_ptr theObject, const char* theName); + ADAPT::HOMARD_Cas_ptr theObject, const char* theName); SALOMEDS::SObject_ptr PublishHypotheseInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, - HOMARD::HOMARD_Hypothesis_ptr theObject, const char* theName); + ADAPT::HOMARD_Hypothesis_ptr theObject, const char* theName); SALOMEDS::SObject_ptr PublishYACSInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, - HOMARD::HOMARD_YACS_ptr theObject, const char* theName); + ADAPT::HOMARD_YACS_ptr theObject, const char* theName); SALOMEDS::SObject_ptr PublishZoneInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, - HOMARD::HOMARD_Zone_ptr theObject, const char* theName); + ADAPT::HOMARD_Zone_ptr theObject, const char* theName); virtual void PublishInStudyAttr(SALOMEDS::StudyBuilder_var aStudyBuilder, SALOMEDS::SObject_var aResultSO, const char* theName, const char* comment, const char* icone, const char* ior); PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject); - HOMARD::HOMARD_Boundary_ptr newBoundary(); - HOMARD::HOMARD_Cas_ptr newCase(); - HOMARD::HOMARD_Hypothesis_ptr newHypothesis(); - HOMARD::HOMARD_Iteration_ptr newIteration(); - HOMARD::HOMARD_YACS_ptr newYACS(); - HOMARD::HOMARD_Zone_ptr newZone(); + ADAPT::HOMARD_Boundary_ptr newBoundary(); + ADAPT::HOMARD_Cas_ptr newCase(); + ADAPT::HOMARD_Hypothesis_ptr newHypothesis(); + ADAPT::HOMARD_Iteration_ptr newIteration(); + ADAPT::HOMARD_YACS_ptr newYACS(); + ADAPT::HOMARD_Zone_ptr newZone(); virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished, @@ -311,16 +311,16 @@ private: private: struct StudyContext { - std::map _mesBoundarys; - std::map _mesCas; - std::map _mesHypotheses; - std::map _mesIterations; - std::map _mesYACSs; - std::map _mesZones; + std::map _mesBoundarys; + std::map _mesCas; + std::map _mesHypotheses; + std::map _mesIterations; + std::map _mesYACSs; + std::map _mesZones; std::map _idmap; }; - ::HOMARD_Gen* myHomard; + ::ADAPT_Gen* myHomard; SALOMEDS::Study_var myStudy; StudyContext myStudyContext; SALOME_NamingService* _NS; diff --git a/src/ADAPT_I/CMakeLists.txt b/src/ADAPT_I/CMakeLists.txt index b569b1e3d..d604458fb 100644 --- a/src/ADAPT_I/CMakeLists.txt +++ b/src/ADAPT_I/CMakeLists.txt @@ -68,7 +68,7 @@ SET(ADAPTEngine_HEADERS HOMARD_Hypothesis_i.hxx HOMARD_Iteration_i.hxx HOMARD_Zone_i.hxx - HOMARD_Gen_i.hxx + ADAPT_Gen_i.hxx HOMARD_Boundary_i.hxx HOMARD_YACS_i.hxx HomardMedCommun.h @@ -82,7 +82,7 @@ SET(ADAPTEngine_SOURCES HOMARD_Cas_i.cxx HOMARD_Hypothesis_i.cxx HOMARD_Iteration_i.cxx - HOMARD_Gen_i.cxx + ADAPT_Gen_i.cxx HOMARD_Zone_i.cxx HOMARD_Boundary_i.cxx HOMARD_YACS_i.cxx diff --git a/src/ADAPT_I/HOMARD_Boundary_i.cxx b/src/ADAPT_I/HOMARD_Boundary_i.cxx index ef80c35b5..cc1097767 100644 --- a/src/ADAPT_I/HOMARD_Boundary_i.cxx +++ b/src/ADAPT_I/HOMARD_Boundary_i.cxx @@ -27,7 +27,7 @@ // Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier // #include "HOMARD_Boundary_i.hxx" -#include "HOMARD_Gen_i.hxx" +#include "ADAPT_Gen_i.hxx" #include "HOMARD_Boundary.hxx" #include "HOMARD_DriverTools.hxx" @@ -49,7 +49,7 @@ HOMARD_Boundary_i::HOMARD_Boundary_i() */ //============================================================================= HOMARD_Boundary_i::HOMARD_Boundary_i( CORBA::ORB_ptr orb, - HOMARD::HOMARD_Gen_var engine ) + ADAPT::ADAPT_Gen_var engine ) { MESSAGE( "HOMARD_Boundary_i" ); _gen_i = engine; @@ -98,12 +98,12 @@ char* HOMARD_Boundary_i::GetDumpPython() //============================================================================= std::string HOMARD_Boundary_i::Dump() const { - return HOMARD::Dump( *myHomardBoundary ); + return ADAPT::Dump( *myHomardBoundary ); } //============================================================================= bool HOMARD_Boundary_i::Restore( const std::string& stream ) { - return HOMARD::Restore( *myHomardBoundary, stream ); + return ADAPT::Restore( *myHomardBoundary, stream ); } //============================================================================= //============================================================================= @@ -178,10 +178,10 @@ void HOMARD_Boundary_i::SetTorus( double X0, double X1, double X2, double X3, do myHomardBoundary->SetTorus( X0, X1, X2, X3, X4, X5, X6, X7 ); } //============================================================================= -HOMARD::double_array* HOMARD_Boundary_i::GetCoords() +ADAPT::double_array* HOMARD_Boundary_i::GetCoords() { ASSERT( myHomardBoundary ); - HOMARD::double_array_var aResult = new HOMARD::double_array(); + ADAPT::double_array_var aResult = new ADAPT::double_array(); std::vector mesCoor = myHomardBoundary->GetCoords(); aResult->length( mesCoor .size() ); std::vector::const_iterator it; @@ -197,10 +197,10 @@ void HOMARD_Boundary_i::SetLimit( double Xincr, double Yincr, double Zincr ) myHomardBoundary->SetLimit( Xincr, Yincr, Zincr ); } //============================================================================= -HOMARD::double_array* HOMARD_Boundary_i::GetLimit() +ADAPT::double_array* HOMARD_Boundary_i::GetLimit() { ASSERT( myHomardBoundary ); - HOMARD::double_array_var aResult = new HOMARD::double_array(); + ADAPT::double_array_var aResult = new ADAPT::double_array(); std::vector mesCoor = myHomardBoundary->GetLimit(); aResult->length( mesCoor .size() ); std::vector::const_iterator it; @@ -216,7 +216,7 @@ void HOMARD_Boundary_i::AddGroup( const char* Group) myHomardBoundary->AddGroup( Group ); } //============================================================================= -void HOMARD_Boundary_i::SetGroups(const HOMARD::ListGroupType& ListGroup) +void HOMARD_Boundary_i::SetGroups(const ADAPT::ListGroupType& ListGroup) { ASSERT( myHomardBoundary ); std::list ListString; @@ -227,11 +227,11 @@ void HOMARD_Boundary_i::SetGroups(const HOMARD::ListGroupType& ListGroup) myHomardBoundary->SetGroups( ListString ); } //============================================================================= -HOMARD::ListGroupType* HOMARD_Boundary_i::GetGroups() +ADAPT::ListGroupType* HOMARD_Boundary_i::GetGroups() { ASSERT( myHomardBoundary ); const std::list& ListString = myHomardBoundary->GetGroups(); - HOMARD::ListGroupType_var aResult = new HOMARD::ListGroupType; + ADAPT::ListGroupType_var aResult = new ADAPT::ListGroupType; aResult->length( ListString.size() ); std::list::const_iterator it; int i = 0; diff --git a/src/ADAPT_I/HOMARD_Boundary_i.hxx b/src/ADAPT_I/HOMARD_Boundary_i.hxx index eaac61af3..37b06921e 100644 --- a/src/ADAPT_I/HOMARD_Boundary_i.hxx +++ b/src/ADAPT_I/HOMARD_Boundary_i.hxx @@ -31,7 +31,7 @@ #define _HOMARD_Boundary_I_HXX_ #include -#include CORBA_SERVER_HEADER(HOMARD_Gen) +#include CORBA_SERVER_HEADER(ADAPT_Gen) #include CORBA_SERVER_HEADER(HOMARD_Boundary) #include "HOMARD_i.hxx" @@ -45,11 +45,11 @@ class HOMARD_Boundary; class HOMARDENGINE_EXPORT HOMARD_Boundary_i: public virtual Engines_Component_i, - public virtual POA_HOMARD::HOMARD_Boundary, + public virtual POA_ADAPT::HOMARD_Boundary, public virtual PortableServer::ServantBase { public: - HOMARD_Boundary_i( CORBA::ORB_ptr orb, HOMARD::HOMARD_Gen_var gen_i ); + HOMARD_Boundary_i( CORBA::ORB_ptr orb, ADAPT::ADAPT_Gen_var gen_i ); HOMARD_Boundary_i(); virtual ~HOMARD_Boundary_i(); @@ -88,14 +88,14 @@ public: double Xaxe, double Yaxe, double Zaxe, double rayonRev, double rayonPri ); - HOMARD::double_array* GetCoords(); + ADAPT::double_array* GetCoords(); void SetLimit( double Xincr, double Yincr, double Zincr); - HOMARD::double_array* GetLimit(); + ADAPT::double_array* GetLimit(); void AddGroup( const char* Group); - void SetGroups(const HOMARD::ListGroupType& ListGroup); - HOMARD::ListGroupType* GetGroups(); + void SetGroups(const ADAPT::ListGroupType& ListGroup); + ADAPT::ListGroupType* GetGroups(); // Liens avec les autres structures void SetCaseCreation( const char* NomCaseCreation ); @@ -106,7 +106,7 @@ private: ::HOMARD_Boundary* myHomardBoundary; CORBA::ORB_ptr _orb; - HOMARD::HOMARD_Gen_var _gen_i; + ADAPT::ADAPT_Gen_var _gen_i; }; #endif diff --git a/src/ADAPT_I/HOMARD_Cas_i.cxx b/src/ADAPT_I/HOMARD_Cas_i.cxx index 036dacef1..432faf678 100644 --- a/src/ADAPT_I/HOMARD_Cas_i.cxx +++ b/src/ADAPT_I/HOMARD_Cas_i.cxx @@ -28,7 +28,7 @@ // #include "HOMARD_Cas_i.hxx" -#include "HOMARD_Gen_i.hxx" +#include "ADAPT_Gen_i.hxx" #include "HOMARD_Cas.hxx" #include "HOMARD_DriverTools.hxx" #include "HOMARD.hxx" @@ -58,7 +58,7 @@ HOMARD_Cas_i::HOMARD_Cas_i() */ //============================================================================= HOMARD_Cas_i::HOMARD_Cas_i( CORBA::ORB_ptr orb, - HOMARD::HOMARD_Gen_var engine ) + ADAPT::ADAPT_Gen_var engine ) { MESSAGE( "HOMARD_Cas_i" ); _gen_i = engine; @@ -108,12 +108,12 @@ char* HOMARD_Cas_i::GetDumpPython() //============================================================================= std::string HOMARD_Cas_i::Dump() const { - return HOMARD::Dump( *myHomardCas ); + return ADAPT::Dump( *myHomardCas ); } //============================================================================= bool HOMARD_Cas_i::Restore( const std::string& stream ) { - return HOMARD::Restore( *myHomardCas, stream ); + return ADAPT::Restore( *myHomardCas, stream ); } //============================================================================= //============================================================================= @@ -161,7 +161,7 @@ void HOMARD_Cas_i::SetDirName( const char* NomDir ) { MESSAGE ( "etat : " << GetState() ) ; // D.1. Nom local du repertoire de l'iteration de depart dans le repertoire actuel du cas - HOMARD::HOMARD_Iteration_ptr Iter = GetIter0() ; + ADAPT::HOMARD_Iteration_ptr Iter = GetIter0() ; char* DirNameIter = Iter->GetDirNameLoc() ; MESSAGE ( "SetDirName : nom actuel pour le repertoire de l iteration, DirNameIter = "<< DirNameIter); // D.2. Recherche d'un nom local pour l'iteration de depart dans le futur repertoire du cas @@ -223,7 +223,7 @@ CORBA::Long HOMARD_Cas_i::GetState() ASSERT( myHomardCas ); // Nom de l'iteration initiale char* Iter0Name = GetIter0Name() ; - HOMARD::HOMARD_Iteration_ptr Iter = _gen_i->GetIteration(Iter0Name) ; + ADAPT::HOMARD_Iteration_ptr Iter = _gen_i->GetIteration(Iter0Name) ; int state = Iter->GetNumber() ; return state ; } @@ -260,7 +260,7 @@ CORBA::Long HOMARD_Cas_i::GetExtType() return myHomardCas->GetExtType(); } //============================================================================= -void HOMARD_Cas_i::SetBoundingBox( const HOMARD::extrema& LesExtrema ) +void HOMARD_Cas_i::SetBoundingBox( const ADAPT::extrema& LesExtrema ) { ASSERT( myHomardCas ); std::vector VExtrema; @@ -273,10 +273,10 @@ void HOMARD_Cas_i::SetBoundingBox( const HOMARD::extrema& LesExtrema ) myHomardCas->SetBoundingBox( VExtrema ); } //============================================================================= -HOMARD::extrema* HOMARD_Cas_i::GetBoundingBox() +ADAPT::extrema* HOMARD_Cas_i::GetBoundingBox() { ASSERT(myHomardCas ); - HOMARD::extrema_var aResult = new HOMARD::extrema(); + ADAPT::extrema_var aResult = new ADAPT::extrema(); std::vector LesExtremes = myHomardCas->GetBoundingBox(); ASSERT( LesExtremes.size() == 10 ); aResult->length( 10 ); @@ -293,7 +293,7 @@ void HOMARD_Cas_i::AddGroup( const char* Group) myHomardCas->AddGroup( Group ); } //============================================================================= -void HOMARD_Cas_i::SetGroups( const HOMARD::ListGroupType& ListGroup ) +void HOMARD_Cas_i::SetGroups( const ADAPT::ListGroupType& ListGroup ) { ASSERT( myHomardCas ); std::list ListString ; @@ -304,11 +304,11 @@ void HOMARD_Cas_i::SetGroups( const HOMARD::ListGroupType& ListGroup ) myHomardCas->SetGroups( ListString ); } //============================================================================= -HOMARD::ListGroupType* HOMARD_Cas_i::GetGroups() +ADAPT::ListGroupType* HOMARD_Cas_i::GetGroups() { ASSERT(myHomardCas ); const std::list& ListString = myHomardCas->GetGroups(); - HOMARD::ListGroupType_var aResult = new HOMARD::ListGroupType(); + ADAPT::ListGroupType_var aResult = new ADAPT::ListGroupType(); aResult->length( ListString.size() ); std::list::const_iterator it; int i = 0; @@ -332,7 +332,7 @@ void HOMARD_Cas_i::AddBoundaryGroup( const char* BoundaryName, const char* Group ASSERT( myHomardCas ); // A. Préalables // A.1. Caractéristiques de la frontière à ajouter - HOMARD::HOMARD_Boundary_ptr myBoundary = _gen_i->GetBoundary(BoundaryName) ; + ADAPT::HOMARD_Boundary_ptr myBoundary = _gen_i->GetBoundary(BoundaryName) ; ASSERT(!CORBA::is_nil(myBoundary)); int BoundaryType = myBoundary->GetType(); MESSAGE ( ". BoundaryType = " << BoundaryType ); @@ -366,7 +366,7 @@ void HOMARD_Cas_i::AddBoundaryGroup( const char* BoundaryName, const char* Group { boun = (*it).c_str() ; MESSAGE (".. Frontiere enregistrée : "<< boun ); - HOMARD::HOMARD_Boundary_ptr myBoundary_0 = _gen_i->GetBoundary(boun) ; + ADAPT::HOMARD_Boundary_ptr myBoundary_0 = _gen_i->GetBoundary(boun) ; int BoundaryType_0 = myBoundary_0->GetType(); MESSAGE ( ".. BoundaryType_0 = " << BoundaryType_0 ); if ( BoundaryType_0 == -1 ) @@ -386,7 +386,7 @@ void HOMARD_Cas_i::AddBoundaryGroup( const char* BoundaryName, const char* Group MESSAGE (".. Frontiere enregistrée : "<< boun ); if ( boun != BoundaryName ) { - HOMARD::HOMARD_Boundary_ptr myBoundary_0 = _gen_i->GetBoundary(boun) ; + ADAPT::HOMARD_Boundary_ptr myBoundary_0 = _gen_i->GetBoundary(boun) ; int BoundaryType_0 = myBoundary_0->GetType(); MESSAGE ( ".. BoundaryType_0 = " << BoundaryType_0 ); if ( BoundaryType_0 == 0 ) @@ -455,12 +455,12 @@ void HOMARD_Cas_i::AddBoundaryGroup( const char* BoundaryName, const char* Group } } //============================================================================= -HOMARD::ListBoundaryGroupType* HOMARD_Cas_i::GetBoundaryGroup() +ADAPT::ListBoundaryGroupType* HOMARD_Cas_i::GetBoundaryGroup() { MESSAGE ("GetBoundaryGroup"); ASSERT(myHomardCas ); const std::list& ListBoundaryGroup = myHomardCas->GetBoundaryGroup(); - HOMARD::ListBoundaryGroupType_var aResult = new HOMARD::ListBoundaryGroupType(); + ADAPT::ListBoundaryGroupType_var aResult = new ADAPT::ListBoundaryGroupType(); aResult->length( ListBoundaryGroup.size() ); std::list::const_iterator it; int i = 0; @@ -523,7 +523,7 @@ char* HOMARD_Cas_i::GetIter0Name() return CORBA::string_dup( myHomardCas->GetIter0Name().c_str() ); } //============================================================================= -HOMARD::HOMARD_Iteration_ptr HOMARD_Cas_i::GetIter0() +ADAPT::HOMARD_Iteration_ptr HOMARD_Cas_i::GetIter0() { // Nom de l'iteration initiale char* Iter0Name = GetIter0Name() ; @@ -531,7 +531,7 @@ HOMARD::HOMARD_Iteration_ptr HOMARD_Cas_i::GetIter0() return _gen_i->GetIteration(Iter0Name) ; } //============================================================================= -HOMARD::HOMARD_Iteration_ptr HOMARD_Cas_i::NextIteration( const char* IterName ) +ADAPT::HOMARD_Iteration_ptr HOMARD_Cas_i::NextIteration( const char* IterName ) { // Nom de l'iteration parent char* NomIterParent = GetIter0Name() ; @@ -540,10 +540,10 @@ HOMARD::HOMARD_Iteration_ptr HOMARD_Cas_i::NextIteration( const char* IterName ) return _gen_i->CreateIteration(IterName, NomIterParent) ; } //============================================================================= -HOMARD::HOMARD_Iteration_ptr HOMARD_Cas_i::LastIteration( ) +ADAPT::HOMARD_Iteration_ptr HOMARD_Cas_i::LastIteration( ) { - HOMARD::HOMARD_Iteration_ptr Iter ; - HOMARD::listeIterFilles_var ListeIterFilles ; + ADAPT::HOMARD_Iteration_ptr Iter ; + ADAPT::listeIterFilles_var ListeIterFilles ; char* IterName ; // Iteration initiale du cas IterName = GetIter0Name() ; @@ -586,7 +586,7 @@ void HOMARD_Cas_i::AddIteration( const char* NomIteration ) // DirName : le repertoire de lancement des calculs du sch?ma // MeshFile : nom du fichier contenant le maillage pour le premier calcul //============================================================================= -HOMARD::HOMARD_YACS_ptr HOMARD_Cas_i::CreateYACSSchema( const char* YACSName, const char* ScriptFile, const char* DirName, const char* MeshFile ) +ADAPT::HOMARD_YACS_ptr HOMARD_Cas_i::CreateYACSSchema( const char* YACSName, const char* ScriptFile, const char* DirName, const char* MeshFile ) { // Nom du cas const char* CaseName = GetName() ; diff --git a/src/ADAPT_I/HOMARD_Cas_i.hxx b/src/ADAPT_I/HOMARD_Cas_i.hxx index 94d17f857..60027606a 100644 --- a/src/ADAPT_I/HOMARD_Cas_i.hxx +++ b/src/ADAPT_I/HOMARD_Cas_i.hxx @@ -31,7 +31,7 @@ #define _HOMARD_CAS_I_HXX_ #include -#include CORBA_SERVER_HEADER(HOMARD_Gen) +#include CORBA_SERVER_HEADER(ADAPT_Gen) #include CORBA_SERVER_HEADER(HOMARD_Cas) #include "HOMARD_i.hxx" @@ -45,11 +45,11 @@ class HOMARD_Cas; class HOMARDENGINE_EXPORT HOMARD_Cas_i: public virtual Engines_Component_i, - public virtual POA_HOMARD::HOMARD_Cas, + public virtual POA_ADAPT::HOMARD_Cas, public virtual PortableServer::ServantBase { public: - HOMARD_Cas_i( CORBA::ORB_ptr orb, HOMARD::HOMARD_Gen_var gen_i ); + HOMARD_Cas_i( CORBA::ORB_ptr orb, ADAPT::ADAPT_Gen_var gen_i ); HOMARD_Cas_i(); virtual ~HOMARD_Cas_i(); @@ -79,16 +79,16 @@ public: void SetExtType( CORBA::Long ExtType ); CORBA::Long GetExtType(); - void SetBoundingBox( const HOMARD::extrema& LesExtremes ); - HOMARD::extrema* GetBoundingBox(); + void SetBoundingBox( const ADAPT::extrema& LesExtremes ); + ADAPT::extrema* GetBoundingBox(); void AddGroup( const char* Group); - void SetGroups(const HOMARD::ListGroupType& ListGroup); - HOMARD::ListGroupType* GetGroups(); + void SetGroups(const ADAPT::ListGroupType& ListGroup); + ADAPT::ListGroupType* GetGroups(); void AddBoundary(const char* Boundary); void AddBoundaryGroup(const char* Boundary, const char* Group); - HOMARD::ListBoundaryGroupType* GetBoundaryGroup(); + ADAPT::ListBoundaryGroupType* GetBoundaryGroup(); void SupprBoundaryGroup( ); void SetPyram( CORBA::Long Pyram ); @@ -98,22 +98,22 @@ public: // Liens avec les autres structures char* GetIter0Name(); - HOMARD::HOMARD_Iteration_ptr GetIter0() ; + ADAPT::HOMARD_Iteration_ptr GetIter0() ; - HOMARD::HOMARD_Iteration_ptr NextIteration( const char* Name ) ; + ADAPT::HOMARD_Iteration_ptr NextIteration( const char* Name ) ; - HOMARD::HOMARD_Iteration_ptr LastIteration() ; + ADAPT::HOMARD_Iteration_ptr LastIteration() ; void AddIteration( const char* NomIteration ); // YACS - HOMARD::HOMARD_YACS_ptr CreateYACSSchema( const char* YACSName, const char* ScriptFile, const char* DirName, const char* MeshFile ); + ADAPT::HOMARD_YACS_ptr CreateYACSSchema( const char* YACSName, const char* ScriptFile, const char* DirName, const char* MeshFile ); private: ::HOMARD_Cas* myHomardCas; CORBA::ORB_ptr _orb; - HOMARD::HOMARD_Gen_var _gen_i; + ADAPT::ADAPT_Gen_var _gen_i; }; #endif diff --git a/src/ADAPT_I/HOMARD_Hypothesis_i.cxx b/src/ADAPT_I/HOMARD_Hypothesis_i.cxx index f9c5249f7..b039bc3a8 100644 --- a/src/ADAPT_I/HOMARD_Hypothesis_i.cxx +++ b/src/ADAPT_I/HOMARD_Hypothesis_i.cxx @@ -28,7 +28,7 @@ // #include "HOMARD_Hypothesis_i.hxx" -#include "HOMARD_Gen_i.hxx" +#include "ADAPT_Gen_i.hxx" #include "HOMARD_Hypothesis.hxx" #include "HOMARD_DriverTools.hxx" @@ -51,7 +51,7 @@ HOMARD_Hypothesis_i::HOMARD_Hypothesis_i() */ //============================================================================= HOMARD_Hypothesis_i::HOMARD_Hypothesis_i( CORBA::ORB_ptr orb, - HOMARD::HOMARD_Gen_var engine ) + ADAPT::ADAPT_Gen_var engine ) { MESSAGE( "standard constructor" ); _gen_i = engine; @@ -101,12 +101,12 @@ char* HOMARD_Hypothesis_i::GetDumpPython() //============================================================================= std::string HOMARD_Hypothesis_i::Dump() const { - return HOMARD::Dump( *myHomardHypothesis ); + return ADAPT::Dump( *myHomardHypothesis ); } //============================================================================= bool HOMARD_Hypothesis_i::Restore( const std::string& stream ) { - return HOMARD::Restore( *myHomardHypothesis, stream ); + return ADAPT::Restore( *myHomardHypothesis, stream ); } //============================================================================= //============================================================================= @@ -132,10 +132,10 @@ void HOMARD_Hypothesis_i::SetUnifRefinUnRef( CORBA::Long TypeRaffDera ) myHomardHypothesis->SetRefinTypeDera( TypeRaff, TypeDera ); } //============================================================================= -HOMARD::listeTypes* HOMARD_Hypothesis_i::GetAdapRefinUnRef() +ADAPT::listeTypes* HOMARD_Hypothesis_i::GetAdapRefinUnRef() { ASSERT( myHomardHypothesis ); - HOMARD::listeTypes_var aResult = new HOMARD::listeTypes; + ADAPT::listeTypes_var aResult = new ADAPT::listeTypes; aResult->length( 3 ); aResult[0] = CORBA::Long( myHomardHypothesis->GetAdapType() ); aResult[1] = CORBA::Long( myHomardHypothesis->GetRefinType() ); @@ -177,10 +177,10 @@ void HOMARD_Hypothesis_i::SetUseField( CORBA::Long UsField ) myHomardHypothesis->SetUseField( UsField ); } //============================================================================= -HOMARD::InfosHypo* HOMARD_Hypothesis_i::GetField() +ADAPT::InfosHypo* HOMARD_Hypothesis_i::GetField() { ASSERT( myHomardHypothesis ); - HOMARD::InfosHypo* aInfosHypo = new HOMARD::InfosHypo(); + ADAPT::InfosHypo* aInfosHypo = new ADAPT::InfosHypo(); aInfosHypo->FieldName = CORBA::string_dup( myHomardHypothesis->GetFieldName().c_str() ); aInfosHypo->TypeThR = CORBA::Long( myHomardHypothesis->GetRefinThrType() ); aInfosHypo->ThreshR = CORBA::Double( myHomardHypothesis->GetThreshR() ); @@ -214,11 +214,11 @@ void HOMARD_Hypothesis_i::SupprComps() myHomardHypothesis->SupprComps(); } //============================================================================= -HOMARD::listeComposantsHypo* HOMARD_Hypothesis_i::GetComps() +ADAPT::listeComposantsHypo* HOMARD_Hypothesis_i::GetComps() { ASSERT( myHomardHypothesis ); const std::list& ListString = myHomardHypothesis->GetComps(); - HOMARD::listeComposantsHypo_var aResult = new HOMARD::listeComposantsHypo; + ADAPT::listeComposantsHypo_var aResult = new ADAPT::listeComposantsHypo; aResult->length( ListString.size() ); std::list::const_iterator it; int i = 0; @@ -329,7 +329,7 @@ void HOMARD_Hypothesis_i::SupprGroups() myHomardHypothesis->SupprGroups(); } //============================================================================= -void HOMARD_Hypothesis_i::SetGroups(const HOMARD::ListGroupType& ListGroup) +void HOMARD_Hypothesis_i::SetGroups(const ADAPT::ListGroupType& ListGroup) { ASSERT( myHomardHypothesis ); std::list ListString; @@ -340,11 +340,11 @@ void HOMARD_Hypothesis_i::SetGroups(const HOMARD::ListGroupType& ListGroup) myHomardHypothesis->SetGroups( ListString ); } //============================================================================= -HOMARD::ListGroupType* HOMARD_Hypothesis_i::GetGroups() +ADAPT::ListGroupType* HOMARD_Hypothesis_i::GetGroups() { ASSERT( myHomardHypothesis ); const std::list& ListString = myHomardHypothesis->GetGroups(); - HOMARD::ListGroupType_var aResult = new HOMARD::ListGroupType; + ADAPT::ListGroupType_var aResult = new ADAPT::ListGroupType; aResult->length( ListString.size() ); std::list::const_iterator it; int i = 0; @@ -391,11 +391,11 @@ void HOMARD_Hypothesis_i::SupprFieldInterps() myHomardHypothesis->SupprFieldInterps(); } //============================================================================= -HOMARD::listeFieldInterpsHypo* HOMARD_Hypothesis_i::GetFieldInterps() +ADAPT::listeFieldInterpsHypo* HOMARD_Hypothesis_i::GetFieldInterps() { ASSERT( myHomardHypothesis ); const std::list& ListString = myHomardHypothesis->GetFieldInterps(); - HOMARD::listeFieldInterpsHypo_var aResult = new HOMARD::listeFieldInterpsHypo; + ADAPT::listeFieldInterpsHypo_var aResult = new ADAPT::listeFieldInterpsHypo; aResult->length( ListString.size() ); std::list::const_iterator it; int i = 0; @@ -434,11 +434,11 @@ void HOMARD_Hypothesis_i::UnLinkIteration( const char* NomIteration ) myHomardHypothesis->UnLinkIteration( NomIteration ); } //============================================================================= -HOMARD::listeIters* HOMARD_Hypothesis_i::GetIterations() +ADAPT::listeIters* HOMARD_Hypothesis_i::GetIterations() { ASSERT( myHomardHypothesis ); const std::list& ListString = myHomardHypothesis->GetIterations(); - HOMARD::listeIters_var aResult = new HOMARD::listeIters; + ADAPT::listeIters_var aResult = new ADAPT::listeIters; aResult->length( ListString.size() ); std::list::const_iterator it; int i = 0; @@ -490,11 +490,11 @@ void HOMARD_Hypothesis_i::SupprZones() myHomardHypothesis->SupprZones(); } //============================================================================= -HOMARD::listeZonesHypo* HOMARD_Hypothesis_i::GetZones() +ADAPT::listeZonesHypo* HOMARD_Hypothesis_i::GetZones() { ASSERT( myHomardHypothesis ); const std::list& ListString = myHomardHypothesis->GetZones(); - HOMARD::listeZonesHypo_var aResult = new HOMARD::listeZonesHypo; + ADAPT::listeZonesHypo_var aResult = new ADAPT::listeZonesHypo; aResult->length( ListString.size() ); std::list::const_iterator it; int i = 0; diff --git a/src/ADAPT_I/HOMARD_Hypothesis_i.hxx b/src/ADAPT_I/HOMARD_Hypothesis_i.hxx index 79c4e6b24..d5dc6f98e 100644 --- a/src/ADAPT_I/HOMARD_Hypothesis_i.hxx +++ b/src/ADAPT_I/HOMARD_Hypothesis_i.hxx @@ -31,7 +31,7 @@ #define _HOMARD_HYPOTHESIS_I_HXX_ #include -#include CORBA_SERVER_HEADER(HOMARD_Gen) +#include CORBA_SERVER_HEADER(ADAPT_Gen) #include CORBA_SERVER_HEADER(HOMARD_Hypothesis) #include "HOMARD_i.hxx" @@ -45,11 +45,11 @@ class HOMARD_Hypothesis; class HOMARDENGINE_EXPORT HOMARD_Hypothesis_i: public virtual Engines_Component_i, - public virtual POA_HOMARD::HOMARD_Hypothesis, + public virtual POA_ADAPT::HOMARD_Hypothesis, public virtual PortableServer::ServantBase { public: - HOMARD_Hypothesis_i( CORBA::ORB_ptr orb, HOMARD::HOMARD_Gen_var gen_i ); + HOMARD_Hypothesis_i( CORBA::ORB_ptr orb, ADAPT::ADAPT_Gen_var gen_i ); HOMARD_Hypothesis_i(); virtual ~HOMARD_Hypothesis_i(); @@ -67,7 +67,7 @@ public: // Caracteristiques void SetUnifRefinUnRef( CORBA::Long TypeRaffDera ); - HOMARD::listeTypes* GetAdapRefinUnRef(); + ADAPT::listeTypes* GetAdapRefinUnRef(); CORBA::Long GetAdapType(); CORBA::Long GetRefinType(); CORBA::Long GetUnRefType(); @@ -75,13 +75,13 @@ public: void SetField( const char* FieldName ); char* GetFieldName(); void SetUseField(CORBA::Long UsField); - HOMARD::InfosHypo* GetField(); + ADAPT::InfosHypo* GetField(); void SetUseComp(CORBA::Long UsCmpI); void AddComp( const char* NomComp ); void SupprComp( const char* NomComp ); void SupprComps(); - HOMARD::listeComposantsHypo* GetComps(); + ADAPT::listeComposantsHypo* GetComps(); void SetRefinThr(CORBA::Long TypeThR, CORBA::Double ThreshR); CORBA::Long GetRefinThrType(); @@ -103,8 +103,8 @@ public: void AddGroup( const char* Group); void SupprGroup( const char* Group ); void SupprGroups(); - void SetGroups(const HOMARD::ListGroupType& ListGroup); - HOMARD::ListGroupType* GetGroups(); + void SetGroups(const ADAPT::ListGroupType& ListGroup); + ADAPT::ListGroupType* GetGroups(); void SetTypeFieldInterp( CORBA::Long TypeFieldInterp ); CORBA::Long GetTypeFieldInterp(); @@ -112,7 +112,7 @@ public: void AddFieldInterpType( const char* FieldInterp, CORBA::Long TypeInterp ); void SupprFieldInterp( const char* FieldInterp ); void SupprFieldInterps(); - HOMARD::listeFieldInterpsHypo* GetFieldInterps(); + ADAPT::listeFieldInterpsHypo* GetFieldInterps(); // Liens avec les autres structures void SetCaseCreation( const char* NomCaseCreation ); @@ -120,19 +120,19 @@ public: void LinkIteration( const char* NomIteration ); void UnLinkIteration( const char* NomIteration ); - HOMARD::listeIters* GetIterations(); + ADAPT::listeIters* GetIterations(); void AddZone( const char* NomZone, CORBA::Long TypeUse ); void AddZone0( const char* NomZone, CORBA::Long TypeUse ); void SupprZone( const char* NomZone ); void SupprZones(); - HOMARD::listeZonesHypo* GetZones(); + ADAPT::listeZonesHypo* GetZones(); private: ::HOMARD_Hypothesis* myHomardHypothesis; CORBA::ORB_ptr _orb; - HOMARD::HOMARD_Gen_var _gen_i; + ADAPT::ADAPT_Gen_var _gen_i; }; #endif diff --git a/src/ADAPT_I/HOMARD_Iteration_i.cxx b/src/ADAPT_I/HOMARD_Iteration_i.cxx index 640c13062..5990a6b71 100644 --- a/src/ADAPT_I/HOMARD_Iteration_i.cxx +++ b/src/ADAPT_I/HOMARD_Iteration_i.cxx @@ -28,7 +28,7 @@ // #include "HOMARD_Iteration_i.hxx" -#include "HOMARD_Gen_i.hxx" +#include "ADAPT_Gen_i.hxx" #include "HOMARD_Iteration.hxx" #include "HOMARD_DriverTools.hxx" @@ -52,7 +52,7 @@ HOMARD_Iteration_i::HOMARD_Iteration_i() */ //============================================================================= HOMARD_Iteration_i::HOMARD_Iteration_i( CORBA::ORB_ptr orb, - HOMARD::HOMARD_Gen_var engine ) + ADAPT::ADAPT_Gen_var engine ) { MESSAGE("constructor"); _gen_i = engine; @@ -101,12 +101,12 @@ char* HOMARD_Iteration_i::GetDumpPython() //============================================================================= std::string HOMARD_Iteration_i::Dump() const { - return HOMARD::Dump( *myHomardIteration ); + return ADAPT::Dump( *myHomardIteration ); } //============================================================================= bool HOMARD_Iteration_i::Restore( const std::string& stream ) { - return HOMARD::Restore( *myHomardIteration, stream ); + return ADAPT::Restore( *myHomardIteration, stream ); } //============================================================================= //============================================================================= @@ -129,7 +129,7 @@ char* HOMARD_Iteration_i::GetDirName() { ASSERT( myHomardIteration ); std::string casename = myHomardIteration->GetCaseName() ; - HOMARD::HOMARD_Cas_ptr caseiter = _gen_i->GetCase(casename.c_str()) ; + ADAPT::HOMARD_Cas_ptr caseiter = _gen_i->GetCase(casename.c_str()) ; std::string dirnamecase = caseiter->GetDirName() ; std::string dirname = dirnamecase + "/" + GetDirNameLoc() ; return CORBA::string_dup( dirname.c_str() ); @@ -240,11 +240,11 @@ void HOMARD_Iteration_i::SetFieldInterpTimeStepRank( const char* FieldInterp, CO myHomardIteration->SetFieldInterpTimeStepRank( FieldInterp, TimeStep, Rank ); } //============================================================================= -HOMARD::listeFieldInterpTSRsIter* HOMARD_Iteration_i::GetFieldInterpsTimeStepRank() +ADAPT::listeFieldInterpTSRsIter* HOMARD_Iteration_i::GetFieldInterpsTimeStepRank() { ASSERT( myHomardIteration ); const std::list& ListString = myHomardIteration->GetFieldInterpsTimeStepRank(); - HOMARD::listeFieldInterpTSRsIter_var aResult = new HOMARD::listeFieldInterpTSRsIter; + ADAPT::listeFieldInterpTSRsIter_var aResult = new ADAPT::listeFieldInterpTSRsIter; aResult->length( ListString.size() ); std::list::const_iterator it; int i = 0; @@ -260,11 +260,11 @@ void HOMARD_Iteration_i::SetFieldInterp( const char* FieldInterp ) myHomardIteration->SetFieldInterp( FieldInterp ); } //============================================================================= -HOMARD::listeFieldInterpsIter* HOMARD_Iteration_i::GetFieldInterps() +ADAPT::listeFieldInterpsIter* HOMARD_Iteration_i::GetFieldInterps() { ASSERT( myHomardIteration ); const std::list& ListString = myHomardIteration->GetFieldInterps(); - HOMARD::listeFieldInterpsIter_var aResult = new HOMARD::listeFieldInterpsIter; + ADAPT::listeFieldInterpsIter_var aResult = new ADAPT::listeFieldInterpsIter; aResult->length( ListString.size() ); std::list::const_iterator it; int i = 0; @@ -355,7 +355,7 @@ char* HOMARD_Iteration_i::GetFileInfo() // Liens avec les autres iterations //============================================================================= //============================================================================= -HOMARD::HOMARD_Iteration_ptr HOMARD_Iteration_i::NextIteration( const char* IterName ) +ADAPT::HOMARD_Iteration_ptr HOMARD_Iteration_i::NextIteration( const char* IterName ) { // Nom de l'iteration parent char* NomIterParent = GetName() ; @@ -375,11 +375,11 @@ void HOMARD_Iteration_i::UnLinkNextIteration( const char* NomIteration ) myHomardIteration->UnLinkNextIteration( NomIteration ); } //============================================================================= -HOMARD::listeIterFilles* HOMARD_Iteration_i::GetIterations() +ADAPT::listeIterFilles* HOMARD_Iteration_i::GetIterations() { ASSERT( myHomardIteration ); const std::list& maListe = myHomardIteration->GetIterations(); - HOMARD::listeIterFilles_var aResult = new HOMARD::listeIterFilles; + ADAPT::listeIterFilles_var aResult = new ADAPT::listeIterFilles; aResult->length( maListe.size() ); std::list::const_iterator it; int i = 0; @@ -402,7 +402,7 @@ char* HOMARD_Iteration_i::GetIterParentName() return CORBA::string_dup( myHomardIteration->GetIterParentName().c_str() ); } //============================================================================= -HOMARD::HOMARD_Iteration_ptr HOMARD_Iteration_i::GetIterParent() +ADAPT::HOMARD_Iteration_ptr HOMARD_Iteration_i::GetIterParent() { // Nom de l'iteration parent char* NomIterParent = GetIterParentName() ; diff --git a/src/ADAPT_I/HOMARD_Iteration_i.hxx b/src/ADAPT_I/HOMARD_Iteration_i.hxx index 1cc30b67e..87d353e77 100644 --- a/src/ADAPT_I/HOMARD_Iteration_i.hxx +++ b/src/ADAPT_I/HOMARD_Iteration_i.hxx @@ -31,7 +31,7 @@ #define _HOMARD_ITERATION_I_HXX_ #include -#include CORBA_SERVER_HEADER(HOMARD_Gen) +#include CORBA_SERVER_HEADER(ADAPT_Gen) #include CORBA_SERVER_HEADER(HOMARD_Iteration) #include "HOMARD_i.hxx" @@ -45,12 +45,12 @@ class HOMARD_Iteration; class HOMARDENGINE_EXPORT HOMARD_Iteration_i: public virtual Engines_Component_i, - public virtual POA_HOMARD::HOMARD_Iteration, + public virtual POA_ADAPT::HOMARD_Iteration, public virtual PortableServer::ServantBase { public: HOMARD_Iteration_i( CORBA::ORB_ptr orb, - HOMARD::HOMARD_Gen_var gen_i ); + ADAPT::ADAPT_Gen_var gen_i ); HOMARD_Iteration_i(); virtual ~HOMARD_Iteration_i(); @@ -95,9 +95,9 @@ public: // Instants pour un champ a interpoler void SetFieldInterpTimeStep( const char* FieldInterp, CORBA::Long TimeStep ); void SetFieldInterpTimeStepRank( const char* FieldInterp, CORBA::Long TimeStep, CORBA::Long Rank ); - HOMARD::listeFieldInterpTSRsIter* GetFieldInterpsTimeStepRank(); + ADAPT::listeFieldInterpTSRsIter* GetFieldInterpsTimeStepRank(); void SetFieldInterp( const char* FieldInterp ); - HOMARD::listeFieldInterpsIter* GetFieldInterps(); + ADAPT::listeFieldInterpsIter* GetFieldInterps(); void SupprFieldInterps(); void SetLogFile( const char* LogFile ); @@ -113,15 +113,15 @@ public: char* GetFileInfo(); // Liens avec les autres iterations - HOMARD::HOMARD_Iteration_ptr NextIteration( const char* Name) ; + ADAPT::HOMARD_Iteration_ptr NextIteration( const char* Name) ; void LinkNextIteration( const char* NomIteration ); void UnLinkNextIteration( const char* NomIteration ); - HOMARD::listeIterFilles* GetIterations(); + ADAPT::listeIterFilles* GetIterations(); void SetIterParentName( const char* NomIterParent ); char* GetIterParentName(); - HOMARD::HOMARD_Iteration_ptr GetIterParent() ; + ADAPT::HOMARD_Iteration_ptr GetIterParent() ; // Liens avec les autres structures void SetCaseName( const char* NomCas ); @@ -139,7 +139,7 @@ private: ::HOMARD_Iteration* myHomardIteration; CORBA::ORB_ptr _orb; - HOMARD::HOMARD_Gen_var _gen_i; + ADAPT::ADAPT_Gen_var _gen_i; }; #endif diff --git a/src/ADAPT_I/HOMARD_YACS_i.cxx b/src/ADAPT_I/HOMARD_YACS_i.cxx index 749d60d71..ae6977b23 100644 --- a/src/ADAPT_I/HOMARD_YACS_i.cxx +++ b/src/ADAPT_I/HOMARD_YACS_i.cxx @@ -28,7 +28,7 @@ // #include "HOMARD_YACS_i.hxx" -#include "HOMARD_Gen_i.hxx" +#include "ADAPT_Gen_i.hxx" #include "HOMARD_YACS.hxx" #include "HOMARD_DriverTools.hxx" @@ -52,7 +52,7 @@ HOMARD_YACS_i::HOMARD_YACS_i() */ //============================================================================= HOMARD_YACS_i::HOMARD_YACS_i( CORBA::ORB_ptr orb, - HOMARD::HOMARD_Gen_var engine ) + ADAPT::ADAPT_Gen_var engine ) { MESSAGE("constructor"); _gen_i = engine; @@ -101,12 +101,12 @@ char* HOMARD_YACS_i::GetDumpPython() //============================================================================= std::string HOMARD_YACS_i::Dump() const { - return HOMARD::Dump( *myHomardYACS ); + return ADAPT::Dump( *myHomardYACS ); } //============================================================================= bool HOMARD_YACS_i::Restore( const std::string& stream ) { - return HOMARD::Restore( *myHomardYACS, stream ); + return ADAPT::Restore( *myHomardYACS, stream ); } //============================================================================= //============================================================================= diff --git a/src/ADAPT_I/HOMARD_YACS_i.hxx b/src/ADAPT_I/HOMARD_YACS_i.hxx index 806602423..45c17851d 100644 --- a/src/ADAPT_I/HOMARD_YACS_i.hxx +++ b/src/ADAPT_I/HOMARD_YACS_i.hxx @@ -31,7 +31,7 @@ #define _HOMARD_YACS_I_HXX_ #include -#include CORBA_SERVER_HEADER(HOMARD_Gen) +#include CORBA_SERVER_HEADER(ADAPT_Gen) #include CORBA_SERVER_HEADER(HOMARD_YACS) #include "HOMARD_i.hxx" @@ -45,12 +45,12 @@ class HOMARD_YACS; class HOMARDENGINE_EXPORT HOMARD_YACS_i: public virtual Engines_Component_i, - public virtual POA_HOMARD::HOMARD_YACS, + public virtual POA_ADAPT::HOMARD_YACS, public virtual PortableServer::ServantBase { public: HOMARD_YACS_i( CORBA::ORB_ptr orb, - HOMARD::HOMARD_Gen_var gen_i ); + ADAPT::ADAPT_Gen_var gen_i ); HOMARD_YACS_i(); virtual ~HOMARD_YACS_i(); @@ -106,7 +106,7 @@ private: ::HOMARD_YACS* myHomardYACS; CORBA::ORB_ptr _orb; - HOMARD::HOMARD_Gen_var _gen_i; + ADAPT::ADAPT_Gen_var _gen_i; }; #endif diff --git a/src/ADAPT_I/HOMARD_Zone_i.cxx b/src/ADAPT_I/HOMARD_Zone_i.cxx index 4a16ee5dd..b8ee19062 100644 --- a/src/ADAPT_I/HOMARD_Zone_i.cxx +++ b/src/ADAPT_I/HOMARD_Zone_i.cxx @@ -28,7 +28,7 @@ // #include "HOMARD_Zone_i.hxx" -#include "HOMARD_Gen_i.hxx" +#include "ADAPT_Gen_i.hxx" #include "HOMARD_Zone.hxx" #include "HOMARD_DriverTools.hxx" @@ -51,7 +51,7 @@ HOMARD_Zone_i::HOMARD_Zone_i() */ //============================================================================= HOMARD_Zone_i::HOMARD_Zone_i( CORBA::ORB_ptr orb, - HOMARD::HOMARD_Gen_var engine ) + ADAPT::ADAPT_Gen_var engine ) { MESSAGE( "HOMARD_Zone_i" ); _gen_i = engine; @@ -101,12 +101,12 @@ char* HOMARD_Zone_i::GetDumpPython() //============================================================================= std::string HOMARD_Zone_i::Dump() const { - return HOMARD::Dump( *myHomardZone ); + return ADAPT::Dump( *myHomardZone ); } //============================================================================= bool HOMARD_Zone_i::Restore( const std::string& stream ) { - return HOMARD::Restore( *myHomardZone, stream ); + return ADAPT::Restore( *myHomardZone, stream ); } //============================================================================= //============================================================================= @@ -153,10 +153,10 @@ void HOMARD_Zone_i::SetSphere( double Xcentre, double Ycentre, double Zcentre, d myHomardZone->SetSphere( Xcentre, Ycentre, Zcentre, Rayon ); } //============================================================================= -HOMARD::double_array* HOMARD_Zone_i::GetCoords() +ADAPT::double_array* HOMARD_Zone_i::GetCoords() { ASSERT( myHomardZone ); - HOMARD::double_array_var aResult = new HOMARD::double_array(); + ADAPT::double_array_var aResult = new ADAPT::double_array(); std::vector mesCoor = myHomardZone->GetCoords(); aResult->length( mesCoor .size() ); std::vector::const_iterator it; @@ -173,10 +173,10 @@ void HOMARD_Zone_i::SetLimit( double Xincr, double Yincr, double Zincr ) myHomardZone->SetLimit( Xincr, Yincr, Zincr ); } //============================================================================= -HOMARD::double_array* HOMARD_Zone_i::GetLimit() +ADAPT::double_array* HOMARD_Zone_i::GetLimit() { ASSERT( myHomardZone ); - HOMARD::double_array_var aResult = new HOMARD::double_array(); + ADAPT::double_array_var aResult = new ADAPT::double_array(); std::vector mesCoor = myHomardZone->GetLimit(); aResult->length( mesCoor .size() ); std::vector::const_iterator it; @@ -197,11 +197,11 @@ void HOMARD_Zone_i::AddHypo( const char* NomHypo ) myHomardZone->AddHypo( NomHypo ); } //============================================================================= -HOMARD::listeHypo* HOMARD_Zone_i::GetHypo() +ADAPT::listeHypo* HOMARD_Zone_i::GetHypo() { ASSERT( myHomardZone ); const std::list& maListe = myHomardZone->GetHypo(); - HOMARD::listeHypo_var aResult = new HOMARD::listeHypo; + ADAPT::listeHypo_var aResult = new ADAPT::listeHypo; aResult->length( maListe.size() ); std:: list::const_iterator it; int i = 0; diff --git a/src/ADAPT_I/HOMARD_Zone_i.hxx b/src/ADAPT_I/HOMARD_Zone_i.hxx index 84c2d5c00..ee4e29e7c 100644 --- a/src/ADAPT_I/HOMARD_Zone_i.hxx +++ b/src/ADAPT_I/HOMARD_Zone_i.hxx @@ -31,7 +31,7 @@ #define _HOMARD_Zone_I_HXX_ #include -#include CORBA_SERVER_HEADER(HOMARD_Gen) +#include CORBA_SERVER_HEADER(ADAPT_Gen) #include CORBA_SERVER_HEADER(HOMARD_Zone) #include "HOMARD_i.hxx" @@ -45,11 +45,11 @@ class HOMARD_Zone; class HOMARDENGINE_EXPORT HOMARD_Zone_i: public virtual Engines_Component_i, - public virtual POA_HOMARD::HOMARD_Zone, + public virtual POA_ADAPT::HOMARD_Zone, public virtual PortableServer::ServantBase { public: - HOMARD_Zone_i( CORBA::ORB_ptr orb, HOMARD::HOMARD_Gen_var gen_i ); + HOMARD_Zone_i( CORBA::ORB_ptr orb, ADAPT::ADAPT_Gen_var gen_i ); HOMARD_Zone_i(); virtual ~HOMARD_Zone_i(); @@ -84,21 +84,21 @@ public: void SetSphere( double Xcentre, double Ycentre, double ZCentre, double Rayon ); - HOMARD::double_array* GetCoords(); + ADAPT::double_array* GetCoords(); void SetLimit( double Xincr, double Yincr, double Zincr); - HOMARD::double_array* GetLimit(); + ADAPT::double_array* GetLimit(); // Liens avec les autres structures void AddHypo( const char *NomHypo ); - HOMARD::listeHypo* GetHypo(); + ADAPT::listeHypo* GetHypo(); void SupprHypo( const char *NomHypo ); private: ::HOMARD_Zone* myHomardZone; CORBA::ORB_ptr _orb; - HOMARD::HOMARD_Gen_var _gen_i; + ADAPT::ADAPT_Gen_var _gen_i; }; #endif From 0937b58dc20a4c912951ca72315009723949ffe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Wed, 27 May 2020 10:36:49 +0200 Subject: [PATCH 022/100] Merge branch 'master' into gni/adaptation --- resources/CMakeLists.txt | 3 + resources/mesh_auto_colors.png | Bin 0 -> 652 bytes resources/mesh_compute_error.png | Bin 0 -> 724 bytes resources/mesh_export.png | Bin 0 -> 196 bytes src/SMESHGUI/SMESHGUI.cxx | 149 ++++++++++++++++----------- src/SMESHGUI/SMESHGUI_ComputeDlg.cxx | 97 +++++++++++++---- src/SMESHGUI/SMESHGUI_ComputeDlg.h | 16 +++ src/SMESHGUI/SMESHGUI_MeshOp.cxx | 5 + src/SMESHGUI/SMESHGUI_Operations.h | 2 + src/SMESHGUI/SMESHGUI_Selection.cxx | 64 ++++++++++-- src/SMESHGUI/SMESHGUI_Selection.h | 2 + src/SMESHGUI/SMESH_images.ts | 16 +++ src/SMESHGUI/SMESH_msg_en.ts | 8 ++ src/SMESH_I/SMESH_Mesh_i.cxx | 42 ++++---- 14 files changed, 292 insertions(+), 112 deletions(-) create mode 100644 resources/mesh_auto_colors.png create mode 100644 resources/mesh_compute_error.png create mode 100644 resources/mesh_export.png diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index bb493d7bb..cb71c43be 100644 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -49,6 +49,7 @@ SET(SMESH_RESOURCES_FILES mesh_area.png mesh_aspect.png mesh_aspect_3d.png + mesh_auto_colors.png mesh_ball.png mesh_biquad_quadrangle.png mesh_biquad_triangle.png @@ -58,6 +59,7 @@ SET(SMESH_RESOURCES_FILES mesh_choose_all.png mesh_clear.png mesh_compute.png + mesh_compute_error.png mesh_conv_to_quad.png mesh_cutGroups.png mesh_cutquad.png @@ -76,6 +78,7 @@ SET(SMESH_RESOURCES_FILES mesh_equal_node.png mesh_equal_volume.png mesh_evaluate.png + mesh_export.png mesh_extmeth_face_offset.png mesh_extmeth_node_offset.png mesh_extmeth_surf_offset_smooth.png diff --git a/resources/mesh_auto_colors.png b/resources/mesh_auto_colors.png new file mode 100644 index 0000000000000000000000000000000000000000..7c4dc29c7a82236d0727989d77c6502d482747bc GIT binary patch literal 652 zcmV;70(1R|P)+@2%^*T> zWbAa@*Sd0!dhzO6QPOaqj;D_@M@^4HxLY~arQjTRDVWV3d%hzUPeGxNf@2jD-$u`e zea7U58jX)L!6uZ+r0$yB9w0}&D6pWDj?~3t5W9gXfmX1p3#ZOf=N-!&NhB^+MPn2vToHp~Xd{xB zXjLX^nOUisWrjLB4z?g#SeOI-ENu2`ayVsaPSGYZUkzxABZo|_g<~hIh}1;-=rGw5 mjAQF7{)-h!T~dVxCx+ipF(s5UoPtXL0000cOXqAi^Sg>mdjvEdNJDrIjDl6JAo3;OcfB#yWP2fKlv0QPcbI)-e z8Ro*~zRUj%n7vVR(QMm%MidfYoRgP|TL#bmHNexpYoorX^tr`m0$3XKt2lh`>9Ud& z4`2Kd;O(l@5R}Pjty*79dqW^d1FXh*xJDu_f#WxnwDhNz2VAdeu-fbH%`dvqF;I>~ zibd-|1{T(f$;aNtO|65D-vWF+wMH^)RWz%zP|=4^1>knS!_(fiik=#tMKUg!N{=~W zzXbTZYC83m2by#%{ED{OM-hoeF+WhC=;#80i4o7u?dQgue*y%$Yu9KCwtOJ-NvL_J za+YWJK;Q*1y%9xosSLaxVKDPHSkQ0>AAbaN?i@F4vsH1CXD}LgG1R(+Q$(tr;IVYH~y_6ljGLwZ6fdT~L3S)YL^X8;q< zK;xmFq(cD&udSwa_4{%~-%E(18X9$aV%Mz+8KA<^y(`lWVjPI12)$Z`{=V7B{`OcV z5xk&2sovXkRb~1NX(V`BpD#x&62@5DB#h>KBqDM&R)mfO=(!mBhw0Nq zw7Z-ocT`X!{YIWa$__XfjdJcO7qXA60}^or9bQm4v}ZpFo7JWHrN@(=KHi5|UgH zdHLmeNshrH?3e$Gq=LpkAQqz_aB@xVkt7K|CZY4t$(ApME-q$n32K7?0000<>&pIwRg_t^fc4 literal 0 HcmV?d00001 diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 13eff94c0..047373492 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -2871,8 +2871,24 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) case SMESHOp::OpComputeSubMesh: case SMESHOp::OpPreCompute: case SMESHOp::OpEvaluate: + case SMESHOp::OpShowErrors: startOperation( theCommandID ); break; + case SMESHOp::OpRecompute: + { + if ( isStudyLocked() ) + break; + SALOME_ListIO selected; + if ( LightApp_SelectionMgr *sel = selectionMgr() ) + sel->selectedObjects( selected ); + if ( selected.Extent() == 1 ) { + SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO( selected.First() ); + if ( !aMesh->_is_nil() ) + aMesh->Clear(); + startOperation( SMESHOp::OpCompute ); + } + } + break; case SMESHOp::OpCopyMesh: { if (isStudyLocked()) break; @@ -4017,7 +4033,7 @@ void SMESHGUI::createSMESHAction( const int id, const QString& po_id, const QStr if ( !icon_id.isEmpty() ) pix = resMgr->loadPixmap( "SMESH", tr( icon_id.toLatin1().data() ) ); else - pix = resMgr->loadPixmap( "SMESH", tr( QString( "ICO_%1" ).arg( po_id ).toLatin1().data() ), false ); + pix = resMgr->loadPixmap( "SMESH", tr( QString( "ICON_%1" ).arg( po_id ).toLatin1().data() ), false ); if ( !pix.isNull() ) icon = QIcon( pix ); @@ -4124,7 +4140,9 @@ void SMESHGUI::initialize( CAM_Application* app ) createSMESHAction( SMESHOp::OpCopyMesh, "COPY_MESH", "ICON_COPY_MESH" ); createSMESHAction( SMESHOp::OpCompute, "COMPUTE", "ICON_COMPUTE" ); createSMESHAction( SMESHOp::OpComputeSubMesh, "COMPUTE_SUBMESH", "ICON_COMPUTE" ); + createSMESHAction( SMESHOp::OpRecompute, "RE_COMPUTE", "ICON_COMPUTE" ); createSMESHAction( SMESHOp::OpPreCompute, "PRECOMPUTE", "ICON_PRECOMPUTE" ); + createSMESHAction( SMESHOp::OpShowErrors, "SHOW_ERRORS", "ICON_SHOW_ERRORS" ); createSMESHAction( SMESHOp::OpEvaluate, "EVALUATE", "ICON_EVALUATE" ); createSMESHAction( SMESHOp::OpMeshOrder, "MESH_ORDER", "ICON_MESH_ORDER"); createSMESHAction( SMESHOp::OpCreateGroup, "CREATE_GROUP", "ICON_CREATE_GROUP" ); @@ -4708,20 +4726,22 @@ void SMESHGUI::initialize( CAM_Application* app ) hasVolumes("({'Volume'} in elemTypes)"), hasFacesOrVolumes("(({'Face'} in elemTypes) || ({'Volume'} in elemTypes)) "); - createPopupItem( SMESHOp::OpFileInformation, OB, mesh, "&& selcount=1 && isImported" ); - createPopupItem( SMESHOp::OpCreateSubMesh, OB, mesh, "&& hasGeomReference"); createPopupItem( SMESHOp::OpEditMesh, OB, mesh, "&& selcount=1" ); + createPopupItem( SMESHOp::OpCreateSubMesh, OB, mesh, "&& hasGeomReference"); + createPopupItem( SMESHOp::OpMeshOrder, OB, mesh, "&& selcount=1 && hasAlgo && hasGeomReference" ); createPopupItem( SMESHOp::OpEditSubMesh, OB, subMesh, "&& selcount=1 && hasGeomReference" ); createPopupItem( SMESHOp::OpEditGroup, OB, group ); createPopupItem( SMESHOp::OpEditGeomGroupAsGroup, OB, group, "&& groupType != 'Group'" ); popupMgr()->insert( separator(), -1, 0 ); - createPopupItem( SMESHOp::OpCompute, OB, mesh, "&& selcount=1 && isComputable" ); - createPopupItem( SMESHOp::OpComputeSubMesh, OB, subMesh, "&& selcount=1 && isComputable" ); - createPopupItem( SMESHOp::OpPreCompute, OB, mesh, "&& selcount=1 && isPreComputable" ); - createPopupItem( SMESHOp::OpEvaluate, OB, mesh, "&& selcount=1 && isComputable" ); - createPopupItem( SMESHOp::OpMeshOrder, OB, mesh, "&& selcount=1 && isComputable && hasGeomReference" ); - createPopupItem( SMESHOp::OpUpdate, OB, mesh_part ); + createPopupItem( SMESHOp::OpCompute, OB, mesh, "&& selcount=1 && hasAlgo && isComputable" ); + createPopupItem( SMESHOp::OpRecompute, OB, mesh, "&& selcount=1 && hasAlgo && " + isNotEmpty ); + createPopupItem( SMESHOp::OpShowErrors, OB, mesh, "&& selcount=1 && hasErrors" ); + createPopupItem( SMESHOp::OpComputeSubMesh, OB, subMesh, "&& selcount=1 && hasAlgo && isComputable" ); + createPopupItem( SMESHOp::OpPreCompute, OB, mesh, "&& selcount=1 && hasAlgo && isPreComputable" ); + createPopupItem( SMESHOp::OpEvaluate, OB, mesh, "&& selcount=1 && hasAlgo && isComputable" ); + popupMgr()->insert( separator(), -1, 0 ); + createPopupItem( SMESHOp::OpFileInformation, OB, mesh, "&& selcount=1 && isImported" ); createPopupItem( SMESHOp::OpMeshInformation, OB, mesh_part ); createPopupItem( SMESHOp::OpFindElementByPoint,OB, mesh_group, "&& selcount=1" ); createPopupItem( SMESHOp::OpOverallMeshQuality,OB, mesh_part ); @@ -4735,8 +4755,8 @@ void SMESHGUI::initialize( CAM_Application* app ) popupMgr()->insert( separator(), -1, 0 ); createPopupItem( SMESHOp::OpConvertMeshToQuadratic, OB, mesh_submesh ); createPopupItem( SMESHOp::OpCreateBoundaryElements, OB, mesh_group, "&& selcount=1 && dim>=2"); - popupMgr()->insert( separator(), -1, 0 ); - createPopupItem( SMESHOp::OpClearMesh, OB, mesh ); + //popupMgr()->insert( separator(), -1, 0 ); + //popupMgr()->insert( separator(), -1, 0 ); // createPopupItem( SMESHOp::OpUniformRefinement, OB, mesh ); // createPopupItem( SMESHOp::OpHOMARDRefinement, OB, mesh ); @@ -4747,6 +4767,7 @@ void SMESHGUI::initialize( CAM_Application* app ) QString only_one_2D = only_one_non_empty + " && dim>1"; int anId = popupMgr()->insert( tr( "MEN_EXPORT" ), -1, -1 ); // EXPORT submenu + popupMgr()->findMenu( anId )->menuAction()->setIcon( resourceMgr()->loadPixmap( "SMESH", tr( "ICON_EXPORT" ))); createPopupItem( SMESHOp::OpPopupExportMED, OB, mesh_group, multiple_non_empty, anId ); createPopupItem( SMESHOp::OpPopupExportUNV, OB, mesh_group, only_one_non_empty, anId ); createPopupItem( SMESHOp::OpPopupExportSTL, OB, mesh_group, only_one_2D, anId ); @@ -4756,8 +4777,6 @@ void SMESHGUI::initialize( CAM_Application* app ) createPopupItem( SMESHOp::OpPopupExportSAUV, OB, mesh_group, only_one_non_empty, anId ); createPopupItem( SMESHOp::OpPopupExportGMF, OB, mesh_group, only_one_non_empty, anId ); createPopupItem( SMESHOp::OpPopupExportDAT, OB, mesh_group, only_one_non_empty, anId ); - createPopupItem( SMESHOp::OpDelete, OB, mesh_part + " " + hyp_alg ); - createPopupItem( SMESHOp::OpDeleteGroup, OB, group ); anId = popupMgr()->insert( tr( "MEN_IMPORT" ), -1, -1 ); // IMPORT submenu createPopupItem( SMESHOp::OpPopupImportMED, OB, smesh, "", anId ); @@ -4771,18 +4790,22 @@ void SMESHGUI::initialize( CAM_Application* app ) createPopupItem( SMESHOp::OpPopupImportDAT, OB, smesh, "", anId ); popupMgr()->insert( separator(), -1, 0 ); + createPopupItem( SMESHOp::OpClearMesh, OB, mesh ); + createPopupItem( SMESHOp::OpDelete, OB, mesh_part + " " + hyp_alg ); + createPopupItem( SMESHOp::OpDeleteGroup, OB, group ); + // popup for viewer createPopupItem( SMESHOp::OpEditGroup, View, group ); createPopupItem( SMESHOp::OpAddElemGroupPopup, View, elems, "&& guiState = 800" ); createPopupItem( SMESHOp::OpRemoveElemGroupPopup, View, elems, "&& guiState = 800" ); popupMgr()->insert( separator(), -1, 0 ); - createPopupItem( SMESHOp::OpUpdate, View, mesh_part ); createPopupItem( SMESHOp::OpMeshInformation, View, mesh_part ); createPopupItem( SMESHOp::OpOverallMeshQuality, View, mesh_part ); createPopupItem( SMESHOp::OpFindElementByPoint, View, mesh ); popupMgr()->insert( separator(), -1, 0 ); + createPopupItem( SMESHOp::OpUpdate, OB + " " + View, mesh_part ); createPopupItem( SMESHOp::OpAutoColor, OB + " " + View, mesh, "&& (not isAutoColor)" ); createPopupItem( SMESHOp::OpDisableAutoColor, OB + " " + View, mesh, "&& isAutoColor" ); popupMgr()->insert( separator(), -1, 0 ); @@ -5131,7 +5154,7 @@ bool SMESHGUI::isSelectionCompatible() bool SMESHGUI::reusableOperation( const int id ) { // compute, evaluate and precompute are not reusable operations - return ( id == SMESHOp::OpCompute || id == SMESHOp::OpPreCompute || id == SMESHOp::OpEvaluate ) ? false : SalomeApp_Module::reusableOperation( id ); + return ( id == SMESHOp::OpCompute || id == SMESHOp::OpPreCompute || id == SMESHOp::OpEvaluate || id == SMESHOp::OpRecompute ) ? false : SalomeApp_Module::reusableOperation( id ); } bool SMESHGUI::activateModule( SUIT_Study* study ) @@ -5915,65 +5938,65 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const // to do : create operation here switch( id ) { - case SMESHOp::OpUniformRefinement: - case SMESHOp::OpHONewCase: - case SMESHOp::OpHOCaseFollow: - case SMESHOp::OpHONewIter: - case SMESHOp::OpHOIterCompute: - case SMESHOp::OpHOIterComputePublish: - case SMESHOp::OpHOEdit: - case SMESHOp::OpHODelete: - case SMESHOp::OpMGAdapt: + case SMESHOp::OpSplitBiQuadratic: + op = new SMESHGUI_SplitBiQuadOp(); break; - case SMESHOp::OpSplitBiQuadratic: - op = new SMESHGUI_SplitBiQuadOp(); + case SMESHOp::OpConvertMeshToQuadratic: + op = new SMESHGUI_ConvToQuadOp(); break; - case SMESHOp::OpConvertMeshToQuadratic: - op = new SMESHGUI_ConvToQuadOp(); + case SMESHOp::OpCreateBoundaryElements: // create 2D mesh as boundary on 3D + op = new SMESHGUI_Make2DFrom3DOp(); break; - case SMESHOp::OpCreateBoundaryElements: // create 2D mesh as boundary on 3D - op = new SMESHGUI_Make2DFrom3DOp(); + case SMESHOp::OpReorientFaces: + op = new SMESHGUI_ReorientFacesOp(); break; - case SMESHOp::OpReorientFaces: - op = new SMESHGUI_ReorientFacesOp(); - break; - case SMESHOp::OpCreateMesh: - op = new SMESHGUI_MeshOp( true, true ); + case SMESHOp::OpCreateMesh: + op = new SMESHGUI_MeshOp( true, true ); break; - case SMESHOp::OpCreateSubMesh: - op = new SMESHGUI_MeshOp( true, false ); + case SMESHOp::OpCreateSubMesh: + op = new SMESHGUI_MeshOp( true, false ); break; - case SMESHOp::OpEditMeshOrSubMesh: - case SMESHOp::OpEditMesh: - case SMESHOp::OpEditSubMesh: - op = new SMESHGUI_MeshOp( false ); + case SMESHOp::OpEditMeshOrSubMesh: + case SMESHOp::OpEditMesh: + case SMESHOp::OpEditSubMesh: + op = new SMESHGUI_MeshOp( false ); break; - case SMESHOp::OpCompute: - case SMESHOp::OpComputeSubMesh: - op = new SMESHGUI_ComputeOp(); + case SMESHOp::OpCompute: + case SMESHOp::OpComputeSubMesh: + op = new SMESHGUI_ComputeOp(); break; - case SMESHOp::OpPreCompute: - op = new SMESHGUI_PrecomputeOp(); + case SMESHOp::OpPreCompute: + op = new SMESHGUI_PrecomputeOp(); break; - case SMESHOp::OpEvaluate: - op = new SMESHGUI_EvaluateOp(); + case SMESHOp::OpEvaluate: + op = new SMESHGUI_EvaluateOp(); break; - case SMESHOp::OpMeshOrder: - op = new SMESHGUI_MeshOrderOp(); + case SMESHOp::OpMeshOrder: + op = new SMESHGUI_MeshOrderOp(); break; - case SMESHOp::OpCreateGeometryGroup: - op = new SMESHGUI_GroupOnShapeOp(); - break; - case SMESHOp::OpFindElementByPoint: - op = new SMESHGUI_FindElemByPointOp(); - break; - case SMESHOp::OpMoveNode: // Make mesh pass through point - op = new SMESHGUI_MakeNodeAtPointOp(); - break; - case SMESHOp::OpElem0DOnElemNodes: // Create 0D elements on all nodes - op = new SMESHGUI_Add0DElemsOnAllNodesOp(); - break; - default: + case SMESHOp::OpCreateGeometryGroup: + op = new SMESHGUI_GroupOnShapeOp(); + break; + case SMESHOp::OpFindElementByPoint: + op = new SMESHGUI_FindElemByPointOp(); + break; + case SMESHOp::OpMoveNode: // Make mesh pass through point + op = new SMESHGUI_MakeNodeAtPointOp(); + break; + case SMESHOp::OpElem0DOnElemNodes: // Create 0D elements on all nodes + op = new SMESHGUI_Add0DElemsOnAllNodesOp(); + break; + case SMESHOp::OpUniformRefinement: + case SMESHOp::OpHONewCase: + case SMESHOp::OpHOCaseFollow: + case SMESHOp::OpHONewIter: + case SMESHOp::OpHOIterCompute: + case SMESHOp::OpHOIterComputePublish: + case SMESHOp::OpHOEdit: + case SMESHOp::OpHODelete: + case SMESHOp::OpMGAdapt: + break; + default: break; } diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index 76b91dd9a..a7cb0d0dc 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -656,6 +656,24 @@ SMESHGUI_BaseComputeOp::SMESHGUI_BaseComputeOp() myHelpFileName = "about_meshes.html"; // V4 } +//================================================================================ +/*! + * \brief Gets dialog of this operation + * \retval LightApp_Dialog* - pointer to dialog of this operation + */ +//================================================================================ + +LightApp_Dialog* SMESHGUI_BaseComputeOp::dlg() const +{ + return myCompDlg; +} + +//================================================================================ +/*! + * \brief Return a selected mesh + */ +//================================================================================ + SMESH::SMESH_Mesh_ptr SMESHGUI_BaseComputeOp::getMesh() { LightApp_SelectionMgr* Sel = selectionMgr(); @@ -665,6 +683,23 @@ SMESH::SMESH_Mesh_ptr SMESHGUI_BaseComputeOp::getMesh() return myMesh->_is_nil() ? aMesh._retn() : SMESH::SMESH_Mesh::_duplicate( myMesh ); } +//================================================================================ +/*! + * \brief check the same operations on the same mesh + */ +//================================================================================ + +bool SMESHGUI_BaseComputeOp::isValid( SUIT_Operation* theOp ) const +{ + SMESHGUI_BaseComputeOp* baseOp = dynamic_cast( theOp ); + bool ret = true; + if ( !myMesh->_is_nil() && baseOp ) { + SMESH::SMESH_Mesh_var aMesh = baseOp->getMesh(); + if ( !aMesh->_is_nil() && aMesh->GetId() == myMesh->GetId() ) ret = false; + } + return ret; +} + //================================================================================ /*! * \brief Start operation @@ -720,6 +755,8 @@ void SMESHGUI_BaseComputeOp::startOperation() return; } + myCompDlg->myMeshName->setText( SMESH::GetName( myIObject )); + myMainShape = myMesh->GetShapeToMesh(); SMESHGUI_Operation::startOperation(); @@ -883,7 +920,6 @@ void SMESHGUI_BaseComputeOp::computeMesh() bool shapeOK = myMainShape->_is_nil() ? !hasShape : hasShape; if ( shapeOK ) { - myCompDlg->myMeshName->setText( aMeshSObj->GetName().c_str() ); SMESH::SMESH_Gen_var gen = getSMESHGUI()->GetSMESHGen(); SMESH::algo_error_array_var errors = gen->GetAlgoState(myMesh,myMainShape); if ( errors->length() > 0 ) { @@ -1552,23 +1588,6 @@ void SMESHGUI_ComputeOp::startOperation() computeMesh(); } -//================================================================================ -/*! - * \brief check the same operations on the same mesh - */ -//================================================================================ - -bool SMESHGUI_BaseComputeOp::isValid( SUIT_Operation* theOp ) const -{ - SMESHGUI_BaseComputeOp* baseOp = dynamic_cast( theOp ); - bool ret = true; - if ( !myMesh->_is_nil() && baseOp ) { - SMESH::SMESH_Mesh_var aMesh = baseOp->getMesh(); - if ( !aMesh->_is_nil() && aMesh->GetId() == myMesh->GetId() ) ret = false; - } - return ret; -} - //================================================================================ /*! * \brief Gets dialog of this operation @@ -1956,7 +1975,6 @@ void SMESHGUI_PrecomputeOp::onPreview() bool computeFailed = true, memoryLack = false; SMESHGUI_ComputeDlg* aCompDlg = computeDlg(); - aCompDlg->myMeshName->setText( aMeshSObj->GetName().c_str() ); SMESHGUI* gui = getSMESHGUI(); SMESH::SMESH_Gen_var gen = gui->GetSMESHGen(); @@ -2203,7 +2221,6 @@ void SMESHGUI_BaseComputeOp::evaluateMesh() bool shapeOK = myMainShape->_is_nil() ? !hasShape : hasShape; if ( shapeOK ) { - myCompDlg->myMeshName->setText( aMeshSObj->GetName().c_str() ); SMESH::SMESH_Gen_var gen = getSMESHGUI()->GetSMESHGen(); SMESH::algo_error_array_var errors = gen->GetAlgoState(myMesh,myMainShape); if ( errors->length() > 0 ) { @@ -2407,3 +2424,43 @@ SMESHGUI_ComputeDlg* SMESHGUI_BaseComputeOp::evaluateDlg() const return myCompDlg; } +//================================================================================ +/*! + * \brief SMESHGUI_BaseComputeOp constructor + */ +//================================================================================ + +SMESHGUI_ShowErrorsOp::SMESHGUI_ShowErrorsOp(): + SMESHGUI_BaseComputeOp() +{ +} + +//================================================================================ +/*! + * \brief Start SMESHGUI_ShowErrorsOp + */ +//================================================================================ + +void SMESHGUI_ShowErrorsOp::startOperation() +{ + SMESHGUI_BaseComputeOp::startOperation(); + + if ( myMesh->_is_nil() ) + return; + + SMESH::SMESH_Gen_var gen = getSMESHGUI()->GetSMESHGen(); + SMESH::compute_error_array_var compErrors = gen->GetComputeErrors( myMesh, myMainShape ); + QString hypErrors; + if ( compErrors->length() == 0 ) + return; + + showComputeResult( /*MemoryLack=*/false, /*NoCompError=*/false, compErrors, + /*NoHypoError=*/true, hypErrors ); + + SMESHGUI_ComputeDlg* aCompDlg = computeDlg(); + aCompDlg->setWindowTitle( tr( "SMESH_WRN_COMPUTE_FAILED" )); + aCompDlg->myFullInfo->hide(); + aCompDlg->myBriefInfo->hide(); + + return; +} diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.h b/src/SMESHGUI/SMESHGUI_ComputeDlg.h index bcac87d09..c72fb097b 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.h +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.h @@ -72,6 +72,7 @@ public: virtual ~SMESHGUI_BaseComputeOp(); SMESH::SMESH_Mesh_ptr getMesh(); + virtual LightApp_Dialog* dlg() const; protected: virtual void startOperation(); @@ -204,6 +205,20 @@ protected: protected slots: }; +/*! + * \brief Operation to show meshing errors + */ +class SMESHGUI_EXPORT SMESHGUI_ShowErrorsOp: public SMESHGUI_BaseComputeOp +{ + Q_OBJECT + +public: + SMESHGUI_ShowErrorsOp(); + +protected: + virtual void startOperation(); +}; + /*! * \brief Dialog to compute a mesh and show computation errors */ @@ -236,6 +251,7 @@ protected: friend class SMESHGUI_BaseComputeOp; friend class SMESHGUI_PrecomputeOp; + friend class SMESHGUI_ShowErrorsOp; }; class SMESHGUI_MeshOrderBox; diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index cb3185b88..f143b0136 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -1913,6 +1913,7 @@ void SMESHGUI_MeshOp::onHypoSet( const QString& theSetName ) if ( aHypoSet->toUseCommonSize() && !getAverageSize( myAverageSize )) return; + int maxDim = -1; for ( int isAlgo = 1; isAlgo >= 0; --isAlgo ) for ( aHypoSet->init( isAlgo, setType ); aHypoSet->more(); aHypoSet->next() ) { @@ -1930,6 +1931,7 @@ void SMESHGUI_MeshOp::onHypoSet( const QString& theSetName ) { setCurrentHyp( myDim, Algo, index ); onAlgoSelected( index, myDim ); + maxDim = Max( maxDim, myDim ); } } else @@ -1963,6 +1965,9 @@ void SMESHGUI_MeshOp::onHypoSet( const QString& theSetName ) } } + if ( maxDim > 0 ) + myDlg->setCurrentTab( maxDim ); + return; } diff --git a/src/SMESHGUI/SMESHGUI_Operations.h b/src/SMESHGUI/SMESHGUI_Operations.h index 75d22b7ff..6edc79469 100644 --- a/src/SMESHGUI/SMESHGUI_Operations.h +++ b/src/SMESHGUI/SMESHGUI_Operations.h @@ -77,6 +77,8 @@ namespace SMESHOp { OpPreCompute = 2042, // MENU MESH - PREVIEW OpEvaluate = 2043, // MENU MESH - EVALUATE OpMeshOrder = 2044, // MENU MESH - CHANGE SUBMESH PRIORITY + OpRecompute = 2045, // MENU MESH - Clear + COMPUTE + OpShowErrors = 2046, // MENU MESH - Show compute errors OpCreateGroup = 2050, // MENU MESH - CREATE GROUP OpCreateGeometryGroup = 2051, // MENU MESH - CREATE GROUPS FROM GEOMETRY OpConstructGroup = 2052, // MENU MESH - CONSTRUCT GROUP diff --git a/src/SMESHGUI/SMESHGUI_Selection.cxx b/src/SMESHGUI/SMESHGUI_Selection.cxx index 6f59abd8c..fdf9a8d1c 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.cxx +++ b/src/SMESHGUI/SMESHGUI_Selection.cxx @@ -129,6 +129,8 @@ QVariant SMESHGUI_Selection::parameter( const int ind, const QString& p ) const else if ( p=="entityMode" ) val = QVariant( entityMode( ind ) ); else if ( p=="isNumFunctor" ) val = QVariant( isNumFunctor( ind ) ); else if ( p=="displayMode" ) val = QVariant( displayMode( ind ) ); + else if ( p=="hasAlgo" ) val = QVariant( hasAlgo( ind ) ); + else if ( p=="hasErrors" ) val = QVariant( hasErrors( ind ) ); else if ( p=="isComputable" ) val = QVariant( isComputable( ind ) ); else if ( p=="isPreComputable" ) val = QVariant( isPreComputable( ind ) ); else if ( p=="hasGeomReference" ) val = QVariant( hasGeomReference( ind ) ); @@ -547,9 +549,52 @@ int SMESHGUI_Selection::dim( int ind ) const return dim; } +//======================================================================= +//function : hasAlgo +//purpose : return true for a ready-to-compute [sub-]mesh +//======================================================================= + +bool SMESHGUI_Selection::hasAlgo( int ind ) const +{ + if ( ind >= 0 && ind < myTypes.count() && ( myTypes[ind] == "Mesh" || + myTypes[ind].startsWith("Mesh " ))) + { + QMap modeMap; + _PTR(SObject) meshSO = SMESH::getStudy()->FindObjectID( entry( ind ).toStdString() ); + + SMESHGUI_PrecomputeOp::getAssignedAlgos( meshSO, modeMap ); + return modeMap.size() > 0; + } + return false; +} + + +//======================================================================= +//function : hasAlgo +//purpose : return true if a mesh was computed with errors +//======================================================================= + +bool SMESHGUI_Selection::hasErrors( int ind ) const +{ + if ( ind >= 0 && ind < myTypes.count() && ( myTypes[ind] == "Mesh")) + { + _PTR(SObject) meshSO = SMESH::getStudy()->FindObjectID( entry( ind ).toStdString() ); + CORBA::Object_var obj = SMESH::SObjectToObject( meshSO ); + SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( obj ); + if ( !CORBA::is_nil( mesh ) ) + { + SMESH::SMESH_Gen_var gen = SMESHGUI::GetSMESHGUI()->GetSMESHGen(); + GEOM::GEOM_Object_var geom = mesh->GetShapeToMesh(); + SMESH::compute_error_array_var compErrors = gen->GetComputeErrors( mesh, geom ); + return compErrors->length(); + } + } + return false; +} + //======================================================================= //function : isComputable -//purpose : return true for a ready-to-compute mesh +//purpose : Return true if a [sub-]mesh does not have "computed" icon //======================================================================= bool SMESHGUI_Selection::isComputable( int ind ) const @@ -557,16 +602,13 @@ bool SMESHGUI_Selection::isComputable( int ind ) const if ( ind >= 0 && ind < myTypes.count() && ( myTypes[ind] == "Mesh" || myTypes[ind].startsWith("Mesh " ))) { - QMap modeMap; - _PTR(SObject) meshSO = SMESH::getStudy()->FindObjectID( entry( ind ).toUtf8().data() ); - - _PTR(SComponent) component = meshSO->GetFatherComponent(); - if ( meshSO->Depth() - component->Depth() > 1 ) // sub-mesh, get a mesh - while ( meshSO->Depth() - component->Depth() > 1 ) - meshSO = meshSO->GetFather(); - - SMESHGUI_PrecomputeOp::getAssignedAlgos( meshSO, modeMap ); - return modeMap.size() > 0; + _PTR(GenericAttribute) attr; + if ( _PTR(SObject) meshSO = SMESH::getStudy()->FindObjectID( entry( ind ).toStdString() )) + if ( meshSO->FindAttribute( attr, "AttributePixMap" )) + { + _PTR(AttributePixMap) pixmap = attr; + return ( pixmap->GetPixMap() != "ICON_SMESH_TREE_MESH" ); + } } return false; } diff --git a/src/SMESHGUI/SMESHGUI_Selection.h b/src/SMESHGUI/SMESHGUI_Selection.h index 5d23e768f..b9727108f 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.h +++ b/src/SMESHGUI/SMESHGUI_Selection.h @@ -58,6 +58,8 @@ public: virtual int numberOfNodes( int ) const; virtual int dim( int ) const; virtual bool isComputable( int ) const; + virtual bool hasAlgo( int ) const; + virtual bool hasErrors( int ) const; virtual bool isPreComputable( int ) const; virtual bool hasGeomReference( int ) const; virtual bool isEditableHyp( int ) const; diff --git a/src/SMESHGUI/SMESH_images.ts b/src/SMESHGUI/SMESH_images.ts index 44f701e94..635b11e5a 100644 --- a/src/SMESHGUI/SMESH_images.ts +++ b/src/SMESHGUI/SMESH_images.ts @@ -43,6 +43,10 @@ ICON_COMPUTE mesh_compute.png + + ICON_SHOW_ERRORS + mesh_compute_error.png + ICON_OVL_MESH_QUALITY mesh_quality.png @@ -119,6 +123,18 @@ ICON_CUTQUAD mesh_cutquad.png + + ICON_EXPORT + mesh_export.png + + + ICON_AUTO_COLOR + mesh_auto_colors.png + + + ICON_DISABLE_AUTO_COLOR + mesh_auto_colors.png + ICON_DELETE delete.png diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index 835ba01b3..6a00a82a0 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -308,6 +308,14 @@ MEN_COMPUTE Compute + + MEN_RE_COMPUTE + Clear + Compute + + + MEN_SHOW_ERRORS + Show Compute Errors + MEN_COMPUTE_SUBMESH Compute Sub-mesh diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index 52f7e9e9c..b24e3ba2d 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -568,7 +568,7 @@ namespace //================================================================================ /*! - * \brief Import data from a GMF file and Return an error description + * \brief Import data from a GMF file and return an error description */ //================================================================================ @@ -4972,7 +4972,7 @@ SMESH::long_array* SMESH_Mesh_i::GetSubMeshElementsId(const CORBA::Long ShapeID) //============================================================================= /*! * Return ID of nodes for given sub-mesh - * If param all==true - Return all nodes, else - + * If param all==true - return all nodes, else - * Return only nodes on shapes. */ //============================================================================= @@ -5079,7 +5079,7 @@ CORBA::LongLong SMESH_Mesh_i::GetMeshPtr() //============================================================================= /*! * Get XYZ coordinates of node as list of double - * If there is not node for given ID - Return empty list + * If there is not node for given ID - return empty list */ //============================================================================= @@ -5109,8 +5109,8 @@ SMESH::double_array* SMESH_Mesh_i::GetNodeXYZ(const CORBA::Long id) //============================================================================= /*! - * For given node Return list of IDs of inverse elements - * If there is not node for given ID - Return empty list + * For given node return list of IDs of inverse elements + * If there is not node for given ID - return empty list */ //============================================================================= @@ -5243,8 +5243,8 @@ SMESH::ElementPosition SMESH_Mesh_i::GetElementPosition(CORBA::Long ElemID) //============================================================================= /*! - * If given element is node Return IDs of shape from position - * If there is not node for given ID - Return -1 + * If given element is node return IDs of shape from position + * If there is not node for given ID - return -1 */ //============================================================================= @@ -5271,7 +5271,7 @@ CORBA::Long SMESH_Mesh_i::GetShapeID(const CORBA::Long id) /*! * For given element return ID of result shape after * ::FindShape() from SMESH_MeshEditor - * If there is not element for given ID - Return -1 + * If there is not element for given ID - return -1 */ //============================================================================= @@ -5301,7 +5301,7 @@ CORBA::Long SMESH_Mesh_i::GetShapeIDForElem(const CORBA::Long id) //============================================================================= /*! * Return number of nodes for given element - * If there is not element for given ID - Return -1 + * If there is not element for given ID - return -1 */ //============================================================================= @@ -5322,8 +5322,8 @@ CORBA::Long SMESH_Mesh_i::GetElemNbNodes(const CORBA::Long id) //============================================================================= /*! * Return ID of node by given index for given element - * If there is not element for given ID - Return -1 - * If there is not node for given index - Return -2 + * If there is not element for given ID - return -1 + * If there is not node for given index - return -2 */ //============================================================================= @@ -6045,7 +6045,7 @@ SMESH::SMESH_Mesh_ptr SMESH_Mesh_i::GetMesh() //================================================================================ /*! - * \brief Return false if GetMeshInfo() Return incorrect information that may + * \brief Return false if GetMeshInfo() return incorrect information that may * happen if mesh data is not yet fully loaded from the file of study. * * @@ -6425,7 +6425,7 @@ class SMESH_DimHyp //! fields int _dim; //!< a dimension the algo can build (concurrent dimension) int _ownDim; //!< dimension of shape of _subMesh (>=_dim) - TopTools_MapOfShape _shapeMap; + TopTools_MapOfShape _shapeMap; //!< [sub-]shapes of dimension == _dim SMESH_subMesh* _subMesh; list _hypotheses; //!< algo is first, then its parameters @@ -6522,9 +6522,11 @@ class SMESH_DimHyp bool isSame = checkAlgo( a1, a2 ); if ( !isSame ) { - if ( !a1 || !a2 ) - return false; // pb? - return a1->GetDim() == a2->GetDim(); // different algorithms of same dim -> concurrency ! + return true; + // commented off for IPAL54678 + // if ( !a1 || !a2 ) + // return false; // pb? + // return a1->GetDim() == a2->GetDim(); // different algorithms of same dim -> concurrency ! } // check hypothesises for concurrence (skip first as algorithm) @@ -6565,6 +6567,9 @@ void addDimHypInstance(const int theDim, const list & theHypList, TDimHypList* theDimHypListArr ) { + if ( !theAlgo->NeedDiscreteBoundary() && + theAlgo->NeedLowerHyps( theDim )) // IPAL54678 + return; TDimHypList& listOfdimHyp = theDimHypListArr[theDim]; if ( listOfdimHyp.empty() || listOfdimHyp.back()->_subMesh != theSubMesh ) { SMESH_DimHyp* dimHyp = new SMESH_DimHyp( theSubMesh, theDim, theShape ); @@ -6707,7 +6712,7 @@ CORBA::Boolean SMESH_Mesh_i::IsUnorderedSubMesh(CORBA::Long submeshID) //============================================================================= /*! - * \brief Return submesh objects list in meshing order + * \brief Return sub-mesh objects list in meshing order */ //============================================================================= @@ -6776,7 +6781,8 @@ TListOfListOfInt SMESH_Mesh_i::findConcurrentSubMeshes() continue; // no algorithm assigned to a current submesh int dim = anAlgo->GetDim(); // top concurrent dimension (see comment to SMESH_DimHyp) - // the submesh can concurrent at (or lower dims if !anAlgo->NeedDiscreteBoundary()) + // the submesh can concurrent at (or lower dims if !anAlgo->NeedDiscreteBoundary() + // and !anAlgo->NeedLowerHyps( dim )) // create instance of dimension-hypothesis for found concurrent dimension(s) and algorithm for ( int j = anAlgo->NeedDiscreteBoundary() ? dim : 1, jn = dim; j <= jn; j++ ) From bb46a82d432f2a7a070417de934b11b99b70dc2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Wed, 27 May 2020 11:43:49 +0200 Subject: [PATCH 023/100] =?UTF-8?q?Pr=C3=A9alables=20de=20l'activation=20d?= =?UTF-8?q?es=20menus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SMESHGUI/SMESHGUI_AdaptDlg.cxx | 344 +++++++++++++++++++++++++++-- src/SMESHGUI/SMESHGUI_AdaptDlg.h | 2 + 2 files changed, 333 insertions(+), 13 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx index 6c1e74514..1aa14fd38 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx @@ -65,6 +65,7 @@ // SALOME KERNEL includes #include +#include // VTK Includes #include @@ -90,6 +91,9 @@ #include #include +// HOMARD includes +#include "MonCreateCase.h" + // STL includes #include #include @@ -129,7 +133,7 @@ SMESHGUI_AdaptDlg::SMESHGUI_AdaptDlg( SMESHGUI* theModule, myNbChangesOfContents(0), myIsApplyAndClose( false ) { - std::cout << "theCommandID : " << theCommandID << std::endl; + std::cout << "SMESHGUI_AdaptDlg avec theCommandID : " << theCommandID << std::endl; initDialog( true ); if ( !theMesh->_is_nil() ) init( theMesh ); @@ -141,6 +145,313 @@ SMESHGUI_AdaptDlg::SMESHGUI_AdaptDlg( SMESHGUI* theModule, myGeomGroupLine->setEnabled( false ); } } +//======================================================================= +// OnGUIEvent for the adaptations +//======================================================================= +bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) +{ + std::cout << "OnGUIEvent avec theCommandID : " << theCommandID << std::endl; +// A. Controles +// SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( application() ); +// if ( !app ) return false; +// +// SalomeApp_Study* stud = dynamic_cast ( app->activeStudy() ); +// if ( !stud ) +// { +// MESSAGE ( "FAILED to cast active study to SalomeApp_Study" ); +// return false; +// } +// +// SUIT_Desktop* parent = application()->desktop(); +// +// ADAPT::ADAPT_Gen_var homardGen = ADAPTGUI::InitHOMARDGen(app); +// +// if (!CORBA::is_nil(homardGen)) +// homardGen->UpdateStudy(); +// +// getApp()->updateObjectBrowser(); +// +// B. Choix selon les commandes + SCRUTE(theCommandID); + switch (theCommandID) + { + case 8011: // Creation d un Cas + { + MESSAGE("command " << theCommandID << " activated"); +// MonCreateCase *aDlg = new MonCreateCase( true, +// ADAPT::ADAPT_Gen::_duplicate(homardGen) ) ; +// aDlg->show(); + break; + } + +// case 8012: // Poursuite d une iteration +// { +// MESSAGE("command " << theCommandID << " activated"); +// MonPursueIteration *aDlg = new MonPursueIteration( true, +// ADAPT::ADAPT_Gen::_duplicate(homardGen) ) ; +// aDlg->show(); +// break; +// } + +// case 8013: // Creation d une Iteration +// { +// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// MonCreateIteration *IterDlg = new MonCreateIteration( parent, true, +// ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName ) ; +// IterDlg->show(); +// break; +// } + +// case 8014: // Compute une iteration +// { +// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// try { homardGen->Compute(_ObjectName.toStdString().c_str(), 0, 1, -1, 1); } +// catch( SALOME::SALOME_Exception& S_ex ) +// { +// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), +// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); +// getApp()->updateObjectBrowser(); +// return false; +// } +// break; +// } + +// case 8015: // Compute une iteration et publication +// { +// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// try { homardGen->Compute(_ObjectName.toStdString().c_str(), 0, 1, -1, 2); } +// catch( SALOME::SALOME_Exception& S_ex ) +// { +// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), +// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); +// getApp()->updateObjectBrowser(); +// return false; +// } +// break; +// } + +// case 1121: // Information sur le maillage de l'iteration +// { +// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// MonIterInfo *IterDlg = new MonIterInfo( parent, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName ) ; +// IterDlg->show(); +// break; +// } +// +// case 1131: // Publication du maillage de l'iteration +// { +// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// homardGen->PublishMeshIterInSmesh(_ObjectName.toStdString().c_str()); +// break; +// } +// +// case 1132: // Publication du maillage de l'iteration a partir du fichier +// { +// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// homardGen->PublishResultInSmesh(_ObjectName.toStdString().c_str(), 1); +// break; +// } +// +// case 1201: // Edition d'un objet +// { +// MESSAGE("command " << theCommandID << " activated"); +// QString nomObjet = HOMARD_QT_COMMUN::SelectionArbreEtude(QString(""), 1); +// if (nomObjet == QString("")) break; +// _PTR(SObject) obj = chercheMonObjet(); +// if (obj) +// { +// // Edition d'une frontiere CAO +// if (HOMARD_UTILS::isBoundaryCAO(obj)) +// { +// MonEditBoundaryCAO *aDlg = new MonEditBoundaryCAO(0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; +// aDlg->show(); +// } +// // Edition d'une frontiere discrete +// else if (HOMARD_UTILS::isBoundaryDi(obj)) +// { +// MonEditBoundaryDi *aDlg = new MonEditBoundaryDi(0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; +// aDlg->show(); +// } +// // Edition d'une frontiere analytique +// else if (HOMARD_UTILS::isBoundaryAn(obj)) +// { +// MonEditBoundaryAn *aDlg = new MonEditBoundaryAn(0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; +// aDlg->show(); +// } +// // Edition d'un cas +// else if (HOMARD_UTILS::isCase(obj)) +// { +// MonEditCase *aDlg = new MonEditCase(true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName ) ; +// aDlg->show(); +// } +// // Edition d'une hypothese +// else if (HOMARD_UTILS::isHypo(obj)) +// { +// MonEditHypothesis *aDlg = new MonEditHypothesis(0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName, QString(""), QString("")) ; +// aDlg->show(); +// } +// // Edition d'une iteration +// else if (HOMARD_UTILS::isIter(obj)) +// { +// MonEditIteration *aDlg = new MonEditIteration(parent, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; +// aDlg->show(); +// } +// // Edition d'un schema YACS +// else if (HOMARD_UTILS::isYACS(obj)) +// { +// MESSAGE("appel de MonEditYACS"); +// MonEditYACS *aDlg = new MonEditYACS(true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName) ; +// aDlg->show(); +// } +// // Edition d'une zone +// else if (HOMARD_UTILS::isZone(obj)) +// { +// MonEditZone *aDlg = new MonEditZone(0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; +// aDlg->show(); +// } +// } +// break; +// } +// +// case 1211: // Suppression d'un objet +// { +// MESSAGE("command " << theCommandID << " activated"); +// QString nomObjet = HOMARD_QT_COMMUN::SelectionArbreEtude(QString(""), 1); +// if (nomObjet == QString("")) break; +// _PTR(SObject) obj = chercheMonObjet(); +// if (obj) +// { +// // Suppression d'une frontiere +// if ( HOMARD_UTILS::isBoundaryCAO(obj) || HOMARD_UTILS::isBoundaryDi(obj) || HOMARD_UTILS::isBoundaryAn(obj) ) +// { +// try +// { homardGen->DeleteBoundary(_ObjectName.toStdString().c_str()); } +// catch( SALOME::SALOME_Exception& S_ex ) +// { +// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), +// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); +// getApp()->updateObjectBrowser(); +// return false; +// } +// } +// // Suppression d'un cas +// else if (HOMARD_UTILS::isCase(obj)) +// { +// try +// { homardGen->DeleteCase(_ObjectName.toStdString().c_str(), 1); } +// catch( SALOME::SALOME_Exception& S_ex ) +// { +// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), +// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); +// getApp()->updateObjectBrowser(); +// return false; +// } +// } +// // Suppression d'une hypothese +// else if (HOMARD_UTILS::isHypo(obj)) +// { +// try +// { homardGen->DeleteHypo(_ObjectName.toStdString().c_str()); } +// catch( SALOME::SALOME_Exception& S_ex ) +// { +// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), +// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); +// getApp()->updateObjectBrowser(); +// return false; +// } +// } +// // Suppression d'une iteration +// else if (HOMARD_UTILS::isIter(obj)) +// { +// try +// { homardGen->DeleteIteration(_ObjectName.toStdString().c_str(), 1); } +// catch( SALOME::SALOME_Exception& S_ex ) +// { +// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), +// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); +// getApp()->updateObjectBrowser(); +// return false; +// } +// } +// // Suppression d'un schema YACS +// else if (HOMARD_UTILS::isYACS(obj)) +// { +// try +// { homardGen->DeleteYACS(_ObjectName.toStdString().c_str(), 1); } +// catch( SALOME::SALOME_Exception& S_ex ) +// { +// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), +// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); +// getApp()->updateObjectBrowser(); +// return false; +// } +// } +// // Suppression d'une zone +// else if (HOMARD_UTILS::isZone(obj)) +// { +// try +// { homardGen->DeleteZone(_ObjectName.toStdString().c_str()); } +// catch( SALOME::SALOME_Exception& S_ex ) +// { +// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), +// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); +// getApp()->updateObjectBrowser(); +// return false; +// } +// } +// } +// break; +// } +// +// case 1301: // Information sur un maillage +// { +// MESSAGE("etape 1301") +// MESSAGE("command " << theCommandID << " activated"); +// MonMeshInfo *aDlg = new MonMeshInfo( parent, true, ADAPT::ADAPT_Gen::_duplicate(homardGen) ) ; +// aDlg->show(); +// break; +// } +// +// case 1302: // Affichage de fichier texte +// { +// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// _PTR(SObject) obj = chercheMonObjet(); +// if ( (obj) && ( HOMARD_UTILS::isFileType(obj,QString("log")) || HOMARD_UTILS::isFileType(obj,QString("Summary")) || HOMARD_UTILS::isFileType(obj,QString("xml")) ) ) +// { +// MonEditFile *aDlg = new MonEditFile( 0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName, 0 ) ; +// if ( aDlg->_codret == 0 ) { aDlg->show(); } +// } +// break; +// } +// +// case 1401: // Création d'un schema YACS +// { +// MESSAGE("etape 1401") +// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// MonCreateYACS *aDlg = new MonCreateYACS( true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName ) ; +// aDlg->show(); +// break; +// } +// +// case 1402: // Ecriture d'un schéma YACS +// { +// MESSAGE("etape 1402") +// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// try { homardGen->YACSWrite(_ObjectName.toStdString().c_str()); } +// catch( SALOME::SALOME_Exception& S_ex ) +// { +// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), +// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); +// getApp()->updateObjectBrowser(); +// return false; +// } +// break; +// } + + } +// getApp()->updateObjectBrowser(); + return true; +} //================================================================================= // function : SMESHGUI_AdaptDlg() @@ -148,6 +459,7 @@ SMESHGUI_AdaptDlg::SMESHGUI_AdaptDlg( SMESHGUI* theModule, //================================================================================= void SMESHGUI_AdaptDlg::initDialog( bool create) { + std::cout << "passage par initDialog" << std::endl; setModal( false ); setAttribute( Qt::WA_DeleteOnClose, true ); @@ -340,7 +652,7 @@ void SMESHGUI_AdaptDlg::initDialog( bool create) QLabel* aColorLab = new QLabel(tr( "SMESH_CHECK_COLOR" ), aColorBox ); myColorBtn = new QtxColorButton(aColorBox); - myColorBtn->setSizePolicy( QSizePolicy::MinimumExpanding, + myColorBtn->setSizePolicy( QSizePolicy::MinimumExpanding, myColorBtn->sizePolicy().verticalPolicy() ); aColorBoxLayout->addWidget(aColorLab); @@ -466,6 +778,7 @@ SMESHGUI_AdaptDlg::~SMESHGUI_AdaptDlg() //================================================================================= QString SMESHGUI_AdaptDlg::GetDefaultName(const QString& theOperation) { + std::cout << "passage par GetDefaultName" << std::endl; QString aName = ""; // collect all object names of SMESH component @@ -495,6 +808,7 @@ QString SMESHGUI_AdaptDlg::GetDefaultName(const QString& theOperation) void SMESHGUI_AdaptDlg::setDefaultName() const { + std::cout << "passage par setDefaultName" << std::endl; QString aResName; int i=1; QString aPrefix ="Group_"; @@ -505,7 +819,7 @@ void SMESHGUI_AdaptDlg::setDefaultName() const anObj = SMESH::getStudy()->FindObject( aResName.toUtf8().constData() ); } while ( anObj ); - myName->setText(aResName); + myName->setText(aResName); } //================================================================================= @@ -514,6 +828,7 @@ void SMESHGUI_AdaptDlg::setDefaultName() const //================================================================================= void SMESHGUI_AdaptDlg::init (SMESH::SMESH_Mesh_ptr theMesh) { + std::cout << "passage par init (SMESH::SMESH_Mesh_ptr theMesh)" << std::endl; mySelectionMgr->installFilter(myMeshFilter); /* init data from current selection */ @@ -554,6 +869,7 @@ void SMESHGUI_AdaptDlg::init (SMESH::SMESH_Mesh_ptr theMesh) //================================================================================= void SMESHGUI_AdaptDlg::init (SMESH::SMESH_GroupBase_ptr theGroup) { + std::cout << "passage par init (SMESH::SMESH_GroupBase_ptr theGroup)" << std::endl; restoreShowEntityMode(); myMesh = theGroup->GetMesh(); setShowEntityMode(); @@ -666,6 +982,7 @@ void SMESHGUI_AdaptDlg::init (SMESH::SMESH_GroupBase_ptr theGroup) //================================================================================= void SMESHGUI_AdaptDlg::updateButtons() { + std::cout << "passage par updateButtons" << std::endl; bool enable = !myName->text().trimmed().isEmpty(); if ( enable ) { @@ -718,6 +1035,7 @@ void SMESHGUI_AdaptDlg::updateButtons() //================================================================================= void SMESHGUI_AdaptDlg::onNameChanged (const QString& text) { + std::cout << "passage par onNameChanged" << std::endl; myOldName = myName->text(); updateButtons(); myNameChanged = !myName->text().trimmed().isEmpty(); @@ -901,7 +1219,7 @@ bool SMESHGUI_AdaptDlg::onApply() SMESH::SMESH_GroupBase_var resultGroup; bool isCreation = false, isConversion = false; - + SUIT_OverrideCursor wc; if (myGrpTypeId == 0) // standalone @@ -973,7 +1291,7 @@ bool SMESHGUI_AdaptDlg::onApply() } else { QList aAddList; - + int i, total = myElements->count(); for (i = 0; i < total; i++) { int anId = myElements->item(i)->text().toInt(); @@ -1153,14 +1471,14 @@ bool SMESHGUI_AdaptDlg::onApply() case grp0DSelection: anActor->Set0DColor ( aColor.R, aColor.G, aColor.B ); break; case grpBallSelection: anActor->SetBallColor( aColor.R, aColor.G, aColor.B ); break; case grpEdgeSelection: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break; - case grpVolumeSelection: + case grpVolumeSelection: SMESH::GetColor("SMESH", "volume_color", c , delta, "255,0,170|-100"); - anActor->SetVolumeColor( aColor.R, aColor.G, aColor.B, delta ); break; + anActor->SetVolumeColor( aColor.R, aColor.G, aColor.B, delta ); break; break; - case grpFaceSelection: + case grpFaceSelection: default: SMESH::GetColor("SMESH", "fill_color", c , delta, "0,170,255|-100"); - anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B, delta ); break; + anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B, delta ); break; break; } // update a visible group according to a changed contents @@ -1527,7 +1845,7 @@ void SMESHGUI_AdaptDlg::onObjectSelectionChanged() } } } - + if (myActorsList.count() == 0) { if (!myGroup->_is_nil()) { SMESH_Actor* anActor = SMESH::FindActorByObject(myGroup); @@ -2090,7 +2408,7 @@ void SMESHGUI_AdaptDlg::onRemove() SMESH::long_array_var anElements = aSubMesh->GetNodesId(); int k = anElements->length(); for (int i = 0; i < k; i++) { - QList found = + QList found = myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly); QListWidgetItem* anItem; foreach(anItem, found) delete anItem; @@ -2105,7 +2423,7 @@ void SMESHGUI_AdaptDlg::onRemove() SMESH::long_array_var anElements = aSubMesh->GetElementsId(); int k = anElements->length(); for (int i = 0; i < k; i++) { - QList found = + QList found = myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly); QListWidgetItem* anItem; foreach(anItem, found) delete anItem; @@ -2132,7 +2450,7 @@ void SMESHGUI_AdaptDlg::onRemove() SMESH::long_array_var anElements = aGroup->GetListOfID(); int k = anElements->length(); for (int i = 0; i < k; i++) { - QList found = + QList found = myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly); QListWidgetItem* anItem; foreach(anItem, found) delete anItem; diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.h b/src/SMESHGUI/SMESHGUI_AdaptDlg.h index 7c140ef21..0138e03d2 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.h +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.h @@ -74,6 +74,8 @@ public: SMESH::SMESH_Mesh_ptr = SMESH::SMESH_Mesh::_nil() ); ~SMESHGUI_AdaptDlg(); + virtual bool OnGUIEvent (int theCommandID); + static QString GetDefaultName( const QString& ); public slots: From 4434b7437bbd2ffea0152bd450974149519d7ea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Wed, 27 May 2020 12:13:20 +0200 Subject: [PATCH 024/100] =?UTF-8?q?Recherche=20de=20l'=C3=A9tude=20sous-ja?= =?UTF-8?q?cente?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SMESHGUI/SMESHGUI.cxx | 8 ++--- src/SMESHGUI/SMESHGUI_AdaptDlg.cxx | 49 ++++++++++++++++-------------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index ecae8b802..53c94d6ec 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -1970,12 +1970,12 @@ void SMESHGUI::OnEditDelete() int objectCount = 0; QString aNameList; QString aParentComponent = QString::null; - + for( SALOME_ListIteratorOfListIO anIt( selected ); anIt.More(); anIt.Next() ) { Handle(SALOME_InteractiveObject) anIO = anIt.Value(); if ( anIO.IsNull() ) continue; - + QString father = "unknown", name; _PTR(SObject) aSO = aStudy->FindObjectID( anIO->getEntry() ); @@ -3048,7 +3048,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) { SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_nil(); SMESHGUI_AdaptDlg *aDlg = new SMESHGUI_AdaptDlg( this, theCommandID, aMesh); - aDlg->show(); +// aDlg->show(); } // Adaptation - end @@ -5368,7 +5368,7 @@ void SMESHGUI::createPreferences() setPreferenceProperty( dispgroup, "columns", 2 ); addPreference( tr( "PREF_FITALL_ON_DISPLAYONLY" ), dispgroup, LightApp_Preferences::Bool, "SMESH", "fitall_on_displayonly" ); - + int dispmode = addPreference( tr( "PREF_DISPLAY_MODE" ), dispgroup, LightApp_Preferences::Selector, "SMESH", "display_mode" ); QStringList modes; modes.append( tr("MEN_WIRE") ); diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx index 1aa14fd38..78eb57775 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx @@ -134,16 +134,20 @@ SMESHGUI_AdaptDlg::SMESHGUI_AdaptDlg( SMESHGUI* theModule, myIsApplyAndClose( false ) { std::cout << "SMESHGUI_AdaptDlg avec theCommandID : " << theCommandID << std::endl; - initDialog( true ); - if ( !theMesh->_is_nil() ) - init( theMesh ); - else + if ( ! OnGUIEvent (theCommandID) ) { - mySelectSubMesh->setEnabled( false ); - mySelectGroup->setEnabled( false ); - myGeomGroupBtn->setEnabled( false ); - myGeomGroupLine->setEnabled( false ); + INFOS("Erreur"); } +// initDialog( true ); +// if ( !theMesh->_is_nil() ) +// init( theMesh ); +// else +// { +// mySelectSubMesh->setEnabled( false ); +// mySelectGroup->setEnabled( false ); +// myGeomGroupBtn->setEnabled( false ); +// myGeomGroupLine->setEnabled( false ); +// } } //======================================================================= // OnGUIEvent for the adaptations @@ -152,24 +156,25 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) { std::cout << "OnGUIEvent avec theCommandID : " << theCommandID << std::endl; // A. Controles -// SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( application() ); -// if ( !app ) return false; -// -// SalomeApp_Study* stud = dynamic_cast ( app->activeStudy() ); -// if ( !stud ) -// { -// MESSAGE ( "FAILED to cast active study to SalomeApp_Study" ); -// return false; -// } -// -// SUIT_Desktop* parent = application()->desktop(); -// + SalomeApp_Application* app = + dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); + if ( !app ) return false; + + SalomeApp_Study* stud = dynamic_cast ( app->activeStudy() ); + if ( !stud ) + { + MESSAGE ( "FAILED to cast active study to SalomeApp_Study" ); + return false; + } + + SUIT_Desktop* parent = SUIT_Session::session()->activeApplication()->desktop(); + // ADAPT::ADAPT_Gen_var homardGen = ADAPTGUI::InitHOMARDGen(app); // // if (!CORBA::is_nil(homardGen)) // homardGen->UpdateStudy(); // -// getApp()->updateObjectBrowser(); + SMESHGUI::GetSMESHGUI()->getApp()->updateObjectBrowser(); // // B. Choix selon les commandes SCRUTE(theCommandID); @@ -177,7 +182,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) { case 8011: // Creation d un Cas { - MESSAGE("command " << theCommandID << " activated"); + INFOS("Creation d'un Cas"); // MonCreateCase *aDlg = new MonCreateCase( true, // ADAPT::ADAPT_Gen::_duplicate(homardGen) ) ; // aDlg->show(); From baad437937a7458cb806e3c8cf1537e8bd6108fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Wed, 27 May 2020 17:01:35 +0200 Subject: [PATCH 025/100] =?UTF-8?q?homardGen=20r=C3=A9activ=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SMESHGUI/CMakeLists.txt | 3 +- src/SMESHGUI/SMESHGUI_AdaptDlg.cxx | 74 ++++++++++++++++-------------- src/SMESHGUI/SMESHGUI_AdaptDlg.h | 50 ++++++++++---------- 3 files changed, 66 insertions(+), 61 deletions(-) diff --git a/src/SMESHGUI/CMakeLists.txt b/src/SMESHGUI/CMakeLists.txt index 53f99bf29..185d6c5fe 100644 --- a/src/SMESHGUI/CMakeLists.txt +++ b/src/SMESHGUI/CMakeLists.txt @@ -75,6 +75,7 @@ SET(_link_LIBRARIES SMESHControls SMESHObject ADAPTGUI + ADAPTImpl ) # --- headers --- @@ -277,7 +278,7 @@ SET(_ts_RESOURCES SMESH_msg_en.ts SMESH_msg_fr.ts SMESH_msg_ja.ts -) +) # --- rules --- diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx index 78eb57775..387baa90f 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx @@ -20,11 +20,10 @@ // SMESH SMESHGUI : GUI for the adaptation in the SMESH component // File : SMESHGUI_AdaptDlg.cxx // Author : Gerald NICOLAS, EDF -// ADAPTGUI includes -// -#include "SMESHGUI_AdaptDlg.h" +// SMESH includes #include "SMESHGUI.h" +#include "SMESHGUI_AdaptDlg.h" #include "SMESHGUI_Utils.h" #include "SMESHGUI_VTKUtils.h" #include "SMESHGUI_GroupUtils.h" @@ -44,36 +43,20 @@ #include // SALOME GUI includes +#include #include - +#include #include -#include -#include #include #include - -#include +#include +#include +#include #include #include -#include - -#include - -#include - +#include #include -// SALOME KERNEL includes -#include -#include - -// VTK Includes -#include -#include - -// OCCT includes -#include - // Qt includes #include #include @@ -99,6 +82,23 @@ #include #include +// VTK includes +#include +#include + +// SALOME KERNEL includes +#include +#include +#include +#include +#include +#include +#include "utilities.h" +#include + +// OCCT includes +#include + #define SPACING 6 #define MARGIN 11 @@ -149,9 +149,11 @@ SMESHGUI_AdaptDlg::SMESHGUI_AdaptDlg( SMESHGUI* theModule, // myGeomGroupLine->setEnabled( false ); // } } -//======================================================================= -// OnGUIEvent for the adaptations -//======================================================================= +/*! + * \brief Launches the GUI for the adaptation + * \param theCommandID - the integer taht references the operation + * \return Graphical object +*/ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) { std::cout << "OnGUIEvent avec theCommandID : " << theCommandID << std::endl; @@ -160,8 +162,8 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); if ( !app ) return false; - SalomeApp_Study* stud = dynamic_cast ( app->activeStudy() ); - if ( !stud ) + SalomeApp_Study* aStudy = dynamic_cast ( app->activeStudy() ); + if ( !aStudy ) { MESSAGE ( "FAILED to cast active study to SalomeApp_Study" ); return false; @@ -169,11 +171,13 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) SUIT_Desktop* parent = SUIT_Session::session()->activeApplication()->desktop(); -// ADAPT::ADAPT_Gen_var homardGen = ADAPTGUI::InitHOMARDGen(app); -// -// if (!CORBA::is_nil(homardGen)) -// homardGen->UpdateStudy(); -// + SALOME_LifeCycleCORBA* ls = new SALOME_LifeCycleCORBA(app->namingService()); + Engines::EngineComponent_var comp = + ls->FindOrLoad_Component("FactoryServer", "SMESH"); + ADAPT::ADAPT_Gen_var homardGen = ADAPT::ADAPT_Gen::_narrow(comp); + if (!CORBA::is_nil(homardGen)) + homardGen->UpdateStudy(); + SMESHGUI::GetSMESHGUI()->getApp()->updateObjectBrowser(); // // B. Choix selon les commandes diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.h b/src/SMESHGUI/SMESHGUI_AdaptDlg.h index 0138e03d2..0aded7c31 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.h +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.h @@ -73,11 +73,11 @@ public: int theCommandID, SMESH::SMESH_Mesh_ptr = SMESH::SMESH_Mesh::_nil() ); ~SMESHGUI_AdaptDlg(); - + virtual bool OnGUIEvent (int theCommandID); static QString GetDefaultName( const QString& ); - + public slots: void onAdd(); void onRemove(); @@ -89,31 +89,31 @@ private slots: void onTypeChanged( int ); void onGrpTypeChanged( int ); void onColorChanged( QColor ); - + void onOK(); bool onApply(); void onHelp(); void onDeactivate(); void onVisibilityChanged(); - + void onListSelectionChanged(); void onObjectSelectionChanged(); - + void onSelectAll(); void onSelectSubMesh( bool ); void onSelectGroup( bool ); void onSelectGeomGroup( bool ); void setCurrentSelection(); - + void setFilters(); void onSort(); - + void onNameChanged( const QString& ); void onFilterAccepted(); - + void onGeomPopup( QAction* ); void onGeomSelectionButton( bool ); - + void onPublishShapeByMeshDlg( SUIT_Operation* ); void onCloseShapeByMeshDlg( SUIT_Operation* ); @@ -134,10 +134,10 @@ private: void restoreShowEntityMode(); bool IsActorVisible( SMESH_Actor* ); - + void setGroupColor( const SALOMEDS::Color& ); SALOMEDS::Color getGroupColor() const; - + void setGroupQColor( const QColor& ); QColor getGroupQColor() const; void setDefaultName() const; @@ -155,16 +155,16 @@ private: int myStoredShownEntity; /* Store ShowEntity mode of myMesh */ QLineEdit* myCurrentLineEdit; /* Current LineEdit */ SVTK_Selector* mySelector; - + QPushButton* myMeshGroupBtn; QLineEdit* myMeshGroupLine; - + QButtonGroup* myTypeGroup; QLineEdit* myName; QString myOldName; - + QButtonGroup* myGrpTypeGroup; - + QStackedWidget* myWGStack; QCheckBox* mySelectAll; QCheckBox* myAllowElemsModif; @@ -174,7 +174,7 @@ private: QPushButton* myAddBtn; QPushButton* myRemoveBtn; QPushButton* mySortBtn; - + QGroupBox* mySelectBox; QCheckBox* mySelectSubMesh; QPushButton* mySubMeshBtn; @@ -182,9 +182,9 @@ private: QCheckBox* mySelectGroup; QPushButton* myGroupBtn; QLineEdit* myGroupLine; - + QtxColorButton* myColorBtn; - + QCheckBox* mySelectGeomGroup; QToolButton* myGeomGroupBtn; QLineEdit* myGeomGroupLine; @@ -194,9 +194,9 @@ private: QPushButton* myApplyBtn; QPushButton* myCloseBtn; QPushButton* myHelpBtn; - + SMESHGUI_ShapeByMeshOp* myShapeByMeshOp; - + SMESH::SMESH_Mesh_var myMesh; QList myActorsList; SMESH::SMESH_Group_var myGroup; @@ -205,7 +205,7 @@ private: SMESH::Filter_var myFilter; QList myIdList; GEOM::ListOfGO_var myGeomObjects; - + int mySelectionMode; //Handle(SMESH_TypeFilter) myMeshFilter; //Handle(SMESH_TypeFilter) mySubMeshFilter; @@ -214,13 +214,13 @@ private: SMESH_LogicalFilter* mySubMeshFilter; SMESH_LogicalFilter* myGroupFilter; SUIT_SelectionFilter* myGeomFilter; - + SMESHGUI_FilterDlg* myFilterDlg; - + bool myCreate, myIsBusy; - + QString myHelpFileName; - + QMap myActions; bool myNameChanged; //added by skl for IPAL19574 From d7dead847f752c5ada23c934916f60245378745c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Wed, 27 May 2020 17:01:52 +0200 Subject: [PATCH 026/100] includes des ui --- src/ADAPTGUI/ui_CreateBoundaryAn.h | 802 ++++++++++++++++++++++++ src/ADAPTGUI/ui_CreateBoundaryCAO.h | 158 +++++ src/ADAPTGUI/ui_CreateBoundaryDi.h | 158 +++++ src/ADAPTGUI/ui_CreateCase.h | 647 ++++++++++++++++++++ src/ADAPTGUI/ui_CreateHypothesis.h | 915 ++++++++++++++++++++++++++++ src/ADAPTGUI/ui_CreateIteration.h | 416 +++++++++++++ src/ADAPTGUI/ui_CreateListGroup.h | 148 +++++ src/ADAPTGUI/ui_CreateYACS.h | 445 ++++++++++++++ src/ADAPTGUI/ui_CreateZone.h | 806 ++++++++++++++++++++++++ src/ADAPTGUI/ui_EditFile.h | 121 ++++ src/ADAPTGUI/ui_IterInfo.h | 155 +++++ src/ADAPTGUI/ui_MeshInfo.h | 269 ++++++++ src/ADAPTGUI/ui_PursueIteration.h | 257 ++++++++ 13 files changed, 5297 insertions(+) create mode 100644 src/ADAPTGUI/ui_CreateBoundaryAn.h create mode 100644 src/ADAPTGUI/ui_CreateBoundaryCAO.h create mode 100644 src/ADAPTGUI/ui_CreateBoundaryDi.h create mode 100644 src/ADAPTGUI/ui_CreateCase.h create mode 100644 src/ADAPTGUI/ui_CreateHypothesis.h create mode 100644 src/ADAPTGUI/ui_CreateIteration.h create mode 100644 src/ADAPTGUI/ui_CreateListGroup.h create mode 100644 src/ADAPTGUI/ui_CreateYACS.h create mode 100644 src/ADAPTGUI/ui_CreateZone.h create mode 100644 src/ADAPTGUI/ui_EditFile.h create mode 100644 src/ADAPTGUI/ui_IterInfo.h create mode 100644 src/ADAPTGUI/ui_MeshInfo.h create mode 100644 src/ADAPTGUI/ui_PursueIteration.h diff --git a/src/ADAPTGUI/ui_CreateBoundaryAn.h b/src/ADAPTGUI/ui_CreateBoundaryAn.h new file mode 100644 index 000000000..b7e85dcaf --- /dev/null +++ b/src/ADAPTGUI/ui_CreateBoundaryAn.h @@ -0,0 +1,802 @@ +/******************************************************************************** +** Form generated from reading UI file 'CreateBoundaryAn.ui' +** +** Created by: Qt User Interface Compiler version 5.9.1 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_CREATEBOUNDARYAN_H +#define UI_CREATEBOUNDARYAN_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_CreateBoundaryAn +{ +public: + QGridLayout *gridLayout_5; + QLabel *Name; + QLineEdit *LEName; + QGroupBox *TypeBoundary; + QGridLayout *gridLayout; + QRadioButton *RBCylindre; + QRadioButton *RBSphere; + QRadioButton *RBCone; + QRadioButton *RBTore; + QGroupBox *gBCylindre; + QGridLayout *gridLayout1; + QDoubleSpinBox *SpinBox_Xcent; + QLabel *TLXcent; + QDoubleSpinBox *SpinBox_Radius; + QDoubleSpinBox *SpinBox_Zcent; + QLabel *TLradius; + QLabel *TLZcent; + QLabel *TLYcent; + QDoubleSpinBox *SpinBox_Ycent; + QLabel *TLXaxis; + QLabel *TLYaxis; + QLabel *TLZaxis; + QDoubleSpinBox *SpinBox_Zaxis; + QDoubleSpinBox *SpinBox_Yaxis; + QDoubleSpinBox *SpinBox_Xaxis; + QGroupBox *gBSphere; + QGridLayout *gridLayout2; + QDoubleSpinBox *SpinBox_Rayon; + QDoubleSpinBox *SpinBox_Zcentre; + QLabel *TLRayon; + QLabel *TLZcentre; + QLabel *TLYcentre; + QDoubleSpinBox *SpinBox_Ycentre; + QDoubleSpinBox *SpinBox_Xcentre; + QLabel *TLXcentre; + QGroupBox *gBCone; + QGridLayout *gridLayout_3; + QGroupBox *groupBox; + QGridLayout *gridLayout_2; + QRadioButton *RB_Def_radius; + QRadioButton *RB_Def_angle; + QLabel *TLCone_X1; + QDoubleSpinBox *SpinBox_Cone_X1; + QLabel *TLCone_X2; + QDoubleSpinBox *SpinBox_Cone_X2; + QLabel *TLCone_Y1; + QDoubleSpinBox *SpinBox_Cone_Y1; + QLabel *TLCone_Y2; + QDoubleSpinBox *SpinBox_Cone_Y2; + QLabel *TLCone_Z1; + QDoubleSpinBox *SpinBox_Cone_Z1; + QLabel *TLCone_Z2; + QDoubleSpinBox *SpinBox_Cone_Z2; + QLabel *TLCone_V1; + QDoubleSpinBox *SpinBox_Cone_V1; + QLabel *TLCone_V2; + QDoubleSpinBox *SpinBox_Cone_V2; + QGroupBox *gBTore; + QGridLayout *gridLayout_4; + QLabel *TLToreXcent; + QDoubleSpinBox *SpinBoxToreXcent; + QLabel *TLToreXaxe; + QDoubleSpinBox *SpinBoxToreXaxe; + QLabel *TLToreYcent; + QDoubleSpinBox *SpinBoxToreYcent; + QLabel *TLToreYaxe; + QDoubleSpinBox *SpinBoxToreYaxe; + QLabel *TLToreZcent; + QDoubleSpinBox *SpinBoxToreZcent; + QLabel *TLToreZaxe; + QDoubleSpinBox *SpinBoxToreZaxe; + QLabel *TLToreRayRev; + QDoubleSpinBox *SpinBoxToreRRev; + QLabel *TLToreRayPri; + QDoubleSpinBox *SpinBoxToreRPri; + QGroupBox *GBButtons; + QGridLayout *gridLayout3; + QPushButton *buttonHelp; + QPushButton *buttonCancel; + QPushButton *buttonApply; + QPushButton *buttonOk; + + void setupUi(QDialog *CreateBoundaryAn) + { + if (CreateBoundaryAn->objectName().isEmpty()) + CreateBoundaryAn->setObjectName(QStringLiteral("CreateBoundaryAn")); + CreateBoundaryAn->resize(522, 835); + CreateBoundaryAn->setAutoFillBackground(true); + CreateBoundaryAn->setSizeGripEnabled(true); + gridLayout_5 = new QGridLayout(CreateBoundaryAn); + gridLayout_5->setObjectName(QStringLiteral("gridLayout_5")); + Name = new QLabel(CreateBoundaryAn); + Name->setObjectName(QStringLiteral("Name")); + + gridLayout_5->addWidget(Name, 0, 0, 1, 1); + + LEName = new QLineEdit(CreateBoundaryAn); + LEName->setObjectName(QStringLiteral("LEName")); + LEName->setMaxLength(32); + + gridLayout_5->addWidget(LEName, 0, 1, 1, 1); + + TypeBoundary = new QGroupBox(CreateBoundaryAn); + TypeBoundary->setObjectName(QStringLiteral("TypeBoundary")); + QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(TypeBoundary->sizePolicy().hasHeightForWidth()); + TypeBoundary->setSizePolicy(sizePolicy); + TypeBoundary->setMinimumSize(QSize(340, 0)); + gridLayout = new QGridLayout(TypeBoundary); + gridLayout->setObjectName(QStringLiteral("gridLayout")); + RBCylindre = new QRadioButton(TypeBoundary); + RBCylindre->setObjectName(QStringLiteral("RBCylindre")); + QIcon icon; + icon.addFile(QStringLiteral("../../resources/cylinderpointvector.png"), QSize(), QIcon::Normal, QIcon::Off); + RBCylindre->setIcon(icon); + RBCylindre->setCheckable(true); + RBCylindre->setChecked(true); + + gridLayout->addWidget(RBCylindre, 0, 0, 1, 1); + + RBSphere = new QRadioButton(TypeBoundary); + RBSphere->setObjectName(QStringLiteral("RBSphere")); + QIcon icon1; + icon1.addFile(QStringLiteral("../../resources/zone_spherepoint.png"), QSize(), QIcon::Normal, QIcon::Off); + RBSphere->setIcon(icon1); + + gridLayout->addWidget(RBSphere, 0, 1, 1, 1); + + RBCone = new QRadioButton(TypeBoundary); + RBCone->setObjectName(QStringLiteral("RBCone")); + QIcon icon2; + icon2.addFile(QStringLiteral("../../resources/cone.png"), QSize(), QIcon::Normal, QIcon::Off); + RBCone->setIcon(icon2); + + gridLayout->addWidget(RBCone, 0, 2, 1, 1); + + RBTore = new QRadioButton(TypeBoundary); + RBTore->setObjectName(QStringLiteral("RBTore")); + QIcon icon3; + icon3.addFile(QStringLiteral("../../resources/toruspointvector.png"), QSize(), QIcon::Normal, QIcon::Off); + RBTore->setIcon(icon3); + RBTore->setCheckable(true); + RBTore->setChecked(false); + + gridLayout->addWidget(RBTore, 0, 3, 1, 1); + + + gridLayout_5->addWidget(TypeBoundary, 1, 0, 1, 2); + + gBCylindre = new QGroupBox(CreateBoundaryAn); + gBCylindre->setObjectName(QStringLiteral("gBCylindre")); + sizePolicy.setHeightForWidth(gBCylindre->sizePolicy().hasHeightForWidth()); + gBCylindre->setSizePolicy(sizePolicy); + gridLayout1 = new QGridLayout(gBCylindre); +#ifndef Q_OS_MAC + gridLayout1->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout1->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); + SpinBox_Xcent = new QDoubleSpinBox(gBCylindre); + SpinBox_Xcent->setObjectName(QStringLiteral("SpinBox_Xcent")); + SpinBox_Xcent->setDecimals(5); + SpinBox_Xcent->setMinimum(-1e+9); + SpinBox_Xcent->setMaximum(1e+9); + SpinBox_Xcent->setValue(0); + + gridLayout1->addWidget(SpinBox_Xcent, 0, 1, 1, 1); + + TLXcent = new QLabel(gBCylindre); + TLXcent->setObjectName(QStringLiteral("TLXcent")); + sizePolicy.setHeightForWidth(TLXcent->sizePolicy().hasHeightForWidth()); + TLXcent->setSizePolicy(sizePolicy); + TLXcent->setWordWrap(false); + + gridLayout1->addWidget(TLXcent, 0, 0, 1, 1); + + SpinBox_Radius = new QDoubleSpinBox(gBCylindre); + SpinBox_Radius->setObjectName(QStringLiteral("SpinBox_Radius")); + SpinBox_Radius->setDecimals(5); + SpinBox_Radius->setMaximum(1e+9); + + gridLayout1->addWidget(SpinBox_Radius, 3, 1, 1, 2); + + SpinBox_Zcent = new QDoubleSpinBox(gBCylindre); + SpinBox_Zcent->setObjectName(QStringLiteral("SpinBox_Zcent")); + SpinBox_Zcent->setDecimals(5); + SpinBox_Zcent->setMinimum(-1e+9); + SpinBox_Zcent->setMaximum(1e+9); + SpinBox_Zcent->setValue(0); + + gridLayout1->addWidget(SpinBox_Zcent, 2, 1, 1, 1); + + TLradius = new QLabel(gBCylindre); + TLradius->setObjectName(QStringLiteral("TLradius")); + sizePolicy.setHeightForWidth(TLradius->sizePolicy().hasHeightForWidth()); + TLradius->setSizePolicy(sizePolicy); + TLradius->setWordWrap(false); + + gridLayout1->addWidget(TLradius, 3, 0, 1, 1); + + TLZcent = new QLabel(gBCylindre); + TLZcent->setObjectName(QStringLiteral("TLZcent")); + sizePolicy.setHeightForWidth(TLZcent->sizePolicy().hasHeightForWidth()); + TLZcent->setSizePolicy(sizePolicy); + TLZcent->setWordWrap(false); + + gridLayout1->addWidget(TLZcent, 2, 0, 1, 1); + + TLYcent = new QLabel(gBCylindre); + TLYcent->setObjectName(QStringLiteral("TLYcent")); + sizePolicy.setHeightForWidth(TLYcent->sizePolicy().hasHeightForWidth()); + TLYcent->setSizePolicy(sizePolicy); + TLYcent->setWordWrap(false); + + gridLayout1->addWidget(TLYcent, 1, 0, 1, 1); + + SpinBox_Ycent = new QDoubleSpinBox(gBCylindre); + SpinBox_Ycent->setObjectName(QStringLiteral("SpinBox_Ycent")); + SpinBox_Ycent->setDecimals(5); + SpinBox_Ycent->setMinimum(-1e+9); + SpinBox_Ycent->setMaximum(1e+9); + SpinBox_Ycent->setValue(0); + + gridLayout1->addWidget(SpinBox_Ycent, 1, 1, 1, 1); + + TLXaxis = new QLabel(gBCylindre); + TLXaxis->setObjectName(QStringLiteral("TLXaxis")); + sizePolicy.setHeightForWidth(TLXaxis->sizePolicy().hasHeightForWidth()); + TLXaxis->setSizePolicy(sizePolicy); + TLXaxis->setWordWrap(false); + + gridLayout1->addWidget(TLXaxis, 0, 2, 1, 1); + + TLYaxis = new QLabel(gBCylindre); + TLYaxis->setObjectName(QStringLiteral("TLYaxis")); + sizePolicy.setHeightForWidth(TLYaxis->sizePolicy().hasHeightForWidth()); + TLYaxis->setSizePolicy(sizePolicy); + TLYaxis->setWordWrap(false); + + gridLayout1->addWidget(TLYaxis, 1, 2, 1, 1); + + TLZaxis = new QLabel(gBCylindre); + TLZaxis->setObjectName(QStringLiteral("TLZaxis")); + sizePolicy.setHeightForWidth(TLZaxis->sizePolicy().hasHeightForWidth()); + TLZaxis->setSizePolicy(sizePolicy); + TLZaxis->setWordWrap(false); + + gridLayout1->addWidget(TLZaxis, 2, 2, 1, 1); + + SpinBox_Zaxis = new QDoubleSpinBox(gBCylindre); + SpinBox_Zaxis->setObjectName(QStringLiteral("SpinBox_Zaxis")); + SpinBox_Zaxis->setDecimals(5); + SpinBox_Zaxis->setMinimum(-1e+9); + SpinBox_Zaxis->setMaximum(1e+9); + SpinBox_Zaxis->setValue(0); + + gridLayout1->addWidget(SpinBox_Zaxis, 2, 3, 1, 1); + + SpinBox_Yaxis = new QDoubleSpinBox(gBCylindre); + SpinBox_Yaxis->setObjectName(QStringLiteral("SpinBox_Yaxis")); + SpinBox_Yaxis->setDecimals(5); + SpinBox_Yaxis->setMinimum(-1e+9); + SpinBox_Yaxis->setMaximum(1e+9); + SpinBox_Yaxis->setValue(0); + + gridLayout1->addWidget(SpinBox_Yaxis, 1, 3, 1, 1); + + SpinBox_Xaxis = new QDoubleSpinBox(gBCylindre); + SpinBox_Xaxis->setObjectName(QStringLiteral("SpinBox_Xaxis")); + SpinBox_Xaxis->setDecimals(5); + SpinBox_Xaxis->setMinimum(-1e+9); + SpinBox_Xaxis->setMaximum(1e+9); + SpinBox_Xaxis->setValue(0); + + gridLayout1->addWidget(SpinBox_Xaxis, 0, 3, 1, 1); + + + gridLayout_5->addWidget(gBCylindre, 2, 0, 1, 2); + + gBSphere = new QGroupBox(CreateBoundaryAn); + gBSphere->setObjectName(QStringLiteral("gBSphere")); + sizePolicy.setHeightForWidth(gBSphere->sizePolicy().hasHeightForWidth()); + gBSphere->setSizePolicy(sizePolicy); + gridLayout2 = new QGridLayout(gBSphere); +#ifndef Q_OS_MAC + gridLayout2->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout2->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout2->setObjectName(QStringLiteral("gridLayout2")); + SpinBox_Rayon = new QDoubleSpinBox(gBSphere); + SpinBox_Rayon->setObjectName(QStringLiteral("SpinBox_Rayon")); + SpinBox_Rayon->setDecimals(5); + SpinBox_Rayon->setMinimum(0); + SpinBox_Rayon->setMaximum(1e+9); + SpinBox_Rayon->setValue(0); + + gridLayout2->addWidget(SpinBox_Rayon, 1, 3, 1, 1); + + SpinBox_Zcentre = new QDoubleSpinBox(gBSphere); + SpinBox_Zcentre->setObjectName(QStringLiteral("SpinBox_Zcentre")); + SpinBox_Zcentre->setDecimals(5); + SpinBox_Zcentre->setMinimum(-1e+9); + SpinBox_Zcentre->setMaximum(1e+9); + SpinBox_Zcentre->setValue(0); + + gridLayout2->addWidget(SpinBox_Zcentre, 2, 1, 1, 1); + + TLRayon = new QLabel(gBSphere); + TLRayon->setObjectName(QStringLiteral("TLRayon")); + sizePolicy.setHeightForWidth(TLRayon->sizePolicy().hasHeightForWidth()); + TLRayon->setSizePolicy(sizePolicy); + TLRayon->setWordWrap(false); + + gridLayout2->addWidget(TLRayon, 1, 2, 1, 1); + + TLZcentre = new QLabel(gBSphere); + TLZcentre->setObjectName(QStringLiteral("TLZcentre")); + sizePolicy.setHeightForWidth(TLZcentre->sizePolicy().hasHeightForWidth()); + TLZcentre->setSizePolicy(sizePolicy); + TLZcentre->setWordWrap(false); + + gridLayout2->addWidget(TLZcentre, 2, 0, 1, 1); + + TLYcentre = new QLabel(gBSphere); + TLYcentre->setObjectName(QStringLiteral("TLYcentre")); + sizePolicy.setHeightForWidth(TLYcentre->sizePolicy().hasHeightForWidth()); + TLYcentre->setSizePolicy(sizePolicy); + TLYcentre->setWordWrap(false); + + gridLayout2->addWidget(TLYcentre, 1, 0, 1, 1); + + SpinBox_Ycentre = new QDoubleSpinBox(gBSphere); + SpinBox_Ycentre->setObjectName(QStringLiteral("SpinBox_Ycentre")); + SpinBox_Ycentre->setDecimals(5); + SpinBox_Ycentre->setMinimum(-1e+9); + SpinBox_Ycentre->setMaximum(1e+9); + SpinBox_Ycentre->setValue(0); + + gridLayout2->addWidget(SpinBox_Ycentre, 1, 1, 1, 1); + + SpinBox_Xcentre = new QDoubleSpinBox(gBSphere); + SpinBox_Xcentre->setObjectName(QStringLiteral("SpinBox_Xcentre")); + SpinBox_Xcentre->setDecimals(5); + SpinBox_Xcentre->setMinimum(-1e+9); + SpinBox_Xcentre->setMaximum(1e+9); + SpinBox_Xcentre->setValue(0); + + gridLayout2->addWidget(SpinBox_Xcentre, 0, 1, 1, 1); + + TLXcentre = new QLabel(gBSphere); + TLXcentre->setObjectName(QStringLiteral("TLXcentre")); + sizePolicy.setHeightForWidth(TLXcentre->sizePolicy().hasHeightForWidth()); + TLXcentre->setSizePolicy(sizePolicy); + TLXcentre->setWordWrap(false); + + gridLayout2->addWidget(TLXcentre, 0, 0, 1, 1); + + + gridLayout_5->addWidget(gBSphere, 3, 0, 1, 2); + + gBCone = new QGroupBox(CreateBoundaryAn); + gBCone->setObjectName(QStringLiteral("gBCone")); + sizePolicy.setHeightForWidth(gBCone->sizePolicy().hasHeightForWidth()); + gBCone->setSizePolicy(sizePolicy); + gridLayout_3 = new QGridLayout(gBCone); + gridLayout_3->setObjectName(QStringLiteral("gridLayout_3")); + groupBox = new QGroupBox(gBCone); + groupBox->setObjectName(QStringLiteral("groupBox")); + gridLayout_2 = new QGridLayout(groupBox); + gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); + RB_Def_radius = new QRadioButton(groupBox); + RB_Def_radius->setObjectName(QStringLiteral("RB_Def_radius")); + QIcon icon4; + icon4.addFile(QStringLiteral("../../resources/conedxyz.png"), QSize(), QIcon::Normal, QIcon::Off); + RB_Def_radius->setIcon(icon4); + RB_Def_radius->setChecked(true); + + gridLayout_2->addWidget(RB_Def_radius, 0, 0, 1, 1); + + RB_Def_angle = new QRadioButton(groupBox); + RB_Def_angle->setObjectName(QStringLiteral("RB_Def_angle")); + QIcon icon5; + icon5.addFile(QStringLiteral("../../resources/conepointvector.png"), QSize(), QIcon::Normal, QIcon::Off); + RB_Def_angle->setIcon(icon5); + + gridLayout_2->addWidget(RB_Def_angle, 0, 1, 1, 1); + + + gridLayout_3->addWidget(groupBox, 0, 0, 1, 2); + + TLCone_X1 = new QLabel(gBCone); + TLCone_X1->setObjectName(QStringLiteral("TLCone_X1")); + sizePolicy.setHeightForWidth(TLCone_X1->sizePolicy().hasHeightForWidth()); + TLCone_X1->setSizePolicy(sizePolicy); + TLCone_X1->setWordWrap(false); + + gridLayout_3->addWidget(TLCone_X1, 1, 0, 1, 1); + + SpinBox_Cone_X1 = new QDoubleSpinBox(gBCone); + SpinBox_Cone_X1->setObjectName(QStringLiteral("SpinBox_Cone_X1")); + SpinBox_Cone_X1->setDecimals(5); + SpinBox_Cone_X1->setMinimum(-1e+9); + SpinBox_Cone_X1->setMaximum(1e+9); + SpinBox_Cone_X1->setValue(0); + + gridLayout_3->addWidget(SpinBox_Cone_X1, 1, 1, 1, 1); + + TLCone_X2 = new QLabel(gBCone); + TLCone_X2->setObjectName(QStringLiteral("TLCone_X2")); + sizePolicy.setHeightForWidth(TLCone_X2->sizePolicy().hasHeightForWidth()); + TLCone_X2->setSizePolicy(sizePolicy); + TLCone_X2->setWordWrap(false); + + gridLayout_3->addWidget(TLCone_X2, 1, 2, 1, 1); + + SpinBox_Cone_X2 = new QDoubleSpinBox(gBCone); + SpinBox_Cone_X2->setObjectName(QStringLiteral("SpinBox_Cone_X2")); + SpinBox_Cone_X2->setDecimals(5); + SpinBox_Cone_X2->setMinimum(-1e+9); + SpinBox_Cone_X2->setMaximum(1e+9); + SpinBox_Cone_X2->setValue(0); + + gridLayout_3->addWidget(SpinBox_Cone_X2, 1, 3, 1, 1); + + TLCone_Y1 = new QLabel(gBCone); + TLCone_Y1->setObjectName(QStringLiteral("TLCone_Y1")); + sizePolicy.setHeightForWidth(TLCone_Y1->sizePolicy().hasHeightForWidth()); + TLCone_Y1->setSizePolicy(sizePolicy); + TLCone_Y1->setWordWrap(false); + + gridLayout_3->addWidget(TLCone_Y1, 2, 0, 1, 1); + + SpinBox_Cone_Y1 = new QDoubleSpinBox(gBCone); + SpinBox_Cone_Y1->setObjectName(QStringLiteral("SpinBox_Cone_Y1")); + SpinBox_Cone_Y1->setDecimals(5); + SpinBox_Cone_Y1->setMinimum(-1e+9); + SpinBox_Cone_Y1->setMaximum(1e+9); + SpinBox_Cone_Y1->setValue(0); + + gridLayout_3->addWidget(SpinBox_Cone_Y1, 2, 1, 1, 1); + + TLCone_Y2 = new QLabel(gBCone); + TLCone_Y2->setObjectName(QStringLiteral("TLCone_Y2")); + sizePolicy.setHeightForWidth(TLCone_Y2->sizePolicy().hasHeightForWidth()); + TLCone_Y2->setSizePolicy(sizePolicy); + TLCone_Y2->setWordWrap(false); + + gridLayout_3->addWidget(TLCone_Y2, 2, 2, 1, 1); + + SpinBox_Cone_Y2 = new QDoubleSpinBox(gBCone); + SpinBox_Cone_Y2->setObjectName(QStringLiteral("SpinBox_Cone_Y2")); + SpinBox_Cone_Y2->setDecimals(5); + SpinBox_Cone_Y2->setMinimum(-1e+9); + SpinBox_Cone_Y2->setMaximum(1e+9); + SpinBox_Cone_Y2->setValue(0); + + gridLayout_3->addWidget(SpinBox_Cone_Y2, 2, 3, 1, 1); + + TLCone_Z1 = new QLabel(gBCone); + TLCone_Z1->setObjectName(QStringLiteral("TLCone_Z1")); + sizePolicy.setHeightForWidth(TLCone_Z1->sizePolicy().hasHeightForWidth()); + TLCone_Z1->setSizePolicy(sizePolicy); + TLCone_Z1->setWordWrap(false); + + gridLayout_3->addWidget(TLCone_Z1, 3, 0, 1, 1); + + SpinBox_Cone_Z1 = new QDoubleSpinBox(gBCone); + SpinBox_Cone_Z1->setObjectName(QStringLiteral("SpinBox_Cone_Z1")); + SpinBox_Cone_Z1->setDecimals(5); + SpinBox_Cone_Z1->setMinimum(-1e+9); + SpinBox_Cone_Z1->setMaximum(1e+9); + SpinBox_Cone_Z1->setValue(0); + + gridLayout_3->addWidget(SpinBox_Cone_Z1, 3, 1, 1, 1); + + TLCone_Z2 = new QLabel(gBCone); + TLCone_Z2->setObjectName(QStringLiteral("TLCone_Z2")); + sizePolicy.setHeightForWidth(TLCone_Z2->sizePolicy().hasHeightForWidth()); + TLCone_Z2->setSizePolicy(sizePolicy); + TLCone_Z2->setWordWrap(false); + + gridLayout_3->addWidget(TLCone_Z2, 3, 2, 1, 1); + + SpinBox_Cone_Z2 = new QDoubleSpinBox(gBCone); + SpinBox_Cone_Z2->setObjectName(QStringLiteral("SpinBox_Cone_Z2")); + SpinBox_Cone_Z2->setDecimals(5); + SpinBox_Cone_Z2->setMinimum(-1e+9); + SpinBox_Cone_Z2->setMaximum(1e+9); + SpinBox_Cone_Z2->setValue(0); + + gridLayout_3->addWidget(SpinBox_Cone_Z2, 3, 3, 1, 1); + + TLCone_V1 = new QLabel(gBCone); + TLCone_V1->setObjectName(QStringLiteral("TLCone_V1")); + sizePolicy.setHeightForWidth(TLCone_V1->sizePolicy().hasHeightForWidth()); + TLCone_V1->setSizePolicy(sizePolicy); + TLCone_V1->setWordWrap(false); + + gridLayout_3->addWidget(TLCone_V1, 4, 0, 1, 1); + + SpinBox_Cone_V1 = new QDoubleSpinBox(gBCone); + SpinBox_Cone_V1->setObjectName(QStringLiteral("SpinBox_Cone_V1")); + SpinBox_Cone_V1->setDecimals(5); + SpinBox_Cone_V1->setMaximum(1e+9); + + gridLayout_3->addWidget(SpinBox_Cone_V1, 4, 1, 1, 1); + + TLCone_V2 = new QLabel(gBCone); + TLCone_V2->setObjectName(QStringLiteral("TLCone_V2")); + sizePolicy.setHeightForWidth(TLCone_V2->sizePolicy().hasHeightForWidth()); + TLCone_V2->setSizePolicy(sizePolicy); + TLCone_V2->setWordWrap(false); + + gridLayout_3->addWidget(TLCone_V2, 4, 2, 1, 1); + + SpinBox_Cone_V2 = new QDoubleSpinBox(gBCone); + SpinBox_Cone_V2->setObjectName(QStringLiteral("SpinBox_Cone_V2")); + SpinBox_Cone_V2->setDecimals(5); + SpinBox_Cone_V2->setMaximum(1e+9); + + gridLayout_3->addWidget(SpinBox_Cone_V2, 4, 3, 1, 1); + + + gridLayout_5->addWidget(gBCone, 4, 0, 1, 2); + + gBTore = new QGroupBox(CreateBoundaryAn); + gBTore->setObjectName(QStringLiteral("gBTore")); + sizePolicy.setHeightForWidth(gBTore->sizePolicy().hasHeightForWidth()); + gBTore->setSizePolicy(sizePolicy); + gridLayout_4 = new QGridLayout(gBTore); + gridLayout_4->setObjectName(QStringLiteral("gridLayout_4")); + TLToreXcent = new QLabel(gBTore); + TLToreXcent->setObjectName(QStringLiteral("TLToreXcent")); + sizePolicy.setHeightForWidth(TLToreXcent->sizePolicy().hasHeightForWidth()); + TLToreXcent->setSizePolicy(sizePolicy); + TLToreXcent->setWordWrap(false); + + gridLayout_4->addWidget(TLToreXcent, 0, 0, 1, 1); + + SpinBoxToreXcent = new QDoubleSpinBox(gBTore); + SpinBoxToreXcent->setObjectName(QStringLiteral("SpinBoxToreXcent")); + SpinBoxToreXcent->setDecimals(5); + SpinBoxToreXcent->setMinimum(-1e+9); + SpinBoxToreXcent->setMaximum(1e+9); + SpinBoxToreXcent->setValue(0); + + gridLayout_4->addWidget(SpinBoxToreXcent, 0, 1, 1, 1); + + TLToreXaxe = new QLabel(gBTore); + TLToreXaxe->setObjectName(QStringLiteral("TLToreXaxe")); + sizePolicy.setHeightForWidth(TLToreXaxe->sizePolicy().hasHeightForWidth()); + TLToreXaxe->setSizePolicy(sizePolicy); + TLToreXaxe->setWordWrap(false); + + gridLayout_4->addWidget(TLToreXaxe, 0, 2, 1, 1); + + SpinBoxToreXaxe = new QDoubleSpinBox(gBTore); + SpinBoxToreXaxe->setObjectName(QStringLiteral("SpinBoxToreXaxe")); + SpinBoxToreXaxe->setDecimals(5); + SpinBoxToreXaxe->setMinimum(-1e+9); + SpinBoxToreXaxe->setMaximum(1e+9); + SpinBoxToreXaxe->setValue(0); + + gridLayout_4->addWidget(SpinBoxToreXaxe, 0, 3, 1, 1); + + TLToreYcent = new QLabel(gBTore); + TLToreYcent->setObjectName(QStringLiteral("TLToreYcent")); + sizePolicy.setHeightForWidth(TLToreYcent->sizePolicy().hasHeightForWidth()); + TLToreYcent->setSizePolicy(sizePolicy); + TLToreYcent->setWordWrap(false); + + gridLayout_4->addWidget(TLToreYcent, 1, 0, 1, 1); + + SpinBoxToreYcent = new QDoubleSpinBox(gBTore); + SpinBoxToreYcent->setObjectName(QStringLiteral("SpinBoxToreYcent")); + SpinBoxToreYcent->setDecimals(5); + SpinBoxToreYcent->setMinimum(-1e+9); + SpinBoxToreYcent->setMaximum(1e+9); + SpinBoxToreYcent->setValue(0); + + gridLayout_4->addWidget(SpinBoxToreYcent, 1, 1, 1, 1); + + TLToreYaxe = new QLabel(gBTore); + TLToreYaxe->setObjectName(QStringLiteral("TLToreYaxe")); + sizePolicy.setHeightForWidth(TLToreYaxe->sizePolicy().hasHeightForWidth()); + TLToreYaxe->setSizePolicy(sizePolicy); + TLToreYaxe->setWordWrap(false); + + gridLayout_4->addWidget(TLToreYaxe, 1, 2, 1, 1); + + SpinBoxToreYaxe = new QDoubleSpinBox(gBTore); + SpinBoxToreYaxe->setObjectName(QStringLiteral("SpinBoxToreYaxe")); + SpinBoxToreYaxe->setDecimals(5); + SpinBoxToreYaxe->setMinimum(-1e+9); + SpinBoxToreYaxe->setMaximum(1e+9); + SpinBoxToreYaxe->setValue(0); + + gridLayout_4->addWidget(SpinBoxToreYaxe, 1, 3, 1, 1); + + TLToreZcent = new QLabel(gBTore); + TLToreZcent->setObjectName(QStringLiteral("TLToreZcent")); + sizePolicy.setHeightForWidth(TLToreZcent->sizePolicy().hasHeightForWidth()); + TLToreZcent->setSizePolicy(sizePolicy); + TLToreZcent->setWordWrap(false); + + gridLayout_4->addWidget(TLToreZcent, 2, 0, 1, 1); + + SpinBoxToreZcent = new QDoubleSpinBox(gBTore); + SpinBoxToreZcent->setObjectName(QStringLiteral("SpinBoxToreZcent")); + SpinBoxToreZcent->setDecimals(5); + SpinBoxToreZcent->setMinimum(-1e+9); + SpinBoxToreZcent->setMaximum(1e+9); + SpinBoxToreZcent->setValue(0); + + gridLayout_4->addWidget(SpinBoxToreZcent, 2, 1, 1, 1); + + TLToreZaxe = new QLabel(gBTore); + TLToreZaxe->setObjectName(QStringLiteral("TLToreZaxe")); + sizePolicy.setHeightForWidth(TLToreZaxe->sizePolicy().hasHeightForWidth()); + TLToreZaxe->setSizePolicy(sizePolicy); + TLToreZaxe->setWordWrap(false); + + gridLayout_4->addWidget(TLToreZaxe, 2, 2, 1, 1); + + SpinBoxToreZaxe = new QDoubleSpinBox(gBTore); + SpinBoxToreZaxe->setObjectName(QStringLiteral("SpinBoxToreZaxe")); + SpinBoxToreZaxe->setDecimals(5); + SpinBoxToreZaxe->setMinimum(-1e+9); + SpinBoxToreZaxe->setMaximum(1e+9); + SpinBoxToreZaxe->setValue(0); + + gridLayout_4->addWidget(SpinBoxToreZaxe, 2, 3, 1, 1); + + TLToreRayRev = new QLabel(gBTore); + TLToreRayRev->setObjectName(QStringLiteral("TLToreRayRev")); + sizePolicy.setHeightForWidth(TLToreRayRev->sizePolicy().hasHeightForWidth()); + TLToreRayRev->setSizePolicy(sizePolicy); + TLToreRayRev->setWordWrap(false); + + gridLayout_4->addWidget(TLToreRayRev, 3, 0, 1, 1); + + SpinBoxToreRRev = new QDoubleSpinBox(gBTore); + SpinBoxToreRRev->setObjectName(QStringLiteral("SpinBoxToreRRev")); + SpinBoxToreRRev->setDecimals(5); + SpinBoxToreRRev->setMaximum(1e+9); + + gridLayout_4->addWidget(SpinBoxToreRRev, 3, 1, 1, 1); + + TLToreRayPri = new QLabel(gBTore); + TLToreRayPri->setObjectName(QStringLiteral("TLToreRayPri")); + sizePolicy.setHeightForWidth(TLToreRayPri->sizePolicy().hasHeightForWidth()); + TLToreRayPri->setSizePolicy(sizePolicy); + TLToreRayPri->setWordWrap(false); + + gridLayout_4->addWidget(TLToreRayPri, 3, 2, 1, 1); + + SpinBoxToreRPri = new QDoubleSpinBox(gBTore); + SpinBoxToreRPri->setObjectName(QStringLiteral("SpinBoxToreRPri")); + SpinBoxToreRPri->setDecimals(5); + SpinBoxToreRPri->setMaximum(1e+9); + + gridLayout_4->addWidget(SpinBoxToreRPri, 3, 3, 1, 1); + + + gridLayout_5->addWidget(gBTore, 5, 0, 1, 2); + + GBButtons = new QGroupBox(CreateBoundaryAn); + GBButtons->setObjectName(QStringLiteral("GBButtons")); + sizePolicy.setHeightForWidth(GBButtons->sizePolicy().hasHeightForWidth()); + GBButtons->setSizePolicy(sizePolicy); + gridLayout3 = new QGridLayout(GBButtons); +#ifndef Q_OS_MAC + gridLayout3->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout3->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout3->setObjectName(QStringLiteral("gridLayout3")); + buttonHelp = new QPushButton(GBButtons); + buttonHelp->setObjectName(QStringLiteral("buttonHelp")); + + gridLayout3->addWidget(buttonHelp, 0, 3, 1, 1); + + buttonCancel = new QPushButton(GBButtons); + buttonCancel->setObjectName(QStringLiteral("buttonCancel")); + + gridLayout3->addWidget(buttonCancel, 0, 2, 1, 1); + + buttonApply = new QPushButton(GBButtons); + buttonApply->setObjectName(QStringLiteral("buttonApply")); + + gridLayout3->addWidget(buttonApply, 0, 1, 1, 1); + + buttonOk = new QPushButton(GBButtons); + buttonOk->setObjectName(QStringLiteral("buttonOk")); + + gridLayout3->addWidget(buttonOk, 0, 0, 1, 1); + + + gridLayout_5->addWidget(GBButtons, 6, 0, 1, 2); + + + retranslateUi(CreateBoundaryAn); + + QMetaObject::connectSlotsByName(CreateBoundaryAn); + } // setupUi + + void retranslateUi(QDialog *CreateBoundaryAn) + { + CreateBoundaryAn->setWindowTitle(QApplication::translate("CreateBoundaryAn", "Create an analytical boundary", Q_NULLPTR)); + Name->setText(QApplication::translate("CreateBoundaryAn", "Name", Q_NULLPTR)); + TypeBoundary->setTitle(QApplication::translate("CreateBoundaryAn", "Type of boundary", Q_NULLPTR)); + RBCylindre->setText(QApplication::translate("CreateBoundaryAn", "Cylinder", Q_NULLPTR)); + RBSphere->setText(QApplication::translate("CreateBoundaryAn", "Sphere", Q_NULLPTR)); + RBCone->setText(QApplication::translate("CreateBoundaryAn", "Cone", Q_NULLPTR)); + RBTore->setText(QApplication::translate("CreateBoundaryAn", "Torus", Q_NULLPTR)); + gBCylindre->setTitle(QApplication::translate("CreateBoundaryAn", "Coordinates", Q_NULLPTR)); + TLXcent->setText(QApplication::translate("CreateBoundaryAn", "X centre", Q_NULLPTR)); + TLradius->setText(QApplication::translate("CreateBoundaryAn", "Radius", Q_NULLPTR)); + TLZcent->setText(QApplication::translate("CreateBoundaryAn", "Z centre", Q_NULLPTR)); + TLYcent->setText(QApplication::translate("CreateBoundaryAn", "Y centre", Q_NULLPTR)); + TLXaxis->setText(QApplication::translate("CreateBoundaryAn", "X axis", Q_NULLPTR)); + TLYaxis->setText(QApplication::translate("CreateBoundaryAn", "Y axis", Q_NULLPTR)); + TLZaxis->setText(QApplication::translate("CreateBoundaryAn", "Z axis", Q_NULLPTR)); + gBSphere->setTitle(QApplication::translate("CreateBoundaryAn", "Coordinates", Q_NULLPTR)); + TLRayon->setText(QApplication::translate("CreateBoundaryAn", "Radius", Q_NULLPTR)); + TLZcentre->setText(QApplication::translate("CreateBoundaryAn", "Z centre", Q_NULLPTR)); + TLYcentre->setText(QApplication::translate("CreateBoundaryAn", "Y centre", Q_NULLPTR)); + TLXcentre->setText(QApplication::translate("CreateBoundaryAn", "X centre", Q_NULLPTR)); + gBCone->setTitle(QApplication::translate("CreateBoundaryAn", "Coordinates", Q_NULLPTR)); + groupBox->setTitle(QApplication::translate("CreateBoundaryAn", "Definition", Q_NULLPTR)); + RB_Def_radius->setText(QApplication::translate("CreateBoundaryAn", "Radius", Q_NULLPTR)); + RB_Def_angle->setText(QApplication::translate("CreateBoundaryAn", "Angle", Q_NULLPTR)); + TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X 1", Q_NULLPTR)); + TLCone_X2->setText(QApplication::translate("CreateBoundaryAn", "X 2", Q_NULLPTR)); + TLCone_Y1->setText(QApplication::translate("CreateBoundaryAn", "Y 1", Q_NULLPTR)); + TLCone_Y2->setText(QApplication::translate("CreateBoundaryAn", "Y 2", Q_NULLPTR)); + TLCone_Z1->setText(QApplication::translate("CreateBoundaryAn", "Z 1", Q_NULLPTR)); + TLCone_Z2->setText(QApplication::translate("CreateBoundaryAn", "Z 2", Q_NULLPTR)); + TLCone_V1->setText(QApplication::translate("CreateBoundaryAn", "V 1", Q_NULLPTR)); + TLCone_V2->setText(QApplication::translate("CreateBoundaryAn", "V 2", Q_NULLPTR)); + gBTore->setTitle(QApplication::translate("CreateBoundaryAn", "Coordinates", Q_NULLPTR)); + TLToreXcent->setText(QApplication::translate("CreateBoundaryAn", "X centre", Q_NULLPTR)); + TLToreXaxe->setText(QApplication::translate("CreateBoundaryAn", "X axis", Q_NULLPTR)); + TLToreYcent->setText(QApplication::translate("CreateBoundaryAn", "Y centre", Q_NULLPTR)); + TLToreYaxe->setText(QApplication::translate("CreateBoundaryAn", "Y axis", Q_NULLPTR)); + TLToreZcent->setText(QApplication::translate("CreateBoundaryAn", "Z centre", Q_NULLPTR)); + TLToreZaxe->setText(QApplication::translate("CreateBoundaryAn", "Z axis", Q_NULLPTR)); + TLToreRayRev->setText(QApplication::translate("CreateBoundaryAn", "R revolution", Q_NULLPTR)); + TLToreRayPri->setText(QApplication::translate("CreateBoundaryAn", "Primary R", Q_NULLPTR)); + GBButtons->setTitle(QString()); + buttonHelp->setText(QApplication::translate("CreateBoundaryAn", "Help", Q_NULLPTR)); + buttonCancel->setText(QApplication::translate("CreateBoundaryAn", "Cancel", Q_NULLPTR)); + buttonApply->setText(QApplication::translate("CreateBoundaryAn", "Apply", Q_NULLPTR)); + buttonOk->setText(QApplication::translate("CreateBoundaryAn", "OK", Q_NULLPTR)); + } // retranslateUi + +}; + +namespace Ui { + class CreateBoundaryAn: public Ui_CreateBoundaryAn {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_CREATEBOUNDARYAN_H diff --git a/src/ADAPTGUI/ui_CreateBoundaryCAO.h b/src/ADAPTGUI/ui_CreateBoundaryCAO.h new file mode 100644 index 000000000..cb6892ca1 --- /dev/null +++ b/src/ADAPTGUI/ui_CreateBoundaryCAO.h @@ -0,0 +1,158 @@ +/******************************************************************************** +** Form generated from reading UI file 'CreateBoundaryCAO.ui' +** +** Created by: Qt User Interface Compiler version 5.9.1 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_CREATEBOUNDARYCAO_H +#define UI_CREATEBOUNDARYCAO_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_CreateBoundaryCAO +{ +public: + QGridLayout *gridLayout; + QGroupBox *GBButtons; + QGridLayout *gridLayout1; + QPushButton *buttonHelp; + QPushButton *buttonCancel; + QPushButton *buttonApply; + QPushButton *buttonOk; + QCheckBox *CBGroupe; + QLineEdit *LEFileName; + QPushButton *PushFichier; + QLabel *XAO; + QLineEdit *LEName; + QLabel *Name; + + void setupUi(QDialog *CreateBoundaryCAO) + { + if (CreateBoundaryCAO->objectName().isEmpty()) + CreateBoundaryCAO->setObjectName(QStringLiteral("CreateBoundaryCAO")); + CreateBoundaryCAO->resize(566, 195); + QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(CreateBoundaryCAO->sizePolicy().hasHeightForWidth()); + CreateBoundaryCAO->setSizePolicy(sizePolicy); + CreateBoundaryCAO->setAutoFillBackground(true); + CreateBoundaryCAO->setSizeGripEnabled(true); + gridLayout = new QGridLayout(CreateBoundaryCAO); +#ifndef Q_OS_MAC + gridLayout->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout->setObjectName(QStringLiteral("gridLayout")); + GBButtons = new QGroupBox(CreateBoundaryCAO); + GBButtons->setObjectName(QStringLiteral("GBButtons")); + gridLayout1 = new QGridLayout(GBButtons); +#ifndef Q_OS_MAC + gridLayout1->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout1->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); + buttonHelp = new QPushButton(GBButtons); + buttonHelp->setObjectName(QStringLiteral("buttonHelp")); + + gridLayout1->addWidget(buttonHelp, 0, 3, 1, 1); + + buttonCancel = new QPushButton(GBButtons); + buttonCancel->setObjectName(QStringLiteral("buttonCancel")); + + gridLayout1->addWidget(buttonCancel, 0, 2, 1, 1); + + buttonApply = new QPushButton(GBButtons); + buttonApply->setObjectName(QStringLiteral("buttonApply")); + + gridLayout1->addWidget(buttonApply, 0, 1, 1, 1); + + buttonOk = new QPushButton(GBButtons); + buttonOk->setObjectName(QStringLiteral("buttonOk")); + + gridLayout1->addWidget(buttonOk, 0, 0, 1, 1); + + + gridLayout->addWidget(GBButtons, 3, 0, 1, 3); + + CBGroupe = new QCheckBox(CreateBoundaryCAO); + CBGroupe->setObjectName(QStringLiteral("CBGroupe")); + + gridLayout->addWidget(CBGroupe, 2, 0, 1, 3); + + LEFileName = new QLineEdit(CreateBoundaryCAO); + LEFileName->setObjectName(QStringLiteral("LEFileName")); + LEFileName->setMinimumSize(QSize(370, 21)); + + gridLayout->addWidget(LEFileName, 1, 2, 1, 1); + + PushFichier = new QPushButton(CreateBoundaryCAO); + PushFichier->setObjectName(QStringLiteral("PushFichier")); + + gridLayout->addWidget(PushFichier, 1, 1, 1, 1); + + XAO = new QLabel(CreateBoundaryCAO); + XAO->setObjectName(QStringLiteral("XAO")); + + gridLayout->addWidget(XAO, 1, 0, 1, 1); + + LEName = new QLineEdit(CreateBoundaryCAO); + LEName->setObjectName(QStringLiteral("LEName")); + LEName->setMinimumSize(QSize(382, 21)); + LEName->setMaxLength(32); + + gridLayout->addWidget(LEName, 0, 1, 1, 2); + + Name = new QLabel(CreateBoundaryCAO); + Name->setObjectName(QStringLiteral("Name")); + + gridLayout->addWidget(Name, 0, 0, 1, 1); + + + retranslateUi(CreateBoundaryCAO); + + QMetaObject::connectSlotsByName(CreateBoundaryCAO); + } // setupUi + + void retranslateUi(QDialog *CreateBoundaryCAO) + { + CreateBoundaryCAO->setWindowTitle(QApplication::translate("CreateBoundaryCAO", "Get CAO", Q_NULLPTR)); + GBButtons->setTitle(QString()); + buttonHelp->setText(QApplication::translate("CreateBoundaryCAO", "Help", Q_NULLPTR)); + buttonCancel->setText(QApplication::translate("CreateBoundaryCAO", "Cancel", Q_NULLPTR)); + buttonApply->setText(QApplication::translate("CreateBoundaryCAO", "Apply", Q_NULLPTR)); + buttonOk->setText(QApplication::translate("CreateBoundaryCAO", "OK", Q_NULLPTR)); + CBGroupe->setText(QApplication::translate("CreateBoundaryCAO", "Filtering with groups", Q_NULLPTR)); + PushFichier->setText(QString()); + XAO->setText(QApplication::translate("CreateBoundaryCAO", "XAO", Q_NULLPTR)); + Name->setText(QApplication::translate("CreateBoundaryCAO", "Name", Q_NULLPTR)); + } // retranslateUi + +}; + +namespace Ui { + class CreateBoundaryCAO: public Ui_CreateBoundaryCAO {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_CREATEBOUNDARYCAO_H diff --git a/src/ADAPTGUI/ui_CreateBoundaryDi.h b/src/ADAPTGUI/ui_CreateBoundaryDi.h new file mode 100644 index 000000000..5101b0d0e --- /dev/null +++ b/src/ADAPTGUI/ui_CreateBoundaryDi.h @@ -0,0 +1,158 @@ +/******************************************************************************** +** Form generated from reading UI file 'CreateBoundaryDi.ui' +** +** Created by: Qt User Interface Compiler version 5.9.1 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_CREATEBOUNDARYDI_H +#define UI_CREATEBOUNDARYDI_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_CreateBoundaryDi +{ +public: + QGridLayout *gridLayout; + QGroupBox *GBButtons; + QGridLayout *gridLayout1; + QPushButton *buttonHelp; + QPushButton *buttonCancel; + QPushButton *buttonApply; + QPushButton *buttonOk; + QCheckBox *CBGroupe; + QLineEdit *LEFileName; + QPushButton *PushFichier; + QLabel *Mesh; + QLineEdit *LEName; + QLabel *Name; + + void setupUi(QDialog *CreateBoundaryDi) + { + if (CreateBoundaryDi->objectName().isEmpty()) + CreateBoundaryDi->setObjectName(QStringLiteral("CreateBoundaryDi")); + CreateBoundaryDi->resize(566, 169); + QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(CreateBoundaryDi->sizePolicy().hasHeightForWidth()); + CreateBoundaryDi->setSizePolicy(sizePolicy); + CreateBoundaryDi->setAutoFillBackground(true); + CreateBoundaryDi->setSizeGripEnabled(true); + gridLayout = new QGridLayout(CreateBoundaryDi); +#ifndef Q_OS_MAC + gridLayout->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout->setObjectName(QStringLiteral("gridLayout")); + GBButtons = new QGroupBox(CreateBoundaryDi); + GBButtons->setObjectName(QStringLiteral("GBButtons")); + gridLayout1 = new QGridLayout(GBButtons); +#ifndef Q_OS_MAC + gridLayout1->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout1->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); + buttonHelp = new QPushButton(GBButtons); + buttonHelp->setObjectName(QStringLiteral("buttonHelp")); + + gridLayout1->addWidget(buttonHelp, 0, 3, 1, 1); + + buttonCancel = new QPushButton(GBButtons); + buttonCancel->setObjectName(QStringLiteral("buttonCancel")); + + gridLayout1->addWidget(buttonCancel, 0, 2, 1, 1); + + buttonApply = new QPushButton(GBButtons); + buttonApply->setObjectName(QStringLiteral("buttonApply")); + + gridLayout1->addWidget(buttonApply, 0, 1, 1, 1); + + buttonOk = new QPushButton(GBButtons); + buttonOk->setObjectName(QStringLiteral("buttonOk")); + + gridLayout1->addWidget(buttonOk, 0, 0, 1, 1); + + + gridLayout->addWidget(GBButtons, 3, 0, 1, 3); + + CBGroupe = new QCheckBox(CreateBoundaryDi); + CBGroupe->setObjectName(QStringLiteral("CBGroupe")); + + gridLayout->addWidget(CBGroupe, 2, 0, 1, 3); + + LEFileName = new QLineEdit(CreateBoundaryDi); + LEFileName->setObjectName(QStringLiteral("LEFileName")); + LEFileName->setMinimumSize(QSize(370, 21)); + + gridLayout->addWidget(LEFileName, 1, 2, 1, 1); + + PushFichier = new QPushButton(CreateBoundaryDi); + PushFichier->setObjectName(QStringLiteral("PushFichier")); + + gridLayout->addWidget(PushFichier, 1, 1, 1, 1); + + Mesh = new QLabel(CreateBoundaryDi); + Mesh->setObjectName(QStringLiteral("Mesh")); + + gridLayout->addWidget(Mesh, 1, 0, 1, 1); + + LEName = new QLineEdit(CreateBoundaryDi); + LEName->setObjectName(QStringLiteral("LEName")); + LEName->setMinimumSize(QSize(382, 21)); + LEName->setMaxLength(32); + + gridLayout->addWidget(LEName, 0, 1, 1, 2); + + Name = new QLabel(CreateBoundaryDi); + Name->setObjectName(QStringLiteral("Name")); + + gridLayout->addWidget(Name, 0, 0, 1, 1); + + + retranslateUi(CreateBoundaryDi); + + QMetaObject::connectSlotsByName(CreateBoundaryDi); + } // setupUi + + void retranslateUi(QDialog *CreateBoundaryDi) + { + CreateBoundaryDi->setWindowTitle(QApplication::translate("CreateBoundaryDi", "Create a discrete boundary", Q_NULLPTR)); + GBButtons->setTitle(QString()); + buttonHelp->setText(QApplication::translate("CreateBoundaryDi", "Help", Q_NULLPTR)); + buttonCancel->setText(QApplication::translate("CreateBoundaryDi", "Cancel", Q_NULLPTR)); + buttonApply->setText(QApplication::translate("CreateBoundaryDi", "Apply", Q_NULLPTR)); + buttonOk->setText(QApplication::translate("CreateBoundaryDi", "OK", Q_NULLPTR)); + CBGroupe->setText(QApplication::translate("CreateBoundaryDi", "Filtering with groups", Q_NULLPTR)); + PushFichier->setText(QString()); + Mesh->setText(QApplication::translate("CreateBoundaryDi", "Mesh", Q_NULLPTR)); + Name->setText(QApplication::translate("CreateBoundaryDi", "Name", Q_NULLPTR)); + } // retranslateUi + +}; + +namespace Ui { + class CreateBoundaryDi: public Ui_CreateBoundaryDi {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_CREATEBOUNDARYDI_H diff --git a/src/ADAPTGUI/ui_CreateCase.h b/src/ADAPTGUI/ui_CreateCase.h new file mode 100644 index 000000000..76b46612d --- /dev/null +++ b/src/ADAPTGUI/ui_CreateCase.h @@ -0,0 +1,647 @@ +/******************************************************************************** +** Form generated from reading UI file 'CreateCase.ui' +** +** Created by: Qt User Interface Compiler version 5.9.1 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_CREATECASE_H +#define UI_CREATECASE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_CreateCase +{ +public: + QGridLayout *gridLayout_5; + QWidget *WName; + QGridLayout *gridLayout_2; + QLabel *Name; + QLineEdit *LEName; + QSpacerItem *horizontalSpacer; + QHBoxLayout *hboxLayout; + QLabel *Directory; + QPushButton *PushDir; + QLineEdit *LEDirName; + QSpacerItem *spacerItem; + QHBoxLayout *hboxLayout1; + QLabel *Mesh; + QPushButton *PushFichier; + QLineEdit *LEFileName; + QSpacerItem *spacerItem1; + QGroupBox *GBTypeConf; + QHBoxLayout *hboxLayout2; + QRadioButton *RBConforme; + QRadioButton *RBNonConforme; + QGroupBox *GBTypeBoun; + QHBoxLayout *_3; + QRadioButton *RBBoundaryNo; + QRadioButton *RBBoundaryCAO; + QRadioButton *RBBoundaryNonCAO; + QSpacerItem *spacerItem2; + QHBoxLayout *hboxLayout3; + QCheckBox *CBBoundaryD; + QCheckBox *CBBoundaryA; + QGroupBox *GBBoundaryC; + QGridLayout *_2; + QPushButton *PBBoundaryCAOEdit; + QPushButton *PBBoundaryCAOHelp; + QComboBox *CBBoundaryCAO; + QSpacerItem *spacerItem3; + QPushButton *PBBoundaryCAONew; + QSpacerItem *spacerItem4; + QGroupBox *GBBoundaryD; + QGridLayout *gridLayout; + QComboBox *CBBoundaryDi; + QSpacerItem *spacerItem5; + QPushButton *PBBoundaryDiEdit; + QPushButton *PBBoundaryDiHelp; + QPushButton *PBBoundaryDiNew; + QGroupBox *GBBoundaryA; + QFormLayout *formLayout; + QTableWidget *TWBoundary; + QGridLayout *gridLayout1; + QPushButton *PBBoundaryAnEdit; + QPushButton *PBBoundaryAnNew; + QPushButton *PBBoundaryAnHelp; + QSpacerItem *spacer; + QCheckBox *CBAdvanced; + QGroupBox *GBAdvancedOptions; + QGridLayout *gridLayout_4; + QCheckBox *CBPyramid; + QGroupBox *GBConforme; + QGridLayout *gridLayout_3; + QHBoxLayout *horizontalLayout_2; + QRadioButton *RBStandard; + QRadioButton *RBBox; + QRadioButton *RBNC1NpA; + QRadioButton *RBNCQuelconque; + QGroupBox *GBFormat; + QGridLayout *gridLayout2; + QRadioButton *RBMED; + QRadioButton *RBSaturne; + QRadioButton *RBSaturne2D; + QSpacerItem *spacer_3; + QSpacerItem *spacer_4; + QLabel *Comment; + QSpacerItem *verticalSpacer; + QGroupBox *GroupButtons; + QGridLayout *gridLayout3; + QPushButton *buttonHelp; + QPushButton *buttonApply; + QPushButton *buttonOk; + QPushButton *buttonCancel; + QSpacerItem *spacer_2; + + void setupUi(QDialog *CreateCase) + { + if (CreateCase->objectName().isEmpty()) + CreateCase->setObjectName(QStringLiteral("CreateCase")); + CreateCase->resize(600, 1150); + QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(CreateCase->sizePolicy().hasHeightForWidth()); + CreateCase->setSizePolicy(sizePolicy); + CreateCase->setMinimumSize(QSize(600, 320)); + CreateCase->setSizeIncrement(QSize(1, 1)); + CreateCase->setBaseSize(QSize(600, 320)); + CreateCase->setAutoFillBackground(true); + gridLayout_5 = new QGridLayout(CreateCase); + gridLayout_5->setObjectName(QStringLiteral("gridLayout_5")); + WName = new QWidget(CreateCase); + WName->setObjectName(QStringLiteral("WName")); + gridLayout_2 = new QGridLayout(WName); + gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); + Name = new QLabel(WName); + Name->setObjectName(QStringLiteral("Name")); + + gridLayout_2->addWidget(Name, 0, 0, 1, 1); + + LEName = new QLineEdit(WName); + LEName->setObjectName(QStringLiteral("LEName")); + + gridLayout_2->addWidget(LEName, 0, 1, 1, 1); + + + gridLayout_5->addWidget(WName, 0, 0, 1, 1); + + horizontalSpacer = new QSpacerItem(199, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout_5->addItem(horizontalSpacer, 0, 2, 1, 2); + + hboxLayout = new QHBoxLayout(); +#ifndef Q_OS_MAC + hboxLayout->setSpacing(6); +#endif + hboxLayout->setContentsMargins(0, 0, 0, 0); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); + Directory = new QLabel(CreateCase); + Directory->setObjectName(QStringLiteral("Directory")); + + hboxLayout->addWidget(Directory); + + PushDir = new QPushButton(CreateCase); + PushDir->setObjectName(QStringLiteral("PushDir")); + PushDir->setAutoDefault(false); + + hboxLayout->addWidget(PushDir); + + LEDirName = new QLineEdit(CreateCase); + LEDirName->setObjectName(QStringLiteral("LEDirName")); + LEDirName->setMinimumSize(QSize(382, 21)); + + hboxLayout->addWidget(LEDirName); + + + gridLayout_5->addLayout(hboxLayout, 1, 0, 1, 5); + + spacerItem = new QSpacerItem(20, 18, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout_5->addItem(spacerItem, 2, 4, 1, 1); + + hboxLayout1 = new QHBoxLayout(); +#ifndef Q_OS_MAC + hboxLayout1->setSpacing(6); +#endif + hboxLayout1->setContentsMargins(0, 0, 0, 0); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); + Mesh = new QLabel(CreateCase); + Mesh->setObjectName(QStringLiteral("Mesh")); + + hboxLayout1->addWidget(Mesh); + + PushFichier = new QPushButton(CreateCase); + PushFichier->setObjectName(QStringLiteral("PushFichier")); + PushFichier->setAutoDefault(false); + + hboxLayout1->addWidget(PushFichier); + + LEFileName = new QLineEdit(CreateCase); + LEFileName->setObjectName(QStringLiteral("LEFileName")); + LEFileName->setMinimumSize(QSize(382, 21)); + + hboxLayout1->addWidget(LEFileName); + + + gridLayout_5->addLayout(hboxLayout1, 3, 0, 1, 5); + + spacerItem1 = new QSpacerItem(20, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout_5->addItem(spacerItem1, 3, 5, 1, 1); + + GBTypeConf = new QGroupBox(CreateCase); + GBTypeConf->setObjectName(QStringLiteral("GBTypeConf")); + hboxLayout2 = new QHBoxLayout(GBTypeConf); +#ifndef Q_OS_MAC + hboxLayout2->setSpacing(6); +#endif +#ifndef Q_OS_MAC + hboxLayout2->setContentsMargins(9, 9, 9, 9); +#endif + hboxLayout2->setObjectName(QStringLiteral("hboxLayout2")); + RBConforme = new QRadioButton(GBTypeConf); + RBConforme->setObjectName(QStringLiteral("RBConforme")); + RBConforme->setChecked(true); + + hboxLayout2->addWidget(RBConforme); + + RBNonConforme = new QRadioButton(GBTypeConf); + RBNonConforme->setObjectName(QStringLiteral("RBNonConforme")); + + hboxLayout2->addWidget(RBNonConforme); + + + gridLayout_5->addWidget(GBTypeConf, 4, 0, 1, 1); + + GBTypeBoun = new QGroupBox(CreateCase); + GBTypeBoun->setObjectName(QStringLiteral("GBTypeBoun")); + _3 = new QHBoxLayout(GBTypeBoun); +#ifndef Q_OS_MAC + _3->setSpacing(6); +#endif +#ifndef Q_OS_MAC + _3->setContentsMargins(9, 9, 9, 9); +#endif + _3->setObjectName(QStringLiteral("_3")); + RBBoundaryNo = new QRadioButton(GBTypeBoun); + RBBoundaryNo->setObjectName(QStringLiteral("RBBoundaryNo")); + RBBoundaryNo->setChecked(true); + + _3->addWidget(RBBoundaryNo); + + RBBoundaryCAO = new QRadioButton(GBTypeBoun); + RBBoundaryCAO->setObjectName(QStringLiteral("RBBoundaryCAO")); + RBBoundaryCAO->setChecked(false); + + _3->addWidget(RBBoundaryCAO); + + RBBoundaryNonCAO = new QRadioButton(GBTypeBoun); + RBBoundaryNonCAO->setObjectName(QStringLiteral("RBBoundaryNonCAO")); + + _3->addWidget(RBBoundaryNonCAO); + + + gridLayout_5->addWidget(GBTypeBoun, 5, 0, 1, 4); + + spacerItem2 = new QSpacerItem(20, 1, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout_5->addItem(spacerItem2, 5, 6, 1, 1); + + hboxLayout3 = new QHBoxLayout(); +#ifndef Q_OS_MAC + hboxLayout3->setSpacing(6); +#endif + hboxLayout3->setContentsMargins(0, 0, 0, 0); + hboxLayout3->setObjectName(QStringLiteral("hboxLayout3")); + CBBoundaryD = new QCheckBox(CreateCase); + CBBoundaryD->setObjectName(QStringLiteral("CBBoundaryD")); + + hboxLayout3->addWidget(CBBoundaryD); + + CBBoundaryA = new QCheckBox(CreateCase); + CBBoundaryA->setObjectName(QStringLiteral("CBBoundaryA")); + + hboxLayout3->addWidget(CBBoundaryA); + + + gridLayout_5->addLayout(hboxLayout3, 6, 0, 1, 3); + + GBBoundaryC = new QGroupBox(CreateCase); + GBBoundaryC->setObjectName(QStringLiteral("GBBoundaryC")); + QSizePolicy sizePolicy1(QSizePolicy::Fixed, QSizePolicy::Fixed); + sizePolicy1.setHorizontalStretch(0); + sizePolicy1.setVerticalStretch(0); + sizePolicy1.setHeightForWidth(GBBoundaryC->sizePolicy().hasHeightForWidth()); + GBBoundaryC->setSizePolicy(sizePolicy1); + _2 = new QGridLayout(GBBoundaryC); +#ifndef Q_OS_MAC + _2->setSpacing(6); +#endif +#ifndef Q_OS_MAC + _2->setContentsMargins(9, 9, 9, 9); +#endif + _2->setObjectName(QStringLiteral("_2")); + PBBoundaryCAOEdit = new QPushButton(GBBoundaryC); + PBBoundaryCAOEdit->setObjectName(QStringLiteral("PBBoundaryCAOEdit")); + PBBoundaryCAOEdit->setAutoDefault(false); + + _2->addWidget(PBBoundaryCAOEdit, 0, 3, 1, 1); + + PBBoundaryCAOHelp = new QPushButton(GBBoundaryC); + PBBoundaryCAOHelp->setObjectName(QStringLiteral("PBBoundaryCAOHelp")); + PBBoundaryCAOHelp->setAutoDefault(false); + + _2->addWidget(PBBoundaryCAOHelp, 0, 4, 1, 1); + + CBBoundaryCAO = new QComboBox(GBBoundaryC); + CBBoundaryCAO->setObjectName(QStringLiteral("CBBoundaryCAO")); + CBBoundaryCAO->setSizeAdjustPolicy(QComboBox::AdjustToContents); + + _2->addWidget(CBBoundaryCAO, 0, 0, 1, 1); + + spacerItem3 = new QSpacerItem(40, 13, QSizePolicy::Fixed, QSizePolicy::Minimum); + + _2->addItem(spacerItem3, 0, 1, 1, 1); + + PBBoundaryCAONew = new QPushButton(GBBoundaryC); + PBBoundaryCAONew->setObjectName(QStringLiteral("PBBoundaryCAONew")); + PBBoundaryCAONew->setAutoDefault(false); + + _2->addWidget(PBBoundaryCAONew, 0, 2, 1, 1); + + + gridLayout_5->addWidget(GBBoundaryC, 7, 0, 1, 2); + + spacerItem4 = new QSpacerItem(20, 2, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout_5->addItem(spacerItem4, 7, 2, 1, 1); + + GBBoundaryD = new QGroupBox(CreateCase); + GBBoundaryD->setObjectName(QStringLiteral("GBBoundaryD")); + sizePolicy1.setHeightForWidth(GBBoundaryD->sizePolicy().hasHeightForWidth()); + GBBoundaryD->setSizePolicy(sizePolicy1); + gridLayout = new QGridLayout(GBBoundaryD); +#ifndef Q_OS_MAC + gridLayout->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout->setObjectName(QStringLiteral("gridLayout")); + CBBoundaryDi = new QComboBox(GBBoundaryD); + CBBoundaryDi->setObjectName(QStringLiteral("CBBoundaryDi")); + CBBoundaryDi->setSizeAdjustPolicy(QComboBox::AdjustToContents); + + gridLayout->addWidget(CBBoundaryDi, 0, 0, 1, 1); + + spacerItem5 = new QSpacerItem(40, 13, QSizePolicy::Fixed, QSizePolicy::Minimum); + + gridLayout->addItem(spacerItem5, 0, 1, 1, 1); + + PBBoundaryDiEdit = new QPushButton(GBBoundaryD); + PBBoundaryDiEdit->setObjectName(QStringLiteral("PBBoundaryDiEdit")); + PBBoundaryDiEdit->setAutoDefault(false); + + gridLayout->addWidget(PBBoundaryDiEdit, 0, 3, 1, 1); + + PBBoundaryDiHelp = new QPushButton(GBBoundaryD); + PBBoundaryDiHelp->setObjectName(QStringLiteral("PBBoundaryDiHelp")); + PBBoundaryDiHelp->setAutoDefault(false); + + gridLayout->addWidget(PBBoundaryDiHelp, 0, 4, 1, 1); + + PBBoundaryDiNew = new QPushButton(GBBoundaryD); + PBBoundaryDiNew->setObjectName(QStringLiteral("PBBoundaryDiNew")); + PBBoundaryDiNew->setAutoDefault(false); + + gridLayout->addWidget(PBBoundaryDiNew, 0, 2, 1, 1); + + + gridLayout_5->addWidget(GBBoundaryD, 8, 0, 1, 4); + + GBBoundaryA = new QGroupBox(CreateCase); + GBBoundaryA->setObjectName(QStringLiteral("GBBoundaryA")); + GBBoundaryA->setMinimumSize(QSize(548, 200)); + formLayout = new QFormLayout(GBBoundaryA); + formLayout->setObjectName(QStringLiteral("formLayout")); + TWBoundary = new QTableWidget(GBBoundaryA); + if (TWBoundary->columnCount() < 1) + TWBoundary->setColumnCount(1); + QTableWidgetItem *__qtablewidgetitem = new QTableWidgetItem(); + TWBoundary->setHorizontalHeaderItem(0, __qtablewidgetitem); + TWBoundary->setObjectName(QStringLiteral("TWBoundary")); + TWBoundary->setEditTriggers(QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked); + TWBoundary->setShowGrid(true); + TWBoundary->setRowCount(0); + TWBoundary->setColumnCount(1); + + formLayout->setWidget(0, QFormLayout::LabelRole, TWBoundary); + + gridLayout1 = new QGridLayout(); +#ifndef Q_OS_MAC + gridLayout1->setSpacing(6); +#endif + gridLayout1->setContentsMargins(0, 0, 0, 0); + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); + PBBoundaryAnEdit = new QPushButton(GBBoundaryA); + PBBoundaryAnEdit->setObjectName(QStringLiteral("PBBoundaryAnEdit")); + PBBoundaryAnEdit->setAutoDefault(false); + + gridLayout1->addWidget(PBBoundaryAnEdit, 1, 0, 1, 1); + + PBBoundaryAnNew = new QPushButton(GBBoundaryA); + PBBoundaryAnNew->setObjectName(QStringLiteral("PBBoundaryAnNew")); + PBBoundaryAnNew->setAutoDefault(false); + + gridLayout1->addWidget(PBBoundaryAnNew, 0, 0, 1, 1); + + PBBoundaryAnHelp = new QPushButton(GBBoundaryA); + PBBoundaryAnHelp->setObjectName(QStringLiteral("PBBoundaryAnHelp")); + PBBoundaryAnHelp->setAutoDefault(false); + + gridLayout1->addWidget(PBBoundaryAnHelp, 2, 0, 1, 1); + + + formLayout->setLayout(0, QFormLayout::FieldRole, gridLayout1); + + + gridLayout_5->addWidget(GBBoundaryA, 9, 0, 1, 7); + + spacer = new QSpacerItem(239, 41, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout_5->addItem(spacer, 10, 0, 1, 1); + + CBAdvanced = new QCheckBox(CreateCase); + CBAdvanced->setObjectName(QStringLiteral("CBAdvanced")); + + gridLayout_5->addWidget(CBAdvanced, 11, 0, 1, 1); + + GBAdvancedOptions = new QGroupBox(CreateCase); + GBAdvancedOptions->setObjectName(QStringLiteral("GBAdvancedOptions")); + gridLayout_4 = new QGridLayout(GBAdvancedOptions); + gridLayout_4->setObjectName(QStringLiteral("gridLayout_4")); + CBPyramid = new QCheckBox(GBAdvancedOptions); + CBPyramid->setObjectName(QStringLiteral("CBPyramid")); + + gridLayout_4->addWidget(CBPyramid, 0, 0, 1, 1); + + GBConforme = new QGroupBox(GBAdvancedOptions); + GBConforme->setObjectName(QStringLiteral("GBConforme")); + gridLayout_3 = new QGridLayout(GBConforme); + gridLayout_3->setObjectName(QStringLiteral("gridLayout_3")); + horizontalLayout_2 = new QHBoxLayout(); + horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2")); + RBStandard = new QRadioButton(GBConforme); + RBStandard->setObjectName(QStringLiteral("RBStandard")); + RBStandard->setChecked(true); + + horizontalLayout_2->addWidget(RBStandard); + + RBBox = new QRadioButton(GBConforme); + RBBox->setObjectName(QStringLiteral("RBBox")); + RBBox->setChecked(false); + + horizontalLayout_2->addWidget(RBBox); + + RBNC1NpA = new QRadioButton(GBConforme); + RBNC1NpA->setObjectName(QStringLiteral("RBNC1NpA")); + + horizontalLayout_2->addWidget(RBNC1NpA); + + RBNCQuelconque = new QRadioButton(GBConforme); + RBNCQuelconque->setObjectName(QStringLiteral("RBNCQuelconque")); + + horizontalLayout_2->addWidget(RBNCQuelconque); + + + gridLayout_3->addLayout(horizontalLayout_2, 0, 0, 1, 1); + + GBFormat = new QGroupBox(GBConforme); + GBFormat->setObjectName(QStringLiteral("GBFormat")); + gridLayout2 = new QGridLayout(GBFormat); + gridLayout2->setObjectName(QStringLiteral("gridLayout2")); + RBMED = new QRadioButton(GBFormat); + RBMED->setObjectName(QStringLiteral("RBMED")); + RBMED->setChecked(true); + + gridLayout2->addWidget(RBMED, 0, 0, 1, 1); + + RBSaturne = new QRadioButton(GBFormat); + RBSaturne->setObjectName(QStringLiteral("RBSaturne")); + + gridLayout2->addWidget(RBSaturne, 0, 1, 1, 1); + + RBSaturne2D = new QRadioButton(GBFormat); + RBSaturne2D->setObjectName(QStringLiteral("RBSaturne2D")); + + gridLayout2->addWidget(RBSaturne2D, 0, 2, 1, 1); + + + gridLayout_3->addWidget(GBFormat, 1, 0, 1, 1); + + + gridLayout_4->addWidget(GBConforme, 1, 0, 1, 1); + + + gridLayout_5->addWidget(GBAdvancedOptions, 12, 0, 1, 3); + + spacer_3 = new QSpacerItem(128, 13, QSizePolicy::Fixed, QSizePolicy::Minimum); + + gridLayout_5->addItem(spacer_3, 12, 4, 1, 3); + + spacer_4 = new QSpacerItem(239, 41, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout_5->addItem(spacer_4, 13, 0, 1, 1); + + Comment = new QLabel(CreateCase); + Comment->setObjectName(QStringLiteral("Comment")); + + gridLayout_5->addWidget(Comment, 14, 0, 1, 1); + + verticalSpacer = new QSpacerItem(20, 35, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout_5->addItem(verticalSpacer, 14, 1, 1, 1); + + GroupButtons = new QGroupBox(CreateCase); + GroupButtons->setObjectName(QStringLiteral("GroupButtons")); + gridLayout3 = new QGridLayout(GroupButtons); +#ifndef Q_OS_MAC + gridLayout3->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout3->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout3->setObjectName(QStringLiteral("gridLayout3")); + buttonHelp = new QPushButton(GroupButtons); + buttonHelp->setObjectName(QStringLiteral("buttonHelp")); + buttonHelp->setAutoDefault(false); + + gridLayout3->addWidget(buttonHelp, 0, 4, 1, 1); + + buttonApply = new QPushButton(GroupButtons); + buttonApply->setObjectName(QStringLiteral("buttonApply")); + buttonApply->setAutoDefault(false); + + gridLayout3->addWidget(buttonApply, 0, 1, 1, 1); + + buttonOk = new QPushButton(GroupButtons); + buttonOk->setObjectName(QStringLiteral("buttonOk")); + buttonOk->setAutoDefault(false); + + gridLayout3->addWidget(buttonOk, 0, 0, 1, 1); + + buttonCancel = new QPushButton(GroupButtons); + buttonCancel->setObjectName(QStringLiteral("buttonCancel")); + buttonCancel->setAutoDefault(false); + + gridLayout3->addWidget(buttonCancel, 0, 2, 1, 1); + + + gridLayout_5->addWidget(GroupButtons, 15, 0, 1, 2); + + spacer_2 = new QSpacerItem(128, 25, QSizePolicy::Fixed, QSizePolicy::Minimum); + + gridLayout_5->addItem(spacer_2, 15, 3, 1, 2); + + WName->raise(); + GBTypeConf->raise(); + GBBoundaryD->raise(); + GBBoundaryA->raise(); + CBAdvanced->raise(); + GBAdvancedOptions->raise(); + Comment->raise(); + GroupButtons->raise(); + GBBoundaryC->raise(); + GBTypeBoun->raise(); + + retranslateUi(CreateCase); + + CBBoundaryCAO->setCurrentIndex(-1); + CBBoundaryDi->setCurrentIndex(-1); + + + QMetaObject::connectSlotsByName(CreateCase); + } // setupUi + + void retranslateUi(QDialog *CreateCase) + { + CreateCase->setWindowTitle(QApplication::translate("CreateCase", "Create a case", Q_NULLPTR)); + Name->setText(QApplication::translate("CreateCase", "Name", Q_NULLPTR)); + Directory->setText(QApplication::translate("CreateCase", "Directory", Q_NULLPTR)); + PushDir->setText(QString()); + Mesh->setText(QApplication::translate("CreateCase", "Mesh", Q_NULLPTR)); + PushFichier->setText(QString()); + GBTypeConf->setTitle(QApplication::translate("CreateCase", "Conformity type", Q_NULLPTR)); + RBConforme->setText(QApplication::translate("CreateCase", "Conformal", Q_NULLPTR)); + RBNonConforme->setText(QApplication::translate("CreateCase", "Non conformal", Q_NULLPTR)); + GBTypeBoun->setTitle(QApplication::translate("CreateCase", "Boundary type", Q_NULLPTR)); + RBBoundaryNo->setText(QApplication::translate("CreateCase", "No boundary", Q_NULLPTR)); + RBBoundaryCAO->setText(QApplication::translate("CreateCase", "CAO", Q_NULLPTR)); + RBBoundaryNonCAO->setText(QApplication::translate("CreateCase", "Non CAO", Q_NULLPTR)); + CBBoundaryD->setText(QApplication::translate("CreateCase", "Discrete boundary", Q_NULLPTR)); + CBBoundaryA->setText(QApplication::translate("CreateCase", "Analytical boundary", Q_NULLPTR)); + GBBoundaryC->setTitle(QApplication::translate("CreateCase", "CAO", Q_NULLPTR)); + PBBoundaryCAOEdit->setText(QApplication::translate("CreateCase", "Edit", Q_NULLPTR)); + PBBoundaryCAOHelp->setText(QApplication::translate("CreateCase", "Help", Q_NULLPTR)); + PBBoundaryCAONew->setText(QApplication::translate("CreateCase", "New", Q_NULLPTR)); + GBBoundaryD->setTitle(QApplication::translate("CreateCase", "Discrete boundary", Q_NULLPTR)); + PBBoundaryDiEdit->setText(QApplication::translate("CreateCase", "Edit", Q_NULLPTR)); + PBBoundaryDiHelp->setText(QApplication::translate("CreateCase", "Help", Q_NULLPTR)); + PBBoundaryDiNew->setText(QApplication::translate("CreateCase", "New", Q_NULLPTR)); + GBBoundaryA->setTitle(QApplication::translate("CreateCase", "Analytical boundary", Q_NULLPTR)); + QTableWidgetItem *___qtablewidgetitem = TWBoundary->horizontalHeaderItem(0); + ___qtablewidgetitem->setText(QApplication::translate("CreateCase", "a_virer", Q_NULLPTR)); + PBBoundaryAnEdit->setText(QApplication::translate("CreateCase", "Edit", Q_NULLPTR)); + PBBoundaryAnNew->setText(QApplication::translate("CreateCase", "New", Q_NULLPTR)); + PBBoundaryAnHelp->setText(QApplication::translate("CreateCase", "Help", Q_NULLPTR)); + CBAdvanced->setText(QApplication::translate("CreateCase", "Advanced options", Q_NULLPTR)); + GBAdvancedOptions->setTitle(QApplication::translate("CreateCase", "Advanced options", Q_NULLPTR)); + CBPyramid->setText(QApplication::translate("CreateCase", "Authorized pyramids", Q_NULLPTR)); + GBConforme->setTitle(QApplication::translate("CreateCase", "Conformity +", Q_NULLPTR)); + RBStandard->setText(QApplication::translate("CreateCase", "Standard", Q_NULLPTR)); + RBBox->setText(QApplication::translate("CreateCase", "Box", Q_NULLPTR)); + RBNC1NpA->setText(QApplication::translate("CreateCase", "1 node per edge", Q_NULLPTR)); + RBNCQuelconque->setText(QApplication::translate("CreateCase", "Free", Q_NULLPTR)); + GBFormat->setTitle(QApplication::translate("CreateCase", "Format", Q_NULLPTR)); + RBMED->setText(QApplication::translate("CreateCase", "MED", Q_NULLPTR)); + RBSaturne->setText(QApplication::translate("CreateCase", "Saturne", Q_NULLPTR)); + RBSaturne2D->setText(QApplication::translate("CreateCase", "Saturne 2D", Q_NULLPTR)); + Comment->setText(QApplication::translate("CreateCase", " No comment.", Q_NULLPTR)); + GroupButtons->setTitle(QString()); + buttonHelp->setText(QApplication::translate("CreateCase", "Help", Q_NULLPTR)); + buttonApply->setText(QApplication::translate("CreateCase", "Apply", Q_NULLPTR)); + buttonOk->setText(QApplication::translate("CreateCase", "OK", Q_NULLPTR)); + buttonCancel->setText(QApplication::translate("CreateCase", "Cancel", Q_NULLPTR)); + } // retranslateUi + +}; + +namespace Ui { + class CreateCase: public Ui_CreateCase {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_CREATECASE_H diff --git a/src/ADAPTGUI/ui_CreateHypothesis.h b/src/ADAPTGUI/ui_CreateHypothesis.h new file mode 100644 index 000000000..6669533df --- /dev/null +++ b/src/ADAPTGUI/ui_CreateHypothesis.h @@ -0,0 +1,915 @@ +/******************************************************************************** +** Form generated from reading UI file 'CreateHypothesis.ui' +** +** Created by: Qt User Interface Compiler version 5.9.1 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_CREATEHYPOTHESIS_H +#define UI_CREATEHYPOTHESIS_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_CreateHypothesis +{ +public: + QWidget *scrollAreaWidgetContents; + QGridLayout *gridLayout_5; + QWidget *WName; + QGridLayout *gridLayout; + QLabel *Name; + QLineEdit *LEName; + QSpacerItem *horizontalSpacer_9; + QGroupBox *GBTypeAdaptation; + QHBoxLayout *hboxLayout; + QRadioButton *RBUniforme; + QRadioButton *RBChamp; + QRadioButton *RBZone; + QSpacerItem *horizontalSpacer_6; + QCheckBox *CBGroupe; + QSpacerItem *horizontalSpacer_8; + QGroupBox *GBUniform; + QGridLayout *gridLayout1; + QRadioButton *RBUniDera; + QRadioButton *RBUniRaff; + QSpacerItem *horizontalSpacer_7; + QGroupBox *GBFieldFile; + QGridLayout *gridLayout2; + QLabel *FieldFile; + QLineEdit *LEFieldFile; + QGroupBox *GBFieldManagement; + QGridLayout *gridLayout3; + QHBoxLayout *hboxLayout1; + QLabel *FieldName; + QComboBox *CBFieldName; + QSpacerItem *spacerItem; + QHBoxLayout *hboxLayout2; + QTableWidget *TWCMP; + QSpacerItem *spacerItem1; + QVBoxLayout *vboxLayout; + QHBoxLayout *hboxLayout3; + QRadioButton *RBL2; + QRadioButton *RBInf; + QCheckBox *CBJump; + QHBoxLayout *hboxLayout4; + QGroupBox *GBRefinementThresholds; + QGridLayout *gridLayout4; + QRadioButton *RBRPE; + QDoubleSpinBox *SpinBox_RPE; + QRadioButton *RBRRel; + QDoubleSpinBox *SpinBox_RRel; + QRadioButton *RBRAbs; + QDoubleSpinBox *SpinBox_RAbs; + QRadioButton *RBRMuSigma; + QDoubleSpinBox *SpinBox_RMuSigma; + QRadioButton *RBRNo; + QGroupBox *GBCoarseningThresholds; + QGridLayout *gridLayout5; + QRadioButton *RBCPE; + QDoubleSpinBox *SpinBox_CPE; + QRadioButton *RBCRel; + QDoubleSpinBox *SpinBox_CRel; + QRadioButton *RBCAbs; + QDoubleSpinBox *SpinBox_CAbs; + QRadioButton *RBCMuSigma; + QDoubleSpinBox *SpinBox_CMuSigma; + QRadioButton *RBCNo; + QGroupBox *GBAreaManagement; + QGridLayout *gridLayout_4; + QTableWidget *TWZone; + QSpacerItem *horizontalSpacer; + QVBoxLayout *vboxLayout1; + QVBoxLayout *vboxLayout2; + QPushButton *PBZoneNew; + QPushButton *PBZoneEdit; + QPushButton *PBZoneDelete; + QSpacerItem *spacerItem2; + QGroupBox *GBField; + QGridLayout *gridLayout6; + QGridLayout *gridLayout7; + QRadioButton *RBFieldNo; + QRadioButton *RBFieldAll; + QRadioButton *RBFieldChosen; + QTableWidget *TWField; + QSpacerItem *horizontalSpacer_5; + QCheckBox *CBAdvanced; + QSpacerItem *horizontalSpacer_4; + QGroupBox *GBAdvancedOptions; + QGridLayout *gridLayout_3; + QLabel *TLMinimalDiameter; + QDoubleSpinBox *doubleSpinBoxDiamMin; + QLabel *TLMaximalLevel; + QSpinBox *SpinBoxNivMax; + QGroupBox *GBAdapInit; + QGridLayout *gridLayout_2; + QRadioButton *RBAIN; + QRadioButton *RBAIR; + QRadioButton *RBAID; + QCheckBox *CBOutputLevel; + QCheckBox *CBOutputQuality; + QCheckBox *CBOutputDiameter; + QCheckBox *CBOutputParent; + QCheckBox *CBOutputVoisins; + QSpacerItem *horizontalSpacer_3; + QSpacerItem *horizontalSpacer_2; + QGroupBox *GBButtons; + QGridLayout *gridLayout8; + QPushButton *buttonOk; + QPushButton *buttonApply; + QPushButton *buttonCancel; + QPushButton *buttonHelp; + + void setupUi(QScrollArea *CreateHypothesis) + { + if (CreateHypothesis->objectName().isEmpty()) + CreateHypothesis->setObjectName(QStringLiteral("CreateHypothesis")); + CreateHypothesis->resize(848, 1650); + QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(CreateHypothesis->sizePolicy().hasHeightForWidth()); + CreateHypothesis->setSizePolicy(sizePolicy); + CreateHypothesis->setMinimumSize(QSize(800, 600)); + CreateHypothesis->setSizeIncrement(QSize(1, 1)); + CreateHypothesis->setBaseSize(QSize(800, 1200)); + CreateHypothesis->setWidgetResizable(true); + scrollAreaWidgetContents = new QWidget(); + scrollAreaWidgetContents->setObjectName(QStringLiteral("scrollAreaWidgetContents")); + scrollAreaWidgetContents->setGeometry(QRect(0, 0, 844, 1646)); + scrollAreaWidgetContents->setProperty("sizeGripEnabled", QVariant(true)); + gridLayout_5 = new QGridLayout(scrollAreaWidgetContents); + gridLayout_5->setObjectName(QStringLiteral("gridLayout_5")); + WName = new QWidget(scrollAreaWidgetContents); + WName->setObjectName(QStringLiteral("WName")); + gridLayout = new QGridLayout(WName); + gridLayout->setObjectName(QStringLiteral("gridLayout")); + Name = new QLabel(WName); + Name->setObjectName(QStringLiteral("Name")); + + gridLayout->addWidget(Name, 0, 0, 1, 1); + + LEName = new QLineEdit(WName); + LEName->setObjectName(QStringLiteral("LEName")); + LEName->setMinimumSize(QSize(282, 31)); + + gridLayout->addWidget(LEName, 0, 1, 1, 1); + + + gridLayout_5->addWidget(WName, 0, 0, 1, 1); + + horizontalSpacer_9 = new QSpacerItem(224, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout_5->addItem(horizontalSpacer_9, 0, 1, 1, 1); + + GBTypeAdaptation = new QGroupBox(scrollAreaWidgetContents); + GBTypeAdaptation->setObjectName(QStringLiteral("GBTypeAdaptation")); + hboxLayout = new QHBoxLayout(GBTypeAdaptation); +#ifndef Q_OS_MAC + hboxLayout->setSpacing(6); +#endif +#ifndef Q_OS_MAC + hboxLayout->setContentsMargins(9, 9, 9, 9); +#endif + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); + RBUniforme = new QRadioButton(GBTypeAdaptation); + RBUniforme->setObjectName(QStringLiteral("RBUniforme")); + RBUniforme->setCheckable(true); + + hboxLayout->addWidget(RBUniforme); + + RBChamp = new QRadioButton(GBTypeAdaptation); + RBChamp->setObjectName(QStringLiteral("RBChamp")); + + hboxLayout->addWidget(RBChamp); + + RBZone = new QRadioButton(GBTypeAdaptation); + RBZone->setObjectName(QStringLiteral("RBZone")); + + hboxLayout->addWidget(RBZone); + + + gridLayout_5->addWidget(GBTypeAdaptation, 1, 0, 1, 1); + + horizontalSpacer_6 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout_5->addItem(horizontalSpacer_6, 1, 2, 1, 1); + + CBGroupe = new QCheckBox(scrollAreaWidgetContents); + CBGroupe->setObjectName(QStringLiteral("CBGroupe")); + + gridLayout_5->addWidget(CBGroupe, 2, 0, 1, 1); + + horizontalSpacer_8 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout_5->addItem(horizontalSpacer_8, 2, 2, 1, 1); + + GBUniform = new QGroupBox(scrollAreaWidgetContents); + GBUniform->setObjectName(QStringLiteral("GBUniform")); + gridLayout1 = new QGridLayout(GBUniform); +#ifndef Q_OS_MAC + gridLayout1->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout1->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); + RBUniDera = new QRadioButton(GBUniform); + RBUniDera->setObjectName(QStringLiteral("RBUniDera")); + + gridLayout1->addWidget(RBUniDera, 0, 1, 1, 1); + + RBUniRaff = new QRadioButton(GBUniform); + RBUniRaff->setObjectName(QStringLiteral("RBUniRaff")); + RBUniRaff->setChecked(true); + + gridLayout1->addWidget(RBUniRaff, 0, 0, 1, 1); + + + gridLayout_5->addWidget(GBUniform, 3, 0, 1, 1); + + horizontalSpacer_7 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout_5->addItem(horizontalSpacer_7, 3, 2, 1, 1); + + GBFieldFile = new QGroupBox(scrollAreaWidgetContents); + GBFieldFile->setObjectName(QStringLiteral("GBFieldFile")); + gridLayout2 = new QGridLayout(GBFieldFile); +#ifndef Q_OS_MAC + gridLayout2->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout2->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout2->setObjectName(QStringLiteral("gridLayout2")); + FieldFile = new QLabel(GBFieldFile); + FieldFile->setObjectName(QStringLiteral("FieldFile")); + + gridLayout2->addWidget(FieldFile, 0, 0, 1, 1); + + LEFieldFile = new QLineEdit(GBFieldFile); + LEFieldFile->setObjectName(QStringLiteral("LEFieldFile")); + LEFieldFile->setMinimumSize(QSize(282, 31)); + + gridLayout2->addWidget(LEFieldFile, 0, 1, 1, 1); + + + gridLayout_5->addWidget(GBFieldFile, 4, 0, 1, 1); + + GBFieldManagement = new QGroupBox(scrollAreaWidgetContents); + GBFieldManagement->setObjectName(QStringLiteral("GBFieldManagement")); + QSizePolicy sizePolicy1(QSizePolicy::Fixed, QSizePolicy::Fixed); + sizePolicy1.setHorizontalStretch(0); + sizePolicy1.setVerticalStretch(0); + sizePolicy1.setHeightForWidth(GBFieldManagement->sizePolicy().hasHeightForWidth()); + GBFieldManagement->setSizePolicy(sizePolicy1); + gridLayout3 = new QGridLayout(GBFieldManagement); +#ifndef Q_OS_MAC + gridLayout3->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout3->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout3->setObjectName(QStringLiteral("gridLayout3")); + hboxLayout1 = new QHBoxLayout(); +#ifndef Q_OS_MAC + hboxLayout1->setSpacing(6); +#endif +#ifndef Q_OS_MAC + hboxLayout1->setContentsMargins(0, 0, 0, 0); +#endif + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); + FieldName = new QLabel(GBFieldManagement); + FieldName->setObjectName(QStringLiteral("FieldName")); + + hboxLayout1->addWidget(FieldName); + + CBFieldName = new QComboBox(GBFieldManagement); + CBFieldName->setObjectName(QStringLiteral("CBFieldName")); + sizePolicy1.setHeightForWidth(CBFieldName->sizePolicy().hasHeightForWidth()); + CBFieldName->setSizePolicy(sizePolicy1); + CBFieldName->setEditable(false); + CBFieldName->setSizeAdjustPolicy(QComboBox::AdjustToContents); + + hboxLayout1->addWidget(CBFieldName); + + spacerItem = new QSpacerItem(48, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + hboxLayout1->addItem(spacerItem); + + + gridLayout3->addLayout(hboxLayout1, 0, 0, 1, 1); + + hboxLayout2 = new QHBoxLayout(); +#ifndef Q_OS_MAC + hboxLayout2->setSpacing(6); +#endif + hboxLayout2->setContentsMargins(0, 0, 0, 0); + hboxLayout2->setObjectName(QStringLiteral("hboxLayout2")); + TWCMP = new QTableWidget(GBFieldManagement); + if (TWCMP->columnCount() < 2) + TWCMP->setColumnCount(2); + QTableWidgetItem *__qtablewidgetitem = new QTableWidgetItem(); + TWCMP->setHorizontalHeaderItem(0, __qtablewidgetitem); + QTableWidgetItem *__qtablewidgetitem1 = new QTableWidgetItem(); + TWCMP->setHorizontalHeaderItem(1, __qtablewidgetitem1); + TWCMP->setObjectName(QStringLiteral("TWCMP")); + TWCMP->setEditTriggers(QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked); + TWCMP->setShowGrid(true); + TWCMP->setRowCount(0); + TWCMP->setColumnCount(2); + + hboxLayout2->addWidget(TWCMP); + + spacerItem1 = new QSpacerItem(60, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + hboxLayout2->addItem(spacerItem1); + + vboxLayout = new QVBoxLayout(); +#ifndef Q_OS_MAC + vboxLayout->setSpacing(6); +#endif + vboxLayout->setContentsMargins(0, 0, 0, 0); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); + hboxLayout3 = new QHBoxLayout(); +#ifndef Q_OS_MAC + hboxLayout3->setSpacing(6); +#endif +#ifndef Q_OS_MAC + hboxLayout3->setContentsMargins(0, 0, 0, 0); +#endif + hboxLayout3->setObjectName(QStringLiteral("hboxLayout3")); + RBL2 = new QRadioButton(GBFieldManagement); + RBL2->setObjectName(QStringLiteral("RBL2")); + RBL2->setChecked(true); + + hboxLayout3->addWidget(RBL2); + + RBInf = new QRadioButton(GBFieldManagement); + RBInf->setObjectName(QStringLiteral("RBInf")); + RBInf->setChecked(false); + + hboxLayout3->addWidget(RBInf); + + + vboxLayout->addLayout(hboxLayout3); + + CBJump = new QCheckBox(GBFieldManagement); + CBJump->setObjectName(QStringLiteral("CBJump")); + + vboxLayout->addWidget(CBJump); + + + hboxLayout2->addLayout(vboxLayout); + + + gridLayout3->addLayout(hboxLayout2, 1, 0, 1, 1); + + hboxLayout4 = new QHBoxLayout(); +#ifndef Q_OS_MAC + hboxLayout4->setSpacing(6); +#endif + hboxLayout4->setContentsMargins(0, 0, 0, 0); + hboxLayout4->setObjectName(QStringLiteral("hboxLayout4")); + GBRefinementThresholds = new QGroupBox(GBFieldManagement); + GBRefinementThresholds->setObjectName(QStringLiteral("GBRefinementThresholds")); + sizePolicy1.setHeightForWidth(GBRefinementThresholds->sizePolicy().hasHeightForWidth()); + GBRefinementThresholds->setSizePolicy(sizePolicy1); + gridLayout4 = new QGridLayout(GBRefinementThresholds); +#ifndef Q_OS_MAC + gridLayout4->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout4->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout4->setObjectName(QStringLiteral("gridLayout4")); + RBRPE = new QRadioButton(GBRefinementThresholds); + RBRPE->setObjectName(QStringLiteral("RBRPE")); + RBRPE->setCheckable(true); + RBRPE->setChecked(true); + + gridLayout4->addWidget(RBRPE, 0, 0, 1, 1); + + SpinBox_RPE = new QDoubleSpinBox(GBRefinementThresholds); + SpinBox_RPE->setObjectName(QStringLiteral("SpinBox_RPE")); + SpinBox_RPE->setDecimals(3); + SpinBox_RPE->setMaximum(100); + SpinBox_RPE->setSingleStep(0.1); + SpinBox_RPE->setValue(2); + + gridLayout4->addWidget(SpinBox_RPE, 0, 1, 1, 1); + + RBRRel = new QRadioButton(GBRefinementThresholds); + RBRRel->setObjectName(QStringLiteral("RBRRel")); + + gridLayout4->addWidget(RBRRel, 1, 0, 1, 1); + + SpinBox_RRel = new QDoubleSpinBox(GBRefinementThresholds); + SpinBox_RRel->setObjectName(QStringLiteral("SpinBox_RRel")); + SpinBox_RRel->setEnabled(false); + SpinBox_RRel->setDecimals(3); + SpinBox_RRel->setMaximum(100); + SpinBox_RRel->setSingleStep(0.1); + + gridLayout4->addWidget(SpinBox_RRel, 1, 1, 1, 1); + + RBRAbs = new QRadioButton(GBRefinementThresholds); + RBRAbs->setObjectName(QStringLiteral("RBRAbs")); + + gridLayout4->addWidget(RBRAbs, 2, 0, 1, 1); + + SpinBox_RAbs = new QDoubleSpinBox(GBRefinementThresholds); + SpinBox_RAbs->setObjectName(QStringLiteral("SpinBox_RAbs")); + SpinBox_RAbs->setEnabled(false); + SpinBox_RAbs->setDecimals(8); + SpinBox_RAbs->setMinimum(-1e+12); + SpinBox_RAbs->setMaximum(1e+12); + SpinBox_RAbs->setSingleStep(0.1); + + gridLayout4->addWidget(SpinBox_RAbs, 2, 1, 1, 1); + + RBRMuSigma = new QRadioButton(GBRefinementThresholds); + RBRMuSigma->setObjectName(QStringLiteral("RBRMuSigma")); + + gridLayout4->addWidget(RBRMuSigma, 3, 0, 1, 1); + + SpinBox_RMuSigma = new QDoubleSpinBox(GBRefinementThresholds); + SpinBox_RMuSigma->setObjectName(QStringLiteral("SpinBox_RMuSigma")); + SpinBox_RMuSigma->setEnabled(false); + SpinBox_RMuSigma->setDecimals(8); + SpinBox_RMuSigma->setMinimum(-1e+12); + SpinBox_RMuSigma->setMaximum(1e+12); + SpinBox_RMuSigma->setSingleStep(0.1); + SpinBox_RMuSigma->setValue(3); + + gridLayout4->addWidget(SpinBox_RMuSigma, 3, 1, 1, 1); + + RBRNo = new QRadioButton(GBRefinementThresholds); + RBRNo->setObjectName(QStringLiteral("RBRNo")); + + gridLayout4->addWidget(RBRNo, 4, 0, 1, 1); + + + hboxLayout4->addWidget(GBRefinementThresholds); + + GBCoarseningThresholds = new QGroupBox(GBFieldManagement); + GBCoarseningThresholds->setObjectName(QStringLiteral("GBCoarseningThresholds")); + gridLayout5 = new QGridLayout(GBCoarseningThresholds); +#ifndef Q_OS_MAC + gridLayout5->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout5->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout5->setObjectName(QStringLiteral("gridLayout5")); + RBCPE = new QRadioButton(GBCoarseningThresholds); + RBCPE->setObjectName(QStringLiteral("RBCPE")); + RBCPE->setCheckable(true); + RBCPE->setChecked(false); + + gridLayout5->addWidget(RBCPE, 0, 0, 1, 1); + + SpinBox_CPE = new QDoubleSpinBox(GBCoarseningThresholds); + SpinBox_CPE->setObjectName(QStringLiteral("SpinBox_CPE")); + SpinBox_CPE->setEnabled(false); + SpinBox_CPE->setDecimals(3); + SpinBox_CPE->setMaximum(100); + SpinBox_CPE->setSingleStep(0.1); + + gridLayout5->addWidget(SpinBox_CPE, 0, 1, 1, 1); + + RBCRel = new QRadioButton(GBCoarseningThresholds); + RBCRel->setObjectName(QStringLiteral("RBCRel")); + + gridLayout5->addWidget(RBCRel, 1, 0, 1, 1); + + SpinBox_CRel = new QDoubleSpinBox(GBCoarseningThresholds); + SpinBox_CRel->setObjectName(QStringLiteral("SpinBox_CRel")); + SpinBox_CRel->setEnabled(false); + SpinBox_CRel->setDecimals(3); + SpinBox_CRel->setMaximum(100); + SpinBox_CRel->setSingleStep(0.1); + + gridLayout5->addWidget(SpinBox_CRel, 1, 1, 1, 1); + + RBCAbs = new QRadioButton(GBCoarseningThresholds); + RBCAbs->setObjectName(QStringLiteral("RBCAbs")); + + gridLayout5->addWidget(RBCAbs, 2, 0, 1, 1); + + SpinBox_CAbs = new QDoubleSpinBox(GBCoarseningThresholds); + SpinBox_CAbs->setObjectName(QStringLiteral("SpinBox_CAbs")); + SpinBox_CAbs->setEnabled(false); + SpinBox_CAbs->setDecimals(8); + SpinBox_CAbs->setMinimum(-1e+12); + SpinBox_CAbs->setMaximum(1e+12); + SpinBox_CAbs->setSingleStep(0.1); + + gridLayout5->addWidget(SpinBox_CAbs, 2, 1, 1, 1); + + RBCMuSigma = new QRadioButton(GBCoarseningThresholds); + RBCMuSigma->setObjectName(QStringLiteral("RBCMuSigma")); + + gridLayout5->addWidget(RBCMuSigma, 3, 0, 1, 1); + + SpinBox_CMuSigma = new QDoubleSpinBox(GBCoarseningThresholds); + SpinBox_CMuSigma->setObjectName(QStringLiteral("SpinBox_CMuSigma")); + SpinBox_CMuSigma->setEnabled(false); + SpinBox_CMuSigma->setDecimals(8); + SpinBox_CMuSigma->setMinimum(-1e+12); + SpinBox_CMuSigma->setMaximum(1e+12); + SpinBox_CMuSigma->setSingleStep(0.1); + SpinBox_CMuSigma->setValue(4); + + gridLayout5->addWidget(SpinBox_CMuSigma, 3, 1, 1, 1); + + RBCNo = new QRadioButton(GBCoarseningThresholds); + RBCNo->setObjectName(QStringLiteral("RBCNo")); + RBCNo->setChecked(true); + + gridLayout5->addWidget(RBCNo, 4, 0, 1, 1); + + + hboxLayout4->addWidget(GBCoarseningThresholds); + + + gridLayout3->addLayout(hboxLayout4, 2, 0, 1, 1); + + + gridLayout_5->addWidget(GBFieldManagement, 5, 0, 1, 3); + + GBAreaManagement = new QGroupBox(scrollAreaWidgetContents); + GBAreaManagement->setObjectName(QStringLiteral("GBAreaManagement")); + sizePolicy1.setHeightForWidth(GBAreaManagement->sizePolicy().hasHeightForWidth()); + GBAreaManagement->setSizePolicy(sizePolicy1); + gridLayout_4 = new QGridLayout(GBAreaManagement); + gridLayout_4->setObjectName(QStringLiteral("gridLayout_4")); + TWZone = new QTableWidget(GBAreaManagement); + if (TWZone->columnCount() < 3) + TWZone->setColumnCount(3); + QTableWidgetItem *__qtablewidgetitem2 = new QTableWidgetItem(); + TWZone->setHorizontalHeaderItem(0, __qtablewidgetitem2); + QTableWidgetItem *__qtablewidgetitem3 = new QTableWidgetItem(); + TWZone->setHorizontalHeaderItem(1, __qtablewidgetitem3); + QTableWidgetItem *__qtablewidgetitem4 = new QTableWidgetItem(); + TWZone->setHorizontalHeaderItem(2, __qtablewidgetitem4); + TWZone->setObjectName(QStringLiteral("TWZone")); + TWZone->setMinimumSize(QSize(400, 0)); + TWZone->setEditTriggers(QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked); + TWZone->setShowGrid(true); + TWZone->setRowCount(0); + TWZone->setColumnCount(3); + + gridLayout_4->addWidget(TWZone, 0, 0, 1, 1); + + horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout_4->addItem(horizontalSpacer, 0, 1, 1, 1); + + vboxLayout1 = new QVBoxLayout(); +#ifndef Q_OS_MAC + vboxLayout1->setSpacing(6); +#endif + vboxLayout1->setContentsMargins(0, 0, 0, 0); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); + vboxLayout2 = new QVBoxLayout(); +#ifndef Q_OS_MAC + vboxLayout2->setSpacing(6); +#endif +#ifndef Q_OS_MAC + vboxLayout2->setContentsMargins(0, 0, 0, 0); +#endif + vboxLayout2->setObjectName(QStringLiteral("vboxLayout2")); + PBZoneNew = new QPushButton(GBAreaManagement); + PBZoneNew->setObjectName(QStringLiteral("PBZoneNew")); + + vboxLayout2->addWidget(PBZoneNew); + + PBZoneEdit = new QPushButton(GBAreaManagement); + PBZoneEdit->setObjectName(QStringLiteral("PBZoneEdit")); + + vboxLayout2->addWidget(PBZoneEdit); + + PBZoneDelete = new QPushButton(GBAreaManagement); + PBZoneDelete->setObjectName(QStringLiteral("PBZoneDelete")); + + vboxLayout2->addWidget(PBZoneDelete); + + + vboxLayout1->addLayout(vboxLayout2); + + spacerItem2 = new QSpacerItem(20, 48, QSizePolicy::Minimum, QSizePolicy::Expanding); + + vboxLayout1->addItem(spacerItem2); + + + gridLayout_4->addLayout(vboxLayout1, 0, 2, 1, 1); + + + gridLayout_5->addWidget(GBAreaManagement, 6, 0, 1, 2); + + GBField = new QGroupBox(scrollAreaWidgetContents); + GBField->setObjectName(QStringLiteral("GBField")); + gridLayout6 = new QGridLayout(GBField); +#ifndef Q_OS_MAC + gridLayout6->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout6->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout6->setObjectName(QStringLiteral("gridLayout6")); + gridLayout7 = new QGridLayout(); +#ifndef Q_OS_MAC + gridLayout7->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout7->setContentsMargins(0, 0, 0, 0); +#endif + gridLayout7->setObjectName(QStringLiteral("gridLayout7")); + RBFieldNo = new QRadioButton(GBField); + RBFieldNo->setObjectName(QStringLiteral("RBFieldNo")); + RBFieldNo->setChecked(true); + + gridLayout7->addWidget(RBFieldNo, 0, 0, 1, 1); + + RBFieldAll = new QRadioButton(GBField); + RBFieldAll->setObjectName(QStringLiteral("RBFieldAll")); + RBFieldAll->setChecked(false); + + gridLayout7->addWidget(RBFieldAll, 0, 1, 1, 1); + + RBFieldChosen = new QRadioButton(GBField); + RBFieldChosen->setObjectName(QStringLiteral("RBFieldChosen")); + RBFieldChosen->setChecked(false); + + gridLayout7->addWidget(RBFieldChosen, 0, 2, 1, 1); + + + gridLayout6->addLayout(gridLayout7, 0, 0, 1, 1); + + TWField = new QTableWidget(GBField); + if (TWField->columnCount() < 2) + TWField->setColumnCount(2); + QTableWidgetItem *__qtablewidgetitem5 = new QTableWidgetItem(); + TWField->setHorizontalHeaderItem(0, __qtablewidgetitem5); + QTableWidgetItem *__qtablewidgetitem6 = new QTableWidgetItem(); + TWField->setHorizontalHeaderItem(1, __qtablewidgetitem6); + TWField->setObjectName(QStringLiteral("TWField")); + + gridLayout6->addWidget(TWField, 1, 0, 1, 1); + + + gridLayout_5->addWidget(GBField, 7, 0, 1, 1); + + horizontalSpacer_5 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout_5->addItem(horizontalSpacer_5, 7, 2, 1, 1); + + CBAdvanced = new QCheckBox(scrollAreaWidgetContents); + CBAdvanced->setObjectName(QStringLiteral("CBAdvanced")); + + gridLayout_5->addWidget(CBAdvanced, 8, 0, 1, 1); + + horizontalSpacer_4 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout_5->addItem(horizontalSpacer_4, 8, 2, 1, 1); + + GBAdvancedOptions = new QGroupBox(scrollAreaWidgetContents); + GBAdvancedOptions->setObjectName(QStringLiteral("GBAdvancedOptions")); + gridLayout_3 = new QGridLayout(GBAdvancedOptions); + gridLayout_3->setObjectName(QStringLiteral("gridLayout_3")); + TLMinimalDiameter = new QLabel(GBAdvancedOptions); + TLMinimalDiameter->setObjectName(QStringLiteral("TLMinimalDiameter")); + sizePolicy1.setHeightForWidth(TLMinimalDiameter->sizePolicy().hasHeightForWidth()); + TLMinimalDiameter->setSizePolicy(sizePolicy1); + TLMinimalDiameter->setWordWrap(false); + + gridLayout_3->addWidget(TLMinimalDiameter, 0, 0, 1, 1); + + doubleSpinBoxDiamMin = new QDoubleSpinBox(GBAdvancedOptions); + doubleSpinBoxDiamMin->setObjectName(QStringLiteral("doubleSpinBoxDiamMin")); + doubleSpinBoxDiamMin->setDecimals(7); + + gridLayout_3->addWidget(doubleSpinBoxDiamMin, 0, 1, 1, 1); + + TLMaximalLevel = new QLabel(GBAdvancedOptions); + TLMaximalLevel->setObjectName(QStringLiteral("TLMaximalLevel")); + sizePolicy1.setHeightForWidth(TLMaximalLevel->sizePolicy().hasHeightForWidth()); + TLMaximalLevel->setSizePolicy(sizePolicy1); + TLMaximalLevel->setWordWrap(false); + + gridLayout_3->addWidget(TLMaximalLevel, 1, 0, 1, 1); + + SpinBoxNivMax = new QSpinBox(GBAdvancedOptions); + SpinBoxNivMax->setObjectName(QStringLiteral("SpinBoxNivMax")); + SpinBoxNivMax->setValue(99); + + gridLayout_3->addWidget(SpinBoxNivMax, 1, 1, 1, 1); + + GBAdapInit = new QGroupBox(GBAdvancedOptions); + GBAdapInit->setObjectName(QStringLiteral("GBAdapInit")); + gridLayout_2 = new QGridLayout(GBAdapInit); + gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); + RBAIN = new QRadioButton(GBAdapInit); + RBAIN->setObjectName(QStringLiteral("RBAIN")); + RBAIN->setChecked(true); + + gridLayout_2->addWidget(RBAIN, 0, 0, 1, 1); + + RBAIR = new QRadioButton(GBAdapInit); + RBAIR->setObjectName(QStringLiteral("RBAIR")); + + gridLayout_2->addWidget(RBAIR, 0, 1, 1, 1); + + RBAID = new QRadioButton(GBAdapInit); + RBAID->setObjectName(QStringLiteral("RBAID")); + + gridLayout_2->addWidget(RBAID, 0, 2, 1, 1); + + + gridLayout_3->addWidget(GBAdapInit, 2, 0, 1, 2); + + CBOutputLevel = new QCheckBox(GBAdvancedOptions); + CBOutputLevel->setObjectName(QStringLiteral("CBOutputLevel")); + + gridLayout_3->addWidget(CBOutputLevel, 3, 0, 1, 1); + + CBOutputQuality = new QCheckBox(GBAdvancedOptions); + CBOutputQuality->setObjectName(QStringLiteral("CBOutputQuality")); + + gridLayout_3->addWidget(CBOutputQuality, 4, 0, 1, 1); + + CBOutputDiameter = new QCheckBox(GBAdvancedOptions); + CBOutputDiameter->setObjectName(QStringLiteral("CBOutputDiameter")); + + gridLayout_3->addWidget(CBOutputDiameter, 5, 0, 1, 1); + + CBOutputParent = new QCheckBox(GBAdvancedOptions); + CBOutputParent->setObjectName(QStringLiteral("CBOutputParent")); + + gridLayout_3->addWidget(CBOutputParent, 6, 0, 1, 1); + + CBOutputVoisins = new QCheckBox(GBAdvancedOptions); + CBOutputVoisins->setObjectName(QStringLiteral("CBOutputVoisins")); + + gridLayout_3->addWidget(CBOutputVoisins, 7, 0, 1, 1); + + + gridLayout_5->addWidget(GBAdvancedOptions, 9, 0, 2, 1); + + horizontalSpacer_3 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout_5->addItem(horizontalSpacer_3, 9, 2, 1, 1); + + horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout_5->addItem(horizontalSpacer_2, 10, 1, 1, 1); + + GBButtons = new QGroupBox(scrollAreaWidgetContents); + GBButtons->setObjectName(QStringLiteral("GBButtons")); + gridLayout8 = new QGridLayout(GBButtons); +#ifndef Q_OS_MAC + gridLayout8->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout8->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout8->setObjectName(QStringLiteral("gridLayout8")); + buttonOk = new QPushButton(GBButtons); + buttonOk->setObjectName(QStringLiteral("buttonOk")); + + gridLayout8->addWidget(buttonOk, 0, 0, 1, 1); + + buttonApply = new QPushButton(GBButtons); + buttonApply->setObjectName(QStringLiteral("buttonApply")); + + gridLayout8->addWidget(buttonApply, 0, 1, 1, 1); + + buttonCancel = new QPushButton(GBButtons); + buttonCancel->setObjectName(QStringLiteral("buttonCancel")); + + gridLayout8->addWidget(buttonCancel, 0, 2, 1, 1); + + buttonHelp = new QPushButton(GBButtons); + buttonHelp->setObjectName(QStringLiteral("buttonHelp")); + + gridLayout8->addWidget(buttonHelp, 0, 3, 1, 1); + + + gridLayout_5->addWidget(GBButtons, 11, 0, 1, 1); + + CreateHypothesis->setWidget(scrollAreaWidgetContents); + + retranslateUi(CreateHypothesis); + + QMetaObject::connectSlotsByName(CreateHypothesis); + } // setupUi + + void retranslateUi(QScrollArea *CreateHypothesis) + { + CreateHypothesis->setWindowTitle(QApplication::translate("CreateHypothesis", "Create a hypothesis", Q_NULLPTR)); + Name->setText(QApplication::translate("CreateHypothesis", "Name", Q_NULLPTR)); + GBTypeAdaptation->setTitle(QApplication::translate("CreateHypothesis", "Type of adaptation", Q_NULLPTR)); + RBUniforme->setText(QApplication::translate("CreateHypothesis", "Uniform", Q_NULLPTR)); + RBChamp->setText(QApplication::translate("CreateHypothesis", "Driven by a field", Q_NULLPTR)); + RBZone->setText(QApplication::translate("CreateHypothesis", "With geometrical zones", Q_NULLPTR)); + CBGroupe->setText(QApplication::translate("CreateHypothesis", "Filtering with groups", Q_NULLPTR)); + GBUniform->setTitle(QApplication::translate("CreateHypothesis", "Uniform adaptation", Q_NULLPTR)); + RBUniDera->setText(QApplication::translate("CreateHypothesis", "Coarsening", Q_NULLPTR)); + RBUniRaff->setText(QApplication::translate("CreateHypothesis", "Refinement", Q_NULLPTR)); + GBFieldFile->setTitle(QString()); + FieldFile->setText(QApplication::translate("CreateHypothesis", "File of the fields", Q_NULLPTR)); + GBFieldManagement->setTitle(QApplication::translate("CreateHypothesis", "Governing field for the adaptation", Q_NULLPTR)); + FieldName->setText(QApplication::translate("CreateHypothesis", "Field name", Q_NULLPTR)); + QTableWidgetItem *___qtablewidgetitem = TWCMP->horizontalHeaderItem(0); + ___qtablewidgetitem->setText(QApplication::translate("CreateHypothesis", "Selection", Q_NULLPTR)); + QTableWidgetItem *___qtablewidgetitem1 = TWCMP->horizontalHeaderItem(1); + ___qtablewidgetitem1->setText(QApplication::translate("CreateHypothesis", "Component", Q_NULLPTR)); + RBL2->setText(QApplication::translate("CreateHypothesis", "L2 norm", Q_NULLPTR)); + RBInf->setText(QApplication::translate("CreateHypothesis", "Infinite norm", Q_NULLPTR)); + CBJump->setText(QApplication::translate("CreateHypothesis", "Jump between elements", Q_NULLPTR)); + GBRefinementThresholds->setTitle(QApplication::translate("CreateHypothesis", "Refinement threshold", Q_NULLPTR)); + RBRPE->setText(QApplication::translate("CreateHypothesis", "Percentage of meshes", Q_NULLPTR)); + SpinBox_RPE->setSuffix(QApplication::translate("CreateHypothesis", " %", Q_NULLPTR)); + RBRRel->setText(QApplication::translate("CreateHypothesis", "Relative", Q_NULLPTR)); + SpinBox_RRel->setSuffix(QApplication::translate("CreateHypothesis", " %", Q_NULLPTR)); + RBRAbs->setText(QApplication::translate("CreateHypothesis", "Absolute", Q_NULLPTR)); + RBRMuSigma->setText(QApplication::translate("CreateHypothesis", "Mean + n*(std deviation)", Q_NULLPTR)); + RBRNo->setText(QApplication::translate("CreateHypothesis", "No refinement", Q_NULLPTR)); + GBCoarseningThresholds->setTitle(QApplication::translate("CreateHypothesis", "Coarsening threshold", Q_NULLPTR)); + RBCPE->setText(QApplication::translate("CreateHypothesis", "Percentage of meshes", Q_NULLPTR)); + SpinBox_CPE->setSuffix(QApplication::translate("CreateHypothesis", " %", Q_NULLPTR)); + RBCRel->setText(QApplication::translate("CreateHypothesis", "Relative", Q_NULLPTR)); + SpinBox_CRel->setSuffix(QApplication::translate("CreateHypothesis", " %", Q_NULLPTR)); + RBCAbs->setText(QApplication::translate("CreateHypothesis", "Absolute", Q_NULLPTR)); + RBCMuSigma->setText(QApplication::translate("CreateHypothesis", "Mean - n*(std deviation)", Q_NULLPTR)); + RBCNo->setText(QApplication::translate("CreateHypothesis", "No coarsening", Q_NULLPTR)); + GBAreaManagement->setTitle(QApplication::translate("CreateHypothesis", "Zone management", Q_NULLPTR)); + QTableWidgetItem *___qtablewidgetitem2 = TWZone->horizontalHeaderItem(0); + ___qtablewidgetitem2->setText(QApplication::translate("CreateHypothesis", "Refinement", Q_NULLPTR)); + QTableWidgetItem *___qtablewidgetitem3 = TWZone->horizontalHeaderItem(1); + ___qtablewidgetitem3->setText(QApplication::translate("CreateHypothesis", "Coarsening", Q_NULLPTR)); + QTableWidgetItem *___qtablewidgetitem4 = TWZone->horizontalHeaderItem(2); + ___qtablewidgetitem4->setText(QApplication::translate("CreateHypothesis", "Zone name", Q_NULLPTR)); + PBZoneNew->setText(QApplication::translate("CreateHypothesis", "New", Q_NULLPTR)); + PBZoneEdit->setText(QApplication::translate("CreateHypothesis", "Edit", Q_NULLPTR)); + PBZoneDelete->setText(QString()); + GBField->setTitle(QApplication::translate("CreateHypothesis", "Field Interpolation", Q_NULLPTR)); + RBFieldNo->setText(QApplication::translate("CreateHypothesis", "None", Q_NULLPTR)); + RBFieldAll->setText(QApplication::translate("CreateHypothesis", "All", Q_NULLPTR)); + RBFieldChosen->setText(QApplication::translate("CreateHypothesis", "Chosen", Q_NULLPTR)); + QTableWidgetItem *___qtablewidgetitem5 = TWField->horizontalHeaderItem(0); + ___qtablewidgetitem5->setText(QApplication::translate("CreateHypothesis", "Selection", Q_NULLPTR)); + QTableWidgetItem *___qtablewidgetitem6 = TWField->horizontalHeaderItem(1); + ___qtablewidgetitem6->setText(QApplication::translate("CreateHypothesis", "Field Name", Q_NULLPTR)); + CBAdvanced->setText(QApplication::translate("CreateHypothesis", "Advanced options", Q_NULLPTR)); + GBAdvancedOptions->setTitle(QApplication::translate("CreateHypothesis", "Advanced options", Q_NULLPTR)); + TLMinimalDiameter->setText(QApplication::translate("CreateHypothesis", "Minimal diameter", Q_NULLPTR)); + TLMaximalLevel->setText(QApplication::translate("CreateHypothesis", "Maximal level", Q_NULLPTR)); + GBAdapInit->setTitle(QApplication::translate("CreateHypothesis", "Initialization of adaptation", Q_NULLPTR)); + RBAIN->setText(QApplication::translate("CreateHypothesis", "Nothing", Q_NULLPTR)); + RBAIR->setText(QApplication::translate("CreateHypothesis", "Refinement", Q_NULLPTR)); + RBAID->setText(QApplication::translate("CreateHypothesis", "Coarsening", Q_NULLPTR)); + CBOutputLevel->setText(QApplication::translate("CreateHypothesis", "Output of the level of refinement", Q_NULLPTR)); + CBOutputQuality->setText(QApplication::translate("CreateHypothesis", "Output of the qualities", Q_NULLPTR)); + CBOutputDiameter->setText(QApplication::translate("CreateHypothesis", "Output of the diameters", Q_NULLPTR)); + CBOutputParent->setText(QApplication::translate("CreateHypothesis", "Output of the parents", Q_NULLPTR)); + CBOutputVoisins->setText(QApplication::translate("CreateHypothesis", "Output of the neighbours", Q_NULLPTR)); + GBButtons->setTitle(QString()); + buttonOk->setText(QApplication::translate("CreateHypothesis", "OK", Q_NULLPTR)); + buttonApply->setText(QApplication::translate("CreateHypothesis", "Apply", Q_NULLPTR)); + buttonCancel->setText(QApplication::translate("CreateHypothesis", "Cancel", Q_NULLPTR)); + buttonHelp->setText(QApplication::translate("CreateHypothesis", "Help", Q_NULLPTR)); + } // retranslateUi + +}; + +namespace Ui { + class CreateHypothesis: public Ui_CreateHypothesis {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_CREATEHYPOTHESIS_H diff --git a/src/ADAPTGUI/ui_CreateIteration.h b/src/ADAPTGUI/ui_CreateIteration.h new file mode 100644 index 000000000..704342a58 --- /dev/null +++ b/src/ADAPTGUI/ui_CreateIteration.h @@ -0,0 +1,416 @@ +/******************************************************************************** +** Form generated from reading UI file 'CreateIteration.ui' +** +** Created by: Qt User Interface Compiler version 5.9.1 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_CREATEITERATION_H +#define UI_CREATEITERATION_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_CreateIteration +{ +public: + QWidget *scrollAreaWidgetContents; + QGridLayout *gridLayout; + QLabel *Iteration_Name; + QSpacerItem *horizontalSpacer_6; + QLineEdit *LEName; + QSpacerItem *horizontalSpacer_3; + QLabel *Iter_Parent; + QPushButton *PBIterParent; + QLineEdit *LEIterationParentName; + QLabel *Mesh_n; + QSpacerItem *horizontalSpacer_7; + QLineEdit *LEMeshName_n; + QSpacerItem *horizontalSpacer_4; + QLabel *Mesh_np1; + QSpacerItem *horizontalSpacer_8; + QLineEdit *LEMeshName_np1; + QSpacerItem *horizontalSpacer_5; + QSpacerItem *verticalSpacer; + QGroupBox *GBField; + QGridLayout *gridLayout1; + QLineEdit *LEFieldFile; + QSpacerItem *spacerItem; + QRadioButton *RBChosen; + QSpacerItem *spacerItem1; + QSpinBox *SpinBox_Rank; + QLabel *Rank; + QSpacerItem *spacerItem2; + QSpinBox *SpinBox_TimeStep; + QLabel *TimeStep; + QSpacerItem *spacerItem3; + QRadioButton *RBLast; + QRadioButton *RBNo; + QPushButton *PushFieldFile; + QLabel *FieldFile; + QSpacerItem *horizontalSpacer_10; + QSpacerItem *spacerItem4; + QGroupBox *Hypothese; + QGridLayout *gridLayout2; + QComboBox *CBHypothese; + QSpacerItem *spacerItem5; + QPushButton *PBHypoEdit; + QPushButton *PBHypoNew; + QSpacerItem *horizontalSpacer_2; + QSpacerItem *spacerItem6; + QGroupBox *GroupButtons; + QGridLayout *gridLayout3; + QPushButton *buttonOk; + QPushButton *buttonApply; + QPushButton *buttonCancel; + QPushButton *buttonHelp; + QSpacerItem *horizontalSpacer; + QSpacerItem *horizontalSpacer_9; + + void setupUi(QScrollArea *CreateIteration) + { + if (CreateIteration->objectName().isEmpty()) + CreateIteration->setObjectName(QStringLiteral("CreateIteration")); + CreateIteration->resize(777, 668); + QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(CreateIteration->sizePolicy().hasHeightForWidth()); + CreateIteration->setSizePolicy(sizePolicy); + CreateIteration->setMinimumSize(QSize(750, 400)); + CreateIteration->setSizeIncrement(QSize(1, 1)); + CreateIteration->setBaseSize(QSize(750, 400)); + CreateIteration->setWidgetResizable(true); + scrollAreaWidgetContents = new QWidget(); + scrollAreaWidgetContents->setObjectName(QStringLiteral("scrollAreaWidgetContents")); + scrollAreaWidgetContents->setGeometry(QRect(0, 0, 773, 664)); + scrollAreaWidgetContents->setProperty("sizeGripEnabled", QVariant(true)); + gridLayout = new QGridLayout(scrollAreaWidgetContents); + gridLayout->setObjectName(QStringLiteral("gridLayout")); + Iteration_Name = new QLabel(scrollAreaWidgetContents); + Iteration_Name->setObjectName(QStringLiteral("Iteration_Name")); + + gridLayout->addWidget(Iteration_Name, 0, 0, 1, 2); + + horizontalSpacer_6 = new QSpacerItem(117, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout->addItem(horizontalSpacer_6, 0, 2, 1, 1); + + LEName = new QLineEdit(scrollAreaWidgetContents); + LEName->setObjectName(QStringLiteral("LEName")); + LEName->setMinimumSize(QSize(290, 21)); + LEName->setMaxLength(64); + + gridLayout->addWidget(LEName, 0, 3, 1, 2); + + horizontalSpacer_3 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout->addItem(horizontalSpacer_3, 0, 5, 1, 1); + + Iter_Parent = new QLabel(scrollAreaWidgetContents); + Iter_Parent->setObjectName(QStringLiteral("Iter_Parent")); + + gridLayout->addWidget(Iter_Parent, 1, 0, 1, 2); + + PBIterParent = new QPushButton(scrollAreaWidgetContents); + PBIterParent->setObjectName(QStringLiteral("PBIterParent")); + PBIterParent->setEnabled(true); + PBIterParent->setMaximumSize(QSize(50, 27)); + + gridLayout->addWidget(PBIterParent, 1, 2, 1, 1); + + LEIterationParentName = new QLineEdit(scrollAreaWidgetContents); + LEIterationParentName->setObjectName(QStringLiteral("LEIterationParentName")); + LEIterationParentName->setMinimumSize(QSize(0, 21)); + LEIterationParentName->setMaxLength(64); + LEIterationParentName->setReadOnly(true); + + gridLayout->addWidget(LEIterationParentName, 1, 3, 1, 2); + + Mesh_n = new QLabel(scrollAreaWidgetContents); + Mesh_n->setObjectName(QStringLiteral("Mesh_n")); + + gridLayout->addWidget(Mesh_n, 2, 0, 1, 1); + + horizontalSpacer_7 = new QSpacerItem(117, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout->addItem(horizontalSpacer_7, 2, 2, 1, 1); + + LEMeshName_n = new QLineEdit(scrollAreaWidgetContents); + LEMeshName_n->setObjectName(QStringLiteral("LEMeshName_n")); + LEMeshName_n->setMinimumSize(QSize(290, 21)); + LEMeshName_n->setMaxLength(64); + LEMeshName_n->setReadOnly(true); + + gridLayout->addWidget(LEMeshName_n, 2, 3, 1, 3); + + horizontalSpacer_4 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout->addItem(horizontalSpacer_4, 2, 6, 1, 1); + + Mesh_np1 = new QLabel(scrollAreaWidgetContents); + Mesh_np1->setObjectName(QStringLiteral("Mesh_np1")); + + gridLayout->addWidget(Mesh_np1, 3, 0, 1, 2); + + horizontalSpacer_8 = new QSpacerItem(117, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout->addItem(horizontalSpacer_8, 3, 2, 1, 1); + + LEMeshName_np1 = new QLineEdit(scrollAreaWidgetContents); + LEMeshName_np1->setObjectName(QStringLiteral("LEMeshName_np1")); + LEMeshName_np1->setMinimumSize(QSize(290, 21)); + LEMeshName_np1->setMaxLength(64); + + gridLayout->addWidget(LEMeshName_np1, 3, 3, 1, 3); + + horizontalSpacer_5 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout->addItem(horizontalSpacer_5, 3, 6, 1, 1); + + verticalSpacer = new QSpacerItem(20, 62, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout->addItem(verticalSpacer, 4, 0, 1, 1); + + GBField = new QGroupBox(scrollAreaWidgetContents); + GBField->setObjectName(QStringLiteral("GBField")); + gridLayout1 = new QGridLayout(GBField); +#ifndef Q_OS_MAC + gridLayout1->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout1->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); + LEFieldFile = new QLineEdit(GBField); + LEFieldFile->setObjectName(QStringLiteral("LEFieldFile")); + LEFieldFile->setMinimumSize(QSize(282, 21)); + + gridLayout1->addWidget(LEFieldFile, 0, 2, 1, 5); + + spacerItem = new QSpacerItem(138, 18, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout1->addItem(spacerItem, 1, 3, 1, 4); + + RBChosen = new QRadioButton(GBField); + RBChosen->setObjectName(QStringLiteral("RBChosen")); + + gridLayout1->addWidget(RBChosen, 2, 6, 1, 1); + + spacerItem1 = new QSpacerItem(255, 13, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout1->addItem(spacerItem1, 4, 6, 1, 1); + + SpinBox_Rank = new QSpinBox(GBField); + SpinBox_Rank->setObjectName(QStringLiteral("SpinBox_Rank")); + SpinBox_Rank->setMinimum(-1); + SpinBox_Rank->setMaximum(1010000); + SpinBox_Rank->setValue(-1); + + gridLayout1->addWidget(SpinBox_Rank, 4, 5, 1, 1); + + Rank = new QLabel(GBField); + Rank->setObjectName(QStringLiteral("Rank")); + + gridLayout1->addWidget(Rank, 4, 4, 1, 1); + + spacerItem2 = new QSpacerItem(40, 13, QSizePolicy::Fixed, QSizePolicy::Minimum); + + gridLayout1->addItem(spacerItem2, 4, 2, 1, 2); + + SpinBox_TimeStep = new QSpinBox(GBField); + SpinBox_TimeStep->setObjectName(QStringLiteral("SpinBox_TimeStep")); + SpinBox_TimeStep->setMinimum(-2); + SpinBox_TimeStep->setMaximum(100000); + SpinBox_TimeStep->setValue(-1); + + gridLayout1->addWidget(SpinBox_TimeStep, 4, 1, 1, 1); + + TimeStep = new QLabel(GBField); + TimeStep->setObjectName(QStringLiteral("TimeStep")); + + gridLayout1->addWidget(TimeStep, 4, 0, 1, 1); + + spacerItem3 = new QSpacerItem(138, 28, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout1->addItem(spacerItem3, 3, 0, 1, 4); + + RBLast = new QRadioButton(GBField); + RBLast->setObjectName(QStringLiteral("RBLast")); + + gridLayout1->addWidget(RBLast, 2, 3, 1, 3); + + RBNo = new QRadioButton(GBField); + RBNo->setObjectName(QStringLiteral("RBNo")); + RBNo->setCheckable(true); + RBNo->setChecked(true); + + gridLayout1->addWidget(RBNo, 2, 0, 1, 3); + + PushFieldFile = new QPushButton(GBField); + PushFieldFile->setObjectName(QStringLiteral("PushFieldFile")); + + gridLayout1->addWidget(PushFieldFile, 0, 1, 1, 1); + + FieldFile = new QLabel(GBField); + FieldFile->setObjectName(QStringLiteral("FieldFile")); + + gridLayout1->addWidget(FieldFile, 0, 0, 1, 1); + + + gridLayout->addWidget(GBField, 5, 0, 1, 6); + + horizontalSpacer_10 = new QSpacerItem(69, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout->addItem(horizontalSpacer_10, 5, 6, 1, 1); + + spacerItem4 = new QSpacerItem(20, 22, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout->addItem(spacerItem4, 6, 0, 1, 1); + + Hypothese = new QGroupBox(scrollAreaWidgetContents); + Hypothese->setObjectName(QStringLiteral("Hypothese")); + gridLayout2 = new QGridLayout(Hypothese); +#ifndef Q_OS_MAC + gridLayout2->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout2->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout2->setObjectName(QStringLiteral("gridLayout2")); + CBHypothese = new QComboBox(Hypothese); + CBHypothese->setObjectName(QStringLiteral("CBHypothese")); + CBHypothese->setSizeAdjustPolicy(QComboBox::AdjustToContents); + + gridLayout2->addWidget(CBHypothese, 0, 0, 1, 1); + + spacerItem5 = new QSpacerItem(40, 13, QSizePolicy::Fixed, QSizePolicy::Minimum); + + gridLayout2->addItem(spacerItem5, 0, 1, 1, 1); + + PBHypoEdit = new QPushButton(Hypothese); + PBHypoEdit->setObjectName(QStringLiteral("PBHypoEdit")); + + gridLayout2->addWidget(PBHypoEdit, 0, 2, 1, 1); + + PBHypoNew = new QPushButton(Hypothese); + PBHypoNew->setObjectName(QStringLiteral("PBHypoNew")); + + gridLayout2->addWidget(PBHypoNew, 0, 3, 1, 1); + + + gridLayout->addWidget(Hypothese, 7, 0, 1, 4); + + horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout->addItem(horizontalSpacer_2, 7, 4, 1, 2); + + spacerItem6 = new QSpacerItem(20, 21, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout->addItem(spacerItem6, 8, 1, 1, 1); + + GroupButtons = new QGroupBox(scrollAreaWidgetContents); + GroupButtons->setObjectName(QStringLiteral("GroupButtons")); + gridLayout3 = new QGridLayout(GroupButtons); +#ifndef Q_OS_MAC + gridLayout3->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout3->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout3->setObjectName(QStringLiteral("gridLayout3")); + buttonOk = new QPushButton(GroupButtons); + buttonOk->setObjectName(QStringLiteral("buttonOk")); + buttonOk->setAutoDefault(false); + + gridLayout3->addWidget(buttonOk, 0, 0, 1, 1); + + buttonApply = new QPushButton(GroupButtons); + buttonApply->setObjectName(QStringLiteral("buttonApply")); + + gridLayout3->addWidget(buttonApply, 0, 1, 1, 1); + + buttonCancel = new QPushButton(GroupButtons); + buttonCancel->setObjectName(QStringLiteral("buttonCancel")); + + gridLayout3->addWidget(buttonCancel, 0, 2, 1, 1); + + buttonHelp = new QPushButton(GroupButtons); + buttonHelp->setObjectName(QStringLiteral("buttonHelp")); + + gridLayout3->addWidget(buttonHelp, 0, 3, 1, 1); + + + gridLayout->addWidget(GroupButtons, 9, 0, 1, 4); + + horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout->addItem(horizontalSpacer, 9, 4, 1, 2); + + horizontalSpacer_9 = new QSpacerItem(139, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout->addItem(horizontalSpacer_9, 1, 5, 1, 1); + + CreateIteration->setWidget(scrollAreaWidgetContents); + + retranslateUi(CreateIteration); + + CBHypothese->setCurrentIndex(-1); + buttonOk->setDefault(false); + + + QMetaObject::connectSlotsByName(CreateIteration); + } // setupUi + + void retranslateUi(QScrollArea *CreateIteration) + { + CreateIteration->setWindowTitle(QApplication::translate("CreateIteration", "Create an iteration", Q_NULLPTR)); + Iteration_Name->setText(QApplication::translate("CreateIteration", "Iteration Name", Q_NULLPTR)); + Iter_Parent->setText(QApplication::translate("CreateIteration", "Previous iteration", Q_NULLPTR)); + PBIterParent->setText(QString()); + Mesh_n->setText(QApplication::translate("CreateIteration", "Mesh n", Q_NULLPTR)); + Mesh_np1->setText(QApplication::translate("CreateIteration", "Mesh n+1", Q_NULLPTR)); + GBField->setTitle(QApplication::translate("CreateIteration", "Field information", Q_NULLPTR)); + RBChosen->setText(QApplication::translate("CreateIteration", "Chosen time step", Q_NULLPTR)); + Rank->setText(QApplication::translate("CreateIteration", "Rank", Q_NULLPTR)); + TimeStep->setText(QApplication::translate("CreateIteration", "Time step", Q_NULLPTR)); + RBLast->setText(QApplication::translate("CreateIteration", "Last time step", Q_NULLPTR)); + RBNo->setText(QApplication::translate("CreateIteration", "No time step", Q_NULLPTR)); + PushFieldFile->setText(QString()); + FieldFile->setText(QApplication::translate("CreateIteration", "Field file", Q_NULLPTR)); + Hypothese->setTitle(QApplication::translate("CreateIteration", "Hypothesis", Q_NULLPTR)); + PBHypoEdit->setText(QApplication::translate("CreateIteration", "Edit", Q_NULLPTR)); + PBHypoNew->setText(QApplication::translate("CreateIteration", "New", Q_NULLPTR)); + GroupButtons->setTitle(QString()); + buttonOk->setText(QApplication::translate("CreateIteration", "OK", Q_NULLPTR)); + buttonApply->setText(QApplication::translate("CreateIteration", "Apply", Q_NULLPTR)); + buttonCancel->setText(QApplication::translate("CreateIteration", "Cancel", Q_NULLPTR)); + buttonHelp->setText(QApplication::translate("CreateIteration", "Help", Q_NULLPTR)); + } // retranslateUi + +}; + +namespace Ui { + class CreateIteration: public Ui_CreateIteration {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_CREATEITERATION_H diff --git a/src/ADAPTGUI/ui_CreateListGroup.h b/src/ADAPTGUI/ui_CreateListGroup.h new file mode 100644 index 000000000..deb244bd1 --- /dev/null +++ b/src/ADAPTGUI/ui_CreateListGroup.h @@ -0,0 +1,148 @@ +/******************************************************************************** +** Form generated from reading UI file 'CreateListGroup.ui' +** +** Created by: Qt User Interface Compiler version 5.9.1 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_CREATELISTGROUP_H +#define UI_CREATELISTGROUP_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_CreateListGroup +{ +public: + QGridLayout *gridLayout; + QGroupBox *GBButtons; + QGridLayout *gridLayout1; + QPushButton *buttonHelp; + QPushButton *buttonCancel; + QPushButton *buttonApply; + QPushButton *buttonOk; + QGroupBox *GBOptions; + QGridLayout *gridLayout2; + QTableWidget *TWGroupe; + + void setupUi(QDialog *CreateListGroup) + { + if (CreateListGroup->objectName().isEmpty()) + CreateListGroup->setObjectName(QStringLiteral("CreateListGroup")); + CreateListGroup->resize(717, 600); + QSizePolicy sizePolicy(static_cast(0), static_cast(0)); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(CreateListGroup->sizePolicy().hasHeightForWidth()); + CreateListGroup->setSizePolicy(sizePolicy); + CreateListGroup->setAutoFillBackground(true); + CreateListGroup->setSizeGripEnabled(true); + gridLayout = new QGridLayout(CreateListGroup); +#ifndef Q_OS_MAC + gridLayout->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout->setObjectName(QStringLiteral("gridLayout")); + GBButtons = new QGroupBox(CreateListGroup); + GBButtons->setObjectName(QStringLiteral("GBButtons")); + gridLayout1 = new QGridLayout(GBButtons); +#ifndef Q_OS_MAC + gridLayout1->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout1->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); + buttonHelp = new QPushButton(GBButtons); + buttonHelp->setObjectName(QStringLiteral("buttonHelp")); + + gridLayout1->addWidget(buttonHelp, 0, 3, 1, 1); + + buttonCancel = new QPushButton(GBButtons); + buttonCancel->setObjectName(QStringLiteral("buttonCancel")); + + gridLayout1->addWidget(buttonCancel, 0, 2, 1, 1); + + buttonApply = new QPushButton(GBButtons); + buttonApply->setObjectName(QStringLiteral("buttonApply")); + + gridLayout1->addWidget(buttonApply, 0, 1, 1, 1); + + buttonOk = new QPushButton(GBButtons); + buttonOk->setObjectName(QStringLiteral("buttonOk")); + + gridLayout1->addWidget(buttonOk, 0, 0, 1, 1); + + + gridLayout->addWidget(GBButtons, 1, 0, 1, 1); + + GBOptions = new QGroupBox(CreateListGroup); + GBOptions->setObjectName(QStringLiteral("GBOptions")); + gridLayout2 = new QGridLayout(GBOptions); +#ifndef Q_OS_MAC + gridLayout2->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout2->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout2->setObjectName(QStringLiteral("gridLayout2")); + TWGroupe = new QTableWidget(GBOptions); + if (TWGroupe->columnCount() < 2) + TWGroupe->setColumnCount(2); + QTableWidgetItem *__qtablewidgetitem = new QTableWidgetItem(); + TWGroupe->setHorizontalHeaderItem(0, __qtablewidgetitem); + QTableWidgetItem *__qtablewidgetitem1 = new QTableWidgetItem(); + TWGroupe->setHorizontalHeaderItem(1, __qtablewidgetitem1); + TWGroupe->setObjectName(QStringLiteral("TWGroupe")); + TWGroupe->setShowGrid(true); + TWGroupe->setRowCount(0); + TWGroupe->setColumnCount(2); + + gridLayout2->addWidget(TWGroupe, 0, 0, 1, 1); + + + gridLayout->addWidget(GBOptions, 0, 0, 1, 1); + + + retranslateUi(CreateListGroup); + + QMetaObject::connectSlotsByName(CreateListGroup); + } // setupUi + + void retranslateUi(QDialog *CreateListGroup) + { + CreateListGroup->setWindowTitle(QApplication::translate("CreateListGroup", "Selection of groups", Q_NULLPTR)); + GBButtons->setTitle(QString()); + buttonHelp->setText(QApplication::translate("CreateListGroup", "Help", Q_NULLPTR)); + buttonCancel->setText(QApplication::translate("CreateListGroup", "Cancel", Q_NULLPTR)); + buttonApply->setText(QApplication::translate("CreateListGroup", "Apply", Q_NULLPTR)); + buttonOk->setText(QApplication::translate("CreateListGroup", "OK", Q_NULLPTR)); + GBOptions->setTitle(QApplication::translate("CreateListGroup", "Selected groups", Q_NULLPTR)); + QTableWidgetItem *___qtablewidgetitem = TWGroupe->horizontalHeaderItem(0); + ___qtablewidgetitem->setText(QApplication::translate("CreateListGroup", "Selection", Q_NULLPTR)); + QTableWidgetItem *___qtablewidgetitem1 = TWGroupe->horizontalHeaderItem(1); + ___qtablewidgetitem1->setText(QApplication::translate("CreateListGroup", "Group", Q_NULLPTR)); + } // retranslateUi + +}; + +namespace Ui { + class CreateListGroup: public Ui_CreateListGroup {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_CREATELISTGROUP_H diff --git a/src/ADAPTGUI/ui_CreateYACS.h b/src/ADAPTGUI/ui_CreateYACS.h new file mode 100644 index 000000000..43635eef7 --- /dev/null +++ b/src/ADAPTGUI/ui_CreateYACS.h @@ -0,0 +1,445 @@ +/******************************************************************************** +** Form generated from reading UI file 'CreateYACS.ui' +** +** Created by: Qt User Interface Compiler version 5.9.1 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_CREATEYACS_H +#define UI_CREATEYACS_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_CreateYACS +{ +public: + QWidget *scrollAreaWidgetContents; + QGridLayout *gridLayout_5; + QWidget *WName; + QGridLayout *gridLayout_2; + QLabel *Name; + QLineEdit *LEName; + QSpacerItem *horizontalSpacer; + QGridLayout *gridLayout; + QLabel *Case; + QPushButton *PBCaseName; + QLineEdit *LECaseName; + QHBoxLayout *_2; + QLabel *Script; + QPushButton *PBScriptFile; + QLineEdit *LEScriptFile; + QHBoxLayout *hboxLayout; + QLabel *DirectoryStart; + QPushButton *PBDir; + QLineEdit *LEDirName; + QHBoxLayout *_3; + QLabel *MeshFile; + QPushButton *PBMeshFile; + QLineEdit *LEMeshFile; + QGroupBox *GBTypeSchema; + QHBoxLayout *_4; + QRadioButton *RBConstant; + QRadioButton *RBVariable; + QGroupBox *GBMax; + QGridLayout *gridLayout_3; + QLabel *TLMaxIteration; + QSpinBox *SpinBoxMaxIter; + QLabel *TLMaxNodes; + QSpinBox *SpinBoxMaxNode; + QLabel *TLMaxElem; + QSpinBox *SpinBoxMaxElem; + QSpacerItem *horizontalSpacer_2; + QGroupBox *GBConvergence; + QGridLayout *gridLayout_4; + QRadioButton *RBNone; + QRadioButton *RBVMinAbs; + QRadioButton *RBVMaxAbs; + QLabel *labelVref; + QDoubleSpinBox *doubleSpinBoxConvergence; + QSpacerItem *horizontalSpacer_3; + QGroupBox *GroupButtons; + QGridLayout *gridLayout1; + QPushButton *buttonHelp; + QPushButton *buttonApply; + QPushButton *buttonOk; + QPushButton *buttonCancel; + QSpacerItem *spacer_2; + + void setupUi(QScrollArea *CreateYACS) + { + if (CreateYACS->objectName().isEmpty()) + CreateYACS->setObjectName(QStringLiteral("CreateYACS")); + CreateYACS->resize(684, 649); + QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(CreateYACS->sizePolicy().hasHeightForWidth()); + CreateYACS->setSizePolicy(sizePolicy); + CreateYACS->setMinimumSize(QSize(600, 500)); + CreateYACS->setSizeIncrement(QSize(1, 1)); + CreateYACS->setBaseSize(QSize(600, 500)); + CreateYACS->setWidgetResizable(true); + scrollAreaWidgetContents = new QWidget(); + scrollAreaWidgetContents->setObjectName(QStringLiteral("scrollAreaWidgetContents")); + scrollAreaWidgetContents->setGeometry(QRect(0, 0, 680, 645)); + scrollAreaWidgetContents->setProperty("sizeGripEnabled", QVariant(true)); + gridLayout_5 = new QGridLayout(scrollAreaWidgetContents); + gridLayout_5->setObjectName(QStringLiteral("gridLayout_5")); + WName = new QWidget(scrollAreaWidgetContents); + WName->setObjectName(QStringLiteral("WName")); + gridLayout_2 = new QGridLayout(WName); + gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); + Name = new QLabel(WName); + Name->setObjectName(QStringLiteral("Name")); + + gridLayout_2->addWidget(Name, 0, 0, 1, 1); + + LEName = new QLineEdit(WName); + LEName->setObjectName(QStringLiteral("LEName")); + LEName->setMaxLength(32); + + gridLayout_2->addWidget(LEName, 0, 1, 1, 1); + + + gridLayout_5->addWidget(WName, 0, 0, 1, 1); + + horizontalSpacer = new QSpacerItem(131, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout_5->addItem(horizontalSpacer, 0, 1, 1, 1); + + gridLayout = new QGridLayout(); + gridLayout->setObjectName(QStringLiteral("gridLayout")); + Case = new QLabel(scrollAreaWidgetContents); + Case->setObjectName(QStringLiteral("Case")); + + gridLayout->addWidget(Case, 0, 0, 1, 1); + + PBCaseName = new QPushButton(scrollAreaWidgetContents); + PBCaseName->setObjectName(QStringLiteral("PBCaseName")); + PBCaseName->setEnabled(true); + PBCaseName->setMaximumSize(QSize(50, 27)); + + gridLayout->addWidget(PBCaseName, 0, 1, 1, 1); + + LECaseName = new QLineEdit(scrollAreaWidgetContents); + LECaseName->setObjectName(QStringLiteral("LECaseName")); + LECaseName->setMinimumSize(QSize(382, 21)); + + gridLayout->addWidget(LECaseName, 0, 2, 1, 1); + + + gridLayout_5->addLayout(gridLayout, 1, 0, 1, 2); + + _2 = new QHBoxLayout(); +#ifndef Q_OS_MAC + _2->setSpacing(6); +#endif + _2->setContentsMargins(0, 0, 0, 0); + _2->setObjectName(QStringLiteral("_2")); + Script = new QLabel(scrollAreaWidgetContents); + Script->setObjectName(QStringLiteral("Script")); + + _2->addWidget(Script); + + PBScriptFile = new QPushButton(scrollAreaWidgetContents); + PBScriptFile->setObjectName(QStringLiteral("PBScriptFile")); + PBScriptFile->setAutoDefault(false); + + _2->addWidget(PBScriptFile); + + LEScriptFile = new QLineEdit(scrollAreaWidgetContents); + LEScriptFile->setObjectName(QStringLiteral("LEScriptFile")); + LEScriptFile->setMinimumSize(QSize(382, 21)); + + _2->addWidget(LEScriptFile); + + + gridLayout_5->addLayout(_2, 2, 0, 1, 2); + + hboxLayout = new QHBoxLayout(); +#ifndef Q_OS_MAC + hboxLayout->setSpacing(6); +#endif + hboxLayout->setContentsMargins(0, 0, 0, 0); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); + DirectoryStart = new QLabel(scrollAreaWidgetContents); + DirectoryStart->setObjectName(QStringLiteral("DirectoryStart")); + + hboxLayout->addWidget(DirectoryStart); + + PBDir = new QPushButton(scrollAreaWidgetContents); + PBDir->setObjectName(QStringLiteral("PBDir")); + PBDir->setAutoDefault(false); + + hboxLayout->addWidget(PBDir); + + LEDirName = new QLineEdit(scrollAreaWidgetContents); + LEDirName->setObjectName(QStringLiteral("LEDirName")); + LEDirName->setMinimumSize(QSize(382, 21)); + + hboxLayout->addWidget(LEDirName); + + + gridLayout_5->addLayout(hboxLayout, 3, 0, 1, 2); + + _3 = new QHBoxLayout(); +#ifndef Q_OS_MAC + _3->setSpacing(6); +#endif + _3->setContentsMargins(0, 0, 0, 0); + _3->setObjectName(QStringLiteral("_3")); + MeshFile = new QLabel(scrollAreaWidgetContents); + MeshFile->setObjectName(QStringLiteral("MeshFile")); + + _3->addWidget(MeshFile); + + PBMeshFile = new QPushButton(scrollAreaWidgetContents); + PBMeshFile->setObjectName(QStringLiteral("PBMeshFile")); + PBMeshFile->setAutoDefault(false); + + _3->addWidget(PBMeshFile); + + LEMeshFile = new QLineEdit(scrollAreaWidgetContents); + LEMeshFile->setObjectName(QStringLiteral("LEMeshFile")); + LEMeshFile->setMinimumSize(QSize(382, 21)); + + _3->addWidget(LEMeshFile); + + + gridLayout_5->addLayout(_3, 4, 0, 1, 2); + + GBTypeSchema = new QGroupBox(scrollAreaWidgetContents); + GBTypeSchema->setObjectName(QStringLiteral("GBTypeSchema")); + _4 = new QHBoxLayout(GBTypeSchema); +#ifndef Q_OS_MAC + _4->setSpacing(6); +#endif +#ifndef Q_OS_MAC + _4->setContentsMargins(9, 9, 9, 9); +#endif + _4->setObjectName(QStringLiteral("_4")); + RBConstant = new QRadioButton(GBTypeSchema); + RBConstant->setObjectName(QStringLiteral("RBConstant")); + RBConstant->setChecked(true); + + _4->addWidget(RBConstant); + + RBVariable = new QRadioButton(GBTypeSchema); + RBVariable->setObjectName(QStringLiteral("RBVariable")); + + _4->addWidget(RBVariable); + + + gridLayout_5->addWidget(GBTypeSchema, 5, 0, 1, 1); + + GBMax = new QGroupBox(scrollAreaWidgetContents); + GBMax->setObjectName(QStringLiteral("GBMax")); + gridLayout_3 = new QGridLayout(GBMax); + gridLayout_3->setObjectName(QStringLiteral("gridLayout_3")); + TLMaxIteration = new QLabel(GBMax); + TLMaxIteration->setObjectName(QStringLiteral("TLMaxIteration")); + QSizePolicy sizePolicy1(QSizePolicy::Fixed, QSizePolicy::Fixed); + sizePolicy1.setHorizontalStretch(0); + sizePolicy1.setVerticalStretch(0); + sizePolicy1.setHeightForWidth(TLMaxIteration->sizePolicy().hasHeightForWidth()); + TLMaxIteration->setSizePolicy(sizePolicy1); + TLMaxIteration->setWordWrap(false); + + gridLayout_3->addWidget(TLMaxIteration, 0, 0, 1, 1); + + SpinBoxMaxIter = new QSpinBox(GBMax); + SpinBoxMaxIter->setObjectName(QStringLiteral("SpinBoxMaxIter")); + SpinBoxMaxIter->setMinimum(0); + SpinBoxMaxIter->setMaximum(999999999); + SpinBoxMaxIter->setValue(0); + + gridLayout_3->addWidget(SpinBoxMaxIter, 0, 1, 1, 1); + + TLMaxNodes = new QLabel(GBMax); + TLMaxNodes->setObjectName(QStringLiteral("TLMaxNodes")); + sizePolicy1.setHeightForWidth(TLMaxNodes->sizePolicy().hasHeightForWidth()); + TLMaxNodes->setSizePolicy(sizePolicy1); + TLMaxNodes->setWordWrap(false); + + gridLayout_3->addWidget(TLMaxNodes, 1, 0, 1, 1); + + SpinBoxMaxNode = new QSpinBox(GBMax); + SpinBoxMaxNode->setObjectName(QStringLiteral("SpinBoxMaxNode")); + SpinBoxMaxNode->setMinimum(0); + SpinBoxMaxNode->setMaximum(999999999); + SpinBoxMaxNode->setSingleStep(1000); + SpinBoxMaxNode->setValue(0); + + gridLayout_3->addWidget(SpinBoxMaxNode, 1, 1, 1, 1); + + TLMaxElem = new QLabel(GBMax); + TLMaxElem->setObjectName(QStringLiteral("TLMaxElem")); + sizePolicy1.setHeightForWidth(TLMaxElem->sizePolicy().hasHeightForWidth()); + TLMaxElem->setSizePolicy(sizePolicy1); + TLMaxElem->setWordWrap(false); + + gridLayout_3->addWidget(TLMaxElem, 1, 2, 1, 1); + + SpinBoxMaxElem = new QSpinBox(GBMax); + SpinBoxMaxElem->setObjectName(QStringLiteral("SpinBoxMaxElem")); + SpinBoxMaxElem->setMinimum(0); + SpinBoxMaxElem->setMaximum(999999999); + SpinBoxMaxElem->setSingleStep(1000); + SpinBoxMaxElem->setValue(0); + + gridLayout_3->addWidget(SpinBoxMaxElem, 1, 3, 1, 1); + + + gridLayout_5->addWidget(GBMax, 6, 0, 1, 1); + + horizontalSpacer_2 = new QSpacerItem(269, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout_5->addItem(horizontalSpacer_2, 6, 1, 1, 1); + + GBConvergence = new QGroupBox(scrollAreaWidgetContents); + GBConvergence->setObjectName(QStringLiteral("GBConvergence")); + gridLayout_4 = new QGridLayout(GBConvergence); + gridLayout_4->setObjectName(QStringLiteral("gridLayout_4")); + RBNone = new QRadioButton(GBConvergence); + RBNone->setObjectName(QStringLiteral("RBNone")); + RBNone->setChecked(true); + + gridLayout_4->addWidget(RBNone, 0, 0, 1, 1); + + RBVMinAbs = new QRadioButton(GBConvergence); + RBVMinAbs->setObjectName(QStringLiteral("RBVMinAbs")); + + gridLayout_4->addWidget(RBVMinAbs, 0, 1, 1, 1); + + RBVMaxAbs = new QRadioButton(GBConvergence); + RBVMaxAbs->setObjectName(QStringLiteral("RBVMaxAbs")); + + gridLayout_4->addWidget(RBVMaxAbs, 0, 2, 1, 1); + + labelVref = new QLabel(GBConvergence); + labelVref->setObjectName(QStringLiteral("labelVref")); + + gridLayout_4->addWidget(labelVref, 1, 0, 1, 1); + + doubleSpinBoxConvergence = new QDoubleSpinBox(GBConvergence); + doubleSpinBoxConvergence->setObjectName(QStringLiteral("doubleSpinBoxConvergence")); + doubleSpinBoxConvergence->setDecimals(4); + doubleSpinBoxConvergence->setMinimum(-1e+9); + doubleSpinBoxConvergence->setMaximum(1e+9); + + gridLayout_4->addWidget(doubleSpinBoxConvergence, 1, 1, 1, 1); + + + gridLayout_5->addWidget(GBConvergence, 7, 0, 1, 1); + + horizontalSpacer_3 = new QSpacerItem(269, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout_5->addItem(horizontalSpacer_3, 7, 1, 1, 1); + + GroupButtons = new QGroupBox(scrollAreaWidgetContents); + GroupButtons->setObjectName(QStringLiteral("GroupButtons")); + gridLayout1 = new QGridLayout(GroupButtons); +#ifndef Q_OS_MAC + gridLayout1->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout1->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); + buttonHelp = new QPushButton(GroupButtons); + buttonHelp->setObjectName(QStringLiteral("buttonHelp")); + buttonHelp->setAutoDefault(false); + + gridLayout1->addWidget(buttonHelp, 0, 4, 1, 1); + + buttonApply = new QPushButton(GroupButtons); + buttonApply->setObjectName(QStringLiteral("buttonApply")); + buttonApply->setAutoDefault(false); + + gridLayout1->addWidget(buttonApply, 0, 1, 1, 1); + + buttonOk = new QPushButton(GroupButtons); + buttonOk->setObjectName(QStringLiteral("buttonOk")); + buttonOk->setAutoDefault(false); + + gridLayout1->addWidget(buttonOk, 0, 0, 1, 1); + + buttonCancel = new QPushButton(GroupButtons); + buttonCancel->setObjectName(QStringLiteral("buttonCancel")); + buttonCancel->setAutoDefault(false); + + gridLayout1->addWidget(buttonCancel, 0, 2, 1, 1); + + + gridLayout_5->addWidget(GroupButtons, 8, 0, 1, 1); + + spacer_2 = new QSpacerItem(128, 25, QSizePolicy::Fixed, QSizePolicy::Minimum); + + gridLayout_5->addItem(spacer_2, 8, 1, 1, 1); + + CreateYACS->setWidget(scrollAreaWidgetContents); + + retranslateUi(CreateYACS); + + QMetaObject::connectSlotsByName(CreateYACS); + } // setupUi + + void retranslateUi(QScrollArea *CreateYACS) + { + CreateYACS->setWindowTitle(QApplication::translate("CreateYACS", "Create YACS", Q_NULLPTR)); + Name->setText(QApplication::translate("CreateYACS", "Name", Q_NULLPTR)); + Case->setText(QApplication::translate("CreateYACS", "Case", Q_NULLPTR)); + PBCaseName->setText(QString()); + Script->setText(QApplication::translate("CreateYACS", "Script", Q_NULLPTR)); + PBScriptFile->setText(QString()); + DirectoryStart->setText(QApplication::translate("CreateYACS", "Directory", Q_NULLPTR)); + PBDir->setText(QString()); + MeshFile->setText(QApplication::translate("CreateYACS", "Mesh file", Q_NULLPTR)); + PBMeshFile->setText(QString()); + GBTypeSchema->setTitle(QApplication::translate("CreateYACS", "Type of schema", Q_NULLPTR)); + RBConstant->setText(QApplication::translate("CreateYACS", "Constant", Q_NULLPTR)); + RBVariable->setText(QApplication::translate("CreateYACS", "Variable", Q_NULLPTR)); + GBMax->setTitle(QApplication::translate("CreateYACS", "Maximum of ...", Q_NULLPTR)); + TLMaxIteration->setText(QApplication::translate("CreateYACS", "Iterations", Q_NULLPTR)); + TLMaxNodes->setText(QApplication::translate("CreateYACS", "Nodes", Q_NULLPTR)); + TLMaxElem->setText(QApplication::translate("CreateYACS", "Elements", Q_NULLPTR)); + GBConvergence->setTitle(QApplication::translate("CreateYACS", "Test of convergence", Q_NULLPTR)); + RBNone->setText(QApplication::translate("CreateYACS", "None", Q_NULLPTR)); + RBVMinAbs->setText(QApplication::translate("CreateYACS", "Vtest > Vref", Q_NULLPTR)); + RBVMaxAbs->setText(QApplication::translate("CreateYACS", "Vtest < Vref", Q_NULLPTR)); + labelVref->setText(QApplication::translate("CreateYACS", "Vref", Q_NULLPTR)); + GroupButtons->setTitle(QString()); + buttonHelp->setText(QApplication::translate("CreateYACS", "Help", Q_NULLPTR)); + buttonApply->setText(QApplication::translate("CreateYACS", "Apply", Q_NULLPTR)); + buttonOk->setText(QApplication::translate("CreateYACS", "OK", Q_NULLPTR)); + buttonCancel->setText(QApplication::translate("CreateYACS", "Cancel", Q_NULLPTR)); + } // retranslateUi + +}; + +namespace Ui { + class CreateYACS: public Ui_CreateYACS {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_CREATEYACS_H diff --git a/src/ADAPTGUI/ui_CreateZone.h b/src/ADAPTGUI/ui_CreateZone.h new file mode 100644 index 000000000..9863c2b4b --- /dev/null +++ b/src/ADAPTGUI/ui_CreateZone.h @@ -0,0 +1,806 @@ +/******************************************************************************** +** Form generated from reading UI file 'CreateZone.ui' +** +** Created by: Qt User Interface Compiler version 5.9.1 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_CREATEZONE_H +#define UI_CREATEZONE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_CreateZone +{ +public: + QGridLayout *gridLayout; + QLabel *Name; + QLineEdit *LEName; + QSpacerItem *horizontalSpacer_3; + QGroupBox *TypeZone; + QGridLayout *gridLayout1; + QRadioButton *RBSphere; + QRadioButton *RBPipe; + QRadioButton *RBCylinder; + QRadioButton *RBBox; + QSpacerItem *horizontalSpacer_2; + QGroupBox *gBBox; + QGridLayout *gridLayout2; + QLabel *TLXmini; + QDoubleSpinBox *SpinBox_Xmini; + QLabel *TLYmini; + QDoubleSpinBox *SpinBox_Ymini; + QLabel *TLZmini; + QDoubleSpinBox *SpinBox_Zmini; + QLabel *TLXmaxi; + QLabel *TLZmaxi; + QDoubleSpinBox *SpinBox_Zmaxi; + QLabel *TLYmaxi; + QDoubleSpinBox *SpinBox_Xmaxi; + QDoubleSpinBox *SpinBox_Ymaxi; + QGroupBox *gBSphere; + QGridLayout *gridLayout3; + QLabel *TLXcentre; + QDoubleSpinBox *SpinBox_Xcentre; + QLabel *TLYcentre; + QDoubleSpinBox *SpinBox_Ycentre; + QLabel *TLRayon; + QDoubleSpinBox *SpinBox_Rayon; + QLabel *TLZcentre; + QDoubleSpinBox *SpinBox_Zcentre; + QGroupBox *gBCylindre; + QGridLayout *gridLayout4; + QDoubleSpinBox *SpinBox_Haut; + QLabel *TLHaut; + QLabel *TLRadius; + QDoubleSpinBox *SpinBox_Xaxis; + QDoubleSpinBox *SpinBox_Yaxis; + QDoubleSpinBox *SpinBox_Zaxis; + QLabel *TLZaxis; + QLabel *TLYaxis; + QLabel *TLXaxis; + QDoubleSpinBox *SpinBox_Ybase; + QLabel *TLYbase; + QLabel *TLZbase; + QDoubleSpinBox *SpinBox_Zbase; + QDoubleSpinBox *SpinBox_Radius; + QLabel *TLXbase; + QDoubleSpinBox *SpinBox_Xbase; + QGroupBox *gBPipe; + QGridLayout *gridLayout5; + QLabel *TLHaut_p; + QDoubleSpinBox *SpinBox_Xbase_p; + QLabel *TLXbase_p; + QDoubleSpinBox *SpinBox_Radius_int; + QDoubleSpinBox *SpinBox_Zbase_p; + QLabel *TLRadius_int; + QLabel *TLZbase_p; + QLabel *TLYbase_p; + QDoubleSpinBox *SpinBox_Ybase_p; + QLabel *TLXaxis_p; + QLabel *TLYaxis_p; + QLabel *TLZaxis_p; + QDoubleSpinBox *SpinBox_Zaxis_p; + QDoubleSpinBox *SpinBox_Yaxis_p; + QDoubleSpinBox *SpinBox_Xaxis_p; + QDoubleSpinBox *SpinBox_Radius_ext; + QLabel *TLRadius_ext; + QDoubleSpinBox *SpinBox_Haut_p; + QGroupBox *GBButtons; + QGridLayout *gridLayout6; + QPushButton *buttonHelp; + QPushButton *buttonCancel; + QPushButton *buttonApply; + QPushButton *buttonOk; + QSpacerItem *horizontalSpacer; + + void setupUi(QDialog *CreateZone) + { + if (CreateZone->objectName().isEmpty()) + CreateZone->setObjectName(QStringLiteral("CreateZone")); + CreateZone->resize(545, 778); + CreateZone->setSizeIncrement(QSize(1, 1)); + CreateZone->setBaseSize(QSize(550, 400)); + CreateZone->setAutoFillBackground(true); + CreateZone->setSizeGripEnabled(true); + gridLayout = new QGridLayout(CreateZone); + gridLayout->setObjectName(QStringLiteral("gridLayout")); + Name = new QLabel(CreateZone); + Name->setObjectName(QStringLiteral("Name")); + + gridLayout->addWidget(Name, 0, 0, 1, 1); + + LEName = new QLineEdit(CreateZone); + LEName->setObjectName(QStringLiteral("LEName")); + LEName->setMaxLength(32); + + gridLayout->addWidget(LEName, 0, 1, 1, 1); + + horizontalSpacer_3 = new QSpacerItem(142, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout->addItem(horizontalSpacer_3, 0, 2, 1, 1); + + TypeZone = new QGroupBox(CreateZone); + TypeZone->setObjectName(QStringLiteral("TypeZone")); + QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(TypeZone->sizePolicy().hasHeightForWidth()); + TypeZone->setSizePolicy(sizePolicy); + TypeZone->setMinimumSize(QSize(340, 0)); + gridLayout1 = new QGridLayout(TypeZone); +#ifndef Q_OS_MAC + gridLayout1->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout1->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); + RBSphere = new QRadioButton(TypeZone); + RBSphere->setObjectName(QStringLiteral("RBSphere")); + QIcon icon; + icon.addFile(QStringLiteral("../../resources/zone_spherepoint.png"), QSize(), QIcon::Normal, QIcon::Off); + RBSphere->setIcon(icon); + + gridLayout1->addWidget(RBSphere, 0, 3, 1, 1); + + RBPipe = new QRadioButton(TypeZone); + RBPipe->setObjectName(QStringLiteral("RBPipe")); + QIcon icon1; + icon1.addFile(QStringLiteral("../../resources/pipe.png"), QSize(), QIcon::Normal, QIcon::Off); + RBPipe->setIcon(icon1); + + gridLayout1->addWidget(RBPipe, 0, 2, 1, 1); + + RBCylinder = new QRadioButton(TypeZone); + RBCylinder->setObjectName(QStringLiteral("RBCylinder")); + QIcon icon2; + icon2.addFile(QStringLiteral("../../resources/cylinderpointvector.png"), QSize(), QIcon::Normal, QIcon::Off); + RBCylinder->setIcon(icon2); + + gridLayout1->addWidget(RBCylinder, 0, 1, 1, 1); + + RBBox = new QRadioButton(TypeZone); + RBBox->setObjectName(QStringLiteral("RBBox")); + QIcon icon3; + icon3.addFile(QStringLiteral("../../resources/zone_boxdxyz.png"), QSize(), QIcon::Normal, QIcon::Off); + RBBox->setIcon(icon3); + RBBox->setCheckable(true); + RBBox->setChecked(true); + + gridLayout1->addWidget(RBBox, 0, 0, 1, 1); + + + gridLayout->addWidget(TypeZone, 1, 0, 1, 4); + + horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout->addItem(horizontalSpacer_2, 1, 4, 1, 1); + + gBBox = new QGroupBox(CreateZone); + gBBox->setObjectName(QStringLiteral("gBBox")); + sizePolicy.setHeightForWidth(gBBox->sizePolicy().hasHeightForWidth()); + gBBox->setSizePolicy(sizePolicy); + gridLayout2 = new QGridLayout(gBBox); +#ifndef Q_OS_MAC + gridLayout2->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout2->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout2->setObjectName(QStringLiteral("gridLayout2")); + TLXmini = new QLabel(gBBox); + TLXmini->setObjectName(QStringLiteral("TLXmini")); + sizePolicy.setHeightForWidth(TLXmini->sizePolicy().hasHeightForWidth()); + TLXmini->setSizePolicy(sizePolicy); + TLXmini->setWordWrap(false); + + gridLayout2->addWidget(TLXmini, 0, 0, 1, 1); + + SpinBox_Xmini = new QDoubleSpinBox(gBBox); + SpinBox_Xmini->setObjectName(QStringLiteral("SpinBox_Xmini")); + SpinBox_Xmini->setDecimals(5); + SpinBox_Xmini->setMinimum(-1e+9); + SpinBox_Xmini->setMaximum(1e+9); + SpinBox_Xmini->setValue(0); + + gridLayout2->addWidget(SpinBox_Xmini, 0, 1, 1, 1); + + TLYmini = new QLabel(gBBox); + TLYmini->setObjectName(QStringLiteral("TLYmini")); + sizePolicy.setHeightForWidth(TLYmini->sizePolicy().hasHeightForWidth()); + TLYmini->setSizePolicy(sizePolicy); + TLYmini->setWordWrap(false); + + gridLayout2->addWidget(TLYmini, 1, 0, 1, 1); + + SpinBox_Ymini = new QDoubleSpinBox(gBBox); + SpinBox_Ymini->setObjectName(QStringLiteral("SpinBox_Ymini")); + SpinBox_Ymini->setDecimals(5); + SpinBox_Ymini->setMinimum(-1e+9); + SpinBox_Ymini->setMaximum(1e+9); + SpinBox_Ymini->setValue(0); + + gridLayout2->addWidget(SpinBox_Ymini, 1, 1, 1, 1); + + TLZmini = new QLabel(gBBox); + TLZmini->setObjectName(QStringLiteral("TLZmini")); + sizePolicy.setHeightForWidth(TLZmini->sizePolicy().hasHeightForWidth()); + TLZmini->setSizePolicy(sizePolicy); + TLZmini->setWordWrap(false); + + gridLayout2->addWidget(TLZmini, 2, 0, 1, 1); + + SpinBox_Zmini = new QDoubleSpinBox(gBBox); + SpinBox_Zmini->setObjectName(QStringLiteral("SpinBox_Zmini")); + SpinBox_Zmini->setDecimals(5); + SpinBox_Zmini->setMinimum(-1e+9); + SpinBox_Zmini->setMaximum(1e+9); + SpinBox_Zmini->setValue(0); + + gridLayout2->addWidget(SpinBox_Zmini, 2, 1, 1, 1); + + TLXmaxi = new QLabel(gBBox); + TLXmaxi->setObjectName(QStringLiteral("TLXmaxi")); + sizePolicy.setHeightForWidth(TLXmaxi->sizePolicy().hasHeightForWidth()); + TLXmaxi->setSizePolicy(sizePolicy); + TLXmaxi->setWordWrap(false); + + gridLayout2->addWidget(TLXmaxi, 0, 2, 1, 1); + + TLZmaxi = new QLabel(gBBox); + TLZmaxi->setObjectName(QStringLiteral("TLZmaxi")); + sizePolicy.setHeightForWidth(TLZmaxi->sizePolicy().hasHeightForWidth()); + TLZmaxi->setSizePolicy(sizePolicy); + TLZmaxi->setWordWrap(false); + + gridLayout2->addWidget(TLZmaxi, 2, 2, 1, 1); + + SpinBox_Zmaxi = new QDoubleSpinBox(gBBox); + SpinBox_Zmaxi->setObjectName(QStringLiteral("SpinBox_Zmaxi")); + SpinBox_Zmaxi->setDecimals(5); + SpinBox_Zmaxi->setMinimum(-1e+9); + SpinBox_Zmaxi->setMaximum(1e+9); + SpinBox_Zmaxi->setValue(0); + + gridLayout2->addWidget(SpinBox_Zmaxi, 2, 3, 1, 1); + + TLYmaxi = new QLabel(gBBox); + TLYmaxi->setObjectName(QStringLiteral("TLYmaxi")); + sizePolicy.setHeightForWidth(TLYmaxi->sizePolicy().hasHeightForWidth()); + TLYmaxi->setSizePolicy(sizePolicy); + TLYmaxi->setWordWrap(false); + + gridLayout2->addWidget(TLYmaxi, 1, 2, 1, 1); + + SpinBox_Xmaxi = new QDoubleSpinBox(gBBox); + SpinBox_Xmaxi->setObjectName(QStringLiteral("SpinBox_Xmaxi")); + SpinBox_Xmaxi->setDecimals(5); + SpinBox_Xmaxi->setMinimum(-1e+9); + SpinBox_Xmaxi->setMaximum(1e+9); + SpinBox_Xmaxi->setValue(0); + + gridLayout2->addWidget(SpinBox_Xmaxi, 0, 3, 1, 1); + + SpinBox_Ymaxi = new QDoubleSpinBox(gBBox); + SpinBox_Ymaxi->setObjectName(QStringLiteral("SpinBox_Ymaxi")); + SpinBox_Ymaxi->setDecimals(5); + SpinBox_Ymaxi->setMinimum(-1e+9); + SpinBox_Ymaxi->setMaximum(1e+9); + SpinBox_Ymaxi->setValue(0); + + gridLayout2->addWidget(SpinBox_Ymaxi, 1, 3, 1, 1); + + + gridLayout->addWidget(gBBox, 2, 0, 1, 4); + + gBSphere = new QGroupBox(CreateZone); + gBSphere->setObjectName(QStringLiteral("gBSphere")); + sizePolicy.setHeightForWidth(gBSphere->sizePolicy().hasHeightForWidth()); + gBSphere->setSizePolicy(sizePolicy); + gridLayout3 = new QGridLayout(gBSphere); +#ifndef Q_OS_MAC + gridLayout3->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout3->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout3->setObjectName(QStringLiteral("gridLayout3")); + TLXcentre = new QLabel(gBSphere); + TLXcentre->setObjectName(QStringLiteral("TLXcentre")); + sizePolicy.setHeightForWidth(TLXcentre->sizePolicy().hasHeightForWidth()); + TLXcentre->setSizePolicy(sizePolicy); + TLXcentre->setWordWrap(false); + + gridLayout3->addWidget(TLXcentre, 0, 0, 1, 1); + + SpinBox_Xcentre = new QDoubleSpinBox(gBSphere); + SpinBox_Xcentre->setObjectName(QStringLiteral("SpinBox_Xcentre")); + SpinBox_Xcentre->setDecimals(5); + SpinBox_Xcentre->setMinimum(-1e+9); + SpinBox_Xcentre->setMaximum(1e+9); + SpinBox_Xcentre->setValue(0); + + gridLayout3->addWidget(SpinBox_Xcentre, 0, 1, 1, 1); + + TLYcentre = new QLabel(gBSphere); + TLYcentre->setObjectName(QStringLiteral("TLYcentre")); + sizePolicy.setHeightForWidth(TLYcentre->sizePolicy().hasHeightForWidth()); + TLYcentre->setSizePolicy(sizePolicy); + TLYcentre->setWordWrap(false); + + gridLayout3->addWidget(TLYcentre, 1, 0, 1, 1); + + SpinBox_Ycentre = new QDoubleSpinBox(gBSphere); + SpinBox_Ycentre->setObjectName(QStringLiteral("SpinBox_Ycentre")); + SpinBox_Ycentre->setDecimals(5); + SpinBox_Ycentre->setMinimum(-1e+9); + SpinBox_Ycentre->setMaximum(1e+9); + SpinBox_Ycentre->setValue(0); + + gridLayout3->addWidget(SpinBox_Ycentre, 1, 1, 1, 1); + + TLRayon = new QLabel(gBSphere); + TLRayon->setObjectName(QStringLiteral("TLRayon")); + sizePolicy.setHeightForWidth(TLRayon->sizePolicy().hasHeightForWidth()); + TLRayon->setSizePolicy(sizePolicy); + TLRayon->setWordWrap(false); + + gridLayout3->addWidget(TLRayon, 1, 2, 1, 1); + + SpinBox_Rayon = new QDoubleSpinBox(gBSphere); + SpinBox_Rayon->setObjectName(QStringLiteral("SpinBox_Rayon")); + SpinBox_Rayon->setDecimals(5); + SpinBox_Rayon->setMinimum(0); + SpinBox_Rayon->setMaximum(1e+9); + SpinBox_Rayon->setValue(0); + + gridLayout3->addWidget(SpinBox_Rayon, 1, 3, 1, 1); + + TLZcentre = new QLabel(gBSphere); + TLZcentre->setObjectName(QStringLiteral("TLZcentre")); + sizePolicy.setHeightForWidth(TLZcentre->sizePolicy().hasHeightForWidth()); + TLZcentre->setSizePolicy(sizePolicy); + TLZcentre->setWordWrap(false); + + gridLayout3->addWidget(TLZcentre, 2, 0, 1, 1); + + SpinBox_Zcentre = new QDoubleSpinBox(gBSphere); + SpinBox_Zcentre->setObjectName(QStringLiteral("SpinBox_Zcentre")); + SpinBox_Zcentre->setDecimals(5); + SpinBox_Zcentre->setMinimum(-1e+9); + SpinBox_Zcentre->setMaximum(1e+9); + SpinBox_Zcentre->setValue(0); + + gridLayout3->addWidget(SpinBox_Zcentre, 2, 1, 1, 1); + + + gridLayout->addWidget(gBSphere, 3, 0, 1, 4); + + gBCylindre = new QGroupBox(CreateZone); + gBCylindre->setObjectName(QStringLiteral("gBCylindre")); + sizePolicy.setHeightForWidth(gBCylindre->sizePolicy().hasHeightForWidth()); + gBCylindre->setSizePolicy(sizePolicy); + gBCylindre->setFocusPolicy(Qt::TabFocus); + gridLayout4 = new QGridLayout(gBCylindre); +#ifndef Q_OS_MAC + gridLayout4->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout4->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout4->setObjectName(QStringLiteral("gridLayout4")); + SpinBox_Haut = new QDoubleSpinBox(gBCylindre); + SpinBox_Haut->setObjectName(QStringLiteral("SpinBox_Haut")); + SpinBox_Haut->setDecimals(5); + SpinBox_Haut->setMaximum(1e+9); + + gridLayout4->addWidget(SpinBox_Haut, 4, 1, 1, 1); + + TLHaut = new QLabel(gBCylindre); + TLHaut->setObjectName(QStringLiteral("TLHaut")); + sizePolicy.setHeightForWidth(TLHaut->sizePolicy().hasHeightForWidth()); + TLHaut->setSizePolicy(sizePolicy); + TLHaut->setWordWrap(false); + + gridLayout4->addWidget(TLHaut, 4, 0, 1, 1); + + TLRadius = new QLabel(gBCylindre); + TLRadius->setObjectName(QStringLiteral("TLRadius")); + sizePolicy.setHeightForWidth(TLRadius->sizePolicy().hasHeightForWidth()); + TLRadius->setSizePolicy(sizePolicy); + TLRadius->setWordWrap(false); + + gridLayout4->addWidget(TLRadius, 3, 0, 1, 1); + + SpinBox_Xaxis = new QDoubleSpinBox(gBCylindre); + SpinBox_Xaxis->setObjectName(QStringLiteral("SpinBox_Xaxis")); + SpinBox_Xaxis->setDecimals(5); + SpinBox_Xaxis->setMinimum(-1e+9); + SpinBox_Xaxis->setMaximum(1e+9); + SpinBox_Xaxis->setValue(0); + + gridLayout4->addWidget(SpinBox_Xaxis, 0, 3, 1, 1); + + SpinBox_Yaxis = new QDoubleSpinBox(gBCylindre); + SpinBox_Yaxis->setObjectName(QStringLiteral("SpinBox_Yaxis")); + SpinBox_Yaxis->setDecimals(5); + SpinBox_Yaxis->setMinimum(-1e+9); + SpinBox_Yaxis->setMaximum(1e+9); + SpinBox_Yaxis->setValue(0); + + gridLayout4->addWidget(SpinBox_Yaxis, 1, 3, 1, 1); + + SpinBox_Zaxis = new QDoubleSpinBox(gBCylindre); + SpinBox_Zaxis->setObjectName(QStringLiteral("SpinBox_Zaxis")); + SpinBox_Zaxis->setDecimals(5); + SpinBox_Zaxis->setMinimum(-1e+9); + SpinBox_Zaxis->setMaximum(1e+9); + SpinBox_Zaxis->setValue(0); + + gridLayout4->addWidget(SpinBox_Zaxis, 2, 3, 1, 1); + + TLZaxis = new QLabel(gBCylindre); + TLZaxis->setObjectName(QStringLiteral("TLZaxis")); + sizePolicy.setHeightForWidth(TLZaxis->sizePolicy().hasHeightForWidth()); + TLZaxis->setSizePolicy(sizePolicy); + TLZaxis->setWordWrap(false); + + gridLayout4->addWidget(TLZaxis, 2, 2, 1, 1); + + TLYaxis = new QLabel(gBCylindre); + TLYaxis->setObjectName(QStringLiteral("TLYaxis")); + sizePolicy.setHeightForWidth(TLYaxis->sizePolicy().hasHeightForWidth()); + TLYaxis->setSizePolicy(sizePolicy); + TLYaxis->setWordWrap(false); + + gridLayout4->addWidget(TLYaxis, 1, 2, 1, 1); + + TLXaxis = new QLabel(gBCylindre); + TLXaxis->setObjectName(QStringLiteral("TLXaxis")); + sizePolicy.setHeightForWidth(TLXaxis->sizePolicy().hasHeightForWidth()); + TLXaxis->setSizePolicy(sizePolicy); + TLXaxis->setWordWrap(false); + + gridLayout4->addWidget(TLXaxis, 0, 2, 1, 1); + + SpinBox_Ybase = new QDoubleSpinBox(gBCylindre); + SpinBox_Ybase->setObjectName(QStringLiteral("SpinBox_Ybase")); + SpinBox_Ybase->setDecimals(5); + SpinBox_Ybase->setMinimum(-1e+9); + SpinBox_Ybase->setMaximum(1e+9); + SpinBox_Ybase->setValue(0); + + gridLayout4->addWidget(SpinBox_Ybase, 1, 1, 1, 1); + + TLYbase = new QLabel(gBCylindre); + TLYbase->setObjectName(QStringLiteral("TLYbase")); + sizePolicy.setHeightForWidth(TLYbase->sizePolicy().hasHeightForWidth()); + TLYbase->setSizePolicy(sizePolicy); + TLYbase->setWordWrap(false); + + gridLayout4->addWidget(TLYbase, 1, 0, 1, 1); + + TLZbase = new QLabel(gBCylindre); + TLZbase->setObjectName(QStringLiteral("TLZbase")); + sizePolicy.setHeightForWidth(TLZbase->sizePolicy().hasHeightForWidth()); + TLZbase->setSizePolicy(sizePolicy); + TLZbase->setWordWrap(false); + + gridLayout4->addWidget(TLZbase, 2, 0, 1, 1); + + SpinBox_Zbase = new QDoubleSpinBox(gBCylindre); + SpinBox_Zbase->setObjectName(QStringLiteral("SpinBox_Zbase")); + SpinBox_Zbase->setDecimals(5); + SpinBox_Zbase->setMinimum(-1e+9); + SpinBox_Zbase->setMaximum(1e+9); + SpinBox_Zbase->setValue(0); + + gridLayout4->addWidget(SpinBox_Zbase, 2, 1, 1, 1); + + SpinBox_Radius = new QDoubleSpinBox(gBCylindre); + SpinBox_Radius->setObjectName(QStringLiteral("SpinBox_Radius")); + SpinBox_Radius->setDecimals(5); + SpinBox_Radius->setMaximum(1e+9); + + gridLayout4->addWidget(SpinBox_Radius, 3, 1, 1, 1); + + TLXbase = new QLabel(gBCylindre); + TLXbase->setObjectName(QStringLiteral("TLXbase")); + sizePolicy.setHeightForWidth(TLXbase->sizePolicy().hasHeightForWidth()); + TLXbase->setSizePolicy(sizePolicy); + TLXbase->setWordWrap(false); + + gridLayout4->addWidget(TLXbase, 0, 0, 1, 1); + + SpinBox_Xbase = new QDoubleSpinBox(gBCylindre); + SpinBox_Xbase->setObjectName(QStringLiteral("SpinBox_Xbase")); + SpinBox_Xbase->setDecimals(5); + SpinBox_Xbase->setMinimum(-1e+9); + SpinBox_Xbase->setMaximum(1e+9); + SpinBox_Xbase->setValue(0); + + gridLayout4->addWidget(SpinBox_Xbase, 0, 1, 1, 1); + + + gridLayout->addWidget(gBCylindre, 4, 0, 1, 4); + + gBPipe = new QGroupBox(CreateZone); + gBPipe->setObjectName(QStringLiteral("gBPipe")); + sizePolicy.setHeightForWidth(gBPipe->sizePolicy().hasHeightForWidth()); + gBPipe->setSizePolicy(sizePolicy); + gridLayout5 = new QGridLayout(gBPipe); +#ifndef Q_OS_MAC + gridLayout5->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout5->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout5->setObjectName(QStringLiteral("gridLayout5")); + TLHaut_p = new QLabel(gBPipe); + TLHaut_p->setObjectName(QStringLiteral("TLHaut_p")); + sizePolicy.setHeightForWidth(TLHaut_p->sizePolicy().hasHeightForWidth()); + TLHaut_p->setSizePolicy(sizePolicy); + TLHaut_p->setWordWrap(false); + + gridLayout5->addWidget(TLHaut_p, 4, 0, 1, 1); + + SpinBox_Xbase_p = new QDoubleSpinBox(gBPipe); + SpinBox_Xbase_p->setObjectName(QStringLiteral("SpinBox_Xbase_p")); + SpinBox_Xbase_p->setDecimals(5); + SpinBox_Xbase_p->setMinimum(-1e+9); + SpinBox_Xbase_p->setMaximum(1e+9); + SpinBox_Xbase_p->setValue(0); + + gridLayout5->addWidget(SpinBox_Xbase_p, 0, 1, 1, 1); + + TLXbase_p = new QLabel(gBPipe); + TLXbase_p->setObjectName(QStringLiteral("TLXbase_p")); + sizePolicy.setHeightForWidth(TLXbase_p->sizePolicy().hasHeightForWidth()); + TLXbase_p->setSizePolicy(sizePolicy); + TLXbase_p->setWordWrap(false); + + gridLayout5->addWidget(TLXbase_p, 0, 0, 1, 1); + + SpinBox_Radius_int = new QDoubleSpinBox(gBPipe); + SpinBox_Radius_int->setObjectName(QStringLiteral("SpinBox_Radius_int")); + SpinBox_Radius_int->setDecimals(5); + SpinBox_Radius_int->setMaximum(1e+9); + + gridLayout5->addWidget(SpinBox_Radius_int, 3, 1, 1, 1); + + SpinBox_Zbase_p = new QDoubleSpinBox(gBPipe); + SpinBox_Zbase_p->setObjectName(QStringLiteral("SpinBox_Zbase_p")); + SpinBox_Zbase_p->setDecimals(5); + SpinBox_Zbase_p->setMinimum(-1e+9); + SpinBox_Zbase_p->setMaximum(1e+9); + SpinBox_Zbase_p->setValue(0); + + gridLayout5->addWidget(SpinBox_Zbase_p, 2, 1, 1, 1); + + TLRadius_int = new QLabel(gBPipe); + TLRadius_int->setObjectName(QStringLiteral("TLRadius_int")); + sizePolicy.setHeightForWidth(TLRadius_int->sizePolicy().hasHeightForWidth()); + TLRadius_int->setSizePolicy(sizePolicy); + TLRadius_int->setWordWrap(false); + + gridLayout5->addWidget(TLRadius_int, 3, 0, 1, 1); + + TLZbase_p = new QLabel(gBPipe); + TLZbase_p->setObjectName(QStringLiteral("TLZbase_p")); + sizePolicy.setHeightForWidth(TLZbase_p->sizePolicy().hasHeightForWidth()); + TLZbase_p->setSizePolicy(sizePolicy); + TLZbase_p->setWordWrap(false); + + gridLayout5->addWidget(TLZbase_p, 2, 0, 1, 1); + + TLYbase_p = new QLabel(gBPipe); + TLYbase_p->setObjectName(QStringLiteral("TLYbase_p")); + sizePolicy.setHeightForWidth(TLYbase_p->sizePolicy().hasHeightForWidth()); + TLYbase_p->setSizePolicy(sizePolicy); + TLYbase_p->setWordWrap(false); + + gridLayout5->addWidget(TLYbase_p, 1, 0, 1, 1); + + SpinBox_Ybase_p = new QDoubleSpinBox(gBPipe); + SpinBox_Ybase_p->setObjectName(QStringLiteral("SpinBox_Ybase_p")); + SpinBox_Ybase_p->setDecimals(5); + SpinBox_Ybase_p->setMinimum(-1e+9); + SpinBox_Ybase_p->setMaximum(1e+9); + SpinBox_Ybase_p->setValue(0); + + gridLayout5->addWidget(SpinBox_Ybase_p, 1, 1, 1, 1); + + TLXaxis_p = new QLabel(gBPipe); + TLXaxis_p->setObjectName(QStringLiteral("TLXaxis_p")); + sizePolicy.setHeightForWidth(TLXaxis_p->sizePolicy().hasHeightForWidth()); + TLXaxis_p->setSizePolicy(sizePolicy); + TLXaxis_p->setWordWrap(false); + + gridLayout5->addWidget(TLXaxis_p, 0, 2, 1, 1); + + TLYaxis_p = new QLabel(gBPipe); + TLYaxis_p->setObjectName(QStringLiteral("TLYaxis_p")); + sizePolicy.setHeightForWidth(TLYaxis_p->sizePolicy().hasHeightForWidth()); + TLYaxis_p->setSizePolicy(sizePolicy); + TLYaxis_p->setWordWrap(false); + + gridLayout5->addWidget(TLYaxis_p, 1, 2, 1, 1); + + TLZaxis_p = new QLabel(gBPipe); + TLZaxis_p->setObjectName(QStringLiteral("TLZaxis_p")); + sizePolicy.setHeightForWidth(TLZaxis_p->sizePolicy().hasHeightForWidth()); + TLZaxis_p->setSizePolicy(sizePolicy); + TLZaxis_p->setWordWrap(false); + + gridLayout5->addWidget(TLZaxis_p, 2, 2, 1, 1); + + SpinBox_Zaxis_p = new QDoubleSpinBox(gBPipe); + SpinBox_Zaxis_p->setObjectName(QStringLiteral("SpinBox_Zaxis_p")); + SpinBox_Zaxis_p->setDecimals(5); + SpinBox_Zaxis_p->setMinimum(-1e+9); + SpinBox_Zaxis_p->setMaximum(1e+9); + SpinBox_Zaxis_p->setValue(0); + + gridLayout5->addWidget(SpinBox_Zaxis_p, 2, 3, 1, 1); + + SpinBox_Yaxis_p = new QDoubleSpinBox(gBPipe); + SpinBox_Yaxis_p->setObjectName(QStringLiteral("SpinBox_Yaxis_p")); + SpinBox_Yaxis_p->setDecimals(5); + SpinBox_Yaxis_p->setMinimum(-1e+9); + SpinBox_Yaxis_p->setMaximum(1e+9); + SpinBox_Yaxis_p->setValue(0); + + gridLayout5->addWidget(SpinBox_Yaxis_p, 1, 3, 1, 1); + + SpinBox_Xaxis_p = new QDoubleSpinBox(gBPipe); + SpinBox_Xaxis_p->setObjectName(QStringLiteral("SpinBox_Xaxis_p")); + SpinBox_Xaxis_p->setDecimals(5); + SpinBox_Xaxis_p->setMinimum(-1e+9); + SpinBox_Xaxis_p->setMaximum(1e+9); + SpinBox_Xaxis_p->setValue(0); + + gridLayout5->addWidget(SpinBox_Xaxis_p, 0, 3, 1, 1); + + SpinBox_Radius_ext = new QDoubleSpinBox(gBPipe); + SpinBox_Radius_ext->setObjectName(QStringLiteral("SpinBox_Radius_ext")); + SpinBox_Radius_ext->setDecimals(5); + SpinBox_Radius_ext->setMaximum(1e+9); + + gridLayout5->addWidget(SpinBox_Radius_ext, 3, 3, 1, 1); + + TLRadius_ext = new QLabel(gBPipe); + TLRadius_ext->setObjectName(QStringLiteral("TLRadius_ext")); + sizePolicy.setHeightForWidth(TLRadius_ext->sizePolicy().hasHeightForWidth()); + TLRadius_ext->setSizePolicy(sizePolicy); + TLRadius_ext->setWordWrap(false); + + gridLayout5->addWidget(TLRadius_ext, 3, 2, 1, 1); + + SpinBox_Haut_p = new QDoubleSpinBox(gBPipe); + SpinBox_Haut_p->setObjectName(QStringLiteral("SpinBox_Haut_p")); + SpinBox_Haut_p->setDecimals(5); + SpinBox_Haut_p->setMaximum(1e+9); + + gridLayout5->addWidget(SpinBox_Haut_p, 4, 1, 1, 1); + + + gridLayout->addWidget(gBPipe, 5, 0, 1, 5); + + GBButtons = new QGroupBox(CreateZone); + GBButtons->setObjectName(QStringLiteral("GBButtons")); + sizePolicy.setHeightForWidth(GBButtons->sizePolicy().hasHeightForWidth()); + GBButtons->setSizePolicy(sizePolicy); + gridLayout6 = new QGridLayout(GBButtons); +#ifndef Q_OS_MAC + gridLayout6->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout6->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout6->setObjectName(QStringLiteral("gridLayout6")); + buttonHelp = new QPushButton(GBButtons); + buttonHelp->setObjectName(QStringLiteral("buttonHelp")); + + gridLayout6->addWidget(buttonHelp, 0, 3, 1, 1); + + buttonCancel = new QPushButton(GBButtons); + buttonCancel->setObjectName(QStringLiteral("buttonCancel")); + + gridLayout6->addWidget(buttonCancel, 0, 2, 1, 1); + + buttonApply = new QPushButton(GBButtons); + buttonApply->setObjectName(QStringLiteral("buttonApply")); + + gridLayout6->addWidget(buttonApply, 0, 1, 1, 1); + + buttonOk = new QPushButton(GBButtons); + buttonOk->setObjectName(QStringLiteral("buttonOk")); + + gridLayout6->addWidget(buttonOk, 0, 0, 1, 1); + + + gridLayout->addWidget(GBButtons, 6, 0, 1, 3); + + horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout->addItem(horizontalSpacer, 6, 3, 1, 2); + + + retranslateUi(CreateZone); + + QMetaObject::connectSlotsByName(CreateZone); + } // setupUi + + void retranslateUi(QDialog *CreateZone) + { + CreateZone->setWindowTitle(QApplication::translate("CreateZone", "Create a zone", Q_NULLPTR)); + Name->setText(QApplication::translate("CreateZone", "Name", Q_NULLPTR)); + TypeZone->setTitle(QApplication::translate("CreateZone", "Type of zone", Q_NULLPTR)); + RBSphere->setText(QApplication::translate("CreateZone", "Sphere", Q_NULLPTR)); + RBPipe->setText(QApplication::translate("CreateZone", "Pipe", Q_NULLPTR)); + RBCylinder->setText(QApplication::translate("CreateZone", "Cylinder", Q_NULLPTR)); + RBBox->setText(QApplication::translate("CreateZone", "Box", Q_NULLPTR)); + gBBox->setTitle(QApplication::translate("CreateZone", "Coordinates", Q_NULLPTR)); + TLXmini->setText(QApplication::translate("CreateZone", "X mini", Q_NULLPTR)); + TLYmini->setText(QApplication::translate("CreateZone", "Y mini", Q_NULLPTR)); + TLZmini->setText(QApplication::translate("CreateZone", "Z mini", Q_NULLPTR)); + TLXmaxi->setText(QApplication::translate("CreateZone", "X maxi", Q_NULLPTR)); + TLZmaxi->setText(QApplication::translate("CreateZone", "Z maxi", Q_NULLPTR)); + TLYmaxi->setText(QApplication::translate("CreateZone", "Y maxi", Q_NULLPTR)); + gBSphere->setTitle(QApplication::translate("CreateZone", "Coordinates", Q_NULLPTR)); + TLXcentre->setText(QApplication::translate("CreateZone", "X centre", Q_NULLPTR)); + TLYcentre->setText(QApplication::translate("CreateZone", "Y centre", Q_NULLPTR)); + TLRayon->setText(QApplication::translate("CreateZone", "Radius", Q_NULLPTR)); + TLZcentre->setText(QApplication::translate("CreateZone", "Z centre", Q_NULLPTR)); + gBCylindre->setTitle(QApplication::translate("CreateZone", "Coordinates", Q_NULLPTR)); + TLHaut->setText(QApplication::translate("CreateZone", "Height", Q_NULLPTR)); + TLRadius->setText(QApplication::translate("CreateZone", "Radius", Q_NULLPTR)); + TLZaxis->setText(QApplication::translate("CreateZone", "Z axis", Q_NULLPTR)); + TLYaxis->setText(QApplication::translate("CreateZone", "Y axis", Q_NULLPTR)); + TLXaxis->setText(QApplication::translate("CreateZone", "X axis", Q_NULLPTR)); + TLYbase->setText(QApplication::translate("CreateZone", "Y base", Q_NULLPTR)); + TLZbase->setText(QApplication::translate("CreateZone", "Z base", Q_NULLPTR)); + TLXbase->setText(QApplication::translate("CreateZone", "X base", Q_NULLPTR)); + gBPipe->setTitle(QApplication::translate("CreateZone", "Coordinates", Q_NULLPTR)); + TLHaut_p->setText(QApplication::translate("CreateZone", "Height", Q_NULLPTR)); + TLXbase_p->setText(QApplication::translate("CreateZone", "X base", Q_NULLPTR)); + TLRadius_int->setText(QApplication::translate("CreateZone", "Internal radius", Q_NULLPTR)); + TLZbase_p->setText(QApplication::translate("CreateZone", "Z base", Q_NULLPTR)); + TLYbase_p->setText(QApplication::translate("CreateZone", "Y base", Q_NULLPTR)); + TLXaxis_p->setText(QApplication::translate("CreateZone", "X axis", Q_NULLPTR)); + TLYaxis_p->setText(QApplication::translate("CreateZone", "Y axis", Q_NULLPTR)); + TLZaxis_p->setText(QApplication::translate("CreateZone", "Z axis", Q_NULLPTR)); + TLRadius_ext->setText(QApplication::translate("CreateZone", "External radius", Q_NULLPTR)); + GBButtons->setTitle(QString()); + buttonHelp->setText(QApplication::translate("CreateZone", "Help", Q_NULLPTR)); + buttonCancel->setText(QApplication::translate("CreateZone", "Cancel", Q_NULLPTR)); + buttonApply->setText(QApplication::translate("CreateZone", "Apply", Q_NULLPTR)); + buttonOk->setText(QApplication::translate("CreateZone", "OK", Q_NULLPTR)); + } // retranslateUi + +}; + +namespace Ui { + class CreateZone: public Ui_CreateZone {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_CREATEZONE_H diff --git a/src/ADAPTGUI/ui_EditFile.h b/src/ADAPTGUI/ui_EditFile.h new file mode 100644 index 000000000..9c2aceb1d --- /dev/null +++ b/src/ADAPTGUI/ui_EditFile.h @@ -0,0 +1,121 @@ +/******************************************************************************** +** Form generated from reading UI file 'EditFile.ui' +** +** Created by: Qt User Interface Compiler version 5.9.1 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_EDITFILE_H +#define UI_EDITFILE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_EditFile +{ +public: + QGridLayout *gridLayout; + QSpacerItem *spacerItem; + QGroupBox *GroupButtons; + QGridLayout *gridLayout1; + QPushButton *buttonPrint; + QPushButton *buttonQuit; + QSpacerItem *spacerItem1; + QTextBrowser *QTBEditFile; + + void setupUi(QWidget *EditFile) + { + if (EditFile->objectName().isEmpty()) + EditFile->setObjectName(QStringLiteral("EditFile")); + EditFile->resize(675, 901); + gridLayout = new QGridLayout(EditFile); +#ifndef Q_OS_MAC + gridLayout->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout->setObjectName(QStringLiteral("gridLayout")); + spacerItem = new QSpacerItem(331, 49, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout->addItem(spacerItem, 2, 1, 1, 1); + + GroupButtons = new QGroupBox(EditFile); + GroupButtons->setObjectName(QStringLiteral("GroupButtons")); + gridLayout1 = new QGridLayout(GroupButtons); +#ifndef Q_OS_MAC + gridLayout1->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout1->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); + buttonPrint = new QPushButton(GroupButtons); + buttonPrint->setObjectName(QStringLiteral("buttonPrint")); + buttonPrint->setAutoDefault(false); + buttonPrint->setFlat(false); + + gridLayout1->addWidget(buttonPrint, 0, 1, 1, 1); + + buttonQuit = new QPushButton(GroupButtons); + buttonQuit->setObjectName(QStringLiteral("buttonQuit")); + buttonQuit->setAutoDefault(false); + buttonQuit->setFlat(false); + + gridLayout1->addWidget(buttonQuit, 0, 0, 1, 1); + + + gridLayout->addWidget(GroupButtons, 2, 0, 1, 1); + + spacerItem1 = new QSpacerItem(20, 14, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout->addItem(spacerItem1, 1, 0, 1, 2); + + QTBEditFile = new QTextBrowser(EditFile); + QTBEditFile->setObjectName(QStringLiteral("QTBEditFile")); + QTBEditFile->setMinimumSize(QSize(530, 800)); + QFont font; + font.setFamily(QStringLiteral("Courier New")); + QTBEditFile->setFont(font); + + gridLayout->addWidget(QTBEditFile, 0, 0, 1, 2); + + + retranslateUi(EditFile); + + buttonPrint->setDefault(false); + buttonQuit->setDefault(true); + + + QMetaObject::connectSlotsByName(EditFile); + } // setupUi + + void retranslateUi(QWidget *EditFile) + { + EditFile->setWindowTitle(QApplication::translate("EditFile", "Edit a file", Q_NULLPTR)); + GroupButtons->setTitle(QString()); + buttonPrint->setText(QApplication::translate("EditFile", "Print", Q_NULLPTR)); + buttonQuit->setText(QApplication::translate("EditFile", "Quit", Q_NULLPTR)); + } // retranslateUi + +}; + +namespace Ui { + class EditFile: public Ui_EditFile {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_EDITFILE_H diff --git a/src/ADAPTGUI/ui_IterInfo.h b/src/ADAPTGUI/ui_IterInfo.h new file mode 100644 index 000000000..efffe0eaf --- /dev/null +++ b/src/ADAPTGUI/ui_IterInfo.h @@ -0,0 +1,155 @@ +/******************************************************************************** +** Form generated from reading UI file 'IterInfo.ui' +** +** Created by: Qt User Interface Compiler version 5.9.1 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_ITERINFO_H +#define UI_ITERINFO_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_IterInfo +{ +public: + QGridLayout *gridLayout_2; + QGroupBox *GBOptions; + QGridLayout *gridLayout; + QCheckBox *CBQuality; + QCheckBox *CBConnection; + QCheckBox *CBDiametre; + QCheckBox *CBBlockSize; + QCheckBox *CBEntanglement; + QGroupBox *GroupButtons; + QGridLayout *gridLayout1; + QPushButton *buttonHelp; + QPushButton *buttonApply; + QPushButton *buttonOk; + QPushButton *buttonCancel; + + void setupUi(QDialog *IterInfo) + { + if (IterInfo->objectName().isEmpty()) + IterInfo->setObjectName(QStringLiteral("IterInfo")); + IterInfo->resize(420, 220); + QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(IterInfo->sizePolicy().hasHeightForWidth()); + IterInfo->setSizePolicy(sizePolicy); + IterInfo->setAutoFillBackground(true); + gridLayout_2 = new QGridLayout(IterInfo); + gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); + GBOptions = new QGroupBox(IterInfo); + GBOptions->setObjectName(QStringLiteral("GBOptions")); + gridLayout = new QGridLayout(GBOptions); + gridLayout->setObjectName(QStringLiteral("gridLayout")); + CBQuality = new QCheckBox(GBOptions); + CBQuality->setObjectName(QStringLiteral("CBQuality")); + + gridLayout->addWidget(CBQuality, 0, 0, 1, 1); + + CBConnection = new QCheckBox(GBOptions); + CBConnection->setObjectName(QStringLiteral("CBConnection")); + + gridLayout->addWidget(CBConnection, 0, 1, 1, 1); + + CBDiametre = new QCheckBox(GBOptions); + CBDiametre->setObjectName(QStringLiteral("CBDiametre")); + + gridLayout->addWidget(CBDiametre, 1, 0, 1, 1); + + CBBlockSize = new QCheckBox(GBOptions); + CBBlockSize->setObjectName(QStringLiteral("CBBlockSize")); + + gridLayout->addWidget(CBBlockSize, 1, 1, 1, 1); + + CBEntanglement = new QCheckBox(GBOptions); + CBEntanglement->setObjectName(QStringLiteral("CBEntanglement")); + + gridLayout->addWidget(CBEntanglement, 2, 0, 1, 2); + + + gridLayout_2->addWidget(GBOptions, 0, 0, 2, 2); + + GroupButtons = new QGroupBox(IterInfo); + GroupButtons->setObjectName(QStringLiteral("GroupButtons")); + gridLayout1 = new QGridLayout(GroupButtons); +#ifndef Q_OS_MAC + gridLayout1->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout1->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); + buttonHelp = new QPushButton(GroupButtons); + buttonHelp->setObjectName(QStringLiteral("buttonHelp")); + buttonHelp->setAutoDefault(false); + + gridLayout1->addWidget(buttonHelp, 0, 4, 1, 1); + + buttonApply = new QPushButton(GroupButtons); + buttonApply->setObjectName(QStringLiteral("buttonApply")); + buttonApply->setAutoDefault(false); + + gridLayout1->addWidget(buttonApply, 0, 1, 1, 1); + + buttonOk = new QPushButton(GroupButtons); + buttonOk->setObjectName(QStringLiteral("buttonOk")); + buttonOk->setAutoDefault(false); + + gridLayout1->addWidget(buttonOk, 0, 0, 1, 1); + + buttonCancel = new QPushButton(GroupButtons); + buttonCancel->setObjectName(QStringLiteral("buttonCancel")); + buttonCancel->setAutoDefault(false); + + gridLayout1->addWidget(buttonCancel, 0, 2, 1, 1); + + + gridLayout_2->addWidget(GroupButtons, 2, 0, 1, 2); + + + retranslateUi(IterInfo); + + QMetaObject::connectSlotsByName(IterInfo); + } // setupUi + + void retranslateUi(QDialog *IterInfo) + { + IterInfo->setWindowTitle(QApplication::translate("IterInfo", "Information on a mesh", Q_NULLPTR)); + GBOptions->setTitle(QApplication::translate("IterInfo", "Options", Q_NULLPTR)); + CBQuality->setText(QApplication::translate("IterInfo", "Quality", Q_NULLPTR)); + CBConnection->setText(QApplication::translate("IterInfo", "Connection", Q_NULLPTR)); + CBDiametre->setText(QApplication::translate("IterInfo", "Diametre", Q_NULLPTR)); + CBBlockSize->setText(QApplication::translate("IterInfo", "Group size", Q_NULLPTR)); + CBEntanglement->setText(QApplication::translate("IterInfo", "Entanglement", Q_NULLPTR)); + GroupButtons->setTitle(QString()); + buttonHelp->setText(QApplication::translate("IterInfo", "Help", Q_NULLPTR)); + buttonApply->setText(QApplication::translate("IterInfo", "Apply", Q_NULLPTR)); + buttonOk->setText(QApplication::translate("IterInfo", "OK", Q_NULLPTR)); + buttonCancel->setText(QApplication::translate("IterInfo", "Cancel", Q_NULLPTR)); + } // retranslateUi + +}; + +namespace Ui { + class IterInfo: public Ui_IterInfo {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_ITERINFO_H diff --git a/src/ADAPTGUI/ui_MeshInfo.h b/src/ADAPTGUI/ui_MeshInfo.h new file mode 100644 index 000000000..b4d3e408f --- /dev/null +++ b/src/ADAPTGUI/ui_MeshInfo.h @@ -0,0 +1,269 @@ +/******************************************************************************** +** Form generated from reading UI file 'MeshInfo.ui' +** +** Created by: Qt User Interface Compiler version 5.9.1 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_MESHINFO_H +#define UI_MESHINFO_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_MeshInfo +{ +public: + QGridLayout *gridLayout_2; + QHBoxLayout *hboxLayout; + QLabel *Name; + QLineEdit *LECaseName; + QHBoxLayout *hboxLayout1; + QLabel *Directory; + QPushButton *PushDir; + QLineEdit *LEDirName; + QSpacerItem *spacerItem; + QHBoxLayout *hboxLayout2; + QLabel *Mesh_2; + QPushButton *PushFichier; + QLineEdit *LEFileName; + QSpacerItem *spacerItem1; + QGroupBox *GBOptions; + QGridLayout *gridLayout; + QCheckBox *CBQuality; + QCheckBox *CBConnection; + QCheckBox *CBDiametre; + QCheckBox *CBBlockSize; + QCheckBox *CBEntanglement; + QSpacerItem *verticalSpacer; + QGroupBox *GroupButtons; + QGridLayout *gridLayout1; + QPushButton *buttonHelp; + QPushButton *buttonApply; + QPushButton *buttonOk; + QPushButton *buttonCancel; + QSpacerItem *spacer_2; + + void setupUi(QDialog *MeshInfo) + { + if (MeshInfo->objectName().isEmpty()) + MeshInfo->setObjectName(QStringLiteral("MeshInfo")); + MeshInfo->resize(536, 372); + QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(MeshInfo->sizePolicy().hasHeightForWidth()); + MeshInfo->setSizePolicy(sizePolicy); + MeshInfo->setAutoFillBackground(true); + gridLayout_2 = new QGridLayout(MeshInfo); + gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); + hboxLayout = new QHBoxLayout(); +#ifndef Q_OS_MAC + hboxLayout->setSpacing(6); +#endif +#ifndef Q_OS_MAC + hboxLayout->setContentsMargins(0, 0, 0, 0); +#endif + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); + Name = new QLabel(MeshInfo); + Name->setObjectName(QStringLiteral("Name")); + + hboxLayout->addWidget(Name); + + LECaseName = new QLineEdit(MeshInfo); + LECaseName->setObjectName(QStringLiteral("LECaseName")); + LECaseName->setMinimumSize(QSize(382, 21)); + + hboxLayout->addWidget(LECaseName); + + + gridLayout_2->addLayout(hboxLayout, 0, 0, 1, 2); + + hboxLayout1 = new QHBoxLayout(); +#ifndef Q_OS_MAC + hboxLayout1->setSpacing(6); +#endif + hboxLayout1->setContentsMargins(0, 0, 0, 0); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); + Directory = new QLabel(MeshInfo); + Directory->setObjectName(QStringLiteral("Directory")); + + hboxLayout1->addWidget(Directory); + + PushDir = new QPushButton(MeshInfo); + PushDir->setObjectName(QStringLiteral("PushDir")); + PushDir->setAutoDefault(false); + + hboxLayout1->addWidget(PushDir); + + LEDirName = new QLineEdit(MeshInfo); + LEDirName->setObjectName(QStringLiteral("LEDirName")); + LEDirName->setMinimumSize(QSize(382, 21)); + + hboxLayout1->addWidget(LEDirName); + + + gridLayout_2->addLayout(hboxLayout1, 1, 0, 1, 2); + + spacerItem = new QSpacerItem(20, 18, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout_2->addItem(spacerItem, 2, 0, 1, 1); + + hboxLayout2 = new QHBoxLayout(); +#ifndef Q_OS_MAC + hboxLayout2->setSpacing(6); +#endif + hboxLayout2->setContentsMargins(0, 0, 0, 0); + hboxLayout2->setObjectName(QStringLiteral("hboxLayout2")); + Mesh_2 = new QLabel(MeshInfo); + Mesh_2->setObjectName(QStringLiteral("Mesh_2")); + + hboxLayout2->addWidget(Mesh_2); + + PushFichier = new QPushButton(MeshInfo); + PushFichier->setObjectName(QStringLiteral("PushFichier")); + PushFichier->setAutoDefault(false); + + hboxLayout2->addWidget(PushFichier); + + LEFileName = new QLineEdit(MeshInfo); + LEFileName->setObjectName(QStringLiteral("LEFileName")); + LEFileName->setMinimumSize(QSize(382, 21)); + + hboxLayout2->addWidget(LEFileName); + + + gridLayout_2->addLayout(hboxLayout2, 3, 0, 1, 2); + + spacerItem1 = new QSpacerItem(20, 1, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout_2->addItem(spacerItem1, 4, 0, 1, 1); + + GBOptions = new QGroupBox(MeshInfo); + GBOptions->setObjectName(QStringLiteral("GBOptions")); + gridLayout = new QGridLayout(GBOptions); + gridLayout->setObjectName(QStringLiteral("gridLayout")); + CBQuality = new QCheckBox(GBOptions); + CBQuality->setObjectName(QStringLiteral("CBQuality")); + + gridLayout->addWidget(CBQuality, 0, 0, 1, 1); + + CBConnection = new QCheckBox(GBOptions); + CBConnection->setObjectName(QStringLiteral("CBConnection")); + + gridLayout->addWidget(CBConnection, 0, 1, 1, 1); + + CBDiametre = new QCheckBox(GBOptions); + CBDiametre->setObjectName(QStringLiteral("CBDiametre")); + + gridLayout->addWidget(CBDiametre, 1, 0, 1, 1); + + CBBlockSize = new QCheckBox(GBOptions); + CBBlockSize->setObjectName(QStringLiteral("CBBlockSize")); + + gridLayout->addWidget(CBBlockSize, 1, 1, 1, 1); + + CBEntanglement = new QCheckBox(GBOptions); + CBEntanglement->setObjectName(QStringLiteral("CBEntanglement")); + + gridLayout->addWidget(CBEntanglement, 2, 0, 1, 2); + + + gridLayout_2->addWidget(GBOptions, 5, 0, 1, 1); + + verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout_2->addItem(verticalSpacer, 6, 0, 1, 1); + + GroupButtons = new QGroupBox(MeshInfo); + GroupButtons->setObjectName(QStringLiteral("GroupButtons")); + gridLayout1 = new QGridLayout(GroupButtons); +#ifndef Q_OS_MAC + gridLayout1->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout1->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); + buttonHelp = new QPushButton(GroupButtons); + buttonHelp->setObjectName(QStringLiteral("buttonHelp")); + buttonHelp->setAutoDefault(false); + + gridLayout1->addWidget(buttonHelp, 0, 4, 1, 1); + + buttonApply = new QPushButton(GroupButtons); + buttonApply->setObjectName(QStringLiteral("buttonApply")); + buttonApply->setAutoDefault(false); + + gridLayout1->addWidget(buttonApply, 0, 1, 1, 1); + + buttonOk = new QPushButton(GroupButtons); + buttonOk->setObjectName(QStringLiteral("buttonOk")); + buttonOk->setAutoDefault(false); + + gridLayout1->addWidget(buttonOk, 0, 0, 1, 1); + + buttonCancel = new QPushButton(GroupButtons); + buttonCancel->setObjectName(QStringLiteral("buttonCancel")); + buttonCancel->setAutoDefault(false); + + gridLayout1->addWidget(buttonCancel, 0, 2, 1, 1); + + + gridLayout_2->addWidget(GroupButtons, 7, 0, 1, 1); + + spacer_2 = new QSpacerItem(128, 25, QSizePolicy::Fixed, QSizePolicy::Minimum); + + gridLayout_2->addItem(spacer_2, 7, 1, 1, 1); + + + retranslateUi(MeshInfo); + + QMetaObject::connectSlotsByName(MeshInfo); + } // setupUi + + void retranslateUi(QDialog *MeshInfo) + { + MeshInfo->setWindowTitle(QApplication::translate("MeshInfo", "Information on a mesh", Q_NULLPTR)); + Name->setText(QApplication::translate("MeshInfo", "Name", Q_NULLPTR)); + Directory->setText(QApplication::translate("MeshInfo", "Directory", Q_NULLPTR)); + PushDir->setText(QString()); + Mesh_2->setText(QApplication::translate("MeshInfo", "Mesh", Q_NULLPTR)); + PushFichier->setText(QString()); + GBOptions->setTitle(QApplication::translate("MeshInfo", "Options", Q_NULLPTR)); + CBQuality->setText(QApplication::translate("MeshInfo", "Quality", Q_NULLPTR)); + CBConnection->setText(QApplication::translate("MeshInfo", "Connection", Q_NULLPTR)); + CBDiametre->setText(QApplication::translate("MeshInfo", "Diametre", Q_NULLPTR)); + CBBlockSize->setText(QApplication::translate("MeshInfo", "Group size", Q_NULLPTR)); + CBEntanglement->setText(QApplication::translate("MeshInfo", "Entanglement", Q_NULLPTR)); + GroupButtons->setTitle(QString()); + buttonHelp->setText(QApplication::translate("MeshInfo", "Help", Q_NULLPTR)); + buttonApply->setText(QApplication::translate("MeshInfo", "Apply", Q_NULLPTR)); + buttonOk->setText(QApplication::translate("MeshInfo", "OK", Q_NULLPTR)); + buttonCancel->setText(QApplication::translate("MeshInfo", "Cancel", Q_NULLPTR)); + } // retranslateUi + +}; + +namespace Ui { + class MeshInfo: public Ui_MeshInfo {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_MESHINFO_H diff --git a/src/ADAPTGUI/ui_PursueIteration.h b/src/ADAPTGUI/ui_PursueIteration.h new file mode 100644 index 000000000..a9dfec8cb --- /dev/null +++ b/src/ADAPTGUI/ui_PursueIteration.h @@ -0,0 +1,257 @@ +/******************************************************************************** +** Form generated from reading UI file 'PursueIteration.ui' +** +** Created by: Qt User Interface Compiler version 5.9.1 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_PURSUEITERATION_H +#define UI_PURSUEITERATION_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_PursueIteration +{ +public: + QGridLayout *gridLayout_2; + QHBoxLayout *hboxLayout; + QLabel *Name; + QLineEdit *LECaseName; + QHBoxLayout *_2; + QLabel *Directory; + QPushButton *PushDir; + QLineEdit *LEDirName; + QRadioButton *RBIteration; + QRadioButton *RBCase; + QHBoxLayout *hboxLayout1; + QLabel *DirectoryStart; + QPushButton *PushDirStart; + QLineEdit *LEDirNameStart; + QGroupBox *GBIterationintoCase; + QGridLayout *gridLayout; + QRadioButton *RBCaseLastIteration; + QRadioButton *RBCaseNIteration; + QSpinBox *SpinBoxNumber; + QGroupBox *GroupButtons; + QGridLayout *gridLayout1; + QPushButton *buttonHelp; + QPushButton *buttonApply; + QPushButton *buttonOk; + QPushButton *buttonCancel; + QSpacerItem *spacer_2; + + void setupUi(QDialog *PursueIteration) + { + if (PursueIteration->objectName().isEmpty()) + PursueIteration->setObjectName(QStringLiteral("PursueIteration")); + PursueIteration->resize(601, 300); + QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(PursueIteration->sizePolicy().hasHeightForWidth()); + PursueIteration->setSizePolicy(sizePolicy); + PursueIteration->setAutoFillBackground(true); + gridLayout_2 = new QGridLayout(PursueIteration); + gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); + hboxLayout = new QHBoxLayout(); +#ifndef Q_OS_MAC + hboxLayout->setSpacing(6); +#endif +#ifndef Q_OS_MAC + hboxLayout->setContentsMargins(0, 0, 0, 0); +#endif + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); + Name = new QLabel(PursueIteration); + Name->setObjectName(QStringLiteral("Name")); + + hboxLayout->addWidget(Name); + + LECaseName = new QLineEdit(PursueIteration); + LECaseName->setObjectName(QStringLiteral("LECaseName")); + LECaseName->setMinimumSize(QSize(382, 21)); + + hboxLayout->addWidget(LECaseName); + + + gridLayout_2->addLayout(hboxLayout, 0, 0, 1, 2); + + _2 = new QHBoxLayout(); +#ifndef Q_OS_MAC + _2->setSpacing(6); +#endif + _2->setContentsMargins(0, 0, 0, 0); + _2->setObjectName(QStringLiteral("_2")); + Directory = new QLabel(PursueIteration); + Directory->setObjectName(QStringLiteral("Directory")); + + _2->addWidget(Directory); + + PushDir = new QPushButton(PursueIteration); + PushDir->setObjectName(QStringLiteral("PushDir")); + PushDir->setAutoDefault(false); + + _2->addWidget(PushDir); + + LEDirName = new QLineEdit(PursueIteration); + LEDirName->setObjectName(QStringLiteral("LEDirName")); + LEDirName->setMinimumSize(QSize(382, 21)); + + _2->addWidget(LEDirName); + + + gridLayout_2->addLayout(_2, 1, 0, 1, 3); + + RBIteration = new QRadioButton(PursueIteration); + RBIteration->setObjectName(QStringLiteral("RBIteration")); + RBIteration->setChecked(true); + + gridLayout_2->addWidget(RBIteration, 2, 0, 1, 1); + + RBCase = new QRadioButton(PursueIteration); + RBCase->setObjectName(QStringLiteral("RBCase")); + + gridLayout_2->addWidget(RBCase, 2, 1, 1, 1); + + hboxLayout1 = new QHBoxLayout(); +#ifndef Q_OS_MAC + hboxLayout1->setSpacing(6); +#endif + hboxLayout1->setContentsMargins(0, 0, 0, 0); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); + DirectoryStart = new QLabel(PursueIteration); + DirectoryStart->setObjectName(QStringLiteral("DirectoryStart")); + + hboxLayout1->addWidget(DirectoryStart); + + PushDirStart = new QPushButton(PursueIteration); + PushDirStart->setObjectName(QStringLiteral("PushDirStart")); + PushDirStart->setAutoDefault(false); + + hboxLayout1->addWidget(PushDirStart); + + LEDirNameStart = new QLineEdit(PursueIteration); + LEDirNameStart->setObjectName(QStringLiteral("LEDirNameStart")); + LEDirNameStart->setMinimumSize(QSize(382, 21)); + + hboxLayout1->addWidget(LEDirNameStart); + + + gridLayout_2->addLayout(hboxLayout1, 3, 0, 1, 3); + + GBIterationintoCase = new QGroupBox(PursueIteration); + GBIterationintoCase->setObjectName(QStringLiteral("GBIterationintoCase")); + gridLayout = new QGridLayout(GBIterationintoCase); + gridLayout->setObjectName(QStringLiteral("gridLayout")); + RBCaseLastIteration = new QRadioButton(GBIterationintoCase); + RBCaseLastIteration->setObjectName(QStringLiteral("RBCaseLastIteration")); + RBCaseLastIteration->setChecked(true); + + gridLayout->addWidget(RBCaseLastIteration, 0, 0, 1, 1); + + RBCaseNIteration = new QRadioButton(GBIterationintoCase); + RBCaseNIteration->setObjectName(QStringLiteral("RBCaseNIteration")); + + gridLayout->addWidget(RBCaseNIteration, 1, 0, 1, 1); + + SpinBoxNumber = new QSpinBox(GBIterationintoCase); + SpinBoxNumber->setObjectName(QStringLiteral("SpinBoxNumber")); + SpinBoxNumber->setMaximum(1789); + + gridLayout->addWidget(SpinBoxNumber, 1, 1, 1, 1); + + + gridLayout_2->addWidget(GBIterationintoCase, 4, 0, 1, 2); + + GroupButtons = new QGroupBox(PursueIteration); + GroupButtons->setObjectName(QStringLiteral("GroupButtons")); + gridLayout1 = new QGridLayout(GroupButtons); +#ifndef Q_OS_MAC + gridLayout1->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout1->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); + buttonHelp = new QPushButton(GroupButtons); + buttonHelp->setObjectName(QStringLiteral("buttonHelp")); + buttonHelp->setAutoDefault(false); + + gridLayout1->addWidget(buttonHelp, 0, 4, 1, 1); + + buttonApply = new QPushButton(GroupButtons); + buttonApply->setObjectName(QStringLiteral("buttonApply")); + buttonApply->setAutoDefault(false); + + gridLayout1->addWidget(buttonApply, 0, 1, 1, 1); + + buttonOk = new QPushButton(GroupButtons); + buttonOk->setObjectName(QStringLiteral("buttonOk")); + buttonOk->setAutoDefault(false); + + gridLayout1->addWidget(buttonOk, 0, 0, 1, 1); + + buttonCancel = new QPushButton(GroupButtons); + buttonCancel->setObjectName(QStringLiteral("buttonCancel")); + buttonCancel->setAutoDefault(false); + + gridLayout1->addWidget(buttonCancel, 0, 2, 1, 1); + + + gridLayout_2->addWidget(GroupButtons, 5, 0, 1, 2); + + spacer_2 = new QSpacerItem(128, 25, QSizePolicy::Fixed, QSizePolicy::Minimum); + + gridLayout_2->addItem(spacer_2, 5, 2, 1, 1); + + + retranslateUi(PursueIteration); + + QMetaObject::connectSlotsByName(PursueIteration); + } // setupUi + + void retranslateUi(QDialog *PursueIteration) + { + PursueIteration->setWindowTitle(QApplication::translate("PursueIteration", "Pursue an iteration", Q_NULLPTR)); + Name->setText(QApplication::translate("PursueIteration", "Name", Q_NULLPTR)); + Directory->setText(QApplication::translate("PursueIteration", "Directory", Q_NULLPTR)); + PushDir->setText(QString()); + RBIteration->setText(QApplication::translate("PursueIteration", "From an iteration", Q_NULLPTR)); + RBCase->setText(QApplication::translate("PursueIteration", "From a case", Q_NULLPTR)); + DirectoryStart->setText(QApplication::translate("PursueIteration", "Directory", Q_NULLPTR)); + PushDirStart->setText(QString()); + GBIterationintoCase->setTitle(QApplication::translate("PursueIteration", "Iteration into the case", Q_NULLPTR)); + RBCaseLastIteration->setText(QApplication::translate("PursueIteration", "Last iteration", Q_NULLPTR)); + RBCaseNIteration->setText(QApplication::translate("PursueIteration", "Iteration number", Q_NULLPTR)); + GroupButtons->setTitle(QString()); + buttonHelp->setText(QApplication::translate("PursueIteration", "Help", Q_NULLPTR)); + buttonApply->setText(QApplication::translate("PursueIteration", "Apply", Q_NULLPTR)); + buttonOk->setText(QApplication::translate("PursueIteration", "OK", Q_NULLPTR)); + buttonCancel->setText(QApplication::translate("PursueIteration", "Cancel", Q_NULLPTR)); + } // retranslateUi + +}; + +namespace Ui { + class PursueIteration: public Ui_PursueIteration {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_PURSUEITERATION_H From aa70584c33cb1ac88f809e2a995f097e736a99a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Wed, 27 May 2020 17:02:03 +0200 Subject: [PATCH 027/100] incmude des ui --- src/ADAPTGUI/CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ADAPTGUI/CMakeLists.txt b/src/ADAPTGUI/CMakeLists.txt index ee193c6af..26c8e966d 100644 --- a/src/ADAPTGUI/CMakeLists.txt +++ b/src/ADAPTGUI/CMakeLists.txt @@ -113,6 +113,19 @@ SET(_moc_HEADERS MonCreateYACS.h MonEditYACS.h MonEditFile.h +ui_CreateBoundaryAn.h +ui_CreateBoundaryCAO.h +ui_CreateBoundaryDi.h +ui_CreateCase.h +ui_CreateHypothesis.h +ui_CreateIteration.h +ui_CreateListGroup.h +ui_CreateYACS.h +ui_CreateZone.h +ui_EditFile.h +ui_IterInfo.h +ui_MeshInfo.h +ui_PursueIteration.h ) # header files / uic wrappings From 029e6c0c457fbd846fc3d5ee27f2b63f6d34656e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Thu, 28 May 2020 10:40:28 +0200 Subject: [PATCH 028/100] changement homardGen ==> adaptGen --- src/ADAPTGUI/MonCreateBoundaryAn.cxx | 24 ++++----- src/ADAPTGUI/MonCreateBoundaryAn.h | 6 +-- src/ADAPTGUI/MonCreateBoundaryCAO.cxx | 12 ++--- src/ADAPTGUI/MonCreateBoundaryCAO.h | 4 +- src/ADAPTGUI/MonCreateBoundaryDi.cxx | 12 ++--- src/ADAPTGUI/MonCreateBoundaryDi.h | 4 +- src/ADAPTGUI/MonCreateCase.cxx | 72 ++++++++++++++------------ src/ADAPTGUI/MonCreateCase.h | 4 +- src/ADAPTGUI/MonCreateHypothesis.cxx | 18 +++---- src/ADAPTGUI/MonCreateHypothesis.h | 6 +-- src/ADAPTGUI/MonCreateIteration.cxx | 24 ++++----- src/ADAPTGUI/MonCreateIteration.h | 6 +-- src/ADAPTGUI/MonCreateListGroup.cxx | 12 ++--- src/ADAPTGUI/MonCreateListGroup.h | 6 +-- src/ADAPTGUI/MonCreateListGroupCAO.cxx | 12 ++--- src/ADAPTGUI/MonCreateListGroupCAO.h | 6 +-- src/ADAPTGUI/MonCreateYACS.cxx | 22 ++++---- src/ADAPTGUI/MonCreateYACS.h | 6 +-- src/ADAPTGUI/MonCreateZone.cxx | 40 +++++++------- src/ADAPTGUI/MonCreateZone.h | 6 +-- src/ADAPTGUI/MonEditBoundaryAn.cxx | 12 ++--- src/ADAPTGUI/MonEditBoundaryAn.h | 2 +- src/ADAPTGUI/MonEditBoundaryCAO.cxx | 10 ++-- src/ADAPTGUI/MonEditBoundaryCAO.h | 2 +- src/ADAPTGUI/MonEditBoundaryDi.cxx | 10 ++-- src/ADAPTGUI/MonEditBoundaryDi.h | 2 +- src/ADAPTGUI/MonEditCase.cxx | 10 ++-- src/ADAPTGUI/MonEditCase.h | 2 +- src/ADAPTGUI/MonEditFile.cxx | 2 +- src/ADAPTGUI/MonEditFile.h | 4 +- src/ADAPTGUI/MonEditHypothesis.cxx | 10 ++-- src/ADAPTGUI/MonEditHypothesis.h | 2 +- src/ADAPTGUI/MonEditIteration.cxx | 12 ++--- src/ADAPTGUI/MonEditIteration.h | 2 +- src/ADAPTGUI/MonEditListGroup.cxx | 4 +- src/ADAPTGUI/MonEditListGroup.h | 2 +- src/ADAPTGUI/MonEditListGroupCAO.cxx | 4 +- src/ADAPTGUI/MonEditListGroupCAO.h | 2 +- src/ADAPTGUI/MonEditYACS.cxx | 8 +-- src/ADAPTGUI/MonEditYACS.h | 2 +- src/ADAPTGUI/MonEditZone.cxx | 8 +-- src/ADAPTGUI/MonEditZone.h | 2 +- src/ADAPTGUI/MonIterInfo.cxx | 10 ++-- src/ADAPTGUI/MonIterInfo.h | 6 +-- src/ADAPTGUI/MonMeshInfo.cxx | 18 +++---- src/ADAPTGUI/MonMeshInfo.h | 4 +- src/ADAPTGUI/MonPursueIteration.cxx | 16 +++--- src/ADAPTGUI/MonPursueIteration.h | 4 +- src/SMESHGUI/SMESHGUI_AdaptDlg.cxx | 6 +-- 49 files changed, 244 insertions(+), 236 deletions(-) diff --git a/src/ADAPTGUI/MonCreateBoundaryAn.cxx b/src/ADAPTGUI/MonCreateBoundaryAn.cxx index a9a4880ee..c7f79c436 100644 --- a/src/ADAPTGUI/MonCreateBoundaryAn.cxx +++ b/src/ADAPTGUI/MonCreateBoundaryAn.cxx @@ -41,7 +41,7 @@ using namespace std; // ------------------------------------------------------------------------------------------------------------------------ MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen0, + ADAPT::ADAPT_Gen_var myAdaptGen0, QString caseName) : // ------------------------------------------------------------------------------------------------------------------------------ /* Constructs a MonCreateBoundaryAn @@ -67,7 +67,7 @@ MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, bool modal, Chgt (false) { MESSAGE("Constructeur") ; - myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0); + myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0); setupUi(this); setModal(modal); @@ -103,12 +103,12 @@ MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, bool modal, } // -------------------------------------------------------------------------------------------------------------- MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, - ADAPT::ADAPT_Gen_var myHomardGen0, + ADAPT::ADAPT_Gen_var myAdaptGen0, QString caseName): // -------------------------------------------------------------------------------------------------------------- // QDialog(0), Ui_CreateBoundaryAn(), - myHomardGen(myHomardGen0), + myAdaptGen(myAdaptGen0), _parent(parent), _Name (""), _aCaseName(caseName), @@ -172,7 +172,7 @@ void MonCreateBoundaryAn::InitValBoundaryAn() // if (_aCaseName == QString("")) { return; } - ADAPT::HOMARD_Cas_var aCas = myHomardGen->GetCase(_aCaseName.toStdString().c_str()); + ADAPT::HOMARD_Cas_var aCas = myAdaptGen->GetCase(_aCaseName.toStdString().c_str()); ADAPT::extrema_var MesExtremes = aCas->GetBoundingBox(); int num = MesExtremes->length() ; ASSERT(num == 10); @@ -456,29 +456,29 @@ bool MonCreateBoundaryAn::CreateOrUpdateBoundaryAn() switch (_Type) { case 1 : // il s agit d un cylindre - { aBoundaryAn = myHomardGen->CreateBoundaryCylinder(CORBA::string_dup(_Name.toStdString().c_str()), \ + { aBoundaryAn = myAdaptGen->CreateBoundaryCylinder(CORBA::string_dup(_Name.toStdString().c_str()), \ _BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnXaxis, _BoundaryAnYaxis, _BoundaryAnZaxis, _BoundaryAnRayon ); break; } case 2 : // il s agit d une sphere - { aBoundaryAn = myHomardGen->CreateBoundarySphere(CORBA::string_dup(_Name.toStdString().c_str()), \ + { aBoundaryAn = myAdaptGen->CreateBoundarySphere(CORBA::string_dup(_Name.toStdString().c_str()), \ _BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnRayon); break; } case 3 : // il s agit d un cone defini par un axe et un angle - { aBoundaryAn = myHomardGen->CreateBoundaryConeA(CORBA::string_dup(_Name.toStdString().c_str()), \ + { aBoundaryAn = myAdaptGen->CreateBoundaryConeA(CORBA::string_dup(_Name.toStdString().c_str()), \ _BoundaryAnXaxisCone, _BoundaryAnYaxisCone, _BoundaryAnZaxisCone, _BoundaryAngle, \ _BoundaryAnXorigCone, _BoundaryAnYorigCone, _BoundaryAnYorigCone); break; } case 4 : // il s agit d un cone defini par les 2 rayons - { aBoundaryAn = myHomardGen->CreateBoundaryConeR(CORBA::string_dup(_Name.toStdString().c_str()), \ + { aBoundaryAn = myAdaptGen->CreateBoundaryConeR(CORBA::string_dup(_Name.toStdString().c_str()), \ _BoundaryAnXcone1, _BoundaryAnYcone1, _BoundaryAnZcone1, _BoundaryAnRayon1, \ _BoundaryAnXcone2, _BoundaryAnYcone2, _BoundaryAnZcone2, _BoundaryAnRayon2); break; } case 5 : // il s agit d un tore - { aBoundaryAn = myHomardGen->CreateBoundaryTorus(CORBA::string_dup(_Name.toStdString().c_str()), \ + { aBoundaryAn = myAdaptGen->CreateBoundaryTorus(CORBA::string_dup(_Name.toStdString().c_str()), \ _BoundaryAnToreXcentre, _BoundaryAnToreYcentre, _BoundaryAnToreZcentre, _BoundaryAnToreXaxe, _BoundaryAnToreYaxe, _BoundaryAnToreZaxe, _BoundaryAnToreRRev, _BoundaryAnToreRPri ); break; } @@ -511,7 +511,7 @@ void MonCreateBoundaryAn::PushOnOK() void MonCreateBoundaryAn::PushOnHelp() // ------------------------------------------------------------------------ { - std::string LanguageShort = myHomardGen->GetLanguageShort(); + std::string LanguageShort = myAdaptGen->GetLanguageShort(); HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("un-cylindre"), QString(LanguageShort.c_str())); } @@ -521,7 +521,7 @@ void MonCreateBoundaryAn::SetNewName() { // Recherche d'un nom par defaut qui n'existe pas encore - ADAPT::listeBoundarys_var MyObjects = myHomardGen->GetAllBoundarysName(); + ADAPT::listeBoundarys_var MyObjects = myAdaptGen->GetAllBoundarysName(); int num = 0; QString aName=""; while (aName=="" ) { diff --git a/src/ADAPTGUI/MonCreateBoundaryAn.h b/src/ADAPTGUI/MonCreateBoundaryAn.h index 2576d14fd..daadd6560 100644 --- a/src/ADAPTGUI/MonCreateBoundaryAn.h +++ b/src/ADAPTGUI/MonCreateBoundaryAn.h @@ -39,13 +39,13 @@ class HOMARD_EXPORT MonCreateBoundaryAn : public QDialog, public Ui_CreateBounda public: MonCreateBoundaryAn( MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString caseName); virtual ~MonCreateBoundaryAn(); protected : MonCreateBoundaryAn( MonCreateCase* parent, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString caseName); MonCreateCase * _parent; @@ -71,7 +71,7 @@ protected : bool Chgt; ADAPT::HOMARD_Boundary_var aBoundaryAn ; - ADAPT::ADAPT_Gen_var myHomardGen; + ADAPT::ADAPT_Gen_var myAdaptGen; virtual void InitConnect(); virtual void InitValBoundaryAn(); diff --git a/src/ADAPTGUI/MonCreateBoundaryCAO.cxx b/src/ADAPTGUI/MonCreateBoundaryCAO.cxx index da3f9d31e..aa3246e43 100644 --- a/src/ADAPTGUI/MonCreateBoundaryCAO.cxx +++ b/src/ADAPTGUI/MonCreateBoundaryCAO.cxx @@ -33,14 +33,14 @@ using namespace std; // ------------------------------------------------------------------------------- MonCreateBoundaryCAO::MonCreateBoundaryCAO(MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen0, + ADAPT::ADAPT_Gen_var myAdaptGen0, QString caseName, QString aName) // --------------------------------------------------------------------------------- /* Constructs a MonCreateBoundaryCAO */ : QDialog(0), Ui_CreateBoundaryCAO(), _parent(parent), _aName(aName), - myHomardGen(ADAPT::ADAPT_Gen::_duplicate(myHomardGen0)), + myAdaptGen(ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0)), _aCaseName(caseName) { MESSAGE("Constructeur") ; @@ -99,7 +99,7 @@ bool MonCreateBoundaryCAO::PushOnApply() try { _aName=aName; - aBoundary=myHomardGen->CreateBoundaryCAO(CORBA::string_dup(_aName.toStdString().c_str()), aCAOFile.toStdString().c_str()); + aBoundary=myAdaptGen->CreateBoundaryCAO(CORBA::string_dup(_aName.toStdString().c_str()), aCAOFile.toStdString().c_str()); _parent->AddBoundaryCAO(_aName); aBoundary->SetCaseCreation(_aCaseName.toStdString().c_str()); } @@ -130,7 +130,7 @@ void MonCreateBoundaryCAO::PushOnOK() void MonCreateBoundaryCAO::PushOnHelp() // ------------------------------------------------------------------------ { - std::string LanguageShort = myHomardGen->GetLanguageShort(); + std::string LanguageShort = myAdaptGen->GetLanguageShort(); HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("CAO"), QString(LanguageShort.c_str())); } // ------------------------------------------------------------------------ @@ -152,7 +152,7 @@ void MonCreateBoundaryCAO::SetNewName() // -------------------------------------------------- { - ADAPT::listeBoundarys_var MyObjects = myHomardGen->GetAllBoundarysName(); + ADAPT::listeBoundarys_var MyObjects = myAdaptGen->GetAllBoundarysName(); int num = 0; QString aName=""; while (aName == QString("") ) { @@ -195,7 +195,7 @@ void MonCreateBoundaryCAO::SetFiltrage() return; } - MonCreateListGroupCAO *aDlg = new MonCreateListGroupCAO(NULL, this, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen), + MonCreateListGroupCAO *aDlg = new MonCreateListGroupCAO(NULL, this, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), _aCaseName, _listeGroupesBoundary) ; aDlg->show(); } diff --git a/src/ADAPTGUI/MonCreateBoundaryCAO.h b/src/ADAPTGUI/MonCreateBoundaryCAO.h index 1d5b646e1..26b11f883 100644 --- a/src/ADAPTGUI/MonCreateBoundaryCAO.h +++ b/src/ADAPTGUI/MonCreateBoundaryCAO.h @@ -39,7 +39,7 @@ class HOMARD_EXPORT MonCreateBoundaryCAO : public QDialog, public Ui_CreateBound public: MonCreateBoundaryCAO( MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString caseName, QString BoundaryName ); ~MonCreateBoundaryCAO(); virtual void setGroups (QStringList listGroup); @@ -53,7 +53,7 @@ protected : ADAPT::HOMARD_Boundary_var aBoundary; - ADAPT::ADAPT_Gen_var myHomardGen; + ADAPT::ADAPT_Gen_var myAdaptGen; QStringList _listeGroupesBoundary; diff --git a/src/ADAPTGUI/MonCreateBoundaryDi.cxx b/src/ADAPTGUI/MonCreateBoundaryDi.cxx index 8d1158c72..5d551a1e5 100644 --- a/src/ADAPTGUI/MonCreateBoundaryDi.cxx +++ b/src/ADAPTGUI/MonCreateBoundaryDi.cxx @@ -33,14 +33,14 @@ using namespace std; // ------------------------------------------------------------------------------- MonCreateBoundaryDi::MonCreateBoundaryDi(MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen0, + ADAPT::ADAPT_Gen_var myAdaptGen0, QString caseName, QString aName) // --------------------------------------------------------------------------------- /* Constructs a MonCreateBoundaryDi */ : QDialog(0), Ui_CreateBoundaryDi(), _parent(parent), _aName(aName), - myHomardGen(ADAPT::ADAPT_Gen::_duplicate(myHomardGen0)), + myAdaptGen(ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0)), _aCaseName(caseName) { MESSAGE("Constructeur") ; @@ -108,7 +108,7 @@ bool MonCreateBoundaryDi::PushOnApply() try { _aName=aName; - aBoundary=myHomardGen->CreateBoundaryDi(CORBA::string_dup(_aName.toStdString().c_str()), aMeshName.toStdString().c_str(), aMeshFile.toStdString().c_str()); + aBoundary=myAdaptGen->CreateBoundaryDi(CORBA::string_dup(_aName.toStdString().c_str()), aMeshName.toStdString().c_str(), aMeshFile.toStdString().c_str()); _parent->AddBoundaryDi(_aName); aBoundary->SetCaseCreation(_aCaseName.toStdString().c_str()); } @@ -139,7 +139,7 @@ void MonCreateBoundaryDi::PushOnOK() void MonCreateBoundaryDi::PushOnHelp() // ------------------------------------------------------------------------ { - std::string LanguageShort = myHomardGen->GetLanguageShort(); + std::string LanguageShort = myAdaptGen->GetLanguageShort(); HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-discrete"), QString(LanguageShort.c_str())); } // ------------------------------------------------------------------------ @@ -161,7 +161,7 @@ void MonCreateBoundaryDi::SetNewName() // -------------------------------------------------- { - ADAPT::listeBoundarys_var MyObjects = myHomardGen->GetAllBoundarysName(); + ADAPT::listeBoundarys_var MyObjects = myAdaptGen->GetAllBoundarysName(); int num = 0; QString aName=""; while (aName == QString("") ) { @@ -204,7 +204,7 @@ void MonCreateBoundaryDi::SetFiltrage() return; } - MonCreateListGroup *aDlg = new MonCreateListGroup(NULL, this, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen), + MonCreateListGroup *aDlg = new MonCreateListGroup(NULL, this, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), _aCaseName, _listeGroupesBoundary) ; aDlg->show(); } diff --git a/src/ADAPTGUI/MonCreateBoundaryDi.h b/src/ADAPTGUI/MonCreateBoundaryDi.h index de99a1120..b26496321 100644 --- a/src/ADAPTGUI/MonCreateBoundaryDi.h +++ b/src/ADAPTGUI/MonCreateBoundaryDi.h @@ -39,7 +39,7 @@ class HOMARD_EXPORT MonCreateBoundaryDi : public QDialog, public Ui_CreateBounda public: MonCreateBoundaryDi( MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString caseName, QString BoundaryName ); ~MonCreateBoundaryDi(); virtual void setGroups (QStringList listGroup); @@ -53,7 +53,7 @@ protected : ADAPT::HOMARD_Boundary_var aBoundary; - ADAPT::ADAPT_Gen_var myHomardGen; + ADAPT::ADAPT_Gen_var myAdaptGen; QStringList _listeGroupesBoundary; diff --git a/src/ADAPTGUI/MonCreateCase.cxx b/src/ADAPTGUI/MonCreateCase.cxx index 3943d3ed4..5a980d4b3 100644 --- a/src/ADAPTGUI/MonCreateCase.cxx +++ b/src/ADAPTGUI/MonCreateCase.cxx @@ -46,7 +46,7 @@ using namespace std; * Sets attributes to default values */ // ----------------------------------------------------------------------------------------- -MonCreateCase::MonCreateCase( bool modal, ADAPT::ADAPT_Gen_var myHomardGen0 ) +MonCreateCase::MonCreateCase( bool modal, ADAPT::ADAPT_Gen_var myAdaptGen0 ) : Ui_CreateCase(), _aCaseName(""),_aDirName(""), @@ -54,8 +54,8 @@ MonCreateCase::MonCreateCase( bool modal, ADAPT::ADAPT_Gen_var myHomardGen0 ) _ExtType(0), _Pyram(0) { - MESSAGE("Debut du constructeur de MonCreateCase"); - myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0); + INFOS("Debut du constructeur de MonCreateCase"); + myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0); setupUi(this); setModal(modal); InitConnect(); @@ -75,7 +75,7 @@ MonCreateCase::MonCreateCase( bool modal, ADAPT::ADAPT_Gen_var myHomardGen0 ) // adjustSize(); -// MESSAGE("Fin du constructeur de MonCreateCase"); + INFOS("Fin du constructeur de MonCreateCase"); } // ------------------------------------------------------------------------ MonCreateCase::~MonCreateCase() @@ -87,6 +87,7 @@ MonCreateCase::~MonCreateCase() void MonCreateCase::InitConnect() // ------------------------------------------------------------------------ { + INFOS("Debut de InitConnect"); connect( LEName, SIGNAL(textChanged(QString)), this, SLOT(CaseNameChanged())); connect( PushDir, SIGNAL(pressed()), this, SLOT(SetDirName())); connect( PushFichier, SIGNAL(pressed()), this, SLOT(SetFileName())); @@ -124,13 +125,14 @@ void MonCreateCase::InitConnect() connect( buttonApply, SIGNAL(pressed()), this, SLOT(PushOnApply(0))); connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); connect( buttonHelp, SIGNAL(pressed()), this, SLOT(PushOnHelp())); + INFOS("Fin de InitConnect"); } // ------------------------------------------------------------------------ void MonCreateCase::InitBoundarys() // ------------------------------------------------------------------------ // Initialisation des menus avec les frontieres deja enregistrees { - MESSAGE("InitBoundarys"); + INFOS("InitBoundarys"); // Pour les frontieres analytiques : la colonne des groupes ADAPT::ListGroupType_var _listeGroupesCas = aCase->GetGroups(); QTableWidgetItem *__colItem = new QTableWidgetItem(); @@ -146,11 +148,11 @@ void MonCreateCase::InitBoundarys() // Pour les frontieres discretes : la liste a saisir // Pour les frontieres analytiques : les colonnes de chaque frontiere ADAPT::HOMARD_Boundary_var myBoundary ; - ADAPT::listeBoundarys_var mesBoundarys = myHomardGen->GetAllBoundarysName(); -// MESSAGE("Nombre de frontieres enregistrees : "<length()); + ADAPT::listeBoundarys_var mesBoundarys = myAdaptGen->GetAllBoundarysName(); +// INFOS("Nombre de frontieres enregistrees : "<length()); for (int i=0; ilength(); i++) { - myBoundary = myHomardGen->GetBoundary(mesBoundarys[i]); + myBoundary = myAdaptGen->GetBoundary(mesBoundarys[i]); int type_obj = myBoundary->GetType() ; if ( type_obj==-1 ) { CBBoundaryCAO->addItem(QString(mesBoundarys[i])); } else if ( type_obj==0 ) { CBBoundaryDi->addItem(QString(mesBoundarys[i])); } @@ -165,7 +167,7 @@ void MonCreateCase::InitBoundarys() bool MonCreateCase::PushOnApply(int option) // -------------------------------- { - MESSAGE("PushOnApply"); + INFOS("PushOnApply"); QString aCaseName=LEName->text().trimmed(); if ( aCaseName == "" ) { @@ -183,7 +185,7 @@ bool MonCreateCase::PushOnApply(int option) } if ( aDirName != _aDirName) - { QString CaseNameDir = myHomardGen->VerifieDir( aDirName.toStdString().c_str()) ; + { QString CaseNameDir = myAdaptGen->VerifieDir( aDirName.toStdString().c_str()) ; if ( ( CaseNameDir != "" ) & ( CaseNameDir != aCaseName ) ) { QString texte ; @@ -231,10 +233,10 @@ bool MonCreateCase::PushOnApply(int option) { // Nom du groupe NomGroup = QString(TWBoundary->item(row, 0)->text()) ; -// MESSAGE("NomGroup "<CreateCase( \ + aCase = myAdaptGen->CreateCase( \ CORBA::string_dup(_aCaseName.toStdString().c_str()), \ CORBA::string_dup(aMeshName.toStdString().c_str()), \ CORBA::string_dup(aFileName.toStdString().c_str()) ); @@ -345,19 +347,22 @@ void MonCreateCase::PushOnOK() void MonCreateCase::PushOnHelp() //------------------------------- { - std::string LanguageShort = myHomardGen->GetLanguageShort(); + std::string LanguageShort = myAdaptGen->GetLanguageShort(); HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""), QString(LanguageShort.c_str())); } // --------------------------------- void MonCreateCase::SetNewName() // ------------------------------ { - ADAPT::listeCases_var MyCases = myHomardGen->GetAllCasesName(); + INFOS("Debut de SetNewName"); + ADAPT::listeCases_var MyCases = myAdaptGen->GetAllCasesName(); + INFOS("MyCases construit"); int num = 0; QString aCaseName=""; while (aCaseName=="" ) { aCaseName.setNum(num+1) ; aCaseName.insert(0, QString("Case_")) ; + std::cout << "aCaseName : --" << aCaseName.toStdString().c_str() << "--" << std::endl; for ( int i=0; ilength(); i++) { if ( aCaseName == QString((MyCases)[i])) @@ -368,8 +373,10 @@ void MonCreateCase::SetNewName() } } } + INFOS("aCaseName construit"); LEName->clear() ; LEName->insert(aCaseName); + INFOS("Fin de SetNewName"); } // ------------------------------------------------------------------------ @@ -507,7 +514,7 @@ void MonCreateCase::PushBoundaryCAONew() // ------------------------------------------------------------------------ { MonCreateBoundaryCAO *BoundaryDlg = new MonCreateBoundaryCAO(this, true, - ADAPT::ADAPT_Gen::_duplicate(myHomardGen), _aCaseName, "") ; + ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), _aCaseName, "") ; BoundaryDlg->show(); } // ------------------------------------------------------------------------ @@ -516,21 +523,21 @@ void MonCreateCase::PushBoundaryCAOEdit() { if (CBBoundaryCAO->currentText() == QString("")) return; MonEditBoundaryCAO *BoundaryDlg = new MonEditBoundaryCAO(this, true, - ADAPT::ADAPT_Gen::_duplicate(myHomardGen), _aCaseName, CBBoundaryCAO->currentText() ) ; + ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), _aCaseName, CBBoundaryCAO->currentText() ) ; BoundaryDlg->show(); } // ------------------------------------------------------------------------ void MonCreateCase::PushBoundaryCAOHelp() // ------------------------------------------------------------------------ { - std::string LanguageShort = myHomardGen->GetLanguageShort(); + std::string LanguageShort = myAdaptGen->GetLanguageShort(); HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("CAO"), QString(LanguageShort.c_str())); } // ------------------------------------------------------------------------ void MonCreateCase::SetBoundaryD() // ------------------------------------------------------------------------ { - MESSAGE("Debut de SetBoundaryD "); + INFOS("Debut de SetBoundaryD "); if (CBBoundaryD->isChecked()) { bool bOK = PushOnApply(0); @@ -555,7 +562,7 @@ void MonCreateCase::PushBoundaryDiNew() // ------------------------------------------------------------------------ { MonCreateBoundaryDi *BoundaryDlg = new MonCreateBoundaryDi(this, true, - ADAPT::ADAPT_Gen::_duplicate(myHomardGen), _aCaseName, "") ; + ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), _aCaseName, "") ; BoundaryDlg->show(); } // ------------------------------------------------------------------------ @@ -564,21 +571,21 @@ void MonCreateCase::PushBoundaryDiEdit() { if (CBBoundaryDi->currentText() == QString("")) return; MonEditBoundaryDi *BoundaryDlg = new MonEditBoundaryDi(this, true, - ADAPT::ADAPT_Gen::_duplicate(myHomardGen), _aCaseName, CBBoundaryDi->currentText() ) ; + ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), _aCaseName, CBBoundaryDi->currentText() ) ; BoundaryDlg->show(); } // ------------------------------------------------------------------------ void MonCreateCase::PushBoundaryDiHelp() // ------------------------------------------------------------------------ { - std::string LanguageShort = myHomardGen->GetLanguageShort(); + std::string LanguageShort = myAdaptGen->GetLanguageShort(); HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-discrete"), QString(LanguageShort.c_str())); } // ------------------------------------------------------------------------ void MonCreateCase::SetBoundaryA() // ------------------------------------------------------------------------ { - MESSAGE("Debut de SetBoundaryA "); + INFOS("Debut de SetBoundaryA "); if (CBBoundaryA->isChecked()) { bool bOK = PushOnApply(0); @@ -595,10 +602,10 @@ void MonCreateCase::SetBoundaryA() void MonCreateCase::AddBoundaryAn(QString newBoundary) // ------------------------------------------------------------------------ { - MESSAGE("Debut de AddBoundaryAn "); + INFOS("Debut de AddBoundaryAn "); // Ajout d'une nouvelle colonne int nbcol = TWBoundary->columnCount(); -// MESSAGE("nbcol " << nbcol); +// INFOS("nbcol " << nbcol); nbcol += 1 ; TWBoundary->setColumnCount ( nbcol ) ; QTableWidgetItem *__colItem = new QTableWidgetItem(); @@ -607,7 +614,7 @@ void MonCreateCase::AddBoundaryAn(QString newBoundary) /* TWBoundary->horizontalHeaderItem(nbcol-1)->setFlags( Qt::ItemIsSelectable|Qt::ItemIsEnabled );*/ // Chaque case est a cocher int nbrow = TWBoundary->rowCount(); -// MESSAGE("nbrow " << nbrow); +// INFOS("nbrow " << nbrow); for ( int i = 0; i < nbrow; i++ ) { TWBoundary->setItem( i, nbcol-1, new QTableWidgetItem( QString ("") ) ); @@ -617,14 +624,14 @@ void MonCreateCase::AddBoundaryAn(QString newBoundary) } TWBoundary->resizeColumnToContents(nbcol-1); // TWBoundary->resizeRowsToContents(); -// MESSAGE("Fin de AddBoundaryAn "); +// INFOS("Fin de AddBoundaryAn "); } // ------------------------------------------------------------------------ void MonCreateCase::PushBoundaryAnNew() // ------------------------------------------------------------------------ { MonCreateBoundaryAn *BoundaryDlg = new MonCreateBoundaryAn(this, true, - ADAPT::ADAPT_Gen::_duplicate(myHomardGen), _aCaseName) ; + ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), _aCaseName) ; BoundaryDlg->show(); } // ------------------------------------------------------------------------ @@ -638,10 +645,10 @@ void MonCreateCase::PushBoundaryAnEdit() QTableWidgetItem *__colItem = new QTableWidgetItem(); __colItem = TWBoundary->horizontalHeaderItem(i); nom = QString(__colItem->text()) ; - MESSAGE("nom "<show(); } } } @@ -649,7 +656,7 @@ void MonCreateCase::PushBoundaryAnEdit() void MonCreateCase::PushBoundaryAnHelp() // ------------------------------------------------------------------------ { - std::string LanguageShort = myHomardGen->GetLanguageShort(); + std::string LanguageShort = myAdaptGen->GetLanguageShort(); HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-analytique"), QString(LanguageShort.c_str())); } // ------------------------------------------------------------------------ @@ -666,7 +673,7 @@ void MonCreateCase::CaseNameChanged() void MonCreateCase::SetAdvanced() // ------------------------------------------------------------------------ { - MESSAGE("Debut de SetAdvanced "); + INFOS("Debut de SetAdvanced "); if (CBAdvanced->isChecked()) { GBAdvancedOptions->setVisible(1); GBConforme->setVisible(1); @@ -688,6 +695,7 @@ void MonCreateCase::SetAdvanced() _Pyram = 0 ; SetStandard() ; SetMED() ; + INFOS("Fin de SetAdvanced "); } // adjustSize(); diff --git a/src/ADAPTGUI/MonCreateCase.h b/src/ADAPTGUI/MonCreateCase.h index 03178ef2e..36f01b884 100644 --- a/src/ADAPTGUI/MonCreateCase.h +++ b/src/ADAPTGUI/MonCreateCase.h @@ -37,7 +37,7 @@ class HOMARD_EXPORT MonCreateCase : public QDialog, public Ui_CreateCase Q_OBJECT public: - MonCreateCase( bool modal, ADAPT::ADAPT_Gen_var myHomardGen ); + MonCreateCase( bool modal, ADAPT::ADAPT_Gen_var myAdaptGen ); ~MonCreateCase(); void AddBoundaryCAO(QString newBoundary); @@ -54,7 +54,7 @@ protected : int _Pyram; ADAPT::HOMARD_Cas_var aCase ; - ADAPT::ADAPT_Gen_var myHomardGen; + ADAPT::ADAPT_Gen_var myAdaptGen; virtual void InitConnect(); virtual void InitBoundarys(); diff --git a/src/ADAPTGUI/MonCreateHypothesis.cxx b/src/ADAPTGUI/MonCreateHypothesis.cxx index add1122ee..6c87eb011 100644 --- a/src/ADAPTGUI/MonCreateHypothesis.cxx +++ b/src/ADAPTGUI/MonCreateHypothesis.cxx @@ -35,7 +35,7 @@ using namespace std; // ------------------------------------------------------------------------------- MonCreateHypothesis::MonCreateHypothesis(MonCreateIteration* parent, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen0, + ADAPT::ADAPT_Gen_var myAdaptGen0, QString Name, QString caseName, QString aFieldFile) // --------------------------------------------------------------------------------- @@ -56,7 +56,7 @@ MonCreateHypothesis::MonCreateHypothesis(MonCreateIteration* parent, bool modal, { MESSAGE("Constructeur") ; - myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0); + myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0); setupUi(this); if ( modal ) { setWindowModality(Qt::WindowModal); } else { setWindowModality(Qt::NonModal); } @@ -158,7 +158,7 @@ bool MonCreateHypothesis::PushOnApply() _Name=LEName->text().trimmed(); try { - aHypothesis=myHomardGen->CreateHypothesis(CORBA::string_dup(_Name.toStdString().c_str()) ); + aHypothesis=myAdaptGen->CreateHypothesis(CORBA::string_dup(_Name.toStdString().c_str()) ); _parent->addHypothese(_Name); } catch( SALOME::SALOME_Exception& S_ex ) @@ -223,7 +223,7 @@ void MonCreateHypothesis::PushOnOK() void MonCreateHypothesis::PushOnHelp() // ------------------------------------------------------------------------ { - std::string LanguageShort = myHomardGen->GetLanguageShort(); + std::string LanguageShort = myAdaptGen->GetLanguageShort(); HOMARD_UTILS::PushOnHelp(QString("gui_create_hypothese.html"), QString(""), QString(LanguageShort.c_str())); } // ------------------------------------------------- @@ -231,7 +231,7 @@ void MonCreateHypothesis::SetNewName() // -------------------------------------------------- { - ADAPT::listeHypotheses_var MyObjects = myHomardGen->GetAllHypothesesName(); + ADAPT::listeHypotheses_var MyObjects = myAdaptGen->GetAllHypothesesName(); int num = 0;// QString aName=""; while (aName=="" ) @@ -318,7 +318,7 @@ void MonCreateHypothesis::PushZoneNew() // ------------------------------------------------------------------------ { MESSAGE("Debut de MonCreateHypothesis::PushZoneNew") - MonCreateZone *aDlg = new MonCreateZone(this, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen), _aCaseName) ; + MonCreateZone *aDlg = new MonCreateZone(this, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), _aCaseName) ; aDlg->show(); } @@ -336,7 +336,7 @@ void MonCreateHypothesis::PushZoneEdit() return; } QString zoneName = monItem->text().trimmed(); - MonEditZone *aDlg = new MonEditZone(this, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen), _aCaseName, zoneName) ; + MonEditZone *aDlg = new MonEditZone(this, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), _aCaseName, zoneName) ; aDlg->show(); } // ------------------------------------------------------------------------ @@ -357,7 +357,7 @@ void MonCreateHypothesis::GetAllZones() // Par defaut, aucune n'est selectionnee { MESSAGE("Debut de GetAllZones") ; - ADAPT::listeZones_var mesZones = myHomardGen->GetAllZonesName(); + ADAPT::listeZones_var mesZones = myAdaptGen->GetAllZonesName(); int nbrow=TWZone->rowCount(); for ( int row=0; row< nbrow; row++) { @@ -711,7 +711,7 @@ void MonCreateHypothesis::SetFiltrage() // ------------------------------------------------------------------------ { if (!CBGroupe->isChecked()) return; - MonCreateListGroup *aDlg = new MonCreateListGroup(this, NULL, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen),_aCaseName, _aListeGroupes) ; + MonCreateListGroup *aDlg = new MonCreateListGroup(this, NULL, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen),_aCaseName, _aListeGroupes) ; aDlg->show(); } diff --git a/src/ADAPTGUI/MonCreateHypothesis.h b/src/ADAPTGUI/MonCreateHypothesis.h index a760fcfef..42f41f1ef 100644 --- a/src/ADAPTGUI/MonCreateHypothesis.h +++ b/src/ADAPTGUI/MonCreateHypothesis.h @@ -38,7 +38,7 @@ class HOMARD_EXPORT MonCreateHypothesis : public QScrollArea, public Ui_CreateHy Q_OBJECT public: - MonCreateHypothesis( MonCreateIteration* parent, bool modal, ADAPT::ADAPT_Gen_var myHomardGen, + MonCreateHypothesis( MonCreateIteration* parent, bool modal, ADAPT::ADAPT_Gen_var myAdaptGen, QString aHypotheseName, QString caseName, QString aFieldFile); ~MonCreateHypothesis(); @@ -46,7 +46,7 @@ public: virtual void setGroups(QStringList listGroup); protected : - // MonCreateHypothesis( MonCreateIteration* parent, ADAPT::ADAPT_Gen_var myHomardGen, + // MonCreateHypothesis( MonCreateIteration* parent, ADAPT::ADAPT_Gen_var myAdaptGen, // QString caseName, QString aFieldFile); MonCreateIteration *_parent; @@ -75,7 +75,7 @@ protected : int _ExtraOutput; ADAPT::HOMARD_Hypothesis_var aHypothesis; - ADAPT::ADAPT_Gen_var myHomardGen; + ADAPT::ADAPT_Gen_var myAdaptGen; QStringList _aListeZone; QStringList _aListeComposant; diff --git a/src/ADAPTGUI/MonCreateIteration.cxx b/src/ADAPTGUI/MonCreateIteration.cxx index 8d4d200d3..27befda2d 100644 --- a/src/ADAPTGUI/MonCreateIteration.cxx +++ b/src/ADAPTGUI/MonCreateIteration.cxx @@ -33,7 +33,7 @@ using namespace std; // ----------------------------------------------------------------------------------------------------- MonCreateIteration::MonCreateIteration(QWidget* parent, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen0, QString IterParentName ): + ADAPT::ADAPT_Gen_var myAdaptGen0, QString IterParentName ): // ----------------------------------------------------------------------------------------------------- /* Constructs a MonCreateIteration * Inherits from CasHomard @@ -46,7 +46,7 @@ MonCreateIteration::MonCreateIteration(QWidget* parent, bool modal, _CaseName("") { MESSAGE("Constructeur"); - myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0); + myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0); setupUi(this); if ( modal ) { setWindowModality(Qt::WindowModal); } else { setWindowModality(Qt::NonModal); } @@ -87,7 +87,7 @@ void MonCreateIteration::InitConnect() void MonCreateIteration::GetHypotheses() // ------------------------------------------------------------------------ { - ADAPT::listeHypotheses_var mesHypotheses = myHomardGen->GetAllHypothesesName(); + ADAPT::listeHypotheses_var mesHypotheses = myAdaptGen->GetAllHypothesesName(); for (int i=0; ilength(); i++) { CBHypothese->addItem(QString(mesHypotheses[i])); @@ -128,7 +128,7 @@ bool MonCreateIteration::PushOnApply() QObject::tr("HOM_ITER_HYPO") ); return false; } - ADAPT::HOMARD_Hypothesis_var _myHypothesis = myHomardGen->GetHypothesis(monHypoName.toStdString().c_str()); + ADAPT::HOMARD_Hypothesis_var _myHypothesis = myAdaptGen->GetHypothesis(monHypoName.toStdString().c_str()); ADAPT::listeTypes_var ListTypes (_myHypothesis->GetAdapRefinUnRef()); int TypeAdap = ListTypes[0]; if ( TypeAdap == 1 && LEFieldFile->text().trimmed() == QString("") ) @@ -149,7 +149,7 @@ bool MonCreateIteration::PushOnApply() { _Name = aName; std::cerr << _Name.toStdString() << std::endl; - aIter = myHomardGen->CreateIteration( \ + aIter = myAdaptGen->CreateIteration( \ CORBA::string_dup(_Name.toStdString().c_str()), CORBA::string_dup(_IterParentName.toStdString().c_str())); } @@ -172,7 +172,7 @@ bool MonCreateIteration::PushOnApply() if ( step == -2 ) { aIter->SetTimeStepRankLast(); } else { aIter->SetTimeStepRank(step,rank); } } - myHomardGen->AssociateIterHypo (IterName.c_str(), monHypoName.toStdString().c_str()); + myAdaptGen->AssociateIterHypo (IterName.c_str(), monHypoName.toStdString().c_str()); aIter->SetMeshName(CORBA::string_dup(aMeshName_np1.toStdString().c_str())); HOMARD_UTILS::updateObjBrowser() ; @@ -190,7 +190,7 @@ void MonCreateIteration::PushOnOK() void MonCreateIteration::PushOnHelp() // ------------------------------------------------------------------------ { - std::string LanguageShort = myHomardGen->GetLanguageShort(); + std::string LanguageShort = myAdaptGen->GetLanguageShort(); HOMARD_UTILS::PushOnHelp(QString("gui_create_iteration.html"), QString(""), QString(LanguageShort.c_str())); } // ------------------------------------------------------------------------ @@ -202,7 +202,7 @@ void MonCreateIteration::SetIterParentName() if (_IterParentName == QString("")) { raise();return;}; } _CaseName=HOMARD_QT_COMMUN::SelectionCasEtude(); - ADAPT::HOMARD_Iteration_var aIterParent = myHomardGen->GetIteration(_IterParentName.toStdString().c_str()) ; + ADAPT::HOMARD_Iteration_var aIterParent = myAdaptGen->GetIteration(_IterParentName.toStdString().c_str()) ; QString MeshName = aIterParent->GetMeshName(); LEMeshName_n->setText(MeshName); @@ -217,7 +217,7 @@ void MonCreateIteration::SetNewName() { // Recherche d'un nom par defaut qui n'existe pas encore - ADAPT::listeIterations_var MyObjects=myHomardGen->GetAllIterationsName(); + ADAPT::listeIterations_var MyObjects=myAdaptGen->GetAllIterationsName(); int num = 0;// QString aName=""; while (aName=="" ) @@ -249,7 +249,7 @@ void MonCreateIteration::PushHypoEdit() return; } QString aFieldFile=LEFieldFile->text().trimmed(); - MonEditHypothesis *HypoDlg = new MonEditHypothesis(this, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen),CBHypothese->currentText(), _CaseName, aFieldFile) ; + MonEditHypothesis *HypoDlg = new MonEditHypothesis(this, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen),CBHypothese->currentText(), _CaseName, aFieldFile) ; HypoDlg->show(); } @@ -273,11 +273,11 @@ void MonCreateIteration::PushHypoNew() } if ( _CaseName == QString("")) { - ADAPT::HOMARD_Iteration_var aIterParent = myHomardGen->GetIteration(_IterParentName.toStdString().c_str()) ; + ADAPT::HOMARD_Iteration_var aIterParent = myAdaptGen->GetIteration(_IterParentName.toStdString().c_str()) ; _CaseName = aIterParent->GetCaseName(); } QString aFieldFile=LEFieldFile->text().trimmed(); - MonCreateHypothesis *HypoDlg = new MonCreateHypothesis(this, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen), QString(""), _CaseName, aFieldFile) ; + MonCreateHypothesis *HypoDlg = new MonCreateHypothesis(this, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), QString(""), _CaseName, aFieldFile) ; HypoDlg->show(); } // ------------------------------------------------------------------------ diff --git a/src/ADAPTGUI/MonCreateIteration.h b/src/ADAPTGUI/MonCreateIteration.h index a10f48d91..383110d5c 100644 --- a/src/ADAPTGUI/MonCreateIteration.h +++ b/src/ADAPTGUI/MonCreateIteration.h @@ -37,14 +37,14 @@ class HOMARD_EXPORT MonCreateIteration : public QScrollArea, public Ui_CreateIte Q_OBJECT public: - MonCreateIteration( QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myHomardGen, QString IterParentName ); + MonCreateIteration( QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myAdaptGen, QString IterParentName ); ~MonCreateIteration(); void addHypothese(QString newHypothese); protected : - MonCreateIteration( QWidget* parent, ADAPT::ADAPT_Gen_var myHomardGen, QString IterParentName ); + MonCreateIteration( QWidget* parent, ADAPT::ADAPT_Gen_var myAdaptGen, QString IterParentName ); QString _Name; QString _IterParentName; @@ -54,7 +54,7 @@ protected : ADAPT::HOMARD_Iteration_var aIter ; ADAPT::HOMARD_Iteration_var aIterParent ; ADAPT::HOMARD_Cas_var aCas ; - ADAPT::ADAPT_Gen_var myHomardGen; + ADAPT::ADAPT_Gen_var myAdaptGen; virtual void InitConnect(); diff --git a/src/ADAPTGUI/MonCreateListGroup.cxx b/src/ADAPTGUI/MonCreateListGroup.cxx index 7664a01fe..3c4ef4c48 100644 --- a/src/ADAPTGUI/MonCreateListGroup.cxx +++ b/src/ADAPTGUI/MonCreateListGroup.cxx @@ -38,7 +38,7 @@ using namespace std; // -------------------------------------------------------------------------------------------------------------- MonCreateListGroup::MonCreateListGroup(MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen0, QString aCaseName, QStringList listeGroupesHypo) : + ADAPT::ADAPT_Gen_var myAdaptGen0, QString aCaseName, QStringList listeGroupesHypo) : // -------------------------------------------------------------------------------------------------------------- // QDialog(0), Ui_CreateListGroup(), @@ -48,7 +48,7 @@ MonCreateListGroup::MonCreateListGroup(MonCreateHypothesis* parentHyp, MonCreate _parentBound(parentBound) { MESSAGE("Debut de MonCreateListGroup") - myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0); + myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0); setupUi(this); setModal(modal); InitConnect(); @@ -56,7 +56,7 @@ MonCreateListGroup::MonCreateListGroup(MonCreateHypothesis* parentHyp, MonCreate } // -------------------------------------------------------------------------------------------------------------- MonCreateListGroup::MonCreateListGroup(MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, - ADAPT::ADAPT_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo) : + ADAPT::ADAPT_Gen_var myAdaptGen, QString aCaseName, QStringList listeGroupesHypo) : // -------------------------------------------------------------------------------------------------------------- // QDialog(0), Ui_CreateListGroup(), @@ -65,7 +65,7 @@ MonCreateListGroup::MonCreateListGroup(MonCreateHypothesis* parentHyp, MonCreate _parentHyp(parentHyp), _parentBound(parentBound) { - myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen); + myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen); setupUi(this); InitConnect(); } @@ -118,7 +118,7 @@ void MonCreateListGroup::PushOnOK() void MonCreateListGroup::PushOnHelp() // ------------------------------------------------------------------------ { - std::string LanguageShort = myHomardGen->GetLanguageShort(); + std::string LanguageShort = myAdaptGen->GetLanguageShort(); HOMARD_UTILS::PushOnHelp(QString("gui_create_hypothese.html"), QString(""), QString(LanguageShort.c_str())); } // ------------------------------------------------------------------------ @@ -130,7 +130,7 @@ void MonCreateListGroup::InitGroupes() TWGroupe->removeRow(row); TWGroupe->setRowCount(0); if (_aCaseName == QString("")) { return; }; - ADAPT::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str()); + ADAPT::HOMARD_Cas_var monCas= myAdaptGen->GetCase(_aCaseName.toStdString().c_str()); ADAPT::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); for ( int i = 0; i < _listeGroupesCas->length(); i++ ) { diff --git a/src/ADAPTGUI/MonCreateListGroup.h b/src/ADAPTGUI/MonCreateListGroup.h index 4aa8a159e..9422e8be2 100644 --- a/src/ADAPTGUI/MonCreateListGroup.h +++ b/src/ADAPTGUI/MonCreateListGroup.h @@ -38,13 +38,13 @@ class HOMARD_EXPORT MonCreateListGroup : public QDialog, public Ui_CreateListGro Q_OBJECT public: - MonCreateListGroup( MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, bool modal, ADAPT::ADAPT_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); - MonCreateListGroup( MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, ADAPT::ADAPT_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); + MonCreateListGroup( MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, bool modal, ADAPT::ADAPT_Gen_var myAdaptGen, QString aCaseName, QStringList listeGroupesHypo); + MonCreateListGroup( MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, ADAPT::ADAPT_Gen_var myAdaptGen, QString aCaseName, QStringList listeGroupesHypo); virtual ~MonCreateListGroup(); protected : - ADAPT::ADAPT_Gen_var myHomardGen; + ADAPT::ADAPT_Gen_var myAdaptGen; MonCreateHypothesis * _parentHyp; MonCreateBoundaryDi * _parentBound; diff --git a/src/ADAPTGUI/MonCreateListGroupCAO.cxx b/src/ADAPTGUI/MonCreateListGroupCAO.cxx index a630d4558..5df4690dd 100644 --- a/src/ADAPTGUI/MonCreateListGroupCAO.cxx +++ b/src/ADAPTGUI/MonCreateListGroupCAO.cxx @@ -38,7 +38,7 @@ using namespace std; // -------------------------------------------------------------------------------------------------------------- MonCreateListGroupCAO::MonCreateListGroupCAO(MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen0, QString aCaseName, QStringList listeGroupesHypo) : + ADAPT::ADAPT_Gen_var myAdaptGen0, QString aCaseName, QStringList listeGroupesHypo) : // -------------------------------------------------------------------------------------------------------------- // QDialog(0), Ui_CreateListGroup(), @@ -48,7 +48,7 @@ MonCreateListGroupCAO::MonCreateListGroupCAO(MonCreateHypothesis* parentHyp, Mon _parentBound(parentBound) { MESSAGE("Debut de MonCreateListGroupCAO") - myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0); + myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0); setupUi(this); setModal(modal); InitConnect(); @@ -56,7 +56,7 @@ MonCreateListGroupCAO::MonCreateListGroupCAO(MonCreateHypothesis* parentHyp, Mon } // -------------------------------------------------------------------------------------------------------------- MonCreateListGroupCAO::MonCreateListGroupCAO(MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, - ADAPT::ADAPT_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo) : + ADAPT::ADAPT_Gen_var myAdaptGen, QString aCaseName, QStringList listeGroupesHypo) : // -------------------------------------------------------------------------------------------------------------- // QDialog(0), Ui_CreateListGroup(), @@ -65,7 +65,7 @@ MonCreateListGroupCAO::MonCreateListGroupCAO(MonCreateHypothesis* parentHyp, Mon _parentHyp(parentHyp), _parentBound(parentBound) { - myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen); + myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen); setupUi(this); InitConnect(); } @@ -115,7 +115,7 @@ void MonCreateListGroupCAO::PushOnOK() void MonCreateListGroupCAO::PushOnHelp() // ------------------------------------------------------------------------ { - std::string LanguageShort = myHomardGen->GetLanguageShort(); + std::string LanguageShort = myAdaptGen->GetLanguageShort(); HOMARD_UTILS::PushOnHelp(QString("gui_create_hypothese.html"), QString(""), QString(LanguageShort.c_str())); } // ------------------------------------------------------------------------ @@ -127,7 +127,7 @@ void MonCreateListGroupCAO::InitGroupes() TWGroupe->removeRow(row); TWGroupe->setRowCount(0); if (_aCaseName == QString("")) { return; }; - ADAPT::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str()); + ADAPT::HOMARD_Cas_var monCas= myAdaptGen->GetCase(_aCaseName.toStdString().c_str()); ADAPT::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); for ( int i = 0; i < _listeGroupesCas->length(); i++ ) { diff --git a/src/ADAPTGUI/MonCreateListGroupCAO.h b/src/ADAPTGUI/MonCreateListGroupCAO.h index 8917c4136..1e291d331 100644 --- a/src/ADAPTGUI/MonCreateListGroupCAO.h +++ b/src/ADAPTGUI/MonCreateListGroupCAO.h @@ -38,13 +38,13 @@ class HOMARD_EXPORT MonCreateListGroupCAO : public QDialog, public Ui_CreateList Q_OBJECT public: - MonCreateListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, bool modal, ADAPT::ADAPT_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); - MonCreateListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, ADAPT::ADAPT_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); + MonCreateListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, bool modal, ADAPT::ADAPT_Gen_var myAdaptGen, QString aCaseName, QStringList listeGroupesHypo); + MonCreateListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, ADAPT::ADAPT_Gen_var myAdaptGen, QString aCaseName, QStringList listeGroupesHypo); virtual ~MonCreateListGroupCAO(); protected : - ADAPT::ADAPT_Gen_var myHomardGen; + ADAPT::ADAPT_Gen_var myAdaptGen; MonCreateHypothesis * _parentHyp; MonCreateBoundaryCAO * _parentBound; diff --git a/src/ADAPTGUI/MonCreateYACS.cxx b/src/ADAPTGUI/MonCreateYACS.cxx index 9572db73a..e0ae6fda1 100644 --- a/src/ADAPTGUI/MonCreateYACS.cxx +++ b/src/ADAPTGUI/MonCreateYACS.cxx @@ -34,7 +34,7 @@ using namespace std; // ---------------------------------------------------------------------- -MonCreateYACS::MonCreateYACS (bool modal, ADAPT::ADAPT_Gen_var myHomardGen0, QString CaseName ): +MonCreateYACS::MonCreateYACS (bool modal, ADAPT::ADAPT_Gen_var myAdaptGen0, QString CaseName ): // ---------------------------------------------------------------------- /* Constructs a MonCreateYACS * Sets attributes to default values @@ -50,7 +50,7 @@ MonCreateYACS::MonCreateYACS (bool modal, ADAPT::ADAPT_Gen_var myHomardGen0, QSt // et doivent correspondre aux defauts des boutons { // MESSAGE("Debut du constructeur de MonCreateYACS"); - myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0); + myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0); setupUi(this); if ( modal ) { setWindowModality(Qt::WindowModal); } else { setWindowModality(Qt::NonModal); } @@ -63,9 +63,9 @@ MonCreateYACS::MonCreateYACS (bool modal, ADAPT::ADAPT_Gen_var myHomardGen0, QSt else { setWindowModality(Qt::NonModal); /* permet selection du cas dans l arbre d etude */} // // Les valeurs definies dans les preferences - _MaxIter = myHomardGen->GetYACSMaxIter(); - _MaxNode = myHomardGen->GetYACSMaxNode(); - _MaxElem = myHomardGen->GetYACSMaxElem(); + _MaxIter = myAdaptGen->GetYACSMaxIter(); + _MaxNode = myAdaptGen->GetYACSMaxNode(); + _MaxElem = myAdaptGen->GetYACSMaxElem(); MESSAGE ("Valeur par defaut de MaxIter = " << _MaxIter<<", MaxNode = "<< _MaxNode<<", MaxElem = "<< _MaxElem); SpinBoxMaxIter->setValue(_MaxIter) ; SpinBoxMaxNode->setValue(_MaxNode) ; @@ -75,12 +75,12 @@ MonCreateYACS::MonCreateYACS (bool modal, ADAPT::ADAPT_Gen_var myHomardGen0, QSt } // ---------------------------------------------------------------------- -MonCreateYACS::MonCreateYACS(ADAPT::ADAPT_Gen_var myHomardGen0, +MonCreateYACS::MonCreateYACS(ADAPT::ADAPT_Gen_var myAdaptGen0, QString caseName): // ---------------------------------------------------------------------- // Constructeur appele par MonEditYACS // -myHomardGen(myHomardGen0), +myAdaptGen(myAdaptGen0), _Name (""), Chgt (false) { @@ -139,7 +139,7 @@ bool MonCreateYACS::PushOnApply() return false; } if ( aDirName != _aDirName) - { QString CaseNameDir = myHomardGen->VerifieDir( aDirName.toStdString().c_str()) ; + { QString CaseNameDir = myAdaptGen->VerifieDir( aDirName.toStdString().c_str()) ; if ( CaseNameDir != "" ) { QString texte ; @@ -218,7 +218,7 @@ bool MonCreateYACS:: CreateOrUpdate() try { _Name=LEName->text().trimmed(); - aYACS=myHomardGen->CreateYACSSchema(CORBA::string_dup(_Name.toStdString().c_str()), CORBA::string_dup(_aCaseName.toStdString().c_str()), CORBA::string_dup(_aScriptFile.toStdString().c_str()), CORBA::string_dup(_aDirName.toStdString().c_str()), CORBA::string_dup(_aMeshFile.toStdString().c_str())); + aYACS=myAdaptGen->CreateYACSSchema(CORBA::string_dup(_Name.toStdString().c_str()), CORBA::string_dup(_aCaseName.toStdString().c_str()), CORBA::string_dup(_aScriptFile.toStdString().c_str()), CORBA::string_dup(_aDirName.toStdString().c_str()), CORBA::string_dup(_aMeshFile.toStdString().c_str())); } catch( SALOME::SALOME_Exception& S_ex ) { @@ -265,7 +265,7 @@ void MonCreateYACS::PushOnOK() void MonCreateYACS::PushOnHelp() //------------------------------- { - std::string LanguageShort = myHomardGen->GetLanguageShort(); + std::string LanguageShort = myAdaptGen->GetLanguageShort(); HOMARD_UTILS::PushOnHelp(QString("yacs.html"), QString(""), QString(LanguageShort.c_str())); } // ------------------------------------------------- @@ -273,7 +273,7 @@ void MonCreateYACS::SetNewName() // -------------------------------------------------- { - ADAPT::listeYACSs_var MyObjects = myHomardGen->GetAllYACSsName(); + ADAPT::listeYACSs_var MyObjects = myAdaptGen->GetAllYACSsName(); int num = 0; QString aName=""; while (aName == QString("") ) { diff --git a/src/ADAPTGUI/MonCreateYACS.h b/src/ADAPTGUI/MonCreateYACS.h index f932b704e..ea93be821 100644 --- a/src/ADAPTGUI/MonCreateYACS.h +++ b/src/ADAPTGUI/MonCreateYACS.h @@ -37,11 +37,11 @@ class HOMARD_EXPORT MonCreateYACS : public QScrollArea, public Ui_CreateYACS Q_OBJECT public: - MonCreateYACS( bool modal, ADAPT::ADAPT_Gen_var myHomardGen, QString CaseName); + MonCreateYACS( bool modal, ADAPT::ADAPT_Gen_var myAdaptGen, QString CaseName); virtual ~MonCreateYACS(); protected : - MonCreateYACS( ADAPT::ADAPT_Gen_var myHomardGen, QString CaseName); + MonCreateYACS( ADAPT::ADAPT_Gen_var myAdaptGen, QString CaseName); QString _Name; QString _aCaseName; @@ -57,7 +57,7 @@ class HOMARD_EXPORT MonCreateYACS : public QScrollArea, public Ui_CreateYACS bool Chgt; ADAPT::HOMARD_YACS_var aYACS; - ADAPT::ADAPT_Gen_var myHomardGen; + ADAPT::ADAPT_Gen_var myAdaptGen; virtual void InitConnect(); virtual bool CreateOrUpdate(); diff --git a/src/ADAPTGUI/MonCreateZone.cxx b/src/ADAPTGUI/MonCreateZone.cxx index b07d87e0b..aeb3b6ac9 100644 --- a/src/ADAPTGUI/MonCreateZone.cxx +++ b/src/ADAPTGUI/MonCreateZone.cxx @@ -38,7 +38,7 @@ using namespace std; // ---------------------------------------------------------------------- MonCreateZone::MonCreateZone(MonCreateHypothesis* parent, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen0, + ADAPT::ADAPT_Gen_var myAdaptGen0, QString caseName) : // ---------------------------------------------------------------------- /* Constructs a MonCreateZone @@ -61,7 +61,7 @@ MonCreateZone::MonCreateZone(MonCreateHypothesis* parent, bool modal, Chgt (false) { MESSAGE("Constructeur") ; - myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0) ; + myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0) ; setupUi(this) ; setModal(modal) ; InitConnect( ) ; @@ -74,13 +74,13 @@ MonCreateZone::MonCreateZone(MonCreateHypothesis* parent, bool modal, } // ---------------------------------------------------------------------- MonCreateZone::MonCreateZone(MonCreateHypothesis* parent, - ADAPT::ADAPT_Gen_var myHomardGen0, + ADAPT::ADAPT_Gen_var myAdaptGen0, QString caseName): // ---------------------------------------------------------------------- // Constructeur appele par MonEditZone // QDialog(0), Ui_CreateZone(), - myHomardGen(myHomardGen0), + myAdaptGen(myAdaptGen0), _parent(parent), _Name (""), _aCaseName(caseName), @@ -131,7 +131,7 @@ void MonCreateZone::InitValZone() // if (_aCaseName == QString("")) { return; } - ADAPT::HOMARD_Cas_var aCas = myHomardGen->GetCase(_aCaseName.toStdString().c_str()) ; + ADAPT::HOMARD_Cas_var aCas = myAdaptGen->GetCase(_aCaseName.toStdString().c_str()) ; ADAPT::extrema_var MesExtremes = aCas->GetBoundingBox() ; int num = MesExtremes->length() ; ASSERT(num == 10) ; @@ -494,67 +494,67 @@ bool MonCreateZone::CreateOrUpdateZone() switch (_Type) { case 11 : // il s agit d un rectangle, dans le plan (X,Y) - { aZone = myHomardGen->CreateZoneBox2D(CORBA::string_dup(_Name.toStdString().c_str()), \ + { aZone = myAdaptGen->CreateZoneBox2D(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneXmin, _ZoneXmax, _ZoneYmin, _ZoneYmax, _Orient ); break; } case 12 : // il s agit d un rectangle, dans le plan (Y,Z) - { aZone = myHomardGen->CreateZoneBox2D(CORBA::string_dup(_Name.toStdString().c_str()), \ + { aZone = myAdaptGen->CreateZoneBox2D(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneYmin, _ZoneYmax, _ZoneZmin, _ZoneZmax, _Orient ); break; } case 13 : // il s agit d un rectangle, dans le plan (Z,X) - { aZone = myHomardGen->CreateZoneBox2D(CORBA::string_dup(_Name.toStdString().c_str()), \ + { aZone = myAdaptGen->CreateZoneBox2D(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneZmin, _ZoneZmax, _ZoneXmin, _ZoneXmax, _Orient ); break; } case 2 : // il s agit d un parallelepipede - { aZone = myHomardGen->CreateZoneBox(CORBA::string_dup(_Name.toStdString().c_str()), \ + { aZone = myAdaptGen->CreateZoneBox(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneXmin, _ZoneXmax, _ZoneYmin, _ZoneYmax, _ZoneZmin, _ZoneZmax ); break; } case 4 : // il s agit d une sphere - { aZone = myHomardGen->CreateZoneSphere(CORBA::string_dup(_Name.toStdString().c_str()), \ + { aZone = myAdaptGen->CreateZoneSphere(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneXcentre, _ZoneYcentre, _ZoneZcentre, _ZoneRayon ); break; } case 31 : // il s agit d un disque issu d'un cylindre, dans le plan (X,Y) - { aZone = myHomardGen->CreateZoneDisk(CORBA::string_dup(_Name.toStdString().c_str()), \ + { aZone = myAdaptGen->CreateZoneDisk(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneXcentre, _ZoneYcentre, _ZoneRayon, _Orient ); break; } case 32 : // il s agit d un disque issu d'un cylindre, dans le plan (Y,Z) - { aZone = myHomardGen->CreateZoneDisk(CORBA::string_dup(_Name.toStdString().c_str()), \ + { aZone = myAdaptGen->CreateZoneDisk(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneYcentre, _ZoneZcentre, _ZoneRayon, _Orient ); break; } case 33 : // il s agit d un disque issu d'un cylindre, dans le plan (Z,X) - { aZone = myHomardGen->CreateZoneDisk(CORBA::string_dup(_Name.toStdString().c_str()), \ + { aZone = myAdaptGen->CreateZoneDisk(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneZcentre, _ZoneXcentre, _ZoneRayon, _Orient ); break; } case 5 : // il s agit d un cylindre - { aZone = myHomardGen->CreateZoneCylinder(CORBA::string_dup(_Name.toStdString().c_str()), \ + { aZone = myAdaptGen->CreateZoneCylinder(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneXcentre, _ZoneYcentre, _ZoneZcentre, _ZoneXaxis, _ZoneYaxis, _ZoneZaxis, _ZoneRayon, _ZoneHaut ); break; } case 61 : // il s agit d un disque avec trou, dans le plan (X,Y) - { aZone = myHomardGen->CreateZoneDiskWithHole(CORBA::string_dup(_Name.toStdString().c_str()), \ + { aZone = myAdaptGen->CreateZoneDiskWithHole(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneXcentre, _ZoneYcentre, _ZoneRayon, _ZoneRayonInt, _Orient ); break; } case 62 : // il s agit d un disque avec trou, dans le plan (Y,Z) - { aZone = myHomardGen->CreateZoneDiskWithHole(CORBA::string_dup(_Name.toStdString().c_str()), \ + { aZone = myAdaptGen->CreateZoneDiskWithHole(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneYcentre, _ZoneZcentre, _ZoneRayon, _ZoneRayonInt, _Orient ); break; } case 63 : // il s agit d un disque avec trou, dans le plan (Z,X) - { aZone = myHomardGen->CreateZoneDiskWithHole(CORBA::string_dup(_Name.toStdString().c_str()), \ + { aZone = myAdaptGen->CreateZoneDiskWithHole(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneZcentre, _ZoneXcentre, _ZoneRayon, _ZoneRayonInt, _Orient ); break; } case 7 : // il s agit d un tuyau - { aZone = myHomardGen->CreateZonePipe(CORBA::string_dup(_Name.toStdString().c_str()), \ + { aZone = myAdaptGen->CreateZonePipe(CORBA::string_dup(_Name.toStdString().c_str()), \ _ZoneXcentre, _ZoneYcentre, _ZoneZcentre, _ZoneXaxis, _ZoneYaxis, _ZoneZaxis, _ZoneRayon, _ZoneHaut, _ZoneRayonInt ); break; } @@ -589,7 +589,7 @@ void MonCreateZone::PushOnOK() void MonCreateZone::PushOnHelp() // ------------------------------------------------------------------------ { - std::string LanguageShort = myHomardGen->GetLanguageShort(); + std::string LanguageShort = myAdaptGen->GetLanguageShort(); HOMARD_UTILS::PushOnHelp(QString("gui_create_zone.html"), QString(""), QString(LanguageShort.c_str())); } @@ -600,7 +600,7 @@ void MonCreateZone::SetNewName() MESSAGE("SetNewName"); // Recherche d'un nom par defaut qui n'existe pas encore - ADAPT::listeZones_var MyObjects = myHomardGen->GetAllZonesName() ; + ADAPT::listeZones_var MyObjects = myAdaptGen->GetAllZonesName() ; int num = 0; QString aName=""; while (aName=="" ) { diff --git a/src/ADAPTGUI/MonCreateZone.h b/src/ADAPTGUI/MonCreateZone.h index 099c063e3..4eb700a43 100644 --- a/src/ADAPTGUI/MonCreateZone.h +++ b/src/ADAPTGUI/MonCreateZone.h @@ -38,13 +38,13 @@ class HOMARD_EXPORT MonCreateZone : public QDialog, public Ui_CreateZone public: MonCreateZone( MonCreateHypothesis* parent, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString caseName); virtual ~MonCreateZone(); protected : MonCreateZone( MonCreateHypothesis* parent, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString caseName); MonCreateHypothesis * _parent; @@ -65,7 +65,7 @@ protected : bool Chgt; ADAPT::HOMARD_Zone_var aZone ; - ADAPT::ADAPT_Gen_var myHomardGen; + ADAPT::ADAPT_Gen_var myAdaptGen; virtual void InitConnect(); virtual void InitValZone(); diff --git a/src/ADAPTGUI/MonEditBoundaryAn.cxx b/src/ADAPTGUI/MonEditBoundaryAn.cxx index bb9a8c340..03ceaf4bb 100644 --- a/src/ADAPTGUI/MonEditBoundaryAn.cxx +++ b/src/ADAPTGUI/MonEditBoundaryAn.cxx @@ -27,18 +27,18 @@ using namespace std; // ------------------------------------------------------------------------ MonEditBoundaryAn::MonEditBoundaryAn( MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString caseName, QString Name ): // ------------------------------------------------------------------------ /* Constructs a MonEditBoundaryAn herite de MonCreateBoundaryAn */ - MonCreateBoundaryAn(parent, myHomardGen, caseName) + MonCreateBoundaryAn(parent, myAdaptGen, caseName) { MESSAGE("Debut de MonEditBoundaryAn pour " << Name.toStdString().c_str()); setWindowTitle(QObject::tr("HOM_BOUN_A_EDIT_WINDOW_TITLE")); _Name=Name; - aBoundaryAn = myHomardGen->GetBoundary(_Name.toStdString().c_str()); + aBoundaryAn = myAdaptGen->GetBoundary(_Name.toStdString().c_str()); InitValEdit(); } // ------------------------------------------------------------------------ @@ -374,14 +374,14 @@ bool MonEditBoundaryAn::CreateOrUpdateBoundaryAn() } case 3 : // il s agit d un cone defini par un axe et un angle { - aBoundaryAn = myHomardGen->CreateBoundaryConeA(CORBA::string_dup(_Name.toStdString().c_str()), \ + aBoundaryAn = myAdaptGen->CreateBoundaryConeA(CORBA::string_dup(_Name.toStdString().c_str()), \ _BoundaryAnXaxisCone, _BoundaryAnYaxisCone, _BoundaryAnZaxisCone, _BoundaryAngle, \ _BoundaryAnXorigCone, _BoundaryAnYorigCone, _BoundaryAnYorigCone); break; } case 4 : // il s agit d un cone defini par les 2 rayons { - aBoundaryAn = myHomardGen->CreateBoundaryConeR(CORBA::string_dup(_Name.toStdString().c_str()), \ + aBoundaryAn = myAdaptGen->CreateBoundaryConeR(CORBA::string_dup(_Name.toStdString().c_str()), \ _BoundaryAnXcone1, _BoundaryAnYcone1, _BoundaryAnZcone1, _BoundaryAnRayon1, \ _BoundaryAnXcone2, _BoundaryAnYcone2, _BoundaryAnZcone2, _BoundaryAnRayon2); break; @@ -392,7 +392,7 @@ bool MonEditBoundaryAn::CreateOrUpdateBoundaryAn() break; } } - if (Chgt) myHomardGen->InvalideBoundary(_Name.toStdString().c_str()); + if (Chgt) myAdaptGen->InvalideBoundary(_Name.toStdString().c_str()); HOMARD_UTILS::updateObjBrowser(); return true; } diff --git a/src/ADAPTGUI/MonEditBoundaryAn.h b/src/ADAPTGUI/MonEditBoundaryAn.h index f43764b8e..fcc9167f7 100644 --- a/src/ADAPTGUI/MonEditBoundaryAn.h +++ b/src/ADAPTGUI/MonEditBoundaryAn.h @@ -35,7 +35,7 @@ class HOMARD_EXPORT MonEditBoundaryAn : public MonCreateBoundaryAn Q_OBJECT public: MonEditBoundaryAn( MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString caseName, QString Name); virtual ~MonEditBoundaryAn(); diff --git a/src/ADAPTGUI/MonEditBoundaryCAO.cxx b/src/ADAPTGUI/MonEditBoundaryCAO.cxx index e9ab43a93..a0c6abb28 100644 --- a/src/ADAPTGUI/MonEditBoundaryCAO.cxx +++ b/src/ADAPTGUI/MonEditBoundaryCAO.cxx @@ -31,19 +31,19 @@ using namespace std; // ------------------------------------------------------------------------------------------------------------------------------------- MonEditBoundaryCAO::MonEditBoundaryCAO( MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString caseName, QString Name): // ------------------------------------------------------------------------------------------------------------------------------------- /* Constructs a MonEditBoundaryCAO herite de MonCreateBoundaryCAO */ - MonCreateBoundaryCAO(parent, modal, myHomardGen, caseName, Name) + MonCreateBoundaryCAO(parent, modal, myAdaptGen, caseName, Name) { MESSAGE("Debut de Boundary pour " << Name.toStdString().c_str()); setWindowTitle(QObject::tr("HOM_BOUN_C_EDIT_WINDOW_TITLE")); try { - aBoundary=myHomardGen->GetBoundary(CORBA::string_dup(_aName.toStdString().c_str())); + aBoundary=myAdaptGen->GetBoundary(CORBA::string_dup(_aName.toStdString().c_str())); if (caseName==QString("")) { _aCaseName=aBoundary->GetCaseCreation();} InitValEdit(); } @@ -95,10 +95,10 @@ void MonEditBoundaryCAO::SetFiltrage() QObject::tr("HOM_BOUN_CASE") ); return; } - ADAPT::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str()); + ADAPT::HOMARD_Cas_var monCas= myAdaptGen->GetCase(_aCaseName.toStdString().c_str()); ADAPT::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); - MonEditListGroupCAO *aDlg = new MonEditListGroupCAO(NULL, this, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen), + MonEditListGroupCAO *aDlg = new MonEditListGroupCAO(NULL, this, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), _aCaseName, _listeGroupesBoundary) ; aDlg->show(); } diff --git a/src/ADAPTGUI/MonEditBoundaryCAO.h b/src/ADAPTGUI/MonEditBoundaryCAO.h index d8131825d..802727623 100644 --- a/src/ADAPTGUI/MonEditBoundaryCAO.h +++ b/src/ADAPTGUI/MonEditBoundaryCAO.h @@ -35,7 +35,7 @@ class HOMARD_EXPORT MonEditBoundaryCAO : public MonCreateBoundaryCAO Q_OBJECT public: MonEditBoundaryCAO( MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString caseName, QString Name ); virtual ~MonEditBoundaryCAO(); diff --git a/src/ADAPTGUI/MonEditBoundaryDi.cxx b/src/ADAPTGUI/MonEditBoundaryDi.cxx index fa92cc174..afbe926b4 100644 --- a/src/ADAPTGUI/MonEditBoundaryDi.cxx +++ b/src/ADAPTGUI/MonEditBoundaryDi.cxx @@ -31,19 +31,19 @@ using namespace std; // ------------------------------------------------------------------------------------------------------------------------------------- MonEditBoundaryDi::MonEditBoundaryDi( MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString caseName, QString Name): // ------------------------------------------------------------------------------------------------------------------------------------- /* Constructs a MonEditBoundaryDi herite de MonCreateBoundaryDi */ - MonCreateBoundaryDi(parent, modal, myHomardGen, caseName, Name) + MonCreateBoundaryDi(parent, modal, myAdaptGen, caseName, Name) { MESSAGE("Debut de Boundary pour " << Name.toStdString().c_str()); setWindowTitle(QObject::tr("HOM_BOUN_D_EDIT_WINDOW_TITLE")); try { - aBoundary=myHomardGen->GetBoundary(CORBA::string_dup(_aName.toStdString().c_str())); + aBoundary=myAdaptGen->GetBoundary(CORBA::string_dup(_aName.toStdString().c_str())); if (caseName==QString("")) { _aCaseName=aBoundary->GetCaseCreation();} InitValEdit(); } @@ -95,10 +95,10 @@ void MonEditBoundaryDi::SetFiltrage() QObject::tr("HOM_BOUN_CASE") ); return; } - ADAPT::HOMARD_Cas_var monCas= myHomardGen->GetCase(_aCaseName.toStdString().c_str()); + ADAPT::HOMARD_Cas_var monCas= myAdaptGen->GetCase(_aCaseName.toStdString().c_str()); ADAPT::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); - MonEditListGroup *aDlg = new MonEditListGroup(NULL, this, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen), + MonEditListGroup *aDlg = new MonEditListGroup(NULL, this, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), _aCaseName, _listeGroupesBoundary) ; aDlg->show(); } diff --git a/src/ADAPTGUI/MonEditBoundaryDi.h b/src/ADAPTGUI/MonEditBoundaryDi.h index 97cdc7fe4..635a7b084 100644 --- a/src/ADAPTGUI/MonEditBoundaryDi.h +++ b/src/ADAPTGUI/MonEditBoundaryDi.h @@ -35,7 +35,7 @@ class HOMARD_EXPORT MonEditBoundaryDi : public MonCreateBoundaryDi Q_OBJECT public: MonEditBoundaryDi( MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString caseName, QString Name ); virtual ~MonEditBoundaryDi(); diff --git a/src/ADAPTGUI/MonEditCase.cxx b/src/ADAPTGUI/MonEditCase.cxx index 4ed612213..c68c22811 100644 --- a/src/ADAPTGUI/MonEditCase.cxx +++ b/src/ADAPTGUI/MonEditCase.cxx @@ -32,14 +32,14 @@ using namespace std; */ // ------------------------------------------------------------- MonEditCase::MonEditCase ( bool modal, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString CaseName ): - MonCreateCase(modal, myHomardGen) + MonCreateCase(modal, myAdaptGen) { MESSAGE("Debut de MonEditCase" << CaseName.toStdString().c_str()); setWindowTitle(QObject::tr("HOM_CASE_EDIT_WINDOW_TITLE")); _aCaseName = CaseName; - aCase = myHomardGen->GetCase(_aCaseName.toStdString().c_str()); + aCase = myAdaptGen->GetCase(_aCaseName.toStdString().c_str()); InitValEdit(); } // ------------------------------ @@ -61,7 +61,7 @@ void MonEditCase::InitValEdit() PushDir->setVisible(0); QString _aitername=aCase->GetIter0Name(); - ADAPT::HOMARD_Iteration_var aIter = myHomardGen->GetIteration(_aitername.toStdString().c_str()); + ADAPT::HOMARD_Iteration_var aIter = myAdaptGen->GetIteration(_aitername.toStdString().c_str()); QString aFileName = aIter->GetMeshFile(); LEFileName->setText(aFileName); LEFileName->setReadOnly(true); @@ -98,7 +98,7 @@ void MonEditCase::InitValEdit() NomFron = mesBoundarys[i++]; MESSAGE("NomFron "<GetBoundary(NomFron.toStdString().c_str()); + ADAPT::HOMARD_Boundary_var myBoundary = myAdaptGen->GetBoundary(NomFron.toStdString().c_str()); int type_obj = myBoundary->GetType() ; MESSAGE("type_obj "<GetHypothesis(_Name.toStdString().c_str()); + aHypothesis = myAdaptGen->GetHypothesis(_Name.toStdString().c_str()); if (caseName == QString("") ){ _aCaseName = aHypothesis->GetCaseCreation();} InitValEdit(); InitGroupes(); @@ -445,7 +445,7 @@ bool MonEditHypothesis::PushOnApply() aHypothesis->SetUnRefThr(_TypeThC, _ThreshC) ; } - myHomardGen->InvalideHypo(_Name.toStdString().c_str()); + myAdaptGen->InvalideHypo(_Name.toStdString().c_str()); HOMARD_UTILS::updateObjBrowser(); } return true; @@ -456,7 +456,7 @@ void MonEditHypothesis::SetFiltrage() { if (CBGroupe->isChecked()) { - MonEditListGroup *aDlg = new MonEditListGroup(this, NULL, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen),_aCaseName, _aListeGroupes) ; + MonEditListGroup *aDlg = new MonEditListGroup(this, NULL, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen),_aCaseName, _aListeGroupes) ; aDlg->show(); } } diff --git a/src/ADAPTGUI/MonEditHypothesis.h b/src/ADAPTGUI/MonEditHypothesis.h index 7bf402e9a..ef5a3e592 100644 --- a/src/ADAPTGUI/MonEditHypothesis.h +++ b/src/ADAPTGUI/MonEditHypothesis.h @@ -35,7 +35,7 @@ class HOMARD_EXPORT MonEditHypothesis : public MonCreateHypothesis Q_OBJECT public: MonEditHypothesis( MonCreateIteration* parent, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString caseName, QString Name, QString aFieldFile ); virtual ~MonEditHypothesis(); diff --git a/src/ADAPTGUI/MonEditIteration.cxx b/src/ADAPTGUI/MonEditIteration.cxx index 2a5203af5..8e75e0f6e 100644 --- a/src/ADAPTGUI/MonEditIteration.cxx +++ b/src/ADAPTGUI/MonEditIteration.cxx @@ -28,19 +28,19 @@ using namespace std; // ------------------------------------------------------------------------------------------------------------------------------------- MonEditIteration::MonEditIteration ( QWidget* parent, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString IterParentName, QString IterName ): // ------------------------------------------------------------------------------------------------------------------------------------- /* Constructs a MonEditIteration herite de MonCreateIteration */ - MonCreateIteration(parent, modal, myHomardGen, IterParentName), + MonCreateIteration(parent, modal, myAdaptGen, IterParentName), _rank(-1), _step(-1), _IterationName(""), _FieldFile(""),_aTypeAdap() { MESSAGE("Debut de MonEditIteration" << IterName.toStdString().c_str()); setWindowTitle(QObject::tr("HOM_ITER_EDIT_WINDOW_TITLE")); _IterationName = IterName; - aIter = myHomardGen->GetIteration(_IterationName.toStdString().c_str()); + aIter = myAdaptGen->GetIteration(_IterationName.toStdString().c_str()); // Attention au cas ou c'est une iteration initiale : il faut inhiber l'essentiel int etat = aIter->GetState() ; @@ -100,7 +100,7 @@ void MonEditIteration::InitValEdit() PBIterParent->setVisible(0); // Affichage bloque du nom du maillage de l'iteration parent - aIterParent = myHomardGen->GetIteration(_IterParentName.toStdString().c_str()); + aIterParent = myAdaptGen->GetIteration(_IterParentName.toStdString().c_str()); QString MeshNameParent = aIterParent->GetMeshName(); LEMeshName_n->setText(MeshNameParent); LEMeshName_n->setReadOnly(1); @@ -118,7 +118,7 @@ void MonEditIteration::InitValEdit() PBHypoNew->setVisible(0); // Pour une adaptation selon un champ - ADAPT::HOMARD_Hypothesis_var myHypo = myHomardGen->GetHypothesis(HypoName.toStdString().c_str()) ; + ADAPT::HOMARD_Hypothesis_var myHypo = myAdaptGen->GetHypothesis(HypoName.toStdString().c_str()) ; _aTypeAdap = myHypo->GetAdapType() ; if ( _aTypeAdap == 1 ) { @@ -177,7 +177,7 @@ bool MonEditIteration::PushOnApply() _step = SpinBox_TimeStep->value(); if ( _step == -2 ) { aIter->SetTimeStepRankLast(); } else { aIter->SetTimeStepRank(_step, _rank); } - myHomardGen->InvalideIter(_IterationName.toStdString().c_str()); + myAdaptGen->InvalideIter(_IterationName.toStdString().c_str()); HOMARD_UTILS::updateObjBrowser(); } } diff --git a/src/ADAPTGUI/MonEditIteration.h b/src/ADAPTGUI/MonEditIteration.h index 3fa4084b7..76abc6025 100644 --- a/src/ADAPTGUI/MonEditIteration.h +++ b/src/ADAPTGUI/MonEditIteration.h @@ -35,7 +35,7 @@ class HOMARD_EXPORT MonEditIteration : public MonCreateIteration Q_OBJECT public: MonEditIteration( QWidget* parent, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString IterParentName, QString Name ); virtual ~MonEditIteration(); diff --git a/src/ADAPTGUI/MonEditListGroup.cxx b/src/ADAPTGUI/MonEditListGroup.cxx index 19f096138..c931c7ba7 100644 --- a/src/ADAPTGUI/MonEditListGroup.cxx +++ b/src/ADAPTGUI/MonEditListGroup.cxx @@ -25,11 +25,11 @@ using namespace std; MonEditListGroup::MonEditListGroup( MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString aCaseName, QStringList listeGroupesHypo): //--------------------------------------------------------------------- -MonCreateListGroup(parentHyp,parentBound,myHomardGen,aCaseName,listeGroupesHypo) +MonCreateListGroup(parentHyp,parentBound,myAdaptGen,aCaseName,listeGroupesHypo) { MESSAGE("Debut de MonEditListGroup"); setWindowTitle(QObject::tr("HOM_GROU_EDIT_WINDOW_TITLE")); diff --git a/src/ADAPTGUI/MonEditListGroup.h b/src/ADAPTGUI/MonEditListGroup.h index d789abf48..0e90cf837 100644 --- a/src/ADAPTGUI/MonEditListGroup.h +++ b/src/ADAPTGUI/MonEditListGroup.h @@ -37,7 +37,7 @@ class HOMARD_EXPORT MonEditListGroup : public MonCreateListGroup Q_OBJECT public: - MonEditListGroup( MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, bool modal, ADAPT::ADAPT_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); + MonEditListGroup( MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, bool modal, ADAPT::ADAPT_Gen_var myAdaptGen, QString aCaseName, QStringList listeGroupesHypo); virtual ~MonEditListGroup(); protected : diff --git a/src/ADAPTGUI/MonEditListGroupCAO.cxx b/src/ADAPTGUI/MonEditListGroupCAO.cxx index 18a0d3f52..c29d2288c 100644 --- a/src/ADAPTGUI/MonEditListGroupCAO.cxx +++ b/src/ADAPTGUI/MonEditListGroupCAO.cxx @@ -25,11 +25,11 @@ using namespace std; MonEditListGroupCAO::MonEditListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString aCaseName, QStringList listeGroupesHypo): //--------------------------------------------------------------------- -MonCreateListGroupCAO(parentHyp,parentBound,myHomardGen,aCaseName,listeGroupesHypo) +MonCreateListGroupCAO(parentHyp,parentBound,myAdaptGen,aCaseName,listeGroupesHypo) { MESSAGE("Debut de MonEditListGroupCAO"); setWindowTitle(QObject::tr("HOM_GROU_EDIT_WINDOW_TITLE")); diff --git a/src/ADAPTGUI/MonEditListGroupCAO.h b/src/ADAPTGUI/MonEditListGroupCAO.h index 90dfb1967..a32d87402 100644 --- a/src/ADAPTGUI/MonEditListGroupCAO.h +++ b/src/ADAPTGUI/MonEditListGroupCAO.h @@ -37,7 +37,7 @@ class HOMARD_EXPORT MonEditListGroupCAO : public MonCreateListGroupCAO Q_OBJECT public: - MonEditListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, bool modal, ADAPT::ADAPT_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo); + MonEditListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, bool modal, ADAPT::ADAPT_Gen_var myAdaptGen, QString aCaseName, QStringList listeGroupesHypo); virtual ~MonEditListGroupCAO(); protected : diff --git a/src/ADAPTGUI/MonEditYACS.cxx b/src/ADAPTGUI/MonEditYACS.cxx index 51fff9cb3..3b346ed2d 100644 --- a/src/ADAPTGUI/MonEditYACS.cxx +++ b/src/ADAPTGUI/MonEditYACS.cxx @@ -32,14 +32,14 @@ using namespace std; */ // ------------------------------------------------------------- MonEditYACS::MonEditYACS ( bool modal, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString Name ): - MonCreateYACS(myHomardGen, Name) + MonCreateYACS(myAdaptGen, Name) { MESSAGE("Debut de MonEditYACS" << Name.toStdString().c_str()); setWindowTitle(QObject::tr("HOM_YACS_EDIT_WINDOW_TITLE")); _Name = Name; - aYACS = myHomardGen->GetYACS(_Name.toStdString().c_str()); + aYACS = myAdaptGen->GetYACS(_Name.toStdString().c_str()); InitValEdit(); } // ------------------------------ @@ -140,7 +140,7 @@ bool MonEditYACS:: CreateOrUpdate() // B. Si changement if ( chgt ) { - myHomardGen->InvalideYACS(_Name.toStdString().c_str()); + myAdaptGen->InvalideYACS(_Name.toStdString().c_str()); } HOMARD_UTILS::updateObjBrowser(); diff --git a/src/ADAPTGUI/MonEditYACS.h b/src/ADAPTGUI/MonEditYACS.h index f8d3a48d5..ddb1b5dcc 100644 --- a/src/ADAPTGUI/MonEditYACS.h +++ b/src/ADAPTGUI/MonEditYACS.h @@ -35,7 +35,7 @@ class HOMARD_EXPORT MonEditYACS : public MonCreateYACS Q_OBJECT public: MonEditYACS( bool modal, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString Name ); virtual ~MonEditYACS(); diff --git a/src/ADAPTGUI/MonEditZone.cxx b/src/ADAPTGUI/MonEditZone.cxx index 3bb2c98da..c2ec454f7 100644 --- a/src/ADAPTGUI/MonEditZone.cxx +++ b/src/ADAPTGUI/MonEditZone.cxx @@ -32,18 +32,18 @@ using namespace std; // ------------------------------------------------------------------------ MonEditZone::MonEditZone( MonCreateHypothesis* parent, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString caseName, QString Name ): // ------------------------------------------------------------------------ /* Constructs a MonEditZone herite de MonCreateZone */ - MonCreateZone(parent, myHomardGen, caseName) + MonCreateZone(parent, myAdaptGen, caseName) { MESSAGE("Debut de MonEditZone pour " << Name.toStdString().c_str()); setWindowTitle(QObject::tr("HOM_ZONE_EDIT_WINDOW_TITLE")); _Name=Name; - aZone = myHomardGen->GetZone(_Name.toStdString().c_str()); + aZone = myAdaptGen->GetZone(_Name.toStdString().c_str()); InitValEdit(); } // ------------------------------------------------------------------------ @@ -420,7 +420,7 @@ bool MonEditZone::CreateOrUpdateZone() break; } } - if (Chgt) myHomardGen->InvalideZone(_Name.toStdString().c_str()); + if (Chgt) myAdaptGen->InvalideZone(_Name.toStdString().c_str()); HOMARD_UTILS::updateObjBrowser(); } catch( const SALOME::SALOME_Exception& S_ex ) { diff --git a/src/ADAPTGUI/MonEditZone.h b/src/ADAPTGUI/MonEditZone.h index 726a1d933..c561f14d1 100644 --- a/src/ADAPTGUI/MonEditZone.h +++ b/src/ADAPTGUI/MonEditZone.h @@ -35,7 +35,7 @@ class HOMARD_EXPORT MonEditZone : public MonCreateZone Q_OBJECT public: MonEditZone( MonCreateHypothesis* parent, bool modal, - ADAPT::ADAPT_Gen_var myHomardGen, + ADAPT::ADAPT_Gen_var myAdaptGen, QString caseName, QString Name); virtual ~MonEditZone(); diff --git a/src/ADAPTGUI/MonIterInfo.cxx b/src/ADAPTGUI/MonIterInfo.cxx index 4a789439c..8d922f887 100644 --- a/src/ADAPTGUI/MonIterInfo.cxx +++ b/src/ADAPTGUI/MonIterInfo.cxx @@ -33,7 +33,7 @@ using namespace std; // ----------------------------------------------------------------------------------------- -MonIterInfo::MonIterInfo(QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myHomardGen0, QString IterName) +MonIterInfo::MonIterInfo(QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myAdaptGen0, QString IterName) // ----------------------------------------------------------------------------------------- /* Constructs a MonIterInfo * Inherits from CasHomard @@ -51,7 +51,7 @@ MonIterInfo::MonIterInfo(QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myHom _Option(-1) { MESSAGE("appel de _duplicate"); - myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0); + myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0); setupUi(this); setModal(modal); InitConnect(); @@ -96,7 +96,7 @@ bool MonIterInfo::PushOnApply() } // Recuperation de l'iteration - aIter = myHomardGen->GetIteration(_IterName.toStdString().c_str()) ; + aIter = myAdaptGen->GetIteration(_IterName.toStdString().c_str()) ; // Lancement de l'analyse try @@ -112,7 +112,7 @@ bool MonIterInfo::PushOnApply() // Le bilan de l'analyse a afficher QString aFileName = aIter->GetFileInfo() ; - MonEditFile *aDlg = new MonEditFile( 0, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen), aFileName, 0 ) ; + MonEditFile *aDlg = new MonEditFile( 0, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), aFileName, 0 ) ; if ( aDlg->_codret == 0 ) { aDlg->show(); } @@ -130,7 +130,7 @@ void MonIterInfo::PushOnOK() void MonIterInfo::PushOnHelp() //------------------------------- { - std::string LanguageShort = myHomardGen->GetLanguageShort(); + std::string LanguageShort = myAdaptGen->GetLanguageShort(); HOMARD_UTILS::PushOnHelp(QString("gui_mesh_info.html"), QString(""), QString(LanguageShort.c_str())); } // ------------------------------------------------------------------------ diff --git a/src/ADAPTGUI/MonIterInfo.h b/src/ADAPTGUI/MonIterInfo.h index 5ce8cf742..8627efbd4 100644 --- a/src/ADAPTGUI/MonIterInfo.h +++ b/src/ADAPTGUI/MonIterInfo.h @@ -40,11 +40,11 @@ class HOMARD_EXPORT MonIterInfo : public QDialog, public Ui_IterInfo Q_OBJECT public: - MonIterInfo( QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myHomardGen, QString IterName); + MonIterInfo( QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myAdaptGen, QString IterName); ~MonIterInfo(); protected : - MonIterInfo( QWidget* parent, ADAPT::ADAPT_Gen_var myHomardGen, QString IterName ); + MonIterInfo( QWidget* parent, ADAPT::ADAPT_Gen_var myAdaptGen, QString IterName ); QString _IterName; QString _aCaseName; @@ -57,7 +57,7 @@ protected : int _Option; ADAPT::HOMARD_Iteration_var aIter ; - ADAPT::ADAPT_Gen_var myHomardGen; + ADAPT::ADAPT_Gen_var myAdaptGen; virtual void InitConnect(); diff --git a/src/ADAPTGUI/MonMeshInfo.cxx b/src/ADAPTGUI/MonMeshInfo.cxx index b172e38e1..3589c5f9a 100644 --- a/src/ADAPTGUI/MonMeshInfo.cxx +++ b/src/ADAPTGUI/MonMeshInfo.cxx @@ -36,7 +36,7 @@ using namespace std; // ----------------------------------------------------------------------------------------- -MonMeshInfo::MonMeshInfo(QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myHomardGen0) +MonMeshInfo::MonMeshInfo(QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myAdaptGen0) // ----------------------------------------------------------------------------------------- /* Constructs a MonMeshInfo * Inherits from CasHomard @@ -51,7 +51,7 @@ MonMeshInfo::MonMeshInfo(QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myHom _Entanglement(0), _Quality(0) { - myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0); + myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0); setupUi(this); setModal(modal); InitConnect(); @@ -106,7 +106,7 @@ bool MonMeshInfo::PushOnApply() return false; } if ( aDirName != _aDirName) - { QString CaseNameDir = myHomardGen->VerifieDir( aDirName.toStdString().c_str()) ; + { QString CaseNameDir = myAdaptGen->VerifieDir( aDirName.toStdString().c_str()) ; if ( CaseNameDir != "" ) { QString texte ; @@ -150,7 +150,7 @@ bool MonMeshInfo::PushOnApply() _aCaseName = aCaseName; try { - myHomardGen->MeshInfo( \ + myAdaptGen->MeshInfo( \ CORBA::string_dup(_aCaseName.toStdString().c_str()), \ CORBA::string_dup(aMeshName.toStdString().c_str()), \ CORBA::string_dup(aFileName.toStdString().c_str()), \ @@ -166,11 +166,11 @@ bool MonMeshInfo::PushOnApply() } // Le bilan de l'analyse a afficher - aCase = myHomardGen->GetCase(_aCaseName.toStdString().c_str()); + aCase = myAdaptGen->GetCase(_aCaseName.toStdString().c_str()); string iter0 = aCase->GetIter0Name(); - ADAPT::HOMARD_Iteration_var aIter = myHomardGen->GetIteration(iter0.c_str()); + ADAPT::HOMARD_Iteration_var aIter = myAdaptGen->GetIteration(iter0.c_str()); aFileName = aIter->GetFileInfo() ; - MonEditFile *aDlg = new MonEditFile( 0, true, ADAPT::ADAPT_Gen::_duplicate(myHomardGen), aFileName, 1 ) ; + MonEditFile *aDlg = new MonEditFile( 0, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), aFileName, 1 ) ; if ( aDlg->_codret == 0 ) { aDlg->show(); } HOMARD_UTILS::updateObjBrowser(); @@ -187,14 +187,14 @@ void MonMeshInfo::PushOnOK() void MonMeshInfo::PushOnHelp() //------------------------------- { - std::string LanguageShort = myHomardGen->GetLanguageShort(); + std::string LanguageShort = myAdaptGen->GetLanguageShort(); HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""), QString(LanguageShort.c_str())); } // --------------------------------- void MonMeshInfo::SetNewCaseName() // ------------------------------ { - ADAPT::listeCases_var MyCases = myHomardGen->GetAllCasesName(); + ADAPT::listeCases_var MyCases = myAdaptGen->GetAllCasesName(); int num = 0; QString aCaseName=""; while (aCaseName=="" ) { diff --git a/src/ADAPTGUI/MonMeshInfo.h b/src/ADAPTGUI/MonMeshInfo.h index 132ce89de..ec29de706 100644 --- a/src/ADAPTGUI/MonMeshInfo.h +++ b/src/ADAPTGUI/MonMeshInfo.h @@ -37,7 +37,7 @@ class HOMARD_EXPORT MonMeshInfo : public QDialog, public Ui_MeshInfo Q_OBJECT public: - MonMeshInfo( QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myHomardGen); + MonMeshInfo( QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myAdaptGen); ~MonMeshInfo(); protected : @@ -51,7 +51,7 @@ protected : int _Quality; ADAPT::HOMARD_Cas_var aCase ; - ADAPT::ADAPT_Gen_var myHomardGen; + ADAPT::ADAPT_Gen_var myAdaptGen; virtual void InitConnect(); virtual void SetNewCaseName(); diff --git a/src/ADAPTGUI/MonPursueIteration.cxx b/src/ADAPTGUI/MonPursueIteration.cxx index b929d5810..ebecd5fa6 100644 --- a/src/ADAPTGUI/MonPursueIteration.cxx +++ b/src/ADAPTGUI/MonPursueIteration.cxx @@ -39,13 +39,13 @@ using namespace std; * Sets attributes to default values */ // ----------------------------------------------------------------------------------------- -MonPursueIteration::MonPursueIteration ( bool modal, ADAPT::ADAPT_Gen_var myHomardGen0 ) +MonPursueIteration::MonPursueIteration ( bool modal, ADAPT::ADAPT_Gen_var myAdaptGen0 ) : Ui_PursueIteration(), _aCaseName(""), _aDirName(""), _aDirNameStart("") { MESSAGE("Debut du constructeur de MonPursueIteration"); - myHomardGen=ADAPT::ADAPT_Gen::_duplicate(myHomardGen0); + myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0); setupUi(this); setModal(modal); @@ -98,7 +98,7 @@ bool MonPursueIteration::PushOnApply() return false; } if ( aDirName != _aDirName) - { QString CaseNameDir = myHomardGen->VerifieDir( aDirName.toStdString().c_str()) ; + { QString CaseNameDir = myAdaptGen->VerifieDir( aDirName.toStdString().c_str()) ; if ( CaseNameDir != "" ) { QString texte ; @@ -147,7 +147,7 @@ bool MonPursueIteration::PushOnApply() try { MESSAGE("Poursuite a partir d'une iteration"); - aCase = myHomardGen->CreateCaseFromIteration( \ + aCase = myAdaptGen->CreateCaseFromIteration( \ CORBA::string_dup(_aCaseName.toStdString().c_str()), \ CORBA::string_dup(_aDirNameStart.toStdString().c_str()) ); } @@ -164,7 +164,7 @@ bool MonPursueIteration::PushOnApply() try { MESSAGE("Poursuite a partir de la derniere iteration dans un cas"); - aCase = myHomardGen->CreateCaseFromCaseLastIteration( \ + aCase = myAdaptGen->CreateCaseFromCaseLastIteration( \ CORBA::string_dup(_aCaseName.toStdString().c_str()), \ CORBA::string_dup(_aDirNameStart.toStdString().c_str()) ); } @@ -181,7 +181,7 @@ bool MonPursueIteration::PushOnApply() try { MESSAGE("Poursuite a partir d'une iteration dans un cas"); - aCase = myHomardGen->CreateCaseFromCaseIteration( \ + aCase = myAdaptGen->CreateCaseFromCaseIteration( \ CORBA::string_dup(_aCaseName.toStdString().c_str()), \ CORBA::string_dup(_aDirNameStart.toStdString().c_str()), \ Number ); @@ -214,14 +214,14 @@ void MonPursueIteration::PushOnOK() void MonPursueIteration::PushOnHelp() //------------------------------- { - std::string LanguageShort = myHomardGen->GetLanguageShort(); + std::string LanguageShort = myAdaptGen->GetLanguageShort(); HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""), QString(LanguageShort.c_str())); } // --------------------------------- void MonPursueIteration::SetNewCaseName() // ------------------------------ { - ADAPT::listeCases_var MyCases = myHomardGen->GetAllCasesName(); + ADAPT::listeCases_var MyCases = myAdaptGen->GetAllCasesName(); int num = 0; QString aCaseName=""; while (aCaseName=="" ) { diff --git a/src/ADAPTGUI/MonPursueIteration.h b/src/ADAPTGUI/MonPursueIteration.h index 367f9141d..00dd62015 100644 --- a/src/ADAPTGUI/MonPursueIteration.h +++ b/src/ADAPTGUI/MonPursueIteration.h @@ -37,7 +37,7 @@ class HOMARD_EXPORT MonPursueIteration : public QDialog, public Ui_PursueIterati Q_OBJECT public: - MonPursueIteration( bool modal, ADAPT::ADAPT_Gen_var myHomardGen ); + MonPursueIteration( bool modal, ADAPT::ADAPT_Gen_var myAdaptGen ); virtual ~MonPursueIteration(); protected : @@ -48,7 +48,7 @@ class HOMARD_EXPORT MonPursueIteration : public QDialog, public Ui_PursueIterati int _Type ; ADAPT::HOMARD_Cas_var aCase ; - ADAPT::ADAPT_Gen_var myHomardGen; + ADAPT::ADAPT_Gen_var myAdaptGen; virtual void InitConnect(); virtual void SetNewCaseName(); diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx index 387baa90f..5d55ae175 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx @@ -187,9 +187,9 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) case 8011: // Creation d un Cas { INFOS("Creation d'un Cas"); -// MonCreateCase *aDlg = new MonCreateCase( true, -// ADAPT::ADAPT_Gen::_duplicate(homardGen) ) ; -// aDlg->show(); + MonCreateCase *aDlg = new MonCreateCase( true, + ADAPT::ADAPT_Gen::_duplicate(homardGen) ) ; + aDlg->show(); break; } From 7a6c94b9e00d2705d46556e0378aa6ae8f804cb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Thu, 28 May 2020 10:48:20 +0200 Subject: [PATCH 029/100] Oubli --- src/SMESHGUI/SMESHGUI_AdaptDlg.cxx | 58 +++++++++++++++--------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx index 5d55ae175..92b9971ac 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx @@ -174,9 +174,9 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) SALOME_LifeCycleCORBA* ls = new SALOME_LifeCycleCORBA(app->namingService()); Engines::EngineComponent_var comp = ls->FindOrLoad_Component("FactoryServer", "SMESH"); - ADAPT::ADAPT_Gen_var homardGen = ADAPT::ADAPT_Gen::_narrow(comp); - if (!CORBA::is_nil(homardGen)) - homardGen->UpdateStudy(); + ADAPT::ADAPT_Gen_var adaptGen = ADAPT::ADAPT_Gen::_narrow(comp); + if (!CORBA::is_nil(adaptGen)) + adaptGen->UpdateStudy(); SMESHGUI::GetSMESHGUI()->getApp()->updateObjectBrowser(); // @@ -188,7 +188,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) { INFOS("Creation d'un Cas"); MonCreateCase *aDlg = new MonCreateCase( true, - ADAPT::ADAPT_Gen::_duplicate(homardGen) ) ; + ADAPT::ADAPT_Gen::_duplicate(adaptGen) ) ; aDlg->show(); break; } @@ -197,7 +197,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // { // MESSAGE("command " << theCommandID << " activated"); // MonPursueIteration *aDlg = new MonPursueIteration( true, -// ADAPT::ADAPT_Gen::_duplicate(homardGen) ) ; +// ADAPT::ADAPT_Gen::_duplicate(adaptGen) ) ; // aDlg->show(); // break; // } @@ -206,7 +206,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // { // MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); // MonCreateIteration *IterDlg = new MonCreateIteration( parent, true, -// ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName ) ; +// ADAPT::ADAPT_Gen::_duplicate(adaptGen), _ObjectName ) ; // IterDlg->show(); // break; // } @@ -214,7 +214,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // case 8014: // Compute une iteration // { // MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// try { homardGen->Compute(_ObjectName.toStdString().c_str(), 0, 1, -1, 1); } +// try { adaptGen->Compute(_ObjectName.toStdString().c_str(), 0, 1, -1, 1); } // catch( SALOME::SALOME_Exception& S_ex ) // { // QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), @@ -228,7 +228,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // case 8015: // Compute une iteration et publication // { // MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// try { homardGen->Compute(_ObjectName.toStdString().c_str(), 0, 1, -1, 2); } +// try { adaptGen->Compute(_ObjectName.toStdString().c_str(), 0, 1, -1, 2); } // catch( SALOME::SALOME_Exception& S_ex ) // { // QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), @@ -242,7 +242,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // case 1121: // Information sur le maillage de l'iteration // { // MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// MonIterInfo *IterDlg = new MonIterInfo( parent, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName ) ; +// MonIterInfo *IterDlg = new MonIterInfo( parent, true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), _ObjectName ) ; // IterDlg->show(); // break; // } @@ -250,14 +250,14 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // case 1131: // Publication du maillage de l'iteration // { // MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// homardGen->PublishMeshIterInSmesh(_ObjectName.toStdString().c_str()); +// adaptGen->PublishMeshIterInSmesh(_ObjectName.toStdString().c_str()); // break; // } // // case 1132: // Publication du maillage de l'iteration a partir du fichier // { // MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// homardGen->PublishResultInSmesh(_ObjectName.toStdString().c_str(), 1); +// adaptGen->PublishResultInSmesh(_ObjectName.toStdString().c_str(), 1); // break; // } // @@ -272,50 +272,50 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // // Edition d'une frontiere CAO // if (HOMARD_UTILS::isBoundaryCAO(obj)) // { -// MonEditBoundaryCAO *aDlg = new MonEditBoundaryCAO(0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; +// MonEditBoundaryCAO *aDlg = new MonEditBoundaryCAO(0, true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), QString(""), _ObjectName ) ; // aDlg->show(); // } // // Edition d'une frontiere discrete // else if (HOMARD_UTILS::isBoundaryDi(obj)) // { -// MonEditBoundaryDi *aDlg = new MonEditBoundaryDi(0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; +// MonEditBoundaryDi *aDlg = new MonEditBoundaryDi(0, true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), QString(""), _ObjectName ) ; // aDlg->show(); // } // // Edition d'une frontiere analytique // else if (HOMARD_UTILS::isBoundaryAn(obj)) // { -// MonEditBoundaryAn *aDlg = new MonEditBoundaryAn(0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; +// MonEditBoundaryAn *aDlg = new MonEditBoundaryAn(0, true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), QString(""), _ObjectName ) ; // aDlg->show(); // } // // Edition d'un cas // else if (HOMARD_UTILS::isCase(obj)) // { -// MonEditCase *aDlg = new MonEditCase(true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName ) ; +// MonEditCase *aDlg = new MonEditCase(true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), _ObjectName ) ; // aDlg->show(); // } // // Edition d'une hypothese // else if (HOMARD_UTILS::isHypo(obj)) // { -// MonEditHypothesis *aDlg = new MonEditHypothesis(0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName, QString(""), QString("")) ; +// MonEditHypothesis *aDlg = new MonEditHypothesis(0, true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), _ObjectName, QString(""), QString("")) ; // aDlg->show(); // } // // Edition d'une iteration // else if (HOMARD_UTILS::isIter(obj)) // { -// MonEditIteration *aDlg = new MonEditIteration(parent, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; +// MonEditIteration *aDlg = new MonEditIteration(parent, true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), QString(""), _ObjectName ) ; // aDlg->show(); // } // // Edition d'un schema YACS // else if (HOMARD_UTILS::isYACS(obj)) // { // MESSAGE("appel de MonEditYACS"); -// MonEditYACS *aDlg = new MonEditYACS(true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName) ; +// MonEditYACS *aDlg = new MonEditYACS(true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), _ObjectName) ; // aDlg->show(); // } // // Edition d'une zone // else if (HOMARD_UTILS::isZone(obj)) // { -// MonEditZone *aDlg = new MonEditZone(0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; +// MonEditZone *aDlg = new MonEditZone(0, true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), QString(""), _ObjectName ) ; // aDlg->show(); // } // } @@ -334,7 +334,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // if ( HOMARD_UTILS::isBoundaryCAO(obj) || HOMARD_UTILS::isBoundaryDi(obj) || HOMARD_UTILS::isBoundaryAn(obj) ) // { // try -// { homardGen->DeleteBoundary(_ObjectName.toStdString().c_str()); } +// { adaptGen->DeleteBoundary(_ObjectName.toStdString().c_str()); } // catch( SALOME::SALOME_Exception& S_ex ) // { // QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), @@ -347,7 +347,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // else if (HOMARD_UTILS::isCase(obj)) // { // try -// { homardGen->DeleteCase(_ObjectName.toStdString().c_str(), 1); } +// { adaptGen->DeleteCase(_ObjectName.toStdString().c_str(), 1); } // catch( SALOME::SALOME_Exception& S_ex ) // { // QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), @@ -360,7 +360,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // else if (HOMARD_UTILS::isHypo(obj)) // { // try -// { homardGen->DeleteHypo(_ObjectName.toStdString().c_str()); } +// { adaptGen->DeleteHypo(_ObjectName.toStdString().c_str()); } // catch( SALOME::SALOME_Exception& S_ex ) // { // QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), @@ -373,7 +373,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // else if (HOMARD_UTILS::isIter(obj)) // { // try -// { homardGen->DeleteIteration(_ObjectName.toStdString().c_str(), 1); } +// { adaptGen->DeleteIteration(_ObjectName.toStdString().c_str(), 1); } // catch( SALOME::SALOME_Exception& S_ex ) // { // QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), @@ -386,7 +386,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // else if (HOMARD_UTILS::isYACS(obj)) // { // try -// { homardGen->DeleteYACS(_ObjectName.toStdString().c_str(), 1); } +// { adaptGen->DeleteYACS(_ObjectName.toStdString().c_str(), 1); } // catch( SALOME::SALOME_Exception& S_ex ) // { // QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), @@ -399,7 +399,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // else if (HOMARD_UTILS::isZone(obj)) // { // try -// { homardGen->DeleteZone(_ObjectName.toStdString().c_str()); } +// { adaptGen->DeleteZone(_ObjectName.toStdString().c_str()); } // catch( SALOME::SALOME_Exception& S_ex ) // { // QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), @@ -416,7 +416,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // { // MESSAGE("etape 1301") // MESSAGE("command " << theCommandID << " activated"); -// MonMeshInfo *aDlg = new MonMeshInfo( parent, true, ADAPT::ADAPT_Gen::_duplicate(homardGen) ) ; +// MonMeshInfo *aDlg = new MonMeshInfo( parent, true, ADAPT::ADAPT_Gen::_duplicate(adaptGen) ) ; // aDlg->show(); // break; // } @@ -427,7 +427,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // _PTR(SObject) obj = chercheMonObjet(); // if ( (obj) && ( HOMARD_UTILS::isFileType(obj,QString("log")) || HOMARD_UTILS::isFileType(obj,QString("Summary")) || HOMARD_UTILS::isFileType(obj,QString("xml")) ) ) // { -// MonEditFile *aDlg = new MonEditFile( 0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName, 0 ) ; +// MonEditFile *aDlg = new MonEditFile( 0, true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), _ObjectName, 0 ) ; // if ( aDlg->_codret == 0 ) { aDlg->show(); } // } // break; @@ -437,7 +437,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // { // MESSAGE("etape 1401") // MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// MonCreateYACS *aDlg = new MonCreateYACS( true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName ) ; +// MonCreateYACS *aDlg = new MonCreateYACS( true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), _ObjectName ) ; // aDlg->show(); // break; // } @@ -446,7 +446,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // { // MESSAGE("etape 1402") // MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// try { homardGen->YACSWrite(_ObjectName.toStdString().c_str()); } +// try { adaptGen->YACSWrite(_ObjectName.toStdString().c_str()); } // catch( SALOME::SALOME_Exception& S_ex ) // { // QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), From c29f2e2ad680db99d029ad0d060bb530324cd052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Thu, 28 May 2020 14:19:59 +0200 Subject: [PATCH 030/100] =?UTF-8?q?Biblioth=C3=A8que=20compl=C3=A9mentaire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SMESHGUI/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SMESHGUI/CMakeLists.txt b/src/SMESHGUI/CMakeLists.txt index 185d6c5fe..c08dae366 100644 --- a/src/SMESHGUI/CMakeLists.txt +++ b/src/SMESHGUI/CMakeLists.txt @@ -76,6 +76,7 @@ SET(_link_LIBRARIES SMESHObject ADAPTGUI ADAPTImpl + ADAPTEngine ) # --- headers --- From c4a98a4a6aee975b90d524e65c170884ceb309b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Thu, 28 May 2020 14:22:10 +0200 Subject: [PATCH 031/100] =?UTF-8?q?Les=20pr=C3=A9f=C3=A9rences.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SMESHGUI/SMESHGUI_AdaptDlg.cxx | 199 +++++++++++++++++++++-------- src/SMESHGUI/SMESHGUI_AdaptDlg.h | 13 ++ 2 files changed, 161 insertions(+), 51 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx index 92b9971ac..a7b278c87 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx @@ -133,52 +133,149 @@ SMESHGUI_AdaptDlg::SMESHGUI_AdaptDlg( SMESHGUI* theModule, myNbChangesOfContents(0), myIsApplyAndClose( false ) { - std::cout << "SMESHGUI_AdaptDlg avec theCommandID : " << theCommandID << std::endl; - if ( ! OnGUIEvent (theCommandID) ) - { - INFOS("Erreur"); - } -// initDialog( true ); -// if ( !theMesh->_is_nil() ) -// init( theMesh ); -// else -// { -// mySelectSubMesh->setEnabled( false ); -// mySelectGroup->setEnabled( false ); -// myGeomGroupBtn->setEnabled( false ); -// myGeomGroupLine->setEnabled( false ); -// } + bool ok = action( theCommandID ) ; } + +/*! + * \brief Pilote les actions d'adaption de maillage + * \param + * \return bool OK/notOK +*/ +bool SMESHGUI_AdaptDlg::action (int theCommandID) +//======================================================================= +{ + std::cout << "SMESHGUI_AdaptDlg::action avec theCommandID : " << theCommandID << std::endl; + +// Preferences + recupPreferences(); + +// Menus and actions + bool ok = OnGUIEvent (theCommandID) ; + if ( ! ok ) INFOS("Erreur"); + + return ok ; +} + +/*! + * \brief Gets the preferences for the adaptation + * \param + * \return + * + * Pour chaque valeur, le defaut est la valeur definie dans ADAPT_Gen + * . Si la recuperation dans config/salome s'est bien passee a la creation de ADAPT_Gen + * ces valeurs sont les valeurs definies. + * . Si cela ne s'est pas bien passe, ce sont les valeurs par defaut de ADAPT_Gen +*/ +void SMESHGUI_AdaptDlg::recupPreferences() +{ + INFOS("Début de recupPreferences") +// +// A. Declarations +// + SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); + SALOME_LifeCycleCORBA* ls = new SALOME_LifeCycleCORBA(app->namingService()); + Engines::EngineComponent_var comp = ls->FindOrLoad_Component("FactoryServer", "SMESH"); + ADAPT::ADAPT_Gen_var adaptGen = ADAPT::ADAPT_Gen::_narrow(comp); + if (!CORBA::is_nil(adaptGen)) + adaptGen->UpdateStudy(); + + int defaut_i ; + std::string defaut_s ; + QString QString_v ; +// +// B. Les valeurs +// B.1. La langue +// + INFOS("début de B.1."); + defaut_s = adaptGen->GetLanguageShort(); + INFOS("defaut_s OK"); + SUIT_ResourceMgr* resMgr = mySMESHGUI->getApp()->resourceMgr(); + INFOS("SUIT_ResourceMgr OK"); + _LanguageShort = resMgr->stringValue("language", "language", QString(defaut_s.c_str()) ); + INFOS ("Récupération de LanguageShort = " << _LanguageShort.toStdString().c_str() ); +// +// B.2. Les publications + bool publish_mesh ; +// + _PublisMeshIN = adaptGen->GetPublisMeshIN(); + if ( _PublisMeshIN == 1 ) { publish_mesh = true ; } + else { publish_mesh = false ; } + publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_in", publish_mesh ); + if ( publish_mesh ) { _PublisMeshIN = 1 ; } + else { _PublisMeshIN = 0 ; } +// + _PublisMeshOUT = adaptGen->GetPublisMeshOUT(); + if ( _PublisMeshOUT == 1 ) { publish_mesh = true ; } + else { publish_mesh = false ; } + publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_out", publish_mesh ); + if ( publish_mesh ) { _PublisMeshOUT = 1 ; } + else { _PublisMeshOUT = 0 ; } +// +// B.3. Les maximum pour YACS +// + defaut_i = adaptGen->GetYACSMaxIter(); + _YACSMaxIter = resMgr->integerValue("HOMARD", "yacs_max_iter", defaut_i ); +// + defaut_i = adaptGen->GetYACSMaxNode(); + _YACSMaxNode = resMgr->integerValue("HOMARD", "yacs_max_node", defaut_i ); +// + defaut_i = adaptGen->GetYACSMaxElem(); + _YACSMaxElem = resMgr->integerValue("HOMARD", "yacs_max_elem", defaut_i ); +// +// B.4. La convergence pour YACS +// + defaut_i = adaptGen->GetYACSConvergenceType(); + if ( defaut_i == 1 ) { QString_v = tr("VTest > VRef") ; } + else if ( defaut_i == 2 ) { QString_v = tr("VTest < VRef") ; } + else { QString_v = tr("None") ; } + QString_v = resMgr->stringValue ( "HOMARD", "yacs_type_test", QString_v ); + if ( ( QString_v == "VTest > VRef" ) || ( QString_v == "VTest > VRef" ) ) { _YACSTypeTest = 1 ; } + else if ( ( QString_v == "VTest < VRef" ) || ( QString_v == "VTest < VRef" ) ) { _YACSTypeTest = 2 ; } + else { _YACSTypeTest = 0 ; } +// +// C. Enregistrement dans l'objet general +// + INFOS ("Enregistrement de LanguageShort = " << _LanguageShort.toStdString().c_str() ); + INFOS ("Enregistrement de PublisMeshIN = " << _PublisMeshIN<<", PublisMeshOUT = "<< _PublisMeshOUT); + INFOS ("Enregistrement de YACSMaxIter = " << _YACSMaxIter<<", YACSMaxNode = "<< _YACSMaxNode<<", YACSMaxElem = "<< _YACSMaxElem); + INFOS ("Enregistrement de YACSTypeTest = " << _YACSTypeTest); +// + adaptGen->SetLanguageShort(_LanguageShort.toStdString().c_str()); + adaptGen->SetPublisMesh(_PublisMeshIN, _PublisMeshOUT); + adaptGen->SetYACSMaximum(_YACSMaxIter, _YACSMaxNode, _YACSMaxElem); +// + adaptGen->SetYACSConvergenceType(_YACSTypeTest); + INFOS("Fin de recupPreferences") +} + /*! * \brief Launches the GUI for the adaptation - * \param theCommandID - the integer taht references the operation - * \return Graphical object + * \param theCommandID - the integer that references the operation + * \return bool OK/notOK */ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) { std::cout << "OnGUIEvent avec theCommandID : " << theCommandID << std::endl; // A. Controles - SalomeApp_Application* app = - dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); + SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); if ( !app ) return false; SalomeApp_Study* aStudy = dynamic_cast ( app->activeStudy() ); if ( !aStudy ) { - MESSAGE ( "FAILED to cast active study to SalomeApp_Study" ); + INFOS ( "FAILED to cast active study to SalomeApp_Study" ); return false; } SUIT_Desktop* parent = SUIT_Session::session()->activeApplication()->desktop(); SALOME_LifeCycleCORBA* ls = new SALOME_LifeCycleCORBA(app->namingService()); - Engines::EngineComponent_var comp = - ls->FindOrLoad_Component("FactoryServer", "SMESH"); + Engines::EngineComponent_var comp = ls->FindOrLoad_Component("FactoryServer", "SMESH"); ADAPT::ADAPT_Gen_var adaptGen = ADAPT::ADAPT_Gen::_narrow(comp); if (!CORBA::is_nil(adaptGen)) adaptGen->UpdateStudy(); - SMESHGUI::GetSMESHGUI()->getApp()->updateObjectBrowser(); + mySMESHGUI->getApp()->updateObjectBrowser(); // // B. Choix selon les commandes SCRUTE(theCommandID); @@ -195,7 +292,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // case 8012: // Poursuite d une iteration // { -// MESSAGE("command " << theCommandID << " activated"); +// INFOS("command " << theCommandID << " activated"); // MonPursueIteration *aDlg = new MonPursueIteration( true, // ADAPT::ADAPT_Gen::_duplicate(adaptGen) ) ; // aDlg->show(); @@ -204,7 +301,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // case 8013: // Creation d une Iteration // { -// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// INFOS("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); // MonCreateIteration *IterDlg = new MonCreateIteration( parent, true, // ADAPT::ADAPT_Gen::_duplicate(adaptGen), _ObjectName ) ; // IterDlg->show(); @@ -213,13 +310,13 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // case 8014: // Compute une iteration // { -// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// INFOS("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); // try { adaptGen->Compute(_ObjectName.toStdString().c_str(), 0, 1, -1, 1); } // catch( SALOME::SALOME_Exception& S_ex ) // { // QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), // QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// getApp()->updateObjectBrowser(); +// mySMESHGUI->getApp()->updateObjectBrowser(); // return false; // } // break; @@ -227,13 +324,13 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // case 8015: // Compute une iteration et publication // { -// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// INFOS("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); // try { adaptGen->Compute(_ObjectName.toStdString().c_str(), 0, 1, -1, 2); } // catch( SALOME::SALOME_Exception& S_ex ) // { // QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), // QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// getApp()->updateObjectBrowser(); +// mySMESHGUI->getApp()->updateObjectBrowser(); // return false; // } // break; @@ -241,7 +338,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // case 1121: // Information sur le maillage de l'iteration // { -// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// INFOS("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); // MonIterInfo *IterDlg = new MonIterInfo( parent, true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), _ObjectName ) ; // IterDlg->show(); // break; @@ -249,21 +346,21 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // // case 1131: // Publication du maillage de l'iteration // { -// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// INFOS("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); // adaptGen->PublishMeshIterInSmesh(_ObjectName.toStdString().c_str()); // break; // } // // case 1132: // Publication du maillage de l'iteration a partir du fichier // { -// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// INFOS("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); // adaptGen->PublishResultInSmesh(_ObjectName.toStdString().c_str(), 1); // break; // } // // case 1201: // Edition d'un objet // { -// MESSAGE("command " << theCommandID << " activated"); +// INFOS("command " << theCommandID << " activated"); // QString nomObjet = HOMARD_QT_COMMUN::SelectionArbreEtude(QString(""), 1); // if (nomObjet == QString("")) break; // _PTR(SObject) obj = chercheMonObjet(); @@ -308,7 +405,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // // Edition d'un schema YACS // else if (HOMARD_UTILS::isYACS(obj)) // { -// MESSAGE("appel de MonEditYACS"); +// INFOS("appel de MonEditYACS"); // MonEditYACS *aDlg = new MonEditYACS(true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), _ObjectName) ; // aDlg->show(); // } @@ -324,7 +421,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // // case 1211: // Suppression d'un objet // { -// MESSAGE("command " << theCommandID << " activated"); +// INFOS("command " << theCommandID << " activated"); // QString nomObjet = HOMARD_QT_COMMUN::SelectionArbreEtude(QString(""), 1); // if (nomObjet == QString("")) break; // _PTR(SObject) obj = chercheMonObjet(); @@ -339,7 +436,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // { // QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), // QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// getApp()->updateObjectBrowser(); +// mySMESHGUI->getApp()->updateObjectBrowser(); // return false; // } // } @@ -352,7 +449,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // { // QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), // QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// getApp()->updateObjectBrowser(); +// mySMESHGUI->getApp()->updateObjectBrowser(); // return false; // } // } @@ -365,7 +462,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // { // QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), // QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// getApp()->updateObjectBrowser(); +// mySMESHGUI->getApp()->updateObjectBrowser(); // return false; // } // } @@ -378,7 +475,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // { // QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), // QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// getApp()->updateObjectBrowser(); +// mySMESHGUI->getApp()->updateObjectBrowser(); // return false; // } // } @@ -391,7 +488,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // { // QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), // QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// getApp()->updateObjectBrowser(); +// mySMESHGUI->getApp()->updateObjectBrowser(); // return false; // } // } @@ -404,7 +501,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // { // QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), // QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// getApp()->updateObjectBrowser(); +// mySMESHGUI->getApp()->updateObjectBrowser(); // return false; // } // } @@ -414,8 +511,8 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // // case 1301: // Information sur un maillage // { -// MESSAGE("etape 1301") -// MESSAGE("command " << theCommandID << " activated"); +// INFOS("etape 1301") +// INFOS("command " << theCommandID << " activated"); // MonMeshInfo *aDlg = new MonMeshInfo( parent, true, ADAPT::ADAPT_Gen::_duplicate(adaptGen) ) ; // aDlg->show(); // break; @@ -423,7 +520,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // // case 1302: // Affichage de fichier texte // { -// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// INFOS("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); // _PTR(SObject) obj = chercheMonObjet(); // if ( (obj) && ( HOMARD_UTILS::isFileType(obj,QString("log")) || HOMARD_UTILS::isFileType(obj,QString("Summary")) || HOMARD_UTILS::isFileType(obj,QString("xml")) ) ) // { @@ -435,8 +532,8 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // // case 1401: // Création d'un schema YACS // { -// MESSAGE("etape 1401") -// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// INFOS("etape 1401") +// INFOS("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); // MonCreateYACS *aDlg = new MonCreateYACS( true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), _ObjectName ) ; // aDlg->show(); // break; @@ -444,21 +541,21 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) // // case 1402: // Ecriture d'un schéma YACS // { -// MESSAGE("etape 1402") -// MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); +// INFOS("etape 1402") +// INFOS("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); // try { adaptGen->YACSWrite(_ObjectName.toStdString().c_str()); } // catch( SALOME::SALOME_Exception& S_ex ) // { // QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), // QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// getApp()->updateObjectBrowser(); +// mySMESHGUI->getApp()->updateObjectBrowser(); // return false; // } // break; // } } -// getApp()->updateObjectBrowser(); +// mySMESHGUI->getApp()->updateObjectBrowser(); return true; } @@ -1530,7 +1627,7 @@ void SMESHGUI_AdaptDlg::onOK() //================================================================================= void SMESHGUI_AdaptDlg::onListSelectionChanged() { - //MESSAGE( "SMESHGUI_AdaptDlg::onListSelectionChanged(); myActorsList.count() = " << myActorsList.count()); + //INFOS( "SMESHGUI_AdaptDlg::onListSelectionChanged(); myActorsList.count() = " << myActorsList.count()); if( myIsBusy || myActorsList.count() == 0 ) return; myIsBusy = true; diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.h b/src/SMESHGUI/SMESHGUI_AdaptDlg.h index 0aded7c31..2b139a3c0 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.h +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.h @@ -74,10 +74,13 @@ public: SMESH::SMESH_Mesh_ptr = SMESH::SMESH_Mesh::_nil() ); ~SMESHGUI_AdaptDlg(); + virtual bool action (int theCommandID); virtual bool OnGUIEvent (int theCommandID); static QString GetDefaultName( const QString& ); +// static ADAPT::ADAPT_Gen_var InitAdaptGen(SalomeApp_Application*); + public slots: void onAdd(); void onRemove(); @@ -148,6 +151,7 @@ private: private: + void recupPreferences(); SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */ LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */ int myGrpTypeId; /* Current group type id : standalone or group on geometry */ @@ -228,6 +232,15 @@ private: QString myObjectToSelect; bool myIsApplyAndClose; + + QString _ObjectName; + QString _LanguageShort ; + int _PublisMeshIN ; + int _PublisMeshOUT ; + int _YACSMaxIter ; + int _YACSMaxNode ; + int _YACSMaxElem ; + int _YACSTypeTest ; }; #endif // SMESHGUI_ADAPTDLG_H From 62f81f8c2703060de34a02c11922e7bff1915d27 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Wed, 3 Jun 2020 10:23:34 +0200 Subject: [PATCH 032/100] =?UTF-8?q?pr=C3=A9f=C3=A9rences?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SMESHGUI/SMESHGUI_AdaptDlg.cxx | 78 +++++++++++------------------- 1 file changed, 27 insertions(+), 51 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx index a7b278c87..48ab56388 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx @@ -179,72 +179,48 @@ void SMESHGUI_AdaptDlg::recupPreferences() if (!CORBA::is_nil(adaptGen)) adaptGen->UpdateStudy(); - int defaut_i ; - std::string defaut_s ; - QString QString_v ; -// + SUIT_ResourceMgr* resMgr = mySMESHGUI->getApp()->resourceMgr(); + // B. Les valeurs // B.1. La langue -// - INFOS("début de B.1."); - defaut_s = adaptGen->GetLanguageShort(); - INFOS("defaut_s OK"); - SUIT_ResourceMgr* resMgr = mySMESHGUI->getApp()->resourceMgr(); - INFOS("SUIT_ResourceMgr OK"); - _LanguageShort = resMgr->stringValue("language", "language", QString(defaut_s.c_str()) ); - INFOS ("Récupération de LanguageShort = " << _LanguageShort.toStdString().c_str() ); -// + + _LanguageShort = resMgr->stringValue("language", "language", "en" ); + INFOS ("Enregistrement de LanguageShort = " << _LanguageShort.toStdString().c_str() ); + adaptGen->SetLanguageShort(_LanguageShort.toStdString().c_str()); + // B.2. Les publications bool publish_mesh ; -// - _PublisMeshIN = adaptGen->GetPublisMeshIN(); - if ( _PublisMeshIN == 1 ) { publish_mesh = true ; } - else { publish_mesh = false ; } - publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_in", publish_mesh ); + + publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_in", false ); if ( publish_mesh ) { _PublisMeshIN = 1 ; } else { _PublisMeshIN = 0 ; } -// - _PublisMeshOUT = adaptGen->GetPublisMeshOUT(); - if ( _PublisMeshOUT == 1 ) { publish_mesh = true ; } - else { publish_mesh = false ; } - publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_out", publish_mesh ); + + publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_out", false ); if ( publish_mesh ) { _PublisMeshOUT = 1 ; } else { _PublisMeshOUT = 0 ; } -// + + INFOS ("Enregistrement de PublisMeshIN = " << _PublisMeshIN<<", PublisMeshOUT = "<< _PublisMeshOUT); + adaptGen->SetPublisMesh(_PublisMeshIN, _PublisMeshOUT); + // B.3. Les maximum pour YACS -// - defaut_i = adaptGen->GetYACSMaxIter(); - _YACSMaxIter = resMgr->integerValue("HOMARD", "yacs_max_iter", defaut_i ); -// - defaut_i = adaptGen->GetYACSMaxNode(); - _YACSMaxNode = resMgr->integerValue("HOMARD", "yacs_max_node", defaut_i ); -// - defaut_i = adaptGen->GetYACSMaxElem(); - _YACSMaxElem = resMgr->integerValue("HOMARD", "yacs_max_elem", defaut_i ); -// + + _YACSMaxIter = resMgr->integerValue("HOMARD", "yacs_max_iter", 0 ); + _YACSMaxNode = resMgr->integerValue("HOMARD", "yacs_max_node", 0 ); + _YACSMaxElem = resMgr->integerValue("HOMARD", "yacs_max_elem", 0 ); + + INFOS ("Enregistrement de YACSMaxIter = " << _YACSMaxIter<<", YACSMaxNode = "<< _YACSMaxNode<<", YACSMaxElem = "<< _YACSMaxElem); + adaptGen->SetYACSMaximum(_YACSMaxIter, _YACSMaxNode, _YACSMaxElem); + // B.4. La convergence pour YACS -// - defaut_i = adaptGen->GetYACSConvergenceType(); - if ( defaut_i == 1 ) { QString_v = tr("VTest > VRef") ; } - else if ( defaut_i == 2 ) { QString_v = tr("VTest < VRef") ; } - else { QString_v = tr("None") ; } - QString_v = resMgr->stringValue ( "HOMARD", "yacs_type_test", QString_v ); + + QString QString_v = resMgr->stringValue ( "HOMARD", "yacs_type_test", "None" ); if ( ( QString_v == "VTest > VRef" ) || ( QString_v == "VTest > VRef" ) ) { _YACSTypeTest = 1 ; } else if ( ( QString_v == "VTest < VRef" ) || ( QString_v == "VTest < VRef" ) ) { _YACSTypeTest = 2 ; } else { _YACSTypeTest = 0 ; } -// -// C. Enregistrement dans l'objet general -// - INFOS ("Enregistrement de LanguageShort = " << _LanguageShort.toStdString().c_str() ); - INFOS ("Enregistrement de PublisMeshIN = " << _PublisMeshIN<<", PublisMeshOUT = "<< _PublisMeshOUT); - INFOS ("Enregistrement de YACSMaxIter = " << _YACSMaxIter<<", YACSMaxNode = "<< _YACSMaxNode<<", YACSMaxElem = "<< _YACSMaxElem); + INFOS ("Enregistrement de YACSTypeTest = " << _YACSTypeTest); -// - adaptGen->SetLanguageShort(_LanguageShort.toStdString().c_str()); - adaptGen->SetPublisMesh(_PublisMeshIN, _PublisMeshOUT); - adaptGen->SetYACSMaximum(_YACSMaxIter, _YACSMaxNode, _YACSMaxElem); -// adaptGen->SetYACSConvergenceType(_YACSTypeTest); + INFOS("Fin de recupPreferences") } From aeafd2ea22fb0d713eedd69de27d6464a961ff3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Thu, 4 Jun 2020 17:38:43 +0200 Subject: [PATCH 033/100] =?UTF-8?q?retour=20arri=C3=A8re?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SMESHGUI/SMESH_msg_fr.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index 2423b0912..24c9ff571 100644 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -474,7 +474,7 @@ MEN_EDIT - Editer + Edition MEN_EDIT_GROUP From 56793dea96395d2f5eb0622dbee1b1187a3720b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Thu, 4 Jun 2020 17:39:55 +0200 Subject: [PATCH 034/100] Gestion des ui.h --- src/ADAPTGUI/CMakeLists.txt | 13 - src/ADAPTGUI/ui_CreateBoundaryAn.h | 802 ------------------------ src/ADAPTGUI/ui_CreateBoundaryCAO.h | 158 ----- src/ADAPTGUI/ui_CreateBoundaryDi.h | 158 ----- src/ADAPTGUI/ui_CreateCase.h | 647 -------------------- src/ADAPTGUI/ui_CreateHypothesis.h | 915 ---------------------------- src/ADAPTGUI/ui_CreateIteration.h | 416 ------------- src/ADAPTGUI/ui_CreateListGroup.h | 148 ----- src/ADAPTGUI/ui_CreateYACS.h | 445 -------------- src/ADAPTGUI/ui_CreateZone.h | 806 ------------------------ src/ADAPTGUI/ui_EditFile.h | 121 ---- src/ADAPTGUI/ui_IterInfo.h | 155 ----- src/ADAPTGUI/ui_MeshInfo.h | 269 -------- src/ADAPTGUI/ui_PursueIteration.h | 257 -------- 14 files changed, 5310 deletions(-) delete mode 100644 src/ADAPTGUI/ui_CreateBoundaryAn.h delete mode 100644 src/ADAPTGUI/ui_CreateBoundaryCAO.h delete mode 100644 src/ADAPTGUI/ui_CreateBoundaryDi.h delete mode 100644 src/ADAPTGUI/ui_CreateCase.h delete mode 100644 src/ADAPTGUI/ui_CreateHypothesis.h delete mode 100644 src/ADAPTGUI/ui_CreateIteration.h delete mode 100644 src/ADAPTGUI/ui_CreateListGroup.h delete mode 100644 src/ADAPTGUI/ui_CreateYACS.h delete mode 100644 src/ADAPTGUI/ui_CreateZone.h delete mode 100644 src/ADAPTGUI/ui_EditFile.h delete mode 100644 src/ADAPTGUI/ui_IterInfo.h delete mode 100644 src/ADAPTGUI/ui_MeshInfo.h delete mode 100644 src/ADAPTGUI/ui_PursueIteration.h diff --git a/src/ADAPTGUI/CMakeLists.txt b/src/ADAPTGUI/CMakeLists.txt index 26c8e966d..ee193c6af 100644 --- a/src/ADAPTGUI/CMakeLists.txt +++ b/src/ADAPTGUI/CMakeLists.txt @@ -113,19 +113,6 @@ SET(_moc_HEADERS MonCreateYACS.h MonEditYACS.h MonEditFile.h -ui_CreateBoundaryAn.h -ui_CreateBoundaryCAO.h -ui_CreateBoundaryDi.h -ui_CreateCase.h -ui_CreateHypothesis.h -ui_CreateIteration.h -ui_CreateListGroup.h -ui_CreateYACS.h -ui_CreateZone.h -ui_EditFile.h -ui_IterInfo.h -ui_MeshInfo.h -ui_PursueIteration.h ) # header files / uic wrappings diff --git a/src/ADAPTGUI/ui_CreateBoundaryAn.h b/src/ADAPTGUI/ui_CreateBoundaryAn.h deleted file mode 100644 index b7e85dcaf..000000000 --- a/src/ADAPTGUI/ui_CreateBoundaryAn.h +++ /dev/null @@ -1,802 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'CreateBoundaryAn.ui' -** -** Created by: Qt User Interface Compiler version 5.9.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_CREATEBOUNDARYAN_H -#define UI_CREATEBOUNDARYAN_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_CreateBoundaryAn -{ -public: - QGridLayout *gridLayout_5; - QLabel *Name; - QLineEdit *LEName; - QGroupBox *TypeBoundary; - QGridLayout *gridLayout; - QRadioButton *RBCylindre; - QRadioButton *RBSphere; - QRadioButton *RBCone; - QRadioButton *RBTore; - QGroupBox *gBCylindre; - QGridLayout *gridLayout1; - QDoubleSpinBox *SpinBox_Xcent; - QLabel *TLXcent; - QDoubleSpinBox *SpinBox_Radius; - QDoubleSpinBox *SpinBox_Zcent; - QLabel *TLradius; - QLabel *TLZcent; - QLabel *TLYcent; - QDoubleSpinBox *SpinBox_Ycent; - QLabel *TLXaxis; - QLabel *TLYaxis; - QLabel *TLZaxis; - QDoubleSpinBox *SpinBox_Zaxis; - QDoubleSpinBox *SpinBox_Yaxis; - QDoubleSpinBox *SpinBox_Xaxis; - QGroupBox *gBSphere; - QGridLayout *gridLayout2; - QDoubleSpinBox *SpinBox_Rayon; - QDoubleSpinBox *SpinBox_Zcentre; - QLabel *TLRayon; - QLabel *TLZcentre; - QLabel *TLYcentre; - QDoubleSpinBox *SpinBox_Ycentre; - QDoubleSpinBox *SpinBox_Xcentre; - QLabel *TLXcentre; - QGroupBox *gBCone; - QGridLayout *gridLayout_3; - QGroupBox *groupBox; - QGridLayout *gridLayout_2; - QRadioButton *RB_Def_radius; - QRadioButton *RB_Def_angle; - QLabel *TLCone_X1; - QDoubleSpinBox *SpinBox_Cone_X1; - QLabel *TLCone_X2; - QDoubleSpinBox *SpinBox_Cone_X2; - QLabel *TLCone_Y1; - QDoubleSpinBox *SpinBox_Cone_Y1; - QLabel *TLCone_Y2; - QDoubleSpinBox *SpinBox_Cone_Y2; - QLabel *TLCone_Z1; - QDoubleSpinBox *SpinBox_Cone_Z1; - QLabel *TLCone_Z2; - QDoubleSpinBox *SpinBox_Cone_Z2; - QLabel *TLCone_V1; - QDoubleSpinBox *SpinBox_Cone_V1; - QLabel *TLCone_V2; - QDoubleSpinBox *SpinBox_Cone_V2; - QGroupBox *gBTore; - QGridLayout *gridLayout_4; - QLabel *TLToreXcent; - QDoubleSpinBox *SpinBoxToreXcent; - QLabel *TLToreXaxe; - QDoubleSpinBox *SpinBoxToreXaxe; - QLabel *TLToreYcent; - QDoubleSpinBox *SpinBoxToreYcent; - QLabel *TLToreYaxe; - QDoubleSpinBox *SpinBoxToreYaxe; - QLabel *TLToreZcent; - QDoubleSpinBox *SpinBoxToreZcent; - QLabel *TLToreZaxe; - QDoubleSpinBox *SpinBoxToreZaxe; - QLabel *TLToreRayRev; - QDoubleSpinBox *SpinBoxToreRRev; - QLabel *TLToreRayPri; - QDoubleSpinBox *SpinBoxToreRPri; - QGroupBox *GBButtons; - QGridLayout *gridLayout3; - QPushButton *buttonHelp; - QPushButton *buttonCancel; - QPushButton *buttonApply; - QPushButton *buttonOk; - - void setupUi(QDialog *CreateBoundaryAn) - { - if (CreateBoundaryAn->objectName().isEmpty()) - CreateBoundaryAn->setObjectName(QStringLiteral("CreateBoundaryAn")); - CreateBoundaryAn->resize(522, 835); - CreateBoundaryAn->setAutoFillBackground(true); - CreateBoundaryAn->setSizeGripEnabled(true); - gridLayout_5 = new QGridLayout(CreateBoundaryAn); - gridLayout_5->setObjectName(QStringLiteral("gridLayout_5")); - Name = new QLabel(CreateBoundaryAn); - Name->setObjectName(QStringLiteral("Name")); - - gridLayout_5->addWidget(Name, 0, 0, 1, 1); - - LEName = new QLineEdit(CreateBoundaryAn); - LEName->setObjectName(QStringLiteral("LEName")); - LEName->setMaxLength(32); - - gridLayout_5->addWidget(LEName, 0, 1, 1, 1); - - TypeBoundary = new QGroupBox(CreateBoundaryAn); - TypeBoundary->setObjectName(QStringLiteral("TypeBoundary")); - QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(TypeBoundary->sizePolicy().hasHeightForWidth()); - TypeBoundary->setSizePolicy(sizePolicy); - TypeBoundary->setMinimumSize(QSize(340, 0)); - gridLayout = new QGridLayout(TypeBoundary); - gridLayout->setObjectName(QStringLiteral("gridLayout")); - RBCylindre = new QRadioButton(TypeBoundary); - RBCylindre->setObjectName(QStringLiteral("RBCylindre")); - QIcon icon; - icon.addFile(QStringLiteral("../../resources/cylinderpointvector.png"), QSize(), QIcon::Normal, QIcon::Off); - RBCylindre->setIcon(icon); - RBCylindre->setCheckable(true); - RBCylindre->setChecked(true); - - gridLayout->addWidget(RBCylindre, 0, 0, 1, 1); - - RBSphere = new QRadioButton(TypeBoundary); - RBSphere->setObjectName(QStringLiteral("RBSphere")); - QIcon icon1; - icon1.addFile(QStringLiteral("../../resources/zone_spherepoint.png"), QSize(), QIcon::Normal, QIcon::Off); - RBSphere->setIcon(icon1); - - gridLayout->addWidget(RBSphere, 0, 1, 1, 1); - - RBCone = new QRadioButton(TypeBoundary); - RBCone->setObjectName(QStringLiteral("RBCone")); - QIcon icon2; - icon2.addFile(QStringLiteral("../../resources/cone.png"), QSize(), QIcon::Normal, QIcon::Off); - RBCone->setIcon(icon2); - - gridLayout->addWidget(RBCone, 0, 2, 1, 1); - - RBTore = new QRadioButton(TypeBoundary); - RBTore->setObjectName(QStringLiteral("RBTore")); - QIcon icon3; - icon3.addFile(QStringLiteral("../../resources/toruspointvector.png"), QSize(), QIcon::Normal, QIcon::Off); - RBTore->setIcon(icon3); - RBTore->setCheckable(true); - RBTore->setChecked(false); - - gridLayout->addWidget(RBTore, 0, 3, 1, 1); - - - gridLayout_5->addWidget(TypeBoundary, 1, 0, 1, 2); - - gBCylindre = new QGroupBox(CreateBoundaryAn); - gBCylindre->setObjectName(QStringLiteral("gBCylindre")); - sizePolicy.setHeightForWidth(gBCylindre->sizePolicy().hasHeightForWidth()); - gBCylindre->setSizePolicy(sizePolicy); - gridLayout1 = new QGridLayout(gBCylindre); -#ifndef Q_OS_MAC - gridLayout1->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout1->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout1->setObjectName(QStringLiteral("gridLayout1")); - SpinBox_Xcent = new QDoubleSpinBox(gBCylindre); - SpinBox_Xcent->setObjectName(QStringLiteral("SpinBox_Xcent")); - SpinBox_Xcent->setDecimals(5); - SpinBox_Xcent->setMinimum(-1e+9); - SpinBox_Xcent->setMaximum(1e+9); - SpinBox_Xcent->setValue(0); - - gridLayout1->addWidget(SpinBox_Xcent, 0, 1, 1, 1); - - TLXcent = new QLabel(gBCylindre); - TLXcent->setObjectName(QStringLiteral("TLXcent")); - sizePolicy.setHeightForWidth(TLXcent->sizePolicy().hasHeightForWidth()); - TLXcent->setSizePolicy(sizePolicy); - TLXcent->setWordWrap(false); - - gridLayout1->addWidget(TLXcent, 0, 0, 1, 1); - - SpinBox_Radius = new QDoubleSpinBox(gBCylindre); - SpinBox_Radius->setObjectName(QStringLiteral("SpinBox_Radius")); - SpinBox_Radius->setDecimals(5); - SpinBox_Radius->setMaximum(1e+9); - - gridLayout1->addWidget(SpinBox_Radius, 3, 1, 1, 2); - - SpinBox_Zcent = new QDoubleSpinBox(gBCylindre); - SpinBox_Zcent->setObjectName(QStringLiteral("SpinBox_Zcent")); - SpinBox_Zcent->setDecimals(5); - SpinBox_Zcent->setMinimum(-1e+9); - SpinBox_Zcent->setMaximum(1e+9); - SpinBox_Zcent->setValue(0); - - gridLayout1->addWidget(SpinBox_Zcent, 2, 1, 1, 1); - - TLradius = new QLabel(gBCylindre); - TLradius->setObjectName(QStringLiteral("TLradius")); - sizePolicy.setHeightForWidth(TLradius->sizePolicy().hasHeightForWidth()); - TLradius->setSizePolicy(sizePolicy); - TLradius->setWordWrap(false); - - gridLayout1->addWidget(TLradius, 3, 0, 1, 1); - - TLZcent = new QLabel(gBCylindre); - TLZcent->setObjectName(QStringLiteral("TLZcent")); - sizePolicy.setHeightForWidth(TLZcent->sizePolicy().hasHeightForWidth()); - TLZcent->setSizePolicy(sizePolicy); - TLZcent->setWordWrap(false); - - gridLayout1->addWidget(TLZcent, 2, 0, 1, 1); - - TLYcent = new QLabel(gBCylindre); - TLYcent->setObjectName(QStringLiteral("TLYcent")); - sizePolicy.setHeightForWidth(TLYcent->sizePolicy().hasHeightForWidth()); - TLYcent->setSizePolicy(sizePolicy); - TLYcent->setWordWrap(false); - - gridLayout1->addWidget(TLYcent, 1, 0, 1, 1); - - SpinBox_Ycent = new QDoubleSpinBox(gBCylindre); - SpinBox_Ycent->setObjectName(QStringLiteral("SpinBox_Ycent")); - SpinBox_Ycent->setDecimals(5); - SpinBox_Ycent->setMinimum(-1e+9); - SpinBox_Ycent->setMaximum(1e+9); - SpinBox_Ycent->setValue(0); - - gridLayout1->addWidget(SpinBox_Ycent, 1, 1, 1, 1); - - TLXaxis = new QLabel(gBCylindre); - TLXaxis->setObjectName(QStringLiteral("TLXaxis")); - sizePolicy.setHeightForWidth(TLXaxis->sizePolicy().hasHeightForWidth()); - TLXaxis->setSizePolicy(sizePolicy); - TLXaxis->setWordWrap(false); - - gridLayout1->addWidget(TLXaxis, 0, 2, 1, 1); - - TLYaxis = new QLabel(gBCylindre); - TLYaxis->setObjectName(QStringLiteral("TLYaxis")); - sizePolicy.setHeightForWidth(TLYaxis->sizePolicy().hasHeightForWidth()); - TLYaxis->setSizePolicy(sizePolicy); - TLYaxis->setWordWrap(false); - - gridLayout1->addWidget(TLYaxis, 1, 2, 1, 1); - - TLZaxis = new QLabel(gBCylindre); - TLZaxis->setObjectName(QStringLiteral("TLZaxis")); - sizePolicy.setHeightForWidth(TLZaxis->sizePolicy().hasHeightForWidth()); - TLZaxis->setSizePolicy(sizePolicy); - TLZaxis->setWordWrap(false); - - gridLayout1->addWidget(TLZaxis, 2, 2, 1, 1); - - SpinBox_Zaxis = new QDoubleSpinBox(gBCylindre); - SpinBox_Zaxis->setObjectName(QStringLiteral("SpinBox_Zaxis")); - SpinBox_Zaxis->setDecimals(5); - SpinBox_Zaxis->setMinimum(-1e+9); - SpinBox_Zaxis->setMaximum(1e+9); - SpinBox_Zaxis->setValue(0); - - gridLayout1->addWidget(SpinBox_Zaxis, 2, 3, 1, 1); - - SpinBox_Yaxis = new QDoubleSpinBox(gBCylindre); - SpinBox_Yaxis->setObjectName(QStringLiteral("SpinBox_Yaxis")); - SpinBox_Yaxis->setDecimals(5); - SpinBox_Yaxis->setMinimum(-1e+9); - SpinBox_Yaxis->setMaximum(1e+9); - SpinBox_Yaxis->setValue(0); - - gridLayout1->addWidget(SpinBox_Yaxis, 1, 3, 1, 1); - - SpinBox_Xaxis = new QDoubleSpinBox(gBCylindre); - SpinBox_Xaxis->setObjectName(QStringLiteral("SpinBox_Xaxis")); - SpinBox_Xaxis->setDecimals(5); - SpinBox_Xaxis->setMinimum(-1e+9); - SpinBox_Xaxis->setMaximum(1e+9); - SpinBox_Xaxis->setValue(0); - - gridLayout1->addWidget(SpinBox_Xaxis, 0, 3, 1, 1); - - - gridLayout_5->addWidget(gBCylindre, 2, 0, 1, 2); - - gBSphere = new QGroupBox(CreateBoundaryAn); - gBSphere->setObjectName(QStringLiteral("gBSphere")); - sizePolicy.setHeightForWidth(gBSphere->sizePolicy().hasHeightForWidth()); - gBSphere->setSizePolicy(sizePolicy); - gridLayout2 = new QGridLayout(gBSphere); -#ifndef Q_OS_MAC - gridLayout2->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout2->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout2->setObjectName(QStringLiteral("gridLayout2")); - SpinBox_Rayon = new QDoubleSpinBox(gBSphere); - SpinBox_Rayon->setObjectName(QStringLiteral("SpinBox_Rayon")); - SpinBox_Rayon->setDecimals(5); - SpinBox_Rayon->setMinimum(0); - SpinBox_Rayon->setMaximum(1e+9); - SpinBox_Rayon->setValue(0); - - gridLayout2->addWidget(SpinBox_Rayon, 1, 3, 1, 1); - - SpinBox_Zcentre = new QDoubleSpinBox(gBSphere); - SpinBox_Zcentre->setObjectName(QStringLiteral("SpinBox_Zcentre")); - SpinBox_Zcentre->setDecimals(5); - SpinBox_Zcentre->setMinimum(-1e+9); - SpinBox_Zcentre->setMaximum(1e+9); - SpinBox_Zcentre->setValue(0); - - gridLayout2->addWidget(SpinBox_Zcentre, 2, 1, 1, 1); - - TLRayon = new QLabel(gBSphere); - TLRayon->setObjectName(QStringLiteral("TLRayon")); - sizePolicy.setHeightForWidth(TLRayon->sizePolicy().hasHeightForWidth()); - TLRayon->setSizePolicy(sizePolicy); - TLRayon->setWordWrap(false); - - gridLayout2->addWidget(TLRayon, 1, 2, 1, 1); - - TLZcentre = new QLabel(gBSphere); - TLZcentre->setObjectName(QStringLiteral("TLZcentre")); - sizePolicy.setHeightForWidth(TLZcentre->sizePolicy().hasHeightForWidth()); - TLZcentre->setSizePolicy(sizePolicy); - TLZcentre->setWordWrap(false); - - gridLayout2->addWidget(TLZcentre, 2, 0, 1, 1); - - TLYcentre = new QLabel(gBSphere); - TLYcentre->setObjectName(QStringLiteral("TLYcentre")); - sizePolicy.setHeightForWidth(TLYcentre->sizePolicy().hasHeightForWidth()); - TLYcentre->setSizePolicy(sizePolicy); - TLYcentre->setWordWrap(false); - - gridLayout2->addWidget(TLYcentre, 1, 0, 1, 1); - - SpinBox_Ycentre = new QDoubleSpinBox(gBSphere); - SpinBox_Ycentre->setObjectName(QStringLiteral("SpinBox_Ycentre")); - SpinBox_Ycentre->setDecimals(5); - SpinBox_Ycentre->setMinimum(-1e+9); - SpinBox_Ycentre->setMaximum(1e+9); - SpinBox_Ycentre->setValue(0); - - gridLayout2->addWidget(SpinBox_Ycentre, 1, 1, 1, 1); - - SpinBox_Xcentre = new QDoubleSpinBox(gBSphere); - SpinBox_Xcentre->setObjectName(QStringLiteral("SpinBox_Xcentre")); - SpinBox_Xcentre->setDecimals(5); - SpinBox_Xcentre->setMinimum(-1e+9); - SpinBox_Xcentre->setMaximum(1e+9); - SpinBox_Xcentre->setValue(0); - - gridLayout2->addWidget(SpinBox_Xcentre, 0, 1, 1, 1); - - TLXcentre = new QLabel(gBSphere); - TLXcentre->setObjectName(QStringLiteral("TLXcentre")); - sizePolicy.setHeightForWidth(TLXcentre->sizePolicy().hasHeightForWidth()); - TLXcentre->setSizePolicy(sizePolicy); - TLXcentre->setWordWrap(false); - - gridLayout2->addWidget(TLXcentre, 0, 0, 1, 1); - - - gridLayout_5->addWidget(gBSphere, 3, 0, 1, 2); - - gBCone = new QGroupBox(CreateBoundaryAn); - gBCone->setObjectName(QStringLiteral("gBCone")); - sizePolicy.setHeightForWidth(gBCone->sizePolicy().hasHeightForWidth()); - gBCone->setSizePolicy(sizePolicy); - gridLayout_3 = new QGridLayout(gBCone); - gridLayout_3->setObjectName(QStringLiteral("gridLayout_3")); - groupBox = new QGroupBox(gBCone); - groupBox->setObjectName(QStringLiteral("groupBox")); - gridLayout_2 = new QGridLayout(groupBox); - gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); - RB_Def_radius = new QRadioButton(groupBox); - RB_Def_radius->setObjectName(QStringLiteral("RB_Def_radius")); - QIcon icon4; - icon4.addFile(QStringLiteral("../../resources/conedxyz.png"), QSize(), QIcon::Normal, QIcon::Off); - RB_Def_radius->setIcon(icon4); - RB_Def_radius->setChecked(true); - - gridLayout_2->addWidget(RB_Def_radius, 0, 0, 1, 1); - - RB_Def_angle = new QRadioButton(groupBox); - RB_Def_angle->setObjectName(QStringLiteral("RB_Def_angle")); - QIcon icon5; - icon5.addFile(QStringLiteral("../../resources/conepointvector.png"), QSize(), QIcon::Normal, QIcon::Off); - RB_Def_angle->setIcon(icon5); - - gridLayout_2->addWidget(RB_Def_angle, 0, 1, 1, 1); - - - gridLayout_3->addWidget(groupBox, 0, 0, 1, 2); - - TLCone_X1 = new QLabel(gBCone); - TLCone_X1->setObjectName(QStringLiteral("TLCone_X1")); - sizePolicy.setHeightForWidth(TLCone_X1->sizePolicy().hasHeightForWidth()); - TLCone_X1->setSizePolicy(sizePolicy); - TLCone_X1->setWordWrap(false); - - gridLayout_3->addWidget(TLCone_X1, 1, 0, 1, 1); - - SpinBox_Cone_X1 = new QDoubleSpinBox(gBCone); - SpinBox_Cone_X1->setObjectName(QStringLiteral("SpinBox_Cone_X1")); - SpinBox_Cone_X1->setDecimals(5); - SpinBox_Cone_X1->setMinimum(-1e+9); - SpinBox_Cone_X1->setMaximum(1e+9); - SpinBox_Cone_X1->setValue(0); - - gridLayout_3->addWidget(SpinBox_Cone_X1, 1, 1, 1, 1); - - TLCone_X2 = new QLabel(gBCone); - TLCone_X2->setObjectName(QStringLiteral("TLCone_X2")); - sizePolicy.setHeightForWidth(TLCone_X2->sizePolicy().hasHeightForWidth()); - TLCone_X2->setSizePolicy(sizePolicy); - TLCone_X2->setWordWrap(false); - - gridLayout_3->addWidget(TLCone_X2, 1, 2, 1, 1); - - SpinBox_Cone_X2 = new QDoubleSpinBox(gBCone); - SpinBox_Cone_X2->setObjectName(QStringLiteral("SpinBox_Cone_X2")); - SpinBox_Cone_X2->setDecimals(5); - SpinBox_Cone_X2->setMinimum(-1e+9); - SpinBox_Cone_X2->setMaximum(1e+9); - SpinBox_Cone_X2->setValue(0); - - gridLayout_3->addWidget(SpinBox_Cone_X2, 1, 3, 1, 1); - - TLCone_Y1 = new QLabel(gBCone); - TLCone_Y1->setObjectName(QStringLiteral("TLCone_Y1")); - sizePolicy.setHeightForWidth(TLCone_Y1->sizePolicy().hasHeightForWidth()); - TLCone_Y1->setSizePolicy(sizePolicy); - TLCone_Y1->setWordWrap(false); - - gridLayout_3->addWidget(TLCone_Y1, 2, 0, 1, 1); - - SpinBox_Cone_Y1 = new QDoubleSpinBox(gBCone); - SpinBox_Cone_Y1->setObjectName(QStringLiteral("SpinBox_Cone_Y1")); - SpinBox_Cone_Y1->setDecimals(5); - SpinBox_Cone_Y1->setMinimum(-1e+9); - SpinBox_Cone_Y1->setMaximum(1e+9); - SpinBox_Cone_Y1->setValue(0); - - gridLayout_3->addWidget(SpinBox_Cone_Y1, 2, 1, 1, 1); - - TLCone_Y2 = new QLabel(gBCone); - TLCone_Y2->setObjectName(QStringLiteral("TLCone_Y2")); - sizePolicy.setHeightForWidth(TLCone_Y2->sizePolicy().hasHeightForWidth()); - TLCone_Y2->setSizePolicy(sizePolicy); - TLCone_Y2->setWordWrap(false); - - gridLayout_3->addWidget(TLCone_Y2, 2, 2, 1, 1); - - SpinBox_Cone_Y2 = new QDoubleSpinBox(gBCone); - SpinBox_Cone_Y2->setObjectName(QStringLiteral("SpinBox_Cone_Y2")); - SpinBox_Cone_Y2->setDecimals(5); - SpinBox_Cone_Y2->setMinimum(-1e+9); - SpinBox_Cone_Y2->setMaximum(1e+9); - SpinBox_Cone_Y2->setValue(0); - - gridLayout_3->addWidget(SpinBox_Cone_Y2, 2, 3, 1, 1); - - TLCone_Z1 = new QLabel(gBCone); - TLCone_Z1->setObjectName(QStringLiteral("TLCone_Z1")); - sizePolicy.setHeightForWidth(TLCone_Z1->sizePolicy().hasHeightForWidth()); - TLCone_Z1->setSizePolicy(sizePolicy); - TLCone_Z1->setWordWrap(false); - - gridLayout_3->addWidget(TLCone_Z1, 3, 0, 1, 1); - - SpinBox_Cone_Z1 = new QDoubleSpinBox(gBCone); - SpinBox_Cone_Z1->setObjectName(QStringLiteral("SpinBox_Cone_Z1")); - SpinBox_Cone_Z1->setDecimals(5); - SpinBox_Cone_Z1->setMinimum(-1e+9); - SpinBox_Cone_Z1->setMaximum(1e+9); - SpinBox_Cone_Z1->setValue(0); - - gridLayout_3->addWidget(SpinBox_Cone_Z1, 3, 1, 1, 1); - - TLCone_Z2 = new QLabel(gBCone); - TLCone_Z2->setObjectName(QStringLiteral("TLCone_Z2")); - sizePolicy.setHeightForWidth(TLCone_Z2->sizePolicy().hasHeightForWidth()); - TLCone_Z2->setSizePolicy(sizePolicy); - TLCone_Z2->setWordWrap(false); - - gridLayout_3->addWidget(TLCone_Z2, 3, 2, 1, 1); - - SpinBox_Cone_Z2 = new QDoubleSpinBox(gBCone); - SpinBox_Cone_Z2->setObjectName(QStringLiteral("SpinBox_Cone_Z2")); - SpinBox_Cone_Z2->setDecimals(5); - SpinBox_Cone_Z2->setMinimum(-1e+9); - SpinBox_Cone_Z2->setMaximum(1e+9); - SpinBox_Cone_Z2->setValue(0); - - gridLayout_3->addWidget(SpinBox_Cone_Z2, 3, 3, 1, 1); - - TLCone_V1 = new QLabel(gBCone); - TLCone_V1->setObjectName(QStringLiteral("TLCone_V1")); - sizePolicy.setHeightForWidth(TLCone_V1->sizePolicy().hasHeightForWidth()); - TLCone_V1->setSizePolicy(sizePolicy); - TLCone_V1->setWordWrap(false); - - gridLayout_3->addWidget(TLCone_V1, 4, 0, 1, 1); - - SpinBox_Cone_V1 = new QDoubleSpinBox(gBCone); - SpinBox_Cone_V1->setObjectName(QStringLiteral("SpinBox_Cone_V1")); - SpinBox_Cone_V1->setDecimals(5); - SpinBox_Cone_V1->setMaximum(1e+9); - - gridLayout_3->addWidget(SpinBox_Cone_V1, 4, 1, 1, 1); - - TLCone_V2 = new QLabel(gBCone); - TLCone_V2->setObjectName(QStringLiteral("TLCone_V2")); - sizePolicy.setHeightForWidth(TLCone_V2->sizePolicy().hasHeightForWidth()); - TLCone_V2->setSizePolicy(sizePolicy); - TLCone_V2->setWordWrap(false); - - gridLayout_3->addWidget(TLCone_V2, 4, 2, 1, 1); - - SpinBox_Cone_V2 = new QDoubleSpinBox(gBCone); - SpinBox_Cone_V2->setObjectName(QStringLiteral("SpinBox_Cone_V2")); - SpinBox_Cone_V2->setDecimals(5); - SpinBox_Cone_V2->setMaximum(1e+9); - - gridLayout_3->addWidget(SpinBox_Cone_V2, 4, 3, 1, 1); - - - gridLayout_5->addWidget(gBCone, 4, 0, 1, 2); - - gBTore = new QGroupBox(CreateBoundaryAn); - gBTore->setObjectName(QStringLiteral("gBTore")); - sizePolicy.setHeightForWidth(gBTore->sizePolicy().hasHeightForWidth()); - gBTore->setSizePolicy(sizePolicy); - gridLayout_4 = new QGridLayout(gBTore); - gridLayout_4->setObjectName(QStringLiteral("gridLayout_4")); - TLToreXcent = new QLabel(gBTore); - TLToreXcent->setObjectName(QStringLiteral("TLToreXcent")); - sizePolicy.setHeightForWidth(TLToreXcent->sizePolicy().hasHeightForWidth()); - TLToreXcent->setSizePolicy(sizePolicy); - TLToreXcent->setWordWrap(false); - - gridLayout_4->addWidget(TLToreXcent, 0, 0, 1, 1); - - SpinBoxToreXcent = new QDoubleSpinBox(gBTore); - SpinBoxToreXcent->setObjectName(QStringLiteral("SpinBoxToreXcent")); - SpinBoxToreXcent->setDecimals(5); - SpinBoxToreXcent->setMinimum(-1e+9); - SpinBoxToreXcent->setMaximum(1e+9); - SpinBoxToreXcent->setValue(0); - - gridLayout_4->addWidget(SpinBoxToreXcent, 0, 1, 1, 1); - - TLToreXaxe = new QLabel(gBTore); - TLToreXaxe->setObjectName(QStringLiteral("TLToreXaxe")); - sizePolicy.setHeightForWidth(TLToreXaxe->sizePolicy().hasHeightForWidth()); - TLToreXaxe->setSizePolicy(sizePolicy); - TLToreXaxe->setWordWrap(false); - - gridLayout_4->addWidget(TLToreXaxe, 0, 2, 1, 1); - - SpinBoxToreXaxe = new QDoubleSpinBox(gBTore); - SpinBoxToreXaxe->setObjectName(QStringLiteral("SpinBoxToreXaxe")); - SpinBoxToreXaxe->setDecimals(5); - SpinBoxToreXaxe->setMinimum(-1e+9); - SpinBoxToreXaxe->setMaximum(1e+9); - SpinBoxToreXaxe->setValue(0); - - gridLayout_4->addWidget(SpinBoxToreXaxe, 0, 3, 1, 1); - - TLToreYcent = new QLabel(gBTore); - TLToreYcent->setObjectName(QStringLiteral("TLToreYcent")); - sizePolicy.setHeightForWidth(TLToreYcent->sizePolicy().hasHeightForWidth()); - TLToreYcent->setSizePolicy(sizePolicy); - TLToreYcent->setWordWrap(false); - - gridLayout_4->addWidget(TLToreYcent, 1, 0, 1, 1); - - SpinBoxToreYcent = new QDoubleSpinBox(gBTore); - SpinBoxToreYcent->setObjectName(QStringLiteral("SpinBoxToreYcent")); - SpinBoxToreYcent->setDecimals(5); - SpinBoxToreYcent->setMinimum(-1e+9); - SpinBoxToreYcent->setMaximum(1e+9); - SpinBoxToreYcent->setValue(0); - - gridLayout_4->addWidget(SpinBoxToreYcent, 1, 1, 1, 1); - - TLToreYaxe = new QLabel(gBTore); - TLToreYaxe->setObjectName(QStringLiteral("TLToreYaxe")); - sizePolicy.setHeightForWidth(TLToreYaxe->sizePolicy().hasHeightForWidth()); - TLToreYaxe->setSizePolicy(sizePolicy); - TLToreYaxe->setWordWrap(false); - - gridLayout_4->addWidget(TLToreYaxe, 1, 2, 1, 1); - - SpinBoxToreYaxe = new QDoubleSpinBox(gBTore); - SpinBoxToreYaxe->setObjectName(QStringLiteral("SpinBoxToreYaxe")); - SpinBoxToreYaxe->setDecimals(5); - SpinBoxToreYaxe->setMinimum(-1e+9); - SpinBoxToreYaxe->setMaximum(1e+9); - SpinBoxToreYaxe->setValue(0); - - gridLayout_4->addWidget(SpinBoxToreYaxe, 1, 3, 1, 1); - - TLToreZcent = new QLabel(gBTore); - TLToreZcent->setObjectName(QStringLiteral("TLToreZcent")); - sizePolicy.setHeightForWidth(TLToreZcent->sizePolicy().hasHeightForWidth()); - TLToreZcent->setSizePolicy(sizePolicy); - TLToreZcent->setWordWrap(false); - - gridLayout_4->addWidget(TLToreZcent, 2, 0, 1, 1); - - SpinBoxToreZcent = new QDoubleSpinBox(gBTore); - SpinBoxToreZcent->setObjectName(QStringLiteral("SpinBoxToreZcent")); - SpinBoxToreZcent->setDecimals(5); - SpinBoxToreZcent->setMinimum(-1e+9); - SpinBoxToreZcent->setMaximum(1e+9); - SpinBoxToreZcent->setValue(0); - - gridLayout_4->addWidget(SpinBoxToreZcent, 2, 1, 1, 1); - - TLToreZaxe = new QLabel(gBTore); - TLToreZaxe->setObjectName(QStringLiteral("TLToreZaxe")); - sizePolicy.setHeightForWidth(TLToreZaxe->sizePolicy().hasHeightForWidth()); - TLToreZaxe->setSizePolicy(sizePolicy); - TLToreZaxe->setWordWrap(false); - - gridLayout_4->addWidget(TLToreZaxe, 2, 2, 1, 1); - - SpinBoxToreZaxe = new QDoubleSpinBox(gBTore); - SpinBoxToreZaxe->setObjectName(QStringLiteral("SpinBoxToreZaxe")); - SpinBoxToreZaxe->setDecimals(5); - SpinBoxToreZaxe->setMinimum(-1e+9); - SpinBoxToreZaxe->setMaximum(1e+9); - SpinBoxToreZaxe->setValue(0); - - gridLayout_4->addWidget(SpinBoxToreZaxe, 2, 3, 1, 1); - - TLToreRayRev = new QLabel(gBTore); - TLToreRayRev->setObjectName(QStringLiteral("TLToreRayRev")); - sizePolicy.setHeightForWidth(TLToreRayRev->sizePolicy().hasHeightForWidth()); - TLToreRayRev->setSizePolicy(sizePolicy); - TLToreRayRev->setWordWrap(false); - - gridLayout_4->addWidget(TLToreRayRev, 3, 0, 1, 1); - - SpinBoxToreRRev = new QDoubleSpinBox(gBTore); - SpinBoxToreRRev->setObjectName(QStringLiteral("SpinBoxToreRRev")); - SpinBoxToreRRev->setDecimals(5); - SpinBoxToreRRev->setMaximum(1e+9); - - gridLayout_4->addWidget(SpinBoxToreRRev, 3, 1, 1, 1); - - TLToreRayPri = new QLabel(gBTore); - TLToreRayPri->setObjectName(QStringLiteral("TLToreRayPri")); - sizePolicy.setHeightForWidth(TLToreRayPri->sizePolicy().hasHeightForWidth()); - TLToreRayPri->setSizePolicy(sizePolicy); - TLToreRayPri->setWordWrap(false); - - gridLayout_4->addWidget(TLToreRayPri, 3, 2, 1, 1); - - SpinBoxToreRPri = new QDoubleSpinBox(gBTore); - SpinBoxToreRPri->setObjectName(QStringLiteral("SpinBoxToreRPri")); - SpinBoxToreRPri->setDecimals(5); - SpinBoxToreRPri->setMaximum(1e+9); - - gridLayout_4->addWidget(SpinBoxToreRPri, 3, 3, 1, 1); - - - gridLayout_5->addWidget(gBTore, 5, 0, 1, 2); - - GBButtons = new QGroupBox(CreateBoundaryAn); - GBButtons->setObjectName(QStringLiteral("GBButtons")); - sizePolicy.setHeightForWidth(GBButtons->sizePolicy().hasHeightForWidth()); - GBButtons->setSizePolicy(sizePolicy); - gridLayout3 = new QGridLayout(GBButtons); -#ifndef Q_OS_MAC - gridLayout3->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout3->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout3->setObjectName(QStringLiteral("gridLayout3")); - buttonHelp = new QPushButton(GBButtons); - buttonHelp->setObjectName(QStringLiteral("buttonHelp")); - - gridLayout3->addWidget(buttonHelp, 0, 3, 1, 1); - - buttonCancel = new QPushButton(GBButtons); - buttonCancel->setObjectName(QStringLiteral("buttonCancel")); - - gridLayout3->addWidget(buttonCancel, 0, 2, 1, 1); - - buttonApply = new QPushButton(GBButtons); - buttonApply->setObjectName(QStringLiteral("buttonApply")); - - gridLayout3->addWidget(buttonApply, 0, 1, 1, 1); - - buttonOk = new QPushButton(GBButtons); - buttonOk->setObjectName(QStringLiteral("buttonOk")); - - gridLayout3->addWidget(buttonOk, 0, 0, 1, 1); - - - gridLayout_5->addWidget(GBButtons, 6, 0, 1, 2); - - - retranslateUi(CreateBoundaryAn); - - QMetaObject::connectSlotsByName(CreateBoundaryAn); - } // setupUi - - void retranslateUi(QDialog *CreateBoundaryAn) - { - CreateBoundaryAn->setWindowTitle(QApplication::translate("CreateBoundaryAn", "Create an analytical boundary", Q_NULLPTR)); - Name->setText(QApplication::translate("CreateBoundaryAn", "Name", Q_NULLPTR)); - TypeBoundary->setTitle(QApplication::translate("CreateBoundaryAn", "Type of boundary", Q_NULLPTR)); - RBCylindre->setText(QApplication::translate("CreateBoundaryAn", "Cylinder", Q_NULLPTR)); - RBSphere->setText(QApplication::translate("CreateBoundaryAn", "Sphere", Q_NULLPTR)); - RBCone->setText(QApplication::translate("CreateBoundaryAn", "Cone", Q_NULLPTR)); - RBTore->setText(QApplication::translate("CreateBoundaryAn", "Torus", Q_NULLPTR)); - gBCylindre->setTitle(QApplication::translate("CreateBoundaryAn", "Coordinates", Q_NULLPTR)); - TLXcent->setText(QApplication::translate("CreateBoundaryAn", "X centre", Q_NULLPTR)); - TLradius->setText(QApplication::translate("CreateBoundaryAn", "Radius", Q_NULLPTR)); - TLZcent->setText(QApplication::translate("CreateBoundaryAn", "Z centre", Q_NULLPTR)); - TLYcent->setText(QApplication::translate("CreateBoundaryAn", "Y centre", Q_NULLPTR)); - TLXaxis->setText(QApplication::translate("CreateBoundaryAn", "X axis", Q_NULLPTR)); - TLYaxis->setText(QApplication::translate("CreateBoundaryAn", "Y axis", Q_NULLPTR)); - TLZaxis->setText(QApplication::translate("CreateBoundaryAn", "Z axis", Q_NULLPTR)); - gBSphere->setTitle(QApplication::translate("CreateBoundaryAn", "Coordinates", Q_NULLPTR)); - TLRayon->setText(QApplication::translate("CreateBoundaryAn", "Radius", Q_NULLPTR)); - TLZcentre->setText(QApplication::translate("CreateBoundaryAn", "Z centre", Q_NULLPTR)); - TLYcentre->setText(QApplication::translate("CreateBoundaryAn", "Y centre", Q_NULLPTR)); - TLXcentre->setText(QApplication::translate("CreateBoundaryAn", "X centre", Q_NULLPTR)); - gBCone->setTitle(QApplication::translate("CreateBoundaryAn", "Coordinates", Q_NULLPTR)); - groupBox->setTitle(QApplication::translate("CreateBoundaryAn", "Definition", Q_NULLPTR)); - RB_Def_radius->setText(QApplication::translate("CreateBoundaryAn", "Radius", Q_NULLPTR)); - RB_Def_angle->setText(QApplication::translate("CreateBoundaryAn", "Angle", Q_NULLPTR)); - TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X 1", Q_NULLPTR)); - TLCone_X2->setText(QApplication::translate("CreateBoundaryAn", "X 2", Q_NULLPTR)); - TLCone_Y1->setText(QApplication::translate("CreateBoundaryAn", "Y 1", Q_NULLPTR)); - TLCone_Y2->setText(QApplication::translate("CreateBoundaryAn", "Y 2", Q_NULLPTR)); - TLCone_Z1->setText(QApplication::translate("CreateBoundaryAn", "Z 1", Q_NULLPTR)); - TLCone_Z2->setText(QApplication::translate("CreateBoundaryAn", "Z 2", Q_NULLPTR)); - TLCone_V1->setText(QApplication::translate("CreateBoundaryAn", "V 1", Q_NULLPTR)); - TLCone_V2->setText(QApplication::translate("CreateBoundaryAn", "V 2", Q_NULLPTR)); - gBTore->setTitle(QApplication::translate("CreateBoundaryAn", "Coordinates", Q_NULLPTR)); - TLToreXcent->setText(QApplication::translate("CreateBoundaryAn", "X centre", Q_NULLPTR)); - TLToreXaxe->setText(QApplication::translate("CreateBoundaryAn", "X axis", Q_NULLPTR)); - TLToreYcent->setText(QApplication::translate("CreateBoundaryAn", "Y centre", Q_NULLPTR)); - TLToreYaxe->setText(QApplication::translate("CreateBoundaryAn", "Y axis", Q_NULLPTR)); - TLToreZcent->setText(QApplication::translate("CreateBoundaryAn", "Z centre", Q_NULLPTR)); - TLToreZaxe->setText(QApplication::translate("CreateBoundaryAn", "Z axis", Q_NULLPTR)); - TLToreRayRev->setText(QApplication::translate("CreateBoundaryAn", "R revolution", Q_NULLPTR)); - TLToreRayPri->setText(QApplication::translate("CreateBoundaryAn", "Primary R", Q_NULLPTR)); - GBButtons->setTitle(QString()); - buttonHelp->setText(QApplication::translate("CreateBoundaryAn", "Help", Q_NULLPTR)); - buttonCancel->setText(QApplication::translate("CreateBoundaryAn", "Cancel", Q_NULLPTR)); - buttonApply->setText(QApplication::translate("CreateBoundaryAn", "Apply", Q_NULLPTR)); - buttonOk->setText(QApplication::translate("CreateBoundaryAn", "OK", Q_NULLPTR)); - } // retranslateUi - -}; - -namespace Ui { - class CreateBoundaryAn: public Ui_CreateBoundaryAn {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_CREATEBOUNDARYAN_H diff --git a/src/ADAPTGUI/ui_CreateBoundaryCAO.h b/src/ADAPTGUI/ui_CreateBoundaryCAO.h deleted file mode 100644 index cb6892ca1..000000000 --- a/src/ADAPTGUI/ui_CreateBoundaryCAO.h +++ /dev/null @@ -1,158 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'CreateBoundaryCAO.ui' -** -** Created by: Qt User Interface Compiler version 5.9.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_CREATEBOUNDARYCAO_H -#define UI_CREATEBOUNDARYCAO_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_CreateBoundaryCAO -{ -public: - QGridLayout *gridLayout; - QGroupBox *GBButtons; - QGridLayout *gridLayout1; - QPushButton *buttonHelp; - QPushButton *buttonCancel; - QPushButton *buttonApply; - QPushButton *buttonOk; - QCheckBox *CBGroupe; - QLineEdit *LEFileName; - QPushButton *PushFichier; - QLabel *XAO; - QLineEdit *LEName; - QLabel *Name; - - void setupUi(QDialog *CreateBoundaryCAO) - { - if (CreateBoundaryCAO->objectName().isEmpty()) - CreateBoundaryCAO->setObjectName(QStringLiteral("CreateBoundaryCAO")); - CreateBoundaryCAO->resize(566, 195); - QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(CreateBoundaryCAO->sizePolicy().hasHeightForWidth()); - CreateBoundaryCAO->setSizePolicy(sizePolicy); - CreateBoundaryCAO->setAutoFillBackground(true); - CreateBoundaryCAO->setSizeGripEnabled(true); - gridLayout = new QGridLayout(CreateBoundaryCAO); -#ifndef Q_OS_MAC - gridLayout->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout->setObjectName(QStringLiteral("gridLayout")); - GBButtons = new QGroupBox(CreateBoundaryCAO); - GBButtons->setObjectName(QStringLiteral("GBButtons")); - gridLayout1 = new QGridLayout(GBButtons); -#ifndef Q_OS_MAC - gridLayout1->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout1->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout1->setObjectName(QStringLiteral("gridLayout1")); - buttonHelp = new QPushButton(GBButtons); - buttonHelp->setObjectName(QStringLiteral("buttonHelp")); - - gridLayout1->addWidget(buttonHelp, 0, 3, 1, 1); - - buttonCancel = new QPushButton(GBButtons); - buttonCancel->setObjectName(QStringLiteral("buttonCancel")); - - gridLayout1->addWidget(buttonCancel, 0, 2, 1, 1); - - buttonApply = new QPushButton(GBButtons); - buttonApply->setObjectName(QStringLiteral("buttonApply")); - - gridLayout1->addWidget(buttonApply, 0, 1, 1, 1); - - buttonOk = new QPushButton(GBButtons); - buttonOk->setObjectName(QStringLiteral("buttonOk")); - - gridLayout1->addWidget(buttonOk, 0, 0, 1, 1); - - - gridLayout->addWidget(GBButtons, 3, 0, 1, 3); - - CBGroupe = new QCheckBox(CreateBoundaryCAO); - CBGroupe->setObjectName(QStringLiteral("CBGroupe")); - - gridLayout->addWidget(CBGroupe, 2, 0, 1, 3); - - LEFileName = new QLineEdit(CreateBoundaryCAO); - LEFileName->setObjectName(QStringLiteral("LEFileName")); - LEFileName->setMinimumSize(QSize(370, 21)); - - gridLayout->addWidget(LEFileName, 1, 2, 1, 1); - - PushFichier = new QPushButton(CreateBoundaryCAO); - PushFichier->setObjectName(QStringLiteral("PushFichier")); - - gridLayout->addWidget(PushFichier, 1, 1, 1, 1); - - XAO = new QLabel(CreateBoundaryCAO); - XAO->setObjectName(QStringLiteral("XAO")); - - gridLayout->addWidget(XAO, 1, 0, 1, 1); - - LEName = new QLineEdit(CreateBoundaryCAO); - LEName->setObjectName(QStringLiteral("LEName")); - LEName->setMinimumSize(QSize(382, 21)); - LEName->setMaxLength(32); - - gridLayout->addWidget(LEName, 0, 1, 1, 2); - - Name = new QLabel(CreateBoundaryCAO); - Name->setObjectName(QStringLiteral("Name")); - - gridLayout->addWidget(Name, 0, 0, 1, 1); - - - retranslateUi(CreateBoundaryCAO); - - QMetaObject::connectSlotsByName(CreateBoundaryCAO); - } // setupUi - - void retranslateUi(QDialog *CreateBoundaryCAO) - { - CreateBoundaryCAO->setWindowTitle(QApplication::translate("CreateBoundaryCAO", "Get CAO", Q_NULLPTR)); - GBButtons->setTitle(QString()); - buttonHelp->setText(QApplication::translate("CreateBoundaryCAO", "Help", Q_NULLPTR)); - buttonCancel->setText(QApplication::translate("CreateBoundaryCAO", "Cancel", Q_NULLPTR)); - buttonApply->setText(QApplication::translate("CreateBoundaryCAO", "Apply", Q_NULLPTR)); - buttonOk->setText(QApplication::translate("CreateBoundaryCAO", "OK", Q_NULLPTR)); - CBGroupe->setText(QApplication::translate("CreateBoundaryCAO", "Filtering with groups", Q_NULLPTR)); - PushFichier->setText(QString()); - XAO->setText(QApplication::translate("CreateBoundaryCAO", "XAO", Q_NULLPTR)); - Name->setText(QApplication::translate("CreateBoundaryCAO", "Name", Q_NULLPTR)); - } // retranslateUi - -}; - -namespace Ui { - class CreateBoundaryCAO: public Ui_CreateBoundaryCAO {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_CREATEBOUNDARYCAO_H diff --git a/src/ADAPTGUI/ui_CreateBoundaryDi.h b/src/ADAPTGUI/ui_CreateBoundaryDi.h deleted file mode 100644 index 5101b0d0e..000000000 --- a/src/ADAPTGUI/ui_CreateBoundaryDi.h +++ /dev/null @@ -1,158 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'CreateBoundaryDi.ui' -** -** Created by: Qt User Interface Compiler version 5.9.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_CREATEBOUNDARYDI_H -#define UI_CREATEBOUNDARYDI_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_CreateBoundaryDi -{ -public: - QGridLayout *gridLayout; - QGroupBox *GBButtons; - QGridLayout *gridLayout1; - QPushButton *buttonHelp; - QPushButton *buttonCancel; - QPushButton *buttonApply; - QPushButton *buttonOk; - QCheckBox *CBGroupe; - QLineEdit *LEFileName; - QPushButton *PushFichier; - QLabel *Mesh; - QLineEdit *LEName; - QLabel *Name; - - void setupUi(QDialog *CreateBoundaryDi) - { - if (CreateBoundaryDi->objectName().isEmpty()) - CreateBoundaryDi->setObjectName(QStringLiteral("CreateBoundaryDi")); - CreateBoundaryDi->resize(566, 169); - QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(CreateBoundaryDi->sizePolicy().hasHeightForWidth()); - CreateBoundaryDi->setSizePolicy(sizePolicy); - CreateBoundaryDi->setAutoFillBackground(true); - CreateBoundaryDi->setSizeGripEnabled(true); - gridLayout = new QGridLayout(CreateBoundaryDi); -#ifndef Q_OS_MAC - gridLayout->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout->setObjectName(QStringLiteral("gridLayout")); - GBButtons = new QGroupBox(CreateBoundaryDi); - GBButtons->setObjectName(QStringLiteral("GBButtons")); - gridLayout1 = new QGridLayout(GBButtons); -#ifndef Q_OS_MAC - gridLayout1->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout1->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout1->setObjectName(QStringLiteral("gridLayout1")); - buttonHelp = new QPushButton(GBButtons); - buttonHelp->setObjectName(QStringLiteral("buttonHelp")); - - gridLayout1->addWidget(buttonHelp, 0, 3, 1, 1); - - buttonCancel = new QPushButton(GBButtons); - buttonCancel->setObjectName(QStringLiteral("buttonCancel")); - - gridLayout1->addWidget(buttonCancel, 0, 2, 1, 1); - - buttonApply = new QPushButton(GBButtons); - buttonApply->setObjectName(QStringLiteral("buttonApply")); - - gridLayout1->addWidget(buttonApply, 0, 1, 1, 1); - - buttonOk = new QPushButton(GBButtons); - buttonOk->setObjectName(QStringLiteral("buttonOk")); - - gridLayout1->addWidget(buttonOk, 0, 0, 1, 1); - - - gridLayout->addWidget(GBButtons, 3, 0, 1, 3); - - CBGroupe = new QCheckBox(CreateBoundaryDi); - CBGroupe->setObjectName(QStringLiteral("CBGroupe")); - - gridLayout->addWidget(CBGroupe, 2, 0, 1, 3); - - LEFileName = new QLineEdit(CreateBoundaryDi); - LEFileName->setObjectName(QStringLiteral("LEFileName")); - LEFileName->setMinimumSize(QSize(370, 21)); - - gridLayout->addWidget(LEFileName, 1, 2, 1, 1); - - PushFichier = new QPushButton(CreateBoundaryDi); - PushFichier->setObjectName(QStringLiteral("PushFichier")); - - gridLayout->addWidget(PushFichier, 1, 1, 1, 1); - - Mesh = new QLabel(CreateBoundaryDi); - Mesh->setObjectName(QStringLiteral("Mesh")); - - gridLayout->addWidget(Mesh, 1, 0, 1, 1); - - LEName = new QLineEdit(CreateBoundaryDi); - LEName->setObjectName(QStringLiteral("LEName")); - LEName->setMinimumSize(QSize(382, 21)); - LEName->setMaxLength(32); - - gridLayout->addWidget(LEName, 0, 1, 1, 2); - - Name = new QLabel(CreateBoundaryDi); - Name->setObjectName(QStringLiteral("Name")); - - gridLayout->addWidget(Name, 0, 0, 1, 1); - - - retranslateUi(CreateBoundaryDi); - - QMetaObject::connectSlotsByName(CreateBoundaryDi); - } // setupUi - - void retranslateUi(QDialog *CreateBoundaryDi) - { - CreateBoundaryDi->setWindowTitle(QApplication::translate("CreateBoundaryDi", "Create a discrete boundary", Q_NULLPTR)); - GBButtons->setTitle(QString()); - buttonHelp->setText(QApplication::translate("CreateBoundaryDi", "Help", Q_NULLPTR)); - buttonCancel->setText(QApplication::translate("CreateBoundaryDi", "Cancel", Q_NULLPTR)); - buttonApply->setText(QApplication::translate("CreateBoundaryDi", "Apply", Q_NULLPTR)); - buttonOk->setText(QApplication::translate("CreateBoundaryDi", "OK", Q_NULLPTR)); - CBGroupe->setText(QApplication::translate("CreateBoundaryDi", "Filtering with groups", Q_NULLPTR)); - PushFichier->setText(QString()); - Mesh->setText(QApplication::translate("CreateBoundaryDi", "Mesh", Q_NULLPTR)); - Name->setText(QApplication::translate("CreateBoundaryDi", "Name", Q_NULLPTR)); - } // retranslateUi - -}; - -namespace Ui { - class CreateBoundaryDi: public Ui_CreateBoundaryDi {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_CREATEBOUNDARYDI_H diff --git a/src/ADAPTGUI/ui_CreateCase.h b/src/ADAPTGUI/ui_CreateCase.h deleted file mode 100644 index 76b46612d..000000000 --- a/src/ADAPTGUI/ui_CreateCase.h +++ /dev/null @@ -1,647 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'CreateCase.ui' -** -** Created by: Qt User Interface Compiler version 5.9.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_CREATECASE_H -#define UI_CREATECASE_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_CreateCase -{ -public: - QGridLayout *gridLayout_5; - QWidget *WName; - QGridLayout *gridLayout_2; - QLabel *Name; - QLineEdit *LEName; - QSpacerItem *horizontalSpacer; - QHBoxLayout *hboxLayout; - QLabel *Directory; - QPushButton *PushDir; - QLineEdit *LEDirName; - QSpacerItem *spacerItem; - QHBoxLayout *hboxLayout1; - QLabel *Mesh; - QPushButton *PushFichier; - QLineEdit *LEFileName; - QSpacerItem *spacerItem1; - QGroupBox *GBTypeConf; - QHBoxLayout *hboxLayout2; - QRadioButton *RBConforme; - QRadioButton *RBNonConforme; - QGroupBox *GBTypeBoun; - QHBoxLayout *_3; - QRadioButton *RBBoundaryNo; - QRadioButton *RBBoundaryCAO; - QRadioButton *RBBoundaryNonCAO; - QSpacerItem *spacerItem2; - QHBoxLayout *hboxLayout3; - QCheckBox *CBBoundaryD; - QCheckBox *CBBoundaryA; - QGroupBox *GBBoundaryC; - QGridLayout *_2; - QPushButton *PBBoundaryCAOEdit; - QPushButton *PBBoundaryCAOHelp; - QComboBox *CBBoundaryCAO; - QSpacerItem *spacerItem3; - QPushButton *PBBoundaryCAONew; - QSpacerItem *spacerItem4; - QGroupBox *GBBoundaryD; - QGridLayout *gridLayout; - QComboBox *CBBoundaryDi; - QSpacerItem *spacerItem5; - QPushButton *PBBoundaryDiEdit; - QPushButton *PBBoundaryDiHelp; - QPushButton *PBBoundaryDiNew; - QGroupBox *GBBoundaryA; - QFormLayout *formLayout; - QTableWidget *TWBoundary; - QGridLayout *gridLayout1; - QPushButton *PBBoundaryAnEdit; - QPushButton *PBBoundaryAnNew; - QPushButton *PBBoundaryAnHelp; - QSpacerItem *spacer; - QCheckBox *CBAdvanced; - QGroupBox *GBAdvancedOptions; - QGridLayout *gridLayout_4; - QCheckBox *CBPyramid; - QGroupBox *GBConforme; - QGridLayout *gridLayout_3; - QHBoxLayout *horizontalLayout_2; - QRadioButton *RBStandard; - QRadioButton *RBBox; - QRadioButton *RBNC1NpA; - QRadioButton *RBNCQuelconque; - QGroupBox *GBFormat; - QGridLayout *gridLayout2; - QRadioButton *RBMED; - QRadioButton *RBSaturne; - QRadioButton *RBSaturne2D; - QSpacerItem *spacer_3; - QSpacerItem *spacer_4; - QLabel *Comment; - QSpacerItem *verticalSpacer; - QGroupBox *GroupButtons; - QGridLayout *gridLayout3; - QPushButton *buttonHelp; - QPushButton *buttonApply; - QPushButton *buttonOk; - QPushButton *buttonCancel; - QSpacerItem *spacer_2; - - void setupUi(QDialog *CreateCase) - { - if (CreateCase->objectName().isEmpty()) - CreateCase->setObjectName(QStringLiteral("CreateCase")); - CreateCase->resize(600, 1150); - QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(CreateCase->sizePolicy().hasHeightForWidth()); - CreateCase->setSizePolicy(sizePolicy); - CreateCase->setMinimumSize(QSize(600, 320)); - CreateCase->setSizeIncrement(QSize(1, 1)); - CreateCase->setBaseSize(QSize(600, 320)); - CreateCase->setAutoFillBackground(true); - gridLayout_5 = new QGridLayout(CreateCase); - gridLayout_5->setObjectName(QStringLiteral("gridLayout_5")); - WName = new QWidget(CreateCase); - WName->setObjectName(QStringLiteral("WName")); - gridLayout_2 = new QGridLayout(WName); - gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); - Name = new QLabel(WName); - Name->setObjectName(QStringLiteral("Name")); - - gridLayout_2->addWidget(Name, 0, 0, 1, 1); - - LEName = new QLineEdit(WName); - LEName->setObjectName(QStringLiteral("LEName")); - - gridLayout_2->addWidget(LEName, 0, 1, 1, 1); - - - gridLayout_5->addWidget(WName, 0, 0, 1, 1); - - horizontalSpacer = new QSpacerItem(199, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout_5->addItem(horizontalSpacer, 0, 2, 1, 2); - - hboxLayout = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout->setSpacing(6); -#endif - hboxLayout->setContentsMargins(0, 0, 0, 0); - hboxLayout->setObjectName(QStringLiteral("hboxLayout")); - Directory = new QLabel(CreateCase); - Directory->setObjectName(QStringLiteral("Directory")); - - hboxLayout->addWidget(Directory); - - PushDir = new QPushButton(CreateCase); - PushDir->setObjectName(QStringLiteral("PushDir")); - PushDir->setAutoDefault(false); - - hboxLayout->addWidget(PushDir); - - LEDirName = new QLineEdit(CreateCase); - LEDirName->setObjectName(QStringLiteral("LEDirName")); - LEDirName->setMinimumSize(QSize(382, 21)); - - hboxLayout->addWidget(LEDirName); - - - gridLayout_5->addLayout(hboxLayout, 1, 0, 1, 5); - - spacerItem = new QSpacerItem(20, 18, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout_5->addItem(spacerItem, 2, 4, 1, 1); - - hboxLayout1 = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout1->setSpacing(6); -#endif - hboxLayout1->setContentsMargins(0, 0, 0, 0); - hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); - Mesh = new QLabel(CreateCase); - Mesh->setObjectName(QStringLiteral("Mesh")); - - hboxLayout1->addWidget(Mesh); - - PushFichier = new QPushButton(CreateCase); - PushFichier->setObjectName(QStringLiteral("PushFichier")); - PushFichier->setAutoDefault(false); - - hboxLayout1->addWidget(PushFichier); - - LEFileName = new QLineEdit(CreateCase); - LEFileName->setObjectName(QStringLiteral("LEFileName")); - LEFileName->setMinimumSize(QSize(382, 21)); - - hboxLayout1->addWidget(LEFileName); - - - gridLayout_5->addLayout(hboxLayout1, 3, 0, 1, 5); - - spacerItem1 = new QSpacerItem(20, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout_5->addItem(spacerItem1, 3, 5, 1, 1); - - GBTypeConf = new QGroupBox(CreateCase); - GBTypeConf->setObjectName(QStringLiteral("GBTypeConf")); - hboxLayout2 = new QHBoxLayout(GBTypeConf); -#ifndef Q_OS_MAC - hboxLayout2->setSpacing(6); -#endif -#ifndef Q_OS_MAC - hboxLayout2->setContentsMargins(9, 9, 9, 9); -#endif - hboxLayout2->setObjectName(QStringLiteral("hboxLayout2")); - RBConforme = new QRadioButton(GBTypeConf); - RBConforme->setObjectName(QStringLiteral("RBConforme")); - RBConforme->setChecked(true); - - hboxLayout2->addWidget(RBConforme); - - RBNonConforme = new QRadioButton(GBTypeConf); - RBNonConforme->setObjectName(QStringLiteral("RBNonConforme")); - - hboxLayout2->addWidget(RBNonConforme); - - - gridLayout_5->addWidget(GBTypeConf, 4, 0, 1, 1); - - GBTypeBoun = new QGroupBox(CreateCase); - GBTypeBoun->setObjectName(QStringLiteral("GBTypeBoun")); - _3 = new QHBoxLayout(GBTypeBoun); -#ifndef Q_OS_MAC - _3->setSpacing(6); -#endif -#ifndef Q_OS_MAC - _3->setContentsMargins(9, 9, 9, 9); -#endif - _3->setObjectName(QStringLiteral("_3")); - RBBoundaryNo = new QRadioButton(GBTypeBoun); - RBBoundaryNo->setObjectName(QStringLiteral("RBBoundaryNo")); - RBBoundaryNo->setChecked(true); - - _3->addWidget(RBBoundaryNo); - - RBBoundaryCAO = new QRadioButton(GBTypeBoun); - RBBoundaryCAO->setObjectName(QStringLiteral("RBBoundaryCAO")); - RBBoundaryCAO->setChecked(false); - - _3->addWidget(RBBoundaryCAO); - - RBBoundaryNonCAO = new QRadioButton(GBTypeBoun); - RBBoundaryNonCAO->setObjectName(QStringLiteral("RBBoundaryNonCAO")); - - _3->addWidget(RBBoundaryNonCAO); - - - gridLayout_5->addWidget(GBTypeBoun, 5, 0, 1, 4); - - spacerItem2 = new QSpacerItem(20, 1, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout_5->addItem(spacerItem2, 5, 6, 1, 1); - - hboxLayout3 = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout3->setSpacing(6); -#endif - hboxLayout3->setContentsMargins(0, 0, 0, 0); - hboxLayout3->setObjectName(QStringLiteral("hboxLayout3")); - CBBoundaryD = new QCheckBox(CreateCase); - CBBoundaryD->setObjectName(QStringLiteral("CBBoundaryD")); - - hboxLayout3->addWidget(CBBoundaryD); - - CBBoundaryA = new QCheckBox(CreateCase); - CBBoundaryA->setObjectName(QStringLiteral("CBBoundaryA")); - - hboxLayout3->addWidget(CBBoundaryA); - - - gridLayout_5->addLayout(hboxLayout3, 6, 0, 1, 3); - - GBBoundaryC = new QGroupBox(CreateCase); - GBBoundaryC->setObjectName(QStringLiteral("GBBoundaryC")); - QSizePolicy sizePolicy1(QSizePolicy::Fixed, QSizePolicy::Fixed); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(GBBoundaryC->sizePolicy().hasHeightForWidth()); - GBBoundaryC->setSizePolicy(sizePolicy1); - _2 = new QGridLayout(GBBoundaryC); -#ifndef Q_OS_MAC - _2->setSpacing(6); -#endif -#ifndef Q_OS_MAC - _2->setContentsMargins(9, 9, 9, 9); -#endif - _2->setObjectName(QStringLiteral("_2")); - PBBoundaryCAOEdit = new QPushButton(GBBoundaryC); - PBBoundaryCAOEdit->setObjectName(QStringLiteral("PBBoundaryCAOEdit")); - PBBoundaryCAOEdit->setAutoDefault(false); - - _2->addWidget(PBBoundaryCAOEdit, 0, 3, 1, 1); - - PBBoundaryCAOHelp = new QPushButton(GBBoundaryC); - PBBoundaryCAOHelp->setObjectName(QStringLiteral("PBBoundaryCAOHelp")); - PBBoundaryCAOHelp->setAutoDefault(false); - - _2->addWidget(PBBoundaryCAOHelp, 0, 4, 1, 1); - - CBBoundaryCAO = new QComboBox(GBBoundaryC); - CBBoundaryCAO->setObjectName(QStringLiteral("CBBoundaryCAO")); - CBBoundaryCAO->setSizeAdjustPolicy(QComboBox::AdjustToContents); - - _2->addWidget(CBBoundaryCAO, 0, 0, 1, 1); - - spacerItem3 = new QSpacerItem(40, 13, QSizePolicy::Fixed, QSizePolicy::Minimum); - - _2->addItem(spacerItem3, 0, 1, 1, 1); - - PBBoundaryCAONew = new QPushButton(GBBoundaryC); - PBBoundaryCAONew->setObjectName(QStringLiteral("PBBoundaryCAONew")); - PBBoundaryCAONew->setAutoDefault(false); - - _2->addWidget(PBBoundaryCAONew, 0, 2, 1, 1); - - - gridLayout_5->addWidget(GBBoundaryC, 7, 0, 1, 2); - - spacerItem4 = new QSpacerItem(20, 2, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout_5->addItem(spacerItem4, 7, 2, 1, 1); - - GBBoundaryD = new QGroupBox(CreateCase); - GBBoundaryD->setObjectName(QStringLiteral("GBBoundaryD")); - sizePolicy1.setHeightForWidth(GBBoundaryD->sizePolicy().hasHeightForWidth()); - GBBoundaryD->setSizePolicy(sizePolicy1); - gridLayout = new QGridLayout(GBBoundaryD); -#ifndef Q_OS_MAC - gridLayout->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout->setObjectName(QStringLiteral("gridLayout")); - CBBoundaryDi = new QComboBox(GBBoundaryD); - CBBoundaryDi->setObjectName(QStringLiteral("CBBoundaryDi")); - CBBoundaryDi->setSizeAdjustPolicy(QComboBox::AdjustToContents); - - gridLayout->addWidget(CBBoundaryDi, 0, 0, 1, 1); - - spacerItem5 = new QSpacerItem(40, 13, QSizePolicy::Fixed, QSizePolicy::Minimum); - - gridLayout->addItem(spacerItem5, 0, 1, 1, 1); - - PBBoundaryDiEdit = new QPushButton(GBBoundaryD); - PBBoundaryDiEdit->setObjectName(QStringLiteral("PBBoundaryDiEdit")); - PBBoundaryDiEdit->setAutoDefault(false); - - gridLayout->addWidget(PBBoundaryDiEdit, 0, 3, 1, 1); - - PBBoundaryDiHelp = new QPushButton(GBBoundaryD); - PBBoundaryDiHelp->setObjectName(QStringLiteral("PBBoundaryDiHelp")); - PBBoundaryDiHelp->setAutoDefault(false); - - gridLayout->addWidget(PBBoundaryDiHelp, 0, 4, 1, 1); - - PBBoundaryDiNew = new QPushButton(GBBoundaryD); - PBBoundaryDiNew->setObjectName(QStringLiteral("PBBoundaryDiNew")); - PBBoundaryDiNew->setAutoDefault(false); - - gridLayout->addWidget(PBBoundaryDiNew, 0, 2, 1, 1); - - - gridLayout_5->addWidget(GBBoundaryD, 8, 0, 1, 4); - - GBBoundaryA = new QGroupBox(CreateCase); - GBBoundaryA->setObjectName(QStringLiteral("GBBoundaryA")); - GBBoundaryA->setMinimumSize(QSize(548, 200)); - formLayout = new QFormLayout(GBBoundaryA); - formLayout->setObjectName(QStringLiteral("formLayout")); - TWBoundary = new QTableWidget(GBBoundaryA); - if (TWBoundary->columnCount() < 1) - TWBoundary->setColumnCount(1); - QTableWidgetItem *__qtablewidgetitem = new QTableWidgetItem(); - TWBoundary->setHorizontalHeaderItem(0, __qtablewidgetitem); - TWBoundary->setObjectName(QStringLiteral("TWBoundary")); - TWBoundary->setEditTriggers(QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked); - TWBoundary->setShowGrid(true); - TWBoundary->setRowCount(0); - TWBoundary->setColumnCount(1); - - formLayout->setWidget(0, QFormLayout::LabelRole, TWBoundary); - - gridLayout1 = new QGridLayout(); -#ifndef Q_OS_MAC - gridLayout1->setSpacing(6); -#endif - gridLayout1->setContentsMargins(0, 0, 0, 0); - gridLayout1->setObjectName(QStringLiteral("gridLayout1")); - PBBoundaryAnEdit = new QPushButton(GBBoundaryA); - PBBoundaryAnEdit->setObjectName(QStringLiteral("PBBoundaryAnEdit")); - PBBoundaryAnEdit->setAutoDefault(false); - - gridLayout1->addWidget(PBBoundaryAnEdit, 1, 0, 1, 1); - - PBBoundaryAnNew = new QPushButton(GBBoundaryA); - PBBoundaryAnNew->setObjectName(QStringLiteral("PBBoundaryAnNew")); - PBBoundaryAnNew->setAutoDefault(false); - - gridLayout1->addWidget(PBBoundaryAnNew, 0, 0, 1, 1); - - PBBoundaryAnHelp = new QPushButton(GBBoundaryA); - PBBoundaryAnHelp->setObjectName(QStringLiteral("PBBoundaryAnHelp")); - PBBoundaryAnHelp->setAutoDefault(false); - - gridLayout1->addWidget(PBBoundaryAnHelp, 2, 0, 1, 1); - - - formLayout->setLayout(0, QFormLayout::FieldRole, gridLayout1); - - - gridLayout_5->addWidget(GBBoundaryA, 9, 0, 1, 7); - - spacer = new QSpacerItem(239, 41, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout_5->addItem(spacer, 10, 0, 1, 1); - - CBAdvanced = new QCheckBox(CreateCase); - CBAdvanced->setObjectName(QStringLiteral("CBAdvanced")); - - gridLayout_5->addWidget(CBAdvanced, 11, 0, 1, 1); - - GBAdvancedOptions = new QGroupBox(CreateCase); - GBAdvancedOptions->setObjectName(QStringLiteral("GBAdvancedOptions")); - gridLayout_4 = new QGridLayout(GBAdvancedOptions); - gridLayout_4->setObjectName(QStringLiteral("gridLayout_4")); - CBPyramid = new QCheckBox(GBAdvancedOptions); - CBPyramid->setObjectName(QStringLiteral("CBPyramid")); - - gridLayout_4->addWidget(CBPyramid, 0, 0, 1, 1); - - GBConforme = new QGroupBox(GBAdvancedOptions); - GBConforme->setObjectName(QStringLiteral("GBConforme")); - gridLayout_3 = new QGridLayout(GBConforme); - gridLayout_3->setObjectName(QStringLiteral("gridLayout_3")); - horizontalLayout_2 = new QHBoxLayout(); - horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2")); - RBStandard = new QRadioButton(GBConforme); - RBStandard->setObjectName(QStringLiteral("RBStandard")); - RBStandard->setChecked(true); - - horizontalLayout_2->addWidget(RBStandard); - - RBBox = new QRadioButton(GBConforme); - RBBox->setObjectName(QStringLiteral("RBBox")); - RBBox->setChecked(false); - - horizontalLayout_2->addWidget(RBBox); - - RBNC1NpA = new QRadioButton(GBConforme); - RBNC1NpA->setObjectName(QStringLiteral("RBNC1NpA")); - - horizontalLayout_2->addWidget(RBNC1NpA); - - RBNCQuelconque = new QRadioButton(GBConforme); - RBNCQuelconque->setObjectName(QStringLiteral("RBNCQuelconque")); - - horizontalLayout_2->addWidget(RBNCQuelconque); - - - gridLayout_3->addLayout(horizontalLayout_2, 0, 0, 1, 1); - - GBFormat = new QGroupBox(GBConforme); - GBFormat->setObjectName(QStringLiteral("GBFormat")); - gridLayout2 = new QGridLayout(GBFormat); - gridLayout2->setObjectName(QStringLiteral("gridLayout2")); - RBMED = new QRadioButton(GBFormat); - RBMED->setObjectName(QStringLiteral("RBMED")); - RBMED->setChecked(true); - - gridLayout2->addWidget(RBMED, 0, 0, 1, 1); - - RBSaturne = new QRadioButton(GBFormat); - RBSaturne->setObjectName(QStringLiteral("RBSaturne")); - - gridLayout2->addWidget(RBSaturne, 0, 1, 1, 1); - - RBSaturne2D = new QRadioButton(GBFormat); - RBSaturne2D->setObjectName(QStringLiteral("RBSaturne2D")); - - gridLayout2->addWidget(RBSaturne2D, 0, 2, 1, 1); - - - gridLayout_3->addWidget(GBFormat, 1, 0, 1, 1); - - - gridLayout_4->addWidget(GBConforme, 1, 0, 1, 1); - - - gridLayout_5->addWidget(GBAdvancedOptions, 12, 0, 1, 3); - - spacer_3 = new QSpacerItem(128, 13, QSizePolicy::Fixed, QSizePolicy::Minimum); - - gridLayout_5->addItem(spacer_3, 12, 4, 1, 3); - - spacer_4 = new QSpacerItem(239, 41, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout_5->addItem(spacer_4, 13, 0, 1, 1); - - Comment = new QLabel(CreateCase); - Comment->setObjectName(QStringLiteral("Comment")); - - gridLayout_5->addWidget(Comment, 14, 0, 1, 1); - - verticalSpacer = new QSpacerItem(20, 35, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout_5->addItem(verticalSpacer, 14, 1, 1, 1); - - GroupButtons = new QGroupBox(CreateCase); - GroupButtons->setObjectName(QStringLiteral("GroupButtons")); - gridLayout3 = new QGridLayout(GroupButtons); -#ifndef Q_OS_MAC - gridLayout3->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout3->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout3->setObjectName(QStringLiteral("gridLayout3")); - buttonHelp = new QPushButton(GroupButtons); - buttonHelp->setObjectName(QStringLiteral("buttonHelp")); - buttonHelp->setAutoDefault(false); - - gridLayout3->addWidget(buttonHelp, 0, 4, 1, 1); - - buttonApply = new QPushButton(GroupButtons); - buttonApply->setObjectName(QStringLiteral("buttonApply")); - buttonApply->setAutoDefault(false); - - gridLayout3->addWidget(buttonApply, 0, 1, 1, 1); - - buttonOk = new QPushButton(GroupButtons); - buttonOk->setObjectName(QStringLiteral("buttonOk")); - buttonOk->setAutoDefault(false); - - gridLayout3->addWidget(buttonOk, 0, 0, 1, 1); - - buttonCancel = new QPushButton(GroupButtons); - buttonCancel->setObjectName(QStringLiteral("buttonCancel")); - buttonCancel->setAutoDefault(false); - - gridLayout3->addWidget(buttonCancel, 0, 2, 1, 1); - - - gridLayout_5->addWidget(GroupButtons, 15, 0, 1, 2); - - spacer_2 = new QSpacerItem(128, 25, QSizePolicy::Fixed, QSizePolicy::Minimum); - - gridLayout_5->addItem(spacer_2, 15, 3, 1, 2); - - WName->raise(); - GBTypeConf->raise(); - GBBoundaryD->raise(); - GBBoundaryA->raise(); - CBAdvanced->raise(); - GBAdvancedOptions->raise(); - Comment->raise(); - GroupButtons->raise(); - GBBoundaryC->raise(); - GBTypeBoun->raise(); - - retranslateUi(CreateCase); - - CBBoundaryCAO->setCurrentIndex(-1); - CBBoundaryDi->setCurrentIndex(-1); - - - QMetaObject::connectSlotsByName(CreateCase); - } // setupUi - - void retranslateUi(QDialog *CreateCase) - { - CreateCase->setWindowTitle(QApplication::translate("CreateCase", "Create a case", Q_NULLPTR)); - Name->setText(QApplication::translate("CreateCase", "Name", Q_NULLPTR)); - Directory->setText(QApplication::translate("CreateCase", "Directory", Q_NULLPTR)); - PushDir->setText(QString()); - Mesh->setText(QApplication::translate("CreateCase", "Mesh", Q_NULLPTR)); - PushFichier->setText(QString()); - GBTypeConf->setTitle(QApplication::translate("CreateCase", "Conformity type", Q_NULLPTR)); - RBConforme->setText(QApplication::translate("CreateCase", "Conformal", Q_NULLPTR)); - RBNonConforme->setText(QApplication::translate("CreateCase", "Non conformal", Q_NULLPTR)); - GBTypeBoun->setTitle(QApplication::translate("CreateCase", "Boundary type", Q_NULLPTR)); - RBBoundaryNo->setText(QApplication::translate("CreateCase", "No boundary", Q_NULLPTR)); - RBBoundaryCAO->setText(QApplication::translate("CreateCase", "CAO", Q_NULLPTR)); - RBBoundaryNonCAO->setText(QApplication::translate("CreateCase", "Non CAO", Q_NULLPTR)); - CBBoundaryD->setText(QApplication::translate("CreateCase", "Discrete boundary", Q_NULLPTR)); - CBBoundaryA->setText(QApplication::translate("CreateCase", "Analytical boundary", Q_NULLPTR)); - GBBoundaryC->setTitle(QApplication::translate("CreateCase", "CAO", Q_NULLPTR)); - PBBoundaryCAOEdit->setText(QApplication::translate("CreateCase", "Edit", Q_NULLPTR)); - PBBoundaryCAOHelp->setText(QApplication::translate("CreateCase", "Help", Q_NULLPTR)); - PBBoundaryCAONew->setText(QApplication::translate("CreateCase", "New", Q_NULLPTR)); - GBBoundaryD->setTitle(QApplication::translate("CreateCase", "Discrete boundary", Q_NULLPTR)); - PBBoundaryDiEdit->setText(QApplication::translate("CreateCase", "Edit", Q_NULLPTR)); - PBBoundaryDiHelp->setText(QApplication::translate("CreateCase", "Help", Q_NULLPTR)); - PBBoundaryDiNew->setText(QApplication::translate("CreateCase", "New", Q_NULLPTR)); - GBBoundaryA->setTitle(QApplication::translate("CreateCase", "Analytical boundary", Q_NULLPTR)); - QTableWidgetItem *___qtablewidgetitem = TWBoundary->horizontalHeaderItem(0); - ___qtablewidgetitem->setText(QApplication::translate("CreateCase", "a_virer", Q_NULLPTR)); - PBBoundaryAnEdit->setText(QApplication::translate("CreateCase", "Edit", Q_NULLPTR)); - PBBoundaryAnNew->setText(QApplication::translate("CreateCase", "New", Q_NULLPTR)); - PBBoundaryAnHelp->setText(QApplication::translate("CreateCase", "Help", Q_NULLPTR)); - CBAdvanced->setText(QApplication::translate("CreateCase", "Advanced options", Q_NULLPTR)); - GBAdvancedOptions->setTitle(QApplication::translate("CreateCase", "Advanced options", Q_NULLPTR)); - CBPyramid->setText(QApplication::translate("CreateCase", "Authorized pyramids", Q_NULLPTR)); - GBConforme->setTitle(QApplication::translate("CreateCase", "Conformity +", Q_NULLPTR)); - RBStandard->setText(QApplication::translate("CreateCase", "Standard", Q_NULLPTR)); - RBBox->setText(QApplication::translate("CreateCase", "Box", Q_NULLPTR)); - RBNC1NpA->setText(QApplication::translate("CreateCase", "1 node per edge", Q_NULLPTR)); - RBNCQuelconque->setText(QApplication::translate("CreateCase", "Free", Q_NULLPTR)); - GBFormat->setTitle(QApplication::translate("CreateCase", "Format", Q_NULLPTR)); - RBMED->setText(QApplication::translate("CreateCase", "MED", Q_NULLPTR)); - RBSaturne->setText(QApplication::translate("CreateCase", "Saturne", Q_NULLPTR)); - RBSaturne2D->setText(QApplication::translate("CreateCase", "Saturne 2D", Q_NULLPTR)); - Comment->setText(QApplication::translate("CreateCase", " No comment.", Q_NULLPTR)); - GroupButtons->setTitle(QString()); - buttonHelp->setText(QApplication::translate("CreateCase", "Help", Q_NULLPTR)); - buttonApply->setText(QApplication::translate("CreateCase", "Apply", Q_NULLPTR)); - buttonOk->setText(QApplication::translate("CreateCase", "OK", Q_NULLPTR)); - buttonCancel->setText(QApplication::translate("CreateCase", "Cancel", Q_NULLPTR)); - } // retranslateUi - -}; - -namespace Ui { - class CreateCase: public Ui_CreateCase {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_CREATECASE_H diff --git a/src/ADAPTGUI/ui_CreateHypothesis.h b/src/ADAPTGUI/ui_CreateHypothesis.h deleted file mode 100644 index 6669533df..000000000 --- a/src/ADAPTGUI/ui_CreateHypothesis.h +++ /dev/null @@ -1,915 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'CreateHypothesis.ui' -** -** Created by: Qt User Interface Compiler version 5.9.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_CREATEHYPOTHESIS_H -#define UI_CREATEHYPOTHESIS_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_CreateHypothesis -{ -public: - QWidget *scrollAreaWidgetContents; - QGridLayout *gridLayout_5; - QWidget *WName; - QGridLayout *gridLayout; - QLabel *Name; - QLineEdit *LEName; - QSpacerItem *horizontalSpacer_9; - QGroupBox *GBTypeAdaptation; - QHBoxLayout *hboxLayout; - QRadioButton *RBUniforme; - QRadioButton *RBChamp; - QRadioButton *RBZone; - QSpacerItem *horizontalSpacer_6; - QCheckBox *CBGroupe; - QSpacerItem *horizontalSpacer_8; - QGroupBox *GBUniform; - QGridLayout *gridLayout1; - QRadioButton *RBUniDera; - QRadioButton *RBUniRaff; - QSpacerItem *horizontalSpacer_7; - QGroupBox *GBFieldFile; - QGridLayout *gridLayout2; - QLabel *FieldFile; - QLineEdit *LEFieldFile; - QGroupBox *GBFieldManagement; - QGridLayout *gridLayout3; - QHBoxLayout *hboxLayout1; - QLabel *FieldName; - QComboBox *CBFieldName; - QSpacerItem *spacerItem; - QHBoxLayout *hboxLayout2; - QTableWidget *TWCMP; - QSpacerItem *spacerItem1; - QVBoxLayout *vboxLayout; - QHBoxLayout *hboxLayout3; - QRadioButton *RBL2; - QRadioButton *RBInf; - QCheckBox *CBJump; - QHBoxLayout *hboxLayout4; - QGroupBox *GBRefinementThresholds; - QGridLayout *gridLayout4; - QRadioButton *RBRPE; - QDoubleSpinBox *SpinBox_RPE; - QRadioButton *RBRRel; - QDoubleSpinBox *SpinBox_RRel; - QRadioButton *RBRAbs; - QDoubleSpinBox *SpinBox_RAbs; - QRadioButton *RBRMuSigma; - QDoubleSpinBox *SpinBox_RMuSigma; - QRadioButton *RBRNo; - QGroupBox *GBCoarseningThresholds; - QGridLayout *gridLayout5; - QRadioButton *RBCPE; - QDoubleSpinBox *SpinBox_CPE; - QRadioButton *RBCRel; - QDoubleSpinBox *SpinBox_CRel; - QRadioButton *RBCAbs; - QDoubleSpinBox *SpinBox_CAbs; - QRadioButton *RBCMuSigma; - QDoubleSpinBox *SpinBox_CMuSigma; - QRadioButton *RBCNo; - QGroupBox *GBAreaManagement; - QGridLayout *gridLayout_4; - QTableWidget *TWZone; - QSpacerItem *horizontalSpacer; - QVBoxLayout *vboxLayout1; - QVBoxLayout *vboxLayout2; - QPushButton *PBZoneNew; - QPushButton *PBZoneEdit; - QPushButton *PBZoneDelete; - QSpacerItem *spacerItem2; - QGroupBox *GBField; - QGridLayout *gridLayout6; - QGridLayout *gridLayout7; - QRadioButton *RBFieldNo; - QRadioButton *RBFieldAll; - QRadioButton *RBFieldChosen; - QTableWidget *TWField; - QSpacerItem *horizontalSpacer_5; - QCheckBox *CBAdvanced; - QSpacerItem *horizontalSpacer_4; - QGroupBox *GBAdvancedOptions; - QGridLayout *gridLayout_3; - QLabel *TLMinimalDiameter; - QDoubleSpinBox *doubleSpinBoxDiamMin; - QLabel *TLMaximalLevel; - QSpinBox *SpinBoxNivMax; - QGroupBox *GBAdapInit; - QGridLayout *gridLayout_2; - QRadioButton *RBAIN; - QRadioButton *RBAIR; - QRadioButton *RBAID; - QCheckBox *CBOutputLevel; - QCheckBox *CBOutputQuality; - QCheckBox *CBOutputDiameter; - QCheckBox *CBOutputParent; - QCheckBox *CBOutputVoisins; - QSpacerItem *horizontalSpacer_3; - QSpacerItem *horizontalSpacer_2; - QGroupBox *GBButtons; - QGridLayout *gridLayout8; - QPushButton *buttonOk; - QPushButton *buttonApply; - QPushButton *buttonCancel; - QPushButton *buttonHelp; - - void setupUi(QScrollArea *CreateHypothesis) - { - if (CreateHypothesis->objectName().isEmpty()) - CreateHypothesis->setObjectName(QStringLiteral("CreateHypothesis")); - CreateHypothesis->resize(848, 1650); - QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(CreateHypothesis->sizePolicy().hasHeightForWidth()); - CreateHypothesis->setSizePolicy(sizePolicy); - CreateHypothesis->setMinimumSize(QSize(800, 600)); - CreateHypothesis->setSizeIncrement(QSize(1, 1)); - CreateHypothesis->setBaseSize(QSize(800, 1200)); - CreateHypothesis->setWidgetResizable(true); - scrollAreaWidgetContents = new QWidget(); - scrollAreaWidgetContents->setObjectName(QStringLiteral("scrollAreaWidgetContents")); - scrollAreaWidgetContents->setGeometry(QRect(0, 0, 844, 1646)); - scrollAreaWidgetContents->setProperty("sizeGripEnabled", QVariant(true)); - gridLayout_5 = new QGridLayout(scrollAreaWidgetContents); - gridLayout_5->setObjectName(QStringLiteral("gridLayout_5")); - WName = new QWidget(scrollAreaWidgetContents); - WName->setObjectName(QStringLiteral("WName")); - gridLayout = new QGridLayout(WName); - gridLayout->setObjectName(QStringLiteral("gridLayout")); - Name = new QLabel(WName); - Name->setObjectName(QStringLiteral("Name")); - - gridLayout->addWidget(Name, 0, 0, 1, 1); - - LEName = new QLineEdit(WName); - LEName->setObjectName(QStringLiteral("LEName")); - LEName->setMinimumSize(QSize(282, 31)); - - gridLayout->addWidget(LEName, 0, 1, 1, 1); - - - gridLayout_5->addWidget(WName, 0, 0, 1, 1); - - horizontalSpacer_9 = new QSpacerItem(224, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout_5->addItem(horizontalSpacer_9, 0, 1, 1, 1); - - GBTypeAdaptation = new QGroupBox(scrollAreaWidgetContents); - GBTypeAdaptation->setObjectName(QStringLiteral("GBTypeAdaptation")); - hboxLayout = new QHBoxLayout(GBTypeAdaptation); -#ifndef Q_OS_MAC - hboxLayout->setSpacing(6); -#endif -#ifndef Q_OS_MAC - hboxLayout->setContentsMargins(9, 9, 9, 9); -#endif - hboxLayout->setObjectName(QStringLiteral("hboxLayout")); - RBUniforme = new QRadioButton(GBTypeAdaptation); - RBUniforme->setObjectName(QStringLiteral("RBUniforme")); - RBUniforme->setCheckable(true); - - hboxLayout->addWidget(RBUniforme); - - RBChamp = new QRadioButton(GBTypeAdaptation); - RBChamp->setObjectName(QStringLiteral("RBChamp")); - - hboxLayout->addWidget(RBChamp); - - RBZone = new QRadioButton(GBTypeAdaptation); - RBZone->setObjectName(QStringLiteral("RBZone")); - - hboxLayout->addWidget(RBZone); - - - gridLayout_5->addWidget(GBTypeAdaptation, 1, 0, 1, 1); - - horizontalSpacer_6 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout_5->addItem(horizontalSpacer_6, 1, 2, 1, 1); - - CBGroupe = new QCheckBox(scrollAreaWidgetContents); - CBGroupe->setObjectName(QStringLiteral("CBGroupe")); - - gridLayout_5->addWidget(CBGroupe, 2, 0, 1, 1); - - horizontalSpacer_8 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout_5->addItem(horizontalSpacer_8, 2, 2, 1, 1); - - GBUniform = new QGroupBox(scrollAreaWidgetContents); - GBUniform->setObjectName(QStringLiteral("GBUniform")); - gridLayout1 = new QGridLayout(GBUniform); -#ifndef Q_OS_MAC - gridLayout1->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout1->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout1->setObjectName(QStringLiteral("gridLayout1")); - RBUniDera = new QRadioButton(GBUniform); - RBUniDera->setObjectName(QStringLiteral("RBUniDera")); - - gridLayout1->addWidget(RBUniDera, 0, 1, 1, 1); - - RBUniRaff = new QRadioButton(GBUniform); - RBUniRaff->setObjectName(QStringLiteral("RBUniRaff")); - RBUniRaff->setChecked(true); - - gridLayout1->addWidget(RBUniRaff, 0, 0, 1, 1); - - - gridLayout_5->addWidget(GBUniform, 3, 0, 1, 1); - - horizontalSpacer_7 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout_5->addItem(horizontalSpacer_7, 3, 2, 1, 1); - - GBFieldFile = new QGroupBox(scrollAreaWidgetContents); - GBFieldFile->setObjectName(QStringLiteral("GBFieldFile")); - gridLayout2 = new QGridLayout(GBFieldFile); -#ifndef Q_OS_MAC - gridLayout2->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout2->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout2->setObjectName(QStringLiteral("gridLayout2")); - FieldFile = new QLabel(GBFieldFile); - FieldFile->setObjectName(QStringLiteral("FieldFile")); - - gridLayout2->addWidget(FieldFile, 0, 0, 1, 1); - - LEFieldFile = new QLineEdit(GBFieldFile); - LEFieldFile->setObjectName(QStringLiteral("LEFieldFile")); - LEFieldFile->setMinimumSize(QSize(282, 31)); - - gridLayout2->addWidget(LEFieldFile, 0, 1, 1, 1); - - - gridLayout_5->addWidget(GBFieldFile, 4, 0, 1, 1); - - GBFieldManagement = new QGroupBox(scrollAreaWidgetContents); - GBFieldManagement->setObjectName(QStringLiteral("GBFieldManagement")); - QSizePolicy sizePolicy1(QSizePolicy::Fixed, QSizePolicy::Fixed); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(GBFieldManagement->sizePolicy().hasHeightForWidth()); - GBFieldManagement->setSizePolicy(sizePolicy1); - gridLayout3 = new QGridLayout(GBFieldManagement); -#ifndef Q_OS_MAC - gridLayout3->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout3->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout3->setObjectName(QStringLiteral("gridLayout3")); - hboxLayout1 = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout1->setSpacing(6); -#endif -#ifndef Q_OS_MAC - hboxLayout1->setContentsMargins(0, 0, 0, 0); -#endif - hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); - FieldName = new QLabel(GBFieldManagement); - FieldName->setObjectName(QStringLiteral("FieldName")); - - hboxLayout1->addWidget(FieldName); - - CBFieldName = new QComboBox(GBFieldManagement); - CBFieldName->setObjectName(QStringLiteral("CBFieldName")); - sizePolicy1.setHeightForWidth(CBFieldName->sizePolicy().hasHeightForWidth()); - CBFieldName->setSizePolicy(sizePolicy1); - CBFieldName->setEditable(false); - CBFieldName->setSizeAdjustPolicy(QComboBox::AdjustToContents); - - hboxLayout1->addWidget(CBFieldName); - - spacerItem = new QSpacerItem(48, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout1->addItem(spacerItem); - - - gridLayout3->addLayout(hboxLayout1, 0, 0, 1, 1); - - hboxLayout2 = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout2->setSpacing(6); -#endif - hboxLayout2->setContentsMargins(0, 0, 0, 0); - hboxLayout2->setObjectName(QStringLiteral("hboxLayout2")); - TWCMP = new QTableWidget(GBFieldManagement); - if (TWCMP->columnCount() < 2) - TWCMP->setColumnCount(2); - QTableWidgetItem *__qtablewidgetitem = new QTableWidgetItem(); - TWCMP->setHorizontalHeaderItem(0, __qtablewidgetitem); - QTableWidgetItem *__qtablewidgetitem1 = new QTableWidgetItem(); - TWCMP->setHorizontalHeaderItem(1, __qtablewidgetitem1); - TWCMP->setObjectName(QStringLiteral("TWCMP")); - TWCMP->setEditTriggers(QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked); - TWCMP->setShowGrid(true); - TWCMP->setRowCount(0); - TWCMP->setColumnCount(2); - - hboxLayout2->addWidget(TWCMP); - - spacerItem1 = new QSpacerItem(60, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout2->addItem(spacerItem1); - - vboxLayout = new QVBoxLayout(); -#ifndef Q_OS_MAC - vboxLayout->setSpacing(6); -#endif - vboxLayout->setContentsMargins(0, 0, 0, 0); - vboxLayout->setObjectName(QStringLiteral("vboxLayout")); - hboxLayout3 = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout3->setSpacing(6); -#endif -#ifndef Q_OS_MAC - hboxLayout3->setContentsMargins(0, 0, 0, 0); -#endif - hboxLayout3->setObjectName(QStringLiteral("hboxLayout3")); - RBL2 = new QRadioButton(GBFieldManagement); - RBL2->setObjectName(QStringLiteral("RBL2")); - RBL2->setChecked(true); - - hboxLayout3->addWidget(RBL2); - - RBInf = new QRadioButton(GBFieldManagement); - RBInf->setObjectName(QStringLiteral("RBInf")); - RBInf->setChecked(false); - - hboxLayout3->addWidget(RBInf); - - - vboxLayout->addLayout(hboxLayout3); - - CBJump = new QCheckBox(GBFieldManagement); - CBJump->setObjectName(QStringLiteral("CBJump")); - - vboxLayout->addWidget(CBJump); - - - hboxLayout2->addLayout(vboxLayout); - - - gridLayout3->addLayout(hboxLayout2, 1, 0, 1, 1); - - hboxLayout4 = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout4->setSpacing(6); -#endif - hboxLayout4->setContentsMargins(0, 0, 0, 0); - hboxLayout4->setObjectName(QStringLiteral("hboxLayout4")); - GBRefinementThresholds = new QGroupBox(GBFieldManagement); - GBRefinementThresholds->setObjectName(QStringLiteral("GBRefinementThresholds")); - sizePolicy1.setHeightForWidth(GBRefinementThresholds->sizePolicy().hasHeightForWidth()); - GBRefinementThresholds->setSizePolicy(sizePolicy1); - gridLayout4 = new QGridLayout(GBRefinementThresholds); -#ifndef Q_OS_MAC - gridLayout4->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout4->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout4->setObjectName(QStringLiteral("gridLayout4")); - RBRPE = new QRadioButton(GBRefinementThresholds); - RBRPE->setObjectName(QStringLiteral("RBRPE")); - RBRPE->setCheckable(true); - RBRPE->setChecked(true); - - gridLayout4->addWidget(RBRPE, 0, 0, 1, 1); - - SpinBox_RPE = new QDoubleSpinBox(GBRefinementThresholds); - SpinBox_RPE->setObjectName(QStringLiteral("SpinBox_RPE")); - SpinBox_RPE->setDecimals(3); - SpinBox_RPE->setMaximum(100); - SpinBox_RPE->setSingleStep(0.1); - SpinBox_RPE->setValue(2); - - gridLayout4->addWidget(SpinBox_RPE, 0, 1, 1, 1); - - RBRRel = new QRadioButton(GBRefinementThresholds); - RBRRel->setObjectName(QStringLiteral("RBRRel")); - - gridLayout4->addWidget(RBRRel, 1, 0, 1, 1); - - SpinBox_RRel = new QDoubleSpinBox(GBRefinementThresholds); - SpinBox_RRel->setObjectName(QStringLiteral("SpinBox_RRel")); - SpinBox_RRel->setEnabled(false); - SpinBox_RRel->setDecimals(3); - SpinBox_RRel->setMaximum(100); - SpinBox_RRel->setSingleStep(0.1); - - gridLayout4->addWidget(SpinBox_RRel, 1, 1, 1, 1); - - RBRAbs = new QRadioButton(GBRefinementThresholds); - RBRAbs->setObjectName(QStringLiteral("RBRAbs")); - - gridLayout4->addWidget(RBRAbs, 2, 0, 1, 1); - - SpinBox_RAbs = new QDoubleSpinBox(GBRefinementThresholds); - SpinBox_RAbs->setObjectName(QStringLiteral("SpinBox_RAbs")); - SpinBox_RAbs->setEnabled(false); - SpinBox_RAbs->setDecimals(8); - SpinBox_RAbs->setMinimum(-1e+12); - SpinBox_RAbs->setMaximum(1e+12); - SpinBox_RAbs->setSingleStep(0.1); - - gridLayout4->addWidget(SpinBox_RAbs, 2, 1, 1, 1); - - RBRMuSigma = new QRadioButton(GBRefinementThresholds); - RBRMuSigma->setObjectName(QStringLiteral("RBRMuSigma")); - - gridLayout4->addWidget(RBRMuSigma, 3, 0, 1, 1); - - SpinBox_RMuSigma = new QDoubleSpinBox(GBRefinementThresholds); - SpinBox_RMuSigma->setObjectName(QStringLiteral("SpinBox_RMuSigma")); - SpinBox_RMuSigma->setEnabled(false); - SpinBox_RMuSigma->setDecimals(8); - SpinBox_RMuSigma->setMinimum(-1e+12); - SpinBox_RMuSigma->setMaximum(1e+12); - SpinBox_RMuSigma->setSingleStep(0.1); - SpinBox_RMuSigma->setValue(3); - - gridLayout4->addWidget(SpinBox_RMuSigma, 3, 1, 1, 1); - - RBRNo = new QRadioButton(GBRefinementThresholds); - RBRNo->setObjectName(QStringLiteral("RBRNo")); - - gridLayout4->addWidget(RBRNo, 4, 0, 1, 1); - - - hboxLayout4->addWidget(GBRefinementThresholds); - - GBCoarseningThresholds = new QGroupBox(GBFieldManagement); - GBCoarseningThresholds->setObjectName(QStringLiteral("GBCoarseningThresholds")); - gridLayout5 = new QGridLayout(GBCoarseningThresholds); -#ifndef Q_OS_MAC - gridLayout5->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout5->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout5->setObjectName(QStringLiteral("gridLayout5")); - RBCPE = new QRadioButton(GBCoarseningThresholds); - RBCPE->setObjectName(QStringLiteral("RBCPE")); - RBCPE->setCheckable(true); - RBCPE->setChecked(false); - - gridLayout5->addWidget(RBCPE, 0, 0, 1, 1); - - SpinBox_CPE = new QDoubleSpinBox(GBCoarseningThresholds); - SpinBox_CPE->setObjectName(QStringLiteral("SpinBox_CPE")); - SpinBox_CPE->setEnabled(false); - SpinBox_CPE->setDecimals(3); - SpinBox_CPE->setMaximum(100); - SpinBox_CPE->setSingleStep(0.1); - - gridLayout5->addWidget(SpinBox_CPE, 0, 1, 1, 1); - - RBCRel = new QRadioButton(GBCoarseningThresholds); - RBCRel->setObjectName(QStringLiteral("RBCRel")); - - gridLayout5->addWidget(RBCRel, 1, 0, 1, 1); - - SpinBox_CRel = new QDoubleSpinBox(GBCoarseningThresholds); - SpinBox_CRel->setObjectName(QStringLiteral("SpinBox_CRel")); - SpinBox_CRel->setEnabled(false); - SpinBox_CRel->setDecimals(3); - SpinBox_CRel->setMaximum(100); - SpinBox_CRel->setSingleStep(0.1); - - gridLayout5->addWidget(SpinBox_CRel, 1, 1, 1, 1); - - RBCAbs = new QRadioButton(GBCoarseningThresholds); - RBCAbs->setObjectName(QStringLiteral("RBCAbs")); - - gridLayout5->addWidget(RBCAbs, 2, 0, 1, 1); - - SpinBox_CAbs = new QDoubleSpinBox(GBCoarseningThresholds); - SpinBox_CAbs->setObjectName(QStringLiteral("SpinBox_CAbs")); - SpinBox_CAbs->setEnabled(false); - SpinBox_CAbs->setDecimals(8); - SpinBox_CAbs->setMinimum(-1e+12); - SpinBox_CAbs->setMaximum(1e+12); - SpinBox_CAbs->setSingleStep(0.1); - - gridLayout5->addWidget(SpinBox_CAbs, 2, 1, 1, 1); - - RBCMuSigma = new QRadioButton(GBCoarseningThresholds); - RBCMuSigma->setObjectName(QStringLiteral("RBCMuSigma")); - - gridLayout5->addWidget(RBCMuSigma, 3, 0, 1, 1); - - SpinBox_CMuSigma = new QDoubleSpinBox(GBCoarseningThresholds); - SpinBox_CMuSigma->setObjectName(QStringLiteral("SpinBox_CMuSigma")); - SpinBox_CMuSigma->setEnabled(false); - SpinBox_CMuSigma->setDecimals(8); - SpinBox_CMuSigma->setMinimum(-1e+12); - SpinBox_CMuSigma->setMaximum(1e+12); - SpinBox_CMuSigma->setSingleStep(0.1); - SpinBox_CMuSigma->setValue(4); - - gridLayout5->addWidget(SpinBox_CMuSigma, 3, 1, 1, 1); - - RBCNo = new QRadioButton(GBCoarseningThresholds); - RBCNo->setObjectName(QStringLiteral("RBCNo")); - RBCNo->setChecked(true); - - gridLayout5->addWidget(RBCNo, 4, 0, 1, 1); - - - hboxLayout4->addWidget(GBCoarseningThresholds); - - - gridLayout3->addLayout(hboxLayout4, 2, 0, 1, 1); - - - gridLayout_5->addWidget(GBFieldManagement, 5, 0, 1, 3); - - GBAreaManagement = new QGroupBox(scrollAreaWidgetContents); - GBAreaManagement->setObjectName(QStringLiteral("GBAreaManagement")); - sizePolicy1.setHeightForWidth(GBAreaManagement->sizePolicy().hasHeightForWidth()); - GBAreaManagement->setSizePolicy(sizePolicy1); - gridLayout_4 = new QGridLayout(GBAreaManagement); - gridLayout_4->setObjectName(QStringLiteral("gridLayout_4")); - TWZone = new QTableWidget(GBAreaManagement); - if (TWZone->columnCount() < 3) - TWZone->setColumnCount(3); - QTableWidgetItem *__qtablewidgetitem2 = new QTableWidgetItem(); - TWZone->setHorizontalHeaderItem(0, __qtablewidgetitem2); - QTableWidgetItem *__qtablewidgetitem3 = new QTableWidgetItem(); - TWZone->setHorizontalHeaderItem(1, __qtablewidgetitem3); - QTableWidgetItem *__qtablewidgetitem4 = new QTableWidgetItem(); - TWZone->setHorizontalHeaderItem(2, __qtablewidgetitem4); - TWZone->setObjectName(QStringLiteral("TWZone")); - TWZone->setMinimumSize(QSize(400, 0)); - TWZone->setEditTriggers(QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked); - TWZone->setShowGrid(true); - TWZone->setRowCount(0); - TWZone->setColumnCount(3); - - gridLayout_4->addWidget(TWZone, 0, 0, 1, 1); - - horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout_4->addItem(horizontalSpacer, 0, 1, 1, 1); - - vboxLayout1 = new QVBoxLayout(); -#ifndef Q_OS_MAC - vboxLayout1->setSpacing(6); -#endif - vboxLayout1->setContentsMargins(0, 0, 0, 0); - vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); - vboxLayout2 = new QVBoxLayout(); -#ifndef Q_OS_MAC - vboxLayout2->setSpacing(6); -#endif -#ifndef Q_OS_MAC - vboxLayout2->setContentsMargins(0, 0, 0, 0); -#endif - vboxLayout2->setObjectName(QStringLiteral("vboxLayout2")); - PBZoneNew = new QPushButton(GBAreaManagement); - PBZoneNew->setObjectName(QStringLiteral("PBZoneNew")); - - vboxLayout2->addWidget(PBZoneNew); - - PBZoneEdit = new QPushButton(GBAreaManagement); - PBZoneEdit->setObjectName(QStringLiteral("PBZoneEdit")); - - vboxLayout2->addWidget(PBZoneEdit); - - PBZoneDelete = new QPushButton(GBAreaManagement); - PBZoneDelete->setObjectName(QStringLiteral("PBZoneDelete")); - - vboxLayout2->addWidget(PBZoneDelete); - - - vboxLayout1->addLayout(vboxLayout2); - - spacerItem2 = new QSpacerItem(20, 48, QSizePolicy::Minimum, QSizePolicy::Expanding); - - vboxLayout1->addItem(spacerItem2); - - - gridLayout_4->addLayout(vboxLayout1, 0, 2, 1, 1); - - - gridLayout_5->addWidget(GBAreaManagement, 6, 0, 1, 2); - - GBField = new QGroupBox(scrollAreaWidgetContents); - GBField->setObjectName(QStringLiteral("GBField")); - gridLayout6 = new QGridLayout(GBField); -#ifndef Q_OS_MAC - gridLayout6->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout6->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout6->setObjectName(QStringLiteral("gridLayout6")); - gridLayout7 = new QGridLayout(); -#ifndef Q_OS_MAC - gridLayout7->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout7->setContentsMargins(0, 0, 0, 0); -#endif - gridLayout7->setObjectName(QStringLiteral("gridLayout7")); - RBFieldNo = new QRadioButton(GBField); - RBFieldNo->setObjectName(QStringLiteral("RBFieldNo")); - RBFieldNo->setChecked(true); - - gridLayout7->addWidget(RBFieldNo, 0, 0, 1, 1); - - RBFieldAll = new QRadioButton(GBField); - RBFieldAll->setObjectName(QStringLiteral("RBFieldAll")); - RBFieldAll->setChecked(false); - - gridLayout7->addWidget(RBFieldAll, 0, 1, 1, 1); - - RBFieldChosen = new QRadioButton(GBField); - RBFieldChosen->setObjectName(QStringLiteral("RBFieldChosen")); - RBFieldChosen->setChecked(false); - - gridLayout7->addWidget(RBFieldChosen, 0, 2, 1, 1); - - - gridLayout6->addLayout(gridLayout7, 0, 0, 1, 1); - - TWField = new QTableWidget(GBField); - if (TWField->columnCount() < 2) - TWField->setColumnCount(2); - QTableWidgetItem *__qtablewidgetitem5 = new QTableWidgetItem(); - TWField->setHorizontalHeaderItem(0, __qtablewidgetitem5); - QTableWidgetItem *__qtablewidgetitem6 = new QTableWidgetItem(); - TWField->setHorizontalHeaderItem(1, __qtablewidgetitem6); - TWField->setObjectName(QStringLiteral("TWField")); - - gridLayout6->addWidget(TWField, 1, 0, 1, 1); - - - gridLayout_5->addWidget(GBField, 7, 0, 1, 1); - - horizontalSpacer_5 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout_5->addItem(horizontalSpacer_5, 7, 2, 1, 1); - - CBAdvanced = new QCheckBox(scrollAreaWidgetContents); - CBAdvanced->setObjectName(QStringLiteral("CBAdvanced")); - - gridLayout_5->addWidget(CBAdvanced, 8, 0, 1, 1); - - horizontalSpacer_4 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout_5->addItem(horizontalSpacer_4, 8, 2, 1, 1); - - GBAdvancedOptions = new QGroupBox(scrollAreaWidgetContents); - GBAdvancedOptions->setObjectName(QStringLiteral("GBAdvancedOptions")); - gridLayout_3 = new QGridLayout(GBAdvancedOptions); - gridLayout_3->setObjectName(QStringLiteral("gridLayout_3")); - TLMinimalDiameter = new QLabel(GBAdvancedOptions); - TLMinimalDiameter->setObjectName(QStringLiteral("TLMinimalDiameter")); - sizePolicy1.setHeightForWidth(TLMinimalDiameter->sizePolicy().hasHeightForWidth()); - TLMinimalDiameter->setSizePolicy(sizePolicy1); - TLMinimalDiameter->setWordWrap(false); - - gridLayout_3->addWidget(TLMinimalDiameter, 0, 0, 1, 1); - - doubleSpinBoxDiamMin = new QDoubleSpinBox(GBAdvancedOptions); - doubleSpinBoxDiamMin->setObjectName(QStringLiteral("doubleSpinBoxDiamMin")); - doubleSpinBoxDiamMin->setDecimals(7); - - gridLayout_3->addWidget(doubleSpinBoxDiamMin, 0, 1, 1, 1); - - TLMaximalLevel = new QLabel(GBAdvancedOptions); - TLMaximalLevel->setObjectName(QStringLiteral("TLMaximalLevel")); - sizePolicy1.setHeightForWidth(TLMaximalLevel->sizePolicy().hasHeightForWidth()); - TLMaximalLevel->setSizePolicy(sizePolicy1); - TLMaximalLevel->setWordWrap(false); - - gridLayout_3->addWidget(TLMaximalLevel, 1, 0, 1, 1); - - SpinBoxNivMax = new QSpinBox(GBAdvancedOptions); - SpinBoxNivMax->setObjectName(QStringLiteral("SpinBoxNivMax")); - SpinBoxNivMax->setValue(99); - - gridLayout_3->addWidget(SpinBoxNivMax, 1, 1, 1, 1); - - GBAdapInit = new QGroupBox(GBAdvancedOptions); - GBAdapInit->setObjectName(QStringLiteral("GBAdapInit")); - gridLayout_2 = new QGridLayout(GBAdapInit); - gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); - RBAIN = new QRadioButton(GBAdapInit); - RBAIN->setObjectName(QStringLiteral("RBAIN")); - RBAIN->setChecked(true); - - gridLayout_2->addWidget(RBAIN, 0, 0, 1, 1); - - RBAIR = new QRadioButton(GBAdapInit); - RBAIR->setObjectName(QStringLiteral("RBAIR")); - - gridLayout_2->addWidget(RBAIR, 0, 1, 1, 1); - - RBAID = new QRadioButton(GBAdapInit); - RBAID->setObjectName(QStringLiteral("RBAID")); - - gridLayout_2->addWidget(RBAID, 0, 2, 1, 1); - - - gridLayout_3->addWidget(GBAdapInit, 2, 0, 1, 2); - - CBOutputLevel = new QCheckBox(GBAdvancedOptions); - CBOutputLevel->setObjectName(QStringLiteral("CBOutputLevel")); - - gridLayout_3->addWidget(CBOutputLevel, 3, 0, 1, 1); - - CBOutputQuality = new QCheckBox(GBAdvancedOptions); - CBOutputQuality->setObjectName(QStringLiteral("CBOutputQuality")); - - gridLayout_3->addWidget(CBOutputQuality, 4, 0, 1, 1); - - CBOutputDiameter = new QCheckBox(GBAdvancedOptions); - CBOutputDiameter->setObjectName(QStringLiteral("CBOutputDiameter")); - - gridLayout_3->addWidget(CBOutputDiameter, 5, 0, 1, 1); - - CBOutputParent = new QCheckBox(GBAdvancedOptions); - CBOutputParent->setObjectName(QStringLiteral("CBOutputParent")); - - gridLayout_3->addWidget(CBOutputParent, 6, 0, 1, 1); - - CBOutputVoisins = new QCheckBox(GBAdvancedOptions); - CBOutputVoisins->setObjectName(QStringLiteral("CBOutputVoisins")); - - gridLayout_3->addWidget(CBOutputVoisins, 7, 0, 1, 1); - - - gridLayout_5->addWidget(GBAdvancedOptions, 9, 0, 2, 1); - - horizontalSpacer_3 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout_5->addItem(horizontalSpacer_3, 9, 2, 1, 1); - - horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout_5->addItem(horizontalSpacer_2, 10, 1, 1, 1); - - GBButtons = new QGroupBox(scrollAreaWidgetContents); - GBButtons->setObjectName(QStringLiteral("GBButtons")); - gridLayout8 = new QGridLayout(GBButtons); -#ifndef Q_OS_MAC - gridLayout8->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout8->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout8->setObjectName(QStringLiteral("gridLayout8")); - buttonOk = new QPushButton(GBButtons); - buttonOk->setObjectName(QStringLiteral("buttonOk")); - - gridLayout8->addWidget(buttonOk, 0, 0, 1, 1); - - buttonApply = new QPushButton(GBButtons); - buttonApply->setObjectName(QStringLiteral("buttonApply")); - - gridLayout8->addWidget(buttonApply, 0, 1, 1, 1); - - buttonCancel = new QPushButton(GBButtons); - buttonCancel->setObjectName(QStringLiteral("buttonCancel")); - - gridLayout8->addWidget(buttonCancel, 0, 2, 1, 1); - - buttonHelp = new QPushButton(GBButtons); - buttonHelp->setObjectName(QStringLiteral("buttonHelp")); - - gridLayout8->addWidget(buttonHelp, 0, 3, 1, 1); - - - gridLayout_5->addWidget(GBButtons, 11, 0, 1, 1); - - CreateHypothesis->setWidget(scrollAreaWidgetContents); - - retranslateUi(CreateHypothesis); - - QMetaObject::connectSlotsByName(CreateHypothesis); - } // setupUi - - void retranslateUi(QScrollArea *CreateHypothesis) - { - CreateHypothesis->setWindowTitle(QApplication::translate("CreateHypothesis", "Create a hypothesis", Q_NULLPTR)); - Name->setText(QApplication::translate("CreateHypothesis", "Name", Q_NULLPTR)); - GBTypeAdaptation->setTitle(QApplication::translate("CreateHypothesis", "Type of adaptation", Q_NULLPTR)); - RBUniforme->setText(QApplication::translate("CreateHypothesis", "Uniform", Q_NULLPTR)); - RBChamp->setText(QApplication::translate("CreateHypothesis", "Driven by a field", Q_NULLPTR)); - RBZone->setText(QApplication::translate("CreateHypothesis", "With geometrical zones", Q_NULLPTR)); - CBGroupe->setText(QApplication::translate("CreateHypothesis", "Filtering with groups", Q_NULLPTR)); - GBUniform->setTitle(QApplication::translate("CreateHypothesis", "Uniform adaptation", Q_NULLPTR)); - RBUniDera->setText(QApplication::translate("CreateHypothesis", "Coarsening", Q_NULLPTR)); - RBUniRaff->setText(QApplication::translate("CreateHypothesis", "Refinement", Q_NULLPTR)); - GBFieldFile->setTitle(QString()); - FieldFile->setText(QApplication::translate("CreateHypothesis", "File of the fields", Q_NULLPTR)); - GBFieldManagement->setTitle(QApplication::translate("CreateHypothesis", "Governing field for the adaptation", Q_NULLPTR)); - FieldName->setText(QApplication::translate("CreateHypothesis", "Field name", Q_NULLPTR)); - QTableWidgetItem *___qtablewidgetitem = TWCMP->horizontalHeaderItem(0); - ___qtablewidgetitem->setText(QApplication::translate("CreateHypothesis", "Selection", Q_NULLPTR)); - QTableWidgetItem *___qtablewidgetitem1 = TWCMP->horizontalHeaderItem(1); - ___qtablewidgetitem1->setText(QApplication::translate("CreateHypothesis", "Component", Q_NULLPTR)); - RBL2->setText(QApplication::translate("CreateHypothesis", "L2 norm", Q_NULLPTR)); - RBInf->setText(QApplication::translate("CreateHypothesis", "Infinite norm", Q_NULLPTR)); - CBJump->setText(QApplication::translate("CreateHypothesis", "Jump between elements", Q_NULLPTR)); - GBRefinementThresholds->setTitle(QApplication::translate("CreateHypothesis", "Refinement threshold", Q_NULLPTR)); - RBRPE->setText(QApplication::translate("CreateHypothesis", "Percentage of meshes", Q_NULLPTR)); - SpinBox_RPE->setSuffix(QApplication::translate("CreateHypothesis", " %", Q_NULLPTR)); - RBRRel->setText(QApplication::translate("CreateHypothesis", "Relative", Q_NULLPTR)); - SpinBox_RRel->setSuffix(QApplication::translate("CreateHypothesis", " %", Q_NULLPTR)); - RBRAbs->setText(QApplication::translate("CreateHypothesis", "Absolute", Q_NULLPTR)); - RBRMuSigma->setText(QApplication::translate("CreateHypothesis", "Mean + n*(std deviation)", Q_NULLPTR)); - RBRNo->setText(QApplication::translate("CreateHypothesis", "No refinement", Q_NULLPTR)); - GBCoarseningThresholds->setTitle(QApplication::translate("CreateHypothesis", "Coarsening threshold", Q_NULLPTR)); - RBCPE->setText(QApplication::translate("CreateHypothesis", "Percentage of meshes", Q_NULLPTR)); - SpinBox_CPE->setSuffix(QApplication::translate("CreateHypothesis", " %", Q_NULLPTR)); - RBCRel->setText(QApplication::translate("CreateHypothesis", "Relative", Q_NULLPTR)); - SpinBox_CRel->setSuffix(QApplication::translate("CreateHypothesis", " %", Q_NULLPTR)); - RBCAbs->setText(QApplication::translate("CreateHypothesis", "Absolute", Q_NULLPTR)); - RBCMuSigma->setText(QApplication::translate("CreateHypothesis", "Mean - n*(std deviation)", Q_NULLPTR)); - RBCNo->setText(QApplication::translate("CreateHypothesis", "No coarsening", Q_NULLPTR)); - GBAreaManagement->setTitle(QApplication::translate("CreateHypothesis", "Zone management", Q_NULLPTR)); - QTableWidgetItem *___qtablewidgetitem2 = TWZone->horizontalHeaderItem(0); - ___qtablewidgetitem2->setText(QApplication::translate("CreateHypothesis", "Refinement", Q_NULLPTR)); - QTableWidgetItem *___qtablewidgetitem3 = TWZone->horizontalHeaderItem(1); - ___qtablewidgetitem3->setText(QApplication::translate("CreateHypothesis", "Coarsening", Q_NULLPTR)); - QTableWidgetItem *___qtablewidgetitem4 = TWZone->horizontalHeaderItem(2); - ___qtablewidgetitem4->setText(QApplication::translate("CreateHypothesis", "Zone name", Q_NULLPTR)); - PBZoneNew->setText(QApplication::translate("CreateHypothesis", "New", Q_NULLPTR)); - PBZoneEdit->setText(QApplication::translate("CreateHypothesis", "Edit", Q_NULLPTR)); - PBZoneDelete->setText(QString()); - GBField->setTitle(QApplication::translate("CreateHypothesis", "Field Interpolation", Q_NULLPTR)); - RBFieldNo->setText(QApplication::translate("CreateHypothesis", "None", Q_NULLPTR)); - RBFieldAll->setText(QApplication::translate("CreateHypothesis", "All", Q_NULLPTR)); - RBFieldChosen->setText(QApplication::translate("CreateHypothesis", "Chosen", Q_NULLPTR)); - QTableWidgetItem *___qtablewidgetitem5 = TWField->horizontalHeaderItem(0); - ___qtablewidgetitem5->setText(QApplication::translate("CreateHypothesis", "Selection", Q_NULLPTR)); - QTableWidgetItem *___qtablewidgetitem6 = TWField->horizontalHeaderItem(1); - ___qtablewidgetitem6->setText(QApplication::translate("CreateHypothesis", "Field Name", Q_NULLPTR)); - CBAdvanced->setText(QApplication::translate("CreateHypothesis", "Advanced options", Q_NULLPTR)); - GBAdvancedOptions->setTitle(QApplication::translate("CreateHypothesis", "Advanced options", Q_NULLPTR)); - TLMinimalDiameter->setText(QApplication::translate("CreateHypothesis", "Minimal diameter", Q_NULLPTR)); - TLMaximalLevel->setText(QApplication::translate("CreateHypothesis", "Maximal level", Q_NULLPTR)); - GBAdapInit->setTitle(QApplication::translate("CreateHypothesis", "Initialization of adaptation", Q_NULLPTR)); - RBAIN->setText(QApplication::translate("CreateHypothesis", "Nothing", Q_NULLPTR)); - RBAIR->setText(QApplication::translate("CreateHypothesis", "Refinement", Q_NULLPTR)); - RBAID->setText(QApplication::translate("CreateHypothesis", "Coarsening", Q_NULLPTR)); - CBOutputLevel->setText(QApplication::translate("CreateHypothesis", "Output of the level of refinement", Q_NULLPTR)); - CBOutputQuality->setText(QApplication::translate("CreateHypothesis", "Output of the qualities", Q_NULLPTR)); - CBOutputDiameter->setText(QApplication::translate("CreateHypothesis", "Output of the diameters", Q_NULLPTR)); - CBOutputParent->setText(QApplication::translate("CreateHypothesis", "Output of the parents", Q_NULLPTR)); - CBOutputVoisins->setText(QApplication::translate("CreateHypothesis", "Output of the neighbours", Q_NULLPTR)); - GBButtons->setTitle(QString()); - buttonOk->setText(QApplication::translate("CreateHypothesis", "OK", Q_NULLPTR)); - buttonApply->setText(QApplication::translate("CreateHypothesis", "Apply", Q_NULLPTR)); - buttonCancel->setText(QApplication::translate("CreateHypothesis", "Cancel", Q_NULLPTR)); - buttonHelp->setText(QApplication::translate("CreateHypothesis", "Help", Q_NULLPTR)); - } // retranslateUi - -}; - -namespace Ui { - class CreateHypothesis: public Ui_CreateHypothesis {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_CREATEHYPOTHESIS_H diff --git a/src/ADAPTGUI/ui_CreateIteration.h b/src/ADAPTGUI/ui_CreateIteration.h deleted file mode 100644 index 704342a58..000000000 --- a/src/ADAPTGUI/ui_CreateIteration.h +++ /dev/null @@ -1,416 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'CreateIteration.ui' -** -** Created by: Qt User Interface Compiler version 5.9.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_CREATEITERATION_H -#define UI_CREATEITERATION_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_CreateIteration -{ -public: - QWidget *scrollAreaWidgetContents; - QGridLayout *gridLayout; - QLabel *Iteration_Name; - QSpacerItem *horizontalSpacer_6; - QLineEdit *LEName; - QSpacerItem *horizontalSpacer_3; - QLabel *Iter_Parent; - QPushButton *PBIterParent; - QLineEdit *LEIterationParentName; - QLabel *Mesh_n; - QSpacerItem *horizontalSpacer_7; - QLineEdit *LEMeshName_n; - QSpacerItem *horizontalSpacer_4; - QLabel *Mesh_np1; - QSpacerItem *horizontalSpacer_8; - QLineEdit *LEMeshName_np1; - QSpacerItem *horizontalSpacer_5; - QSpacerItem *verticalSpacer; - QGroupBox *GBField; - QGridLayout *gridLayout1; - QLineEdit *LEFieldFile; - QSpacerItem *spacerItem; - QRadioButton *RBChosen; - QSpacerItem *spacerItem1; - QSpinBox *SpinBox_Rank; - QLabel *Rank; - QSpacerItem *spacerItem2; - QSpinBox *SpinBox_TimeStep; - QLabel *TimeStep; - QSpacerItem *spacerItem3; - QRadioButton *RBLast; - QRadioButton *RBNo; - QPushButton *PushFieldFile; - QLabel *FieldFile; - QSpacerItem *horizontalSpacer_10; - QSpacerItem *spacerItem4; - QGroupBox *Hypothese; - QGridLayout *gridLayout2; - QComboBox *CBHypothese; - QSpacerItem *spacerItem5; - QPushButton *PBHypoEdit; - QPushButton *PBHypoNew; - QSpacerItem *horizontalSpacer_2; - QSpacerItem *spacerItem6; - QGroupBox *GroupButtons; - QGridLayout *gridLayout3; - QPushButton *buttonOk; - QPushButton *buttonApply; - QPushButton *buttonCancel; - QPushButton *buttonHelp; - QSpacerItem *horizontalSpacer; - QSpacerItem *horizontalSpacer_9; - - void setupUi(QScrollArea *CreateIteration) - { - if (CreateIteration->objectName().isEmpty()) - CreateIteration->setObjectName(QStringLiteral("CreateIteration")); - CreateIteration->resize(777, 668); - QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(CreateIteration->sizePolicy().hasHeightForWidth()); - CreateIteration->setSizePolicy(sizePolicy); - CreateIteration->setMinimumSize(QSize(750, 400)); - CreateIteration->setSizeIncrement(QSize(1, 1)); - CreateIteration->setBaseSize(QSize(750, 400)); - CreateIteration->setWidgetResizable(true); - scrollAreaWidgetContents = new QWidget(); - scrollAreaWidgetContents->setObjectName(QStringLiteral("scrollAreaWidgetContents")); - scrollAreaWidgetContents->setGeometry(QRect(0, 0, 773, 664)); - scrollAreaWidgetContents->setProperty("sizeGripEnabled", QVariant(true)); - gridLayout = new QGridLayout(scrollAreaWidgetContents); - gridLayout->setObjectName(QStringLiteral("gridLayout")); - Iteration_Name = new QLabel(scrollAreaWidgetContents); - Iteration_Name->setObjectName(QStringLiteral("Iteration_Name")); - - gridLayout->addWidget(Iteration_Name, 0, 0, 1, 2); - - horizontalSpacer_6 = new QSpacerItem(117, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout->addItem(horizontalSpacer_6, 0, 2, 1, 1); - - LEName = new QLineEdit(scrollAreaWidgetContents); - LEName->setObjectName(QStringLiteral("LEName")); - LEName->setMinimumSize(QSize(290, 21)); - LEName->setMaxLength(64); - - gridLayout->addWidget(LEName, 0, 3, 1, 2); - - horizontalSpacer_3 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout->addItem(horizontalSpacer_3, 0, 5, 1, 1); - - Iter_Parent = new QLabel(scrollAreaWidgetContents); - Iter_Parent->setObjectName(QStringLiteral("Iter_Parent")); - - gridLayout->addWidget(Iter_Parent, 1, 0, 1, 2); - - PBIterParent = new QPushButton(scrollAreaWidgetContents); - PBIterParent->setObjectName(QStringLiteral("PBIterParent")); - PBIterParent->setEnabled(true); - PBIterParent->setMaximumSize(QSize(50, 27)); - - gridLayout->addWidget(PBIterParent, 1, 2, 1, 1); - - LEIterationParentName = new QLineEdit(scrollAreaWidgetContents); - LEIterationParentName->setObjectName(QStringLiteral("LEIterationParentName")); - LEIterationParentName->setMinimumSize(QSize(0, 21)); - LEIterationParentName->setMaxLength(64); - LEIterationParentName->setReadOnly(true); - - gridLayout->addWidget(LEIterationParentName, 1, 3, 1, 2); - - Mesh_n = new QLabel(scrollAreaWidgetContents); - Mesh_n->setObjectName(QStringLiteral("Mesh_n")); - - gridLayout->addWidget(Mesh_n, 2, 0, 1, 1); - - horizontalSpacer_7 = new QSpacerItem(117, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout->addItem(horizontalSpacer_7, 2, 2, 1, 1); - - LEMeshName_n = new QLineEdit(scrollAreaWidgetContents); - LEMeshName_n->setObjectName(QStringLiteral("LEMeshName_n")); - LEMeshName_n->setMinimumSize(QSize(290, 21)); - LEMeshName_n->setMaxLength(64); - LEMeshName_n->setReadOnly(true); - - gridLayout->addWidget(LEMeshName_n, 2, 3, 1, 3); - - horizontalSpacer_4 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout->addItem(horizontalSpacer_4, 2, 6, 1, 1); - - Mesh_np1 = new QLabel(scrollAreaWidgetContents); - Mesh_np1->setObjectName(QStringLiteral("Mesh_np1")); - - gridLayout->addWidget(Mesh_np1, 3, 0, 1, 2); - - horizontalSpacer_8 = new QSpacerItem(117, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout->addItem(horizontalSpacer_8, 3, 2, 1, 1); - - LEMeshName_np1 = new QLineEdit(scrollAreaWidgetContents); - LEMeshName_np1->setObjectName(QStringLiteral("LEMeshName_np1")); - LEMeshName_np1->setMinimumSize(QSize(290, 21)); - LEMeshName_np1->setMaxLength(64); - - gridLayout->addWidget(LEMeshName_np1, 3, 3, 1, 3); - - horizontalSpacer_5 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout->addItem(horizontalSpacer_5, 3, 6, 1, 1); - - verticalSpacer = new QSpacerItem(20, 62, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout->addItem(verticalSpacer, 4, 0, 1, 1); - - GBField = new QGroupBox(scrollAreaWidgetContents); - GBField->setObjectName(QStringLiteral("GBField")); - gridLayout1 = new QGridLayout(GBField); -#ifndef Q_OS_MAC - gridLayout1->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout1->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout1->setObjectName(QStringLiteral("gridLayout1")); - LEFieldFile = new QLineEdit(GBField); - LEFieldFile->setObjectName(QStringLiteral("LEFieldFile")); - LEFieldFile->setMinimumSize(QSize(282, 21)); - - gridLayout1->addWidget(LEFieldFile, 0, 2, 1, 5); - - spacerItem = new QSpacerItem(138, 18, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout1->addItem(spacerItem, 1, 3, 1, 4); - - RBChosen = new QRadioButton(GBField); - RBChosen->setObjectName(QStringLiteral("RBChosen")); - - gridLayout1->addWidget(RBChosen, 2, 6, 1, 1); - - spacerItem1 = new QSpacerItem(255, 13, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout1->addItem(spacerItem1, 4, 6, 1, 1); - - SpinBox_Rank = new QSpinBox(GBField); - SpinBox_Rank->setObjectName(QStringLiteral("SpinBox_Rank")); - SpinBox_Rank->setMinimum(-1); - SpinBox_Rank->setMaximum(1010000); - SpinBox_Rank->setValue(-1); - - gridLayout1->addWidget(SpinBox_Rank, 4, 5, 1, 1); - - Rank = new QLabel(GBField); - Rank->setObjectName(QStringLiteral("Rank")); - - gridLayout1->addWidget(Rank, 4, 4, 1, 1); - - spacerItem2 = new QSpacerItem(40, 13, QSizePolicy::Fixed, QSizePolicy::Minimum); - - gridLayout1->addItem(spacerItem2, 4, 2, 1, 2); - - SpinBox_TimeStep = new QSpinBox(GBField); - SpinBox_TimeStep->setObjectName(QStringLiteral("SpinBox_TimeStep")); - SpinBox_TimeStep->setMinimum(-2); - SpinBox_TimeStep->setMaximum(100000); - SpinBox_TimeStep->setValue(-1); - - gridLayout1->addWidget(SpinBox_TimeStep, 4, 1, 1, 1); - - TimeStep = new QLabel(GBField); - TimeStep->setObjectName(QStringLiteral("TimeStep")); - - gridLayout1->addWidget(TimeStep, 4, 0, 1, 1); - - spacerItem3 = new QSpacerItem(138, 28, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout1->addItem(spacerItem3, 3, 0, 1, 4); - - RBLast = new QRadioButton(GBField); - RBLast->setObjectName(QStringLiteral("RBLast")); - - gridLayout1->addWidget(RBLast, 2, 3, 1, 3); - - RBNo = new QRadioButton(GBField); - RBNo->setObjectName(QStringLiteral("RBNo")); - RBNo->setCheckable(true); - RBNo->setChecked(true); - - gridLayout1->addWidget(RBNo, 2, 0, 1, 3); - - PushFieldFile = new QPushButton(GBField); - PushFieldFile->setObjectName(QStringLiteral("PushFieldFile")); - - gridLayout1->addWidget(PushFieldFile, 0, 1, 1, 1); - - FieldFile = new QLabel(GBField); - FieldFile->setObjectName(QStringLiteral("FieldFile")); - - gridLayout1->addWidget(FieldFile, 0, 0, 1, 1); - - - gridLayout->addWidget(GBField, 5, 0, 1, 6); - - horizontalSpacer_10 = new QSpacerItem(69, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout->addItem(horizontalSpacer_10, 5, 6, 1, 1); - - spacerItem4 = new QSpacerItem(20, 22, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout->addItem(spacerItem4, 6, 0, 1, 1); - - Hypothese = new QGroupBox(scrollAreaWidgetContents); - Hypothese->setObjectName(QStringLiteral("Hypothese")); - gridLayout2 = new QGridLayout(Hypothese); -#ifndef Q_OS_MAC - gridLayout2->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout2->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout2->setObjectName(QStringLiteral("gridLayout2")); - CBHypothese = new QComboBox(Hypothese); - CBHypothese->setObjectName(QStringLiteral("CBHypothese")); - CBHypothese->setSizeAdjustPolicy(QComboBox::AdjustToContents); - - gridLayout2->addWidget(CBHypothese, 0, 0, 1, 1); - - spacerItem5 = new QSpacerItem(40, 13, QSizePolicy::Fixed, QSizePolicy::Minimum); - - gridLayout2->addItem(spacerItem5, 0, 1, 1, 1); - - PBHypoEdit = new QPushButton(Hypothese); - PBHypoEdit->setObjectName(QStringLiteral("PBHypoEdit")); - - gridLayout2->addWidget(PBHypoEdit, 0, 2, 1, 1); - - PBHypoNew = new QPushButton(Hypothese); - PBHypoNew->setObjectName(QStringLiteral("PBHypoNew")); - - gridLayout2->addWidget(PBHypoNew, 0, 3, 1, 1); - - - gridLayout->addWidget(Hypothese, 7, 0, 1, 4); - - horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout->addItem(horizontalSpacer_2, 7, 4, 1, 2); - - spacerItem6 = new QSpacerItem(20, 21, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout->addItem(spacerItem6, 8, 1, 1, 1); - - GroupButtons = new QGroupBox(scrollAreaWidgetContents); - GroupButtons->setObjectName(QStringLiteral("GroupButtons")); - gridLayout3 = new QGridLayout(GroupButtons); -#ifndef Q_OS_MAC - gridLayout3->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout3->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout3->setObjectName(QStringLiteral("gridLayout3")); - buttonOk = new QPushButton(GroupButtons); - buttonOk->setObjectName(QStringLiteral("buttonOk")); - buttonOk->setAutoDefault(false); - - gridLayout3->addWidget(buttonOk, 0, 0, 1, 1); - - buttonApply = new QPushButton(GroupButtons); - buttonApply->setObjectName(QStringLiteral("buttonApply")); - - gridLayout3->addWidget(buttonApply, 0, 1, 1, 1); - - buttonCancel = new QPushButton(GroupButtons); - buttonCancel->setObjectName(QStringLiteral("buttonCancel")); - - gridLayout3->addWidget(buttonCancel, 0, 2, 1, 1); - - buttonHelp = new QPushButton(GroupButtons); - buttonHelp->setObjectName(QStringLiteral("buttonHelp")); - - gridLayout3->addWidget(buttonHelp, 0, 3, 1, 1); - - - gridLayout->addWidget(GroupButtons, 9, 0, 1, 4); - - horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout->addItem(horizontalSpacer, 9, 4, 1, 2); - - horizontalSpacer_9 = new QSpacerItem(139, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout->addItem(horizontalSpacer_9, 1, 5, 1, 1); - - CreateIteration->setWidget(scrollAreaWidgetContents); - - retranslateUi(CreateIteration); - - CBHypothese->setCurrentIndex(-1); - buttonOk->setDefault(false); - - - QMetaObject::connectSlotsByName(CreateIteration); - } // setupUi - - void retranslateUi(QScrollArea *CreateIteration) - { - CreateIteration->setWindowTitle(QApplication::translate("CreateIteration", "Create an iteration", Q_NULLPTR)); - Iteration_Name->setText(QApplication::translate("CreateIteration", "Iteration Name", Q_NULLPTR)); - Iter_Parent->setText(QApplication::translate("CreateIteration", "Previous iteration", Q_NULLPTR)); - PBIterParent->setText(QString()); - Mesh_n->setText(QApplication::translate("CreateIteration", "Mesh n", Q_NULLPTR)); - Mesh_np1->setText(QApplication::translate("CreateIteration", "Mesh n+1", Q_NULLPTR)); - GBField->setTitle(QApplication::translate("CreateIteration", "Field information", Q_NULLPTR)); - RBChosen->setText(QApplication::translate("CreateIteration", "Chosen time step", Q_NULLPTR)); - Rank->setText(QApplication::translate("CreateIteration", "Rank", Q_NULLPTR)); - TimeStep->setText(QApplication::translate("CreateIteration", "Time step", Q_NULLPTR)); - RBLast->setText(QApplication::translate("CreateIteration", "Last time step", Q_NULLPTR)); - RBNo->setText(QApplication::translate("CreateIteration", "No time step", Q_NULLPTR)); - PushFieldFile->setText(QString()); - FieldFile->setText(QApplication::translate("CreateIteration", "Field file", Q_NULLPTR)); - Hypothese->setTitle(QApplication::translate("CreateIteration", "Hypothesis", Q_NULLPTR)); - PBHypoEdit->setText(QApplication::translate("CreateIteration", "Edit", Q_NULLPTR)); - PBHypoNew->setText(QApplication::translate("CreateIteration", "New", Q_NULLPTR)); - GroupButtons->setTitle(QString()); - buttonOk->setText(QApplication::translate("CreateIteration", "OK", Q_NULLPTR)); - buttonApply->setText(QApplication::translate("CreateIteration", "Apply", Q_NULLPTR)); - buttonCancel->setText(QApplication::translate("CreateIteration", "Cancel", Q_NULLPTR)); - buttonHelp->setText(QApplication::translate("CreateIteration", "Help", Q_NULLPTR)); - } // retranslateUi - -}; - -namespace Ui { - class CreateIteration: public Ui_CreateIteration {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_CREATEITERATION_H diff --git a/src/ADAPTGUI/ui_CreateListGroup.h b/src/ADAPTGUI/ui_CreateListGroup.h deleted file mode 100644 index deb244bd1..000000000 --- a/src/ADAPTGUI/ui_CreateListGroup.h +++ /dev/null @@ -1,148 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'CreateListGroup.ui' -** -** Created by: Qt User Interface Compiler version 5.9.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_CREATELISTGROUP_H -#define UI_CREATELISTGROUP_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_CreateListGroup -{ -public: - QGridLayout *gridLayout; - QGroupBox *GBButtons; - QGridLayout *gridLayout1; - QPushButton *buttonHelp; - QPushButton *buttonCancel; - QPushButton *buttonApply; - QPushButton *buttonOk; - QGroupBox *GBOptions; - QGridLayout *gridLayout2; - QTableWidget *TWGroupe; - - void setupUi(QDialog *CreateListGroup) - { - if (CreateListGroup->objectName().isEmpty()) - CreateListGroup->setObjectName(QStringLiteral("CreateListGroup")); - CreateListGroup->resize(717, 600); - QSizePolicy sizePolicy(static_cast(0), static_cast(0)); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(CreateListGroup->sizePolicy().hasHeightForWidth()); - CreateListGroup->setSizePolicy(sizePolicy); - CreateListGroup->setAutoFillBackground(true); - CreateListGroup->setSizeGripEnabled(true); - gridLayout = new QGridLayout(CreateListGroup); -#ifndef Q_OS_MAC - gridLayout->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout->setObjectName(QStringLiteral("gridLayout")); - GBButtons = new QGroupBox(CreateListGroup); - GBButtons->setObjectName(QStringLiteral("GBButtons")); - gridLayout1 = new QGridLayout(GBButtons); -#ifndef Q_OS_MAC - gridLayout1->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout1->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout1->setObjectName(QStringLiteral("gridLayout1")); - buttonHelp = new QPushButton(GBButtons); - buttonHelp->setObjectName(QStringLiteral("buttonHelp")); - - gridLayout1->addWidget(buttonHelp, 0, 3, 1, 1); - - buttonCancel = new QPushButton(GBButtons); - buttonCancel->setObjectName(QStringLiteral("buttonCancel")); - - gridLayout1->addWidget(buttonCancel, 0, 2, 1, 1); - - buttonApply = new QPushButton(GBButtons); - buttonApply->setObjectName(QStringLiteral("buttonApply")); - - gridLayout1->addWidget(buttonApply, 0, 1, 1, 1); - - buttonOk = new QPushButton(GBButtons); - buttonOk->setObjectName(QStringLiteral("buttonOk")); - - gridLayout1->addWidget(buttonOk, 0, 0, 1, 1); - - - gridLayout->addWidget(GBButtons, 1, 0, 1, 1); - - GBOptions = new QGroupBox(CreateListGroup); - GBOptions->setObjectName(QStringLiteral("GBOptions")); - gridLayout2 = new QGridLayout(GBOptions); -#ifndef Q_OS_MAC - gridLayout2->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout2->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout2->setObjectName(QStringLiteral("gridLayout2")); - TWGroupe = new QTableWidget(GBOptions); - if (TWGroupe->columnCount() < 2) - TWGroupe->setColumnCount(2); - QTableWidgetItem *__qtablewidgetitem = new QTableWidgetItem(); - TWGroupe->setHorizontalHeaderItem(0, __qtablewidgetitem); - QTableWidgetItem *__qtablewidgetitem1 = new QTableWidgetItem(); - TWGroupe->setHorizontalHeaderItem(1, __qtablewidgetitem1); - TWGroupe->setObjectName(QStringLiteral("TWGroupe")); - TWGroupe->setShowGrid(true); - TWGroupe->setRowCount(0); - TWGroupe->setColumnCount(2); - - gridLayout2->addWidget(TWGroupe, 0, 0, 1, 1); - - - gridLayout->addWidget(GBOptions, 0, 0, 1, 1); - - - retranslateUi(CreateListGroup); - - QMetaObject::connectSlotsByName(CreateListGroup); - } // setupUi - - void retranslateUi(QDialog *CreateListGroup) - { - CreateListGroup->setWindowTitle(QApplication::translate("CreateListGroup", "Selection of groups", Q_NULLPTR)); - GBButtons->setTitle(QString()); - buttonHelp->setText(QApplication::translate("CreateListGroup", "Help", Q_NULLPTR)); - buttonCancel->setText(QApplication::translate("CreateListGroup", "Cancel", Q_NULLPTR)); - buttonApply->setText(QApplication::translate("CreateListGroup", "Apply", Q_NULLPTR)); - buttonOk->setText(QApplication::translate("CreateListGroup", "OK", Q_NULLPTR)); - GBOptions->setTitle(QApplication::translate("CreateListGroup", "Selected groups", Q_NULLPTR)); - QTableWidgetItem *___qtablewidgetitem = TWGroupe->horizontalHeaderItem(0); - ___qtablewidgetitem->setText(QApplication::translate("CreateListGroup", "Selection", Q_NULLPTR)); - QTableWidgetItem *___qtablewidgetitem1 = TWGroupe->horizontalHeaderItem(1); - ___qtablewidgetitem1->setText(QApplication::translate("CreateListGroup", "Group", Q_NULLPTR)); - } // retranslateUi - -}; - -namespace Ui { - class CreateListGroup: public Ui_CreateListGroup {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_CREATELISTGROUP_H diff --git a/src/ADAPTGUI/ui_CreateYACS.h b/src/ADAPTGUI/ui_CreateYACS.h deleted file mode 100644 index 43635eef7..000000000 --- a/src/ADAPTGUI/ui_CreateYACS.h +++ /dev/null @@ -1,445 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'CreateYACS.ui' -** -** Created by: Qt User Interface Compiler version 5.9.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_CREATEYACS_H -#define UI_CREATEYACS_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_CreateYACS -{ -public: - QWidget *scrollAreaWidgetContents; - QGridLayout *gridLayout_5; - QWidget *WName; - QGridLayout *gridLayout_2; - QLabel *Name; - QLineEdit *LEName; - QSpacerItem *horizontalSpacer; - QGridLayout *gridLayout; - QLabel *Case; - QPushButton *PBCaseName; - QLineEdit *LECaseName; - QHBoxLayout *_2; - QLabel *Script; - QPushButton *PBScriptFile; - QLineEdit *LEScriptFile; - QHBoxLayout *hboxLayout; - QLabel *DirectoryStart; - QPushButton *PBDir; - QLineEdit *LEDirName; - QHBoxLayout *_3; - QLabel *MeshFile; - QPushButton *PBMeshFile; - QLineEdit *LEMeshFile; - QGroupBox *GBTypeSchema; - QHBoxLayout *_4; - QRadioButton *RBConstant; - QRadioButton *RBVariable; - QGroupBox *GBMax; - QGridLayout *gridLayout_3; - QLabel *TLMaxIteration; - QSpinBox *SpinBoxMaxIter; - QLabel *TLMaxNodes; - QSpinBox *SpinBoxMaxNode; - QLabel *TLMaxElem; - QSpinBox *SpinBoxMaxElem; - QSpacerItem *horizontalSpacer_2; - QGroupBox *GBConvergence; - QGridLayout *gridLayout_4; - QRadioButton *RBNone; - QRadioButton *RBVMinAbs; - QRadioButton *RBVMaxAbs; - QLabel *labelVref; - QDoubleSpinBox *doubleSpinBoxConvergence; - QSpacerItem *horizontalSpacer_3; - QGroupBox *GroupButtons; - QGridLayout *gridLayout1; - QPushButton *buttonHelp; - QPushButton *buttonApply; - QPushButton *buttonOk; - QPushButton *buttonCancel; - QSpacerItem *spacer_2; - - void setupUi(QScrollArea *CreateYACS) - { - if (CreateYACS->objectName().isEmpty()) - CreateYACS->setObjectName(QStringLiteral("CreateYACS")); - CreateYACS->resize(684, 649); - QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(CreateYACS->sizePolicy().hasHeightForWidth()); - CreateYACS->setSizePolicy(sizePolicy); - CreateYACS->setMinimumSize(QSize(600, 500)); - CreateYACS->setSizeIncrement(QSize(1, 1)); - CreateYACS->setBaseSize(QSize(600, 500)); - CreateYACS->setWidgetResizable(true); - scrollAreaWidgetContents = new QWidget(); - scrollAreaWidgetContents->setObjectName(QStringLiteral("scrollAreaWidgetContents")); - scrollAreaWidgetContents->setGeometry(QRect(0, 0, 680, 645)); - scrollAreaWidgetContents->setProperty("sizeGripEnabled", QVariant(true)); - gridLayout_5 = new QGridLayout(scrollAreaWidgetContents); - gridLayout_5->setObjectName(QStringLiteral("gridLayout_5")); - WName = new QWidget(scrollAreaWidgetContents); - WName->setObjectName(QStringLiteral("WName")); - gridLayout_2 = new QGridLayout(WName); - gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); - Name = new QLabel(WName); - Name->setObjectName(QStringLiteral("Name")); - - gridLayout_2->addWidget(Name, 0, 0, 1, 1); - - LEName = new QLineEdit(WName); - LEName->setObjectName(QStringLiteral("LEName")); - LEName->setMaxLength(32); - - gridLayout_2->addWidget(LEName, 0, 1, 1, 1); - - - gridLayout_5->addWidget(WName, 0, 0, 1, 1); - - horizontalSpacer = new QSpacerItem(131, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout_5->addItem(horizontalSpacer, 0, 1, 1, 1); - - gridLayout = new QGridLayout(); - gridLayout->setObjectName(QStringLiteral("gridLayout")); - Case = new QLabel(scrollAreaWidgetContents); - Case->setObjectName(QStringLiteral("Case")); - - gridLayout->addWidget(Case, 0, 0, 1, 1); - - PBCaseName = new QPushButton(scrollAreaWidgetContents); - PBCaseName->setObjectName(QStringLiteral("PBCaseName")); - PBCaseName->setEnabled(true); - PBCaseName->setMaximumSize(QSize(50, 27)); - - gridLayout->addWidget(PBCaseName, 0, 1, 1, 1); - - LECaseName = new QLineEdit(scrollAreaWidgetContents); - LECaseName->setObjectName(QStringLiteral("LECaseName")); - LECaseName->setMinimumSize(QSize(382, 21)); - - gridLayout->addWidget(LECaseName, 0, 2, 1, 1); - - - gridLayout_5->addLayout(gridLayout, 1, 0, 1, 2); - - _2 = new QHBoxLayout(); -#ifndef Q_OS_MAC - _2->setSpacing(6); -#endif - _2->setContentsMargins(0, 0, 0, 0); - _2->setObjectName(QStringLiteral("_2")); - Script = new QLabel(scrollAreaWidgetContents); - Script->setObjectName(QStringLiteral("Script")); - - _2->addWidget(Script); - - PBScriptFile = new QPushButton(scrollAreaWidgetContents); - PBScriptFile->setObjectName(QStringLiteral("PBScriptFile")); - PBScriptFile->setAutoDefault(false); - - _2->addWidget(PBScriptFile); - - LEScriptFile = new QLineEdit(scrollAreaWidgetContents); - LEScriptFile->setObjectName(QStringLiteral("LEScriptFile")); - LEScriptFile->setMinimumSize(QSize(382, 21)); - - _2->addWidget(LEScriptFile); - - - gridLayout_5->addLayout(_2, 2, 0, 1, 2); - - hboxLayout = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout->setSpacing(6); -#endif - hboxLayout->setContentsMargins(0, 0, 0, 0); - hboxLayout->setObjectName(QStringLiteral("hboxLayout")); - DirectoryStart = new QLabel(scrollAreaWidgetContents); - DirectoryStart->setObjectName(QStringLiteral("DirectoryStart")); - - hboxLayout->addWidget(DirectoryStart); - - PBDir = new QPushButton(scrollAreaWidgetContents); - PBDir->setObjectName(QStringLiteral("PBDir")); - PBDir->setAutoDefault(false); - - hboxLayout->addWidget(PBDir); - - LEDirName = new QLineEdit(scrollAreaWidgetContents); - LEDirName->setObjectName(QStringLiteral("LEDirName")); - LEDirName->setMinimumSize(QSize(382, 21)); - - hboxLayout->addWidget(LEDirName); - - - gridLayout_5->addLayout(hboxLayout, 3, 0, 1, 2); - - _3 = new QHBoxLayout(); -#ifndef Q_OS_MAC - _3->setSpacing(6); -#endif - _3->setContentsMargins(0, 0, 0, 0); - _3->setObjectName(QStringLiteral("_3")); - MeshFile = new QLabel(scrollAreaWidgetContents); - MeshFile->setObjectName(QStringLiteral("MeshFile")); - - _3->addWidget(MeshFile); - - PBMeshFile = new QPushButton(scrollAreaWidgetContents); - PBMeshFile->setObjectName(QStringLiteral("PBMeshFile")); - PBMeshFile->setAutoDefault(false); - - _3->addWidget(PBMeshFile); - - LEMeshFile = new QLineEdit(scrollAreaWidgetContents); - LEMeshFile->setObjectName(QStringLiteral("LEMeshFile")); - LEMeshFile->setMinimumSize(QSize(382, 21)); - - _3->addWidget(LEMeshFile); - - - gridLayout_5->addLayout(_3, 4, 0, 1, 2); - - GBTypeSchema = new QGroupBox(scrollAreaWidgetContents); - GBTypeSchema->setObjectName(QStringLiteral("GBTypeSchema")); - _4 = new QHBoxLayout(GBTypeSchema); -#ifndef Q_OS_MAC - _4->setSpacing(6); -#endif -#ifndef Q_OS_MAC - _4->setContentsMargins(9, 9, 9, 9); -#endif - _4->setObjectName(QStringLiteral("_4")); - RBConstant = new QRadioButton(GBTypeSchema); - RBConstant->setObjectName(QStringLiteral("RBConstant")); - RBConstant->setChecked(true); - - _4->addWidget(RBConstant); - - RBVariable = new QRadioButton(GBTypeSchema); - RBVariable->setObjectName(QStringLiteral("RBVariable")); - - _4->addWidget(RBVariable); - - - gridLayout_5->addWidget(GBTypeSchema, 5, 0, 1, 1); - - GBMax = new QGroupBox(scrollAreaWidgetContents); - GBMax->setObjectName(QStringLiteral("GBMax")); - gridLayout_3 = new QGridLayout(GBMax); - gridLayout_3->setObjectName(QStringLiteral("gridLayout_3")); - TLMaxIteration = new QLabel(GBMax); - TLMaxIteration->setObjectName(QStringLiteral("TLMaxIteration")); - QSizePolicy sizePolicy1(QSizePolicy::Fixed, QSizePolicy::Fixed); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(TLMaxIteration->sizePolicy().hasHeightForWidth()); - TLMaxIteration->setSizePolicy(sizePolicy1); - TLMaxIteration->setWordWrap(false); - - gridLayout_3->addWidget(TLMaxIteration, 0, 0, 1, 1); - - SpinBoxMaxIter = new QSpinBox(GBMax); - SpinBoxMaxIter->setObjectName(QStringLiteral("SpinBoxMaxIter")); - SpinBoxMaxIter->setMinimum(0); - SpinBoxMaxIter->setMaximum(999999999); - SpinBoxMaxIter->setValue(0); - - gridLayout_3->addWidget(SpinBoxMaxIter, 0, 1, 1, 1); - - TLMaxNodes = new QLabel(GBMax); - TLMaxNodes->setObjectName(QStringLiteral("TLMaxNodes")); - sizePolicy1.setHeightForWidth(TLMaxNodes->sizePolicy().hasHeightForWidth()); - TLMaxNodes->setSizePolicy(sizePolicy1); - TLMaxNodes->setWordWrap(false); - - gridLayout_3->addWidget(TLMaxNodes, 1, 0, 1, 1); - - SpinBoxMaxNode = new QSpinBox(GBMax); - SpinBoxMaxNode->setObjectName(QStringLiteral("SpinBoxMaxNode")); - SpinBoxMaxNode->setMinimum(0); - SpinBoxMaxNode->setMaximum(999999999); - SpinBoxMaxNode->setSingleStep(1000); - SpinBoxMaxNode->setValue(0); - - gridLayout_3->addWidget(SpinBoxMaxNode, 1, 1, 1, 1); - - TLMaxElem = new QLabel(GBMax); - TLMaxElem->setObjectName(QStringLiteral("TLMaxElem")); - sizePolicy1.setHeightForWidth(TLMaxElem->sizePolicy().hasHeightForWidth()); - TLMaxElem->setSizePolicy(sizePolicy1); - TLMaxElem->setWordWrap(false); - - gridLayout_3->addWidget(TLMaxElem, 1, 2, 1, 1); - - SpinBoxMaxElem = new QSpinBox(GBMax); - SpinBoxMaxElem->setObjectName(QStringLiteral("SpinBoxMaxElem")); - SpinBoxMaxElem->setMinimum(0); - SpinBoxMaxElem->setMaximum(999999999); - SpinBoxMaxElem->setSingleStep(1000); - SpinBoxMaxElem->setValue(0); - - gridLayout_3->addWidget(SpinBoxMaxElem, 1, 3, 1, 1); - - - gridLayout_5->addWidget(GBMax, 6, 0, 1, 1); - - horizontalSpacer_2 = new QSpacerItem(269, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout_5->addItem(horizontalSpacer_2, 6, 1, 1, 1); - - GBConvergence = new QGroupBox(scrollAreaWidgetContents); - GBConvergence->setObjectName(QStringLiteral("GBConvergence")); - gridLayout_4 = new QGridLayout(GBConvergence); - gridLayout_4->setObjectName(QStringLiteral("gridLayout_4")); - RBNone = new QRadioButton(GBConvergence); - RBNone->setObjectName(QStringLiteral("RBNone")); - RBNone->setChecked(true); - - gridLayout_4->addWidget(RBNone, 0, 0, 1, 1); - - RBVMinAbs = new QRadioButton(GBConvergence); - RBVMinAbs->setObjectName(QStringLiteral("RBVMinAbs")); - - gridLayout_4->addWidget(RBVMinAbs, 0, 1, 1, 1); - - RBVMaxAbs = new QRadioButton(GBConvergence); - RBVMaxAbs->setObjectName(QStringLiteral("RBVMaxAbs")); - - gridLayout_4->addWidget(RBVMaxAbs, 0, 2, 1, 1); - - labelVref = new QLabel(GBConvergence); - labelVref->setObjectName(QStringLiteral("labelVref")); - - gridLayout_4->addWidget(labelVref, 1, 0, 1, 1); - - doubleSpinBoxConvergence = new QDoubleSpinBox(GBConvergence); - doubleSpinBoxConvergence->setObjectName(QStringLiteral("doubleSpinBoxConvergence")); - doubleSpinBoxConvergence->setDecimals(4); - doubleSpinBoxConvergence->setMinimum(-1e+9); - doubleSpinBoxConvergence->setMaximum(1e+9); - - gridLayout_4->addWidget(doubleSpinBoxConvergence, 1, 1, 1, 1); - - - gridLayout_5->addWidget(GBConvergence, 7, 0, 1, 1); - - horizontalSpacer_3 = new QSpacerItem(269, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout_5->addItem(horizontalSpacer_3, 7, 1, 1, 1); - - GroupButtons = new QGroupBox(scrollAreaWidgetContents); - GroupButtons->setObjectName(QStringLiteral("GroupButtons")); - gridLayout1 = new QGridLayout(GroupButtons); -#ifndef Q_OS_MAC - gridLayout1->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout1->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout1->setObjectName(QStringLiteral("gridLayout1")); - buttonHelp = new QPushButton(GroupButtons); - buttonHelp->setObjectName(QStringLiteral("buttonHelp")); - buttonHelp->setAutoDefault(false); - - gridLayout1->addWidget(buttonHelp, 0, 4, 1, 1); - - buttonApply = new QPushButton(GroupButtons); - buttonApply->setObjectName(QStringLiteral("buttonApply")); - buttonApply->setAutoDefault(false); - - gridLayout1->addWidget(buttonApply, 0, 1, 1, 1); - - buttonOk = new QPushButton(GroupButtons); - buttonOk->setObjectName(QStringLiteral("buttonOk")); - buttonOk->setAutoDefault(false); - - gridLayout1->addWidget(buttonOk, 0, 0, 1, 1); - - buttonCancel = new QPushButton(GroupButtons); - buttonCancel->setObjectName(QStringLiteral("buttonCancel")); - buttonCancel->setAutoDefault(false); - - gridLayout1->addWidget(buttonCancel, 0, 2, 1, 1); - - - gridLayout_5->addWidget(GroupButtons, 8, 0, 1, 1); - - spacer_2 = new QSpacerItem(128, 25, QSizePolicy::Fixed, QSizePolicy::Minimum); - - gridLayout_5->addItem(spacer_2, 8, 1, 1, 1); - - CreateYACS->setWidget(scrollAreaWidgetContents); - - retranslateUi(CreateYACS); - - QMetaObject::connectSlotsByName(CreateYACS); - } // setupUi - - void retranslateUi(QScrollArea *CreateYACS) - { - CreateYACS->setWindowTitle(QApplication::translate("CreateYACS", "Create YACS", Q_NULLPTR)); - Name->setText(QApplication::translate("CreateYACS", "Name", Q_NULLPTR)); - Case->setText(QApplication::translate("CreateYACS", "Case", Q_NULLPTR)); - PBCaseName->setText(QString()); - Script->setText(QApplication::translate("CreateYACS", "Script", Q_NULLPTR)); - PBScriptFile->setText(QString()); - DirectoryStart->setText(QApplication::translate("CreateYACS", "Directory", Q_NULLPTR)); - PBDir->setText(QString()); - MeshFile->setText(QApplication::translate("CreateYACS", "Mesh file", Q_NULLPTR)); - PBMeshFile->setText(QString()); - GBTypeSchema->setTitle(QApplication::translate("CreateYACS", "Type of schema", Q_NULLPTR)); - RBConstant->setText(QApplication::translate("CreateYACS", "Constant", Q_NULLPTR)); - RBVariable->setText(QApplication::translate("CreateYACS", "Variable", Q_NULLPTR)); - GBMax->setTitle(QApplication::translate("CreateYACS", "Maximum of ...", Q_NULLPTR)); - TLMaxIteration->setText(QApplication::translate("CreateYACS", "Iterations", Q_NULLPTR)); - TLMaxNodes->setText(QApplication::translate("CreateYACS", "Nodes", Q_NULLPTR)); - TLMaxElem->setText(QApplication::translate("CreateYACS", "Elements", Q_NULLPTR)); - GBConvergence->setTitle(QApplication::translate("CreateYACS", "Test of convergence", Q_NULLPTR)); - RBNone->setText(QApplication::translate("CreateYACS", "None", Q_NULLPTR)); - RBVMinAbs->setText(QApplication::translate("CreateYACS", "Vtest > Vref", Q_NULLPTR)); - RBVMaxAbs->setText(QApplication::translate("CreateYACS", "Vtest < Vref", Q_NULLPTR)); - labelVref->setText(QApplication::translate("CreateYACS", "Vref", Q_NULLPTR)); - GroupButtons->setTitle(QString()); - buttonHelp->setText(QApplication::translate("CreateYACS", "Help", Q_NULLPTR)); - buttonApply->setText(QApplication::translate("CreateYACS", "Apply", Q_NULLPTR)); - buttonOk->setText(QApplication::translate("CreateYACS", "OK", Q_NULLPTR)); - buttonCancel->setText(QApplication::translate("CreateYACS", "Cancel", Q_NULLPTR)); - } // retranslateUi - -}; - -namespace Ui { - class CreateYACS: public Ui_CreateYACS {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_CREATEYACS_H diff --git a/src/ADAPTGUI/ui_CreateZone.h b/src/ADAPTGUI/ui_CreateZone.h deleted file mode 100644 index 9863c2b4b..000000000 --- a/src/ADAPTGUI/ui_CreateZone.h +++ /dev/null @@ -1,806 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'CreateZone.ui' -** -** Created by: Qt User Interface Compiler version 5.9.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_CREATEZONE_H -#define UI_CREATEZONE_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_CreateZone -{ -public: - QGridLayout *gridLayout; - QLabel *Name; - QLineEdit *LEName; - QSpacerItem *horizontalSpacer_3; - QGroupBox *TypeZone; - QGridLayout *gridLayout1; - QRadioButton *RBSphere; - QRadioButton *RBPipe; - QRadioButton *RBCylinder; - QRadioButton *RBBox; - QSpacerItem *horizontalSpacer_2; - QGroupBox *gBBox; - QGridLayout *gridLayout2; - QLabel *TLXmini; - QDoubleSpinBox *SpinBox_Xmini; - QLabel *TLYmini; - QDoubleSpinBox *SpinBox_Ymini; - QLabel *TLZmini; - QDoubleSpinBox *SpinBox_Zmini; - QLabel *TLXmaxi; - QLabel *TLZmaxi; - QDoubleSpinBox *SpinBox_Zmaxi; - QLabel *TLYmaxi; - QDoubleSpinBox *SpinBox_Xmaxi; - QDoubleSpinBox *SpinBox_Ymaxi; - QGroupBox *gBSphere; - QGridLayout *gridLayout3; - QLabel *TLXcentre; - QDoubleSpinBox *SpinBox_Xcentre; - QLabel *TLYcentre; - QDoubleSpinBox *SpinBox_Ycentre; - QLabel *TLRayon; - QDoubleSpinBox *SpinBox_Rayon; - QLabel *TLZcentre; - QDoubleSpinBox *SpinBox_Zcentre; - QGroupBox *gBCylindre; - QGridLayout *gridLayout4; - QDoubleSpinBox *SpinBox_Haut; - QLabel *TLHaut; - QLabel *TLRadius; - QDoubleSpinBox *SpinBox_Xaxis; - QDoubleSpinBox *SpinBox_Yaxis; - QDoubleSpinBox *SpinBox_Zaxis; - QLabel *TLZaxis; - QLabel *TLYaxis; - QLabel *TLXaxis; - QDoubleSpinBox *SpinBox_Ybase; - QLabel *TLYbase; - QLabel *TLZbase; - QDoubleSpinBox *SpinBox_Zbase; - QDoubleSpinBox *SpinBox_Radius; - QLabel *TLXbase; - QDoubleSpinBox *SpinBox_Xbase; - QGroupBox *gBPipe; - QGridLayout *gridLayout5; - QLabel *TLHaut_p; - QDoubleSpinBox *SpinBox_Xbase_p; - QLabel *TLXbase_p; - QDoubleSpinBox *SpinBox_Radius_int; - QDoubleSpinBox *SpinBox_Zbase_p; - QLabel *TLRadius_int; - QLabel *TLZbase_p; - QLabel *TLYbase_p; - QDoubleSpinBox *SpinBox_Ybase_p; - QLabel *TLXaxis_p; - QLabel *TLYaxis_p; - QLabel *TLZaxis_p; - QDoubleSpinBox *SpinBox_Zaxis_p; - QDoubleSpinBox *SpinBox_Yaxis_p; - QDoubleSpinBox *SpinBox_Xaxis_p; - QDoubleSpinBox *SpinBox_Radius_ext; - QLabel *TLRadius_ext; - QDoubleSpinBox *SpinBox_Haut_p; - QGroupBox *GBButtons; - QGridLayout *gridLayout6; - QPushButton *buttonHelp; - QPushButton *buttonCancel; - QPushButton *buttonApply; - QPushButton *buttonOk; - QSpacerItem *horizontalSpacer; - - void setupUi(QDialog *CreateZone) - { - if (CreateZone->objectName().isEmpty()) - CreateZone->setObjectName(QStringLiteral("CreateZone")); - CreateZone->resize(545, 778); - CreateZone->setSizeIncrement(QSize(1, 1)); - CreateZone->setBaseSize(QSize(550, 400)); - CreateZone->setAutoFillBackground(true); - CreateZone->setSizeGripEnabled(true); - gridLayout = new QGridLayout(CreateZone); - gridLayout->setObjectName(QStringLiteral("gridLayout")); - Name = new QLabel(CreateZone); - Name->setObjectName(QStringLiteral("Name")); - - gridLayout->addWidget(Name, 0, 0, 1, 1); - - LEName = new QLineEdit(CreateZone); - LEName->setObjectName(QStringLiteral("LEName")); - LEName->setMaxLength(32); - - gridLayout->addWidget(LEName, 0, 1, 1, 1); - - horizontalSpacer_3 = new QSpacerItem(142, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout->addItem(horizontalSpacer_3, 0, 2, 1, 1); - - TypeZone = new QGroupBox(CreateZone); - TypeZone->setObjectName(QStringLiteral("TypeZone")); - QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(TypeZone->sizePolicy().hasHeightForWidth()); - TypeZone->setSizePolicy(sizePolicy); - TypeZone->setMinimumSize(QSize(340, 0)); - gridLayout1 = new QGridLayout(TypeZone); -#ifndef Q_OS_MAC - gridLayout1->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout1->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout1->setObjectName(QStringLiteral("gridLayout1")); - RBSphere = new QRadioButton(TypeZone); - RBSphere->setObjectName(QStringLiteral("RBSphere")); - QIcon icon; - icon.addFile(QStringLiteral("../../resources/zone_spherepoint.png"), QSize(), QIcon::Normal, QIcon::Off); - RBSphere->setIcon(icon); - - gridLayout1->addWidget(RBSphere, 0, 3, 1, 1); - - RBPipe = new QRadioButton(TypeZone); - RBPipe->setObjectName(QStringLiteral("RBPipe")); - QIcon icon1; - icon1.addFile(QStringLiteral("../../resources/pipe.png"), QSize(), QIcon::Normal, QIcon::Off); - RBPipe->setIcon(icon1); - - gridLayout1->addWidget(RBPipe, 0, 2, 1, 1); - - RBCylinder = new QRadioButton(TypeZone); - RBCylinder->setObjectName(QStringLiteral("RBCylinder")); - QIcon icon2; - icon2.addFile(QStringLiteral("../../resources/cylinderpointvector.png"), QSize(), QIcon::Normal, QIcon::Off); - RBCylinder->setIcon(icon2); - - gridLayout1->addWidget(RBCylinder, 0, 1, 1, 1); - - RBBox = new QRadioButton(TypeZone); - RBBox->setObjectName(QStringLiteral("RBBox")); - QIcon icon3; - icon3.addFile(QStringLiteral("../../resources/zone_boxdxyz.png"), QSize(), QIcon::Normal, QIcon::Off); - RBBox->setIcon(icon3); - RBBox->setCheckable(true); - RBBox->setChecked(true); - - gridLayout1->addWidget(RBBox, 0, 0, 1, 1); - - - gridLayout->addWidget(TypeZone, 1, 0, 1, 4); - - horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout->addItem(horizontalSpacer_2, 1, 4, 1, 1); - - gBBox = new QGroupBox(CreateZone); - gBBox->setObjectName(QStringLiteral("gBBox")); - sizePolicy.setHeightForWidth(gBBox->sizePolicy().hasHeightForWidth()); - gBBox->setSizePolicy(sizePolicy); - gridLayout2 = new QGridLayout(gBBox); -#ifndef Q_OS_MAC - gridLayout2->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout2->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout2->setObjectName(QStringLiteral("gridLayout2")); - TLXmini = new QLabel(gBBox); - TLXmini->setObjectName(QStringLiteral("TLXmini")); - sizePolicy.setHeightForWidth(TLXmini->sizePolicy().hasHeightForWidth()); - TLXmini->setSizePolicy(sizePolicy); - TLXmini->setWordWrap(false); - - gridLayout2->addWidget(TLXmini, 0, 0, 1, 1); - - SpinBox_Xmini = new QDoubleSpinBox(gBBox); - SpinBox_Xmini->setObjectName(QStringLiteral("SpinBox_Xmini")); - SpinBox_Xmini->setDecimals(5); - SpinBox_Xmini->setMinimum(-1e+9); - SpinBox_Xmini->setMaximum(1e+9); - SpinBox_Xmini->setValue(0); - - gridLayout2->addWidget(SpinBox_Xmini, 0, 1, 1, 1); - - TLYmini = new QLabel(gBBox); - TLYmini->setObjectName(QStringLiteral("TLYmini")); - sizePolicy.setHeightForWidth(TLYmini->sizePolicy().hasHeightForWidth()); - TLYmini->setSizePolicy(sizePolicy); - TLYmini->setWordWrap(false); - - gridLayout2->addWidget(TLYmini, 1, 0, 1, 1); - - SpinBox_Ymini = new QDoubleSpinBox(gBBox); - SpinBox_Ymini->setObjectName(QStringLiteral("SpinBox_Ymini")); - SpinBox_Ymini->setDecimals(5); - SpinBox_Ymini->setMinimum(-1e+9); - SpinBox_Ymini->setMaximum(1e+9); - SpinBox_Ymini->setValue(0); - - gridLayout2->addWidget(SpinBox_Ymini, 1, 1, 1, 1); - - TLZmini = new QLabel(gBBox); - TLZmini->setObjectName(QStringLiteral("TLZmini")); - sizePolicy.setHeightForWidth(TLZmini->sizePolicy().hasHeightForWidth()); - TLZmini->setSizePolicy(sizePolicy); - TLZmini->setWordWrap(false); - - gridLayout2->addWidget(TLZmini, 2, 0, 1, 1); - - SpinBox_Zmini = new QDoubleSpinBox(gBBox); - SpinBox_Zmini->setObjectName(QStringLiteral("SpinBox_Zmini")); - SpinBox_Zmini->setDecimals(5); - SpinBox_Zmini->setMinimum(-1e+9); - SpinBox_Zmini->setMaximum(1e+9); - SpinBox_Zmini->setValue(0); - - gridLayout2->addWidget(SpinBox_Zmini, 2, 1, 1, 1); - - TLXmaxi = new QLabel(gBBox); - TLXmaxi->setObjectName(QStringLiteral("TLXmaxi")); - sizePolicy.setHeightForWidth(TLXmaxi->sizePolicy().hasHeightForWidth()); - TLXmaxi->setSizePolicy(sizePolicy); - TLXmaxi->setWordWrap(false); - - gridLayout2->addWidget(TLXmaxi, 0, 2, 1, 1); - - TLZmaxi = new QLabel(gBBox); - TLZmaxi->setObjectName(QStringLiteral("TLZmaxi")); - sizePolicy.setHeightForWidth(TLZmaxi->sizePolicy().hasHeightForWidth()); - TLZmaxi->setSizePolicy(sizePolicy); - TLZmaxi->setWordWrap(false); - - gridLayout2->addWidget(TLZmaxi, 2, 2, 1, 1); - - SpinBox_Zmaxi = new QDoubleSpinBox(gBBox); - SpinBox_Zmaxi->setObjectName(QStringLiteral("SpinBox_Zmaxi")); - SpinBox_Zmaxi->setDecimals(5); - SpinBox_Zmaxi->setMinimum(-1e+9); - SpinBox_Zmaxi->setMaximum(1e+9); - SpinBox_Zmaxi->setValue(0); - - gridLayout2->addWidget(SpinBox_Zmaxi, 2, 3, 1, 1); - - TLYmaxi = new QLabel(gBBox); - TLYmaxi->setObjectName(QStringLiteral("TLYmaxi")); - sizePolicy.setHeightForWidth(TLYmaxi->sizePolicy().hasHeightForWidth()); - TLYmaxi->setSizePolicy(sizePolicy); - TLYmaxi->setWordWrap(false); - - gridLayout2->addWidget(TLYmaxi, 1, 2, 1, 1); - - SpinBox_Xmaxi = new QDoubleSpinBox(gBBox); - SpinBox_Xmaxi->setObjectName(QStringLiteral("SpinBox_Xmaxi")); - SpinBox_Xmaxi->setDecimals(5); - SpinBox_Xmaxi->setMinimum(-1e+9); - SpinBox_Xmaxi->setMaximum(1e+9); - SpinBox_Xmaxi->setValue(0); - - gridLayout2->addWidget(SpinBox_Xmaxi, 0, 3, 1, 1); - - SpinBox_Ymaxi = new QDoubleSpinBox(gBBox); - SpinBox_Ymaxi->setObjectName(QStringLiteral("SpinBox_Ymaxi")); - SpinBox_Ymaxi->setDecimals(5); - SpinBox_Ymaxi->setMinimum(-1e+9); - SpinBox_Ymaxi->setMaximum(1e+9); - SpinBox_Ymaxi->setValue(0); - - gridLayout2->addWidget(SpinBox_Ymaxi, 1, 3, 1, 1); - - - gridLayout->addWidget(gBBox, 2, 0, 1, 4); - - gBSphere = new QGroupBox(CreateZone); - gBSphere->setObjectName(QStringLiteral("gBSphere")); - sizePolicy.setHeightForWidth(gBSphere->sizePolicy().hasHeightForWidth()); - gBSphere->setSizePolicy(sizePolicy); - gridLayout3 = new QGridLayout(gBSphere); -#ifndef Q_OS_MAC - gridLayout3->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout3->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout3->setObjectName(QStringLiteral("gridLayout3")); - TLXcentre = new QLabel(gBSphere); - TLXcentre->setObjectName(QStringLiteral("TLXcentre")); - sizePolicy.setHeightForWidth(TLXcentre->sizePolicy().hasHeightForWidth()); - TLXcentre->setSizePolicy(sizePolicy); - TLXcentre->setWordWrap(false); - - gridLayout3->addWidget(TLXcentre, 0, 0, 1, 1); - - SpinBox_Xcentre = new QDoubleSpinBox(gBSphere); - SpinBox_Xcentre->setObjectName(QStringLiteral("SpinBox_Xcentre")); - SpinBox_Xcentre->setDecimals(5); - SpinBox_Xcentre->setMinimum(-1e+9); - SpinBox_Xcentre->setMaximum(1e+9); - SpinBox_Xcentre->setValue(0); - - gridLayout3->addWidget(SpinBox_Xcentre, 0, 1, 1, 1); - - TLYcentre = new QLabel(gBSphere); - TLYcentre->setObjectName(QStringLiteral("TLYcentre")); - sizePolicy.setHeightForWidth(TLYcentre->sizePolicy().hasHeightForWidth()); - TLYcentre->setSizePolicy(sizePolicy); - TLYcentre->setWordWrap(false); - - gridLayout3->addWidget(TLYcentre, 1, 0, 1, 1); - - SpinBox_Ycentre = new QDoubleSpinBox(gBSphere); - SpinBox_Ycentre->setObjectName(QStringLiteral("SpinBox_Ycentre")); - SpinBox_Ycentre->setDecimals(5); - SpinBox_Ycentre->setMinimum(-1e+9); - SpinBox_Ycentre->setMaximum(1e+9); - SpinBox_Ycentre->setValue(0); - - gridLayout3->addWidget(SpinBox_Ycentre, 1, 1, 1, 1); - - TLRayon = new QLabel(gBSphere); - TLRayon->setObjectName(QStringLiteral("TLRayon")); - sizePolicy.setHeightForWidth(TLRayon->sizePolicy().hasHeightForWidth()); - TLRayon->setSizePolicy(sizePolicy); - TLRayon->setWordWrap(false); - - gridLayout3->addWidget(TLRayon, 1, 2, 1, 1); - - SpinBox_Rayon = new QDoubleSpinBox(gBSphere); - SpinBox_Rayon->setObjectName(QStringLiteral("SpinBox_Rayon")); - SpinBox_Rayon->setDecimals(5); - SpinBox_Rayon->setMinimum(0); - SpinBox_Rayon->setMaximum(1e+9); - SpinBox_Rayon->setValue(0); - - gridLayout3->addWidget(SpinBox_Rayon, 1, 3, 1, 1); - - TLZcentre = new QLabel(gBSphere); - TLZcentre->setObjectName(QStringLiteral("TLZcentre")); - sizePolicy.setHeightForWidth(TLZcentre->sizePolicy().hasHeightForWidth()); - TLZcentre->setSizePolicy(sizePolicy); - TLZcentre->setWordWrap(false); - - gridLayout3->addWidget(TLZcentre, 2, 0, 1, 1); - - SpinBox_Zcentre = new QDoubleSpinBox(gBSphere); - SpinBox_Zcentre->setObjectName(QStringLiteral("SpinBox_Zcentre")); - SpinBox_Zcentre->setDecimals(5); - SpinBox_Zcentre->setMinimum(-1e+9); - SpinBox_Zcentre->setMaximum(1e+9); - SpinBox_Zcentre->setValue(0); - - gridLayout3->addWidget(SpinBox_Zcentre, 2, 1, 1, 1); - - - gridLayout->addWidget(gBSphere, 3, 0, 1, 4); - - gBCylindre = new QGroupBox(CreateZone); - gBCylindre->setObjectName(QStringLiteral("gBCylindre")); - sizePolicy.setHeightForWidth(gBCylindre->sizePolicy().hasHeightForWidth()); - gBCylindre->setSizePolicy(sizePolicy); - gBCylindre->setFocusPolicy(Qt::TabFocus); - gridLayout4 = new QGridLayout(gBCylindre); -#ifndef Q_OS_MAC - gridLayout4->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout4->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout4->setObjectName(QStringLiteral("gridLayout4")); - SpinBox_Haut = new QDoubleSpinBox(gBCylindre); - SpinBox_Haut->setObjectName(QStringLiteral("SpinBox_Haut")); - SpinBox_Haut->setDecimals(5); - SpinBox_Haut->setMaximum(1e+9); - - gridLayout4->addWidget(SpinBox_Haut, 4, 1, 1, 1); - - TLHaut = new QLabel(gBCylindre); - TLHaut->setObjectName(QStringLiteral("TLHaut")); - sizePolicy.setHeightForWidth(TLHaut->sizePolicy().hasHeightForWidth()); - TLHaut->setSizePolicy(sizePolicy); - TLHaut->setWordWrap(false); - - gridLayout4->addWidget(TLHaut, 4, 0, 1, 1); - - TLRadius = new QLabel(gBCylindre); - TLRadius->setObjectName(QStringLiteral("TLRadius")); - sizePolicy.setHeightForWidth(TLRadius->sizePolicy().hasHeightForWidth()); - TLRadius->setSizePolicy(sizePolicy); - TLRadius->setWordWrap(false); - - gridLayout4->addWidget(TLRadius, 3, 0, 1, 1); - - SpinBox_Xaxis = new QDoubleSpinBox(gBCylindre); - SpinBox_Xaxis->setObjectName(QStringLiteral("SpinBox_Xaxis")); - SpinBox_Xaxis->setDecimals(5); - SpinBox_Xaxis->setMinimum(-1e+9); - SpinBox_Xaxis->setMaximum(1e+9); - SpinBox_Xaxis->setValue(0); - - gridLayout4->addWidget(SpinBox_Xaxis, 0, 3, 1, 1); - - SpinBox_Yaxis = new QDoubleSpinBox(gBCylindre); - SpinBox_Yaxis->setObjectName(QStringLiteral("SpinBox_Yaxis")); - SpinBox_Yaxis->setDecimals(5); - SpinBox_Yaxis->setMinimum(-1e+9); - SpinBox_Yaxis->setMaximum(1e+9); - SpinBox_Yaxis->setValue(0); - - gridLayout4->addWidget(SpinBox_Yaxis, 1, 3, 1, 1); - - SpinBox_Zaxis = new QDoubleSpinBox(gBCylindre); - SpinBox_Zaxis->setObjectName(QStringLiteral("SpinBox_Zaxis")); - SpinBox_Zaxis->setDecimals(5); - SpinBox_Zaxis->setMinimum(-1e+9); - SpinBox_Zaxis->setMaximum(1e+9); - SpinBox_Zaxis->setValue(0); - - gridLayout4->addWidget(SpinBox_Zaxis, 2, 3, 1, 1); - - TLZaxis = new QLabel(gBCylindre); - TLZaxis->setObjectName(QStringLiteral("TLZaxis")); - sizePolicy.setHeightForWidth(TLZaxis->sizePolicy().hasHeightForWidth()); - TLZaxis->setSizePolicy(sizePolicy); - TLZaxis->setWordWrap(false); - - gridLayout4->addWidget(TLZaxis, 2, 2, 1, 1); - - TLYaxis = new QLabel(gBCylindre); - TLYaxis->setObjectName(QStringLiteral("TLYaxis")); - sizePolicy.setHeightForWidth(TLYaxis->sizePolicy().hasHeightForWidth()); - TLYaxis->setSizePolicy(sizePolicy); - TLYaxis->setWordWrap(false); - - gridLayout4->addWidget(TLYaxis, 1, 2, 1, 1); - - TLXaxis = new QLabel(gBCylindre); - TLXaxis->setObjectName(QStringLiteral("TLXaxis")); - sizePolicy.setHeightForWidth(TLXaxis->sizePolicy().hasHeightForWidth()); - TLXaxis->setSizePolicy(sizePolicy); - TLXaxis->setWordWrap(false); - - gridLayout4->addWidget(TLXaxis, 0, 2, 1, 1); - - SpinBox_Ybase = new QDoubleSpinBox(gBCylindre); - SpinBox_Ybase->setObjectName(QStringLiteral("SpinBox_Ybase")); - SpinBox_Ybase->setDecimals(5); - SpinBox_Ybase->setMinimum(-1e+9); - SpinBox_Ybase->setMaximum(1e+9); - SpinBox_Ybase->setValue(0); - - gridLayout4->addWidget(SpinBox_Ybase, 1, 1, 1, 1); - - TLYbase = new QLabel(gBCylindre); - TLYbase->setObjectName(QStringLiteral("TLYbase")); - sizePolicy.setHeightForWidth(TLYbase->sizePolicy().hasHeightForWidth()); - TLYbase->setSizePolicy(sizePolicy); - TLYbase->setWordWrap(false); - - gridLayout4->addWidget(TLYbase, 1, 0, 1, 1); - - TLZbase = new QLabel(gBCylindre); - TLZbase->setObjectName(QStringLiteral("TLZbase")); - sizePolicy.setHeightForWidth(TLZbase->sizePolicy().hasHeightForWidth()); - TLZbase->setSizePolicy(sizePolicy); - TLZbase->setWordWrap(false); - - gridLayout4->addWidget(TLZbase, 2, 0, 1, 1); - - SpinBox_Zbase = new QDoubleSpinBox(gBCylindre); - SpinBox_Zbase->setObjectName(QStringLiteral("SpinBox_Zbase")); - SpinBox_Zbase->setDecimals(5); - SpinBox_Zbase->setMinimum(-1e+9); - SpinBox_Zbase->setMaximum(1e+9); - SpinBox_Zbase->setValue(0); - - gridLayout4->addWidget(SpinBox_Zbase, 2, 1, 1, 1); - - SpinBox_Radius = new QDoubleSpinBox(gBCylindre); - SpinBox_Radius->setObjectName(QStringLiteral("SpinBox_Radius")); - SpinBox_Radius->setDecimals(5); - SpinBox_Radius->setMaximum(1e+9); - - gridLayout4->addWidget(SpinBox_Radius, 3, 1, 1, 1); - - TLXbase = new QLabel(gBCylindre); - TLXbase->setObjectName(QStringLiteral("TLXbase")); - sizePolicy.setHeightForWidth(TLXbase->sizePolicy().hasHeightForWidth()); - TLXbase->setSizePolicy(sizePolicy); - TLXbase->setWordWrap(false); - - gridLayout4->addWidget(TLXbase, 0, 0, 1, 1); - - SpinBox_Xbase = new QDoubleSpinBox(gBCylindre); - SpinBox_Xbase->setObjectName(QStringLiteral("SpinBox_Xbase")); - SpinBox_Xbase->setDecimals(5); - SpinBox_Xbase->setMinimum(-1e+9); - SpinBox_Xbase->setMaximum(1e+9); - SpinBox_Xbase->setValue(0); - - gridLayout4->addWidget(SpinBox_Xbase, 0, 1, 1, 1); - - - gridLayout->addWidget(gBCylindre, 4, 0, 1, 4); - - gBPipe = new QGroupBox(CreateZone); - gBPipe->setObjectName(QStringLiteral("gBPipe")); - sizePolicy.setHeightForWidth(gBPipe->sizePolicy().hasHeightForWidth()); - gBPipe->setSizePolicy(sizePolicy); - gridLayout5 = new QGridLayout(gBPipe); -#ifndef Q_OS_MAC - gridLayout5->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout5->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout5->setObjectName(QStringLiteral("gridLayout5")); - TLHaut_p = new QLabel(gBPipe); - TLHaut_p->setObjectName(QStringLiteral("TLHaut_p")); - sizePolicy.setHeightForWidth(TLHaut_p->sizePolicy().hasHeightForWidth()); - TLHaut_p->setSizePolicy(sizePolicy); - TLHaut_p->setWordWrap(false); - - gridLayout5->addWidget(TLHaut_p, 4, 0, 1, 1); - - SpinBox_Xbase_p = new QDoubleSpinBox(gBPipe); - SpinBox_Xbase_p->setObjectName(QStringLiteral("SpinBox_Xbase_p")); - SpinBox_Xbase_p->setDecimals(5); - SpinBox_Xbase_p->setMinimum(-1e+9); - SpinBox_Xbase_p->setMaximum(1e+9); - SpinBox_Xbase_p->setValue(0); - - gridLayout5->addWidget(SpinBox_Xbase_p, 0, 1, 1, 1); - - TLXbase_p = new QLabel(gBPipe); - TLXbase_p->setObjectName(QStringLiteral("TLXbase_p")); - sizePolicy.setHeightForWidth(TLXbase_p->sizePolicy().hasHeightForWidth()); - TLXbase_p->setSizePolicy(sizePolicy); - TLXbase_p->setWordWrap(false); - - gridLayout5->addWidget(TLXbase_p, 0, 0, 1, 1); - - SpinBox_Radius_int = new QDoubleSpinBox(gBPipe); - SpinBox_Radius_int->setObjectName(QStringLiteral("SpinBox_Radius_int")); - SpinBox_Radius_int->setDecimals(5); - SpinBox_Radius_int->setMaximum(1e+9); - - gridLayout5->addWidget(SpinBox_Radius_int, 3, 1, 1, 1); - - SpinBox_Zbase_p = new QDoubleSpinBox(gBPipe); - SpinBox_Zbase_p->setObjectName(QStringLiteral("SpinBox_Zbase_p")); - SpinBox_Zbase_p->setDecimals(5); - SpinBox_Zbase_p->setMinimum(-1e+9); - SpinBox_Zbase_p->setMaximum(1e+9); - SpinBox_Zbase_p->setValue(0); - - gridLayout5->addWidget(SpinBox_Zbase_p, 2, 1, 1, 1); - - TLRadius_int = new QLabel(gBPipe); - TLRadius_int->setObjectName(QStringLiteral("TLRadius_int")); - sizePolicy.setHeightForWidth(TLRadius_int->sizePolicy().hasHeightForWidth()); - TLRadius_int->setSizePolicy(sizePolicy); - TLRadius_int->setWordWrap(false); - - gridLayout5->addWidget(TLRadius_int, 3, 0, 1, 1); - - TLZbase_p = new QLabel(gBPipe); - TLZbase_p->setObjectName(QStringLiteral("TLZbase_p")); - sizePolicy.setHeightForWidth(TLZbase_p->sizePolicy().hasHeightForWidth()); - TLZbase_p->setSizePolicy(sizePolicy); - TLZbase_p->setWordWrap(false); - - gridLayout5->addWidget(TLZbase_p, 2, 0, 1, 1); - - TLYbase_p = new QLabel(gBPipe); - TLYbase_p->setObjectName(QStringLiteral("TLYbase_p")); - sizePolicy.setHeightForWidth(TLYbase_p->sizePolicy().hasHeightForWidth()); - TLYbase_p->setSizePolicy(sizePolicy); - TLYbase_p->setWordWrap(false); - - gridLayout5->addWidget(TLYbase_p, 1, 0, 1, 1); - - SpinBox_Ybase_p = new QDoubleSpinBox(gBPipe); - SpinBox_Ybase_p->setObjectName(QStringLiteral("SpinBox_Ybase_p")); - SpinBox_Ybase_p->setDecimals(5); - SpinBox_Ybase_p->setMinimum(-1e+9); - SpinBox_Ybase_p->setMaximum(1e+9); - SpinBox_Ybase_p->setValue(0); - - gridLayout5->addWidget(SpinBox_Ybase_p, 1, 1, 1, 1); - - TLXaxis_p = new QLabel(gBPipe); - TLXaxis_p->setObjectName(QStringLiteral("TLXaxis_p")); - sizePolicy.setHeightForWidth(TLXaxis_p->sizePolicy().hasHeightForWidth()); - TLXaxis_p->setSizePolicy(sizePolicy); - TLXaxis_p->setWordWrap(false); - - gridLayout5->addWidget(TLXaxis_p, 0, 2, 1, 1); - - TLYaxis_p = new QLabel(gBPipe); - TLYaxis_p->setObjectName(QStringLiteral("TLYaxis_p")); - sizePolicy.setHeightForWidth(TLYaxis_p->sizePolicy().hasHeightForWidth()); - TLYaxis_p->setSizePolicy(sizePolicy); - TLYaxis_p->setWordWrap(false); - - gridLayout5->addWidget(TLYaxis_p, 1, 2, 1, 1); - - TLZaxis_p = new QLabel(gBPipe); - TLZaxis_p->setObjectName(QStringLiteral("TLZaxis_p")); - sizePolicy.setHeightForWidth(TLZaxis_p->sizePolicy().hasHeightForWidth()); - TLZaxis_p->setSizePolicy(sizePolicy); - TLZaxis_p->setWordWrap(false); - - gridLayout5->addWidget(TLZaxis_p, 2, 2, 1, 1); - - SpinBox_Zaxis_p = new QDoubleSpinBox(gBPipe); - SpinBox_Zaxis_p->setObjectName(QStringLiteral("SpinBox_Zaxis_p")); - SpinBox_Zaxis_p->setDecimals(5); - SpinBox_Zaxis_p->setMinimum(-1e+9); - SpinBox_Zaxis_p->setMaximum(1e+9); - SpinBox_Zaxis_p->setValue(0); - - gridLayout5->addWidget(SpinBox_Zaxis_p, 2, 3, 1, 1); - - SpinBox_Yaxis_p = new QDoubleSpinBox(gBPipe); - SpinBox_Yaxis_p->setObjectName(QStringLiteral("SpinBox_Yaxis_p")); - SpinBox_Yaxis_p->setDecimals(5); - SpinBox_Yaxis_p->setMinimum(-1e+9); - SpinBox_Yaxis_p->setMaximum(1e+9); - SpinBox_Yaxis_p->setValue(0); - - gridLayout5->addWidget(SpinBox_Yaxis_p, 1, 3, 1, 1); - - SpinBox_Xaxis_p = new QDoubleSpinBox(gBPipe); - SpinBox_Xaxis_p->setObjectName(QStringLiteral("SpinBox_Xaxis_p")); - SpinBox_Xaxis_p->setDecimals(5); - SpinBox_Xaxis_p->setMinimum(-1e+9); - SpinBox_Xaxis_p->setMaximum(1e+9); - SpinBox_Xaxis_p->setValue(0); - - gridLayout5->addWidget(SpinBox_Xaxis_p, 0, 3, 1, 1); - - SpinBox_Radius_ext = new QDoubleSpinBox(gBPipe); - SpinBox_Radius_ext->setObjectName(QStringLiteral("SpinBox_Radius_ext")); - SpinBox_Radius_ext->setDecimals(5); - SpinBox_Radius_ext->setMaximum(1e+9); - - gridLayout5->addWidget(SpinBox_Radius_ext, 3, 3, 1, 1); - - TLRadius_ext = new QLabel(gBPipe); - TLRadius_ext->setObjectName(QStringLiteral("TLRadius_ext")); - sizePolicy.setHeightForWidth(TLRadius_ext->sizePolicy().hasHeightForWidth()); - TLRadius_ext->setSizePolicy(sizePolicy); - TLRadius_ext->setWordWrap(false); - - gridLayout5->addWidget(TLRadius_ext, 3, 2, 1, 1); - - SpinBox_Haut_p = new QDoubleSpinBox(gBPipe); - SpinBox_Haut_p->setObjectName(QStringLiteral("SpinBox_Haut_p")); - SpinBox_Haut_p->setDecimals(5); - SpinBox_Haut_p->setMaximum(1e+9); - - gridLayout5->addWidget(SpinBox_Haut_p, 4, 1, 1, 1); - - - gridLayout->addWidget(gBPipe, 5, 0, 1, 5); - - GBButtons = new QGroupBox(CreateZone); - GBButtons->setObjectName(QStringLiteral("GBButtons")); - sizePolicy.setHeightForWidth(GBButtons->sizePolicy().hasHeightForWidth()); - GBButtons->setSizePolicy(sizePolicy); - gridLayout6 = new QGridLayout(GBButtons); -#ifndef Q_OS_MAC - gridLayout6->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout6->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout6->setObjectName(QStringLiteral("gridLayout6")); - buttonHelp = new QPushButton(GBButtons); - buttonHelp->setObjectName(QStringLiteral("buttonHelp")); - - gridLayout6->addWidget(buttonHelp, 0, 3, 1, 1); - - buttonCancel = new QPushButton(GBButtons); - buttonCancel->setObjectName(QStringLiteral("buttonCancel")); - - gridLayout6->addWidget(buttonCancel, 0, 2, 1, 1); - - buttonApply = new QPushButton(GBButtons); - buttonApply->setObjectName(QStringLiteral("buttonApply")); - - gridLayout6->addWidget(buttonApply, 0, 1, 1, 1); - - buttonOk = new QPushButton(GBButtons); - buttonOk->setObjectName(QStringLiteral("buttonOk")); - - gridLayout6->addWidget(buttonOk, 0, 0, 1, 1); - - - gridLayout->addWidget(GBButtons, 6, 0, 1, 3); - - horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout->addItem(horizontalSpacer, 6, 3, 1, 2); - - - retranslateUi(CreateZone); - - QMetaObject::connectSlotsByName(CreateZone); - } // setupUi - - void retranslateUi(QDialog *CreateZone) - { - CreateZone->setWindowTitle(QApplication::translate("CreateZone", "Create a zone", Q_NULLPTR)); - Name->setText(QApplication::translate("CreateZone", "Name", Q_NULLPTR)); - TypeZone->setTitle(QApplication::translate("CreateZone", "Type of zone", Q_NULLPTR)); - RBSphere->setText(QApplication::translate("CreateZone", "Sphere", Q_NULLPTR)); - RBPipe->setText(QApplication::translate("CreateZone", "Pipe", Q_NULLPTR)); - RBCylinder->setText(QApplication::translate("CreateZone", "Cylinder", Q_NULLPTR)); - RBBox->setText(QApplication::translate("CreateZone", "Box", Q_NULLPTR)); - gBBox->setTitle(QApplication::translate("CreateZone", "Coordinates", Q_NULLPTR)); - TLXmini->setText(QApplication::translate("CreateZone", "X mini", Q_NULLPTR)); - TLYmini->setText(QApplication::translate("CreateZone", "Y mini", Q_NULLPTR)); - TLZmini->setText(QApplication::translate("CreateZone", "Z mini", Q_NULLPTR)); - TLXmaxi->setText(QApplication::translate("CreateZone", "X maxi", Q_NULLPTR)); - TLZmaxi->setText(QApplication::translate("CreateZone", "Z maxi", Q_NULLPTR)); - TLYmaxi->setText(QApplication::translate("CreateZone", "Y maxi", Q_NULLPTR)); - gBSphere->setTitle(QApplication::translate("CreateZone", "Coordinates", Q_NULLPTR)); - TLXcentre->setText(QApplication::translate("CreateZone", "X centre", Q_NULLPTR)); - TLYcentre->setText(QApplication::translate("CreateZone", "Y centre", Q_NULLPTR)); - TLRayon->setText(QApplication::translate("CreateZone", "Radius", Q_NULLPTR)); - TLZcentre->setText(QApplication::translate("CreateZone", "Z centre", Q_NULLPTR)); - gBCylindre->setTitle(QApplication::translate("CreateZone", "Coordinates", Q_NULLPTR)); - TLHaut->setText(QApplication::translate("CreateZone", "Height", Q_NULLPTR)); - TLRadius->setText(QApplication::translate("CreateZone", "Radius", Q_NULLPTR)); - TLZaxis->setText(QApplication::translate("CreateZone", "Z axis", Q_NULLPTR)); - TLYaxis->setText(QApplication::translate("CreateZone", "Y axis", Q_NULLPTR)); - TLXaxis->setText(QApplication::translate("CreateZone", "X axis", Q_NULLPTR)); - TLYbase->setText(QApplication::translate("CreateZone", "Y base", Q_NULLPTR)); - TLZbase->setText(QApplication::translate("CreateZone", "Z base", Q_NULLPTR)); - TLXbase->setText(QApplication::translate("CreateZone", "X base", Q_NULLPTR)); - gBPipe->setTitle(QApplication::translate("CreateZone", "Coordinates", Q_NULLPTR)); - TLHaut_p->setText(QApplication::translate("CreateZone", "Height", Q_NULLPTR)); - TLXbase_p->setText(QApplication::translate("CreateZone", "X base", Q_NULLPTR)); - TLRadius_int->setText(QApplication::translate("CreateZone", "Internal radius", Q_NULLPTR)); - TLZbase_p->setText(QApplication::translate("CreateZone", "Z base", Q_NULLPTR)); - TLYbase_p->setText(QApplication::translate("CreateZone", "Y base", Q_NULLPTR)); - TLXaxis_p->setText(QApplication::translate("CreateZone", "X axis", Q_NULLPTR)); - TLYaxis_p->setText(QApplication::translate("CreateZone", "Y axis", Q_NULLPTR)); - TLZaxis_p->setText(QApplication::translate("CreateZone", "Z axis", Q_NULLPTR)); - TLRadius_ext->setText(QApplication::translate("CreateZone", "External radius", Q_NULLPTR)); - GBButtons->setTitle(QString()); - buttonHelp->setText(QApplication::translate("CreateZone", "Help", Q_NULLPTR)); - buttonCancel->setText(QApplication::translate("CreateZone", "Cancel", Q_NULLPTR)); - buttonApply->setText(QApplication::translate("CreateZone", "Apply", Q_NULLPTR)); - buttonOk->setText(QApplication::translate("CreateZone", "OK", Q_NULLPTR)); - } // retranslateUi - -}; - -namespace Ui { - class CreateZone: public Ui_CreateZone {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_CREATEZONE_H diff --git a/src/ADAPTGUI/ui_EditFile.h b/src/ADAPTGUI/ui_EditFile.h deleted file mode 100644 index 9c2aceb1d..000000000 --- a/src/ADAPTGUI/ui_EditFile.h +++ /dev/null @@ -1,121 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'EditFile.ui' -** -** Created by: Qt User Interface Compiler version 5.9.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_EDITFILE_H -#define UI_EDITFILE_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_EditFile -{ -public: - QGridLayout *gridLayout; - QSpacerItem *spacerItem; - QGroupBox *GroupButtons; - QGridLayout *gridLayout1; - QPushButton *buttonPrint; - QPushButton *buttonQuit; - QSpacerItem *spacerItem1; - QTextBrowser *QTBEditFile; - - void setupUi(QWidget *EditFile) - { - if (EditFile->objectName().isEmpty()) - EditFile->setObjectName(QStringLiteral("EditFile")); - EditFile->resize(675, 901); - gridLayout = new QGridLayout(EditFile); -#ifndef Q_OS_MAC - gridLayout->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout->setObjectName(QStringLiteral("gridLayout")); - spacerItem = new QSpacerItem(331, 49, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout->addItem(spacerItem, 2, 1, 1, 1); - - GroupButtons = new QGroupBox(EditFile); - GroupButtons->setObjectName(QStringLiteral("GroupButtons")); - gridLayout1 = new QGridLayout(GroupButtons); -#ifndef Q_OS_MAC - gridLayout1->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout1->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout1->setObjectName(QStringLiteral("gridLayout1")); - buttonPrint = new QPushButton(GroupButtons); - buttonPrint->setObjectName(QStringLiteral("buttonPrint")); - buttonPrint->setAutoDefault(false); - buttonPrint->setFlat(false); - - gridLayout1->addWidget(buttonPrint, 0, 1, 1, 1); - - buttonQuit = new QPushButton(GroupButtons); - buttonQuit->setObjectName(QStringLiteral("buttonQuit")); - buttonQuit->setAutoDefault(false); - buttonQuit->setFlat(false); - - gridLayout1->addWidget(buttonQuit, 0, 0, 1, 1); - - - gridLayout->addWidget(GroupButtons, 2, 0, 1, 1); - - spacerItem1 = new QSpacerItem(20, 14, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout->addItem(spacerItem1, 1, 0, 1, 2); - - QTBEditFile = new QTextBrowser(EditFile); - QTBEditFile->setObjectName(QStringLiteral("QTBEditFile")); - QTBEditFile->setMinimumSize(QSize(530, 800)); - QFont font; - font.setFamily(QStringLiteral("Courier New")); - QTBEditFile->setFont(font); - - gridLayout->addWidget(QTBEditFile, 0, 0, 1, 2); - - - retranslateUi(EditFile); - - buttonPrint->setDefault(false); - buttonQuit->setDefault(true); - - - QMetaObject::connectSlotsByName(EditFile); - } // setupUi - - void retranslateUi(QWidget *EditFile) - { - EditFile->setWindowTitle(QApplication::translate("EditFile", "Edit a file", Q_NULLPTR)); - GroupButtons->setTitle(QString()); - buttonPrint->setText(QApplication::translate("EditFile", "Print", Q_NULLPTR)); - buttonQuit->setText(QApplication::translate("EditFile", "Quit", Q_NULLPTR)); - } // retranslateUi - -}; - -namespace Ui { - class EditFile: public Ui_EditFile {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_EDITFILE_H diff --git a/src/ADAPTGUI/ui_IterInfo.h b/src/ADAPTGUI/ui_IterInfo.h deleted file mode 100644 index efffe0eaf..000000000 --- a/src/ADAPTGUI/ui_IterInfo.h +++ /dev/null @@ -1,155 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'IterInfo.ui' -** -** Created by: Qt User Interface Compiler version 5.9.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_ITERINFO_H -#define UI_ITERINFO_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_IterInfo -{ -public: - QGridLayout *gridLayout_2; - QGroupBox *GBOptions; - QGridLayout *gridLayout; - QCheckBox *CBQuality; - QCheckBox *CBConnection; - QCheckBox *CBDiametre; - QCheckBox *CBBlockSize; - QCheckBox *CBEntanglement; - QGroupBox *GroupButtons; - QGridLayout *gridLayout1; - QPushButton *buttonHelp; - QPushButton *buttonApply; - QPushButton *buttonOk; - QPushButton *buttonCancel; - - void setupUi(QDialog *IterInfo) - { - if (IterInfo->objectName().isEmpty()) - IterInfo->setObjectName(QStringLiteral("IterInfo")); - IterInfo->resize(420, 220); - QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(IterInfo->sizePolicy().hasHeightForWidth()); - IterInfo->setSizePolicy(sizePolicy); - IterInfo->setAutoFillBackground(true); - gridLayout_2 = new QGridLayout(IterInfo); - gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); - GBOptions = new QGroupBox(IterInfo); - GBOptions->setObjectName(QStringLiteral("GBOptions")); - gridLayout = new QGridLayout(GBOptions); - gridLayout->setObjectName(QStringLiteral("gridLayout")); - CBQuality = new QCheckBox(GBOptions); - CBQuality->setObjectName(QStringLiteral("CBQuality")); - - gridLayout->addWidget(CBQuality, 0, 0, 1, 1); - - CBConnection = new QCheckBox(GBOptions); - CBConnection->setObjectName(QStringLiteral("CBConnection")); - - gridLayout->addWidget(CBConnection, 0, 1, 1, 1); - - CBDiametre = new QCheckBox(GBOptions); - CBDiametre->setObjectName(QStringLiteral("CBDiametre")); - - gridLayout->addWidget(CBDiametre, 1, 0, 1, 1); - - CBBlockSize = new QCheckBox(GBOptions); - CBBlockSize->setObjectName(QStringLiteral("CBBlockSize")); - - gridLayout->addWidget(CBBlockSize, 1, 1, 1, 1); - - CBEntanglement = new QCheckBox(GBOptions); - CBEntanglement->setObjectName(QStringLiteral("CBEntanglement")); - - gridLayout->addWidget(CBEntanglement, 2, 0, 1, 2); - - - gridLayout_2->addWidget(GBOptions, 0, 0, 2, 2); - - GroupButtons = new QGroupBox(IterInfo); - GroupButtons->setObjectName(QStringLiteral("GroupButtons")); - gridLayout1 = new QGridLayout(GroupButtons); -#ifndef Q_OS_MAC - gridLayout1->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout1->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout1->setObjectName(QStringLiteral("gridLayout1")); - buttonHelp = new QPushButton(GroupButtons); - buttonHelp->setObjectName(QStringLiteral("buttonHelp")); - buttonHelp->setAutoDefault(false); - - gridLayout1->addWidget(buttonHelp, 0, 4, 1, 1); - - buttonApply = new QPushButton(GroupButtons); - buttonApply->setObjectName(QStringLiteral("buttonApply")); - buttonApply->setAutoDefault(false); - - gridLayout1->addWidget(buttonApply, 0, 1, 1, 1); - - buttonOk = new QPushButton(GroupButtons); - buttonOk->setObjectName(QStringLiteral("buttonOk")); - buttonOk->setAutoDefault(false); - - gridLayout1->addWidget(buttonOk, 0, 0, 1, 1); - - buttonCancel = new QPushButton(GroupButtons); - buttonCancel->setObjectName(QStringLiteral("buttonCancel")); - buttonCancel->setAutoDefault(false); - - gridLayout1->addWidget(buttonCancel, 0, 2, 1, 1); - - - gridLayout_2->addWidget(GroupButtons, 2, 0, 1, 2); - - - retranslateUi(IterInfo); - - QMetaObject::connectSlotsByName(IterInfo); - } // setupUi - - void retranslateUi(QDialog *IterInfo) - { - IterInfo->setWindowTitle(QApplication::translate("IterInfo", "Information on a mesh", Q_NULLPTR)); - GBOptions->setTitle(QApplication::translate("IterInfo", "Options", Q_NULLPTR)); - CBQuality->setText(QApplication::translate("IterInfo", "Quality", Q_NULLPTR)); - CBConnection->setText(QApplication::translate("IterInfo", "Connection", Q_NULLPTR)); - CBDiametre->setText(QApplication::translate("IterInfo", "Diametre", Q_NULLPTR)); - CBBlockSize->setText(QApplication::translate("IterInfo", "Group size", Q_NULLPTR)); - CBEntanglement->setText(QApplication::translate("IterInfo", "Entanglement", Q_NULLPTR)); - GroupButtons->setTitle(QString()); - buttonHelp->setText(QApplication::translate("IterInfo", "Help", Q_NULLPTR)); - buttonApply->setText(QApplication::translate("IterInfo", "Apply", Q_NULLPTR)); - buttonOk->setText(QApplication::translate("IterInfo", "OK", Q_NULLPTR)); - buttonCancel->setText(QApplication::translate("IterInfo", "Cancel", Q_NULLPTR)); - } // retranslateUi - -}; - -namespace Ui { - class IterInfo: public Ui_IterInfo {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_ITERINFO_H diff --git a/src/ADAPTGUI/ui_MeshInfo.h b/src/ADAPTGUI/ui_MeshInfo.h deleted file mode 100644 index b4d3e408f..000000000 --- a/src/ADAPTGUI/ui_MeshInfo.h +++ /dev/null @@ -1,269 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'MeshInfo.ui' -** -** Created by: Qt User Interface Compiler version 5.9.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_MESHINFO_H -#define UI_MESHINFO_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_MeshInfo -{ -public: - QGridLayout *gridLayout_2; - QHBoxLayout *hboxLayout; - QLabel *Name; - QLineEdit *LECaseName; - QHBoxLayout *hboxLayout1; - QLabel *Directory; - QPushButton *PushDir; - QLineEdit *LEDirName; - QSpacerItem *spacerItem; - QHBoxLayout *hboxLayout2; - QLabel *Mesh_2; - QPushButton *PushFichier; - QLineEdit *LEFileName; - QSpacerItem *spacerItem1; - QGroupBox *GBOptions; - QGridLayout *gridLayout; - QCheckBox *CBQuality; - QCheckBox *CBConnection; - QCheckBox *CBDiametre; - QCheckBox *CBBlockSize; - QCheckBox *CBEntanglement; - QSpacerItem *verticalSpacer; - QGroupBox *GroupButtons; - QGridLayout *gridLayout1; - QPushButton *buttonHelp; - QPushButton *buttonApply; - QPushButton *buttonOk; - QPushButton *buttonCancel; - QSpacerItem *spacer_2; - - void setupUi(QDialog *MeshInfo) - { - if (MeshInfo->objectName().isEmpty()) - MeshInfo->setObjectName(QStringLiteral("MeshInfo")); - MeshInfo->resize(536, 372); - QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(MeshInfo->sizePolicy().hasHeightForWidth()); - MeshInfo->setSizePolicy(sizePolicy); - MeshInfo->setAutoFillBackground(true); - gridLayout_2 = new QGridLayout(MeshInfo); - gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); - hboxLayout = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout->setSpacing(6); -#endif -#ifndef Q_OS_MAC - hboxLayout->setContentsMargins(0, 0, 0, 0); -#endif - hboxLayout->setObjectName(QStringLiteral("hboxLayout")); - Name = new QLabel(MeshInfo); - Name->setObjectName(QStringLiteral("Name")); - - hboxLayout->addWidget(Name); - - LECaseName = new QLineEdit(MeshInfo); - LECaseName->setObjectName(QStringLiteral("LECaseName")); - LECaseName->setMinimumSize(QSize(382, 21)); - - hboxLayout->addWidget(LECaseName); - - - gridLayout_2->addLayout(hboxLayout, 0, 0, 1, 2); - - hboxLayout1 = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout1->setSpacing(6); -#endif - hboxLayout1->setContentsMargins(0, 0, 0, 0); - hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); - Directory = new QLabel(MeshInfo); - Directory->setObjectName(QStringLiteral("Directory")); - - hboxLayout1->addWidget(Directory); - - PushDir = new QPushButton(MeshInfo); - PushDir->setObjectName(QStringLiteral("PushDir")); - PushDir->setAutoDefault(false); - - hboxLayout1->addWidget(PushDir); - - LEDirName = new QLineEdit(MeshInfo); - LEDirName->setObjectName(QStringLiteral("LEDirName")); - LEDirName->setMinimumSize(QSize(382, 21)); - - hboxLayout1->addWidget(LEDirName); - - - gridLayout_2->addLayout(hboxLayout1, 1, 0, 1, 2); - - spacerItem = new QSpacerItem(20, 18, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout_2->addItem(spacerItem, 2, 0, 1, 1); - - hboxLayout2 = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout2->setSpacing(6); -#endif - hboxLayout2->setContentsMargins(0, 0, 0, 0); - hboxLayout2->setObjectName(QStringLiteral("hboxLayout2")); - Mesh_2 = new QLabel(MeshInfo); - Mesh_2->setObjectName(QStringLiteral("Mesh_2")); - - hboxLayout2->addWidget(Mesh_2); - - PushFichier = new QPushButton(MeshInfo); - PushFichier->setObjectName(QStringLiteral("PushFichier")); - PushFichier->setAutoDefault(false); - - hboxLayout2->addWidget(PushFichier); - - LEFileName = new QLineEdit(MeshInfo); - LEFileName->setObjectName(QStringLiteral("LEFileName")); - LEFileName->setMinimumSize(QSize(382, 21)); - - hboxLayout2->addWidget(LEFileName); - - - gridLayout_2->addLayout(hboxLayout2, 3, 0, 1, 2); - - spacerItem1 = new QSpacerItem(20, 1, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout_2->addItem(spacerItem1, 4, 0, 1, 1); - - GBOptions = new QGroupBox(MeshInfo); - GBOptions->setObjectName(QStringLiteral("GBOptions")); - gridLayout = new QGridLayout(GBOptions); - gridLayout->setObjectName(QStringLiteral("gridLayout")); - CBQuality = new QCheckBox(GBOptions); - CBQuality->setObjectName(QStringLiteral("CBQuality")); - - gridLayout->addWidget(CBQuality, 0, 0, 1, 1); - - CBConnection = new QCheckBox(GBOptions); - CBConnection->setObjectName(QStringLiteral("CBConnection")); - - gridLayout->addWidget(CBConnection, 0, 1, 1, 1); - - CBDiametre = new QCheckBox(GBOptions); - CBDiametre->setObjectName(QStringLiteral("CBDiametre")); - - gridLayout->addWidget(CBDiametre, 1, 0, 1, 1); - - CBBlockSize = new QCheckBox(GBOptions); - CBBlockSize->setObjectName(QStringLiteral("CBBlockSize")); - - gridLayout->addWidget(CBBlockSize, 1, 1, 1, 1); - - CBEntanglement = new QCheckBox(GBOptions); - CBEntanglement->setObjectName(QStringLiteral("CBEntanglement")); - - gridLayout->addWidget(CBEntanglement, 2, 0, 1, 2); - - - gridLayout_2->addWidget(GBOptions, 5, 0, 1, 1); - - verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout_2->addItem(verticalSpacer, 6, 0, 1, 1); - - GroupButtons = new QGroupBox(MeshInfo); - GroupButtons->setObjectName(QStringLiteral("GroupButtons")); - gridLayout1 = new QGridLayout(GroupButtons); -#ifndef Q_OS_MAC - gridLayout1->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout1->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout1->setObjectName(QStringLiteral("gridLayout1")); - buttonHelp = new QPushButton(GroupButtons); - buttonHelp->setObjectName(QStringLiteral("buttonHelp")); - buttonHelp->setAutoDefault(false); - - gridLayout1->addWidget(buttonHelp, 0, 4, 1, 1); - - buttonApply = new QPushButton(GroupButtons); - buttonApply->setObjectName(QStringLiteral("buttonApply")); - buttonApply->setAutoDefault(false); - - gridLayout1->addWidget(buttonApply, 0, 1, 1, 1); - - buttonOk = new QPushButton(GroupButtons); - buttonOk->setObjectName(QStringLiteral("buttonOk")); - buttonOk->setAutoDefault(false); - - gridLayout1->addWidget(buttonOk, 0, 0, 1, 1); - - buttonCancel = new QPushButton(GroupButtons); - buttonCancel->setObjectName(QStringLiteral("buttonCancel")); - buttonCancel->setAutoDefault(false); - - gridLayout1->addWidget(buttonCancel, 0, 2, 1, 1); - - - gridLayout_2->addWidget(GroupButtons, 7, 0, 1, 1); - - spacer_2 = new QSpacerItem(128, 25, QSizePolicy::Fixed, QSizePolicy::Minimum); - - gridLayout_2->addItem(spacer_2, 7, 1, 1, 1); - - - retranslateUi(MeshInfo); - - QMetaObject::connectSlotsByName(MeshInfo); - } // setupUi - - void retranslateUi(QDialog *MeshInfo) - { - MeshInfo->setWindowTitle(QApplication::translate("MeshInfo", "Information on a mesh", Q_NULLPTR)); - Name->setText(QApplication::translate("MeshInfo", "Name", Q_NULLPTR)); - Directory->setText(QApplication::translate("MeshInfo", "Directory", Q_NULLPTR)); - PushDir->setText(QString()); - Mesh_2->setText(QApplication::translate("MeshInfo", "Mesh", Q_NULLPTR)); - PushFichier->setText(QString()); - GBOptions->setTitle(QApplication::translate("MeshInfo", "Options", Q_NULLPTR)); - CBQuality->setText(QApplication::translate("MeshInfo", "Quality", Q_NULLPTR)); - CBConnection->setText(QApplication::translate("MeshInfo", "Connection", Q_NULLPTR)); - CBDiametre->setText(QApplication::translate("MeshInfo", "Diametre", Q_NULLPTR)); - CBBlockSize->setText(QApplication::translate("MeshInfo", "Group size", Q_NULLPTR)); - CBEntanglement->setText(QApplication::translate("MeshInfo", "Entanglement", Q_NULLPTR)); - GroupButtons->setTitle(QString()); - buttonHelp->setText(QApplication::translate("MeshInfo", "Help", Q_NULLPTR)); - buttonApply->setText(QApplication::translate("MeshInfo", "Apply", Q_NULLPTR)); - buttonOk->setText(QApplication::translate("MeshInfo", "OK", Q_NULLPTR)); - buttonCancel->setText(QApplication::translate("MeshInfo", "Cancel", Q_NULLPTR)); - } // retranslateUi - -}; - -namespace Ui { - class MeshInfo: public Ui_MeshInfo {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_MESHINFO_H diff --git a/src/ADAPTGUI/ui_PursueIteration.h b/src/ADAPTGUI/ui_PursueIteration.h deleted file mode 100644 index a9dfec8cb..000000000 --- a/src/ADAPTGUI/ui_PursueIteration.h +++ /dev/null @@ -1,257 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'PursueIteration.ui' -** -** Created by: Qt User Interface Compiler version 5.9.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_PURSUEITERATION_H -#define UI_PURSUEITERATION_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_PursueIteration -{ -public: - QGridLayout *gridLayout_2; - QHBoxLayout *hboxLayout; - QLabel *Name; - QLineEdit *LECaseName; - QHBoxLayout *_2; - QLabel *Directory; - QPushButton *PushDir; - QLineEdit *LEDirName; - QRadioButton *RBIteration; - QRadioButton *RBCase; - QHBoxLayout *hboxLayout1; - QLabel *DirectoryStart; - QPushButton *PushDirStart; - QLineEdit *LEDirNameStart; - QGroupBox *GBIterationintoCase; - QGridLayout *gridLayout; - QRadioButton *RBCaseLastIteration; - QRadioButton *RBCaseNIteration; - QSpinBox *SpinBoxNumber; - QGroupBox *GroupButtons; - QGridLayout *gridLayout1; - QPushButton *buttonHelp; - QPushButton *buttonApply; - QPushButton *buttonOk; - QPushButton *buttonCancel; - QSpacerItem *spacer_2; - - void setupUi(QDialog *PursueIteration) - { - if (PursueIteration->objectName().isEmpty()) - PursueIteration->setObjectName(QStringLiteral("PursueIteration")); - PursueIteration->resize(601, 300); - QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(PursueIteration->sizePolicy().hasHeightForWidth()); - PursueIteration->setSizePolicy(sizePolicy); - PursueIteration->setAutoFillBackground(true); - gridLayout_2 = new QGridLayout(PursueIteration); - gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); - hboxLayout = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout->setSpacing(6); -#endif -#ifndef Q_OS_MAC - hboxLayout->setContentsMargins(0, 0, 0, 0); -#endif - hboxLayout->setObjectName(QStringLiteral("hboxLayout")); - Name = new QLabel(PursueIteration); - Name->setObjectName(QStringLiteral("Name")); - - hboxLayout->addWidget(Name); - - LECaseName = new QLineEdit(PursueIteration); - LECaseName->setObjectName(QStringLiteral("LECaseName")); - LECaseName->setMinimumSize(QSize(382, 21)); - - hboxLayout->addWidget(LECaseName); - - - gridLayout_2->addLayout(hboxLayout, 0, 0, 1, 2); - - _2 = new QHBoxLayout(); -#ifndef Q_OS_MAC - _2->setSpacing(6); -#endif - _2->setContentsMargins(0, 0, 0, 0); - _2->setObjectName(QStringLiteral("_2")); - Directory = new QLabel(PursueIteration); - Directory->setObjectName(QStringLiteral("Directory")); - - _2->addWidget(Directory); - - PushDir = new QPushButton(PursueIteration); - PushDir->setObjectName(QStringLiteral("PushDir")); - PushDir->setAutoDefault(false); - - _2->addWidget(PushDir); - - LEDirName = new QLineEdit(PursueIteration); - LEDirName->setObjectName(QStringLiteral("LEDirName")); - LEDirName->setMinimumSize(QSize(382, 21)); - - _2->addWidget(LEDirName); - - - gridLayout_2->addLayout(_2, 1, 0, 1, 3); - - RBIteration = new QRadioButton(PursueIteration); - RBIteration->setObjectName(QStringLiteral("RBIteration")); - RBIteration->setChecked(true); - - gridLayout_2->addWidget(RBIteration, 2, 0, 1, 1); - - RBCase = new QRadioButton(PursueIteration); - RBCase->setObjectName(QStringLiteral("RBCase")); - - gridLayout_2->addWidget(RBCase, 2, 1, 1, 1); - - hboxLayout1 = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout1->setSpacing(6); -#endif - hboxLayout1->setContentsMargins(0, 0, 0, 0); - hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); - DirectoryStart = new QLabel(PursueIteration); - DirectoryStart->setObjectName(QStringLiteral("DirectoryStart")); - - hboxLayout1->addWidget(DirectoryStart); - - PushDirStart = new QPushButton(PursueIteration); - PushDirStart->setObjectName(QStringLiteral("PushDirStart")); - PushDirStart->setAutoDefault(false); - - hboxLayout1->addWidget(PushDirStart); - - LEDirNameStart = new QLineEdit(PursueIteration); - LEDirNameStart->setObjectName(QStringLiteral("LEDirNameStart")); - LEDirNameStart->setMinimumSize(QSize(382, 21)); - - hboxLayout1->addWidget(LEDirNameStart); - - - gridLayout_2->addLayout(hboxLayout1, 3, 0, 1, 3); - - GBIterationintoCase = new QGroupBox(PursueIteration); - GBIterationintoCase->setObjectName(QStringLiteral("GBIterationintoCase")); - gridLayout = new QGridLayout(GBIterationintoCase); - gridLayout->setObjectName(QStringLiteral("gridLayout")); - RBCaseLastIteration = new QRadioButton(GBIterationintoCase); - RBCaseLastIteration->setObjectName(QStringLiteral("RBCaseLastIteration")); - RBCaseLastIteration->setChecked(true); - - gridLayout->addWidget(RBCaseLastIteration, 0, 0, 1, 1); - - RBCaseNIteration = new QRadioButton(GBIterationintoCase); - RBCaseNIteration->setObjectName(QStringLiteral("RBCaseNIteration")); - - gridLayout->addWidget(RBCaseNIteration, 1, 0, 1, 1); - - SpinBoxNumber = new QSpinBox(GBIterationintoCase); - SpinBoxNumber->setObjectName(QStringLiteral("SpinBoxNumber")); - SpinBoxNumber->setMaximum(1789); - - gridLayout->addWidget(SpinBoxNumber, 1, 1, 1, 1); - - - gridLayout_2->addWidget(GBIterationintoCase, 4, 0, 1, 2); - - GroupButtons = new QGroupBox(PursueIteration); - GroupButtons->setObjectName(QStringLiteral("GroupButtons")); - gridLayout1 = new QGridLayout(GroupButtons); -#ifndef Q_OS_MAC - gridLayout1->setSpacing(6); -#endif -#ifndef Q_OS_MAC - gridLayout1->setContentsMargins(9, 9, 9, 9); -#endif - gridLayout1->setObjectName(QStringLiteral("gridLayout1")); - buttonHelp = new QPushButton(GroupButtons); - buttonHelp->setObjectName(QStringLiteral("buttonHelp")); - buttonHelp->setAutoDefault(false); - - gridLayout1->addWidget(buttonHelp, 0, 4, 1, 1); - - buttonApply = new QPushButton(GroupButtons); - buttonApply->setObjectName(QStringLiteral("buttonApply")); - buttonApply->setAutoDefault(false); - - gridLayout1->addWidget(buttonApply, 0, 1, 1, 1); - - buttonOk = new QPushButton(GroupButtons); - buttonOk->setObjectName(QStringLiteral("buttonOk")); - buttonOk->setAutoDefault(false); - - gridLayout1->addWidget(buttonOk, 0, 0, 1, 1); - - buttonCancel = new QPushButton(GroupButtons); - buttonCancel->setObjectName(QStringLiteral("buttonCancel")); - buttonCancel->setAutoDefault(false); - - gridLayout1->addWidget(buttonCancel, 0, 2, 1, 1); - - - gridLayout_2->addWidget(GroupButtons, 5, 0, 1, 2); - - spacer_2 = new QSpacerItem(128, 25, QSizePolicy::Fixed, QSizePolicy::Minimum); - - gridLayout_2->addItem(spacer_2, 5, 2, 1, 1); - - - retranslateUi(PursueIteration); - - QMetaObject::connectSlotsByName(PursueIteration); - } // setupUi - - void retranslateUi(QDialog *PursueIteration) - { - PursueIteration->setWindowTitle(QApplication::translate("PursueIteration", "Pursue an iteration", Q_NULLPTR)); - Name->setText(QApplication::translate("PursueIteration", "Name", Q_NULLPTR)); - Directory->setText(QApplication::translate("PursueIteration", "Directory", Q_NULLPTR)); - PushDir->setText(QString()); - RBIteration->setText(QApplication::translate("PursueIteration", "From an iteration", Q_NULLPTR)); - RBCase->setText(QApplication::translate("PursueIteration", "From a case", Q_NULLPTR)); - DirectoryStart->setText(QApplication::translate("PursueIteration", "Directory", Q_NULLPTR)); - PushDirStart->setText(QString()); - GBIterationintoCase->setTitle(QApplication::translate("PursueIteration", "Iteration into the case", Q_NULLPTR)); - RBCaseLastIteration->setText(QApplication::translate("PursueIteration", "Last iteration", Q_NULLPTR)); - RBCaseNIteration->setText(QApplication::translate("PursueIteration", "Iteration number", Q_NULLPTR)); - GroupButtons->setTitle(QString()); - buttonHelp->setText(QApplication::translate("PursueIteration", "Help", Q_NULLPTR)); - buttonApply->setText(QApplication::translate("PursueIteration", "Apply", Q_NULLPTR)); - buttonOk->setText(QApplication::translate("PursueIteration", "OK", Q_NULLPTR)); - buttonCancel->setText(QApplication::translate("PursueIteration", "Cancel", Q_NULLPTR)); - } // retranslateUi - -}; - -namespace Ui { - class PursueIteration: public Ui_PursueIteration {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_PURSUEITERATION_H From b8d0c082d520aaddf1ef96a26d4c92bb44877357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Thu, 4 Jun 2020 17:41:11 +0200 Subject: [PATCH 035/100] =?UTF-8?q?cosm=C3=A9tique?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SMESHGUI/SMESHGUI.cxx | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 53c94d6ec..4b664bf68 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -3034,8 +3034,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) } break; } - - // Adaptation - begin + // Adaptation - end case SMESHOp::OpUniformRefinement: case SMESHOp::OpHONewCase: case SMESHOp::OpHOCaseFollow: @@ -3048,10 +3047,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) { SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_nil(); SMESHGUI_AdaptDlg *aDlg = new SMESHGUI_AdaptDlg( this, theCommandID, aMesh); -// aDlg->show(); } // Adaptation - end - case SMESHOp::OpSplitBiQuadratic: case SMESHOp::OpConvertMeshToQuadratic: case SMESHOp::OpCreateBoundaryElements: // create 2D mesh from 3D @@ -4289,7 +4286,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createSMESHAction( SMESHOp::OpAutoColor, "AUTO_COLOR" ); createSMESHAction( SMESHOp::OpDisableAutoColor, "DISABLE_AUTO_COLOR" ); -// Mesh adaptation + // Adaptation - begin createSMESHAction( SMESHOp::OpUniformRefinement, "REF_ALL", "ICON_REF_ALL" ); createSMESHAction( SMESHOp::OpHONewCase, "HOMARD_CREATE_CASE", "ICON_HOMARD_CREATE_CASE" ); createSMESHAction( SMESHOp::OpHOCaseFollow, "HOMARD_FOLLOW_ITERATION", "ICON_HOMARD_FOLLOW_ITERATION" ); @@ -4299,6 +4296,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createSMESHAction( SMESHOp::OpHOEdit, "EDIT", "ICON_DLG_EDIT_MESH" ); createSMESHAction( SMESHOp::OpHODelete, "DELETE", "ICON_DELETE" ); createSMESHAction( SMESHOp::OpMGAdapt, "MG_ADAPT", "ICON_MG_ADAPT" ); + // Adaptation - end createSMESHAction( SMESHOp::OpMinimumDistance, "MEASURE_MIN_DIST", "ICON_MEASURE_MIN_DIST" ); createSMESHAction( SMESHOp::OpBoundingBox, "MEASURE_BND_BOX", "ICON_MEASURE_BND_BOX" ); @@ -4515,6 +4513,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createMenu( SMESHOp::OpSmoothing, modifyId, -1 ); createMenu( SMESHOp::OpPatternMapping, modifyId, -1 ); + // Adaptation - begin createMenu( SMESHOp::OpUniformRefinement, adaptId, -1 ); createMenu( SMESHOp::OpHONewCase, refHomardId, -1 ); createMenu( SMESHOp::OpHOCaseFollow, refHomardId, -1 ); @@ -4526,6 +4525,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createMenu( SMESHOp::OpHOEdit, refHomardId, -1 ); createMenu( SMESHOp::OpHODelete, refHomardId, -1 ); createMenu( SMESHOp::OpMGAdapt, adaptId, -1 ); + // Adaptation - end createMenu( SMESHOp::OpMinimumDistance, measureId, -1 ); createMenu( SMESHOp::OpBoundingBox, measureId, -1 ); @@ -4554,7 +4554,7 @@ void SMESHGUI::initialize( CAM_Application* app ) //renumbTb = createTool( tr( "TB_RENUMBER" ), QString( "SMESHRenumberingToolbar" ) ), transformTb = createTool( tr( "TB_TRANSFORM" ), QString( "SMESHTransformationToolbar" ) ), modifyTb = createTool( tr( "TB_MODIFY" ), QString( "SMESHModificationToolbar" ) ), -// adaptTb = createTool( tr( "TB_ADAPTATION" ),QString( "SMESHAdaptationToolbar" ) ), + adaptTb = createTool( tr( "TB_ADAPTATION" ),QString( "SMESHAdaptationToolbar" ) ), measuremTb = createTool( tr( "TB_MEASUREM" ), QString( "SMESHMeasurementsToolbar" ) ), dispModeTb = createTool( tr( "TB_DISP_MODE" ), QString( "SMESHDisplayModeToolbar" ) ); @@ -4674,9 +4674,11 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpSmoothing, modifyTb ); createTool( SMESHOp::OpPatternMapping, modifyTb ); -// createTool( SMESHOp::OpUniformRefinement, adaptTb ); + // Adaptation - begin + createTool( SMESHOp::OpUniformRefinement, adaptTb ); // createTool( SMESHOp::OpHOMARDRefinement, adaptTb ); -// createTool( SMESHOp::OpMGAdapt, adaptTb ); + createTool( SMESHOp::OpMGAdapt, adaptTb ); + // Adaptation - end createTool( SMESHOp::OpMinimumDistance, measuremTb ); @@ -4759,9 +4761,11 @@ void SMESHGUI::initialize( CAM_Application* app ) //popupMgr()->insert( separator(), -1, 0 ); + // Adaptation - begin // createPopupItem( SMESHOp::OpUniformRefinement, OB, mesh ); // createPopupItem( SMESHOp::OpHOMARDRefinement, OB, mesh ); // createPopupItem( SMESHOp::OpMGAdapt, OB, mesh ); + // Adaptation - end QString only_one_non_empty = QString( " && %1=1 && numberOfNodes>0" ).arg( dc ); QString multiple_non_empty = QString( " && %1>0 && numberOfNodes>0" ).arg( dc ); @@ -5745,6 +5749,7 @@ void SMESHGUI::createPreferences() setPreferenceProperty( coloringType, "indexes", indices ); addPreference( tr( "SMESH_DISTRIBUTION_COLOR" ), distributionGr, LightApp_Preferences::Color, "SMESH", "distribution_color" ); + // Adaptation - begin // Adaptation tab ------------------------------------------------------------------------ int adaptTab = addPreference( tr( "ADAPT_PREF_TAB_GENERAL" ) ); int bloc, pref ; @@ -5776,6 +5781,7 @@ void SMESHGUI::createPreferences() aListOfTypeTest << "VTest > VRef"; aListOfTypeTest << "VTest < VRef"; setPreferenceProperty( pref, "strings", aListOfTypeTest ); + // Adaptation - end } @@ -5987,6 +5993,7 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const case SMESHOp::OpElem0DOnElemNodes: // Create 0D elements on all nodes op = new SMESHGUI_Add0DElemsOnAllNodesOp(); break; + // Adaptation - begin case SMESHOp::OpUniformRefinement: case SMESHOp::OpHONewCase: case SMESHOp::OpHOCaseFollow: @@ -5997,6 +6004,7 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const case SMESHOp::OpHODelete: case SMESHOp::OpMGAdapt: break; + // Adaptation - end default: break; } From d72d95195cff80e11734325856974e3d40dce7ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Thu, 4 Jun 2020 17:41:47 +0200 Subject: [PATCH 036/100] =?UTF-8?q?m=C3=A9nage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SMESHGUI/SMESHGUI_AdaptDlg.cxx | 2964 +--------------------------- src/SMESHGUI/SMESHGUI_AdaptDlg.h | 169 +- 2 files changed, 52 insertions(+), 3081 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx index 48ab56388..a83311fdf 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx @@ -24,99 +24,21 @@ // SMESH includes #include "SMESHGUI.h" #include "SMESHGUI_AdaptDlg.h" -#include "SMESHGUI_Utils.h" -#include "SMESHGUI_VTKUtils.h" -#include "SMESHGUI_GroupUtils.h" -#include "SMESHGUI_FilterUtils.h" -#include "SMESHGUI_GEOMGenUtils.h" -#include "SMESHGUI_FilterDlg.h" -#include "SMESHGUI_ShapeByMeshDlg.h" - -#include -#include -//#include -#include - -// SALOME GEOM includes -#include -#include -#include // SALOME GUI includes -#include -#include -#include #include -#include -#include #include #include -#include #include #include -#include -#include - -// Qt includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // HOMARD includes #include "MonCreateCase.h" -// STL includes -#include -#include -#include - -// VTK includes -#include -#include - // SALOME KERNEL includes -#include -#include -#include -#include -#include -#include #include "utilities.h" #include -// OCCT includes -#include - -#define SPACING 6 -#define MARGIN 11 - -enum grpSelectionMode { - grpNoSelection = -1, - grpNodeSelection = 0, - grp0DSelection = 1, - grpBallSelection = 2, - grpEdgeSelection = 3, - grpFaceSelection = 4, - grpVolumeSelection = 5, - grpSubMeshSelection = 6, - grpGroupSelection = 7, - grpMeshSelection = 8, - grpGeomSelection = 9, - grpAllSelection = 10, -}; - //================================================================================= // function : SMESHGUI_AdaptDlg() // purpose : @@ -124,18 +46,19 @@ enum grpSelectionMode { SMESHGUI_AdaptDlg::SMESHGUI_AdaptDlg( SMESHGUI* theModule, int theCommandID, SMESH::SMESH_Mesh_ptr theMesh ) - : QDialog( SMESH::GetDesktop( theModule ) ), - mySMESHGUI( theModule ), - mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), myStoredShownEntity(0), - mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ), - myIsBusy( false ), - myNameChanged( false ), - myNbChangesOfContents(0), - myIsApplyAndClose( false ) + : mySMESHGUI( theModule ) { bool ok = action( theCommandID ) ; } +//================================================================================= +// function : ~SMESHGUI_AdaptDlg() +// purpose : Destroys the object and frees any allocated resources +//================================================================================= +SMESHGUI_AdaptDlg::~SMESHGUI_AdaptDlg() +{ +} + /*! * \brief Pilote les actions d'adaption de maillage * \param @@ -145,10 +68,10 @@ bool SMESHGUI_AdaptDlg::action (int theCommandID) //======================================================================= { std::cout << "SMESHGUI_AdaptDlg::action avec theCommandID : " << theCommandID << std::endl; - + // Preferences recupPreferences(); - + // Menus and actions bool ok = OnGUIEvent (theCommandID) ; if ( ! ok ) INFOS("Erreur"); @@ -160,7 +83,7 @@ bool SMESHGUI_AdaptDlg::action (int theCommandID) * \brief Gets the preferences for the adaptation * \param * \return - * + * * Pour chaque valeur, le defaut est la valeur definie dans ADAPT_Gen * . Si la recuperation dans config/salome s'est bien passee a la creation de ADAPT_Gen * ces valeurs sont les valeurs definies. @@ -186,7 +109,7 @@ void SMESHGUI_AdaptDlg::recupPreferences() _LanguageShort = resMgr->stringValue("language", "language", "en" ); INFOS ("Enregistrement de LanguageShort = " << _LanguageShort.toStdString().c_str() ); - adaptGen->SetLanguageShort(_LanguageShort.toStdString().c_str()); +// adaptGen->SetLanguageShort(_LanguageShort.toStdString().c_str()); // B.2. Les publications bool publish_mesh ; @@ -200,7 +123,7 @@ void SMESHGUI_AdaptDlg::recupPreferences() else { _PublisMeshOUT = 0 ; } INFOS ("Enregistrement de PublisMeshIN = " << _PublisMeshIN<<", PublisMeshOUT = "<< _PublisMeshOUT); - adaptGen->SetPublisMesh(_PublisMeshIN, _PublisMeshOUT); +// adaptGen->SetPublisMesh(_PublisMeshIN, _PublisMeshOUT); // B.3. Les maximum pour YACS @@ -209,7 +132,7 @@ void SMESHGUI_AdaptDlg::recupPreferences() _YACSMaxElem = resMgr->integerValue("HOMARD", "yacs_max_elem", 0 ); INFOS ("Enregistrement de YACSMaxIter = " << _YACSMaxIter<<", YACSMaxNode = "<< _YACSMaxNode<<", YACSMaxElem = "<< _YACSMaxElem); - adaptGen->SetYACSMaximum(_YACSMaxIter, _YACSMaxNode, _YACSMaxElem); +// adaptGen->SetYACSMaximum(_YACSMaxIter, _YACSMaxNode, _YACSMaxElem); // B.4. La convergence pour YACS @@ -219,7 +142,7 @@ void SMESHGUI_AdaptDlg::recupPreferences() else { _YACSTypeTest = 0 ; } INFOS ("Enregistrement de YACSTypeTest = " << _YACSTypeTest); - adaptGen->SetYACSConvergenceType(_YACSTypeTest); +// adaptGen->SetYACSConvergenceType(_YACSTypeTest); INFOS("Fin de recupPreferences") } @@ -254,2862 +177,77 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) mySMESHGUI->getApp()->updateObjectBrowser(); // // B. Choix selon les commandes + bool ok = true ; SCRUTE(theCommandID); switch (theCommandID) { - case 8011: // Creation d un Cas + case 8000: // Raffinement uniforme { - INFOS("Creation d'un Cas"); + INFOS("Raffinement uniforme"); +// A faire + break; + } + case 8011: // Création d'un Cas + { + INFOS("Création d'un Cas"); MonCreateCase *aDlg = new MonCreateCase( true, ADAPT::ADAPT_Gen::_duplicate(adaptGen) ) ; aDlg->show(); break; } - -// case 8012: // Poursuite d une iteration -// { -// INFOS("command " << theCommandID << " activated"); + case 8012: // Création d'un cas en poursuite d'une itération + { + INFOS("Création d'un cas en poursuite d'une itération"); // MonPursueIteration *aDlg = new MonPursueIteration( true, // ADAPT::ADAPT_Gen::_duplicate(adaptGen) ) ; // aDlg->show(); // break; -// } - -// case 8013: // Creation d une Iteration -// { -// INFOS("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); + } + case 8013: // Création d'une itération + { + INFOS("Création d'une itération" ); // MonCreateIteration *IterDlg = new MonCreateIteration( parent, true, // ADAPT::ADAPT_Gen::_duplicate(adaptGen), _ObjectName ) ; // IterDlg->show(); -// break; -// } - -// case 8014: // Compute une iteration -// { -// INFOS("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); + break; + } + case 8014: // Calcule une itération + { + INFOS("Calcule une itération" ); // try { adaptGen->Compute(_ObjectName.toStdString().c_str(), 0, 1, -1, 1); } // catch( SALOME::SALOME_Exception& S_ex ) // { // QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), // QObject::tr(CORBA::string_dup(S_ex.details.text)) ); // mySMESHGUI->getApp()->updateObjectBrowser(); -// return false; +// ok = false; // } -// break; -// } - -// case 8015: // Compute une iteration et publication -// { -// INFOS("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); + break; + } + case 8015: // Calcule une itération et publication + { + INFOS("Calcule une itération et publication"); // try { adaptGen->Compute(_ObjectName.toStdString().c_str(), 0, 1, -1, 2); } // catch( SALOME::SALOME_Exception& S_ex ) // { // QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), // QObject::tr(CORBA::string_dup(S_ex.details.text)) ); // mySMESHGUI->getApp()->updateObjectBrowser(); -// return false; +// ok = false; // } -// break; -// } - -// case 1121: // Information sur le maillage de l'iteration -// { -// INFOS("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// MonIterInfo *IterDlg = new MonIterInfo( parent, true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), _ObjectName ) ; -// IterDlg->show(); -// break; -// } -// -// case 1131: // Publication du maillage de l'iteration -// { -// INFOS("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// adaptGen->PublishMeshIterInSmesh(_ObjectName.toStdString().c_str()); -// break; -// } -// -// case 1132: // Publication du maillage de l'iteration a partir du fichier -// { -// INFOS("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// adaptGen->PublishResultInSmesh(_ObjectName.toStdString().c_str(), 1); -// break; -// } -// -// case 1201: // Edition d'un objet -// { -// INFOS("command " << theCommandID << " activated"); -// QString nomObjet = HOMARD_QT_COMMUN::SelectionArbreEtude(QString(""), 1); -// if (nomObjet == QString("")) break; -// _PTR(SObject) obj = chercheMonObjet(); -// if (obj) -// { -// // Edition d'une frontiere CAO -// if (HOMARD_UTILS::isBoundaryCAO(obj)) -// { -// MonEditBoundaryCAO *aDlg = new MonEditBoundaryCAO(0, true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), QString(""), _ObjectName ) ; -// aDlg->show(); -// } -// // Edition d'une frontiere discrete -// else if (HOMARD_UTILS::isBoundaryDi(obj)) -// { -// MonEditBoundaryDi *aDlg = new MonEditBoundaryDi(0, true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), QString(""), _ObjectName ) ; -// aDlg->show(); -// } -// // Edition d'une frontiere analytique -// else if (HOMARD_UTILS::isBoundaryAn(obj)) -// { -// MonEditBoundaryAn *aDlg = new MonEditBoundaryAn(0, true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), QString(""), _ObjectName ) ; -// aDlg->show(); -// } -// // Edition d'un cas -// else if (HOMARD_UTILS::isCase(obj)) -// { -// MonEditCase *aDlg = new MonEditCase(true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), _ObjectName ) ; -// aDlg->show(); -// } -// // Edition d'une hypothese -// else if (HOMARD_UTILS::isHypo(obj)) -// { -// MonEditHypothesis *aDlg = new MonEditHypothesis(0, true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), _ObjectName, QString(""), QString("")) ; -// aDlg->show(); -// } -// // Edition d'une iteration -// else if (HOMARD_UTILS::isIter(obj)) -// { -// MonEditIteration *aDlg = new MonEditIteration(parent, true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), QString(""), _ObjectName ) ; -// aDlg->show(); -// } -// // Edition d'un schema YACS -// else if (HOMARD_UTILS::isYACS(obj)) -// { -// INFOS("appel de MonEditYACS"); -// MonEditYACS *aDlg = new MonEditYACS(true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), _ObjectName) ; -// aDlg->show(); -// } -// // Edition d'une zone -// else if (HOMARD_UTILS::isZone(obj)) -// { -// MonEditZone *aDlg = new MonEditZone(0, true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), QString(""), _ObjectName ) ; -// aDlg->show(); -// } -// } -// break; -// } -// -// case 1211: // Suppression d'un objet -// { -// INFOS("command " << theCommandID << " activated"); -// QString nomObjet = HOMARD_QT_COMMUN::SelectionArbreEtude(QString(""), 1); -// if (nomObjet == QString("")) break; -// _PTR(SObject) obj = chercheMonObjet(); -// if (obj) -// { -// // Suppression d'une frontiere -// if ( HOMARD_UTILS::isBoundaryCAO(obj) || HOMARD_UTILS::isBoundaryDi(obj) || HOMARD_UTILS::isBoundaryAn(obj) ) -// { -// try -// { adaptGen->DeleteBoundary(_ObjectName.toStdString().c_str()); } -// catch( SALOME::SALOME_Exception& S_ex ) -// { -// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), -// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// mySMESHGUI->getApp()->updateObjectBrowser(); -// return false; -// } -// } -// // Suppression d'un cas -// else if (HOMARD_UTILS::isCase(obj)) -// { -// try -// { adaptGen->DeleteCase(_ObjectName.toStdString().c_str(), 1); } -// catch( SALOME::SALOME_Exception& S_ex ) -// { -// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), -// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// mySMESHGUI->getApp()->updateObjectBrowser(); -// return false; -// } -// } -// // Suppression d'une hypothese -// else if (HOMARD_UTILS::isHypo(obj)) -// { -// try -// { adaptGen->DeleteHypo(_ObjectName.toStdString().c_str()); } -// catch( SALOME::SALOME_Exception& S_ex ) -// { -// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), -// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// mySMESHGUI->getApp()->updateObjectBrowser(); -// return false; -// } -// } -// // Suppression d'une iteration -// else if (HOMARD_UTILS::isIter(obj)) -// { -// try -// { adaptGen->DeleteIteration(_ObjectName.toStdString().c_str(), 1); } -// catch( SALOME::SALOME_Exception& S_ex ) -// { -// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), -// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// mySMESHGUI->getApp()->updateObjectBrowser(); -// return false; -// } -// } -// // Suppression d'un schema YACS -// else if (HOMARD_UTILS::isYACS(obj)) -// { -// try -// { adaptGen->DeleteYACS(_ObjectName.toStdString().c_str(), 1); } -// catch( SALOME::SALOME_Exception& S_ex ) -// { -// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), -// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// mySMESHGUI->getApp()->updateObjectBrowser(); -// return false; -// } -// } -// // Suppression d'une zone -// else if (HOMARD_UTILS::isZone(obj)) -// { -// try -// { adaptGen->DeleteZone(_ObjectName.toStdString().c_str()); } -// catch( SALOME::SALOME_Exception& S_ex ) -// { -// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), -// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// mySMESHGUI->getApp()->updateObjectBrowser(); -// return false; -// } -// } -// } -// break; -// } -// -// case 1301: // Information sur un maillage -// { -// INFOS("etape 1301") -// INFOS("command " << theCommandID << " activated"); -// MonMeshInfo *aDlg = new MonMeshInfo( parent, true, ADAPT::ADAPT_Gen::_duplicate(adaptGen) ) ; -// aDlg->show(); -// break; -// } -// -// case 1302: // Affichage de fichier texte -// { -// INFOS("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// _PTR(SObject) obj = chercheMonObjet(); -// if ( (obj) && ( HOMARD_UTILS::isFileType(obj,QString("log")) || HOMARD_UTILS::isFileType(obj,QString("Summary")) || HOMARD_UTILS::isFileType(obj,QString("xml")) ) ) -// { -// MonEditFile *aDlg = new MonEditFile( 0, true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), _ObjectName, 0 ) ; -// if ( aDlg->_codret == 0 ) { aDlg->show(); } -// } -// break; -// } -// -// case 1401: // Création d'un schema YACS -// { -// INFOS("etape 1401") -// INFOS("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// MonCreateYACS *aDlg = new MonCreateYACS( true, ADAPT::ADAPT_Gen::_duplicate(adaptGen), _ObjectName ) ; -// aDlg->show(); -// break; -// } -// -// case 1402: // Ecriture d'un schéma YACS -// { -// INFOS("etape 1402") -// INFOS("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); -// try { adaptGen->YACSWrite(_ObjectName.toStdString().c_str()); } -// catch( SALOME::SALOME_Exception& S_ex ) -// { -// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), -// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// mySMESHGUI->getApp()->updateObjectBrowser(); -// return false; -// } -// break; -// } - - } -// mySMESHGUI->getApp()->updateObjectBrowser(); - return true; -} - -//================================================================================= -// function : SMESHGUI_AdaptDlg() -// purpose : -//================================================================================= -void SMESHGUI_AdaptDlg::initDialog( bool create) -{ - std::cout << "passage par initDialog" << std::endl; - setModal( false ); - setAttribute( Qt::WA_DeleteOnClose, true ); - - myFilterDlg = 0; - myCreate = create; - myCurrentLineEdit = 0; - - myShapeByMeshOp = 0; - myGeomPopup = 0; - myGeomObjects = new GEOM::ListOfGO(); - myGeomObjects->length( 0 ); - - QPixmap image0( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH", tr( "ICON_SELECT" ) ) ); - - setWindowTitle( create ? tr( "SMESH_CREATE_GROUP_TITLE" ) : tr( "SMESH_EDIT_GROUP_TITLE" ) ); - myHelpFileName = create ? "creating_groups.html" : "editing_groups.html"; - - setSizeGripEnabled( true); - - QGridLayout* aMainLayout = new QGridLayout( this ); - aMainLayout->setMargin( MARGIN ); - aMainLayout->setSpacing( SPACING ); - - /***************************************************************/ - QLabel* meshGroupLab = new QLabel( create ? tr( "SMESH_MESH" ) : tr( "SMESH_GROUP" ), this ); - myMeshGroupBtn = new QPushButton( this ); - myMeshGroupBtn->setIcon( image0 ); - myMeshGroupLine = new QLineEdit( this ); - myMeshGroupLine->setReadOnly( true ); - - /***************************************************************/ - QGroupBox* aTypeBox = new QGroupBox( tr( "SMESH_ELEMENTS_TYPE" ), this ); - myTypeGroup = new QButtonGroup( this ); - QHBoxLayout* aTypeBoxLayout = new QHBoxLayout( aTypeBox ); - aTypeBoxLayout->setMargin( MARGIN ); - aTypeBoxLayout->setSpacing( SPACING ); - - QStringList types; - types.append( tr( "MESH_NODE" ) ); - types.append( tr( "SMESH_ELEM0D" ) ); - types.append( tr( "SMESH_BALL_ELEM" ) ); - types.append( tr( "SMESH_EDGE" ) ); - types.append( tr( "SMESH_FACE" ) ); - types.append( tr( "SMESH_VOLUME" ) ); - QRadioButton* rb; - for ( int i = 0; i < types.count(); i++ ) - { - rb = new QRadioButton( types[i], aTypeBox ); - myTypeGroup->addButton( rb, i ); - aTypeBoxLayout->addWidget( rb ); - } - aTypeBox->setEnabled( create ); - myTypeId = -1; - - /***************************************************************/ - QLabel* aName = new QLabel( tr( "SMESH_NAME" ), this ); - aName->setMinimumWidth( 50 ); - myName = new QLineEdit( this ); - - /***************************************************************/ - QGroupBox* aGrpTypeBox = new QGroupBox( tr( "SMESH_GROUP_TYPE" ), this ); - myGrpTypeGroup = new QButtonGroup( this ); - QHBoxLayout* aGrpTypeBoxLayout = new QHBoxLayout( aGrpTypeBox ); - aGrpTypeBoxLayout->setMargin( MARGIN ); - aGrpTypeBoxLayout->setSpacing( SPACING ); - - QRadioButton* rb1 = new QRadioButton( tr( "SMESH_GROUP_STANDALONE" ), aGrpTypeBox ); - QRadioButton* rb2 = new QRadioButton( tr( "SMESH_GROUP_GEOMETRY" ), aGrpTypeBox ); - QRadioButton* rb3 = new QRadioButton( tr( "SMESH_GROUP_FILTER" ), aGrpTypeBox ); - myGrpTypeGroup->addButton( rb1, 0 ); - myGrpTypeGroup->addButton( rb2, 1 ); - myGrpTypeGroup->addButton( rb3, 2 ); - aGrpTypeBoxLayout->addWidget( rb1 ); - aGrpTypeBoxLayout->addWidget( rb2 ); - aGrpTypeBoxLayout->addWidget( rb3 ); - aGrpTypeBox->setEnabled( create ); - myGrpTypeId = -1; - - /***************************************************************/ - myWGStack = new QStackedWidget( this ); - QWidget* wg1 = new QWidget( myWGStack ); - QWidget* wg2 = new QWidget( myWGStack ); - QWidget* wg3 = new QWidget( myWGStack ); - - /***************************************************************/ - QGroupBox* aContentBox = new QGroupBox( tr( "SMESH_CONTENT" ), wg1 ); - QGridLayout* aContentBoxLayout = new QGridLayout( aContentBox ); - aContentBoxLayout->setMargin( MARGIN ); - aContentBoxLayout->setSpacing( SPACING ); - - mySelectAll = new QCheckBox( tr( "SELECT_ALL" ), aContentBox ); - myAllowElemsModif = new QCheckBox( tr( "ALLOW_ELEM_LIST_MODIF" ), aContentBox ); - - myElementsLab = new QLabel( tr( "SMESH_ID_ELEMENTS" ), aContentBox ); - myElements = new QListWidget( aContentBox ); - myElements->setSelectionMode( QListWidget::ExtendedSelection ); - - myFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), aContentBox ); - myAddBtn = new QPushButton( tr( "SMESH_BUT_ADD" ), aContentBox ); - myRemoveBtn = new QPushButton( tr( "SMESH_BUT_REMOVE" ), aContentBox ); - mySortBtn = new QPushButton( tr( "SMESH_BUT_SORT" ), aContentBox ); - - aContentBoxLayout->addWidget( mySelectAll, 0, 0 ); - aContentBoxLayout->addWidget( myAllowElemsModif, 1, 0 ); - aContentBoxLayout->addWidget( myFilterBtn, 1, 1 ); - aContentBoxLayout->addWidget( myElementsLab, 2, 0 ); - aContentBoxLayout->addWidget( myElements, 3, 0, 6, 1 ); - aContentBoxLayout->addWidget( myAddBtn, 3, 1 ); - aContentBoxLayout->addWidget( myRemoveBtn, 4, 1 ); - aContentBoxLayout->addWidget( mySortBtn, 8, 1 ); - - aContentBoxLayout->setColumnStretch( 0, 1 ); - aContentBoxLayout->setRowStretch( 3, 1 ); - aContentBoxLayout->setRowStretch( 6, 1 ); - - /***************************************************************/ - mySelectBox = new QGroupBox( tr( "SMESH_SELECT_FROM" ), wg1 ); - QGridLayout* mySelectBoxLayout = new QGridLayout( mySelectBox ); - mySelectBoxLayout->setMargin( MARGIN ); - mySelectBoxLayout->setSpacing( SPACING ); - - mySelectSubMesh = new QCheckBox( tr( "SMESH_SUBMESH" ), mySelectBox ); - mySubMeshBtn = new QPushButton( mySelectBox ); - mySubMeshBtn->setIcon( image0 ); - mySubMeshLine = new QLineEdit( mySelectBox ); - mySubMeshLine->setReadOnly( true ); - onSelectSubMesh( false ); - - mySelectGroup = new QCheckBox( tr( "SMESH_GROUP" ), mySelectBox ); - myGroupBtn = new QPushButton( mySelectBox ); - myGroupBtn->setIcon( image0 ); - myGroupLine = new QLineEdit( mySelectBox ); - myGroupLine->setReadOnly( true ); - onSelectGroup( false ); - - mySelectBoxLayout->addWidget( mySelectSubMesh, 0, 0 ); - mySelectBoxLayout->addWidget( mySubMeshBtn, 0, 1 ); - mySelectBoxLayout->addWidget( mySubMeshLine, 0, 2 ); - mySelectBoxLayout->addWidget( mySelectGroup, 1, 0 ); - mySelectBoxLayout->addWidget( myGroupBtn, 1, 1 ); - mySelectBoxLayout->addWidget( myGroupLine, 1, 2 ); - - /***************************************************************/ - QVBoxLayout* wg1Layout = new QVBoxLayout( wg1 ); - wg1Layout->setMargin( 0 ); - wg1Layout->setSpacing( SPACING ); - wg1Layout->addWidget( aContentBox ); - wg1Layout->addWidget( mySelectBox ); - wg1Layout->setStretchFactor( aContentBox, 10 ); - - /***************************************************************/ - QLabel* geomObject = new QLabel( tr( "SMESH_OBJECT_GEOM" ), wg2 ); - myGeomGroupBtn = new QToolButton( wg2 ); - myGeomGroupBtn->setIcon( image0 ); - myGeomGroupBtn->setCheckable( true ); - myGeomGroupLine = new QLineEdit( wg2 ); - myGeomGroupLine->setReadOnly( true ); //VSR ??? - onSelectGeomGroup( false ); - - myGeomGroupBtn->setEnabled( create ); - myGeomGroupLine->setEnabled( create ); - - /***************************************************************/ - QGridLayout* wg2Layout = new QGridLayout( wg2 ); - wg2Layout->setMargin( 0 ); - wg2Layout->setSpacing( SPACING ); - wg2Layout->addWidget( geomObject, 0, 0 ); - wg2Layout->addWidget( myGeomGroupBtn, 0, 1 ); - wg2Layout->addWidget( myGeomGroupLine,0, 2 ); - wg2Layout->setRowStretch( 1, 5 ); - - /***************************************************************/ - QPushButton * aFilter2 = new QPushButton( tr( "SMESH_BUT_FILTER" ), wg3 ); - QGridLayout* wg3Layout = new QGridLayout( wg3 ); - wg3Layout->setMargin( 0 ); - wg3Layout->setSpacing( SPACING ); - wg3Layout->addWidget( aFilter2, 0, 0 ); - wg3Layout->setRowStretch( 1, 5 ); - - /***************************************************************/ - myWGStack->insertWidget( 0, wg1 ); - myWGStack->insertWidget( 1, wg2 ); - myWGStack->insertWidget( 2, wg3 ); - - /***************************************************************/ - QGroupBox* aColorBox = new QGroupBox(tr( "SMESH_SET_COLOR" ), this); - QHBoxLayout* aColorBoxLayout = new QHBoxLayout(aColorBox); - aColorBoxLayout->setMargin(MARGIN); - aColorBoxLayout->setSpacing(SPACING); - - QLabel* aColorLab = new QLabel(tr( "SMESH_CHECK_COLOR" ), aColorBox ); - myColorBtn = new QtxColorButton(aColorBox); - myColorBtn->setSizePolicy( QSizePolicy::MinimumExpanding, - myColorBtn->sizePolicy().verticalPolicy() ); - - aColorBoxLayout->addWidget(aColorLab); - aColorBoxLayout->addWidget(myColorBtn); - - /***************************************************************/ - - QFrame* aButtons = new QFrame(this); - aButtons->setFrameStyle( QFrame::Box | QFrame::Sunken ); - QHBoxLayout* aBtnLayout = new QHBoxLayout(aButtons); - aBtnLayout->setMargin(MARGIN); - aBtnLayout->setSpacing(SPACING); - - myOKBtn = new QPushButton(tr( "SMESH_BUT_APPLY_AND_CLOSE" ), aButtons); - myOKBtn->setAutoDefault(true); - myOKBtn->setDefault(true); - myApplyBtn = new QPushButton(tr( "SMESH_BUT_APPLY" ), aButtons); - myApplyBtn->setAutoDefault(true); - myCloseBtn = new QPushButton(tr( "SMESH_BUT_CLOSE" ), aButtons); - myCloseBtn->setAutoDefault(true); - myHelpBtn = new QPushButton(tr( "SMESH_BUT_HELP" ), aButtons); - myHelpBtn->setAutoDefault(true); - - aBtnLayout->addWidget(myOKBtn); - aBtnLayout->addSpacing(10); - aBtnLayout->addWidget(myApplyBtn); - aBtnLayout->addSpacing(10); - aBtnLayout->addStretch(); - aBtnLayout->addWidget(myCloseBtn); - aBtnLayout->addWidget(myHelpBtn); - - /***************************************************************/ - aMainLayout->addWidget(meshGroupLab, 0, 0); - aMainLayout->addWidget(myMeshGroupBtn, 0, 1); - aMainLayout->addWidget(myMeshGroupLine, 0, 2); - aMainLayout->addWidget(aTypeBox, 1, 0, 1, 3); - aMainLayout->addWidget(aName, 2, 0); - aMainLayout->addWidget(myName, 2, 2); - aMainLayout->addWidget(aGrpTypeBox, 3, 0, 1, 3); - aMainLayout->addWidget(myWGStack, 4, 0, 1, 3); - aMainLayout->addWidget(aColorBox, 5, 0, 1, 3); - aMainLayout->addWidget(aButtons, 6, 0, 1, 3); - - /* signals and slots connections */ - connect(myMeshGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection())); - connect(myGrpTypeGroup, SIGNAL(buttonClicked(int)), this, SLOT(onGrpTypeChanged(int))); - connect(myTypeGroup, SIGNAL(buttonClicked(int)), this, SLOT(onTypeChanged(int))); - - connect(myName, SIGNAL(textChanged(const QString&)), this, SLOT(onNameChanged(const QString&))); - connect(myElements, SIGNAL(itemSelectionChanged()), this, SLOT(onListSelectionChanged())); - - connect(myFilterBtn, SIGNAL(clicked()), this, SLOT(setFilters())); - connect(aFilter2, SIGNAL(clicked()), this, SLOT(setFilters())); - connect(mySelectAll, SIGNAL(toggled(bool)), this, SLOT(onSelectAll())); - connect(myAllowElemsModif,SIGNAL(toggled(bool)), this, SLOT(onSelectAll())); - connect(myAddBtn, SIGNAL(clicked()), this, SLOT(onAdd())); - connect(myRemoveBtn, SIGNAL(clicked()), this, SLOT(onRemove())); - connect(mySortBtn, SIGNAL(clicked()), this, SLOT(onSort())); - - connect(mySelectSubMesh, SIGNAL(toggled(bool)), this, SLOT(onSelectSubMesh(bool))); - connect(mySelectGroup, SIGNAL(toggled(bool)), this, SLOT(onSelectGroup(bool))); - connect(mySubMeshBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection())); - connect(myGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection())); - connect(myGeomGroupBtn, SIGNAL(toggled(bool)), this, SLOT(onGeomSelectionButton(bool))); - - connect(myColorBtn, SIGNAL(changed( QColor )), this, SLOT(onColorChanged( QColor ))); - - connect(myOKBtn, SIGNAL(clicked()), this, SLOT(onOK())); - connect(myApplyBtn, SIGNAL(clicked()), this, SLOT(onApply())); - connect(myCloseBtn, SIGNAL(clicked()), this, SLOT(reject())); - connect(myHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp())); - - /* Init selection */ - mySMESHGUI->SetActiveDialogBox(this); - - SalomeApp_Study* aStudy = dynamic_cast( mySMESHGUI->application()->activeStudy() ); - mySelectionMode = grpNoSelection; - - myMeshFilter = new SMESH_TypeFilter(SMESH::MESH); - mySubMeshFilter = new SMESH_LogicalFilter(QList(), - SMESH_LogicalFilter::LO_OR, - /*takeOwnership=*/true); - myGroupFilter = new SMESH_LogicalFilter(QList(), - SMESH_LogicalFilter::LO_OR, - /*takeOwnership=*/true); - myGeomFilter = new GEOM_SelectionFilter( aStudy, true ); - - connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(onDeactivate())); - connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject())); - connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onObjectSelectionChanged())); - connect(mySMESHGUI, SIGNAL(SignalVisibilityChanged()), this, SLOT(onVisibilityChanged())); - connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), this, SLOT(onOpenView())); - connect(mySMESHGUI, SIGNAL(SignalCloseView()), this, SLOT(onCloseView())); - rb1->setChecked(true); // VSR !!! - onGrpTypeChanged(0); // VSR!!! - - if (myMesh->_is_nil() ) - myTypeGroup->button(0)->setChecked(true); - - onSelectAll(); //updateButtons(); -} - -//================================================================================= -// function : ~SMESHGUI_AdaptDlg() -// purpose : Destroys the object and frees any allocated resources -//================================================================================= -SMESHGUI_AdaptDlg::~SMESHGUI_AdaptDlg() -{ - // no need to delete child widgets, Qt does it all for us - if ( myFilterDlg != 0 ) { - myFilterDlg->setParent( 0 ); - delete myFilterDlg; - } - if ( myMeshFilter ) delete myMeshFilter; - if ( mySubMeshFilter ) delete mySubMeshFilter; - if ( myGroupFilter ) delete myGroupFilter; - if ( myGeomFilter ) delete myGeomFilter; -} - -//================================================================================= -// function : GetDefaultName() -// purpose : Get the Group Name if Create new Group -//================================================================================= -QString SMESHGUI_AdaptDlg::GetDefaultName(const QString& theOperation) -{ - std::cout << "passage par GetDefaultName" << std::endl; - QString aName = ""; - - // collect all object names of SMESH component - _PTR(Study) aStudy = SMESH::getStudy(); - - std::set aSet; - _PTR(SComponent) aMeshCompo (aStudy->FindComponent( "SMESH" )); - if (aMeshCompo) { - _PTR(ChildIterator) it (aStudy->NewChildIterator(aMeshCompo)); - _PTR(SObject) obj; - for (it->InitEx(true); it->More(); it->Next()) { - obj = it->Value(); - aSet.insert(obj->GetName()); - } - } - - // build a unique name - int aNumber = 0; - bool isUnique = false; - while (!isUnique) { - aName = theOperation + "_" + QString::number(++aNumber); - isUnique = (aSet.count(std::string(aName.toUtf8().constData())) == 0); - } - - return aName; -} - -void SMESHGUI_AdaptDlg::setDefaultName() const -{ - std::cout << "passage par setDefaultName" << std::endl; - QString aResName; - int i=1; - QString aPrefix ="Group_"; - _PTR(SObject) anObj; - do - { - aResName = aPrefix + QString::number( i++ ); - anObj = SMESH::getStudy()->FindObject( aResName.toUtf8().constData() ); - } - while ( anObj ); - myName->setText(aResName); -} - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void SMESHGUI_AdaptDlg::init (SMESH::SMESH_Mesh_ptr theMesh) -{ - std::cout << "passage par init (SMESH::SMESH_Mesh_ptr theMesh)" << std::endl; - mySelectionMgr->installFilter(myMeshFilter); - - /* init data from current selection */ - restoreShowEntityMode(); - myMesh = SMESH::SMESH_Mesh::_duplicate(theMesh); - setShowEntityMode(); - myGroup = SMESH::SMESH_Group::_nil(); - myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); - myGroupOnFilter = SMESH::SMESH_GroupOnFilter::_nil(); - - // NPAL19389: create a group with a selection in another group - // set actor of myMesh, if it is visible, else try - // any visible actor of group or submesh of myMesh - SetAppropriateActor(); - - setDefaultGroupColor(); - setDefaultName(); - - - SALOME_ListIO aList; - mySelectionMgr->selectedObjects( aList ); - if( !aList.IsEmpty() ) - { - QString aName = aList.First()->getName(); - myMeshGroupLine->setText(aName);//?????? - myMeshGroupLine->home( false ); - } - - myCurrentLineEdit = 0; - - myTypeGroup->button(0)->setChecked(true); - onTypeChanged(0); -} - -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void SMESHGUI_AdaptDlg::init (SMESH::SMESH_GroupBase_ptr theGroup) -{ - std::cout << "passage par init (SMESH::SMESH_GroupBase_ptr theGroup)" << std::endl; - restoreShowEntityMode(); - myMesh = theGroup->GetMesh(); - setShowEntityMode(); - - myNameChanged = true; - myName->blockSignals(true); - myName->setText(SMESH::fromUtf8(theGroup->GetName())); - myName->blockSignals(false); - myName->home(false); - - SALOMEDS::Color aColor = theGroup->GetColor(); - setGroupColor( aColor ); - - myMeshGroupLine->setText(theGroup->GetName()); - - int aType = 0; - switch(theGroup->GetType()) { - case SMESH::NODE: aType = grpNodeSelection; break; - case SMESH::ELEM0D: aType = grp0DSelection; break; - case SMESH::BALL: aType = grpBallSelection; break; - case SMESH::EDGE: aType = grpEdgeSelection; break; - case SMESH::FACE: aType = grpFaceSelection; break; - case SMESH::VOLUME: aType = grpVolumeSelection; break; - case SMESH::ALL: - case SMESH::NB_ELEMENT_TYPES: break; - } - myTypeGroup->button(aType)->setChecked(true); - - myGroup = SMESH::SMESH_Group::_narrow( theGroup ); - myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_narrow( theGroup ); - myGroupOnFilter = SMESH::SMESH_GroupOnFilter::_narrow( theGroup ); - myFilter = SMESH::Filter::_nil(); - - if (myGroup->_is_nil() && myGroupOnGeom->_is_nil() && myGroupOnFilter->_is_nil() ) - return; - - // NPAL19389: create a group with a selection in another group - // set actor of myMesh, if it is visible, else set - // actor of theGroup, if it is visible, else try - // any visible actor of group or submesh of myMesh - // commented, because an attempt to set selection on not displayed cells leads to error - SetAppropriateActor(); - - /* SMESH_Actor* anActor = SMESH::FindActorByObject(myMesh); - if ( !anActor ) - anActor = SMESH::FindActorByObject(theGroup); - SMESH::SetPickable(anActor);*/ - int grpType = (!myGroup->_is_nil() ? 0 : (false ? 0 : myGroupOnGeom->_is_nil() ? 2 : 1)); - myGrpTypeGroup->button(grpType)->setChecked(true); - onGrpTypeChanged(grpType); - - myTypeId = aType; - if ( grpType == 0 ) { // standalone group - myCurrentLineEdit = 0; - myElements->clear(); - myAllowElemsModif->setChecked( true ); - - setSelectionMode(aType); - - setShowEntityMode(); // depends on myTypeId - - myIdList.clear(); - if (!theGroup->IsEmpty()) { - SMESH::long_array_var anElements = theGroup->GetListOfID(); - int k = anElements->length(); - for (int i = 0; i < k; i++) { - myIdList.append(anElements[i]); - myElements->addItem(QString::number(anElements[i])); - } - myElements->selectAll(); - } - } - else if ( grpType == 1 ) // group on geom - { - QString aShapeName( "" ); - _PTR(Study) aStudy = SMESH::getStudy(); - GEOM::GEOM_Object_var aGroupShape = myGroupOnGeom->GetShape(); - if (!aGroupShape->_is_nil()) - { - _PTR(SObject) aGroupShapeSO = aStudy->FindObjectID(aGroupShape->GetStudyEntry()); - if ( aGroupShapeSO ) - aShapeName = aGroupShapeSO->GetName().c_str(); - } - myGeomGroupLine->setText( aShapeName ); - } - else // group on filter - { - myFilter = myGroupOnFilter->GetFilter(); - if ( !myFilter->_is_nil() ) { - SMESH::Predicate_var perdicate = myFilter->GetPredicate(); - if ( perdicate->_is_nil() ) - myFilter = SMESH::Filter::_nil(); - } - } - - if ( grpType != 0 ) - { - myNameChanged = true; - myName->blockSignals(true); - myName->setText(theGroup->GetName()); - myName->blockSignals(false); - } - - onSelectAll(); //updateButtons(); -} - -//================================================================================= -// function : updateButtons() -// purpose : -//================================================================================= -void SMESHGUI_AdaptDlg::updateButtons() -{ - std::cout << "passage par updateButtons" << std::endl; - bool enable = !myName->text().trimmed().isEmpty(); - if ( enable ) - { - if (myGrpTypeId == 0) { // standalone - if ( !mySelectAll->isChecked() ) - { - if ( myAllowElemsModif->isChecked() ) - { - enable = ( myElements->count() > 0 ); - } - else if ((enable = !myFilter->_is_nil() )) - { - SMESH::array_of_ElementType_var types = myFilter->GetTypes(); - enable = types->length(); - } - } - enable = enable && (!myGroup->_is_nil() || !myMesh->_is_nil()); - } - else if (myGrpTypeId == 1) // on geom - { - if (CORBA::is_nil(myGroupOnGeom)) // creation mode - enable = ( myGeomObjects->length() > 0 && !myMesh->_is_nil() ); - } - else if (myGrpTypeId == 2) // on filter - { - if (( enable = !myFilter->_is_nil() )) - if (CORBA::is_nil(myGroupOnFilter) ) // creation mode - enable = !myMesh->_is_nil(); - } - } - - bool meshHasGeom = ( myMesh->_is_nil() || myMesh->HasShapeToMesh() ); - if ( myGrpTypeId != 1 ) - { - myGrpTypeGroup->button(1)->setEnabled( meshHasGeom ); - } - else - { - myGeomGroupBtn->setEnabled( meshHasGeom ); - myGeomGroupLine->setEnabled( meshHasGeom ); - } - - myOKBtn->setEnabled(enable); - myApplyBtn->setEnabled(enable); -} - -//================================================================================= -// function : onNameChanged() -// purpose : -//================================================================================= -void SMESHGUI_AdaptDlg::onNameChanged (const QString& text) -{ - std::cout << "passage par onNameChanged" << std::endl; - myOldName = myName->text(); - updateButtons(); - myNameChanged = !myName->text().trimmed().isEmpty(); -} - -//================================================================================= -// function : onTypeChanged() -// purpose : Group elements type radio button management -//================================================================================= -void SMESHGUI_AdaptDlg::onTypeChanged (int id) -{ - if (myTypeId != id) { - myElements->clear(); - myTypeId = id; - if ( myGrpTypeId == 0 && myCurrentLineEdit == 0) - setSelectionMode(id); - else - setSelectionMode( mySelectionMode++ ); // update according to mySelectionMode - - onObjectSelectionChanged(); - setShowEntityMode(); - } -} - -//================================================================================= -// function : onGrpTypeChanged() -// purpose : Group type radio button management -//================================================================================= -void SMESHGUI_AdaptDlg::onGrpTypeChanged (int id) -{ - if (myGrpTypeId != id) { - myGrpTypeId = id; - myWGStack->setCurrentIndex( id ); - myName->blockSignals(true); - myName->setText(myOldName); - myName->blockSignals(false); - onSelectGeomGroup(id != 0); - } - updateButtons(); -} - -//================================================================================= -// function : onColorChanged() -// purpose : Color button management -//================================================================================= -void SMESHGUI_AdaptDlg::onColorChanged(QColor theColor) -{ - updateButtons(); -} - -//================================================================================= -// function : setSelectionMode() -// purpose : Radio button management -//================================================================================= -void SMESHGUI_AdaptDlg::setSelectionMode (int theMode) -{ - // PAL7314 - if (myMesh->_is_nil()) - return; - SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ); - bool isSelectAll = mySelectAll->isChecked() || !myAllowElemsModif->isChecked() || myGrpTypeId != 0; - if (mySelectionMode != theMode) { - // [PAL10408] mySelectionMgr->clearSelected(); - mySelectionMgr->clearFilters(); - SMESH::RemoveFilters(); - - if (myActorsList.count() > 0) - for (QListIterator it( myActorsList ); it.hasNext(); ) - it.next()->SetPointRepresentation(false); - else - SMESH::SetPointRepresentation(false); - - switch (theMode) { - case grpNodeSelection: - if ( myGrpTypeId == 0 ) // standalone - { - if (myActorsList.count() > 0) - for (QListIterator it( myActorsList ); it.hasNext(); ) - it.next()->SetPointRepresentation(true); - else - SMESH::SetPointRepresentation(true); - } - if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : NodeSelection); - break; - case grpEdgeSelection: - if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : EdgeSelection); - break; - case grpBallSelection: - if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : BallSelection); - break; - case grp0DSelection: - if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : Elem0DSelection); - break; - case grpFaceSelection: - if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : FaceSelection); - break; - case grpVolumeSelection: - if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : VolumeSelection); - break; - case grpSubMeshSelection: { - - SMESH_TypeFilter* f = 0; - switch (myTypeId) { - case grpNodeSelection: f = new SMESH_TypeFilter(SMESH::SUBMESH); break; - case grpEdgeSelection: f = new SMESH_TypeFilter(SMESH::SUBMESH_EDGE); break; - case grpFaceSelection: f = new SMESH_TypeFilter(SMESH::SUBMESH_FACE); break; - case grpVolumeSelection: f = new SMESH_TypeFilter(SMESH::SUBMESH_SOLID); break; - default: f = new SMESH_TypeFilter(SMESH::SUBMESH); - } - QList filtList; - filtList.append( f ); - filtList.append( new SMESH_TypeFilter(SMESH::SUBMESH_COMPOUND)); - mySubMeshFilter->setFilters( filtList ); - - mySelectionMgr->installFilter( mySubMeshFilter ); - - if ( aViewWindow ) aViewWindow->SetSelectionMode(ActorSelection); break; } - case grpGroupSelection: { - - SMESH_TypeFilter* f = 0; - switch (myTypeId) { - case grpNodeSelection: f = new SMESH_TypeFilter(SMESH::GROUP_NODE); break; - case grp0DSelection: f = new SMESH_TypeFilter(SMESH::GROUP_0D); break; - case grpBallSelection: f = new SMESH_TypeFilter(SMESH::GROUP_BALL); break; - case grpEdgeSelection: f = new SMESH_TypeFilter(SMESH::GROUP_EDGE); break; - case grpFaceSelection: f = new SMESH_TypeFilter(SMESH::GROUP_FACE); break; - case grpVolumeSelection: f = new SMESH_TypeFilter(SMESH::GROUP_VOLUME); break; - default: f = new SMESH_TypeFilter(SMESH::GROUP); - } - QList filtList; - filtList.append( f ); - myGroupFilter->setFilters( filtList ); - - mySelectionMgr->installFilter(myGroupFilter); - if ( aViewWindow ) aViewWindow->SetSelectionMode(ActorSelection); + case 8020: // Adaptation avec MG-Adpat + { + INFOS("Interface avec MG-Adapt" ); +// A faire break; } - case grpMeshSelection: - mySelectionMgr->installFilter(myMeshFilter); - if ( aViewWindow ) aViewWindow->SetSelectionMode(ActorSelection); - break; - case grpGeomSelection: - mySelectionMgr->installFilter(myGeomFilter); - if ( aViewWindow ) aViewWindow->SetSelectionMode(ActorSelection); - break; - default: - if ( aViewWindow ) aViewWindow->SetSelectionMode(ActorSelection); - break; - } - if ( aViewWindow ) aViewWindow->Repaint(); - mySelectionMode = theMode; + } -} - -//================================================================================= -// function : onApply() -// purpose : -//================================================================================= -bool SMESHGUI_AdaptDlg::onApply() -{ - if (SMESHGUI::isStudyLocked()) - return false; - - if (myName->text().trimmed().isEmpty()) - return false; - - SMESH::ElementType aType = SMESH::ALL; - switch (myTypeId) { - case grpNodeSelection: aType = SMESH::NODE; break; - case grp0DSelection: aType = SMESH::ELEM0D; break; - case grpBallSelection: aType = SMESH::BALL; break; - case grpEdgeSelection: aType = SMESH::EDGE; break; - case grpFaceSelection: aType = SMESH::FACE; break; - case grpVolumeSelection: aType = SMESH::VOLUME; break; - } - - bool anIsOk = false; - QStringList anEntryList; - - SMESH::SMESH_GroupBase_var resultGroup; - bool isCreation = false, isConversion = false; - - SUIT_OverrideCursor wc; - - if (myGrpTypeId == 0) // standalone - { - if (!mySelectAll->isChecked() && !myElements->count() && myAllowElemsModif->isChecked()) - return false; - - mySelectionMgr->clearSelected(); - - if (myGroup->_is_nil()) { // creation or conversion - // check if group on geometry is not null - if (!myGroupOnGeom->_is_nil() || !myGroupOnFilter->_is_nil()) { - if (myMesh->_is_nil()) - return false; - if ( myGroupOnGeom->_is_nil() ) - myGroup = myMesh->ConvertToStandalone( myGroupOnFilter ); - else - myGroup = myMesh->ConvertToStandalone( myGroupOnGeom ); - - myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); - myGroupOnFilter = SMESH::SMESH_GroupOnFilter::_nil(); - isConversion = true; - } - } - - if (myGroup->_is_nil()) { // creation - if (myMesh->_is_nil()) - return false; - - myGroup = SMESH::AddGroup(myMesh, aType, myName->text()); - - resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroup ); - isCreation = true; - - if ( mySelectAll->isChecked() ) { - // select all - myGroup->AddFrom(myMesh.in()); - } - else { - // select manually - - if ( !myFilter->_is_nil() && - ( myNbChangesOfContents == 1 || !myAllowElemsModif->isChecked())) - { - myGroup->AddFrom( myFilter ); - } - else - { - SMESH::long_array_var anIdList = new SMESH::long_array; - int i, k = myElements->count(); - anIdList->length(k); - for (i = 0; i < k; i++) { - anIdList[i] = myElements->item(i)->text().toInt(); - } - myGroup->Add(anIdList.inout()); - } - } - - - } else { // edition - - resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroup ); - isCreation = false; - - if ( mySelectAll->isChecked() ) { - // select all - myGroup->Clear(); - myGroup->AddFrom(myMesh.in()); - } - else { - QList aAddList; - - int i, total = myElements->count(); - for (i = 0; i < total; i++) { - int anId = myElements->item(i)->text().toInt(); - int idx = myIdList.indexOf(anId); - if ( idx == -1 ) - aAddList.append(anId); - else - myIdList.removeAt(idx); - } - if (!aAddList.empty()) { - SMESH::long_array_var anIdList = new SMESH::long_array; - int added = aAddList.count(); - anIdList->length(added); - for (i = 0; i < added; i++) - anIdList[i] = aAddList[i]; - myGroup->Add(anIdList.inout()); - } - if (!myIdList.empty()) { - SMESH::long_array_var anIdList = new SMESH::long_array; - int removed = myIdList.count(); - anIdList->length(removed); - for (i = 0; i < removed; i++) - anIdList[i] = myIdList[i]; - myGroup->Remove(anIdList.inout()); - } - /* init for next operation */ - myIdList.clear(); - for (i = 0; i < total; i++) { - myIdList.append(myElements->item(i)->text().toInt()); - } - } - } - - anIsOk = true; - } - else if (myGrpTypeId == 1) // on geom object - { - if (CORBA::is_nil(myGroupOnGeom)) { // creation - if (myMesh->_is_nil() || !myGeomObjects->length()) - return false; - - _PTR(Study) aStudy = SMESH::getStudy(); - - if (myGeomObjects->length() == 1) { - myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType, - myName->text().toUtf8(), - myGeomObjects[0]); - } - else { - SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen(); - if ( aSMESHGen->_is_nil() || myGeomObjects->length() == 0 ) - return false; - - // create a geometry group - GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen( myGeomObjects[0] ); - if (geomGen->_is_nil()) - return false; - - GEOM::GEOM_IGroupOperations_wrap op = geomGen->GetIGroupOperations(); - if (op->_is_nil()) - return false; - - // check and add all selected GEOM objects: they must be - // a sub-shapes of the main GEOM and must be of one type - TopAbs_ShapeEnum aGroupType = TopAbs_SHAPE; - for ( CORBA::ULong i =0; i < myGeomObjects->length(); i++) - { - TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)myGeomObjects[i]->GetShapeType(); - if ( i == 0 ) - aGroupType = aSubShapeType; - else if ( aSubShapeType != aGroupType ) { - aGroupType = TopAbs_SHAPE; - break; - } - } - - GEOM::GEOM_Object_var aMeshShape = myMesh->GetShapeToMesh(); - GEOM::GEOM_Object_wrap aGroupVar = op->CreateGroup(aMeshShape, aGroupType); - if ( aGroupVar->_is_nil() ) - return false; - op->UnionList(aGroupVar, myGeomObjects); - - if (op->IsDone()) { - // publish the GEOM group in study - QString aNewGeomGroupName ( "Auto_group_for_" ); - aNewGeomGroupName += myName->text(); - SALOMEDS::SObject_var aNewGroupSO = - geomGen->AddInStudy(aGroupVar, - aNewGeomGroupName.toUtf8(), aMeshShape); - } - - myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType, - myName->text().toUtf8(), - aGroupVar); - } - resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnGeom ); - isCreation = true; - - } - else { // edition - - resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnGeom ); - isCreation = false; - } - anIsOk = true; - } - if (myGrpTypeId == 2) // group on filter - { - if ( myFilter->_is_nil() ) return false; - - if (CORBA::is_nil(myGroupOnFilter)) // creation - { - if (myMesh->_is_nil()) - return false; - - myGroupOnFilter = myMesh->CreateGroupFromFilter(aType, - myName->text().toUtf8(), - myFilter); - resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnFilter ); - isCreation = true; - } - else - { - myGroupOnFilter->SetFilter( myFilter ); - - resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnFilter ); - isCreation = false; - } - anIsOk = true; - } - - if ( anIsOk ) - { - SALOMEDS::Color aColor = getGroupColor(); - resultGroup->SetColor(aColor); - - _PTR(SObject) aMeshGroupSO = SMESH::FindSObject( resultGroup ); - if( aMeshGroupSO ) - anEntryList.append( aMeshGroupSO->GetID().c_str() ); - - resultGroup->SetName(myName->text().trimmed().toUtf8()); - - if ( isCreation ) - { - SMESH::setFileType ( aMeshGroupSO, "COULEURGROUP" ); - - /* init for the next operation */ - setDefaultName(); - myElements->clear(); - myGroup = SMESH::SMESH_Group::_nil(); - myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); - myGroupOnFilter = SMESH::SMESH_GroupOnFilter::_nil(); - myFilter = SMESH::Filter::_nil(); - - setDefaultGroupColor(); // reset color for case if 'auto-color' feature is enabled. - } - else - { - if ( aMeshGroupSO ) - { - if ( SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) - { - Handle(SALOME_InteractiveObject) anIO = anActor->getIO(); - if ( isConversion ) { // need to reset TVisualObj and actor - SMESH::RemoveVisualObjectWithActors( anIO->getEntry(), true ); - SMESH::Update( anIO,true); - myActorsList.clear(); - anActor = SMESH::FindActorByEntry( anIO->getEntry() ); - if ( !anActor ) return false; - myActorsList.append( anActor ); - } - anActor->setName(myName->text().toUtf8()); - QColor c; - int delta; - switch ( myTypeId ) { - case grpNodeSelection: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break; - case grp0DSelection: anActor->Set0DColor ( aColor.R, aColor.G, aColor.B ); break; - case grpBallSelection: anActor->SetBallColor( aColor.R, aColor.G, aColor.B ); break; - case grpEdgeSelection: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break; - case grpVolumeSelection: - SMESH::GetColor("SMESH", "volume_color", c , delta, "255,0,170|-100"); - anActor->SetVolumeColor( aColor.R, aColor.G, aColor.B, delta ); break; - break; - case grpFaceSelection: - default: - SMESH::GetColor("SMESH", "fill_color", c , delta, "0,170,255|-100"); - anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B, delta ); break; - break; - } - // update a visible group according to a changed contents - if ( !isConversion && anActor->GetVisibility() ) - { - SMESH::Update( anIO, true ); - SMESH::RepaintCurrentView(); - } - } - } - } - SMESHGUI::Modified(); - mySMESHGUI->updateObjBrowser(true); - mySelectionMgr->clearSelected(); - - if( LightApp_Application* anApp = - dynamic_cast( SUIT_Session::session()->activeApplication() ) ) - myObjectToSelect = anApp->browseObjects( anEntryList, isApplyAndClose() ); - } - return anIsOk; -} - -//================================================================================= -// function : onOK() -// purpose : -//================================================================================= -void SMESHGUI_AdaptDlg::onOK() -{ - setIsApplyAndClose( true ); - if ( onApply() ) - reject(); - setIsApplyAndClose( false ); - - if ( myFilterDlg ) myFilterDlg->UnRegisterFilters(); -} - -//================================================================================= -// function : onListSelectionChanged() -// purpose : Called when selection in element list is changed -//================================================================================= -void SMESHGUI_AdaptDlg::onListSelectionChanged() -{ - //INFOS( "SMESHGUI_AdaptDlg::onListSelectionChanged(); myActorsList.count() = " << myActorsList.count()); - if( myIsBusy || myActorsList.count() == 0 ) return; - myIsBusy = true; - - if (myCurrentLineEdit == 0) { - mySelectionMgr->clearSelected(); - TColStd_MapOfInteger aIndexes; - QList selItems = myElements->selectedItems(); - QListWidgetItem* anItem; - foreach(anItem, selItems) aIndexes.Add(anItem->text().toInt()); - mySelector->AddOrRemoveIndex(myActorsList.first()->getIO(), aIndexes, false); - SALOME_ListIO aList; - aList.Append(myActorsList.first()->getIO()); - mySelectionMgr->setSelectedObjects(aList,false); - } - myIsBusy = false; -} - -//================================================================================= -// function : onObjectSelectionChanged() -// purpose : Called when selection in 3D view or ObjectBrowser is changed -//================================================================================= -void SMESHGUI_AdaptDlg::onObjectSelectionChanged() -{ - if ( myIsBusy || !isEnabled()) return; - if (myCurrentLineEdit == myGeomGroupLine && !myGeomGroupBtn->isChecked()) return; - - myIsBusy = true; - - SALOME_ListIO aList; - mySelectionMgr->selectedObjects( aList ); - - int aNbSel = aList.Extent(); - myElements->clearSelection(); - - if (myCurrentLineEdit) - { - myCurrentLineEdit->setText( "" ); - QString aString = ""; - - if (myCurrentLineEdit == myMeshGroupLine) - { - mySelectSubMesh->setEnabled(false); - mySelectGroup->setEnabled(false); - myGroupLine->setText( "" ); - mySubMeshLine->setText( "" ); - - myGeomGroupBtn->setEnabled(false); - myGeomGroupLine->setEnabled(false); - myGeomGroupLine->setText( "" ); - myGeomObjects = new GEOM::ListOfGO(); - myGeomObjects->length(0); - - if (myGeomGroupBtn->isChecked()) - myGeomGroupBtn->setChecked(false); - if (!myCreate) - myName->setText( "" ); - - myElements->clear(); - - if (aNbSel != 1 ) { - myGroup = SMESH::SMESH_Group::_nil(); - myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); - restoreShowEntityMode(); - myMesh = SMESH::SMESH_Mesh::_nil(); - updateGeomPopup(); - updateButtons(); - myIsBusy = false; - return; - } - Handle(SALOME_InteractiveObject) IO = aList.First(); - - if (myCreate) { - restoreShowEntityMode(); - myMesh = SMESH::IObjectToInterface(IO); - setShowEntityMode(); - updateGeomPopup(); - if (myMesh->_is_nil()) - { - updateButtons(); - myIsBusy = false; - return; - } - - if ( myFilterDlg && !myMesh->_is_nil()){ - myFilterDlg->SetMesh( myMesh ); - } - myGroup = SMESH::SMESH_Group::_nil(); - - // NPAL19389: create a group with a selection in another group - // set actor of myMesh, if it is visible, else try - // any visible actor of group or submesh of myMesh - SetAppropriateActor(); - - setDefaultGroupColor(); - if (myName->text().isEmpty()) - setDefaultName(); - - aString = aList.First()->getName(); - myMeshGroupLine->setText(aString); - myMeshGroupLine->home( false ); - - mySelectSubMesh->setEnabled(true); - mySelectGroup->setEnabled(true); - myGeomGroupBtn->setEnabled(true); - myGeomGroupLine->setEnabled(true); - updateButtons(); - } - else { - SMESH::SMESH_GroupBase_var aGroup = SMESH::IObjectToInterface(IO); - if (aGroup->_is_nil()) - { - myIsBusy = false; - return; - } - myIsBusy = false; - - myGroup = SMESH::SMESH_Group::_nil(); - myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); - - init(aGroup); - myIsBusy = true; - mySelectSubMesh->setEnabled(true); - mySelectGroup->setEnabled(true); - } - myCurrentLineEdit = 0; - myIsBusy = false; - if (!myCreate) - return; - - if (myGrpTypeId == 0) - { - if (myTypeId == -1) - onTypeChanged(0); - else - { - myElements->clear(); - setSelectionMode(myTypeId); - } - } - - myIsBusy = false; - return; - - } - else if (myCurrentLineEdit == myGeomGroupLine) - { - myGeomObjects = new GEOM::ListOfGO(); - - // The mesh SObject - _PTR(SObject) aMeshSO = SMESH::FindSObject(myMesh); - - if (aNbSel == 0 || !aMeshSO) - { - myGeomObjects->length(0); - updateButtons(); - myIsBusy = false; - return; - } - - myGeomObjects->length(aNbSel); - - GEOM::GEOM_Object_var aGeomGroup; - int i = 0; - - SALOME_ListIteratorOfListIO anIt (aList); - for (; anIt.More(); anIt.Next()) - { - aGeomGroup = GEOMBase::ConvertIOinGEOMObject(anIt.Value()); - - // Check if the object is a geometry group - if (CORBA::is_nil(aGeomGroup)) - continue; - - // Check if group constructed on the same shape as a mesh or on its child - - // The main shape of the group - GEOM::GEOM_Object_var aGroupMainShape; - if (aGeomGroup->GetType() == 37) - { - GEOM::GEOM_IGroupOperations_wrap anOp = - SMESH::GetGEOMGen( aGeomGroup )->GetIGroupOperations(); - aGroupMainShape = anOp->GetMainShape( aGeomGroup ); - // aGroupMainShape is an existing servant => GEOM_Object_var not GEOM_Object_wrap - } - else - { - aGroupMainShape = aGeomGroup; - aGroupMainShape->Register(); - } - CORBA::String_var entry = aGroupMainShape->GetStudyEntry(); - _PTR(SObject) aGroupMainShapeSO = - SMESH::getStudy()->FindObjectID( entry.in() ); - - _PTR(SObject) anObj, aRef; - bool isRefOrSubShape = false; - if (aMeshSO->FindSubObject(1, anObj) && anObj->ReferencedObject(aRef)) { - if (aRef->GetID() == aGroupMainShapeSO->GetID()) { - isRefOrSubShape = true; - } else { - _PTR(SObject) aFather = aGroupMainShapeSO->GetFather(); - _PTR(SComponent) aComponent = aGroupMainShapeSO->GetFatherComponent(); - while (!isRefOrSubShape && aFather->GetID() != aComponent->GetID()) { - if (aRef->GetID() == aFather->GetID()) - isRefOrSubShape = true; - else - aFather = aFather->GetFather(); - } - } - } - if (isRefOrSubShape) - myGeomObjects[i++] = aGeomGroup; - } - - myGeomObjects->length(i); - if ( i == 0 ) - { - myIsBusy = false; - return; - } - - aNbSel = i; - } - - if (aNbSel >= 1) { - if (aNbSel > 1) { - if (myCurrentLineEdit == mySubMeshLine) - aString = tr( "SMESH_SUBMESH_SELECTED" ).arg(aNbSel); - else if (myCurrentLineEdit == myGroupLine) - aString = tr( "SMESH_GROUP_SELECTED" ).arg(aNbSel); - else if (myCurrentLineEdit == myGeomGroupLine) - aString = tr( "%1 Objects" ).arg(aNbSel); - } - else { - aString = aList.First()->getName(); - } - } - - myCurrentLineEdit->setText(aString); - myCurrentLineEdit->home(false); - // 07.06.2008 skl for IPAL19574: - // change name of group only if it is empty - if( myName->text().trimmed().isEmpty() || !myNameChanged ) { - myOldName = myName->text(); - myName->blockSignals(true); - myName->setText(aString); - myName->blockSignals(false); - } - - updateButtons(); - } - else // !myCurrentLineEdit: local selection of nodes or elements - { - if (aNbSel == 1 && myActorsList.count() > 0 ) - { - // NPAL19389: create a group with a selection in another group - // Switch myActor to the newly selected one, if the last - // is visible and belongs to group or submesh of myMesh - /* Handle(SALOME_InteractiveObject) curIO = myActor->getIO(); - Handle(SALOME_InteractiveObject) selIO = aList.First(); - if (curIO->hasEntry() && selIO->hasEntry()) { - const char* selEntry = selIO->getEntry(); - if (strcmp(curIO->getEntry(), selEntry) != 0) { - // different objects: selected and myActor - SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView(); - if (aViewWindow && aViewWindow->isVisible(selIO)) { - // newly selected actor is visible - - // mesh entry - _PTR(SObject) aSObject = SMESH::FindSObject(myMesh); - if (aSObject) { - CORBA::String_var meshEntry = aSObject->GetID().c_str(); - int len = strlen(meshEntry); - - if (strncmp(selEntry, meshEntry, len) == 0) { - // selected object is myMesh or a part of it - SMESH_Actor* anActor = SMESH::FindActorByEntry(selEntry); - if (anActor) { - myActor = anActor; - SMESH::SetPickable(myActor); - } - } - } - } - } - }*/ - // NPAL19389 END - - QString aListStr = ""; - int aNbItems = 0; - if (myTypeId == 0) { - QListIterator it( myActorsList ); - while ( it.hasNext() ) { - QString tmpStr; - aNbItems += SMESH::GetNameOfSelectedNodes(mySelector, it.next()->getIO(), tmpStr); - aListStr += tmpStr; - } - } else { - QListIterator it( myActorsList ); - while ( it.hasNext() ) { - QString tmpStr; - aNbItems += SMESH::GetNameOfSelectedElements(mySelector, it.next()->getIO(), tmpStr); - aListStr += tmpStr; - } - } - if (aNbItems > 0) { - QListWidgetItem* anItem; - QList listItemsToSel; - QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts); - for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) { - QList found = myElements->findItems(*it, Qt::MatchExactly); - foreach(anItem, found) - if (!anItem->isSelected()) - listItemsToSel.push_back(anItem); - } - bool blocked = myElements->signalsBlocked(); - myElements->blockSignals(true); - foreach(anItem, listItemsToSel) anItem->setSelected(true); - myElements->blockSignals(blocked); - onListSelectionChanged(); - listItemsToSel.clear(); - } - } - } - - if (myActorsList.count() == 0) { - if (!myGroup->_is_nil()) { - SMESH_Actor* anActor = SMESH::FindActorByObject(myGroup); - if ( anActor ) - myActorsList.append( anActor ); - } - else if(!myGroupOnGeom->_is_nil()) { - SMESH_Actor* anActor = SMESH::FindActorByObject(myGroupOnGeom); - if ( anActor ) - myActorsList.append( anActor ); - } - else { - SMESH_Actor* anActor = SMESH::FindActorByObject( myMesh ); - if ( anActor ) - myActorsList.append( anActor ); - } - } - - // somehow, if we display the mesh, while selecting from another actor, - // the mesh becomes pickable, and there is no way to select any element - if (myActorsList.count() > 0) { - QListIterator it( myActorsList ); - while ( it.hasNext() ) { - SMESH_Actor* anActor = it.next(); - if ( IsActorVisible(anActor) ) - anActor->SetPickable(true); - } - } - - myIsBusy = false; -} - -//================================================================================= -// function : onSelectAll() -// purpose : Called when "Select all" is checked -//================================================================================= -void SMESHGUI_AdaptDlg::onSelectAll() -{ - bool noElemsModif = ( mySelectAll->isChecked() || !myAllowElemsModif->isChecked() ); - - myElementsLab->setEnabled( !noElemsModif ); - myElements->setEnabled ( !noElemsModif ); - myFilterBtn->setEnabled ( !noElemsModif ); - myAddBtn->setEnabled ( !noElemsModif ); - myRemoveBtn->setEnabled ( !noElemsModif ); - mySortBtn->setEnabled ( !noElemsModif ); - mySelectBox->setEnabled ( !noElemsModif ); - myAllowElemsModif->setEnabled( !mySelectAll->isChecked() ); - if ( noElemsModif ) mySMESHGUI->ResetState(); - else mySMESHGUI->SetState(800); - - int selMode = mySelectionMode; - mySelectionMode = grpNoSelection; - setSelectionMode( selMode ); - updateButtons(); -} - -//================================================================================= -// function : onSelectSubMesh() -// purpose : Called when selection in 3D view or ObjectBrowser is changed -//================================================================================= -void SMESHGUI_AdaptDlg::onSelectSubMesh(bool on) -{ - if (on) { - if (mySelectGroup->isChecked()) { - mySelectGroup->setChecked(false); - } - //VSR: else if (mySelectGeomGroup->isChecked()) { - //VSR: mySelectGeomGroup->setChecked(false); - //VSR: } - myCurrentLineEdit = mySubMeshLine; - setSelectionMode(grpSubMeshSelection); - } - else { - mySubMeshLine->setText( "" ); - myCurrentLineEdit = 0; - if (myTypeId != -1) - setSelectionMode(myTypeId); - } - mySubMeshBtn->setEnabled(on); - mySubMeshLine->setEnabled(on); + mySMESHGUI->getApp()->updateObjectBrowser(); + return ok; } -//================================================================================= -// function : (onSelectGroup) -// purpose : Called when selection in 3D view or ObjectBrowser is changed -//================================================================================= -void SMESHGUI_AdaptDlg::onSelectGroup(bool on) -{ - if (on) { - if (mySelectSubMesh->isChecked()) { - mySelectSubMesh->setChecked(false); - } - myCurrentLineEdit = myGroupLine; - setSelectionMode(grpGroupSelection); - } - else { - myGroupLine->setText( "" ); - myCurrentLineEdit = 0; - if (myTypeId != -1) - setSelectionMode(myTypeId); - } - myGroupBtn->setEnabled(on); - myGroupLine->setEnabled(on); -} - -//================================================================================= -// function : (onSelectGeomGroup) -// purpose : Called when group type changed. on == "on geometry" or "on filter" -//================================================================================= -void SMESHGUI_AdaptDlg::onSelectGeomGroup(bool on) -{ - if (on) { - if (mySelectSubMesh->isChecked()) { - mySelectSubMesh->setChecked(false); - } - else if (mySelectGroup->isChecked()) { - mySelectGroup->setChecked(false); - } - if ( myGrpTypeId == 1 ) { // on geometry - myCurrentLineEdit = myGeomGroupLine; - updateGeomPopup(); - } - else { // on filter - myCurrentLineEdit = 0; - } - setSelectionMode(grpAllSelection); - } - else { - myGeomGroupBtn->setChecked(false); - myGeomObjects->length(0); - myGeomGroupLine->setText( "" ); - myCurrentLineEdit = 0; - if (myTypeId != -1) - setSelectionMode( myTypeId ); - } -} - -//================================================================================= -// function : setCurrentSelection() -// purpose : -//================================================================================= -void SMESHGUI_AdaptDlg::setCurrentSelection() -{ - QPushButton* send = (QPushButton*)sender(); - myCurrentLineEdit = 0; - if (send == myMeshGroupBtn) { - disconnect(myMeshGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection())); - mySelectionMgr->clearSelected(); - if (myCreate) - setSelectionMode(grpMeshSelection); - else - setSelectionMode(grpGroupSelection); - connect(myMeshGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection())); - myCurrentLineEdit = myMeshGroupLine; - onObjectSelectionChanged(); - } - else if (send == mySubMeshBtn) { - myCurrentLineEdit = mySubMeshLine; - onObjectSelectionChanged(); - } - else if (send == myGroupBtn) { - myCurrentLineEdit = myGroupLine; - onObjectSelectionChanged(); - } -} - - -//================================================================================= -// function : setFilters() -// purpose : SLOT. Called when "Filter" button pressed. -//================================================================================= -void SMESHGUI_AdaptDlg::setFilters() -{ - if(myMesh->_is_nil()) { - SUIT_MessageBox::critical(this, - tr("SMESH_ERROR"), - tr("NO_MESH_SELECTED")); - return; - } - - SMESH::ElementType aType = SMESH::ALL; - switch ( myTypeId ) - { - case grpNodeSelection: aType = SMESH::NODE; break; - case grp0DSelection: aType = SMESH::ELEM0D; break; - case grpBallSelection: aType = SMESH::BALL; break; - case grpEdgeSelection: aType = SMESH::EDGE; break; - case grpFaceSelection: aType = SMESH::FACE; break; - case grpVolumeSelection: aType = SMESH::VOLUME; break; - default: return; - } - - if ( myFilterDlg == 0 ) - { - myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, aType ); - connect( myFilterDlg, SIGNAL( Accepted() ), SLOT( onFilterAccepted() ) ); - } - else - myFilterDlg->Init( aType ); - - if ( !myGroupOnFilter->_is_nil() ) - { - myFilterDlg->SetFilter( myFilter, aType ); - myFilterDlg->Init( aType ); - } - - bool isStandalone = ( sender() == myFilterBtn ); - myFilterDlg->SetEnabled( /*setInViewer=*/isStandalone, - /*diffSources=*/isStandalone ); - myFilterDlg->SetMesh( myMesh ); - myFilterDlg->SetGroup( myGroupOnFilter ); - myFilterDlg->SetSelection(); - myFilterDlg->SetSourceWg( myElements, false ); - - myFilterDlg->show(); -} - -//================================================================================= -// function : onFilterAccepted() -// purpose : SLOT. Called when Filter dlg closed with OK button. -// Uncheck "Select submesh" and "Select group" checkboxes -//================================================================================= -void SMESHGUI_AdaptDlg::onFilterAccepted() -{ - if ( mySelectSubMesh->isChecked() || mySelectGroup->isChecked() ) - { - mySelectionMode = myTypeId; - mySelectSubMesh->setChecked( false ); - mySelectGroup->setChecked( false ); - } - // get a filter from myFilterDlg - myFilter = myFilterDlg->GetFilter(); - if ( !myFilter->_is_nil() ) { - SMESH::Predicate_var perdicate = myFilter->GetPredicate(); - if ( perdicate->_is_nil() ) - myFilter = SMESH::Filter::_nil(); - } - // set mesh to myFilter - if ( !myFilter->_is_nil() ) { - SMESH::SMESH_Mesh_var mesh = myMesh; - if ( mesh->_is_nil() ) { - if ( !myGroup->_is_nil() ) - mesh = myGroup->GetMesh(); - else if ( !myGroupOnGeom->_is_nil() ) - mesh = myGroupOnGeom->GetMesh(); - else if ( !myGroupOnFilter->_is_nil() ) - mesh = myGroupOnFilter->GetMesh(); - } - myFilter->SetMesh( mesh ); - - // highlight ids if selection changed in the Viewer (IPAL52924) - myCurrentLineEdit = 0; - onObjectSelectionChanged(); - } - - updateButtons(); -} - -//================================================================================= -// function : onAdd() -// purpose : -//================================================================================= -void SMESHGUI_AdaptDlg::onAdd() -{ - SALOME_ListIO aList; - mySelectionMgr->selectedObjects( aList ); - - int aNbSel = aList.Extent(); - - if (aNbSel == 0 || myActorsList.count() == 0 || myMesh->_is_nil()) return; - - SUIT_OverrideCursor wc; - - myIsBusy = true; - int sizeBefore = myElements->count(); - - SMESH::ElementType aType = SMESH::ALL; - switch(myTypeId) { - case grpNodeSelection: - aType = SMESH::NODE; - mySelector->SetSelectionMode(NodeSelection); - break; - case grpBallSelection: - aType = SMESH::BALL; - mySelector->SetSelectionMode(BallSelection); - break; - case grp0DSelection: - aType = SMESH::ELEM0D; - mySelector->SetSelectionMode(Elem0DSelection); - break; - case grpEdgeSelection: - aType = SMESH::EDGE; - mySelector->SetSelectionMode(EdgeSelection); - break; - case grpFaceSelection: - aType = SMESH::FACE; - mySelector->SetSelectionMode(FaceSelection); - break; - case grpVolumeSelection: - aType = SMESH::VOLUME; - mySelector->SetSelectionMode(VolumeSelection); - break; - default: - mySelector->SetSelectionMode(ActorSelection); - } - - QListWidgetItem* anItem = 0; - QList listItemsToSel; - - if ( myCurrentLineEdit == 0 ) - { - //if (aNbSel != 1) { myIsBusy = false; return; } - QString aListStr = ""; - int aNbItems = 0; - if (myTypeId == 0) { - QListIterator it( myActorsList ); - while ( it.hasNext() ) { - QString tmpStr; - aNbItems += SMESH::GetNameOfSelectedNodes(mySelector, it.next()->getIO(), tmpStr); - aListStr += tmpStr; - } - } - else { - QListIterator it( myActorsList ); - while ( it.hasNext() ) { - QString tmpStr; - aNbItems += SMESH::GetNameOfSelectedElements(mySelector, it.next()->getIO(), tmpStr); - aListStr += tmpStr; - } - } - if (aNbItems > 0) { - QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts); - for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) { - QList found = myElements->findItems(*it, Qt::MatchExactly); - if (found.count() == 0) { - anItem = new QListWidgetItem(*it); - myElements->addItem(anItem); - if (!anItem->isSelected()) - listItemsToSel.push_back(anItem); - } - else { - foreach(anItem, found) - if (!anItem->isSelected()) - listItemsToSel.push_back(anItem); - } - } - bool blocked = myElements->signalsBlocked(); - myElements->blockSignals(true); - foreach(anItem, listItemsToSel) anItem->setSelected(true); - myElements->blockSignals(blocked); - onListSelectionChanged(); - listItemsToSel.clear(); - } - } - else if ( myCurrentLineEdit == mySubMeshLine ) - { - //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects()); - - SALOME_ListIO aList; - mySelectionMgr->selectedObjects( aList ); - - SALOME_ListIteratorOfListIO anIt (aList); - for ( ; anIt.More(); anIt.Next()) { - SMESH::SMESH_subMesh_var aSubMesh = - SMESH::IObjectToInterface(anIt.Value()); - if (!aSubMesh->_is_nil()) { - // check if mesh is the same - if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) { - try { - SMESH::long_array_var anElements = aSubMesh->GetElementsByType(aType); - int k = anElements->length(); - for (int i = 0; i < k; i++) { - QString aText = QString::number(anElements[i]); - QList found = myElements->findItems(aText, Qt::MatchExactly); - if (found.count() == 0) { - anItem = new QListWidgetItem(aText); - myElements->addItem(anItem); - if (!anItem->isSelected()) - listItemsToSel.push_back(anItem); - } - else { - foreach(anItem, found) - if (!anItem->isSelected()) - listItemsToSel.push_back(anItem); - } - } - bool blocked = myElements->signalsBlocked(); - myElements->blockSignals(true); - foreach(anItem, listItemsToSel) anItem->setSelected(true); - myElements->blockSignals(blocked); - onListSelectionChanged(); - listItemsToSel.clear(); - } - catch (const SALOME::SALOME_Exception& ex) { - SalomeApp_Tools::QtCatchCorbaException(ex); - } - } - } - } - mySelectSubMesh->setChecked(false); - myIsBusy = false; - onListSelectionChanged(); - - } - else if ( myCurrentLineEdit == myGroupLine ) - { - //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects()); - SALOME_ListIO aList; - mySelectionMgr->selectedObjects( aList ); - - SALOME_ListIteratorOfListIO anIt (aList); - for ( ; anIt.More(); anIt.Next()) { - SMESH::SMESH_GroupBase_var aGroup = - SMESH::IObjectToInterface(anIt.Value()); - if (!aGroup->_is_nil()) { - // check if mesh is the same - if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) { - SMESH::long_array_var anElements = aGroup->GetListOfID(); - int k = anElements->length(); - for (int i = 0; i < k; i++) { - QString aText = QString::number(anElements[i]); - QList found = myElements->findItems(aText, Qt::MatchExactly); - if (found.count() == 0) { - anItem = new QListWidgetItem(aText); - myElements->addItem(anItem); - if (!anItem->isSelected()) - listItemsToSel.push_back(anItem); - } - else { - foreach(anItem, found) - if (!anItem->isSelected()) - listItemsToSel.push_back(anItem); - } - } - bool blocked = myElements->signalsBlocked(); - myElements->blockSignals(true); - foreach(anItem, listItemsToSel) anItem->setSelected(true); - myElements->blockSignals(blocked); - onListSelectionChanged(); - listItemsToSel.clear(); - } - } - } - mySelectGroup->setChecked(false); - myIsBusy = false; - onListSelectionChanged(); - - } - else if ( myCurrentLineEdit == myGeomGroupLine && myGeomObjects->length() == 1 ) - { - GEOM::GEOM_IGroupOperations_wrap aGroupOp = - SMESH::GetGEOMGen( myGeomObjects[0] )->GetIGroupOperations(); - - SMESH::ElementType aGroupType = SMESH::ALL; - switch(aGroupOp->GetType(myGeomObjects[0])) { - case TopAbs_VERTEX: aGroupType = SMESH::NODE; break; - case TopAbs_EDGE: aGroupType = SMESH::EDGE; break; - case TopAbs_FACE: aGroupType = SMESH::FACE; break; - case TopAbs_SOLID: aGroupType = SMESH::VOLUME; break; - default: myIsBusy = false; return; - } - - if (aGroupType == aType) { - _PTR(SObject) aGroupSO = - //SMESH::getStudy()->FindObjectIOR(SMESH::getStudy()->ConvertObjectToIOR(myGeomGroup)); - SMESH::getStudy()->FindObjectID(myGeomObjects[0]->GetStudyEntry()); - // Construct filter - SMESH::FilterManager_var aFilterMgr = SMESH::GetFilterManager(); - SMESH::Filter_var aFilter = aFilterMgr->CreateFilter(); - SMESH::BelongToGeom_var aBelongToGeom = aFilterMgr->CreateBelongToGeom(); - aBelongToGeom->SetGeom(myGeomObjects[0]); - aBelongToGeom->SetShapeName(aGroupSO->GetName().c_str()); - aBelongToGeom->SetElementType(aType); - aFilter->SetPredicate(aBelongToGeom); - - SMESH::long_array_var anElements = aFilter->GetElementsId(myMesh); - - int k = anElements->length(); - for (int i = 0; i < k; i++) { - QString aText = QString::number(anElements[i]); - QList found = myElements->findItems(aText, Qt::MatchExactly); - if (found.count() == 0) { - anItem = new QListWidgetItem(aText); - myElements->addItem(anItem); - if (!anItem->isSelected()) - listItemsToSel.push_back(anItem); - } - else { - foreach(anItem, found) - if (!anItem->isSelected()) - listItemsToSel.push_back(anItem); - } - } - bool blocked = myElements->signalsBlocked(); - myElements->blockSignals(true); - foreach(anItem, listItemsToSel) anItem->setSelected(true); - myElements->blockSignals(blocked); - onListSelectionChanged(); - listItemsToSel.clear(); - } - - //VSR: mySelectGeomGroup->setChecked(false); - myIsBusy = false; - onListSelectionChanged(); - } - myIsBusy = false; - if ( sizeBefore < myElements->count() ) - ++myNbChangesOfContents; - // mySelectionMgr->clearSelected(); - updateButtons(); -} - -//================================================================================= -// function : onRemove() -// purpose : -//================================================================================= -void SMESHGUI_AdaptDlg::onRemove() -{ - myIsBusy = true; - int sizeBefore = myElements->count(); - - if (myCurrentLineEdit == 0) { - QList selItems = myElements->selectedItems(); - QListWidgetItem* item; - foreach(item, selItems) delete item; - } else { - SALOME_ListIO aList; - mySelectionMgr->selectedObjects( aList ); - - int aNbSel = aList.Extent(); - - if (aNbSel == 0) { myIsBusy = false; return; } - - SMESH::ElementType aType = SMESH::ALL; - switch(myTypeId) { - case grpNodeSelection: aType = SMESH::NODE; break; - case grp0DSelection: aType = SMESH::ELEM0D; break; - case grpBallSelection: aType = SMESH::BALL; break; - case grpEdgeSelection: aType = SMESH::EDGE; break; - case grpFaceSelection: aType = SMESH::FACE; break; - case grpVolumeSelection: aType = SMESH::VOLUME; break; - } - - if (myCurrentLineEdit == mySubMeshLine) { - //SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects()); - SALOME_ListIO aList; - mySelectionMgr->selectedObjects( aList ); - - SALOME_ListIteratorOfListIO anIt (aList); - for ( ; anIt.More(); anIt.Next()) { - SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface(anIt.Value()); - if (!aSubMesh->_is_nil()) { - // check if mesh is the same - if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) { - if (aType == SMESH::NODE) { - try { - SMESH::long_array_var anElements = aSubMesh->GetNodesId(); - int k = anElements->length(); - for (int i = 0; i < k; i++) { - QList found = - myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly); - QListWidgetItem* anItem; - foreach(anItem, found) delete anItem; - } - } - catch (const SALOME::SALOME_Exception& ex) { - SalomeApp_Tools::QtCatchCorbaException(ex); - } - } - else { - try { - SMESH::long_array_var anElements = aSubMesh->GetElementsId(); - int k = anElements->length(); - for (int i = 0; i < k; i++) { - QList found = - myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly); - QListWidgetItem* anItem; - foreach(anItem, found) delete anItem; - } - } - catch (const SALOME::SALOME_Exception& ex) { - SalomeApp_Tools::QtCatchCorbaException(ex); - } - } - } - } - } - } - else if (myCurrentLineEdit == myGroupLine) { - SALOME_ListIO aList; - mySelectionMgr->selectedObjects( aList ); - - SALOME_ListIteratorOfListIO anIt (aList); - for ( ; anIt.More(); anIt.Next()) { - SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface(anIt.Value()); - if (!aGroup->_is_nil()) { - // check if mesh is the same - if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) { - SMESH::long_array_var anElements = aGroup->GetListOfID(); - int k = anElements->length(); - for (int i = 0; i < k; i++) { - QList found = - myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly); - QListWidgetItem* anItem; - foreach(anItem, found) delete anItem; - } - } - } - } - } - } - myIsBusy = false; - if ( sizeBefore > myElements->count() ) - myNbChangesOfContents += 2; // it's used to detect that "Add" was only once - updateButtons(); -} - -//================================================================================= -// function : onSort() -// purpose : -//================================================================================= -void SMESHGUI_AdaptDlg::onSort() -{ - // PAL5412: sorts items in ascending by "string" value - // myElements->sort(true); - // myElements->update(); - int i, k = myElements->count(); - if (k > 0) { - myIsBusy = true; - QList aSelected; - std::vector anArray(k); - // QMemArray anArray(k); - // fill the array - for (i = 0; i < k; i++) { - int id = myElements->item(i)->text().toInt(); - anArray[i] = id; - if (myElements->item(i)->isSelected()) - aSelected.append(id); - } - // sort & update list - std::sort(anArray.begin(), anArray.end()); - // anArray.sort(); - myElements->clear(); - QListWidgetItem* anItem; - QList listItemsToSel; - for (i = 0; i < k; i++) { - anItem = new QListWidgetItem(QString::number(anArray[i])); - myElements->addItem(anItem); - if (aSelected.contains(anArray[i])) - listItemsToSel.push_back(anItem); - } - bool blocked = myElements->signalsBlocked(); - myElements->blockSignals(true); - foreach(anItem, listItemsToSel) anItem->setSelected(true); - myElements->blockSignals(blocked); - listItemsToSel.clear(); - myIsBusy = false; - } -} - -//================================================================================= -// function : onVisibilityChanged() -// purpose : -//================================================================================= -void SMESHGUI_AdaptDlg::onVisibilityChanged() -{ - SetAppropriateActor(); -} - -//================================================================================= -// function : SMESHGUI_AdaptDlg::reject -// purpose : SLOT called when "Close" button pressed. Close dialog -//================================================================================= -void SMESHGUI_AdaptDlg::reject() -{ - if (SMESH::GetCurrentVtkView()) { - SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters - SMESH::SetPointRepresentation(false); - SMESH::SetPickable(); - restoreShowEntityMode(); - } - - if( isApplyAndClose() && !myObjectToSelect.isEmpty() ) { - SUIT_DataOwnerPtrList aList; - aList.append( new LightApp_DataOwner( myObjectToSelect ) ); - mySelectionMgr->setSelected( aList ); - } - else - mySelectionMgr->clearSelected(); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(ActorSelection); - mySelectionMgr->clearFilters(); - mySMESHGUI->ResetState(); - - QDialog::reject(); - - if ( myFilterDlg ) myFilterDlg->UnRegisterFilters(); -} - -//================================================================================= -// function : onOpenView() -// purpose : -//================================================================================= -void SMESHGUI_AdaptDlg::onOpenView() -{ - if ( mySelector ) { - SMESH::SetPointRepresentation(false); - } - else { - mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector(); - mySMESHGUI->EmitSignalDeactivateDialog(); - setEnabled(true); - } -} - -//================================================================================= -// function : onCloseView() -// purpose : -//================================================================================= -void SMESHGUI_AdaptDlg::onCloseView() -{ - onDeactivate(); - mySelector = 0; -} - -//================================================================================= -// function : onHelp() -// purpose : -//================================================================================= -void SMESHGUI_AdaptDlg::onHelp() -{ - LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); - if (app) - { - app->onHelpContextModule - ( mySMESHGUI ? app->moduleName( mySMESHGUI->moduleName() ) : QString(""), myHelpFileName ); - } - else - { -#ifdef WIN32 - QString platform = "winapplication"; -#else - QString platform = "application"; -#endif - SUIT_MessageBox::warning(this, tr( "WRN_WARNING" ), - tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ). - arg(app->resourceMgr()->stringValue( "ExternalBrowser", platform)). - arg(myHelpFileName)); - } -} - -//================================================================================= -// function : SMESHGUI_AdaptDlg::onDeactivate -// purpose : SLOT called when dialog must be deactivated -//================================================================================= -void SMESHGUI_AdaptDlg::onDeactivate() -{ - mySMESHGUI->ResetState(); - setEnabled(false); -} - -//================================================================================= -// function : SMESHGUI_AdaptDlg::enterEvent -// purpose : Event filter -//================================================================================= -void SMESHGUI_AdaptDlg::enterEvent (QEvent*) -{ - if (!isEnabled()) { - SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ); - if ( aViewWindow && !mySelector) { - mySelector = aViewWindow->GetSelector(); - } - mySMESHGUI->EmitSignalDeactivateDialog(); - setEnabled(true); - mySelectionMode = grpNoSelection; - setSelectionMode(myTypeId); - mySMESHGUI->SetActiveDialogBox(this); - if ( mySelectBox->isEnabled() ) mySMESHGUI->SetState(800); - else mySMESHGUI->ResetState(); - } -} - -//================================================================================= -// function : keyPressEvent() -// purpose : -//================================================================================= -void SMESHGUI_AdaptDlg::keyPressEvent( QKeyEvent* e ) -{ - QDialog::keyPressEvent( e ); - if ( e->isAccepted() ) - return; - - if ( e->key() == Qt::Key_F1 ) - { - e->accept(); - onHelp(); - } -} - -//================================================================================ -/*! - * \brief Enable showing of the popup when Geometry selection btn is clicked - * \param enable - true to enable - */ -//================================================================================ - -enum { DIRECT_GEOM_INDEX = 0, GEOM_BY_MESH_INDEX }; - -void SMESHGUI_AdaptDlg::updateGeomPopup() -{ - bool enable = false; - - if ( !myMesh->_is_nil() ) - enable = myMesh->NbEdges() > 0; - - if ( myGeomGroupBtn ) - { - disconnect( myGeomGroupBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) )); - if ( enable ) { - if ( !myGeomPopup ) { - myGeomPopup = new QMenu(this); - myActions[myGeomPopup->addAction( tr( "DIRECT_GEOM_SELECTION" ) )] = DIRECT_GEOM_INDEX; - myActions[myGeomPopup->addAction( tr( "GEOM_BY_MESH_ELEM_SELECTION" ) )] = GEOM_BY_MESH_INDEX; - connect( myGeomPopup, SIGNAL( triggered( QAction* ) ), SLOT( onGeomPopup( QAction* ) ) ); - } - connect( myGeomGroupBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) )); - } - } -} - - -//================================================================================= -// function : onGeomSelectionButton() -// purpose : -//================================================================================= -void SMESHGUI_AdaptDlg::onGeomSelectionButton(bool isBtnOn) -{ - if ( myGeomPopup && isBtnOn ) - { - myCurrentLineEdit = myGeomGroupLine; - QAction* a = myGeomPopup->exec( QCursor::pos() ); - if (!a || myActions[a] == DIRECT_GEOM_INDEX) - setSelectionMode(grpGeomSelection); - } - else if (!isBtnOn) - { - myCurrentLineEdit = 0; - setSelectionMode(grpAllSelection); - } -} - -//================================================================================= -// function : onGeomPopup() -// purpose : -//================================================================================= -void SMESHGUI_AdaptDlg::onGeomPopup( QAction* a ) -{ - int index = myActions[a]; - if ( index == GEOM_BY_MESH_INDEX ) - { - mySelectionMode = grpNoSelection; - if ( !myShapeByMeshOp ) { - myShapeByMeshOp = new SMESHGUI_ShapeByMeshOp(true); - connect(myShapeByMeshOp, SIGNAL(committed(SUIT_Operation*)), - SLOT(onPublishShapeByMeshDlg(SUIT_Operation*))); - connect(myShapeByMeshOp, SIGNAL(aborted(SUIT_Operation*)), - SLOT(onCloseShapeByMeshDlg(SUIT_Operation*))); - } - // set mesh object to SMESHGUI_ShapeByMeshOp and start it - if ( !myMesh->_is_nil() ) { - myIsBusy = true; - hide(); // stop processing selection - myIsBusy = false; - myShapeByMeshOp->setModule( mySMESHGUI ); - myShapeByMeshOp->setStudy( 0 ); // it's really necessary - myShapeByMeshOp->SetMesh( myMesh ); - myShapeByMeshOp->start(); - } - } -} - -//================================================================================ -/*! - * \brief SLOT. Is called when Ok is pressed in SMESHGUI_ShapeByMeshDlg - */ -//================================================================================ - -void SMESHGUI_AdaptDlg::onPublishShapeByMeshDlg(SUIT_Operation* op) -{ - if ( myShapeByMeshOp == op ) { - mySMESHGUI->getApp()->updateObjectBrowser(); - show(); - // Select a found geometry object - GEOM::GEOM_Object_var aGeomVar = myShapeByMeshOp->GetShape(); - if ( !aGeomVar->_is_nil() ) - { - QString ID = aGeomVar->GetStudyEntry(); - if ( _PTR(SObject) aGeomSO = SMESH::getStudy()->FindObjectID( ID.toLatin1().data() )) { - SALOME_ListIO anIOList; - Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject - ( aGeomSO->GetID().c_str(), "SMESH", aGeomSO->GetName().c_str() ); - anIOList.Append( anIO ); - mySelectionMgr->setSelectedObjects( anIOList, false ); - onObjectSelectionChanged(); - } - } - } -} - -//================================================================================ -/*! - * \brief SLOT. Is called when Close is pressed in SMESHGUI_ShapeByMeshDlg - */ -//================================================================================ - -void SMESHGUI_AdaptDlg::onCloseShapeByMeshDlg(SUIT_Operation* op) -{ - if ( myShapeByMeshOp == op ) - { - show(); - setSelectionMode(grpGeomSelection); - } -} - -//================================================================================= -// function : setGroupColor() -// purpose : -//================================================================================= -void SMESHGUI_AdaptDlg::setGroupColor( const SALOMEDS::Color& theColor ) -{ - QColor aQColor( (int)( theColor.R * 255.0 ), - (int)( theColor.G * 255.0 ), - (int)( theColor.B * 255.0 ) ); - setGroupQColor( aQColor ); -} - -//================================================================================= -// function : getGroupColor() -// purpose : -//================================================================================= -SALOMEDS::Color SMESHGUI_AdaptDlg::getGroupColor() const -{ - QColor aQColor = getGroupQColor(); - - SALOMEDS::Color aColor; - aColor.R = (float)aQColor.red() / 255.0; - aColor.G = (float)aQColor.green() / 255.0; - aColor.B = (float)aQColor.blue() / 255.0; - - return aColor; -} - -//================================================================================= -// function : setGroupQColor() -// purpose : -//================================================================================= -void SMESHGUI_AdaptDlg::setGroupQColor( const QColor& theColor ) -{ - if( theColor.isValid() ) - myColorBtn->setColor( theColor ); -} - -//================================================================================= -// function : getGroupQColor() -// purpose : -//================================================================================= -QColor SMESHGUI_AdaptDlg::getGroupQColor() const -{ - return myColorBtn->color(); -} - -//================================================================================= -// function : setDefaultGroupColor() -// purpose : -//================================================================================= -void SMESHGUI_AdaptDlg::setDefaultGroupColor() -{ - if( myMesh->_is_nil() ) - return; - - bool isAutoColor = myMesh->GetAutoColor(); - - QColor aQColor = myColorBtn->color(); - if( !isAutoColor ) - { - if ( !aQColor.isValid() ) { - int r = 0, g = 0, b = 0; - SMESH::GetColor( "SMESH", "default_grp_color", r, g, b, QColor( 255, 170, 0 ) ); - aQColor.setRgb( r, g, b ); - } - } - else - { -#ifdef SIMPLE_AUTOCOLOR // simplified algorithm for auto-colors - SALOMEDS::Color aColor = SMESHGUI::getPredefinedUniqueColor(); -#else // old algorithm for auto-colors - SMESH::ListOfGroups aListOfGroups = *myMesh->GetGroups(); - - QList aReservedColors; - for( int i = 0, n = aListOfGroups.length(); i < n; i++ ) - { - SMESH::SMESH_GroupBase_var aGroupObject = aListOfGroups[i]; - SALOMEDS::Color aReservedColor = aGroupObject->GetColor(); - aReservedColors.append( aReservedColor ); - } - - SALOMEDS::Color aColor = SMESHGUI::getUniqueColor( aReservedColors ); -#endif // SIMPLE_AUTOCOLOR - - aQColor.setRgb( (int)( aColor.R * 255.0 ), - (int)( aColor.G * 255.0 ), - (int)( aColor.B * 255.0 ) ); - - } - - setGroupQColor( aQColor ); -} - -//================================================================================= -// function : SetAppropriateActor() -// purpose : Find more appropriate of visible actors, set it to myActor, allow picking -// NPAL19389: create a group with a selection in another group. -// if mesh actor is not visible - find any first visible group or sub-mesh -//================================================================================= -bool SMESHGUI_AdaptDlg::SetAppropriateActor() -{ - bool isActor = false; - myActorsList.clear(); - - if (myMesh->_is_nil()) return false; - - SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView(); - - if (myGrpTypeGroup->checkedId() > 0) { // try current group on geometry actor - SMESH_Actor* anActor = 0; - if (!myGroupOnGeom->_is_nil()) - anActor = SMESH::FindActorByObject(myGroupOnGeom); - if (!myGroupOnFilter->_is_nil()) - anActor = SMESH::FindActorByObject(myGroupOnFilter); - if (anActor && anActor->hasIO()) - { - isActor = true; - if (aViewWindow && !aViewWindow->isVisible(anActor->getIO())) - isActor = false; - else - myActorsList.append(anActor); - } - return anActor; - } - else { - // try mesh actor - SMESH_Actor* anActor = SMESH::FindActorByObject(myMesh); - if (anActor && anActor->hasIO()) { - isActor = true; - if (aViewWindow && !aViewWindow->isVisible(anActor->getIO())) - isActor = false; - else - myActorsList.append(anActor); - } - - // try group actor - SMESH_Actor* aGroupActor = 0; - if (!isActor && !myGroup->_is_nil()) { - aGroupActor = SMESH::FindActorByObject(myGroup); - if (aGroupActor && aGroupActor->hasIO()) - myActorsList.append(aGroupActor); - } - - // try any visible actor of group or sub-mesh of current mesh - if (aViewWindow) { - // mesh entry - _PTR(SObject) aSObject = SMESH::FindSObject(myMesh); - if (aSObject) { - CORBA::String_var meshEntry = aSObject->GetID().c_str(); - int len = strlen(meshEntry); - - // iterate on all actors in current view window, search for - // any visible actor, that belongs to group or submesh of current mesh - VTK::ActorCollectionCopy aCopy(aViewWindow->getRenderer()->GetActors()); - vtkActorCollection *aCollection = aCopy.GetActors(); - int nbItems = aCollection->GetNumberOfItems(); - for (int i=0; i(aCollection->GetItemAsObject(i)); - if (anActor && anActor->hasIO()) { - Handle(SALOME_InteractiveObject) anIO = anActor->getIO(); - if (aViewWindow->isVisible(anIO)) { - if (anIO->hasEntry() && strncmp(anIO->getEntry(), meshEntry, len) == 0 && !myActorsList.contains(anActor) ) - myActorsList.append(anActor); - } - } - } - } - } - - // Show a standalone group if nothing else is visible (IPAL52227) - if ( myActorsList.count() == 1 && - myActorsList[0] == aGroupActor && - aViewWindow && !aViewWindow->isVisible(aGroupActor->getIO())) - SMESH::UpdateView( aViewWindow, SMESH::eDisplay, aGroupActor->getIO()->getEntry() ); - } - - - if (myActorsList.count() > 0) { - QListIterator it( myActorsList ); - while ( it.hasNext() ) { - SMESH_Actor* anActor = it.next(); - if ( IsActorVisible(anActor) ) - anActor->SetPickable(true); - } - } - - return ( isActor || (myActorsList.count() > 0) ); -} - -//======================================================================= -//function : setShowEntityMode -//purpose : make shown only entity corresponding to my type -//======================================================================= -void SMESHGUI_AdaptDlg::setShowEntityMode() -{ - if ( !myMesh->_is_nil() ) { - if ( SMESH_Actor* actor = SMESH::FindActorByObject(myMesh) ) { - if (!myStoredShownEntity) - myStoredShownEntity = actor->GetEntityMode(); - switch ( myTypeId ) { - case grpNodeSelection: restoreShowEntityMode(); break; - case grp0DSelection: actor->SetEntityMode( SMESH_Actor::e0DElements ); break; - case grpBallSelection: actor->SetEntityMode( SMESH_Actor::eBallElem ); break; - case grpEdgeSelection: actor->SetEntityMode( SMESH_Actor::eEdges ); break; - case grpFaceSelection: actor->SetEntityMode( SMESH_Actor::eFaces ); break; - case grpVolumeSelection: actor->SetEntityMode( SMESH_Actor::eVolumes ); break; - } - } - } -} - -//======================================================================= -//function : restoreShowEntityMode -//purpose : restore ShowEntity mode of myActor -//======================================================================= -void SMESHGUI_AdaptDlg::restoreShowEntityMode() -{ - if ( myStoredShownEntity && !myMesh->_is_nil() ) { - if ( SMESH_Actor* actor = SMESH::FindActorByObject(myMesh) ) { - actor->SetEntityMode(myStoredShownEntity); - } - } - myStoredShownEntity = 0; -} - -//======================================================================= -//function : IsActorVisible -//purpose : return visibility of the actor -//======================================================================= -bool SMESHGUI_AdaptDlg::IsActorVisible( SMESH_Actor* theActor ) -{ - SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView(); - if (theActor && aViewWindow) - return aViewWindow->isVisible(theActor->getIO()); - return false; -} - -//================================================================ -//function : setIsApplyAndClose -//purpose : Set value of the flag indicating that the dialog is -// accepted by Apply & Close button -//================================================================ -void SMESHGUI_AdaptDlg::setIsApplyAndClose( const bool theFlag ) -{ - myIsApplyAndClose = theFlag; -} - -//================================================================ -//function : isApplyAndClose -//purpose : Get value of the flag indicating that the dialog is -// accepted by Apply & Close button -//================================================================ -bool SMESHGUI_AdaptDlg::isApplyAndClose() const -{ - return myIsApplyAndClose; -} diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.h b/src/SMESHGUI/SMESHGUI_AdaptDlg.h index 2b139a3c0..4392340ea 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.h +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.h @@ -29,36 +29,12 @@ // Qt includes #include -#include -#include // IDL includes #include #include CORBA_SERVER_HEADER(SMESH_Mesh) -#include CORBA_SERVER_HEADER(SMESH_Group) -#include CORBA_SERVER_HEADER(SMESH_Filter) -class QGroupBox; -class QLabel; -class QLineEdit; -class QButtonGroup; -class QListWidget; -class QMenu; -class QPushButton; -class QToolButton; -class QCheckBox; -class QStackedWidget; -class QAction; class SMESHGUI; -class SMESH_Actor; -class SMESHGUI_FilterDlg; -class SMESHGUI_ShapeByMeshOp; -class QtxColorButton; -class SUIT_Operation; -class SVTK_Selector; -class SUIT_SelectionFilter; -class LightApp_SelectionMgr; -class SMESH_LogicalFilter; //================================================================================= // class : SMESHGUI_AdaptDlg @@ -77,161 +53,18 @@ public: virtual bool action (int theCommandID); virtual bool OnGUIEvent (int theCommandID); - static QString GetDefaultName( const QString& ); - -// static ADAPT::ADAPT_Gen_var InitAdaptGen(SalomeApp_Application*); +// static ADAPT::ADAPT_Gen_var InitAdaptGen(SalomeApp_Application*); public slots: - void onAdd(); - void onRemove(); protected slots: - virtual void reject(); private slots: - void onTypeChanged( int ); - void onGrpTypeChanged( int ); - void onColorChanged( QColor ); - - void onOK(); - bool onApply(); - void onHelp(); - void onDeactivate(); - void onVisibilityChanged(); - - void onListSelectionChanged(); - void onObjectSelectionChanged(); - - void onSelectAll(); - void onSelectSubMesh( bool ); - void onSelectGroup( bool ); - void onSelectGeomGroup( bool ); - void setCurrentSelection(); - - void setFilters(); - void onSort(); - - void onNameChanged( const QString& ); - void onFilterAccepted(); - - void onGeomPopup( QAction* ); - void onGeomSelectionButton( bool ); - - void onPublishShapeByMeshDlg( SUIT_Operation* ); - void onCloseShapeByMeshDlg( SUIT_Operation* ); - - void onOpenView(); - void onCloseView(); private: - void initDialog( bool ); - void init( SMESH::SMESH_Mesh_ptr ); - void init( SMESH::SMESH_GroupBase_ptr ); - void enterEvent( QEvent* ); - void keyPressEvent( QKeyEvent* ); - void setSelectionMode( int ); - void updateButtons(); - void updateGeomPopup(); - bool SetAppropriateActor(); - void setShowEntityMode(); - void restoreShowEntityMode(); - - bool IsActorVisible( SMESH_Actor* ); - - void setGroupColor( const SALOMEDS::Color& ); - SALOMEDS::Color getGroupColor() const; - - void setGroupQColor( const QColor& ); - QColor getGroupQColor() const; - void setDefaultName() const; - void setDefaultGroupColor(); - - void setIsApplyAndClose( const bool theFlag ); - bool isApplyAndClose() const; - - private: void recupPreferences(); SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */ - LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */ - int myGrpTypeId; /* Current group type id : standalone or group on geometry */ - int myTypeId; /* Current type id = radio button id */ - int myStoredShownEntity; /* Store ShowEntity mode of myMesh */ - QLineEdit* myCurrentLineEdit; /* Current LineEdit */ - SVTK_Selector* mySelector; - - QPushButton* myMeshGroupBtn; - QLineEdit* myMeshGroupLine; - - QButtonGroup* myTypeGroup; - QLineEdit* myName; - QString myOldName; - - QButtonGroup* myGrpTypeGroup; - - QStackedWidget* myWGStack; - QCheckBox* mySelectAll; - QCheckBox* myAllowElemsModif; - QLabel* myElementsLab; - QListWidget* myElements; - QPushButton* myFilterBtn; - QPushButton* myAddBtn; - QPushButton* myRemoveBtn; - QPushButton* mySortBtn; - - QGroupBox* mySelectBox; - QCheckBox* mySelectSubMesh; - QPushButton* mySubMeshBtn; - QLineEdit* mySubMeshLine; - QCheckBox* mySelectGroup; - QPushButton* myGroupBtn; - QLineEdit* myGroupLine; - - QtxColorButton* myColorBtn; - - QCheckBox* mySelectGeomGroup; - QToolButton* myGeomGroupBtn; - QLineEdit* myGeomGroupLine; - QMenu* myGeomPopup; - - QPushButton* myOKBtn; - QPushButton* myApplyBtn; - QPushButton* myCloseBtn; - QPushButton* myHelpBtn; - - SMESHGUI_ShapeByMeshOp* myShapeByMeshOp; - - SMESH::SMESH_Mesh_var myMesh; - QList myActorsList; - SMESH::SMESH_Group_var myGroup; - SMESH::SMESH_GroupOnGeom_var myGroupOnGeom; - SMESH::SMESH_GroupOnFilter_var myGroupOnFilter; - SMESH::Filter_var myFilter; - QList myIdList; - GEOM::ListOfGO_var myGeomObjects; - - int mySelectionMode; - //Handle(SMESH_TypeFilter) myMeshFilter; - //Handle(SMESH_TypeFilter) mySubMeshFilter; - //Handle(SMESH_TypeFilter) myGroupFilter; - SUIT_SelectionFilter* myMeshFilter; - SMESH_LogicalFilter* mySubMeshFilter; - SMESH_LogicalFilter* myGroupFilter; - SUIT_SelectionFilter* myGeomFilter; - - SMESHGUI_FilterDlg* myFilterDlg; - - bool myCreate, myIsBusy; - - QString myHelpFileName; - - QMap myActions; - - bool myNameChanged; //added by skl for IPAL19574 - int myNbChangesOfContents; // nb add's and remove's - - QString myObjectToSelect; - bool myIsApplyAndClose; QString _ObjectName; QString _LanguageShort ; From 3fb47a652285a23e85265c0fe0ef0237452105f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Thu, 4 Jun 2020 17:43:05 +0200 Subject: [PATCH 037/100] gestion des includes en .ui --- src/SMESHGUI/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SMESHGUI/CMakeLists.txt b/src/SMESHGUI/CMakeLists.txt index c08dae366..642d767df 100644 --- a/src/SMESHGUI/CMakeLists.txt +++ b/src/SMESHGUI/CMakeLists.txt @@ -45,6 +45,7 @@ INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/src/ADAPTGUI ${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}/idl + ${PROJECT_BINARY_DIR}/src/ADAPTGUI ) # additional preprocessor / compiler flags From 2362b00dd27b541d718d967a217ba74572b6f65f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Thu, 4 Jun 2020 17:44:51 +0200 Subject: [PATCH 038/100] =?UTF-8?q?mise=20=C3=A0=20jour?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx | 1 + src/SMESHUtils/SMESH_ControlPnt.cxx | 93 ++++++------ src/SMESHUtils/SMESH_ControlPnt.hxx | 28 ++-- src/SMESH_I/SMESH_Mesh_i.cxx | 154 ++++++++++---------- 4 files changed, 138 insertions(+), 138 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx index e4654aa62..165b1487c 100644 --- a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx @@ -217,6 +217,7 @@ namespace SMESH void SetBallPosition(SMESH_Actor* theActor,TVTKIds& theIds, double theDiameter) { vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid(); + myBallPolyData->SetPoints(NULL); myBallPolyData->Reset(); myBallPolyData->DeleteCells(); myBallPolyData->SetPoints(aGrid->GetPoints()); diff --git a/src/SMESHUtils/SMESH_ControlPnt.cxx b/src/SMESHUtils/SMESH_ControlPnt.cxx index 16ab68651..2e644c135 100644 --- a/src/SMESHUtils/SMESH_ControlPnt.cxx +++ b/src/SMESHUtils/SMESH_ControlPnt.cxx @@ -58,9 +58,10 @@ namespace SMESHUtils const double& theSize, std::vector& thePoints ); - std::vector computePointsForSplitting( const gp_Pnt& p1, - const gp_Pnt& p2, - const gp_Pnt& p3 ); + void computePointsForSplitting( const gp_Pnt& p1, + const gp_Pnt& p2, + const gp_Pnt& p3, + gp_Pnt midPoints[3]); gp_Pnt tangencyPoint(const gp_Pnt& p1, const gp_Pnt& p2, const gp_Pnt& Center); @@ -164,8 +165,7 @@ void SMESHUtils::createPointsSampleFromFace( const TopoDS_Face& theFace, // Get triangles int nbTriangles = aTri->NbTriangles(); - Poly_Array1OfTriangle triangles(1,nbTriangles); - triangles=aTri->Triangles(); + const Poly_Array1OfTriangle& triangles = aTri->Triangles(); // GetNodes int nbNodes = aTri->NbNodes(); @@ -173,9 +173,10 @@ void SMESHUtils::createPointsSampleFromFace( const TopoDS_Face& theFace, nodes = aTri->Nodes(); // Iterate on triangles and subdivide them - for(int i=1; i<=nbTriangles; i++) + thePoints.reserve( thePoints.size() + nbTriangles ); + for ( int i = 1; i <= nbTriangles; i++ ) { - Poly_Triangle aTriangle = triangles.Value(i); + const Poly_Triangle& aTriangle = triangles.Value(i); gp_Pnt p1 = nodes.Value(aTriangle.Value(1)); gp_Pnt p2 = nodes.Value(aTriangle.Value(2)); gp_Pnt p3 = nodes.Value(aTriangle.Value(3)); @@ -184,7 +185,7 @@ void SMESHUtils::createPointsSampleFromFace( const TopoDS_Face& theFace, p2.Transform(aTrsf); p3.Transform(aTrsf); - subdivideTriangle(p1, p2, p3, theSize, thePoints); + subdivideTriangle( p1, p2, p3, theSize, thePoints ); } } @@ -221,10 +222,8 @@ void SMESHUtils::createPointsSampleFromSolid( const TopoDS_Solid& theSolid, // Step2 : for each face of theSolid: std::set intersections; - std::set::iterator it = intersections.begin(); - TopExp_Explorer Ex; - for (Ex.Init(theSolid,TopAbs_FACE); Ex.More(); Ex.Next()) + for ( TopExp_Explorer Ex( theSolid, TopAbs_FACE ); Ex.More(); Ex.Next() ) { // check if there is an intersection IntCurvesFace_Intersector anIntersector(TopoDS::Face(Ex.Current()), Precision::Confusion()); @@ -232,13 +231,13 @@ void SMESHUtils::createPointsSampleFromSolid( const TopoDS_Solid& theSolid, // get the intersection's parameter and store it int nbPoints = anIntersector.NbPnt(); - for(int i = 0 ; i < nbPoints ; i++ ) + for ( int i = 0 ; i < nbPoints; i++ ) { - it = intersections.insert( it, anIntersector.WParameter(i+1) ); + intersections.insert( anIntersector.WParameter(i+1) ); } } // Step3 : go through the line chunk by chunk - if ( intersections.begin() != intersections.end() ) + if ( intersections.size() > 1 ) { std::set::iterator intersectionsIterator=intersections.begin(); double first = *intersectionsIterator; @@ -254,9 +253,9 @@ void SMESHUtils::createPointsSampleFromSolid( const TopoDS_Solid& theSolid, double localStep = (second -first) / ceil( (second - first) / step ); for ( double z = Zmin + first; z < Zmin + second; z = z + localStep ) { - thePoints.push_back(ControlPnt( x, y, z, theSize )); + thePoints.emplace_back( x, y, z, theSize ); } - thePoints.push_back(ControlPnt( x, y, Zmin + second, theSize )); + thePoints.emplace_back( x, y, Zmin + second, theSize ); } first = second; innerPoints = !innerPoints; @@ -288,45 +287,45 @@ void SMESHUtils::subdivideTriangle( const gp_Pnt& p1, // and the distance between two mass centers of two neighbouring triangles // sharing an edge is < 2 * 1/2 * S = S // If the traingles share a Vertex and no Edge the distance of the mass centers - // to the Vertices is 2*D < S so the mass centers are distant of less than 2*S + // to the Vertices is 2*D < S so the mass centers are distant of less than 2*S double threshold = sqrt( 3. ) * theSize; - if ( (p1.Distance(p2) > threshold || - p2.Distance(p3) > threshold || - p3.Distance(p1) > threshold)) - { - std::vector midPoints = computePointsForSplitting(p1, p2, p3); + if ( p1.Distance(p2) > threshold || + p2.Distance(p3) > threshold || + p3.Distance(p1) > threshold ) + try + { + gp_Pnt midPoints[3]; + computePointsForSplitting( p1, p2, p3, midPoints ); - subdivideTriangle( midPoints[0], midPoints[1], midPoints[2], theSize, thePoints ); - subdivideTriangle( midPoints[0], p2, midPoints[1], theSize, thePoints ); - subdivideTriangle( midPoints[2], midPoints[1], p3, theSize, thePoints ); - subdivideTriangle( p1, midPoints[0], midPoints[2], theSize, thePoints ); - } - else - { - double x = (p1.X() + p2.X() + p3.X()) / 3 ; - double y = (p1.Y() + p2.Y() + p3.Y()) / 3 ; - double z = (p1.Z() + p2.Z() + p3.Z()) / 3 ; + subdivideTriangle( midPoints[0], midPoints[1], midPoints[2], theSize, thePoints ); + subdivideTriangle( midPoints[0], p2, midPoints[1], theSize, thePoints ); + subdivideTriangle( midPoints[2], midPoints[1], p3, theSize, thePoints ); + subdivideTriangle( p1, midPoints[0], midPoints[2], theSize, thePoints ); + return; + } + catch (...) + { + } - ControlPnt massCenter( x ,y ,z, theSize ); - thePoints.push_back( massCenter ); - } + gp_Pnt massCenter = ( p1.XYZ() + p2.XYZ() + p3.XYZ() ) / 3.; + thePoints.emplace_back( massCenter, theSize ); } //================================================================================ /*! * \brief Returns the appropriate points for splitting a triangle - * \brief the tangency points of the incircle are used in order to have mostly - * \brief well-shaped sub-triangles + * the tangency points of the incircle are used in order to have mostly + * well-shaped sub-triangles */ //================================================================================ -std::vector SMESHUtils::computePointsForSplitting( const gp_Pnt& p1, - const gp_Pnt& p2, - const gp_Pnt& p3 ) +void SMESHUtils::computePointsForSplitting( const gp_Pnt& p1, + const gp_Pnt& p2, + const gp_Pnt& p3, + gp_Pnt midPoints[3]) { - std::vector midPoints; //Change coordinates gp_Trsf Trsf_1; // Identity transformation gp_Ax3 reference_system(gp::Origin(), gp::DZ(), gp::DX()); // OXY @@ -359,15 +358,11 @@ std::vector SMESHUtils::computePointsForSplitting( const gp_Pnt& p1, gp_Pnt T2 = tangencyPoint( B, C, Center); gp_Pnt T3 = tangencyPoint( C, A, Center); - gp_Pnt p1_2 = T1.Transformed(Trsf_1.Inverted()); - gp_Pnt p2_3 = T2.Transformed(Trsf_1.Inverted()); - gp_Pnt p3_1 = T3.Transformed(Trsf_1.Inverted()); + midPoints[0] = T1.Transformed(Trsf_1.Inverted()); + midPoints[1] = T2.Transformed(Trsf_1.Inverted()); + midPoints[2] = T3.Transformed(Trsf_1.Inverted()); - midPoints.push_back(p1_2); - midPoints.push_back(p2_3); - midPoints.push_back(p3_1); - - return midPoints; + return; } //================================================================================ diff --git a/src/SMESHUtils/SMESH_ControlPnt.hxx b/src/SMESHUtils/SMESH_ControlPnt.hxx index 9ebdd909a..f19da4aa9 100644 --- a/src/SMESHUtils/SMESH_ControlPnt.hxx +++ b/src/SMESHUtils/SMESH_ControlPnt.hxx @@ -42,11 +42,9 @@ namespace SMESHUtils { ControlPnt() : gp_Pnt(), size(0) {} - ControlPnt( const gp_Pnt& aPnt, double theSize) + ControlPnt( const gp_Pnt& aPnt, double theSize=0) : gp_Pnt( aPnt ), size( theSize ) {} - ControlPnt(double theX,double theY,double theZ) - : gp_Pnt(theX, theY, theZ), size(0) {} - ControlPnt(double theX,double theY,double theZ, double theSize) + ControlPnt(double theX,double theY,double theZ, double theSize=0) : gp_Pnt(theX, theY, theZ), size( theSize ) {} double Size() const { return size; }; @@ -57,20 +55,20 @@ namespace SMESHUtils // Functions to get sample point from shapes SMESHUtils_EXPORT void createControlPoints( const TopoDS_Shape& theShape, - const double& theSize, - std::vector< ControlPnt >& thePoints ); + const double& theSize, + std::vector< ControlPnt >& thePoints ); - SMESHUtils_EXPORT void createPointsSampleFromEdge( const TopoDS_Edge& theEdge, - const double& theSize, - std::vector& thePoints ); + SMESHUtils_EXPORT void createPointsSampleFromEdge( const TopoDS_Edge& theEdge, + const double& theSize, + std::vector& thePoints ); - SMESHUtils_EXPORT void createPointsSampleFromFace( const TopoDS_Face& theFace, - const double& theSize, - std::vector& thePoints ); + SMESHUtils_EXPORT void createPointsSampleFromFace( const TopoDS_Face& theFace, + const double& theSize, + std::vector& thePoints ); - SMESHUtils_EXPORT void createPointsSampleFromSolid( const TopoDS_Solid& theSolid, - const double& theSize, - std::vector& thePoints ); + SMESHUtils_EXPORT void createPointsSampleFromSolid( const TopoDS_Solid& theSolid, + const double& theSize, + std::vector& thePoints ); } #endif diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index b24e3ba2d..cf2a16ea6 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -6425,8 +6425,8 @@ class SMESH_DimHyp //! fields int _dim; //!< a dimension the algo can build (concurrent dimension) int _ownDim; //!< dimension of shape of _subMesh (>=_dim) - TopTools_MapOfShape _shapeMap; //!< [sub-]shapes of dimension == _dim - SMESH_subMesh* _subMesh; + TopTools_MapOfShape _shapeMap; //!< [sub-]shapes of dimension == _dim + const SMESH_subMesh* _subMesh; list _hypotheses; //!< algo is first, then its parameters //----------------------------------------------------------------------------- @@ -6440,7 +6440,7 @@ class SMESH_DimHyp const int theDim, const TopoDS_Shape& theShape) { - _subMesh = (SMESH_subMesh*)theSubMesh; + _subMesh = theSubMesh; SetShape( theDim, theShape ); } @@ -6571,7 +6571,8 @@ void addDimHypInstance(const int theDim, theAlgo->NeedLowerHyps( theDim )) // IPAL54678 return; TDimHypList& listOfdimHyp = theDimHypListArr[theDim]; - if ( listOfdimHyp.empty() || listOfdimHyp.back()->_subMesh != theSubMesh ) { + if ( listOfdimHyp.empty() || listOfdimHyp.back()->_subMesh != theSubMesh ) + { SMESH_DimHyp* dimHyp = new SMESH_DimHyp( theSubMesh, theDim, theShape ); dimHyp->_hypotheses.push_front(theAlgo); listOfdimHyp.push_back( dimHyp ); @@ -6627,7 +6628,8 @@ void unionLists(TListOfInt& theListOfId, const int theIndx ) { TListOfListOfInt::iterator it = theListOfListOfId.begin(); - for ( int i = 0; it != theListOfListOfId.end(); it++, i++ ) { + for ( int i = 0; it != theListOfListOfId.end(); it++, i++ ) + { if ( i < theIndx ) continue; //skip already treated lists // check if other list has any same submesh object @@ -6750,83 +6752,85 @@ TListOfListOfInt SMESH_Mesh_i::findConcurrentSubMeshes() { TListOfListOfInt anOrder; ::SMESH_Mesh& mesh = GetImpl(); - { - // collect submeshes and detect concurrent algorithms and hypothesises - TDimHypList dimHypListArr[4]; // dimHyp list for each shape dimension - map::iterator i_sm = _mapSubMesh.begin(); - for ( ; i_sm != _mapSubMesh.end(); i_sm++ ) { - ::SMESH_subMesh* sm = (*i_sm).second; - // shape of submesh - const TopoDS_Shape& aSubMeshShape = sm->GetSubShape(); + // collect submeshes and detect concurrent algorithms and hypothesises + TDimHypList dimHypListArr[4]; // dimHyp list for each shape dimension - // list of assigned hypothesises - const list & hypList = mesh.GetHypothesisList(aSubMeshShape); - // Find out dimensions where the submesh can be concurrent. - // We define the dimensions by algo of each of hypotheses in hypList - list ::const_iterator hypIt = hypList.begin(); - for( ; hypIt != hypList.end(); hypIt++ ) { - SMESH_Algo* anAlgo = 0; - const SMESH_Hypothesis* hyp = dynamic_cast(*hypIt); - if ( hyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO ) - // hyp it-self is algo - anAlgo = (SMESH_Algo*)dynamic_cast(hyp); - else { - // try to find algorithm with help of sub-shapes - TopExp_Explorer anExp( aSubMeshShape, shapeTypeByDim(hyp->GetDim()) ); - for ( ; !anAlgo && anExp.More(); anExp.Next() ) - anAlgo = mesh.GetGen()->GetAlgo( mesh, anExp.Current() ); - } - if (!anAlgo) - continue; // no algorithm assigned to a current submesh + map::iterator i_sm = _mapSubMesh.begin(); + for ( ; i_sm != _mapSubMesh.end(); i_sm++ ) { + ::SMESH_subMesh* sm = (*i_sm).second; + // shape of submesh + const TopoDS_Shape& aSubMeshShape = sm->GetSubShape(); - int dim = anAlgo->GetDim(); // top concurrent dimension (see comment to SMESH_DimHyp) - // the submesh can concurrent at (or lower dims if !anAlgo->NeedDiscreteBoundary() - // and !anAlgo->NeedLowerHyps( dim )) - - // create instance of dimension-hypothesis for found concurrent dimension(s) and algorithm - for ( int j = anAlgo->NeedDiscreteBoundary() ? dim : 1, jn = dim; j <= jn; j++ ) - addDimHypInstance( j, aSubMeshShape, anAlgo, sm, hypList, dimHypListArr ); + // list of assigned hypothesises + const list & hypList = mesh.GetHypothesisList(aSubMeshShape); + // Find out dimensions where the submesh can be concurrent. + // We define the dimensions by algo of each of hypotheses in hypList + list ::const_iterator hypIt = hypList.begin(); + for( ; hypIt != hypList.end(); hypIt++ ) { + SMESH_Algo* anAlgo = 0; + const SMESH_Hypothesis* hyp = dynamic_cast(*hypIt); + if ( hyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO ) + // hyp it-self is algo + anAlgo = (SMESH_Algo*)dynamic_cast(hyp); + else { + // try to find algorithm with help of sub-shapes + TopExp_Explorer anExp( aSubMeshShape, shapeTypeByDim(hyp->GetDim()) ); + for ( ; !anAlgo && anExp.More(); anExp.Next() ) + anAlgo = mesh.GetGen()->GetAlgo( mesh, anExp.Current() ); } - } // end iterations on submesh + if (!anAlgo) + continue; // no algorithm assigned to a current submesh + + int dim = anAlgo->GetDim(); // top concurrent dimension (see comment to SMESH_DimHyp) + // the submesh can concurrent at (or lower dims if !anAlgo->NeedDiscreteBoundary() + // and !anAlgo->NeedLowerHyps( dim )) + + // create instance of dimension-hypothesis for found concurrent dimension(s) and algorithm + for ( int j = anAlgo->NeedDiscreteBoundary() ? dim : 1, jn = dim; j <= jn; j++ ) + addDimHypInstance( j, aSubMeshShape, anAlgo, sm, hypList, dimHypListArr ); + } + } // end iterations on submesh // iterate on created dimension-hypotheses and check for concurrents - for ( int i = 0; i < 4; i++ ) { - const TDimHypList& listOfDimHyp = dimHypListArr[i]; - // check for concurrents in own and other dimensions (step-by-step) - TDimHypList::const_iterator dhIt = listOfDimHyp.begin(); - for ( ; dhIt != listOfDimHyp.end(); dhIt++ ) { - const SMESH_DimHyp* dimHyp = *dhIt; - TDimHypList listOfConcurr; - set setOfConcurrIds; - // looking for concurrents and collect into own list - for ( int j = i; j < 4; j++ ) - findConcurrents( dimHyp, dimHypListArr[j], listOfConcurr, setOfConcurrIds ); - // check if any concurrents found - if ( listOfConcurr.size() > 0 ) { - // add own submesh to list of concurrent - addInOrderOfPriority( dimHyp, listOfConcurr ); - list listOfConcurrIds; - TDimHypList::iterator hypIt = listOfConcurr.begin(); - for ( ; hypIt != listOfConcurr.end(); ++hypIt ) - listOfConcurrIds.push_back( (*hypIt)->_subMesh->GetId() ); - anOrder.push_back( listOfConcurrIds ); - } + for ( int i = 0; i < 4; i++ ) + { + const TDimHypList& listOfDimHyp = dimHypListArr[i]; + // check for concurrents in own and other dimensions (step-by-step) + TDimHypList::const_iterator dhIt = listOfDimHyp.begin(); + for ( ; dhIt != listOfDimHyp.end(); dhIt++ ) + { + const SMESH_DimHyp* dimHyp = *dhIt; + TDimHypList listOfConcurr; + set setOfConcurrIds; + // looking for concurrents and collect into own list + for ( int j = i; j < 4; j++ ) + findConcurrents( dimHyp, dimHypListArr[j], listOfConcurr, setOfConcurrIds ); + // check if any concurrents found + if ( listOfConcurr.size() > 0 ) + { + // add own submesh to list of concurrent + addInOrderOfPriority( dimHyp, listOfConcurr ); + list listOfConcurrIds; + TDimHypList::iterator hypIt = listOfConcurr.begin(); + for ( ; hypIt != listOfConcurr.end(); ++hypIt ) + listOfConcurrIds.push_back( (*hypIt)->_subMesh->GetId() ); + anOrder.push_back( listOfConcurrIds ); } } - - removeDimHyps(dimHypListArr); - - // now, minimize the number of concurrent groups - // Here we assume that lists of submeshes can have same submesh - // in case of multi-dimension algorithms, as result - // list with common submesh has to be united into one list - int listIndx = 0; - TListOfListOfInt::iterator listIt = anOrder.begin(); - for(; listIt != anOrder.end(); listIt++, listIndx++ ) - unionLists( *listIt, anOrder, listIndx + 1 ); } + removeDimHyps(dimHypListArr); + + // now, minimize the number of concurrent groups + // Here we assume that lists of submeshes can have same submesh + // in case of multi-dimension algorithms, as result + // list with common submesh has to be united into one list + int listIndx = 0; + TListOfListOfInt::iterator listIt = anOrder.begin(); + for(; listIt != anOrder.end(); listIt++, listIndx++ ) + unionLists( *listIt, anOrder, listIndx + 1 ); + return anOrder; } @@ -6913,7 +6917,8 @@ void SMESH_Mesh_i::convertMeshOrder (const TListOfListOfInt& theIdsOrder, theResOrder.length(nbSet); TListOfListOfInt::const_iterator it = theIdsOrder.begin(); int listIndx = 0; - for( ; it != theIdsOrder.end(); it++ ) { + for( ; it != theIdsOrder.end(); it++ ) + { // translate submesh identificators into submesh objects // takeing into account real number of concurrent lists const TListOfInt& aSubOrder = (*it); @@ -6926,7 +6931,8 @@ void SMESH_Mesh_i::convertMeshOrder (const TListOfListOfInt& theIdsOrder, aResSubSet->length(aSubOrder.size()); TListOfInt::const_iterator subIt = aSubOrder.begin(); int j; - for( j = 0; subIt != aSubOrder.end(); subIt++ ) { + for( j = 0; subIt != aSubOrder.end(); subIt++ ) + { if ( _mapSubMeshIor.find(*subIt) == _mapSubMeshIor.end() ) continue; SMESH::SMESH_subMesh_var subMesh = From 389de9f0a16e8c5eff5f33b63e26d2551418d956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Mon, 8 Jun 2020 14:29:21 +0200 Subject: [PATCH 039/100] Messages pour les TOP menus --- src/SMESHGUI/SMESH_msg_en.ts | 32 ++++++++++++++++++++++++-------- src/SMESHGUI/SMESH_msg_fr.ts | 22 +++++++++++++++++++--- 2 files changed, 43 insertions(+), 11 deletions(-) diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index 6a00a82a0..9055b7530 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -3937,8 +3937,24 @@ Use Display Entity menu command to show them. Uniform refinement - TOP_REF_HOMARD - Refinement with HOMARD + TOP_HOMARD_CREATE_CASE + New case + + + TOP_HOMARD_FOLLOW_ITERATION + Existing case + + + TOP_HOMARD_NEW_ITERATION + New iteration + + + TOP_HOMARD_COMPUTE + Compute + + + TOP_HOMARD_COMPUTE_PUBLISH + Compute and publish TOP_MG_ADAPT @@ -4575,8 +4591,8 @@ Use Display Entity menu command to show them. FULL_RECOMPUTE_QUESTION -The mesh has been edited since a last total re-compute -that may prevent successful computation. +The mesh has been edited since a last total re-compute +that may prevent successful computation. Do you wish to re-compute the mesh totally to discard the modifications? @@ -6701,7 +6717,7 @@ Please specify them and try again GEOMETRY_OBJECT_IS_NOT_DEFINED_MESH Geometry object is not defined. -Do you want to create an empty mesh +Do you want to create an empty mesh without algorithms and hypotheses? @@ -6775,8 +6791,8 @@ select mesh or sub-mesh and try again CONCURRENT_SUBMESH_APPEARS - -The assigned algorithm has the same priority as one assigned to an + +The assigned algorithm has the same priority as one assigned to an adjacent sub-mesh, hence it's undefined which algorithm to use for meshing boundary shared by two sub-meshes. Would you like to set the order of sub-mesh computation? @@ -8386,7 +8402,7 @@ as they are of improper type: SUBSHAPES_NOT_FOUND_MSG -Some sub-shapes not found in the new geometry. They are listed +Some sub-shapes not found in the new geometry. They are listed below along with dependent mesh objects that are marked with red in the Object Browser. diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index 24c9ff571..d66f06849 100644 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -474,7 +474,7 @@ MEN_EDIT - Edition + Editer MEN_EDIT_GROUP @@ -3896,8 +3896,24 @@ Utilisez le menu "Visualiser une entité" pour les afficher. Raffinement uniforme - TOP_REF_HOMARD - Raffinement avec HOMARD + TOP_HOMARD_CREATE_CASE + Création d'un cas + + + TOP_HOMARD_FOLLOW_ITERATION + Poursuite d'une itération. + + + TOP_HOMARD_NEW_ITERATION + Création d'une itération + + + TOP_HOMARD_COMPUTE + Calculer + + + TOP_HOMARD_COMPUTE_PUBLISH + Calculer et publier TOP_MG_ADAPT From d4b3f508bf172a4623f109c34fc7371c1fe0dcf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Mon, 8 Jun 2020 14:40:22 +0200 Subject: [PATCH 040/100] Menus --- src/SMESHGUI/SMESHGUI.cxx | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 4b664bf68..20074a8f0 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -3034,7 +3034,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) } break; } - // Adaptation - end + // Adaptation - begin case SMESHOp::OpUniformRefinement: case SMESHOp::OpHONewCase: case SMESHOp::OpHOCaseFollow: @@ -4675,9 +4675,13 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpPatternMapping, modifyTb ); // Adaptation - begin - createTool( SMESHOp::OpUniformRefinement, adaptTb ); -// createTool( SMESHOp::OpHOMARDRefinement, adaptTb ); - createTool( SMESHOp::OpMGAdapt, adaptTb ); + createTool( SMESHOp::OpUniformRefinement, adaptTb ); + createTool( SMESHOp::OpHONewCase, adaptTb ); + createTool( SMESHOp::OpHOCaseFollow, adaptTb ); + createTool( SMESHOp::OpHONewIter, adaptTb ); + createTool( SMESHOp::OpHOIterCompute, adaptTb ); + createTool( SMESHOp::OpHOIterComputePublish, adaptTb ); + createTool( SMESHOp::OpMGAdapt, adaptTb ); // Adaptation - end createTool( SMESHOp::OpMinimumDistance, measuremTb ); @@ -4762,9 +4766,15 @@ void SMESHGUI::initialize( CAM_Application* app ) //popupMgr()->insert( separator(), -1, 0 ); // Adaptation - begin -// createPopupItem( SMESHOp::OpUniformRefinement, OB, mesh ); -// createPopupItem( SMESHOp::OpHOMARDRefinement, OB, mesh ); -// createPopupItem( SMESHOp::OpMGAdapt, OB, mesh ); + createPopupItem( SMESHOp::OpUniformRefinement, OB, mesh ); + createPopupItem( SMESHOp::OpHONewCase, OB, mesh ); + createPopupItem( SMESHOp::OpHOCaseFollow, OB, mesh ); + createPopupItem( SMESHOp::OpHONewIter, OB, mesh ); + createPopupItem( SMESHOp::OpHOIterCompute, OB, mesh ); + createPopupItem( SMESHOp::OpHOIterComputePublish, OB, mesh ); + createPopupItem( SMESHOp::OpHOEdit, OB, mesh ); + createPopupItem( SMESHOp::OpHODelete, OB, mesh ); + createPopupItem( SMESHOp::OpMGAdapt, OB, mesh ); // Adaptation - end QString only_one_non_empty = QString( " && %1=1 && numberOfNodes>0" ).arg( dc ); From f787750dbb7ad5f4237e058ca703737a59c52522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Mon, 8 Jun 2020 16:43:05 +0200 Subject: [PATCH 041/100] Rassemblement des toolbars --- src/SMESHGUI/SMESHGUI.cxx | 55 +++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 20074a8f0..6d219c86b 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -4541,23 +4541,8 @@ void SMESHGUI::initialize( CAM_Application* app ) connect( volumeMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) ); // ----- create toolbars -------------- - int meshTb = createTool( tr( "TB_MESH" ), QString( "SMESHMeshToolbar" ) ), - info = createTool( tr( "TB_INFO" ), QString( "SMESHInformationToolbar" ) ), - groupTb = createTool( tr( "TB_GROUP" ), QString( "SMESHGroupToolbar" ) ), - ctrl0dTb = createTool( tr( "TB_CTRL0D" ), QString( "SMESHNodeControlsToolbar" ) ), - ctrl1dTb = createTool( tr( "TB_CTRL1D" ), QString( "SMESHEdgeControlsToolbar" ) ), - ctrl2dTb = createTool( tr( "TB_CTRL2D" ), QString( "SMESHFaceControlsToolbar" ) ), - ctrl3dTb = createTool( tr( "TB_CTRL3D" ), QString( "SMESHVolumeControlsToolbar" ) ), - addElemTb = createTool( tr( "TB_ADD" ), QString( "SMESHAddElementToolbar" ) ), - addNonElemTb = createTool( tr( "TB_ADDNON" ), QString( "SMESHAddElementToolbar" ) ), - remTb = createTool( tr( "TB_REM" ), QString( "SMESHRemoveToolbar" ) ), - //renumbTb = createTool( tr( "TB_RENUMBER" ), QString( "SMESHRenumberingToolbar" ) ), - transformTb = createTool( tr( "TB_TRANSFORM" ), QString( "SMESHTransformationToolbar" ) ), - modifyTb = createTool( tr( "TB_MODIFY" ), QString( "SMESHModificationToolbar" ) ), - adaptTb = createTool( tr( "TB_ADAPTATION" ),QString( "SMESHAdaptationToolbar" ) ), - measuremTb = createTool( tr( "TB_MEASUREM" ), QString( "SMESHMeasurementsToolbar" ) ), - dispModeTb = createTool( tr( "TB_DISP_MODE" ), QString( "SMESHDisplayModeToolbar" ) ); - + int meshTb = createTool( tr( "TB_MESH" ), QString( "SMESHMeshToolbar" ) ) ; + INFOS( "meshTb :" << meshTb ); createTool( SMESHOp::OpCreateMesh, meshTb ); createTool( SMESHOp::OpCreateSubMesh, meshTb ); createTool( SMESHOp::OpEditMeshOrSubMesh, meshTb ); @@ -4569,25 +4554,36 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpEvaluate, meshTb ); createTool( SMESHOp::OpMeshOrder, meshTb ); + int infoTb = createTool( tr( "TB_INFO" ), QString( "SMESHInformationToolbar" ) ) ; + INFOS( "infoTb :" << infoTb ); + createTool( SMESHOp::OpMeshInformation, infoTb ); + //createTool( SMESHOp::OpStdInfo, meshTb ); + //createTool( SMESHOp::OpWhatIs, meshTb ); // VSR: issue #0021242 (eliminate "Mesh Element Information" command) + createTool( SMESHOp::OpFindElementByPoint, infoTb ); + + int groupTb = createTool( tr( "TB_GROUP" ), QString( "SMESHGroupToolbar" ) ) ; + INFOS( "groupTb :" << groupTb ); + createTool( SMESHOp::OpCreateGroup, groupTb ); createTool( SMESHOp::OpCreateGeometryGroup, groupTb ); createTool( SMESHOp::OpConstructGroup, groupTb ); createTool( SMESHOp::OpEditGroup, groupTb ); - createTool( SMESHOp::OpMeshInformation, info ); - //createTool( SMESHOp::OpStdInfo, meshTb ); - //createTool( SMESHOp::OpWhatIs, meshTb ); // VSR: issue #0021242 (eliminate "Mesh Element Information" command) - createTool( SMESHOp::OpFindElementByPoint, info ); - + int ctrl0dTb = createTool( tr( "TB_CTRL0D" ), QString( "SMESHNodeControlsToolbar" ) ) ; + INFOS( "ctrl0dTb :" << ctrl0dTb ); createTool( SMESHOp::OpFreeNode, ctrl0dTb ); createTool( SMESHOp::OpEqualNode, ctrl0dTb ); //createTool( SMESHOp::OpNodeConnectivityNb, ctrl0dTb ); + int ctrl1dTb = createTool( tr( "TB_CTRL1D" ), QString( "SMESHEdgeControlsToolbar" ) ) ; + INFOS( "ctrl1dTb :" << ctrl1dTb ); createTool( SMESHOp::OpFreeBorder, ctrl1dTb ); createTool( SMESHOp::OpLength, ctrl1dTb ); createTool( SMESHOp::OpConnection, ctrl1dTb ); createTool( SMESHOp::OpEqualEdge, ctrl1dTb ); + int ctrl2dTb = createTool( tr( "TB_CTRL2D" ), QString( "SMESHFaceControlsToolbar" ) ) ; + INFOS( "ctrl2dTb :" << ctrl2dTb ); createTool( SMESHOp::OpFreeEdge, ctrl2dTb ); createTool( SMESHOp::OpFreeFace, ctrl2dTb ); createTool( SMESHOp::OpBareBorderFace, ctrl2dTb ); @@ -4604,6 +4600,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpEqualFace, ctrl2dTb ); createTool( SMESHOp::OpDeflection2D, ctrl2dTb ); + int ctrl3dTb = createTool( tr( "TB_CTRL3D" ), QString( "SMESHVolumeControlsToolbar" ) ) ; createTool( SMESHOp::OpAspectRatio3D, ctrl3dTb ); createTool( SMESHOp::OpVolume, ctrl3dTb ); createTool( SMESHOp::OpMaxElementLength3D, ctrl3dTb ); @@ -4611,6 +4608,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpOverConstrainedVolume, ctrl3dTb ); createTool( SMESHOp::OpEqualVolume, ctrl3dTb ); + int addElemTb = createTool( tr( "TB_ADD" ), QString( "SMESHAddElementToolbar" ) ) ; createTool( SMESHOp::OpNode, addElemTb ); createTool( SMESHOp::OpElem0D, addElemTb ); createTool( SMESHOp::OpElem0DOnElemNodes, addElemTb ); @@ -4626,6 +4624,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpHexagonalPrism, addElemTb ); createTool( SMESHOp::OpPolyhedron, addElemTb ); + int addNonElemTb = createTool( tr( "TB_ADDNON" ), QString( "SMESHAddElementToolbar" ) ) ; createTool( SMESHOp::OpQuadraticEdge, addNonElemTb ); createTool( SMESHOp::OpQuadraticTriangle, addNonElemTb ); createTool( SMESHOp::OpBiQuadraticTriangle, addNonElemTb ); @@ -4639,14 +4638,18 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpQuadraticHexahedron, addNonElemTb ); createTool( SMESHOp::OpTriQuadraticHexahedron, addNonElemTb ); + int remTb = createTool( tr( "TB_REM" ), QString( "SMESHRemoveToolbar" ) ) ; createTool( SMESHOp::OpRemoveNodes, remTb ); createTool( SMESHOp::OpRemoveElements, remTb ); createTool( SMESHOp::OpRemoveOrphanNodes, remTb ); createTool( SMESHOp::OpClearMesh, remTb ); +// int renumbTb = createTool( tr( "TB_RENUMBER" ), QString( "SMESHRenumberingToolbar" ) ) ; //createTool( SMESHOp::OpRenumberingNodes, renumbTb ); //createTool( SMESHOp::OpRenumberingElements, renumbTb ); + int transformTb = createTool( tr( "TB_TRANSFORM" ), QString( "SMESHTransformationToolbar" ) ) ; + INFOS( "transformTb :" << transformTb ); createTool( SMESHOp::OpMergeNodes, transformTb ); createTool( SMESHOp::OpMergeElements, transformTb ); createTool( SMESHOp::OpTranslation, transformTb ); @@ -4657,6 +4660,8 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpSewing, transformTb ); createTool( SMESHOp::OpDuplicateNodes, transformTb ); + int modifyTb = createTool( tr( "TB_MODIFY" ), QString( "SMESHModificationToolbar" ) ) ; + INFOS( "modifyTb :" << modifyTb ); createTool( SMESHOp::OpConvertMeshToQuadratic, modifyTb ); createTool( SMESHOp::OpCreateBoundaryElements, modifyTb ); createTool( SMESHOp::OpExtrusion, modifyTb ); @@ -4675,6 +4680,8 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpPatternMapping, modifyTb ); // Adaptation - begin + int adaptTb = createTool( tr( "TB_ADAPTATION" ),QString( "SMESHAdaptationToolbar" ) ) ; + INFOS( "adaptTb :" << adaptTb ); createTool( SMESHOp::OpUniformRefinement, adaptTb ); createTool( SMESHOp::OpHONewCase, adaptTb ); createTool( SMESHOp::OpHOCaseFollow, adaptTb ); @@ -4684,8 +4691,12 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpMGAdapt, adaptTb ); // Adaptation - end + int measuremTb = createTool( tr( "TB_MEASUREM" ), QString( "SMESHMeasurementsToolbar" ) ) ; + INFOS( "measuremTb :" << measuremTb ); createTool( SMESHOp::OpMinimumDistance, measuremTb ); + int dispModeTb = createTool( tr( "TB_DISP_MODE" ), QString( "SMESHDisplayModeToolbar" ) ); + INFOS( "dispModeTb :" << dispModeTb ); createTool( SMESHOp::OpUpdate, dispModeTb ); QString lc = "$"; // VSR : instead of QtxPopupSelection::defEquality(); From 005a0c7d7e82a73977e8b678910ce932b6672abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Tue, 9 Jun 2020 10:10:12 +0200 Subject: [PATCH 042/100] Suppression des impressions --- src/SMESHGUI/SMESHGUI.cxx | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 6d219c86b..511e230d0 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -4542,7 +4542,6 @@ void SMESHGUI::initialize( CAM_Application* app ) // ----- create toolbars -------------- int meshTb = createTool( tr( "TB_MESH" ), QString( "SMESHMeshToolbar" ) ) ; - INFOS( "meshTb :" << meshTb ); createTool( SMESHOp::OpCreateMesh, meshTb ); createTool( SMESHOp::OpCreateSubMesh, meshTb ); createTool( SMESHOp::OpEditMeshOrSubMesh, meshTb ); @@ -4555,35 +4554,29 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpMeshOrder, meshTb ); int infoTb = createTool( tr( "TB_INFO" ), QString( "SMESHInformationToolbar" ) ) ; - INFOS( "infoTb :" << infoTb ); createTool( SMESHOp::OpMeshInformation, infoTb ); //createTool( SMESHOp::OpStdInfo, meshTb ); //createTool( SMESHOp::OpWhatIs, meshTb ); // VSR: issue #0021242 (eliminate "Mesh Element Information" command) createTool( SMESHOp::OpFindElementByPoint, infoTb ); int groupTb = createTool( tr( "TB_GROUP" ), QString( "SMESHGroupToolbar" ) ) ; - INFOS( "groupTb :" << groupTb ); - createTool( SMESHOp::OpCreateGroup, groupTb ); createTool( SMESHOp::OpCreateGeometryGroup, groupTb ); createTool( SMESHOp::OpConstructGroup, groupTb ); createTool( SMESHOp::OpEditGroup, groupTb ); int ctrl0dTb = createTool( tr( "TB_CTRL0D" ), QString( "SMESHNodeControlsToolbar" ) ) ; - INFOS( "ctrl0dTb :" << ctrl0dTb ); createTool( SMESHOp::OpFreeNode, ctrl0dTb ); createTool( SMESHOp::OpEqualNode, ctrl0dTb ); //createTool( SMESHOp::OpNodeConnectivityNb, ctrl0dTb ); int ctrl1dTb = createTool( tr( "TB_CTRL1D" ), QString( "SMESHEdgeControlsToolbar" ) ) ; - INFOS( "ctrl1dTb :" << ctrl1dTb ); createTool( SMESHOp::OpFreeBorder, ctrl1dTb ); createTool( SMESHOp::OpLength, ctrl1dTb ); createTool( SMESHOp::OpConnection, ctrl1dTb ); createTool( SMESHOp::OpEqualEdge, ctrl1dTb ); int ctrl2dTb = createTool( tr( "TB_CTRL2D" ), QString( "SMESHFaceControlsToolbar" ) ) ; - INFOS( "ctrl2dTb :" << ctrl2dTb ); createTool( SMESHOp::OpFreeEdge, ctrl2dTb ); createTool( SMESHOp::OpFreeFace, ctrl2dTb ); createTool( SMESHOp::OpBareBorderFace, ctrl2dTb ); @@ -4649,7 +4642,6 @@ void SMESHGUI::initialize( CAM_Application* app ) //createTool( SMESHOp::OpRenumberingElements, renumbTb ); int transformTb = createTool( tr( "TB_TRANSFORM" ), QString( "SMESHTransformationToolbar" ) ) ; - INFOS( "transformTb :" << transformTb ); createTool( SMESHOp::OpMergeNodes, transformTb ); createTool( SMESHOp::OpMergeElements, transformTb ); createTool( SMESHOp::OpTranslation, transformTb ); @@ -4661,7 +4653,6 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpDuplicateNodes, transformTb ); int modifyTb = createTool( tr( "TB_MODIFY" ), QString( "SMESHModificationToolbar" ) ) ; - INFOS( "modifyTb :" << modifyTb ); createTool( SMESHOp::OpConvertMeshToQuadratic, modifyTb ); createTool( SMESHOp::OpCreateBoundaryElements, modifyTb ); createTool( SMESHOp::OpExtrusion, modifyTb ); @@ -4681,7 +4672,6 @@ void SMESHGUI::initialize( CAM_Application* app ) // Adaptation - begin int adaptTb = createTool( tr( "TB_ADAPTATION" ),QString( "SMESHAdaptationToolbar" ) ) ; - INFOS( "adaptTb :" << adaptTb ); createTool( SMESHOp::OpUniformRefinement, adaptTb ); createTool( SMESHOp::OpHONewCase, adaptTb ); createTool( SMESHOp::OpHOCaseFollow, adaptTb ); @@ -4692,11 +4682,9 @@ void SMESHGUI::initialize( CAM_Application* app ) // Adaptation - end int measuremTb = createTool( tr( "TB_MEASUREM" ), QString( "SMESHMeasurementsToolbar" ) ) ; - INFOS( "measuremTb :" << measuremTb ); createTool( SMESHOp::OpMinimumDistance, measuremTb ); int dispModeTb = createTool( tr( "TB_DISP_MODE" ), QString( "SMESHDisplayModeToolbar" ) ); - INFOS( "dispModeTb :" << dispModeTb ); createTool( SMESHOp::OpUpdate, dispModeTb ); QString lc = "$"; // VSR : instead of QtxPopupSelection::defEquality(); From f52342ec683cd6897f5263df6333f887666b82f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Tue, 9 Jun 2020 10:27:06 +0200 Subject: [PATCH 043/100] =?UTF-8?q?M=C3=A9nage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ADAPTGUI/ADAPTGUI.cxx | 909 ------------------------------- src/ADAPTGUI/ADAPTGUI.h | 105 ---- src/ADAPTGUI/CMakeLists.txt | 2 - src/ADAPTGUI/HOMARDGUI_Utils.cxx | 41 +- 4 files changed, 20 insertions(+), 1037 deletions(-) delete mode 100644 src/ADAPTGUI/ADAPTGUI.cxx delete mode 100644 src/ADAPTGUI/ADAPTGUI.h diff --git a/src/ADAPTGUI/ADAPTGUI.cxx b/src/ADAPTGUI/ADAPTGUI.cxx deleted file mode 100644 index ed8cf6b51..000000000 --- a/src/ADAPTGUI/ADAPTGUI.cxx +++ /dev/null @@ -1,909 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// File : ADAPTGUI.cxx -// Author : Gerald NICOLAS, EDF -// Module : HOMARD - -#include "ADAPTGUI.h" - -// SALOME Includes -#include "Utils_ORB_INIT.hxx" -#include "Utils_SINGLETON.hxx" -#include "SALOME_LifeCycleCORBA.hxx" - -#include "SUIT_ResourceMgr.h" -#include "SUIT_MessageBox.h" -#include "SUIT_Session.h" -#include "SUIT_ViewWindow.h" -#include "SUIT_ViewManager.h" -#include - -#include "CAM_Module.h" -#include "OB_Browser.h" - -#include "SALOME_ListIO.hxx" - -#include "SalomeApp_Application.h" -#include "SalomeApp_DataModel.h" -#include "SalomeApp_Study.h" -#include "LightApp_SelectionMgr.h" -#include "LightApp_Selection.h" -#include -#include "SalomeApp_Module.h" -#include "SALOMEconfig.h" -#include - -#include - - -// QT Includes -#include -#include "MonCreateCase.h" -#include "MonCreateIteration.h" -#include "MonPursueIteration.h" -#include "MonCreateYACS.h" -#include "MonEditBoundaryCAO.h" -#include "MonEditBoundaryAn.h" -#include "MonEditBoundaryDi.h" -#include "MonEditCase.h" -#include "MonEditHypothesis.h" -#include "MonEditIteration.h" -#include "MonEditYACS.h" -#include "MonEditZone.h" -#include "MonMeshInfo.h" -#include "MonIterInfo.h" -#include "MonEditFile.h" -#include "HomardQtCommun.h" - -// BOOST Includes -#include - -//Pour le _CAST -#include "SALOMEDS_Study.hxx" -#include "HOMARDGUI_Utils.h" - -using namespace std; - -static CORBA::ORB_var _orb; - -//======================================================================= -// function : ADAPTGUI() -// purpose : Constructor -//======================================================================= -ADAPTGUI::ADAPTGUI(const QString&) : - SalomeApp_Module( "HOMARD" ) // default name -{ -} -//======================================================================= -// function : ~ADAPTGUI() -// purpose : Destructor -//======================================================================= -ADAPTGUI::~ADAPTGUI() -{ -} - -//======================================================================= -// function : InitHOMARDGen -// launch HOMARD component and return a handle -//======================================================================= -ADAPT::ADAPT_Gen_var ADAPTGUI::InitHOMARDGen(SalomeApp_Application* app) -{ - Engines::EngineComponent_var comp = app->lcc()->FindOrLoad_Component( "FactoryServer","HOMARD" ); - ADAPT::ADAPT_Gen_var clr = ADAPT::ADAPT_Gen::_narrow(comp); - ASSERT(!CORBA::is_nil(clr)); - return clr; -} - -//======================================================================= -// Module's initialization -void ADAPTGUI::initialize( CAM_Application* app ) -//======================================================================= -{ - SalomeApp_Module::initialize( app ); - InitHOMARDGen(dynamic_cast( app )); - anId = 0; - createActions(); - createMenus(); - recupPreferences(); -} - -//================================================ -// function : createHOMARDAction -// create an item in status bar and Homard menu -//================================================ -void ADAPTGUI::createHOMARDAction( const int id, const QString& po_id, const QString& icon_id, const int key, const bool toggle ) -{ -// MESSAGE("createHOMARDAction"); - QIcon icon; - QWidget* parent = application()->desktop(); - SUIT_ResourceMgr* resMgr = application()->resourceMgr(); - QPixmap pix; - if ( icon_id.length() ) - pix = resMgr->loadPixmap( "HOMARD", tr( icon_id .toLatin1().data()) ); - else - pix = resMgr->loadPixmap( "HOMARD", tr( QString( "ICO_%1" ).arg( po_id ).toLatin1().data()), false ); - if ( !pix.isNull() ) - icon = QIcon( pix ); - - QString tooltip = tr(QString( "HOM_TOP_%1" ).arg( po_id ).toLatin1().data()), - menu = tr(QString( "HOM_MEN_%1" ).arg( po_id ).toLatin1().data()), - status_bar = tr(QString( "HOM_STB_%1" ).arg( po_id ).toLatin1().data()); - - createAction( id, tooltip, icon, menu, status_bar, key, parent, toggle, this, SLOT( OnGUIEvent() ) ); -} - -//================================================ -// function : createAction -// constructs Homard menu -// calls createHOMARDAction for each item -//================================================ -void ADAPTGUI::createActions(){ -// - createHOMARDAction( 1101, "NEW_CASE", "cas_calcule.png" ); - createHOMARDAction( 1102, "PURSUE_ITERATION", "iter_poursuite.png" ); - createHOMARDAction( 1103, "NEW_ITERATION", "iter_next.png" ); - createHOMARDAction( 1111, "COMPUTE", "mesh_compute.png" ); - createHOMARDAction( 1112, "COMPUTE_PUBLISH", "mesh_compute.png" ); - createHOMARDAction( 1121, "MESH_INFO", "advanced_mesh_info.png" ); - createHOMARDAction( 1131, "MESH_PUBLICATION", "mesh_tree_mesh.png" ); -// - createHOMARDAction( 1201, "EDIT", "loop.png" ); - createHOMARDAction( 1211, "DELETE", "delete.png" ); -// - createHOMARDAction( 1301, "MESH_INFO", "advanced_mesh_info.png" ); - createHOMARDAction( 1302, "EDIT_MESS_FILE", "texte.png" ); -// - createHOMARDAction( 1401, "YACS", "table_view.png" ); -// -} - -//================================================ -// function : createPreferences -//================================================ -void ADAPTGUI::createPreferences() -{ - MESSAGE("createPreferences") - - int Onglet, Bloc, Pref ; - // 1. Generalites - Onglet = addPreference( tr( "PREF_TAB_GENERAL" ) ); -// Onglet = addPreference( tr( "PREF_TAB_SETTINGS" ) ) ; - - Bloc = addPreference( tr( "PREF_PUBLICATION" ), Onglet ); - setPreferenceProperty( Bloc, "columns", 1 ); - - Pref = addPreference( tr( "PREF_PUBLICATION_MAILLAGE_IN" ), Bloc, LightApp_Preferences::Bool, "HOMARD", "publish_mesh_in" ); - - Pref = addPreference( tr( "PREF_PUBLICATION_MAILLAGE_OUT" ), Bloc, LightApp_Preferences::Bool, "HOMARD", "publish_mesh_out" ); - - // 2. YACS - Onglet = addPreference( tr( "PREF_YACS" ) ) ; - - Bloc = addPreference( tr( "PREF_YACS_MAX" ), Onglet ); - setPreferenceProperty( Bloc, "columns", 1 ); - - Pref = addPreference( tr( "PREF_YACS_MAX_ITER" ), Bloc, LightApp_Preferences::IntSpin, "HOMARD", "yacs_max_iter" ); - setPreferenceProperty( Pref, "min", 0 ); - setPreferenceProperty( Pref, "max", 100000000 ); - setPreferenceProperty( Pref, "step", 1 ); - - Pref = addPreference( tr( "PREF_YACS_MAX_NODE" ), Bloc, LightApp_Preferences::IntSpin, "HOMARD", "yacs_max_node" ); - setPreferenceProperty( Pref, "min", 0 ); - setPreferenceProperty( Pref, "max", 100000000 ); - setPreferenceProperty( Pref, "step", 1000 ); - - Pref = addPreference( tr( "PREF_YACS_MAX_ELEM" ), Bloc, LightApp_Preferences::IntSpin, "HOMARD", "yacs_max_elem" ); - setPreferenceProperty( Pref, "min", 0 ); - setPreferenceProperty( Pref, "max", 100000000 ); - setPreferenceProperty( Pref, "step", 1000 ); - - Bloc = addPreference( tr( "PREF_YACS_CONVERGENCE" ), Onglet ); - setPreferenceProperty( Bloc, "columns", 1 ); - - Pref = addPreference( tr( "PREF_YACS_TYPE_TEST" ), Bloc, LightApp_Preferences::Selector, "HOMARD", "yacs_type_test" ); - QStringList aListOfTypeTest; - aListOfTypeTest << "None"; - aListOfTypeTest << "VTest > VRef"; - aListOfTypeTest << "VTest < VRef"; - setPreferenceProperty( Pref, "strings", aListOfTypeTest ); -} - - -//================================================ -// function : createMenus -//================================================ -void ADAPTGUI::createMenus() -{ - MESSAGE("createMenus") -// - int HOMARD_Id = createMenu( tr( "HOM_MEN_HOMARD" ), -1, 5, 10 ); - createMenu( 1101, HOMARD_Id, -1 ); //Create_Case - createMenu( 1102, HOMARD_Id, -1 ); //Pursue_Iteration - createMenu( separator(), HOMARD_Id,-1); - createMenu( 1103, HOMARD_Id, -1 ); //Create_Iteration - createMenu( 1111, HOMARD_Id, -1 ); //Compute - createMenu( 1112, HOMARD_Id, -1 ); //Compute and publish -// - HOMARD_Id = createMenu( tr( "HOM_MEN_MODIFICATION" ), -1, 5, 10 ); - createMenu( 1201, HOMARD_Id, -1 ); //Edit - createMenu( 1211, HOMARD_Id, -1 ); //Delete -// - HOMARD_Id = createMenu( tr( "HOM_MEN_INFORMATION" ), -1, 5, 10 ); - createMenu( 1301, HOMARD_Id, -1 ); //Information sur un maillage - createMenu( 1131, HOMARD_Id, -1 ); //Mesh publication - createMenu( separator(), HOMARD_Id,-1); - createMenu( 1302, HOMARD_Id, -1 ); //EditAsciiFile pour le fichier listeStd ou bilan - createMenu( separator(), HOMARD_Id,-1); - createMenu( 1201, HOMARD_Id, -1 ); //Edit - createMenu( separator(), HOMARD_Id,-1); -// - HOMARD_Id = createMenu( tr( "HOM_MEN_YACS" ), -1, 5, 10 ); - createMenu( 1401, HOMARD_Id, -1 ); // Création d'un schéma YACS - createMenu( separator(), HOMARD_Id,-1); -} - -//================================================ -// function : recupPreferences -// Pour chaque valeur, le defaut est la valeur definie dans ADAPT_Gen -// . Si la recuperation dans config/salome s'est bien passee a la creation de ADAPT_Gen, -// ces valeurs sont les valeurs definies. -// . Si cela ne s'est pas bien passe, ce sont les valeurs par defaut de ADAPT_Gen -//================================================ -void ADAPTGUI::recupPreferences() -{ - MESSAGE("recupPreferences") -// -// A. Declarations -// - SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( application() ); - ADAPT::ADAPT_Gen_var homardGen = ADAPTGUI::InitHOMARDGen(app); - int defaut_i ; - std::string defaut_s ; - QString QString_v ; -// -// B. Les valeurs -// B.1. La langue -// - defaut_s = homardGen->GetLanguageShort(); - SUIT_ResourceMgr* resMgr = getApp()->resourceMgr(); - _LanguageShort = resMgr->stringValue("language", "language", QString(defaut_s.c_str()) ); -// -// B.2. Les publications - bool publish_mesh ; -// - _PublisMeshIN = homardGen->GetPublisMeshIN(); - if ( _PublisMeshIN == 1 ) { publish_mesh = true ; } - else { publish_mesh = false ; } - publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_in", publish_mesh ); - if ( publish_mesh ) { _PublisMeshIN = 1 ; } - else { _PublisMeshIN = 0 ; } -// - _PublisMeshOUT = homardGen->GetPublisMeshOUT(); - if ( _PublisMeshOUT == 1 ) { publish_mesh = true ; } - else { publish_mesh = false ; } - publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_out", publish_mesh ); - if ( publish_mesh ) { _PublisMeshOUT = 1 ; } - else { _PublisMeshOUT = 0 ; } -// -// B.3. Les maximum pour YACS -// - defaut_i = homardGen->GetYACSMaxIter(); - _YACSMaxIter = resMgr->integerValue("HOMARD", "yacs_max_iter", defaut_i ); -// - defaut_i = homardGen->GetYACSMaxNode(); - _YACSMaxNode = resMgr->integerValue("HOMARD", "yacs_max_node", defaut_i ); -// - defaut_i = homardGen->GetYACSMaxElem(); - _YACSMaxElem = resMgr->integerValue("HOMARD", "yacs_max_elem", defaut_i ); -// -// B.4. La convergence pour YACS -// - defaut_i = homardGen->GetYACSConvergenceType(); - if ( defaut_i == 1 ) { QString_v = tr("VTest > VRef") ; } - else if ( defaut_i == 2 ) { QString_v = tr("VTest < VRef") ; } - else { QString_v = tr("None") ; } - QString_v = resMgr->stringValue ( "HOMARD", "yacs_type_test", QString_v ); - if ( ( QString_v == "VTest > VRef" ) || ( QString_v == "VTest > VRef" ) ) { _YACSTypeTest = 1 ; } - else if ( ( QString_v == "VTest < VRef" ) || ( QString_v == "VTest < VRef" ) ) { _YACSTypeTest = 2 ; } - else { _YACSTypeTest = 0 ; } -// -// C. Enregistrement dans l'objet general -// - MESSAGE ("Enregistrement de LanguageShort = " << _LanguageShort.toStdString().c_str() ); - MESSAGE ("Enregistrement de PublisMeshIN = " << _PublisMeshIN<<", PublisMeshOUT = "<< _PublisMeshOUT); - MESSAGE ("Enregistrement de YACSMaxIter = " << _YACSMaxIter<<", YACSMaxNode = "<< _YACSMaxNode<<", YACSMaxElem = "<< _YACSMaxElem); - MESSAGE ("Enregistrement de YACSTypeTest = " << _YACSTypeTest); -// - homardGen->SetLanguageShort(_LanguageShort.toStdString().c_str()); - homardGen->SetPublisMesh(_PublisMeshIN, _PublisMeshOUT); - homardGen->SetYACSMaximum(_YACSMaxIter, _YACSMaxNode, _YACSMaxElem); -// - homardGen->SetYACSConvergenceType(_YACSTypeTest); -} - -//================================================ -void ADAPTGUI::OnGUIEvent() -//================================================ -{ - MESSAGE("OnGUIEvent()") - setOrb(); - const QObject* obj = sender(); - if ( !obj || !obj->inherits( "QAction" ) ) { return; } - int id = actionId((QAction*)obj); - if ( id != -1 ) { bool ret = OnGUIEvent( id ); } - MESSAGE("Fin de OnGUIEvent()"); -} - -//======================================================================= -// Method OnGUIEvent pour Homard -//======================================================================= -bool ADAPTGUI::OnGUIEvent (int theCommandID) -{ - MESSAGE("OnGUIEvent avec theCommandID = "<( application() ); - if ( !app ) return false; - - SalomeApp_Study* stud = dynamic_cast ( app->activeStudy() ); - if ( !stud ) - { - MESSAGE ( "FAILED to cast active study to SalomeApp_Study" ); - return false; - } - - SUIT_Desktop* parent = application()->desktop(); - - ADAPT::ADAPT_Gen_var homardGen = ADAPTGUI::InitHOMARDGen(app); - - if (!CORBA::is_nil(homardGen)) - homardGen->UpdateStudy(); - - getApp()->updateObjectBrowser(); - -// B. Choix selon les commandes - SCRUTE(theCommandID); - switch (theCommandID) - { - case 1101: // Creation d un Cas - { - MESSAGE("command " << theCommandID << " activated"); - MonCreateCase *aDlg = new MonCreateCase( true, - ADAPT::ADAPT_Gen::_duplicate(homardGen) ) ; - aDlg->show(); - break; - } - - case 1102: // Poursuite d une iteration - { - MESSAGE("command " << theCommandID << " activated"); - MonPursueIteration *aDlg = new MonPursueIteration( true, - ADAPT::ADAPT_Gen::_duplicate(homardGen) ) ; - aDlg->show(); - break; - } - - case 1103: // Creation d une Iteration - { - MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); - MonCreateIteration *IterDlg = new MonCreateIteration( parent, true, - ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName ) ; - IterDlg->show(); - break; - } - - case 1111: // Compute une iteration - { - MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); - try { homardGen->Compute(_ObjectName.toStdString().c_str(), 0, 1, -1, 1); } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - getApp()->updateObjectBrowser(); - return false; - } - break; - } - - case 1112: // Compute une iteration et publication - { - MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); - try { homardGen->Compute(_ObjectName.toStdString().c_str(), 0, 1, -1, 2); } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - getApp()->updateObjectBrowser(); - return false; - } - break; - } - - case 1121: // Information sur le maillage de l'iteration - { - MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); - MonIterInfo *IterDlg = new MonIterInfo( parent, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName ) ; - IterDlg->show(); - break; - } - - case 1131: // Publication du maillage de l'iteration - { - MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); - homardGen->PublishMeshIterInSmesh(_ObjectName.toStdString().c_str()); - break; - } - - case 1132: // Publication du maillage de l'iteration a partir du fichier - { - MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); - homardGen->PublishResultInSmesh(_ObjectName.toStdString().c_str(), 1); - break; - } - - case 1201: // Edition d'un objet - { - MESSAGE("command " << theCommandID << " activated"); - QString nomObjet = HOMARD_QT_COMMUN::SelectionArbreEtude(QString(""), 1); - if (nomObjet == QString("")) break; - _PTR(SObject) obj = chercheMonObjet(); - if (obj) - { - // Edition d'une frontiere CAO - if (HOMARD_UTILS::isBoundaryCAO(obj)) - { - MonEditBoundaryCAO *aDlg = new MonEditBoundaryCAO(0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; - aDlg->show(); - } - // Edition d'une frontiere discrete - else if (HOMARD_UTILS::isBoundaryDi(obj)) - { - MonEditBoundaryDi *aDlg = new MonEditBoundaryDi(0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; - aDlg->show(); - } - // Edition d'une frontiere analytique - else if (HOMARD_UTILS::isBoundaryAn(obj)) - { - MonEditBoundaryAn *aDlg = new MonEditBoundaryAn(0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; - aDlg->show(); - } - // Edition d'un cas - else if (HOMARD_UTILS::isCase(obj)) - { - MonEditCase *aDlg = new MonEditCase(true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName ) ; - aDlg->show(); - } - // Edition d'une hypothese - else if (HOMARD_UTILS::isHypo(obj)) - { - MonEditHypothesis *aDlg = new MonEditHypothesis(0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName, QString(""), QString("")) ; - aDlg->show(); - } - // Edition d'une iteration - else if (HOMARD_UTILS::isIter(obj)) - { - MonEditIteration *aDlg = new MonEditIteration(parent, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; - aDlg->show(); - } - // Edition d'un schema YACS - else if (HOMARD_UTILS::isYACS(obj)) - { - MESSAGE("appel de MonEditYACS"); - MonEditYACS *aDlg = new MonEditYACS(true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName) ; - aDlg->show(); - } - // Edition d'une zone - else if (HOMARD_UTILS::isZone(obj)) - { - MonEditZone *aDlg = new MonEditZone(0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), QString(""), _ObjectName ) ; - aDlg->show(); - } - } - break; - } - - case 1211: // Suppression d'un objet - { - MESSAGE("command " << theCommandID << " activated"); - QString nomObjet = HOMARD_QT_COMMUN::SelectionArbreEtude(QString(""), 1); - if (nomObjet == QString("")) break; - _PTR(SObject) obj = chercheMonObjet(); - if (obj) - { - // Suppression d'une frontiere - if ( HOMARD_UTILS::isBoundaryCAO(obj) || HOMARD_UTILS::isBoundaryDi(obj) || HOMARD_UTILS::isBoundaryAn(obj) ) - { - try - { homardGen->DeleteBoundary(_ObjectName.toStdString().c_str()); } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - getApp()->updateObjectBrowser(); - return false; - } - } - // Suppression d'un cas - else if (HOMARD_UTILS::isCase(obj)) - { - try - { homardGen->DeleteCase(_ObjectName.toStdString().c_str(), 1); } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - getApp()->updateObjectBrowser(); - return false; - } - } - // Suppression d'une hypothese - else if (HOMARD_UTILS::isHypo(obj)) - { - try - { homardGen->DeleteHypo(_ObjectName.toStdString().c_str()); } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - getApp()->updateObjectBrowser(); - return false; - } - } - // Suppression d'une iteration - else if (HOMARD_UTILS::isIter(obj)) - { - try - { homardGen->DeleteIteration(_ObjectName.toStdString().c_str(), 1); } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - getApp()->updateObjectBrowser(); - return false; - } - } - // Suppression d'un schema YACS - else if (HOMARD_UTILS::isYACS(obj)) - { - try - { homardGen->DeleteYACS(_ObjectName.toStdString().c_str(), 1); } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - getApp()->updateObjectBrowser(); - return false; - } - } - // Suppression d'une zone - else if (HOMARD_UTILS::isZone(obj)) - { - try - { homardGen->DeleteZone(_ObjectName.toStdString().c_str()); } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - getApp()->updateObjectBrowser(); - return false; - } - } - } - break; - } - - case 1301: // Information sur un maillage - { - MESSAGE("etape 1301") - MESSAGE("command " << theCommandID << " activated"); - MonMeshInfo *aDlg = new MonMeshInfo( parent, true, ADAPT::ADAPT_Gen::_duplicate(homardGen) ) ; - aDlg->show(); - break; - } - - case 1302: // Affichage de fichier texte - { - MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); - _PTR(SObject) obj = chercheMonObjet(); - if ( (obj) && ( HOMARD_UTILS::isFileType(obj,QString("log")) || HOMARD_UTILS::isFileType(obj,QString("Summary")) || HOMARD_UTILS::isFileType(obj,QString("xml")) ) ) - { - MonEditFile *aDlg = new MonEditFile( 0, true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName, 0 ) ; - if ( aDlg->_codret == 0 ) { aDlg->show(); } - } - break; - } - - case 1401: // Création d'un schema YACS - { - MESSAGE("etape 1401") - MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); - MonCreateYACS *aDlg = new MonCreateYACS( true, ADAPT::ADAPT_Gen::_duplicate(homardGen), _ObjectName ) ; - aDlg->show(); - break; - } - - case 1402: // Ecriture d'un schéma YACS - { - MESSAGE("etape 1402") - MESSAGE("command " << theCommandID << " activated avec objet " << _ObjectName.toStdString().c_str() ); - try { homardGen->YACSWrite(_ObjectName.toStdString().c_str()); } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - getApp()->updateObjectBrowser(); - return false; - } - break; - } - - } - getApp()->updateObjectBrowser(); - return true; -} - -//============================================================================= -/*! - * - */ -//============================================================================= - -// Module's engine IOR -//============================================================================= -QString ADAPTGUI::engineIOR() const -//============================================================================= -{ - CORBA::String_var anIOR = getApp()->orb()->object_to_string( InitHOMARDGen(getApp()) ); - return QString( anIOR.in() ); -} - -// Module's activation -//============================================================================= -bool ADAPTGUI::activateModule( SUIT_Study* theStudy ) -//============================================================================= -{ - bool bOk = SalomeApp_Module::activateModule( theStudy ); - - setMenuShown( true ); - setToolShown( true ); - - return bOk; -} - -// Module's deactivation -//============================================================================= -bool ADAPTGUI::deactivateModule( SUIT_Study* theStudy ) -//============================================================================= -{ - setMenuShown( false ); - setToolShown( false ); - - return SalomeApp_Module::deactivateModule( theStudy ); -} - -// Default windows -//============================================================================= -void ADAPTGUI::windows( QMap& theMap ) const -//============================================================================= -{ - theMap.clear(); - theMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea ); -#ifndef DISABLE_PYCONSOLE - theMap.insert( SalomeApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea ); -#endif -} - -//============================================================================= -void ADAPTGUI::setOrb() -//============================================================================= -{ - try - { - ORB_INIT &init = *SINGLETON_::Instance(); - ASSERT(SINGLETON_::IsAlreadyExisting()); - _orb = init( 0 , 0 ); - } - catch (...) - { - INFOS("internal error : orb not found"); - _orb = 0; - } - ASSERT(! CORBA::is_nil(_orb)); -} -//======================================== -_PTR(SObject) ADAPTGUI::chercheMonObjet() -//======================================== -{ - SALOMEDSClient_SObject* aSO = NULL; - _PTR(SObject) obj; - SALOME_ListIO lst; - getApp()->selectionMgr()->selectedObjects( lst ); - if ( lst.Extent() == 1 ) - { - Handle(SALOME_InteractiveObject) io = lst.First(); - SalomeApp_Study* appStudy = dynamic_cast( application()->activeStudy() ); - _PTR(Study) study = appStudy->studyDS(); - _PTR(SObject) obj = study->FindObjectID( io->getEntry() ); - _ObjectName = QString( obj->GetName().c_str() ); - return obj; - } - else { return _PTR(SObject)(aSO); } -} -//============================================================================= -void ADAPTGUI::contextMenuPopup( const QString& client, QMenu* menu, QString& title ) -//============================================================================= -{ - MESSAGE("Debut de contextMenuPopup"); - _PTR(SObject) obj = chercheMonObjet(); - if ( obj ) - { - title = QString( obj->GetName().c_str() ); - _ObjectName = title; - SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); -// - QPixmap pix ; - bool DeleteObject = false ; - bool EditObject = false ; -// - if ( HOMARD_UTILS::isBoundaryCAO(obj) ) - { - EditObject = true ; - DeleteObject = true ; - } - else if ( HOMARD_UTILS::isBoundaryAn(obj) ) - { - EditObject = true ; - DeleteObject = true ; - } - else if ( HOMARD_UTILS::isBoundaryDi(obj) ) - { - EditObject = true ; - DeleteObject = true ; - } - else if ( HOMARD_UTILS::isCase(obj) ) - { - pix = resMgr->loadPixmap( "HOMARD", "table_view.png" ); - menu->addAction(QIcon(pix), tr(QString("HOM_MEN_YACS").toLatin1().data()), this, SLOT(YACSCreate())); - EditObject = true ; - DeleteObject = true ; - } - else if ( HOMARD_UTILS::isHypo(obj) ) - { - EditObject = true ; - DeleteObject = true ; - } - else if ( HOMARD_UTILS::isIter(obj) ) - { - pix = resMgr->loadPixmap( "HOMARD", "iter_next.png" ); - menu->addAction(QIcon(pix), tr(QString("HOM_MEN_NEW_ITERATION").toLatin1().data()), this, SLOT(NextIter())); - pix = resMgr->loadPixmap( "HOMARD", "mesh_compute.png" ); - menu->addAction(QIcon(pix), tr(QString("HOM_MEN_COMPUTE").toLatin1().data()), this, SLOT(LanceCalcul0())); - pix = resMgr->loadPixmap( "HOMARD", "mesh_compute.png" ); - menu->addAction(QIcon(pix), tr(QString("HOM_MEN_COMPUTE_PUBLISH").toLatin1().data()), this, SLOT(LanceCalcul1())); - pix = resMgr->loadPixmap( "HOMARD", "advanced_mesh_info.png" ); - menu->addAction(QIcon(pix), tr(QString("HOM_MEN_MESH_INFO").toLatin1().data()), this, SLOT(IterInfo())); - pix = resMgr->loadPixmap( "HOMARD", "mesh_tree_mesh.png" ); - menu->addAction(QIcon(pix), tr(QString("HOM_MEN_MESH_PUBLICATION").toLatin1().data()), this, SLOT(MeshPublish0())); - EditObject = true ; - DeleteObject = true ; - } - else if ( HOMARD_UTILS::isYACS(obj) ) - { - pix = resMgr->loadPixmap( "HOMARD", "write.png" ); - menu->addAction(QIcon(pix), tr(QString("HOM_MEN_WRITE").toLatin1().data()), this, SLOT(YACSWrite())); - EditObject = true ; - DeleteObject = true ; - } - else if ( HOMARD_UTILS::isZone(obj) ) - { - EditObject = true ; - DeleteObject = true ; - } - else if ( HOMARD_UTILS::isFileType(obj,QString("log")) || HOMARD_UTILS::isFileType(obj,QString("Summary")) || HOMARD_UTILS::isFileType(obj,QString("xml")) ) - { - pix = resMgr->loadPixmap( "HOMARD", "texte.png" ); - menu->addAction(QIcon(pix), tr(QString("HOM_MEN_EDIT_MESS_FILE").toLatin1().data()), this, SLOT(EditAsciiFile())); - } - else if ( HOMARD_UTILS::isFileType(obj,QString("Mesh")) ) - { - pix = resMgr->loadPixmap( "HOMARD", "mesh_tree_mesh.png" ); - menu->addAction(QIcon(pix), tr(QString("HOM_MEN_MESH_PUBLICATION").toLatin1().data()), this, SLOT(MeshPublish1())); - } -// Ajout d'un menu d'edition pour les objets qui le proposent - if ( EditObject ) - { - pix = resMgr->loadPixmap( "HOMARD", "loop.png" ); - menu->addAction(QIcon(pix), tr(QString("HOM_MEN_EDIT").toLatin1().data()), this, SLOT(Edit())); - } -// Ajout d'un menu de destruction pour les objets qui le proposent - if ( DeleteObject ) - { - pix = resMgr->loadPixmap( "HOMARD", "delete.png" ); - menu->addAction(QIcon(pix), tr(QString("HOM_MEN_DELETE").toLatin1().data()), this, SLOT(Delete())); - } - } -} - -void ADAPTGUI::NextIter() -{ - this->OnGUIEvent(1103); -} - -void ADAPTGUI::LanceCalcul0() -{ - this->OnGUIEvent(1111); -} - -void ADAPTGUI::LanceCalcul1() -{ - this->OnGUIEvent(1112); -} - -void ADAPTGUI::IterInfo() -{ - this->OnGUIEvent(1121); -} - -void ADAPTGUI::MeshPublish0() -{ - this->OnGUIEvent(1131); -} - -void ADAPTGUI::MeshPublish1() -{ - this->OnGUIEvent(1132); -} - -void ADAPTGUI::Edit() -{ - this->OnGUIEvent(1201); -} - -void ADAPTGUI::Delete() -{ - this->OnGUIEvent(1211); -} - -void ADAPTGUI::EditAsciiFile() -{ - this->OnGUIEvent(1302); -} - -void ADAPTGUI::YACSCreate() -{ - this->OnGUIEvent(1401); -} -void ADAPTGUI::YACSWrite() -{ - this->OnGUIEvent(1402); -} - - -// -//============================================================================= -// Export the module -//============================================================================= -extern "C" { - Standard_EXPORT CAM_Module* createModule() - { - return new ADAPTGUI(""); - } -} - diff --git a/src/ADAPTGUI/ADAPTGUI.h b/src/ADAPTGUI/ADAPTGUI.h deleted file mode 100644 index 82b71aa79..000000000 --- a/src/ADAPTGUI/ADAPTGUI.h +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// ADAPTGUI : HOMARD component GUI implemetation -// - -#ifndef _ADAPTGUI_H_ -#define _ADAPTGUI_H_ - -#include "HOMARDGUI_Exports.hxx" - -#include -#include "SalomeApp_Study.h" - -#include -#include -#include CORBA_CLIENT_HEADER(ADAPT_Gen) -#include CORBA_CLIENT_HEADER(HOMARD_Cas) -#include CORBA_CLIENT_HEADER(HOMARD_Hypothesis) - -#include - -class SalomeApp_Application; - -class HOMARD_EXPORT ADAPTGUI: public SalomeApp_Module -{ - Q_OBJECT - -public: - ADAPTGUI(const QString&); - ~ADAPTGUI(); - - - - virtual bool OnGUIEvent (int theCommandID); - void initialize( CAM_Application* ); - QString engineIOR() const; - void windows( QMap& ) const; - - static ADAPT::ADAPT_Gen_var InitHOMARDGen(SalomeApp_Application* ); - - -public slots: - bool deactivateModule( SUIT_Study* ); - bool activateModule( SUIT_Study* ); - static void setOrb(); - -private slots: - void OnGUIEvent(); - void EditAsciiFile(); - void LanceCalcul0(); - void LanceCalcul1(); - void IterInfo(); - void NextIter(); - void MeshPublish0(); - void MeshPublish1(); - void YACSCreate(); - void YACSWrite(); - void Edit(); - void Delete(); - -public: - virtual void contextMenuPopup( const QString&, QMenu*, QString& ); - - -private: - void createHOMARDAction( const int id, const QString& po_id, const QString& icon_id = QString(""), - const int key = 0, const bool toggle = false ); - void createActions(); - void createMenus(); - void recupPreferences(); - void createPopupMenus(); - _PTR(SObject) chercheMonObjet(); - - virtual void createPreferences(); - ADAPT::ADAPT_Gen_var myComponentHomard; - - int anId; - QString _ObjectName; - QString _LanguageShort ; - int _PublisMeshIN ; - int _PublisMeshOUT ; - int _YACSMaxIter ; - int _YACSMaxNode ; - int _YACSMaxElem ; - int _YACSTypeTest ; -}; - -#endif diff --git a/src/ADAPTGUI/CMakeLists.txt b/src/ADAPTGUI/CMakeLists.txt index ee193c6af..7008df0b0 100644 --- a/src/ADAPTGUI/CMakeLists.txt +++ b/src/ADAPTGUI/CMakeLists.txt @@ -88,7 +88,6 @@ SET(_uic_FILES # header files / to be processed by moc SET(_moc_HEADERS - ADAPTGUI.h MonCreateBoundaryCAO.h MonCreateBoundaryAn.h MonCreateBoundaryDi.h @@ -135,7 +134,6 @@ QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS}) # sources / static SET(_other_SOURCES - ADAPTGUI.cxx HOMARDGUI_Utils.cxx MonCreateBoundaryCAO.cxx MonCreateBoundaryAn.cxx diff --git a/src/ADAPTGUI/HOMARDGUI_Utils.cxx b/src/ADAPTGUI/HOMARDGUI_Utils.cxx index 5358c5c32..b89e4e743 100644 --- a/src/ADAPTGUI/HOMARDGUI_Utils.cxx +++ b/src/ADAPTGUI/HOMARDGUI_Utils.cxx @@ -36,7 +36,6 @@ #include "SALOMEconfig.h" #include "utilities.h" #include -#include #include @@ -254,25 +253,25 @@ void HOMARD_UTILS::PushOnHelp(QString monFichierAide, QString contexte, QString { MESSAGE("Debut de PushOnHelp avec monFichierAide = "<< monFichierAide.toStdString().c_str()); LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); - if (app) - { - ADAPTGUI* aHomardGUI = dynamic_cast( app->module( "Homard" ) ); - // Repertoire de reference de la documentation - QString rep = aHomardGUI ? app->moduleName(aHomardGUI->moduleName()) : QString("") ; - // WARNING/ATTENTION : si on savait recuperer la langue depuis les preferences, on ne ferait pas le passage par argument -// SUIT_ResourceMgr* resMgr = getApp()->resourceMgr(); -// SUIT_ResourceMgr* resMgr = myModule->getApp()->resourceMgr(); -// QString langue = resMgr->stringValue("language", "language", "en"); -// QString langue = "fr" ; - MESSAGE(". LanguageShort " << LanguageShort.toStdString().c_str()) ; - // Complement du fichier - QString fichier = QString(LanguageShort+"/"+monFichierAide) ; - MESSAGE(". Appel de onHelpContextModule avec :"); - MESSAGE(" rep = "<< rep.toStdString().c_str()); - MESSAGE(" fichier = "<< fichier.toStdString().c_str()); - MESSAGE(" contexte = "<< contexte.toStdString().c_str()); - - app->onHelpContextModule(rep, fichier, contexte); - } +// if (app) +// { +// ADAPTGUI* aHomardGUI = dynamic_cast( app->module( "Homard" ) ); +// // Repertoire de reference de la documentation +// QString rep = aHomardGUI ? app->moduleName(aHomardGUI->moduleName()) : QString("") ; +// // WARNING/ATTENTION : si on savait recuperer la langue depuis les preferences, on ne ferait pas le passage par argument +// // SUIT_ResourceMgr* resMgr = getApp()->resourceMgr(); +// // SUIT_ResourceMgr* resMgr = myModule->getApp()->resourceMgr(); +// // QString langue = resMgr->stringValue("language", "language", "en"); +// // QString langue = "fr" ; +// MESSAGE(". LanguageShort " << LanguageShort.toStdString().c_str()) ; +// // Complement du fichier +// QString fichier = QString(LanguageShort+"/"+monFichierAide) ; +// MESSAGE(". Appel de onHelpContextModule avec :"); +// MESSAGE(" rep = "<< rep.toStdString().c_str()); +// MESSAGE(" fichier = "<< fichier.toStdString().c_str()); +// MESSAGE(" contexte = "<< contexte.toStdString().c_str()); +// +// app->onHelpContextModule(rep, fichier, contexte); +// } } //========================================================================================================= From 913c682099fe621fe7c506b2b755ff826630a570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Tue, 9 Jun 2020 11:25:48 +0200 Subject: [PATCH 044/100] Clarification --- src/SMESHGUI/SMESHGUI.cxx | 2 +- src/SMESHGUI/SMESHGUI_AdaptDlg.cxx | 8 ++++---- src/SMESHGUI/SMESHGUI_AdaptDlg.h | 6 ++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 511e230d0..c653ff1ac 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -3046,7 +3046,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) case SMESHOp::OpMGAdapt: { SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_nil(); - SMESHGUI_AdaptDlg *aDlg = new SMESHGUI_AdaptDlg( this, theCommandID, aMesh); + SMESHGUI_AdaptDlg *objet = new SMESHGUI_AdaptDlg( this, theCommandID, aMesh); } // Adaptation - end case SMESHOp::OpSplitBiQuadratic: diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx index a83311fdf..2e80bd079 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx @@ -48,7 +48,7 @@ SMESHGUI_AdaptDlg::SMESHGUI_AdaptDlg( SMESHGUI* theModule, SMESH::SMESH_Mesh_ptr theMesh ) : mySMESHGUI( theModule ) { - bool ok = action( theCommandID ) ; + action( theCommandID ) ; } //================================================================================= @@ -64,19 +64,19 @@ SMESHGUI_AdaptDlg::~SMESHGUI_AdaptDlg() * \param * \return bool OK/notOK */ -bool SMESHGUI_AdaptDlg::action (int theCommandID) +void SMESHGUI_AdaptDlg::action (int theCommandID) //======================================================================= { std::cout << "SMESHGUI_AdaptDlg::action avec theCommandID : " << theCommandID << std::endl; // Preferences - recupPreferences(); +// recupPreferences(); // Menus and actions bool ok = OnGUIEvent (theCommandID) ; if ( ! ok ) INFOS("Erreur"); - return ok ; + return ; } /*! diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.h b/src/SMESHGUI/SMESHGUI_AdaptDlg.h index 4392340ea..8a7d6c286 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.h +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.h @@ -40,17 +40,15 @@ class SMESHGUI; // class : SMESHGUI_AdaptDlg // purpose : //================================================================================= -class SMESHGUI_EXPORT SMESHGUI_AdaptDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_AdaptDlg : public QWidget { - Q_OBJECT - public: SMESHGUI_AdaptDlg( SMESHGUI*, int theCommandID, SMESH::SMESH_Mesh_ptr = SMESH::SMESH_Mesh::_nil() ); ~SMESHGUI_AdaptDlg(); - virtual bool action (int theCommandID); + void action (int theCommandID); virtual bool OnGUIEvent (int theCommandID); // static ADAPT::ADAPT_Gen_var InitAdaptGen(SalomeApp_Application*); From c9d52c82e17b5f6ee8ff699e95b55aa128d6adec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Tue, 9 Jun 2020 11:38:36 +0200 Subject: [PATCH 045/100] =?UTF-8?q?suppression=20des=20impressions=20syt?= =?UTF-8?q?=C3=A9matiques?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ADAPTGUI/MonCreateCase.cxx | 39 ++++++++++++++-------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/src/ADAPTGUI/MonCreateCase.cxx b/src/ADAPTGUI/MonCreateCase.cxx index 5a980d4b3..51d93450f 100644 --- a/src/ADAPTGUI/MonCreateCase.cxx +++ b/src/ADAPTGUI/MonCreateCase.cxx @@ -54,7 +54,7 @@ MonCreateCase::MonCreateCase( bool modal, ADAPT::ADAPT_Gen_var myAdaptGen0 ) _ExtType(0), _Pyram(0) { - INFOS("Debut du constructeur de MonCreateCase"); + MESSAGE("Debut du constructeur de MonCreateCase"); myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0); setupUi(this); setModal(modal); @@ -75,7 +75,7 @@ MonCreateCase::MonCreateCase( bool modal, ADAPT::ADAPT_Gen_var myAdaptGen0 ) // adjustSize(); - INFOS("Fin du constructeur de MonCreateCase"); +// MESSAGE("Fin du constructeur de MonCreateCase"); } // ------------------------------------------------------------------------ MonCreateCase::~MonCreateCase() @@ -87,7 +87,6 @@ MonCreateCase::~MonCreateCase() void MonCreateCase::InitConnect() // ------------------------------------------------------------------------ { - INFOS("Debut de InitConnect"); connect( LEName, SIGNAL(textChanged(QString)), this, SLOT(CaseNameChanged())); connect( PushDir, SIGNAL(pressed()), this, SLOT(SetDirName())); connect( PushFichier, SIGNAL(pressed()), this, SLOT(SetFileName())); @@ -125,14 +124,13 @@ void MonCreateCase::InitConnect() connect( buttonApply, SIGNAL(pressed()), this, SLOT(PushOnApply(0))); connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); connect( buttonHelp, SIGNAL(pressed()), this, SLOT(PushOnHelp())); - INFOS("Fin de InitConnect"); } // ------------------------------------------------------------------------ void MonCreateCase::InitBoundarys() // ------------------------------------------------------------------------ // Initialisation des menus avec les frontieres deja enregistrees { - INFOS("InitBoundarys"); + MESSAGE("InitBoundarys"); // Pour les frontieres analytiques : la colonne des groupes ADAPT::ListGroupType_var _listeGroupesCas = aCase->GetGroups(); QTableWidgetItem *__colItem = new QTableWidgetItem(); @@ -149,7 +147,7 @@ void MonCreateCase::InitBoundarys() // Pour les frontieres analytiques : les colonnes de chaque frontiere ADAPT::HOMARD_Boundary_var myBoundary ; ADAPT::listeBoundarys_var mesBoundarys = myAdaptGen->GetAllBoundarysName(); -// INFOS("Nombre de frontieres enregistrees : "<length()); +// MESSAGE("Nombre de frontieres enregistrees : "<length()); for (int i=0; ilength(); i++) { myBoundary = myAdaptGen->GetBoundary(mesBoundarys[i]); @@ -167,7 +165,7 @@ void MonCreateCase::InitBoundarys() bool MonCreateCase::PushOnApply(int option) // -------------------------------- { - INFOS("PushOnApply"); + MESSAGE("PushOnApply"); QString aCaseName=LEName->text().trimmed(); if ( aCaseName == "" ) { @@ -233,10 +231,10 @@ bool MonCreateCase::PushOnApply(int option) { // Nom du groupe NomGroup = QString(TWBoundary->item(row, 0)->text()) ; -// INFOS("NomGroup "<GetAllCasesName(); - INFOS("MyCases construit"); int num = 0; QString aCaseName=""; while (aCaseName=="" ) { aCaseName.setNum(num+1) ; aCaseName.insert(0, QString("Case_")) ; - std::cout << "aCaseName : --" << aCaseName.toStdString().c_str() << "--" << std::endl; +// std::cout << "aCaseName : --" << aCaseName.toStdString().c_str() << "--" << std::endl; for ( int i=0; ilength(); i++) { if ( aCaseName == QString((MyCases)[i])) @@ -373,10 +369,8 @@ void MonCreateCase::SetNewName() } } } - INFOS("aCaseName construit"); LEName->clear() ; LEName->insert(aCaseName); - INFOS("Fin de SetNewName"); } // ------------------------------------------------------------------------ @@ -537,7 +531,7 @@ void MonCreateCase::PushBoundaryCAOHelp() void MonCreateCase::SetBoundaryD() // ------------------------------------------------------------------------ { - INFOS("Debut de SetBoundaryD "); + MESSAGE("Debut de SetBoundaryD "); if (CBBoundaryD->isChecked()) { bool bOK = PushOnApply(0); @@ -585,7 +579,7 @@ void MonCreateCase::PushBoundaryDiHelp() void MonCreateCase::SetBoundaryA() // ------------------------------------------------------------------------ { - INFOS("Debut de SetBoundaryA "); + MESSAGE("Debut de SetBoundaryA "); if (CBBoundaryA->isChecked()) { bool bOK = PushOnApply(0); @@ -602,10 +596,10 @@ void MonCreateCase::SetBoundaryA() void MonCreateCase::AddBoundaryAn(QString newBoundary) // ------------------------------------------------------------------------ { - INFOS("Debut de AddBoundaryAn "); + MESSAGE("Debut de AddBoundaryAn "); // Ajout d'une nouvelle colonne int nbcol = TWBoundary->columnCount(); -// INFOS("nbcol " << nbcol); +// MESSAGE("nbcol " << nbcol); nbcol += 1 ; TWBoundary->setColumnCount ( nbcol ) ; QTableWidgetItem *__colItem = new QTableWidgetItem(); @@ -614,7 +608,7 @@ void MonCreateCase::AddBoundaryAn(QString newBoundary) /* TWBoundary->horizontalHeaderItem(nbcol-1)->setFlags( Qt::ItemIsSelectable|Qt::ItemIsEnabled );*/ // Chaque case est a cocher int nbrow = TWBoundary->rowCount(); -// INFOS("nbrow " << nbrow); +// MESSAGE("nbrow " << nbrow); for ( int i = 0; i < nbrow; i++ ) { TWBoundary->setItem( i, nbcol-1, new QTableWidgetItem( QString ("") ) ); @@ -624,7 +618,7 @@ void MonCreateCase::AddBoundaryAn(QString newBoundary) } TWBoundary->resizeColumnToContents(nbcol-1); // TWBoundary->resizeRowsToContents(); -// INFOS("Fin de AddBoundaryAn "); +// MESSAGE("Fin de AddBoundaryAn "); } // ------------------------------------------------------------------------ void MonCreateCase::PushBoundaryAnNew() @@ -645,7 +639,7 @@ void MonCreateCase::PushBoundaryAnEdit() QTableWidgetItem *__colItem = new QTableWidgetItem(); __colItem = TWBoundary->horizontalHeaderItem(i); nom = QString(__colItem->text()) ; - INFOS("nom "<isChecked()) { GBAdvancedOptions->setVisible(1); GBConforme->setVisible(1); @@ -695,7 +689,6 @@ void MonCreateCase::SetAdvanced() _Pyram = 0 ; SetStandard() ; SetMED() ; - INFOS("Fin de SetAdvanced "); } // adjustSize(); From 40e97e8c94491834efd9525328e30af8550fa7b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Tue, 9 Jun 2020 11:38:47 +0200 Subject: [PATCH 046/100] =?UTF-8?q?m=C3=A9nage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ADAPTGUI/MonCreateCase.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ADAPTGUI/MonCreateCase.cxx b/src/ADAPTGUI/MonCreateCase.cxx index 51d93450f..65e3f4adf 100644 --- a/src/ADAPTGUI/MonCreateCase.cxx +++ b/src/ADAPTGUI/MonCreateCase.cxx @@ -358,7 +358,6 @@ void MonCreateCase::SetNewName() { aCaseName.setNum(num+1) ; aCaseName.insert(0, QString("Case_")) ; -// std::cout << "aCaseName : --" << aCaseName.toStdString().c_str() << "--" << std::endl; for ( int i=0; ilength(); i++) { if ( aCaseName == QString((MyCases)[i])) From cadf63ae2c25a6df4bf13be1ee5157ffc4896fd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Tue, 9 Jun 2020 14:13:29 +0200 Subject: [PATCH 047/100] =?UTF-8?q?Suppression=20des=20particularit=C3=A9s?= =?UTF-8?q?=20HOMARD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SMESHGUI/SMESHGUI_AdaptDlg.cxx | 171 +++++++++++++---------------- src/SMESHGUI/SMESHGUI_AdaptDlg.h | 2 +- 2 files changed, 77 insertions(+), 96 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx index 2e80bd079..2e48cc2aa 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx @@ -33,7 +33,7 @@ #include // HOMARD includes -#include "MonCreateCase.h" +// #include "MonCreateCase.h" // SALOME KERNEL includes #include "utilities.h" @@ -79,73 +79,72 @@ void SMESHGUI_AdaptDlg::action (int theCommandID) return ; } -/*! - * \brief Gets the preferences for the adaptation - * \param - * \return - * - * Pour chaque valeur, le defaut est la valeur definie dans ADAPT_Gen - * . Si la recuperation dans config/salome s'est bien passee a la creation de ADAPT_Gen - * ces valeurs sont les valeurs definies. - * . Si cela ne s'est pas bien passe, ce sont les valeurs par defaut de ADAPT_Gen -*/ -void SMESHGUI_AdaptDlg::recupPreferences() -{ - INFOS("Début de recupPreferences") +// /*! +// * \brief Gets the preferences for the adaptation +// * \param +// * \return +// * +// * Pour chaque valeur, le defaut est la valeur definie dans ADAPT_Gen +// * . Si la recuperation dans config/salome s'est bien passee a la creation de ADAPT_Gen +// * ces valeurs sont les valeurs definies. +// * . Si cela ne s'est pas bien passe, ce sont les valeurs par defaut de ADAPT_Gen +// */ +// void SMESHGUI_AdaptDlg::recupPreferences() +// { +// INFOS("Début de recupPreferences") +// // +// // A. Declarations +// // +// SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); +// SALOME_LifeCycleCORBA* ls = new SALOME_LifeCycleCORBA(app->namingService()); +// Engines::EngineComponent_var comp = ls->FindOrLoad_Component("FactoryServer", "SMESH"); +// ADAPT::ADAPT_Gen_var adaptGen = ADAPT::ADAPT_Gen::_narrow(comp); +// if (!CORBA::is_nil(adaptGen)) +// adaptGen->UpdateStudy(); // -// A. Declarations +// SUIT_ResourceMgr* resMgr = mySMESHGUI->getApp()->resourceMgr(); // - SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); - SALOME_LifeCycleCORBA* ls = new SALOME_LifeCycleCORBA(app->namingService()); - Engines::EngineComponent_var comp = ls->FindOrLoad_Component("FactoryServer", "SMESH"); - ADAPT::ADAPT_Gen_var adaptGen = ADAPT::ADAPT_Gen::_narrow(comp); - if (!CORBA::is_nil(adaptGen)) - adaptGen->UpdateStudy(); - - SUIT_ResourceMgr* resMgr = mySMESHGUI->getApp()->resourceMgr(); - -// B. Les valeurs -// B.1. La langue - - _LanguageShort = resMgr->stringValue("language", "language", "en" ); - INFOS ("Enregistrement de LanguageShort = " << _LanguageShort.toStdString().c_str() ); -// adaptGen->SetLanguageShort(_LanguageShort.toStdString().c_str()); - -// B.2. Les publications - bool publish_mesh ; - - publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_in", false ); - if ( publish_mesh ) { _PublisMeshIN = 1 ; } - else { _PublisMeshIN = 0 ; } - - publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_out", false ); - if ( publish_mesh ) { _PublisMeshOUT = 1 ; } - else { _PublisMeshOUT = 0 ; } - - INFOS ("Enregistrement de PublisMeshIN = " << _PublisMeshIN<<", PublisMeshOUT = "<< _PublisMeshOUT); -// adaptGen->SetPublisMesh(_PublisMeshIN, _PublisMeshOUT); - -// B.3. Les maximum pour YACS - - _YACSMaxIter = resMgr->integerValue("HOMARD", "yacs_max_iter", 0 ); - _YACSMaxNode = resMgr->integerValue("HOMARD", "yacs_max_node", 0 ); - _YACSMaxElem = resMgr->integerValue("HOMARD", "yacs_max_elem", 0 ); - - INFOS ("Enregistrement de YACSMaxIter = " << _YACSMaxIter<<", YACSMaxNode = "<< _YACSMaxNode<<", YACSMaxElem = "<< _YACSMaxElem); -// adaptGen->SetYACSMaximum(_YACSMaxIter, _YACSMaxNode, _YACSMaxElem); - -// B.4. La convergence pour YACS - - QString QString_v = resMgr->stringValue ( "HOMARD", "yacs_type_test", "None" ); - if ( ( QString_v == "VTest > VRef" ) || ( QString_v == "VTest > VRef" ) ) { _YACSTypeTest = 1 ; } - else if ( ( QString_v == "VTest < VRef" ) || ( QString_v == "VTest < VRef" ) ) { _YACSTypeTest = 2 ; } - else { _YACSTypeTest = 0 ; } - - INFOS ("Enregistrement de YACSTypeTest = " << _YACSTypeTest); -// adaptGen->SetYACSConvergenceType(_YACSTypeTest); - - INFOS("Fin de recupPreferences") -} +// // B. Les valeurs +// // B.1. La langue +// +// _LanguageShort = resMgr->stringValue("language", "language", "en" ); +// INFOS ("Enregistrement de LanguageShort = " << _LanguageShort.toStdString().c_str() ); +// // adaptGen->SetLanguageShort(_LanguageShort.toStdString().c_str()); +// +// // B.2. Les publications +// bool publish_mesh ; +// +// publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_in", false ); +// if ( publish_mesh ) { _PublisMeshIN = 1 ; } +// else { _PublisMeshIN = 0 ; } +// +// publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_out", false ); +// if ( publish_mesh ) { _PublisMeshOUT = 1 ; } +// else { _PublisMeshOUT = 0 ; } +// +// INFOS ("Enregistrement de PublisMeshIN = " << _PublisMeshIN<<", PublisMeshOUT = "<< _PublisMeshOUT); +// // adaptGen->SetPublisMesh(_PublisMeshIN, _PublisMeshOUT); +// +// // B.3. Les maximum pour YACS +// +// _YACSMaxIter = resMgr->integerValue("HOMARD", "yacs_max_iter", 0 ); +// _YACSMaxNode = resMgr->integerValue("HOMARD", "yacs_max_node", 0 ); +// _YACSMaxElem = resMgr->integerValue("HOMARD", "yacs_max_elem", 0 ); +// +// INFOS ("Enregistrement de YACSMaxIter = " << _YACSMaxIter<<", YACSMaxNode = "<< _YACSMaxNode<<", YACSMaxElem = "<< _YACSMaxElem); +// // adaptGen->SetYACSMaximum(_YACSMaxIter, _YACSMaxNode, _YACSMaxElem); +// +// // B.4. La convergence pour YACS +// +// QString QString_v = resMgr->stringValue ( "HOMARD", "yacs_type_test", "None" ); +// if ( ( QString_v == "VTest > VRef" ) || ( QString_v == "VTest > VRef" ) ) { _YACSTypeTest = 1 ; } +// else if ( ( QString_v == "VTest < VRef" ) || ( QString_v == "VTest < VRef" ) ) { _YACSTypeTest = 2 ; } +// else { _YACSTypeTest = 0 ; } +// +// INFOS ("Enregistrement de YACSTypeTest = " << _YACSTypeTest); +// // adaptGen->SetYACSConvergenceType(_YACSTypeTest); +// +// } /*! * \brief Launches the GUI for the adaptation @@ -170,9 +169,9 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) SALOME_LifeCycleCORBA* ls = new SALOME_LifeCycleCORBA(app->namingService()); Engines::EngineComponent_var comp = ls->FindOrLoad_Component("FactoryServer", "SMESH"); - ADAPT::ADAPT_Gen_var adaptGen = ADAPT::ADAPT_Gen::_narrow(comp); - if (!CORBA::is_nil(adaptGen)) - adaptGen->UpdateStudy(); +// ADAPT::ADAPT_Gen_var adaptGen = ADAPT::ADAPT_Gen::_narrow(comp); +// if (!CORBA::is_nil(adaptGen)) +// adaptGen->UpdateStudy(); mySMESHGUI->getApp()->updateObjectBrowser(); // @@ -190,51 +189,33 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) case 8011: // Création d'un Cas { INFOS("Création d'un Cas"); - MonCreateCase *aDlg = new MonCreateCase( true, - ADAPT::ADAPT_Gen::_duplicate(adaptGen) ) ; - aDlg->show(); +// MonCreateCase *aDlg = new MonCreateCase( true, +// ADAPT::ADAPT_Gen::_duplicate(adaptGen) ) ; +// aDlg->show(); break; } case 8012: // Création d'un cas en poursuite d'une itération { INFOS("Création d'un cas en poursuite d'une itération"); -// MonPursueIteration *aDlg = new MonPursueIteration( true, -// ADAPT::ADAPT_Gen::_duplicate(adaptGen) ) ; -// aDlg->show(); -// break; +// A faire + break; } case 8013: // Création d'une itération { INFOS("Création d'une itération" ); -// MonCreateIteration *IterDlg = new MonCreateIteration( parent, true, -// ADAPT::ADAPT_Gen::_duplicate(adaptGen), _ObjectName ) ; -// IterDlg->show(); +// A faire break; } case 8014: // Calcule une itération { INFOS("Calcule une itération" ); -// try { adaptGen->Compute(_ObjectName.toStdString().c_str(), 0, 1, -1, 1); } -// catch( SALOME::SALOME_Exception& S_ex ) -// { -// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), -// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// mySMESHGUI->getApp()->updateObjectBrowser(); -// ok = false; -// } +// A faire break; } case 8015: // Calcule une itération et publication { INFOS("Calcule une itération et publication"); -// try { adaptGen->Compute(_ObjectName.toStdString().c_str(), 0, 1, -1, 2); } -// catch( SALOME::SALOME_Exception& S_ex ) -// { -// QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), -// QObject::tr(CORBA::string_dup(S_ex.details.text)) ); -// mySMESHGUI->getApp()->updateObjectBrowser(); -// ok = false; -// } +// A faire break; } case 8020: // Adaptation avec MG-Adpat diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.h b/src/SMESHGUI/SMESHGUI_AdaptDlg.h index 8a7d6c286..1231b067e 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.h +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.h @@ -61,7 +61,7 @@ private slots: private: - void recupPreferences(); +// void recupPreferences(); SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */ QString _ObjectName; From f7b879328c3fda0af85ab2321d81feb8fa7d9041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Tue, 9 Jun 2020 16:36:42 +0200 Subject: [PATCH 048/100] Positionnement des toolbars --- resources/SalomeApp.xml.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in index 4af56219a..4d4121523 100644 --- a/resources/SalomeApp.xml.in +++ b/resources/SalomeApp.xml.in @@ -115,9 +115,9 @@
- +
- +
From ba015687b346215788c59ebbf6390df67d8560e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Tue, 9 Jun 2020 17:18:17 +0200 Subject: [PATCH 049/100] =?UTF-8?q?Pr=C3=A9f=C3=A9rences=20par=20d=C3=A9fa?= =?UTF-8?q?ut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/SalomeApp.xml.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in index 4d4121523..3c928f1d7 100644 --- a/resources/SalomeApp.xml.in +++ b/resources/SalomeApp.xml.in @@ -97,6 +97,13 @@ + + + + + + +
From eb9868c360dd2f3c097d206f4f1a4f8195832f8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Wed, 10 Jun 2020 11:22:21 +0200 Subject: [PATCH 050/100] =?UTF-8?q?Les=20pr=C3=A9f=C3=A9rences=20pour=20MG?= =?UTF-8?q?-Adapt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/SalomeApp.xml.in | 16 ++++--- src/ADAPT_I/ADAPT_Gen_i.cxx | 12 ++--- src/SMESHGUI/SMESHGUI.cxx | 39 +++++++++++----- src/SMESHGUI/SMESHGUI_AdaptDlg.cxx | 18 ++++---- src/SMESHGUI/SMESH_msg_en.ts | 70 ++++++++++++++++++++++------- src/SMESHGUI/SMESH_msg_fr.ts | 72 ++++++++++++++++++++++-------- 6 files changed, 160 insertions(+), 67 deletions(-) diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in index 3c928f1d7..8009476ad 100644 --- a/resources/SalomeApp.xml.in +++ b/resources/SalomeApp.xml.in @@ -98,12 +98,16 @@ - - - - - - + + + + + + + + + +
diff --git a/src/ADAPT_I/ADAPT_Gen_i.cxx b/src/ADAPT_I/ADAPT_Gen_i.cxx index 6b055fd62..eb58aeee3 100644 --- a/src/ADAPT_I/ADAPT_Gen_i.cxx +++ b/src/ADAPT_I/ADAPT_Gen_i.cxx @@ -5317,13 +5317,13 @@ void ADAPT_Gen_i::SetPreferences( ) { std::istringstream chainebis( chaine ) ; // 3.2.1. Les publications - if ( chaine2 == "publish_mesh_in" ) { chainebis >> PublisMeshIN ; } - if ( chaine2 == "publish_mesh_out" ) { chainebis >> PublisMeshOUT ; } + if ( chaine2 == "homard_publish_mesh_in" ) { chainebis >> PublisMeshIN ; } + if ( chaine2 == "homard_publish_mesh_out" ) { chainebis >> PublisMeshOUT ; } // 3.2.2. Les maximum pour YACS - if ( chaine2 == "yacs_max_iter" ) { chainebis >> YACSMaxIter ; } - if ( chaine2 == "yacs_max_node" ) { chainebis >> YACSMaxNode ; } - if ( chaine2 == "yacs_max_elem" ) { chainebis >> YACSMaxElem ; } - if ( chaine2 == "yacs_type_test" ) { YACSTypeTestchaine = chaine ; } + if ( chaine2 == "homard_yacs_max_iter" ) { chainebis >> YACSMaxIter ; } + if ( chaine2 == "homard_yacs_max_node" ) { chainebis >> YACSMaxNode ; } + if ( chaine2 == "homard_yacs_max_elem" ) { chainebis >> YACSMaxElem ; } + if ( chaine2 == "homard_yacs_type_test" ) { YACSTypeTestchaine = chaine ; } } } } diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index c653ff1ac..5056902dd 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -5763,33 +5763,50 @@ void SMESHGUI::createPreferences() int adaptTab = addPreference( tr( "ADAPT_PREF_TAB_GENERAL" ) ); int bloc, pref ; // Refinement with HOMARD - bloc = addPreference( tr( "ADAPT_PREF_PUBLICATION" ), adaptTab ); + bloc = addPreference( tr( "ADAPT_PREF_HOMARD_PUBLICATION" ), adaptTab ); setPreferenceProperty( bloc, "columns", 1 ); - pref = addPreference( tr( "ADAPT_PREF_PUBLICATION_MAILLAGE_IN" ), bloc, LightApp_Preferences::Bool, "HOMARD", "publish_mesh_in" ); - pref = addPreference( tr( "ADAPT_PREF_PUBLICATION_MAILLAGE_OUT" ), bloc, LightApp_Preferences::Bool, "HOMARD", "publish_mesh_out" ); + pref = addPreference( tr( "ADAPT_PREF_HOMARD_PUBLICATION_MAILLAGE_IN" ), bloc, LightApp_Preferences::Bool, "HOMARD", "homard_publish_mesh_in" ); + pref = addPreference( tr( "ADAPT_PREF_HOMARD_PUBLICATION_MAILLAGE_OUT" ), bloc, LightApp_Preferences::Bool, "HOMARD", "homard_publish_mesh_out" ); - bloc = addPreference( tr( "ADAPT_PREF_YACS_MAX" ), adaptTab ); + // YACS with HOMARD + bloc = addPreference( tr( "ADAPT_PREF_HOMARD_YACS" ), adaptTab ); setPreferenceProperty( bloc, "columns", 1 ); - pref = addPreference( tr( "ADAPT_PREF_YACS_MAX_ITER" ), bloc, LightApp_Preferences::IntSpin, "HOMARD", "yacs_max_iter" ); + pref = addPreference( tr( "ADAPT_PREF_HOMARD_YACS_MAX_ITER" ), bloc, LightApp_Preferences::IntSpin, "HOMARD", "homard_yacs_max_iter" ); setPreferenceProperty( pref, "min", 0 ); setPreferenceProperty( pref, "max", 100000000 ); setPreferenceProperty( pref, "step", 1 ); - pref = addPreference( tr( "ADAPT_PREF_YACS_MAX_NODE" ), bloc, LightApp_Preferences::IntSpin, "HOMARD", "yacs_max_node" ); + pref = addPreference( tr( "ADAPT_PREF_HOMARD_YACS_MAX_NODE" ), bloc, LightApp_Preferences::IntSpin, "HOMARD", "homard_yacs_max_node" ); setPreferenceProperty( pref, "min", 0 ); setPreferenceProperty( pref, "max", 100000000 ); setPreferenceProperty( pref, "step", 1000 ); - pref = addPreference( tr( "ADAPT_PREF_YACS_MAX_ELEM" ), bloc, LightApp_Preferences::IntSpin, "HOMARD", "yacs_max_elem" ); + pref = addPreference( tr( "ADAPT_PREF_HOMARD_YACS_MAX_ELEM" ), bloc, LightApp_Preferences::IntSpin, "HOMARD", "homard_yacs_max_elem" ); setPreferenceProperty( pref, "min", 0 ); setPreferenceProperty( pref, "max", 100000000 ); setPreferenceProperty( pref, "step", 1000 ); - bloc = addPreference( tr( "ADAPT_PREF_YACS_CONVERGENCE" ), adaptTab ); - setPreferenceProperty( bloc, "columns", 1 ); - pref = addPreference( tr( "ADAPT_PREF_YACS_TYPE_TEST" ), bloc, LightApp_Preferences::Selector, "HOMARD", "yacs_type_test" ); + pref = addPreference( tr( "ADAPT_PREF_HOMARD_YACS_TYPE_CONVERGENCE" ), bloc, LightApp_Preferences::Selector, "HOMARD", "homard_yacs_type_test" ); QStringList aListOfTypeTest; - aListOfTypeTest << "None"; + aListOfTypeTest << tr( "ADAPT_PREF_NONE" ); aListOfTypeTest << "VTest > VRef"; aListOfTypeTest << "VTest < VRef"; setPreferenceProperty( pref, "strings", aListOfTypeTest ); + + // MG-Adapt + bloc = addPreference( tr( "ADAPT_PREF_MG_ADAPT" ), adaptTab ); + setPreferenceProperty( bloc, "columns", 1 ); + pref = addPreference( tr( "ADAPT_PREF_MG_ADAPT_FILE_MAILLAGE_OUT" ), bloc, LightApp_Preferences::Bool, "HOMARD", "mg_adapt_file_mesh_out" ); + pref = addPreference( tr( "ADAPT_PREF_MG_ADAPT_PUBLICATION_MAILLAGE_OUT" ), bloc, LightApp_Preferences::Bool, "HOMARD", "mg_adapt_publish_mesh_out" ); + pref = addPreference( tr( "ADAPT_PREF_MG_ADAPT_SIZE_MAP" ), bloc, LightApp_Preferences::Selector, "HOMARD", "mg_adapt_size_map" ); + QStringList aListOfSizeMap; + aListOfSizeMap << tr( "ADAPT_PREF_MG_ADAPT_SIZE_MAP_LOCAL" ); + aListOfSizeMap << tr( "ADAPT_PREF_MG_ADAPT_SIZE_MAP_BACKGROUND" ); + aListOfSizeMap << tr( "ADAPT_PREF_NONE" );; + setPreferenceProperty( pref, "strings", aListOfSizeMap ); + pref = addPreference( tr( "ADAPT_PREF_MG_ADAPT_TIME_STEP" ), bloc, LightApp_Preferences::Selector, "HOMARD", "mg_adapt_time_step" ); + QStringList aListOfTimeStep; + aListOfTimeStep << tr( "ADAPT_PREF_NONE" ); + aListOfTimeStep << tr( "ADAPT_PREF_MG_ADAPT_TIME_STEP_LAST" ); + aListOfTimeStep << tr( "ADAPT_PREF_MG_ADAPT_TIME_STEP_C" );; + setPreferenceProperty( pref, "strings", aListOfTimeStep ); // Adaptation - end } diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx index 2e48cc2aa..e48ed4d85 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx @@ -111,32 +111,32 @@ void SMESHGUI_AdaptDlg::action (int theCommandID) // INFOS ("Enregistrement de LanguageShort = " << _LanguageShort.toStdString().c_str() ); // // adaptGen->SetLanguageShort(_LanguageShort.toStdString().c_str()); // -// // B.2. Les publications +// // B.2. Les publications avec HOMARD // bool publish_mesh ; // -// publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_in", false ); +// publish_mesh = resMgr->booleanValue("HOMARD", "homard_publish_mesh_in", false ); // if ( publish_mesh ) { _PublisMeshIN = 1 ; } // else { _PublisMeshIN = 0 ; } // -// publish_mesh = resMgr->booleanValue("HOMARD", "publish_mesh_out", false ); +// publish_mesh = resMgr->booleanValue("HOMARD", "homard_publish_mesh_out", false ); // if ( publish_mesh ) { _PublisMeshOUT = 1 ; } // else { _PublisMeshOUT = 0 ; } // // INFOS ("Enregistrement de PublisMeshIN = " << _PublisMeshIN<<", PublisMeshOUT = "<< _PublisMeshOUT); // // adaptGen->SetPublisMesh(_PublisMeshIN, _PublisMeshOUT); // -// // B.3. Les maximum pour YACS +// // B.3. Les maximum pour YACS avec HOMARD // -// _YACSMaxIter = resMgr->integerValue("HOMARD", "yacs_max_iter", 0 ); -// _YACSMaxNode = resMgr->integerValue("HOMARD", "yacs_max_node", 0 ); -// _YACSMaxElem = resMgr->integerValue("HOMARD", "yacs_max_elem", 0 ); +// _YACSMaxIter = resMgr->integerValue("HOMARD", "homard_yacs_max_iter", 0 ); +// _YACSMaxNode = resMgr->integerValue("HOMARD", "homard_yacs_max_node", 0 ); +// _YACSMaxElem = resMgr->integerValue("HOMARD", "homard_yacs_max_elem", 0 ); // // INFOS ("Enregistrement de YACSMaxIter = " << _YACSMaxIter<<", YACSMaxNode = "<< _YACSMaxNode<<", YACSMaxElem = "<< _YACSMaxElem); // // adaptGen->SetYACSMaximum(_YACSMaxIter, _YACSMaxNode, _YACSMaxElem); // -// // B.4. La convergence pour YACS +// // B.4. La convergence pour YACS avec HOMARD // -// QString QString_v = resMgr->stringValue ( "HOMARD", "yacs_type_test", "None" ); +// QString QString_v = resMgr->stringValue ( "HOMARD", "homard_yacs_type_test", "None" ); // if ( ( QString_v == "VTest > VRef" ) || ( QString_v == "VTest > VRef" ) ) { _YACSTypeTest = 1 ; } // else if ( ( QString_v == "VTest < VRef" ) || ( QString_v == "VTest < VRef" ) ) { _YACSTypeTest = 2 ; } // else { _YACSTypeTest = 0 ; } diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index 9055b7530..2c68a790b 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -2942,41 +2942,77 @@ Check algorithm documentation for supported geometry Adaptation - ADAPT_PREF_PUBLICATION - Publication + ADAPT_PREF_NONE + None - ADAPT_PREF_PUBLICATION_MAILLAGE_IN - IN meshes + ADAPT_PREF_HOMARD_PUBLICATION + Publication of meshes with HOMARD - ADAPT_PREF_PUBLICATION_MAILLAGE_OUT - OUT meshes + ADAPT_PREF_HOMARD_PUBLICATION_MAILLAGE_IN + IN mesh - ADAPT_PREF_YACS_MAX - Maximum numbers for a YACS schema with HOMARD + ADAPT_PREF_HOMARD_PUBLICATION_MAILLAGE_OUT + OUT mesh - ADAPT_PREF_YACS_MAX_ITER - Iterations + ADAPT_PREF_HOMARD_YACS + A YACS schema with HOMARD - ADAPT_PREF_YACS_MAX_NODE - Nodes + ADAPT_PREF_HOMARD_YACS_MAX_ITER + Maximal number of iterations - ADAPT_PREF_YACS_MAX_ELEM - Elements + ADAPT_PREF_HOMARD_YACS_MAX_NODE + Maximal number of nodes - ADAPT_PREF_YACS_CONVERGENCE - Convergence + ADAPT_PREF_HOMARD_YACS_MAX_ELEM + Maximal number of elements - ADAPT_PREF_YACS_TYPE_TEST + ADAPT_PREF_HOMARD_YACS_TYPE_CONVERGENCE Test type for a YACS schema with HOMARD + + ADAPT_PREF_MG_ADAPT + Adaptation with MG-Adapt + + + ADAPT_PREF_MG_ADAPT_FILE_MAILLAGE_OUT + Write the OUT mesh + + + ADAPT_PREF_MG_ADAPT_PUBLICATION_MAILLAGE_OUT + Publication of the OUT mesh + + + ADAPT_PREF_MG_ADAPT_SIZE_MAP + Size map + + + ADAPT_PREF_MG_ADAPT_SIZE_MAP_LOCAL + Local + + + ADAPT_PREF_MG_ADAPT_SIZE_MAP_BACKGROUND + Background + + + ADAPT_PREF_MG_ADAPT_TIME_STEP + Time step + + + ADAPT_PREF_MG_ADAPT_TIME_STEP_LAST + Last + + + ADAPT_PREF_MG_ADAPT_TIME_STEP_C + Value + SMESH_VISU_PROBLEM Mesh visualization failed diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index d66f06849..c82129921 100644 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -2904,40 +2904,76 @@ Référez-vous à la documentation sur l'algorithme et la géométrie suppo Adaptation - ADAPT_PREF_PUBLICATION - Publication + ADAPT_PREF_NONE + Sans - ADAPT_PREF_PUBLICATION_MAILLAGE_IN - Les maillages d'entrée + ADAPT_PREF_HOMARD_PUBLICATION + Publication des maillages avec HOMARD - ADAPT_PREF_PUBLICATION_MAILLAGE_OUT - Les maillages de sortie + ADAPT_PREF_HOMARD_PUBLICATION_MAILLAGE_IN + Le maillage d'entrée - ADAPT_PREF_YACS_MAX - Nombres maximaux pour un schéma YACS avec HOMARD + ADAPT_PREF_HOMARD_PUBLICATION_MAILLAGE_OUT + Le maillage de sortie - ADAPT_PREF_YACS_MAX_ITER - Itérations + ADAPT_PREF_HOMARD_YACS + Schéma YACS avec HOMARD - ADAPT_PREF_YACS_MAX_NODE - Noeuds + ADAPT_PREF_HOMARD_YACS_MAX_ITER + Nombre maximal d'itérations - ADAPT_PREF_YACS_MAX_ELEM - Eléments + ADAPT_PREF_HOMARD_YACS_MAX_NODE + Nombre maximal de noeuds - ADAPT_PREF_YACS_CONVERGENCE - Convergence + ADAPT_PREF_HOMARD_YACS_MAX_ELEM + Nombre maximal d'éléments - ADAPT_PREF_YACS_TYPE_TEST - Type de test pour un schéma YACS avec HOMARD + ADAPT_PREF_HOMARD_YACS_TYPE_CONVERGENCE + Type de test pour la convergence + + + ADAPT_PREF_MG_ADAPT + Adaptation avec MG-Adapt + + + ADAPT_PREF_MG_ADAPT_FILE_MAILLAGE_OUT + Ecriture du maillage de sortie + + + ADAPT_PREF_MG_ADAPT_PUBLICATION_MAILLAGE_OUT + Publication du maillage de sortie + + + ADAPT_PREF_MG_ADAPT_SIZE_MAP + Carte de tailles + + + ADAPT_PREF_MG_ADAPT_SIZE_MAP_LOCAL + Locale + + + ADAPT_PREF_MG_ADAPT_SIZE_MAP_BACKGROUND + Arrière-plan + + + ADAPT_PREF_MG_ADAPT_TIME_STEP + Choix du pas de temps + + + ADAPT_PREF_MG_ADAPT_TIME_STEP_LAST + Dernier + + + ADAPT_PREF_MG_ADAPT_TIME_STEP_C + Valeur SMESH_VISU_PROBLEM From 224eada95185c4b52f2e6733ab08536ec18fa2e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Wed, 10 Jun 2020 16:00:51 +0200 Subject: [PATCH 051/100] Clarification des menus --- src/SMESHGUI/SMESHGUI.cxx | 14 +++++--------- src/SMESHGUI/SMESH_msg_en.ts | 6 +++--- src/SMESHGUI/SMESH_msg_fr.ts | 14 +++++++------- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 5056902dd..27fe6571b 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -4760,19 +4760,15 @@ void SMESHGUI::initialize( CAM_Application* app ) popupMgr()->insert( separator(), -1, 0 ); createPopupItem( SMESHOp::OpConvertMeshToQuadratic, OB, mesh_submesh ); createPopupItem( SMESHOp::OpCreateBoundaryElements, OB, mesh_group, "&& selcount=1 && dim>=2"); - //popupMgr()->insert( separator(), -1, 0 ); - - //popupMgr()->insert( separator(), -1, 0 ); + popupMgr()->insert( separator(), -1, 0 ); // Adaptation - begin createPopupItem( SMESHOp::OpUniformRefinement, OB, mesh ); createPopupItem( SMESHOp::OpHONewCase, OB, mesh ); - createPopupItem( SMESHOp::OpHOCaseFollow, OB, mesh ); - createPopupItem( SMESHOp::OpHONewIter, OB, mesh ); - createPopupItem( SMESHOp::OpHOIterCompute, OB, mesh ); - createPopupItem( SMESHOp::OpHOIterComputePublish, OB, mesh ); - createPopupItem( SMESHOp::OpHOEdit, OB, mesh ); - createPopupItem( SMESHOp::OpHODelete, OB, mesh ); +// createPopupItem( SMESHOp::OpHOCaseFollow, OB, mesh ); +// createPopupItem( SMESHOp::OpHONewIter, OB, mesh ); +// createPopupItem( SMESHOp::OpHOIterCompute, OB, mesh ); +// createPopupItem( SMESHOp::OpHOIterComputePublish, OB, mesh ); createPopupItem( SMESHOp::OpMGAdapt, OB, mesh ); // Adaptation - end diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index 2c68a790b..ec3ca2f25 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -346,11 +346,11 @@ MEN_REF_HOMARD - Refinement with HOMARD + Adaptation with HOMARD MEN_HOMARD_CREATE_CASE - New case + New case for adaptation with HOMARD MEN_HOMARD_FOLLOW_ITERATION @@ -3238,7 +3238,7 @@ Use Display Entity menu command to show them. STB_HOMARD_CREATE_CASE - Creation of a new case + Creation of a new case for adaptation with HOMARD STB_HOMARD_FOLLOW_ITERATION diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index c82129921..a5d53c3a7 100644 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -1122,15 +1122,15 @@ MEN_HOMARD_CREATE_CASE - Création d'un cas + Création d'un cas d'adaptation MEN_HOMARD_FOLLOW_ITERATION - Poursuite d'une itération. + Poursuite d'une itération d'adaptation MEN_HOMARD_NEW_ITERATION - Création d'une itération + Création d'une itération d'adaptation MEN_HOMARD_COMPUTE @@ -3197,11 +3197,11 @@ Utilisez le menu "Visualiser une entité" pour les afficher. STB_REF_HOMARD - Raffinement avec HOMARD + Adaptation avec HOMARD STB_HOMARD_CREATE_CASE - Création d'un nouveau cas + Création d'un nouveau cas d'adaptation avec HOMARD STB_HOMARD_FOLLOW_ITERATION @@ -3933,11 +3933,11 @@ Utilisez le menu "Visualiser une entité" pour les afficher. TOP_HOMARD_CREATE_CASE - Création d'un cas + Création d'un cas d'adaptation avec HOMARD TOP_HOMARD_FOLLOW_ITERATION - Poursuite d'une itération. + Poursuite d'une itération d'adaptation avec HOMARD TOP_HOMARD_NEW_ITERATION From d8fb185943ac37f7fe54f54f34b42b6a456afc3f Mon Sep 17 00:00:00 2001 From: azakir Date: Thu, 10 Dec 2020 16:15:09 +0100 Subject: [PATCH 052/100] mesh adaptation with mg-adapt --- src/SMESHGUI/CMakeLists.txt | 8 + src/SMESHGUI/MG_ADAPT.cxx | 1297 ++++++++++++++++++++ src/SMESHGUI/MG_ADAPT.hxx | 330 ++++++ src/SMESHGUI/MG_ADAPTGUI.cxx | 1367 ++++++++++++++++++++++ src/SMESHGUI/MG_ADAPTGUI.hxx | 312 +++++ src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx | 771 ++++++++++++ src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.h | 227 ++++ 7 files changed, 4312 insertions(+) create mode 100644 src/SMESHGUI/MG_ADAPT.cxx create mode 100644 src/SMESHGUI/MG_ADAPT.hxx create mode 100644 src/SMESHGUI/MG_ADAPTGUI.cxx create mode 100644 src/SMESHGUI/MG_ADAPTGUI.hxx create mode 100644 src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx create mode 100644 src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.h diff --git a/src/SMESHGUI/CMakeLists.txt b/src/SMESHGUI/CMakeLists.txt index 642d767df..df5580f27 100644 --- a/src/SMESHGUI/CMakeLists.txt +++ b/src/SMESHGUI/CMakeLists.txt @@ -46,6 +46,7 @@ INCLUDE_DIRECTORIES( ${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}/idl ${PROJECT_BINARY_DIR}/src/ADAPTGUI + ${MEDCOUPLING_INCLUDE_DIRS} ) # additional preprocessor / compiler flags @@ -78,6 +79,7 @@ SET(_link_LIBRARIES ADAPTGUI ADAPTImpl ADAPTEngine + ${MEDCoupling_medloader} ) # --- headers --- @@ -151,6 +153,8 @@ SET(_moc_HEADERS SMESHGUI_IdPreview.h SMESHGUI_PreVisualObj.h SMESHGUI_AdaptDlg.h + SMESHGUI_MG_ADAPTDRIVER.h + MG_ADAPTGUI.hxx # to replace in ../ADAPTGUI/ ) # header files / no moc processing @@ -173,6 +177,7 @@ SET(_other_HEADERS SMESHGUI_FileValidator.h SMESHGUI_SelectionProxy.h SMESH_SMESHGUI.hxx + MG_ADAPT.hxx # to replace in ../ADAPT/ ) # header files / to install @@ -267,6 +272,9 @@ SET(_other_SOURCES SMESHGUI_PreVisualObj.cxx SMESHGUI_IdPreview.cxx SMESHGUI_AdaptDlg.cxx + SMESHGUI_MG_ADAPTDRIVER.cxx + MG_ADAPTGUI.cxx # to replace in ../ADAPTGUI/ + MG_ADAPT.cxx # to replace in ../ADAPT/ ) # sources / to compile diff --git a/src/SMESHGUI/MG_ADAPT.cxx b/src/SMESHGUI/MG_ADAPT.cxx new file mode 100644 index 000000000..305990c33 --- /dev/null +++ b/src/SMESHGUI/MG_ADAPT.cxx @@ -0,0 +1,1297 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// file : MG_ADAPT.cxx + +#include "MG_ADAPT.hxx" + +#include "MeshFormatReader.hxx" +#include "MeshFormatWriter.hxx" +#include "MEDFileMesh.hxx" +#include "MCAuto.hxx" +#include "MEDFileData.hxx" +#include "MEDFileField.hxx" +#include "MEDCouplingFieldDouble.hxx" + +#include +#include +#include +#include +#include +#include + +namespace +{ +struct GET_DEFAULT // struct used to get default value from GetOptionValue() +{ + bool isDefault; + operator bool* () { + return &isDefault; + } +}; +} + +//---------------------------------------------------------------------------------------- +MgAdapt::MgAdapt() +{ + data = new MgAdaptHypothesisData(); + data->myInMeshName = ""; + data->fromMedFile = defaultFromMedFile(); + data->myFileInDir = defaultWorkingDirectory(); + data->myMeshFileIn = ""; + data->myFileOutDir = defaultWorkingDirectory(); + data->myOutMeshName = ""; + data->myMeshFileOut = ""; + data->myMeshOutMed = defaultMeshOutMed(); + data->myPublish = defaultPublish(); + data->myUseLocalMap = defaultUseLocalMap(); + data->myUseBackgroundMap = defaultUseBackgroundMap(); + data->myFileSizeMapDir = defaultWorkingDirectory(); + data->myMeshFileBackground = ""; + data->myUseConstantValue = defaultUseConstantValue(); + data->myConstantValue = 0.0; + data->myFieldName = ""; + data->myUseNoTimeStep = defaultUseNoTimeStep(); + data->myUseLastTimeStep = defaultUseLastTimeStep(); + data->myUseChosenTimeStep = defaultUseChosenTimeStep(); + data->myTimeStep = -2; + data->myRank = -2; + data->myWorkingDir = defaultWorkingDirectory(); + data->myLogFile = defaultLogFile(); + data->myVerboseLevel = defaultVerboseLevel(); + data->myPrintLogInFile = defaultPrintLogInFile(); + data->myKeepFiles = defaultKeepFiles(); + data->myRemoveLogOnSuccess = defaultRemoveLogOnSuccess(); + + buildModel(); + setAll(); +} +MgAdapt::MgAdapt(MgAdaptHypothesisData* myData) +{ + data = new MgAdaptHypothesisData(); + setData(myData); + buildModel(); +} + +MgAdapt::MgAdapt( const MgAdapt& copy) +{ + + data = new MgAdaptHypothesisData(); + MgAdaptHypothesisData *copyData = copy.getData(); + copyMgAdaptHypothesisData(copyData); + setAll(); + + this->_option2value = copy._option2value; + this->_customOption2value = copy._customOption2value; + this->_defaultOptionValues = copy._defaultOptionValues; + this->_doubleOptions = copy._doubleOptions; + this->_charOptions = copy._charOptions; + this->_boolOptions = copy._boolOptions; + +} + + + +//----------------------------------------------------------------------------------------- +MgAdapt::~MgAdapt() +{ + + delete data; + +} +void MgAdapt::buildModel() +{ + + const char* boolOptionNames[] = { "compute_ridges", // yes + "" // mark of end + }; + // const char* intOptionNames[] = { "max_number_of_errors_printed", // 1 + // "max_number_of_threads", // 4 + // "" // mark of end + // }; + const char* doubleOptionNames[] = { "max_memory", // 0 + "" // mark of end + }; + const char* charOptionNames[] = { "components", // "yes" + "adaptation", // both + "" // mark of end + }; + + int i = 0; + while (boolOptionNames[i][0]) + { + _boolOptions.insert( boolOptionNames[i] ); + _option2value[boolOptionNames[i++]].clear(); + } + // i = 0; + // while (intOptionNames[i][0]) + // _option2value[intOptionNames[i++]].clear(); + + i = 0; + while (doubleOptionNames[i][0]) { + _doubleOptions.insert(doubleOptionNames[i]); + _option2value[doubleOptionNames[i++]].clear(); + } + i = 0; + while (charOptionNames[i][0]) { + _charOptions.insert(charOptionNames[i]); + _option2value[charOptionNames[i++]].clear(); + } + + // default values to be used while MG-Adapt + + _defaultOptionValues["adaptation" ] = "both"; + _defaultOptionValues["components" ] = "outside components"; + _defaultOptionValues["compute_ridges" ] = "yes"; + _defaultOptionValues["max_memory" ] = ToComment(defaultMaximumMemory()); +} + +//============================================================================= +TOptionValues MgAdapt::getOptionValues() const +{ + TOptionValues vals; + TOptionValues::const_iterator op_val = _option2value.begin(); + for ( ; op_val != _option2value.end(); ++op_val ) + vals.insert( make_pair( op_val->first, getOptionValue( op_val->first, GET_DEFAULT() ))); + + return vals; +} + +std::vector MgAdapt::getOptionValuesStrVec() const +{ + std::vector vals; + TOptionValues::const_iterator op_val = _option2value.begin(); + for ( ; op_val != _option2value.end(); ++op_val ) + vals.push_back(op_val->first+":"+getOptionValue( op_val->first, GET_DEFAULT() )); + + return vals; +} + +std::vector MgAdapt::getCustomOptionValuesStrVec() const +{ + std::vector vals; + TOptionValues::const_iterator op_val; + for ( op_val = _customOption2value.begin(); op_val != _customOption2value.end(); ++op_val ) + { + vals.push_back(op_val->first+":"+getOptionValue( op_val->first, GET_DEFAULT() )); + } + return vals; +} +const TOptionValues& MgAdapt::getCustomOptionValues() const +{ + return _customOption2value; +} +void MgAdapt::setData(MgAdaptHypothesisData* myData) +{ + copyMgAdaptHypothesisData(myData); + setAll(); +} +MgAdaptHypothesisData* MgAdapt::getData() const +{ + return data; +} +void MgAdapt::setMedFileIn(std::string fileName) +{ + medFileIn = fileName; +} + +std::string MgAdapt::getMedFileIn() +{ + return medFileIn; +} + +void MgAdapt::setMedFileOut(std::string fileOut) +{ + medFileOut = fileOut; +} + +std::string MgAdapt::getMedFileOut() +{ + return medFileOut; +} +void MgAdapt::setMeshOutMed(bool mybool) +{ + meshOutMed = mybool; +} +bool MgAdapt::getMeshOutMed() +{ + return meshOutMed; +} +void MgAdapt::setPublish(bool mybool) +{ + publish = mybool; +} +bool MgAdapt::getPublish() +{ + return publish; +} +void MgAdapt::setFieldName(std::string myFieldName) +{ + fieldName = myFieldName; +} +std::string MgAdapt::getFieldName() +{ + return fieldName; +} +void MgAdapt::setTimeStep(int time) +{ + timeStep = time; +} +int MgAdapt::getTimeStep() const +{ + return timeStep; +} + +void MgAdapt::setRankTimeStep(int time, int myRank) +{ + timeStep = time; + rank = myRank; +} + +int MgAdapt::getRank() +{ + return rank; +} +void MgAdapt::setUseLocalMap(bool myLocal) +{ + useLocalMap = myLocal; + +} +bool MgAdapt::getUseLocalMap() +{ + return useLocalMap; +} + +void MgAdapt::setUseBackgroundMap(bool bckg) +{ + useBackgroundMap = bckg; + +} +bool MgAdapt::getUseBackgroundMap() +{ + return useBackgroundMap; +} + +void MgAdapt::setUseConstantValue(bool cnst) +{ + useConstantValue = cnst; + +} +bool MgAdapt::getUseConstantValue() +{ + return useConstantValue; +} +void MgAdapt::setLogFile(std::string myLogFile) +{ + logFile = myLogFile; +} +std::string MgAdapt::getLogFile() +{ + return logFile; +} +void MgAdapt::setVerbosityLevel(int verboLevel) +{ + verbosityLevel = verboLevel; +} +int MgAdapt::getVerbosityLevel() +{ + return verbosityLevel; +} +void MgAdapt::setRemoveOnSuccess(bool rmons) +{ + removeOnSuccess = rmons; +} +bool MgAdapt::getRemoveOnSuccess() +{ + return removeOnSuccess; +} +void MgAdapt::setSizeMapFile(std::string mapFile) +{ + sizeMapFile = mapFile; +} +std::string MgAdapt::getSizeMapFile() +{ + return sizeMapFile; +} + +void MgAdapt::setMeshName(std::string name) +{ + meshName = name; +} +std::string MgAdapt::getMeshName() +{ + return meshName; +} +void MgAdapt::setMeshNameOut(std::string name) +{ + meshNameOut = name; +} +std::string MgAdapt::getMeshNameOut() +{ + return meshNameOut; +} +void MgAdapt::setFromMedFile(bool mybool) +{ + fromMedFile = mybool; +} +bool MgAdapt::isFromMedFile() +{ + return fromMedFile; +} +void MgAdapt::setConstantValue(double cnst) +{ + constantValue = cnst; +} +bool MgAdapt::getConstantValue() +{ + return constantValue; +} + +void MgAdapt::setWorkingDir(std::string dir) +{ + workingDir = dir; +} +std::string MgAdapt::getWorkingDir() const +{ + return workingDir; +} +void MgAdapt::setKeepWorkingFiles(bool mybool) +{ + toKeepWorkingFiles = mybool; +} +bool MgAdapt::getKeepWorkingFiles() +{ + return toKeepWorkingFiles; +} +void MgAdapt::setPrintLogInFile(bool print) +{ + printLogInFile = print; +} +bool MgAdapt::getPrintLogInFile() +{ + return printLogInFile; +} + +bool MgAdapt::setAll() +{ + + setFromMedFile(data->fromMedFile); + std::string file; + checkDirPath(data->myFileInDir); + file = data->myFileInDir+data->myMeshFileIn; + setMedFileIn(file); + setMeshName(data->myInMeshName); + setMeshNameOut(data->myOutMeshName); + checkDirPath(data->myFileOutDir); + std::string out = data->myFileOutDir+data->myMeshFileOut; + setMedFileOut(out); + setPublish(data->myPublish); + setMeshOutMed(data->myMeshOutMed); + setUseLocalMap(data->myUseLocalMap); + setUseBackgroundMap(data->myUseBackgroundMap); + setUseConstantValue(data->myUseConstantValue); + + std::string mapfile; + if (useBackgroundMap) + { + + checkDirPath(data->myFileSizeMapDir); + mapfile = data->myFileSizeMapDir+data->myMeshFileBackground; + setFieldName(data->myFieldName); + } + else if (useConstantValue) + { + setConstantValue(data->myConstantValue); + } + else + { + mapfile =""; + setConstantValue(0.0); + setFieldName(data->myFieldName); + + } + + setSizeMapFile(mapfile); + int rank; + int tmst; + if (data->myUseNoTimeStep) + { + rank = MED_NO_IT; + tmst = MED_NO_DT ; + } + else if (data->myUseLastTimeStep) + { + std::string fieldFile = useBackgroundMap ? sizeMapFile : medFileIn; + getTimeStepInfos(fieldFile, tmst, rank); + } + else + { + rank = data->myRank; + tmst = data->myTimeStep; + } + setRankTimeStep(tmst, rank); + + /* Advanced options */ + setWorkingDir(data->myWorkingDir); + checkDirPath(data->myWorkingDir); + setLogFile(data->myWorkingDir+defaultLogFile()); + setVerbosityLevel(data->myVerboseLevel); + setRemoveOnSuccess(data->myRemoveLogOnSuccess); + setPrintLogInFile(data->myPrintLogInFile); + setKeepWorkingFiles(data->myKeepFiles); + + return true; +} + +void MgAdapt::checkDirPath(std::string& dirPath) +{ + const char lastChar = *dirPath.rbegin(); +#ifdef WIN32 + if(lastChar != '\\') dirPath+='\\'; +#else + if(lastChar != '/') dirPath+='/'; +#endif +} +//============================================================================= +void MgAdapt::setOptionValue(const std::string& optionName, + const std::string& optionValue) +throw (std::invalid_argument) +{ + TOptionValues::iterator op_val = _option2value.find(optionName); + if (op_val == _option2value.end()) + { + op_val = _customOption2value.find( optionName ); + _customOption2value[ optionName ] = optionValue; + return; + } + + if (op_val->second != optionValue) + { + const char* ptr = optionValue.c_str(); + // strip white spaces + while (ptr[0] == ' ') + ptr++; + int i = strlen(ptr); + while (i != 0 && ptr[i - 1] == ' ') + i--; + // check value type + bool typeOk = true; + std::string typeName; + if (i == 0) { + // empty string + } else if (_charOptions.count(optionName)) { + // do not check strings + } else if (_doubleOptions.count(optionName)) { + // check if value is double + toDbl(ptr, &typeOk); + typeName = "real"; + } else if (_boolOptions.count(optionName)) { + // check if value is bool + toBool(ptr, &typeOk); + typeName = "bool"; + } else { + // check if value is int + toInt(ptr, &typeOk); + typeName = "integer"; + } + if ( typeOk ) // check some specific values ? + { + } + if ( !typeOk ) + { + std::string msg = "Advanced option '" + optionName + "' = '" + optionValue + "' but must be " + typeName; + throw std::invalid_argument(msg); + } + std::string value( ptr, i ); + if ( _defaultOptionValues[ optionName ] == value ) + value.clear(); + + + op_val->second = value; + + } +} +//============================================================================= +//! Return option value. If isDefault provided, it can be a default value, +// then *isDefault == true. If isDefault is not provided, the value will be +// empty if it equals a default one. +std::string MgAdapt::getOptionValue(const std::string& optionName, bool* isDefault) const +throw (std::invalid_argument) +{ + TOptionValues::const_iterator op_val = _option2value.find(optionName); + if (op_val == _option2value.end()) + { + op_val = _customOption2value.find(optionName); + if (op_val == _customOption2value.end()) + { + std::string msg = "Unknown MG-Adapt option: <" + optionName + ">"; + throw std::invalid_argument(msg); + } + } + std::string val = op_val->second; + if ( isDefault ) *isDefault = ( val.empty() ); + + if ( val.empty() && isDefault ) + { + op_val = _defaultOptionValues.find( optionName ); + if (op_val != _defaultOptionValues.end()) + val = op_val->second; + } + return val; +} +//================================================================================ +/*! + * \brief Converts a string to a real value + */ +//================================================================================ + +double MgAdapt::toDbl(const std::string& str, bool* isOk ) +throw (std::invalid_argument) +{ + if ( str.empty() ) throw std::invalid_argument("Empty value provided"); + + char * endPtr; + double val = strtod(&str[0], &endPtr); + bool ok = (&str[0] != endPtr); + + if ( isOk ) *isOk = ok; + + if ( !ok ) + { + std::string msg = "Not a real value:'" + str + "'"; + throw std::invalid_argument(msg); + } + return val; +} +//================================================================================ +/*! + * \brief Converts a string to a bool + */ +//================================================================================ + +bool MgAdapt::toBool(const std::string& str, bool* isOk ) +throw (std::invalid_argument) +{ + std::string s = str; + if ( isOk ) *isOk = true; + + for ( size_t i = 0; i <= s.size(); ++i ) + s[i] = tolower( s[i] ); + + if ( s == "1" || s == "true" || s == "active" || s == "yes" ) + return true; + + if ( s == "0" || s == "false" || s == "inactive" || s == "no" ) + return false; + + if ( isOk ) + *isOk = false; + else { + std::string msg = "Not a Boolean value:'" + str + "'"; + throw std::invalid_argument(msg); + } + return false; +} +//================================================================================ +/*! + * \brief Converts a string to a integer value + */ +//================================================================================ + +int MgAdapt::toInt(const std::string& str, bool* isOk ) +throw (std::invalid_argument) +{ + if ( str.empty() ) throw std::invalid_argument("Empty value provided"); + + char * endPtr; + int val = (int)strtol( &str[0], &endPtr, 10); + bool ok = (&str[0] != endPtr); + + if ( isOk ) *isOk = ok; + + if ( !ok ) + { + std::string msg = "Not an integer value:'" + str + "'"; + throw std::invalid_argument(msg); + } + return val; +} +//============================================================================= +bool MgAdapt::hasOptionDefined( const std::string& optionName ) const +{ + bool isDefault = false; + try + { + getOptionValue( optionName, &isDefault ); + } + catch ( std::invalid_argument ) + { + return false; + } + return !isDefault; +} +//================================================================================ +/*! + * \brief Return command to run MG-Tetra mesher excluding file prefix (-f) + */ +//================================================================================ + +std::string MgAdapt::getCommandToRun(MgAdapt* hyp) +{ + return hyp ? hyp->getCommandToRun() : ToComment("error with hypothesis!"); +} + + + +int MgAdapt::compute(std::string& errStr) +{ + std::string cmd= getCommandToRun(); + int err = 0; + execCmd( cmd.c_str(), err ); // run + + if ( err ) + { + errStr = ToComment("system(mg-adapt.exe ...) command failed with error: ") + << strerror( errno ); + } + else + { + convertMeshFile(meshFormatOutputMesh, solFormatOutput); + } + return err; +} + +void MgAdapt::execCmd( const char* cmd, int& err) +{ + err = 1; + std::array buffer; + std:: ofstream logStream; + logStream.open(logFile); + std::unique_ptr pipe(popen(cmd, "r"), pclose ); + if(!pipe) + { + throw std::runtime_error("popen() failed!"); + } + while(fgets(buffer.data(), buffer.size(), pipe.get()) !=nullptr ) + { + logStream<begin(); + for ( ; o2v != options[iOp]->end(); ++o2v ) + { + option = o2v->first; + value = getOptionValue( option, &isDefault ); + + if ( isDefault ) + continue; + if ( value.empty() )//value == NoValue() ) + { + if ( _defaultOptionValues.count( option )) + continue; // non-custom option with no value + //value.clear(); + } + if ( strncmp( "no", option.c_str(), 2 ) == 0 ) // options w/o values: --no_* + { + if ( !value.empty() && toBool( value ) == false ) + continue; + value.clear(); + } + if ( option[0] != '-' ) + cmd += " --"; + else + cmd += " "; + cmd += option + " " + value; + } + } + //~} +//~cmd+= " >" +#ifdef WIN32 + cmd += " < NUL"; +#endif + + return cmd; +} + + +bool MgAdapt::isFileExist(std::string& fName) const +{ + + if ( fName.empty() ) + return false; + + boost::system::error_code err; + bool res = boost::filesystem::exists( fName, err ); + + return err ? false : res; +} +//======================================================================= +//function : defaultMaximumMemory +//======================================================================= + +#if defined(WIN32) +#include +#elif !defined(__APPLE__) +#include +#endif + +double MgAdapt::defaultMaximumMemory() +{ +#if defined(WIN32) + // See http://msdn.microsoft.com/en-us/library/aa366589.aspx + MEMORYSTATUSEX statex; + statex.dwLength = sizeof (statex); + long err = GlobalMemoryStatusEx (&statex); + if (err != 0) { + double totMB = (double)statex.ullAvailPhys / 1024. / 1024.; + return (double)( 0.7 * totMB ); + } +#elif !defined(__APPLE__) + struct sysinfo si; + long err = sysinfo( &si ); + if ( err == 0 ) { + long ramMB = si.totalram * si.mem_unit / 1024 / 1024; + return ( 0.7 * ramMB ); + } +#endif + return 1024; +} + + +//======================================================================= +//function : defaultWorkingDirectory +//======================================================================= + +std::string MgAdapt::defaultWorkingDirectory() +{ + TCollection_AsciiString aTmpDir; + + char *Tmp_dir = getenv("SALOME_TMP_DIR"); + if(Tmp_dir != NULL) { + aTmpDir = Tmp_dir; + } + else { +#ifdef WIN32 + aTmpDir = TCollection_AsciiString("C:\\"); +#else + aTmpDir = TCollection_AsciiString("/tmp/"); +#endif + } + return aTmpDir.ToCString(); +} +//================================================================================ +/*! + * \brief Return a unique file name + */ +//================================================================================ + +std::string MgAdapt::getFileName() const +{ + std::string aTmpDir = workingDir; + const char lastChar = *aTmpDir.rbegin(); +#ifdef WIN32 + if(lastChar != '\\') aTmpDir+='\\'; +#else + if(lastChar != '/') aTmpDir+='/'; +#endif + + TCollection_AsciiString aGenericName = (char*)aTmpDir.c_str(); + aGenericName += "MgAdapt_"; + aGenericName += getpid(); + aGenericName += "_"; + aGenericName += Abs((Standard_Integer)(long) aGenericName.ToCString()); + + return aGenericName.ToCString(); +} +//======================================================================= +//function : defaultLogFile +//======================================================================= + +std::string MgAdapt::defaultLogFile() +{ + std::string alogFile("MG_ADAPT.log"); + return alogFile; +} +//======================================================================= +//function : defaultUseConstantValue +//======================================================================= + +bool MgAdapt::defaultUseConstantValue() +{ + return false; +} +//======================================================================= +//function : defaultUseNoTimeStep +//======================================================================= + +bool MgAdapt::defaultUseNoTimeStep() +{ + return true; +} +//======================================================================= +//function : defaultRemoveLogOnSuccess +//======================================================================= + +bool MgAdapt::defaultRemoveLogOnSuccess() +{ + return true; +} +//======================================================================= +//function : defaultPrintLogInFile +//======================================================================= + +bool MgAdapt::defaultPrintLogInFile() +{ + return false; +} +//======================================================================= +//function : defaultUseChosenTimeStep +//======================================================================= + +bool MgAdapt::defaultUseChosenTimeStep() +{ + return false; +} +//======================================================================= +//function : UseLastTimeStep +//======================================================================= + +bool MgAdapt::defaultUseLastTimeStep() +{ + return false; +} +//======================================================================= +//function : defaultUseBackgroundMap +//======================================================================= + +bool MgAdapt::defaultUseBackgroundMap() +{ + return false; +} +//======================================================================= +//function : defaultKeepFiles +//======================================================================= + +bool MgAdapt::defaultKeepFiles() +{ + return false; +} +//======================================================================= +//function : defaultUseLocalMap +//======================================================================= + +bool MgAdapt::defaultUseLocalMap() +{ + return true; +} +//======================================================================= +//function : defaultPublish +//======================================================================= + +bool MgAdapt::defaultPublish() +{ + return false; +} +//======================================================================= +//function : defaultMeshOutMed +//======================================================================= + +bool MgAdapt::defaultMeshOutMed() +{ + return true; +} +//======================================================================= +//function : defaultFromMedFile +//======================================================================= + +bool MgAdapt::defaultFromMedFile() +{ + return true; +} +//======================================================================= +//function : defaultVerboseLevel +//======================================================================= + +int MgAdapt::defaultVerboseLevel() +{ + return 3; +} +std::string MgAdapt::getExeName() +{ + return "mg-adapt.exe"; +} +void MgAdapt::copyMgAdaptHypothesisData( MgAdaptHypothesisData* from) +{ + + data->myFileInDir = from->myFileInDir; + data->myMeshFileIn = from->myMeshFileIn; + data->myMeshFileBackground = from->myMeshFileBackground; + data->myOutMeshName = from->myOutMeshName; + data->myMeshFileOut = from->myMeshFileOut; + data->myFileOutDir = from->myFileOutDir; + data->myFileSizeMapDir = from->myFileSizeMapDir; + data->myFieldName = from->myFieldName; + data->fromMedFile = from->fromMedFile; + data->myPublish = from->myPublish; + data->myMeshOutMed = from->myMeshOutMed; + data->myUseLocalMap = from->myUseLocalMap; + data->myUseBackgroundMap = from->myUseBackgroundMap; + data->myUseConstantValue = from->myUseConstantValue; + data->myConstantValue = from->myConstantValue; + data->myTimeStep = from->myTimeStep; + data->myRank = from->myRank; + data->myUseNoTimeStep = from->myUseNoTimeStep; + data->myUseLastTimeStep = from->myUseLastTimeStep; + data->myUseChosenTimeStep = from->myUseChosenTimeStep; + data->myWorkingDir = from->myWorkingDir; + data->myLogFile = from->myLogFile; + data->myPrintLogInFile = from->myPrintLogInFile; + data->myKeepFiles = from->myKeepFiles; + data->myRemoveLogOnSuccess = from->myRemoveLogOnSuccess; + data->myVerboseLevel = from->myVerboseLevel; + +} + + +void MgAdapt::convertMedFile(std::string& meshFormatMeshFileName, std::string& solFormatFieldFileName, std::string& meshFormatsizeMapFile) +{ + + std::vector fieldFileNames; + MeshFormatWriter writer; + MEDCoupling::MCAuto mfd = MEDCoupling::MEDFileData::New(medFileIn); + MEDCoupling::MEDFileMeshes* meshes = mfd->getMeshes(); + MEDCoupling::MEDFileMesh* fileMesh = meshes->getMeshAtPos(0); // ok only one mesh in file! + storeGroupsAndFams(fileMesh); + + MEDCoupling::MCAuto fields = MEDCoupling::MEDFileFields::New(); + solFormatFieldFileName = getFileName(); + solFormatFieldFileName+=".sol"; + fieldFileNames.push_back(solFormatFieldFileName); + + if (useBackgroundMap) + { + + meshFormatsizeMapFile = getFileName(); + meshFormatsizeMapFile += ".mesh"; + MEDCoupling::MCAuto tmpMfd = MEDCoupling::MEDFileData::New(sizeMapFile); + MEDCoupling::MEDFileFields* tmpFields = tmpMfd->getFields(); + MEDCoupling::MEDFileAnyTypeFieldMultiTS* fts = tmpFields->getFieldWithName(fieldName); + MEDCoupling::MCAuto fts1 = dynamic_cast(fts); + MEDCoupling::MCAuto f = fts1->getTimeStep(timeStep, rank); + MEDCoupling::MCAuto tmFts = MEDCoupling::MEDFileFieldMultiTS::New(); + tmFts->pushBackTimeStep(f); + + MEDCoupling::MCAuto tmp_fields = MEDCoupling::MEDFileFields::New(); + tmp_fields->pushField(tmFts); + + + tmpMfd->setFields( tmp_fields ); + MeshFormatWriter tmpWriter; + tmpWriter.setMeshFileName(meshFormatsizeMapFile); + tmpWriter.setFieldFileNames( fieldFileNames); + tmpWriter.setMEDFileDS(tmpMfd); + tmpWriter.write(); + + + } + else if(useLocalMap) + { + + MEDCoupling::MCAuto fts = dynamic_cast( mfd->getFields()->getFieldWithName(fieldName) ); + MEDCoupling::MCAuto f = fts->getTimeStep(timeStep, rank); + MEDCoupling::MCAuto tmFts = MEDCoupling::MEDFileFieldMultiTS::New(); + tmFts->pushBackTimeStep(f); + + fields->pushField(tmFts); + + writer.setFieldFileNames( fieldFileNames); + } + + else + { + MEDCoupling::MEDCouplingMesh* mesh = fileMesh->getMeshAtLevel(1); // nodes mesh + MEDCoupling::MEDCouplingFieldDouble* fieldOnNodes=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_NODES,MEDCoupling::NO_TIME); + fieldOnNodes->setName("MyScalarFieldOnNodeNoTime"); + fieldOnNodes->setMesh(mesh); + mesh->decrRef(); // no more need of mesh because mesh has been attached to fieldOnNodes + MEDCoupling::DataArrayDouble *array=MEDCoupling::DataArrayDouble::New(); + array->alloc(fieldOnNodes->getMesh()->getNumberOfNodes(),1);//Implicitly fieldOnNodes will be a 1 component field. + array->fillWithValue(constantValue); + fieldOnNodes->setArray(array); + array->decrRef(); + // fieldOnNodes is now usable + // ... + // fieldOnNodes is no more useful h + + } + + mfd->setFields( fields ); + meshFormatMeshFileName = getFileName(); + meshFormatMeshFileName+=".mesh"; + writer.setMeshFileName(meshFormatMeshFileName); + writer.setMEDFileDS( mfd); + writer.write(); + +} + +void MgAdapt::convertMeshFile(std::string& meshFormatIn, std::vector< std::string>& solFieldFileNames) const +{ + MeshFormatReader reader(meshFormatIn, solFieldFileNames); + + MEDCoupling::MCAuto mfd = reader.loadInMedFileDS(); + // write MED + MEDCoupling::MEDFileMeshes* meshes = mfd->getMeshes(); + MEDCoupling::MEDFileMesh* fileMesh = meshes->getMeshAtPos(0); // ok only one mesh in file! + fileMesh->setName(meshNameOut); + restoreGroupsAndFams(fileMesh); + mfd->write(medFileOut, 2); +} + + +void MgAdapt::storeGroupsAndFams(MEDCoupling::MEDFileMesh* fileMesh) +{ + storefams(fileMesh); + storeGroups(fileMesh); +} + +void MgAdapt::restoreGroupsAndFams(MEDCoupling::MEDFileMesh* fileMesh) const +{ + restorefams(fileMesh); + restoreGroups(fileMesh); +} +void MgAdapt::storeGroups(MEDCoupling::MEDFileMesh* fileMesh) +{ + std::map > grpFams = fileMesh->getGroupInfo(); + std::map >::iterator g2ff = grpFams.begin(); + + for ( ; g2ff != grpFams.end(); ++g2ff ) + { + std::string groupName = g2ff->first; + std::vector famNames = g2ff->second; + + if ( famNames.empty() ) continue; + std::size_t k = 0; + std::vector< mcIdType> famListId; + for ( size_t i = 0; i < famNames.size(); ++i ) + { + famListId.push_back( fileMesh->getFamilyId( famNames[i].c_str() ) ); + } + group grp(groupName, famListId, famNames); + groupVec.push_back(grp); + } +} + +void MgAdapt::storefams(MEDCoupling::MEDFileMesh* fileMesh) +{ + std::map grpFams = fileMesh->getFamilyInfo(); + std::map::iterator f = grpFams.begin(); + + for ( ; f != grpFams.end(); ++f ) + { + if(!f->second) continue; // FAMILLE_ZERO + family fs(f->first, f->second); + famVec.push_back(fs); + } + +} + +void MgAdapt::restorefams(MEDCoupling::MEDFileMesh* fileMesh) const +{ + std::vector::const_iterator fIt = famVec.begin(); + + for (; fIt!=famVec.end(); ++fIt) + { + std::string givenFamNameFromMeshGemConverter = fileMesh->getFamilyNameGivenId( fIt->_famId ); + fileMesh->changeFamilyName(givenFamNameFromMeshGemConverter, fIt->_famName); + } +} + +void MgAdapt::restoreGroups(MEDCoupling::MEDFileMesh* fileMesh) const +{ + std::map > info; + std::vector ::const_iterator grpFams = groupVec.begin(); + + for (; grpFams!=groupVec.end(); ++grpFams) + { + info.insert(std::pair > (grpFams->_name, grpFams->_famNames) ); + } + + fileMesh->setGroupInfo(info); +} +// ======================================================================= +med_idt MgAdapt::openMedFile(const std::string aFile) +// ======================================================================= +// renvoie le medId associe au fichier Med apres ouverture +{ + med_idt medIdt = MEDfileOpen(aFile.c_str(),MED_ACC_RDONLY); + if (medIdt <0) + { + //~addMessage( ToComment(" error: Can't open ") << aFile, /*fatal=*/true ); + ; + } + return medIdt; +} + +MgAdapt::Status MgAdapt::addMessage(const std::string& msg, + const bool isFatal/*=false*/) +{ + if ( isFatal ) + _myErrorMessages.clear(); // warnings are useless if a fatal error encounters + + _myErrorMessages.push_back( msg ); + + //~MESSAGE(msg); +#ifdef _DEBUG_ + std::cout << msg << std::endl; +#endif + return ( _myStatus = isFatal ? MgAdapt::DRS_FAIL : MgAdapt::DRS_WARN_SKIP_ELEM ); +} + + + + +// ======================================================================= +void MgAdapt::getTimeStepInfos(std::string aFile, int& numdt, int& numit) +// ======================================================================= +{ +// Il faut voir si plusieurs maillages + + + med_err erreur = 0 ; + med_idt medIdt ; + + + // Ouverture du fichier + //~SCRUTE(aFile.toStdString()); + medIdt = openMedFile(aFile); + if ( medIdt < 0 ) return ; + // Lecture du nombre de champs + med_int ncha = MEDnField(medIdt) ; + if (ncha < 1 ) + { + //~addMessage( ToComment(" error: there is no field in ") << aFile, /*fatal=*/true ); + return; + } + // Lecture des caracteristiques du champs + + // Lecture du type du champ, des noms des composantes et du nom de l'unite + char nomcha [MED_NAME_SIZE+1]; + strcpy(nomcha, fieldName.c_str()); +// Lecture du nombre de composantes + med_int ncomp = MEDfieldnComponentByName(medIdt, nomcha); + char meshname[MED_NAME_SIZE+1]; + char * comp = (char*) malloc(ncomp*MED_SNAME_SIZE+1); + char * unit = (char*) malloc(ncomp*MED_SNAME_SIZE+1); + char dtunit[MED_SNAME_SIZE+1]; + med_bool local; + med_field_type typcha; + med_int nbofcstp; + erreur = MEDfieldInfoByName (medIdt, nomcha, meshname,&local,&typcha,comp,unit,dtunit, &nbofcstp); + free(comp); + free(unit); + if ( erreur < 0 ) + { + //~addMessage( ToComment(" error: error while reading field ") << nomcha << " in file " << aFile , /*fatal=*/true ); + return; + } + + med_float dt; + int tmp_numdt, tmp_numit; + + med_int step = data->myUseLastTimeStep ? nbofcstp : data->myTimeStep+1; + //~myPrint("step ", step); + erreur = MEDfieldComputingStepInfo ( medIdt, nomcha, step, &tmp_numdt, &tmp_numit, &dt ); + if ( erreur < 0 ) + { + + //~addMessage( ToComment(" error: error while reading field last time step ") << nomcha << " in file " << aFile , /*fatal=*/true ); + return; + } + + numdt = tmp_numdt; + numit = tmp_numit; + + + // Fermeture du fichier + if ( medIdt > 0 ) MEDfileClose(medIdt); + + +} + + + diff --git a/src/SMESHGUI/MG_ADAPT.hxx b/src/SMESHGUI/MG_ADAPT.hxx new file mode 100644 index 000000000..f81dd03c5 --- /dev/null +++ b/src/SMESHGUI/MG_ADAPT.hxx @@ -0,0 +1,330 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// +// File : MG_ADAPT.hxx +// +#ifndef MG_ADAPT_HXX +#define MG_ADAPT_HXX +#include +# include +#include +#include +#include +#include + +#include "MCAuto.hxx" +#include "MCType.hxx" +#include "MEDFileMesh.hxx" + +#include +// SMESH includes + +//~#include + + +class MgAdapt; + +typedef std::map< std::string, std::string > TOptionValues; +typedef std::set< std::string > TOptionNames; + +struct MgAdaptHypothesisData +{ + std::string myFileInDir, myMeshFileIn, myInMeshName, myMeshFileBackground, myOutMeshName, + myMeshFileOut, myFileOutDir, myFileSizeMapDir, myFieldName; + bool fromMedFile; + bool myPublish, myMeshOutMed; + bool myUseLocalMap, myUseBackgroundMap, myUseConstantValue; + double myConstantValue; + int myRank, myTimeStep; + bool myUseNoTimeStep, myUseLastTimeStep, myUseChosenTimeStep; + std::string myWorkingDir, myLogFile; + bool myPrintLogInFile, myKeepFiles, myRemoveLogOnSuccess; + int myVerboseLevel; + +}; + + + +/*! + * \brief Class to generate string from any type + */ +class ToComment : public std::string +{ + std::ostringstream _s ; + +public : + + ToComment():std::string("") {} + + ToComment(const ToComment& c):std::string() { + _s << c.c_str() ; + this->std::string::operator=( _s.str() ); + } + + ToComment & operator=(const ToComment& c) { + _s << c.c_str() ; + this->std::string::operator=( _s.str() ); + return *this; + } + + template + ToComment( const T &anything ) { + _s << anything ; + this->std::string::operator=( _s.str() ); + } + + template + ToComment & operator<<( const T &anything ) { + _s << anything ; + this->std::string::operator=( _s.str() ); + return *this ; + } + + operator char*() const { + return (char*)c_str(); + } + + std::ostream& Stream() { + return _s; + } +}; + + +class MgAdapt +{ + enum YesNo {YES, NO}; +public: + + MgAdapt(); + MgAdapt(MgAdaptHypothesisData*); + MgAdapt(const MgAdapt&); + ~MgAdapt(); + void buildModel(); + void setData( MgAdaptHypothesisData*); + + void setMedFileIn(std::string); + std::string getMedFileIn(); + + void setMedFileOut(std::string); + std::string getMedFileOut(); + + void setMeshName(std::string); + std::string getMeshName(); + + void setMeshNameOut(std::string); + std::string getMeshNameOut(); + + void setMeshOutMed(bool); + bool getMeshOutMed(); + + void setPublish(bool); + bool getPublish(); + + void setFieldName(std::string); + std::string getFieldName(); + + void setTimeStep(int); + int getTimeStep() const; + + void setRankTimeStep(int, int ); + int getRank(); + + void setLogFile(std::string); + std::string getLogFile(); + + void setVerbosityLevel(int); + int getVerbosityLevel(); + + void setRemoveOnSuccess(bool); + bool getRemoveOnSuccess(); + + MgAdaptHypothesisData* getData() const; + + void setUseLocalMap(bool); + bool getUseLocalMap(); + + void setUseBackgroundMap(bool); + bool getUseBackgroundMap(); + + void setUseConstantValue(bool); + bool getUseConstantValue(); + + void setConstantValue(double); + bool getConstantValue(); + + void setSizeMapFile(std::string); + std::string getSizeMapFile(); + + void setFromMedFile(bool); + bool isFromMedFile(); + + void setKeepWorkingFiles(bool); + bool getKeepWorkingFiles(); + + void setPrintLogInFile(bool); + bool getPrintLogInFile(); + + void setWorkingDir(std::string); + std::string getWorkingDir() const; + + + bool setAll(); + static std::string getCommandToRun(MgAdapt* ); + std::string getCommandToRun() ; + int compute(std::string& errStr); + std::string getFileName() const; + static std::string getExeName(); + void copyMgAdaptHypothesisData( MgAdaptHypothesisData* ) ; + + void checkDirPath(std::string& ); + + + + bool hasOptionDefined( const std::string& optionName ) const; + void setOptionValue(const std::string& optionName, + const std::string& optionValue) throw (std::invalid_argument); + std::string getOptionValue(const std::string& optionName, + bool* isDefault=0) const throw (std::invalid_argument); + std::vector getCustomOptionValuesStrVec() const; + std::vector getOptionValuesStrVec() const; + + + TOptionValues getOptionValues() const; + const TOptionValues& getCustomOptionValues() const ; + static double toDbl(const std::string&, bool* isOk = 0) throw (std::invalid_argument); + static bool toBool(const std::string&, bool* isOk = 0) throw (std::invalid_argument); + static int toInt(const std::string&, bool* isOk = 0 ) throw (std::invalid_argument); + + + /* default values */ + static std::string defaultWorkingDirectory(); + static std::string defaultLogFile(); + static bool defaultKeepFiles(); + static bool defaultRemoveLogOnSuccess(); + static int defaultVerboseLevel(); + static bool defaultPrintLogInFile(); + static bool defaultFromMedFile(); + static bool defaultMeshOutMed(); + static bool defaultPublish(); + static bool defaultUseLocalMap(); + static bool defaultUseBackgroundMap(); + static bool defaultUseConstantValue(); + static bool defaultUseNoTimeStep(); + static bool defaultUseLastTimeStep(); + static bool defaultUseChosenTimeStep(); + static double defaultMaximumMemory(); + + + + + enum Status { + DRS_OK, + DRS_EMPTY, // a file contains no mesh with the given name + DRS_WARN_RENUMBER, // a file has overlapped ranges of element numbers, + // so the numbers from the file are ignored + DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data + DRS_WARN_DESCENDING, // some elements were skipped due to descending connectivity + DRS_FAIL, // general failure (exception etc.) + DRS_NO_TIME_STEP // general failure (exception etc.) + }; + + struct group { + + std::string _name; + std::vector _famListId; + std::vector _famNames; + group(std::string name, std::vector famListId, std::vector famNames):_name(name) + { + std::vector::iterator it = famListId.begin(); + for (; it!=famListId.end(); ++it) + _famListId.push_back(*it); + + std::vector::iterator itt = famNames.begin(); + for (; itt!=famNames.end(); ++itt) + _famNames.push_back(*itt); + } + }; + + struct family { + std::string _famName; + mcIdType _famId; + family(std::string famName, MEDCoupling::mcIdType famId):_famName(famName), _famId(famId) {} + }; + + +private : + bool fromMedFile; + + std::string medFileIn; + std::string medFileOut; + std::string meshName; + std::string meshNameOut; + bool publish, meshOutMed; + bool useLocalMap, useBackgroundMap, useConstantValue; + std::string sizeMapFile; + std::string fieldName; + double constantValue; + int rank, timeStep; + + /* advanced options */ + + + std::string logFile; + std::string workingDir; + int verbosityLevel; + bool removeOnSuccess; + bool toKeepWorkingFiles; + bool printLogInFile; + + /* Model DATA */ + MgAdaptHypothesisData* data; + + /* */ + + TOptionValues _option2value, _customOption2value; // user defined values + TOptionValues _defaultOptionValues; // default values + TOptionNames _doubleOptions, _charOptions, _boolOptions; // to find a type of option + + std::vector _myErrorMessages; + Status _myStatus; + std::string meshFormatOutputMesh; + std::vector< std::string> solFormatOutput; + std::vector groupVec; + std::vector famVec; + + /* convert MED-->.mesh format */ + void convertMedFile(std::string& meshIn,std::string& solFileIn, std::string& sizeMapIn) ; + void storeGroups(MEDCoupling::MEDFileMesh* fileMesh); + void restoreGroups(MEDCoupling::MEDFileMesh* fileMesh) const; + void storefams(MEDCoupling::MEDFileMesh* fileMesh); + void restorefams(MEDCoupling::MEDFileMesh* fileMesh) const; + void storeGroupsAndFams(MEDCoupling::MEDFileMesh* fileMesh); + void restoreGroupsAndFams(MEDCoupling::MEDFileMesh* fileMesh) const; + void convertMeshFile(std::string& meshFormatIn, std::vector< std::string>& solFieldFileNames) const ; + void getTimeStepInfos(std::string aFile, int& numdt, int& numit); + Status addMessage(const std::string& msg, const bool isFatal = false); + med_idt openMedFile(const std::string aFile) ; + bool isFileExist(std::string& fName) const; + void execCmd( const char* cmd, int& err); +}; + + + +#endif // MG_ADAPT_HXX diff --git a/src/SMESHGUI/MG_ADAPTGUI.cxx b/src/SMESHGUI/MG_ADAPTGUI.cxx new file mode 100644 index 000000000..628912e46 --- /dev/null +++ b/src/SMESHGUI/MG_ADAPTGUI.cxx @@ -0,0 +1,1367 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// file : MG_ADAPTGUI.cxx + +#include "MG_ADAPTGUI.hxx" + +#include "SUIT_Desktop.h" +#include "SUIT_Application.h" +#include "SUIT_Session.h" + +#include "SalomeApp_Application.h" +#include "SalomeApp_Module.h" +#include "SalomeApp_Study.h" +#include "SMESH_Actor.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +// SALOME KERNEL includes +#include +#include +#include +#include +#include "SalomeApp_Tools.h" +#include +#include +#include + +#include + + +const int SPACING = 6; // layout spacing +const int MARGIN = 9; // layout margin + +//================================================================================= +// function : SMESHGUI_MgAdaptDlg() +// purpose : +//================================================================================= +SMESHGUI_MgAdaptDlg::SMESHGUI_MgAdaptDlg( SalomeApp_Module* theModule, MgAdapt* myModel, QWidget* parent, bool isCreation ) + : mySMESHGUI( theModule ), QDialog(parent) +{ + model = new MgAdapt(*myModel); + myData = model->getData(); + buildDlg(); + if (!isCreation) readParamsFromHypo(); +} + +void SMESHGUI_MgAdaptDlg::buildDlg() +{ + setModal( false ); + setAttribute( Qt::WA_DeleteOnClose, true ); + setWindowTitle( tr( "ADAPT_PREF_MG_ADAPT" ) ); + setSizeGripEnabled( true ); + + + myTabWidget = new QTabWidget( this ); + + // Arguments + + myArgs = new SMESHGUI_MgAdaptArguments( myTabWidget ); + std::vector str = model->getOptionValuesStrVec(); + std::vector str2 = model->getCustomOptionValuesStrVec(); + str.insert( str.end(), str2.begin(), str2.end() ); + + myAdvOpt = new MgAdaptAdvWidget(myTabWidget, &str); + int argsTab = myTabWidget->addTab( myArgs, tr( "Args" ) ); + int advTab = myTabWidget->addTab( myAdvOpt, tr( "ADVOP" ) ); + + myAdvOpt->workingDirectoryLabel ->setText (tr( "WORKING_DIR" )); + myAdvOpt->workingDirectoryPushButton ->setText (tr( "SELECT_DIR" )); + myAdvOpt->keepWorkingFilesCheck ->setText (tr( "KEEP_WORKING_FILES" )); + myAdvOpt->verboseLevelLabel ->setText (tr( "VERBOSE_LEVEL" )); + myAdvOpt->removeLogOnSuccessCheck ->setText (tr( "REMOVE_LOG_ON_SUCCESS" )); + myAdvOpt->logInFileCheck ->setText (tr( "LOG_IN_FILE" )); + myAdvOpt->logGroupBox ->setTitle(tr( "LOG_GROUP_TITLE" )); + + // buttons + QPushButton* okBtn = new QPushButton( tr( "SMESH_BUT_OK" ), this ); + okBtn->setAutoDefault( true ); + okBtn->setDefault( true ); + okBtn->setFocus(); + QPushButton* buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), this); + buttonApply->setAutoDefault(true); + QPushButton* buttonApplyAndClose = new QPushButton(tr("SMESH_BUT_APPLY_AND_CLOSE"), this); + buttonApplyAndClose->setAutoDefault(true); + QPushButton* cancelBtn = new QPushButton( tr( "SMESH_BUT_CANCEL" ), this ); + cancelBtn->setAutoDefault( true ); + QPushButton* helpBtn = new QPushButton( tr( "SMESH_BUT_HELP" ), this ); + helpBtn->setAutoDefault( true ); + + QHBoxLayout* btnLayout = new QHBoxLayout; + btnLayout->setSpacing( SPACING ); + btnLayout->setMargin( 0 ); + btnLayout->addWidget( buttonApplyAndClose ); + btnLayout->addStretch( 10 ); + btnLayout->addWidget( buttonApply ); + btnLayout->addStretch( 10 ); + btnLayout->addWidget( okBtn ); + btnLayout->addStretch( 10 ); + btnLayout->addWidget( cancelBtn ); + btnLayout->addStretch( 10 ); + btnLayout->addWidget( helpBtn ); + okBtn->hide(); // tab 1 + + QVBoxLayout* l = new QVBoxLayout ( this ); + l->setMargin( MARGIN ); + l->setSpacing( SPACING ); + l->addWidget( myTabWidget ); + l->addStretch(); + l->addLayout( btnLayout ); + + + connect( okBtn, SIGNAL( clicked() ), this, SLOT( clickOnOk() ) ); + connect( helpBtn, SIGNAL( clicked() ), this, SLOT( clickOnHelp() ) ); + connect(cancelBtn, SIGNAL(clicked()), this, SLOT(reject())); + connect(buttonApply, SIGNAL(clicked()), this,SLOT(clickOnApply())); + connect(buttonApplyAndClose, SIGNAL(clicked()), this,SLOT(clickOnOk())); +} + + +//================================================================================= +// function : ~SMESHGUI_MgAdaptDlg() +// purpose : Destroys the object and frees any allocated resources +//================================================================================= +SMESHGUI_MgAdaptDlg::~SMESHGUI_MgAdaptDlg() +{ + delete model; +} + +void SMESHGUI_MgAdaptDlg::setModel(MgAdapt* mg) +{ + model = mg; +} +MgAdapt* SMESHGUI_MgAdaptDlg::getModel() const +{ + return model; +} +/*! + \brief Perform clean-up actions on the dialog box closing. +*/ +bool SMESHGUI_MgAdaptDlg::clickOnApply() +{ + readParamsFromWidgets(); + return true; +} +void SMESHGUI_MgAdaptDlg::clickOnOk() +{ + clickOnApply(); + reject(); +} +void SMESHGUI_MgAdaptDlg::reject() +{ + QDialog::reject(); +} +bool SMESHGUI_MgAdaptDlg::readParamsFromHypo( ) const +{ + bool ret = true; + myArgs->aMedfile->setChecked(myData->fromMedFile) ; + if (myData->fromMedFile) + { + + *(myArgs->myFileInDir) = QString(myData->myFileInDir.c_str()) ; + myArgs->selectMedFileLineEdit->setText(myData->myMeshFileIn.c_str()) ; + // myData->myInMeshName = // TODO + + } + else + { + myArgs->aBrowserObject->setText(myData->myInMeshName.c_str()); + //~ myArgs->myFileInDir =""; // TODO + //~ myArgs->selectMedFileLineEdit->setText(); // TODO + } + myArgs->meshNameLineEdit->setText(myData->myOutMeshName.c_str()); + myArgs->medFileCheckBox->setChecked(myData->myMeshOutMed); + + if(myData->myMeshOutMed) + { + *(myArgs->myFileOutDir) = QString(myData->myFileOutDir.c_str()); + myArgs->selectOutMedFileLineEdit->setText(myData->myMeshFileOut.c_str()); + + } + else + { + *(myArgs->myFileOutDir) = QString(""); //TODO + } + + myArgs->publishOut->setChecked(myData->myPublish); + + myArgs->localButton->setChecked(myData->myUseLocalMap); + myArgs->backgroundButton->setChecked(myData->myUseBackgroundMap); + myArgs->constantButton->setChecked(myData->myUseConstantValue); + + if (myData->myUseConstantValue) + { + myArgs->dvalue->setValue(myData->myConstantValue); + } + else + { + myArgs->dvalue->setValue(0.0); + } + + if (myData->myUseBackgroundMap) + { + + *(myArgs->myFileSizeMapDir) = QString(myData->myFileSizeMapDir.c_str()) ; + myArgs->selectMedFileBackgroundLineEdit->setText(myData->myMeshFileBackground.c_str()); + } + else + { + *(myArgs->myFileSizeMapDir) = QString("") ; //TODO + myArgs->selectMedFileBackgroundLineEdit->setText(""); //TODO + } + + myArgs->fieldNameCmb->setCurrentText(myData->myFieldName.c_str()); + myArgs->noTimeStep->setChecked(myData->myUseNoTimeStep); + myArgs->lastTimeStep->setChecked( myData->myUseLastTimeStep); + myArgs->chosenTimeStep->setChecked(myData->myUseChosenTimeStep); + if (myData->myUseChosenTimeStep) + { + myArgs->rankSpinBox->setValue(myData->myRank); + myArgs->timeStep->setValue(myData->myTimeStep); + } + + myAdvOpt->workingDirectoryLineEdit->setText(myData->myWorkingDir.c_str()); + myAdvOpt->logInFileCheck->setChecked(myData->myPrintLogInFile); + + myAdvOpt->verboseLevelSpin->setValue(myData->myVerboseLevel); + myAdvOpt->removeLogOnSuccessCheck->setChecked(myData->myRemoveLogOnSuccess); + myAdvOpt->keepWorkingFilesCheck->setChecked(myData->myKeepFiles); + + return ret; + +} + + +bool SMESHGUI_MgAdaptDlg::readParamsFromWidgets() +{ + bool ret = true; + MgAdaptHypothesisData* aData = new MgAdaptHypothesisData(); + aData->fromMedFile = myArgs->aMedfile->isChecked(); + if (aData->fromMedFile) + { + + aData->myFileInDir = myArgs->myFileInDir->toStdString(); + aData->myMeshFileIn = myArgs->selectMedFileLineEdit->text().toStdString(); + // aData->myInMeshName = // TODO + } + else // TODO browser + { + aData->myInMeshName = myArgs->aBrowserObject->text().toStdString(); + aData->myFileInDir = myAdvOpt->workingDirectoryLineEdit->text().toStdString(); + + TCollection_AsciiString aGenericName = (char*)aData->myFileInDir.c_str(); + TCollection_AsciiString aGenericName2 = "MgAdapt_"; + aGenericName2 += getpid(); + aGenericName2 += "_"; + aGenericName2 += Abs((Standard_Integer)(long) aGenericName.ToCString()); + aGenericName2 += ".med"; + aGenericName+=aGenericName2; + emit myArgs->toExportMED(aGenericName.ToCString()); + aData->myMeshFileIn = aGenericName2.ToCString(); + } + aData->myOutMeshName = myArgs->meshNameLineEdit->text().toStdString(); + aData->myMeshOutMed = myArgs->medFileCheckBox->isChecked(); + if(aData->myMeshOutMed) + { + aData->myFileOutDir = myArgs->myFileOutDir->toStdString(); + aData->myMeshFileOut = myArgs->selectOutMedFileLineEdit->text().toStdString(); + + } + else + { + aData->myMeshFileOut = ""; + } + + aData->myPublish = myArgs->publishOut->isChecked(); + + + aData->myUseLocalMap = myArgs->localButton->isChecked(); + aData->myUseBackgroundMap = myArgs->backgroundButton->isChecked(); + aData->myUseConstantValue = myArgs->constantButton->isChecked(); + if (aData->myUseConstantValue) + { + aData->myConstantValue = myArgs->dvalue->value(); + } + else + { + aData->myConstantValue = 0.0; + } + if (aData->myUseBackgroundMap) + { + aData->myFileSizeMapDir = myArgs->myFileSizeMapDir->toStdString(); + aData->myMeshFileBackground = myArgs->selectMedFileBackgroundLineEdit->text().toStdString(); + } + else + { + aData->myMeshFileBackground = ""; + } + + aData->myFieldName = myArgs->fieldNameCmb->currentText().toStdString(); + aData->myUseNoTimeStep = myArgs->noTimeStep->isChecked(); + aData->myUseLastTimeStep = myArgs->lastTimeStep->isChecked(); + aData->myUseChosenTimeStep = myArgs->chosenTimeStep->isChecked(); + if (aData->myUseChosenTimeStep) + { + aData->myRank = myArgs->rankSpinBox->value(); + aData->myTimeStep = myArgs->timeStep->value(); + + } + + + aData->myWorkingDir = myAdvOpt->workingDirectoryLineEdit->text().toStdString(); + aData->myPrintLogInFile = myAdvOpt->logInFileCheck->isChecked(); + aData->myVerboseLevel = myAdvOpt->verboseLevelSpin->value(); + aData->myRemoveLogOnSuccess = myAdvOpt->removeLogOnSuccessCheck->isChecked(); + aData->myKeepFiles = myAdvOpt->keepWorkingFilesCheck->isChecked(); + model->setData(aData); + QString msg; + checkParams(msg); + delete aData; + return ret; +} +bool SMESHGUI_MgAdaptDlg::storeParamsToHypo( const MgAdaptHypothesisData& ) const +{ + +} +/*! + \brief Show help page +*/ +void SMESHGUI_MgAdaptDlg::clickOnHelp() +{ + // QString aHelpFile; + // if ( myTabWidget->currentIndex() == MinDistance ) { + // aHelpFile = "measurements.html#min-distance-anchor"; + // } else if ( myTabWidget->currentIndex() == BoundingBox ) { + // aHelpFile = "measurements.html#bounding-box-anchor"; + // } else if ( myTabWidget->currentWidget() == myAngle ) { + // aHelpFile = "measurements.html#angle-anchor"; + // } else { + // aHelpFile = "measurements.html#basic-properties-anchor"; + // } + + // SMESH::ShowHelpFile( aHelpFile ); +} +bool SMESHGUI_MgAdaptDlg::checkParams(QString& msg) +{ + if ( !QFileInfo( myAdvOpt->workingDirectoryLineEdit->text().trimmed() ).isWritable() ) { + SUIT_MessageBox::warning( this, + tr( "SMESH_WRN_WARNING" ), + tr( "GHS3D_PERMISSION_DENIED" ) ); + return false; + } + + + myAdvOpt->myOptionTable->setFocus(); + QApplication::instance()->processEvents(); + + QString name, value; + bool isDefault, ok = true; + int iRow = 0, nbRows = myAdvOpt->myOptionTable->topLevelItemCount(); + for ( ; iRow < nbRows; ++iRow ) + { + QTreeWidgetItem* row = myAdvOpt->myOptionTable->topLevelItem( iRow ); + myAdvOpt->GetOptionAndValue( row, name, value, isDefault ); + + if ( name.simplified().isEmpty() ) + continue; // invalid custom option + + if ( isDefault ) // not selected option + value.clear(); + + try { + model->setOptionValue( name.toLatin1().constData(), value.toLatin1().constData() ); + } + catch ( const SALOME::SALOME_Exception& ex ) + { + msg = ex.details.text.in(); + ok = false; + break; + } + } + + + return ok; +} + +//================================================================================= +// function : SMESHGUI_MgAdaptArguments() +// purpose : +//================================================================================= +SMESHGUI_MgAdaptArguments::SMESHGUI_MgAdaptArguments( QWidget* parent ) + :QWidget(parent) +{ + + + myFileInDir = new QString(""); + myFileOutDir = new QString(""); + myFileSizeMapDir = new QString(""); + if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() ) + { + *myFileInDir = QDir::currentPath(); + *myFileOutDir = QDir::currentPath(); + *myFileSizeMapDir = QDir::currentPath(); + } + else + { + *myFileInDir = SUIT_FileDlg::getLastVisitedPath(); + *myFileOutDir = SUIT_FileDlg::getLastVisitedPath(); + *myFileSizeMapDir = SUIT_FileDlg::getLastVisitedPath(); + } + + + // Mesh in + aMeshIn = new QGroupBox( tr( "MeshIn" ), this ); + aMedfile = new QRadioButton( tr( "MEDFile" ), aMeshIn ); + aBrowser = new QRadioButton( tr( "Browser" ), aMeshIn ); + aBrowserObject = new QLineEdit( aMeshIn ); + selectMedFilebutton = new QPushButton("", aMeshIn); + selectMedFileLineEdit = new QLineEdit( aMeshIn ); + + meshIn = new QGridLayout( aMeshIn ); + + meshIn->setMargin( MARGIN ); + meshIn->setSpacing( SPACING ); + meshIn->addWidget( aMedfile, 0, 0, 1,1 ); + meshIn->addWidget( aBrowser, 0, 1,1,1); + meshIn->addWidget( aBrowserObject, 0, 2, 1, 1 ); + meshIn->addWidget( selectMedFilebutton, 1, 0,1, 1); + meshIn->addWidget( selectMedFileLineEdit, 1, 1, 1, 1 ); + hspacer = new QSpacerItem(188, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + meshInGroup = new QButtonGroup( this ); + meshInGroup->addButton( aMedfile, 0 ); + meshInGroup->addButton( aBrowser, 1 ); + + //Mesh out + + aMeshOut = new QGroupBox( tr( "MeshOut" ), this ); + meshName = new QLabel(tr("MeshName"), aMeshOut); + secondHspacer = new QSpacerItem(100, 30); + meshNameLineEdit = new QLineEdit(aMeshOut) ; + medFileCheckBox = new QCheckBox(tr("MEDFile"), aMeshOut); + selectOutMedFilebutton = new QPushButton("", aMeshOut); + thirdHspacer = new QSpacerItem(188, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + selectOutMedFileLineEdit = new QLineEdit(aMeshOut) ; + publishOut = new QCheckBox(tr("Publish_MG_ADAPT"), aMeshOut); + + meshOut = new QGridLayout( aMeshOut ); + + meshOut->setMargin( MARGIN ); + meshOut->setSpacing( SPACING ); + meshOut->addWidget( meshName, 0, 0, 1,1 ); + meshOut->addItem( secondHspacer, 0, 1, 1, 1 ); + meshOut->addWidget( meshNameLineEdit, 0, 2,1,1); + meshOut->addWidget( medFileCheckBox, 1, 0,1,1 ); + meshOut->addWidget( selectOutMedFilebutton, 1, 1,1,1 ); + meshOut->addWidget( selectOutMedFileLineEdit, 1, 2,1,1); + meshOut->addWidget( publishOut, 2, 0,1,1 ); + + //size map definition + + sizeMapDefinition = new QGroupBox(tr("SIZE_MAP_DEF"), this); + localButton = new QRadioButton(tr("LOCAL_MG_ADAPT"), sizeMapDefinition); + backgroundButton = new QRadioButton(tr("BACKGRND_MG_ADAPT"), sizeMapDefinition); + constantButton = new QRadioButton(tr("CNST_MG_ADAPT"), sizeMapDefinition); + medFileBackground = new QLabel(tr("MED_FILE_BCKG"), sizeMapDefinition); + selectMedFileBackgroundbutton = new QPushButton(tr(""), sizeMapDefinition); + selectMedFileBackgroundLineEdit = new QLineEdit(sizeMapDefinition); + valueLabel = new QLabel(tr("VALUE_MG_ADAPT"), sizeMapDefinition); + dvalue = new QDoubleSpinBox(sizeMapDefinition); + sizeMapDefGroup = new QButtonGroup( this ); + sizeMapDefGroup->addButton( localButton, 0 ); + sizeMapDefGroup->addButton( backgroundButton, 1 ); + sizeMapDefGroup->addButton( constantButton, 2 ); + + sizeMapDefGroupLayout = new QGridLayout(sizeMapDefinition); + sizeMapDefGroupLayout->addWidget(localButton, 0,0); + sizeMapDefGroupLayout->addWidget(backgroundButton, 0,1); + sizeMapDefGroupLayout->addWidget(constantButton, 0,2); + sizeMapDefGroupLayout->addWidget(medFileBackground, 1,0); + sizeMapDefGroupLayout->addWidget(selectMedFileBackgroundbutton, 1,1); + sizeMapDefGroupLayout->addWidget(selectMedFileBackgroundLineEdit, 1,2); + sizeMapDefGroupLayout->addWidget(valueLabel, 2,0); + sizeMapDefGroupLayout->addWidget(dvalue, 2,1); + + // size Map field + sizeMapField = new QGroupBox(tr("SIZE_MAP_FIELD"), this); + fieldName = new QLabel(tr("MG_ADAPT_FIELD_NAME"), sizeMapField); + fieldNameCmb = new QComboBox(sizeMapField); + noTimeStep = new QRadioButton(tr("MG_ADAPT_NO_T_ST"), sizeMapField); + lastTimeStep = new QRadioButton(tr("MG_ADAPT_L_ST"), sizeMapField); + chosenTimeStep = new QRadioButton(tr("MG_ADAPT_CH_ST"), sizeMapField); + timeStepLabel = new QLabel(tr("MG_ADAPT_TSTP"), sizeMapField); + timeStep = new QSpinBox(sizeMapField); + //~timeStep->setMinimum(-1); + rankLabel = new QLabel(tr("MG_ADAPT_RANK"), sizeMapField); + rankSpinBox = new QSpinBox(sizeMapField); + rankSpinBox->setMinimum(-1); + + timeStepGroup = new QButtonGroup(this); + timeStepGroup->addButton(noTimeStep, 0); + timeStepGroup->addButton(lastTimeStep, 1); + timeStepGroup->addButton(chosenTimeStep, 2); + + sizeMapFieldGroupLayout = new QGridLayout(sizeMapField); + + sizeMapFieldGroupLayout->addWidget(fieldName, 0,0); + sizeMapFieldGroupLayout->addWidget(fieldNameCmb, 0,1); + sizeMapFieldGroupLayout->addWidget(noTimeStep, 1,0); + sizeMapFieldGroupLayout->addWidget(lastTimeStep, 1,1); + sizeMapFieldGroupLayout->addWidget(chosenTimeStep, 1,2); + sizeMapFieldGroupLayout->addWidget(timeStepLabel, 2,0); + sizeMapFieldGroupLayout->addWidget(timeStep, 2,1); + sizeMapFieldGroupLayout->addWidget(rankLabel, 2,2); + sizeMapFieldGroupLayout->addWidget(rankSpinBox, 2,3); + + + QGridLayout* argumentsLayout = new QGridLayout( this ); + argumentsLayout->setMargin( MARGIN ); + argumentsLayout->setSpacing( SPACING ); + + argumentsLayout->addWidget( aMeshIn, 0, 0, 1, 3 ); + argumentsLayout->addWidget( aMeshOut, 1, 0, 1, 3 ); + argumentsLayout->addWidget( sizeMapDefinition, 2, 0, 1, 3 ); + argumentsLayout->addWidget( sizeMapField, 3, 0, 1, 3 ); + argumentsLayout->setColumnStretch( 1, 5 ); + argumentsLayout->setRowStretch( 4, 5 ); + + // Initial state + setMode( Mesh, Local); + medFileCheckBox->setChecked(true); + + // Connections + connect( meshInGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( modeChanged( int ) ) ); + connect( sizeMapDefGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( sizeMapDefChanged( int ) ) ); + connect( selectMedFilebutton, SIGNAL( pressed( ) ), this, SLOT( onSelectMedFilebuttonClicked( ) ) ); + connect(medFileCheckBox, SIGNAL (stateChanged(int)), this, SLOT(onMedFileCheckBox(int) ) ); + connect(publishOut, SIGNAL (stateChanged(int)), this, SLOT(onPublishOut(int) ) ); + connect(selectOutMedFilebutton, SIGNAL( pressed()), this, SLOT(onSelectOutMedFilebutton())); + connect(selectMedFileBackgroundbutton, SIGNAL(pressed()), this, SLOT(onSelectMedFileBackgroundbutton()) ); + connect( timeStepGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( timeStepGroupChanged( int ) ) ); + emit updateSelection(); +} + +//================================================================================= +// function : ~SMESHGUI_MgAdaptArguments() +// purpose : Destroys the object and frees any allocated resources +//================================================================================= +SMESHGUI_MgAdaptArguments::~SMESHGUI_MgAdaptArguments() +{ +} + +void SMESHGUI_MgAdaptArguments::onNoTimeStep(bool disableOther) +{ + noTimeStep->setChecked(true); + + rankLabel->setVisible(0); + rankSpinBox->setVisible(0); + rankSpinBox->setValue(-2); + + timeStepLabel->setVisible(0); + timeStep->setVisible(0); + timeStep->setValue(-2); + + lastTimeStep->setDisabled(disableOther); + chosenTimeStep->setDisabled(disableOther); + + +} +void SMESHGUI_MgAdaptArguments::onLastTimeStep(bool disableOther) +{ + lastTimeStep->setChecked(true); + + rankLabel->setVisible(0); + rankSpinBox->setVisible(0); + rankSpinBox->setValue(-1); + + timeStepLabel->setVisible(0); + timeStep->setVisible(0); + timeStep->setValue(-1); + noTimeStep->setDisabled(disableOther); +} + +void SMESHGUI_MgAdaptArguments::onChosenTimeStep(bool disableOther, int max) +{ + chosenTimeStep->setChecked(true); + + rankLabel->setVisible(1); + rankSpinBox->setVisible(1); + rankSpinBox->setValue(0); + + timeStepLabel->setVisible(1); + timeStep->setVisible(1); + timeStep->setValue(0); + if (max) timeStep->setMaximum(max); + +} + +void SMESHGUI_MgAdaptArguments::onSelectOutMedFilebutton() +{ + + QString filtre = QString("Med") ; + filtre += QString(" files (*.") + QString("med") + QString(");;"); + QString fileName = QFileDialog::getSaveFileName(this, tr("SAVE_MED"), + QString(""), filtre); + QFileInfo myFileInfo(fileName); + selectOutMedFileLineEdit->setText(myFileInfo.fileName()); + *myFileOutDir = myFileInfo.path(); + +} +void SMESHGUI_MgAdaptArguments::onSelectMedFileBackgroundbutton() +{ + QString fileName0 = selectMedFileBackgroundbutton->text().trimmed(); + + QString fileName = getMedFileName(false); + if (fileName != QString::null) + { + myFieldList = GetListeChamps(fileName); + if (myFieldList.empty()) + { + fileName = fileName0; + fieldNameCmb->clear(); + } + else + { + // fill field name Combobox + fieldNameCmb->clear(); + std::map::const_iterator it; + for ( it=myFieldList.begin() ; it != myFieldList.end(); it++) + { + fieldNameCmb->insertItem(0,QString(it->first)); + int typeStepInField = it->second > 2 ? 2 : it->second ; + timeStepGroupChanged(typeStepInField, true, it->second-1); + } + + } + + } + else + { + fileName = fileName0; + fieldNameCmb->clear(); + } + + QFileInfo myFileInfo(fileName); + *myFileSizeMapDir = myFileInfo.path(); + selectMedFileBackgroundLineEdit->setText(myFileInfo.fileName()); + +} +void SMESHGUI_MgAdaptArguments::onMedFileCheckBox(int state) +{ + if (state == Qt::Checked) + { + selectOutMedFilebutton->show(); + selectOutMedFileLineEdit->show(); + selectOutMedFilebutton->setEnabled(true); + selectOutMedFileLineEdit->setEnabled(true); + } + else + { + selectOutMedFilebutton->setEnabled(false); + selectOutMedFileLineEdit->setEnabled(false); + publishOut->setChecked(true); + } +} +void SMESHGUI_MgAdaptArguments::onPublishOut(int state) +{ + if (state == Qt::Unchecked) + { + medFileCheckBox->setChecked(true); + } +} + +void SMESHGUI_MgAdaptArguments::onSelectMedFilebuttonClicked() +{ + // bool keep = false; + QString fileName0 = selectMedFileLineEdit->text().trimmed(); + + QString fileName = getMedFileName(false); + if(fileName != QString::null) + { + QString aMeshName = lireNomMaillage(fileName.trimmed()); + if (aMeshName == QString::null ) + { + QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), + QObject::tr("MG_ADAPT_MED_FILE_2") ); + fileName = fileName0; + } + else + { + meshNameLineEdit->setText(aMeshName); + } + + } + else + { + return; + } + + + QFileInfo myFileInfo(fileName); + *myFileInDir = myFileInfo.path(); + *myFileOutDir = myFileInfo.path(); + selectMedFileLineEdit->setText(myFileInfo.fileName()); + selectOutMedFileLineEdit->setText(myFileInfo.fileName()); + onLocalSelected(myFileInfo.filePath()); + +} + +void SMESHGUI_MgAdaptArguments::onLocalSelected(QString filePath) +{ + myFieldList = GetListeChamps(filePath, false); + if (myFieldList.empty()) + { + if (localButton->isChecked()) + { + fieldNameCmb->clear(); + } + + } + else + { + // fill field name Combobox + fieldNameCmb->clear(); + std::map::const_iterator it; + for ( it=myFieldList.begin() ; it != myFieldList.end(); it++) + { + fieldNameCmb->insertItem(0,QString(it->first)); + int typeStepInField = it->second > 2 ? 2 : it->second ; + timeStepGroupChanged(typeStepInField, true, it->second-1); + } + + } +} +// ======================================================================= +// Gestion les boutons qui permettent de +// 1) retourne le nom d'un fichier par une fenetre de dialogue si aucun +// objet est selectionne dans l arbre d etude +// 2) retourne le nom du fichier asocie a l objet +// selectionne dans l arbre d etude +// ======================================================================= +QString SMESHGUI_MgAdaptArguments::getMedFileName(bool avertir) +{ + + QString aFile = QString::null; + QString filtre = QString("Med") ; + filtre += QString(" files (*.") + QString("med") + QString(");;"); + aFile = SUIT_FileDlg::getOpenFileName(0, QObject::tr("MG_ADAPT_SELECT_FILE_0"), QString(""), filtre ); + + return aFile; + +} +void SMESHGUI_MgAdaptArguments::setMode(const Mode theMode, const SIZEMAP theSizeMap ) +{ + QRadioButton* aButton = qobject_cast( meshInGroup->button( theMode ) ); + QRadioButton* bButton = qobject_cast( sizeMapDefGroup->button( theSizeMap ) ); + if ( aButton ) { + aButton->setChecked( true ); + modeChanged( theMode ); + } + if ( bButton ) { + bButton->setChecked( true ); + sizeMapDefChanged( theSizeMap ); + } +} + +void SMESHGUI_MgAdaptArguments::modeChanged( int theMode ) +{ + clear(); + if(theMode == Mesh) + { + aBrowserObject->hide(); + selectMedFileLineEdit->show(); + selectMedFilebutton->show(); + localButton->setEnabled(true); + } + else + { + selectMedFileLineEdit->hide(); + selectMedFilebutton->hide(); + localButton->setEnabled(false); + aBrowserObject->show(); + sizeMapDefChanged(Background); + emit updateSelection(); + } + + + +} + +void SMESHGUI_MgAdaptArguments::sizeMapDefChanged( int theSizeMap ) +{ + fieldNameCmb->clear(); + if(theSizeMap == Local) + { + localButton->setEnabled(true); + localButton->setChecked(true); + medFileBackground->hide(); + selectMedFileBackgroundbutton->hide(); + selectMedFileBackgroundLineEdit->hide(); + selectMedFileBackgroundLineEdit->clear(); + valueLabel->hide(); + dvalue->hide(); + + sizeMapField->setEnabled(true); + if (!selectMedFileLineEdit->text().isEmpty()) + { + QFileInfo myFileInfo(QDir(*myFileInDir), selectMedFileLineEdit->text()); + onLocalSelected(myFileInfo.filePath()); + } + } + else if (theSizeMap == Background) + { + medFileBackground->show(); + backgroundButton->setChecked(true); + selectMedFileBackgroundbutton->show(); + selectMedFileBackgroundLineEdit->show(); + valueLabel->hide(); + dvalue->hide(); + sizeMapField->setEnabled(true); + + } + else + { + medFileBackground->hide(); + constantButton->setChecked(true); + selectMedFileBackgroundbutton->hide(); + selectMedFileBackgroundLineEdit->clear(); + selectMedFileBackgroundLineEdit->hide(); + valueLabel->show(); + dvalue->show(); + sizeMapField->setEnabled(false); + + } + + +} +void SMESHGUI_MgAdaptArguments::timeStepGroupChanged(int timeStepType, bool disableOther, int max) +{ + switch (timeStepType) + { + case 0 : + onNoTimeStep(disableOther); + break; + case 1 : + onLastTimeStep(disableOther); + break; + case 2 : + onChosenTimeStep(disableOther, max); + default: + break; + } +} + +void SMESHGUI_MgAdaptArguments::clear() +{ + selectMedFileLineEdit->clear(); + aBrowserObject->clear(); + + meshNameLineEdit->clear(); + selectOutMedFileLineEdit->clear(); +} + +QWidget* ItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &o, const QModelIndex &index) const +{ + bool editable = index.data( EDITABLE_ROLE ).toInt(); + return editable ? QItemDelegate::createEditor( parent, o, index ) : 0; +} + +////////////////////////////////////////// +// MgAdaptAdvWidget +////////////////////////////////////////// + +MgAdaptAdvWidget::MgAdaptAdvWidget( QWidget* parent, std::vector * options, Qt::WindowFlags f ) + : QWidget( parent, f ), myOptions(options) +{ + setupWidget(); + myOptionTable->header()->setSectionResizeMode( QHeaderView::ResizeToContents ); + myOptionTable->setItemDelegate( new ItemDelegate( myOptionTable ) ); + + for ( int i = 0, nb = myOptions->size(); i < nb; ++i ) + { + AddOption( (*myOptions)[i].c_str() ); + } + + connect( myOptionTable, SIGNAL( itemChanged(QTreeWidgetItem *, int)), SLOT( itemChanged(QTreeWidgetItem *, int ))); + connect( addBtn, SIGNAL( clicked() ), this, SLOT( onAddOption() ) ); +} + +MgAdaptAdvWidget::~MgAdaptAdvWidget() +{ +} + +void MgAdaptAdvWidget::AddOption( const char* option, bool isCustom ) +{ + QTreeWidget * table = myOptionTable; + //table->setExpanded( true ); + + QTreeWidgetItem * row = new QTreeWidgetItem( table ); + row->setData( NAME_COL, EDITABLE_ROLE, int( isCustom && !option )); + row->setFlags( row->flags() | Qt::ItemIsEditable ); + + QString name, value; + bool isDefault = false; + if ( option ) + { + QStringList name_value_type = QString(option).split( ":", QString::KeepEmptyParts ); + if ( name_value_type.size() > 0 ) + name = name_value_type[0]; + if ( name_value_type.size() > 1 ) + value = name_value_type[1]; + if ( name_value_type.size() > 2 ) + isDefault = !name_value_type[2].toInt(); + + } + row->setText( 0, tr( name.toLatin1().constData() )); + row->setText( 1, tr( value.toLatin1().constData() )); + row->setCheckState( 0, isDefault ? Qt::Unchecked : Qt::Checked); + row->setData( NAME_COL, PARAM_NAME, name ); + + if ( isCustom ) + { + myOptionTable->scrollToItem( row ); + myOptionTable->setCurrentItem( row ); + myOptionTable->editItem( row, NAME_COL ); + } +} +void MgAdaptAdvWidget::onAddOption() +{ + AddOption( NULL, true ); +} +void MgAdaptAdvWidget::GetOptionAndValue( QTreeWidgetItem * tblRow, + QString& option, + QString& value, + bool& isDefault) +{ + option = tblRow->data( NAME_COL, PARAM_NAME ).toString(); + value = tblRow->text( VALUE_COL ); + isDefault = ! tblRow->checkState( NAME_COL ); + +} + + +void MgAdaptAdvWidget::itemChanged(QTreeWidgetItem * tblRow, int column) +{ + if ( tblRow ) + { + myOptionTable->blockSignals( true ); + + tblRow->setData( VALUE_COL, EDITABLE_ROLE, int( tblRow->checkState( NAME_COL ))); + + int c = tblRow->checkState( NAME_COL ) ? 0 : 150; + tblRow->setForeground( VALUE_COL, QBrush( QColor( c, c, c ))); + + if ( column == NAME_COL && tblRow->data( NAME_COL, EDITABLE_ROLE ).toInt() ) // custom table + { + tblRow->setData( NAME_COL, PARAM_NAME, tblRow->text( NAME_COL )); + } + + myOptionTable->blockSignals( false ); + } +} +void MgAdaptAdvWidget::setupWidget() +{ + if (this->objectName().isEmpty()) + this->setObjectName(QString(tr("MG-ADAPT-ADV"))); + this->resize(337, 369); + gridLayout_4 = new QGridLayout(this); + gridLayout_4->setObjectName(QString("gridLayout_4")); + myOptionTable = new MgAdaptAdvWidgetTreeWidget(this); + QFont font; + font.setBold(false); + font.setWeight(50); + QTreeWidgetItem *__qtreewidgetitem = new QTreeWidgetItem(); + __qtreewidgetitem->setFont(1, font); + __qtreewidgetitem->setFont(0, font); + __qtreewidgetitem->setText(1, tr("OPTION_VALUE_COLUMN")); + __qtreewidgetitem->setText(0, tr("OPTION_NAME_COLUMN")); + myOptionTable->setHeaderItem(__qtreewidgetitem); + myOptionTable->setObjectName(QString("myOptionTable")); + myOptionTable->setEditTriggers(QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed); + myOptionTable->setTabKeyNavigation(true); + + gridLayout_4->addWidget(myOptionTable, 0, 0, 1, 2); + + addBtn = new QPushButton(this); + addBtn->setObjectName(QString("addBtn")); + + gridLayout_4->addWidget(addBtn, 1, 0, 1, 1); + + horizontalSpacer = new QSpacerItem(188, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout_4->addItem(horizontalSpacer, 1, 1, 1, 1); + + logGroupBox = new QGroupBox(this); + logGroupBox->setObjectName(QString("logGroupBox")); + gridLayout_2 = new QGridLayout(logGroupBox); + gridLayout_2->setObjectName(QString("gridLayout_2")); + gridLayout = new QGridLayout(); + gridLayout->setObjectName(QString("gridLayout")); + workingDirectoryLabel = new QLabel(logGroupBox); + workingDirectoryLabel->setObjectName(QString("workingDirectoryLabel")); + + gridLayout->addWidget(workingDirectoryLabel, 0, 0, 1, 1); + + workingDirectoryLineEdit = new QLineEdit(logGroupBox); + workingDirectoryLineEdit->setObjectName(QString("workingDirectoryLineEdit")); + + gridLayout->addWidget(workingDirectoryLineEdit, 0, 1, 1, 1); + + workingDirectoryPushButton = new QPushButton(logGroupBox); + workingDirectoryPushButton->setObjectName(QString("workingDirectoryPushButton")); + + gridLayout->addWidget(workingDirectoryPushButton, 0, 2, 1, 1); + + verboseLevelLabel = new QLabel(logGroupBox); + verboseLevelLabel->setObjectName(QString("verboseLevelLabel")); + + gridLayout->addWidget(verboseLevelLabel, 1, 0, 1, 1); + + verboseLevelSpin = new QSpinBox(logGroupBox); + verboseLevelSpin->setObjectName(QString("verboseLevelSpin")); + + gridLayout->addWidget(verboseLevelSpin, 1, 1, 1, 1); + + + gridLayout_2->addLayout(gridLayout, 0, 0, 1, 1); + + horizontalLayout = new QHBoxLayout(); + horizontalLayout->setObjectName(QString("horizontalLayout")); + logInFileCheck = new QCheckBox(logGroupBox); + logInFileCheck->setObjectName(QString("logInFileCheck")); + logInFileCheck->setChecked(true); + + horizontalLayout->addWidget(logInFileCheck); + + removeLogOnSuccessCheck = new QCheckBox(logGroupBox); + removeLogOnSuccessCheck->setObjectName(QString("removeLogOnSuccessCheck")); + removeLogOnSuccessCheck->setChecked(true); + + horizontalLayout->addWidget(removeLogOnSuccessCheck); + + + gridLayout_2->addLayout(horizontalLayout, 1, 0, 1, 1); + + keepWorkingFilesCheck = new QCheckBox(logGroupBox); + keepWorkingFilesCheck->setObjectName(QString("keepWorkingFilesCheck")); + keepWorkingFilesCheck->setAutoExclusive(false); + + gridLayout_2->addWidget(keepWorkingFilesCheck, 2, 0, 1, 1); + + + gridLayout_4->addWidget(logGroupBox, 3, 0, 1, 2); + + + // retranslateUi(this); + + // QMetaObject::connectSlotsByName(this); + +} + +namespace +{ +bool isEditable( const QModelIndex& index ) +{ + return index.isValid() && + index.flags() & Qt::ItemIsEditable && + index.flags() & Qt::ItemIsEnabled && + ( !index.data( Qt::UserRole + 1 ).isValid() || index.data( Qt::UserRole + 1 ).toInt() != 0 ); +} +} + +MgAdaptAdvWidgetTreeWidget::MgAdaptAdvWidgetTreeWidget( QWidget* parent ) + : QTreeWidget( parent ) +{ +} + +QModelIndex MgAdaptAdvWidgetTreeWidget::moveCursor( CursorAction action, Qt::KeyboardModifiers modifiers ) +{ + QModelIndex current = currentIndex(); + int column = current.column(); + if ( action == MoveNext ) { + if ( column < columnCount()-1 ) { + QModelIndex next = current.sibling( current.row(), column+1 ); + if ( isEditable( next ) ) + return next; + } + else { + QModelIndex next = current.sibling( current.row()+1, 0 ); + if ( isEditable( next ) ) + return next; + } + } + else if ( action == MovePrevious ) { + if ( column == 0 ) { + QModelIndex next = current.sibling( current.row()-1, columnCount()-1 ); + if ( isEditable( next ) ) + return next; + } + else { + QModelIndex next = current.sibling( current.row(), column-1 ); + if ( isEditable( next ) ) + return next; + } + } + return QTreeWidget::moveCursor( action, modifiers ); +} + +void MgAdaptAdvWidgetTreeWidget::keyPressEvent( QKeyEvent* e ) +{ + switch ( e->key() ) { + case Qt::Key_F2: + { + QModelIndex index = currentIndex(); + if ( !isEditable( index ) ) { + for ( int i = 0; i < columnCount(); i++ ) { + QModelIndex sibling = index.sibling( index.row(), i ); + if ( isEditable( sibling ) ) { + if ( !edit( sibling, EditKeyPressed, e ) ) + e->ignore(); + } + } + } + } + break; + default: + break; + } + QTreeWidget::keyPressEvent( e ); +} + + +// ======================================================================= +// renvoie le medId associe au fichier Med apres ouverture +// ======================================================================= +med_idt OuvrirFichier(QString aFile) +{ + med_idt medIdt = MEDfileOpen(aFile.toStdString().c_str(),MED_ACC_RDONLY); + if (medIdt <0) + { + QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), + QObject::tr("MG_ADAPT_MED_FILE_1") ); + } + return medIdt; +} + +// ====================================================== +// ======================================================== +QString lireNomMaillage(QString aFile) +{ + QString nomMaillage = QString::null ; + int erreur = 0 ; + med_idt medIdt ; + + // Ouverture du fichier + medIdt = OuvrirFichier(aFile); + if ( medIdt < 0 ) + { + erreur = 1 ; + return nomMaillage; + } + med_int numberOfMeshes = MEDnMesh(medIdt) ; + if (numberOfMeshes == 0 ) + { + QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), + QObject::tr("MG_ADAPT_MED_FILE_2") ); + erreur = 2 ; + return nomMaillage; + } + if (numberOfMeshes > 1 ) + { + QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), + QObject::tr("MG_ADAPT_MED_FILE_3") ); + erreur = 3 ; + return nomMaillage; + } + + nomMaillage = lireNomMaillage2(medIdt,1); + // Fermeture du fichier + if ( medIdt > 0 ) MEDfileClose(medIdt); + + return nomMaillage; +} + +// ======================================================================= +// ======================================================================= +QString lireNomMaillage2(med_idt medIdt,int meshId) +{ + QString NomMaillage=QString::null; + char meshname[MED_NAME_SIZE+1]; + med_int spacedim,meshdim; + med_mesh_type meshtype; + char descriptionription[MED_COMMENT_SIZE+1]; + char dtunit[MED_SNAME_SIZE+1]; + med_sorting_type sortingtype; + med_int nstep; + med_axis_type axistype; + int naxis = MEDmeshnAxis(medIdt,1); + char *axisname=new char[naxis*MED_SNAME_SIZE+1]; + char *axisunit=new char[naxis*MED_SNAME_SIZE+1]; + med_err aRet = MEDmeshInfo(medIdt, + meshId, + meshname, + &spacedim, + &meshdim, + &meshtype, + descriptionription, + dtunit, + &sortingtype, + &nstep, + &axistype, + axisname, + axisunit); + + if ( aRet < 0 ) { + QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), \ + QObject::tr("MG_ADAPT_MED_FILE_4") ); + } + else { + NomMaillage=QString(meshname); + } + + delete[] axisname ; + delete[] axisunit ; + + return NomMaillage; +} + + + +// ======================================================================= +std::map GetListeChamps(QString aFile, bool errorMessage) +// ======================================================================= +{ +// Il faut voir si plusieurs maillages + + MESSAGE("GetListeChamps"); + std::map ListeChamp ; + + med_err erreur = 0 ; + med_idt medIdt ; + + while ( erreur == 0 ) + { + // Ouverture du fichier + SCRUTE(aFile.toStdString()); + medIdt = OuvrirFichier(aFile); + if ( medIdt < 0 ) + { + erreur = 1 ; + break ; + } + // Lecture du nombre de champs + med_int ncha = MEDnField(medIdt) ; + if (ncha < 1 ) + { + if(errorMessage) + { + QMessageBox::critical( 0, QObject::tr("_ERROR"), + QObject::tr("HOM_MED_FILE_5") ); + } + erreur = 2 ; + break ; + } + // Lecture des caracteristiques des champs + for (int i=0; i< ncha; i++) + { +// Lecture du nombre de composantes + med_int ncomp = MEDfieldnComponent(medIdt,i+1); +// Lecture du type du champ, des noms des composantes et du nom de l'unite + char nomcha [MED_NAME_SIZE+1]; + char meshname[MED_NAME_SIZE+1]; + char * comp = (char*) malloc(ncomp*MED_SNAME_SIZE+1); + char * unit = (char*) malloc(ncomp*MED_SNAME_SIZE+1); + char dtunit[MED_SNAME_SIZE+1]; + med_bool local; + med_field_type typcha; + med_int nbofcstp; + erreur = MEDfieldInfo(medIdt,i+1,nomcha,meshname,&local,&typcha,comp,unit,dtunit,&nbofcstp) ; + free(comp); + free(unit); + if ( erreur < 0 ) + { + if(errorMessage) + { + QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), + QObject::tr("MG_ADAPT_MED_FILE_6") ); + } + break ; + } + + ListeChamp.insert(std::pair (QString(nomcha), nbofcstp)); + + } + break ; + } + // Fermeture du fichier + if ( medIdt > 0 ) MEDfileClose(medIdt); + + return ListeChamp; +} + + + + diff --git a/src/SMESHGUI/MG_ADAPTGUI.hxx b/src/SMESHGUI/MG_ADAPTGUI.hxx new file mode 100644 index 000000000..db4012425 --- /dev/null +++ b/src/SMESHGUI/MG_ADAPTGUI.hxx @@ -0,0 +1,312 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// SMESH SMESHGUI : GUI for the adaptation in the SMESH component +// File : MG_ADAPTGUI.hxx +// +#ifndef MG_ADAPTGUI_HXX +#define MG_ADAPTGUI_HXX + +#include +// SMESH includes + +// Qt includes +#include +#include +#include + +#include "LightApp_DataOwner.h" +#include "SalomeApp_Application.h" +#include +#include +#include "SalomeApp_Module.h" +#include "SalomeApp_Study.h" +#include +#include + + +// model + + +#include "MG_ADAPT.hxx" + +class SUIT_ViewWindow; +class SUIT_Desktop; +class SUIT_Study; +class SUIT_ResourceMgr; + +class CAM_Module; + +class SALOMEDSClient_Study; +class SALOMEDSClient_SObject; + +class SalomeApp_Study; +class SalomeApp_Module; +class LightApp_SelectionMgr; + + +class QButtonGroup; +class QLineEdit; +class QGroupBox; +class QRadioButton; +class QLabel; +class QCheckBox; +class QGridLayout; +class QTabWidget; +class QDoubleSpinBox; +class QSpinBox; +class QTreeWidget; +class QTreeWidgetItem; +class QSpacerItem; +class QHBoxLayout; +class QItemDelegate; +class QComboBox; + +// IDL includes +#include + +class SVTK_ViewWindow; +class SVTK_Selector; +class SMESHGUI_MgAdaptDlg; +class SMESHGUI_MgAdaptArguments; +class SMESHGUI_SpinBox; +class MgAdaptAdvWidgetTreeWidget; +class MgAdaptAdvWidget; +class MgAdapt; +class QHeaderView; +class QFileDialog; + + +std::map GetListeChamps(QString aFile, bool errorMessage = true); +QString lireNomMaillage(QString aFile); +QString lireNomMaillage2(med_idt medIdt,int meshId); +med_idt OuvrirFichier(QString aFile); + +//================================================================================= +// class : SMESHGUI_MgAdaptDlg +// purpose : +//================================================================================= +class SMESHGUI_MgAdaptDlg : public QDialog +{ + Q_OBJECT; +public: + //! Property type + enum Mode { Arguments, AdvancedOptions}; + SMESHGUI_MgAdaptDlg( SalomeApp_Module*, MgAdapt*, QWidget* parent= 0,bool isCreation = true ); + ~SMESHGUI_MgAdaptDlg(); + + void buildDlg(); + void reject(); + bool checkParams(QString& msg) ; + void setModel(MgAdapt*); + MgAdapt* getModel() const; + +public slots: + +protected slots: + + virtual bool clickOnApply(); +private slots: + virtual void clickOnHelp(); + virtual void clickOnOk(); +protected : + + SMESHGUI_MgAdaptArguments* myArgs; + MgAdaptAdvWidget* myAdvOpt; + bool readParamsFromHypo( ) const ; + bool readParamsFromWidgets( ) ; + bool storeParamsToHypo( const MgAdaptHypothesisData& ) const; + +private: + + + SalomeApp_Module* mySMESHGUI; /* Current SMESHGUI object */ + QTabWidget* myTabWidget; + + + MgAdaptHypothesisData* myData; + MgAdapt* model; + +}; + +class SMESHGUI_MgAdaptArguments : public QWidget +{ + Q_OBJECT; +public: + //! Property type + enum Mode { Mesh, Browser}; + enum SIZEMAP { Local, Background, Constant}; + SMESHGUI_MgAdaptArguments( QWidget* parent); + ~SMESHGUI_MgAdaptArguments(); + void setMode( const Mode, const SIZEMAP ); + + QString* myFileInDir; + QString* myFileOutDir; + QString* myFileSizeMapDir; + QGroupBox* aMeshIn ; + QRadioButton* aMedfile; + QRadioButton* aBrowser ; + QLineEdit* aBrowserObject; + QPushButton* selectMedFilebutton ; + QSpacerItem* hspacer; + QLineEdit* selectMedFileLineEdit ; + QButtonGroup* meshInGroup ; + QGridLayout* meshIn ; + + QGroupBox* aMeshOut ; + QLabel* meshName; + QLineEdit* meshNameLineEdit; + QSpacerItem* secondHspacer; + QCheckBox* medFileCheckBox; + QPushButton* selectOutMedFilebutton; + QLineEdit* selectOutMedFileLineEdit; + QSpacerItem* thirdHspacer; + QCheckBox* publishOut; + QGridLayout* meshOut ; + + QGroupBox* sizeMapDefinition ; + QRadioButton* localButton; + QRadioButton* backgroundButton ; + QRadioButton* constantButton ; + QLabel* medFileBackground; + QPushButton* selectMedFileBackgroundbutton; + QLineEdit* selectMedFileBackgroundLineEdit; + QLabel* valueLabel; + QDoubleSpinBox* dvalue; + QButtonGroup* sizeMapDefGroup ; + QGridLayout* sizeMapDefGroupLayout; + + + QGroupBox* sizeMapField; + QLabel* fieldName; + QComboBox* fieldNameCmb; + QRadioButton* noTimeStep; + QRadioButton* lastTimeStep ; + QRadioButton* chosenTimeStep; + QLabel* timeStepLabel; + QSpinBox* timeStep; + QLabel* rankLabel; + QSpinBox* rankSpinBox; + QButtonGroup* timeStepGroup; + QGridLayout* sizeMapFieldGroupLayout; + +signals: + void updateSelection(); + void toExportMED(const char *); +public slots: + +protected slots: + +private slots: + void modeChanged( int); + void sizeMapDefChanged(int); + void timeStepGroupChanged(int timeStepType, bool disableOther = false, int max = 0); + void onSelectMedFilebuttonClicked(); + void clear(); + void onMedFileCheckBox(int); + void onPublishOut(int); + void onSelectOutMedFilebutton(); + void onSelectMedFileBackgroundbutton(); + void onLocalSelected(QString); + void onNoTimeStep(bool disableOther = false); + void onLastTimeStep(bool disableOther = false); + void onChosenTimeStep(bool disableOther = false, int max = 0); + +private: + + QString getMedFileName(bool avertir); + LightApp_SelectionMgr* selMgr ; + + std::map myFieldList; + + +}; +enum { + OPTION_ID_COLUMN = 0, + OPTION_TYPE_COLUMN, + OPTION_NAME_COLUMN = 0, + OPTION_VALUE_COLUMN, + NB_COLUMNS, +}; + +////////////////////////////////////////// +// MgAdaptAdvWidget +////////////////////////////////////////// +class MgAdaptAdvWidget : public QWidget +{ + Q_OBJECT + +public: + MgAdaptAdvWidget( QWidget* = 0, std::vector * = nullptr, Qt::WindowFlags = 0 ); + ~MgAdaptAdvWidget(); + std::vector < std::string > * myOptions; + QGridLayout *gridLayout_4; + MgAdaptAdvWidgetTreeWidget *myOptionTable; + QPushButton *addBtn; + QSpacerItem *horizontalSpacer; + QGroupBox *logGroupBox; + QGridLayout *gridLayout_2; + QGridLayout *gridLayout; + QLabel *workingDirectoryLabel; + QLineEdit *workingDirectoryLineEdit; + QPushButton *workingDirectoryPushButton; + QLabel *verboseLevelLabel; + QSpinBox *verboseLevelSpin; + QHBoxLayout *horizontalLayout; + QCheckBox *logInFileCheck; + QCheckBox *removeLogOnSuccessCheck; + QCheckBox *keepWorkingFilesCheck; + + void AddOption( const char* name_value_type, bool isCustom = false ); + void GetOptionAndValue( QTreeWidgetItem * tblRow, QString& option, QString& value, bool& dflt ); + void setupWidget(); +public slots: + + void onAddOption(); + void itemChanged(QTreeWidgetItem * tblRow, int column); + +}; + +enum { EDITABLE_ROLE = Qt::UserRole + 1, PARAM_NAME, + NAME_COL = 0, VALUE_COL + }; + + + +class ItemDelegate: public QItemDelegate +{ +public: + + ItemDelegate(QObject* parent=0): QItemDelegate(parent) {} + QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &o, const QModelIndex &index) const; +}; + +class MgAdaptAdvWidgetTreeWidget : public QTreeWidget +{ + Q_OBJECT +public: + MgAdaptAdvWidgetTreeWidget( QWidget* ); + +protected: + QModelIndex moveCursor( CursorAction, Qt::KeyboardModifiers ); + void keyPressEvent( QKeyEvent* ); +}; + + +#endif // MG_ADAPTGUI_HXX diff --git a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx new file mode 100644 index 000000000..1e732a8a0 --- /dev/null +++ b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx @@ -0,0 +1,771 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : SMESHGUI_MG_ADAPTDRIVER.cxx + +#include "SMESHGUI_MG_ADAPTDRIVER.h" + +#include "SUIT_Desktop.h" +#include "SUIT_Application.h" +#include "SUIT_Session.h" + +#include "SalomeApp_Application.h" +#include "SalomeApp_Module.h" +#include "SalomeApp_Study.h" + +#include "SMESH_Comment.hxx" +#include "SMESH_Actor.h" +#include "SMESHGUI.h" +#include "SMESHGUI_FilterDlg.h" +#include "SMESHGUI_Selection.h" +#include +#include "SMESHGUI_IdValidator.h" +#include "SMESHGUI_Utils.h" +#include "SMESHGUI_MeshEditPreview.h" +#include "SMESHGUI_VTKUtils.h" +#include +#include +#include +#include +#include +#include "SMESHGUI_SpinBox.h" + +#include +#include +#include +#include +#include +#include +#include "SMESHGUI_MeshUtils.h" + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +// SALOME KERNEL includes +#include +#include +#include +#include +#include "SalomeApp_Tools.h" +#include +#include +#include + +#include + +const int SPACING = 6; // layout spacing +const int MARGIN = 9; // layout margin + +SALOME_ListIO mySelected; + + +//================================================================ +// Function : firstIObject +// Purpose : Return the first selected object in the selected object list +//================================================================ +Handle(SALOME_InteractiveObject) firstIObject() +{ + const SALOME_ListIO& aList = selectedIO(); + return aList.Extent() > 0 ? aList.First() : Handle(SALOME_InteractiveObject)(); +} +//================================================================ +// Function : selectedIO +// Return the list of selected SALOME_InteractiveObject's +//================================================================ +const SALOME_ListIO& selectedIO() +{ + SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* > ( SUIT_Session::session()->activeApplication() ); + LightApp_SelectionMgr* aSelectionMgr = app->selectionMgr(); + if( aSelectionMgr ) + { + aSelectionMgr->selectedObjects( mySelected ); + for (SALOME_ListIteratorOfListIO it (mySelected); it.More(); it.Next()) + SCRUTE(it.Value()->getEntry()); + }; + return mySelected; +} +//================================================================ +// Function : getStudy +// Returne un pointeur sur l'etude active +//================================================================ +_PTR(Study) getStudy() +{ + static _PTR(Study) _study; + if(!_study) + _study = SalomeApp_Application::getStudy(); + return _study; +} + +bool createAndPublishMed(QString fileName) +{ + + SMESH::DriverMED_ReadStatus res; + SMESH::mesh_array_var aMeshes = new SMESH::mesh_array; + // SMESHGUI aGui; + + aMeshes = SMESHGUI::GetSMESHGen()->CreateMeshesFromMED( fileName.toUtf8().constData(), res ); + _PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshes[0] ); + _PTR(Study) aStudy = SMESH::getStudy(); + QStringList anEntryList; + // bool isEmpty; + if ( aMeshSO ) { + _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder(); + _PTR(AttributePixMap) aPixmap = aBuilder->FindOrCreateAttribute( aMeshSO, "AttributePixMap" ); + aPixmap->SetPixMap( "ICON_SMESH_TREE_MESH_IMPORTED" ); + anEntryList.append( aMeshSO->GetID().c_str() ); + } + else { + // isEmpty = true; + return false; + } + SMESHGUI::GetSMESHGUI()->updateObjBrowser(); + + // browse to the published meshes + if( LightApp_Application* anApp = + dynamic_cast( SUIT_Session::session()->activeApplication() ) ) + anApp->browseObjects( anEntryList ); + return true; +} +bool createMgAdaptObject(MgAdapt *myMgAdapt ) +{ + // SMESH::SMESH_Mesh_var newMesh = SMESHGUI::GetSMESHGen()->CreateEmptyMesh(); + + // _PTR(SObject) aHypothesis; + _PTR(Study) aStudy = SMESH::getStudy(); + QStringList anEntryList; + _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder(); + _PTR(SComponent) mgadapt = aStudy->FindComponent("MG-ADAPT"); + _PTR(GenericAttribute) ga; + if (!aBuilder->FindAttribute(mgadapt, ga, "AttributeName") ) + { + mgadapt = aBuilder->NewComponent("MG-ADAPT"); + _PTR(AttributeName) Name = aBuilder->FindOrCreateAttribute(mgadapt, "AttributeName"); + Name->SetValue("MG-ADAPT"); + _PTR(AttributePixMap) myPixmap = aBuilder->FindOrCreateAttribute( mgadapt, "AttributePixMap" ); + myPixmap->SetPixMap( "ICON_MG_ADAPT" ); + anEntryList.append( mgadapt->GetID().c_str() ); + } + + _PTR(SObject) obj = aBuilder->NewObject(mgadapt); + _PTR(AttributeName) myName = aBuilder->FindOrCreateAttribute(obj, "AttributeName"); + myName->SetValue("hypo"); + _PTR(AttributePixMap) aPixmap = aBuilder->FindOrCreateAttribute( obj, "AttributePixMap" ); + aPixmap->SetPixMap( "ICON_SMESH_TREE_HYPO" ); + anEntryList.append( obj->GetID().c_str() ); + + SMESHGUI::GetSMESHGUI()->updateObjBrowser(); + + // // browse to the published meshes + if( LightApp_Application* anApp = + dynamic_cast( SUIT_Session::session()->activeApplication() ) ) + anApp->browseObjects( anEntryList ); + return true; +} + + +// MG ADAPT UTILS +//================================================================ +// Function : IObjectCount +// Return the number of selected objects +//================================================================ +int IObjectCount() +{ + SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); + LightApp_SelectionMgr* aSelectionMgr = app->selectionMgr(); + if( aSelectionMgr ) + { + aSelectionMgr->selectedObjects( mySelected ); + SCRUTE(mySelected.Extent()); + return mySelected.Extent(); + } + return 0; +} + + +SMESHGUI_MG_AdaptComputeDlg_QThread::SMESHGUI_MG_AdaptComputeDlg_QThread(MgAdapt* aModel) +{ + model = aModel; + myResult = -1; +} + +void SMESHGUI_MG_AdaptComputeDlg_QThread::run() +{ + + int err; + std::string errStr; + errStr = model->compute(errStr); + std::string msg = err == 0 ? " ok" : std::string("Not ok \n")+ errStr; + exec(); +} + +int SMESHGUI_MG_AdaptComputeDlg_QThread::result() +{ + return myResult; +} + +void SMESHGUI_MG_AdaptComputeDlg_QThread::cancel() +{ + //~model->cancel(); +} + +SMESHGUI_MG_ADAPTDRIVER::SMESHGUI_MG_ADAPTDRIVER( SMESHGUI* theModule, MgAdapt* myModel, bool isCreation ) + : mySMESHGUI( theModule ), + myFilterDlg(0), + myIsApplyAndClose( false ), + SMESHGUI_MgAdaptDlg((SalomeApp_Module*)theModule, myModel, SMESHGUI::desktop(), isCreation) +{ + + resMgr = resourceMgr(); + + selMgr = selectionMgr(); + + // connections + connect(myArgs, SIGNAL(updateSelection()), this, SLOT(updateSelection())); + connect(myArgs, SIGNAL(toExportMED(const char*)), this, SLOT(exportMED(const char*))); +} + +SUIT_ResourceMgr* SMESHGUI_MG_ADAPTDRIVER::resourceMgr() +{ + return dynamic_cast( SUIT_Session::session()->resourceMgr() ); +} + +LightApp_SelectionMgr* SMESHGUI_MG_ADAPTDRIVER::selectionMgr() +{ + SalomeApp_Application* anApp = dynamic_cast( SUIT_Session::session()->activeApplication() ); + if( anApp ) + return dynamic_cast( anApp->selectionMgr() ); + else + return 0; +} + +void SMESHGUI_MG_ADAPTDRIVER::updateSelection() +{ + disconnect( selMgr, 0, this, 0 ); + selMgr->clearFilters(); + + SMESH::SetPointRepresentation( true ); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() ) + aViewWindow->SetSelectionMode( ActorSelection ); + if (myArgs->aBrowser->isChecked()) + { + connect( selMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( selectionChanged() )); + selectionChanged(); + } + +} +void SMESHGUI_MG_ADAPTDRIVER::selectionChanged() +{ + //~ get selected mesh + SALOME_ListIO aList; + selMgr->selectedObjects(aList); + QString aString = ""; + int nbSel = aList.Extent(); + if (nbSel != 1) + return; + + Handle(SALOME_InteractiveObject) IO = aList.First(); + SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO(IO); + if ( !mesh->_is_nil() ) + { + myMesh = mesh; + + mySelectedObject = SMESH::IObjectToInterface( IO ); + if ( mySelectedObject->_is_nil() ) + return; + + } + else + return; + + SMESH::GetNameOfSelectedIObjects( selMgr, aString ); + if ( aString.isEmpty() ) aString = " "; + else aString = aString.trimmed(); + + + bool ok = !aString.isEmpty(); + if ( !mesh->_is_nil() ) + { + myArgs->aBrowserObject->setText( aString ); + myArgs->meshNameLineEdit->setText( aString ); + myArgs->selectOutMedFileLineEdit->setText(aString+QString(".med")); + } + +} +void SMESHGUI_MG_ADAPTDRIVER::exportMED(const char* tmp_file) +{ + bool toOverwrite = true; + bool toFindOutDim = true; + myMesh->ExportMED(tmp_file, false, -1, toOverwrite, toFindOutDim); +} +void SMESHGUI_MG_ADAPTDRIVER::setMyMesh(SMESH::SMESH_Mesh_var mesh) +{ + myMesh = mesh; +} +SMESH::SMESH_Mesh_var SMESHGUI_MG_ADAPTDRIVER::getMyMesh() +{ + return myMesh; +} + +//================================================================================= +// function : ClickOnOk() +// purpose : +//================================================================================= +void SMESHGUI_MG_ADAPTDRIVER::clickOnOk() +{ + setIsApplyAndClose( true ); + clickOnApply(); + reject(); +} +bool SMESHGUI_MG_ADAPTDRIVER::clickOnApply() +{ + + if ( SMESHGUI::isStudyLocked() ) + return false; + if( !isValid() ) + return false; + + SMESHGUI_MgAdaptDlg::clickOnApply(); + + bool ok = execute(); + //~SMESHGUI_MG_AdaptComputeDlg_QThread atest(getModel()); + //~atest.start(); + //~atest.quit(); + if (getModel()->getPublish()) this->createMeshInObjectBrowser(); + + return ok; +} + +bool SMESHGUI_MG_ADAPTDRIVER::execute() +{ + + int err; + std::string errStr; + try + { + err = getModel()->compute(errStr); + std::string msg = err == 0 ? " ok" : std::string("Not ok \n")+errStr ; + } + catch (const std::exception& e) + { + std::cerr<clear(); + myNbOkElements = 0; + + buttonOk->setEnabled(false); + buttonApply->setEnabled(false); + + //~myActor = 0; + myMesh = SMESH::SMESH_Mesh::_nil(); + + myIdSourceCheck->setChecked(true); + + onConstructor( 0 ); + } + +} + +//======================================================================= +//function : onConstructor +//purpose : switch operation mode +//======================================================================= + +void SMESHGUI_MG_ADAPTDRIVER::onConstructor( int withGeom ) +{ + + myGeomLabel ->setVisible( withGeom ); + myGeomNameEdit ->setVisible( withGeom ); + myReuseHypCheck ->setVisible( withGeom ); + myCopyElementsCheck->setVisible( withGeom ); + myFilterBtn ->setVisible( !withGeom ); + myIdSourceCheck ->setVisible( !withGeom ); + + if ( !withGeom ) + myMeshNameEdit->setText( SMESH::UniqueMeshName("Mesh")); + +} + + +//~void SMESHGUI_MG_ADAPTDRIVER::onSelectIdSource( bool ) +//~{} + + +//================================================================================= +// function : enterEvent() +// purpose : +//================================================================================= +void SMESHGUI_MG_ADAPTDRIVER::enterEvent (QEvent*) +{ + + // if ( !ConstructorsBox->isEnabled() ) { + // SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ); + // if ( aViewWindow && !mySelector ) { + // mySelector = aViewWindow->GetSelector(); + // } + // activateThisDialog(); + // } + +} + +//================================================================================= +// function : keyPressEvent() +// purpose : +//================================================================================= +void SMESHGUI_MG_ADAPTDRIVER::keyPressEvent( QKeyEvent* e ) +{ + + QDialog::keyPressEvent( e ); + if ( e->isAccepted() ) + return; + + if ( e->key() == Qt::Key_F1 ) { + e->accept(); + clickOnHelp(); + } + +} + +//================================================================================= +// function : clickOnHelp() +// purpose : +//================================================================================= +void SMESHGUI_MG_ADAPTDRIVER::clickOnHelp() +{ + + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif + SUIT_MessageBox::warning(this, tr("WRN_WARNING"), + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); + } + +} + +//======================================================================= +//function : getErrorMsg +//purpose : Return an error message and entries of invalid smesh object +//======================================================================= + +QString SMESHGUI_MG_ADAPTDRIVER::getErrorMsg( SMESH::string_array_var theInvalidEntries, + QStringList & theEntriesToBrowse ) +{ + + if ( theInvalidEntries->length() == 0 ) + return tr("OPERATION_FAILED"); + + // theInvalidEntries - SObject's that hold geometry objects whose + // counterparts are not found in the newGeometry, followed by SObject's + // holding mesh sub-objects that are invalid because they depend on a not found + // preceding sub-shape + + QString msg = tr("SUBSHAPES_NOT_FOUND_MSG") + "\n"; + + QString objString; + for ( CORBA::ULong i = 0; i < theInvalidEntries->length(); ++i ) + { + _PTR(SObject) so = SMESH::getStudy()->FindObjectID( theInvalidEntries[i].in() ); + + int objType = SMESHGUI_Selection::type( theInvalidEntries[i].in() ); + if ( objType < 0 ) // geom object + { + objString += "\n"; + if ( so ) + objString += so->GetName().c_str(); + else + objString += theInvalidEntries[i].in(); // it's something like "FACE #2" + } + else // smesh object + { + theEntriesToBrowse.push_back( theInvalidEntries[i].in() ); + + objString += "\n "; + switch ( objType ) { + case SMESH::MESH: + objString += tr("SMESH_MESH"); + break; + case SMESH::HYPOTHESIS: + objString += tr("SMESH_HYPOTHESIS"); + break; + case SMESH::ALGORITHM: + objString += tr("SMESH_ALGORITHM"); + break; + case SMESH::SUBMESH_VERTEX: + case SMESH::SUBMESH_EDGE: + case SMESH::SUBMESH_FACE: + case SMESH::SUBMESH_SOLID: + case SMESH::SUBMESH_COMPOUND: + case SMESH::SUBMESH: + objString += tr("SMESH_SUBMESH"); + break; + case SMESH::GROUP: + objString += tr("SMESH_GROUP"); + break; + default: + ; + } + objString += " \""; + if ( so ) + objString += so->GetName().c_str(); + objString += "\" ("; + objString += theInvalidEntries[i].in(); + objString += ")"; + } + } + if ( !objString.isEmpty() ) + msg += objString; + + return msg; +} + +//================================================================================= +// function : isValid +// purpose : +//================================================================================= + +bool SMESHGUI_MG_ADAPTDRIVER::isValid() +{ + bool ok = true; + return ok; +} + +bool SMESHGUI_MG_ADAPTDRIVER::createMeshInObjectBrowser() +{ + QString filename(getModel()->getMedFileOut().c_str()); + QStringList errors; + QStringList anEntryList; + bool isEmpty = false; + bool ok = false; + SMESH::SMESH_Gen_var SMESH_Gen_ptr = SMESHGUI::GetSMESHGen(); + if (!SMESH_Gen_ptr) { + std::cerr << "Could not retrieve SMESH_Gen_ptr" << std::endl; + throw SALOME_Exception(LOCALIZED("Could not retrieve SMESH::GetSMESHGen()")); + } + SMESH::mesh_array_var aMeshes = new SMESH::mesh_array; + aMeshes->length( 1 ); // one mesh only + SMESH::DriverMED_ReadStatus res; + aMeshes = SMESH_Gen_ptr->CreateMeshesFromMED( filename.toUtf8().constData(), res ); + if ( res != SMESH::DRS_OK ) { + errors.append( QString( "%1 :\n\t%2" ).arg( filename ).arg( QObject::tr( QString( "SMESH_DRS_%1" ).arg( res ).toLatin1().data() ) ) ); + } + _PTR(Study) aStudy = SMESH::getStudy(); + for ( int i = 0, iEnd = aMeshes->length(); i < iEnd; i++ ) + { + _PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshes[i] ); + if ( aMeshSO ) { + _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder(); + _PTR(AttributePixMap) aPixmap = aBuilder->FindOrCreateAttribute( aMeshSO, "AttributePixMap" ); + aPixmap->SetPixMap( "ICON_SMESH_TREE_MESH_IMPORTED" ); // put REFINED mesh ico + anEntryList.append( aMeshSO->GetID().c_str() ); + } + else { + isEmpty = true; + } + } + // update Object browser + SMESHGUI::GetSMESHGUI()->updateObjBrowser(); + // browse to the published meshes + if( LightApp_Application* anApp = + dynamic_cast( SUIT_Session::session()->activeApplication() ) ) + anApp->browseObjects( anEntryList ); + + // show Error message box if there were errors + if ( errors.count() > 0 ) { + SUIT_MessageBox::critical( SMESHGUI::desktop(), + QObject::tr( "SMESH_ERROR" ), + QObject::tr( "SMESH_IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) ); + } + + // show warning message box, if some imported mesh is empty + if ( isEmpty ) { + SUIT_MessageBox::warning( SMESHGUI::desktop(), + QObject::tr( "SMESH_WRN_WARNING" ), + QObject::tr( "SMESH_DRS_SOME_EMPTY" ) ); + } + return true; +} + +//================================================================ +// function : setIsApplyAndClose +// Purpose : Set value of the flag indicating that the dialog is +// accepted by Apply & Close button +//================================================================ +void SMESHGUI_MG_ADAPTDRIVER::setIsApplyAndClose( const bool theFlag ) +{ + myIsApplyAndClose = theFlag; +}//================================================================ +// function : isApplyAndClose +// Purpose : Get value of the flag indicating that the dialog is +// accepted by Apply & Close button +//================================================================ +bool SMESHGUI_MG_ADAPTDRIVER::isApplyAndClose() const +{ + return myIsApplyAndClose; +} + +//================================================================================= +// function : DeactivateActiveDialog() +// purpose : +//================================================================================= +void SMESHGUI_MG_ADAPTDRIVER::deactivateActiveDialog() +{ + + if (ConstructorsBox->isEnabled()) { + ConstructorsBox->setEnabled(false); + GroupArguments->setEnabled(false); + GroupButtons->setEnabled(false); + mySMESHGUI->ResetState(); + mySMESHGUI->SetActiveDialogBox(0); + if ( selMgr ) + selMgr->removeFilter( myIdSourceFilter ); + } +} + +//================================================================================= +// function : ActivateThisDialog() +// purpose : +//================================================================================= +void SMESHGUI_MG_ADAPTDRIVER::activateThisDialog() +{ + + /* Emit a signal to deactivate the active dialog */ + // mySMESHGUI->EmitSignalDeactivateDialog(); + // ConstructorsBox->setEnabled(true); + // GroupArguments->setEnabled(true); + // GroupButtons->setEnabled(true); + + // mySMESHGUI->SetActiveDialogBox((QDialog*)this); + + // onSelectIdSource( myIdSourceCheck->isChecked() ); + + // SelectionIntoArgument(); +} + +//================================================================================= +// function : setFilters() +// purpose : SLOT. Called when "Filter" button pressed. +//================================================================================= +void SMESHGUI_MG_ADAPTDRIVER::setFilters() +{ + if(myMesh->_is_nil()) { + SUIT_MessageBox::critical(this, + tr("SMESH_ERROR"), + tr("NO_MESH_SELECTED")); + return; + } + if ( !myFilterDlg ) + myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL ); + + QList types; + if ( myMesh->NbEdges() ) types << SMESH::EDGE; + if ( myMesh->NbFaces() ) types << SMESH::FACE; + if ( myMesh->NbVolumes() ) types << SMESH::VOLUME; + if ( myMesh->NbBalls() ) types << SMESH::BALL; + if ( myMesh->Nb0DElements()) types << SMESH::ELEM0D; + if ( types.count() > 1 ) types << SMESH::ALL; + + myFilterDlg->Init( types ); + myFilterDlg->SetSelection(); + myFilterDlg->SetMesh( myMesh ); + myFilterDlg->SetSourceWg( myLineEditElements ); + + myFilterDlg->show(); +} + +//================================================================================= +// function : onOpenView() +// purpose : +//================================================================================= +void SMESHGUI_MG_ADAPTDRIVER::onOpenView() +{ + if ( mySelector ) { + SMESH::SetPointRepresentation(false); + } + else { + mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector(); + activateThisDialog(); + } +} + +//================================================================================= +// function : onCloseView() +// purpose : +//================================================================================= +void SMESHGUI_MG_ADAPTDRIVER::onCloseView() +{ + deactivateActiveDialog(); + mySelector = 0; +} diff --git a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.h b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.h new file mode 100644 index 000000000..7f2e3ee6f --- /dev/null +++ b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.h @@ -0,0 +1,227 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// SMESH SMESHGUI : GUI for the adaptation in the SMESH component +// File : SMESHGUI_MG_ADAPTDRIVER.h +// +#ifndef SMESHGUI_MG_ADAPTDRIVER_H +#define SMESHGUI_MG_ADAPTDRIVER_H + +#include +// SMESH includes +#include "SMESH_SMESHGUI.hxx" + +// Qt includes +#include +#include +#include + +#include + +#include "LightApp_DataOwner.h" +#include "SalomeApp_Application.h" +#include +#include +#include "SalomeApp_Module.h" +#include "SalomeApp_Study.h" +#include +#include +// model +//~#include "MG_ADAPT.h" +#include "MG_ADAPTGUI.hxx" +#include "MG_ADAPT.hxx" + + +class SUIT_ViewWindow; +class SUIT_Desktop; +class SUIT_Study; +class SUIT_ResourceMgr; + +class CAM_Module; + +class SALOMEDSClient_Study; +class SALOMEDSClient_SObject; + +class SalomeApp_Study; +class SalomeApp_Module; +class LightApp_SelectionMgr; +class SUIT_SelectionFilter; + + +class QButtonGroup; +class QLineEdit; +class QGroupBox; +class QRadioButton; +class QLabel; +class QCheckBox; +class QGridLayout; +class QTabWidget; +class QDoubleSpinBox; +class QSpinBox; +class QTreeWidget; +class QTreeWidgetItem; +class QSpacerItem; +class QHBoxLayout; +class QItemDelegate; +class QComboBox; +class QObject; + + +// IDL includes +#include +#include CORBA_SERVER_HEADER(SMESH_Mesh) +#include CORBA_SERVER_HEADER(SMESH_Gen) +class SMESHGUI; +class SMESHGUI_MgAdaptDlg; +class SMESHGUI_IdValidator; +class SMESHGUI_FilterDlg; +class MgAdapt; +class QHeaderView; +class QFileDialog; + + +int IObjectCount(); +const SALOME_ListIO& selectedIO(); +_PTR(Study) getStudy(); +Handle(SALOME_InteractiveObject) firstIObject(); +bool createAndPublishMed(QString fileName); +bool createMgAdaptObject(MgAdapt* myMgAdapt = 0); + +class SMESHGUI_EXPORT SMESHGUI_MG_AdaptComputeDlg_QThread : public QThread +{ + Q_OBJECT + +public: + SMESHGUI_MG_AdaptComputeDlg_QThread(MgAdapt* model); + int result(); + void cancel(); +protected: + void run(); + +private: + + MgAdapt* model; + int myResult; +}; + +class SMESHGUI_MG_ADAPTDRIVER : public SMESHGUI_MgAdaptDlg +{ + Q_OBJECT; + +public : + SMESHGUI_MG_ADAPTDRIVER( SMESHGUI*, MgAdapt*, bool isCreation = true ); + void setMyMesh(SMESH::SMESH_Mesh_var); + SMESH::SMESH_Mesh_var getMyMesh() ; + +private : + + SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */ + LightApp_SelectionMgr* selMgr ; + SUIT_ResourceMgr* resMgr; + SUIT_ResourceMgr* resourceMgr(); + LightApp_SelectionMgr* selectionMgr(); + SMESH::SMESH_Mesh_var myMesh ; + + + + void Init( bool = true ); + void enterEvent( QEvent* ); /* mouse enter the QWidget */ + void keyPressEvent( QKeyEvent* ); + QString getErrorMsg( SMESH::string_array_var invalidEntries, + QStringList & entriesToBrowse ); + + bool isValid(); + bool createMeshInObjectBrowser(); + void setIsApplyAndClose( const bool theFlag ); + bool isApplyAndClose() const; + bool execute(); + SMESHGUI_IdValidator* myIdValidator; + int myNbOkElements; /* to check when elements are defined */ + + SVTK_Selector* mySelector; + + bool myBusy; + GEOM::GEOM_Object_var myNewGeometry; + //~SMESH_Actor* myActor; // + SUIT_SelectionFilter* myIdSourceFilter; + + SMESH::SMESH_IDSource_var mySelectedObject; + + QTabWidget* myTabWidget; + QButtonGroup* GroupConstructors; + + QGroupBox* ConstructorsBox; + QGroupBox* GroupArguments; + QGroupBox* GroupButtons; + + QPushButton* buttonOk; + QPushButton* buttonCancel; + QPushButton* buttonApply; + QPushButton* buttonHelp; + + QLabel* myTextLabelElements; + QLabel* myGeomLabel; + QLineEdit* myLineEditElements; + QLineEdit* myMeshNameEdit; + QLineEdit* myGeomNameEdit; + QCheckBox* myIdSourceCheck; + QCheckBox* myCopyGroupsCheck; + QCheckBox* myReuseHypCheck; + QCheckBox* myCopyElementsCheck; + QCheckBox* myKeepIdsCheck; + + QPushButton* myFilterBtn; + SMESHGUI_FilterDlg* myFilterDlg; + + QString myHelpFileName; + + bool myIsApplyAndClose; + + QString inputMeshName; + QString outputMeshName; +private slots: + void selectionChanged(); + void updateSelection(); + +protected slots : + +private slots: + + void exportMED(const char* ); + + virtual bool clickOnApply(); + virtual void clickOnOk(); + virtual void clickOnHelp(); + //~void SelectionIntoArgument(); + void deactivateActiveDialog(); + void activateThisDialog(); + void onConstructor( int ); + //~void onTextChange( const QString& ); + //~void onSelectIdSource( bool ); + void setFilters(); + void onOpenView(); + void onCloseView(); + + +}; + + + + +#endif // SMESHGUI_MG_ADAPTDRIVER_H From c0c883fc72c29f66e6703a2e06c0ad27ad18618e Mon Sep 17 00:00:00 2001 From: azakir Date: Thu, 10 Dec 2020 18:33:02 +0100 Subject: [PATCH 053/100] update translation files --- src/SMESHGUI/MG_ADAPT.cxx | 13 ++- src/SMESHGUI/SMESHGUI_AdaptDlg.cxx | 10 ++ src/SMESHGUI/SMESH_msg_en.ts | 164 +++++++++++++++++++++++++++++ src/SMESHGUI/SMESH_msg_fr.ts | 136 ++++++++++++++++++++++++ 4 files changed, 320 insertions(+), 3 deletions(-) diff --git a/src/SMESHGUI/MG_ADAPT.cxx b/src/SMESHGUI/MG_ADAPT.cxx index 305990c33..641c0f0c2 100644 --- a/src/SMESHGUI/MG_ADAPT.cxx +++ b/src/SMESHGUI/MG_ADAPT.cxx @@ -1175,9 +1175,16 @@ void MgAdapt::restorefams(MEDCoupling::MEDFileMesh* fileMesh) const std::vector::const_iterator fIt = famVec.begin(); for (; fIt!=famVec.end(); ++fIt) - { - std::string givenFamNameFromMeshGemConverter = fileMesh->getFamilyNameGivenId( fIt->_famId ); - fileMesh->changeFamilyName(givenFamNameFromMeshGemConverter, fIt->_famName); + { + try // safety : FAMILY could be lost P2-->P1 + { + std::string givenFamNameFromMeshGemConverter = fileMesh->getFamilyNameGivenId( fIt->_famId ); + fileMesh->changeFamilyName(givenFamNameFromMeshGemConverter, fIt->_famName); + } + catch (const std::exception& e) + { + std::cerr< @@ -222,6 +224,14 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) { INFOS("Interface avec MG-Adapt" ); // A faire + + MgAdapt* model = new MgAdapt(); + bool isCreation = false; + if (mySMESHGUI->isStudyLocked()) break; + mySMESHGUI->EmitSignalDeactivateDialog(); + SMESHGUI_MG_ADAPTDRIVER *mgAdapt = new SMESHGUI_MG_ADAPTDRIVER(mySMESHGUI, model, isCreation); + mgAdapt->show(); + delete model; break; } diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index ec3ca2f25..5c7703a82 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -372,6 +372,118 @@ MEN_MG_ADAPT Remesh with MG_Adapt + + Args + Arguments + + + MeshOut + Mesh Out + + + MeshIn + Mesh In + + + MEDFile + MED file + + + Browser + Browser + + + Publish_MG_ADAPT + Publish + + + SIZE_MAP_FIELD + Size map field + + + MG_ADAPT_FIELD_NAME + Field Name + + + MG_ADAPT_MED_FILE_1 + This MED file cannot be read. + + + MG_ADAPT_MED_FILE_2 + No mesh in this MED file. + + + MG_ADAPT_MED_FILE_3 + More than one mesh in this MED file. + + + MG_ADAPT_MED_FILE_4 + The mesh in this MED file cannot be read. + + + MG_ADAPT_MED_FILE_5 + No field in this MED file. + + + MG_ADAPT_MED_FILE_6 + The field(s) in this MED file cannot be read. + + + MG_ADAPT_ERROR + Error + + + MG_ADAPT_CH_ST + Chosen time step + + + MG_ADAPT_RANK + Rank + + + MG_ADAPT_TSTP + Time step + + + MG_ADAPT_NO_T_ST + No time step + + + MG_ADAPT_L_ST + Last time step + + + MeshName + Mesh name + + + LOCAL_MG_ADAPT + local + + + BACKGRND_MG_ADAPT + Background + + + CNST_MG_ADAPT + Constant + + + MED_FILE_BCKG + MED file background size map + + + VALUE_MG_ADAPT + Value + + + SIZE_MAP_DEF + size map definition + + + ADVOP + Advanced Options + MEN_CONV_TO_QUAD Convert to/from quadratic @@ -2989,6 +3101,30 @@ Check algorithm documentation for supported geometry ADAPT_PREF_MG_ADAPT_PUBLICATION_MAILLAGE_OUT Publication of the OUT mesh + + OPTION_VALUE_COLUMN + Option + + + OPTION_NAME_COLUMN + Value + + + compute_ridges + Compute ridges + + + max_memory + Maximum memory (Mb) + + + Adaption + adaptation + + + components + Components + ADAPT_PREF_MG_ADAPT_SIZE_MAP Size map @@ -3001,18 +3137,46 @@ Check algorithm documentation for supported geometry ADAPT_PREF_MG_ADAPT_SIZE_MAP_BACKGROUND Background + + ADAPT_PREF_MG_ADAPT_MED_SIZE_MAP_BACKGROUND + MED file background size map + ADAPT_PREF_MG_ADAPT_TIME_STEP Time step + + ADAPT_PREF_MG_ADAPT_NO_TIME_STEP + No time step + ADAPT_PREF_MG_ADAPT_TIME_STEP_LAST Last + + ADAPT_PREF_MG_ADAPT_AR + Arguments + + + ADAPT_PREF_MG_ADAPT_ADVOP + Advanced Options + + + ADAPT_PREF_MG_ADAPT_TIME_LAST_STEP + Last time step + + + ADAPT_PREF_MG_ADAPT_TIME_C_STEP + Chosen time step + ADAPT_PREF_MG_ADAPT_TIME_STEP_C Value + + MG_ADAPT_SELECT_FILE_0 + MG-ADAPT select file + SMESH_VISU_PROBLEM Mesh visualization failed diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index dd806b89c..5b7bdd0f9 100644 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -792,6 +792,114 @@ MEN_ADAPT Adaptation + + Args + Arguments + + + MeshOut + Maillage en sortie + + + MEDFile + Fichier MED + + + Browser + Arbre d'études + + + BACKGRND_MG_ADAPT + Arrière-plan + + + CNST_MG_ADAPT + Constante + + + SIZE_MAP_FIELD + Champ de la carte de taille + + + MG_ADAPT_FIELD_NAME + Nom du champ + + + MG_ADAPT_MED_FILE_1 + Ce fichier MED est illisible. + + + MG_ADAPT_MED_FILE_2 + Ce fichier MED ne contient aucun maillage. + + + MG_ADAPT_MED_FILE_3 + Ce fichier MED contient plus d'un maillage. + + + MG_ADAPT_MED_FILE_4 + Impossible de lire le maillage de ce fichier MED. + + + MG_ADAPT_MED_FILE_5 + Ce fichier MED ne contient aucun champ. + + + MG_ADAPT_MED_FILE_6 + Impossible de lire le(s) champ(s) de ce fichier MED. + + + MG_ADAPT_NO_T_ST + Sans pas de temps + + + MG_ADAPT_CH_ST + Pas de temps choisi + + + MG_ADAPT_RANK + Numéro d'ordre + + + MG_ADAPT_TSTP + Pas de temps + + + MG_ADAPT_L_ST + Dernier pas de temps + + + MED_FILE_BCKG + fichier MED de la carte en arrière-plan + + + VALUE_MG_ADAPT + Valeur + + + Publish_MG_ADAPT + Publication + + + LOCAL_MG_ADAPT + locale + + + MeshName + Nom du maillage + + + MeshIn + Maillage en entrée + + + SIZE_MAP_DEF + Définition de la carte de taille + + + ADVOP + Advanced Options + MEN_MEASURE Outils de mesure @@ -2967,6 +3075,30 @@ Référez-vous à la documentation sur l'algorithme et la géométrie suppo ADAPT_PREF_MG_ADAPT_PUBLICATION_MAILLAGE_OUT Publication du maillage de sortie + + OPTION_VALUE_COLUMN + Option + + + OPTION_NAME_COLUMN + Valeur + + + compute_ridges + Calcul des crêtes + + + max_memory + Maximum memoire (Mb) + + + components + Composants + + + Adapation + adaptation + ADAPT_PREF_MG_ADAPT_SIZE_MAP Carte de tailles @@ -2991,6 +3123,10 @@ Référez-vous à la documentation sur l'algorithme et la géométrie suppo ADAPT_PREF_MG_ADAPT_TIME_STEP_C Valeur + + MG_ADAPT_SELECT_FILE_0 + MG-ADAPT selection fichier MED + SMESH_VISU_PROBLEM Impossible de visualiser le maillage, probablement à cause d'un manque de mémoire From af459b337cda51ec16228ab5599d8a649893daf9 Mon Sep 17 00:00:00 2001 From: azakir Date: Sat, 12 Dec 2020 16:35:18 +0100 Subject: [PATCH 054/100] fix med_int conversion --- src/SMESHGUI/MG_ADAPT.cxx | 12 ++++++------ src/SMESHGUI/MG_ADAPT.hxx | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/SMESHGUI/MG_ADAPT.cxx b/src/SMESHGUI/MG_ADAPT.cxx index 641c0f0c2..a89924ed7 100644 --- a/src/SMESHGUI/MG_ADAPT.cxx +++ b/src/SMESHGUI/MG_ADAPT.cxx @@ -429,8 +429,8 @@ bool MgAdapt::setAll() } setSizeMapFile(mapfile); - int rank; - int tmst; + med_int rank; + med_int tmst; if (data->myUseNoTimeStep) { rank = MED_NO_IT; @@ -446,7 +446,7 @@ bool MgAdapt::setAll() rank = data->myRank; tmst = data->myTimeStep; } - setRankTimeStep(tmst, rank); + setRankTimeStep((int)tmst, (int)rank); /* Advanced options */ setWorkingDir(data->myWorkingDir); @@ -1233,13 +1233,13 @@ MgAdapt::Status MgAdapt::addMessage(const std::string& msg, // ======================================================================= -void MgAdapt::getTimeStepInfos(std::string aFile, int& numdt, int& numit) +void MgAdapt::getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit) // ======================================================================= { // Il faut voir si plusieurs maillages - med_err erreur = 0 ; + herr_t erreur = 0 ; med_idt medIdt ; @@ -1278,7 +1278,7 @@ void MgAdapt::getTimeStepInfos(std::string aFile, int& numdt, int& numit) } med_float dt; - int tmp_numdt, tmp_numit; + med_int tmp_numdt, tmp_numit; med_int step = data->myUseLastTimeStep ? nbofcstp : data->myTimeStep+1; //~myPrint("step ", step); diff --git a/src/SMESHGUI/MG_ADAPT.hxx b/src/SMESHGUI/MG_ADAPT.hxx index f81dd03c5..1854c931c 100644 --- a/src/SMESHGUI/MG_ADAPT.hxx +++ b/src/SMESHGUI/MG_ADAPT.hxx @@ -318,7 +318,7 @@ private : void storeGroupsAndFams(MEDCoupling::MEDFileMesh* fileMesh); void restoreGroupsAndFams(MEDCoupling::MEDFileMesh* fileMesh) const; void convertMeshFile(std::string& meshFormatIn, std::vector< std::string>& solFieldFileNames) const ; - void getTimeStepInfos(std::string aFile, int& numdt, int& numit); + void getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit); Status addMessage(const std::string& msg, const bool isFatal = false); med_idt openMedFile(const std::string aFile) ; bool isFileExist(std::string& fName) const; From b099bfe29f33249f81ce784f5cacb660c4add911 Mon Sep 17 00:00:00 2001 From: azakir Date: Mon, 14 Dec 2020 11:51:43 +0100 Subject: [PATCH 055/100] reading constant size map --- src/SMESHGUI/MG_ADAPT.cxx | 88 ++++++++++++++++++++++----------------- src/SMESHGUI/MG_ADAPT.hxx | 2 + 2 files changed, 52 insertions(+), 38 deletions(-) diff --git a/src/SMESHGUI/MG_ADAPT.cxx b/src/SMESHGUI/MG_ADAPT.cxx index a89924ed7..9e3936606 100644 --- a/src/SMESHGUI/MG_ADAPT.cxx +++ b/src/SMESHGUI/MG_ADAPT.cxx @@ -730,16 +730,16 @@ std::string MgAdapt::getCommandToRun() cmd+= " --in "+ meshIn; meshFormatOutputMesh = getFileName()+".mesh"; cmd+= " --out "+ meshFormatOutputMesh; - if (useLocalMap) cmd+= " --sizemap "+ solFileIn; - else if (useBackgroundMap) + if (useLocalMap || useConstantValue) cmd+= " --sizemap "+ solFileIn; + else // (useBackgroundMap) { cmd+= " --background_mesh "+ sizeMapIn ; cmd+= " --background_sizemap "+ solFileIn; } - else - { - // constant value TODO - } + //~else + //~{ + //~// constant value TODO + //~} if (verbosityLevel != defaultVerboseLevel()) { @@ -1048,25 +1048,7 @@ void MgAdapt::convertMedFile(std::string& meshFormatMeshFileName, std::string& s meshFormatsizeMapFile = getFileName(); meshFormatsizeMapFile += ".mesh"; - MEDCoupling::MCAuto tmpMfd = MEDCoupling::MEDFileData::New(sizeMapFile); - MEDCoupling::MEDFileFields* tmpFields = tmpMfd->getFields(); - MEDCoupling::MEDFileAnyTypeFieldMultiTS* fts = tmpFields->getFieldWithName(fieldName); - MEDCoupling::MCAuto fts1 = dynamic_cast(fts); - MEDCoupling::MCAuto f = fts1->getTimeStep(timeStep, rank); - MEDCoupling::MCAuto tmFts = MEDCoupling::MEDFileFieldMultiTS::New(); - tmFts->pushBackTimeStep(f); - - MEDCoupling::MCAuto tmp_fields = MEDCoupling::MEDFileFields::New(); - tmp_fields->pushField(tmFts); - - - tmpMfd->setFields( tmp_fields ); - MeshFormatWriter tmpWriter; - tmpWriter.setMeshFileName(meshFormatsizeMapFile); - tmpWriter.setFieldFileNames( fieldFileNames); - tmpWriter.setMEDFileDS(tmpMfd); - tmpWriter.write(); - + buildBackGroundMeshAndSolFiles(fieldFileNames, meshFormatsizeMapFile); } else if(useLocalMap) @@ -1084,19 +1066,12 @@ void MgAdapt::convertMedFile(std::string& meshFormatMeshFileName, std::string& s else { - MEDCoupling::MEDCouplingMesh* mesh = fileMesh->getMeshAtLevel(1); // nodes mesh - MEDCoupling::MEDCouplingFieldDouble* fieldOnNodes=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_NODES,MEDCoupling::NO_TIME); - fieldOnNodes->setName("MyScalarFieldOnNodeNoTime"); - fieldOnNodes->setMesh(mesh); - mesh->decrRef(); // no more need of mesh because mesh has been attached to fieldOnNodes - MEDCoupling::DataArrayDouble *array=MEDCoupling::DataArrayDouble::New(); - array->alloc(fieldOnNodes->getMesh()->getNumberOfNodes(),1);//Implicitly fieldOnNodes will be a 1 component field. - array->fillWithValue(constantValue); - fieldOnNodes->setArray(array); - array->decrRef(); - // fieldOnNodes is now usable - // ... - // fieldOnNodes is no more useful h + MEDCoupling::MCAuto mesh = fileMesh->getMeshAtLevel(1); // nodes mesh + MEDCoupling::MCAuto umesh = mesh->buildUnstructured(); // nodes mesh + int dim = umesh->getSpaceDimension(); + int version = sizeof(double) < 8 ? 1 : 2; + mcIdType nbNodes = umesh->getNumberOfNodes(); + buildConstantSizeMapSolFile(solFormatFieldFileName, dim, version, nbNodes); } @@ -1200,6 +1175,43 @@ void MgAdapt::restoreGroups(MEDCoupling::MEDFileMesh* fileMesh) const fileMesh->setGroupInfo(info); } + +void MgAdapt::buildConstantSizeMapSolFile(const std::string& solFormatFieldFileName, const int dim, const int version, const mcIdType nbNodes) const +{ + MeshFormat::Localizer loc; + MeshFormat::MeshFormatParser writer; + int fileId = writer.GmfOpenMesh( solFormatFieldFileName.c_str(), GmfWrite, version, dim); + int typTab[] = {GmfSca}; + writer.GmfSetKwd(fileId, MeshFormat::GmfSolAtVertices, (int)nbNodes, 1, typTab); + for (mcIdType i = 0; i& fieldFileNames, const std::string& meshFormatsizeMapFile) const +{ + MEDCoupling::MCAuto tmpMfd = MEDCoupling::MEDFileData::New(sizeMapFile); + MEDCoupling::MEDFileFields* tmpFields = tmpMfd->getFields(); + MEDCoupling::MEDFileAnyTypeFieldMultiTS* fts = tmpFields->getFieldWithName(fieldName); + MEDCoupling::MCAuto fts1 = dynamic_cast(fts); + MEDCoupling::MCAuto f = fts1->getTimeStep(timeStep, rank); + MEDCoupling::MCAuto tmFts = MEDCoupling::MEDFileFieldMultiTS::New(); + tmFts->pushBackTimeStep(f); + + MEDCoupling::MCAuto tmp_fields = MEDCoupling::MEDFileFields::New(); + tmp_fields->pushField(tmFts); + + + tmpMfd->setFields( tmp_fields ); + MeshFormatWriter tmpWriter; + tmpWriter.setMeshFileName(meshFormatsizeMapFile); + tmpWriter.setFieldFileNames( fieldFileNames); + tmpWriter.setMEDFileDS(tmpMfd); + tmpWriter.write(); +} // ======================================================================= med_idt MgAdapt::openMedFile(const std::string aFile) // ======================================================================= diff --git a/src/SMESHGUI/MG_ADAPT.hxx b/src/SMESHGUI/MG_ADAPT.hxx index 1854c931c..2ac1f7100 100644 --- a/src/SMESHGUI/MG_ADAPT.hxx +++ b/src/SMESHGUI/MG_ADAPT.hxx @@ -318,6 +318,8 @@ private : void storeGroupsAndFams(MEDCoupling::MEDFileMesh* fileMesh); void restoreGroupsAndFams(MEDCoupling::MEDFileMesh* fileMesh) const; void convertMeshFile(std::string& meshFormatIn, std::vector< std::string>& solFieldFileNames) const ; + void buildConstantSizeMapSolFile(const std::string& solFormatFieldFileName, const int dim, const int version, const mcIdType nbNodes) const; + void buildBackGroundMeshAndSolFiles(const std::vector& fieldFileNames, const std::string& meshFormatsizeMapFile) const; void getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit); Status addMessage(const std::string& msg, const bool isFatal = false); med_idt openMedFile(const std::string aFile) ; From abe3e0bbe9a83c7b07818571dc949d87c2fd0f4a Mon Sep 17 00:00:00 2001 From: azakir Date: Wed, 16 Dec 2020 10:31:52 +0100 Subject: [PATCH 056/100] to remove tmp file --- src/SMESHGUI/MG_ADAPT.cxx | 94 ++++++++++++++++++++++++++++++++---- src/SMESHGUI/MG_ADAPT.hxx | 9 +++- src/SMESHGUI/MG_ADAPTGUI.cxx | 6 +++ src/SMESHGUI/MG_ADAPTGUI.hxx | 2 + 4 files changed, 100 insertions(+), 11 deletions(-) diff --git a/src/SMESHGUI/MG_ADAPT.cxx b/src/SMESHGUI/MG_ADAPT.cxx index 9e3936606..ce0bbeeab 100644 --- a/src/SMESHGUI/MG_ADAPT.cxx +++ b/src/SMESHGUI/MG_ADAPT.cxx @@ -37,6 +37,17 @@ #include #include + +static std::string removeFile(std::string fileName, int& notOk) +{ + std::string errStr; + notOk = std::remove(fileName.c_str()); + if (notOk) errStr = ToComment(" \n error while removing file : ") + << fileName; + else errStr= ToComment("\n file : ")<< fileName << " succesfully deleted! \n "; + + return errStr; +} namespace { struct GET_DEFAULT // struct used to get default value from GetOptionValue() @@ -484,7 +495,9 @@ throw (std::invalid_argument) if (op_val->second != optionValue) { - const char* ptr = optionValue.c_str(); + + std::string lowerOptionValue = toLowerStr(optionValue); + const char* ptr = lowerOptionValue.c_str(); // strip white spaces while (ptr[0] == ' ') ptr++; @@ -497,7 +510,7 @@ throw (std::invalid_argument) if (i == 0) { // empty string } else if (_charOptions.count(optionName)) { - // do not check strings + // do not check strings } else if (_doubleOptions.count(optionName)) { // check if value is double toDbl(ptr, &typeOk); @@ -581,6 +594,18 @@ throw (std::invalid_argument) return val; } //================================================================================ +/*! + * \brief Converts a string to a lower + */ +//================================================================================ +std::string MgAdapt::toLowerStr(const std::string& str) +{ + std::string s = str; + for ( size_t i = 0; i <= s.size(); ++i ) + s[i] = tolower( s[i] ); + return s; +} +//================================================================================ /*! * \brief Converts a string to a bool */ @@ -662,7 +687,7 @@ std::string MgAdapt::getCommandToRun(MgAdapt* hyp) int MgAdapt::compute(std::string& errStr) { - std::string cmd= getCommandToRun(); + std::string cmd = getCommandToRun(); int err = 0; execCmd( cmd.c_str(), err ); // run @@ -675,6 +700,7 @@ int MgAdapt::compute(std::string& errStr) { convertMeshFile(meshFormatOutputMesh, solFormatOutput); } + //~if (!err) cleanUp(); return err; } @@ -682,8 +708,19 @@ void MgAdapt::execCmd( const char* cmd, int& err) { err = 1; std::array buffer; - std:: ofstream logStream; - logStream.open(logFile); + std::streambuf* buf; + outFileStream fileStream; + if (printLogInFile) + { + fileStream.open(logFile); + buf = fileStream.rdbuf(); + } + else + { + buf = std::cout.rdbuf(); + } + std::ostream logStream(buf); + std::unique_ptr pipe(popen(cmd, "r"), pclose ); if(!pipe) { @@ -693,9 +730,34 @@ void MgAdapt::execCmd( const char* cmd, int& err) { logStream<::iterator it = tmpFilesToBeDeleted.begin(); + for (; it!=tmpFilesToBeDeleted.end(); ++it) + { + errStr=removeFile(*it, notOk); + if (notOk) + { + appendMsgToLogFile(errStr); + } + + } +} + +void MgAdapt::appendMsgToLogFile(std::string& msg) +{ + std::ofstream logStream; + logStream.open(logFile, std::ofstream::out | std::ofstream::app); + logStream<< msg; + logStream.close(); +} //================================================================================ /*! * \brief Return command to run MG-Tetra mesher excluding file prefix (-f) @@ -717,6 +779,8 @@ std::string MgAdapt::getCommandToRun() errStr = ToComment(" failed to find .mesh or .sol file from converter ")<< strerror( errno ); return errStr; } + tmpFilesToBeDeleted.push_back(meshIn); + tmpFilesToBeDeleted.push_back(solFileIn); if(useBackgroundMap && !isFileExist(sizeMapIn)) { @@ -724,8 +788,7 @@ std::string MgAdapt::getCommandToRun() return errStr; } - meshFormatOutputMesh = meshIn; - solFormatOutput.push_back(solFileIn); + cmd+= " --in "+ meshIn; meshFormatOutputMesh = getFileName()+".mesh"; @@ -735,12 +798,22 @@ std::string MgAdapt::getCommandToRun() { cmd+= " --background_mesh "+ sizeMapIn ; cmd+= " --background_sizemap "+ solFileIn; + tmpFilesToBeDeleted.push_back(sizeMapIn); } //~else //~{ //~// constant value TODO //~} - + /* sizemap file is not adapted in case of only surface adaptation see MeshGems docs */ + std::string adapOp = "adaptation"; + std::string adpOpVal = getOptionValue(adapOp); + std::string surfaceAdapt = "surface"; + if(surfaceAdapt != adpOpVal ) + { + std::string solFileOut = getFileName()+".sol"; + cmd+= " --write_sizemap "+ solFileOut; + solFormatOutput.push_back(solFileOut); + } if (verbosityLevel != defaultVerboseLevel()) { @@ -1298,7 +1371,8 @@ void MgAdapt::getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit if ( erreur < 0 ) { - //~addMessage( ToComment(" error: error while reading field last time step ") << nomcha << " in file " << aFile , /*fatal=*/true ); + //~addMessage( ToComment(" error: error while reading field ") << nomcha << "step (numdt, numit) = " <<"("<< numdt<< ", " \ + numit<< ")" <<" in file " << aFile , /*fatal=*/true ); return; } diff --git a/src/SMESHGUI/MG_ADAPT.hxx b/src/SMESHGUI/MG_ADAPT.hxx index 2ac1f7100..e11898f00 100644 --- a/src/SMESHGUI/MG_ADAPT.hxx +++ b/src/SMESHGUI/MG_ADAPT.hxx @@ -60,7 +60,10 @@ struct MgAdaptHypothesisData }; - +class outFileStream : public std::ofstream{ +public: + ~outFileStream(){close();} //to close file at dtor +}; /*! * \brief Class to generate string from any type @@ -211,6 +214,7 @@ public: static double toDbl(const std::string&, bool* isOk = 0) throw (std::invalid_argument); static bool toBool(const std::string&, bool* isOk = 0) throw (std::invalid_argument); static int toInt(const std::string&, bool* isOk = 0 ) throw (std::invalid_argument); + static std::string toLowerStr(const std::string& str); /* default values */ @@ -308,6 +312,7 @@ private : std::vector< std::string> solFormatOutput; std::vector groupVec; std::vector famVec; + std::vector< std::string> tmpFilesToBeDeleted; /* convert MED-->.mesh format */ void convertMedFile(std::string& meshIn,std::string& solFileIn, std::string& sizeMapIn) ; @@ -325,6 +330,8 @@ private : med_idt openMedFile(const std::string aFile) ; bool isFileExist(std::string& fName) const; void execCmd( const char* cmd, int& err); + void cleanUp(); + void appendMsgToLogFile(std::string& msg); }; diff --git a/src/SMESHGUI/MG_ADAPTGUI.cxx b/src/SMESHGUI/MG_ADAPTGUI.cxx index 628912e46..928b93023 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.cxx +++ b/src/SMESHGUI/MG_ADAPTGUI.cxx @@ -947,6 +947,7 @@ MgAdaptAdvWidget::MgAdaptAdvWidget( QWidget* parent, std::vector * connect( myOptionTable, SIGNAL( itemChanged(QTreeWidgetItem *, int)), SLOT( itemChanged(QTreeWidgetItem *, int ))); connect( addBtn, SIGNAL( clicked() ), this, SLOT( onAddOption() ) ); + connect(workingDirectoryPushButton, SIGNAL(pressed()), this, SLOT(_onWorkingDirectoryPushButton())); } MgAdaptAdvWidget::~MgAdaptAdvWidget() @@ -1120,6 +1121,11 @@ void MgAdaptAdvWidget::setupWidget() // QMetaObject::connectSlotsByName(this); } +void MgAdaptAdvWidget::_onWorkingDirectoryPushButton() +{ + QString aDirName=QFileDialog::getExistingDirectory (); + if (!(aDirName.isEmpty()))workingDirectoryLineEdit->setText(aDirName); +} namespace { diff --git a/src/SMESHGUI/MG_ADAPTGUI.hxx b/src/SMESHGUI/MG_ADAPTGUI.hxx index db4012425..ced54d236 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.hxx +++ b/src/SMESHGUI/MG_ADAPTGUI.hxx @@ -280,6 +280,8 @@ public slots: void onAddOption(); void itemChanged(QTreeWidgetItem * tblRow, int column); +private slots: + void _onWorkingDirectoryPushButton(); }; From 1224f8cfd6255dec39cf45bceb42b479e9c47805 Mon Sep 17 00:00:00 2001 From: azakir Date: Thu, 17 Dec 2020 10:04:50 +0100 Subject: [PATCH 057/100] restoring fam with old id --- src/SMESHGUI/MG_ADAPT.cxx | 7 ++++--- src/SMESHGUI/MG_ADAPT.hxx | 6 ++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/SMESHGUI/MG_ADAPT.cxx b/src/SMESHGUI/MG_ADAPT.cxx index ce0bbeeab..a75e9448c 100644 --- a/src/SMESHGUI/MG_ADAPT.cxx +++ b/src/SMESHGUI/MG_ADAPT.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ // file : MG_ADAPT.cxx #include "MG_ADAPT.hxx" @@ -35,9 +35,9 @@ #include #include #include +#include #include - static std::string removeFile(std::string fileName, int& notOk) { std::string errStr; @@ -1226,7 +1226,8 @@ void MgAdapt::restorefams(MEDCoupling::MEDFileMesh* fileMesh) const { try // safety : FAMILY could be lost P2-->P1 { - std::string givenFamNameFromMeshGemConverter = fileMesh->getFamilyNameGivenId( fIt->_famId ); + std::string givenFamNameFromMeshGemConverter = fileMesh->getFamilyNameGivenId( std::abs(fIt->_famId) ); + fileMesh->changeFamilyId(std::abs(fIt->_famId), fIt->_famId); fileMesh->changeFamilyName(givenFamNameFromMeshGemConverter, fIt->_famName); } catch (const std::exception& e) diff --git a/src/SMESHGUI/MG_ADAPT.hxx b/src/SMESHGUI/MG_ADAPT.hxx index e11898f00..379671f91 100644 --- a/src/SMESHGUI/MG_ADAPT.hxx +++ b/src/SMESHGUI/MG_ADAPT.hxx @@ -14,9 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - +// See http://www.salome-platform.org/ // // File : MG_ADAPT.hxx // @@ -112,7 +110,7 @@ public : class MgAdapt { - enum YesNo {YES, NO}; + public: MgAdapt(); From 86be227dee12b1a2d7dafc3308597f1566ef950f Mon Sep 17 00:00:00 2001 From: azakir Date: Thu, 17 Dec 2020 16:18:49 +0100 Subject: [PATCH 058/100] change default med file out --- src/SMESHGUI/MG_ADAPTGUI.cxx | 9 +++++++-- src/SMESHGUI/MG_ADAPTGUI.hxx | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/SMESHGUI/MG_ADAPTGUI.cxx b/src/SMESHGUI/MG_ADAPTGUI.cxx index 928b93023..397bdb3be 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.cxx +++ b/src/SMESHGUI/MG_ADAPTGUI.cxx @@ -764,7 +764,8 @@ void SMESHGUI_MgAdaptArguments::onSelectMedFilebuttonClicked() *myFileInDir = myFileInfo.path(); *myFileOutDir = myFileInfo.path(); selectMedFileLineEdit->setText(myFileInfo.fileName()); - selectOutMedFileLineEdit->setText(myFileInfo.fileName()); + QString outF = QString( remove_extension(myFileInfo.fileName().toStdString() ).c_str() )+QString(".adapt.med"); + selectOutMedFileLineEdit->setText(outF); onLocalSelected(myFileInfo.filePath()); } @@ -1368,6 +1369,10 @@ std::map GetListeChamps(QString aFile, bool errorMessage) return ListeChamp; } - +std::string remove_extension(const std::string& filename) { + size_t lastdot = filename.find_last_of("."); + if (lastdot == std::string::npos) return filename; + return filename.substr(0, lastdot); +} diff --git a/src/SMESHGUI/MG_ADAPTGUI.hxx b/src/SMESHGUI/MG_ADAPTGUI.hxx index ced54d236..4cc94cca9 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.hxx +++ b/src/SMESHGUI/MG_ADAPTGUI.hxx @@ -97,6 +97,7 @@ std::map GetListeChamps(QString aFile, bool errorMessage = true); QString lireNomMaillage(QString aFile); QString lireNomMaillage2(med_idt medIdt,int meshId); med_idt OuvrirFichier(QString aFile); +std::string remove_extension(const std::string& filename); //================================================================================= // class : SMESHGUI_MgAdaptDlg From 97ad2bb328fa80b05d01479ca342b9d4e1944280 Mon Sep 17 00:00:00 2001 From: azakir Date: Fri, 18 Dec 2020 12:36:45 +0100 Subject: [PATCH 059/100] fixing adaptation default mode --- src/SMESHGUI/MG_ADAPTGUI.cxx | 103 +++++++++++++++++++---- src/SMESHGUI/MG_ADAPTGUI.hxx | 20 ++++- src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx | 7 ++ 3 files changed, 112 insertions(+), 18 deletions(-) diff --git a/src/SMESHGUI/MG_ADAPTGUI.cxx b/src/SMESHGUI/MG_ADAPTGUI.cxx index 397bdb3be..564271ac9 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.cxx +++ b/src/SMESHGUI/MG_ADAPTGUI.cxx @@ -177,6 +177,7 @@ void SMESHGUI_MgAdaptDlg::buildDlg() connect(cancelBtn, SIGNAL(clicked()), this, SLOT(reject())); connect(buttonApply, SIGNAL(clicked()), this,SLOT(clickOnApply())); connect(buttonApplyAndClose, SIGNAL(clicked()), this,SLOT(clickOnOk())); + connect(myArgs, SIGNAL(meshDimSignal(ADAPTATION_MODE)), myAdvOpt, SLOT( onMeshDimChanged(ADAPTATION_MODE)) ); } @@ -471,7 +472,7 @@ SMESHGUI_MgAdaptArguments::SMESHGUI_MgAdaptArguments( QWidget* parent ) *myFileSizeMapDir = SUIT_FileDlg::getLastVisitedPath(); } - + meshDim = 0; // Mesh in aMeshIn = new QGroupBox( tr( "MeshIn" ), this ); aMedfile = new QRadioButton( tr( "MEDFile" ), aMeshIn ); @@ -741,7 +742,7 @@ void SMESHGUI_MgAdaptArguments::onSelectMedFilebuttonClicked() QString fileName = getMedFileName(false); if(fileName != QString::null) { - QString aMeshName = lireNomMaillage(fileName.trimmed()); + QString aMeshName = lireNomMaillage(fileName.trimmed(), meshDim); if (aMeshName == QString::null ) { QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), @@ -751,6 +752,8 @@ void SMESHGUI_MgAdaptArguments::onSelectMedFilebuttonClicked() else { meshNameLineEdit->setText(aMeshName); + ADAPTATION_MODE aMode = meshDim == 3 ? ADAPTATION_MODE::BOTH : ADAPTATION_MODE::SURFACE; // and when dimesh 3 without 2D mesh? + emit meshDimSignal(aMode); } } @@ -764,7 +767,8 @@ void SMESHGUI_MgAdaptArguments::onSelectMedFilebuttonClicked() *myFileInDir = myFileInfo.path(); *myFileOutDir = myFileInfo.path(); selectMedFileLineEdit->setText(myFileInfo.fileName()); - QString outF = QString( remove_extension(myFileInfo.fileName().toStdString() ).c_str() )+QString(".adapt.med"); + QString outF = fileName == QString::null ? myFileInfo.fileName() : + QString( remove_extension(myFileInfo.fileName().toStdString() ).c_str() )+ QString(".adapt.med"); selectOutMedFileLineEdit->setText(outF); onLocalSelected(myFileInfo.filePath()); @@ -786,7 +790,7 @@ void SMESHGUI_MgAdaptArguments::onLocalSelected(QString filePath) // fill field name Combobox fieldNameCmb->clear(); std::map::const_iterator it; - for ( it=myFieldList.begin() ; it != myFieldList.end(); it++) + for ( it = myFieldList.begin() ; it != myFieldList.end(); it++) { fieldNameCmb->insertItem(0,QString(it->first)); int typeStepInField = it->second > 2 ? 2 : it->second ; @@ -923,7 +927,10 @@ void SMESHGUI_MgAdaptArguments::clear() meshNameLineEdit->clear(); selectOutMedFileLineEdit->clear(); } - +med_int SMESHGUI_MgAdaptArguments::getMeshDim() const +{ + return meshDim; +} QWidget* ItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &o, const QModelIndex &index) const { bool editable = index.data( EDITABLE_ROLE ).toInt(); @@ -957,12 +964,7 @@ MgAdaptAdvWidget::~MgAdaptAdvWidget() void MgAdaptAdvWidget::AddOption( const char* option, bool isCustom ) { - QTreeWidget * table = myOptionTable; - //table->setExpanded( true ); - QTreeWidgetItem * row = new QTreeWidgetItem( table ); - row->setData( NAME_COL, EDITABLE_ROLE, int( isCustom && !option )); - row->setFlags( row->flags() | Qt::ItemIsEditable ); QString name, value; bool isDefault = false; @@ -977,6 +979,23 @@ void MgAdaptAdvWidget::AddOption( const char* option, bool isCustom ) isDefault = !name_value_type[2].toInt(); } + QTreeWidget* table = myOptionTable; + //table->setExpanded( true ); + + QTreeWidgetItem* row; + if (optionTreeWidgetItem.size()) + { + std::map::iterator it = optionTreeWidgetItem.find(name); + if(it != optionTreeWidgetItem.end()) return; // option exist + else + { + row = getNewQTreeWidgetItem(table, option, name, isCustom); + } + } + else + { + row = getNewQTreeWidgetItem(table, option, name, isCustom); + } row->setText( 0, tr( name.toLatin1().constData() )); row->setText( 1, tr( value.toLatin1().constData() )); row->setCheckState( 0, isDefault ? Qt::Unchecked : Qt::Checked); @@ -989,6 +1008,17 @@ void MgAdaptAdvWidget::AddOption( const char* option, bool isCustom ) myOptionTable->editItem( row, NAME_COL ); } } + +QTreeWidgetItem* MgAdaptAdvWidget::getNewQTreeWidgetItem(QTreeWidget* table, const char* option, QString& name, bool isCustom) +{ + QTreeWidgetItem* row = new QTreeWidgetItem( table ); + row->setData( NAME_COL, EDITABLE_ROLE, int( isCustom && !option )); + row->setFlags( row->flags() | Qt::ItemIsEditable ); + optionTreeWidgetItem.insert(std::pair (name, row)); + + return row; +} + void MgAdaptAdvWidget::onAddOption() { AddOption( NULL, true ); @@ -1005,7 +1035,7 @@ void MgAdaptAdvWidget::GetOptionAndValue( QTreeWidgetItem * tblRow, } -void MgAdaptAdvWidget::itemChanged(QTreeWidgetItem * tblRow, int column) +void MgAdaptAdvWidget::itemChanged(QTreeWidgetItem* tblRow, int column) { if ( tblRow ) { @@ -1127,7 +1157,50 @@ void MgAdaptAdvWidget::_onWorkingDirectoryPushButton() QString aDirName=QFileDialog::getExistingDirectory (); if (!(aDirName.isEmpty()))workingDirectoryLineEdit->setText(aDirName); } +void MgAdaptAdvWidget::onMeshDimChanged(ADAPTATION_MODE aMode) +{ + /* default adaptation mode + * assume that if meshDim == 2 -->adaptation surface + * if meshDim == 3 and if there is not 2D mesh -->VOLUME + * else BOTH + */ + + QString adaptation("adaptation"), value; + switch(aMode) + { + case ADAPTATION_MODE::SURFACE: + { + value ="surface"; + setOptionValue(adaptation, value); + break; + } + case ADAPTATION_MODE::BOTH : + { + value = "both"; + setOptionValue(adaptation, value); + break; + } + case ADAPTATION_MODE::VOLUME : + { + value = "volume"; + setOptionValue(adaptation, value); + break; + } + } +} +void MgAdaptAdvWidget::setOptionValue(QString& option, QString& value) +{ + std::map::iterator it = optionTreeWidgetItem.find(option); + if (it != optionTreeWidgetItem.end()) + { + it->second->setText( 0, tr( option.toLatin1().constData() )); + it->second->setText( 1, tr( value.toLatin1().constData() )); + it->second->setCheckState( 0, Qt::Checked ); + it->second->setData( NAME_COL, PARAM_NAME, option ); + myOptionTable->editItem( it->second, NAME_COL ); + } +} namespace { bool isEditable( const QModelIndex& index ) @@ -1215,7 +1288,7 @@ med_idt OuvrirFichier(QString aFile) // ====================================================== // ======================================================== -QString lireNomMaillage(QString aFile) +QString lireNomMaillage(QString aFile, med_int& meshdim) { QString nomMaillage = QString::null ; int erreur = 0 ; @@ -1244,7 +1317,7 @@ QString lireNomMaillage(QString aFile) return nomMaillage; } - nomMaillage = lireNomMaillage2(medIdt,1); + nomMaillage = lireNomMaillage2(medIdt,1, meshdim); // Fermeture du fichier if ( medIdt > 0 ) MEDfileClose(medIdt); @@ -1253,11 +1326,11 @@ QString lireNomMaillage(QString aFile) // ======================================================================= // ======================================================================= -QString lireNomMaillage2(med_idt medIdt,int meshId) +QString lireNomMaillage2(med_idt medIdt,int meshId, med_int& meshdim ) { QString NomMaillage=QString::null; char meshname[MED_NAME_SIZE+1]; - med_int spacedim,meshdim; + med_int spacedim; med_mesh_type meshtype; char descriptionription[MED_COMMENT_SIZE+1]; char dtunit[MED_SNAME_SIZE+1]; diff --git a/src/SMESHGUI/MG_ADAPTGUI.hxx b/src/SMESHGUI/MG_ADAPTGUI.hxx index 4cc94cca9..5e2a90435 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.hxx +++ b/src/SMESHGUI/MG_ADAPTGUI.hxx @@ -94,11 +94,17 @@ class QFileDialog; std::map GetListeChamps(QString aFile, bool errorMessage = true); -QString lireNomMaillage(QString aFile); -QString lireNomMaillage2(med_idt medIdt,int meshId); +QString lireNomMaillage(QString aFile, med_int& meshDim); +QString lireNomMaillage2(med_idt medIdt,int meshId, med_int& meshDim); med_idt OuvrirFichier(QString aFile); std::string remove_extension(const std::string& filename); + +enum ADAPTATION_MODE{ + SURFACE, // surface adaption when meshDim == 2 + VOLUME, // + BOTH +}; //================================================================================= // class : SMESHGUI_MgAdaptDlg // purpose : @@ -156,6 +162,7 @@ public: SMESHGUI_MgAdaptArguments( QWidget* parent); ~SMESHGUI_MgAdaptArguments(); void setMode( const Mode, const SIZEMAP ); + med_int getMeshDim() const; QString* myFileInDir; QString* myFileOutDir; @@ -210,6 +217,7 @@ public: signals: void updateSelection(); void toExportMED(const char *); + void meshDimSignal(ADAPTATION_MODE aMode); public slots: protected slots: @@ -233,7 +241,7 @@ private: QString getMedFileName(bool avertir); LightApp_SelectionMgr* selMgr ; - + med_int meshDim; std::map myFieldList; @@ -281,8 +289,14 @@ public slots: void onAddOption(); void itemChanged(QTreeWidgetItem * tblRow, int column); + void onMeshDimChanged(ADAPTATION_MODE aMode); private slots: void _onWorkingDirectoryPushButton(); +private: + void setOptionValue(QString& option, QString& value); + std::map optionTreeWidgetItem; + + QTreeWidgetItem* getNewQTreeWidgetItem(QTreeWidget* table, const char* option, QString& name, bool isCustom); }; diff --git a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx index 1e732a8a0..13a1d916c 100644 --- a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx +++ b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx @@ -339,6 +339,13 @@ void SMESHGUI_MG_ADAPTDRIVER::selectionChanged() myArgs->aBrowserObject->setText( aString ); myArgs->meshNameLineEdit->setText( aString ); myArgs->selectOutMedFileLineEdit->setText(aString+QString(".med")); + ADAPTATION_MODE aMode; + int nbVolumes = myMesh->NbVolumes(); + int nbFaces = myMesh->NbFaces(); + if(nbFaces > 0 && nbVolumes > 0) aMode = ADAPTATION_MODE::BOTH; + else if(nbFaces > 0) aMode = ADAPTATION_MODE::SURFACE; + else aMode = ADAPTATION_MODE::VOLUME; + emit myArgs->meshDimSignal(aMode); } } From 2e6d41859930a694e6df9302898e9fab77809428 Mon Sep 17 00:00:00 2001 From: azakir Date: Mon, 21 Dec 2020 10:41:06 +0100 Subject: [PATCH 060/100] MeshFormatWriter and MeshFormaReader are in MEDCOUPLING namespace --- src/SMESHGUI/MG_ADAPT.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SMESHGUI/MG_ADAPT.cxx b/src/SMESHGUI/MG_ADAPT.cxx index a75e9448c..3a1f56832 100644 --- a/src/SMESHGUI/MG_ADAPT.cxx +++ b/src/SMESHGUI/MG_ADAPT.cxx @@ -1105,7 +1105,7 @@ void MgAdapt::convertMedFile(std::string& meshFormatMeshFileName, std::string& s { std::vector fieldFileNames; - MeshFormatWriter writer; + MEDCoupling::MeshFormatWriter writer; MEDCoupling::MCAuto mfd = MEDCoupling::MEDFileData::New(medFileIn); MEDCoupling::MEDFileMeshes* meshes = mfd->getMeshes(); MEDCoupling::MEDFileMesh* fileMesh = meshes->getMeshAtPos(0); // ok only one mesh in file! @@ -1159,7 +1159,7 @@ void MgAdapt::convertMedFile(std::string& meshFormatMeshFileName, std::string& s void MgAdapt::convertMeshFile(std::string& meshFormatIn, std::vector< std::string>& solFieldFileNames) const { - MeshFormatReader reader(meshFormatIn, solFieldFileNames); + MEDCoupling::MeshFormatReader reader(meshFormatIn, solFieldFileNames); MEDCoupling::MCAuto mfd = reader.loadInMedFileDS(); // write MED @@ -1280,7 +1280,7 @@ void MgAdapt::buildBackGroundMeshAndSolFiles(const std::vector& fie tmpMfd->setFields( tmp_fields ); - MeshFormatWriter tmpWriter; + MEDCoupling::MeshFormatWriter tmpWriter; tmpWriter.setMeshFileName(meshFormatsizeMapFile); tmpWriter.setFieldFileNames( fieldFileNames); tmpWriter.setMEDFileDS(tmpMfd); From 147d2c026ddc55eea8b101eb608f698e763a472a Mon Sep 17 00:00:00 2001 From: azakir Date: Mon, 21 Dec 2020 15:46:50 +0100 Subject: [PATCH 061/100] correct timestep issues --- src/SMESHGUI/MG_ADAPT.cxx | 15 +++++++++++---- src/SMESHGUI/MG_ADAPTGUI.cxx | 4 ++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/SMESHGUI/MG_ADAPT.cxx b/src/SMESHGUI/MG_ADAPT.cxx index 3a1f56832..b65696e97 100644 --- a/src/SMESHGUI/MG_ADAPT.cxx +++ b/src/SMESHGUI/MG_ADAPT.cxx @@ -1366,9 +1366,18 @@ void MgAdapt::getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit med_float dt; med_int tmp_numdt, tmp_numit; - med_int step = data->myUseLastTimeStep ? nbofcstp : data->myTimeStep+1; + //~med_int step = data->myUseLastTimeStep ? nbofcstp : data->myTimeStep+1; //~myPrint("step ", step); - erreur = MEDfieldComputingStepInfo ( medIdt, nomcha, step, &tmp_numdt, &tmp_numit, &dt ); + erreur = MEDfieldComputingStepInfo ( medIdt, nomcha, 1, &numdt, &numit, &dt ); + for(med_int step = 1; step <= nbofcstp; step++ ) + { + erreur = MEDfieldComputingStepInfo ( medIdt, nomcha, step, &tmp_numdt, &tmp_numit, &dt ); + if(tmp_numdt > numdt) + { + numdt = tmp_numdt; + numit = tmp_numit; + } + } if ( erreur < 0 ) { @@ -1377,8 +1386,6 @@ void MgAdapt::getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit return; } - numdt = tmp_numdt; - numit = tmp_numit; // Fermeture du fichier diff --git a/src/SMESHGUI/MG_ADAPTGUI.cxx b/src/SMESHGUI/MG_ADAPTGUI.cxx index 564271ac9..598e0cf3f 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.cxx +++ b/src/SMESHGUI/MG_ADAPTGUI.cxx @@ -693,7 +693,7 @@ void SMESHGUI_MgAdaptArguments::onSelectMedFileBackgroundbutton() { fieldNameCmb->insertItem(0,QString(it->first)); int typeStepInField = it->second > 2 ? 2 : it->second ; - timeStepGroupChanged(typeStepInField, true, it->second-1); + timeStepGroupChanged(typeStepInField, true); } } @@ -794,7 +794,7 @@ void SMESHGUI_MgAdaptArguments::onLocalSelected(QString filePath) { fieldNameCmb->insertItem(0,QString(it->first)); int typeStepInField = it->second > 2 ? 2 : it->second ; - timeStepGroupChanged(typeStepInField, true, it->second-1); + timeStepGroupChanged(typeStepInField, true); } } From 248e60643509215bc3b3b37b4da3be0e17380b6d Mon Sep 17 00:00:00 2001 From: azakir Date: Wed, 23 Dec 2020 10:33:06 +0100 Subject: [PATCH 062/100] naming param in method declaration --- src/SMESHGUI/MG_ADAPT.cxx | 2 +- src/SMESHGUI/MG_ADAPT.hxx | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/SMESHGUI/MG_ADAPT.cxx b/src/SMESHGUI/MG_ADAPT.cxx index b65696e97..8a74bc78e 100644 --- a/src/SMESHGUI/MG_ADAPT.cxx +++ b/src/SMESHGUI/MG_ADAPT.cxx @@ -370,7 +370,7 @@ void MgAdapt::setConstantValue(double cnst) { constantValue = cnst; } -bool MgAdapt::getConstantValue() +double MgAdapt::getConstantValue() const { return constantValue; } diff --git a/src/SMESHGUI/MG_ADAPT.hxx b/src/SMESHGUI/MG_ADAPT.hxx index 379671f91..e25101dfb 100644 --- a/src/SMESHGUI/MG_ADAPT.hxx +++ b/src/SMESHGUI/MG_ADAPT.hxx @@ -120,45 +120,45 @@ public: void buildModel(); void setData( MgAdaptHypothesisData*); - void setMedFileIn(std::string); + void setMedFileIn(std::string fileName); std::string getMedFileIn(); - void setMedFileOut(std::string); + void setMedFileOut(std::string fileOut); std::string getMedFileOut(); - void setMeshName(std::string); + void setMeshName(std::string name); std::string getMeshName(); - void setMeshNameOut(std::string); + void setMeshNameOut(std::string name); std::string getMeshNameOut(); - void setMeshOutMed(bool); + void setMeshOutMed(bool mybool); bool getMeshOutMed(); - void setPublish(bool); + void setPublish(bool mybool); bool getPublish(); - void setFieldName(std::string); + void setFieldName(std::string myFieldName); std::string getFieldName(); - void setTimeStep(int); + void setTimeStep(int time); int getTimeStep() const; - void setRankTimeStep(int, int ); + void setRankTimeStep(int time, int myRank); int getRank(); void setLogFile(std::string); std::string getLogFile(); - void setVerbosityLevel(int); + void setVerbosityLevel(int verbosity); int getVerbosityLevel(); - void setRemoveOnSuccess(bool); + void setRemoveOnSuccess(bool mybool); bool getRemoveOnSuccess(); MgAdaptHypothesisData* getData() const; - void setUseLocalMap(bool); + void setUseLocalMap(bool mybool); bool getUseLocalMap(); void setUseBackgroundMap(bool); @@ -168,7 +168,7 @@ public: bool getUseConstantValue(); void setConstantValue(double); - bool getConstantValue(); + double getConstantValue() const; void setSizeMapFile(std::string); std::string getSizeMapFile(); From 1a5fa0f4c0bb69276916a503612b0388613d0193 Mon Sep 17 00:00:00 2001 From: azakir Date: Tue, 5 Jan 2021 11:18:05 +0100 Subject: [PATCH 063/100] replace files in their respective rep --- src/ADAPT/CMakeLists.txt | 4 ++++ src/{SMESHGUI => ADAPT}/MG_ADAPT.cxx | 0 src/{SMESHGUI => ADAPT}/MG_ADAPT.hxx | 20 ++++++++++---------- src/ADAPTGUI/CMakeLists.txt | 4 ++++ src/{SMESHGUI => ADAPTGUI}/MG_ADAPTGUI.cxx | 12 ++++++------ src/{SMESHGUI => ADAPTGUI}/MG_ADAPTGUI.hxx | 0 src/SMESHGUI/CMakeLists.txt | 10 ++++++---- 7 files changed, 30 insertions(+), 20 deletions(-) rename src/{SMESHGUI => ADAPT}/MG_ADAPT.cxx (100%) rename src/{SMESHGUI => ADAPT}/MG_ADAPT.hxx (95%) rename src/{SMESHGUI => ADAPTGUI}/MG_ADAPTGUI.cxx (99%) rename src/{SMESHGUI => ADAPTGUI}/MG_ADAPTGUI.hxx (100%) diff --git a/src/ADAPT/CMakeLists.txt b/src/ADAPT/CMakeLists.txt index 728d7203d..fe9b1ef74 100644 --- a/src/ADAPT/CMakeLists.txt +++ b/src/ADAPT/CMakeLists.txt @@ -21,6 +21,7 @@ # additional include directories INCLUDE_DIRECTORIES( ${KERNEL_INCLUDE_DIRS} + ${MEDCOUPLING_INCLUDE_DIRS} ) # additional preprocessor / compiler flags @@ -31,6 +32,7 @@ ADD_DEFINITIONS( # libraries to link to SET(_link_LIBRARIES ${KERNEL_SALOMELocalTrace} + ${MEDCoupling_medloader} ) # --- headers --- @@ -48,6 +50,7 @@ SET(ADAPTImpl_HEADERS HOMARD_YACS.hxx HomardDriver.hxx YACSDriver.hxx + MG_ADAPT.hxx ) # --- sources --- @@ -64,6 +67,7 @@ SET(ADAPTImpl_SOURCES HOMARD_YACS.cxx HomardDriver.cxx YACSDriver.cxx + MG_ADAPT.cxx ) # --- rules --- diff --git a/src/SMESHGUI/MG_ADAPT.cxx b/src/ADAPT/MG_ADAPT.cxx similarity index 100% rename from src/SMESHGUI/MG_ADAPT.cxx rename to src/ADAPT/MG_ADAPT.cxx diff --git a/src/SMESHGUI/MG_ADAPT.hxx b/src/ADAPT/MG_ADAPT.hxx similarity index 95% rename from src/SMESHGUI/MG_ADAPT.hxx rename to src/ADAPT/MG_ADAPT.hxx index e25101dfb..d597cf5f2 100644 --- a/src/SMESHGUI/MG_ADAPT.hxx +++ b/src/ADAPT/MG_ADAPT.hxx @@ -161,28 +161,28 @@ public: void setUseLocalMap(bool mybool); bool getUseLocalMap(); - void setUseBackgroundMap(bool); + void setUseBackgroundMap(bool mybool); bool getUseBackgroundMap(); - void setUseConstantValue(bool); + void setUseConstantValue(bool mybool); bool getUseConstantValue(); - void setConstantValue(double); + void setConstantValue(double cnst); double getConstantValue() const; - void setSizeMapFile(std::string); + void setSizeMapFile(std::string mapFile); std::string getSizeMapFile(); - void setFromMedFile(bool); + void setFromMedFile(bool mybool); bool isFromMedFile(); - void setKeepWorkingFiles(bool); + void setKeepWorkingFiles(bool mybool); bool getKeepWorkingFiles(); - void setPrintLogInFile(bool); + void setPrintLogInFile(bool mybool); bool getPrintLogInFile(); - void setWorkingDir(std::string); + void setWorkingDir(std::string dir); std::string getWorkingDir() const; @@ -192,9 +192,9 @@ public: int compute(std::string& errStr); std::string getFileName() const; static std::string getExeName(); - void copyMgAdaptHypothesisData( MgAdaptHypothesisData* ) ; + void copyMgAdaptHypothesisData( MgAdaptHypothesisData* from) ; - void checkDirPath(std::string& ); + void checkDirPath(std::string& dirPath); diff --git a/src/ADAPTGUI/CMakeLists.txt b/src/ADAPTGUI/CMakeLists.txt index 7008df0b0..8ab085563 100644 --- a/src/ADAPTGUI/CMakeLists.txt +++ b/src/ADAPTGUI/CMakeLists.txt @@ -39,6 +39,7 @@ INCLUDE_DIRECTORIES( ${PROJECT_BINARY_DIR}/adm_local/unix ${PROJECT_SOURCE_DIR}/src/ADAPT ${PROJECT_SOURCE_DIR}/src/ADAPT_I + ${MEDCOUPLING_INCLUDE_DIRS} ) # additional preprocessor / compiler flags @@ -56,6 +57,7 @@ SET(_link_LIBRARIES ${GUI_SalomeApp} ${SMESH_SalomeIDLSMESH} ADAPTEngine + ${MEDCoupling_medloader} ) # --- resources --- @@ -112,6 +114,7 @@ SET(_moc_HEADERS MonCreateYACS.h MonEditYACS.h MonEditFile.h + MG_ADAPTGUI.hxx ) # header files / uic wrappings @@ -160,6 +163,7 @@ SET(_other_SOURCES MonEditYACS.cxx MonEditFile.cxx HomardQtCommun.cxx + MG_ADAPTGUI.cxx ) # sources / to compile diff --git a/src/SMESHGUI/MG_ADAPTGUI.cxx b/src/ADAPTGUI/MG_ADAPTGUI.cxx similarity index 99% rename from src/SMESHGUI/MG_ADAPTGUI.cxx rename to src/ADAPTGUI/MG_ADAPTGUI.cxx index 598e0cf3f..af8c47e24 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.cxx +++ b/src/ADAPTGUI/MG_ADAPTGUI.cxx @@ -30,13 +30,13 @@ #include "SalomeApp_Application.h" #include "SalomeApp_Module.h" #include "SalomeApp_Study.h" -#include "SMESH_Actor.h" +//~#include "SMESH_Actor.h" #include -#include -#include -#include -#include -#include +//~#include +//~#include +//~#include +//~#include +//~#include #include #include #include diff --git a/src/SMESHGUI/MG_ADAPTGUI.hxx b/src/ADAPTGUI/MG_ADAPTGUI.hxx similarity index 100% rename from src/SMESHGUI/MG_ADAPTGUI.hxx rename to src/ADAPTGUI/MG_ADAPTGUI.hxx diff --git a/src/SMESHGUI/CMakeLists.txt b/src/SMESHGUI/CMakeLists.txt index df5580f27..59f09da98 100644 --- a/src/SMESHGUI/CMakeLists.txt +++ b/src/SMESHGUI/CMakeLists.txt @@ -42,10 +42,12 @@ INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/src/Controls ${PROJECT_SOURCE_DIR}/src/SMESHClient ${PROJECT_SOURCE_DIR}/src/MEDWrapper + ${PROJECT_SOURCE_DIR}/src/ADAPT ${PROJECT_SOURCE_DIR}/src/ADAPTGUI ${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}/idl ${PROJECT_BINARY_DIR}/src/ADAPTGUI + ${PROJECT_BINARY_DIR}/src/ADAPT ${MEDCOUPLING_INCLUDE_DIRS} ) @@ -154,7 +156,7 @@ SET(_moc_HEADERS SMESHGUI_PreVisualObj.h SMESHGUI_AdaptDlg.h SMESHGUI_MG_ADAPTDRIVER.h - MG_ADAPTGUI.hxx # to replace in ../ADAPTGUI/ + #~MG_ADAPTGUI.hxx # to replace in ../ADAPTGUI/ ) # header files / no moc processing @@ -177,7 +179,7 @@ SET(_other_HEADERS SMESHGUI_FileValidator.h SMESHGUI_SelectionProxy.h SMESH_SMESHGUI.hxx - MG_ADAPT.hxx # to replace in ../ADAPT/ + #~MG_ADAPT.hxx # to replace in ../ADAPT/ ) # header files / to install @@ -273,8 +275,8 @@ SET(_other_SOURCES SMESHGUI_IdPreview.cxx SMESHGUI_AdaptDlg.cxx SMESHGUI_MG_ADAPTDRIVER.cxx - MG_ADAPTGUI.cxx # to replace in ../ADAPTGUI/ - MG_ADAPT.cxx # to replace in ../ADAPT/ + #~MG_ADAPTGUI.cxx # to replace in ../ADAPTGUI/ + #MG_ADAPT.cxx ) # sources / to compile From 8b1d1d4dbc61d8e5b654855eef567cb35738cdfe Mon Sep 17 00:00:00 2001 From: azakir Date: Thu, 7 Jan 2021 17:07:11 +0100 Subject: [PATCH 064/100] add src/ADAPT_I/MG_ADAPT_i.* files --- idl/CMakeLists.txt | 1 + idl/MG_ADAPT.idl | 142 +++++++++++++++++ src/ADAPT_I/CMakeLists.txt | 4 + src/ADAPT_I/MG_ADAPT_i.cxx | 302 +++++++++++++++++++++++++++++++++++++ src/ADAPT_I/MG_ADAPT_i.hxx | 123 +++++++++++++++ 5 files changed, 572 insertions(+) create mode 100644 idl/MG_ADAPT.idl create mode 100644 src/ADAPT_I/MG_ADAPT_i.cxx create mode 100644 src/ADAPT_I/MG_ADAPT_i.hxx diff --git a/idl/CMakeLists.txt b/idl/CMakeLists.txt index 7aabfb53b..4a67452e6 100644 --- a/idl/CMakeLists.txt +++ b/idl/CMakeLists.txt @@ -43,6 +43,7 @@ SET(SalomeIDLSMESH_IDLSOURCES HOMARD_Iteration.idl HOMARD_YACS.idl HOMARD_Zone.idl + MG_ADAPT.idl ) SET(_idl_include_dirs diff --git a/idl/MG_ADAPT.idl b/idl/MG_ADAPT.idl new file mode 100644 index 000000000..3cbda07f7 --- /dev/null +++ b/idl/MG_ADAPT.idl @@ -0,0 +1,142 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ +// +// File : MG_ADAPT.hxx +// +#ifndef MG_ADAPT_IDL +#define MG_ADAPT_IDL + + +#include "SALOME_Component.idl" +#include "SALOME_Exception.idl" +#include "SALOMEDS.idl" + +module ADAPT{ + + typedef sequence string_array ; + struct MgAdaptHypothesisData + { + string myFileInDir, myMeshFileIn, myInMeshName, myMeshFileBackground, myOutMeshName, + myMeshFileOut, myFileOutDir, myFileSizeMapDir, myFieldName; + boolean fromMedFile; + boolean myPublish, myMeshOutMed; + boolean myUseLocalMap, myUseBackgroundMap, myUseConstantValue; + double myConstantValue; + long myRank, myTimeStep; + boolean myUseNoTimeStep, myUseLastTimeStep, myUseChosenTimeStep; + string myWorkingDir, myLogFile; + boolean myPrintLogInFile, myKeepFiles, myRemoveLogOnSuccess; + long myVerboseLevel; + + }; + + + interface MG_ADAPT : Engines::EngineComponent + { + + void setData( in MgAdaptHypothesisData data); + + void setMedFileIn(in string MedFileIn ); + string getMedFileIn(); + + void setMedFileOut(in string MedFileOut); + string getMedFileOut(); + + void setMeshName(in string s); + string getMeshName(); + + void setMeshNameOut(in string s); + string getMeshNameOut(); + + void setMeshOutMed(in boolean b); + boolean getMeshOutMed(); + + void setPublish(in boolean b); + boolean getPublish(); + + void setFieldName(in string s); + string getFieldName(); + + void setTimeStep(in long s); + long getTimeStep() ; + + void setRankTimeStep(in long s, in long f); + long getRank(); + + void setLogFile(in string f); + string getLogFile(); + + void setVerbosityLevel(in long f); + long getVerbosityLevel(); + + void setRemoveOnSuccess(in boolean f); + boolean getRemoveOnSuccess(); + + MgAdaptHypothesisData getData(); + + void setUseLocalMap(in boolean f); + boolean getUseLocalMap(); + + void setUseBackgroundMap(in boolean f); + boolean getUseBackgroundMap(); + + void setUseConstantValue(in boolean f); + boolean getUseConstantValue(); + + void setConstantValue(in double f); + double getConstantValue() ; + + void setSizeMapFile(in string f); + string getSizeMapFile(); + + void setFromMedFile(in boolean f); + boolean isFromMedFile(); + + void setKeepWorkingFiles(in boolean f); + boolean getKeepWorkingFiles(); + + void setPrintLogInFile(in boolean f); + boolean getPrintLogInFile(); + + void setWorkingDir(in string f); + string getWorkingDir() ; + + + boolean setAll(); + string getCommandToRun() ; + long compute(inout string errStr); + string getFileName() ; + string getExeName(); + void copyMgAdaptHypothesisData(in MgAdaptHypothesisData f ) ; + + void checkDirPath(in string f); + + + + boolean hasOptionDefined( in string optionName ) ; + void setOptionValue(in string optionName, + in string optionValue) raises (SALOME::SALOME_Exception); + string getOptionValue(in string optionName, + in boolean isDefault) raises (SALOME::SALOME_Exception); + string_array getCustomOptionValuesStrVec() ; + string_array getOptionValuesStrVec() ; + }; + + +}; +#endif // MG_ADAPT_IDL diff --git a/src/ADAPT_I/CMakeLists.txt b/src/ADAPT_I/CMakeLists.txt index d604458fb..b6e7bad12 100644 --- a/src/ADAPT_I/CMakeLists.txt +++ b/src/ADAPT_I/CMakeLists.txt @@ -37,6 +37,7 @@ INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/src/SMESHDS ${PROJECT_SOURCE_DIR}/src/SMDS ${PROJECT_SOURCE_DIR}/src/SMESHUtils + ${MEDCOUPLING_INCLUDE_DIRS} ) # additional preprocessor / compiler flags ADD_DEFINITIONS( @@ -55,6 +56,7 @@ SET(_link_LIBRARIES ${KERNEL_SalomeGenericObj} ${SMESH_SalomeIDLSMESH} ${SMESH_SMESHEngine} + ${MEDCoupling_medloader} ADAPTFrontTrack ADAPTImpl SMESHimpl @@ -73,6 +75,7 @@ SET(ADAPTEngine_HEADERS HOMARD_YACS_i.hxx HomardMedCommun.h HOMARD_i.hxx + MG_ADAPT_i.cxx ) # --- sources --- @@ -87,6 +90,7 @@ SET(ADAPTEngine_SOURCES HOMARD_Boundary_i.cxx HOMARD_YACS_i.cxx HomardMedCommun.cxx + MG_ADAPT_i.cxx ) # --- rules --- diff --git a/src/ADAPT_I/MG_ADAPT_i.cxx b/src/ADAPT_I/MG_ADAPT_i.cxx new file mode 100644 index 000000000..5a056d955 --- /dev/null +++ b/src/ADAPT_I/MG_ADAPT_i.cxx @@ -0,0 +1,302 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#include "MG_ADAPT_i.hxx" +#include "ADAPT_Gen_i.hxx" +#include "MG_ADAPT.hxx" +#include "string.h" + +//============================================================================= +/*! + * standard constructor + */ +//============================================================================= +MG_ADAPT_i::MG_ADAPT_i() +{ + MESSAGE( "Default constructor, not for use" ); + ASSERT( 0 ); +} + +//============================================================================= +/*! + * standard constructor + */ +//============================================================================= +MG_ADAPT_i::MG_ADAPT_i( CORBA::ORB_ptr orb, + ADAPT::ADAPT_Gen_var engine ) +{ + + _gen_i = engine; + _orb = orb; + myMgAdapt = new MgAdapt(); + //~ASSERT( myHomardCas ); +} + +//============================================================================= +/*! + * standard destructor + */ +//============================================================================= +MG_ADAPT_i::~MG_ADAPT_i() +{ +} +void MG_ADAPT_i::setData( MgAdaptHypothesisData* data) +{ + myMgAdapt->setData(data); +} +void MG_ADAPT_i::setMedFileIn(char* str) +{ + myMgAdapt->setMedFileIn(str); +} +char* MG_ADAPT_i::getMedFileIn() +{ + return CORBA::string_dup(myMgAdapt->getMedFileIn().c_str()); +} +void MG_ADAPT_i::setMedFileOut(char* str) +{ + myMgAdapt->setMedFileOut(str); +} +char* MG_ADAPT_i::getMedFileOut() +{ + return CORBA::string_dup(myMgAdapt->getMedFileOut().c_str()); +} +void MG_ADAPT_i::setMeshName(char* str) +{ + myMgAdapt->setMeshName(str); +} +char* MG_ADAPT_i::getMeshName() +{ + return CORBA::string_dup(myMgAdapt->getMeshName().c_str()); +} +void MG_ADAPT_i::setMeshNameOut(char* str) +{ + myMgAdapt->setMeshNameOut(str); +} +char* MG_ADAPT_i::getMeshNameOut() +{ + return CORBA::string_dup(myMgAdapt->getMeshNameOut().c_str()); +} +void MG_ADAPT_i::setMeshOutMed(bool mybool) +{ + myMgAdapt->setMeshOutMed(mybool); +} +bool MG_ADAPT_i::getMeshOutMed() +{ + return myMgAdapt->getMeshOutMed(); +} +void MG_ADAPT_i::setPublish(bool mybool) +{ + myMgAdapt->setPublish(mybool); +} +bool MG_ADAPT_i::getPublish() +{ + return myMgAdapt->getPublish(); +} +void MG_ADAPT_i::setFieldName(char* str) +{ + myMgAdapt->setFieldName(str); +} +char* MG_ADAPT_i::getFieldName() +{ + return CORBA::string_dup(myMgAdapt->getFieldName().c_str()); +} +void MG_ADAPT_i::setTimeStep(CORBA::Long t) +{ + myMgAdapt->setTimeStep(t); +} +CORBA::Long MG_ADAPT_i::getTimeStep() const +{ + return myMgAdapt->getTimeStep(); +} +void MG_ADAPT_i::setRankTimeStep(CORBA::Long t, CORBA::Long r) +{ + myMgAdapt->setRankTimeStep(t, r); +} +CORBA::Long MG_ADAPT_i::getRank() +{ + return myMgAdapt->getRank(); +} +void MG_ADAPT_i::setLogFile(char* str) +{ + myMgAdapt->setLogFile(str); +} +char* MG_ADAPT_i::getLogFile() +{ + return CORBA::string_dup(myMgAdapt->getLogFile().c_str()); +} + +void MG_ADAPT_i::setVerbosityLevel(CORBA::Long v) +{ + myMgAdapt->setVerbosityLevel(v); +} +CORBA::Long MG_ADAPT_i::getVerbosityLevel() +{ + return myMgAdapt->getVerbosityLevel(); +} +void MG_ADAPT_i::setRemoveOnSuccess(bool mybool) +{ + myMgAdapt->setRemoveOnSuccess(mybool); +} +bool MG_ADAPT_i::getRemoveOnSuccess() +{ + myMgAdapt->getRemoveOnSuccess(); +} +MgAdaptHypothesisData* MG_ADAPT_i::getData() const +{ + return myMgAdapt->getData(); +} +void MG_ADAPT_i::setUseLocalMap(bool mybool) +{ + myMgAdapt->setUseLocalMap(mybool); +} +bool MG_ADAPT_i::getUseLocalMap() +{ + return myMgAdapt->getUseLocalMap(); +} +void MG_ADAPT_i::setUseBackgroundMap(bool mybool) +{ + myMgAdapt->setUseBackgroundMap(mybool); +} +bool MG_ADAPT_i::getUseBackgroundMap() +{ + return myMgAdapt->getUseBackgroundMap(); +} +void MG_ADAPT_i::setUseConstantValue(bool mybool) +{ + myMgAdapt->setUseConstantValue(mybool); +} +bool MG_ADAPT_i::getUseConstantValue() +{ + return myMgAdapt->getUseConstantValue(); +} + +void MG_ADAPT_i::setConstantValue(double value) +{ + myMgAdapt->setConstantValue(value); +} +double MG_ADAPT_i::getConstantValue() const +{ + return myMgAdapt->getConstantValue(); +} +void MG_ADAPT_i::setSizeMapFile(char* str) +{ + myMgAdapt->setSizeMapFile(str); +} +char* MG_ADAPT_i::getSizeMapFile() +{ + return CORBA::string_dup(myMgAdapt->getSizeMapFile().c_str()); +} +void MG_ADAPT_i::setFromMedFile(bool mybool) +{ + myMgAdapt->setFromMedFile(mybool); +} +bool MG_ADAPT_i::isFromMedFile() +{ + return myMgAdapt->isFromMedFile(); +} + +void MG_ADAPT_i::setKeepWorkingFiles(bool mybool) +{ + myMgAdapt->setKeepWorkingFiles(mybool); +} +bool MG_ADAPT_i::getKeepWorkingFiles() +{ + return myMgAdapt->getKeepWorkingFiles(); +} + +//~void MG_ADAPT_i::setPrCORBA::LongLogInFile(bool); +//~bool MG_ADAPT_i::getPrCORBA::LongLogInFile(); + +void MG_ADAPT_i::setWorkingDir(char* dir) +{ + myMgAdapt->setWorkingDir(dir); +} +char* MG_ADAPT_i::getWorkingDir() const +{ + return CORBA::string_dup(myMgAdapt->getWorkingDir().c_str()); +} +bool MG_ADAPT_i::setAll() +{ + return myMgAdapt->setAll(); +} +char* MG_ADAPT_i::getCommandToRun() +{ + return CORBA::string_dup(myMgAdapt->getCommandToRun().c_str()); +} +CORBA::Long MG_ADAPT_i::compute(char* errStr) +{ + std::string err(""); + CORBA::Long ret = myMgAdapt->compute(err); + strcpy(errStr, err.c_str()); + return ret; +} +char* MG_ADAPT_i::getFileName() const +{ + return CORBA::string_dup(myMgAdapt->getFileName().c_str()); +} +char* MG_ADAPT_i::getExeName() +{ + return CORBA::string_dup(myMgAdapt->getExeName().c_str()); +} +void MG_ADAPT_i::copyMgAdaptHypothesisData( MgAdaptHypothesisData* data) +{ + myMgAdapt->copyMgAdaptHypothesisData(data); +} + +void MG_ADAPT_i::checkDirPath(std::string& str) +{ + myMgAdapt->checkDirPath(str); +} + +bool MG_ADAPT_i::hasOptionDefined( const char* optionName ) const +{ + return myMgAdapt->hasOptionDefined(optionName); +} +void MG_ADAPT_i::setOptionValue(const char* optionName, + const char* optionValue) throw (std::invalid_argument) +{ + myMgAdapt->setOptionValue(optionName, optionValue); +} +std::string MG_ADAPT_i::getOptionValue(const char* optionName, + bool* isDefault) const throw (std::invalid_argument) +{ + return myMgAdapt->getOptionValue(optionName, isDefault); +} +std::vector MG_ADAPT_i::getCustomOptionValuesStrVec() const +{ + return myMgAdapt->getCustomOptionValuesStrVec(); +} +std::vector MG_ADAPT_i::getOptionValuesStrVec() const +{ + return myMgAdapt->getOptionValuesStrVec(); +} + + +//~TOptionValues MG_ADAPT_i::getOptionValues() const; +//~const TOptionValues& MG_ADAPT_i::getCustomOptionValues() const ; diff --git a/src/ADAPT_I/MG_ADAPT_i.hxx b/src/ADAPT_I/MG_ADAPT_i.hxx new file mode 100644 index 000000000..657fca93a --- /dev/null +++ b/src/ADAPT_I/MG_ADAPT_i.hxx @@ -0,0 +1,123 @@ +#ifndef MG_ADAPT_I_HXX +#define MG_ADAPT_I_HXX + +#include +#include CORBA_SERVER_HEADER(ADAPT_Gen) +#include CORBA_SERVER_HEADER(MG_ADAPT) + +#include "SALOME_Component_i.hxx" +#include "SALOME_NamingService.hxx" +#include "Utils_CorbaException.hxx" + +#include + +struct MgAdaptHypothesisData; +class MgAdapt; + +class MG_ADAPT_i : + public virtual Engines_Component_i, + public virtual POA_ADAPT::MG_ADAPT, + public virtual PortableServer::ServantBase +{ +public: + MG_ADAPT_i( CORBA::ORB_ptr orb, ADAPT::ADAPT_Gen_var gen_i ); + MG_ADAPT_i(); + virtual ~MG_ADAPT_i(); + void setData( MgAdaptHypothesisData*); + + void setMedFileIn(char* str); + char* getMedFileIn(); + + void setMedFileOut(char* str); + char* getMedFileOut(); + + void setMeshName(char* str); + char* getMeshName(); + + void setMeshNameOut(char* str); + char* getMeshNameOut(); + + void setMeshOutMed(bool mybool); + bool getMeshOutMed(); + + void setPublish(bool mybool); + bool getPublish(); + + void setFieldName(char* str); + char* getFieldName(); + + void setTimeStep(CORBA::Long t); + CORBA::Long getTimeStep() const; + + void setRankTimeStep(CORBA::Long t, CORBA::Long r ); + CORBA::Long getRank(); + + void setLogFile(char* str); + char* getLogFile(); + + void setVerbosityLevel(CORBA::Long v); + CORBA::Long getVerbosityLevel(); + + void setRemoveOnSuccess(bool mybool); + bool getRemoveOnSuccess(); + + MgAdaptHypothesisData* getData() const; + + void setUseLocalMap(bool mybool); + bool getUseLocalMap(); + + void setUseBackgroundMap(bool mybool); + bool getUseBackgroundMap(); + + void setUseConstantValue(bool mybool); + bool getUseConstantValue(); + + void setConstantValue(double value); + double getConstantValue() const; + + void setSizeMapFile(char* str); + char* getSizeMapFile(); + + void setFromMedFile(bool mybool); + bool isFromMedFile(); + + void setKeepWorkingFiles(bool mybool); + bool getKeepWorkingFiles(); + + //~void setPrCORBA::LongLogInFile(bool); + //~bool getPrCORBA::LongLogInFile(); + + void setWorkingDir(char* str); + char* getWorkingDir() const; + + + bool setAll(); + char* getCommandToRun() ; + CORBA::Long compute(char* errStr); + char* getFileName() const; + char* getExeName(); + void copyMgAdaptHypothesisData( MgAdaptHypothesisData* data ) ; + + void checkDirPath(std::string& str); + + + + bool hasOptionDefined( const char* optionName ) const; + void setOptionValue(const char* optionName, + const char* optionValue) throw (std::invalid_argument); + std::string getOptionValue(const char* optionName, + bool* isDefault=0) const throw (std::invalid_argument); + std::vector getCustomOptionValuesStrVec() const; + std::vector getOptionValuesStrVec() const; + + + //~TOptionValues getOptionValues() const; + //~const TOptionValues& getCustomOptionValues() const ; +private: + MgAdapt* myMgAdapt; + + CORBA::ORB_ptr _orb; + ADAPT::ADAPT_Gen_var _gen_i; + +}; +#endif // MG_ADAPT_I_HXX From d89ac41df1b7ff1c52366444f6228c0a6450cd1c Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Tue, 12 Jan 2021 09:56:59 +0100 Subject: [PATCH 065/100] =?UTF-8?q?retour=20arri=C3=A8re?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/SalomeApp.xml.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in index c3f660aac..e3ad3743c 100644 --- a/resources/SalomeApp.xml.in +++ b/resources/SalomeApp.xml.in @@ -130,9 +130,9 @@
- +
- +
From 6e11711875a44f73be05523f67828d6491ff6c18 Mon Sep 17 00:00:00 2001 From: azakir Date: Tue, 12 Jan 2021 14:18:03 +0100 Subject: [PATCH 066/100] TUI first dev --- idl/MG_ADAPT.idl | 25 +- idl/SMESH_Gen.idl | 5 +- src/ADAPT/CMakeLists.txt | 4 +- src/ADAPTGUI/CMakeLists.txt | 8 +- src/ADAPT_I/CMakeLists.txt | 6 +- src/ADAPT_I/MG_ADAPT_i.cxx | 302 --------------- src/ADAPT_I/MG_ADAPT_i.hxx | 123 ------ src/SMESH/CMakeLists.txt | 4 + src/{ADAPT => SMESH}/MG_ADAPT.cxx | 24 +- src/{ADAPT => SMESH}/MG_ADAPT.hxx | 17 +- src/SMESHGUI/CMakeLists.txt | 7 +- src/{ADAPTGUI => SMESHGUI}/MG_ADAPTGUI.cxx | 79 ++-- src/{ADAPTGUI => SMESHGUI}/MG_ADAPTGUI.hxx | 18 +- src/SMESHGUI/SMESHGUI_AdaptDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx | 34 +- src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.h | 21 +- src/SMESH_I/CMakeLists.txt | 6 + src/SMESH_I/MG_ADAPT_i.cxx | 427 +++++++++++++++++++++ src/SMESH_I/MG_ADAPT_i.hxx | 138 +++++++ src/SMESH_I/SMESH_Gen_i.hxx | 1 + 20 files changed, 702 insertions(+), 555 deletions(-) delete mode 100644 src/ADAPT_I/MG_ADAPT_i.cxx delete mode 100644 src/ADAPT_I/MG_ADAPT_i.hxx rename src/{ADAPT => SMESH}/MG_ADAPT.cxx (98%) rename src/{ADAPT => SMESH}/MG_ADAPT.hxx (97%) rename src/{ADAPTGUI => SMESHGUI}/MG_ADAPTGUI.cxx (94%) rename src/{ADAPTGUI => SMESHGUI}/MG_ADAPTGUI.hxx (91%) create mode 100644 src/SMESH_I/MG_ADAPT_i.cxx create mode 100644 src/SMESH_I/MG_ADAPT_i.hxx diff --git a/idl/MG_ADAPT.idl b/idl/MG_ADAPT.idl index 3cbda07f7..8f9311e75 100644 --- a/idl/MG_ADAPT.idl +++ b/idl/MG_ADAPT.idl @@ -24,11 +24,13 @@ #include "SALOME_Component.idl" #include "SALOME_Exception.idl" +#include "SALOME_GenericObj.idl" #include "SALOMEDS.idl" +#include "SMESH_Mesh.idl" -module ADAPT{ +module SMESH{ - typedef sequence string_array ; + typedef sequence str_array ; struct MgAdaptHypothesisData { string myFileInDir, myMeshFileIn, myInMeshName, myMeshFileBackground, myOutMeshName, @@ -46,10 +48,10 @@ module ADAPT{ }; - interface MG_ADAPT : Engines::EngineComponent + interface MG_ADAPT : SALOME::GenericObj { - - void setData( in MgAdaptHypothesisData data); + //MG_ADAPT CreateMG_ADAPT(in PortableServer::POA_var poa); + void setData( inout MgAdaptHypothesisData data); void setMedFileIn(in string MedFileIn ); string getMedFileIn(); @@ -77,6 +79,9 @@ module ADAPT{ void setRankTimeStep(in long s, in long f); long getRank(); + + void setTimeStepRankLast(); + void setNoTimeStep(); void setLogFile(in string f); string getLogFile(); @@ -119,12 +124,12 @@ module ADAPT{ boolean setAll(); string getCommandToRun() ; - long compute(inout string errStr); + long compute(out string errStr); string getFileName() ; string getExeName(); void copyMgAdaptHypothesisData(in MgAdaptHypothesisData f ) ; - void checkDirPath(in string f); + //void checkDirPath(inout string f); @@ -132,9 +137,9 @@ module ADAPT{ void setOptionValue(in string optionName, in string optionValue) raises (SALOME::SALOME_Exception); string getOptionValue(in string optionName, - in boolean isDefault) raises (SALOME::SALOME_Exception); - string_array getCustomOptionValuesStrVec() ; - string_array getOptionValuesStrVec() ; + inout boolean isDefault) raises (SALOME::SALOME_Exception); + str_array getCustomOptionValuesStrVec() ; + str_array getOptionValuesStrVec() ; }; diff --git a/idl/SMESH_Gen.idl b/idl/SMESH_Gen.idl index 69d725c7c..cee3f9c56 100644 --- a/idl/SMESH_Gen.idl +++ b/idl/SMESH_Gen.idl @@ -43,6 +43,7 @@ module SMESH interface FilterManager; interface SMESH_Pattern; interface Measurements; + interface MG_ADAPT; /*! * Tags definition @@ -136,7 +137,6 @@ module SMESH SMESH_Pattern GetPattern(); Measurements CreateMeasurements(); - /*! Set the current mode */ @@ -584,7 +584,8 @@ module SMESH in GEOM::GEOM_Object theGeom, in double theTolerance ); - + + MG_ADAPT CreateMG_ADAPT(); }; }; diff --git a/src/ADAPT/CMakeLists.txt b/src/ADAPT/CMakeLists.txt index fe9b1ef74..cfaabe454 100644 --- a/src/ADAPT/CMakeLists.txt +++ b/src/ADAPT/CMakeLists.txt @@ -50,7 +50,7 @@ SET(ADAPTImpl_HEADERS HOMARD_YACS.hxx HomardDriver.hxx YACSDriver.hxx - MG_ADAPT.hxx + #~MG_ADAPT.hxx ) # --- sources --- @@ -67,7 +67,7 @@ SET(ADAPTImpl_SOURCES HOMARD_YACS.cxx HomardDriver.cxx YACSDriver.cxx - MG_ADAPT.cxx + #~MG_ADAPT.cxx ) # --- rules --- diff --git a/src/ADAPTGUI/CMakeLists.txt b/src/ADAPTGUI/CMakeLists.txt index 8ab085563..6499859d3 100644 --- a/src/ADAPTGUI/CMakeLists.txt +++ b/src/ADAPTGUI/CMakeLists.txt @@ -39,6 +39,8 @@ INCLUDE_DIRECTORIES( ${PROJECT_BINARY_DIR}/adm_local/unix ${PROJECT_SOURCE_DIR}/src/ADAPT ${PROJECT_SOURCE_DIR}/src/ADAPT_I + ${PROJECT_SOURCE_DIR}/src/SMESH_I + ${PROJECT_SOURCE_DIR}/src/SMESH ${MEDCOUPLING_INCLUDE_DIRS} ) @@ -56,8 +58,10 @@ SET(_link_LIBRARIES ${KERNEL_SalomeDS} ${GUI_SalomeApp} ${SMESH_SalomeIDLSMESH} + ${SMESH_SMESHEngine} ADAPTEngine ${MEDCoupling_medloader} + SMESHimpl ) # --- resources --- @@ -114,7 +118,7 @@ SET(_moc_HEADERS MonCreateYACS.h MonEditYACS.h MonEditFile.h - MG_ADAPTGUI.hxx + #~MG_ADAPTGUI.hxx ) # header files / uic wrappings @@ -163,7 +167,7 @@ SET(_other_SOURCES MonEditYACS.cxx MonEditFile.cxx HomardQtCommun.cxx - MG_ADAPTGUI.cxx + #~MG_ADAPTGUI.cxx ) # sources / to compile diff --git a/src/ADAPT_I/CMakeLists.txt b/src/ADAPT_I/CMakeLists.txt index b6e7bad12..42b4ccc1a 100644 --- a/src/ADAPT_I/CMakeLists.txt +++ b/src/ADAPT_I/CMakeLists.txt @@ -57,9 +57,9 @@ SET(_link_LIBRARIES ${SMESH_SalomeIDLSMESH} ${SMESH_SMESHEngine} ${MEDCoupling_medloader} + SMESHimpl ADAPTFrontTrack ADAPTImpl - SMESHimpl ) # --- headers --- @@ -75,7 +75,7 @@ SET(ADAPTEngine_HEADERS HOMARD_YACS_i.hxx HomardMedCommun.h HOMARD_i.hxx - MG_ADAPT_i.cxx + #~MG_ADAPT_i.hxx ) # --- sources --- @@ -90,7 +90,7 @@ SET(ADAPTEngine_SOURCES HOMARD_Boundary_i.cxx HOMARD_YACS_i.cxx HomardMedCommun.cxx - MG_ADAPT_i.cxx + #~MG_ADAPT_i.cxx ) # --- rules --- diff --git a/src/ADAPT_I/MG_ADAPT_i.cxx b/src/ADAPT_I/MG_ADAPT_i.cxx deleted file mode 100644 index 5a056d955..000000000 --- a/src/ADAPT_I/MG_ADAPT_i.cxx +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier -// - -#include "MG_ADAPT_i.hxx" -#include "ADAPT_Gen_i.hxx" -#include "MG_ADAPT.hxx" -#include "string.h" - -//============================================================================= -/*! - * standard constructor - */ -//============================================================================= -MG_ADAPT_i::MG_ADAPT_i() -{ - MESSAGE( "Default constructor, not for use" ); - ASSERT( 0 ); -} - -//============================================================================= -/*! - * standard constructor - */ -//============================================================================= -MG_ADAPT_i::MG_ADAPT_i( CORBA::ORB_ptr orb, - ADAPT::ADAPT_Gen_var engine ) -{ - - _gen_i = engine; - _orb = orb; - myMgAdapt = new MgAdapt(); - //~ASSERT( myHomardCas ); -} - -//============================================================================= -/*! - * standard destructor - */ -//============================================================================= -MG_ADAPT_i::~MG_ADAPT_i() -{ -} -void MG_ADAPT_i::setData( MgAdaptHypothesisData* data) -{ - myMgAdapt->setData(data); -} -void MG_ADAPT_i::setMedFileIn(char* str) -{ - myMgAdapt->setMedFileIn(str); -} -char* MG_ADAPT_i::getMedFileIn() -{ - return CORBA::string_dup(myMgAdapt->getMedFileIn().c_str()); -} -void MG_ADAPT_i::setMedFileOut(char* str) -{ - myMgAdapt->setMedFileOut(str); -} -char* MG_ADAPT_i::getMedFileOut() -{ - return CORBA::string_dup(myMgAdapt->getMedFileOut().c_str()); -} -void MG_ADAPT_i::setMeshName(char* str) -{ - myMgAdapt->setMeshName(str); -} -char* MG_ADAPT_i::getMeshName() -{ - return CORBA::string_dup(myMgAdapt->getMeshName().c_str()); -} -void MG_ADAPT_i::setMeshNameOut(char* str) -{ - myMgAdapt->setMeshNameOut(str); -} -char* MG_ADAPT_i::getMeshNameOut() -{ - return CORBA::string_dup(myMgAdapt->getMeshNameOut().c_str()); -} -void MG_ADAPT_i::setMeshOutMed(bool mybool) -{ - myMgAdapt->setMeshOutMed(mybool); -} -bool MG_ADAPT_i::getMeshOutMed() -{ - return myMgAdapt->getMeshOutMed(); -} -void MG_ADAPT_i::setPublish(bool mybool) -{ - myMgAdapt->setPublish(mybool); -} -bool MG_ADAPT_i::getPublish() -{ - return myMgAdapt->getPublish(); -} -void MG_ADAPT_i::setFieldName(char* str) -{ - myMgAdapt->setFieldName(str); -} -char* MG_ADAPT_i::getFieldName() -{ - return CORBA::string_dup(myMgAdapt->getFieldName().c_str()); -} -void MG_ADAPT_i::setTimeStep(CORBA::Long t) -{ - myMgAdapt->setTimeStep(t); -} -CORBA::Long MG_ADAPT_i::getTimeStep() const -{ - return myMgAdapt->getTimeStep(); -} -void MG_ADAPT_i::setRankTimeStep(CORBA::Long t, CORBA::Long r) -{ - myMgAdapt->setRankTimeStep(t, r); -} -CORBA::Long MG_ADAPT_i::getRank() -{ - return myMgAdapt->getRank(); -} -void MG_ADAPT_i::setLogFile(char* str) -{ - myMgAdapt->setLogFile(str); -} -char* MG_ADAPT_i::getLogFile() -{ - return CORBA::string_dup(myMgAdapt->getLogFile().c_str()); -} - -void MG_ADAPT_i::setVerbosityLevel(CORBA::Long v) -{ - myMgAdapt->setVerbosityLevel(v); -} -CORBA::Long MG_ADAPT_i::getVerbosityLevel() -{ - return myMgAdapt->getVerbosityLevel(); -} -void MG_ADAPT_i::setRemoveOnSuccess(bool mybool) -{ - myMgAdapt->setRemoveOnSuccess(mybool); -} -bool MG_ADAPT_i::getRemoveOnSuccess() -{ - myMgAdapt->getRemoveOnSuccess(); -} -MgAdaptHypothesisData* MG_ADAPT_i::getData() const -{ - return myMgAdapt->getData(); -} -void MG_ADAPT_i::setUseLocalMap(bool mybool) -{ - myMgAdapt->setUseLocalMap(mybool); -} -bool MG_ADAPT_i::getUseLocalMap() -{ - return myMgAdapt->getUseLocalMap(); -} -void MG_ADAPT_i::setUseBackgroundMap(bool mybool) -{ - myMgAdapt->setUseBackgroundMap(mybool); -} -bool MG_ADAPT_i::getUseBackgroundMap() -{ - return myMgAdapt->getUseBackgroundMap(); -} -void MG_ADAPT_i::setUseConstantValue(bool mybool) -{ - myMgAdapt->setUseConstantValue(mybool); -} -bool MG_ADAPT_i::getUseConstantValue() -{ - return myMgAdapt->getUseConstantValue(); -} - -void MG_ADAPT_i::setConstantValue(double value) -{ - myMgAdapt->setConstantValue(value); -} -double MG_ADAPT_i::getConstantValue() const -{ - return myMgAdapt->getConstantValue(); -} -void MG_ADAPT_i::setSizeMapFile(char* str) -{ - myMgAdapt->setSizeMapFile(str); -} -char* MG_ADAPT_i::getSizeMapFile() -{ - return CORBA::string_dup(myMgAdapt->getSizeMapFile().c_str()); -} -void MG_ADAPT_i::setFromMedFile(bool mybool) -{ - myMgAdapt->setFromMedFile(mybool); -} -bool MG_ADAPT_i::isFromMedFile() -{ - return myMgAdapt->isFromMedFile(); -} - -void MG_ADAPT_i::setKeepWorkingFiles(bool mybool) -{ - myMgAdapt->setKeepWorkingFiles(mybool); -} -bool MG_ADAPT_i::getKeepWorkingFiles() -{ - return myMgAdapt->getKeepWorkingFiles(); -} - -//~void MG_ADAPT_i::setPrCORBA::LongLogInFile(bool); -//~bool MG_ADAPT_i::getPrCORBA::LongLogInFile(); - -void MG_ADAPT_i::setWorkingDir(char* dir) -{ - myMgAdapt->setWorkingDir(dir); -} -char* MG_ADAPT_i::getWorkingDir() const -{ - return CORBA::string_dup(myMgAdapt->getWorkingDir().c_str()); -} -bool MG_ADAPT_i::setAll() -{ - return myMgAdapt->setAll(); -} -char* MG_ADAPT_i::getCommandToRun() -{ - return CORBA::string_dup(myMgAdapt->getCommandToRun().c_str()); -} -CORBA::Long MG_ADAPT_i::compute(char* errStr) -{ - std::string err(""); - CORBA::Long ret = myMgAdapt->compute(err); - strcpy(errStr, err.c_str()); - return ret; -} -char* MG_ADAPT_i::getFileName() const -{ - return CORBA::string_dup(myMgAdapt->getFileName().c_str()); -} -char* MG_ADAPT_i::getExeName() -{ - return CORBA::string_dup(myMgAdapt->getExeName().c_str()); -} -void MG_ADAPT_i::copyMgAdaptHypothesisData( MgAdaptHypothesisData* data) -{ - myMgAdapt->copyMgAdaptHypothesisData(data); -} - -void MG_ADAPT_i::checkDirPath(std::string& str) -{ - myMgAdapt->checkDirPath(str); -} - -bool MG_ADAPT_i::hasOptionDefined( const char* optionName ) const -{ - return myMgAdapt->hasOptionDefined(optionName); -} -void MG_ADAPT_i::setOptionValue(const char* optionName, - const char* optionValue) throw (std::invalid_argument) -{ - myMgAdapt->setOptionValue(optionName, optionValue); -} -std::string MG_ADAPT_i::getOptionValue(const char* optionName, - bool* isDefault) const throw (std::invalid_argument) -{ - return myMgAdapt->getOptionValue(optionName, isDefault); -} -std::vector MG_ADAPT_i::getCustomOptionValuesStrVec() const -{ - return myMgAdapt->getCustomOptionValuesStrVec(); -} -std::vector MG_ADAPT_i::getOptionValuesStrVec() const -{ - return myMgAdapt->getOptionValuesStrVec(); -} - - -//~TOptionValues MG_ADAPT_i::getOptionValues() const; -//~const TOptionValues& MG_ADAPT_i::getCustomOptionValues() const ; diff --git a/src/ADAPT_I/MG_ADAPT_i.hxx b/src/ADAPT_I/MG_ADAPT_i.hxx deleted file mode 100644 index 657fca93a..000000000 --- a/src/ADAPT_I/MG_ADAPT_i.hxx +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef MG_ADAPT_I_HXX -#define MG_ADAPT_I_HXX - -#include -#include CORBA_SERVER_HEADER(ADAPT_Gen) -#include CORBA_SERVER_HEADER(MG_ADAPT) - -#include "SALOME_Component_i.hxx" -#include "SALOME_NamingService.hxx" -#include "Utils_CorbaException.hxx" - -#include - -struct MgAdaptHypothesisData; -class MgAdapt; - -class MG_ADAPT_i : - public virtual Engines_Component_i, - public virtual POA_ADAPT::MG_ADAPT, - public virtual PortableServer::ServantBase -{ -public: - MG_ADAPT_i( CORBA::ORB_ptr orb, ADAPT::ADAPT_Gen_var gen_i ); - MG_ADAPT_i(); - virtual ~MG_ADAPT_i(); - void setData( MgAdaptHypothesisData*); - - void setMedFileIn(char* str); - char* getMedFileIn(); - - void setMedFileOut(char* str); - char* getMedFileOut(); - - void setMeshName(char* str); - char* getMeshName(); - - void setMeshNameOut(char* str); - char* getMeshNameOut(); - - void setMeshOutMed(bool mybool); - bool getMeshOutMed(); - - void setPublish(bool mybool); - bool getPublish(); - - void setFieldName(char* str); - char* getFieldName(); - - void setTimeStep(CORBA::Long t); - CORBA::Long getTimeStep() const; - - void setRankTimeStep(CORBA::Long t, CORBA::Long r ); - CORBA::Long getRank(); - - void setLogFile(char* str); - char* getLogFile(); - - void setVerbosityLevel(CORBA::Long v); - CORBA::Long getVerbosityLevel(); - - void setRemoveOnSuccess(bool mybool); - bool getRemoveOnSuccess(); - - MgAdaptHypothesisData* getData() const; - - void setUseLocalMap(bool mybool); - bool getUseLocalMap(); - - void setUseBackgroundMap(bool mybool); - bool getUseBackgroundMap(); - - void setUseConstantValue(bool mybool); - bool getUseConstantValue(); - - void setConstantValue(double value); - double getConstantValue() const; - - void setSizeMapFile(char* str); - char* getSizeMapFile(); - - void setFromMedFile(bool mybool); - bool isFromMedFile(); - - void setKeepWorkingFiles(bool mybool); - bool getKeepWorkingFiles(); - - //~void setPrCORBA::LongLogInFile(bool); - //~bool getPrCORBA::LongLogInFile(); - - void setWorkingDir(char* str); - char* getWorkingDir() const; - - - bool setAll(); - char* getCommandToRun() ; - CORBA::Long compute(char* errStr); - char* getFileName() const; - char* getExeName(); - void copyMgAdaptHypothesisData( MgAdaptHypothesisData* data ) ; - - void checkDirPath(std::string& str); - - - - bool hasOptionDefined( const char* optionName ) const; - void setOptionValue(const char* optionName, - const char* optionValue) throw (std::invalid_argument); - std::string getOptionValue(const char* optionName, - bool* isDefault=0) const throw (std::invalid_argument); - std::vector getCustomOptionValuesStrVec() const; - std::vector getOptionValuesStrVec() const; - - - //~TOptionValues getOptionValues() const; - //~const TOptionValues& getCustomOptionValues() const ; -private: - MgAdapt* myMgAdapt; - - CORBA::ORB_ptr _orb; - ADAPT::ADAPT_Gen_var _gen_i; - -}; -#endif // MG_ADAPT_I_HXX diff --git a/src/SMESH/CMakeLists.txt b/src/SMESH/CMakeLists.txt index 129ec5c41..55b8da584 100644 --- a/src/SMESH/CMakeLists.txt +++ b/src/SMESH/CMakeLists.txt @@ -38,6 +38,7 @@ INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/src/SMDS ${PROJECT_SOURCE_DIR}/src/SMESHDS ${PROJECT_SOURCE_DIR}/src/SMESHUtils + ${MEDCOUPLING_INCLUDE_DIRS} ) # additional preprocessor / compiler flags @@ -67,6 +68,7 @@ SET(_link_LIBRARIES MeshDriverUNV MeshDriverGMF ${DriverCGNS_LIB} + ${MEDCoupling_medloader} ) # --- headers --- @@ -86,6 +88,7 @@ SET(SMESHimpl_HEADERS SMESH_MesherHelper.hxx SMESH_ProxyMesh.hxx SMESH_SMESH.hxx + MG_ADAPT.hxx ) # --- sources --- @@ -104,6 +107,7 @@ SET(SMESHimpl_SOURCES SMESH_HypoFilter.cxx SMESH_ProxyMesh.cxx SMESH_MesherHelper.cxx + MG_ADAPT.cxx ) # --- rules --- diff --git a/src/ADAPT/MG_ADAPT.cxx b/src/SMESH/MG_ADAPT.cxx similarity index 98% rename from src/ADAPT/MG_ADAPT.cxx rename to src/SMESH/MG_ADAPT.cxx index 8a74bc78e..954ea0d97 100644 --- a/src/ADAPT/MG_ADAPT.cxx +++ b/src/SMESH/MG_ADAPT.cxx @@ -38,6 +38,7 @@ #include #include +using namespace MG_ADAPT; static std::string removeFile(std::string fileName, int& notOk) { std::string errStr; @@ -280,11 +281,24 @@ int MgAdapt::getRank() { return rank; } +void MgAdapt::setTimeStepRankLast() +{ + med_int aRank, tmst; + std::string fieldFile = useBackgroundMap ? sizeMapFile : medFileIn; + getTimeStepInfos(fieldFile, tmst, aRank); + setRankTimeStep((int) tmst, (int) aRank); +} +void MgAdapt::setNoTimeStep() +{ + int aRank = (int)MED_NO_IT; + int tmst = (int)MED_NO_DT ; + setRankTimeStep(tmst, aRank); +} void MgAdapt::setUseLocalMap(bool myLocal) { - useLocalMap = myLocal; - + useLocalMap = myLocal; } + bool MgAdapt::getUseLocalMap() { return useLocalMap; @@ -293,8 +307,8 @@ bool MgAdapt::getUseLocalMap() void MgAdapt::setUseBackgroundMap(bool bckg) { useBackgroundMap = bckg; - } + bool MgAdapt::getUseBackgroundMap() { return useBackgroundMap; @@ -303,7 +317,6 @@ bool MgAdapt::getUseBackgroundMap() void MgAdapt::setUseConstantValue(bool cnst) { useConstantValue = cnst; - } bool MgAdapt::getUseConstantValue() { @@ -400,6 +413,7 @@ bool MgAdapt::getPrintLogInFile() return printLogInFile; } + bool MgAdapt::setAll() { @@ -1068,7 +1082,7 @@ std::string MgAdapt::getExeName() { return "mg-adapt.exe"; } -void MgAdapt::copyMgAdaptHypothesisData( MgAdaptHypothesisData* from) +void MgAdapt::copyMgAdaptHypothesisData( const MgAdaptHypothesisData* from) { data->myFileInDir = from->myFileInDir; diff --git a/src/ADAPT/MG_ADAPT.hxx b/src/SMESH/MG_ADAPT.hxx similarity index 97% rename from src/ADAPT/MG_ADAPT.hxx rename to src/SMESH/MG_ADAPT.hxx index d597cf5f2..dc55e8419 100644 --- a/src/ADAPT/MG_ADAPT.hxx +++ b/src/SMESH/MG_ADAPT.hxx @@ -36,7 +36,7 @@ //~#include - +namespace MG_ADAPT{ class MgAdapt; typedef std::map< std::string, std::string > TOptionValues; @@ -118,7 +118,7 @@ public: MgAdapt(const MgAdapt&); ~MgAdapt(); void buildModel(); - void setData( MgAdaptHypothesisData*); + void setData( MgAdaptHypothesisData* data); void setMedFileIn(std::string fileName); std::string getMedFileIn(); @@ -142,11 +142,14 @@ public: std::string getFieldName(); void setTimeStep(int time); - int getTimeStep() const; + int getTimeStep() const; void setRankTimeStep(int time, int myRank); int getRank(); - + + void setTimeStepRankLast(); + void setNoTimeStep(); + void setLogFile(std::string); std::string getLogFile(); @@ -192,12 +195,10 @@ public: int compute(std::string& errStr); std::string getFileName() const; static std::string getExeName(); - void copyMgAdaptHypothesisData( MgAdaptHypothesisData* from) ; + void copyMgAdaptHypothesisData( const MgAdaptHypothesisData* from) ; void checkDirPath(std::string& dirPath); - - bool hasOptionDefined( const std::string& optionName ) const; void setOptionValue(const std::string& optionName, const std::string& optionValue) throw (std::invalid_argument); @@ -332,6 +333,6 @@ private : void appendMsgToLogFile(std::string& msg); }; - +} #endif // MG_ADAPT_HXX diff --git a/src/SMESHGUI/CMakeLists.txt b/src/SMESHGUI/CMakeLists.txt index 59f09da98..f4fa5526d 100644 --- a/src/SMESHGUI/CMakeLists.txt +++ b/src/SMESHGUI/CMakeLists.txt @@ -43,11 +43,12 @@ INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/src/SMESHClient ${PROJECT_SOURCE_DIR}/src/MEDWrapper ${PROJECT_SOURCE_DIR}/src/ADAPT + ${PROJECT_SOURCE_DIR}/src/ADAPT_I ${PROJECT_SOURCE_DIR}/src/ADAPTGUI ${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}/idl ${PROJECT_BINARY_DIR}/src/ADAPTGUI - ${PROJECT_BINARY_DIR}/src/ADAPT + ${PROJECT_BINARY_DIR}/src/ADAPT_I ${MEDCOUPLING_INCLUDE_DIRS} ) @@ -156,7 +157,7 @@ SET(_moc_HEADERS SMESHGUI_PreVisualObj.h SMESHGUI_AdaptDlg.h SMESHGUI_MG_ADAPTDRIVER.h - #~MG_ADAPTGUI.hxx # to replace in ../ADAPTGUI/ + MG_ADAPTGUI.hxx # to replace in ../ADAPTGUI/ ) # header files / no moc processing @@ -275,7 +276,7 @@ SET(_other_SOURCES SMESHGUI_IdPreview.cxx SMESHGUI_AdaptDlg.cxx SMESHGUI_MG_ADAPTDRIVER.cxx - #~MG_ADAPTGUI.cxx # to replace in ../ADAPTGUI/ + MG_ADAPTGUI.cxx # to replace in ../ADAPTGUI/ #MG_ADAPT.cxx ) diff --git a/src/ADAPTGUI/MG_ADAPTGUI.cxx b/src/SMESHGUI/MG_ADAPTGUI.cxx similarity index 94% rename from src/ADAPTGUI/MG_ADAPTGUI.cxx rename to src/SMESHGUI/MG_ADAPTGUI.cxx index af8c47e24..dcca5a7a6 100644 --- a/src/ADAPTGUI/MG_ADAPTGUI.cxx +++ b/src/SMESHGUI/MG_ADAPTGUI.cxx @@ -98,10 +98,11 @@ const int MARGIN = 9; // layout margin // function : SMESHGUI_MgAdaptDlg() // purpose : //================================================================================= -SMESHGUI_MgAdaptDlg::SMESHGUI_MgAdaptDlg( SalomeApp_Module* theModule, MgAdapt* myModel, QWidget* parent, bool isCreation ) +SMESHGUI_MgAdaptDlg::SMESHGUI_MgAdaptDlg( SalomeApp_Module* theModule, SMESH::MG_ADAPT_ptr myModel, QWidget* parent, bool isCreation ) : mySMESHGUI( theModule ), QDialog(parent) { - model = new MgAdapt(*myModel); + //~model = new MgAdapt(*myModel); + model = SMESH::MG_ADAPT::_duplicate(myModel); myData = model->getData(); buildDlg(); if (!isCreation) readParamsFromHypo(); @@ -120,11 +121,15 @@ void SMESHGUI_MgAdaptDlg::buildDlg() // Arguments myArgs = new SMESHGUI_MgAdaptArguments( myTabWidget ); - std::vector str = model->getOptionValuesStrVec(); - std::vector str2 = model->getCustomOptionValuesStrVec(); - str.insert( str.end(), str2.begin(), str2.end() ); + SMESH::str_array* str = model->getOptionValuesStrVec(); + SMESH::str_array* str2 = model->getCustomOptionValuesStrVec(); + std::vector s; + for (int i = 0; i< str->length(); i++) s.push_back( (*str)[i].in()); + for (int j = str->length(); j< str2->length(); j++) s.push_back((*str2)[ j - str->length() ].in() ); + //~str.insert( str.end(), str2.begin(), str2.end() ); - myAdvOpt = new MgAdaptAdvWidget(myTabWidget, &str); + myAdvOpt = new MgAdaptAdvWidget(myTabWidget, &s); + int argsTab = myTabWidget->addTab( myArgs, tr( "Args" ) ); int advTab = myTabWidget->addTab( myAdvOpt, tr( "ADVOP" ) ); @@ -187,14 +192,14 @@ void SMESHGUI_MgAdaptDlg::buildDlg() //================================================================================= SMESHGUI_MgAdaptDlg::~SMESHGUI_MgAdaptDlg() { - delete model; + //~delete model; } -void SMESHGUI_MgAdaptDlg::setModel(MgAdapt* mg) -{ - model = mg; -} -MgAdapt* SMESHGUI_MgAdaptDlg::getModel() const +//~void SMESHGUI_MgAdaptDlg::setModel(MgAdapt* mg) +//~{ + //~model = mg; +//~} +SMESH::MG_ADAPT_ptr SMESHGUI_MgAdaptDlg::getModel() const { return model; } @@ -222,24 +227,24 @@ bool SMESHGUI_MgAdaptDlg::readParamsFromHypo( ) const if (myData->fromMedFile) { - *(myArgs->myFileInDir) = QString(myData->myFileInDir.c_str()) ; - myArgs->selectMedFileLineEdit->setText(myData->myMeshFileIn.c_str()) ; + *(myArgs->myFileInDir) = QString(myData->myFileInDir) ; + myArgs->selectMedFileLineEdit->setText(QString(myData->myMeshFileIn)) ; // myData->myInMeshName = // TODO } else { - myArgs->aBrowserObject->setText(myData->myInMeshName.c_str()); + myArgs->aBrowserObject->setText(QString(myData->myInMeshName)); //~ myArgs->myFileInDir =""; // TODO //~ myArgs->selectMedFileLineEdit->setText(); // TODO } - myArgs->meshNameLineEdit->setText(myData->myOutMeshName.c_str()); + myArgs->meshNameLineEdit->setText(QString(myData->myOutMeshName)); myArgs->medFileCheckBox->setChecked(myData->myMeshOutMed); if(myData->myMeshOutMed) { - *(myArgs->myFileOutDir) = QString(myData->myFileOutDir.c_str()); - myArgs->selectOutMedFileLineEdit->setText(myData->myMeshFileOut.c_str()); + *(myArgs->myFileOutDir) = QString(myData->myFileOutDir); + myArgs->selectOutMedFileLineEdit->setText(QString(myData->myMeshFileOut)); } else @@ -265,8 +270,8 @@ bool SMESHGUI_MgAdaptDlg::readParamsFromHypo( ) const if (myData->myUseBackgroundMap) { - *(myArgs->myFileSizeMapDir) = QString(myData->myFileSizeMapDir.c_str()) ; - myArgs->selectMedFileBackgroundLineEdit->setText(myData->myMeshFileBackground.c_str()); + *(myArgs->myFileSizeMapDir) = QString(myData->myFileSizeMapDir) ; + myArgs->selectMedFileBackgroundLineEdit->setText(QString(myData->myMeshFileBackground)); } else { @@ -274,7 +279,7 @@ bool SMESHGUI_MgAdaptDlg::readParamsFromHypo( ) const myArgs->selectMedFileBackgroundLineEdit->setText(""); //TODO } - myArgs->fieldNameCmb->setCurrentText(myData->myFieldName.c_str()); + myArgs->fieldNameCmb->setCurrentText(QString(myData->myFieldName)); myArgs->noTimeStep->setChecked(myData->myUseNoTimeStep); myArgs->lastTimeStep->setChecked( myData->myUseLastTimeStep); myArgs->chosenTimeStep->setChecked(myData->myUseChosenTimeStep); @@ -284,7 +289,7 @@ bool SMESHGUI_MgAdaptDlg::readParamsFromHypo( ) const myArgs->timeStep->setValue(myData->myTimeStep); } - myAdvOpt->workingDirectoryLineEdit->setText(myData->myWorkingDir.c_str()); + myAdvOpt->workingDirectoryLineEdit->setText(QString(myData->myWorkingDir)); myAdvOpt->logInFileCheck->setChecked(myData->myPrintLogInFile); myAdvOpt->verboseLevelSpin->setValue(myData->myVerboseLevel); @@ -299,21 +304,21 @@ bool SMESHGUI_MgAdaptDlg::readParamsFromHypo( ) const bool SMESHGUI_MgAdaptDlg::readParamsFromWidgets() { bool ret = true; - MgAdaptHypothesisData* aData = new MgAdaptHypothesisData(); + SMESH::MgAdaptHypothesisData* aData = new SMESH::MgAdaptHypothesisData(); aData->fromMedFile = myArgs->aMedfile->isChecked(); if (aData->fromMedFile) { - aData->myFileInDir = myArgs->myFileInDir->toStdString(); - aData->myMeshFileIn = myArgs->selectMedFileLineEdit->text().toStdString(); + aData->myFileInDir = CORBA::string_dup(myArgs->myFileInDir->toStdString().c_str()); + aData->myMeshFileIn = CORBA::string_dup(myArgs->selectMedFileLineEdit->text().toStdString().c_str()); // aData->myInMeshName = // TODO } else // TODO browser { - aData->myInMeshName = myArgs->aBrowserObject->text().toStdString(); - aData->myFileInDir = myAdvOpt->workingDirectoryLineEdit->text().toStdString(); + aData->myInMeshName = CORBA::string_dup(myArgs->aBrowserObject->text().toStdString().c_str()); + aData->myFileInDir = CORBA::string_dup(myAdvOpt->workingDirectoryLineEdit->text().toStdString().c_str()); - TCollection_AsciiString aGenericName = (char*)aData->myFileInDir.c_str(); + TCollection_AsciiString aGenericName = (char*)aData->myFileInDir; TCollection_AsciiString aGenericName2 = "MgAdapt_"; aGenericName2 += getpid(); aGenericName2 += "_"; @@ -323,12 +328,12 @@ bool SMESHGUI_MgAdaptDlg::readParamsFromWidgets() emit myArgs->toExportMED(aGenericName.ToCString()); aData->myMeshFileIn = aGenericName2.ToCString(); } - aData->myOutMeshName = myArgs->meshNameLineEdit->text().toStdString(); + aData->myOutMeshName = CORBA::string_dup(myArgs->meshNameLineEdit->text().toStdString().c_str()); aData->myMeshOutMed = myArgs->medFileCheckBox->isChecked(); if(aData->myMeshOutMed) { - aData->myFileOutDir = myArgs->myFileOutDir->toStdString(); - aData->myMeshFileOut = myArgs->selectOutMedFileLineEdit->text().toStdString(); + aData->myFileOutDir = CORBA::string_dup(myArgs->myFileOutDir->toStdString().c_str()); + aData->myMeshFileOut = CORBA::string_dup(myArgs->selectOutMedFileLineEdit->text().toStdString().c_str()); } else @@ -352,15 +357,15 @@ bool SMESHGUI_MgAdaptDlg::readParamsFromWidgets() } if (aData->myUseBackgroundMap) { - aData->myFileSizeMapDir = myArgs->myFileSizeMapDir->toStdString(); - aData->myMeshFileBackground = myArgs->selectMedFileBackgroundLineEdit->text().toStdString(); + aData->myFileSizeMapDir = CORBA::string_dup(myArgs->myFileSizeMapDir->toStdString().c_str()); + aData->myMeshFileBackground = CORBA::string_dup(myArgs->selectMedFileBackgroundLineEdit->text().toStdString().c_str()); } else { aData->myMeshFileBackground = ""; } - aData->myFieldName = myArgs->fieldNameCmb->currentText().toStdString(); + aData->myFieldName = CORBA::string_dup(myArgs->fieldNameCmb->currentText().toStdString().c_str()); aData->myUseNoTimeStep = myArgs->noTimeStep->isChecked(); aData->myUseLastTimeStep = myArgs->lastTimeStep->isChecked(); aData->myUseChosenTimeStep = myArgs->chosenTimeStep->isChecked(); @@ -372,18 +377,18 @@ bool SMESHGUI_MgAdaptDlg::readParamsFromWidgets() } - aData->myWorkingDir = myAdvOpt->workingDirectoryLineEdit->text().toStdString(); + aData->myWorkingDir = CORBA::string_dup(myAdvOpt->workingDirectoryLineEdit->text().toStdString().c_str()); aData->myPrintLogInFile = myAdvOpt->logInFileCheck->isChecked(); aData->myVerboseLevel = myAdvOpt->verboseLevelSpin->value(); aData->myRemoveLogOnSuccess = myAdvOpt->removeLogOnSuccessCheck->isChecked(); aData->myKeepFiles = myAdvOpt->keepWorkingFilesCheck->isChecked(); - model->setData(aData); + model->setData(*aData); QString msg; checkParams(msg); delete aData; return ret; } -bool SMESHGUI_MgAdaptDlg::storeParamsToHypo( const MgAdaptHypothesisData& ) const +bool SMESHGUI_MgAdaptDlg::storeParamsToHypo( const SMESH::MgAdaptHypothesisData& ) const { } diff --git a/src/ADAPTGUI/MG_ADAPTGUI.hxx b/src/SMESHGUI/MG_ADAPTGUI.hxx similarity index 91% rename from src/ADAPTGUI/MG_ADAPTGUI.hxx rename to src/SMESHGUI/MG_ADAPTGUI.hxx index 5e2a90435..7b50a32a5 100644 --- a/src/ADAPTGUI/MG_ADAPTGUI.hxx +++ b/src/SMESHGUI/MG_ADAPTGUI.hxx @@ -44,7 +44,9 @@ // model -#include "MG_ADAPT.hxx" +//~#include "MG_ADAPT.hxx" + +#include CORBA_SERVER_HEADER(MG_ADAPT) class SUIT_ViewWindow; class SUIT_Desktop; @@ -88,7 +90,7 @@ class SMESHGUI_MgAdaptArguments; class SMESHGUI_SpinBox; class MgAdaptAdvWidgetTreeWidget; class MgAdaptAdvWidget; -class MgAdapt; +//~class MgAdapt; class QHeaderView; class QFileDialog; @@ -115,14 +117,14 @@ class SMESHGUI_MgAdaptDlg : public QDialog public: //! Property type enum Mode { Arguments, AdvancedOptions}; - SMESHGUI_MgAdaptDlg( SalomeApp_Module*, MgAdapt*, QWidget* parent= 0,bool isCreation = true ); + SMESHGUI_MgAdaptDlg( SalomeApp_Module*, SMESH::MG_ADAPT_ptr, QWidget* parent= 0,bool isCreation = true ); ~SMESHGUI_MgAdaptDlg(); void buildDlg(); void reject(); bool checkParams(QString& msg) ; - void setModel(MgAdapt*); - MgAdapt* getModel() const; + //~void setModel(MgAdapt*); + SMESH::MG_ADAPT_ptr getModel() const; public slots: @@ -138,7 +140,7 @@ protected : MgAdaptAdvWidget* myAdvOpt; bool readParamsFromHypo( ) const ; bool readParamsFromWidgets( ) ; - bool storeParamsToHypo( const MgAdaptHypothesisData& ) const; + bool storeParamsToHypo( const SMESH::MgAdaptHypothesisData & ) const; private: @@ -147,8 +149,8 @@ private: QTabWidget* myTabWidget; - MgAdaptHypothesisData* myData; - MgAdapt* model; + SMESH::MgAdaptHypothesisData* myData; + SMESH::MG_ADAPT_ptr model; }; diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx index 90dff1ad3..afd74b0dd 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx @@ -25,7 +25,8 @@ #include "SMESHGUI.h" #include "SMESHGUI_AdaptDlg.h" #include "SMESHGUI_MG_ADAPTDRIVER.h" -#include "MG_ADAPT.hxx" +//~#include "MG_ADAPT_i.hxx" +//~#include "MG_ADAPT.hxx" // SALOME GUI includes #include @@ -225,13 +226,14 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) INFOS("Interface avec MG-Adapt" ); // A faire - MgAdapt* model = new MgAdapt(); + SMESH::MG_ADAPT_ptr model = SMESHGUI::GetSMESHGen()->CreateMG_ADAPT();// = new SMESH::MG_ADAPT_var(); + //~SMESH::MG_ADAPT_ptr model = SMESH::MG_ADAPT_i::CreateMG_ADAPT(); bool isCreation = false; if (mySMESHGUI->isStudyLocked()) break; mySMESHGUI->EmitSignalDeactivateDialog(); SMESHGUI_MG_ADAPTDRIVER *mgAdapt = new SMESHGUI_MG_ADAPTDRIVER(mySMESHGUI, model, isCreation); mgAdapt->show(); - delete model; + //~delete model; break; } diff --git a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx index 13a1d916c..56180d043 100644 --- a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx +++ b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx @@ -233,33 +233,8 @@ int IObjectCount() } -SMESHGUI_MG_AdaptComputeDlg_QThread::SMESHGUI_MG_AdaptComputeDlg_QThread(MgAdapt* aModel) -{ - model = aModel; - myResult = -1; -} -void SMESHGUI_MG_AdaptComputeDlg_QThread::run() -{ - - int err; - std::string errStr; - errStr = model->compute(errStr); - std::string msg = err == 0 ? " ok" : std::string("Not ok \n")+ errStr; - exec(); -} - -int SMESHGUI_MG_AdaptComputeDlg_QThread::result() -{ - return myResult; -} - -void SMESHGUI_MG_AdaptComputeDlg_QThread::cancel() -{ - //~model->cancel(); -} - -SMESHGUI_MG_ADAPTDRIVER::SMESHGUI_MG_ADAPTDRIVER( SMESHGUI* theModule, MgAdapt* myModel, bool isCreation ) +SMESHGUI_MG_ADAPTDRIVER::SMESHGUI_MG_ADAPTDRIVER( SMESHGUI* theModule, SMESH::MG_ADAPT_ptr myModel, bool isCreation ) : mySMESHGUI( theModule ), myFilterDlg(0), myIsApplyAndClose( false ), @@ -397,11 +372,12 @@ bool SMESHGUI_MG_ADAPTDRIVER::execute() { int err; - std::string errStr; + //~std::string errStr; + char* errStr; try { err = getModel()->compute(errStr); - std::string msg = err == 0 ? " ok" : std::string("Not ok \n")+errStr ; + std::string msg = err == 0 ? " ok" : std::string("Not ok \n")+CORBA::string_dup(errStr) ; } catch (const std::exception& e) { @@ -611,7 +587,7 @@ bool SMESHGUI_MG_ADAPTDRIVER::isValid() bool SMESHGUI_MG_ADAPTDRIVER::createMeshInObjectBrowser() { - QString filename(getModel()->getMedFileOut().c_str()); + QString filename(getModel()->getMedFileOut()); QStringList errors; QStringList anEntryList; bool isEmpty = false; diff --git a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.h b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.h index 7f2e3ee6f..e73a77795 100644 --- a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.h +++ b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.h @@ -45,8 +45,9 @@ // model //~#include "MG_ADAPT.h" #include "MG_ADAPTGUI.hxx" -#include "MG_ADAPT.hxx" +//~#include "MG_ADAPT.hxx" +#include CORBA_SERVER_HEADER(MG_ADAPT) class SUIT_ViewWindow; class SUIT_Desktop; @@ -103,29 +104,13 @@ Handle(SALOME_InteractiveObject) firstIObject(); bool createAndPublishMed(QString fileName); bool createMgAdaptObject(MgAdapt* myMgAdapt = 0); -class SMESHGUI_EXPORT SMESHGUI_MG_AdaptComputeDlg_QThread : public QThread -{ - Q_OBJECT - -public: - SMESHGUI_MG_AdaptComputeDlg_QThread(MgAdapt* model); - int result(); - void cancel(); -protected: - void run(); - -private: - - MgAdapt* model; - int myResult; -}; class SMESHGUI_MG_ADAPTDRIVER : public SMESHGUI_MgAdaptDlg { Q_OBJECT; public : - SMESHGUI_MG_ADAPTDRIVER( SMESHGUI*, MgAdapt*, bool isCreation = true ); + SMESHGUI_MG_ADAPTDRIVER( SMESHGUI*, SMESH::MG_ADAPT_ptr, bool isCreation = true ); void setMyMesh(SMESH::SMESH_Mesh_var); SMESH::SMESH_Mesh_var getMyMesh() ; diff --git a/src/SMESH_I/CMakeLists.txt b/src/SMESH_I/CMakeLists.txt index 4f1695d84..cc3ad31f1 100644 --- a/src/SMESH_I/CMakeLists.txt +++ b/src/SMESH_I/CMakeLists.txt @@ -37,8 +37,11 @@ INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/src/DriverCGNS ${PROJECT_SOURCE_DIR}/src/SMESH ${PROJECT_SOURCE_DIR}/src/SMESHUtils + #~${PROJECT_SOURCE_DIR}/src/ADAPT ${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}/idl + #~${PROJECT_BINARY_DIR}/ADAPT + ${MEDCOUPLING_INCLUDE_DIRS} ) # additional preprocessor / compiler flags @@ -81,6 +84,7 @@ SET(_link_LIBRARIES SMESHDS SMESHControls MeshDriverMED + ${MEDCoupling_medloader} ) # --- headers --- @@ -107,6 +111,7 @@ SET(SMESHEngine_HEADERS SMESH_PreMeshInfo.hxx SMESH_MeshPartDS.hxx SMESH.hxx + MG_ADAPT_i.hxx ) # --- sources --- @@ -132,6 +137,7 @@ SET(SMESHEngine_SOURCES SMESH_NoteBook.cxx SMESH_Measurements_i.cxx SMESH_PreMeshInfo.cxx + MG_ADAPT_i.cxx ) # --- rules --- diff --git a/src/SMESH_I/MG_ADAPT_i.cxx b/src/SMESH_I/MG_ADAPT_i.cxx new file mode 100644 index 000000000..6a770c68c --- /dev/null +++ b/src/SMESH_I/MG_ADAPT_i.cxx @@ -0,0 +1,427 @@ +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// Remarques : +// L'ordre de description des fonctions est le meme dans tous les fichiers +// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : +// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore +// 2. Les caracteristiques +// 3. Le lien avec les autres structures +// +// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier +// + +#include "MG_ADAPT_i.hxx" +//~#include "ADAPT_Gen_i.hxx" +#include "string.h" +#include "SMESH_Gen_i.hxx" +#include +#include +#include CORBA_CLIENT_HEADER(SALOMEDS) +//~#include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog) +//~#include CORBA_CLIENT_HEADER(SMESH_Gen) + + +//============================================================================= +/*! + * SMESH_Gen_i::CreateMG_ADAPT + * + * Create measurement instance + */ +//============================================================================= + + +using namespace SMESH; +void MG_ADAPT_i::copyHypothesisDataToImpl(const SMESH::MgAdaptHypothesisData& from, ::MG_ADAPT::MgAdaptHypothesisData* to) const +{ + to->myFileInDir = from.myFileInDir; + to->myMeshFileIn = from.myMeshFileIn; + to->myMeshFileBackground = from.myMeshFileBackground; + to->myOutMeshName = from.myOutMeshName; + to->myMeshFileOut = from.myMeshFileOut; + to->myFileOutDir = from.myFileOutDir; + to->myFileSizeMapDir = from.myFileSizeMapDir; + to->myFieldName = from.myFieldName; + to->fromMedFile = from.fromMedFile; + to->myPublish = from.myPublish; + to->myMeshOutMed = from.myMeshOutMed; + to->myUseLocalMap = from.myUseLocalMap; + to->myUseBackgroundMap = from.myUseBackgroundMap; + to->myUseConstantValue = from.myUseConstantValue; + to->myConstantValue = from.myConstantValue; + to->myTimeStep = from.myTimeStep; + to->myRank = from.myRank; + to->myUseNoTimeStep = from.myUseNoTimeStep; + to->myUseLastTimeStep = from.myUseLastTimeStep; + to->myUseChosenTimeStep = from.myUseChosenTimeStep; + to->myWorkingDir = from.myWorkingDir; + to->myLogFile = from.myLogFile; + to->myPrintLogInFile = from.myPrintLogInFile; + to->myKeepFiles = from.myKeepFiles; + to->myRemoveLogOnSuccess = from.myRemoveLogOnSuccess; + to->myVerboseLevel = from.myVerboseLevel; +} +void MG_ADAPT_i::copyHypothesisDataFromImpl(const ::MG_ADAPT::MgAdaptHypothesisData* from, SMESH::MgAdaptHypothesisData* to) const +{ + to->myFileInDir = CORBA::string_dup(from->myFileInDir.c_str()); + to->myMeshFileIn = CORBA::string_dup(from->myMeshFileIn.c_str()); + to->myMeshFileBackground = CORBA::string_dup(from->myMeshFileBackground.c_str()); + to->myOutMeshName = CORBA::string_dup(from->myOutMeshName.c_str()); + to->myMeshFileOut = CORBA::string_dup(from->myMeshFileOut.c_str()); + to->myFileOutDir = CORBA::string_dup(from->myFileOutDir.c_str()); + to->myFileSizeMapDir = CORBA::string_dup(from->myFileSizeMapDir.c_str()); + to->myFieldName = CORBA::string_dup(from->myFieldName.c_str()); + to->fromMedFile = from->fromMedFile; + to->myPublish = from->myPublish; + to->myMeshOutMed = from->myMeshOutMed; + to->myUseLocalMap = from->myUseLocalMap; + to->myUseBackgroundMap = from->myUseBackgroundMap; + to->myUseConstantValue = from->myUseConstantValue; + to->myConstantValue = from->myConstantValue; + to->myTimeStep = from->myTimeStep; + to->myRank = from->myRank; + to->myUseNoTimeStep = from->myUseNoTimeStep; + to->myUseLastTimeStep = from->myUseLastTimeStep; + to->myUseChosenTimeStep = from->myUseChosenTimeStep; + to->myWorkingDir = CORBA::string_dup(from->myWorkingDir.c_str()); + to->myLogFile = CORBA::string_dup(from->myLogFile.c_str()); + to->myPrintLogInFile = from->myPrintLogInFile; + to->myKeepFiles = from->myKeepFiles; + to->myRemoveLogOnSuccess = from->myRemoveLogOnSuccess; + to->myVerboseLevel = from->myVerboseLevel; +} +SMESH::MG_ADAPT_ptr SMESH_Gen_i::CreateMG_ADAPT() +{ + SMESH::MG_ADAPT_i* aMGadapt = new SMESH::MG_ADAPT_i(); + SMESH::MG_ADAPT_var anObj = aMGadapt->_this(); + return anObj._retn(); +} +//~SMESH::MG_ADAPT_ptr MG_ADAPT_i::CreateMG_ADAPT() +//~{ + + //~SMESH_Gen_i* smeshGen_i = SMESH_Gen_i::GetSMESHGen(); + //~SMESH::MG_ADAPT_i* aMGadapt = new SMESH::MG_ADAPT_i(smeshGen_i->GetPOA()); + //~SMESH::MG_ADAPT_var anObj = aMGadapt->_this(); + //~return anObj._retn(); +//~} +//============================================================================= +/*! + * standard constructor + */ +//============================================================================= +MG_ADAPT_i::MG_ADAPT_i(): SALOME::GenericObj_i( SMESH_Gen_i::GetPOA() ) +{ + myMgAdapt = new ::MG_ADAPT::MgAdapt(); +} +//~MG_ADAPT_i::MG_ADAPT_i(PortableServer::POA_var myPoa): SALOME::GenericObj_i( myPoa ) +//~{ + //~myMgAdapt = new ::MG_ADAPT::MgAdapt(); +//~} + +//============================================================================= +/*! + * standard constructor + */ +//============================================================================= +//~MG_ADAPT_i::MG_ADAPT_i( CORBA::ORB_ptr orb, + //~ADAPT::ADAPT_Gen_var engine ) +//~{ + + //~_gen_i = engine; + //~_orb = orb; + //~myMgAdapt = new MgAdapt(); +//~} + +//============================================================================= +/*! + * standard destructor + */ +//============================================================================= +MG_ADAPT_i::~MG_ADAPT_i() +{ +} +void MG_ADAPT_i::setData( SMESH::MgAdaptHypothesisData& data) +{ + ::MG_ADAPT::MgAdaptHypothesisData* baseData = new ::MG_ADAPT::MgAdaptHypothesisData(); + copyHypothesisDataToImpl(data, baseData); + myMgAdapt->setData(baseData); + delete baseData; +} +void MG_ADAPT_i::setMedFileIn(const char* str) +{ + myMgAdapt->setMedFileIn(str); +} +char* MG_ADAPT_i::getMedFileIn() +{ + return CORBA::string_dup(myMgAdapt->getMedFileIn().c_str()); +} +void MG_ADAPT_i::setMedFileOut(const char* str) +{ + myMgAdapt->setMedFileOut(str); +} +char* MG_ADAPT_i::getMedFileOut() +{ + return CORBA::string_dup(myMgAdapt->getMedFileOut().c_str()); +} +void MG_ADAPT_i::setMeshName(const char* str) +{ + myMgAdapt->setMeshName(str); +} +char* MG_ADAPT_i::getMeshName() +{ + return CORBA::string_dup(myMgAdapt->getMeshName().c_str()); +} +void MG_ADAPT_i::setMeshNameOut(const char* str) +{ + myMgAdapt->setMeshNameOut(str); +} +char* MG_ADAPT_i::getMeshNameOut() +{ + return CORBA::string_dup(myMgAdapt->getMeshNameOut().c_str()); +} +void MG_ADAPT_i::setMeshOutMed(bool mybool) +{ + myMgAdapt->setMeshOutMed(mybool); +} +bool MG_ADAPT_i::getMeshOutMed() +{ + return myMgAdapt->getMeshOutMed(); +} +void MG_ADAPT_i::setPublish(bool mybool) +{ + myMgAdapt->setPublish(mybool); +} +bool MG_ADAPT_i::getPublish() +{ + return myMgAdapt->getPublish(); +} +void MG_ADAPT_i::setFieldName(const char* str) +{ + myMgAdapt->setFieldName(str); +} +char* MG_ADAPT_i::getFieldName() +{ + return CORBA::string_dup(myMgAdapt->getFieldName().c_str()); +} +void MG_ADAPT_i::setTimeStep(CORBA::Long t) +{ + myMgAdapt->setTimeStep(t); +} +CORBA::Long MG_ADAPT_i::getTimeStep() +{ + return myMgAdapt->getTimeStep(); +} +void MG_ADAPT_i::setRankTimeStep(CORBA::Long t, CORBA::Long r) +{ + myMgAdapt->setRankTimeStep(t, r); +} +CORBA::Long MG_ADAPT_i::getRank() +{ + return myMgAdapt->getRank(); +} +void MG_ADAPT_i::setTimeStepRankLast() +{ + myMgAdapt->setTimeStepRankLast(); +} +void MG_ADAPT_i::setNoTimeStep() +{ + myMgAdapt->setNoTimeStep(); +} +void MG_ADAPT_i::setLogFile(const char* str) +{ + myMgAdapt->setLogFile(str); +} +char* MG_ADAPT_i::getLogFile() +{ + return CORBA::string_dup(myMgAdapt->getLogFile().c_str()); +} + +void MG_ADAPT_i::setVerbosityLevel(CORBA::Long v) +{ + myMgAdapt->setVerbosityLevel(v); +} +CORBA::Long MG_ADAPT_i::getVerbosityLevel() +{ + return myMgAdapt->getVerbosityLevel(); +} +void MG_ADAPT_i::setRemoveOnSuccess(bool mybool) +{ + myMgAdapt->setRemoveOnSuccess(mybool); +} +bool MG_ADAPT_i::getRemoveOnSuccess() +{ + myMgAdapt->getRemoveOnSuccess(); +} +SMESH::MgAdaptHypothesisData* MG_ADAPT_i::getData() +{ + SMESH::MgAdaptHypothesisData* result = new SMESH::MgAdaptHypothesisData(); + ::MG_ADAPT::MgAdaptHypothesisData* from = myMgAdapt->getData(); + copyHypothesisDataFromImpl(from, result); + return result; +} +void MG_ADAPT_i::setUseLocalMap(bool mybool) +{ + myMgAdapt->setUseLocalMap(mybool); +} +bool MG_ADAPT_i::getUseLocalMap() +{ + return myMgAdapt->getUseLocalMap(); +} +void MG_ADAPT_i::setUseBackgroundMap(bool mybool) +{ + myMgAdapt->setUseBackgroundMap(mybool); +} +bool MG_ADAPT_i::getUseBackgroundMap() +{ + return myMgAdapt->getUseBackgroundMap(); +} +void MG_ADAPT_i::setUseConstantValue(bool mybool) +{ + myMgAdapt->setUseConstantValue(mybool); +} +bool MG_ADAPT_i::getUseConstantValue() +{ + return myMgAdapt->getUseConstantValue(); +} + +void MG_ADAPT_i::setConstantValue(double value) +{ + myMgAdapt->setConstantValue(value); +} +double MG_ADAPT_i::getConstantValue() +{ + return myMgAdapt->getConstantValue(); +} +void MG_ADAPT_i::setSizeMapFile(const char* str) +{ + myMgAdapt->setSizeMapFile(str); +} +char* MG_ADAPT_i::getSizeMapFile() +{ + return CORBA::string_dup(myMgAdapt->getSizeMapFile().c_str()); +} +void MG_ADAPT_i::setFromMedFile(bool mybool) +{ + myMgAdapt->setFromMedFile(mybool); +} +bool MG_ADAPT_i::isFromMedFile() +{ + return myMgAdapt->isFromMedFile(); +} + +void MG_ADAPT_i::setKeepWorkingFiles(bool mybool) +{ + myMgAdapt->setKeepWorkingFiles(mybool); +} +bool MG_ADAPT_i::getKeepWorkingFiles() +{ + return myMgAdapt->getKeepWorkingFiles(); +} + +//~void MG_ADAPT_i::setPrCORBA::LongLogInFile(bool); +//~bool MG_ADAPT_i::getPrCORBA::LongLogInFile(); + +void MG_ADAPT_i::setWorkingDir(const char* dir) +{ + myMgAdapt->setWorkingDir(dir); +} +char* MG_ADAPT_i::getWorkingDir() +{ + return CORBA::string_dup(myMgAdapt->getWorkingDir().c_str()); +} +bool MG_ADAPT_i::setAll() +{ + return myMgAdapt->setAll(); +} +char* MG_ADAPT_i::getCommandToRun() +{ + return CORBA::string_dup(myMgAdapt->getCommandToRun().c_str()); +} + +CORBA::Long MG_ADAPT_i::compute(::CORBA::String_out errStr) +{ + std::string err(""); + CORBA::Long ret = myMgAdapt->compute(err); + errStr = err.c_str(); + return ret; +} +char* MG_ADAPT_i::getFileName() +{ + return CORBA::string_dup(myMgAdapt->getFileName().c_str()); +} +char* MG_ADAPT_i::getExeName() +{ + return CORBA::string_dup(myMgAdapt->getExeName().c_str()); +} +void MG_ADAPT_i::copyMgAdaptHypothesisData( const SMESH::MgAdaptHypothesisData& data) +{ + ::MG_ADAPT::MgAdaptHypothesisData* baseData = new ::MG_ADAPT::MgAdaptHypothesisData(); + copyHypothesisDataToImpl(data, baseData); + myMgAdapt->copyMgAdaptHypothesisData(baseData); + delete baseData; +} + +//~void MG_ADAPT_i::checkDirPath(char*& str) +//~{ + //~myMgAdapt->checkDirPath(str); +//~} + +bool MG_ADAPT_i::hasOptionDefined( const char* optionName ) +{ + return myMgAdapt->hasOptionDefined(optionName); +} +void MG_ADAPT_i::setOptionValue(const char* optionName, + const char* optionValue) throw (std::invalid_argument) +{ + myMgAdapt->setOptionValue(optionName, optionValue); +} + +char* MG_ADAPT_i::getOptionValue(const char* optionName, + bool& isDefault) throw (std::invalid_argument) +{ + return CORBA::string_dup(myMgAdapt->getOptionValue(optionName, &isDefault).c_str()); +} +str_array* MG_ADAPT_i::getCustomOptionValuesStrVec() +{ + SMESH::str_array_var result = new SMESH::str_array(); + std::vector vals = myMgAdapt->getCustomOptionValuesStrVec(); + result->length(vals.size()); + for (int i = 0; i vals = myMgAdapt->getOptionValuesStrVec(); + result->length(vals.size()); + for (int i = 0; isetPrintLogInFile(mybool); +} +bool MG_ADAPT_i::getPrintLogInFile() +{ + return myMgAdapt->getPrintLogInFile(); +} +//~TOptionValues MG_ADAPT_i::getOptionValues() const; +//~const TOptionValues& MG_ADAPT_i::getCustomOptionValues() const ; diff --git a/src/SMESH_I/MG_ADAPT_i.hxx b/src/SMESH_I/MG_ADAPT_i.hxx new file mode 100644 index 000000000..7ff30dce4 --- /dev/null +++ b/src/SMESH_I/MG_ADAPT_i.hxx @@ -0,0 +1,138 @@ +#ifndef MG_ADAPT_I_HXX +#define MG_ADAPT_I_HXX + +#include "MG_ADAPT.hxx" +#include "SMESH.hxx" +#include +//~#include CORBA_SERVER_HEADER(ADAPT_Gen) +#include CORBA_SERVER_HEADER(MG_ADAPT) + +#include "SALOME_GenericObj_i.hh" +#include "SALOME_Component_i.hxx" +#include "SALOME_NamingService.hxx" +#include "Utils_CorbaException.hxx" + +#include + +//~struct MgAdaptHypothesisData; +//~static void copyHypothesisDataToImpl(SMESH::MgAdaptHypothesisData& from, MG_ADAPT::MgAdaptHypothesisData* to); +//~static void copyHypothesisDataFromImpl(MG_ADAPT::MgAdaptHypothesisData* from, SMESH::MgAdaptHypothesisData& to); +//~class MgAdapt; +namespace SMESH +{ +class SMESH_I_EXPORT MG_ADAPT_i : + public virtual SALOME::GenericObj_i, + public virtual POA_SMESH::MG_ADAPT +{ +public: + //~MG_ADAPT_i( CORBA::ORB_ptr orb, ADAPT::ADAPT_Gen_var gen_i ); + //~static SMESH::MG_ADAPT_ptr CreateMG_ADAPT(); + //~MG_ADAPT_i(PortableServer::POA_var poa); + MG_ADAPT_i(); + virtual ~MG_ADAPT_i(); + //~void setData( SMESH::MgAdaptHypothesisData* data); + void setData( SMESH::MgAdaptHypothesisData& data); + + void setMedFileIn(const char* str); + char* getMedFileIn(); + + void setMedFileOut(const char* str); + char* getMedFileOut(); + + void setMeshName(const char* str); + char* getMeshName(); + + void setMeshNameOut(const char* str); + char* getMeshNameOut(); + + void setMeshOutMed(bool mybool); + bool getMeshOutMed(); + + void setPublish(bool mybool); + bool getPublish(); + + void setFieldName(const char* str); + char* getFieldName(); + + void setTimeStep(CORBA::Long t); + CORBA::Long getTimeStep() ; + + void setRankTimeStep(CORBA::Long t, CORBA::Long r ); + CORBA::Long getRank(); + + void setTimeStepRankLast(); + void setNoTimeStep(); + + void setLogFile(const char* str); + char* getLogFile(); + + void setVerbosityLevel(CORBA::Long v); + CORBA::Long getVerbosityLevel(); + + void setRemoveOnSuccess(bool mybool); + bool getRemoveOnSuccess(); + + SMESH::MgAdaptHypothesisData* getData() ; + + void setUseLocalMap(bool mybool); + bool getUseLocalMap(); + + void setUseBackgroundMap(bool mybool); + bool getUseBackgroundMap(); + + void setUseConstantValue(bool mybool); + bool getUseConstantValue(); + + void setConstantValue(double value); + double getConstantValue(); + + void setSizeMapFile(const char* str); + char* getSizeMapFile(); + + void setFromMedFile(bool mybool); + bool isFromMedFile(); + + void setKeepWorkingFiles(bool mybool); + bool getKeepWorkingFiles(); + + //~void setPrCORBA::LongLogInFile(bool); + //~bool getPrCORBA::LongLogInFile(); + + void setWorkingDir(const char* str); + char* getWorkingDir() ; + + void setPrintLogInFile(bool mybool); + bool getPrintLogInFile(); + + bool setAll(); + char* getCommandToRun() ; + CORBA::Long compute(::CORBA::String_out errStr); + char* getFileName(); + char* getExeName(); + void copyMgAdaptHypothesisData( const SMESH::MgAdaptHypothesisData& data ) ; + //~void copyMgAdaptHypothesisData( const SMESH::MgAdaptHypothesisData& data ) { + //~copyMgAdaptHypothesisData(&data); + //~} + + //~void checkDirPath(char*& str); + + bool hasOptionDefined( const char* optionName ) ; + void setOptionValue(const char* optionName, + const char* optionValue) throw (std::invalid_argument); + char* getOptionValue(const char* optionName, + bool& isDefault) throw (std::invalid_argument); + str_array* getCustomOptionValuesStrVec() ; + str_array* getOptionValuesStrVec() ; + void copyHypothesisDataFromImpl(const ::MG_ADAPT::MgAdaptHypothesisData* from, SMESH::MgAdaptHypothesisData* to) const; + void copyHypothesisDataToImpl(const SMESH::MgAdaptHypothesisData& from, ::MG_ADAPT::MgAdaptHypothesisData* to) const; + //~TOptionValues getOptionValues() const; + //~const TOptionValues& getCustomOptionValues() const ; +private: + ::MG_ADAPT::MgAdapt* myMgAdapt; + + //~CORBA::ORB_ptr _orb; + //~ADAPT::ADAPT_Gen_var _gen_i; + +}; +} +#endif // MG_ADAPT_I_HXX diff --git a/src/SMESH_I/SMESH_Gen_i.hxx b/src/SMESH_I/SMESH_Gen_i.hxx index fb16909b8..fa533f853 100644 --- a/src/SMESH_I/SMESH_Gen_i.hxx +++ b/src/SMESH_I/SMESH_Gen_i.hxx @@ -469,6 +469,7 @@ public: void CleanPythonTrace(); static int CountInPyDump(const TCollection_AsciiString& text); + SMESH::MG_ADAPT_ptr CreateMG_ADAPT(); // ***************************************** // Internal methods From 8196d751b1e8edaa53acca65c062e5b897ca69a0 Mon Sep 17 00:00:00 2001 From: azakir Date: Tue, 12 Jan 2021 17:36:13 +0100 Subject: [PATCH 067/100] for MG-adapt TUI --- idl/MG_ADAPT.idl | 4 +++- src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx | 3 ++- src/SMESH_I/MG_ADAPT_i.cxx | 19 +++++++++++++++---- src/SMESH_I/MG_ADAPT_i.hxx | 6 ++++-- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/idl/MG_ADAPT.idl b/idl/MG_ADAPT.idl index 8f9311e75..8cad0d628 100644 --- a/idl/MG_ADAPT.idl +++ b/idl/MG_ADAPT.idl @@ -124,7 +124,9 @@ module SMESH{ boolean setAll(); string getCommandToRun() ; - long compute(out string errStr); + //long compute(out string errStr); + long compute(); + string getErrMsg(); string getFileName() ; string getExeName(); void copyMgAdaptHypothesisData(in MgAdaptHypothesisData f ) ; diff --git a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx index 56180d043..0025f5751 100644 --- a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx +++ b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx @@ -376,7 +376,8 @@ bool SMESHGUI_MG_ADAPTDRIVER::execute() char* errStr; try { - err = getModel()->compute(errStr); + err = getModel()->compute(); + errStr = getModel()->getErrMsg(); std::string msg = err == 0 ? " ok" : std::string("Not ok \n")+CORBA::string_dup(errStr) ; } catch (const std::exception& e) diff --git a/src/SMESH_I/MG_ADAPT_i.cxx b/src/SMESH_I/MG_ADAPT_i.cxx index 6a770c68c..1d41d8079 100644 --- a/src/SMESH_I/MG_ADAPT_i.cxx +++ b/src/SMESH_I/MG_ADAPT_i.cxx @@ -354,13 +354,24 @@ char* MG_ADAPT_i::getCommandToRun() return CORBA::string_dup(myMgAdapt->getCommandToRun().c_str()); } -CORBA::Long MG_ADAPT_i::compute(::CORBA::String_out errStr) +//~CORBA::Long MG_ADAPT_i::compute(::CORBA::String_out errStr) +//~{ + //~std::string err(""); + //~CORBA::Long ret = myMgAdapt->compute(err); + //~errStr = err.c_str(); + //~return ret; +//~} +CORBA::Long MG_ADAPT_i::compute() { - std::string err(""); - CORBA::Long ret = myMgAdapt->compute(err); - errStr = err.c_str(); + errStr = ""; + CORBA::Long ret = myMgAdapt->compute(errStr); + //~errStr = err.c_str(); return ret; } +char* MG_ADAPT_i::getErrMsg() +{ + return CORBA::string_dup(errStr.c_str()); +} char* MG_ADAPT_i::getFileName() { return CORBA::string_dup(myMgAdapt->getFileName().c_str()); diff --git a/src/SMESH_I/MG_ADAPT_i.hxx b/src/SMESH_I/MG_ADAPT_i.hxx index 7ff30dce4..07fc78b8f 100644 --- a/src/SMESH_I/MG_ADAPT_i.hxx +++ b/src/SMESH_I/MG_ADAPT_i.hxx @@ -106,7 +106,8 @@ public: bool setAll(); char* getCommandToRun() ; - CORBA::Long compute(::CORBA::String_out errStr); + //~CORBA::Long compute(::CORBA::String_out errStr); + CORBA::Long compute(); char* getFileName(); char* getExeName(); void copyMgAdaptHypothesisData( const SMESH::MgAdaptHypothesisData& data ) ; @@ -127,9 +128,10 @@ public: void copyHypothesisDataToImpl(const SMESH::MgAdaptHypothesisData& from, ::MG_ADAPT::MgAdaptHypothesisData* to) const; //~TOptionValues getOptionValues() const; //~const TOptionValues& getCustomOptionValues() const ; + char* getErrMsg(); private: ::MG_ADAPT::MgAdapt* myMgAdapt; - + std::string errStr; //~CORBA::ORB_ptr _orb; //~ADAPT::ADAPT_Gen_var _gen_i; From d37a77ee95c9e1b494b35908468dd19388f67398 Mon Sep 17 00:00:00 2001 From: azakir Date: Wed, 13 Jan 2021 11:01:18 +0100 Subject: [PATCH 068/100] maj TUI --- src/SMESH_I/MG_ADAPT_i.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/SMESH_I/MG_ADAPT_i.cxx b/src/SMESH_I/MG_ADAPT_i.cxx index 1d41d8079..f0b510ccd 100644 --- a/src/SMESH_I/MG_ADAPT_i.cxx +++ b/src/SMESH_I/MG_ADAPT_i.cxx @@ -364,7 +364,16 @@ char* MG_ADAPT_i::getCommandToRun() CORBA::Long MG_ADAPT_i::compute() { errStr = ""; - CORBA::Long ret = myMgAdapt->compute(errStr); + CORBA::Long ret; + try + { + ret = myMgAdapt->compute(errStr); + } + catch (const std::exception& e) + { + std::cerr< Date: Thu, 14 Jan 2021 17:00:52 +0100 Subject: [PATCH 069/100] TUI for mg-adapt --- src/SMESH/MG_ADAPT.cxx | 90 ++++++++++++++++++++---------- src/SMESH/MG_ADAPT.hxx | 15 +++-- src/SMESH_I/MG_ADAPT_i.cxx | 107 ++++++++++++++++++++++++++++++++++-- src/SMESH_I/MG_ADAPT_i.hxx | 37 ++++++++++--- src/SMESH_I/SMESH_Gen_i.hxx | 2 + 5 files changed, 202 insertions(+), 49 deletions(-) diff --git a/src/SMESH/MG_ADAPT.cxx b/src/SMESH/MG_ADAPT.cxx index 954ea0d97..688c5da2c 100644 --- a/src/SMESH/MG_ADAPT.cxx +++ b/src/SMESH/MG_ADAPT.cxx @@ -49,6 +49,11 @@ static std::string removeFile(std::string fileName, int& notOk) return errStr; } +std::string remove_extension(const std::string& filename) { + size_t lastdot = filename.find_last_of("."); + if (lastdot == std::string::npos) return filename; + return filename.substr(0, lastdot); +} namespace { struct GET_DEFAULT // struct used to get default value from GetOptionValue() @@ -221,7 +226,9 @@ MgAdaptHypothesisData* MgAdapt::getData() const } void MgAdapt::setMedFileIn(std::string fileName) { - medFileIn = fileName; + medFileIn = fileName; + if (medFileOut == "") // default MED file Out + medFileOut = remove_extension( fileName )+ ".adapt.med"; } std::string MgAdapt::getMedFileIn() @@ -283,16 +290,31 @@ int MgAdapt::getRank() } void MgAdapt::setTimeStepRankLast() { - med_int aRank, tmst; - std::string fieldFile = useBackgroundMap ? sizeMapFile : medFileIn; - getTimeStepInfos(fieldFile, tmst, aRank); - setRankTimeStep((int) tmst, (int) aRank); + myUseLastTimeStep = true; + myUseChosenTimeStep = false; + myUseNoTimeStep = false; + //~med_int aRank, tmst; + //~std::string fieldFile = useBackgroundMap ? sizeMapFile : medFileIn; + //~getTimeStepInfos(fieldFile, tmst, aRank); + //~setRankTimeStep((int) tmst, (int) aRank); } void MgAdapt::setNoTimeStep() -{ - int aRank = (int)MED_NO_IT; - int tmst = (int)MED_NO_DT ; - setRankTimeStep(tmst, aRank); +{ + myUseLastTimeStep = false; + myUseChosenTimeStep = false; + myUseNoTimeStep = true; + //~int aRank = (int)MED_NO_IT; + //~int tmst = (int)MED_NO_DT ; + //~setRankTimeStep(tmst, aRank); +} +void MgAdapt::setChosenTimeStepRank() +{ + myUseLastTimeStep = false; + myUseChosenTimeStep = true; + myUseNoTimeStep = false; + //~int aRank = (int)MED_NO_IT; + //~int tmst = (int)MED_NO_DT ; + //~setRankTimeStep(tmst, aRank); } void MgAdapt::setUseLocalMap(bool myLocal) { @@ -454,25 +476,15 @@ bool MgAdapt::setAll() } setSizeMapFile(mapfile); - med_int rank; - med_int tmst; if (data->myUseNoTimeStep) - { - rank = MED_NO_IT; - tmst = MED_NO_DT ; - } + setNoTimeStep(); else if (data->myUseLastTimeStep) - { - std::string fieldFile = useBackgroundMap ? sizeMapFile : medFileIn; - getTimeStepInfos(fieldFile, tmst, rank); - } + setTimeStepRankLast(); else - { - rank = data->myRank; - tmst = data->myTimeStep; - } - setRankTimeStep((int)tmst, (int)rank); - + { + setChosenTimeStepRank(); + setRankTimeStep(data->myTimeStep, data->myRank); + } /* Advanced options */ setWorkingDir(data->myWorkingDir); checkDirPath(data->myWorkingDir); @@ -714,7 +726,7 @@ int MgAdapt::compute(std::string& errStr) { convertMeshFile(meshFormatOutputMesh, solFormatOutput); } - //~if (!err) cleanUp(); + if (!err) cleanUp(); return err; } @@ -787,6 +799,7 @@ std::string MgAdapt::getCommandToRun() std::string errStr; std::string cmd = getExeName(); std::string meshIn(""), sizeMapIn(""), solFileIn(""); + updateTimeStepRank(); convertMedFile(meshIn, solFileIn, sizeMapIn); if (!isFileExist(meshIn) || !isFileExist(solFileIn)) { @@ -833,7 +846,7 @@ std::string MgAdapt::getCommandToRun() cmd+= " --verbose "+ ToComment(verbosityLevel); } - + std::string option, value; bool isDefault; const TOptionValues* options[] = { &_option2value, &_customOption2value }; @@ -876,7 +889,7 @@ std::string MgAdapt::getCommandToRun() } -bool MgAdapt::isFileExist(std::string& fName) const +bool MgAdapt::isFileExist(const std::string& fName) { if ( fName.empty() ) @@ -1123,6 +1136,8 @@ void MgAdapt::convertMedFile(std::string& meshFormatMeshFileName, std::string& s MEDCoupling::MCAuto mfd = MEDCoupling::MEDFileData::New(medFileIn); MEDCoupling::MEDFileMeshes* meshes = mfd->getMeshes(); MEDCoupling::MEDFileMesh* fileMesh = meshes->getMeshAtPos(0); // ok only one mesh in file! + if (meshNameOut =="") + meshNameOut = fileMesh->getName(); storeGroupsAndFams(fileMesh); MEDCoupling::MCAuto fields = MEDCoupling::MEDFileFields::New(); @@ -1408,5 +1423,20 @@ void MgAdapt::getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit } - - +void MgAdapt::updateTimeStepRank() +{ + + med_int arank = rank; + med_int tmst = timeStep; + if (myUseNoTimeStep) + { + rank = MED_NO_IT; + tmst = MED_NO_DT ; + } + else if (myUseLastTimeStep) + { + std::string fieldFile = useBackgroundMap ? sizeMapFile : medFileIn; + getTimeStepInfos(fieldFile, tmst, arank); + } + setRankTimeStep((int)tmst, (int)arank); +} diff --git a/src/SMESH/MG_ADAPT.hxx b/src/SMESH/MG_ADAPT.hxx index dc55e8419..c97ad15d3 100644 --- a/src/SMESH/MG_ADAPT.hxx +++ b/src/SMESH/MG_ADAPT.hxx @@ -35,7 +35,7 @@ // SMESH includes //~#include - +std::string remove_extension(const std::string& filename); namespace MG_ADAPT{ class MgAdapt; @@ -54,7 +54,7 @@ struct MgAdaptHypothesisData bool myUseNoTimeStep, myUseLastTimeStep, myUseChosenTimeStep; std::string myWorkingDir, myLogFile; bool myPrintLogInFile, myKeepFiles, myRemoveLogOnSuccess; - int myVerboseLevel; + int myVerboseLevel; }; @@ -149,6 +149,8 @@ public: void setTimeStepRankLast(); void setNoTimeStep(); + void setChosenTimeStepRank(); + void updateTimeStepRank(); void setLogFile(std::string); std::string getLogFile(); @@ -219,9 +221,9 @@ public: /* default values */ static std::string defaultWorkingDirectory(); static std::string defaultLogFile(); - static bool defaultKeepFiles(); - static bool defaultRemoveLogOnSuccess(); - static int defaultVerboseLevel(); + static bool defaultKeepFiles(); + static bool defaultRemoveLogOnSuccess(); + static int defaultVerboseLevel(); static bool defaultPrintLogInFile(); static bool defaultFromMedFile(); static bool defaultMeshOutMed(); @@ -233,6 +235,7 @@ public: static bool defaultUseLastTimeStep(); static bool defaultUseChosenTimeStep(); static double defaultMaximumMemory(); + static bool isFileExist(const std::string& fName); @@ -281,6 +284,7 @@ private : std::string meshNameOut; bool publish, meshOutMed; bool useLocalMap, useBackgroundMap, useConstantValue; + bool myUseLastTimeStep, myUseNoTimeStep, myUseChosenTimeStep; std::string sizeMapFile; std::string fieldName; double constantValue; @@ -327,7 +331,6 @@ private : void getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit); Status addMessage(const std::string& msg, const bool isFatal = false); med_idt openMedFile(const std::string aFile) ; - bool isFileExist(std::string& fName) const; void execCmd( const char* cmd, int& err); void cleanUp(); void appendMsgToLogFile(std::string& msg); diff --git a/src/SMESH_I/MG_ADAPT_i.cxx b/src/SMESH_I/MG_ADAPT_i.cxx index f0b510ccd..71c3ef21e 100644 --- a/src/SMESH_I/MG_ADAPT_i.cxx +++ b/src/SMESH_I/MG_ADAPT_i.cxx @@ -111,6 +111,23 @@ SMESH::MG_ADAPT_ptr SMESH_Gen_i::CreateMG_ADAPT() SMESH::MG_ADAPT_i* aMGadapt = new SMESH::MG_ADAPT_i(); SMESH::MG_ADAPT_var anObj = aMGadapt->_this(); return anObj._retn(); +} +SMESH::MG_ADAPT_ptr SMESH_Gen_i::CreateAdaptationHypothesis() +{ + SMESH::MG_ADAPT_i* aMGadapt = new SMESH::MG_ADAPT_i(); + SMESH::MG_ADAPT_var anObj = aMGadapt->_this(); + return anObj._retn(); +} +SMESH::MG_ADAPT_OBJECT_ptr SMESH_Gen_i::Adaptation( const char* adaptationType) +{ + + if (!strcmp(adaptationType, "MG_Adapt")){ + SMESH::MG_ADAPT_OBJECT_i* mg_adapt_object = new SMESH::MG_ADAPT_OBJECT_i(); + SMESH::MG_ADAPT_OBJECT_var anObj = mg_adapt_object->_this(); + return anObj._retn(); + } + + } //~SMESH::MG_ADAPT_ptr MG_ADAPT_i::CreateMG_ADAPT() //~{ @@ -211,11 +228,11 @@ bool MG_ADAPT_i::getPublish() { return myMgAdapt->getPublish(); } -void MG_ADAPT_i::setFieldName(const char* str) +void MG_ADAPT_i::setSizeMapFieldName(const char* str) { myMgAdapt->setFieldName(str); } -char* MG_ADAPT_i::getFieldName() +char* MG_ADAPT_i::getSizeMapFieldName() { return CORBA::string_dup(myMgAdapt->getFieldName().c_str()); } @@ -227,7 +244,7 @@ CORBA::Long MG_ADAPT_i::getTimeStep() { return myMgAdapt->getTimeStep(); } -void MG_ADAPT_i::setRankTimeStep(CORBA::Long t, CORBA::Long r) +void MG_ADAPT_i::setTimeStepRank(CORBA::Long t, CORBA::Long r) { myMgAdapt->setRankTimeStep(t, r); } @@ -300,11 +317,11 @@ bool MG_ADAPT_i::getUseConstantValue() return myMgAdapt->getUseConstantValue(); } -void MG_ADAPT_i::setConstantValue(double value) +void MG_ADAPT_i::setConstantSize(double value) { myMgAdapt->setConstantValue(value); } -double MG_ADAPT_i::getConstantValue() +double MG_ADAPT_i::getConstantSize() { return myMgAdapt->getConstantValue(); } @@ -337,6 +354,19 @@ bool MG_ADAPT_i::getKeepWorkingFiles() //~void MG_ADAPT_i::setPrCORBA::LongLogInFile(bool); //~bool MG_ADAPT_i::getPrCORBA::LongLogInFile(); +void MG_ADAPT_i::setSizeMapType(const char* type) +{ + setUseLocalMap(false); + setUseBackgroundMap(false); + setUseConstantValue(false); + + if (!strcmp("Local", type)) + setUseLocalMap(true); + else if (!strcmp("Background", type)) + setUseBackgroundMap(true); + else + setUseConstantValue(true); +} void MG_ADAPT_i::setWorkingDir(const char* dir) { myMgAdapt->setWorkingDir(dir); @@ -365,7 +395,7 @@ CORBA::Long MG_ADAPT_i::compute() { errStr = ""; CORBA::Long ret; - try + try { ret = myMgAdapt->compute(errStr); } @@ -445,3 +475,68 @@ bool MG_ADAPT_i::getPrintLogInFile() } //~TOptionValues MG_ADAPT_i::getOptionValues() const; //~const TOptionValues& MG_ADAPT_i::getCustomOptionValues() const ; + +MG_ADAPT_OBJECT_i::MG_ADAPT_OBJECT_i(): SALOME::GenericObj_i( SMESH_Gen_i::GetPOA() ) +{ + medFileIn=""; + medFileOut=""; + medFileBackground=""; + publish = false; + //~myMesh = CORBA::nil; +} + +void MG_ADAPT_OBJECT_i::setMeshIn(SMESH::SMESH_Mesh_ptr theMesh ) +{ + myMesh = SMESH::SMESH_Mesh::_duplicate(theMesh); +} +void MG_ADAPT_OBJECT_i::setMEDFileIn(const char* f) +{ + medFileIn = f; +} +void MG_ADAPT_OBJECT_i::setMEDFileOut(const char* f) +{ + medFileOut = f; +} +void MG_ADAPT_OBJECT_i::setMEDFileBackground(const char* f) +{ + medFileBackground = f; +} +void MG_ADAPT_OBJECT_i::AddHypothesis(SMESH::MG_ADAPT_ptr mg) +{ + + mg->setMedFileIn(medFileIn.c_str()); + mg->setMedFileOut(medFileOut.c_str()); + mg->setSizeMapFile(medFileBackground.c_str()); + hypothesis = SMESH::MG_ADAPT::_duplicate(mg); +} +CORBA::Long MG_ADAPT_OBJECT_i::Compute(bool publish) +{ + if(!checkMeshFileIn()){ + std::cerr<< "\n Error : Please check the MED file input or mesh input. \n"; + return -1; + } + hypothesis->setPublish(publish); + return hypothesis->compute(); +} + +bool MG_ADAPT_OBJECT_i::checkMeshFileIn() +{ + bool ret = false; // 1 ok , 0 nook + if(!::MG_ADAPT::MgAdapt::isFileExist(medFileIn)) + { + if(!myMesh->_is_nil()) + { + bool toOverwrite = true; + bool toFindOutDim = true; + medFileIn = hypothesis->getFileName(); + medFileIn+= ".med"; + myMesh->ExportMED(medFileIn.c_str(), false, -1, toOverwrite, toFindOutDim); + hypothesis->setMedFileIn(medFileIn.c_str()); + ret = true; + } + } + else + ret = true; + + return ret; +} diff --git a/src/SMESH_I/MG_ADAPT_i.hxx b/src/SMESH_I/MG_ADAPT_i.hxx index 07fc78b8f..daedce449 100644 --- a/src/SMESH_I/MG_ADAPT_i.hxx +++ b/src/SMESH_I/MG_ADAPT_i.hxx @@ -11,7 +11,9 @@ #include "SALOME_Component_i.hxx" #include "SALOME_NamingService.hxx" #include "Utils_CorbaException.hxx" - +#include +#include +#include #include //~struct MgAdaptHypothesisData; @@ -20,6 +22,7 @@ //~class MgAdapt; namespace SMESH { + class SMESH_I_EXPORT MG_ADAPT_i : public virtual SALOME::GenericObj_i, public virtual POA_SMESH::MG_ADAPT @@ -51,13 +54,13 @@ public: void setPublish(bool mybool); bool getPublish(); - void setFieldName(const char* str); - char* getFieldName(); + void setSizeMapFieldName(const char* str); + char* getSizeMapFieldName(); void setTimeStep(CORBA::Long t); CORBA::Long getTimeStep() ; - void setRankTimeStep(CORBA::Long t, CORBA::Long r ); + void setTimeStepRank(CORBA::Long t, CORBA::Long r ); CORBA::Long getRank(); void setTimeStepRankLast(); @@ -73,7 +76,7 @@ public: bool getRemoveOnSuccess(); SMESH::MgAdaptHypothesisData* getData() ; - + void setSizeMapType(const char* type); void setUseLocalMap(bool mybool); bool getUseLocalMap(); @@ -83,8 +86,8 @@ public: void setUseConstantValue(bool mybool); bool getUseConstantValue(); - void setConstantValue(double value); - double getConstantValue(); + void setConstantSize(double value); + double getConstantSize(); void setSizeMapFile(const char* str); char* getSizeMapFile(); @@ -136,5 +139,25 @@ private: //~ADAPT::ADAPT_Gen_var _gen_i; }; + +class SMESH_I_EXPORT MG_ADAPT_OBJECT_i: + public virtual SALOME::GenericObj_i, + public virtual POA_SMESH::MG_ADAPT_OBJECT { +public : + MG_ADAPT_OBJECT_i(); + void setMeshIn( SMESH::SMESH_Mesh_ptr theMesh ); + void setMEDFileIn(const char* f); + void setMEDFileOut(const char* f); + void setMEDFileBackground(const char* f); + void AddHypothesis(SMESH::MG_ADAPT_ptr); + CORBA::Long Compute(bool Publish); +private: +std::string medFileIn, medFileOut, medFileBackground; +bool checkMeshFileIn(); +bool publish; +SMESH::SMESH_Mesh_ptr myMesh; +SMESH::MG_ADAPT_ptr hypothesis; +}; + } #endif // MG_ADAPT_I_HXX diff --git a/src/SMESH_I/SMESH_Gen_i.hxx b/src/SMESH_I/SMESH_Gen_i.hxx index fa533f853..08cfb22f7 100644 --- a/src/SMESH_I/SMESH_Gen_i.hxx +++ b/src/SMESH_I/SMESH_Gen_i.hxx @@ -470,6 +470,8 @@ public: static int CountInPyDump(const TCollection_AsciiString& text); SMESH::MG_ADAPT_ptr CreateMG_ADAPT(); + SMESH::MG_ADAPT_ptr CreateAdaptationHypothesis(); + SMESH::MG_ADAPT_OBJECT_ptr Adaptation( const char* adaptationType); // ***************************************** // Internal methods From 4cd6311d740e3b2e7fea4b760975087ad79a70dd Mon Sep 17 00:00:00 2001 From: azakir Date: Fri, 15 Jan 2021 12:03:28 +0100 Subject: [PATCH 070/100] little corrections --- idl/MG_ADAPT.idl | 23 ++++++++++++++++------- idl/SMESH_Gen.idl | 3 +++ src/SMESH/MG_ADAPT.cxx | 9 +++++---- src/SMESH_I/MG_ADAPT_i.cxx | 1 + 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/idl/MG_ADAPT.idl b/idl/MG_ADAPT.idl index 8cad0d628..3a593fde7 100644 --- a/idl/MG_ADAPT.idl +++ b/idl/MG_ADAPT.idl @@ -71,13 +71,13 @@ module SMESH{ void setPublish(in boolean b); boolean getPublish(); - void setFieldName(in string s); - string getFieldName(); + void setSizeMapFieldName(in string s); + string getSizeMapFieldName(); void setTimeStep(in long s); long getTimeStep() ; - void setRankTimeStep(in long s, in long f); + void setTimeStepRank(in long s, in long f); long getRank(); void setTimeStepRankLast(); @@ -103,8 +103,8 @@ module SMESH{ void setUseConstantValue(in boolean f); boolean getUseConstantValue(); - void setConstantValue(in double f); - double getConstantValue() ; + void setConstantSize(in double f); + double getConstantSize() ; void setSizeMapFile(in string f); string getSizeMapFile(); @@ -121,7 +121,7 @@ module SMESH{ void setWorkingDir(in string f); string getWorkingDir() ; - + void setSizeMapType(in string f); boolean setAll(); string getCommandToRun() ; //long compute(out string errStr); @@ -143,7 +143,16 @@ module SMESH{ str_array getCustomOptionValuesStrVec() ; str_array getOptionValuesStrVec() ; }; - + typedef MG_ADAPT MG_ADAPT_HYPOTHESIS; + interface MG_ADAPT_OBJECT : SALOME::GenericObj + { + void setMeshIn(in SMESH_Mesh theMesh ); + void setMEDFileIn(in string f); + void setMEDFileOut(in string f); + void setMEDFileBackground(in string f); + void AddHypothesis(in MG_ADAPT mg); + long Compute(in boolean Publish); + }; }; #endif // MG_ADAPT_IDL diff --git a/idl/SMESH_Gen.idl b/idl/SMESH_Gen.idl index 56901f5f9..52295a43b 100644 --- a/idl/SMESH_Gen.idl +++ b/idl/SMESH_Gen.idl @@ -44,6 +44,7 @@ module SMESH interface SMESH_Pattern; interface Measurements; interface MG_ADAPT; + interface MG_ADAPT_OBJECT; /*! * Tags definition @@ -586,6 +587,8 @@ module SMESH MG_ADAPT CreateMG_ADAPT(); + MG_ADAPT_OBJECT Adaptation(in string adaptType); + MG_ADAPT CreateAdaptationHypothesis(); }; }; diff --git a/src/SMESH/MG_ADAPT.cxx b/src/SMESH/MG_ADAPT.cxx index 688c5da2c..c3cba43ac 100644 --- a/src/SMESH/MG_ADAPT.cxx +++ b/src/SMESH/MG_ADAPT.cxx @@ -1426,17 +1426,18 @@ void MgAdapt::getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit void MgAdapt::updateTimeStepRank() { - med_int arank = rank; - med_int tmst = timeStep; + med_int arank; + med_int tmst; if (myUseNoTimeStep) { - rank = MED_NO_IT; + arank = MED_NO_IT; tmst = MED_NO_DT ; + setRankTimeStep((int)tmst, (int)arank); } else if (myUseLastTimeStep) { std::string fieldFile = useBackgroundMap ? sizeMapFile : medFileIn; getTimeStepInfos(fieldFile, tmst, arank); + setRankTimeStep((int)tmst, (int)arank); } - setRankTimeStep((int)tmst, (int)arank); } diff --git a/src/SMESH_I/MG_ADAPT_i.cxx b/src/SMESH_I/MG_ADAPT_i.cxx index 71c3ef21e..04ff3daaa 100644 --- a/src/SMESH_I/MG_ADAPT_i.cxx +++ b/src/SMESH_I/MG_ADAPT_i.cxx @@ -246,6 +246,7 @@ CORBA::Long MG_ADAPT_i::getTimeStep() } void MG_ADAPT_i::setTimeStepRank(CORBA::Long t, CORBA::Long r) { + myMgAdapt->setChosenTimeStepRank(); myMgAdapt->setRankTimeStep(t, r); } CORBA::Long MG_ADAPT_i::getRank() From 4002febb8b27c5d1bb1817183d1f046096ecb8f6 Mon Sep 17 00:00:00 2001 From: azakir Date: Tue, 19 Jan 2021 10:30:07 +0100 Subject: [PATCH 071/100] enable to publish in TUI --- src/SMESH/MG_ADAPT.cxx | 2 +- src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx | 3 --- src/SMESH_I/MG_ADAPT_i.cxx | 6 ++++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/SMESH/MG_ADAPT.cxx b/src/SMESH/MG_ADAPT.cxx index c3cba43ac..09a06ef86 100644 --- a/src/SMESH/MG_ADAPT.cxx +++ b/src/SMESH/MG_ADAPT.cxx @@ -1253,7 +1253,7 @@ void MgAdapt::restorefams(MEDCoupling::MEDFileMesh* fileMesh) const for (; fIt!=famVec.end(); ++fIt) { - try // safety : FAMILY could be lost P2-->P1 + try // { std::string givenFamNameFromMeshGemConverter = fileMesh->getFamilyNameGivenId( std::abs(fIt->_famId) ); fileMesh->changeFamilyId(std::abs(fIt->_famId), fIt->_famId); diff --git a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx index 0025f5751..85a719b40 100644 --- a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx +++ b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx @@ -360,9 +360,6 @@ bool SMESHGUI_MG_ADAPTDRIVER::clickOnApply() SMESHGUI_MgAdaptDlg::clickOnApply(); bool ok = execute(); - //~SMESHGUI_MG_AdaptComputeDlg_QThread atest(getModel()); - //~atest.start(); - //~atest.quit(); if (getModel()->getPublish()) this->createMeshInObjectBrowser(); return ok; diff --git a/src/SMESH_I/MG_ADAPT_i.cxx b/src/SMESH_I/MG_ADAPT_i.cxx index 04ff3daaa..51160b1df 100644 --- a/src/SMESH_I/MG_ADAPT_i.cxx +++ b/src/SMESH_I/MG_ADAPT_i.cxx @@ -405,6 +405,12 @@ CORBA::Long MG_ADAPT_i::compute() std::cerr<getPublish()) + { + SMESH_Gen_i* smeshGen_i = SMESH_Gen_i::GetSMESHGen(); + SMESH::DriverMED_ReadStatus theStatus; + smeshGen_i->CreateMeshesFromMED(myMgAdapt->getMedFileOut().c_str(), theStatus); + } //~errStr = err.c_str(); return ret; } From b04533874fac449b319a8f515b65174faf6151ff Mon Sep 17 00:00:00 2001 From: azakir Date: Tue, 19 Jan 2021 11:31:46 +0100 Subject: [PATCH 072/100] some precisions --- src/SMESH/MG_ADAPT.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/SMESH/MG_ADAPT.cxx b/src/SMESH/MG_ADAPT.cxx index 09a06ef86..2445d8cdb 100644 --- a/src/SMESH/MG_ADAPT.cxx +++ b/src/SMESH/MG_ADAPT.cxx @@ -758,12 +758,19 @@ void MgAdapt::execCmd( const char* cmd, int& err) } err = 0; } - +/* + * to delete tmp files .mesh, .sol and if needed + * the log file + * + */ void MgAdapt::cleanUp() { int notOk; std::string errStr; - if(removeOnSuccess) tmpFilesToBeDeleted.push_back(logFile); + if(toKeepWorkingFiles) + return; + if(removeOnSuccess && printLogInFile) + tmpFilesToBeDeleted.push_back(logFile); std::vector< std::string>::iterator it = tmpFilesToBeDeleted.begin(); for (; it!=tmpFilesToBeDeleted.end(); ++it) @@ -819,6 +826,7 @@ std::string MgAdapt::getCommandToRun() cmd+= " --in "+ meshIn; meshFormatOutputMesh = getFileName()+".mesh"; + tmpFilesToBeDeleted.push_back(meshFormatOutputMesh); cmd+= " --out "+ meshFormatOutputMesh; if (useLocalMap || useConstantValue) cmd+= " --sizemap "+ solFileIn; else // (useBackgroundMap) @@ -840,6 +848,7 @@ std::string MgAdapt::getCommandToRun() std::string solFileOut = getFileName()+".sol"; cmd+= " --write_sizemap "+ solFileOut; solFormatOutput.push_back(solFileOut); + tmpFilesToBeDeleted.push_back(solFileOut); } if (verbosityLevel != defaultVerboseLevel()) { From 5e46af59684e7cdf480e523e46c5e1b5dfc9ee12 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Fri, 29 Jan 2021 16:39:42 +0100 Subject: [PATCH 073/100] =?UTF-8?q?Mise=20=C3=A0=20jour=20des=20messages?= =?UTF-8?q?=20et=20d=C3=A9faut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SMESH/MG_ADAPT.cxx | 60 +++---- src/SMESHGUI/MG_ADAPTGUI.cxx | 66 ++++---- src/SMESHGUI/MG_ADAPTGUI.hxx | 9 +- src/SMESHGUI/SMESH_msg_en.ts | 34 +--- src/SMESHGUI/SMESH_msg_fr.ts | 308 ++++++++++++++++++----------------- 5 files changed, 230 insertions(+), 247 deletions(-) diff --git a/src/SMESH/MG_ADAPT.cxx b/src/SMESH/MG_ADAPT.cxx index 2445d8cdb..b59fde866 100644 --- a/src/SMESH/MG_ADAPT.cxx +++ b/src/SMESH/MG_ADAPT.cxx @@ -45,14 +45,14 @@ static std::string removeFile(std::string fileName, int& notOk) notOk = std::remove(fileName.c_str()); if (notOk) errStr = ToComment(" \n error while removing file : ") << fileName; - else errStr= ToComment("\n file : ")<< fileName << " succesfully deleted! \n "; - - return errStr; + else errStr= ToComment("\n file : ")<< fileName << " succesfully deleted! \n "; + + return errStr; } std::string remove_extension(const std::string& filename) { size_t lastdot = filename.find_last_of("."); if (lastdot == std::string::npos) return filename; - return filename.substr(0, lastdot); + return filename.substr(0, lastdot); } namespace { @@ -176,7 +176,7 @@ void MgAdapt::buildModel() _defaultOptionValues["adaptation" ] = "both"; _defaultOptionValues["components" ] = "outside components"; - _defaultOptionValues["compute_ridges" ] = "yes"; + _defaultOptionValues["compute_ridges" ] = "yes"; _defaultOptionValues["max_memory" ] = ToComment(defaultMaximumMemory()); } @@ -295,11 +295,11 @@ void MgAdapt::setTimeStepRankLast() myUseNoTimeStep = false; //~med_int aRank, tmst; //~std::string fieldFile = useBackgroundMap ? sizeMapFile : medFileIn; - //~getTimeStepInfos(fieldFile, tmst, aRank); + //~getTimeStepInfos(fieldFile, tmst, aRank); //~setRankTimeStep((int) tmst, (int) aRank); } void MgAdapt::setNoTimeStep() -{ +{ myUseLastTimeStep = false; myUseChosenTimeStep = false; myUseNoTimeStep = true; @@ -308,7 +308,7 @@ void MgAdapt::setNoTimeStep() //~setRankTimeStep(tmst, aRank); } void MgAdapt::setChosenTimeStepRank() -{ +{ myUseLastTimeStep = false; myUseChosenTimeStep = true; myUseNoTimeStep = false; @@ -481,7 +481,7 @@ bool MgAdapt::setAll() else if (data->myUseLastTimeStep) setTimeStepRankLast(); else - { + { setChosenTimeStepRank(); setRankTimeStep(data->myTimeStep, data->myRank); } @@ -521,7 +521,7 @@ throw (std::invalid_argument) if (op_val->second != optionValue) { - + std::string lowerOptionValue = toLowerStr(optionValue); const char* ptr = lowerOptionValue.c_str(); // strip white spaces @@ -536,7 +536,7 @@ throw (std::invalid_argument) if (i == 0) { // empty string } else if (_charOptions.count(optionName)) { - // do not check strings + // do not check strings } else if (_doubleOptions.count(optionName)) { // check if value is double toDbl(ptr, &typeOk); @@ -621,7 +621,7 @@ throw (std::invalid_argument) } //================================================================================ /*! - * \brief Converts a string to a lower + * \brief Converts a string to a lower */ //================================================================================ std::string MgAdapt::toLowerStr(const std::string& str) @@ -743,10 +743,10 @@ void MgAdapt::execCmd( const char* cmd, int& err) } else { - buf = std::cout.rdbuf(); + buf = std::cout.rdbuf(); } std::ostream logStream(buf); - + std::unique_ptr pipe(popen(cmd, "r"), pclose ); if(!pipe) { @@ -759,9 +759,9 @@ void MgAdapt::execCmd( const char* cmd, int& err) err = 0; } /* - * to delete tmp files .mesh, .sol and if needed + * to delete tmp files .mesh, .sol and if needed * the log file - * + * */ void MgAdapt::cleanUp() { @@ -769,9 +769,9 @@ void MgAdapt::cleanUp() std::string errStr; if(toKeepWorkingFiles) return; - if(removeOnSuccess && printLogInFile) + if(removeOnSuccess && printLogInFile) tmpFilesToBeDeleted.push_back(logFile); - + std::vector< std::string>::iterator it = tmpFilesToBeDeleted.begin(); for (; it!=tmpFilesToBeDeleted.end(); ++it) { @@ -780,16 +780,16 @@ void MgAdapt::cleanUp() { appendMsgToLogFile(errStr); } - + } } void MgAdapt::appendMsgToLogFile(std::string& msg) { - std::ofstream logStream; + std::ofstream logStream; logStream.open(logFile, std::ofstream::out | std::ofstream::app); logStream<< msg; - logStream.close(); + logStream.close(); } //================================================================================ /*! @@ -849,13 +849,13 @@ std::string MgAdapt::getCommandToRun() cmd+= " --write_sizemap "+ solFileOut; solFormatOutput.push_back(solFileOut); tmpFilesToBeDeleted.push_back(solFileOut); - } + } if (verbosityLevel != defaultVerboseLevel()) { cmd+= " --verbose "+ ToComment(verbosityLevel); } - + std::string option, value; bool isDefault; const TOptionValues* options[] = { &_option2value, &_customOption2value }; @@ -1261,7 +1261,7 @@ void MgAdapt::restorefams(MEDCoupling::MEDFileMesh* fileMesh) const std::vector::const_iterator fIt = famVec.begin(); for (; fIt!=famVec.end(); ++fIt) - { + { try // { std::string givenFamNameFromMeshGemConverter = fileMesh->getFamilyNameGivenId( std::abs(fIt->_famId) ); @@ -1271,7 +1271,7 @@ void MgAdapt::restorefams(MEDCoupling::MEDFileMesh* fileMesh) const catch (const std::exception& e) { std::cerr<& fie tmpWriter.setMeshFileName(meshFormatsizeMapFile); tmpWriter.setFieldFileNames( fieldFileNames); tmpWriter.setMEDFileDS(tmpMfd); - tmpWriter.write(); + tmpWriter.write(); } // ======================================================================= med_idt MgAdapt::openMedFile(const std::string aFile) @@ -1413,8 +1413,8 @@ void MgAdapt::getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit if(tmp_numdt > numdt) { numdt = tmp_numdt; - numit = tmp_numit; - } + numit = tmp_numit; + } } if ( erreur < 0 ) { @@ -1434,7 +1434,7 @@ void MgAdapt::getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit void MgAdapt::updateTimeStepRank() { - + med_int arank; med_int tmst; if (myUseNoTimeStep) diff --git a/src/SMESHGUI/MG_ADAPTGUI.cxx b/src/SMESHGUI/MG_ADAPTGUI.cxx index dcca5a7a6..1e4b4a5df 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.cxx +++ b/src/SMESHGUI/MG_ADAPTGUI.cxx @@ -124,12 +124,12 @@ void SMESHGUI_MgAdaptDlg::buildDlg() SMESH::str_array* str = model->getOptionValuesStrVec(); SMESH::str_array* str2 = model->getCustomOptionValuesStrVec(); std::vector s; - for (int i = 0; i< str->length(); i++) s.push_back( (*str)[i].in()); - for (int j = str->length(); j< str2->length(); j++) s.push_back((*str2)[ j - str->length() ].in() ); + for (int i = 0; i< str->length(); i++) s.push_back( (*str)[i].in()); + for (int j = str->length(); j< str2->length(); j++) s.push_back((*str2)[ j - str->length() ].in() ); //~str.insert( str.end(), str2.begin(), str2.end() ); myAdvOpt = new MgAdaptAdvWidget(myTabWidget, &s); - + int argsTab = myTabWidget->addTab( myArgs, tr( "Args" ) ); int advTab = myTabWidget->addTab( myAdvOpt, tr( "ADVOP" ) ); @@ -597,6 +597,7 @@ SMESHGUI_MgAdaptArguments::SMESHGUI_MgAdaptArguments( QWidget* parent ) // Initial state setMode( Mesh, Local); medFileCheckBox->setChecked(true); + visibleTimeStepRankLabel (false); // Connections connect( meshInGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( modeChanged( int ) ) ); @@ -622,46 +623,39 @@ void SMESHGUI_MgAdaptArguments::onNoTimeStep(bool disableOther) { noTimeStep->setChecked(true); - rankLabel->setVisible(0); - rankSpinBox->setVisible(0); + visibleTimeStepRankLabel (false); rankSpinBox->setValue(-2); - - timeStepLabel->setVisible(0); - timeStep->setVisible(0); timeStep->setValue(-2); lastTimeStep->setDisabled(disableOther); chosenTimeStep->setDisabled(disableOther); - - } void SMESHGUI_MgAdaptArguments::onLastTimeStep(bool disableOther) { lastTimeStep->setChecked(true); - rankLabel->setVisible(0); - rankSpinBox->setVisible(0); + visibleTimeStepRankLabel (false); rankSpinBox->setValue(-1); - - timeStepLabel->setVisible(0); - timeStep->setVisible(0); timeStep->setValue(-1); noTimeStep->setDisabled(disableOther); } - void SMESHGUI_MgAdaptArguments::onChosenTimeStep(bool disableOther, int max) { chosenTimeStep->setChecked(true); - rankLabel->setVisible(1); - rankSpinBox->setVisible(1); + visibleTimeStepRankLabel (true); rankSpinBox->setValue(0); - - timeStepLabel->setVisible(1); - timeStep->setVisible(1); timeStep->setValue(0); if (max) timeStep->setMaximum(max); +} +void SMESHGUI_MgAdaptArguments::visibleTimeStepRankLabel(bool visible) +{ + rankLabel->setVisible(visible); + rankSpinBox->setVisible(visible); + + timeStepLabel->setVisible(visible); + timeStep->setVisible(visible); } void SMESHGUI_MgAdaptArguments::onSelectOutMedFilebutton() @@ -994,12 +988,12 @@ void MgAdaptAdvWidget::AddOption( const char* option, bool isCustom ) if(it != optionTreeWidgetItem.end()) return; // option exist else { - row = getNewQTreeWidgetItem(table, option, name, isCustom); - } + row = getNewQTreeWidgetItem(table, option, name, isCustom); + } } - else + else { - row = getNewQTreeWidgetItem(table, option, name, isCustom); + row = getNewQTreeWidgetItem(table, option, name, isCustom); } row->setText( 0, tr( name.toLatin1().constData() )); row->setText( 1, tr( value.toLatin1().constData() )); @@ -1019,8 +1013,8 @@ QTreeWidgetItem* MgAdaptAdvWidget::getNewQTreeWidgetItem(QTreeWidget* table, con QTreeWidgetItem* row = new QTreeWidgetItem( table ); row->setData( NAME_COL, EDITABLE_ROLE, int( isCustom && !option )); row->setFlags( row->flags() | Qt::ItemIsEditable ); - optionTreeWidgetItem.insert(std::pair (name, row)); - + optionTreeWidgetItem.insert(std::pair (name, row)); + return row; } @@ -1167,34 +1161,34 @@ void MgAdaptAdvWidget::onMeshDimChanged(ADAPTATION_MODE aMode) /* default adaptation mode * assume that if meshDim == 2 -->adaptation surface * if meshDim == 3 and if there is not 2D mesh -->VOLUME - * else BOTH + * else BOTH */ - + QString adaptation("adaptation"), value; switch(aMode) { case ADAPTATION_MODE::SURFACE: - { - value ="surface"; + { + value ="surface"; setOptionValue(adaptation, value); break; } case ADAPTATION_MODE::BOTH : { - value = "both"; + value = "both"; setOptionValue(adaptation, value); break; } case ADAPTATION_MODE::VOLUME : { - value = "volume"; + value = "volume"; setOptionValue(adaptation, value); break; } - } + } } void MgAdaptAdvWidget::setOptionValue(QString& option, QString& value) -{ +{ std::map::iterator it = optionTreeWidgetItem.find(option); if (it != optionTreeWidgetItem.end()) @@ -1450,7 +1444,7 @@ std::map GetListeChamps(QString aFile, bool errorMessage) std::string remove_extension(const std::string& filename) { size_t lastdot = filename.find_last_of("."); if (lastdot == std::string::npos) return filename; - return filename.substr(0, lastdot); + return filename.substr(0, lastdot); } diff --git a/src/SMESHGUI/MG_ADAPTGUI.hxx b/src/SMESHGUI/MG_ADAPTGUI.hxx index 7b50a32a5..2319d735c 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.hxx +++ b/src/SMESHGUI/MG_ADAPTGUI.hxx @@ -102,10 +102,10 @@ med_idt OuvrirFichier(QString aFile); std::string remove_extension(const std::string& filename); -enum ADAPTATION_MODE{ +enum ADAPTATION_MODE{ SURFACE, // surface adaption when meshDim == 2 - VOLUME, // - BOTH + VOLUME, // + BOTH }; //================================================================================= // class : SMESHGUI_MgAdaptDlg @@ -238,6 +238,7 @@ private slots: void onNoTimeStep(bool disableOther = false); void onLastTimeStep(bool disableOther = false); void onChosenTimeStep(bool disableOther = false, int max = 0); + void visibleTimeStepRankLabel(bool visible); private: @@ -297,7 +298,7 @@ private slots: private: void setOptionValue(QString& option, QString& value); std::map optionTreeWidgetItem; - + QTreeWidgetItem* getNewQTreeWidgetItem(QTreeWidget* table, const char* option, QString& name, bool isCustom); }; diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index fde42d2f4..90a784488 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -396,7 +396,7 @@ Publish_MG_ADAPT Publish
- + SIZE_MAP_FIELD Size map field @@ -3137,37 +3137,13 @@ Check algorithm documentation for supported geometry ADAPT_PREF_MG_ADAPT_SIZE_MAP_BACKGROUND Background - - ADAPT_PREF_MG_ADAPT_MED_SIZE_MAP_BACKGROUND - MED file background size map - - - ADAPT_PREF_MG_ADAPT_TIME_STEP - Time step - - - ADAPT_PREF_MG_ADAPT_NO_TIME_STEP - No time step - ADAPT_PREF_MG_ADAPT_TIME_STEP_LAST Last - ADAPT_PREF_MG_ADAPT_AR - Arguments - - - ADAPT_PREF_MG_ADAPT_ADVOP - Advanced Options - - - ADAPT_PREF_MG_ADAPT_TIME_LAST_STEP - Last time step - - - ADAPT_PREF_MG_ADAPT_TIME_C_STEP - Chosen time step + ADAPT_PREF_MG_ADAPT_TIME_STEP + Choosen time step ADAPT_PREF_MG_ADAPT_TIME_STEP_C @@ -3177,6 +3153,10 @@ Check algorithm documentation for supported geometry MG_ADAPT_SELECT_FILE_0 MG-ADAPT select file + + ADAPT_PREF_MG_ADAPT_ADVOP + Advanced Options + SMESH_VISU_PROBLEM Mesh visualization failed diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index 4177ac636..a23d20e5a 100644 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -340,6 +340,150 @@ MEN_CONSTRUCT_GROUP Construire un groupe + + MEN_REF_ALL + Raffinement uniforme + + + MEN_REF_HOMARD + Raffinement avec HOMARD + + + MEN_HOMARD_CREATE_CASE + Création d'un cas d'adaptation + + + MEN_HOMARD_FOLLOW_ITERATION + Poursuite d'une itération d'adaptation + + + MEN_HOMARD_NEW_ITERATION + Création d'une itération d'adaptation + + + MEN_HOMARD_COMPUTE + Calculer + + + MEN_HOMARD_COMPUTE_PUBLISH + Calculer et publier + + + MEN_MG_ADAPT + Remaillage avec MG_Adapt + + + Args + Arguments + + + MeshOut + Maillage en sortie + + + MeshIn + Maillage en entrée + + + MEDFile + Fichier MED + + + Browser + Arbre d'études + + + Publish_MG_ADAPT + Publication + + + SIZE_MAP_FIELD + Champ de la carte de taille + + + MG_ADAPT_FIELD_NAME + Nom du champ + + + MG_ADAPT_MED_FILE_1 + Ce fichier MED est illisible. + + + MG_ADAPT_MED_FILE_2 + Ce fichier MED ne contient aucun maillage. + + + MG_ADAPT_MED_FILE_3 + Ce fichier MED contient plus d'un maillage. + + + MG_ADAPT_MED_FILE_4 + Impossible de lire le maillage de ce fichier MED. + + + MG_ADAPT_MED_FILE_5 + Ce fichier MED ne contient aucun champ. + + + MG_ADAPT_MED_FILE_6 + Impossible de lire le(s) champ(s) de ce fichier MED. + + + MG_ADAPT_ERROR + Erreur + + + MG_ADAPT_CH_ST + Pas de temps choisi + + + MG_ADAPT_RANK + Numéro d'ordre + + + MG_ADAPT_TSTP + Pas de temps + + + MG_ADAPT_NO_T_ST + Sans pas de temps + + + MG_ADAPT_L_ST + Dernier pas de temps + + + MeshName + Nom du maillage + + + LOCAL_MG_ADAPT + Locale + + + BACKGRND_MG_ADAPT + Arrière-plan + + + CNST_MG_ADAPT + Constante + + + MED_FILE_BCKG + Fichier MED de la carte en arrière-plan + + + VALUE_MG_ADAPT + Valeur + + + SIZE_MAP_DEF + Définition de la carte de taille + + + ADVOP + Options avancées + MEN_CONV_TO_QUAD Convertir vers/depuis quadratique @@ -792,114 +936,6 @@ MEN_ADAPT Adaptation - - Args - Arguments - - - MeshOut - Maillage en sortie - - - MEDFile - Fichier MED - - - Browser - Arbre d'études - - - BACKGRND_MG_ADAPT - Arrière-plan - - - CNST_MG_ADAPT - Constante - - - SIZE_MAP_FIELD - Champ de la carte de taille - - - MG_ADAPT_FIELD_NAME - Nom du champ - - - MG_ADAPT_MED_FILE_1 - Ce fichier MED est illisible. - - - MG_ADAPT_MED_FILE_2 - Ce fichier MED ne contient aucun maillage. - - - MG_ADAPT_MED_FILE_3 - Ce fichier MED contient plus d'un maillage. - - - MG_ADAPT_MED_FILE_4 - Impossible de lire le maillage de ce fichier MED. - - - MG_ADAPT_MED_FILE_5 - Ce fichier MED ne contient aucun champ. - - - MG_ADAPT_MED_FILE_6 - Impossible de lire le(s) champ(s) de ce fichier MED. - - - MG_ADAPT_NO_T_ST - Sans pas de temps - - - MG_ADAPT_CH_ST - Pas de temps choisi - - - MG_ADAPT_RANK - Numéro d'ordre - - - MG_ADAPT_TSTP - Pas de temps - - - MG_ADAPT_L_ST - Dernier pas de temps - - - MED_FILE_BCKG - fichier MED de la carte en arrière-plan - - - VALUE_MG_ADAPT - Valeur - - - Publish_MG_ADAPT - Publication - - - LOCAL_MG_ADAPT - locale - - - MeshName - Nom du maillage - - - MeshIn - Maillage en entrée - - - SIZE_MAP_DEF - Définition de la carte de taille - - - ADVOP - Advanced Options - MEN_MEASURE Outils de mesure @@ -1240,38 +1276,6 @@ MEN_TRANSF Transformation - - MEN_REF_ALL - Raffinement uniforme - - - MEN_REF_HOMARD - Raffinement avec HOMARD - - - MEN_HOMARD_CREATE_CASE - Création d'un cas d'adaptation - - - MEN_HOMARD_FOLLOW_ITERATION - Poursuite d'une itération d'adaptation - - - MEN_HOMARD_NEW_ITERATION - Création d'une itération d'adaptation - - - MEN_HOMARD_COMPUTE - Calculer - - - MEN_HOMARD_COMPUTE_PUBLISH - Calculer et publier - - - MEN_MG_ADAPT - Remaillage avec MG_Adapt - MEN_TRANSP Transparence @@ -3105,15 +3109,15 @@ Référez-vous à la documentation sur l'algorithme et la géométrie supportée max_memory - Maximum memoire (Mb) + Maximum mémoire (Mb) + + + Adaption + Adaptation components - Composants - - - Adapation - adaptation + Composantes ADAPT_PREF_MG_ADAPT_SIZE_MAP @@ -3127,14 +3131,14 @@ Référez-vous à la documentation sur l'algorithme et la géométrie supportée ADAPT_PREF_MG_ADAPT_SIZE_MAP_BACKGROUND Arrière-plan - - ADAPT_PREF_MG_ADAPT_TIME_STEP - Choix du pas de temps - ADAPT_PREF_MG_ADAPT_TIME_STEP_LAST Dernier + + ADAPT_PREF_MG_ADAPT_TIME_STEP + Choix du pas de temps + ADAPT_PREF_MG_ADAPT_TIME_STEP_C Valeur @@ -3143,6 +3147,10 @@ Référez-vous à la documentation sur l'algorithme et la géométrie supportée MG_ADAPT_SELECT_FILE_0 MG-ADAPT selection fichier MED + + ADAPT_PREF_MG_ADAPT_ADVOP + Options avancées + SMESH_VISU_PROBLEM Impossible de visualiser le maillage, probablement à cause d'un manque de mémoire From 55f658966bd743c8a7a5c9405f4d09e60657b97c Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Mon, 1 Feb 2021 11:26:34 +0100 Subject: [PATCH 074/100] =?UTF-8?q?M=C3=A9nage=20avant=20int=C3=A9gration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 47 +- idl/ADAPT_Gen.idl | 233 - idl/CMakeLists.txt | 7 - idl/HOMARD_Boundary.idl | 99 - idl/HOMARD_Cas.idl | 107 - idl/HOMARD_Hypothesis.idl | 136 - idl/HOMARD_Iteration.idl | 130 - idl/HOMARD_YACS.idl | 87 - idl/HOMARD_Zone.idl | 83 - resources/CMakeLists.txt | 4 - resources/SalomeApp.xml.in | 6 - resources/adapt_hom_iter_next.png | Bin 369 -> 0 bytes resources/adapt_hom_iter_poursuite.png | Bin 613 -> 0 bytes resources/adapt_ref_all.png | Bin 2641 -> 0 bytes resources/adapt_ref_homard.png | Bin 241 -> 0 bytes src/ADAPT/ADAPT_Gen.cxx | 41 - src/ADAPT/ADAPT_Gen.hxx | 37 - src/ADAPT/CMakeLists.txt | 79 - src/ADAPT/HOMARD.hxx | 53 - src/ADAPT/HOMARD_Boundary.cxx | 324 - src/ADAPT/HOMARD_Boundary.hxx | 111 - src/ADAPT/HOMARD_Cas.cxx | 283 - src/ADAPT/HOMARD_Cas.hxx | 112 - src/ADAPT/HOMARD_DriverTools.cxx | 840 --- src/ADAPT/HOMARD_DriverTools.hxx | 76 - src/ADAPT/HOMARD_Hypothesis.cxx | 524 -- src/ADAPT/HOMARD_Hypothesis.hxx | 157 - src/ADAPT/HOMARD_Iteration.cxx | 394 -- src/ADAPT/HOMARD_Iteration.hxx | 139 - src/ADAPT/HOMARD_YACS.cxx | 219 - src/ADAPT/HOMARD_YACS.hxx | 103 - src/ADAPT/HOMARD_Zone.cxx | 325 - src/ADAPT/HOMARD_Zone.hxx | 95 - src/ADAPT/HomardDriver.cxx | 1106 ---- src/ADAPT/HomardDriver.hxx | 85 - src/ADAPT/YACSDriver.cxx | 684 --- src/ADAPT/YACSDriver.hxx | 68 - src/ADAPTFrontTrack/CMakeLists.txt | 73 - src/ADAPTFrontTrack/FrontTrack.cxx | 164 - src/ADAPTFrontTrack/FrontTrack.hxx | 54 - src/ADAPTFrontTrack/FrontTrack_NodeGroups.cxx | 134 - src/ADAPTFrontTrack/FrontTrack_NodeGroups.hxx | 76 - .../FrontTrack_NodesOnGeom.cxx | 511 -- .../FrontTrack_NodesOnGeom.hxx | 117 - src/ADAPTFrontTrack/FrontTrack_Projector.cxx | 947 --- src/ADAPTFrontTrack/FrontTrack_Projector.hxx | 95 - src/ADAPTFrontTrack/FrontTrack_Utils.cxx | 164 - src/ADAPTFrontTrack/FrontTrack_Utils.hxx | 72 - src/ADAPTFrontTrack_SWIG/CMakeLists.txt | 83 - src/ADAPTFrontTrack_SWIG/FrontTrack.i | 67 - src/ADAPTGUI/ADAPT_msg_en.ts | 415 -- src/ADAPTGUI/ADAPT_msg_fr.ts | 1127 ---- src/ADAPTGUI/ADAPT_msg_ja.ts | 1148 ---- src/ADAPTGUI/CMakeLists.txt | 183 - src/ADAPTGUI/CreateBoundaryAn.ui | 1107 ---- src/ADAPTGUI/CreateBoundaryCAO.ui | 133 - src/ADAPTGUI/CreateBoundaryDi.ui | 133 - src/ADAPTGUI/CreateCase.ui | 777 --- src/ADAPTGUI/CreateHypothesis.ui | 1111 ---- src/ADAPTGUI/CreateIteration.ui | 600 -- src/ADAPTGUI/CreateListGroup.ui | 121 - src/ADAPTGUI/CreateYACS.ui | 526 -- src/ADAPTGUI/CreateZone.ui | 1139 ---- src/ADAPTGUI/EditFile.ui | 115 - src/ADAPTGUI/HOMARDGUI_Exports.hxx | 35 - src/ADAPTGUI/HOMARDGUI_Utils.cxx | 277 - src/ADAPTGUI/HOMARDGUI_Utils.h | 90 - src/ADAPTGUI/HomardQtCommun.cxx | 453 -- src/ADAPTGUI/HomardQtCommun.h | 58 - src/ADAPTGUI/IterInfo.ui | 129 - src/ADAPTGUI/MeshInfo.ui | 285 - src/ADAPTGUI/MonCreateBoundaryAn.cxx | 809 --- src/ADAPTGUI/MonCreateBoundaryAn.h | 96 - src/ADAPTGUI/MonCreateBoundaryCAO.cxx | 202 - src/ADAPTGUI/MonCreateBoundaryCAO.h | 73 - src/ADAPTGUI/MonCreateBoundaryDi.cxx | 211 - src/ADAPTGUI/MonCreateBoundaryDi.h | 73 - src/ADAPTGUI/MonCreateCase.cxx | 694 --- src/ADAPTGUI/MonCreateCase.h | 102 - src/ADAPTGUI/MonCreateHypothesis.cxx | 945 --- src/ADAPTGUI/MonCreateHypothesis.h | 138 - src/ADAPTGUI/MonCreateIteration.cxx | 339 - src/ADAPTGUI/MonCreateIteration.h | 78 - src/ADAPTGUI/MonCreateListGroup.cxx | 153 - src/ADAPTGUI/MonCreateListGroup.h | 64 - src/ADAPTGUI/MonCreateListGroupCAO.cxx | 150 - src/ADAPTGUI/MonCreateListGroupCAO.h | 64 - src/ADAPTGUI/MonCreateYACS.cxx | 342 -- src/ADAPTGUI/MonCreateYACS.h | 84 - src/ADAPTGUI/MonCreateZone.cxx | 713 --- src/ADAPTGUI/MonCreateZone.h | 87 - src/ADAPTGUI/MonEditBoundaryAn.cxx | 399 -- src/ADAPTGUI/MonEditBoundaryAn.h | 61 - src/ADAPTGUI/MonEditBoundaryCAO.cxx | 105 - src/ADAPTGUI/MonEditBoundaryCAO.h | 51 - src/ADAPTGUI/MonEditBoundaryDi.cxx | 105 - src/ADAPTGUI/MonEditBoundaryDi.h | 51 - src/ADAPTGUI/MonEditCase.cxx | 269 - src/ADAPTGUI/MonEditCase.h | 50 - src/ADAPTGUI/MonEditFile.cxx | 119 - src/ADAPTGUI/MonEditFile.h | 64 - src/ADAPTGUI/MonEditHypothesis.cxx | 463 -- src/ADAPTGUI/MonEditHypothesis.h | 56 - src/ADAPTGUI/MonEditIteration.cxx | 186 - src/ADAPTGUI/MonEditIteration.h | 57 - src/ADAPTGUI/MonEditListGroup.cxx | 61 - src/ADAPTGUI/MonEditListGroup.h | 49 - src/ADAPTGUI/MonEditListGroupCAO.cxx | 61 - src/ADAPTGUI/MonEditListGroupCAO.h | 49 - src/ADAPTGUI/MonEditYACS.cxx | 148 - src/ADAPTGUI/MonEditYACS.h | 50 - src/ADAPTGUI/MonEditZone.cxx | 432 -- src/ADAPTGUI/MonEditZone.h | 59 - src/ADAPTGUI/MonIterInfo.cxx | 175 - src/ADAPTGUI/MonIterInfo.h | 78 - src/ADAPTGUI/MonMeshInfo.cxx | 281 - src/ADAPTGUI/MonMeshInfo.h | 76 - src/ADAPTGUI/MonPursueIteration.cxx | 288 - src/ADAPTGUI/MonPursueIteration.h | 72 - src/ADAPTGUI/PursueIteration.ui | 252 - src/ADAPT_I/ADAPT_Gen_i.cxx | 5432 ----------------- src/ADAPT_I/ADAPT_Gen_i.hxx | 347 -- src/ADAPT_I/CMakeLists.txt | 102 - src/ADAPT_I/HOMARD_Boundary_i.cxx | 262 - src/ADAPT_I/HOMARD_Boundary_i.hxx | 112 - src/ADAPT_I/HOMARD_Cas_i.cxx | 599 -- src/ADAPT_I/HOMARD_Cas_i.hxx | 119 - src/ADAPT_I/HOMARD_Hypothesis_i.cxx | 506 -- src/ADAPT_I/HOMARD_Hypothesis_i.hxx | 138 - src/ADAPT_I/HOMARD_Iteration_i.cxx | 465 -- src/ADAPT_I/HOMARD_Iteration_i.hxx | 145 - src/ADAPT_I/HOMARD_YACS_i.cxx | 279 - src/ADAPT_I/HOMARD_YACS_i.hxx | 112 - src/ADAPT_I/HOMARD_Zone_i.cxx | 218 - src/ADAPT_I/HOMARD_Zone_i.hxx | 104 - src/ADAPT_I/HOMARD_i.hxx | 35 - src/ADAPT_I/HomardMedCommun.cxx | 335 - src/ADAPT_I/HomardMedCommun.h | 32 - src/CMakeLists.txt | 5 - src/SMESHGUI/CMakeLists.txt | 7 - src/SMESHGUI/MG_ADAPTGUI.cxx | 36 +- src/SMESHGUI/MG_ADAPTGUI.hxx | 4 +- src/SMESHGUI/SMESHGUI.cxx | 81 +- src/SMESHGUI/SMESHGUI_AdaptDlg.cxx | 92 +- src/SMESHGUI/SMESHGUI_Operations.h | 8 - src/SMESHGUI/SMESH_images.ts | 26 +- src/SMESHGUI/SMESH_msg_en.ts | 118 +- src/SMESHGUI/SMESH_msg_fr.ts | 116 - src/SMESH_I/MG_ADAPT_i.cxx | 54 +- 149 files changed, 72 insertions(+), 38714 deletions(-) delete mode 100644 idl/ADAPT_Gen.idl delete mode 100644 idl/HOMARD_Boundary.idl delete mode 100644 idl/HOMARD_Cas.idl delete mode 100644 idl/HOMARD_Hypothesis.idl delete mode 100644 idl/HOMARD_Iteration.idl delete mode 100644 idl/HOMARD_YACS.idl delete mode 100644 idl/HOMARD_Zone.idl delete mode 100755 resources/adapt_hom_iter_next.png delete mode 100755 resources/adapt_hom_iter_poursuite.png delete mode 100755 resources/adapt_ref_all.png delete mode 100755 resources/adapt_ref_homard.png delete mode 100644 src/ADAPT/ADAPT_Gen.cxx delete mode 100644 src/ADAPT/ADAPT_Gen.hxx delete mode 100644 src/ADAPT/CMakeLists.txt delete mode 100644 src/ADAPT/HOMARD.hxx delete mode 100644 src/ADAPT/HOMARD_Boundary.cxx delete mode 100644 src/ADAPT/HOMARD_Boundary.hxx delete mode 100644 src/ADAPT/HOMARD_Cas.cxx delete mode 100644 src/ADAPT/HOMARD_Cas.hxx delete mode 100644 src/ADAPT/HOMARD_DriverTools.cxx delete mode 100644 src/ADAPT/HOMARD_DriverTools.hxx delete mode 100644 src/ADAPT/HOMARD_Hypothesis.cxx delete mode 100644 src/ADAPT/HOMARD_Hypothesis.hxx delete mode 100644 src/ADAPT/HOMARD_Iteration.cxx delete mode 100644 src/ADAPT/HOMARD_Iteration.hxx delete mode 100644 src/ADAPT/HOMARD_YACS.cxx delete mode 100644 src/ADAPT/HOMARD_YACS.hxx delete mode 100644 src/ADAPT/HOMARD_Zone.cxx delete mode 100644 src/ADAPT/HOMARD_Zone.hxx delete mode 100644 src/ADAPT/HomardDriver.cxx delete mode 100644 src/ADAPT/HomardDriver.hxx delete mode 100644 src/ADAPT/YACSDriver.cxx delete mode 100644 src/ADAPT/YACSDriver.hxx delete mode 100644 src/ADAPTFrontTrack/CMakeLists.txt delete mode 100644 src/ADAPTFrontTrack/FrontTrack.cxx delete mode 100644 src/ADAPTFrontTrack/FrontTrack.hxx delete mode 100644 src/ADAPTFrontTrack/FrontTrack_NodeGroups.cxx delete mode 100644 src/ADAPTFrontTrack/FrontTrack_NodeGroups.hxx delete mode 100644 src/ADAPTFrontTrack/FrontTrack_NodesOnGeom.cxx delete mode 100644 src/ADAPTFrontTrack/FrontTrack_NodesOnGeom.hxx delete mode 100644 src/ADAPTFrontTrack/FrontTrack_Projector.cxx delete mode 100644 src/ADAPTFrontTrack/FrontTrack_Projector.hxx delete mode 100644 src/ADAPTFrontTrack/FrontTrack_Utils.cxx delete mode 100644 src/ADAPTFrontTrack/FrontTrack_Utils.hxx delete mode 100644 src/ADAPTFrontTrack_SWIG/CMakeLists.txt delete mode 100644 src/ADAPTFrontTrack_SWIG/FrontTrack.i delete mode 100644 src/ADAPTGUI/ADAPT_msg_en.ts delete mode 100644 src/ADAPTGUI/ADAPT_msg_fr.ts delete mode 100644 src/ADAPTGUI/ADAPT_msg_ja.ts delete mode 100644 src/ADAPTGUI/CMakeLists.txt delete mode 100644 src/ADAPTGUI/CreateBoundaryAn.ui delete mode 100644 src/ADAPTGUI/CreateBoundaryCAO.ui delete mode 100644 src/ADAPTGUI/CreateBoundaryDi.ui delete mode 100644 src/ADAPTGUI/CreateCase.ui delete mode 100644 src/ADAPTGUI/CreateHypothesis.ui delete mode 100644 src/ADAPTGUI/CreateIteration.ui delete mode 100644 src/ADAPTGUI/CreateListGroup.ui delete mode 100644 src/ADAPTGUI/CreateYACS.ui delete mode 100644 src/ADAPTGUI/CreateZone.ui delete mode 100644 src/ADAPTGUI/EditFile.ui delete mode 100644 src/ADAPTGUI/HOMARDGUI_Exports.hxx delete mode 100644 src/ADAPTGUI/HOMARDGUI_Utils.cxx delete mode 100644 src/ADAPTGUI/HOMARDGUI_Utils.h delete mode 100644 src/ADAPTGUI/HomardQtCommun.cxx delete mode 100644 src/ADAPTGUI/HomardQtCommun.h delete mode 100644 src/ADAPTGUI/IterInfo.ui delete mode 100644 src/ADAPTGUI/MeshInfo.ui delete mode 100644 src/ADAPTGUI/MonCreateBoundaryAn.cxx delete mode 100644 src/ADAPTGUI/MonCreateBoundaryAn.h delete mode 100644 src/ADAPTGUI/MonCreateBoundaryCAO.cxx delete mode 100644 src/ADAPTGUI/MonCreateBoundaryCAO.h delete mode 100644 src/ADAPTGUI/MonCreateBoundaryDi.cxx delete mode 100644 src/ADAPTGUI/MonCreateBoundaryDi.h delete mode 100644 src/ADAPTGUI/MonCreateCase.cxx delete mode 100644 src/ADAPTGUI/MonCreateCase.h delete mode 100644 src/ADAPTGUI/MonCreateHypothesis.cxx delete mode 100644 src/ADAPTGUI/MonCreateHypothesis.h delete mode 100644 src/ADAPTGUI/MonCreateIteration.cxx delete mode 100644 src/ADAPTGUI/MonCreateIteration.h delete mode 100644 src/ADAPTGUI/MonCreateListGroup.cxx delete mode 100644 src/ADAPTGUI/MonCreateListGroup.h delete mode 100644 src/ADAPTGUI/MonCreateListGroupCAO.cxx delete mode 100644 src/ADAPTGUI/MonCreateListGroupCAO.h delete mode 100644 src/ADAPTGUI/MonCreateYACS.cxx delete mode 100644 src/ADAPTGUI/MonCreateYACS.h delete mode 100644 src/ADAPTGUI/MonCreateZone.cxx delete mode 100644 src/ADAPTGUI/MonCreateZone.h delete mode 100644 src/ADAPTGUI/MonEditBoundaryAn.cxx delete mode 100644 src/ADAPTGUI/MonEditBoundaryAn.h delete mode 100644 src/ADAPTGUI/MonEditBoundaryCAO.cxx delete mode 100644 src/ADAPTGUI/MonEditBoundaryCAO.h delete mode 100644 src/ADAPTGUI/MonEditBoundaryDi.cxx delete mode 100644 src/ADAPTGUI/MonEditBoundaryDi.h delete mode 100644 src/ADAPTGUI/MonEditCase.cxx delete mode 100644 src/ADAPTGUI/MonEditCase.h delete mode 100644 src/ADAPTGUI/MonEditFile.cxx delete mode 100644 src/ADAPTGUI/MonEditFile.h delete mode 100644 src/ADAPTGUI/MonEditHypothesis.cxx delete mode 100644 src/ADAPTGUI/MonEditHypothesis.h delete mode 100644 src/ADAPTGUI/MonEditIteration.cxx delete mode 100644 src/ADAPTGUI/MonEditIteration.h delete mode 100644 src/ADAPTGUI/MonEditListGroup.cxx delete mode 100644 src/ADAPTGUI/MonEditListGroup.h delete mode 100644 src/ADAPTGUI/MonEditListGroupCAO.cxx delete mode 100644 src/ADAPTGUI/MonEditListGroupCAO.h delete mode 100644 src/ADAPTGUI/MonEditYACS.cxx delete mode 100644 src/ADAPTGUI/MonEditYACS.h delete mode 100644 src/ADAPTGUI/MonEditZone.cxx delete mode 100644 src/ADAPTGUI/MonEditZone.h delete mode 100644 src/ADAPTGUI/MonIterInfo.cxx delete mode 100644 src/ADAPTGUI/MonIterInfo.h delete mode 100644 src/ADAPTGUI/MonMeshInfo.cxx delete mode 100644 src/ADAPTGUI/MonMeshInfo.h delete mode 100644 src/ADAPTGUI/MonPursueIteration.cxx delete mode 100644 src/ADAPTGUI/MonPursueIteration.h delete mode 100644 src/ADAPTGUI/PursueIteration.ui delete mode 100644 src/ADAPT_I/ADAPT_Gen_i.cxx delete mode 100644 src/ADAPT_I/ADAPT_Gen_i.hxx delete mode 100644 src/ADAPT_I/CMakeLists.txt delete mode 100644 src/ADAPT_I/HOMARD_Boundary_i.cxx delete mode 100644 src/ADAPT_I/HOMARD_Boundary_i.hxx delete mode 100644 src/ADAPT_I/HOMARD_Cas_i.cxx delete mode 100644 src/ADAPT_I/HOMARD_Cas_i.hxx delete mode 100644 src/ADAPT_I/HOMARD_Hypothesis_i.cxx delete mode 100644 src/ADAPT_I/HOMARD_Hypothesis_i.hxx delete mode 100644 src/ADAPT_I/HOMARD_Iteration_i.cxx delete mode 100644 src/ADAPT_I/HOMARD_Iteration_i.hxx delete mode 100644 src/ADAPT_I/HOMARD_YACS_i.cxx delete mode 100644 src/ADAPT_I/HOMARD_YACS_i.hxx delete mode 100644 src/ADAPT_I/HOMARD_Zone_i.cxx delete mode 100644 src/ADAPT_I/HOMARD_Zone_i.hxx delete mode 100644 src/ADAPT_I/HOMARD_i.hxx delete mode 100644 src/ADAPT_I/HomardMedCommun.cxx delete mode 100644 src/ADAPT_I/HomardMedCommun.h diff --git a/CMakeLists.txt b/CMakeLists.txt index f93ed2749..651fbb877 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,7 +65,7 @@ SET(BUILD_SHARED_LIBS TRUE) # ============ OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON) OPTION(SALOME_BUILD_DOC "Generate SALOME SMESH documentation" ON) - + # Advanced options: OPTION(SALOME_BUILD_GUI "Enable GUI" ON) OPTION(SALOME_SMESH_USE_CGNS "Enable import/export to CGNS format" OFF) @@ -142,7 +142,7 @@ IF(SALOME_BUILD_GUI) IF(EXISTS ${GUI_ROOT_DIR}) FIND_PACKAGE(SalomeGUI) SALOME_GUI_WITH_CORBA() #check whether GUI built with CORBA - SALOME_GUI_MODE(SALOME_USE_VTKVIEWER SALOME_USE_SALOMEOBJECT + SALOME_GUI_MODE(SALOME_USE_VTKVIEWER SALOME_USE_SALOMEOBJECT OPTIONAL SALOME_USE_PLOT2DVIEWER SALOME_USE_PYCONSOLE) ## ## Prerequisites From GUI: @@ -207,7 +207,7 @@ ENDIF(EXISTS ${MEDCOUPLING_ROOT_DIR}) # VTK is obligatiry for the SMESH FIND_PACKAGE(SalomeVTK REQUIRED) -FIND_PACKAGE(SalomeOpenCASCADE REQUIRED) +FIND_PACKAGE(SalomeOpenCASCADE REQUIRED) IF(SALOME_SMESH_USE_CGNS) FIND_PACKAGE(SalomeCGNS) @@ -233,7 +233,7 @@ IF(WIN32) MESSAGE(STATUS "Build MEFISTO2D mesher using Fortran to C generator") ELSE(${F2C_FOUND}) MESSAGE(FATAL "Fortran to C generator is not found: MEFISTO2D mesher cannot be compiled! Please define F2C_ROOT_DIR !") - ENDIF(${F2C_FOUND}) + ENDIF(${F2C_FOUND}) ENDIF(WIN32) IF(SALOME_SMESH_ENABLE_MEFISTO) @@ -252,32 +252,32 @@ SET(SALOME_INSTALL_BINS "${SALOME_INSTALL_BINS}" CACHE PATH "Install path: SALOM SET(SALOME_INSTALL_LIBS "${SALOME_INSTALL_LIBS}" CACHE PATH "Install path: SALOME libs") SET(SALOME_INSTALL_IDLS "${SALOME_INSTALL_IDLS}" CACHE PATH "Install path: SALOME IDL files") SET(SALOME_INSTALL_HEADERS "${SALOME_INSTALL_HEADERS}" CACHE PATH "Install path: SALOME headers") -SET(SALOME_INSTALL_SCRIPT_SCRIPTS "${SALOME_INSTALL_SCRIPT_SCRIPTS}" CACHE PATH +SET(SALOME_INSTALL_SCRIPT_SCRIPTS "${SALOME_INSTALL_SCRIPT_SCRIPTS}" CACHE PATH "Install path: SALOME scripts") -SET(SALOME_INSTALL_SCRIPT_DATA "${SALOME_INSTALL_SCRIPT_DATA}" CACHE PATH +SET(SALOME_INSTALL_SCRIPT_DATA "${SALOME_INSTALL_SCRIPT_DATA}" CACHE PATH "Install path: SALOME script data") -SET(SALOME_INSTALL_SCRIPT_PYTHON "${SALOME_INSTALL_SCRIPT_PYTHON}" CACHE PATH +SET(SALOME_INSTALL_SCRIPT_PYTHON "${SALOME_INSTALL_SCRIPT_PYTHON}" CACHE PATH "Install path: SALOME Python scripts") -SET(SALOME_INSTALL_APPLISKEL_SCRIPTS "${SALOME_INSTALL_APPLISKEL_SCRIPTS}" CACHE PATH +SET(SALOME_INSTALL_APPLISKEL_SCRIPTS "${SALOME_INSTALL_APPLISKEL_SCRIPTS}" CACHE PATH "Install path: SALOME application skeleton - scripts") -SET(SALOME_INSTALL_APPLISKEL_PYTHON "${SALOME_INSTALL_APPLISKEL_PYTHON}" CACHE PATH +SET(SALOME_INSTALL_APPLISKEL_PYTHON "${SALOME_INSTALL_APPLISKEL_PYTHON}" CACHE PATH "Install path: SALOME application skeleton - Python") SET(SALOME_INSTALL_PYTHON "${SALOME_INSTALL_PYTHON}" CACHE PATH "Install path: SALOME Python stuff") -SET(SALOME_INSTALL_PYTHON_SHARED "${SALOME_INSTALL_PYTHON_SHARED}" CACHE PATH +SET(SALOME_INSTALL_PYTHON_SHARED "${SALOME_INSTALL_PYTHON_SHARED}" CACHE PATH "Install path: SALOME Python shared modules") -SET(SALOME_INSTALL_CMAKE_LOCAL "${SALOME_INSTALL_CMAKE_LOCAL}" CACHE PATH - "Install path: local SALOME CMake files") +SET(SALOME_INSTALL_CMAKE_LOCAL "${SALOME_INSTALL_CMAKE_LOCAL}" CACHE PATH + "Install path: local SALOME CMake files") SET(SALOME_INSTALL_AMCONFIG_LOCAL "${SALOME_INSTALL_AMCONFIG_LOCAL}" CACHE PATH "Install path: local SALOME config files (obsolete, to be removed)") SET(SALOME_INSTALL_RES "${SALOME_INSTALL_RES}" CACHE PATH "Install path: SALOME resources") SET(SALOME_INSTALL_DOC "${SALOME_INSTALL_DOC}" CACHE PATH "Install path: SALOME documentation") # Specific to SMESH: -SET(SALOME_SMESH_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/smesh" CACHE PATH +SET(SALOME_SMESH_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/smesh" CACHE PATH "Install path: SALOME SMESH specific data") -SET(SALOME_SMESH_INSTALL_PLUGINS share/salome/plugins/smesh CACHE PATH +SET(SALOME_SMESH_INSTALL_PLUGINS share/salome/plugins/smesh CACHE PATH "Install path: SALOME SMESH plugins") - + MARK_AS_ADVANCED(SALOME_INSTALL_BINS SALOME_INSTALL_LIBS SALOME_INSTALL_IDLS SALOME_INSTALL_HEADERS) MARK_AS_ADVANCED(SALOME_INSTALL_SCRIPT_SCRIPTS SALOME_INSTALL_SCRIPT_DATA SALOME_INSTALL_SCRIPT_PYTHON) MARK_AS_ADVANCED(SALOME_INSTALL_APPLISKEL_SCRIPTS SALOME_INSTALL_APPLISKEL_PYTHON SALOME_INSTALL_CMAKE_LOCAL SALOME_INSTALL_RES) @@ -299,9 +299,9 @@ SET(SALOME_ADAPT_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/adapt" CACHE PATH SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS} ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON} ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON_SHARED}) -SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS}) +SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS}) -# Sources +# Sources # ======== ADD_SUBDIRECTORY(idl) @@ -328,28 +328,27 @@ INCLUDE(CMakePackageConfigHelpers) # List of targets in this project we want to make visible to the rest of the world. # They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup" -SET(_${PROJECT_NAME}_exposed_targets +SET(_${PROJECT_NAME}_exposed_targets SMESHControls MeshDriver MeshDriverDAT MeshDriverGMF MeshDriverMED MeshDriverSTL MeshDriverUNV MEDWrapper SMDS SMESHimpl SMESHEngine SMESHClient SMESHDS SMESHUtils StdMeshers StdMeshersEngine MeshJobManagerEngine SPADDERPluginTesterEngine SalomeIDLSMESH SalomeIDLSPADDER - ADAPTEngine ADAPTFrontTrack ADAPTImpl ) IF(SALOME_SMESH_ENABLE_MEFISTO) LIST(APPEND _${PROJECT_NAME}_exposed_targets - MEFISTO2D) + MEFISTO2D) ENDIF(SALOME_SMESH_ENABLE_MEFISTO) IF(SALOME_BUILD_GUI) LIST(APPEND _${PROJECT_NAME}_exposed_targets - SMESHObject SMESHFiltersSelection SMESH PluginUtils StdMeshersGUI ADAPTGUI + SMESHObject SMESHFiltersSelection SMESH PluginUtils StdMeshersGUI ) ENDIF(SALOME_BUILD_GUI) IF(SALOME_SMESH_USE_CGNS) - LIST(APPEND _${PROJECT_NAME}_exposed_targets + LIST(APPEND _${PROJECT_NAME}_exposed_targets MeshDriverCGNS ) ENDIF(SALOME_SMESH_USE_CGNS) @@ -366,7 +365,7 @@ SET(GEOM_ROOT_DIR "${GEOM_ROOT_DIR}") SET(MEDFILE_ROOT_DIR "${MEDFILE_ROOT_DIR}") SET(CGNS_ROOT_DIR "${CGNS_ROOT_DIR}") SET(TBB_ROOT_DIR "${TBB_ROOT_DIR}") - + SET(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include") # Build variables that will be expanded when configuring SalomeConfig.cmake: @@ -389,5 +388,5 @@ INSTALL(FILES DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}") # Install the export set for use with the install-tree -INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}" +INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}" FILE ${PROJECT_NAME}Targets.cmake) diff --git a/idl/ADAPT_Gen.idl b/idl/ADAPT_Gen.idl deleted file mode 100644 index 83114652e..000000000 --- a/idl/ADAPT_Gen.idl +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef __ADAPT_GEN__ -#define __ADAPT_GEN__ - -#include "SALOME_Component.idl" -#include "SALOME_Exception.idl" -#include "SALOMEDS.idl" - -#include "HOMARD_Cas.idl" -#include "HOMARD_Hypothesis.idl" -#include "HOMARD_Iteration.idl" -#include "HOMARD_Zone.idl" -#include "HOMARD_Boundary.idl" -#include "HOMARD_YACS.idl" - -module ADAPT -{ - typedef sequence listeHypotheses; - typedef sequence listeZones; - typedef sequence listeIterations; - typedef sequence listeCases; - typedef sequence listeBoundarys; - typedef sequence listeYACSs; - - interface ADAPT_Gen : Engines::EngineComponent, SALOMEDS::Driver - { -// -// A. Les methodes qui suivent sont celles que l'on retrouvera dans -// le fichier resources/HOMARDCatalog.xml.in pour definir le composant HOMARD dans YACS -// A priori, ce sont les seules sont l'utilisateur doit connaitre l'existence. -// ATTENTION : si les noms des arguments changent dans les Createxxxx, il faudra les changer -// dans YACSDriver pour assurer la coherence -// -// A.1. Les creations -// - HOMARD_Boundary CreateBoundaryCAO (in string BoundaryName, in string FileName) - raises(SALOME::SALOME_Exception); - HOMARD_Boundary CreateBoundaryDi (in string BoundaryName, in string MeshName, in string FileName) - raises(SALOME::SALOME_Exception); - HOMARD_Boundary CreateBoundaryCylinder (in string BoundaryName, - in double Xcentre, in double Ycentre, in double Zcentre, - in double Xaxis, in double Yaxis, in double Zaxis, - in double Radius) - raises (SALOME::SALOME_Exception); - HOMARD_Boundary CreateBoundarySphere (in string BoundaryName, - in double Xcentre, in double Ycentre, in double Zcentre, - in double Radius) - raises(SALOME::SALOME_Exception); - HOMARD_Boundary CreateBoundaryConeR (in string BoundaryName, - in double Xcentre1, in double Ycentre1, in double Zcentre1, in double Radius1, - in double Xcentre2, in double Ycentre2, in double Zcentre2, in double Radius2) - raises(SALOME::SALOME_Exception); - HOMARD_Boundary CreateBoundaryConeA (in string BoundaryName, - in double Xaxis, in double Yaxis, in double Zaxis, in double Angle, - in double Xcentre, in double Ycentre, in double Zcentre) - raises(SALOME::SALOME_Exception); - HOMARD_Boundary CreateBoundaryTorus (in string BoundaryName, - in double Xcentre, in double Ycentre, in double Zcentre, - in double Xaxis, in double Yaxis, in double Zaxis, - in double RadiusRev, in double RadiusPri) - raises (SALOME::SALOME_Exception); - HOMARD_Cas CreateCase(in string CaseName, in string MeshName, in string FileName ) - raises(SALOME::SALOME_Exception); - HOMARD_Cas CreateCaseFromIteration(in string CaseName, in string DirNameStart ) - raises(SALOME::SALOME_Exception); - HOMARD_Cas CreateCaseFromCaseLastIteration(in string CaseName, in string DirNameStart ) - raises(SALOME::SALOME_Exception); - HOMARD_Cas CreateCaseFromCaseIteration(in string CaseName, in string DirNameStart, in long Number ) - raises(SALOME::SALOME_Exception); - HOMARD_Hypothesis CreateHypothesis(in string HypoName ) - raises(SALOME::SALOME_Exception); - HOMARD_Zone CreateZoneBox (in string ZoneName, - in double Xmini, in double Xmaxi, - in double Ymini, in double Ymaxi, - in double Zmini, in double Zmaxi) - raises(SALOME::SALOME_Exception); - HOMARD_Zone CreateZoneBox2D (in string ZoneName, - in double Umini, in double Umaxi, - in double Vmini, in double Vmaxi, - in long Orient) - raises(SALOME::SALOME_Exception); - HOMARD_Zone CreateZoneCylinder (in string ZoneName, - in double Xcentre, in double Ycentre, in double Zcentre, - in double Xaxis, in double Yaxis, in double Zaxis, - in double Radius, in double Height) - raises(SALOME::SALOME_Exception); - HOMARD_Zone CreateZoneDisk (in string ZoneName, - in double Ucentre, in double Vcentre, - in double Radius, in long Orient) - raises(SALOME::SALOME_Exception); - HOMARD_Zone CreateZoneDiskWithHole (in string ZoneName, - in double Ucentre, in double Vcentre, - in double Radius, in double InternalRadius, - in long Orient) - raises(SALOME::SALOME_Exception); - HOMARD_Zone CreateZonePipe (in string ZoneName, - in double Xcentre, in double Ycentre, in double Zcentre, - in double Xaxis, in double Yaxis, in double Zaxis, - in double Radius, in double Height, in double InternalRadius) - raises(SALOME::SALOME_Exception); - HOMARD_Zone CreateZoneSphere (in string ZoneName, - in double Xcentre, in double Ycentre, in double Zcentre, - in double Radius) - raises(SALOME::SALOME_Exception); -// -// A.2. Les informations -// - HOMARD_Boundary GetBoundary(in string BoundaryName) raises (SALOME::SALOME_Exception); - HOMARD_Cas GetCase(in string CaseName) raises (SALOME::SALOME_Exception); - HOMARD_Hypothesis GetHypothesis(in string HypoName) raises (SALOME::SALOME_Exception); - HOMARD_Iteration GetIteration(in string IterName) raises (SALOME::SALOME_Exception); - HOMARD_YACS GetYACS(in string YACSName) raises (SALOME::SALOME_Exception); - HOMARD_Zone GetZone(in string ZoneName) raises (SALOME::SALOME_Exception); - - listeBoundarys GetAllBoundarysName() raises (SALOME::SALOME_Exception); - listeCases GetAllCasesName() raises (SALOME::SALOME_Exception); - listeHypotheses GetAllHypothesesName() raises (SALOME::SALOME_Exception); - listeIterations GetAllIterationsName() raises (SALOME::SALOME_Exception); - listeYACSs GetAllYACSsName() raises (SALOME::SALOME_Exception); - listeZones GetAllZonesName() raises (SALOME::SALOME_Exception); - - void MeshInfo(in string CaseName, in string MeshName, in string FileName, in string DirName, in long Qual, in long Diam, in long Conn, in long Tail, in long Inte ) - raises(SALOME::SALOME_Exception); - - HOMARD_Iteration LastIteration(in string CaseName) raises (SALOME::SALOME_Exception); -// -// A.3. L'etude -// - void UpdateStudy() raises (SALOME::SALOME_Exception); -// -// A.4. Les caracteristiques generales -// - void SetLanguageShort (in string LanguageShort) raises (SALOME::SALOME_Exception); - string GetLanguageShort () raises (SALOME::SALOME_Exception); -// -// B. Les methodes qui suivent n'apparaissent pas dans le composant HOMARD dans YACS -// L'utilisateur ne devrait pas les connaitre (ni s'en servir, a fortiori) -// - HOMARD_Iteration CreateIteration(in string IterName, in string PreviousIterName ) - raises(SALOME::SALOME_Exception); -// - void InvalideBoundary (in string BoundaryName) raises (SALOME::SALOME_Exception); - void InvalideHypo (in string HypoName) raises (SALOME::SALOME_Exception); - void InvalideIter (in string IterName) raises (SALOME::SALOME_Exception); - void InvalideIterOption (in string IterName, in long Option) - raises(SALOME::SALOME_Exception); - void InvalideYACS (in string YacsName) raises (SALOME::SALOME_Exception); - void InvalideZone (in string ZoneName) raises (SALOME::SALOME_Exception); - - long DeleteBoundary (in string BoundaryName) raises (SALOME::SALOME_Exception); - long DeleteCase(in string CaseName, in long Option) - raises(SALOME::SALOME_Exception); - long DeleteHypo(in string HypoName) raises (SALOME::SALOME_Exception); - long DeleteIteration(in string IterName, in long Option) - raises(SALOME::SALOME_Exception); - long DeleteIterationOption(in string IterName, in long Option1, in long Option2) - raises(SALOME::SALOME_Exception); - long DeleteYACS(in string YacsName, in long Option) raises (SALOME::SALOME_Exception); - long DeleteZone (in string ZoneName) raises (SALOME::SALOME_Exception); -// - void AssociateIterHypo(in string IterName, in string HypoName) - raises(SALOME::SALOME_Exception); - -// - void AssociateHypoZone(in string HypoName, in string ZoneName, in long TypeUse) - raises(SALOME::SALOME_Exception); - void DissociateHypoZone(in string HypoName, in string ZoneName) - raises(SALOME::SALOME_Exception); - - long Compute (in string IterName, in long CleanOption, in long modeHOMARD, in long Option1, in long Option2) - raises(SALOME::SALOME_Exception); - -// - string CreateDirNameIter(in string NomDir, in long option ) - raises(SALOME::SALOME_Exception); - - string VerifieDir (in string NomDir) raises (SALOME::SALOME_Exception); - -// - void PublishFileUnderIteration(in string IterName, in string FileName, in string Comment) - raises(SALOME::SALOME_Exception); - void PublishBoundaryUnderCase(in string CaseName, in string BoundaryName) - raises(SALOME::SALOME_Exception); - void PublishResultInSmesh(in string FileName, in long Option) - raises(SALOME::SALOME_Exception); - void PublishMeshIterInSmesh (in string IterName) raises(SALOME::SALOME_Exception); - -// - -// -// La creation des schemas YACS - HOMARD_YACS CreateYACSSchema(in string YACSName, in string CaseName, in string ScriptFile, in string DirName, in string MeshFile) - raises(SALOME::SALOME_Exception); - long YACSWrite (in string YACSName) raises (SALOME::SALOME_Exception); - long YACSWriteOnFile (in string YACSName, in string YACSFile) - raises(SALOME::SALOME_Exception); - -// -// Les preferences - void SetPublisMesh (in long PublisMeshIN, in long PublisMeshOUT) - raises (SALOME::SALOME_Exception); - long GetPublisMeshIN () raises (SALOME::SALOME_Exception); - long GetPublisMeshOUT () raises (SALOME::SALOME_Exception); - void SetYACSMaximum(in long YACSMaxIter, in long YACSMaxNode, in long YACSMaxElem) - raises (SALOME::SALOME_Exception); - long GetYACSMaxIter() raises (SALOME::SALOME_Exception); - long GetYACSMaxNode() raises (SALOME::SALOME_Exception); - long GetYACSMaxElem() raises (SALOME::SALOME_Exception); - void SetYACSConvergenceType(in long TypeTest) raises (SALOME::SALOME_Exception); - long GetYACSConvergenceType() raises (SALOME::SALOME_Exception); - }; -}; - -#endif - diff --git a/idl/CMakeLists.txt b/idl/CMakeLists.txt index 4a67452e6..6387eb741 100644 --- a/idl/CMakeLists.txt +++ b/idl/CMakeLists.txt @@ -36,13 +36,6 @@ SET(SalomeIDLSMESH_IDLSOURCES SMESH_Pattern.idl SMESH_MeshEditor.idl SMESH_Measurements.idl - HOMARD_Boundary.idl - HOMARD_Cas.idl - ADAPT_Gen.idl - HOMARD_Hypothesis.idl - HOMARD_Iteration.idl - HOMARD_YACS.idl - HOMARD_Zone.idl MG_ADAPT.idl ) diff --git a/idl/HOMARD_Boundary.idl b/idl/HOMARD_Boundary.idl deleted file mode 100644 index aa7baea61..000000000 --- a/idl/HOMARD_Boundary.idl +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier -// - -#ifndef _HOMARD_Boundary_IDL -#define _HOMARD_Boundary_IDL - -#include "SALOME_Component.idl" -#include "SALOME_Exception.idl" -#include "SALOMEDS.idl" - -#include "HOMARD_Cas.idl" -#include "HOMARD_Zone.idl" - - -module ADAPT -{ - interface HOMARD_Boundary : Engines::EngineComponent - { -// Generalites - void SetName(in string Name) raises (SALOME::SALOME_Exception); - string GetName() raises (SALOME::SALOME_Exception); - - long Delete() raises (SALOME::SALOME_Exception); - - string GetDumpPython() raises (SALOME::SALOME_Exception); - -// Caracteristiques - void SetType (in long Type) raises (SALOME::SALOME_Exception); - long GetType() raises (SALOME::SALOME_Exception); - - void SetDataFile(in string DataFile) raises (SALOME::SALOME_Exception); - string GetDataFile() raises (SALOME::SALOME_Exception); - - void SetMeshName(in string MeshName) raises (SALOME::SALOME_Exception); - string GetMeshName() raises (SALOME::SALOME_Exception); - - void SetCylinder (in double Xcentre, in double Ycentre, in double Zcentre, - in double Xaxe, in double Yaxe, in double Zaxe, in double rayon) - raises (SALOME::SALOME_Exception); - - void SetSphere (in double Xcentre, in double Ycentre, in double Zcentre, in double rayon) - raises (SALOME::SALOME_Exception); - - void SetConeR (in double Xcentre1, in double Ycentre1, in double Zcentre1, in double Rayon1, - in double Xcentre2, in double Ycentre2, in double Zcentre2, in double Rayon2) - raises (SALOME::SALOME_Exception); - - void SetConeA(in double Xaxe,in double Yaxe,in double Zaxe,in double Angle, - in double Xcentre,in double Ycentre,in double ZCentre) - raises (SALOME::SALOME_Exception); - - void SetTorus (in double Xcentre, in double Ycentre, in double Zcentre, - in double Xaxe, in double Yaxe, in double Zaxe, in double rayonRev, in double rayonPri) - raises (SALOME::SALOME_Exception); - - - ADAPT::double_array GetCoords() raises (SALOME::SALOME_Exception); - - void SetLimit (in double Xincr, in double Yincr, in double Zincr) - raises (SALOME::SALOME_Exception); - ADAPT::double_array GetLimit() raises (SALOME::SALOME_Exception); - - void AddGroup(in string LeGroupe) raises (SALOME::SALOME_Exception); - void SetGroups(in ListGroupType ListGroup) raises (SALOME::SALOME_Exception); - ListGroupType GetGroups() raises (SALOME::SALOME_Exception); - -// Liens avec les autres iterations - void SetCaseCreation(in string NomCas) raises (SALOME::SALOME_Exception); - string GetCaseCreation() raises (SALOME::SALOME_Exception); - - }; -}; -#endif diff --git a/idl/HOMARD_Cas.idl b/idl/HOMARD_Cas.idl deleted file mode 100644 index 1e07cc69a..000000000 --- a/idl/HOMARD_Cas.idl +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier -// - -#ifndef _HOMARD_CAS_IDL -#define _HOMARD_CAS_IDL - -#include "SALOME_Component.idl" -#include "SALOME_Exception.idl" -#include "SALOMEDS.idl" - -#include "HOMARD_Iteration.idl" -#include "HOMARD_YACS.idl" - -module ADAPT -{ - typedef sequence extrema ; - typedef sequence ListGroupType ; - typedef sequence ListBoundaryGroupType ; - - - interface HOMARD_Cas : Engines::EngineComponent - { -// Generalites - void SetName(in string Name) raises (SALOME::SALOME_Exception); - string GetName() raises (SALOME::SALOME_Exception); - - long Delete(in long Option) raises (SALOME::SALOME_Exception); - - string GetDumpPython() raises (SALOME::SALOME_Exception); - -// Caracteristiques - void SetDirName(in string NomDir) raises (SALOME::SALOME_Exception); - string GetDirName() raises (SALOME::SALOME_Exception); - - long GetState() raises (SALOME::SALOME_Exception); - - long GetNumberofIter() raises (SALOME::SALOME_Exception); - - void SetConfType(in long ConfType) raises (SALOME::SALOME_Exception); - long GetConfType() raises (SALOME::SALOME_Exception); - - void SetExtType(in long ExtType) raises (SALOME::SALOME_Exception); - long GetExtType() raises (SALOME::SALOME_Exception); - - void SetBoundingBox(in extrema LesExtremes) raises (SALOME::SALOME_Exception); - extrema GetBoundingBox() raises (SALOME::SALOME_Exception); - - void AddGroup(in string Group) raises (SALOME::SALOME_Exception); - void SetGroups(in ListGroupType ListGroup) raises (SALOME::SALOME_Exception); - ListGroupType GetGroups() raises (SALOME::SALOME_Exception); - - void AddBoundary(in string BoundaryName) raises (SALOME::SALOME_Exception); - void AddBoundaryGroup(in string BoundaryName, in string Group) - raises (SALOME::SALOME_Exception); - ListBoundaryGroupType GetBoundaryGroup() raises (SALOME::SALOME_Exception); - void SupprBoundaryGroup() raises (SALOME::SALOME_Exception); - - void SetPyram(in long Pyram) raises (SALOME::SALOME_Exception); - long GetPyram() raises (SALOME::SALOME_Exception); - - void MeshInfo(in long Qual, in long Diam, in long Conn, in long Tail, in long Inte) - raises (SALOME::SALOME_Exception); - -// Liens avec les autres structures - string GetIter0Name () raises (SALOME::SALOME_Exception); - HOMARD_Iteration GetIter0 () raises (SALOME::SALOME_Exception); - - HOMARD_Iteration NextIteration(in string IterName) raises (SALOME::SALOME_Exception); - - HOMARD_Iteration LastIteration() raises (SALOME::SALOME_Exception); - - void AddIteration (in string IterName) raises (SALOME::SALOME_Exception); - -// YACS - HOMARD_YACS CreateYACSSchema(in string YACSName, in string ScriptFile, in string DirName, in string MeshFile) - raises (SALOME::SALOME_Exception); - - - }; -}; -#endif diff --git a/idl/HOMARD_Hypothesis.idl b/idl/HOMARD_Hypothesis.idl deleted file mode 100644 index 2e8bd1190..000000000 --- a/idl/HOMARD_Hypothesis.idl +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier -// - -#ifndef _HOMARD_HYPOTHESIS_IDL -#define _HOMARD_HYPOTHESIS_IDL - -#include "SALOME_Component.idl" -#include "SALOME_Exception.idl" -#include "SALOMEDS.idl" - -#include "HOMARD_Cas.idl" - -module ADAPT -{ - typedef sequence listeZonesHypo ; - typedef sequence listeIters ; - typedef sequence listeComposantsHypo ; - typedef sequence listeTypes ; - typedef sequence listeFieldInterpsHypo ; - - struct InfosHypo - { - string FieldName; - long UsCmpI; - long UsField; - long TypeThR; - double ThreshR; - long TypeThC; - double ThreshC; - }; - - interface HOMARD_Hypothesis : Engines::EngineComponent - { -// Generalites - void SetName(in string Name) raises (SALOME::SALOME_Exception); - string GetName() raises (SALOME::SALOME_Exception); - - long Delete() raises (SALOME::SALOME_Exception); - - string GetDumpPython() raises (SALOME::SALOME_Exception); - -// Caracteristiques - void SetUnifRefinUnRef(in long RaffDera) raises (SALOME::SALOME_Exception); - listeTypes GetAdapRefinUnRef() raises (SALOME::SALOME_Exception); - long GetAdapType() raises (SALOME::SALOME_Exception); - long GetRefinType() raises (SALOME::SALOME_Exception); - long GetUnRefType() raises (SALOME::SALOME_Exception); - - void SetField(in string FieldName) raises (SALOME::SALOME_Exception); - string GetFieldName() raises (SALOME::SALOME_Exception); - void SetUseField(in long UsField) raises (SALOME::SALOME_Exception); - InfosHypo GetField() raises (SALOME::SALOME_Exception); - - void SetUseComp(in long UsCmpI) raises (SALOME::SALOME_Exception); - void AddComp(in string NomComp) raises (SALOME::SALOME_Exception); - void SupprComp(in string NomComp) raises (SALOME::SALOME_Exception); - void SupprComps() raises (SALOME::SALOME_Exception); - listeComposantsHypo GetComps() raises (SALOME::SALOME_Exception); - - void SetRefinThr(in long TypeThR, in double ThreshR) - raises (SALOME::SALOME_Exception); - long GetRefinThrType() raises (SALOME::SALOME_Exception); - void SetUnRefThr(in long TypeThC, in double ThreshC) - raises (SALOME::SALOME_Exception); - long GetUnRefThrType() raises (SALOME::SALOME_Exception); - - void SetNivMax(in long NivMax) raises (SALOME::SALOME_Exception); - long GetNivMax() raises (SALOME::SALOME_Exception); - - void SetDiamMin(in double DiamMin) raises (SALOME::SALOME_Exception); - double GetDiamMin() raises (SALOME::SALOME_Exception); - - void SetAdapInit(in long AdapInit) raises (SALOME::SALOME_Exception); - long GetAdapInit() raises (SALOME::SALOME_Exception); - - void SetExtraOutput(in long ExtraOutput) raises (SALOME::SALOME_Exception); - long GetExtraOutput() raises (SALOME::SALOME_Exception); - - void AddGroup(in string LeGroupe) raises (SALOME::SALOME_Exception); - void SupprGroup(in string LeGroupe) raises (SALOME::SALOME_Exception); - void SupprGroups() raises (SALOME::SALOME_Exception); - void SetGroups(in ListGroupType ListGroup) raises (SALOME::SALOME_Exception); - ListGroupType GetGroups() raises (SALOME::SALOME_Exception); - - void SetTypeFieldInterp(in long TypeFieldInterp) raises (SALOME::SALOME_Exception); - long GetTypeFieldInterp() raises (SALOME::SALOME_Exception); - void AddFieldInterp(in string FieldInterp) raises (SALOME::SALOME_Exception); - void AddFieldInterpType(in string FieldInterp, in long TypeInterp) - raises (SALOME::SALOME_Exception); - void SupprFieldInterp(in string FieldInterp) raises (SALOME::SALOME_Exception); - void SupprFieldInterps() raises (SALOME::SALOME_Exception); - listeFieldInterpsHypo GetFieldInterps() raises (SALOME::SALOME_Exception); - -// Liens avec les autres structures - void SetCaseCreation(in string NomCas) raises (SALOME::SALOME_Exception); - string GetCaseCreation() raises (SALOME::SALOME_Exception); - - void LinkIteration(in string NomIteration) raises (SALOME::SALOME_Exception); - void UnLinkIteration(in string NomIteration) raises (SALOME::SALOME_Exception); - listeIters GetIterations() raises (SALOME::SALOME_Exception); - - void AddZone(in string NomZone, in long TypeUse) raises (SALOME::SALOME_Exception); - void AddZone0(in string NomZone, in long TypeUse) raises (SALOME::SALOME_Exception); - void SupprZone(in string NomZone) raises (SALOME::SALOME_Exception); - void SupprZones() raises (SALOME::SALOME_Exception); - listeZonesHypo GetZones() raises (SALOME::SALOME_Exception); - - }; -}; -#endif diff --git a/idl/HOMARD_Iteration.idl b/idl/HOMARD_Iteration.idl deleted file mode 100644 index 67512a6a4..000000000 --- a/idl/HOMARD_Iteration.idl +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier -// - -#ifndef _HOMARD_ITERATION_IDL -#define _HOMARD_ITERATION_IDL - -#include "SALOME_Component.idl" -#include "SALOME_Exception.idl" -#include "SALOMEDS.idl" - -module ADAPT -{ - typedef sequence listeIterFilles ; - typedef sequence listeFieldInterpsIter ; - typedef sequence listeFieldInterpTSRsIter ; - - interface HOMARD_Iteration : Engines::EngineComponent - { -// Generalites - void SetName(in string Name) raises (SALOME::SALOME_Exception); - string GetName() raises (SALOME::SALOME_Exception); - - long Delete(in long Option) raises (SALOME::SALOME_Exception); - - string GetDumpPython() raises (SALOME::SALOME_Exception); - -// Caracteristiques - void SetDirNameLoc(in string NomDir) raises (SALOME::SALOME_Exception); - string GetDirNameLoc() raises (SALOME::SALOME_Exception); - - string GetDirName() raises (SALOME::SALOME_Exception); - - void SetNumber(in long NumIter) raises (SALOME::SALOME_Exception); - long GetNumber() raises (SALOME::SALOME_Exception); - - void SetState(in long State) raises (SALOME::SALOME_Exception); - long GetState() raises (SALOME::SALOME_Exception); - - void SetMeshName(in string NomMesh) raises (SALOME::SALOME_Exception); - string GetMeshName() raises (SALOME::SALOME_Exception); - - void SetMeshFile(in string MeshFile) raises (SALOME::SALOME_Exception); - string GetMeshFile() raises (SALOME::SALOME_Exception); - - void SetFieldFile(in string FieldFile) raises (SALOME::SALOME_Exception); - string GetFieldFile() raises (SALOME::SALOME_Exception); - -// Instants pour le champ de pilotage - void SetTimeStep(in long TimeStep) raises (SALOME::SALOME_Exception); - void SetTimeStepRank(in long TimeStep, in long Rank) - raises (SALOME::SALOME_Exception); - void SetTimeStepRankLast() raises (SALOME::SALOME_Exception); - long GetTimeStep() raises (SALOME::SALOME_Exception); - long GetRank() raises (SALOME::SALOME_Exception); - -// Instants pour un champ a interpoler - void SetFieldInterpTimeStep(in string FieldInterp, in long TimeStep) - raises (SALOME::SALOME_Exception); - void SetFieldInterpTimeStepRank(in string FieldInterp, in long TimeStep, in long Rank) - raises (SALOME::SALOME_Exception); - listeFieldInterpTSRsIter GetFieldInterpsTimeStepRank() raises (SALOME::SALOME_Exception); - void SetFieldInterp(in string FieldInterp) raises (SALOME::SALOME_Exception); - listeFieldInterpsIter GetFieldInterps() raises (SALOME::SALOME_Exception); - void SupprFieldInterps() raises (SALOME::SALOME_Exception); - -// Fichier des messages - void SetLogFile(in string LogFile) raises (SALOME::SALOME_Exception); - string GetLogFile() raises (SALOME::SALOME_Exception); - - long Compute(in long etatMenage, in long Option) raises (SALOME::SALOME_Exception); - - void MeshInfo(in long Qual, in long Diam, in long Conn, in long Tail, in long Inte) - raises (SALOME::SALOME_Exception); - void MeshInfoOption(in long Qual, in long Diam, in long Conn, in long Tail, in long Inte, in long Option) - raises (SALOME::SALOME_Exception); - - void SetFileInfo(in string FileInfo) raises (SALOME::SALOME_Exception); - string GetFileInfo() raises (SALOME::SALOME_Exception); - -// Liens avec les autres iterations - HOMARD_Iteration NextIteration(in string NomIter) raises (SALOME::SALOME_Exception); - - void LinkNextIteration(in string NomIter) raises (SALOME::SALOME_Exception); - void UnLinkNextIteration(in string NomIter) raises (SALOME::SALOME_Exception); - listeIterFilles GetIterations() raises (SALOME::SALOME_Exception); - - void SetIterParentName(in string NomIterParent) raises (SALOME::SALOME_Exception); - string GetIterParentName() raises (SALOME::SALOME_Exception); - HOMARD_Iteration GetIterParent() raises (SALOME::SALOME_Exception); - -// Liens avec les autres structures - void SetCaseName(in string NomCas) raises (SALOME::SALOME_Exception); - string GetCaseName() raises (SALOME::SALOME_Exception); - - void AssociateHypo(in string NomHypo) raises (SALOME::SALOME_Exception); - void SetHypoName(in string NomHypo) raises (SALOME::SALOME_Exception); - string GetHypoName() raises (SALOME::SALOME_Exception); - -// Divers - void SetInfoCompute(in long MessInfo) raises (SALOME::SALOME_Exception); - long GetInfoCompute() raises (SALOME::SALOME_Exception); - }; -}; -#endif diff --git a/idl/HOMARD_YACS.idl b/idl/HOMARD_YACS.idl deleted file mode 100644 index 538e0ec20..000000000 --- a/idl/HOMARD_YACS.idl +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier -// - -#ifndef _HOMARD_YACS_IDL -#define _HOMARD_YACS_IDL - -#include "SALOME_Component.idl" -#include "SALOME_Exception.idl" -#include "SALOMEDS.idl" - -module ADAPT -{ - interface HOMARD_YACS : Engines::EngineComponent - { -// Generalites - void SetName(in string Name) raises (SALOME::SALOME_Exception); - string GetName() raises (SALOME::SALOME_Exception); - - long Delete(in long Option) raises (SALOME::SALOME_Exception); - - string GetDumpPython() raises (SALOME::SALOME_Exception); - -// Caracteristiques - void SetType (in long Type) raises (SALOME::SALOME_Exception); - long GetType() raises (SALOME::SALOME_Exception); - - void SetMaxIter (in long MaxIter) raises (SALOME::SALOME_Exception); - long GetMaxIter() raises (SALOME::SALOME_Exception); - void SetMaxNode (in long MaxNode) raises (SALOME::SALOME_Exception); - long GetMaxNode() raises (SALOME::SALOME_Exception); - void SetMaxElem (in long MaxElem) raises (SALOME::SALOME_Exception); - long GetMaxElem() raises (SALOME::SALOME_Exception); - - void SetTestConvergence (in long TypeTest, in double VRef) - raises (SALOME::SALOME_Exception); - long GetTestConvergenceType() raises (SALOME::SALOME_Exception); - double GetTestConvergenceVRef() raises (SALOME::SALOME_Exception); - - void SetDirName(in string NomDir) raises (SALOME::SALOME_Exception); - string GetDirName() raises (SALOME::SALOME_Exception); - - void SetMeshFile(in string MeshFile) raises (SALOME::SALOME_Exception); - string GetMeshFile() raises (SALOME::SALOME_Exception); - - void SetScriptFile(in string ScriptFile) raises (SALOME::SALOME_Exception); - string GetScriptFile() raises (SALOME::SALOME_Exception); - - void SetXMLFile(in string XMLFile) raises (SALOME::SALOME_Exception); - string GetXMLFile() raises (SALOME::SALOME_Exception); - - long Write() raises (SALOME::SALOME_Exception); - long WriteOnFile( in string YACSFile ) raises (SALOME::SALOME_Exception); - -// Liens avec les autres structures - void SetCaseName(in string NomCas) raises (SALOME::SALOME_Exception); - string GetCaseName() raises (SALOME::SALOME_Exception); - -// Divers - }; -}; -#endif diff --git a/idl/HOMARD_Zone.idl b/idl/HOMARD_Zone.idl deleted file mode 100644 index 691246ea4..000000000 --- a/idl/HOMARD_Zone.idl +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier -// - -#ifndef _HOMARD_Zone_IDL -#define _HOMARD_Zone_IDL - -#include "SALOME_Component.idl" -#include "SALOME_Exception.idl" -#include "SALOMEDS.idl" - -module ADAPT -{ - typedef sequence double_array ; - typedef sequence listeHypo ; - - interface HOMARD_Zone : Engines::EngineComponent - { -// Generalites - void SetName(in string Name) raises (SALOME::SALOME_Exception); - string GetName() raises (SALOME::SALOME_Exception); - - long Delete() raises (SALOME::SALOME_Exception); - - string GetDumpPython() raises (SALOME::SALOME_Exception); - -// Caracteristiques - void SetType (in long Type) raises (SALOME::SALOME_Exception); - long GetType() raises (SALOME::SALOME_Exception); - - void SetBox (in double Xmini, in double Xmaxi, in double Ymini, - in double Ymaxi, in double Zmini, in double Zmaxi) - raises (SALOME::SALOME_Exception); - void SetCylinder (in double Xcentre, in double Ycentre, in double Zcentre, - in double Xaxis, in double Yaxis, in double Zaxis, - in double Rayon, in double Haut) - raises (SALOME::SALOME_Exception); - void SetPipe( in double Xcentre, in double Ycentre, in double ZCentre, - in double Xaxis, in double Yaxis, in double Zaxis, - in double Rayon, in double Haut, in double Rayonint ) - raises (SALOME::SALOME_Exception); - void SetSphere (in double Xcentre, in double Ycentre, in double Zcentre, in double rayon) - raises (SALOME::SALOME_Exception); - - double_array GetCoords() raises (SALOME::SALOME_Exception); - - void SetLimit (in double Xincr, in double Yincr, in double Zincr) - raises (SALOME::SALOME_Exception); - double_array GetLimit() raises (SALOME::SALOME_Exception); - -// Liens avec les autres structures - void AddHypo(in string NomHypo) raises (SALOME::SALOME_Exception); - listeHypo GetHypo() raises (SALOME::SALOME_Exception); - void SupprHypo(in string NomHypo) raises (SALOME::SALOME_Exception); - - }; -}; -#endif diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index 9bc947916..1306b1319 100644 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -22,11 +22,7 @@ SET(SMESH_RESOURCES_FILES ModuleMesh.png - adapt_hom_iter_next.png - adapt_hom_iter_poursuite.png adapt_mg_adapt.png - adapt_ref_all.png - adapt_ref_homard.png advanced_mesh_info.png bare_border_face.png bare_border_volume.png diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in index 1f4c5dee5..90649ffdd 100644 --- a/resources/SalomeApp.xml.in +++ b/resources/SalomeApp.xml.in @@ -99,12 +99,6 @@ - - - - - - diff --git a/resources/adapt_hom_iter_next.png b/resources/adapt_hom_iter_next.png deleted file mode 100755 index 3bbcbd640ad1a61ad98a7d2fdbcc775c87277c1a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 369 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 HOMARD_Boundary::GetCoords() const -{ - std::vector mesCoor; -// - switch (_Type) - { -// Cylindre - case 1: - { - mesCoor.push_back( _Xcentre ); - mesCoor.push_back( _Ycentre ); - mesCoor.push_back( _Zcentre ); - mesCoor.push_back( _Xaxe ); - mesCoor.push_back( _Yaxe ); - mesCoor.push_back( _Zaxe ); - mesCoor.push_back( _rayon ); - break ; - } -// Sphere - case 2: - { - mesCoor.push_back( _Xcentre ); - mesCoor.push_back( _Ycentre ); - mesCoor.push_back( _Zcentre ); - mesCoor.push_back( _rayon ); - break ; - } -// Cone defini par un axe et un angle - case 3: - { - mesCoor.push_back( _Xaxe ); - mesCoor.push_back( _Yaxe ); - mesCoor.push_back( _Zaxe ); - mesCoor.push_back( _Angle ); - mesCoor.push_back( _Xcentre ); - mesCoor.push_back( _Ycentre ); - mesCoor.push_back( _Zcentre ); - break ; - } -// Cone defini par les 2 rayons - case 4: - { - mesCoor.push_back( _Xcentre1 ); - mesCoor.push_back( _Ycentre1 ); - mesCoor.push_back( _Zcentre1 ); - mesCoor.push_back( _Rayon1 ); - mesCoor.push_back( _Xcentre2 ); - mesCoor.push_back( _Ycentre2 ); - mesCoor.push_back( _Zcentre2 ); - mesCoor.push_back( _Rayon2 ); - break ; - } -// Tore - case 5: - { - mesCoor.push_back( _Xcentre ); - mesCoor.push_back( _Ycentre ); - mesCoor.push_back( _Zcentre ); - mesCoor.push_back( _Xaxe ); - mesCoor.push_back( _Yaxe ); - mesCoor.push_back( _Zaxe ); - mesCoor.push_back( _Rayon1 ); - mesCoor.push_back( _Rayon2 ); - break ; - } - VERIFICATION( (_Type>=1) && (_Type<=5) ) ; - } - return mesCoor; -} -//====================================================================== -void HOMARD_Boundary::SetLimit( double X0, double X1, double X2 ) -{ - _Xincr = X0; _Yincr = X1; _Zincr = X2; -} -//======================================================================================= -std::vector HOMARD_Boundary::GetLimit() const -{ - std::vector mesLimit; - mesLimit.push_back( _Xincr ); - mesLimit.push_back( _Yincr ); - mesLimit.push_back( _Zincr ); - return mesLimit; -} -//============================================================================= -void HOMARD_Boundary::AddGroup( const char* Group) -{ - _ListGroupSelected.push_back(Group); -} -//============================================================================= -void HOMARD_Boundary::SetGroups( const std::list& ListGroup ) -{ - _ListGroupSelected.clear(); - std::list::const_iterator it = ListGroup.begin(); - while(it != ListGroup.end()) - _ListGroupSelected.push_back((*it++)); -} -//============================================================================= -const std::list& HOMARD_Boundary::GetGroups() const -{ - return _ListGroupSelected; -} -//============================================================================= -//============================================================================= -// Liens avec les autres structures -//============================================================================= -//============================================================================= -void HOMARD_Boundary::SetCaseCreation( const char* NomCasCreation ) -{ - _NomCasCreation = std::string( NomCasCreation ); -} -//============================================================================= -std::string HOMARD_Boundary::GetCaseCreation() const -{ - return _NomCasCreation; -} -//============================================================================= diff --git a/src/ADAPT/HOMARD_Boundary.hxx b/src/ADAPT/HOMARD_Boundary.hxx deleted file mode 100644 index ddbffae6b..000000000 --- a/src/ADAPT/HOMARD_Boundary.hxx +++ /dev/null @@ -1,111 +0,0 @@ -// HOMARD HOMARD : implementation of HOMARD idl descriptions -// -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : HOMARD_Boundary.hxx -// Author : Gerald NICOLAS, EDF -// Module : HOMARD -// -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier - -#ifndef _HOMARD_Boundary_HXX_ -#define _HOMARD_Boundary_HXX_ - -#include "HOMARD.hxx" - -#include -#include -#include - -#if defined WIN32 -#pragma warning ( disable: 4251 ) -#endif - -class HOMARDIMPL_EXPORT HOMARD_Boundary -{ -public: - HOMARD_Boundary(); - ~HOMARD_Boundary(); - -// Generalites - void SetName( const char* Name ); - std::string GetName() const; - - std::string GetDumpPython() const; - -// Caracteristiques - void SetType( int Type ); - int GetType() const; - - void SetMeshName( const char* MeshName ); - std::string GetMeshName() const; - - void SetDataFile( const char* DataFile ); - std::string GetDataFile() const; - - void SetCylinder( double X0, double X1, double X2, double X3, - double X4, double X5, double X6 ); - void SetSphere( double X0, double X1, double X2, double X3 ); - void SetConeR( double Xcentre1, double Ycentre1, double Zcentre1, double Rayon1, - double Xcentre2, double Ycentre2, double Zcentre2, double Rayon2); - void SetConeA( double Xaxe, double Yaxe, double Zaxe, double Angle, - double Xcentre, double Ycentre, double ZCentre); - void SetTorus( double X0, double X1, double X2, double X3, - double X4, double X5, double X6, double X7 ); - - std::vector GetCoords() const; - - void SetLimit( double X0, double X1, double X2 ); - std::vector GetLimit() const; - - void AddGroup( const char* LeGroupe); - void SetGroups(const std::list& ListGroup ); - const std::list& GetGroups() const; - -// Liens avec les autres structures - std::string GetCaseCreation() const; - void SetCaseCreation( const char* NomCasCreation ); - -private: - std::string _Name; - std::string _NomCasCreation; - std::string _DataFile; - std::string _MeshName; - int _Type; - double _Xmin, _Xmax, _Ymin, _Ymax, _Zmin, _Zmax; - double _Xaxe, _Yaxe, _Zaxe; - double _Xcentre, _Ycentre, _Zcentre, _rayon; - double _Xincr, _Yincr, _Zincr; - double _Xcentre1, _Ycentre1, _Zcentre1, _Rayon1; - double _Xcentre2, _Ycentre2, _Zcentre2, _Rayon2; - double _Angle; - - std::list _ListGroupSelected; - -}; - - -#endif diff --git a/src/ADAPT/HOMARD_Cas.cxx b/src/ADAPT/HOMARD_Cas.cxx deleted file mode 100644 index 1493c8ff1..000000000 --- a/src/ADAPT/HOMARD_Cas.cxx +++ /dev/null @@ -1,283 +0,0 @@ -// HOMARD HOMARD : implementation of HOMARD idl descriptions -// -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : HOMARD_Cas.cxx -// Author : Gerald NICOLAS, EDF -// Module : HOMARD -// -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier - -#include "HOMARD_Cas.hxx" -#include "utilities.h" -#include "HOMARD.hxx" -#include -#include - -#ifndef WIN32 -#include -#else -#include -#endif - -//============================================================================= -/*! - * default constructor: - * Par defaut, l'adaptation est conforme, sans suivi de frontiere - */ -//============================================================================= -HOMARD_Cas::HOMARD_Cas(): - _Name(""), _NomDir("/tmp"), _ConfType(0), _ExtType(0) -{ - MESSAGE("HOMARD_Cas"); -} -//============================================================================= -HOMARD_Cas::~HOMARD_Cas() -//============================================================================= -{ - MESSAGE("~HOMARD_Cas"); -} -//============================================================================= -//============================================================================= -// Generalites -//============================================================================= -//============================================================================= -void HOMARD_Cas::SetName( const char* Name ) -{ - _Name = std::string( Name ); -} -//============================================================================= -std::string HOMARD_Cas::GetName() const -{ - return _Name; -} -//============================================================================= -std::string HOMARD_Cas::GetDumpPython() const -{ - std::ostringstream aScript; - aScript << "\t" <<_Name << ".SetDirName(\""; - aScript << _NomDir << "\")\n"; - aScript << "\t" <<_Name << ".SetConfType("; - aScript << _ConfType << ")\n"; - aScript << "\t" <<_Name << ".SetExtType("; - aScript << _ExtType << ")\n"; -// Suivi de frontieres - std::list::const_iterator it = _ListBoundaryGroup.begin(); - while(it != _ListBoundaryGroup.end()) - { - aScript << "\t" <<_Name << ".AddBoundaryGroup(\""; - aScript << *it << "\", \""; - it++; - aScript << *it << "\")\n"; - it++; - } - if ( _Pyram > 0 ) - { - aScript << "\t" <<_Name << ".SetPyram("; - aScript << _Pyram << ")\n"; - } - - return aScript.str(); -} -//============================================================================= -//============================================================================= -// Caracteristiques -//============================================================================= -//============================================================================= -int HOMARD_Cas::SetDirName( const char* NomDir ) -{ -// MESSAGE("SetDirName, NomDir : "< 1 ) { erreur = 1 ; } - // Creation - if ( CHDIR(NomDir) == 0 ) - { _NomDir = std::string( NomDir ); } - else - { - -#ifndef WIN32 - if ( mkdir(NomDir, S_IRWXU|S_IRGRP|S_IXGRP) == 0 ) -#else - if ( _mkdir(NomDir) == 0 ) -#endif - { - if ( CHDIR(NomDir) == 0 ) { _NomDir = std::string( NomDir ); } - else { erreur = 2 ; } - } - else { erreur = 2 ; } - }; - return erreur ; -} -//============================================================================= -std::string HOMARD_Cas::GetDirName() const -{ - return _NomDir; -} -//============================================================================= -int HOMARD_Cas::GetNumberofIter() -{ - return _ListIter.size(); -} -// -// Le type de conformite ou non conformite -// -//============================================================================= -void HOMARD_Cas::SetConfType( int Conftype ) -{ -// VERIFICATION( (Conftype>=-2) && (Conftype<=3) ); - _ConfType = Conftype; -} -//============================================================================= -const int HOMARD_Cas::GetConfType() const -{ - return _ConfType; -} -// -// Le type exterieur -// -//============================================================================= -void HOMARD_Cas::SetExtType( int ExtType ) -{ -// VERIFICATION( (ExtType>=0) && (ExtType<=2) ); - _ExtType = ExtType; -} -//============================================================================= -const int HOMARD_Cas::GetExtType() const -{ - return _ExtType; -} -// -// La boite englobante -// -//============================================================================= -void HOMARD_Cas::SetBoundingBox( const std::vector& extremas ) -{ - _Boite.clear(); - _Boite.resize( extremas.size() ); - for ( int i = 0; i < extremas.size(); i++ ) - _Boite[i] = extremas[i]; -} -//============================================================================= -const std::vector& HOMARD_Cas::GetBoundingBox() const -{ - return _Boite; -} -// -// Les groupes -// -//============================================================================= -void HOMARD_Cas::AddGroup( const char* Group ) -{ - _ListGroup.push_back(Group); -} -//============================================================================= -void HOMARD_Cas::SetGroups( const std::list& ListGroup ) -{ - _ListGroup.clear(); - std::list::const_iterator it = ListGroup.begin(); - while(it != ListGroup.end()) - { - _ListGroup.push_back((*it++)); - } -} -//============================================================================= -const std::list& HOMARD_Cas::GetGroups() const -{ - return _ListGroup; -} -//============================================================================= -void HOMARD_Cas::SupprGroups() -{ - _ListGroup.clear(); -} -// -// Les frontieres -// -//============================================================================= -void HOMARD_Cas::AddBoundary( const char* Boundary ) -{ -// MESSAGE ( ". HOMARD_Cas::AddBoundary : Boundary = " << Boundary ); - const char* Group = ""; - AddBoundaryGroup( Boundary, Group ); -} -//============================================================================= -void HOMARD_Cas::AddBoundaryGroup( const char* Boundary, const char* Group ) -{ -// MESSAGE ( ". HOMARD_Cas::AddBoundaryGroup : Boundary = " << Boundary ); -// MESSAGE ( ". HOMARD_Cas::AddBoundaryGroup : Group = " << Group ); - _ListBoundaryGroup.push_back( Boundary ); - _ListBoundaryGroup.push_back( Group ); -} -//============================================================================= -const std::list& HOMARD_Cas::GetBoundaryGroup() const -{ - return _ListBoundaryGroup; -} -//============================================================================= -void HOMARD_Cas::SupprBoundaryGroup() -{ - _ListBoundaryGroup.clear(); -} -//============================================================================= -void HOMARD_Cas::SetPyram( int Pyram ) -{ - _Pyram = Pyram; -} -//============================================================================= -const int HOMARD_Cas::GetPyram() const -{ - return _Pyram; -} -//============================================================================= -//============================================================================= -// Liens avec les autres structures -//============================================================================= -//============================================================================= -std::string HOMARD_Cas::GetIter0Name() const -{ -// Par construction de la liste, l'iteration a ete mise en tete. - return (*(_ListIter.begin())); -} -//============================================================================= -void HOMARD_Cas::AddIteration( const char* NomIteration ) -{ - _ListIter.push_back( std::string( NomIteration ) ); -} -//============================================================================= -const std::list& HOMARD_Cas::GetIterations() const -{ - return _ListIter; -} -//============================================================================= -void HOMARD_Cas::SupprIterations() -{ - _ListIter.clear(); -} - - diff --git a/src/ADAPT/HOMARD_Cas.hxx b/src/ADAPT/HOMARD_Cas.hxx deleted file mode 100644 index 71127136e..000000000 --- a/src/ADAPT/HOMARD_Cas.hxx +++ /dev/null @@ -1,112 +0,0 @@ -// HOMARD HOMARD : implementation of HOMARD idl descriptions -// -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : HOMARD_Cas.hxx -// Author : Gerald NICOLAS, EDF -// Module : HOMARD -// -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier - -#ifndef _HOMARD_CAS_HXX_ -#define _HOMARD_CAS_HXX_ - -#include "HOMARD.hxx" - -#include -#include -#include - -#if defined WIN32 -#pragma warning ( disable: 4251 ) -#endif - -class HOMARDIMPL_EXPORT HOMARD_Cas -{ -public: - HOMARD_Cas(); - ~HOMARD_Cas(); - -// Generalites - void SetName( const char* Name ); - std::string GetName() const; - - std::string GetDumpPython() const; - -// Caracteristiques - int SetDirName( const char* NomDir ); - std::string GetDirName() const; - - int GetNumberofIter(); - - void SetConfType( int ConfType ); - const int GetConfType() const; - - void SetExtType( int ExtType ); - const int GetExtType() const; - - void SetBoundingBox( const std::vector& extremas ); - const std::vector& GetBoundingBox() const; - - void AddGroup( const char* Group); - void SetGroups( const std::list& ListGroup ); - const std::list& GetGroups() const; - void SupprGroups(); - - void AddBoundary( const char* Boundary ); - void AddBoundaryGroup( const char* Boundary, const char* Group ); - const std::list& GetBoundaryGroup() const; - void SupprBoundaryGroup(); - - void SetPyram( int Pyram ); - const int GetPyram() const; - -// Liens avec les autres structures - std::string GetIter0Name() const; - - void AddIteration( const char* NomIteration ); - const std::list& GetIterations() const; - void SupprIterations(); - -private: - std::string _Name; - std::string _NomDir; - int _ConfType; - int _ExtType; - int _Etat; - - std::vector _Boite; // cf HomardQTCommun pour structure du vecteur - std::list _ListGroup; - std::list _ListBoundaryGroup; - - int _Pyram; - - typedef std::string IterName; - typedef std::list IterNames; - IterNames _ListIter; -}; - -#endif diff --git a/src/ADAPT/HOMARD_DriverTools.cxx b/src/ADAPT/HOMARD_DriverTools.cxx deleted file mode 100644 index 74ec51209..000000000 --- a/src/ADAPT/HOMARD_DriverTools.cxx +++ /dev/null @@ -1,840 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : HOMARD_DriverTools.cxx -// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) -// -// ---------------------------------------------------------------------------- - -#include "HOMARD_DriverTools.hxx" -#include "HOMARD_Boundary.hxx" -#include "HOMARD_Cas.hxx" -#include "HOMARD_Hypothesis.hxx" -#include "HOMARD_Iteration.hxx" -#include "HOMARD_Zone.hxx" -#include "HOMARD_YACS.hxx" -#include -#include -#include "utilities.h" - -namespace ADAPT -{ - - std::string SEPARATOR = "|" ; - - /*! - \brief Read next chunk of data from the string - \internal - - The function tries to read next chunk of the data from the input string \a str. - The parameter \a start specifies the start position of next chunk. If the operation - read the chunk successfully, after its completion this parameter will refer to the - start position of the next chunk. The function returns resulting chunk as a string. - The status of the operation is returned via \a ok parameter. - - \param str source data stream string - \param start start position to get next chunk - \param ok in this variable the status of the chunk reading operation is returned - \return next chunk read from the string - */ - static std::string getNextChunk( const std::string& str, std::string::size_type& start, bool& ok ) - { - std::string chunk = ""; - ok = false; - if ( start <= str.size() ) { - std::string::size_type end = str.find( separator(), start ); - chunk = str.substr( start, end == std::string::npos ? std::string::npos : end-start ); - start = end == std::string::npos ? str.size()+1 : end + separator().size(); - ok = true; - } - return chunk; - } - - /*! - \brief Get persistence signature - \param type persistence entity type - \return persistence signature - */ - std::string GetSignature( SignatureType type ) - { - std::string signature = ""; - switch ( type ) { - case Case: signature = "CASE"; break; - case Zone: signature = "ZONE"; break; - case Hypothesis: signature = "HYPO"; break; - case Iteration: signature = "ITER"; break; - case Boundary: signature = "BOUNDARY"; break; - case YACS: signature = "YACS"; break; - default: break; - } - signature += separator(); - return signature; - } - - /*! - \brief Get data separator - \return string that is used to separate data entities in the stream - */ - std::string separator() - { - return SEPARATOR ; - } - -// ======================= -// 1.1. Case -// ======================= - /*! - \brief Dump case to the string - \param cas case being dumped - \return string representation of the case - */ - std::string Dump( const HOMARD_Cas& cas ) - { - std::stringstream os; - std::string saux ; - // ... - MESSAGE( ". Sauvegarde du cas "< coor = cas.GetBoundingBox(); - os << separator() << coor.size(); - for ( int i = 0; i < coor.size(); i++ ) - os << separator() << coor[i]; - - std::list ListString = cas.GetIterations(); - os << separator() << ListString.size(); - std::list::const_iterator it; - for ( it = ListString.begin(); it != ListString.end(); ++it ) - os << separator() << *it; - - ListString = cas.GetGroups(); - os << separator() << ListString.size(); - for ( it = ListString.begin(); it != ListString.end(); ++it ) - os << separator() << *it; - ListString = cas.GetBoundaryGroup(); - os << separator() << ListString.size(); - for ( it = ListString.begin(); it != ListString.end(); ++it ) - os << separator() << *it; - - os << separator() << cas.GetPyram(); - - saux = os.str(); -// MESSAGE( ". Fin avec "< ListString = iteration.GetIterations(); - os << separator() << ListString.size(); - std::list::const_iterator it; - for ( it = ListString.begin(); it != ListString.end(); ++it ) - os << separator() << *it; - - os << separator() << iteration.GetHypoName(); - os << separator() << iteration.GetCaseName(); - os << separator() << iteration.GetDirNameLoc(); - - saux = os.str(); -// MESSAGE( ". Fin avec "< ListString = hypothesis.GetIterations(); - std::list::const_iterator it; - os << separator() << ListString.size(); - for ( it = ListString.begin(); it != ListString.end(); ++it ) - os << separator() << *it; - - ListString = hypothesis.GetZones(); - os << separator() << ListString.size(); - for ( it = ListString.begin(); it != ListString.end(); ++it ) - os << separator() << *it; - - ListString = hypothesis.GetComps(); - os << separator() << ListString.size(); - for ( it = ListString.begin(); it != ListString.end(); ++it ) - os << separator() << *it; - - ListString = hypothesis.GetGroups(); - os << separator() << ListString.size(); - for ( it = ListString.begin(); it != ListString.end(); ++it ) - os << separator() << *it; - - ListString = hypothesis.GetFieldInterps(); - os << separator() << ListString.size(); - for ( it = ListString.begin(); it != ListString.end(); ++it ) - os << separator() << *it; - - os << separator() << hypothesis.GetNivMax(); - os << separator() << hypothesis.GetDiamMin(); - os << separator() << hypothesis.GetAdapInit(); - os << separator() << hypothesis.GetExtraOutput(); - - saux = os.str(); -// MESSAGE( ". Fin avec "< coords = zone.GetCoords(); - for ( int i = 0; i < coords.size(); i++ ) - os << separator() << ( i < coords.size() ? coords[i] : 0. ); - - std::vector limit = zone.GetLimit(); - for ( int i = 0; i < 3; i++ ) - os << separator() << ( i < limit.size() ? limit[i] : 0. ); - - std::list hypos = zone.GetHypo(); - os << separator() << hypos.size(); - std::list::const_iterator it; - for ( it = hypos.begin(); it != hypos.end(); ++it ) - os << separator() << *it; - - saux = os.str(); -// MESSAGE( ". Fin avec "< coor = boundary.GetCoords() ; - for ( int i = 0; i < coor.size(); i++ ) - os << separator() << coor[i]; - std::vector limit = boundary.GetLimit(); - for ( int i = 0; i < limit.size(); i++ ) - os << separator() << limit[i]; - } - - std::list ListString = boundary.GetGroups(); - std::list::const_iterator it; - os << separator() << ListString.size(); - for ( it = ListString.begin(); it != ListString.end(); ++it ) - os << separator() << *it; - - saux = os.str(); -// MESSAGE( ". Fin avec "< boite; - boite.resize( size ); - for ( int i = 0; i < size; i++ ) { - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - boite[i] = strtod( chunk.c_str(), 0 ); - } - cas.SetBoundingBox( boite ); - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - - size = atoi( chunk.c_str() ); - for ( int i = 0; i < size; i++ ) { - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - cas.AddIteration( chunk.c_str() ); - } - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - size = atoi( chunk.c_str() ); - for ( int i = 0; i < size; i++ ) - { - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - cas.AddGroup( chunk.c_str() ); - } - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - size = atoi( chunk.c_str() ); - for ( int i = 0; i < size; i++ ) { - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - i++; - chunkNext = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - cas.AddBoundaryGroup( chunk.c_str(), chunkNext.c_str() ); - } - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - cas.SetPyram( atoi( chunk.c_str() ) ); - - return true; - } -// -// ============== -// 2.2. Iteration -// ============== - /*! - \brief Restore iteration from the string - \param iteration iteration being restored - \param stream string representation of the iteration - \return \c true if iteration is correctly restored or \c false otherwise - */ - bool Restore( HOMARD_Iteration& iteration, const std::string& stream ) - { - std::string::size_type start = 0; - std::string chunk; - bool ok; - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - - iteration.SetName( chunk.c_str() ); - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - iteration.SetState( atoi( chunk.c_str() ) ); - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - iteration.SetNumber( atoi( chunk.c_str() ) ); - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - iteration.SetMeshFile( chunk.c_str() ); - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - iteration.SetLogFile( chunk.c_str() ); - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - iteration.SetMeshName( chunk.c_str() ); - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - iteration.SetFieldFile( chunk.c_str() ); - // . - int timestep, rank; - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - timestep = atoi( chunk.c_str() ); - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - rank = atoi( chunk.c_str() ); - iteration.SetTimeStepRank( timestep, rank ); - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - iteration.SetIterParentName( chunk.c_str() ); - // - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - int size = atoi( chunk.c_str() ); - for ( int i = 0; i < size; i++ ) { - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - iteration.LinkNextIteration( chunk.c_str() ); - } - // - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - iteration.SetHypoName( chunk.c_str() ); - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - iteration.SetCaseName( chunk.c_str() ); - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - iteration.SetDirNameLoc( chunk.c_str() ); - return true; - } - -// -// ============== -// 2.3. hypothese -// ============== - /*! - \brief Restore hypothesis from the string - \param hypothesis hypothesis being restored - \param stream string representation of the hypothesis - \return \c true if hypothesis is correctly restored or \c false otherwise - */ - bool Restore( HOMARD_Hypothesis& hypothesis, const std::string& stream ) - { - std::string::size_type start = 0; - std::string chunk, chunkNext; - bool ok; - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - hypothesis.SetName( chunk.c_str() ); - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - hypothesis.SetCaseCreation( chunk.c_str() ); - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - hypothesis.SetAdapType( atoi( chunk.c_str() ) ); - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - int typeraff = atoi( chunk.c_str() ); - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - int typedera = atoi( chunk.c_str() ); - hypothesis.SetRefinTypeDera( typeraff, typedera ); - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - hypothesis.SetField( chunk.c_str() ); - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - int typethr = atoi( chunk.c_str() ); - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - double threshr = strtod( chunk.c_str(), 0 ); - hypothesis.SetRefinThr( typethr, threshr ); - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - int typethc = atoi( chunk.c_str() ); - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - double threshc = strtod( chunk.c_str(), 0 ); - hypothesis.SetUnRefThr( typethc, threshc ); - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - hypothesis.SetUseField(atoi(chunk.c_str())); - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - hypothesis.SetUseComp(atoi(chunk.c_str())); - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - hypothesis.SetTypeFieldInterp(atoi(chunk.c_str())); - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - int size = atoi( chunk.c_str() ); - for ( int i = 0; i < size; i++ ) { - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - hypothesis.LinkIteration( chunk.c_str() ); - } - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - size = atoi( chunk.c_str() ); - for ( int i = 0; i < size; i++ ) { - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - i++; - chunkNext = getNextChunk( stream, start, ok ); - int typeuse = atoi( chunkNext.c_str() ); - if ( !ok ) return false; - hypothesis.AddZone( chunk.c_str(), typeuse ); - } - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - size = atoi( chunk.c_str() ); - for ( int i = 0; i < size; i++ ) { - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - hypothesis.AddComp( chunk.c_str() ); - } - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - size = atoi( chunk.c_str() ); - for ( int i = 0; i < size; i++ ) { - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - hypothesis.AddGroup( chunk.c_str() ); - } - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - size = atoi( chunk.c_str() ); - for ( int i = 0; i < size; i++ ) { - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - i++; - chunkNext = getNextChunk( stream, start, ok ); - int TypeInterp = atoi( chunkNext.c_str() ); - if ( !ok ) return false; - hypothesis.AddFieldInterpType( chunk.c_str(), TypeInterp ); - } - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - hypothesis.SetNivMax( atoi( chunk.c_str() ) ); - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - hypothesis.SetDiamMin( strtod( chunk.c_str(), 0 ) ); - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - hypothesis.SetAdapInit( strtod( chunk.c_str(), 0 ) ); - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - hypothesis.SetExtraOutput( strtod( chunk.c_str(), 0 ) ); - - return true; - } - -// -// ========= -// 2.4. Zone -// ========= - /*! - \brief Restore zone from the string - \param zone zone being restored - \param stream string representation of the zone - \return \c true if zone is correctly restored or \c false otherwise - */ - bool Restore( HOMARD_Zone& zone, const std::string& stream ) - { - std::string::size_type start = 0; - std::string chunk; - bool ok; - // - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - zone.SetName( chunk.c_str() ); - // - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - int ZoneType = atoi( chunk.c_str() ) ; - zone.SetType( ZoneType ); - // Les coordonnees des zones : le nombre depend du type - std::vector coords; - int lgcoords ; - if ( ZoneType == 2 || ( ZoneType >= 11 && ZoneType <= 13 ) ) { lgcoords = 6 ; } - else if ( ZoneType == 4 ) { lgcoords = 4 ; } - else if ( ZoneType == 5 || ( ZoneType >= 31 && ZoneType <= 33 ) ) { lgcoords = 8 ; } - else if ( ZoneType == 7 || ( ZoneType >= 61 && ZoneType <= 63 ) ) { lgcoords = 9 ; } - else return false; - coords.resize( lgcoords ); - for ( int i = 0; i < lgcoords; i++ ) { - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - coords[i] = strtod( chunk.c_str(), 0 ); - } - if ( ZoneType == 2 || ( ZoneType >= 11 && ZoneType <= 13 ) ) - { zone.SetBox( coords[0], coords[1], coords[2], coords[3], coords[4], coords[5] ); } - else if ( ZoneType == 4 ) - { zone.SetSphere( coords[0], coords[1], coords[2], coords[3] ); } - else if ( ZoneType == 5 || ( ZoneType >= 31 && ZoneType <= 33 ) ) - { zone.SetCylinder( coords[0], coords[1], coords[2], coords[3], coords[4], coords[5], coords[6], coords[7] ); } - else if ( ZoneType == 7 || ( ZoneType >= 61 && ZoneType <= 63 ) ) - { zone.SetPipe( coords[0], coords[1], coords[2], coords[3], coords[4], coords[5], coords[6], coords[7], coords[8] ); } - // Remarque : la taille de coords est suffisante pour les limites - for ( int i = 0; i < 3; i++ ) { - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - coords[i] = strtod( chunk.c_str(), 0 ); - } - zone.SetLimit( coords[0], coords[1], coords[2]); - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - int size = atoi( chunk.c_str() ); - for ( int i = 0; i < size; i++ ) { - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - zone.AddHypo( chunk.c_str() ); - } - return true; - } - -// -// ================================= -// 2.5. Restauration d'une frontiere -// ================================= - - /*! - \brief Restore boundary from the string - \param boundary boundary being restored - \param stream string representation of the boundary - \return \c true if the boundary is correctly restored or \c false otherwise - */ - bool Restore( HOMARD_Boundary& boundary, const std::string& stream ) - { - std::string::size_type start = 0; - std::string chunk; - bool ok; - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - boundary.SetName( chunk.c_str() ); - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - int BoundaryType = atoi( chunk.c_str() ) ; - boundary.SetType( BoundaryType ); - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - boundary.SetCaseCreation( chunk.c_str() ); - - // Si analytique, les coordonnees des frontieres : le nombre depend du type - // Si discret, le maillage - // Si CAO, la géométrie - int lgcoords ; - if ( BoundaryType == -1 ) { lgcoords = -1 ; } - else if ( BoundaryType == 1 ) { lgcoords = 7 ; } - else if ( BoundaryType == 2 ) { lgcoords = 4 ; } - else { lgcoords = 0 ; } -// - if ( lgcoords == -1 ) - { - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - boundary.SetDataFile( chunk.c_str() ); - } - else if ( lgcoords == 0 ) - { - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - boundary.SetMeshName( chunk.c_str() ); - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - boundary.SetDataFile( chunk.c_str() ); - } - else - { std::vector coords; - coords.resize( lgcoords ); - for ( int i = 0; i < lgcoords; i++ ) { - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - coords[i] = strtod( chunk.c_str(), 0 ); - } - if ( BoundaryType == 1 ) - { boundary.SetCylinder(coords[0],coords[1],coords[2],coords[3],coords[4],coords[5],coords[6]); } - else if ( BoundaryType == 2 ) - { boundary.SetSphere( coords[0], coords[1], coords[2], coords[3]); } - else if ( BoundaryType == 3 ) - { boundary.SetConeA( coords[0], coords[1], coords[2], coords[3], coords[4], coords[5], coords[6]); } - else if ( BoundaryType == 4 ) - { boundary.SetConeR( coords[0], coords[1], coords[2], coords[3], coords[4], coords[5], coords[6], coords[7]); } - // Remarque : la taille de coords est suffisante pour les limites - for ( int i = 0; i < 3; i++ ) { - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - coords[i] = strtod( chunk.c_str(), 0 ); - } - boundary.SetLimit( coords[0], coords[1], coords[2]); - } - // Les groupes - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - int size = atoi( chunk.c_str() ); - for ( int i = 0; i < size; i++ ) { - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - boundary.AddGroup( chunk.c_str() ); - } - - return true; - } - -// -// ================================== -// 2.6. Restauration d'un schema YACS -// ================================== - - /*! - \brief Restore a schema YACS from the string - \param yacs yacs being restored - \param stream string representation of the schema yacs - \return \c true if yacs is correctly restored or \c false otherwise - */ - bool Restore( HOMARD_YACS& yacs, const std::string& stream ) - { - std::string::size_type start = 0; - std::string chunk; - bool ok; - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - yacs.SetName( chunk.c_str() ); - - chunk = getNextChunk( stream, start, ok ); - if ( !ok ) return false; - int YACSType = atoi( chunk.c_str() ) ; - yacs.SetType( YACSType ); - - return true; - } - -} // namespace ADAPT /end/ diff --git a/src/ADAPT/HOMARD_DriverTools.hxx b/src/ADAPT/HOMARD_DriverTools.hxx deleted file mode 100644 index e7aff54f8..000000000 --- a/src/ADAPT/HOMARD_DriverTools.hxx +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : HOMARD_DriverTools.hxx -// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) -// -// ---------------------------------------------------------------------------- - -#ifndef HOMARD_DRIVERTOOLS_H -#define HOMARD_DRIVERTOOLS_H - -#include "HOMARD.hxx" - -#include - -class HOMARD_Boundary; -class HOMARD_Cas; -class HOMARD_Iteration; -class HOMARD_Hypothesis; -class HOMARD_Zone; -class HOMARD_YACS; - -namespace ADAPT -{ - //! persistence entity type - typedef enum { Case, Zone, Hypothesis, Iteration, Boundary, YACS } SignatureType; - - //! get persistence signature - HOMARDIMPL_EXPORT std::string GetSignature( SignatureType type ); - - //! get data separator - HOMARDIMPL_EXPORT std::string separator(); - - //! dump boundary to the string - HOMARDIMPL_EXPORT std::string Dump( const ::HOMARD_Boundary& boundary ); - //! dump case to the string - HOMARDIMPL_EXPORT std::string Dump( const ::HOMARD_Cas& cas ); - //! dump iteration to the string - HOMARDIMPL_EXPORT std::string Dump( const ::HOMARD_Iteration& iteration ); - //! dump hypothesis to the string - HOMARDIMPL_EXPORT std::string Dump( const ::HOMARD_Hypothesis& hypothesis ); - //! dump zone to the string - HOMARDIMPL_EXPORT std::string Dump( const ::HOMARD_Zone& zone ); - //! dump yacs to the string - HOMARDIMPL_EXPORT std::string Dump( const ::HOMARD_YACS& yacs ); - - //! restore boundary from the string - HOMARDIMPL_EXPORT bool Restore( ::HOMARD_Boundary& boundary, const std::string& stream ); - //! restore case from the string - HOMARDIMPL_EXPORT bool Restore( ::HOMARD_Cas& cas, const std::string& stream ); - //! restore hypothesis from the string - HOMARDIMPL_EXPORT bool Restore( ::HOMARD_Hypothesis& hypothesis, const std::string& stream ); - //! restore iteration from the string - HOMARDIMPL_EXPORT bool Restore( ::HOMARD_Iteration& iteration, const std::string& stream ); - //! restore zone from the string - HOMARDIMPL_EXPORT bool Restore( ::HOMARD_Zone& zone, const std::string& stream ); - //! restore yacs from the string - HOMARDIMPL_EXPORT bool Restore( ::HOMARD_YACS& yacs, const std::string& stream ); -}; - -#endif // HOMARD_DRIVERTOOLS_H diff --git a/src/ADAPT/HOMARD_Hypothesis.cxx b/src/ADAPT/HOMARD_Hypothesis.cxx deleted file mode 100644 index a957b57ba..000000000 --- a/src/ADAPT/HOMARD_Hypothesis.cxx +++ /dev/null @@ -1,524 +0,0 @@ -// HOMARD HOMARD : implementation of HOMARD idl descriptions -// -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : HOMARD_Hypothesis.cxx -// Author : Gerald NICOLAS, EDF -// Module : HOMARD -// -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier - -#include "HOMARD_Hypothesis.hxx" -#include "HOMARD.hxx" -#include "utilities.h" - -//============================================================================= -/*! - * default constructor: - */ -//============================================================================= -HOMARD_Hypothesis::HOMARD_Hypothesis(): - _Name(""), _NomCasCreation(""), - _TypeAdap(-1), _TypeRaff(0), _TypeDera(0), - _Field(""), - _TypeThR(0), _ThreshR(0), - _TypeThC(0), _ThreshC(0), - _UsField(0), _UsCmpI(0), _TypeFieldInterp(0) -{ - MESSAGE("HOMARD_Hypothesis"); -} - -//============================================================================= -/*! - */ -//============================================================================= -HOMARD_Hypothesis::~HOMARD_Hypothesis() -{ - MESSAGE("~HOMARD_Hypothesis"); -} -//============================================================================= -//============================================================================= -// Generalites -//============================================================================= -//============================================================================= -void HOMARD_Hypothesis::SetName( const char* Name ) -{ - _Name = std::string( Name ); -} -//============================================================================= -std::string HOMARD_Hypothesis::GetName() const -{ - return _Name; -} -//============================================================================= -std::string HOMARD_Hypothesis::GetDumpPython() const -{ - std::ostringstream aScript; - aScript << "\n# Creation of the hypothesis " << _Name << "\n" ; - aScript << "\t" << _Name << " = homard.CreateHypothesis(\"" << _Name << "\")\n"; - if ( _TypeAdap == -1 ) - { - int TypeRaffDera ; - if ( _TypeRaff == 1 ) { TypeRaffDera = 1 ; } - else { TypeRaffDera = -1 ; } - aScript << "\t" << _Name << ".SetUnifRefinUnRef(" << TypeRaffDera << ")\n"; - } - -// Raffinement selon des zones geometriques - std::list::const_iterator it = _ListZone.begin(); - int TypeUse ; - while(it != _ListZone.end()) - { - aScript << "\t" << _Name << ".AddZone(\"" << *it; - it++; - if ( *it == "1" ) { TypeUse = 1 ; } - else { TypeUse = -1 ; } - aScript << "\", " << TypeUse << ")\n"; - it++; - } - -// Raffinement selon un champ - if ( _TypeAdap == 1 ) - { - aScript << "\t" << _Name << ".SetField(\"" << _Field << "\")\n"; - aScript << "\t" << _Name << ".SetUseField(" << _UsField << ")\n"; - aScript << "\t" << _Name << ".SetUseComp(" << _UsCmpI << ")\n"; - std::list::const_iterator it_comp = _ListComp.begin(); - while(it_comp != _ListComp.end()) - { - aScript << "\t" << _Name << ".AddComp(\"" << *it_comp << "\")\n"; - it_comp++; - } - if ( _TypeRaff == 1 ) - { - aScript << "\t" << _Name << ".SetRefinThr(" << _TypeThR << ", " << _ThreshR << ")\n"; - } - if ( _TypeDera == 1 ) - { - aScript << "\t" << _Name << ".SetUnRefThr(" << _TypeThC << ", " << _ThreshC << ")\n"; - } - } - -// Filtrage du raffinement par des groupes - for ( it=_ListGroupSelected.begin(); it!=_ListGroupSelected.end();it++) - aScript << "\t" << _Name << ".AddGroup(\"" << (*it) << "\")\n" ; - -// Interpolation des champs - if ( _TypeFieldInterp == 2 ) - { - std::list::const_iterator it_champ = _ListFieldInterp.begin(); - while(it_champ != _ListFieldInterp.end()) - { - aScript << "\t" << _Name << ".AddFieldInterpType( \"" << *it_champ << "\" " ; - it_champ++; - aScript << ", " << *it_champ << ")\n"; - it_champ++; - } - } - else if ( _TypeFieldInterp != 0 ) - { - aScript << "\t" << _Name << ".SetTypeFieldInterp(" << _TypeFieldInterp << ")\n"; - } - if ( _NivMax > 0 ) - { - aScript << "\t" <<_Name << ".SetNivMax(" << _NivMax << ")\n"; - } - if ( _DiamMin > 0 ) - { - aScript << "\t" <<_Name << ".SetDiamMin(" << _DiamMin << ")\n"; - } - if ( _AdapInit != 0 ) - { - aScript << "\t" <<_Name << ".SetAdapInit(" << _AdapInit << ")\n"; - } - if ( _ExtraOutput != 1 ) - { - aScript << "\t" <<_Name << ".SetExtraOutput(" << _ExtraOutput << ")\n"; - } - - return aScript.str(); -} -//============================================================================= -//============================================================================= -// Caracteristiques -//============================================================================= -//============================================================================= -void HOMARD_Hypothesis::SetAdapType( int TypeAdap ) -{ - VERIFICATION( (TypeAdap>=-1) && (TypeAdap<=1) ); - _TypeAdap = TypeAdap; -} -//============================================================================= -int HOMARD_Hypothesis::GetAdapType() const -{ - return _TypeAdap; -} -//============================================================================= -void HOMARD_Hypothesis::SetRefinTypeDera( int TypeRaff, int TypeDera ) -{ - VERIFICATION( (TypeRaff>=-1) && (TypeRaff<=1) ); - _TypeRaff = TypeRaff; - VERIFICATION( (TypeDera>=-1) && (TypeDera<=1) ); - _TypeDera = TypeDera; -} -//============================================================================= -int HOMARD_Hypothesis::GetRefinType() const -{ - return _TypeRaff; -} -//============================================================================= -int HOMARD_Hypothesis::GetUnRefType() const -{ - return _TypeDera; -} -//============================================================================= -void HOMARD_Hypothesis::SetField( const char* FieldName ) -{ - _Field = std::string( FieldName ); - MESSAGE( "SetField : FieldName = " << FieldName ); -} -//============================================================================= -std::string HOMARD_Hypothesis::GetFieldName() const -{ - return _Field; -} -//============================================================================= -void HOMARD_Hypothesis::SetUseField( int UsField ) -{ - VERIFICATION( (UsField>=0) && (UsField<=1) ); - _UsField = UsField; -} -//============================================================================= -int HOMARD_Hypothesis::GetUseField() const -{ - return _UsField; -} -//============================================================================= -void HOMARD_Hypothesis::SetUseComp( int UsCmpI ) -{ - MESSAGE ("SetUseComp pour UsCmpI = "<=0) && (UsCmpI<=2) ); - _UsCmpI = UsCmpI; -} -//============================================================================= -int HOMARD_Hypothesis::GetUseComp() const -{ - return _UsCmpI; -} -//============================================================================= -void HOMARD_Hypothesis::AddComp( const char* NomComp ) -{ -// On commence par supprimer la composante au cas ou elle aurait deja ete inseree -// Cela peut se produire dans un schema YACS quand on repasse plusieurs fois par la -// definition de l'hypothese - SupprComp( NomComp ) ; -// Insertion veritable - _ListComp.push_back( std::string( NomComp ) ); -} -//============================================================================= -void HOMARD_Hypothesis::SupprComp( const char* NomComp ) -{ - MESSAGE ("SupprComp pour "<::iterator it = find( _ListComp.begin(), _ListComp.end(), NomComp ); - if ( it != _ListComp.end() ) { it = _ListComp.erase( it ); } -} -//============================================================================= -void HOMARD_Hypothesis::SupprComps() -{ - _ListComp.clear(); -} -//============================================================================= -const std::list& HOMARD_Hypothesis::GetComps() const -{ - return _ListComp; -} -//============================================================================= -void HOMARD_Hypothesis::SetRefinThr( int TypeThR, double ThreshR ) -{ - MESSAGE( "SetRefinThr : TypeThR = " << TypeThR << ", ThreshR = " << ThreshR ); - VERIFICATION( (TypeThR>=0) && (TypeThR<=4) ); - _TypeThR = TypeThR; - _ThreshR = ThreshR; -} -//============================================================================= -int HOMARD_Hypothesis::GetRefinThrType() const -{ - return _TypeThR; -} -//============================================================================= -double HOMARD_Hypothesis::GetThreshR() const -{ - return _ThreshR; -} -//============================================================================= -void HOMARD_Hypothesis::SetUnRefThr( int TypeThC, double ThreshC ) -{ - VERIFICATION( (TypeThC>=0) && (TypeThC<=4) ); - _TypeThC = TypeThC; - _ThreshC = ThreshC; -} -//============================================================================= -int HOMARD_Hypothesis::GetUnRefThrType() const -{ - return _TypeThC; -} -//============================================================================= -double HOMARD_Hypothesis::GetThreshC() const -{ - return _ThreshC; -} -//============================================================================= -void HOMARD_Hypothesis::SetNivMax( int NivMax ) -//============================================================================= -{ - _NivMax = NivMax; -} -//============================================================================= -const int HOMARD_Hypothesis::GetNivMax() const -//============================================================================= -{ - return _NivMax; -} -//============================================================================= -void HOMARD_Hypothesis::SetDiamMin( double DiamMin ) -//============================================================================= -{ - _DiamMin = DiamMin; -} -//============================================================================= -const double HOMARD_Hypothesis::GetDiamMin() const -//============================================================================= -{ - return _DiamMin; -} -//============================================================================= -void HOMARD_Hypothesis::SetAdapInit( int AdapInit ) -//============================================================================= -{ - _AdapInit = AdapInit; -} -//============================================================================= -const int HOMARD_Hypothesis::GetAdapInit() const -//============================================================================= -{ - return _AdapInit; -} -//============================================================================= -void HOMARD_Hypothesis::SetExtraOutput( int ExtraOutput ) -//============================================================================= -{ - _ExtraOutput = ExtraOutput; -} -//============================================================================= -const int HOMARD_Hypothesis::GetExtraOutput() const -//============================================================================= -{ - return _ExtraOutput; -} -//============================================================================= -void HOMARD_Hypothesis::AddGroup( const char* Group) -{ -// On commence par supprimer le groupe au cas ou il aurait deja ete insere -// Cela peut se produire dans un schema YACS quand on repasse plusieurs fois par la -// definition de l'hypothese - SupprGroup( Group ) ; -// Insertion veritable - _ListGroupSelected.push_back(Group); -} -//============================================================================= -void HOMARD_Hypothesis::SupprGroup( const char* Group ) -{ - MESSAGE ("SupprGroup pour "<::iterator it = find( _ListGroupSelected.begin(), _ListGroupSelected.end(), Group ); - if ( it != _ListGroupSelected.end() ) { it = _ListGroupSelected.erase( it ); } -} -//============================================================================= -void HOMARD_Hypothesis::SupprGroups() -{ - _ListGroupSelected.clear(); -} -//============================================================================= -void HOMARD_Hypothesis::SetGroups( const std::list& ListGroup ) -{ - _ListGroupSelected.clear(); - std::list::const_iterator it = ListGroup.begin(); - while(it != ListGroup.end()) - _ListGroupSelected.push_back((*it++)); -} -//============================================================================= -const std::list& HOMARD_Hypothesis::GetGroups() const -{ - return _ListGroupSelected; -} -//============================================================================= -// Type d'interpolation des champs : -// 0 : aucun champ n'est interpole -// 1 : tous les champs sont interpoles -// 2 : certains champs sont interpoles -void HOMARD_Hypothesis::SetTypeFieldInterp( int TypeFieldInterp ) -{ - VERIFICATION( (TypeFieldInterp>=0) && (TypeFieldInterp<=2) ); - _TypeFieldInterp = TypeFieldInterp; -} -//============================================================================= -int HOMARD_Hypothesis::GetTypeFieldInterp() const -{ - return _TypeFieldInterp; -} -//============================================================================= -void HOMARD_Hypothesis::AddFieldInterpType( const char* FieldInterp, int TypeInterp ) -{ - MESSAGE ("Dans AddFieldInterpType pour " << FieldInterp << " et TypeInterp = " << TypeInterp) ; -// On commence par supprimer le champ au cas ou il aurait deja ete insere -// Cela peut se produire dans un schema YACS quand on repasse plusieurs fois par la -// definition de l'hypothese - SupprFieldInterp( FieldInterp ) ; -// Insertion veritable -// . Nom du champ - _ListFieldInterp.push_back( std::string( FieldInterp ) ); -// . Usage du champ - std::stringstream saux1 ; - saux1 << TypeInterp ; - _ListFieldInterp.push_back( saux1.str() ); -// . Indication generale : certains champs sont a interpoler - SetTypeFieldInterp ( 2 ) ; -} -//============================================================================= -void HOMARD_Hypothesis::SupprFieldInterp( const char* FieldInterp ) -{ - MESSAGE ("Dans SupprFieldInterp pour " << FieldInterp) ; - std::list::iterator it = find( _ListFieldInterp.begin(), _ListFieldInterp.end(), FieldInterp ) ; -// Attention a supprimer le nom du champ et le type d'usage - if ( it != _ListFieldInterp.end() ) - { - it = _ListFieldInterp.erase( it ) ; - it = _ListFieldInterp.erase( it ) ; - } -// Decompte du nombre de champs restant a interpoler - it = _ListFieldInterp.begin() ; - int cpt = 0 ; - while(it != _ListFieldInterp.end()) - { - cpt += 1 ; - (*it++); - } - MESSAGE("Nombre de champ restants = "<& HOMARD_Hypothesis::GetFieldInterps() const -{ - return _ListFieldInterp; -} -//============================================================================= -//============================================================================= -// Liens avec les autres structures -//============================================================================= -//============================================================================= -void HOMARD_Hypothesis::SetCaseCreation( const char* NomCasCreation ) -{ - _NomCasCreation = std::string( NomCasCreation ); -} -//============================================================================= -std::string HOMARD_Hypothesis::GetCaseCreation() const -{ - return _NomCasCreation; -} -//============================================================================= -void HOMARD_Hypothesis::LinkIteration( const char* NomIteration ) -{ - _ListIter.push_back( std::string( NomIteration ) ); -} -//============================================================================= -void HOMARD_Hypothesis::UnLinkIteration( const char* NomIteration ) -{ - std::list::iterator it = find( _ListIter.begin(), _ListIter.end(), NomIteration ) ; - if ( it != _ListIter.end() ) - { - MESSAGE ("Dans UnLinkIteration pour " << NomIteration) ; - it = _ListIter.erase( it ) ; - } -} -//============================================================================= -void HOMARD_Hypothesis::UnLinkIterations() -{ - _ListIter.clear(); -} -//============================================================================= -const std::list& HOMARD_Hypothesis::GetIterations() const -{ - return _ListIter; -} -//============================================================================= -void HOMARD_Hypothesis::AddZone( const char* NomZone, int TypeUse ) -{ - MESSAGE ("Dans AddZone pour " << NomZone << " et TypeUse = " << TypeUse) ; -// On commence par supprimer la zone au cas ou elle aurait deja ete inseree -// Cela peut se produire dans un schema YACS quand on repasse plusieurs fois par la -// definition de l'hypothese - SupprZone( NomZone ) ; -// Insertion veritable -// . Nom de la zone - _ListZone.push_back( std::string( NomZone ) ); -// . Usage de la zone - std::stringstream saux1 ; - saux1 << TypeUse ; - _ListZone.push_back( saux1.str() ); -} -//============================================================================= -void HOMARD_Hypothesis::SupprZone( const char* NomZone ) -{ - MESSAGE ("Dans SupprZone pour " << NomZone) ; - std::list::iterator it = find( _ListZone.begin(), _ListZone.end(), NomZone ); -// Attention a supprimer le nom de zone et le type d'usage - if ( it != _ListZone.end() ) - { - it = _ListZone.erase( it ); - it = _ListZone.erase( it ); - } -} -//============================================================================= -void HOMARD_Hypothesis::SupprZones() -{ - _ListZone.clear(); -} -//============================================================================= -const std::list& HOMARD_Hypothesis::GetZones() const -{ - return _ListZone; -} diff --git a/src/ADAPT/HOMARD_Hypothesis.hxx b/src/ADAPT/HOMARD_Hypothesis.hxx deleted file mode 100644 index 8dd0492ab..000000000 --- a/src/ADAPT/HOMARD_Hypothesis.hxx +++ /dev/null @@ -1,157 +0,0 @@ -// HOMARD HOMARD : implementation of HOMARD idl descriptions -// -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : HOMARD_Hypothesis.hxx -// Author : Gerald NICOLAS, EDF -// Module : HOMARD -// -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier - -#ifndef _HOMARD_HYPOTHESIS_HXX_ -#define _HOMARD_HYPOTHESIS_HXX_ - -#include "HOMARD.hxx" - -#include -#include - -#if defined WIN32 -#pragma warning ( disable: 4251 ) -#endif - -class HOMARDIMPL_EXPORT HOMARD_Hypothesis -{ -public: - HOMARD_Hypothesis(); - ~HOMARD_Hypothesis(); - -// Generalites - void SetName( const char* Name ); - std::string GetName() const; - - std::string GetDumpPython() const; - -// Caracteristiques - void SetAdapType( int TypeAdap ); - int GetAdapType() const; - void SetRefinTypeDera( int TypeRaff, int TypeDera ); - int GetRefinType() const; - int GetUnRefType() const; - - void SetField( const char* FieldName ); - std::string GetFieldName() const; - void SetUseField( int UsField ); - int GetUseField() const; - - void SetUseComp( int UsCmpI ); - int GetUseComp() const; - void AddComp( const char* NomComp ); - void SupprComp( const char* NomComp ); - void SupprComps(); - const std::list& GetComps() const; - - void SetRefinThr( int TypeThR, double ThreshR ); - int GetRefinThrType() const; - double GetThreshR() const; - void SetUnRefThr( int TypeThC, double ThreshC ); - int GetUnRefThrType() const; - double GetThreshC() const; - - void SetNivMax( int NivMax ); - const int GetNivMax() const; - - void SetDiamMin( double DiamMin ); - const double GetDiamMin() const; - - void SetAdapInit( int AdapInit ); - const int GetAdapInit() const; - - void SetExtraOutput( int ExtraOutput ); - const int GetExtraOutput() const; - - void AddGroup( const char* Group); - void SupprGroup( const char* Group ); - void SupprGroups(); - void SetGroups(const std::list& ListGroup ); - const std::list& GetGroups() const; - - void SetTypeFieldInterp( int TypeFieldInterp ); - int GetTypeFieldInterp() const; - void AddFieldInterpType( const char* FieldInterp, int TypeInterp ); - void SupprFieldInterp( const char* FieldInterp ); - void SupprFieldInterps(); - const std::list& GetFieldInterps() const; - -// Liens avec les autres structures - void SetCaseCreation( const char* NomCasCreation ); - std::string GetCaseCreation() const; - - void LinkIteration( const char* NomIter ); - void UnLinkIteration( const char* NomIter ); - void UnLinkIterations(); - const std::list& GetIterations() const; - - void AddZone( const char* NomZone, int TypeUse ); - void SupprZone( const char* NomZone ); - void SupprZones(); - const std::list& GetZones() const; - -private: - std::string _Name; - std::string _NomCasCreation; - - int _TypeAdap; // -1 pour une adapation Uniforme, - // 0 si l adaptation depend des zones, - // 1 pour des champs - - int _TypeRaff; - int _TypeDera; - - std::string _Field; - int _TypeThR; - int _TypeThC; - double _ThreshR; - double _ThreshC; - int _UsField; - int _UsCmpI; - int _TypeFieldInterp; // 0 pour aucune interpolation, - // 1 pour interpolation de tous les champs, - // 2 pour une liste - int _NivMax; - double _DiamMin; - int _AdapInit; - int _ExtraOutput; - - std::list _ListIter; - std::list _ListZone; - std::list _ListComp; - std::list _ListGroupSelected; - std::list _ListFieldInterp; - -}; - -#endif diff --git a/src/ADAPT/HOMARD_Iteration.cxx b/src/ADAPT/HOMARD_Iteration.cxx deleted file mode 100644 index 713a6b066..000000000 --- a/src/ADAPT/HOMARD_Iteration.cxx +++ /dev/null @@ -1,394 +0,0 @@ -// HOMARD HOMARD : implementation of HOMARD idl descriptions -// -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : HOMARD_Iteration.cxx -// Author : Gerald NICOLAS, EDF -// Module : HOMARD -// -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier - -#include "HOMARD_Iteration.hxx" -#include "HOMARD.hxx" -#include "utilities.h" - -//============================================================================= -/*! - * default constructor: - */ -//============================================================================= -HOMARD_Iteration::HOMARD_Iteration(): - _Name( "" ), _Etat( 0 ), - _NumIter( -1 ), - _NomMesh( "" ), _MeshFile( "" ), - _FieldFile( "" ), _TimeStep( -1 ), _Rank( -1 ), - _LogFile( "" ), - _IterParent( "" ), - _NomHypo( "" ), _NomCas( "" ), _NomDir( "" ), - _FileInfo( "" ), - _MessInfo( 1 ) -{ - MESSAGE("HOMARD_Iteration"); -} -//============================================================================= -/*! - * - */ -//============================================================================= -HOMARD_Iteration::~HOMARD_Iteration() -{ - MESSAGE("~HOMARD_Iteration"); -} -//============================================================================= -//============================================================================= -// Generalites -//============================================================================= -//============================================================================= -void HOMARD_Iteration::SetName( const char* Name ) -{ - _Name = std::string( Name ); -} -//============================================================================= -std::string HOMARD_Iteration::GetName() const -{ - return _Name; -} -//============================================================================= -std::string HOMARD_Iteration::GetDumpPython() const -{ - if (_IterParent == "") return std::string(" ") ; // Pas de creation explicite de iteration 0"; - - MESSAGE (". Ecriture de l iteration " << _Name ); - std::ostringstream aScript; - aScript << "\n# Creation of the iteration " << _Name << "\n"; - if( _NumIter == 1 ) - { - aScript << "\t" << _Name << " = " << _NomCas << ".NextIteration(\"" << _Name << "\")\n"; - } - else - { - aScript << "\t" << _Name << " = " << _IterParent << ".NextIteration(\"" << _Name << "\")\n"; - } -// L'hypothese (doit etre au debut) - aScript << "\t" << _Name << ".AssociateHypo(\"" << _NomHypo << "\")\n"; -// Le nom du maillage produit -// MESSAGE (".. maillage produit " << _NomMesh ); - aScript << "\t" << _Name << ".SetMeshName(\"" << _NomMesh << "\")\n" ; -// Le fichier du maillage produit - aScript << "\t" << _Name << ".SetMeshFile(\"" << _MeshFile << "\")\n"; -// Le fichier des champs - if ( _FieldFile != "" ) - { - aScript << "\t" << _Name << ".SetFieldFile(\"" << _FieldFile << "\")\n"; - } -// Si champ de pilotage, valeurs de pas de temps - MESSAGE (". champ de pilotage : _TimeStep = " << _TimeStep << ", _Rank : " << _Rank); - if ( _TimeStep != -1 ) - { - if ( _TimeStep == -2 ) { - aScript << "\t" << _Name << ".SetTimeStepRankLast()\n"; - } - else - { - if ( _TimeStep != -1 ) - { - if ( _Rank == -1 ) - { - aScript << "\t" << _Name << ".SetTimeStep( " << _TimeStep << " )\n"; - } - else - { - aScript << "\t" << _Name << ".SetTimeStepRank( " << _TimeStep << ", " << _Rank << " )\n"; - } - } - } - } -// Les instants d'interpolation - MESSAGE (". instants d'interpolation "); - std::list::const_iterator it = _ListFieldInterpTSR.begin() ; - while(it != _ListFieldInterpTSR.end()) - { - std::string FieldName = std::string((*it)) ; -// MESSAGE ("... FieldName = "<< FieldName); - (*it++); - std::string TimeStepstr = std::string((*it)) ; -// MESSAGE ("... TimeStepstr = "<< TimeStepstr); - (*it++); - std::string Rankstr = std::string((*it)) ; -// MESSAGE ("... Rankstr = "<< Rankstr); - (*it++); - aScript << "\t" << _Name << ".SetFieldInterpTimeStepRank( \"" << FieldName << "\"" ; - aScript << ", " << TimeStepstr ; - aScript << ", " << Rankstr << " )\n" ; - } - -// Compute - MESSAGE (". Compute "); - if ( _Etat == 2 ) { aScript << "\tcodret = " <<_Name << ".Compute(1, 1)\n"; } - else { aScript << "\t#codret = " <<_Name << ".Compute(1, 1)\n"; } -// MESSAGE (". Fin de l ecriture de l iteration " << _Name ); - - return aScript.str(); -} -//============================================================================= -//============================================================================= -// Caracteristiques -//============================================================================= -//============================================================================= -void HOMARD_Iteration::SetDirNameLoc( const char* NomDir ) -{ - _NomDir = std::string( NomDir ); -} -//============================================================================= -std::string HOMARD_Iteration::GetDirNameLoc() const -{ - return _NomDir; -} -//============================================================================= -void HOMARD_Iteration::SetNumber( int NumIter ) -{ - _NumIter = NumIter; -} -//============================================================================= -int HOMARD_Iteration::GetNumber() const -{ - return _NumIter; -} -//============================================================================= -void HOMARD_Iteration::SetState( int etat ) -{ - _Etat = etat; -} -//============================================================================= -int HOMARD_Iteration::GetState() const -{ - return _Etat; -} -//============================================================================= -void HOMARD_Iteration::SetMeshName( const char* NomMesh ) -{ - _NomMesh = std::string( NomMesh ); -} -//============================================================================= -std::string HOMARD_Iteration::GetMeshName() const -{ - return _NomMesh; -} -//============================================================================= -void HOMARD_Iteration::SetMeshFile( const char* MeshFile ) -{ - _MeshFile = std::string( MeshFile ); -} -//============================================================================= -std::string HOMARD_Iteration::GetMeshFile() const -{ - return _MeshFile; -} -//============================================================================= -void HOMARD_Iteration::SetFieldFile( const char* FieldFile ) -{ - _FieldFile = std::string( FieldFile ); -} -//============================================================================= -std::string HOMARD_Iteration::GetFieldFile() const -{ - return _FieldFile; -} -//============================================================================= -// Instants pour le champ de pilotage -//============================================================================= -void HOMARD_Iteration::SetTimeStep( int TimeStep ) -{ - _TimeStep = TimeStep; -} -//============================================================================= -void HOMARD_Iteration::SetTimeStepRank( int TimeStep, int Rank ) -{ - _TimeStep = TimeStep; - _Rank = Rank; -} -//============================================================================= -void HOMARD_Iteration::SetTimeStepRankLast() -{ - _TimeStep = -2; -} -//============================================================================= -int HOMARD_Iteration::GetTimeStep() const -{ - return _TimeStep; -} -//============================================================================= -int HOMARD_Iteration::GetRank() const -{ - return _Rank; -} -//============================================================================= -// Instants pour un champ a interpoler -//============================================================================= -void HOMARD_Iteration::SetFieldInterpTimeStep( const char* FieldInterp, int TimeStep ) -{ - SetFieldInterpTimeStepRank( FieldInterp, TimeStep, TimeStep ) ; -} -//============================================================================= -void HOMARD_Iteration::SetFieldInterpTimeStepRank( const char* FieldInterp, int TimeStep, int Rank ) -{ - MESSAGE("Champ " << FieldInterp << ", hypothese " << _NomHypo ) -// Verification de la presence du champ dans l'hypothese - std::list::iterator it = find( _ListFieldInterp.begin(), _ListFieldInterp.end(), FieldInterp ); - if ( it == _ListFieldInterp.end() ) - { - INFOS("Champ " << FieldInterp << " ; hypothese " << _NomHypo ) - VERIFICATION("Le champ est inconnu dans l'hypothese associee a cette iteration." == 0); - } - -// . Nom du champ - _ListFieldInterpTSR.push_back( std::string( FieldInterp ) ); -// . Pas de temps - std::stringstream saux1 ; - saux1 << TimeStep ; - _ListFieldInterpTSR.push_back( saux1.str() ); -// . Numero d'ordre - std::stringstream saux2 ; - saux2 << Rank ; - _ListFieldInterpTSR.push_back( saux2.str() ); -} -//============================================================================= -const std::list& HOMARD_Iteration::GetFieldInterpsTimeStepRank() const -{ - return _ListFieldInterpTSR; -} -//============================================================================= -void HOMARD_Iteration::SetFieldInterp( const char* FieldInterp ) -{ - _ListFieldInterp.push_back( std::string( FieldInterp ) ); -} -//============================================================================= -const std::list& HOMARD_Iteration::GetFieldInterps() const -{ - return _ListFieldInterp; -} -//============================================================================= -void HOMARD_Iteration::SupprFieldInterps() -{ - _ListFieldInterp.clear(); -} -//============================================================================= -void HOMARD_Iteration::SetLogFile( const char* LogFile ) -{ - _LogFile = std::string( LogFile ); -} -//============================================================================= -std::string HOMARD_Iteration::GetLogFile() const -{ - return _LogFile; -} -//============================================================================= -void HOMARD_Iteration::SetFileInfo( const char* FileInfo ) -{ - _FileInfo = std::string( FileInfo ); -} -//============================================================================= -std::string HOMARD_Iteration::GetFileInfo() const -{ - return _FileInfo; -} -//============================================================================= -//============================================================================= -// Liens avec les autres iterations -//============================================================================= -//============================================================================= -void HOMARD_Iteration::LinkNextIteration( const char* NomIteration ) -{ - _mesIterFilles.push_back( std::string( NomIteration ) ); -} -//============================================================================= -void HOMARD_Iteration::UnLinkNextIteration( const char* NomIteration ) -{ - std::list::iterator it = find( _mesIterFilles.begin(), _mesIterFilles.end(), NomIteration ) ; - if ( it != _mesIterFilles.end() ) - { - MESSAGE ("Dans UnLinkNextIteration pour " << NomIteration) ; - it = _mesIterFilles.erase( it ) ; - } -} -//============================================================================= -void HOMARD_Iteration::UnLinkNextIterations() -{ - _mesIterFilles.clear(); -} -//============================================================================= -const std::list& HOMARD_Iteration::GetIterations() const -{ - return _mesIterFilles; -} -//============================================================================= -void HOMARD_Iteration::SetIterParentName( const char* IterParent ) -{ - _IterParent = IterParent; -} -//============================================================================= -std::string HOMARD_Iteration::GetIterParentName() const -{ - return _IterParent; -} -//============================================================================= -//============================================================================= -// Liens avec les autres structures -//============================================================================= -//============================================================================= -void HOMARD_Iteration::SetCaseName( const char* NomCas ) -{ - _NomCas = std::string( NomCas ); -} -//============================================================================= -std::string HOMARD_Iteration::GetCaseName() const -{ - return _NomCas; -} -//============================================================================= -void HOMARD_Iteration::SetHypoName( const char* NomHypo ) -{ - _NomHypo = std::string( NomHypo ); -} -//============================================================================= -std::string HOMARD_Iteration::GetHypoName() const -{ - return _NomHypo; -} -//============================================================================= -//============================================================================= -// Divers -//============================================================================= -//============================================================================= -void HOMARD_Iteration::SetInfoCompute( int MessInfo ) -{ - _MessInfo = MessInfo; -} -//============================================================================= -int HOMARD_Iteration::GetInfoCompute() const -{ - return _MessInfo; -} diff --git a/src/ADAPT/HOMARD_Iteration.hxx b/src/ADAPT/HOMARD_Iteration.hxx deleted file mode 100644 index cb0e3c72d..000000000 --- a/src/ADAPT/HOMARD_Iteration.hxx +++ /dev/null @@ -1,139 +0,0 @@ -// HOMARD HOMARD : implementation of HOMARD idl descriptions -// -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : HOMARD_Iteration.hxx -// Author : Gerald NICOLAS, EDF -// Module : HOMARD -// -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier - -#ifndef _HOMARD_ITER_HXX_ -#define _HOMARD_ITER_HXX_ - -#include "HOMARD.hxx" - -#include -#include - -#if defined WIN32 -#pragma warning ( disable: 4251 ) -#endif - -class HOMARDIMPL_EXPORT HOMARD_Iteration -{ -public: - HOMARD_Iteration(); - ~HOMARD_Iteration(); - -// Generalites - void SetName( const char* Name ); - std::string GetName() const; - - std::string GetDumpPython() const; - -// Caracteristiques - void SetDirNameLoc( const char* NomDir ); - std::string GetDirNameLoc() const; - - void SetNumber( int NumIter ); - int GetNumber() const; - - void SetState( int etat ); - int GetState() const; - - void SetMeshName( const char* NomMesh ); - std::string GetMeshName() const; - - void SetMeshFile( const char* MeshFile ); - std::string GetMeshFile() const; - - void SetFieldFile( const char* FieldFile ); - std::string GetFieldFile() const; -// Instants pour le champ de pilotage - void SetTimeStep( int TimeStep ); - void SetTimeStepRank( int TimeStep, int Rank ); - void SetTimeStepRankLast(); - int GetTimeStep() const; - int GetRank() const; -// Instants pour un champ a interpoler - void SetFieldInterpTimeStep( const char* FieldInterp, int TimeStep ); - void SetFieldInterpTimeStepRank( const char* FieldInterp, int TimeStep, int Rank ); - const std::list& GetFieldInterpsTimeStepRank() const; - void SetFieldInterp( const char* FieldInterp ); - const std::list& GetFieldInterps() const; - void SupprFieldInterps(); - - void SetLogFile( const char* LogFile ); - std::string GetLogFile() const; - - void SetFileInfo( const char* FileInfo ); - std::string GetFileInfo() const; - -// Liens avec les autres iterations - void LinkNextIteration( const char* NomIteration ); - void UnLinkNextIteration( const char* NomIteration ); - void UnLinkNextIterations(); - const std::list& GetIterations() const; - - void SetIterParentName( const char* iterParent ); - std::string GetIterParentName() const; - -// Liens avec les autres structures - void SetCaseName( const char* NomCas ); - std::string GetCaseName() const; - - void SetHypoName( const char* NomHypo ); - std::string GetHypoName() const; - -// Divers - void SetInfoCompute( int MessInfo ); - int GetInfoCompute() const; - -private: - std::string _Name; - int _Etat; - int _NumIter; - std::string _NomMesh; - std::string _MeshFile; - std::string _FieldFile; - int _TimeStep; - int _Rank; - std::string _LogFile; - std::string _IterParent; - std::string _NomHypo; - std::string _NomCas; - std::string _NomDir; - std::list _mesIterFilles; - std::string _FileInfo; - int _MessInfo; - // La liste des champs retenus par l'hypothese - std::list _ListFieldInterp; - // La liste des triplets (champs, pas de temps, numero d'ordre) retenus par l'iteration - std::list _ListFieldInterpTSR; -}; - -#endif diff --git a/src/ADAPT/HOMARD_YACS.cxx b/src/ADAPT/HOMARD_YACS.cxx deleted file mode 100644 index 69c2a8189..000000000 --- a/src/ADAPT/HOMARD_YACS.cxx +++ /dev/null @@ -1,219 +0,0 @@ -// HOMARD HOMARD : implementation of HOMARD idl descriptions -// -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : HOMARD_YACS.cxx -// Author : Gerald NICOLAS, EDF -// Module : HOMARD -// -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier - -#include "HOMARD_YACS.hxx" -#include "utilities.h" - -//============================================================================= -/*! - * default constructor: - */ -//============================================================================= -HOMARD_YACS::HOMARD_YACS(): - _Name( "" ), - _NomCas( "" ), - _NomDir( "" ), - _MeshFile( "" ), - _ScriptFile( "" ) -{ - MESSAGE("HOMARD_YACS"); -} -//============================================================================= -/*! - * - */ -//============================================================================= -HOMARD_YACS::~HOMARD_YACS() -{ - MESSAGE("~HOMARD_YACS"); -} -//============================================================================= -//============================================================================= -// Generalites -//============================================================================= -//============================================================================= -void HOMARD_YACS::SetName( const char* Name ) -{ - _Name = std::string( Name ); -} -//============================================================================= -std::string HOMARD_YACS::GetName() const -{ - return _Name; -} -//============================================================================= -std::string HOMARD_YACS::GetDumpPython() const -{ - MESSAGE (". Ecriture du schema " << _Name ); - std::ostringstream aScript; - aScript << "\n# Creation of the schema " << _Name << "\n"; -// Creation du schema - aScript << "\t" << _Name << " = " << _NomCas << ".CreateYACSSchema(\"" << _Name << "\", \"" << _ScriptFile << "\", \"" << _NomDir << "\", \"" << _MeshFile << "\")\n"; -// Le type de schema - aScript << "\t" << _Name << ".SetType(" << _Type << ")\n"; -// Les controles de convergences - if ( _MaxIter > 0 ) { aScript << "\t" << _Name << ".SetMaxIter(" << _MaxIter << ")\n"; } - if ( _MaxNode > 0 ) { aScript << "\t" << _Name << ".SetMaxNode(" << _MaxNode << ")\n"; } - if ( _MaxElem > 0 ) { aScript << "\t" << _Name << ".SetMaxElem(" << _MaxElem << ")\n"; } - -// L'ecriture du schema - aScript << "\tcodret = " << _Name << ".Write()\n"; - - MESSAGE (". Fin de l ecriture du schema " << _Name ); - - return aScript.str(); -} -//============================================================================= -//============================================================================= -// Caracteristiques de la convergence -//============================================================================= -//============================================================================= -void HOMARD_YACS::SetType( int Type ) -{ - _Type = Type; -} -//============================================================================= -int HOMARD_YACS::GetType() const -{ - return _Type; -} -//============================================================================= -void HOMARD_YACS::SetMaxIter( int MaxIter ) -{ - _MaxIter = MaxIter; -} -//============================================================================= -int HOMARD_YACS::GetMaxIter() const -{ - return _MaxIter; -} -//============================================================================= -void HOMARD_YACS::SetMaxNode( int MaxNode ) -{ - _MaxNode = MaxNode; -} -//============================================================================= -int HOMARD_YACS::GetMaxNode() const -{ - return _MaxNode; -} -//============================================================================= -void HOMARD_YACS::SetMaxElem( int MaxElem ) -{ - _MaxElem = MaxElem; -} -//============================================================================= -int HOMARD_YACS::GetMaxElem() const -{ - return _MaxElem; -} -//============================================================================= -void HOMARD_YACS::SetTestConvergence( int TypeTest, double VRef ) -{ - _TypeTest = TypeTest; - _VRef = VRef; -} -//============================================================================= -int HOMARD_YACS::GetTestConvergenceType() const -{ - return _TypeTest; -} -//============================================================================= -double HOMARD_YACS::GetTestConvergenceVRef() const -{ - return _VRef; -} -//============================================================================= -//============================================================================= -// Repertoire et fichiers -//============================================================================= -//============================================================================= -//============================================================================= -void HOMARD_YACS::SetDirName( const char* NomDir ) -{ - _NomDir = std::string( NomDir ); -} -//============================================================================= -std::string HOMARD_YACS::GetDirName() const -{ - return _NomDir; -} -//============================================================================= -void HOMARD_YACS::SetMeshFile( const char* MeshFile ) -{ - _MeshFile = std::string( MeshFile ); -} -//============================================================================= -std::string HOMARD_YACS::GetMeshFile() const -{ - return _MeshFile; -} -//============================================================================= -void HOMARD_YACS::SetScriptFile( const char* ScriptFile ) -{ - _ScriptFile = std::string( ScriptFile ); -} -//============================================================================= -std::string HOMARD_YACS::GetScriptFile() const -{ - return _ScriptFile; -} -//============================================================================= -void HOMARD_YACS::SetXMLFile( const char* XMLFile ) -{ - _XMLFile = std::string( XMLFile ); -} -//============================================================================= -std::string HOMARD_YACS::GetXMLFile() const -{ - return _XMLFile; -} -//============================================================================= -//============================================================================= -// Liens avec les autres structures -//============================================================================= -//============================================================================= -void HOMARD_YACS::SetCaseName( const char* NomCas ) -{ - _NomCas = std::string( NomCas ); -} -//============================================================================= -std::string HOMARD_YACS::GetCaseName() const -{ - return _NomCas; -} -//============================================================================= -//============================================================================= -// Divers -//============================================================================= -//============================================================================= diff --git a/src/ADAPT/HOMARD_YACS.hxx b/src/ADAPT/HOMARD_YACS.hxx deleted file mode 100644 index 5f9141997..000000000 --- a/src/ADAPT/HOMARD_YACS.hxx +++ /dev/null @@ -1,103 +0,0 @@ -// HOMARD HOMARD : implementation of HOMARD idl descriptions -// -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : HOMARD_YACS.hxx -// Author : Gerald NICOLAS, EDF -// Module : HOMARD -// -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier - -#ifndef _HOMARD_YACS_HXX_ -#define _HOMARD_YACS_HXX_ - -#include "HOMARD.hxx" - -#include -#include - -class HOMARDIMPL_EXPORT HOMARD_YACS -{ -public: - HOMARD_YACS(); - ~HOMARD_YACS(); - -// Generalites - void SetName( const char* Name ); - std::string GetName() const; - - std::string GetDumpPython() const; - -// Caracteristiques - void SetType( int Type ); - int GetType() const; - - void SetMaxIter( int MaxIter ); - int GetMaxIter() const; - void SetMaxNode( int MaxNode ); - int GetMaxNode() const; - void SetMaxElem( int MaxElem ); - int GetMaxElem() const; - - void SetTestConvergence( int TypeTest, double VRef ); - int GetTestConvergenceType() const; - double GetTestConvergenceVRef() const; - - void SetDirName( const char* NomDir ); - std::string GetDirName() const; - - void SetMeshFile( const char* MeshFile ); - std::string GetMeshFile() const; - - void SetScriptFile( const char* ScriptFile ); - std::string GetScriptFile() const; - - void SetXMLFile( const char* XMLFile ); - std::string GetXMLFile() const; - -// Liens avec les autres structures - void SetCaseName( const char* NomCas ); - std::string GetCaseName() const; - - -// Divers - -private: - std::string _Name; - std::string _NomCas; - std::string _NomDir; - std::string _MeshFile; - std::string _ScriptFile; - int _Type; - int _MaxIter; - int _MaxNode; - int _MaxElem; - int _TypeTest; - double _VRef; - std::string _XMLFile; -}; - -#endif diff --git a/src/ADAPT/HOMARD_Zone.cxx b/src/ADAPT/HOMARD_Zone.cxx deleted file mode 100644 index 0d938a53b..000000000 --- a/src/ADAPT/HOMARD_Zone.cxx +++ /dev/null @@ -1,325 +0,0 @@ -// HOMARD HOMARD : implementation of HOMARD idl descriptions -// -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : HOMARD_Zone.cxx -// Author : Gerald NICOLAS, EDF -// Module : HOMARD -// -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier - -#include "HOMARD_Zone.hxx" -#include "HOMARD.hxx" -#include "utilities.h" - -//============================================================================= -/*! - * default constructor: - */ -//============================================================================= -HOMARD_Zone::HOMARD_Zone(): - _Name( "" ),_Type( 2 ), - _Xmin( 0 ), _Xmax( 0 ), _Ymin( 0 ), _Ymax( 0 ), _Zmin( 0 ), _Zmax( 0 ), - _Xcentre( 0 ), _Ycentre( 0 ), _Zcentre( 0 ), _Rayon( 0 ), - _Xaxe( 0 ), _Yaxe( 0 ), _Zaxe( 0 ), _Haut( 0 ), - _Xincr( 0 ), _Yincr( 0 ), _Zincr( 0 ) -{ - MESSAGE("HOMARD_Zone") ; -} - -//============================================================================= -HOMARD_Zone::~HOMARD_Zone() -{ - MESSAGE("~HOMARD_Zone") ; -} -//============================================================================= -//============================================================================= -// Generalites -//============================================================================= -//============================================================================= -void HOMARD_Zone::SetName( const char* Name ) -{ - _Name = std::string( Name ); -} -//============================================================================= -std::string HOMARD_Zone::GetName() const -{ - return _Name; -} -//============================================================================= -std::string HOMARD_Zone::GetDumpPython() const -{ -// MESSAGE("GetDumpPython avec _Type " << _Type) ; -// MESSAGE("GetDumpPython avec _Name " << _Name) ; - std::ostringstream aScript; - aScript << "\n# Creation of the "; - if ( _Type >= 11 && _Type <= 13 ) { aScript << "rectangle " ; } - else if ( _Type == 2 ) { aScript << "box " ;} - else if ( _Type >= 31 && _Type <= 33 ) { aScript << "disk " ;} - else if ( _Type == 4 ) { aScript << "sphere " ; } - else if ( _Type == 5 ) { aScript << "cylinder " ; } - else if ( _Type >= 61 && _Type <= 63 ) { aScript << "disk with hole " ;} - else if ( _Type == 7 ) { aScript << "pipe " ; } - aScript << _Name << "\n" ; -// - aScript << "\t" << _Name << " = homard.CreateZone" ; -// - switch (_Type) - { - case 11: - { aScript << "Box2D( \"" << _Name << "\", " << _Xmin << ", " << _Xmax << ", " << _Ymin << ", " << _Ymax << ", 1 )\n"; - break ; - } - case 12: - { aScript << "Box2D( \"" << _Name << "\", " << _Ymin << ", " << _Ymax << ", " << _Zmin << ", " << _Zmax << ", 2 )\n"; - break ; - } - case 13: - { aScript << "Box2D( \"" << _Name << "\", " << _Zmin << ", " << _Zmax << ", " << _Xmin << ", " << _Xmax << ", 3 )\n"; - break ; - } - case 2: - { aScript << "Box( \"" << _Name << "\", " << _Xmin << ", " << _Xmax << ", " << _Ymin << ", " << _Ymax << ", " << _Zmin << ", " << _Zmax << ")\n"; - break ; - } - - case 4: - { aScript << "Sphere( \"" << _Name << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Rayon << ")\n"; - break ; - } - - case 31: - { aScript << "Disk( \"" << _Name << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Rayon << ", 1 )\n"; - break ; - } - case 32: - { aScript << "Disk( \"" << _Name << "\", " << _Ycentre << ", " << _Zcentre << ", " << _Rayon << ", 2 )\n"; - break ; - } - case 33: - { aScript << "Disk( \"" << _Name << "\", " << _Zcentre << ", " << _Xcentre << ", " << _Rayon << ", 3 )\n"; - break ; - } - case 5: - { aScript << "Cylinder( \"" << _Name << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Xaxe << ", " << _Yaxe << ", " << _Zaxe << ", " << _Rayon << ", " << _Haut << ")\n"; - break ; - } - - case 61: - { aScript << "DiskWithHole( \"" << _Name << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Rayon << ", " << _Rayonint << ", 1 )\n"; - break ; - } - case 62: - { aScript << "DiskWithHole( \"" << _Name << "\", " << _Ycentre << ", " << _Zcentre << ", " << _Rayon << ", " << _Rayonint << ", 2 )\n"; - break ; - } - case 63: - { aScript << "DiskWithHole( \"" << _Name << "\", " << _Zcentre << ", " << _Xcentre << ", " << _Rayon << ", " << _Rayonint << ", 3 )\n"; - break ; - } - case 7: - { aScript << "Pipe( \"" << _Name << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Xaxe << ", " << _Yaxe << ", " << _Zaxe << ", " << _Rayon << ", " << _Haut << ", " << _Rayonint << ")\n"; - break ; - } - } - - return aScript.str() ; -} -//============================================================================= -//============================================================================= -// Caracteristiques -//============================================================================= -//============================================================================= -void HOMARD_Zone::SetType( int Type ) -{ - _Type = Type; -} -//============================================================================= -int HOMARD_Zone::GetType() const -{ - return _Type; -} -//======================================================================================= -void HOMARD_Zone::SetBox( double X0, double X1, double X2, double X3, double X4, double X5 ) -{ - _Xmin = X0; _Xmax = X1; - _Ymin = X2; _Ymax = X3; - _Zmin = X4; _Zmax = X5; -} -//======================================================================================= -void HOMARD_Zone::SetCylinder( double X0, double X1, double X2, - double X3, double X4, double X5, double X6, double X7 ) -{ - _Xcentre = X0; - _Ycentre = X1; - _Zcentre = X2; - _Xaxe = X3; - _Yaxe = X4; - _Zaxe = X5; - _Rayon = X6; - _Haut = X7; -} -//======================================================================================= -void HOMARD_Zone::SetPipe( double X0, double X1, double X2, - double X3, double X4, double X5, double X6, double X7, double X8 ) -{ - _Xcentre = X0; - _Ycentre = X1; - _Zcentre = X2; - _Xaxe = X3; - _Yaxe = X4; - _Zaxe = X5; - _Rayon = X6; - _Haut = X7; - _Rayonint = X8; -} -//====================================================================== -void HOMARD_Zone::SetSphere( double X0, double X1, double X2, double X3 ) -{ - _Xcentre = X0; - _Ycentre = X1; - _Zcentre = X2; - _Rayon = X3; -} -//======================================================================================= -std::vector HOMARD_Zone::GetCoords() const -{ - std::vector mesCoor; -// - switch (_Type) - { -// Rectangle ou parallelepipede - case 11: - { } - case 12: - { } - case 13: - { } - case 2: - { - mesCoor.push_back( _Xmin ) ; - mesCoor.push_back( _Xmax ) ; - mesCoor.push_back( _Ymin ) ; - mesCoor.push_back( _Ymax ) ; - mesCoor.push_back( _Zmin ) ; - mesCoor.push_back( _Zmax ) ; - break ; - } -// Sphere - case 4: - { - mesCoor.push_back( _Xcentre ) ; - mesCoor.push_back( _Ycentre ) ; - mesCoor.push_back( _Zcentre ) ; - mesCoor.push_back( _Rayon ) ; - break ; - } -// Disque ou cylindre - case 31: - { } - case 32: - { } - case 33: - { } - case 5: - { - mesCoor.push_back( _Xcentre ) ; - mesCoor.push_back( _Ycentre ) ; - mesCoor.push_back( _Zcentre ) ; - mesCoor.push_back( _Xaxe ) ; - mesCoor.push_back( _Yaxe ) ; - mesCoor.push_back( _Zaxe ) ; - mesCoor.push_back( _Rayon ) ; - mesCoor.push_back( _Haut ) ; - break ; - } -// Disque avec trou ou tuyau - case 61: - { } - case 62: - { } - case 63: - { } - case 7: - { - mesCoor.push_back( _Xcentre ) ; - mesCoor.push_back( _Ycentre ) ; - mesCoor.push_back( _Zcentre ) ; - mesCoor.push_back( _Xaxe ) ; - mesCoor.push_back( _Yaxe ) ; - mesCoor.push_back( _Zaxe ) ; - mesCoor.push_back( _Rayon ) ; - mesCoor.push_back( _Haut ) ; - mesCoor.push_back( _Rayonint ) ; - break ; - } - VERIFICATION ( ( (_Type>10) && (_Type<14) ) || (_Type==2) || ( (_Type>30) && (_Type<34) ) || (_Type==4) || (_Type==5) || ( (_Type>60) && (_Type<64) ) || (_Type==7) ) ; - } - return mesCoor; -} -//====================================================================== -void HOMARD_Zone::SetLimit( double X0, double X1, double X2 ) -{ - _Xincr = X0; _Yincr = X1; _Zincr = X2; -} -//======================================================================================= -std::vector HOMARD_Zone::GetLimit() const -{ - std::vector mesLimit; - mesLimit.push_back( _Xincr ) ; - mesLimit.push_back( _Yincr ) ; - mesLimit.push_back( _Zincr ) ; - return mesLimit; -} -//============================================================================= -//============================================================================= -// Liens avec les autres structures -//============================================================================= -//============================================================================= -void HOMARD_Zone::AddHypo( const char* NomHypo ) -{ - _ListHypo.push_back( std::string( NomHypo ) ) ; -} -//============================================================================= -const std::list& HOMARD_Zone::GetHypo() const -{ - return _ListHypo; -} -//============================================================================= -void HOMARD_Zone::SupprHypo( const char* NomHypo ) -{ - std::list::iterator it = find( _ListHypo.begin(), _ListHypo.end(), NomHypo ) ; - if ( it != _ListHypo.end() ) - { - MESSAGE ("Dans SupprHypo pour " << NomHypo) ; - it = _ListHypo.erase( it ) ; - } -} -//============================================================================= -void HOMARD_Zone::SupprHypos() -{ - _ListHypo.clear() ; -} diff --git a/src/ADAPT/HOMARD_Zone.hxx b/src/ADAPT/HOMARD_Zone.hxx deleted file mode 100644 index ace77905d..000000000 --- a/src/ADAPT/HOMARD_Zone.hxx +++ /dev/null @@ -1,95 +0,0 @@ -// HOMARD HOMARD : implementation of HOMARD idl descriptions -// -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : HOMARD_Zone.hxx -// Author : Gerald NICOLAS, EDF -// Module : HOMARD -// -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier - -#ifndef _HOMARD_Zone_HXX_ -#define _HOMARD_Zone_HXX_ - -#include "HOMARD.hxx" - -#include -#include -#include - -#if defined WIN32 -#pragma warning ( disable: 4251 ) -#endif - -class HOMARDIMPL_EXPORT HOMARD_Zone -{ -public: - HOMARD_Zone(); - ~HOMARD_Zone(); - -// Generalites - void SetName( const char* Name ); - std::string GetName() const; - - std::string GetDumpPython() const; - -// Caracteristiques - void SetType( int Type ); - int GetType() const; - - void SetBox( double X0, double X1, double X2, - double X3, double X4, double X5 ); - - void SetCylinder( double X0, double X1, double X2, double X3, - double X4, double X5, double X6, double X7 ); - - void SetPipe( double X0, double X1, double X2, double X3, - double X4, double X5, double X6, double X7, double X8 ); - - void SetSphere( double X0, double X1, double X2, double X3 ); - - std::vector GetCoords() const; - - void SetLimit( double X0, double X1, double X2 ); - std::vector GetLimit() const; - -// Liens avec les autres structures - void AddHypo( const char* NomHypo ); - const std::list& GetHypo() const; - void SupprHypo( const char* NomHypo ); - void SupprHypos(); - -private: - std::string _Name; - int _Type; - std::list _ListHypo; - double _Xmin, _Xmax, _Ymin, _Ymax, _Zmin, _Zmax; - double _Xcentre, _Ycentre, _Zcentre, _Rayon, _Rayonint; - double _Xaxe, _Yaxe, _Zaxe, _Haut; - double _Xincr, _Yincr, _Zincr; -}; - -#endif diff --git a/src/ADAPT/HomardDriver.cxx b/src/ADAPT/HomardDriver.cxx deleted file mode 100644 index f11b7a5e7..000000000 --- a/src/ADAPT/HomardDriver.cxx +++ /dev/null @@ -1,1106 +0,0 @@ -// HOMARD HOMARD : implementation of HOMARD idl descriptions -// -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// Pilote l'ecriture du fichier de configuration pour lancer l'execution de HOMARD - -#include -#ifndef WIN32 -#include -#endif -#include - -#include "HomardDriver.hxx" -#include "Utils_SALOME_Exception.hxx" -#include "utilities.h" - -//============================================================================= -//============================================================================= -HomardDriver::HomardDriver(const std::string siter, const std::string siterp1): - _HOMARD_Exec( "" ), _NomDir( "" ), _NomFichierConfBase( "HOMARD.Configuration" ), - _NomFichierConf( "" ), _NomFichierDonn( "" ), _siter( "" ), _siterp1( "" ), - _Texte( "" ), _bLu( false ) -{ - MESSAGE("siter = "< _HOMARD_Exec ="<<_HOMARD_Exec) ; -// - _siter = siter ; - _siterp1 = siterp1 ; -} -//============================================================================= -//============================================================================= -HomardDriver::~HomardDriver() -{ -} -//=============================================================================== -// A. Generalites -//=============================================================================== -void HomardDriver::TexteInit( const std::string DirCompute, const std::string LogFile, const std::string Langue ) -{ - MESSAGE("TexteInit, DirCompute ="<0 signifie que l'on raffinera les mailles contenues dans la zone, -// <0 signifie que l'on deraffinera -// - int ZoneTypeHOMARD ; - if ( ZoneType >= 11 && ZoneType <= 13 ) { ZoneTypeHOMARD = 1 ; } - else if ( ZoneType >= 31 && ZoneType <= 33 ) { ZoneTypeHOMARD = 3 ; } - else if ( ZoneType >= 61 && ZoneType <= 63 ) { ZoneTypeHOMARD = 6 ; } - else { ZoneTypeHOMARD = ZoneType ; } -// - if ( TypeUse < 0 ) { ZoneTypeHOMARD = -ZoneTypeHOMARD ; } -// - std::stringstream saux1 ; - saux1 << NumeZone ; - saux = "#\n# Zone numero " + saux1.str() + "\n" ; -// - { std::stringstream saux1 ; - saux1 << NumeZone << " " << ZoneTypeHOMARD ; - saux += "ZoRaType " + saux1.str() + "\n" ; - } -// -// Cas du rectangle -// - if ( ZoneType == 11 ) // Z est constant X Homard <=> X Salome -// Y Homard <=> Y Salome - { - saux += "#Rectangle\n" ; - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x0 ; - saux += "ZoRaXmin " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x1 ; - saux += "ZoRaXmax " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x2 ; - saux += "ZoRaYmin " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x3 ; - saux += "ZoRaYmax " + saux1.str() + "\n" ; - } - } -// - else if ( ZoneType == 12 ) // X est constant X Homard <=> Y Salome -// Y Homard <=> Z Salome - { - saux += "#Rectangle\n" ; - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x2 ; - saux += "ZoRaXmin " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x3 ; - saux += "ZoRaXmax " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x4 ; - saux += "ZoRaYmin " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x5 ; - saux += "ZoRaYmax " + saux1.str() + "\n" ; - } - } -// - else if ( ZoneType == 13 ) // Y est constant X Homard <=> X Salome -// Y Homard <=> Z Salome - { - saux += "#Rectangle\n" ; - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x0 ; - saux += "ZoRaXmin " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x1 ; - saux += "ZoRaXmax " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x4 ; - saux += "ZoRaYmin " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x5 ; - saux += "ZoRaYmax " + saux1.str() + "\n" ; - } - } -// -// Cas du parallelepipede -// - else if ( ZoneType == 2 ) - { - saux += "# Boite\n" ; - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x0 ; - saux += "ZoRaXmin " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x1 ; - saux += "ZoRaXmax " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x2 ; - saux += "ZoRaYmin " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x3 ; - saux += "ZoRaYmax " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x4 ; - saux += "ZoRaZmin " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x5 ; - saux += "ZoRaZmax " + saux1.str() + "\n" ; - } - } -// -// Cas du disque -// - else if ( ZoneType == 31 || ZoneType == 61 ) - { - saux += "# Sphere\n" ; - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x0 ; - saux += "ZoRaXCen " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x1 ; - saux += "ZoRaYCen " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x6 ; - saux2 = saux1.str() ; - if ( ZoneType == 61 ) { saux += "ZoRaRayE " + saux2 + "\n" ; } - else { saux += "ZoRaRayo " + saux2 + "\n" ; } - } - if ( ZoneType == 61 ) - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x8 ; - saux += "ZoRaRayI " + saux1.str() + "\n" ; - } - } - else if ( ZoneType == 32 || ZoneType == 62 ) - { - saux += "# Sphere\n" ; - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x1 ; - saux += "ZoRaXCen " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x2 ; - saux += "ZoRaYCen " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x6 ; - saux2 = saux1.str() ; - if ( ZoneType == 62 ) { saux += "ZoRaRayE " + saux2 + "\n" ; } - else { saux += "ZoRaRayo " + saux2 + "\n" ; } - } - if ( ZoneType == 62 ) - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x8 ; - saux += "ZoRaRayI " + saux1.str() + "\n" ; - } - } - else if ( ZoneType == 33 || ZoneType == 63 ) - { - saux += "# Sphere\n" ; - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x0 ; - saux += "ZoRaXCen " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x2 ; - saux += "ZoRaYCen " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x6 ; - saux2 = saux1.str() ; - if ( ZoneType == 63 ) { saux += "ZoRaRayE " + saux2 + "\n" ; } - else { saux += "ZoRaRayo " + saux2 + "\n" ; } - } - if ( ZoneType == 63 ) - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x8 ; - saux += "ZoRaRayI " + saux1.str() + "\n" ; - } - } -// -// Cas de la sphere -// - else if ( ZoneType == 4 ) - { - saux += "# Sphere\n" ; - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x0 ; - saux += "ZoRaXCen " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x1 ; - saux += "ZoRaYCen " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x2 ; - saux += "ZoRaZCen " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x3 ; - saux += "ZoRaRayo " + saux1.str() + "\n" ; - } - } -// -// Cas du cylindre ou du tuyau -// - else if ( ZoneType == 5 || ZoneType == 7 ) - { - if ( ZoneType == 5 ) { saux += "# Cylindre\n" ; } - else { saux += "# Tuyau\n" ; } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x0 ; - saux += "ZoRaXBas " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x1 ; - saux += "ZoRaYBas " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x2 ; - saux += "ZoRaZBas " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x3 ; - saux += "ZoRaXAxe " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x4 ; - saux += "ZoRaYAxe " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x5 ; - saux += "ZoRaZAxe " + saux1.str() + "\n" ; - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x6 ; - saux2 = saux1.str() ; - if ( ZoneType == 5 ) { saux += "ZoRaRayo " + saux2 + "\n" ; } - else { saux += "ZoRaRayE " + saux2 + "\n" ; } - } - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x7 ; - saux += "ZoRaHaut " + saux1.str() + "\n" ; - } - if ( ZoneType == 7 ) - { std::stringstream saux1 ; - saux1 << NumeZone << " " << x8 ; - saux += "ZoRaRayI " + saux1.str() + "\n" ; - } - } -// - _Texte += saux + "#\n" ; -// -// MESSAGE("A la fin de HomardDriver::TexteZone, _Texte ="<<_Texte); -} -//=============================================================================== -void HomardDriver::TexteField( const std::string FieldName, const std::string FieldFile, int TimeStep, int Rank, - int TypeThR, double ThreshR, int TypeThC, double ThreshC, - int UsField, int UsCmpI ) -{ - MESSAGE("TexteField, FieldName = "<= 0 ) - { - { - std::stringstream saux1 ; - saux1 << TimeStep ; - saux2 = saux1.str() ; - _Texte += "CCNumPTI " + saux2 + "\n" ; - } - if ( Rank >= 0 ) - { - std::stringstream saux1 ; - saux1 << Rank ; - saux2 = saux1.str() ; - _Texte += "CCNumOrI " + saux2 + "\n" ; - } - } -// - saux = " " ; - if ( TypeThR == 1 ) - { saux = "Hau" ; } - if ( TypeThR == 2 ) - { saux = "HRe" ; } - if ( TypeThR == 3 ) - { saux = "HPE" ; } - if ( TypeThR == 4 ) - { saux = "HMS" ; } - if ( saux != " " ) - { - std::stringstream saux1 ; - saux1 << ThreshR ; - _Texte += "Seuil" + saux + " " + saux1.str() + "\n" ; - } -// - saux = " " ; - if ( TypeThC == 1 ) - { saux = "Bas" ; } - if ( TypeThC == 2 ) - { saux = "BRe" ; } - if ( TypeThC == 3 ) - { saux = "BPE" ; } - if ( TypeThC == 4 ) - { saux = "BMS" ; } - if ( saux != " " ) - { - std::stringstream saux1 ; - saux1 << ThreshC ; - _Texte += "Seuil" + saux + " " + saux1.str() + "\n" ; - } -// - saux = " " ; - if ( UsField == 0 ) - { saux = "MAILLE" ; } - if ( UsField == 1 ) - { saux = "SAUT" ; } - if ( saux != " " ) - { - _Texte += "CCModeFI " + saux + "\n" ; - } -// - saux = " " ; - if ( UsCmpI == 0 ) - { saux = "L2" ; } - if ( UsCmpI == 1 ) - { saux = "INFINI" ; } - if ( UsCmpI == 2 ) - { saux = "RELATIF" ; } - if ( saux != " " ) - { - _Texte += "CCUsCmpI " + saux + "\n" ; - } -} -//=============================================================================== -void HomardDriver::TexteGroup( const std::string GroupName ) -{ - MESSAGE("TexteGroup, GroupName = "<0 si pas de precision) -// Rank : numero d'ordre retenu -// -void HomardDriver::TexteFieldInterpNameType( int NumeChamp, const std::string FieldName, const std::string TypeInterp, int TimeStep, int Rank) -{ - MESSAGE("TexteFieldInterpNameType, NumeChamp = "<= 0 ) - { - { - std::stringstream saux1 ; - saux1 << TimeStep ; - _Texte += "CCChaPdT " + saux + " " + saux1.str() + "\n" ; - } - { - std::stringstream saux1 ; - saux1 << Rank ; - _Texte += "CCChaNuO " + saux + " " + saux1.str() + "\n" ; - } - } -} -//=============================================================================== -// F. Les options avancees -//=============================================================================== -void HomardDriver::TexteAdvanced( int Pyram, int NivMax, double DiamMin, int AdapInit, int ExtraOutput ) -{ - MESSAGE("TexteAdvanced, Pyram ="< 0 ) - { - _Texte += "# Niveaux extremes\n" ; - { std::stringstream saux1 ; - saux1 << NivMax ; - _Texte += "NiveauMa " + saux1.str() + "\n" ; - } - } - if ( DiamMin > 0 ) - { - _Texte += "# Diametre minimal\n" ; - { std::stringstream saux1 ; - saux1 << DiamMin ; - _Texte += "DiametMi " + saux1.str() + "\n" ; - } - } - if ( AdapInit != 0 ) - { - if ( AdapInit > 0 ) - { _Texte += "# Raffinement" ; } - else - { _Texte += "# Deraffinement" ; } - _Texte += " des regions sans indicateur\n" ; - { std::stringstream saux1 ; - saux1 << AdapInit ; - _Texte += "AdapInit " + saux1.str() + "\n" ; - } - } - if ( ExtraOutput % 2 == 0 ) - { - _Texte += "# Sortie des niveaux de raffinement\n" ; - _Texte += "NCNiveau NIVEAU\n" ; - } - if ( ExtraOutput % 3 == 0 ) - { - _Texte += "# Sortie des qualités des mailles\n" ; - _Texte += "NCQualit QUAL\n" ; - } - if ( ExtraOutput % 5 == 0 ) - { - _Texte += "# Sortie des diamètres des mailles\n" ; - _Texte += "NCDiamet DIAM\n" ; - } - if ( ExtraOutput % 7 == 0 ) - { - _Texte += "# Sortie des parents des mailles\n" ; - _Texte += "NCParent PARENT\n" ; - } - if ( ExtraOutput % 11 == 0 ) - { - _Texte += "# Volumes voisins par recollement\n" ; - _Texte += "NCVoisRc Voisin-Recollement\n" ; - } -} -//=============================================================================== -// G. Les messages -//=============================================================================== -void HomardDriver::TexteInfoCompute( int MessInfo ) -{ - MESSAGE("TexteAdvanced, MessInfo ="< -#include - -class HOMARDIMPL_EXPORT HomardDriver -{ -public: - HomardDriver(const std::string siter, const std::string siterp1); - ~HomardDriver(); - // - void TexteInit( const std::string DirCompute, const std::string LogFile, const std::string Langue ); - void TexteInfo( int TypeBila, int NumeIter ); - void TexteMajCoords( int NumeIter ); - void CreeFichierDonn(); - void TexteAdap( int ExtType ); - void CreeFichier(); - void TexteMaillage( const std::string NomMesh, const std::string MeshFile, int apres ); - void TexteMaillageHOMARD( const std::string Dir, const std::string liter, int apres ); - void TexteConfRaffDera( int ConfType, int TypeAdap, int TypeRaff, int TypeDera ); - void TexteZone( int NumeZone, int ZoneType, int TypeUse, double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8 ); - void TexteGroup( const std::string GroupName ); - void TexteField( const std::string FieldName, const std::string FieldFile, - int TimeStep, int Rank, - int TypeThR, double ThreshR, int TypeThC, double ThreshC, - int UsField, int UsCmpI ); - void TexteCompo( int NumeComp, const std::string NomCompo); - - void TexteBoundaryOption( int BoundaryOption ); - void TexteBoundaryCAOGr( const std::string GroupName ); - void TexteBoundaryDi( const std::string MeshName, const std::string MeshFile ); - void TexteBoundaryDiGr( const std::string GroupName ); - void TexteBoundaryAn( const std::string NameBoundary, int NumeBoundary, int BoundaryType, double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7 ); - void TexteBoundaryAnGr( const std::string NameBoundary, int NumeBoundary, const std::string GroupName ); - - void TexteFieldInterp( const std::string FieldFile, const std::string MeshFile ); - void TexteFieldInterpAll(); - void TexteFieldInterpNameType( int NumeChamp, const std::string FieldName, const std::string TypeInterp, int TimeStep, int Rank ); - void TexteAdvanced( int Pyram, int NivMax, double DiamMin, int AdapInit, int LevelOutput ); - void TexteInfoCompute( int MessInfo ); - // - int ExecuteHomard(int option); - // - -public: - int _modeHOMARD; - std::string _HOMARD_Exec; - std::string _NomDir; - std::string _NomFichierConfBase; - std::string _NomFichierConf; - std::string _NomFichierDonn; - std::string _siter; - std::string _siterp1; - std::string _Texte; - int _TimeStep; - int _Rank; - bool _bLu; - -}; - -# endif /* # ifndef _HOMARDDRIVER_HXX_ */ diff --git a/src/ADAPT/YACSDriver.cxx b/src/ADAPT/YACSDriver.cxx deleted file mode 100644 index 864803db8..000000000 --- a/src/ADAPT/YACSDriver.cxx +++ /dev/null @@ -1,684 +0,0 @@ -// HOMARD HOMARD : implementation of HOMARD idl descriptions -// -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// Pilote l'ecriture du fichier xml pour lancer un schema YACS - -#include -#ifndef WIN32 -#include -#endif -#include - -#include "YACSDriver.hxx" -#include "HOMARD.hxx" -#include "Utils_SALOME_Exception.hxx" -#include "utilities.h" - -//============================================================================= -//============================================================================= -YACSDriver::YACSDriver(const std::string XMLFile, const std::string DirName, const std::string LangueShort): - _XMLFile( "" ), _DirName( "" ), - _Texte( "" ), - _Texte_parametres( "" ), - _noeud_1( "CreateCase" ), - _LangueShort( "" ), - _bLu( false ) -{ - MESSAGE("XMLFile = "<" ; - _Texte += Meshfile ; - _Texte += "\n" ; -// -} -//=============================================================================== -// Le repertoire de calcul -// Le script de lancement -//=============================================================================== -void YACSDriver::Texte_Alternance_Calcul_HOMARD_Calcul( const std::string FileName ) -{ - MESSAGE("Texte_Alternance_Calcul_HOMARD_Calcul, FileName : "<\n" ; - INFOS("_LangueShort = "<<_LangueShort ); - if ( _LangueShort == "fr" ) { motcle = "Etude_Initialisation" ; } - else { motcle = "Study_Initialisation" ; } - INFOS("motcle = "<\n" ; - _Texte += " " + methode + "\n" ; -// 4. Les inports -// 4.1. Le nom de la zone - _Texte += Texte_inport( "string", "ZoneName" ) ; - TexteParametre( node, "ZoneName", "string", ZoneName ) ; -// 4.2. Les valeurs numeriques -// ATTENTION : les noms doivent etre les memes que dans Gen.xml, donc ADAPT_Gen.idl -// 4.2.1. Decodage des valeurs -// La chaine pythonStructure est de ce genre : -// CreateZoneBox( "Zone_1", 0.144, 0.216, 0.096, 0.1464, 0.076, 0.12) - std::string ligne = pythonStructure ; -// On commence par ne garder que ce qui suit la premiere virgule - ligne = GetStringInTexte( ligne, ",", 1 ); -// On boucle pour isoler toutes les chaines dans les virgules - std::string lignebis ; - std::string x0, x1, x2, x3, x4, x5, x6, x7, x8 ; - int iaux = 0 ; - while ( ligne != lignebis ) - { - lignebis = GetStringInTexte ( ligne, ",", 0 ) ; -// MESSAGE("lignebis = "< 10 ) && ( ZoneType < 14 ) ) - { - _Texte += Texte_inport( "double", "Umini" ) ; - _Texte += Texte_inport( "double", "Umaxi" ) ; - _Texte += Texte_inport( "double", "Vmini" ) ; - _Texte += Texte_inport( "double", "Vmaxi" ) ; - _Texte += Texte_inport( "long", "Orient" ) ; - TexteParametre( node, "Umini", "double", x0 ) ; - TexteParametre( node, "Umaxi", "double", x1 ) ; - TexteParametre( node, "Vmini", "double", x2 ) ; - TexteParametre( node, "Vmaxi", "double", x3 ) ; - TexteParametre( node, "Orient", "int", x8 ) ; - } -// -// 4.2.4. Cas du disque (31, 32, 33) ou du disque perce (61, 62, 63) - else if ( ( ( ZoneType > 30 ) && ( ZoneType < 34 ) ) || ( ( ZoneType > 60 ) && ( ZoneType < 64 ) ) ) - { - _Texte += Texte_inport( "double", "Ucentre" ) ; - _Texte += Texte_inport( "double", "Vcentre" ) ; - _Texte += Texte_inport( "double", "Radius" ) ; - TexteParametre( node, "Ucentre", "double", x0 ) ; - TexteParametre( node, "Vcentre", "double", x1 ) ; - TexteParametre( node, "Radius", "double", x2 ) ; - if ( ZoneType > 60 ) - { - _Texte += Texte_inport( "double", "InternalRadius" ) ; - TexteParametre( node, "InternalRadius", "double", x3 ) ; - } - _Texte += Texte_inport( "long", "Orient" ) ; - TexteParametre( node, "Orient", "int", x8 ) ; - } -// -// 4.2.5. Cas de la sphere (4) - else if ( ZoneType == 4 ) - { - _Texte += Texte_inport( "double", "Xcentre" ) ; - _Texte += Texte_inport( "double", "Ycentre" ) ; - _Texte += Texte_inport( "double", "Zcentre" ) ; - _Texte += Texte_inport( "double", "Radius" ) ; - TexteParametre( node, "Xcentre", "double", x0 ) ; - TexteParametre( node, "Ycentre", "double", x1 ) ; - TexteParametre( node, "Zcentre", "double", x2 ) ; - TexteParametre( node, "Radius", "double", x8 ) ; - } -// -// 4.2.6. Cas du cylindre (5) ou du tuyau (7) - else if ( ZoneType == 5 || ZoneType == 7 ) - { - _Texte += Texte_inport( "double", "Xcentre" ) ; - _Texte += Texte_inport( "double", "Ycentre" ) ; - _Texte += Texte_inport( "double", "Zcentre" ) ; - _Texte += Texte_inport( "double", "Xaxis" ) ; - _Texte += Texte_inport( "double", "Yaxis" ) ; - _Texte += Texte_inport( "double", "Zaxis" ) ; - _Texte += Texte_inport( "double", "Radius" ) ; - _Texte += Texte_inport( "double", "Height" ) ; - TexteParametre( node, "Xcentre", "double", x0 ) ; - TexteParametre( node, "Ycentre", "double", x1 ) ; - TexteParametre( node, "Zcentre", "double", x2 ) ; - TexteParametre( node, "Xaxis", "double", x3 ) ; - TexteParametre( node, "Yaxis", "double", x4 ) ; - TexteParametre( node, "Zaxis", "double", x5 ) ; - TexteParametre( node, "Radius", "double", x6 ) ; - if ( ZoneType == 5 ) - { - TexteParametre( node, "Height", "double", x8 ) ; - } - else - { - _Texte += Texte_inport( "double", "InternalRadius" ) ; - TexteParametre( node, "Height", "double", x7 ) ; - TexteParametre( node, "InternalRadius", "double", x8 ) ; - } - } -// -// 4.2.7. Erreur - else - { VERIFICATION("Type de zone inconnu." == 0); } - -// -// 5. La fin - _Texte += " \n" ; - _Texte += " \n" ; -// - return texte_control ; -// -} -//=============================================================================== -// La description des frontieres -// BoundaryType : le type de la frontiere -// pythonStructure : le python correspondant a la frontiere -// methode : methode associee a la creation de la frontiere -// BoundaryName : nom de la frontiere -// MeshName : nom du maillage dans le cas d'une frontiere discrete -// MeshFile : nom du fichier du maillage dans le cas d'une frontiere discrete -//=============================================================================== -std::string YACSDriver::Texte_Iter_1_Boundary( int BoundaryType, const std::string pythonStructure, const std::string methode, const std::string BoundaryName, const std::string MeshName, const std::string MeshFile ) -{ - MESSAGE("Texte_Iter_1_Boundary, BoundaryType = "<\n" ; - if ( _LangueShort == "fr" ) { motcle = "Etude_Initialisation" ; } - else { motcle = "Study_Initialisation" ; } - _Texte += " " + motcle + ".UpdateStudy\n" ; - _Texte += " " + methode + "\n" ; -// 4. Les inports -// ATTENTION : les noms doivent etre les memes que dans Gen.xml, donc ADAPT_Gen.idl -// 4.1. Le nom de la frontiere - _Texte += Texte_inport( "string", "BoundaryName" ) ; - TexteParametre( node, "BoundaryName", "string", BoundaryName ) ; -// 4.2. Cas d une frontiere discrete - if (BoundaryType == 0) - { - _Texte += Texte_inport( "string", "MeshName" ) ; - TexteParametre( node, "MeshName", "string", MeshName ) ; - _Texte += Texte_inport( "string", "FileName" ) ; - TexteParametre( node, "FileName", "string", MeshFile ) ; - } -// 4.3. Cas d'une frontiere analytique : les valeurs numeriques - else - { -// 4.3.1. Decodage des valeurs -// La chaine pythonStructure est de ce genre : -// CreateBoundaryCylinder('cyl_2', 17.5, -2.5, -12.5, -100., -75., -25., 50.) -// CreateBoundaryDi("intersection", "PIQUAGE", "/scratch/D68518/Salome/script/sfr_2d_piquage.fr.med") - std::string ligne = pythonStructure ; -// On commence par ne garder que ce qui suit la premiere virgule - ligne = GetStringInTexte( ligne, ",", 1 ); -// On boucle pour isoler toutes les chaines dans les virgules - std::string lignebis ; - std::string x0, x1, x2, x3, x4, x5, x6, x7 ; - int iaux = 0 ; - while ( ligne != lignebis ) - { - lignebis = GetStringInTexte ( ligne, ",", 0 ) ; -// MESSAGE("lignebis = "<\n" ; - _Texte += " \n" ; -// - return texte_control ; -// -} -//=============================================================================== -// Fin du controle des enchainements de noeud dans le noeud Iter_1 -//=============================================================================== - std::string YACSDriver::Texte_Iter_1_control() -{ - MESSAGE("Texte_Iter_1_control"); -// - std::string texte ; - texte = Texte_control (_noeud_1, "CreateHypothesis", 1) ; - texte += Texte_control ("CreateHypothesis", "Case_Options", 0) ; -// - return texte ; -// -} -//=============================================================================== -// Controle des enchainements de noeuds -// noeud_1 : noeud de depart -// noeud_2 : noeud d'arrivee -// option : 0 : sans caractere de saut de ligne a la fin -// 1 : avec caractere de saut de ligne a la fin -//=============================================================================== - std::string YACSDriver::Texte_control( const std::string noeud_1, const std::string noeud_2, int option ) -{ - MESSAGE("Texte_control, noeud_1 = "< " ; - texte += "" + noeud_1 + "" ; - texte += " " + noeud_2 + "" ; - texte += " " ; - if ( option == 1 ) { texte += "\n" ; } - - return texte ; -// -} -//=============================================================================== -// Inport -// inport_type : type de la donnee a importer -// inport_nom : nom de la donnee a importer -//=============================================================================== - std::string YACSDriver::Texte_inport( const std::string inport_type, const std::string inport_nom ) -{ -// MESSAGE("Texte_inport, inport_type = "< indice ) - { - int position = ligne.find_first_of( "." ) ; - MESSAGE("\nposition : "<< position); - if ( position > 0 ) - { - ligne_bis = ligne.substr( position ); - MESSAGE("\nligne_bis : "<< ligne_bis); - _Texte += concept + ligne_bis + "\n" ; - } - } - cptr += 1 ; - } -// -} -//=============================================================================== -// Manipulation des instructions python - 2 -// pythonTexte : le texte des instructions python a manipuler -// mot_cle : mot-cle dans les lignes a inserer -// concept : nom du concept a inserer -//=============================================================================== -void YACSDriver::Texte_python_2( const std::string pythonTexte, const std::string mot_cle, const std::string concept ) -{ - MESSAGE("Texte_python_2, pythonTexte\n"< 0 ) - { - int position = ligne.find_first_of( "." ) ; -// MESSAGE("\nposition : "<< position); - if ( position > 0 ) - { - ligne_bis = ligne.substr( position ); -// MESSAGE("\nligne_bis : "<< ligne_bis); - _Texte += concept + ligne_bis + "\n" ; - } - } - } -// -} -//=============================================================================== -// Parametres de tests de convergence -//=============================================================================== -void YACSDriver::TexteAnalyse_Test_Convergence( int MaxIter, int MaxNode, int MaxElem ) -{ -// -// MESSAGE("TexteAnalyse_Test_Convergence"); - std::string chaine ; - std::ostringstream oss1; - oss1 << MaxIter; - chaine = oss1.str(); - _Texte += "MaxIter = " + chaine + "\n" ; - std::ostringstream oss2; - oss2 << MaxNode; - chaine = oss2.str(); - _Texte += "MaxNode = " + chaine + "\n" ; - std::ostringstream oss3; - oss3 << MaxElem; - chaine = oss3.str(); - _Texte += "MaxElem = " + chaine + "\n" ; -// -} -//=============================================================================== -// Creation d'un parametre -//=============================================================================== -void YACSDriver::TexteParametre( const std::string node, const std::string port, const std::string type_value, const std::string value ) -{ -// -// MESSAGE("TexteParametre"); - _Texte_parametres += " \n" ; - _Texte_parametres += " " + node + "" ; - _Texte_parametres += "" + port + "\n" ; - _Texte_parametres += " <" + type_value + ">" + value + "\n" ; - _Texte_parametres += " \n" ; -// -} -//=============================================================================== -// Ajout des parametres -//=============================================================================== -void YACSDriver::TexteAddParametres( ) -{ -// - MESSAGE("TexteAddParametres"); - TexteAdd(_Texte_parametres) ; -// -} -//=============================================================================== -void YACSDriver::CreeFichier( ) -{ -// - MESSAGE("CreeFichier sur le fichier "<<_XMLFile); - std::ofstream Fic(_XMLFile.c_str(), std::ios::out ) ; - if (Fic.is_open() == true) { Fic << _Texte << std::endl ; } - Fic.close() ; -// -} -//=============================================================================== -// REMARQUE : on devrait utiliser le GetStringInTexte de ADAPT_Gen_i mais je ne sais pas -// comment l'appeler. ALors je clone. -// Recuperation de la chaine de caracteres par rapport l'apparition d'un texte -// ligne : la ligne a manipuler -// texte : le texte a reperer -// option : 0 : la chaine avant le texte -// 1 : la chaine apres le texte -// Si le texte est absent, on retourne la chaine totale -//=============================================================================== -std::string YACSDriver::GetStringInTexte( const std::string ligne, const std::string texte, int option ) -{ -// MESSAGE("GetStringInTexte, recherche de '"< -#include - -class HOMARDIMPL_EXPORT YACSDriver -{ -public: - YACSDriver(const std::string XMLFile, const std::string DirName, const std::string LangueShort) ; - ~YACSDriver() ; - // - void TexteAdd( const std::string ligne ) ; - void Texte_DataInit_MeshFile( const std::string Meshfile ) ; - void Texte_Alternance_Calcul_HOMARD_Calcul( const std::string FileName ) ; - void Texte_Iter_1_Case_Options( const std::string pythonCas ) ; - std::string Texte_Iter_1_Boundary( int BoundaryType, const std::string pythonStructure, const std::string methode, const std::string BoundaryName, const std::string MeshName, const std::string MeshFile ) ; - std::string Texte_Iter_1_Zone( int ZoneType, const std::string pythonStructure, const std::string methode, const std::string ZoneName ) ; - std::string Texte_Iter_1_control() ; - std::string Texte_control( const std::string noeud_1, const std::string noeud_2, int option ) ; - std::string Texte_inport( const std::string inport_type, const std::string inport_nom ) ; - void Texte_HOMARD_Exec_DirName( ) ; - void Texte_HOMARD_Exec_MeshName( const std::string MeshName ) ; - void Texte_python_1( const std::string pythonTexte, int indice, const std::string concept ) ; - void Texte_python_2( const std::string pythonTexte, const std::string mot_cle, const std::string concept ) ; - void TexteParametre( const std::string node, const std::string port, const std::string type_value, const std::string value ) ; - void TexteAnalyse_Test_Convergence( int MaxIter, int MaxNode, int MaxElem ) ; - void TexteAddParametres( ) ; - void CreeFichier() ; - // - -public: - std::string _XMLFile ; - std::string _DirName ; - std::string _Texte ; - std::string _Texte_parametres ; - std::string _noeud_1 ; - std::string _LangueShort ; - bool _bLu; - -private : - std::string GetStringInTexte( const std::string Texte, const std::string String, int option ) ; -}; - -# endif /* # ifndef __YACSDRIVER_H__ */ diff --git a/src/ADAPTFrontTrack/CMakeLists.txt b/src/ADAPTFrontTrack/CMakeLists.txt deleted file mode 100644 index b19d068e7..000000000 --- a/src/ADAPTFrontTrack/CMakeLists.txt +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright (C) 2017-2020 CEA/DEN, EDF R&D -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# --- options --- -# additional include directories -INCLUDE_DIRECTORIES( - ${OpenCASCADE_INCLUDE_DIR} - ${GEOM_INCLUDE_DIRS} - ${MEDFILE_INCLUDE_DIRS} - ${MEDCOUPLING_INCLUDE_DIRS} - ${TBB_INCLUDE_DIRS} -) - -# additional preprocessor / compiler flags -ADD_DEFINITIONS( - ${OpenCASCADE_DEFINITIONS} -) - -IF(ADAPTFRONTTRACK_USE_TBB) - SET(TBB_LIBS ${TBB_LIBRARIES}) -ENDIF(ADAPTFRONTTRACK_USE_TBB) - -# libraries to link to -SET(_link_LIBRARIES - ${OpenCASCADE_FoundationClasses_LIBRARIES} - ${OpenCASCADE_ModelingAlgorithms_LIBRARIES} - ${OpenCASCADE_ModelingData_LIBRARIES} - ${GEOM_XAO} - ${MEDCoupling_medloader} - ${TBB_LIBS} -) - -# --- headers --- - -# header files -SET(ADAPTFRONTTRACK_HEADERS - FrontTrack.hxx -) - -# --- sources --- - -# sources / static -SET(ADAPTFRONTTRACK_SOURCES - FrontTrack.cxx - FrontTrack_NodeGroups.cxx - FrontTrack_NodesOnGeom.cxx - FrontTrack_Projector.cxx - FrontTrack_Utils.cxx -) - -# --- rules --- - -ADD_LIBRARY(ADAPTFrontTrack ${ADAPTFRONTTRACK_SOURCES}) -TARGET_LINK_LIBRARIES(ADAPTFrontTrack ${_link_LIBRARIES} ) -INSTALL(TARGETS ADAPTFrontTrack EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) - -INSTALL(FILES ${ADAPTFRONTTRACK_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) diff --git a/src/ADAPTFrontTrack/FrontTrack.cxx b/src/ADAPTFrontTrack/FrontTrack.cxx deleted file mode 100644 index 91eb4b606..000000000 --- a/src/ADAPTFrontTrack/FrontTrack.cxx +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (C) 2017-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : FrontTrack.cxx -// Created : Tue Apr 25 17:20:28 2017 -// Author : Edward AGAPOV (eap) - -#include "FrontTrack.hxx" -#include "FrontTrack_NodeGroups.hxx" -#include "FrontTrack_Utils.hxx" - -#include -#include -#include - -#include -#include - -#include - -#include - -/*! - * \brief Relocate nodes to lie on geometry - * \param [in] theInputMedFile - a MED file holding a mesh including nodes that will be - * moved onto the geometry - * \param [in] theOutputMedFile - a MED file to create, that will hold a modified mesh - * \param [in] theInputNodeFiles - an array of names of files describing groups of nodes that - * will be moved onto the geometry - * \param [in] theXaoFileName - a path to a file in XAO format holding the geometry and - * the geometrical groups. - * \param [in] theIsParallel - if \c true, all processors are used to treat boundary shapes - * in parallel. - */ -void FrontTrack::track( const std::string& theInputMedFile, - const std::string& theOutputMedFile, - const std::vector< std::string > & theInputNodeFiles, - const std::string& theXaoFileName, - bool theIsParallel ) -{ - // check arguments -#ifdef _DEBUG_ - std::cout << "FrontTrack::track" << std::endl; -#endif - - if ( theInputNodeFiles.empty() ) - return; - -#ifdef _DEBUG_ - std::cout << "Input MED file: " << theInputMedFile << std::endl; -#endif - if ( !FT_Utils::fileExists( theInputMedFile )) - throw std::invalid_argument( "Input MED file does not exist: " + theInputMedFile ); - -#ifdef _DEBUG_ - std::cout << "Output MED file: " << theOutputMedFile << std::endl; -#endif - if ( !FT_Utils::canWrite( theOutputMedFile )) - throw std::invalid_argument( "Can't create the output MED file: " + theOutputMedFile ); - - std::vector< std::string > theNodeFiles ; - for ( size_t i = 0; i < theInputNodeFiles.size(); ++i ) - { -#ifdef _DEBUG_ - std::cout << "Initial input node file #"<1 - // keep only files with more than 1 line: - std::ifstream fichier(theInputNodeFiles[i].c_str()); - std::string s; - unsigned int nb_lines = 0; - while(std::getline(fichier,s)) ++nb_lines; -// std::cout << ". nb_lines: " << nb_lines << std::endl; - if ( nb_lines >= 2 ) { theNodeFiles.push_back( theInputNodeFiles[i] ); } - } -#ifdef _DEBUG_ - for ( size_t i = 0; i < theNodeFiles.size(); ++i ) - { std::cout << "Valid input node file #"< - mfMesh( MEDCoupling::MEDFileUMesh::New( theInputMedFile )); - if ( mfMesh.isNull() ) - throw std::invalid_argument( "Failed to read the input MED file: " + theInputMedFile ); - - MEDCoupling::DataArrayDouble * nodeCoords = mfMesh->getCoords(); - if ( !nodeCoords || nodeCoords->empty() ) - throw std::invalid_argument( "No nodes in the input mesh" ); - - - // read a geometry - -#ifdef _DEBUG_ - std::cout << "Lecture de la geometrie" << std::endl; -#endif - XAO::Xao xao; - if ( !xao.importXAO( theXaoFileName ) || !xao.getGeometry() ) - throw std::invalid_argument( "Failed to read the XAO input file: " + theXaoFileName ); - -#ifdef _DEBUG_ - std::cout << "Conversion en BREP" << std::endl; -#endif - XAO::BrepGeometry* xaoGeom = dynamic_cast( xao.getGeometry() ); - if ( !xaoGeom || xaoGeom->getTopoDS_Shape().IsNull() ) - throw std::invalid_argument( "Failed to get a BREP shape from the XAO input file" ); - - - // read groups of nodes and associate them with boundary shapes using names (no projection so far) - -#ifdef _DEBUG_ - std::cout << "Lecture des groupes" << std::endl; -#endif - FT_NodeGroups nodeGroups; - nodeGroups.read( theNodeFiles, &xao, nodeCoords ); -#ifdef _DEBUG_ - std::cout << "Nombre de groupes : " << nodeGroups.nbOfGroups() << std::endl; -#endif - - // project nodes to the boundary shapes and change their coordinates - -#ifdef _DEBUG_ - std::cout << "Projection des noeuds, theIsParallel=" << theIsParallel << std::endl; -#endif - OSD_Parallel::For( 0, nodeGroups.nbOfGroups(), nodeGroups, !theIsParallel ); - - // save the modified mesh - -#ifdef _DEBUG_ - std::cout << "Ecriture du maillage" << std::endl; -#endif - const int erase = 2; - mfMesh->write( theOutputMedFile, /*mode=*/erase ); - - if ( !nodeGroups.isOK() ) - throw std::runtime_error("Unable to project some nodes"); -} diff --git a/src/ADAPTFrontTrack/FrontTrack.hxx b/src/ADAPTFrontTrack/FrontTrack.hxx deleted file mode 100644 index fa033161c..000000000 --- a/src/ADAPTFrontTrack/FrontTrack.hxx +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (C) 2017-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : FrontTrack.hxx -// Created : Tue Apr 25 17:08:52 2017 -// Author : Edward AGAPOV (eap) - - -#ifndef __FrontTrack_HXX__ -#define __FrontTrack_HXX__ - -#include -#include - -class FrontTrack -{ -public: - - /*! - * \brief Relocate nodes to lie on geometry - * \param [in] theInputMedFile - a MED file holding a mesh including nodes that will be - * moved onto the geometry - * \param [in] theOutputMedFile - a MED file to create, that will hold a modified mesh - * \param [in] theInputNodeFiles - an array of names of files describing groups of nodes that - * will be moved onto the geometry - * \param [in] theXaoFileName - a path to a file in XAO format holding the geometry and - * the geometrical groups. - * \param [in] theIsParallel - if \c true, all processors are used to treat boundary shapes - * in parallel. - */ - void track( const std::string& theInputMedFile, - const std::string& theOutputMedFile, - const std::vector< std::string > & theInputNodeFiles, - const std::string& theXaoFileName, - bool theIsParallel=true); - -}; - -#endif diff --git a/src/ADAPTFrontTrack/FrontTrack_NodeGroups.cxx b/src/ADAPTFrontTrack/FrontTrack_NodeGroups.cxx deleted file mode 100644 index 247def290..000000000 --- a/src/ADAPTFrontTrack/FrontTrack_NodeGroups.cxx +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (C) 2017-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : FrontTrack_NodeGroups.cxx -// Created : Tue Apr 25 19:17:47 2017 -// Author : Edward AGAPOV (eap) - -#include "FrontTrack_NodeGroups.hxx" -#include "FrontTrack_Projector.hxx" -#include "FrontTrack_Utils.hxx" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -namespace -{ - //================================================================================ - /*! - * \brief Initialize FT_Projector's with all sub-shapes of given type - * \param [in] theMainShape - the shape to explore - * \param [in] theSubType - the type of sub-shapes - * \param [out] theProjectors - the projectors - */ - //================================================================================ - - void getProjectors( const TopoDS_Shape& theMainShape, - const TopAbs_ShapeEnum theSubType, - std::vector< FT_Projector > & theProjectors ) - { - TopTools_IndexedMapOfShape subShapes; - TopExp::MapShapes( theMainShape, theSubType, subShapes ); -#ifdef _DEBUG_ - std::cout << ". Nombre de subShapes : " << subShapes.Size() << std::endl; -#endif - - theProjectors.resize( subShapes.Size() ); - for ( int i = 1; i <= subShapes.Size(); ++i ) - theProjectors[ i-1 ].setBoundaryShape( subShapes( i )); - } -} - -//================================================================================ -/*! - * \brief Load node groups from files - * \param [in] theNodeFiles - an array of names of files describing groups of nodes that - * will be moved onto geometry - * \param [in] theXaoGeom - the whole geometry to project on - * \param [inout] theNodeCoords - array of node coordinates - */ -//================================================================================ - -void FT_NodeGroups::read( const std::vector< std::string >& theNodeFiles, - const XAO::Xao* theXao, - MEDCoupling::DataArrayDouble* theNodeCoords ) -{ - // get projectors for all boundary sub-shapes; - // index of a projector in the vector corresponds to a XAO index of a sub-shape - XAO::BrepGeometry* xaoGeom = dynamic_cast( theXao->getGeometry() ); - getProjectors( xaoGeom->getTopoDS_Shape(), TopAbs_EDGE, _projectors[0] ); - getProjectors( xaoGeom->getTopoDS_Shape(), TopAbs_FACE, _projectors[1] ); - - _nodesOnGeom.resize( theNodeFiles.size() ); - - // read node IDs and look for projectors to boundary sub-shapes by group name - FT_Utils::XaoGroups xaoGroups( theXao ); - for ( size_t i = 0; i < theNodeFiles.size(); ++i ) - { - _nodesOnGeom[i].read( theNodeFiles[i], xaoGroups, theNodeCoords, _projectors ); - } -} - -//================================================================================ -/*! - * \brief Project and move nodes of a given group of nodes - */ -//================================================================================ - -void FT_NodeGroups::projectAndMove( const int groupIndex ) -{ - _nodesOnGeom[ groupIndex ].projectAndMove(); -} - -//================================================================================ -/*! - * \brief Return true if all nodes were successfully relocated - */ -//================================================================================ - -bool FT_NodeGroups::isOK() const -{ - for ( size_t i = 0; i < _nodesOnGeom.size(); ++i ) - if ( ! _nodesOnGeom[ i ].isOK() ) - return false; - - return true; -} - -//================================================================================ -/*! - * \brief Print some statistics on node groups - */ -//================================================================================ - -void FT_NodeGroups::dumpStat() const -{ - for ( size_t i = 0; i < _nodesOnGeom.size(); ++i ) - { - std::cout << _nodesOnGeom[i].getShapeDim() << "D " - << _nodesOnGeom[i].nbNodes() << " nodes" << std::endl; - } -} diff --git a/src/ADAPTFrontTrack/FrontTrack_NodeGroups.hxx b/src/ADAPTFrontTrack/FrontTrack_NodeGroups.hxx deleted file mode 100644 index 9204ac8af..000000000 --- a/src/ADAPTFrontTrack/FrontTrack_NodeGroups.hxx +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (C) 2017-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : FrontTrack_NodeGroups.hxx -// Created : Tue Apr 25 19:02:49 2017 -// Author : Edward AGAPOV (eap) - -#ifndef __FrontTrack_NodeGroups_HXX__ -#define __FrontTrack_NodeGroups_HXX__ - -#include "FrontTrack_NodesOnGeom.hxx" -#include "FrontTrack_Projector.hxx" - -#include -#include - -namespace MEDCoupling { - class DataArrayDouble; -} -namespace XAO { - class Xao; -} - -/*! - * \brief Container of node groups. - */ -class FT_NodeGroups -{ -public: - - // Load node groups from files - void read( const std::vector< std::string >& nodeFiles, - const XAO::Xao* xaoGeom, - MEDCoupling::DataArrayDouble* nodeCoords ); - - // return number of groups of nodes to move - int nbOfGroups() const { return _nodesOnGeom.size(); } - - // Move nodes of a group in parallel mode - void operator() ( const int groupIndex ) const - { - const_cast< FT_NodeGroups* >( this )->projectAndMove( groupIndex ); - } - - // Project and move nodes of a given group of nodes - void projectAndMove( const int groupIndex ); - - // return true if all nodes were successfully relocated - bool isOK() const; - - // print some statistics on node groups - void dumpStat() const; - -private: - - std::vector< FT_NodesOnGeom > _nodesOnGeom; - std::vector< FT_Projector > _projectors[2]; // curves and surfaces separately - -}; - -#endif diff --git a/src/ADAPTFrontTrack/FrontTrack_NodesOnGeom.cxx b/src/ADAPTFrontTrack/FrontTrack_NodesOnGeom.cxx deleted file mode 100644 index 16422348e..000000000 --- a/src/ADAPTFrontTrack/FrontTrack_NodesOnGeom.cxx +++ /dev/null @@ -1,511 +0,0 @@ -// Copyright (C) 2017-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : FrontTrack_NodesOnGeom.cxx -// Created : Tue Apr 25 20:48:23 2017 -// Author : Edward AGAPOV (eap) - -#include "FrontTrack_NodesOnGeom.hxx" -#include "FrontTrack_Utils.hxx" - -#include - -#include -#include -#include -#include - -namespace -{ - /*! - * \brief Close a file at destruction - */ - struct FileCloser - { - FILE * _file; - - FileCloser( FILE * file ): _file( file ) {} - ~FileCloser() { if ( _file ) ::fclose( _file ); } - }; -} - -//================================================================================ -/*! - * \brief Read node ids from a file and find shapes for projection - * \param [in] theNodeFile - a name of file holding IDs of nodes that - * will be moved onto geometry - * \param [in] theXaoGroups - a tool returning FT_Projector's by XAO group name - * \param [inout] theNodeCoords - array of node coordinates - * \param [in] theAllProjectorsByDim - all projectors of 2 dimensions, ordered so that - * a vector index corresponds to a XAO sub-shape ID - */ -//================================================================================ - -void FT_NodesOnGeom::read( const std::string& theNodeFile, - const FT_Utils::XaoGroups& theXaoGroups, - MEDCoupling::DataArrayDouble* theNodeCoords, - std::vector< FT_Projector > * theAllProjectorsByDim ) -{ - _nodeCoords = theNodeCoords; - - FILE * file = ::fopen( theNodeFile.c_str(), "r" ); - if ( !file ) - throw std::invalid_argument( "Can't open an input node file: " + theNodeFile ); - - FileCloser fileCloser( file ); - - // ------------------------------------- - // get shape dimension by the file name - // ------------------------------------- - - // hope the file name is something like "frnD.**" with n in (1,2) - int dimPos = theNodeFile.size() - 5; - if ( theNodeFile[ dimPos ] == '2' ) - _shapeDim = 2; - else if ( theNodeFile[ dimPos ] == '1' ) - _shapeDim = 1; - else - throw std::invalid_argument( "Can't define dimension by node file name " + theNodeFile ); -#ifdef _DEBUG_ - std::cout << ". Dimension of the file " << theNodeFile << ": " << _shapeDim << std::endl; -#endif - - // ------------------------------------- - // read geom group names; several lines - // ------------------------------------- - - std::vector< std::string > geomNames; - - const int maxLineLen = 256; - char line[ maxLineLen ]; - - long int pos = ::ftell( file ); - while ( ::fgets( line, maxLineLen, file )) // read a line - { - if ( ::feof( file )) - { - return; // no nodes in the file - } - - // check if the line describes node ids in format 3I10 (e.g. " 120 1 43\n") - size_t lineLen = strlen( line ); - if ( lineLen >= 31 && - ::isdigit( line[9] ) && - line[10] == ' ' && - ::isdigit( line[19] ) && - line[20] == ' ' && - ::isdigit( line[29] ) && - ::isspace( line[30] )) - break; - - geomNames.push_back( line + 1 ); // skip the 1st white space - - pos = ::ftell( file ); // remember the position to return if the next line holds node ids - } - - ::fseek( file, pos, SEEK_SET ); // return to the 1st line holding nodes ids - - - // -------------- - // read node ids - // -------------- - - FT_NodeToMove nodeIds; - std::vector< int > ids; - - const int nbNodes = theNodeCoords->getNumberOfTuples(); // to check validity of node IDs - - while ( ::fgets( line, maxLineLen, file )) // read a line - { - // find node ids in the line - - char *beg = line, *end = 0; - long int id; - - ids.clear(); - while (( id = ::strtol( beg, &end, 10 )) && - ( beg != end )) - { - ids.push_back( id ); - if ( id > nbNodes ) - throw std::invalid_argument( "Too large node ID: " + FT_Utils::toStr( id )); - beg = end; - } - - if ( ids.size() >= 3 ) - { - std::vector< int >::iterator i = ids.begin(); - nodeIds._nodeToMove = *i; - nodeIds._neighborNodes.assign( ++i, ids.end() ); - - _nodes.push_back( nodeIds ); - } - - if ( ::feof( file )) - break; - } - - // ----------------------------------------------------------------- - // try to find FT_Projector's to boundary sub-shapes by group names - // ----------------------------------------------------------------- - - _allProjectors = & theAllProjectorsByDim[ _shapeDim - 1 ]; - - _projectors.reserve( geomNames.size() ); - std::vector< const FT_Projector* > projectors; - - for ( size_t i = 0; i < geomNames.size(); ++i ) - { - std::string & groupName = geomNames[i]; -#ifdef _DEBUG_ - std::cout << ". Group name: " << groupName << std::endl; -#endif - - // remove trailing white spaces - for ( int iC = groupName.size() - 1; iC >= 0; --iC ) - { - if ( ::isspace( groupName[iC] ) ) - groupName.resize( iC ); - else - break; - } - if ( groupName.empty() ) - continue; - - _groupNames.push_back( groupName ); // keep _groupNames for easier debug :) - - // get projectors by group name - theXaoGroups.getProjectors( groupName, _shapeDim, - theAllProjectorsByDim[ _shapeDim-1 ], projectors ); - } - - // ------------------------------ - // check the found FT_Projector's - // ------------------------------ - - if ( projectors.size() == 1 ) - { - _projectors.push_back( *projectors[ 0 ]); - } - else - { - Bnd_Box nodesBox; - for ( size_t i = 0; i < _nodes.size(); ++i ) - nodesBox.Add( getPoint( _nodes[i]._nodeToMove )); - - if ( projectors.size() > 1 ) - { - // more than one boundary shape; - // try to filter off unnecessary projectors using a bounding box of nodes - for ( size_t i = 0; i < projectors.size(); ++i ) - if ( !nodesBox.IsOut( projectors[ i ]->getBoundingBox() )) - _projectors.push_back( *projectors[ i ]); - } - - if ( _projectors.empty() ) - { - // select projectors using a bounding box of nodes - std::vector< FT_Projector > & allProjectors = *_allProjectors; - for ( size_t i = 0; i < allProjectors.size(); ++i ) - if ( !nodesBox.IsOut( allProjectors[ i ].getBoundingBox() )) - _projectors.push_back( allProjectors[ i ]); - - if ( _projectors.empty() && !_nodes.empty() ) - throw std::runtime_error("No boundary shape found for nodes in file " + theNodeFile ); - } - } - - // prepare for projection - create real projectors - for ( size_t i = 0; i < _projectors.size(); ++i ) - _projectors[ i ].prepareForProjection(); - -} - -//================================================================================ -/*! - * \brief Project nodes to the shapes and move them to new positions - */ -//================================================================================ - -void FT_NodesOnGeom::projectAndMove() -{ - _OK = true; -// -// 1. Préalables -// - // check if all the shapes are planar - bool isAllPlanar = true; - for ( size_t i = 0; i < _projectors.size() && isAllPlanar; ++i ) - isAllPlanar = _projectors[i].isPlanarBoundary(); - if ( isAllPlanar ) - return; - - // set nodes in the order suitable for optimal projection - putNodesInOrder(); - - // project and move nodes - - std::vector< FT_NodeToMove* > notProjectedNodes; - size_t iP, iProjector; - gp_Pnt newXyz; - -#ifdef _DEBUG_ - std::cout << ".. _projectors.size() = " << _projectors.size() << std::endl; - std::cout << ".. _nodesOrder.size() = " << _nodesOrder.size() << std::endl; -#endif -// -// 2. Calculs -// 2.1. Avec plusieurs shapes -// - if ( _projectors.size() > 1 ) - { - // the nodes are to be projected onto several boundary shapes; - // in addition to the projecting, classification on a shape is necessary - // in order to find out on which of the shapes a node is to be projected - - iProjector = 0; - for ( size_t i = 0; i < _nodesOrder.size(); ++i ) - { - FT_NodeToMove& nn = _nodes[ _nodesOrder[ i ]]; - gp_Pnt xyz = getPoint( nn._nodeToMove ); - gp_Pnt xyz1 = getPoint( nn._neighborNodes[0] ); - gp_Pnt xyz2 = getPoint( nn._neighborNodes[1] ); - double maxDist2 = xyz1.SquareDistance( xyz2 ) / 4.; - if ( _projectors[ iProjector ].projectAndClassify( xyz, maxDist2, newXyz, - nn._params, nn._nearParams )) - { - moveNode( nn._nodeToMove, newXyz ); - } - else // a node is not on iProjector-th shape, find the shape it is on - { - for ( iP = 1; iP < _projectors.size(); ++iP ) // check _projectors other than iProjector - { - iProjector = ( iProjector + 1 ) % _projectors.size(); - if ( _projectors[ iProjector ].projectAndClassify( xyz, maxDist2, newXyz, - nn._params, nn._nearParams )) - { - moveNode( nn._nodeToMove, newXyz ); - break; - } - } - if ( iP == _projectors.size() ) - { - notProjectedNodes.push_back( &nn ); - -#ifdef _DEBUG_ - std::cerr << "Warning: no shape found for node " << nn._nodeToMove << std::endl; - if ( !_groupNames.empty() ) - std::cerr << "Warning: group -- " << _groupNames[0] << std::endl; -#endif - } - } - } - } -// -// 2.2. Avec une seule shape -// - else // one shape - { - for ( size_t i = 0; i < _nodesOrder.size(); ++i ) - { - FT_NodeToMove& nn = _nodes[ _nodesOrder[ i ]]; - gp_Pnt xyz = getPoint( nn._nodeToMove ); - gp_Pnt xyz1 = getPoint( nn._neighborNodes[0] ); - gp_Pnt xyz2 = getPoint( nn._neighborNodes[1] ); - -// maxDist2 : le quart du carré de la distance entre les deux voisins du noeud à bouger - double maxDist2 = xyz1.SquareDistance( xyz2 ) / 4.; -#ifdef _DEBUG_ - std::cout << "\n.. maxDist2 = " << maxDist2 << " entre " << nn._neighborNodes[0] << " et " << nn._neighborNodes[1] << " - milieu " << nn._nodeToMove << " - d/2 = " << sqrt(maxDist2) << " - d = " << sqrt(xyz1.SquareDistance( xyz2 )) << std::endl; -#endif - if ( _projectors[ 0 ].project( xyz, maxDist2, newXyz, - nn._params, nn._nearParams )) - moveNode( nn._nodeToMove, newXyz ); - else - notProjectedNodes.push_back( &nn ); - } - } -// -// 3. Bilan -// - if ( !notProjectedNodes.empty() ) - { - // project nodes that are not projected by any of _projectors; - // a proper projector is selected by evaluation of a distance between neighbor nodes - // and a shape - - std::vector< FT_Projector > & projectors = *_allProjectors; - - iProjector = 0; - for ( size_t i = 0; i < notProjectedNodes.size(); ++i ) - { - FT_NodeToMove& nn = *notProjectedNodes[ i ]; - gp_Pnt xyz = getPoint( nn._nodeToMove ); - gp_Pnt xyz1 = getPoint( nn._neighborNodes[0] ); - gp_Pnt xyz2 = getPoint( nn._neighborNodes[1] ); - double maxDist2 = xyz1.SquareDistance( xyz2 ) / 4.; - double tol2 = 1e-6 * maxDist2; - - bool ok; - for ( iP = 0; iP < projectors.size(); ++iP ) - { - projectors[ iProjector ].prepareForProjection(); - projectors[ iProjector ].tryWithoutPrevSolution( true ); - - if (( ok = projectors[ iProjector ].isOnShape( xyz1, tol2, nn._params, nn._nearParams )) && - ( ok = projectors[ iProjector ].isOnShape( xyz2, tol2, nn._params, nn._params ))) - { - if ( nn._neighborNodes.size() == 4 ) - { - gp_Pnt xyz1 = getPoint( nn._neighborNodes[2] ); - gp_Pnt xyz2 = getPoint( nn._neighborNodes[3] ); - if (( ok = projectors[ iProjector ].isOnShape( xyz1, tol2, nn._params, nn._params ))) - ok = projectors[ iProjector ].isOnShape( xyz2, tol2, nn._params, nn._params ); - } - } - - if ( ok && projectors[iProjector].project( xyz, maxDist2, newXyz, nn._params, nn._params )) - { - moveNode( nn._nodeToMove, newXyz ); - break; - } - iProjector = ( iProjector + 1 ) % projectors.size(); - } - if ( iP == projectors.size() ) - { - _OK = false; - - std::cerr << "Error: not projected node " << nn._nodeToMove << std::endl; - } - } - } -} - -//================================================================================ -/*! - * \brief Put nodes in the order for optimal projection and set FT_NodeToMove::_nearParams - * to point to a FT_NodeToMove::_params of a node that will be projected earlier - */ -//================================================================================ - -void FT_NodesOnGeom::putNodesInOrder() -{ - if ( !_nodesOrder.empty() ) - return; - - // check if any of projectors can use parameters of a previously projected node on a shape - // to speed up projection - - bool isPrevSolutionUsed = false; - for ( size_t i = 0; i < _projectors.size() && !isPrevSolutionUsed; ++i ) - isPrevSolutionUsed = _projectors[i].canUsePrevSolution(); - - if ( !isPrevSolutionUsed ) - { - _nodesOrder.resize( _nodes.size() ); - for ( size_t i = 0; i < _nodesOrder.size(); ++i ) - _nodesOrder[ i ] = i; - return; - } - - // make a map to find a neighbor projected node - - // map of { FT_NodeToMove::_neighborNodes[i] } to { FT_NodeToMove* }; - // here we call FT_NodeToMove a 'link' as this data links a _neighborNodes[i] node to other nodes - typedef NCollection_DataMap< int, std::vector< FT_NodeToMove* > > TNodeIDToLinksMap; - TNodeIDToLinksMap neigborsMap; - - int mapSize = ( _shapeDim == 1 ) ? _nodes.size() + 1 : _nodes.size() * 3; - neigborsMap.Clear(); - neigborsMap.ReSize( mapSize ); - - std::vector< FT_NodeToMove* > linkVec, *linkVecPtr; - const int maxNbLinks = ( _shapeDim == 1 ) ? 2 : 6; // usual nb of links - - for ( size_t i = 0; i < _nodes.size(); ++i ) - { - FT_NodeToMove& nn = _nodes[i]; - for ( size_t iN = 0; iN < nn._neighborNodes.size(); ++iN ) - { - if ( !( linkVecPtr = neigborsMap.ChangeSeek( nn._neighborNodes[ iN ] ))) - { - linkVecPtr = neigborsMap.Bound( nn._neighborNodes[ iN ], linkVec ); - linkVecPtr->reserve( maxNbLinks ); - } - linkVecPtr->push_back( & nn ); - } - } - - // fill in _nodesOrder - - _nodesOrder.reserve( _nodes.size() ); - - std::list< FT_NodeToMove* > queue; - queue.push_back( &_nodes[0] ); - _nodes[0]._nearParams = _nodes[0]._params; // to avoid re-adding to the queue - - while ( !queue.empty() ) - { - FT_NodeToMove* nn = queue.front(); - queue.pop_front(); - - _nodesOrder.push_back( nn - & _nodes[0] ); - - // add neighbors to the queue and set their _nearParams = nn->_params - for ( size_t iN = 0; iN < nn->_neighborNodes.size(); ++iN ) - { - std::vector< FT_NodeToMove* >& linkVec = neigborsMap( nn->_neighborNodes[ iN ]); - for ( size_t iL = 0; iL < linkVec.size(); ++iL ) - { - FT_NodeToMove* nnn = linkVec[ iL ]; - if ( nnn != nn && nnn->_nearParams == 0 ) - { - nnn->_nearParams = nn->_params; - queue.push_back( nnn ); - } - } - } - } - _nodes[0]._nearParams = 0; // reset -} - -//================================================================================ -/*! - * \brief Get node coordinates. Node IDs count from a unit - */ -//================================================================================ - -gp_Pnt FT_NodesOnGeom::getPoint( const int nodeID ) -{ - const size_t dim = _nodeCoords->getNumberOfComponents(); - const double * xyz = _nodeCoords->getConstPointer() + ( dim * ( nodeID - 1 )); - return gp_Pnt( xyz[0], xyz[1], dim == 2 ? 0 : xyz[2] ); -} - -//================================================================================ -/*! - * \brief change node coordinates - */ -//================================================================================ - -void FT_NodesOnGeom::moveNode( const int nodeID, const gp_Pnt& newXyz ) -{ - const size_t dim = _nodeCoords->getNumberOfComponents(); - double z, *xyz = _nodeCoords->getPointer() + ( dim * ( nodeID - 1 )); - newXyz.Coord( xyz[0], xyz[1], dim == 2 ? z : xyz[2] ); -} diff --git a/src/ADAPTFrontTrack/FrontTrack_NodesOnGeom.hxx b/src/ADAPTFrontTrack/FrontTrack_NodesOnGeom.hxx deleted file mode 100644 index 08db0e1de..000000000 --- a/src/ADAPTFrontTrack/FrontTrack_NodesOnGeom.hxx +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (C) 2017-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : FrontTrack_NodesOnGeom.hxx -// Created : Tue Apr 25 19:12:25 2017 -// Author : Edward AGAPOV (eap) - - -#ifndef __FrontTrack_NodesOnGeom_HXX__ -#define __FrontTrack_NodesOnGeom_HXX__ - -#include "FrontTrack_Projector.hxx" - -#include -#include -#include -#include - -#include -#include - -namespace FT_Utils { - struct XaoGroups; -} -namespace MEDCoupling { - class DataArrayDouble; -} -namespace XAO { - class BrepGeometry; -} - - //-------------------------------------------------------------------------------------------- -/*! - * \brief Node group and geometry to project onto - */ -class FT_NodesOnGeom -{ -public: - - // read node IDs form a file and try to find a boundary sub-shape by name - void read( const std::string& nodesFile, - const FT_Utils::XaoGroups& xaoGroups, - MEDCoupling::DataArrayDouble* nodeCoords, - std::vector< FT_Projector > * allProjectorsByDim); - - // chose boundary shapes by evaluating distance between nodes and shapes - //void choseShape( const std::vector< FT_Utils::ShapeAndBndBox >& shapeAndBoxList ); - - // project nodes to the shapes and move them to new positions - void projectAndMove(); - - // return true if all nodes were successfully relocated - bool isOK() const { return _OK; } - - // return dimension of boundary shapes - int getShapeDim() const { return _shapeDim; } - - // return nb of nodes to move - int nbNodes() const { return _nodes.size(); } - - -private: - - // put nodes in the order for optimal projection - void putNodesInOrder(); - - // get node coordinates - gp_Pnt getPoint( const int nodeID ); - - // change node coordinates - void moveNode( const int nodeID, const gp_Pnt& xyz ); - - - // Ids of a node to move and its 2 or 4 neighbors - struct FT_NodeToMove - { - int _nodeToMove; - std::vector< int > _neighborNodes; - - double _params[2]; // parameters on shape (U or UV) found by projection - double *_nearParams; // _params of a neighbor already projected node - - FT_NodeToMove(): _nearParams(0) {} - }; - - std::vector< std::string > _groupNames; - int _shapeDim; // dimension of boundary shapes - std::vector< FT_NodeToMove > _nodes; // ids of nodes to move and their neighbors - std::vector< FT_Projector > _projectors; // FT_Projector's initialized with boundary shapes - std::vector< FT_Projector > * _allProjectors; // FT_Projector's for all shapes of _shapeDim - MEDCoupling::DataArrayDouble* _nodeCoords; - bool _OK; // projecting is successful - - // map of { FT_NodeToMove::_neighborNodes[i] } to { FT_NodeToMove* } - // this map is used to find neighbor nodes - typedef NCollection_DataMap< int, std::vector< FT_NodeToMove* > > TNodeIDToLinksMap; - TNodeIDToLinksMap _neigborsMap; - std::vector _nodesOrder; - -}; - -#endif diff --git a/src/ADAPTFrontTrack/FrontTrack_Projector.cxx b/src/ADAPTFrontTrack/FrontTrack_Projector.cxx deleted file mode 100644 index a3bbfc614..000000000 --- a/src/ADAPTFrontTrack/FrontTrack_Projector.cxx +++ /dev/null @@ -1,947 +0,0 @@ -// Copyright (C) 2017-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : FrontTrack_Projector.cxx -// Created : Wed Apr 26 20:33:55 2017 -// Author : Edward AGAPOV (eap) - -#include "FrontTrack_Projector.hxx" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -//----------------------------------------------------------------------------- -/*! - * \brief Root class of a projector of a point to a boundary shape - */ -struct FT_RealProjector -{ - virtual ~FT_RealProjector() {} - - /*! - * \brief Project a point to a boundary shape - * \param [in] point - the point to project - * \param [out] newSolution - position on the shape (U or UV) found during the projection - * \param [in] prevSolution - position already found during the projection of a neighbor point - * \return gp_Pnt - the projection point - */ - virtual gp_Pnt project( const gp_Pnt& point, - double* newSolution, - const double* prevSolution = 0) = 0; - - /*! - * \brief Project a point to a boundary shape and check if the projection is within - * the shape boundary - * \param [in] point - the point to project - * \param [in] maxDist2 - the maximal allowed square distance between point and projection - * \param [out] projection - the projection point - * \param [out] newSolution - position on the shape (U or UV) found during the projection - * \param [in] prevSolution - position already found during the projection of a neighbor point - * \return bool - false if the projection point lies out of the shape boundary or - the distance the point and the projection is more than sqrt(maxDist2) - */ - virtual bool projectAndClassify( const gp_Pnt& point, - const double maxDist2, - gp_Pnt& projection, - double* newSolution, - const double* prevSolution = 0) = 0; - - // return true if a previously found solution can be used to speed up the projection - - virtual bool canUsePrevSolution() const { return false; } - - - double _dist; // distance between the point being projected and its projection -}; - -namespace // actual projection algorithms -{ - const double theEPS = 1e-12; - - //================================================================================ - /*! - * \brief Projector to any curve - */ - //================================================================================ - - struct CurveProjector : public FT_RealProjector - { - BRepAdaptor_Curve _curve; - double _tol; - ShapeAnalysis_Curve _projector; - double _uRange[2]; - - //----------------------------------------------------------------------------- - CurveProjector( const TopoDS_Edge& e, const double tol ): - _curve( e ), _tol( tol ) - { - BRep_Tool::Range( e, _uRange[0], _uRange[1] ); - } - - //----------------------------------------------------------------------------- - // project a point to the curve - virtual gp_Pnt project( const gp_Pnt& P, - double* newSolution, - const double* prevSolution = 0) - { -#ifdef _DEBUG_ - std::cout << ".. project a point to the curve prevSolution = " << prevSolution << std::endl; -#endif - gp_Pnt proj; - Standard_Real param; - - if ( prevSolution ) - { - _dist = _projector.NextProject( prevSolution[0], _curve, P, _tol, proj, param ); - } - else - { - _dist = _projector.Project( _curve, P, _tol, proj, param, false ); - } -#ifdef _DEBUG_ - std::cout << ".. _dist : " << _dist << std::endl; -#endif - proj = _curve.Value( param ); - - newSolution[0] = param; - - return proj; - } - - //----------------------------------------------------------------------------- - // project a point to a curve and check if the projection is within the curve boundary - virtual bool projectAndClassify( const gp_Pnt& point, - const double maxDist2, - gp_Pnt& projection, - double* newSolution, - const double* prevSolution = 0) - { -#ifdef _DEBUG_ - std::cout << ".. project a point to a curve and check " << std::endl; -#endif - projection = project( point, newSolution, prevSolution ); - return ( _uRange[0] < newSolution[0] && newSolution[0] < _uRange[1] && - _dist * _dist < maxDist2 ); - } - - //----------------------------------------------------------------------------- - // return true if a previously found solution can be used to speed up the projection - virtual bool canUsePrevSolution() const { return true; } - }; - - //================================================================================ - /*! - * \brief Projector to a straight curve. Don't project, classify only - */ - //================================================================================ - - struct LineProjector : public FT_RealProjector - { - gp_Pnt _p0, _p1; - - //----------------------------------------------------------------------------- - LineProjector( TopoDS_Edge e ) - { - e.Orientation( TopAbs_FORWARD ); - _p0 = BRep_Tool::Pnt( TopExp::FirstVertex( e )); - _p1 = BRep_Tool::Pnt( TopExp::LastVertex ( e )); - } - - //----------------------------------------------------------------------------- - // does nothing - virtual gp_Pnt project( const gp_Pnt& P, - double* newSolution, - const double* prevSolution = 0) - { - return P; - } - //----------------------------------------------------------------------------- - // check if a point lies within the line segment - virtual bool projectAndClassify( const gp_Pnt& point, - const double maxDist2, - gp_Pnt& projection, - double* newSolution, - const double* prevSolution = 0) - { - gp_Vec edge( _p0, _p1 ); - gp_Vec p0p ( _p0, point ); - double u = ( edge * p0p ) / edge.SquareMagnitude(); // param [0,1] on the edge - projection = ( 1. - u ) * _p0.XYZ() + u * _p1.XYZ(); // projection of the point on the edge - if ( u < 0 || 1 < u ) - return false; - - // check distance - return point.SquareDistance( projection ) < theEPS * theEPS; - } - }; - - //================================================================================ - /*! - * \brief Projector to a circular edge - */ - //================================================================================ - - struct CircleProjector : public FT_RealProjector - { - gp_Circ _circle; - double _uRange[2]; - - //----------------------------------------------------------------------------- - CircleProjector( const gp_Circ& c, const double f, const double l ): - _circle( c ) - { - _uRange[0] = f; - _uRange[1] = l; - } - - //----------------------------------------------------------------------------- - // project a point to the circle - virtual gp_Pnt project( const gp_Pnt& P, - double* newSolution, - const double* prevSolution = 0) - { - // assume that P is already on the the plane of circle, since - // it is in the middle of two points lying on the circle - - // move P to the circle - const gp_Pnt& O = _circle.Location(); - gp_Vec radiusVec( O, P ); - double radius = radiusVec.Magnitude(); - if ( radius < std::numeric_limits::min() ) - return P; // P in on the axe - - gp_Pnt proj = O.Translated( radiusVec.Multiplied( _circle.Radius() / radius )); - - _dist = _circle.Radius() - radius; - - return proj; - } - - //----------------------------------------------------------------------------- - // project and check if a projection lies within the circular edge - virtual bool projectAndClassify( const gp_Pnt& point, - const double maxDist2, - gp_Pnt& projection, - double* newSolution, - const double* prevSolution = 0) - { - _dist = -1; - projection = project( point, newSolution ); - if ( _dist < 0 || // ? - _dist * _dist > maxDist2 ) - return false; - - newSolution[0] = ElCLib::Parameter( _circle, projection ); - return ( _uRange[0] < newSolution[0] && newSolution[0] < _uRange[1] ); - } - }; - - //================================================================================ - /*! - * \brief Projector to any surface - */ - //================================================================================ - - struct SurfaceProjector : public FT_RealProjector - { - ShapeAnalysis_Surface _projector; - double _tol; - BRepTopAdaptor_FClass2d* _classifier; - - //----------------------------------------------------------------------------- - SurfaceProjector( const TopoDS_Face& face, const double tol, BRepTopAdaptor_FClass2d* cls ): - _projector( BRep_Tool::Surface( face )), - _tol( tol ), - _classifier( cls ) - { - } - //----------------------------------------------------------------------------- - // delete _classifier - ~SurfaceProjector() - { - delete _classifier; - } - - //----------------------------------------------------------------------------- - // project a point to a surface - virtual gp_Pnt project( const gp_Pnt& P, - double* newSolution, - const double* prevSolution = 0) - { - gp_Pnt2d uv; - - if ( prevSolution ) - { - gp_Pnt2d prevUV( prevSolution[0], prevSolution[1] ); - uv = _projector.NextValueOfUV( prevUV, P, _tol ); - } - else - { - uv = _projector.ValueOfUV( P, _tol ); - } - - uv.Coord( newSolution[0], newSolution[1] ); - - gp_Pnt proj = _projector.Value( uv ); - - _dist = _projector.Gap(); - - return proj; - } - - //----------------------------------------------------------------------------- - // project a point to a surface and check if the projection is within the surface boundary - virtual bool projectAndClassify( const gp_Pnt& point, - const double maxDist2, - gp_Pnt& projection, - double* newSolution, - const double* prevSolution = 0) - { - projection = project( point, newSolution, prevSolution ); - return ( _dist * _dist < maxDist2 ) && classify( newSolution ); - } - - //----------------------------------------------------------------------------- - // check if the projection is within the shape boundary - bool classify( const double* newSolution ) - { - TopAbs_State state = _classifier->Perform( gp_Pnt2d( newSolution[0], newSolution[1]) ); - return ( state != TopAbs_OUT ); - } - - //----------------------------------------------------------------------------- - // return true if a previously found solution can be used to speed up the projection - virtual bool canUsePrevSolution() const { return true; } - }; - - //================================================================================ - /*! - * \brief Projector to a plane. Don't project, classify only - */ - //================================================================================ - - struct PlaneProjector : public SurfaceProjector - { - gp_Pln _plane; - bool _isRealPlane; // false means that a surface is planar but parametrization is different - - //----------------------------------------------------------------------------- - PlaneProjector( const gp_Pln& pln, - const TopoDS_Face& face, - BRepTopAdaptor_FClass2d* cls, - bool isRealPlane=true): - SurfaceProjector( face, 0, cls ), - _plane( pln ), - _isRealPlane( isRealPlane ) - {} - - //----------------------------------------------------------------------------- - // does nothing - virtual gp_Pnt project( const gp_Pnt& P, - double* newSolution, - const double* prevSolution = 0) - { - return P; - } - //----------------------------------------------------------------------------- - // check if a point lies within the boundry of the planar face - virtual bool projectAndClassify( const gp_Pnt& point, - const double maxDist2, - gp_Pnt& projection, - double* newSolution, - const double* prevSolution = 0) - { - if ( _isRealPlane ) - { - ElSLib::PlaneParameters( _plane.Position(), point, newSolution[0], newSolution[1]); - projection = ElSLib::PlaneValue ( newSolution[0], newSolution[1], _plane.Position() ); - if ( projection.SquareDistance( point ) > theEPS * theEPS ) - return false; - - return SurfaceProjector::classify( newSolution ); - } - else - { - return SurfaceProjector::projectAndClassify( point, maxDist2, projection, - newSolution, prevSolution ); - } - } - //----------------------------------------------------------------------------- - // return true if a previously found solution can be used to speed up the projection - virtual bool canUsePrevSolution() const { return false; } - }; - - //================================================================================ - /*! - * \brief Projector to a cylinder - */ - //================================================================================ - - struct CylinderProjector : public SurfaceProjector - { - gp_Cylinder _cylinder; - - //----------------------------------------------------------------------------- - CylinderProjector( const gp_Cylinder& c, - const TopoDS_Face& face, - BRepTopAdaptor_FClass2d* cls ): - SurfaceProjector( face, 0, cls ), - _cylinder( c ) - {} - - //----------------------------------------------------------------------------- - // project a point to the cylinder - virtual gp_Pnt project( const gp_Pnt& P, - double* newSolution, - const double* prevSolution = 0) - { - // project the point P to the cylinder axis -> Pp - const gp_Pnt& O = _cylinder.Position().Location(); - const gp_Dir& axe = _cylinder.Position().Direction(); - gp_Vec trsl = gp_Vec( axe ).Multiplied( gp_Vec( O, P ).Dot( axe )); - gp_Pnt Pp = O.Translated( trsl ); - - // move Pp to the cylinder - gp_Vec radiusVec( Pp, P ); - double radius = radiusVec.Magnitude(); - if ( radius < std::numeric_limits::min() ) - return P; // P in on the axe - - gp_Pnt proj = Pp.Translated( radiusVec.Multiplied( _cylinder.Radius() / radius )); - - _dist = _cylinder.Radius() - radius; - - return proj; - } - //----------------------------------------------------------------------------- - // project a point to the cylinder and check if the projection is within the surface boundary - virtual bool projectAndClassify( const gp_Pnt& point, - const double maxDist2, - gp_Pnt& projection, - double* newSolution, - const double* prevSolution = 0) - { - ElSLib::CylinderParameters( _cylinder.Position(), _cylinder.Radius(), point, - newSolution[0], newSolution[1]); - projection = ElSLib::CylinderValue( newSolution[0], newSolution[1], - _cylinder.Position(), _cylinder.Radius() ); - - return ( _dist * _dist < maxDist2 ) && SurfaceProjector::classify( newSolution ); - } - //----------------------------------------------------------------------------- - // return true if a previously found solution can be used to speed up the projection - virtual bool canUsePrevSolution() const { return false; } - }; - - //================================================================================ - /*! - * \brief Projector to a cone - */ - //================================================================================ - - struct ConeProjector : public SurfaceProjector - { - gp_Cone _cone; - - //----------------------------------------------------------------------------- - ConeProjector( const gp_Cone& c, - const TopoDS_Face& face, - BRepTopAdaptor_FClass2d* cls ): - SurfaceProjector( face, 0, cls ), - _cone( c ) - {} - - //----------------------------------------------------------------------------- - // project a point to the cone - virtual gp_Pnt project( const gp_Pnt& point, - double* newSolution, - const double* prevSolution = 0) - { - ElSLib::ConeParameters( _cone.Position(), _cone.RefRadius(), _cone.SemiAngle(), - point, newSolution[0], newSolution[1]); - gp_Pnt proj = ElSLib::ConeValue( newSolution[0], newSolution[1], - _cone.Position(), _cone.RefRadius(), _cone.SemiAngle() ); - _dist = point.Distance( proj ); - - return proj; - } - - //----------------------------------------------------------------------------- - // project a point to the cone and check if the projection is within the surface boundary - virtual bool projectAndClassify( const gp_Pnt& point, - const double maxDist2, - gp_Pnt& projection, - double* newSolution, - const double* prevSolution = 0) - { - projection = project( point, newSolution, prevSolution ); - - return ( _dist * _dist < maxDist2 ) && SurfaceProjector::classify( newSolution ); - } - //----------------------------------------------------------------------------- - // return true if a previously found solution can be used to speed up the projection - virtual bool canUsePrevSolution() const { return false; } - }; - - //================================================================================ - /*! - * \brief Projector to a sphere - */ - //================================================================================ - - struct SphereProjector : public SurfaceProjector - { - gp_Sphere _sphere; - - //----------------------------------------------------------------------------- - SphereProjector( const gp_Sphere& s, - const TopoDS_Face& face, - BRepTopAdaptor_FClass2d* cls ): - SurfaceProjector( face, 0, cls ), - _sphere( s ) - {} - - //----------------------------------------------------------------------------- - // project a point to the sphere - virtual gp_Pnt project( const gp_Pnt& P, - double* newSolution, - const double* prevSolution = 0) - { - // move Pp to the Sphere - const gp_Pnt& O = _sphere.Location(); - gp_Vec radiusVec( O, P ); - double radius = radiusVec.Magnitude(); - if ( radius < std::numeric_limits::min() ) - return P; // P is on O - - gp_Pnt proj = O.Translated( radiusVec.Multiplied( _sphere.Radius() / radius )); - - _dist = _sphere.Radius() - radius; - - return proj; - } - - //----------------------------------------------------------------------------- - // project a point to the sphere and check if the projection is within the surface boundary - virtual bool projectAndClassify( const gp_Pnt& point, - const double maxDist2, - gp_Pnt& projection, - double* newSolution, - const double* prevSolution = 0) - { - ElSLib::SphereParameters( _sphere.Position(), _sphere.Radius(), point, - newSolution[0], newSolution[1]); - projection = ElSLib::SphereValue( newSolution[0], newSolution[1], - _sphere.Position(), _sphere.Radius() ); - - return ( _dist * _dist < maxDist2 ) && SurfaceProjector::classify( newSolution ); - } - //----------------------------------------------------------------------------- - // return true if a previously found solution can be used to speed up the projection - virtual bool canUsePrevSolution() const { return false; } - }; - - //================================================================================ - /*! - * \brief Projector to a torus - */ - //================================================================================ - - struct TorusProjector : public SurfaceProjector - { - gp_Torus _torus; - - //----------------------------------------------------------------------------- - TorusProjector( const gp_Torus& t, - const TopoDS_Face& face, - BRepTopAdaptor_FClass2d* cls ): - SurfaceProjector( face, 0, cls ), - _torus( t ) - {} - - //----------------------------------------------------------------------------- - // project a point to the torus - virtual gp_Pnt project( const gp_Pnt& point, - double* newSolution, - const double* prevSolution = 0) - { - ElSLib::TorusParameters( _torus.Position(), _torus.MajorRadius(), _torus.MinorRadius(), - point, newSolution[0], newSolution[1]); - gp_Pnt proj = ElSLib::TorusValue( newSolution[0], newSolution[1], - _torus.Position(), _torus.MajorRadius(), _torus.MinorRadius() ); - _dist = point.Distance( proj ); - - return proj; - } - - //----------------------------------------------------------------------------- - // project a point to the torus and check if the projection is within the surface boundary - virtual bool projectAndClassify( const gp_Pnt& point, - const double maxDist2, - gp_Pnt& projection, - double* newSolution, - const double* prevSolution = 0) - { - projection = project( point, newSolution, prevSolution ); - - return ( _dist * _dist < maxDist2 ) && SurfaceProjector::classify( newSolution ); - } - //----------------------------------------------------------------------------- - // return true if a previously found solution can be used to speed up the projection - virtual bool canUsePrevSolution() const { return false; } - }; - - //================================================================================ - /*! - * \brief Check if a curve can be considered straight - */ - //================================================================================ - - bool isStraight( const GeomAdaptor_Curve& curve, const double tol ) - { - // rough check: evaluate how far from a straight line connecting the curve ends - // stand several internal points of the curve - - const double f = curve.FirstParameter(); - const double l = curve.LastParameter(); - const gp_Pnt pf = curve.Value( f ); - const gp_Pnt pl = curve.Value( l ); - const gp_Vec lineVec( pf, pl ); - const double lineLen2 = lineVec.SquareMagnitude(); - if ( lineLen2 < std::numeric_limits< double >::min() ) - return false; // E seems closed - - const double nbSamples = 7; - for ( int i = 0; i < nbSamples; ++i ) - { - const double r = ( i + 1 ) / nbSamples; - const gp_Pnt pi = curve.Value( f * r + l * ( 1 - r )); - const gp_Vec vi( pf, pi ); - const double h2 = lineVec.Crossed( vi ).SquareMagnitude() / lineLen2; - if ( h2 > tol * tol ) - return false; - } - - // thorough check - GCPnts_UniformDeflection divider( curve, tol ); - return ( divider.IsDone() && divider.NbPoints() < 3 ); - } -} - -//================================================================================ -/*! - * \brief Initialize with a boundary shape - */ -//================================================================================ - -FT_Projector::FT_Projector(const TopoDS_Shape& shape) -{ - _realProjector = 0; - setBoundaryShape( shape ); - _tryWOPrevSolution = false; -} - -//================================================================================ -/*! - * \brief Copy another projector - */ -//================================================================================ - -FT_Projector::FT_Projector(const FT_Projector& other) -{ - _realProjector = 0; - _shape = other._shape; - _bndBox = other._bndBox; - _tryWOPrevSolution = false; -} - -//================================================================================ -/*! - * \brief Destructor. Delete _realProjector - */ -//================================================================================ - -FT_Projector::~FT_Projector() -{ - delete _realProjector; -} - -//================================================================================ -/*! - * \brief Initialize with a boundary shape. Compute the bounding box - */ -//================================================================================ - -void FT_Projector::setBoundaryShape(const TopoDS_Shape& shape) -{ - delete _realProjector; _realProjector = 0; - _shape = shape; - if ( shape.IsNull() ) - return; - - BRepBndLib::Add( shape, _bndBox ); - _bndBox.Enlarge( 1e-5 * sqrt( _bndBox.SquareExtent() )); -} - -//================================================================================ -/*! - * \brief Create a real projector - */ -//================================================================================ - -void FT_Projector::prepareForProjection() -{ - if ( _shape.IsNull() || _realProjector ) - return; - - if ( _shape.ShapeType() == TopAbs_EDGE ) - { - const TopoDS_Edge& edge = TopoDS::Edge( _shape ); - - double tol = 1e-6 * sqrt( _bndBox.SquareExtent() ); - - double f,l; - Handle(Geom_Curve) curve = BRep_Tool::Curve( edge, f,l ); - if ( curve.IsNull() ) - return; // degenerated edge - - GeomAdaptor_Curve acurve( curve, f, l ); - switch ( acurve.GetType() ) - { - case GeomAbs_Line: - _realProjector = new LineProjector( edge ); - break; - case GeomAbs_Circle: - _realProjector = new CircleProjector( acurve.Circle(), f, l ); - break; - case GeomAbs_BezierCurve: - case GeomAbs_BSplineCurve: - case GeomAbs_OffsetCurve: - case GeomAbs_OtherCurve: - if ( isStraight( acurve, tol )) - { - _realProjector = new LineProjector( edge ); - break; - } - case GeomAbs_Ellipse: - case GeomAbs_Hyperbola: - case GeomAbs_Parabola: - _realProjector = new CurveProjector( edge, tol ); - } - } - else if ( _shape.ShapeType() == TopAbs_FACE ) - { - TopoDS_Face face = TopoDS::Face( _shape ); - - Handle(Geom_Surface) surface = BRep_Tool::Surface( face ); - if ( surface.IsNull() ) - return; - - GeomAdaptor_Surface asurface( surface ); - Standard_Real tol = BRep_Tool::Tolerance( face ); - Standard_Real toluv = Min( asurface.UResolution( tol ), asurface.VResolution( tol )); - BRepTopAdaptor_FClass2d* classifier = new BRepTopAdaptor_FClass2d( face, toluv ); - - switch ( asurface.GetType() ) - { - case GeomAbs_Plane: - _realProjector = new PlaneProjector( asurface.Plane(), face, classifier ); - break; - case GeomAbs_Cylinder: - _realProjector = new CylinderProjector( asurface.Cylinder(), face, classifier ); - break; - case GeomAbs_Sphere: - _realProjector = new SphereProjector( asurface.Sphere(), face, classifier ); - break; - case GeomAbs_Cone: - _realProjector = new ConeProjector( asurface.Cone(), face, classifier ); - break; - case GeomAbs_Torus: - _realProjector = new TorusProjector( asurface.Torus(), face, classifier ); - break; - case GeomAbs_BezierSurface: - case GeomAbs_BSplineSurface: - case GeomAbs_SurfaceOfRevolution: - case GeomAbs_SurfaceOfExtrusion: - case GeomAbs_OffsetSurface: - case GeomAbs_OtherSurface: - GeomLib_IsPlanarSurface isPlaneCheck( surface, tol ); - if ( isPlaneCheck.IsPlanar() ) - { - _realProjector = new PlaneProjector( isPlaneCheck.Plan(), face, classifier, - /*isRealPlane=*/false); - } - else - { - _realProjector = new SurfaceProjector( face, tol, classifier ); - } - break; - } - - if ( !_realProjector ) - delete classifier; - } -} - -//================================================================================ -/*! - * \brief Return true if projection is not needed - */ -//================================================================================ - -bool FT_Projector::isPlanarBoundary() const -{ - return ( dynamic_cast< LineProjector* >( _realProjector ) || - dynamic_cast< PlaneProjector* >( _realProjector ) ); -} - -//================================================================================ -/*! - * \brief Check if a point lies on the boundary shape - * \param [in] point - the point to check - * \param [in] tol2 - a square tolerance allowing to decide whether a point is on the shape - * \param [in] newSolution - position on the shape (U or UV) of the point found - * during projecting - * \param [in] prevSolution - position on the shape (U or UV) of a neighbor point - * \return bool - \c true if the point lies on the boundary shape - * - * This method is used to select a shape by checking if all neighbor nodes of a node to move - * lie on a shape. - */ -//================================================================================ - -bool FT_Projector::isOnShape( const gp_Pnt& point, - const double tol2, - double* newSolution, - const double* prevSolution) -{ - if ( _bndBox.IsOut( point ) || !_realProjector ) - return false; - - gp_Pnt proj; - if ( isPlanarBoundary() ) - return projectAndClassify( point, tol2, proj, newSolution, prevSolution ); - - return project( point, tol2, proj, newSolution, prevSolution ); -} - -//================================================================================ -/*! - * \brief Project a point to the boundary shape - * \param [in] point - the point to project - * \param [in] maxDist2 - the maximal square distance between the point and the projection - * \param [out] projection - the projection - * \param [out] newSolution - position on the shape (U or UV) of the point found - * during projecting - * \param [in] prevSolution - already found position on the shape (U or UV) of a neighbor point - * \return bool - false if the distance between the point and the projection - * is more than sqrt(maxDist2) - * - * This method is used to project a node in the case where only one shape is found by name - */ -//================================================================================ - -bool FT_Projector::project( const gp_Pnt& point, - const double maxDist2, - gp_Pnt& projection, - double* newSolution, - const double* prevSolution) -{ - if ( !_realProjector ) - return false; - - _realProjector->_dist = 1e100; - projection = _realProjector->project( point, newSolution, prevSolution ); - - bool ok = ( _realProjector->_dist * _realProjector->_dist < maxDist2 ); - if ( !ok && _tryWOPrevSolution && prevSolution ) - { - projection = _realProjector->project( point, newSolution ); - ok = ( _realProjector->_dist * _realProjector->_dist < maxDist2 ); - } - return ok; -} - -//================================================================================ -/*! - * \brief Project a point to the boundary shape and check if the projection lies within - * the shape boundary - * \param [in] point - the point to project - * \param [in] maxDist2 - the maximal square distance between the point and the projection - * \param [out] projection - the projection - * \param [out] newSolution - position on the shape (U or UV) of the point found - * during projecting - * \param [in] prevSolution - already found position on the shape (U or UV) of a neighbor point - * \return bool - false if the projection point lies out of the shape boundary or - * the distance between the point and the projection is more than sqrt(maxDist2) - * - * This method is used to project a node in the case where several shapes are selected for - * projection of a node group - */ -//================================================================================ - -bool FT_Projector::projectAndClassify( const gp_Pnt& point, - const double maxDist2, - gp_Pnt& projection, - double* newSolution, - const double* prevSolution) -{ - if ( _bndBox.IsOut( point ) || !_realProjector ) - return false; - - bool ok = _realProjector->projectAndClassify( point, maxDist2, projection, - newSolution, prevSolution ); - if ( !ok && _tryWOPrevSolution && prevSolution ) - ok = _realProjector->projectAndClassify( point, maxDist2, projection, newSolution ); - - return ok; -} - -//================================================================================ -/*! - * \brief Return true if a previously found solution can be used to speed up the projection - */ -//================================================================================ - -bool FT_Projector::canUsePrevSolution() const -{ - return ( _realProjector && _realProjector->canUsePrevSolution() ); -} diff --git a/src/ADAPTFrontTrack/FrontTrack_Projector.hxx b/src/ADAPTFrontTrack/FrontTrack_Projector.hxx deleted file mode 100644 index 82578e252..000000000 --- a/src/ADAPTFrontTrack/FrontTrack_Projector.hxx +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (C) 2017-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : FrontTrack_Projector.hxx -// Created : Wed Apr 26 20:12:13 2017 -// Author : Edward AGAPOV (eap) - -#ifndef __FrontTrack_Projector_HXX__ -#define __FrontTrack_Projector_HXX__ - -#include -#include - -struct FT_RealProjector; - -/*! - * \brief Projector of a point to a boundary shape. Wrapper of a real projection algo - */ -class FT_Projector -{ -public: - - FT_Projector(const TopoDS_Shape& shape = TopoDS_Shape()); - FT_Projector(const FT_Projector& other); - ~FT_Projector(); - - // initialize with a boundary shape, compute the bounding box - void setBoundaryShape(const TopoDS_Shape& shape); - - // return the boundary shape - const TopoDS_Shape& getShape() const { return _shape; } - - // return the bounding box - const Bnd_Box getBoundingBox() const { return _bndBox; } - - - // create a real projector - void prepareForProjection(); - - // return true if a previously found solution can be used to speed up the projection - bool canUsePrevSolution() const; - - // return true if projection is not needed - bool isPlanarBoundary() const; - - - // switch a mode of usage of prevSolution. - // If projection fails, to try to project without usage of prevSolution. - // By default this mode is off - void tryWithoutPrevSolution( bool toTry ) { _tryWOPrevSolution = toTry; } - - // project a point to the boundary shape - bool project( const gp_Pnt& point, - const double maxDist2, - gp_Pnt& projection, - double* newSolution, - const double* prevSolution = 0); - - // project a point to the boundary shape and check if the projection is within the shape boundary - bool projectAndClassify( const gp_Pnt& point, - const double maxDist2, - gp_Pnt& projection, - double* newSolution, - const double* prevSolution = 0); - - // check if a point lies on the boundary shape - bool isOnShape( const gp_Pnt& point, - const double tol2, - double* newSolution, - const double* prevSolution = 0); - -private: - - FT_RealProjector* _realProjector; - Bnd_Box _bndBox; - TopoDS_Shape _shape; - bool _tryWOPrevSolution; -}; - -#endif diff --git a/src/ADAPTFrontTrack/FrontTrack_Utils.cxx b/src/ADAPTFrontTrack/FrontTrack_Utils.cxx deleted file mode 100644 index e74072ac0..000000000 --- a/src/ADAPTFrontTrack/FrontTrack_Utils.cxx +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (C) 2017-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : FrontTrack_Utils.cxx -// Created : Tue Apr 25 17:28:58 2017 -// Author : Edward AGAPOV (eap) - -#include "FrontTrack_Utils.hxx" - -#include -#include - -#include -#include - -namespace boofs = boost::filesystem; - -//================================================================================ -/* - * \brief Check if a file exists - */ -//================================================================================ - -bool FT_Utils::fileExists( const std::string& path ) -{ - if ( path.empty() ) - return false; - - boost::system::error_code err; - bool res = boofs::exists( path, err ); - - return err ? false : res; -} - -//================================================================================ -/*! - * \brief Check if a file can be created/overwritten - */ -//================================================================================ - -bool FT_Utils::canWrite( const std::string& path ) -{ - if ( path.empty() ) - return false; - - bool can = false; -#ifdef WIN32 - - HANDLE file = CreateFile( path.c_str(), // name of the write - GENERIC_WRITE, // open for writing - 0, // do not share - NULL, // default security - OPEN_ALWAYS, // CREATE NEW or OPEN EXISTING - FILE_ATTRIBUTE_NORMAL, // normal file - NULL); // no attr. template - can = ( file != INVALID_HANDLE_VALUE ); - CloseHandle( file ); - -#else - - int file = ::open( path.c_str(), - O_WRONLY | O_CREAT, - S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ); // rw-r--r-- - can = ( file >= 0 ); - -#endif - - return can; -} - -//================================================================================ -/*! - * \brief Make a map of XAO groups - */ -//================================================================================ - -FT_Utils::XaoGroups::XaoGroups( const XAO::Xao* theXao ) -{ - XAO::Xao* xao = const_cast< XAO::Xao* >( theXao ); - - for ( int iG = 0; iG < theXao->countGroups(); ++iG ) - { - XAO::Group* group = xao->getGroup( iG ); - - if ( group->getDimension() == 1 ) - - _xaoGroups[ 0 ].insert( std::make_pair( group->getName(), group )); - - else if ( group->getDimension() == 2 ) - - _xaoGroups[ 1 ].insert( std::make_pair( group->getName(), group )); - } -} - -//================================================================================ -/*! - * \brief Return FT_Projector's by a group name - * \param [in] groupName - the group name - * \param [in] dim - the group dimension - * \param [in] allProjectors - the projector of all shapes of \a dim dimension - * \param [out] groupProjectors - projectors to shapes of the group - * \return int - number of found shapes - */ -//================================================================================ - -int FT_Utils::XaoGroups::getProjectors( const std::string& groupName, - const int dim, - const std::vector< FT_Projector > & allProjectors, - std::vector< const FT_Projector* > & groupProjectors) const -{ - // get namesake groups - - const TGroupByNameMap* groupMap = 0; - if ( dim == 1 ) - groupMap = &_xaoGroups[ 0 ]; - else if ( dim == 2 ) - groupMap = &_xaoGroups[ 1 ]; - else - return 0; - - TGroupByNameMap::const_iterator name2gr = groupMap->find( groupName ); - if ( name2gr == groupMap->end() ) - return 0; - - std::vector< XAO::Group* > groups; - groups.push_back( name2gr->second ); - - for ( ++name2gr; name2gr != groupMap->end(); ++name2gr ) - { - if ( name2gr->second->getName() == groupName ) - groups.push_back( name2gr->second ); - else - break; - } - - // get projectors - - int nbFound = 0; - for ( size_t i = 0; i < groups.size(); ++i ) - { - // IDs in XAO correspond to indices of allProjectors - std::set::iterator id = groups[i]->begin(), end = groups[i]->end(); - for ( ; id != end; ++id, ++nbFound ) - if ( *id < (int) allProjectors.size() ) - groupProjectors.push_back ( & allProjectors[ *id ]); - } - - return nbFound; -} diff --git a/src/ADAPTFrontTrack/FrontTrack_Utils.hxx b/src/ADAPTFrontTrack/FrontTrack_Utils.hxx deleted file mode 100644 index 38817cb59..000000000 --- a/src/ADAPTFrontTrack/FrontTrack_Utils.hxx +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (C) 2017-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : FrontTrack_Utils.hxx -// Created : Tue Apr 25 17:23:33 2017 -// Author : Edward AGAPOV (eap) - -#ifndef __FrontTrack_Utils_HXX__ -#define __FrontTrack_Utils_HXX__ - -#include "FrontTrack_Projector.hxx" - -#include -#include -#include - -namespace XAO { - class Xao; - class Group; -} - -namespace FT_Utils -{ - // Check if a file exists - bool fileExists( const std::string& path ); - - // Check if a file can be created/overwritten - bool canWrite( const std::string& path ); - - // Transform anything printable to a string - template< typename T> std::string toStr( const T& t ) - { - std::ostringstream s; - s << t; - return s.str(); - } - - //-------------------------------------------------------------------------------------------- - /*! - * \brief Return projectors by group name - */ - struct XaoGroups - { - XaoGroups( const XAO::Xao* xao ); - - int getProjectors( const std::string& groupName, - const int dim, - const std::vector< FT_Projector > & allProjectors, - std::vector< const FT_Projector* > & groupProjectors ) const; - private: - - typedef std::multimap< std::string, XAO::Group* > TGroupByNameMap; - TGroupByNameMap _xaoGroups[ 2 ]; // by dim - }; -} - -#endif diff --git a/src/ADAPTFrontTrack_SWIG/CMakeLists.txt b/src/ADAPTFrontTrack_SWIG/CMakeLists.txt deleted file mode 100644 index 5b9a4a901..000000000 --- a/src/ADAPTFrontTrack_SWIG/CMakeLists.txt +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright (C) 2017-2020 CEA/DEN, EDF R&D -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -INCLUDE(${SWIG_USE_FILE}) - -# --- options --- -# additional include directories -INCLUDE_DIRECTORIES( - ${PYTHON_INCLUDE_DIRS} - ${PTHREAD_INCLUDE_DIR} # pthread dependancy due to python2.7 library - ${CMAKE_CURRENT_SOURCE_DIR} - ${PROJECT_SOURCE_DIR}/src/ADAPTFrontTrack -) - -# additional preprocessor / compiler flags -ADD_DEFINITIONS( - ${PYTHON_DEFINITIONS} -) - -# libraries to link to -SET(_link_LIBRARIES - ${PYTHON_LIBRARIES} - ${PLATFORM_LIBS} - ADAPTFrontTrack -) - -# --- headers --- - -# header files / to be processed by moc -SET(ADAPTFrontTrack_Swig_HEADERS - FrontTrack.i -) - -# --- sources --- - -# sources / static -SET(ADAPTFrontTrack_Swig_SOURCES - ${ADAPTFrontTrack_Swig_HEADERS} -) - -# swig flags -SET_SOURCE_FILES_PROPERTIES(FrontTrack.i PROPERTIES CPLUSPLUS ON) -SET_SOURCE_FILES_PROPERTIES(FrontTrack.i PROPERTIES SWIG_DEFINITIONS "-shadow") - -# --- scripts --- - -# scripts / swig wrappings -SET(_swig_SCRIPTS - ${CMAKE_CURRENT_BINARY_DIR}/FrontTrack.py -) - -# --- rules --- -IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") - SWIG_ADD_MODULE(FrontTrack_Swig python ${ADAPTFrontTrack_Swig_SOURCES}) -ELSE() - SWIG_ADD_LIBRARY(FrontTrack_Swig LANGUAGE python SOURCES ${ADAPTFrontTrack_Swig_SOURCES}) -ENDIF() - -SWIG_LINK_LIBRARIES(FrontTrack_Swig ${_link_LIBRARIES}) -SWIG_CHECK_GENERATION(FrontTrack_Swig) -IF(WIN32) - SET_TARGET_PROPERTIES(_FrontTrack_Swig PROPERTIES DEBUG_OUTPUT_NAME _FrontTrack_Swig_d) -ENDIF(WIN32) - -INSTALL(TARGETS ${SWIG_MODULE_FrontTrack_Swig_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON}) - -SALOME_INSTALL_SCRIPTS("${_swig_SCRIPTS}" ${SALOME_INSTALL_PYTHON} EXTRA_DPYS "${SWIG_MODULE_FrontTrack_Swig_REAL_NAME}") diff --git a/src/ADAPTFrontTrack_SWIG/FrontTrack.i b/src/ADAPTFrontTrack_SWIG/FrontTrack.i deleted file mode 100644 index 50c6c2066..000000000 --- a/src/ADAPTFrontTrack_SWIG/FrontTrack.i +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (C) 2017-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : FrontTrack.i -// Created : Fri Apr 28 17:36:20 2017 -// Author : Edward AGAPOV (eap) - -%module FrontTrack - -%{ -#include "FrontTrack.hxx" -#include -#include -#include - -static PyObject* setOCCException(Standard_Failure& ex) -{ - std::string msg(ex.DynamicType()->Name()); - if ( ex.GetMessageString() && strlen( ex.GetMessageString() )) { - msg += ": "; - msg += ex.GetMessageString(); - } - PyErr_SetString(PyExc_Exception, msg.c_str() ); - return NULL; -} - -%} - - -%exception -{ - try { - OCC_CATCH_SIGNALS; - $action } - catch (Standard_Failure& ex) { - return setOCCException(ex); - } - catch (std::exception& ex) { - PyErr_SetString(PyExc_Exception, ex.what() ); - return NULL; - } -} - -%include -%include - -%template(svec) std::vector; - -//%feature("autodoc", "1"); -//%feature("docstring"); - -%include "FrontTrack.hxx" diff --git a/src/ADAPTGUI/ADAPT_msg_en.ts b/src/ADAPTGUI/ADAPT_msg_en.ts deleted file mode 100644 index 1567033d6..000000000 --- a/src/ADAPTGUI/ADAPT_msg_en.ts +++ /dev/null @@ -1,415 +0,0 @@ - - - - - @default - - HOM_MEN_HOMARD - HOMARD - - - HOM_MEN_MODIFICATION - Modification - - - HOM_MEN_INFORMATION - Information - - - HOM_MEN_YACS - YACS - - - HOM_MEN_NEW_CASE - New case - - - HOM_MEN_NEW_ITERATION - Next iteration - - - HOM_MEN_PURSUE_ITERATION - Case: pursuit of a stored iteration - - - HOM_MEN_COMPUTE - Compute - - - HOM_MEN_COMPUTE_PUBLISH - Compute and publish - - - HOM_MEN_EDIT - Edit - - - HOM_MEN_DELETE - Delete - - - HOM_MEN_MESH_INFO - Mesh analysis - - - HOM_MEN_MESH_PUBLICATION - Mesh publication - - - HOM_MEN_EDIT_MESS_FILE - Show the file - - - HOM_MEN_WRITE - Write - - - HOM_TOP_HOMARD - HOMARD - - - HOM_TOP_NEW_CASE - New case - - - HOM_TOP_NEW_ITERATION - Next iteration - - - HOM_TOP_PURSUE_ITERATION - Case: pursuit of a stored iteration - - - HOM_TOP_COMPUTE - Compute - - - HOM_TOP_COMPUTE_PUBLISH - Compute and publish - - - HOM_TOP_EDIT - Edit - - - HOM_TOP_DELETE - Delete - - - HOM_TOP_EDIT_MESS_FILE - Show the file - - - HOM_STB_HOMARD - HOMARD - - - HOM_STB_NEW_CASE - New case - - - HOM_STB_NEW_ITERATION - Next iteration - - - HOM_STB_PURSUE_ITERATION - Case: pursuit of a stored iteration - - - HOM_STB_COMPUTE - Compute - - - HOM_STB_COMPUTE_PUBLISH - Compute and publish - - - HOM_STB_EDIT - Edit - - - HOM_STB_DELETE - Delete - - - HOM_STB_EDIT_MESS_FILE - Show the file - - - HOM_WARNING - Warning - - - HOM_ERROR - Error - - - HOM_INACTIVE_BUTTON - Inactive button - - - HOM_SELECT_OBJECT_1 - Select an object. - - - HOM_SELECT_OBJECT_2 - Select only one object. - - - HOM_SELECT_OBJECT_3 - Select an object with type %1. - - - HOM_SELECT_OBJECT_4 - The name of the object is already selected. Modify it or cancel. - - - HOM_SELECT_FILE_0 - File selection - - - HOM_SELECT_FILE_1 - Select a file. - - - HOM_SELECT_FILE_2 - Select only one file. - - - HOM_SELECT_FILE_3 - This file cannot be opened. - - - HOM_SCRIPT_FILE - A script file must be given. - - - HOM_MED_FILE_1 - This MED file cannot be read. - - - HOM_MED_FILE_2 - No mesh in this MED file. - - - HOM_MED_FILE_3 - More than one mesh in this MED file. - - - HOM_MED_FILE_4 - The mesh in this MED file cannot be read. - - - HOM_MED_FILE_5 - No field in this MED file. - - - HOM_MED_FILE_6 - The field(s) in this MED file cannot be read. - - - HOM_SELECT_STUDY - Select a study object with associated MED file \n or select a MED file. - - - HOM_CASE_NAME - The case must be named. - - - HOM_CASE_DIRECTORY_1 - A directory for the case must be selected. - - - HOM_CASE_DIRECTORY_2 - This directory is already used by the case - - - HOM_CASE_DIRECTORY_3 - A valid directory for the case must be selected. - - - HOM_CASE_DIRECTORY_4 - A directory for the computation must be selected. - - - HOM_START_DIRECTORY_1 - A starting directory for the pursuit must be selected. - - - HOM_START_DIRECTORY_3 - A valid directory for the pursuit must be selected. - - - HOM_CASE_MESH - The file of the initial mesh must be selected. - - - HOM_CASE_GROUP - The group "%1" cannot be given for more than 1 boundary. - - - HOM_CASE_EDIT_WINDOW_TITLE - Edition of a case - - - HOM_CASE_EDIT_STATE_0 - Initial mesh. - - - HOM_CASE_EDIT_STATE - Pursuit of an iteration. - - - HOM_CASE_PURSUE_WINDOW_TITLE - Case: pursuit of a stored iteration - - - HOM_ITER_NAME - The iteration must be named. - - - HOM_ITER_STARTING_POINT - The previous iteration must be given. - - - HOM_ITER_MESH - Give a name for the final mesh. - - - HOM_ITER_HYPO - A hypothesis must be selected. - - - HOM_ITER_FIELD_FILE - With this hypothesis, a file for the field must be given. - - - HOM_ITER_STARTING_POINT_0 - Mesh - - - HOM_ITER_STARTING_POINT_1 - First iteration of the case. - - - HOM_ITER_STARTING_POINT_2 - First iteration of the case for the pursuit. - - - HOM_ITER_EDIT_WINDOW_TITLE - Edition of an iteration - - - HOM_HYPO_NAME - The hypothesis must be named. - - - HOM_HYPO_FIELD_FILE - A file for the field must be given. - - - HOM_HYPO_ZONE_1 - A zone must be selected. - - - HOM_HYPO_ZONE_2 - At least, one zone must be selected. - - - HOM_HYPO_ZONE_3 - Either refinement or coarsening, but not both. - - - HOM_HYPO_NORM_L2 - L2 norm - - - HOM_HYPO_NORM_INF - Infinite norm - - - HOM_HYPO_NORM_ABS - Absolute - - - HOM_HYPO_NORM_REL - Relative - - - HOM_HYPO_COMP - At least, one component must be selected. - - - HOM_HYPO_EDIT_WINDOW_TITLE - Edition of a hypothesis - - - HOM_ZONE_NAME - The zone must be named. - - - HOM_ZONE_LIMIT - %1 maxi must be greater than %1 mini. - - - HOM_ZONE_RAYON - The external radius must be greater than the internal radius. - - - HOM_ZONE_EDIT_WINDOW_TITLE - Edition of a zone - - - HOM_BOUN_NAME - The boundary must be named. - - - HOM_BOUN_MESH - The file for the mesh of the boundary must be selected. - - - HOM_BOUN_CAO - The file for the CAO must be selected. - - - HOM_BOUN_CASE - The meshfile of the case is unknown. - - - HOM_AXE - The axis must be a non 0 vector. - - - HOM_BOUN_C_EDIT_WINDOW_TITLE - Edition of a CAO based boundary - - - HOM_BOUN_A_EDIT_WINDOW_TITLE - Edition of an analytical boundary - - - HOM_BOUN_D_EDIT_WINDOW_TITLE - Edition of a discrete boundary - - - HOM_GROU_EDIT_WINDOW_TITLE - Selected groups - - - HOM_MESH_INFO_0 - Mesh analysis - - - HOM_MESH_INFO_1 - Select at least one option. - - - HOM_MESH_INFO_2 - Analysis in the object browser, file - - - HOM_YACS_EDIT_WINDOW_TITLE - Edition of a schema YACS - - - diff --git a/src/ADAPTGUI/ADAPT_msg_fr.ts b/src/ADAPTGUI/ADAPT_msg_fr.ts deleted file mode 100644 index f36da7b24..000000000 --- a/src/ADAPTGUI/ADAPT_msg_fr.ts +++ /dev/null @@ -1,1127 +0,0 @@ - - - - - @default - - HOM_MEN_HOMARD - HOMARD - - - HOM_MEN_MODIFICATION - Modification - - - HOM_MEN_INFORMATION - Information - - - HOM_MEN_YACS - YACS - - - HOM_MEN_NEW_CASE - Nouveau cas - - - HOM_MEN_NEW_ITERATION - Itération suivante - - - HOM_MEN_PURSUE_ITERATION - Cas de poursuite d'une itération - - - HOM_MEN_COMPUTE - Calculer - - - HOM_MEN_COMPUTE_PUBLISH - Calculer et publier - - - HOM_MEN_EDIT - Editer - - - HOM_MEN_DELETE - Supprimer - - - HOM_MEN_MESH_INFO - Analyse de maillage - - - HOM_MEN_MESH_PUBLICATION - Publication du maillage - - - HOM_MEN_EDIT_MESS_FILE - Afficher le fichier - - - HOM_MEN_WRITE - Ecrire - - - HOM_TOP_HOMARD - HOMARD - - - HOM_TOP_NEW_CASE - Nouveau cas - - - HOM_TOP_NEW_ITERATION - Itération suivante - - - HOM_TOP_PURSUE_ITERATION - Cas de poursuite d'une itération - - - HOM_TOP_COMPUTE - Calculer - - - HOM_TOP_COMPUTE_PUBLISH - Calculer et publier - - - HOM_TOP_EDIT - Editer - - - HOM_TOP_DELETE - Supprimer - - - HOM_TOP_EDIT_MESS_FILE - Afficher le fichier - - - HOM_STB_HOMARD - HOMARD - - - HOM_STB_NEW_CASE - Nouveau cas - - - HOM_STB_NEW_ITERATION - Itération suivante - - - HOM_STB_PURSUE_ITERATION - Cas de poursuite d'une itération - - - HOM_STB_COMPUTE - Calculer - - - HOM_STB_COMPUTE_PUBLISH - Calculer et publier - - - HOM_STB_EDIT - Editer - - - HOM_STB_DELETE - Supprimer - - - HOM_STB_EDIT_MESS_FILE - Afficher le fichier - - - HOM_WARNING - Avertissement - - - HOM_ERROR - Erreur - - - HOM_INACTIVE_BUTTON - Bouton inactif - - - OK - Appliquer et fermer - - - Apply - Appliquer - - - Cancel - Annuler - - - Help - Aide - - - New - Nouveau - - - Edit - Editer - - - Quit - Quitter - - - Name - Nom - - - Directory - Répertoire - - - Mesh - Maillage - - - Selection - Sélection - - - None - Aucun - - - All - Tout - - - HOM_SELECT_OBJECT_1 - Sélectionner un objet. - - - HOM_SELECT_OBJECT_2 - Sélectionner un seul objet. - - - HOM_SELECT_OBJECT_3 - Sélectionner un objet de type %1. - - - HOM_SELECT_OBJECT_4 - Le nom est déjà choisi. Modifiez le ou annulez la saisie. - - - HOM_SELECT_FILE_0 - Choix de fichier - - - HOM_SELECT_FILE_1 - Sélectionner un fichier. - - - HOM_SELECT_FILE_2 - Sélectionner un seul fichier. - - - HOM_SELECT_FILE_3 - Impossible d'ouvrir ce fichier. - - - HOM_SCRIPT_FILE - Il faut donner un fichier pour le script python. - - - HOM_MED_FILE_1 - Ce fichier MED est illisible. - - - HOM_MED_FILE_2 - Ce fichier MED ne contient aucun maillage. - - - HOM_MED_FILE_3 - Ce fichier MED contient plus d'un maillage. - - - HOM_MED_FILE_4 - Impossible de lire le maillage de ce fichier MED. - - - HOM_MED_FILE_5 - Ce fichier MED ne contient aucun champ. - - - HOM_MED_FILE_6 - Impossible de lire le(s) champ(s) de ce fichier MED. - - - HOM_SELECT_STUDY - Sélectionner une étude avec un fichier MED associé\n ou sélectionner un fichier MED. - - - Create a case - Création d'un cas - - - HOM_CASE_NAME - Il faut donner un nom au cas. - - - HOM_CASE_DIRECTORY_1 - Il faut choisir un répertoire de travail pour le cas. - - - HOM_CASE_DIRECTORY_2 - Ce répertoire est déjà utilisé par le cas - - - HOM_CASE_DIRECTORY_3 - Un répertoire valide doit être choisi. - - - HOM_CASE_DIRECTORY_4 - Il faut choisir un répertoire de travail pour le calcul. - - - HOM_START_DIRECTORY_1 - Il faut choisir un répertoire contenant l'itération à poursuivre. - - - HOM_START_DIRECTORY_3 - Un répertoire valide contenant l'itération à poursuivre doit être choisi. - - - HOM_CASE_MESH - Il faut choisir le maillage initial. - - - HOM_CASE_GROUP - Le groupe "%1" ne peut pas être attribué à plus d'une frontière. - - - HOM_CASE_EDIT_WINDOW_TITLE - Edition d'un cas - - - HOM_CASE_EDIT_STATE_0 - Maillage initial. - - - HOM_CASE_EDIT_STATE - Poursuite d'une itération. - - - HOM_CASE_PURSUE_WINDOW_TITLE - Cas de poursuite d'une itération - - - The configuration file cannot be found. - Le fichier de configuration de HOMARD est introuvable. - - - The configuration file cannot be read. - Le fichier de configuration de HOMARD est illisible. - - - The HOMARD mesh file cannot be found. - Le fichier de maillage de HOMARD est introuvable. - - - HOM_ITER_NAME - Il faut donner un nom à l'itération. - - - HOM_ITER_STARTING_POINT - Il faut désigner l'itération précédente. - - - HOM_ITER_MESH - Donner le nom du maillage final. - - - HOM_ITER_HYPO - Choisir une hypothèse. - - - HOM_ITER_FIELD_FILE - Avec cette hypothèse, il faut fournir le fichier du champ. - - - HOM_ITER_STARTING_POINT_0 - Maillage - - - HOM_ITER_STARTING_POINT_1 - Itération initiale du cas. - - - HOM_ITER_STARTING_POINT_2 - Itération initiale du cas pour la poursuite. - - - HOM_ITER_EDIT_WINDOW_TITLE - Edition d'une itération - - - Boundary type - Type de frontière - - - No boundary - Pas de frontière - - - Non CAO - Autre que CAO - - - Discrete boundary - Frontière discrète - - - Analytical boundary - Frontière analytique - - - Conformity type - Type de conformité - - - Conformal - Conforme - - - Non conformal - Non conforme - - - Non conformal option - Option de non conformité - - - Conformity + - Conformité + - - - Free - Libre - - - 1 hanging node per mesh - 1 noeud pendant par maille - - - 1 node per edge - 1 noeud pendant par arête - - - Advanced options - Options avancées - - - Authorized pyramids - Pyramides autorisées - - - Minimal diameter - Diamètre minimal - - - Initialization of adaptation - Initialisation de l'adaptation - - - Maximal level - Niveau maximal - - - Output of the level of refinement - Sortie du niveau de raffinement - - - Output of the qualities - Sortie des qualités - - - Output of the diameters - Sortie des diamètres - - - Output of the parents - Sortie des parents - - - Output of the neighbours - Sortie des voisins - - - Create an iteration - Création d'une itération - - - Iteration Name - Nom de l'itération - - - Previous iteration - Itération précédente - - - Invalid boundary - Frontière non valable - - - Invalid case - Cas non valable - - - Invalid case context - Cas contextuel non valable - - - Invalid hypothesis - Hypothèse non valable - - - Invalid iteration - Itération non valable - - - Invalid zone - Zone non valable - - - This boundary has already been defined. - Cette frontière est déjà définie. - - - This case has already been defined. - Ce cas est déjà défini. - - - This hypothesis has already been defined. - Cette hypothèse est déjà définie. - - - This iteration has already been defined. - Cette itération est déjà définie. - - - This zone has already been defined. - Cette zone est déjà définie. - - - The parent iteration is not defined. - L'itération parent n'est pas définie. - - - Unable to create the iteration. - Impossible de créer l'itération. - - - The directory for the computation cannot be created. - Impossible de créer le répertoire pour le calcul de l'itération. - - - This iteration is the first of the case and cannot be computed. - Cette itération définit le point de départ du cas. Elle ne peut pas être calculée. - - - This iteration does not have any associated hypothesis. - Cette itération n'est associée à aucune hypothèse. - - - The mesh file does not exist. - Le fichier du maillage n'existe pas. - - - The mesh file cannot be deleted. - Impossible de supprimer le fichier du maillage. - - - Mesh n - Maillage n - - - Mesh n+1 - Maillage n+1 - - - Field information - Information sur les champs - - - Field file - Fichier des champs - - - No time step - Sans pas de temps - - - Last time step - Dernier pas de temps - - - Chosen time step - Pas de temps choisi - - - Time step - Pas de temps - - - Rank - Numéro d'ordre - - - Hypothesis - Hypothèse - - - Create a hypothesis - Création d'une hypothèse - - - HOM_HYPO_NAME - Il faut donner un nom à l'hypothèse. - - - HOM_HYPO_FIELD_FILE - Il faut fournir le fichier du champ. - - - HOM_HYPO_ZONE_1 - Choisir une zone. - - - HOM_HYPO_ZONE_2 - Il faut choisir au moins une zone. - - - HOM_HYPO_ZONE_3 - Raffinement ou déraffinement, mais pas les deux. - - - HOM_HYPO_NORM_L2 - Norme L2 - - - HOM_HYPO_NORM_INF - Norme infinie - - - HOM_HYPO_NORM_ABS - Absolu - - - HOM_HYPO_NORM_REL - Relatif - - - HOM_HYPO_COMP - Il faut choisir au moins une composante. - - - HOM_HYPO_EDIT_WINDOW_TITLE - Edition d'une hypothèse - - - Type of adaptation - Type d'adaptation - - - Uniform - Uniforme - - - Driven by a field - Pilotage par un champ - - - With geometrical zones - Selon des zones géométriques - - - Uniform adaptation - Adaptation uniforme - - - Coarsening - Déraffinement - - - Refinement - Raffinement - - - Nothing - Rien - - - File of the fields - Fichier des champs - - - Governing field for the adaptation - Champ pilotant l'adaptation - - - Field name - Nom du champ - - - Jump between elements - Saut entre éléments - - - Component - Composante - - - Refinement threshold - Seuil de raffinement - - - Coarsening threshold - Seuil de déraffinement - - - Percentage of meshes - Pourcentage de mailles - - - Mean + n*(std deviation) - Moyenne + n*(ecart-type) - - - No refinement - Sans raffinement - - - Mean - n*(std deviation) - Moyenne - n*(ecart-type) - - - No coarsening - Sans déraffinement - - - Zone management - Gestion des zones - - - Zone name - Nom de la zone - - - Field Interpolation - Interpolation des champs - - - Chosen - Choisi - - - Create a zone - Création d'une zone - - - HOM_ZONE_NAME - Il faut donner un nom à la zone. - - - HOM_ZONE_LIMIT - %1 maxi doit être plus grand que %1 mini. - - - HOM_ZONE_RAYON - Le rayon externe doit être supérieur au rayon interne. - - - HOM_ZONE_EDIT_WINDOW_TITLE - Edition d'une zone - - - Type of zone - Type de la zone - - - Box - Boîte - - - Sphere - Sphère - - - Cylinder - Cylindre - - - Disk - Disque - - - Disk with hole - Disque avec trou - - - Pipe - Tuyau - - - Coordinates - Coordonnées - - - Get CAO - Acquisition de la CAO - - - Create an analytical boundary - Création d'une frontière analytique - - - Create a discrete boundary - Création d'une frontière discrète - - - Type of boundary - Type de la frontière - - - Torus - Tore - - - Radius - Rayon - - - Radius 1 - Rayon 1 - - - Radius 2 - Rayon 2 - - - External radius - Rayon externe - - - Internal radius - Rayon interne - - - Height - Hauteur - - - X axis - X axe - - - Y axis - Y axe - - - Z axis - Z axe - - - R revolution - R révolution - - - Primary R - R primaire - - - HOM_BOUN_NAME - Il faut donner un nom à la frontière. - - - HOM_BOUN_MESH - Il faut choisir le fichier qui contient le maillage de la frontière discrète. - - - HOM_BOUN_CAO - Il faut choisir le fichier qui contient la CAO. - - - HOM_BOUN_CASE - Le fichier du maillage du cas est inconnu. - - - HOM_AXE - L'axe doit être un vecteur non nul. - - - HOM_BOUN_C_EDIT_WINDOW_TITLE - Edition d'une frontière basée sur une CAO - - - HOM_BOUN_A_EDIT_WINDOW_TITLE - Edition d'une frontière analytique - - - HOM_BOUN_D_EDIT_WINDOW_TITLE - Edition d'une frontière discrète - - - HOM_GROU_EDIT_WINDOW_TITLE - Groupes choisis - - - The height must be positive. - La hauteur doit être positive. - - - The radius must be positive. - Un rayon doit être positif. - - - The axis must be a non 0 vector. - L'axe doit être un vecteur non nul. - - - The angle must be included higher than 0 degree and lower than 90 degrees. - L'angle doit être compris entre 0 et 90 degrés. - - - The radius must be different. - Les rayons doivent être différents. - - - The centers must be different. - Les centres doivent être différents. - - - The external radius must be higher than the internal radius. - Le rayon externe doit être supérieur au rayon interne. - - - The X coordinates are not coherent. - Les coordonnées en X ne sont pas cohérentes. - - - The Y coordinates are not coherent. - Les coordonnées en Y ne sont pas cohérentes. - - - The Z coordinates are not coherent. - Les coordonnées en Z ne sont pas cohérentes. - - - The first coordinates are not coherent. - Les premières coordonnées ne sont pas cohérentes. - - - The second coordinates are not coherent. - Les secondes coordonnées ne sont pas cohérentes. - - - The orientation must be 1, 2 or 3. - L'orientation vaut 1, 2 ou 3. - - - HOM_MESH_INFO_0 - Analyse de maillage - - - HOM_MESH_INFO_1 - Choisir au moins une option. - - - HOM_MESH_INFO_2 - Bilan de l'analyse dans l'arbre d'études, fichier - - - Filtering with groups - Filtrage par les groupes - - - Selection of groups - Choix des groupes - - - Selected groups - Groupes choisis - - - Group - Groupe - - - Information on a mesh - Analyse d'un maillage - - - Group size - Taille des domaines - - - Quality - Qualité - - - Connection - Connexité - - - Diametre - Diamètre - - - Entanglement - Interpénétration - - - No change is allowed in a boundary. Ask for evolution. - Impossible de changer une donnée dans une frontière. Demander une évolution. - - - This boundary is used in a case and cannot be deleted. - Cette frontière est utilisée dans un cas ; elle ne peut pas être détruite. - - - This hypothesis is used and cannot be deleted. - Cette hypothèse est utilisée dans une itération ; elle ne peut pas être détruite. - - - This iteration cannot be deleted. - Cette itération ne peut pas être détruite. - - - This zone is used in a hypothesis and cannot be deleted. - Cette zone est utilisée dans une hypothèse ; elle ne peut pas être détruite. - - - The directory for the calculation cannot be cleared. - Menage du repertoire de calcul impossible - - - Starting point - Point de départ - - - From an iteration - A partir d'une itération - - - From a case - A partir d'un cas - - - Iteration into the case - Choix d'une itération dans le cas - - - Last iteration - A partir de la dernière itération - - - Iteration number - A partir d'une itération numérotée - - - The directory of the case does not exist. - Le répertoire du cas n'existe pas. - - - The directory for the case cannot be modified because some iterations are already defined. - Impossible de changer le répertoire du cas car des itérations ont déjà été définies. - - - The directory for the case cannot be reached. - Impossible d'atteindre ce répertoire pour le cas. - - - The starting point for the case cannot be copied into the working directory. - Impossible de copier le point de départ du cas dans le répertoire de travail. - - - The starting point for the case cannot be moved into the new directory. - Impossible de déplacer le point de départ du cas dans le nouveau répertoire. - - - The directory of the case for the pursuit does not exist. - Le répertoire du cas de reprise n'existe pas. - - - The directory of the iteration does not exist. - Le répertoire de l'itération de reprise n'existe pas. - - - The number of iteration must be positive. - Le numéro de l'itération doit etre positif. - - - Number of iteration - Numéro de l'itération - - - Case - Cas - - - Mesh file - Maillage initial - - - Constant - Constant - - - Variable - Variable - - - Type of schema - Type de schema - - - Maximum of ... - Maximum de ... - - - Iterations - Itérations - - - Nodes - Noeuds - - - Elements - Eléments - - - Test of convergence - Test de convergence - - - Edit a file - Affichage d'un fichier - - - Print - Imprimer - - - Invalid study context - Etude contextuelle non valable - - - HOM_YACS_EDIT_WINDOW_TITLE - Edition d'un schéma YACS - - - diff --git a/src/ADAPTGUI/ADAPT_msg_ja.ts b/src/ADAPTGUI/ADAPT_msg_ja.ts deleted file mode 100644 index e60a20c76..000000000 --- a/src/ADAPTGUI/ADAPT_msg_ja.ts +++ /dev/null @@ -1,1148 +0,0 @@ - - - - - @default - - HOM_MEN_HOMARD - ロブスター - - - HOM_MEN_MODIFICATION - 変更 - - - HOM_MEN_INFORMATION - 情報 - - - HOM_MEN_YACS - YACS - - - HOM_MEN_NEW_CASE - 新しいケース - - - HOM_MEN_NEW_ITERATION - 新しいイテレーション - - - HOM_MEN_PURSUE_ITERATION - イテレーションの追跡 - - - HOM_MEN_COMPUTE - 計算します。 - - - HOM_MEN_COMPUTE_PUBLISH - 計算と発行 - - - HOM_MEN_EDIT - 編集(&E) - - - HOM_MEN_DELETE - 削除 - - - HOM_MEN_MESH_INFO - メッシュの解析 - - - HOM_MEN_MESH_PUBLICATION - メッシュ発行 - - - HOM_MEN_EDIT_MESS_FILE - ファイルを表示します。 - - - HOM_MEN_WRITE - 書き込み - - - HOM_TOP_HOMARD - ロブスター - - - HOM_TOP_NEW_CASE - 新しいケース - - - HOM_TOP_NEW_ITERATION - 新しいイテレーション - - - HOM_TOP_PURSUE_ITERATION - イテレーションの追跡 - - - HOM_TOP_COMPUTE - 計算します。 - - - HOM_TOP_COMPUTE_PUBLISH - 計算と発行 - - - HOM_TOP_EDIT - 編集 - - - HOM_TOP_DELETE - 削除 - - - HOM_TOP_EDIT_MESS_FILE - ファイルを表示します。 - - - HOM_STB_HOMARD - ロブスター - - - HOM_STB_NEW_CASE - 新しいケース - - - HOM_STB_NEW_ITERATION - 新しいイテレーション - - - HOM_STB_PURSUE_ITERATION - イテレーションの追跡 - - - HOM_STB_COMPUTE - 計算 - - - HOM_STB_COMPUTE_PUBLISH - 計算と発行 - - - HOM_STB_EDIT - 編集 - - - HOM_STB_DELETE - 削除 - - - HOM_STB_EDIT_MESS_FILE - ファイルを表示します。 - - - HOM_WARNING - 警告 - - - HOM_ERROR - エラー - - - HOM_INACTIVE_BUTTON - アクティブでないボタン - - - OK - Ok - - - Apply - 適用 - - - Cancel - キャンセル - - - Help - ヘルプ - - - New - 新規 - - - Edit - 編集 - - - Quit - 終了 - - - Name - 名前 - - - Directory - ディレクトリ - - - Mesh - メッシュ - - - Selection - 選択 - - - None - なし - - - All - 全て - - - HOM_SELECT_OBJECT_1 - オブジェクトを選択します。 - - - HOM_SELECT_OBJECT_2 - 1 つのオブジェクトを選択します。 - - - HOM_SELECT_OBJECT_3 - 型 %1 のオブジェクトを選択します。 - - - HOM_SELECT_OBJECT_4 - The name of the object is already selected. Modify it or cancel. - - - HOM_SELECT_FILE_0 - ファイル選択 - - - HOM_SELECT_FILE_1 - ファイルを選択します。 - - - HOM_SELECT_FILE_2 - 1 つのファイルを選択します。 - - - HOM_SELECT_FILE_3 - このファイルを開くことができません。 - - - HOM_SCRIPT_FILE - 我々 は python スクリプトにファイルを与える必要があります。 - - - HOM_MED_FILE_1 - この医学ファイルは読み取り不可能です。 - - - HOM_MED_FILE_2 - この医学のファイルには、メッシュが含まれていません。 - - - HOM_MED_FILE_3 - この医学のファイルにはよりも 1 つのメッシュが含まれています。 - - - HOM_MED_FILE_4 - 音楽配信マック & ファイルのメッシュを読み取れませんでした。 - - - HOM_MED_FILE_5 - この医学のファイルには、フィールドが含まれていません。 - - - HOM_MED_FILE_6 - 医学ファイル (秒) (秒) フィールドを読み取ることができません。 - - - HOM_SELECT_STUDY - 研究医 associe - のファイルを選択または医学ファイルを選択します。 - - - Create a case - ケースの作成 - - - HOM_CASE_NAME - 場合に名前を付ける必要があります。 - - - HOM_CASE_DIRECTORY_1 - 1 つの場合を動作するようにディレクトリを選択する必要があります。 - - - HOM_CASE_DIRECTORY_2 - このディレクトリは、既に使用中です。 - - - HOM_CASE_DIRECTORY_3 - 有効なディレクトリを選択する必要があります。 - - - HOM_CASE_DIRECTORY_4 - 計算のための作業ディレクトリを選択する必要があります。 - - - HOM_START_DIRECTORY_1 - 追跡のため開始点を選択する必要があります。 - - - HOM_START_DIRECTORY_3 - 追跡のため有効な方向を選択する必要があります。 - - - HOM_CASE_MESH - 1 つは、初期のメッシュを選択する必要があります。 - - - HOM_CASE_GROUP - グループ"%1"は、以上の境界線に割り当てることはできません。 - - - HOM_CASE_EDIT_WINDOW_TITLE - 場合の編集 - - - HOM_CASE_EDIT_STATE_0 - 初期メッシュ。 - - - HOM_CASE_EDIT_STATE - イテレーションの継続。 - - - HOM_CASE_PURSUE_WINDOW_TITLE - イテレーションの追跡 - - - The configuration file cannot be found. - コンフィギュレーションファイルが見つかりません。 - - - The configuration file cannot be read. - コンフィギュレーションファイルが読み込めません。 - - - The HOMARD mesh file cannot be found. - HOMARDメッシュファイルが見つかりません。 - - - HOM_ITER_NAME - 名前を反復処理する必要があります。 - - - HOM_ITER_STARTING_POINT - これは、前のイテレーションを指定する必要があります。 - - - HOM_ITER_MESH - 最終的なメッシュの名前。 - - - HOM_ITER_HYPO - 仮説を選択します。 - - - HOM_ITER_FIELD_FILE - この前提には、ファイルのフィールドを指定する必要があります。 - - - HOM_ITER_STARTING_POINT_0 - メッシュ - - - HOM_ITER_STARTING_POINT_1 - ケースの最初のイテレーションです。 - - - HOM_ITER_STARTING_POINT_2 - 検察側の事件の最初のイテレーションです。 - - - HOM_ITER_EDIT_WINDOW_TITLE - イテレーションの編集 - - - Discrete boundary - 離散境界 - - - Analytical boundary - 解析的境界 - - - Conformity type - 適合タイプ - - - Conformal - 等角 - - - Non conformal - 非共形 - - - Non conformal option - 非共形オプション - - - Conformity + - 適合性 + - - - Free - Free - - - 1 hanging node per mesh - メッシュあたりの1接続節点 - - - 1 node per edge - エッジ辺りの1節点 - - - Advanced options - 詳細オプション - - - Authorized pyramids - 認定済みピラミッド - - - Minimal diameter - 最小径 - - - Initialization of adaptation - 適応の初期化 - - - Maximal level - 最大レベル - - - Output of the level of refinement - リファインレベルの出力 - - - Output of the qualities - 品質の出力 - - - Output of the diameters - 直径の出力 - - - Output of the parents - 親直径の出力 - - - Output of the neighbours - 隣の直径の出力 - - - Create an iteration - イテレーションの作成 - - - Iteration Name - イテレーションの名前 - - - Previous iteration - 以前のイテレーション - - - Invalid boundary - 無効な境界 - - - Invalid case - 無効なケース - - - Invalid case context - ケースの内容が無効です - - - Invalid hypothesis - 無効なhypothesis - - - Invalid iteration - 無効なイテレーション - - - Invalid zone - 無効なゾーン - - - This boundary has already been defined. - この境界は既に定義されています。 - - - This case has already been defined. - このケースは既に定義されています。 - - - This hypothesis has already been defined. - このhypothesisは既に定義されています。 - - - This iteration has already been defined. - このイテレーションは既に定義されています。 - - - This zone has already been defined. - このゾーンは既に定義されています。 - - - The parent iteration is not defined. - 親イテレーションは、定義されていません。 - - - Unable to create the iteration. - イテレーションを作成することができません。 - - - The directory for the computation cannot be created. - 計算のためのディレクトリを作成できません。 - - - This iteration is the first of the case and cannot be computed. - このイタレーションはケースの最初であり、計算できません。 - - - This iteration does not have any associated hypothesis. - このイタレーションは関連した hypothesis がありません。 - - - The mesh file does not exist. - メッシュ ファイルは存在しません。 - - - The mesh file cannot be deleted. - メッシュ ファイルを削除できません。 - - - Mesh n - メッシュ n - - - Mesh n+1 - メッシュ n + 1 - - - Field information - フィールド情報 - - - Field file - フィールド ファイル - - - No time step - タイムステップなし - - - Last time step - 最終タイムステップ - - - Chosen time step - 選択されたタイムステップ - - - Time step - タイムステップ - - - Rank - ランク - - - Hypothesis - Hypothesis - - - Create a hypothesis - hypothesis の作成 - - - HOM_HYPO_NAME - 仮説に名前を付ける必要があります。 - - - HOM_HYPO_FIELD_FILE - それはフィールドのファイルを提供する必要があります。 - - - HOM_HYPO_ZONE_1 - ゾーンを選択します。 - - - HOM_HYPO_ZONE_2 - 1 つは、少なくとも 1 つのゾーンを選択する必要があります。 - - - HOM_HYPO_ZONE_3 - 洗練された、または deraffinement、両方ではないです。 - - - HOM_HYPO_NORM_L2 - 標準の L2 - - - HOM_HYPO_NORM_INF - 無限の標準 - - - HOM_HYPO_NORM_ABS - 絶対値 - - - HOM_HYPO_NORM_REL - 関係 - - - HOM_HYPO_COMP - 1 つ以上のコンポーネントを選択する必要があります。 - - - HOM_HYPO_EDIT_WINDOW_TITLE - 仮説の編集 - - - Type of adaptation - 適合のタイプ - - - Uniform - 均一 - - - Driven by a field - フィールドによって駆動 - - - With geometrical zones - 幾何学的ゾーン使用 - - - Uniform adaptation - 均一な適応 - - - Coarsening - 粗大化 - - - Refinement - リファインメント - - - Nothing - なし - - - File of the fields - フィールドファイル - - - Governing field for the adaptation - 適合のためにフィールドを管理 - - - Field name - フィールド名 - - - Jump between elements - 要素間ジャンプ - - - Component - コンポーネント - - - Refinement threshold - リファインメント閾値 - - - Coarsening threshold - 粗大化閾値 - - - Percentage of meshes - メッシュの割合 - - - Mean + n*(std deviation) - 平均 + n * (標準偏差) - - - No refinement - リファインメントなし - - - Mean - n*(std deviation) - 平均 - n * (標準偏差) - - - No coarsening - 粗大化なし - - - Zone management - ゾーン管理 - - - Zone name - ゾーン名 - - - Field Interpolation - フィールド補間 - - - Chosen - 選択済み - - - Create a zone - ゾーンの作成 - - - HOM_ZONE_NAME - 領域に名前を必要があります。 - - - HOM_ZONE_LIMIT - 最大 %1 は %1 のミニよりも大きい必要があります。 - - - HOM_ZONE_RAYON - 外側の半径は、内側の半径よりも大きい必要があります。 - - - HOM_ZONE_EDIT_WINDOW_TITLE - 領域の編集 - - - Type of zone - ゾーンのタイプ - - - Box - Box - - - Sphere - - - - Cylinder - 円筒 - - - Disk - 円盤 - - - Disk with hole - 穴付き円盤 - - - Pipe - パイプ - - - Coordinates - 座標 - - - Create an analytical boundary - 分析境界の作成 - - - Create a discrete boundary - 離散境界の作成 - - - Type of boundary - 境界のタイプ - - - Torus - 環状体 - - - Radius - 半径 - - - Radius 1 - 半径1 - - - Radius 2 - 半径2 - - - External radius - 外半径 - - - Internal radius - 内半径 - - - Height - 高さ - - - X axis - X 軸 - - - Y axis - Y 軸 - - - Z axis - Z 軸 - - - R revolution - R 回転 - - - Primary R - 主 R - - - HOM_BOUN_NAME - 名前の国境に与えする必要があります。 - - - HOM_BOUN_MESH - 1 つの枠を含むメッシュを選択する必要があります。 - - - HOM_BOUN_CASE - 場合ファイルのメッシュが知られています。 - - - HOM_AXE - 軸は、ゼロ以外のベクトルでなければなりません。 - - - HOM_BOUN_A_EDIT_WINDOW_TITLE - 分析のフロンティアの編集 - - - HOM_BOUN_D_EDIT_WINDOW_TITLE - 離散境界の編集 - - - HOM_GROU_EDIT_WINDOW_TITLE - 選択したグループ - - - The height must be positive. - 高さは正でなければなりません。 - - - The radius must be positive. - 半径は正でなければなりません。 - - - The axis must be a non 0 vector. - 軸は非 0 のベクトルでなければなりません。 - - - The angle must be included higher than 0 degree and lower than 90 degrees. - 角度は0 °よりも大きく 90 °未満である必要があります。 - - - The radius must be different. - 半径が異なる必要があります。 - - - The centers must be different. - 中心が異なる必要があります。 - - - The external radius must be higher than the internal radius. - 外部の半径は内部の半径より大きい必要があります。 - - - The X coordinates are not coherent. - X座標は論理上問題があります。 - - - The Y coordinates are not coherent. - Y座標は論理上問題があります。 - - - The Z coordinates are not coherent. - Z座標は論理上問題があります。 - - - The first coordinates are not coherent. - 最初の座標に論理上問題があります。 - - - The second coordinates are not coherent. - 2番目の座標に論理上問題があります。 - - - The orientation must be 1, 2 or 3. - 方向は1、2、3のどれかにする必要があります。 - - - HOM_MESH_INFO_0 - メッシュの解析 - - - HOM_MESH_INFO_1 - 少なくとも 1 つのオプションを選択します。 - - - HOM_MESH_INFO_2 - バランス シート分析結果をスタディ ツリーで、ファイル - - - Filtering with groups - グループでフィルタリング - - - Selection of groups - グループの選択 - - - Selected groups - 選択されたグループ - - - Group - グループ : - - - Information on a mesh - メッシュに関する情報 - - - Group size - グループのサイズ - - - Quality - 品質 - - - Connection - 接続 - - - Diametre - 直径 - - - Entanglement - 縺れ合い - - - No change is allowed in a boundary. Ask for evolution. - 境界内に許可された変更はありません。旋回について尋ねます。 - - - This boundary is used in a case and cannot be deleted. - この境界はケースで使用されており、削除できません。 - - - This hypothesis is used and cannot be deleted. - このhypothesisは使用されており、削除できません。 - - - This iteration cannot be deleted. - このイテレーションは削除できません。 - - - This zone is used in a hypothesis and cannot be deleted. - このゾーンはhypothesisで使用されており、削除できません。 - - - The directory for the calculation cannot be cleared. - 計算用ディレクトリは削除できません。 - - - Starting point - 始点 - - - From an iteration - イテレーションから - - - From a case - ケースから - - - Iteration into the case - ケースへのイテレーション - - - Last iteration - 最後のイテレーション - - - Iteration number - イテレーション数 - - - The directory of the case does not exist. - ケースのディレクトリは存在しません。 - - - The directory for the case cannot be modified because some iterations are already defined. - いくつかのイテレーションが既に定義されているため、ケースのディレクトリを変更できません。 - - - The directory for the case cannot be reached. - ケースのディレクトリに到達できません。 - - - The starting point for the case cannot be copied into the working directory. - ケースの開始点は作業ディレクトリにコピーできません。 - - - The starting point for the case cannot be moved into the new directory. - ケースの開始点は新しいディレクトリに移動できません。 - - - The directory of the case for the pursuit does not exist. - 追跡用ケースのディレクトリは存在しません。 - - - The directory of the iteration does not exist. - イテレーションのディレクトリが存在しません。 - - - The number of iteration must be positive. - イテレーション数は正である必要があります。 - - - Number of iteration - イテレーション数 - - - Case - ケース - - - Mesh file - メッシュファイル - - - Constant - 定数 - - - Variable - 変数 - - - Type of schema - スキーマタイプ - - - Maximum of ... - 最大の... - - - Iterations - イテレーション - - - Nodes - 節点 - - - Elements - 要素 - - - Test of convergence - 収束テスト - - - Edit a file - ファイルの編集 - - - Print - 印刷 - - - Invalid study context - 無効なスタディの内容 - - - HOM_YACS_EDIT_WINDOW_TITLE - YACS スキーマ編集スキーマへんしゅう - - - PREF_TAB_GENERAL - 一般的な - - - PREF_PUBLICATION - 発行 - - - PREF_PUBLICATION_MAILLAGE_IN - メッシュ入力 - - - PREF_PUBLICATION_MAILLAGE_OUT - メッシュ出力 - - - PREF_YACS - YACS - - - PREF_YACS_MAX - 最大の数 - - - PREF_YACS_MAX_ITER - 繰り返し - - - PREF_YACS_MAX_NODE - 節点 - - - PREF_YACS_MAX_ELEM - 要素 - - - PREF_YACS_CONVERGENCE - 収束 - - - PREF_YACS_TYPE_TEST - テストタイプ - - - diff --git a/src/ADAPTGUI/CMakeLists.txt b/src/ADAPTGUI/CMakeLists.txt deleted file mode 100644 index 6499859d3..000000000 --- a/src/ADAPTGUI/CMakeLists.txt +++ /dev/null @@ -1,183 +0,0 @@ -# Copyright (C) 2012-2020 CEA/DEN, EDF R&D -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -INCLUDE(UseQtExt) -INCLUDE(UsePyQt) - -# --- options --- - -# additional include directories -INCLUDE_DIRECTORIES( - ${QT_INCLUDES} - ${OpenCASCADE_INCLUDE_DIR} - ${PYTHON_INCLUDE_DIRS} - ${MEDFILE_INCLUDE_DIRS} - ${HDF5_INCLUDE_DIRS} - ${OMNIORB_INCLUDE_DIR} - ${KERNEL_INCLUDE_DIRS} - ${GUI_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_BINARY_DIR} - ${PROJECT_BINARY_DIR} - ${PROJECT_BINARY_DIR}/idl - ${PROJECT_BINARY_DIR}/adm_local/unix - ${PROJECT_SOURCE_DIR}/src/ADAPT - ${PROJECT_SOURCE_DIR}/src/ADAPT_I - ${PROJECT_SOURCE_DIR}/src/SMESH_I - ${PROJECT_SOURCE_DIR}/src/SMESH - ${MEDCOUPLING_INCLUDE_DIRS} -) - -# additional preprocessor / compiler flags -ADD_DEFINITIONS( - ${OMNIORB_DEFINITIONS} - ${OpenCASCADE_DEFINITIONS} - ${KERNEL_DEFINITIONS} -) - -# libraries to link to -SET(_link_LIBRARIES - ${MEDFILE_C_LIBRARIES} - ${KERNEL_SalomeLifeCycleCORBA} - ${KERNEL_SalomeDS} - ${GUI_SalomeApp} - ${SMESH_SalomeIDLSMESH} - ${SMESH_SMESHEngine} - ADAPTEngine - ${MEDCoupling_medloader} - SMESHimpl -) - -# --- resources --- - -# resource files / to be processed by lrelease -SET(_ts_RESOURCES - ADAPT_msg_en.ts - ADAPT_msg_fr.ts - ADAPT_msg_ja.ts -) - -# resource files / to be processed by uic -SET(_uic_FILES - CreateBoundaryCAO.ui - CreateBoundaryAn.ui - CreateBoundaryDi.ui - CreateCase.ui - CreateHypothesis.ui - CreateIteration.ui - CreateListGroup.ui - CreateYACS.ui - CreateZone.ui - EditFile.ui - IterInfo.ui - MeshInfo.ui - PursueIteration.ui -) - -# --- headers --- - -# header files / to be processed by moc -SET(_moc_HEADERS - MonCreateBoundaryCAO.h - MonCreateBoundaryAn.h - MonCreateBoundaryDi.h - MonEditBoundaryCAO.h - MonEditBoundaryAn.h - MonEditBoundaryDi.h - MonCreateCase.h - MonEditCase.h - MonCreateZone.h - MonEditZone.h - MonCreateHypothesis.h - MonEditHypothesis.h - MonCreateListGroup.h - MonCreateListGroupCAO.h - MonEditListGroup.h - MonEditListGroupCAO.h - MonCreateIteration.h - MonEditIteration.h - MonPursueIteration.h - MonMeshInfo.h - MonIterInfo.h - MonCreateYACS.h - MonEditYACS.h - MonEditFile.h - #~MG_ADAPTGUI.hxx -) - -# header files / uic wrappings -QT_WRAP_UIC(_uic_HEADERS ${_uic_FILES}) - -# header files / static -SET(_other_HEADERS - HOMARDGUI_Utils.h - HomardQtCommun.h - HOMARDGUI_Exports.hxx -) - -# header files / to install -SET(ADAPT_HEADERS ${_other_HEADERS} ${_moc_HEADERS} ${_uic_HEADERS}) - -# --- sources --- - -# sources / moc wrappings -QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS}) - -# sources / static -SET(_other_SOURCES - HOMARDGUI_Utils.cxx - MonCreateBoundaryCAO.cxx - MonCreateBoundaryAn.cxx - MonCreateBoundaryDi.cxx - MonEditBoundaryCAO.cxx - MonEditBoundaryAn.cxx - MonEditBoundaryDi.cxx - MonCreateCase.cxx - MonEditCase.cxx - MonCreateHypothesis.cxx - MonEditHypothesis.cxx - MonCreateListGroup.cxx - MonCreateListGroupCAO.cxx - MonEditListGroup.cxx - MonEditListGroupCAO.cxx - MonCreateIteration.cxx - MonEditIteration.cxx - MonPursueIteration.cxx - MonCreateZone.cxx - MonEditZone.cxx - MonMeshInfo.cxx - MonIterInfo.cxx - MonCreateYACS.cxx - MonEditYACS.cxx - MonEditFile.cxx - HomardQtCommun.cxx - #~MG_ADAPTGUI.cxx -) - -# sources / to compile -SET(ADAPT_SOURCES ${_other_SOURCES} ${_moc_SOURCES} ${_uic_HEADERS}) - -# --- rules --- - -ADD_LIBRARY(ADAPTGUI ${ADAPT_SOURCES}) -TARGET_LINK_LIBRARIES(ADAPTGUI ${_link_LIBRARIES} ) -INSTALL(TARGETS ADAPTGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) - -INSTALL(FILES ${ADAPT_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) -QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_ADAPT_INSTALL_RES_DATA}") diff --git a/src/ADAPTGUI/CreateBoundaryAn.ui b/src/ADAPTGUI/CreateBoundaryAn.ui deleted file mode 100644 index ac291082d..000000000 --- a/src/ADAPTGUI/CreateBoundaryAn.ui +++ /dev/null @@ -1,1107 +0,0 @@ - - - CreateBoundaryAn - - - - 0 - 0 - 522 - 835 - - - - Create an analytical boundary - - - true - - - true - - - - - - Name - - - - - - - 32 - - - - - - - - 0 - 0 - - - - - 340 - 0 - - - - Type of boundary - - - - - - Cylinder - - - - ../../resources/cylinderpointvector.png../../resources/cylinderpointvector.png - - - true - - - true - - - - - - - Sphere - - - - ../../resources/zone_spherepoint.png../../resources/zone_spherepoint.png - - - - - - - Cone - - - - ../../resources/cone.png../../resources/cone.png - - - - - - - Torus - - - - ../../resources/toruspointvector.png../../resources/toruspointvector.png - - - true - - - false - - - - - - - - - - - 0 - 0 - - - - Coordinates - - - - 9 - - - 6 - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - X centre - - - false - - - - - - - 5 - - - 1000000000.000000000000000 - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - Radius - - - false - - - - - - - - 0 - 0 - - - - Z centre - - - false - - - - - - - - 0 - 0 - - - - Y centre - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - X axis - - - false - - - - - - - - 0 - 0 - - - - Y axis - - - false - - - - - - - - 0 - 0 - - - - Z axis - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - - - - 0 - 0 - - - - Coordinates - - - - 9 - - - 6 - - - - - 5 - - - 0.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - Radius - - - false - - - - - - - - 0 - 0 - - - - Z centre - - - false - - - - - - - - 0 - 0 - - - - Y centre - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - X centre - - - false - - - - - - - - - - - 0 - 0 - - - - Coordinates - - - - - - Definition - - - - - - Radius - - - - ../../resources/conedxyz.png../../resources/conedxyz.png - - - true - - - - - - - Angle - - - - ../../resources/conepointvector.png../../resources/conepointvector.png - - - - - - - - - - - 0 - 0 - - - - X 1 - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - X 2 - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - Y 1 - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - Y 2 - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - Z 1 - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - Z 2 - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - V 1 - - - false - - - - - - - 5 - - - 1000000000.000000000000000 - - - - - - - - 0 - 0 - - - - V 2 - - - false - - - - - - - 5 - - - 1000000000.000000000000000 - - - - - - - - - - - 0 - 0 - - - - Coordinates - - - - - - - 0 - 0 - - - - X centre - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - X axis - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - Y centre - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - Y axis - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - Z centre - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - Z axis - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - R revolution - - - false - - - - - - - 5 - - - 1000000000.000000000000000 - - - - - - - - 0 - 0 - - - - Primary R - - - false - - - - - - - 5 - - - 1000000000.000000000000000 - - - - - - - - - - - 0 - 0 - - - - - - - - 9 - - - 6 - - - - - Help - - - - - - - Cancel - - - - - - - Apply - - - - - - - OK - - - - - - - - - - - diff --git a/src/ADAPTGUI/CreateBoundaryCAO.ui b/src/ADAPTGUI/CreateBoundaryCAO.ui deleted file mode 100644 index c74c60122..000000000 --- a/src/ADAPTGUI/CreateBoundaryCAO.ui +++ /dev/null @@ -1,133 +0,0 @@ - - - CreateBoundaryCAO - - - - 0 - 0 - 566 - 195 - - - - - 0 - 0 - - - - Get CAO - - - true - - - true - - - - 9 - - - 6 - - - - - - - - - 9 - - - 6 - - - - - Help - - - - - - - Cancel - - - - - - - Apply - - - - - - - OK - - - - - - - - - - Filtering with groups - - - - - - - - 370 - 21 - - - - - - - - - - - - - - - XAO - - - - - - - - 382 - 21 - - - - 32 - - - - - - - Name - - - - - - - - diff --git a/src/ADAPTGUI/CreateBoundaryDi.ui b/src/ADAPTGUI/CreateBoundaryDi.ui deleted file mode 100644 index b505ff869..000000000 --- a/src/ADAPTGUI/CreateBoundaryDi.ui +++ /dev/null @@ -1,133 +0,0 @@ - - - CreateBoundaryDi - - - - 0 - 0 - 566 - 169 - - - - - 0 - 0 - - - - Create a discrete boundary - - - true - - - true - - - - 9 - - - 6 - - - - - - - - - 9 - - - 6 - - - - - Help - - - - - - - Cancel - - - - - - - Apply - - - - - - - OK - - - - - - - - - - Filtering with groups - - - - - - - - 370 - 21 - - - - - - - - - - - - - - - Mesh - - - - - - - - 382 - 21 - - - - 32 - - - - - - - Name - - - - - - - - diff --git a/src/ADAPTGUI/CreateCase.ui b/src/ADAPTGUI/CreateCase.ui deleted file mode 100644 index 14fe44db9..000000000 --- a/src/ADAPTGUI/CreateCase.ui +++ /dev/null @@ -1,777 +0,0 @@ - - - CreateCase - - - - 0 - 0 - 600 - 1150 - - - - - 0 - 0 - - - - - 600 - 320 - - - - - 1 - 1 - - - - - 600 - 320 - - - - Create a case - - - true - - - - - - - - - Name - - - - - - - - - - - - - Qt::Horizontal - - - - 199 - 20 - - - - - - - - 6 - - - 0 - - - - - Directory - - - - - - - - - - false - - - - - - - - 382 - 21 - - - - - - - - - - Qt::Vertical - - - - 20 - 18 - - - - - - - - 6 - - - 0 - - - - - Mesh - - - - - - - - - - false - - - - - - - - 382 - 21 - - - - - - - - - - Qt::Vertical - - - - 20 - 0 - - - - - - - - Conformity type - - - - 6 - - - 9 - - - - - Conformal - - - true - - - - - - - Non conformal - - - - - - - - - - Boundary type - - - - 6 - - - 9 - - - - - No boundary - - - true - - - - - - - CAO - - - false - - - - - - - Non CAO - - - - - - - - - - Qt::Vertical - - - - 20 - 1 - - - - - - - - 6 - - - 0 - - - - - Discrete boundary - - - - - - - Analytical boundary - - - - - - - - - - 0 - 0 - - - - CAO - - - - 9 - - - 6 - - - - - Edit - - - false - - - - - - - Help - - - false - - - - - - - -1 - - - QComboBox::AdjustToContents - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 13 - - - - - - - - New - - - false - - - - - - - - - - Qt::Vertical - - - - 20 - 2 - - - - - - - - - 0 - 0 - - - - Discrete boundary - - - - 9 - - - 6 - - - - - -1 - - - QComboBox::AdjustToContents - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 13 - - - - - - - - Edit - - - false - - - - - - - Help - - - false - - - - - - - New - - - false - - - - - - - - - - - 548 - 200 - - - - Analytical boundary - - - - - - QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked - - - true - - - 0 - - - 1 - - - - a_virer - - - - - - - - 0 - - - 6 - - - - - Edit - - - false - - - - - - - New - - - false - - - - - - - Help - - - false - - - - - - - - - - - - Qt::Vertical - - - - 239 - 41 - - - - - - - - Advanced options - - - - - - - Advanced options - - - - - - Authorized pyramids - - - - - - - Conformity + - - - - - - - - Standard - - - true - - - - - - - Box - - - false - - - - - - - 1 node per edge - - - - - - - Free - - - - - - - - - Format - - - - - - MED - - - true - - - - - - - Saturne - - - - - - - Saturne 2D - - - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 128 - 13 - - - - - - - - Qt::Vertical - - - - 239 - 41 - - - - - - - - No comment. - - - - - - - Qt::Vertical - - - - 20 - 35 - - - - - - - - - - - - 9 - - - 6 - - - - - Help - - - false - - - - - - - Apply - - - false - - - - - - - OK - - - false - - - - - - - Cancel - - - false - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 128 - 25 - - - - - - WName - GBTypeConf - GBBoundaryD - GBBoundaryA - CBAdvanced - GBAdvancedOptions - Comment - GroupButtons - GBBoundaryC - GBTypeBoun - - - - diff --git a/src/ADAPTGUI/CreateHypothesis.ui b/src/ADAPTGUI/CreateHypothesis.ui deleted file mode 100644 index 53698b548..000000000 --- a/src/ADAPTGUI/CreateHypothesis.ui +++ /dev/null @@ -1,1111 +0,0 @@ - - - CreateHypothesis - - - - 0 - 0 - 848 - 1650 - - - - - 0 - 0 - - - - - 800 - 600 - - - - - 1 - 1 - - - - - 800 - 1200 - - - - Create a hypothesis - - - true - - - - - 0 - 0 - 844 - 1646 - - - - true - - - - - - - - - Name - - - - - - - - 282 - 31 - - - - - - - - - - - Qt::Horizontal - - - - 224 - 20 - - - - - - - - Type of adaptation - - - - 6 - - - 9 - - - - - Uniform - - - true - - - - - - - Driven by a field - - - - - - - With geometrical zones - - - - - - - - - - Qt::Horizontal - - - - 20 - 20 - - - - - - - - Filtering with groups - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Uniform adaptation - - - - 9 - - - 6 - - - - - Coarsening - - - - - - - Refinement - - - true - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - 9 - - - 6 - - - - - File of the fields - - - - - - - - 282 - 31 - - - - - - - - - - - - 0 - 0 - - - - Governing field for the adaptation - - - - 9 - - - 6 - - - - - 6 - - - 0 - - - - - Field name - - - - - - - - 0 - 0 - - - - false - - - QComboBox::AdjustToContents - - - - - - - Qt::Horizontal - - - - 48 - 20 - - - - - - - - - - 6 - - - 0 - - - - - QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked - - - true - - - 0 - - - 2 - - - - Selection - - - - - Component - - - - - - - - Qt::Horizontal - - - - 60 - 20 - - - - - - - - 6 - - - 0 - - - - - 6 - - - 0 - - - - - L2 norm - - - true - - - - - - - Infinite norm - - - false - - - - - - - - - Jump between elements - - - - - - - - - - - 6 - - - 0 - - - - - - 0 - 0 - - - - Refinement threshold - - - - 9 - - - 6 - - - - - Percentage of meshes - - - true - - - true - - - - - - - % - - - 3 - - - 100.000000000000000 - - - 0.100000000000000 - - - 2.000000000000000 - - - - - - - Relative - - - - - - - false - - - % - - - 3 - - - 100.000000000000000 - - - 0.100000000000000 - - - - - - - Absolute - - - - - - - false - - - 8 - - - -1000000000000.000000000000000 - - - 1000000000000.000000000000000 - - - 0.100000000000000 - - - - - - - Mean + n*(std deviation) - - - - - - - false - - - 8 - - - -1000000000000.000000000000000 - - - 1000000000000.000000000000000 - - - 0.100000000000000 - - - 3.000000000000000 - - - - - - - No refinement - - - - - - - - - - Coarsening threshold - - - - 9 - - - 6 - - - - - Percentage of meshes - - - true - - - false - - - - - - - false - - - % - - - 3 - - - 100.000000000000000 - - - 0.100000000000000 - - - - - - - Relative - - - - - - - false - - - % - - - 3 - - - 100.000000000000000 - - - 0.100000000000000 - - - - - - - Absolute - - - - - - - false - - - 8 - - - -1000000000000.000000000000000 - - - 1000000000000.000000000000000 - - - 0.100000000000000 - - - - - - - Mean - n*(std deviation) - - - - - - - false - - - 8 - - - -1000000000000.000000000000000 - - - 1000000000000.000000000000000 - - - 0.100000000000000 - - - 4.000000000000000 - - - - - - - No coarsening - - - true - - - - - - - - - - - - - - - - 0 - 0 - - - - Zone management - - - - - - - 400 - 0 - - - - QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked - - - true - - - 0 - - - 3 - - - - Refinement - - - - - Coarsening - - - - - Zone name - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 6 - - - 0 - - - - - 6 - - - 0 - - - - - New - - - - - - - Edit - - - - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 48 - - - - - - - - - - - - - Field Interpolation - - - - 9 - - - 6 - - - - - 0 - - - 6 - - - - - None - - - true - - - - - - - All - - - false - - - - - - - Chosen - - - false - - - - - - - - - - Selection - - - - - Field Name - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Advanced options - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Advanced options - - - - - - - 0 - 0 - - - - Minimal diameter - - - false - - - - - - - 7 - - - - - - - - 0 - 0 - - - - Maximal level - - - false - - - - - - - 99 - - - - - - - Initialization of adaptation - - - - - - Nothing - - - true - - - - - - - Refinement - - - - - - - Coarsening - - - - - - - - - - Output of the level of refinement - - - - - - - Output of the qualities - - - - - - - Output of the diameters - - - - - - - Output of the parents - - - - - - - Output of the neighbours - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - 9 - - - 6 - - - - - OK - - - - - - - Apply - - - - - - - Cancel - - - - - - - Help - - - - - - - - - - - - diff --git a/src/ADAPTGUI/CreateIteration.ui b/src/ADAPTGUI/CreateIteration.ui deleted file mode 100644 index 2cc2827c6..000000000 --- a/src/ADAPTGUI/CreateIteration.ui +++ /dev/null @@ -1,600 +0,0 @@ - - - CreateIteration - - - - 0 - 0 - 777 - 668 - - - - - 0 - 0 - - - - - 750 - 400 - - - - - 1 - 1 - - - - - 750 - 400 - - - - Create an iteration - - - true - - - - - 0 - 0 - 773 - 664 - - - - true - - - - - - Iteration Name - - - - - - - Qt::Horizontal - - - - 117 - 20 - - - - - - - - - 290 - 21 - - - - 64 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Previous iteration - - - - - - - true - - - - 50 - 27 - - - - - - - - - - - - 0 - 21 - - - - 64 - - - true - - - - - - - Mesh n - - - - - - - Qt::Horizontal - - - - 117 - 20 - - - - - - - - - 290 - 21 - - - - 64 - - - true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Mesh n+1 - - - - - - - Qt::Horizontal - - - - 117 - 20 - - - - - - - - - 290 - 21 - - - - 64 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Vertical - - - - 20 - 62 - - - - - - - - Field information - - - - 9 - - - 6 - - - - - - 282 - 21 - - - - - - - - Qt::Vertical - - - - 138 - 18 - - - - - - - - Chosen time step - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 255 - 13 - - - - - - - - -1 - - - 1010000 - - - -1 - - - - - - - Rank - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 13 - - - - - - - - -2 - - - 100000 - - - -1 - - - - - - - Time step - - - - - - - Qt::Vertical - - - - 138 - 28 - - - - - - - - Last time step - - - - - - - No time step - - - true - - - true - - - - - - - - - - - - - - Field file - - - - - - - - - - Qt::Horizontal - - - - 69 - 20 - - - - - - - - Qt::Vertical - - - - 20 - 22 - - - - - - - - Hypothesis - - - - 9 - - - 6 - - - - - -1 - - - QComboBox::AdjustToContents - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 13 - - - - - - - - Edit - - - - - - - New - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Vertical - - - - 20 - 21 - - - - - - - - - - - - 9 - - - 6 - - - - - OK - - - false - - - false - - - - - - - Apply - - - - - - - Cancel - - - - - - - Help - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 139 - 20 - - - - - - - - - - diff --git a/src/ADAPTGUI/CreateListGroup.ui b/src/ADAPTGUI/CreateListGroup.ui deleted file mode 100644 index 06c606110..000000000 --- a/src/ADAPTGUI/CreateListGroup.ui +++ /dev/null @@ -1,121 +0,0 @@ - - CreateListGroup - - - - 0 - 0 - 717 - 600 - - - - - 0 - 0 - 0 - 0 - - - - Selection of groups - - - true - - - true - - - - 9 - - - 6 - - - - - - - - - 9 - - - 6 - - - - - Help - - - - - - - Cancel - - - - - - - Apply - - - - - - - OK - - - - - - - - - - Selected groups - - - - 9 - - - 6 - - - - - true - - - 0 - - - 2 - - - - Selection - - - - - Group - - - - - - - - - - - - diff --git a/src/ADAPTGUI/CreateYACS.ui b/src/ADAPTGUI/CreateYACS.ui deleted file mode 100644 index 0e8f76c25..000000000 --- a/src/ADAPTGUI/CreateYACS.ui +++ /dev/null @@ -1,526 +0,0 @@ - - - CreateYACS - - - - 0 - 0 - 684 - 649 - - - - - 0 - 0 - - - - - 600 - 500 - - - - - 1 - 1 - - - - - 600 - 500 - - - - Create YACS - - - true - - - - - 0 - 0 - 680 - 645 - - - - true - - - - - - - - - Name - - - - - - - 32 - - - - - - - - - - Qt::Horizontal - - - - 131 - 20 - - - - - - - - - - Case - - - - - - - true - - - - 50 - 27 - - - - - - - - - - - - 382 - 21 - - - - - - - - - - 6 - - - 0 - - - - - Script - - - - - - - - - - false - - - - - - - - 382 - 21 - - - - - - - - - - 6 - - - 0 - - - - - Directory - - - - - - - - - - false - - - - - - - - 382 - 21 - - - - - - - - - - 6 - - - 0 - - - - - Mesh file - - - - - - - - - - false - - - - - - - - 382 - 21 - - - - - - - - - - Type of schema - - - - 6 - - - 9 - - - - - Constant - - - true - - - - - - - Variable - - - - - - - - - - Maximum of ... - - - - - - - 0 - 0 - - - - Iterations - - - false - - - - - - - 0 - - - 999999999 - - - 0 - - - - - - - - 0 - 0 - - - - Nodes - - - false - - - - - - - 0 - - - 999999999 - - - 1000 - - - 0 - - - - - - - - 0 - 0 - - - - Elements - - - false - - - - - - - 0 - - - 999999999 - - - 1000 - - - 0 - - - - - - - - - - Qt::Horizontal - - - - 269 - 20 - - - - - - - - Test of convergence - - - - - - None - - - true - - - - - - - Vtest > Vref - - - - - - - Vtest < Vref - - - - - - - Vref - - - - - - - 4 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - - - - - - - - Qt::Horizontal - - - - 269 - 20 - - - - - - - - - - - - 9 - - - 6 - - - - - Help - - - false - - - - - - - Apply - - - false - - - - - - - OK - - - false - - - - - - - Cancel - - - false - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 128 - 25 - - - - - - - - - - diff --git a/src/ADAPTGUI/CreateZone.ui b/src/ADAPTGUI/CreateZone.ui deleted file mode 100644 index 84a607516..000000000 --- a/src/ADAPTGUI/CreateZone.ui +++ /dev/null @@ -1,1139 +0,0 @@ - - - CreateZone - - - - 0 - 0 - 545 - 778 - - - - - 1 - 1 - - - - - 550 - 400 - - - - Create a zone - - - true - - - true - - - - - - Name - - - - - - - 32 - - - - - - - Qt::Horizontal - - - - 142 - 20 - - - - - - - - - 0 - 0 - - - - - 340 - 0 - - - - Type of zone - - - - 9 - - - 6 - - - - - Sphere - - - - ../../resources/zone_spherepoint.png../../resources/zone_spherepoint.png - - - - - - - Pipe - - - - ../../resources/pipe.png../../resources/pipe.png - - - - - - - Cylinder - - - - ../../resources/cylinderpointvector.png../../resources/cylinderpointvector.png - - - - - - - Box - - - - ../../resources/zone_boxdxyz.png../../resources/zone_boxdxyz.png - - - true - - - true - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Coordinates - - - - 9 - - - 6 - - - - - - 0 - 0 - - - - X mini - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - Y mini - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - Z mini - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - X maxi - - - false - - - - - - - - 0 - 0 - - - - Z maxi - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - Y maxi - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - - - - 0 - 0 - - - - Coordinates - - - - 9 - - - 6 - - - - - - 0 - 0 - - - - X centre - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - Y centre - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - Radius - - - false - - - - - - - 5 - - - 0.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - Z centre - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - - - - 0 - 0 - - - - Qt::TabFocus - - - Coordinates - - - - 9 - - - 6 - - - - - 5 - - - 1000000000.000000000000000 - - - - - - - - 0 - 0 - - - - Height - - - false - - - - - - - - 0 - 0 - - - - Radius - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - Z axis - - - false - - - - - - - - 0 - 0 - - - - Y axis - - - false - - - - - - - - 0 - 0 - - - - X axis - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - Y base - - - false - - - - - - - - 0 - 0 - - - - Z base - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - 5 - - - 1000000000.000000000000000 - - - - - - - - 0 - 0 - - - - X base - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - - - - 0 - 0 - - - - Coordinates - - - - 9 - - - 6 - - - - - - 0 - 0 - - - - Height - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - X base - - - false - - - - - - - 5 - - - 1000000000.000000000000000 - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - Internal radius - - - false - - - - - - - - 0 - 0 - - - - Z base - - - false - - - - - - - - 0 - 0 - - - - Y base - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - X axis - - - false - - - - - - - - 0 - 0 - - - - Y axis - - - false - - - - - - - - 0 - 0 - - - - Z axis - - - false - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - 5 - - - -999999999.000000000000000 - - - 999999999.000000000000000 - - - 0.000000000000000 - - - - - - - 5 - - - 1000000000.000000000000000 - - - - - - - - 0 - 0 - - - - External radius - - - false - - - - - - - 5 - - - 1000000000.000000000000000 - - - - - - - - - - - 0 - 0 - - - - - - - - 9 - - - 6 - - - - - Help - - - - - - - Cancel - - - - - - - Apply - - - - - - - OK - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - diff --git a/src/ADAPTGUI/EditFile.ui b/src/ADAPTGUI/EditFile.ui deleted file mode 100644 index bfccdc178..000000000 --- a/src/ADAPTGUI/EditFile.ui +++ /dev/null @@ -1,115 +0,0 @@ - - - EditFile - - - - 0 - 0 - 675 - 901 - - - - Edit a file - - - - 9 - - - 6 - - - - - Qt::Horizontal - - - - 331 - 49 - - - - - - - - - - - - 9 - - - 6 - - - - - Print - - - false - - - false - - - false - - - - - - - Quit - - - false - - - true - - - false - - - - - - - - - - Qt::Vertical - - - - 20 - 14 - - - - - - - - - 530 - 800 - - - - - Courier New - - - - - - - - - diff --git a/src/ADAPTGUI/HOMARDGUI_Exports.hxx b/src/ADAPTGUI/HOMARDGUI_Exports.hxx deleted file mode 100644 index 193b8124b..000000000 --- a/src/ADAPTGUI/HOMARDGUI_Exports.hxx +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef _HOMARDGUI_EXPORTS_H_ -#define _HOMARDGUI_EXPORTS_H_ - -#ifdef WIN32 - #if defined HOMARD_EXPORTS || defined Homard_EXPORTS - #define HOMARD_EXPORT __declspec( dllexport ) - #else - #define HOMARD_EXPORT __declspec( dllimport ) - #endif -#else - #define HOMARD_EXPORT -#endif - - -#endif //_HOMARDGUI_EXPORTS_H_ - diff --git a/src/ADAPTGUI/HOMARDGUI_Utils.cxx b/src/ADAPTGUI/HOMARDGUI_Utils.cxx deleted file mode 100644 index b89e4e743..000000000 --- a/src/ADAPTGUI/HOMARDGUI_Utils.cxx +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - - -#include "HOMARDGUI_Utils.h" - -#include "OB_Browser.h" - -#include "SUIT_Desktop.h" -#include "SUIT_Application.h" -#include "SUIT_Session.h" - -#include "LightApp_SelectionMgr.h" -#include "SalomeApp_Application.h" -#include "SalomeApp_Module.h" -#include "SalomeApp_Study.h" - -#include "SALOME_ListIO.hxx" - -#include "SALOMEconfig.h" -#include "utilities.h" -#include - - -#include -#include -#include -#ifndef WIN32 -#include -#endif - -SALOME_ListIO HOMARD_UTILS::mySelected; - -//================================================================ -// Function : GetActiveStudy -// Returne un pointeur sur l'etude active -//================================================================ -SUIT_Study* HOMARD_UTILS::GetActiveStudy() -{ - SUIT_Application* app = SUIT_Session::session()->activeApplication(); - if (app) - return app->activeStudy(); - else - return NULL; -} - -//================================================================ -// Function : getStudy -// Returne un pointeur sur l'etude active -//================================================================ -_PTR(Study) HOMARD_UTILS::getStudy() -{ - static _PTR(Study) _study; - if(!_study) - _study = SalomeApp_Application::getStudy(); - return _study; -} - -//================================================================ -// Function : updateObjBrowser -// Purpose : met a jour l arbre d 'etude pour Homard -//================================================================ -void HOMARD_UTILS::updateObjBrowser() -{ - SalomeApp_Application* app = dynamic_cast(SUIT_Session::session()->activeApplication()); - if (app) { - // Le nom identifiant doit etre la valeur du parametre - // name de la section HOMARD du fichier SalomeApp.xml - CAM_Module* module = app->module("Homard" ); - SalomeApp_Module* appMod = dynamic_cast( module ); - if ( appMod ) { - app->updateObjectBrowser(); - appMod->updateObjBrowser( true ); - } - else - MESSAGE( "--- ADAPT::updateObjBrowser: appMod = NULL"); - } -} - -//================================================================ -// Function : selectedIO -// Return the list of selected SALOME_InteractiveObject's -//================================================================ -const SALOME_ListIO& HOMARD_UTILS::selectedIO() -{ - SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* > ( SUIT_Session::session()->activeApplication() ); - LightApp_SelectionMgr* aSelectionMgr = app->selectionMgr(); - if( aSelectionMgr ) - { - aSelectionMgr->selectedObjects( mySelected ); - for (SALOME_ListIteratorOfListIO it (mySelected); it.More(); it.Next()) - SCRUTE(it.Value()->getEntry()); - }; - return mySelected; -} - -//================================================================ -// Function : IObjectCount -// Return the number of selected objects -//================================================================ -int HOMARD_UTILS::IObjectCount() -{ - SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); - LightApp_SelectionMgr* aSelectionMgr = app->selectionMgr(); - if( aSelectionMgr ) - { - aSelectionMgr->selectedObjects( mySelected ); - SCRUTE(mySelected.Extent()); - return mySelected.Extent(); - } - return 0; -} - -//================================================================ -// Function : firstIObject -// Purpose : Return the first selected object in the selected object list -//================================================================ -Handle(SALOME_InteractiveObject) HOMARD_UTILS::firstIObject() -{ - const SALOME_ListIO& aList = selectedIO(); - return aList.Extent() > 0 ? aList.First() : Handle(SALOME_InteractiveObject)(); -} - -//================================================================ -// Function : lastIObject -// Return the last selected object in the selected object list -//================================================================ -Handle(SALOME_InteractiveObject) HOMARD_UTILS::lastIObject() -{ - const SALOME_ListIO& aList = selectedIO(); - return aList.Extent() > 0 ? aList.Last() : Handle(SALOME_InteractiveObject)(); -} - -//================================================================ -// Retourne vrai si l'objet est du type voulu -// . Dans le cas d'un cas, d'une hypothese, d'une zone, on se contente -// d'une comparaison simple entre le type stocke et TypeObject. -// . Pour l'iteration, le type stocke en attribut est sous la forme -// "IterationHomard" + le nom de l'iteration precedente. -// Il faut donc regarder si la chaine commence par TypeObject. -// . Idem pour le fichier de messages : "Mess " + numero d'iteration -// -// On filtre ce genre de situation avec option : -// -1 : comparaison totale -// 0 : comparaison sur le debut de la chaine -//================================================================ -bool HOMARD_UTILS::isObject(_PTR(SObject) MonObj, QString TypeObject, int option) -{ -// MESSAGE("isObject, TypeObject = "<Value().c_str()); -// MESSAGE("Type = "<moduleName(aHomardGUI->moduleName()) : QString("") ; -// // WARNING/ATTENTION : si on savait recuperer la langue depuis les preferences, on ne ferait pas le passage par argument -// // SUIT_ResourceMgr* resMgr = getApp()->resourceMgr(); -// // SUIT_ResourceMgr* resMgr = myModule->getApp()->resourceMgr(); -// // QString langue = resMgr->stringValue("language", "language", "en"); -// // QString langue = "fr" ; -// MESSAGE(". LanguageShort " << LanguageShort.toStdString().c_str()) ; -// // Complement du fichier -// QString fichier = QString(LanguageShort+"/"+monFichierAide) ; -// MESSAGE(". Appel de onHelpContextModule avec :"); -// MESSAGE(" rep = "<< rep.toStdString().c_str()); -// MESSAGE(" fichier = "<< fichier.toStdString().c_str()); -// MESSAGE(" contexte = "<< contexte.toStdString().c_str()); -// -// app->onHelpContextModule(rep, fichier, contexte); -// } -} -//========================================================================================================= diff --git a/src/ADAPTGUI/HOMARDGUI_Utils.h b/src/ADAPTGUI/HOMARDGUI_Utils.h deleted file mode 100644 index a2f24a6e2..000000000 --- a/src/ADAPTGUI/HOMARDGUI_Utils.h +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef HOMARD_H_UTILS -#define HOMARD_H_UTILS - -#include "HOMARDGUI_Exports.hxx" - -#include - -#include -#include CORBA_CLIENT_HEADER(HOMARD_Cas) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) - -#include "SALOMEDSClient_definitions.hxx" -#include "SALOME_InteractiveObject.hxx" -#include "LightApp_DataOwner.h" -#include "SalomeApp_Application.h" -#include - -class QString; -class QStringList; - -class SUIT_ViewWindow; -class SUIT_Desktop; -class SUIT_Study; -class SUIT_ResourceMgr; - -class CAM_Module; - -class SALOMEDSClient_Study; -class SALOMEDSClient_SObject; - -class SalomeApp_Study; -class SalomeApp_Module; -class LightApp_SelectionMgr; - -namespace HOMARD_UTILS { - - HOMARD_EXPORT SUIT_Study* GetActiveStudy(); - HOMARD_EXPORT _PTR(Study) getStudy(); - - HOMARD_EXPORT void updateObjBrowser(); - - HOMARD_EXPORT const SALOME_ListIO& selectedIO(); // Function returns a list of SALOME_InteractiveObject's from - // selection manager in GUI - - HOMARD_EXPORT int IObjectCount() ; // Function returns the number of selected objects - - HOMARD_EXPORT Handle(SALOME_InteractiveObject) firstIObject() ; - // Function returns the first selected object in the list - // of selected objects - - HOMARD_EXPORT Handle(SALOME_InteractiveObject) lastIObject() ; - // Function returns the last selected object in the list - // of selected objects - - HOMARD_EXPORT bool isBoundaryCAO(_PTR(SObject) MonObj); - HOMARD_EXPORT bool isBoundaryAn(_PTR(SObject) MonObj); - HOMARD_EXPORT bool isBoundaryDi(_PTR(SObject) MonObj); - HOMARD_EXPORT bool isCase(_PTR(SObject) MonObj); - HOMARD_EXPORT bool isHypo(_PTR(SObject) MonObj); - HOMARD_EXPORT bool isIter(_PTR(SObject) MonObj); - HOMARD_EXPORT bool isYACS(_PTR(SObject) MonObj); - HOMARD_EXPORT bool isZone(_PTR(SObject) MonObj); - HOMARD_EXPORT bool isFileType(_PTR(SObject) MonObj, QString TypeFile); - HOMARD_EXPORT bool isObject(_PTR(SObject) MonObj, QString TypeObject, int option ); - - HOMARD_EXPORT void PushOnHelp(QString monFichierAide, QString contexte, QString LanguageShort); - - extern SALOME_ListIO mySelected; -} - -#endif // ifndef HOMARD_H_UTILS diff --git a/src/ADAPTGUI/HomardQtCommun.cxx b/src/ADAPTGUI/HomardQtCommun.cxx deleted file mode 100644 index a5762d03f..000000000 --- a/src/ADAPTGUI/HomardQtCommun.cxx +++ /dev/null @@ -1,453 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "HomardQtCommun.h" -#include "HOMARDGUI_Utils.h" - -#include - -#include -#include -#include -#include -#include -#ifndef WIN32 -#include -#endif -#include - - -#include "SalomeApp_Tools.h" - -using namespace std; - -#include - -// ============================================================================ -QString HOMARD_QT_COMMUN::SelectionArbreEtude(QString commentaire, int option ) -// ============================================================================ -// Retourne l'objet selectionne dans l'arbre d'etudes -// commentaire : -// . si le commentaire est une chaine vide, on ne tient pas compte du type de l'objet -// et on retourne le nom de cet objet -// . sinon : -// . si l'objet est du type defini par commentaire, retourne le nom de cet objet -// . sinon on retourne une QString("") -// option : -// . Si option = 0, ce n'est pas grave de ne rien trouver ; aucun message n'est emis -// . Si option = 1, ce n'est pas grave de ne rien trouver mais on emet un message -{ -// MESSAGE("SelectionArbreEtude : commentaire = " << commentaire.toStdString().c_str() << " et option = " << option); - int nbSel = HOMARD_UTILS::IObjectCount() ; - if ( nbSel == 0 ) - { - if ( option == 1 ) - { - QMessageBox::warning( 0, QObject::tr("HOM_WARNING"), - QObject::tr("HOM_SELECT_OBJECT_1") ); - } - return QString(""); - } - if ( nbSel > 1 ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_SELECT_OBJECT_2") ); - return QString(""); - } -// - Handle(SALOME_InteractiveObject) aIO = HOMARD_UTILS::firstIObject(); - if ( aIO->hasEntry() ) - { -// MESSAGE("aIO->getEntry() = " << aIO->getEntry()); - _PTR(Study) aStudy = HOMARD_UTILS::getStudy(); - _PTR(SObject) aSO ( aStudy->FindObjectID( aIO->getEntry() ) ); - _PTR(GenericAttribute) anAttr; - if (aSO->FindAttribute(anAttr, "AttributeComment") ) - { - if ( commentaire != "" ) - { - _PTR(AttributeComment) attributComment = anAttr; - QString aComment= QString(attributComment->Value().data()); -// MESSAGE("... aComment = " << aComment.toStdString().c_str()); - int iaux = aComment.lastIndexOf(commentaire); -// MESSAGE("... iaux = " << iaux); - if ( iaux !=0 ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_SELECT_OBJECT_3").arg(commentaire) ); - return QString(""); - } - } - if (aSO->FindAttribute(anAttr, "AttributeName") ) - { - _PTR(AttributeName) attributName = anAttr; - QString aName= QString(attributName->Value().data()); - return aName; - } - } - } -// - return QString(""); -} - -// ======================================================================= -QString HOMARD_QT_COMMUN::SelectionCasEtude() -// ======================================================================= -{ - QString aName = QString(""); - int nbSel = HOMARD_UTILS::IObjectCount() ; - if ( nbSel == 0 ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_SELECT_OBJECT_1") ); - return QString(""); - } - if ( nbSel > 1 ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_SELECT_OBJECT_2") ); - return QString(""); - } - Handle(SALOME_InteractiveObject) aIO = HOMARD_UTILS::firstIObject(); - if ( aIO->hasEntry() ) - { - _PTR(Study) aStudy = HOMARD_UTILS::getStudy(); - _PTR(SObject) aSO ( aStudy->FindObjectID( aIO->getEntry() ) ); - _PTR(SObject) aSObjCas = aSO->GetFather(); - _PTR(GenericAttribute) anAttr; - if (aSObjCas->FindAttribute(anAttr, "AttributeName") ) - { - _PTR(AttributeName) attributName = anAttr; - aName= QString(attributName->Value().data()); - } - return aName; - } - return QString(""); -} - -// ======================================================================= -QString HOMARD_QT_COMMUN::PushNomFichier(bool avertir, QString TypeFichier) -// ======================================================================= -// Gestion les boutons qui permettent de -// 1) retourne le nom d'un fichier par une fenetre de dialogue si aucun -// objet est selectionne dans l arbre d etude -// 2) retourne le nom du fichier asocie a l objet -// selectionne dans l arbre d etude -{ -// MESSAGE("PushNomFichier avec avertir "<hasEntry() ) - { - _PTR(Study) aStudy = HOMARD_UTILS::getStudy(); - _PTR(SObject) aSO ( aStudy->FindObjectID( aIO->getEntry() ) ); - _PTR(GenericAttribute) anAttr; - _PTR(AttributeFileType) aFileType; - _PTR(AttributeExternalFileDef) aFileName; - if (aSO) { - if (aSO->FindAttribute(anAttr, "AttributeFileType") ) { - aFileType=anAttr; - QString fileType=QString(aFileType->Value().data()); - if ( fileType==QString("FICHIERMED")) { - if (aSO->FindAttribute(anAttr,"AttributeExternalFileDef")) { - aFileName=anAttr; - aFile= QString(aFileName->Value().data()); } - } - } - } - } - - if ( aFile==QString::null ) - { - if ( avertir ) { - QMessageBox::warning( 0, QObject::tr("HOM_WARNING"), - QObject::tr("HOM_SELECT_STUDY") ); - } - aFile = QFileDialog::getOpenFileName(0, QObject::tr("HOM_SELECT_FILE_0"), QString(""), filtre ); - } - } - // B.3. Bizarre - else - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_SELECT_FILE_2") ); - } - - return aFile; -} -// ======================================================================= -med_idt HOMARD_QT_COMMUN::OuvrirFichier(QString aFile) -// ======================================================================= -// renvoie le medId associe au fichier Med apres ouverture -{ - med_idt medIdt = MEDfileOpen(aFile.toStdString().c_str(),MED_ACC_RDONLY); - if (medIdt <0) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_MED_FILE_1") ); - } - return medIdt; -} - -// ====================================================== -QString HOMARD_QT_COMMUN::LireNomMaillage(QString aFile) -// ======================================================== -{ - QString nomMaillage = "" ; - int erreur = 0 ; - med_idt medIdt ; - while ( erreur == 0 ) - { - // Ouverture du fichier - medIdt = HOMARD_QT_COMMUN::OuvrirFichier(aFile); - if ( medIdt < 0 ) - { - erreur = 1 ; - break ; - } - med_int numberOfMeshes = MEDnMesh(medIdt) ; - if (numberOfMeshes == 0 ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_MED_FILE_2") ); - erreur = 2 ; - break ; - } - if (numberOfMeshes > 1 ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_MED_FILE_3") ); - erreur = 3 ; - break ; - } - - nomMaillage = HOMARD_QT_COMMUN::LireNomMaillage2(medIdt,1); - break ; - } - // Fermeture du fichier - if ( medIdt > 0 ) MEDfileClose(medIdt); - - return nomMaillage; -} -// ======================================================================= -QString HOMARD_QT_COMMUN::LireNomMaillage2(med_idt medIdt ,int meshId) -// ======================================================================= -{ - QString NomMaillage=QString::null; - char meshname[MED_NAME_SIZE+1]; - med_int spacedim,meshdim; - med_mesh_type meshtype; - char descriptionription[MED_COMMENT_SIZE+1]; - char dtunit[MED_SNAME_SIZE+1]; - med_sorting_type sortingtype; - med_int nstep; - med_axis_type axistype; - int naxis = MEDmeshnAxis(medIdt,1); - char *axisname=new char[naxis*MED_SNAME_SIZE+1]; - char *axisunit=new char[naxis*MED_SNAME_SIZE+1]; - med_err aRet = MEDmeshInfo(medIdt, - meshId, - meshname, - &spacedim, - &meshdim, - &meshtype, - descriptionription, - dtunit, - &sortingtype, - &nstep, - &axistype, - axisname, - axisunit); - - if ( aRet < 0 ) { QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), \ - QObject::tr("HOM_MED_FILE_4") ); } - else { NomMaillage=QString(meshname); } - - delete[] axisname ; - delete[] axisunit ; - - return NomMaillage; -} - - -// ======================================================================= -std::list HOMARD_QT_COMMUN::GetListeChamps(QString aFile) -// ======================================================================= -{ -// Il faut voir si plusieurs maillages - - MESSAGE("GetListeChamps"); - std::list ListeChamp ; - - med_err erreur = 0 ; - med_idt medIdt ; - - while ( erreur == 0 ) - { - // Ouverture du fichier - SCRUTE(aFile.toStdString()); - medIdt = HOMARD_QT_COMMUN::OuvrirFichier(aFile); - if ( medIdt < 0 ) - { - erreur = 1 ; - break ; - } - // Lecture du nombre de champs - med_int ncha = MEDnField(medIdt) ; - if (ncha < 1 ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_MED_FILE_5") ); - erreur = 2 ; - break ; - } - // Lecture des caracteristiques des champs - for (int i=0; i< ncha; i++) - { -// Lecture du nombre de composantes - med_int ncomp = MEDfieldnComponent(medIdt,i+1); -// Lecture du type du champ, des noms des composantes et du nom de l'unite - char nomcha [MED_NAME_SIZE+1]; - char meshname[MED_NAME_SIZE+1]; - char * comp = (char*) malloc(ncomp*MED_SNAME_SIZE+1); - char * unit = (char*) malloc(ncomp*MED_SNAME_SIZE+1); - char dtunit[MED_SNAME_SIZE+1]; - med_bool local; - med_field_type typcha; - med_int nbofcstp; - erreur = MEDfieldInfo(medIdt,i+1,nomcha,meshname,&local,&typcha,comp,unit,dtunit,&nbofcstp) ; - free(comp); - free(unit); - if ( erreur < 0 ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_MED_FILE_6") ); - break ; - } - ListeChamp.push_back(QString(nomcha)); - } - break ; - } - // Fermeture du fichier - if ( medIdt > 0 ) MEDfileClose(medIdt); - - return ListeChamp; -} - -// ====================================================================================== -std::list HOMARD_QT_COMMUN::GetListeComposants(QString aFile, QString aChamp) -// ====================================================================================== -{ - MESSAGE ( "GetListeComposants pour le fichier " << aFile.toStdString().c_str()); - MESSAGE ( "GetListeComposants pour le champ " << aChamp.toStdString().c_str()); - - std::list ListeComposants; - - med_err erreur = 0 ; - med_idt medIdt ; - - while ( erreur == 0 ) - { - // Ouverture du fichier - SCRUTE(aFile.toStdString()); - medIdt = HOMARD_QT_COMMUN::OuvrirFichier(aFile); - if ( medIdt < 0 ) - { - erreur = 1 ; - break ; - } - // Lecture du nombre de champs - med_int ncha = MEDnField(medIdt) ; - if (ncha < 1 ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_MED_FILE_5") ); - erreur = 2 ; - break ; - } - // Lecture des caracteristiques des champs - for (int i=0; i< ncha; i++) - { -// Lecture du nombre de composantes - med_int ncomp = MEDfieldnComponent(medIdt,i+1); -// Lecture du type du champ, des noms des composantes et du nom de l'unite - char nomcha [MED_NAME_SIZE+1]; - char meshname[MED_NAME_SIZE+1]; - char * comp = (char*) malloc(ncomp*MED_SNAME_SIZE+1); - char * unit = (char*) malloc(ncomp*MED_SNAME_SIZE+1); - char dtunit[MED_SNAME_SIZE+1]; - med_bool local; - med_field_type typcha; - med_int nbofcstp; - erreur = MEDfieldInfo(medIdt,i+1,nomcha,meshname,&local,&typcha,comp,unit,dtunit,&nbofcstp) ; - free(unit); - if ( erreur < 0 ) - { - free(comp); - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_MED_FILE_6") ); - break ; - } - // Lecture des composantes si c'est le bon champ - if ( QString(nomcha) == aChamp ) - { - for (int j = 0; j 0 ) MEDfileClose(medIdt); - - return ListeComposants; -} diff --git a/src/ADAPTGUI/HomardQtCommun.h b/src/ADAPTGUI/HomardQtCommun.h deleted file mode 100644 index 32f32deff..000000000 --- a/src/ADAPTGUI/HomardQtCommun.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef HOMARDQTCOMMUN_H -#define HOMARDQTCOMMUN_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include "SALOME_Selection.h" -#include - -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) -#include CORBA_CLIENT_HEADER(HOMARD_Cas) - -#include -#include -#include - -class QComboBox; - - -namespace HOMARD_QT_COMMUN -{ - HOMARD_EXPORT QString PushNomFichier(bool avertir, QString TypeFichier=""); - HOMARD_EXPORT QString LireNomMaillage(QString aFile); - HOMARD_EXPORT QString LireNomMaillage2(med_idt Medidt,int MeshId); - - HOMARD_EXPORT med_idt OuvrirFichier(QString aFile); - - HOMARD_EXPORT std::list GetListeChamps(QString aFile); - HOMARD_EXPORT std::list GetListeComposants(QString aFile, QString aChamp); - - HOMARD_EXPORT QString SelectionArbreEtude(QString commentaire, int grave ); - HOMARD_EXPORT QString SelectionCasEtude(); - -}; - -#endif // HOMARDQTCOMMUN_H diff --git a/src/ADAPTGUI/IterInfo.ui b/src/ADAPTGUI/IterInfo.ui deleted file mode 100644 index 04b2664ae..000000000 --- a/src/ADAPTGUI/IterInfo.ui +++ /dev/null @@ -1,129 +0,0 @@ - - - IterInfo - - - - 0 - 0 - 420 - 220 - - - - - 0 - 0 - - - - Information on a mesh - - - true - - - - - - Options - - - - - - Quality - - - - - - - Connection - - - - - - - Diametre - - - - - - - Group size - - - - - - - Entanglement - - - - - - - - - - - - - - 9 - - - 6 - - - - - Help - - - false - - - - - - - Apply - - - false - - - - - - - OK - - - false - - - - - - - Cancel - - - false - - - - - - - - - - - diff --git a/src/ADAPTGUI/MeshInfo.ui b/src/ADAPTGUI/MeshInfo.ui deleted file mode 100644 index c3e55aa07..000000000 --- a/src/ADAPTGUI/MeshInfo.ui +++ /dev/null @@ -1,285 +0,0 @@ - - - MeshInfo - - - - 0 - 0 - 536 - 372 - - - - - 0 - 0 - - - - Information on a mesh - - - true - - - - - - 6 - - - 0 - - - - - Name - - - - - - - - 382 - 21 - - - - - - - - - - 6 - - - 0 - - - - - Directory - - - - - - - - - - false - - - - - - - - 382 - 21 - - - - - - - - - - Qt::Vertical - - - - 20 - 18 - - - - - - - - 6 - - - 0 - - - - - Mesh - - - - - - - - - - false - - - - - - - - 382 - 21 - - - - - - - - - - Qt::Vertical - - - - 20 - 1 - - - - - - - - Options - - - - - - Quality - - - - - - - Connection - - - - - - - Diametre - - - - - - - Group size - - - - - - - Entanglement - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - 9 - - - 6 - - - - - Help - - - false - - - - - - - Apply - - - false - - - - - - - OK - - - false - - - - - - - Cancel - - - false - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 128 - 25 - - - - - - - - - diff --git a/src/ADAPTGUI/MonCreateBoundaryAn.cxx b/src/ADAPTGUI/MonCreateBoundaryAn.cxx deleted file mode 100644 index c7f79c436..000000000 --- a/src/ADAPTGUI/MonCreateBoundaryAn.cxx +++ /dev/null @@ -1,809 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonCreateBoundaryAn.h" -#include "MonCreateCase.h" - -#include -#include - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include "HomardQtCommun.h" -#include - -#include -#include -#include -#include -#include - -#include "math.h" -#define PI 3.141592653589793 - -using namespace std; - -// ------------------------------------------------------------------------------------------------------------------------ -MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen0, - QString caseName) : -// ------------------------------------------------------------------------------------------------------------------------------ -/* Constructs a MonCreateBoundaryAn - appele pour une vraie creation - initialise un cylindre et non une sphere -*/ - QDialog(0), Ui_CreateBoundaryAn(), - _parent(parent), - _Name (""), - _aCaseName(caseName), - _Xmin(0), _Xmax(0), _Xincr(0), _Ymin(0), _Ymax(0), _Yincr(0), _Zmin(0), _Zmax(0), _Zincr(0), _DMax(0), - _Type(1), - _BoundaryAnXcentre(0), _BoundaryAnYcentre(0), _BoundaryAnZcentre(0), _BoundaryAnRayon(0), - _BoundaryAnXaxis(0), _BoundaryAnYaxis(0), _BoundaryAnZaxis(0), - _Xcentre(0), _Ycentre(0), _Zcentre(0), _Rayon(0), - _BoundaryAnXcone1(0), _BoundaryAnYcone1(0), _BoundaryAnZcone1(0), _BoundaryAnRayon1(0), - _BoundaryAnXcone2(0), _BoundaryAnYcone2(0), _BoundaryAnZcone2(0), _BoundaryAnRayon2(0), - _BoundaryAnXaxisCone(0), _BoundaryAnYaxisCone(0), _BoundaryAnZaxisCone(0), - _BoundaryAngle(0), - _BoundaryAnToreXcentre(0), _BoundaryAnToreYcentre(0), _BoundaryAnToreZcentre(0), - _BoundaryAnToreXaxe(0), _BoundaryAnToreYaxe(0), _BoundaryAnToreZaxe(0), - _BoundaryAnToreRRev(0), _BoundaryAnToreRPri(0), - Chgt (false) - { - MESSAGE("Constructeur") ; - myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0); - setupUi(this); - setModal(modal); - - // Gestion des icones - QPixmap pix ; - QIcon IS ; - SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - pix = resMgr->loadPixmap( "HOMARD", "spherepoint.png" ); - IS=QIcon(pix); - RBSphere->setIcon(IS); - pix = resMgr->loadPixmap( "HOMARD", "cylinderpointvector.png" ); - IS=QIcon(pix); - RBCylindre->setIcon(IS); - pix = resMgr->loadPixmap( "HOMARD", "cone.png" ); - IS=QIcon(pix); - RBCone->setIcon(IS); - pix = resMgr->loadPixmap( "HOMARD", "conepointvector.png" ); - IS=QIcon(pix); - RB_Def_angle->setIcon(IS); - pix = resMgr->loadPixmap( "HOMARD", "conedxyz.png" ); - IS=QIcon(pix); - RB_Def_radius->setIcon(IS); - pix = resMgr->loadPixmap( "HOMARD", "toruspointvector.png" ); - IS=QIcon(pix); - RBTore->setIcon(IS); - - InitConnect( ); - - SetNewName() ; - InitValBoundaryAn(); // Cherche les valeurs de la boite englobante le maillage - InitMinMax(); // Initialise les bornes des boutons - SetCylinder(); // Propose un cylindre en premier choix - } -// -------------------------------------------------------------------------------------------------------------- -MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, - ADAPT::ADAPT_Gen_var myAdaptGen0, - QString caseName): -// -------------------------------------------------------------------------------------------------------------- -// - QDialog(0), Ui_CreateBoundaryAn(), - myAdaptGen(myAdaptGen0), - _parent(parent), - _Name (""), - _aCaseName(caseName), - _Type(1), - _BoundaryAnXcentre(0), _BoundaryAnYcentre(0), _BoundaryAnZcentre(0), _BoundaryAnRayon(0), - _BoundaryAnXaxis(0), _BoundaryAnYaxis(0), _BoundaryAnZaxis(0), - // Pour affichage lors de l edition d une BoundaryAn sans nom de Cas - _Xcentre(0), _Ycentre(0), _Zcentre(0), _Rayon(0), - _Xmin(1), _Xmax(1), _Xincr(1), _Ymin(1), _Ymax(1), _Yincr(1), _Zmin(1), _Zmax(1), _Zincr(1), _DMax(1), - Chgt (false) - { - // MESSAGE("Debut de MonCreateBoundaryAn") - setupUi(this); - SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - QPixmap pix = resMgr->loadPixmap( "HOMARD", "spherepoint.png" ); - QIcon IS=QIcon(pix); - RBSphere->setIcon(IS); - QPixmap pix2 = resMgr->loadPixmap( "HOMARD", "cylinderpointvector.png" ); - QIcon IS2=QIcon(pix2); - RBCylindre->setIcon(IS2); - QPixmap pix3 = resMgr->loadPixmap( "HOMARD", "cone.png" ); - QIcon IS3=QIcon(pix3); - RBCone->setIcon(IS3); - QPixmap pix4 = resMgr->loadPixmap( "HOMARD", "conepointvector.png" ); - QIcon IS4=QIcon(pix4); - RB_Def_angle->setIcon(IS4); - QPixmap pix5 = resMgr->loadPixmap( "HOMARD", "conedxyz.png" ); - QIcon IS5=QIcon(pix5); - RB_Def_radius->setIcon(IS5); - setModal(true); - InitConnect(); - } - -// ------------------------------------------------------------------------ -MonCreateBoundaryAn::~MonCreateBoundaryAn() -// ------------------------------------------------------------------------ -{ - // no need to delete child widgets, Qt does it all for us -} -// ------------------------------------------------------------------------ -void MonCreateBoundaryAn::InitConnect() -// ------------------------------------------------------------------------ -{ - connect( RBCylindre, SIGNAL(clicked()) , this, SLOT(SetCylinder()) ) ; - connect( RBSphere, SIGNAL(clicked()) , this, SLOT(SetSphere()) ) ; - connect( RBCone, SIGNAL(clicked()) , this, SLOT(SetCone()) ) ; - connect( RB_Def_radius, SIGNAL(clicked()) , this, SLOT(SetConeR()) ); - connect( RB_Def_angle, SIGNAL(clicked()) , this, SLOT(SetConeA()) ); - connect( RBTore, SIGNAL(clicked()) , this, SLOT(SetTore()) ) ; - connect( buttonOk, SIGNAL( pressed() ), this, SLOT( PushOnOK() ) ); - connect( buttonApply, SIGNAL( pressed() ), this, SLOT( PushOnApply() ) ); - connect( buttonCancel, SIGNAL( pressed() ), this, SLOT( close() ) ); - connect( buttonHelp, SIGNAL( pressed() ), this, SLOT( PushOnHelp() ) ); -} -// ------------------------------------------------------------------------ -void MonCreateBoundaryAn::InitValBoundaryAn() -// ------------------------------------------------------------------------ -{ -// -// 1. Les coordonnees extremes du maillage -// - if (_aCaseName == QString("")) { return; } - - ADAPT::HOMARD_Cas_var aCas = myAdaptGen->GetCase(_aCaseName.toStdString().c_str()); - ADAPT::extrema_var MesExtremes = aCas->GetBoundingBox(); - int num = MesExtremes->length() ; - ASSERT(num == 10); - _Xmin=MesExtremes[0]; _Xmax=MesExtremes[1]; _Xincr=MesExtremes[2]; - _Ymin=MesExtremes[3]; _Ymax=MesExtremes[4]; _Yincr=MesExtremes[5]; - _Zmin=MesExtremes[6]; _Zmax=MesExtremes[7]; _Zincr=MesExtremes[8]; - _DMax=MesExtremes[9]; - MESSAGE ("_Xmin : " << _Xmin << " _Xmax : " << _Xmax << " _Xincr : " << _Xincr ) ; - MESSAGE ("_Ymin : " << _Ymin << " _Ymax : " << _Ymax << " _Yincr : " << _Yincr ) ; - MESSAGE ("_Zmin : " << _Zmin << " _Zmax : " << _Zmax << " _Zincr : " << _Zincr) ; - MESSAGE ("_DMax : " << _DMax); - -// 2. Caracteristiques des frontieres -// en X - _Xcentre=(_Xmin + _Xmax)/2.; -// en Y - _Ycentre=(_Ymin + _Ymax)/2.; -// en Z - _Zcentre=(_Zmin + _Zmax)/2.; -// Rayon - _Rayon= _DMax/4.; -} - -// ------------------------------------------------------------------------ -void MonCreateBoundaryAn::InitMinMax() -// ------------------------------------------------------------------------ -{ - // Cylindre - // . X du centre - SpinBox_Xcent->setValue(_Xcentre); - SpinBox_Xcent->setSingleStep(_Xincr); - // . Y du centre - SpinBox_Ycent->setValue(_Ycentre); - SpinBox_Ycent->setSingleStep(_Yincr); - // . Z du centre - SpinBox_Zcent->setValue(_Zcentre); - SpinBox_Zcent->setSingleStep(_Zincr); - // . X de l'axe - SpinBox_Xaxis->setValue(0.); - SpinBox_Xaxis->setSingleStep(0.1); - // . Y de l'axe - SpinBox_Yaxis->setValue(0.); - SpinBox_Yaxis->setSingleStep(0.1); - // . Z de l'axe - SpinBox_Zaxis->setValue(1.); - SpinBox_Zaxis->setSingleStep(0.1); - // . Rayon - SpinBox_Radius->setValue(_Rayon); - SpinBox_Radius->setSingleStep(_Rayon/10.); - - // Sphere - // . X du centre - SpinBox_Xcentre->setValue(_Xcentre); - SpinBox_Xcentre->setSingleStep(_Xincr); - // . Y du centre - SpinBox_Ycentre->setValue(_Ycentre); - SpinBox_Ycentre->setSingleStep(_Yincr); - // . Z du centre - SpinBox_Zcentre->setValue(_Zcentre); - SpinBox_Zcentre->setSingleStep(_Zincr); - // . Rayon - SpinBox_Rayon->setValue(_Rayon); - SpinBox_Rayon->setSingleStep(_Rayon/10.); - - // Cone en rayons - // . X des centres - _BoundaryAnXcone1 = _Xcentre ; - SpinBox_Cone_X1->setSingleStep(_Xincr); - _BoundaryAnXcone2 = _Xcentre ; - SpinBox_Cone_X2->setSingleStep(_Xincr); - // . Y des centres - _BoundaryAnYcone1 = _Ycentre ; - SpinBox_Cone_Y1->setSingleStep(_Yincr); - _BoundaryAnYcone2 = _Ycentre ; - SpinBox_Cone_Y2->setSingleStep(_Yincr); - // . Z des centres - _BoundaryAnZcone1 = _Zmin ; - SpinBox_Cone_Z1->setSingleStep(_Zincr); - _BoundaryAnZcone2 = _Zmax ; - SpinBox_Cone_Z2->setSingleStep(_Zincr); - // . Rayons/Angles - _BoundaryAnRayon1 = 0. ; - _BoundaryAnRayon2 = _Rayon ; - SpinBox_Cone_V2->setSingleStep(_Rayon/10.); - - // Cone en angle - convertRayonAngle(1) ; - SpinBox_Cone_X1->setValue(_BoundaryAnXaxisCone); - SpinBox_Cone_Y1->setValue(_BoundaryAnYaxisCone); - SpinBox_Cone_Z1->setValue(_BoundaryAnZaxisCone); - SpinBox_Cone_V1->setValue(_BoundaryAngle); - SpinBox_Cone_X2->setValue(_BoundaryAnXorigCone); - SpinBox_Cone_Y2->setValue(_BoundaryAnYorigCone); - SpinBox_Cone_Z2->setValue(_BoundaryAnZorigCone); - - // Tore - // . X du centre - SpinBoxToreXcent->setValue(_Xcentre); - SpinBoxToreXcent->setSingleStep(_Xincr); - // . Y du centre - SpinBoxToreYcent->setValue(_Ycentre); - SpinBoxToreYcent->setSingleStep(_Yincr); - // . Z du centre - SpinBoxToreZcent->setValue(_Zcentre); - SpinBoxToreZcent->setSingleStep(_Zincr); - // . X de l'axe - SpinBoxToreXaxe->setValue(0.); - SpinBoxToreXaxe->setSingleStep(0.1); - // . Y de l'axe - SpinBoxToreYaxe->setValue(0.); - SpinBoxToreYaxe->setSingleStep(0.1); - // . Z de l'axe - SpinBoxToreZaxe->setValue(1.); - SpinBoxToreZaxe->setSingleStep(0.1); - // . Rayon de revolution - SpinBoxToreRRev->setValue(_Rayon); - SpinBoxToreRRev->setSingleStep(_Rayon/10.); - // . Rayon primaire - SpinBoxToreRPri->setValue(_Rayon/3.); - SpinBoxToreRPri->setSingleStep(_Rayon/20.); -} -// ------------------------------------------------------------------------ -bool MonCreateBoundaryAn::PushOnApply() -// ------------------------------------------------------------------------ -// Appele lorsque l'un des boutons Ok ou Apply est presse -// -{ - if (LEName->text().trimmed()=="") - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_BOUN_NAME") ); - return false; - } - - switch (_Type) - { - case 1 : // il s agit d un cylindre - { - if ((_BoundaryAnXcentre != SpinBox_Xcent->value()) || - (_BoundaryAnYcentre != SpinBox_Ycent->value()) || - (_BoundaryAnZcentre != SpinBox_Zcent->value()) || - (_BoundaryAnRayon != SpinBox_Radius->value()) || - (_BoundaryAnXaxis != SpinBox_Xaxis->value()) || - (_BoundaryAnYaxis != SpinBox_Yaxis->value()) || - (_BoundaryAnZaxis != SpinBox_Zaxis->value()) ) - { - Chgt = true; - _BoundaryAnXaxis= SpinBox_Xaxis->value(); - _BoundaryAnYaxis= SpinBox_Yaxis->value(); - _BoundaryAnZaxis= SpinBox_Zaxis->value(); - _BoundaryAnXcentre=SpinBox_Xcent->value(); - _BoundaryAnYcentre=SpinBox_Ycent->value(); - _BoundaryAnZcentre=SpinBox_Zcent->value(); - _BoundaryAnRayon=SpinBox_Radius->value(); - } - break; - } - - case 2 : // il s agit d une sphere - { - if ((_BoundaryAnXcentre != SpinBox_Xcentre->value()) || - (_BoundaryAnYcentre != SpinBox_Ycentre->value()) || - (_BoundaryAnZcentre != SpinBox_Zcentre->value()) || - (_BoundaryAnRayon != SpinBox_Rayon->value()) ) - { - Chgt = true; - _BoundaryAnXcentre=SpinBox_Xcentre->value(); - _BoundaryAnYcentre=SpinBox_Ycentre->value(); - _BoundaryAnZcentre=SpinBox_Zcentre->value(); - _BoundaryAnRayon=SpinBox_Rayon->value(); - } - break; - } - - case 3 : // il s agit d un cone defini par un axe et un angle - { - if ((_BoundaryAnXaxisCone != SpinBox_Cone_X1->value()) || - (_BoundaryAnYaxisCone != SpinBox_Cone_Y1->value()) || - (_BoundaryAnZaxisCone != SpinBox_Cone_Z1->value()) || - (_BoundaryAnXorigCone != SpinBox_Cone_X2->value()) || - (_BoundaryAnYorigCone != SpinBox_Cone_Y2->value()) || - (_BoundaryAnZorigCone != SpinBox_Cone_Z2->value()) || - (_BoundaryAngle != SpinBox_Cone_V1->value()) ) - { - Chgt = true; - _BoundaryAnXaxisCone = SpinBox_Cone_X1->value() ; - _BoundaryAnYaxisCone = SpinBox_Cone_Y1->value() ; - _BoundaryAnZaxisCone = SpinBox_Cone_Z1->value() ; - _BoundaryAnXorigCone = SpinBox_Cone_X2->value() ; - _BoundaryAnYorigCone = SpinBox_Cone_Y2->value() ; - _BoundaryAnZorigCone = SpinBox_Cone_Z2->value() ; - _BoundaryAngle = SpinBox_Cone_V1->value() ; - } - break; - } - - case 4 : // il s agit d un cone defini par les 2 rayons - { - if ((_BoundaryAnXcone1 != SpinBox_Cone_X1->value()) || - (_BoundaryAnYcone1 != SpinBox_Cone_Y1->value()) || - (_BoundaryAnZcone1 != SpinBox_Cone_Z1->value()) || - (_BoundaryAnRayon1 != SpinBox_Cone_V1->value()) || - (_BoundaryAnXcone2 != SpinBox_Cone_X2->value()) || - (_BoundaryAnYcone2 != SpinBox_Cone_Y2->value()) || - (_BoundaryAnZcone2 != SpinBox_Cone_Z2->value()) || - (_BoundaryAnRayon2 != SpinBox_Cone_V2->value()) ) - { - Chgt = true; - _BoundaryAnXcone1 = SpinBox_Cone_X1->value() ; - _BoundaryAnYcone1 = SpinBox_Cone_Y1->value() ; - _BoundaryAnZcone1 = SpinBox_Cone_Z1->value() ; - _BoundaryAnRayon1 = SpinBox_Cone_V1->value() ; - _BoundaryAnXcone2 = SpinBox_Cone_X2->value() ; - _BoundaryAnYcone2 = SpinBox_Cone_Y2->value() ; - _BoundaryAnZcone2 = SpinBox_Cone_Z2->value() ; - _BoundaryAnRayon2 = SpinBox_Cone_V2->value() ; - } - break; - } - case 5 : // il s agit d un tore - { - if ((_BoundaryAnToreXcentre != SpinBoxToreXcent->value()) || - (_BoundaryAnToreYcentre != SpinBoxToreYcent->value()) || - (_BoundaryAnToreZcentre != SpinBoxToreZcent->value()) || - (_BoundaryAnToreRRev != SpinBoxToreRRev->value()) || - (_BoundaryAnToreRPri != SpinBoxToreRPri->value()) || - (_BoundaryAnToreXaxe != SpinBoxToreXaxe->value()) || - (_BoundaryAnToreYaxe != SpinBoxToreYaxe->value()) || - (_BoundaryAnToreZaxe != SpinBoxToreZaxe->value()) ) - { - Chgt = true; - _BoundaryAnToreXcentre= SpinBoxToreXcent->value(); - _BoundaryAnToreYcentre= SpinBoxToreYcent->value(); - _BoundaryAnToreZcentre= SpinBoxToreZcent->value(); - _BoundaryAnToreRRev=SpinBoxToreRRev->value(); - _BoundaryAnToreRPri=SpinBoxToreRPri->value(); - _BoundaryAnToreXaxe=SpinBoxToreXaxe->value(); - _BoundaryAnToreYaxe=SpinBoxToreYaxe->value(); - _BoundaryAnToreZaxe=SpinBoxToreZaxe->value(); - } - break; - } - - } - -// Controles -// L'axe pour un cylindre - if ( _Type == 5 ) - { - double daux = _BoundaryAnXaxis*_BoundaryAnXaxis + _BoundaryAnYaxis*_BoundaryAnYaxis + _BoundaryAnZaxis*_BoundaryAnZaxis ; - if ( daux < 0.0000001 ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_AXE") ); - return false; - } - } - -// -// Création ou mise à jour de la frontière -// - bool bOK = CreateOrUpdateBoundaryAn(); - - if ( bOK ) { HOMARD_UTILS::updateObjBrowser() ; } - - return bOK; - -} -// --------------------------------------------------- -bool MonCreateBoundaryAn::CreateOrUpdateBoundaryAn() -//---------------------------------------------------- -// Creation de l'objet boundary -{ - MESSAGE("Debut de CreateOrUpdateBoundaryAn avec _Type ="<<_Type<<", _Name ="<<_Name.toStdString().c_str()<<" et LEName ="<text().trimmed().toStdString().c_str()); -// - if (_Name != LEName->text().trimmed()) - { - _Name = LEName->text().trimmed() ; - try - { - switch (_Type) - { - case 1 : // il s agit d un cylindre - { aBoundaryAn = myAdaptGen->CreateBoundaryCylinder(CORBA::string_dup(_Name.toStdString().c_str()), \ - _BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnXaxis, _BoundaryAnYaxis, _BoundaryAnZaxis, _BoundaryAnRayon ); - break; - } - case 2 : // il s agit d une sphere - { aBoundaryAn = myAdaptGen->CreateBoundarySphere(CORBA::string_dup(_Name.toStdString().c_str()), \ - _BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnRayon); - break; - } - case 3 : // il s agit d un cone defini par un axe et un angle - { aBoundaryAn = myAdaptGen->CreateBoundaryConeA(CORBA::string_dup(_Name.toStdString().c_str()), \ - _BoundaryAnXaxisCone, _BoundaryAnYaxisCone, _BoundaryAnZaxisCone, _BoundaryAngle, \ - _BoundaryAnXorigCone, _BoundaryAnYorigCone, _BoundaryAnYorigCone); - break; - } - case 4 : // il s agit d un cone defini par les 2 rayons - { aBoundaryAn = myAdaptGen->CreateBoundaryConeR(CORBA::string_dup(_Name.toStdString().c_str()), \ - _BoundaryAnXcone1, _BoundaryAnYcone1, _BoundaryAnZcone1, _BoundaryAnRayon1, \ - _BoundaryAnXcone2, _BoundaryAnYcone2, _BoundaryAnZcone2, _BoundaryAnRayon2); - break; - } - case 5 : // il s agit d un tore - { aBoundaryAn = myAdaptGen->CreateBoundaryTorus(CORBA::string_dup(_Name.toStdString().c_str()), \ - _BoundaryAnToreXcentre, _BoundaryAnToreYcentre, _BoundaryAnToreZcentre, _BoundaryAnToreXaxe, _BoundaryAnToreYaxe, _BoundaryAnToreZaxe, _BoundaryAnToreRRev, _BoundaryAnToreRPri ); - break; - } - } - } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - return false ; - } - _parent->AddBoundaryAn(_Name); - - return true; - } - else { - QMessageBox::warning( 0, QObject::tr("HOM_WARNING"), - QObject::tr("HOM_SELECT_OBJECT_4") ); - return false ; - } - MESSAGE("Fin de CreateOrUpdateBoundaryAn"); -} -// ------------------------------------------------------------------------ -void MonCreateBoundaryAn::PushOnOK() -// ------------------------------------------------------------------------ -{ - if (PushOnApply()) this->close(); -} -// ------------------------------------------------------------------------ -void MonCreateBoundaryAn::PushOnHelp() -// ------------------------------------------------------------------------ -{ - std::string LanguageShort = myAdaptGen->GetLanguageShort(); - HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("un-cylindre"), QString(LanguageShort.c_str())); -} - -// ----------------------------------- -void MonCreateBoundaryAn::SetNewName() -// ----------------------------------- -{ -// Recherche d'un nom par defaut qui n'existe pas encore - - ADAPT::listeBoundarys_var MyObjects = myAdaptGen->GetAllBoundarysName(); - int num = 0; QString aName=""; - while (aName=="" ) - { - aName.setNum(num+1) ; - aName.insert(0, QString("Boun_")) ; - for ( int i=0; ilength(); i++) - { - if ( aName == QString(MyObjects[i])) - { - num ++ ; - aName = "" ; - break ; - } - } - } - LEName->setText(aName); -} -// ------------------------------------------------------------------------ -void MonCreateBoundaryAn::SetCylinder() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetCylinder") - gBCylindre->setVisible(1); - gBSphere->setVisible(0); - gBCone->setVisible(0); - gBTore->setVisible(0); -// - _Type=1; -// - adjustSize(); -// MESSAGE("Fin de SetCylinder") -} -// ------------------------------------------------------------------------ -void MonCreateBoundaryAn::SetSphere() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetSphere") - gBCylindre->setVisible(0); - gBSphere->setVisible(1); - gBCone->setVisible(0); - gBTore->setVisible(0); -// - _Type=2; -// - adjustSize(); -// MESSAGE("Fin de SetSphere") -} -// ------------------------------------------------------------------------ -void MonCreateBoundaryAn::SetConeR() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetConeR") -// -// Stockage et conversion des valeurs si elles ont change - if ((_BoundaryAnXaxisCone != SpinBox_Cone_X1->value()) || - (_BoundaryAnYaxisCone != SpinBox_Cone_Y1->value()) || - (_BoundaryAnZaxisCone != SpinBox_Cone_Z1->value()) || - (_BoundaryAnXorigCone != SpinBox_Cone_X2->value()) || - (_BoundaryAnYorigCone != SpinBox_Cone_Y2->value()) || - (_BoundaryAnZorigCone != SpinBox_Cone_Z2->value()) || - (_BoundaryAngle != SpinBox_Cone_V1->value()) ) - { - MESSAGE("Stockage et conversion") - _BoundaryAnXaxisCone = SpinBox_Cone_X1->value() ; - _BoundaryAnYaxisCone = SpinBox_Cone_Y1->value() ; - _BoundaryAnZaxisCone = SpinBox_Cone_Z1->value() ; - _BoundaryAnXorigCone = SpinBox_Cone_X2->value() ; - _BoundaryAnYorigCone = SpinBox_Cone_Y2->value() ; - _BoundaryAnZorigCone = SpinBox_Cone_Z2->value() ; - _BoundaryAngle = SpinBox_Cone_V1->value() ; - convertRayonAngle(-1) ; - } -// - _Type=4; -// - TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X centre 1", 0)); - SpinBox_Cone_X1->setValue(_BoundaryAnXcone1); - TLCone_Y1->setText(QApplication::translate("CreateBoundaryAn", "Y centre 1", 0)); - SpinBox_Cone_Y1->setValue(_BoundaryAnYcone1); - TLCone_Z1->setText(QApplication::translate("CreateBoundaryAn", "Z centre 1", 0)); - SpinBox_Cone_Z1->setValue(_BoundaryAnZcone1); -// - TLCone_V1->setText(QApplication::translate("CreateBoundaryAn", "Radius 1", 0)); - SpinBox_Cone_V1->setSingleStep(_Rayon/10.); - SpinBox_Cone_V1->setMaximum(100000.*_DMax); - SpinBox_Cone_V1->setValue(_BoundaryAnRayon1); -// - TLCone_X2->setText(QApplication::translate("CreateBoundaryAn", "X centre 2", 0)); - SpinBox_Cone_X2->setValue(_BoundaryAnXcone2); - TLCone_Y2->setText(QApplication::translate("CreateBoundaryAn", "Y centre 2", 0)); - SpinBox_Cone_Y2->setValue(_BoundaryAnYcone2); - TLCone_Z2->setText(QApplication::translate("CreateBoundaryAn", "Z centre 2", 0)); - SpinBox_Cone_Z2->setValue(_BoundaryAnZcone2); -// - TLCone_V2->setVisible(1); - SpinBox_Cone_V2->setVisible(1); - TLCone_V2->setText(QApplication::translate("CreateBoundaryAn", "Radius 2", 0)); - SpinBox_Cone_V2->setValue(_BoundaryAnRayon2); -// -// MESSAGE("Fin de SetConeR") -} -// ------------------------------------------------------------------------ -void MonCreateBoundaryAn::SetConeA() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetConeA") -// Stockage et conversion des valeurs si elles ont change - if ((_BoundaryAnXcone1 != SpinBox_Cone_X1->value()) || - (_BoundaryAnYcone1 != SpinBox_Cone_Y1->value()) || - (_BoundaryAnZcone1 != SpinBox_Cone_Z1->value()) || - (_BoundaryAnRayon1 != SpinBox_Cone_V1->value()) || - (_BoundaryAnXcone2 != SpinBox_Cone_X2->value()) || - (_BoundaryAnYcone2 != SpinBox_Cone_Y2->value()) || - (_BoundaryAnZcone2 != SpinBox_Cone_Z2->value()) || - (_BoundaryAnRayon2 != SpinBox_Cone_V2->value()) ) - { - MESSAGE("Stockage et conversion") - _BoundaryAnXcone1 = SpinBox_Cone_X1->value() ; - _BoundaryAnYcone1 = SpinBox_Cone_Y1->value() ; - _BoundaryAnZcone1 = SpinBox_Cone_Z1->value() ; - _BoundaryAnRayon1 = SpinBox_Cone_V1->value() ; - _BoundaryAnXcone2 = SpinBox_Cone_X2->value() ; - _BoundaryAnYcone2 = SpinBox_Cone_Y2->value() ; - _BoundaryAnZcone2 = SpinBox_Cone_Z2->value() ; - _BoundaryAnRayon2 = SpinBox_Cone_V2->value() ; - convertRayonAngle(1) ; - } -// - _Type=3; -// - TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X axis", 0)); - SpinBox_Cone_X1->setValue(_BoundaryAnXaxisCone); - TLCone_Y1->setText(QApplication::translate("CreateBoundaryAn", "Y axis", 0)); - SpinBox_Cone_Y1->setValue(_BoundaryAnYaxisCone); - TLCone_Z1->setText(QApplication::translate("CreateBoundaryAn", "Z axis", 0)); - SpinBox_Cone_Z1->setValue(_BoundaryAnZaxisCone); -// - TLCone_X2->setText(QApplication::translate("CreateBoundaryAn", "X centre", 0)); - SpinBox_Cone_X2->setValue(_BoundaryAnXorigCone); - TLCone_Y2->setText(QApplication::translate("CreateBoundaryAn", "Y centre", 0)); - SpinBox_Cone_Y2->setValue(_BoundaryAnYorigCone); - TLCone_Z2->setText(QApplication::translate("CreateBoundaryAn", "Z centre", 0)); - SpinBox_Cone_Z2->setValue(_BoundaryAnZorigCone); -// - TLCone_V1->setText(QApplication::translate("CreateBoundaryAn", "Angle", 0)); - SpinBox_Cone_V1->setValue(_BoundaryAngle); - SpinBox_Cone_V1->setSingleStep(1.); - SpinBox_Cone_V1->setMaximum(90.); -// - TLCone_V2->setVisible(0); - SpinBox_Cone_V2->setVisible(0); -// MESSAGE("Fin de SetConeA") -} - - -// ------------------------------------------------------------------------ -void MonCreateBoundaryAn::SetCone() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetCone") - gBCylindre->setVisible(0); - gBSphere->setVisible(0); - gBCone->setVisible(1); - gBTore->setVisible(0); -// - if ( RB_Def_radius->isChecked() ) - { - SetConeR(); - } - else - { - SetConeA(); - } -// - adjustSize(); -// MESSAGE("Fin de SetCone") -} -// ------------------------------------------------------------------------ -void MonCreateBoundaryAn::SetTore() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetTore") - gBCylindre->setVisible(0); - gBSphere->setVisible(0); - gBCone->setVisible(0); - gBTore->setVisible(1); -// - _Type=5; -// - adjustSize(); -// MESSAGE("Fin de SetTore") -} -// ------------------------------------------------------------------------ -void MonCreateBoundaryAn::convertRayonAngle(int option) -// ------------------------------------------------------------------------ -// Conversion entre les deux formulations du cone : -// par deux rayons ou avec un axe et un angle. -// Voir sfcoi1 de HOMARD -{ - MESSAGE("Debut de convertRayonAngle, option = "< BO = AB*RB/(RA-RB) -// Angle : tg(alpha) = RA/AO -// - double daux ; -// De rayon vers angle : - if ( option == 1 ) - { - double xa, ya, za, ra ; - double xb, yb, zb, rb ; -// Positionnement de A vers B, avec RA>RB - if ( _BoundaryAnRayon1 > _BoundaryAnRayon2 ) - { - xa = _BoundaryAnXcone1 ; - ya = _BoundaryAnYcone1 ; - za = _BoundaryAnZcone1 ; - ra = _BoundaryAnRayon1 ; - xb = _BoundaryAnXcone2 ; - yb = _BoundaryAnYcone2 ; - zb = _BoundaryAnZcone2 ; - rb = _BoundaryAnRayon2 ; - } - else - { - xa = _BoundaryAnXcone2 ; - ya = _BoundaryAnYcone2 ; - za = _BoundaryAnZcone2 ; - ra = _BoundaryAnRayon2 ; - xb = _BoundaryAnXcone1 ; - yb = _BoundaryAnYcone1 ; - zb = _BoundaryAnZcone1 ; - rb = _BoundaryAnRayon1 ; - } -// Axe : relie les deux centres, de A vers B. L'axe est normalise - _BoundaryAnXaxisCone = xb - xa ; - _BoundaryAnYaxisCone = yb - ya ; - _BoundaryAnZaxisCone = zb - za ; - daux = sqrt ( _BoundaryAnXaxisCone*_BoundaryAnXaxisCone + _BoundaryAnYaxisCone*_BoundaryAnYaxisCone + _BoundaryAnZaxisCone*_BoundaryAnZaxisCone ) ; - _BoundaryAnXaxisCone = _BoundaryAnXaxisCone/daux ; - _BoundaryAnYaxisCone = _BoundaryAnYaxisCone/daux ; - _BoundaryAnZaxisCone = _BoundaryAnZaxisCone/daux ; -// Origine - daux = daux * rb / (ra-rb) ; - _BoundaryAnXorigCone = xb + daux*_BoundaryAnXaxisCone ; - _BoundaryAnYorigCone = yb + daux*_BoundaryAnYaxisCone ; - _BoundaryAnZorigCone = zb + daux*_BoundaryAnZaxisCone ; -// Angle en degre - daux = ra / sqrt((_BoundaryAnXorigCone-xa)*(_BoundaryAnXorigCone-xa) + (_BoundaryAnYorigCone-ya)*(_BoundaryAnYorigCone-ya) + (_BoundaryAnZorigCone-za)*(_BoundaryAnZorigCone-za) ) ; - _BoundaryAngle = atan(daux)*180./PI ; - } -// D'angle vers rayon : - else - { - double xax, yax, zax ; -// L'axe est normalise - daux = sqrt ( _BoundaryAnXaxisCone*_BoundaryAnXaxisCone + _BoundaryAnYaxisCone*_BoundaryAnYaxisCone + _BoundaryAnZaxisCone*_BoundaryAnZaxisCone ) ; - xax = _BoundaryAnXaxisCone/daux ; - yax = _BoundaryAnYaxisCone/daux ; - zax = _BoundaryAnZaxisCone/daux ; -// Centre 1 : l'origine - _BoundaryAnXcone1 = _BoundaryAnXorigCone ; - _BoundaryAnYcone1 = _BoundaryAnYorigCone ; - _BoundaryAnZcone1 = _BoundaryAnZorigCone ; -// Rayon 1 : nul - _BoundaryAnRayon1 = 0. ; -// Centre 2 : l'origine decalee d'une longueur arbitraire le long de l'axe - _BoundaryAnXcone2 = _BoundaryAnXorigCone + _DMax*xax ; - _BoundaryAnYcone2 = _BoundaryAnYorigCone + _DMax*yax ; - _BoundaryAnZcone2 = _BoundaryAnZorigCone + _DMax*zax ; -// Rayon 2 : a calculer - _BoundaryAnRayon2 = _DMax*tan(_BoundaryAngle*PI/180.) ; - } -// MESSAGE("Fin de convertRayonAngle") -} - - diff --git a/src/ADAPTGUI/MonCreateBoundaryAn.h b/src/ADAPTGUI/MonCreateBoundaryAn.h deleted file mode 100644 index daadd6560..000000000 --- a/src/ADAPTGUI/MonCreateBoundaryAn.h +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_CREATEBOUNDARYAN_H -#define MON_CREATEBOUNDARYAN_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) -#include CORBA_CLIENT_HEADER(HOMARD_Boundary) - -#include "ui_CreateBoundaryAn.h" -#include - -class MonCreateCase; -class HOMARD_EXPORT MonCreateBoundaryAn : public QDialog, public Ui_CreateBoundaryAn -{ - Q_OBJECT - -public: - MonCreateBoundaryAn( MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString caseName); - virtual ~MonCreateBoundaryAn(); - -protected : - MonCreateBoundaryAn( MonCreateCase* parent, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString caseName); - - MonCreateCase * _parent; - - QString _Name; - QString _aCaseName; - - int _Type; - double _BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnRayon; - double _BoundaryAnXaxis, _BoundaryAnYaxis, _BoundaryAnZaxis; - double _Xcentre, _Ycentre, _Zcentre, _Rayon ; - double _Xmin, _Xmax, _Xincr, _Ymin, _Ymax, _Yincr, _Zmin, _Zmax, _Zincr, _DMax ; - double _BoundaryAnXcone1, _BoundaryAnYcone1, _BoundaryAnZcone1, _BoundaryAnRayon1; - double _BoundaryAnXcone2, _BoundaryAnYcone2, _BoundaryAnZcone2, _BoundaryAnRayon2; - double _BoundaryAnXaxisCone, _BoundaryAnYaxisCone, _BoundaryAnZaxisCone; - double _BoundaryAnXorigCone, _BoundaryAnYorigCone, _BoundaryAnZorigCone; - double _BoundaryAngle; - double _BoundaryAnToreXcentre, _BoundaryAnToreYcentre, _BoundaryAnToreZcentre; - double _BoundaryAnToreXaxe, _BoundaryAnToreYaxe, _BoundaryAnToreZaxe; - double _BoundaryAnToreRRev, _BoundaryAnToreRPri; - - - bool Chgt; - - ADAPT::HOMARD_Boundary_var aBoundaryAn ; - ADAPT::ADAPT_Gen_var myAdaptGen; - - virtual void InitConnect(); - virtual void InitValBoundaryAn(); - virtual void InitMinMax(); - virtual void SetNewName(); - virtual bool CreateOrUpdateBoundaryAn(); - virtual void convertRayonAngle(int option); - -public slots: - virtual void SetCylinder(); - virtual void SetSphere(); - virtual void SetCone(); - virtual void SetConeR(); - virtual void SetConeA(); - virtual void SetTore(); - virtual void PushOnOK(); - virtual bool PushOnApply(); - virtual void PushOnHelp(); - -}; - -#endif // MON_CREATEBOUNDARYAN_H diff --git a/src/ADAPTGUI/MonCreateBoundaryCAO.cxx b/src/ADAPTGUI/MonCreateBoundaryCAO.cxx deleted file mode 100644 index aa3246e43..000000000 --- a/src/ADAPTGUI/MonCreateBoundaryCAO.cxx +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonCreateBoundaryCAO.h" -#include "MonCreateListGroupCAO.h" -#include "MonCreateCase.h" - -#include -#include - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include "HomardQtCommun.h" -#include - -using namespace std; - -// ------------------------------------------------------------------------------- -MonCreateBoundaryCAO::MonCreateBoundaryCAO(MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen0, - QString caseName, QString aName) -// --------------------------------------------------------------------------------- -/* Constructs a MonCreateBoundaryCAO */ - : - QDialog(0), Ui_CreateBoundaryCAO(), - _parent(parent), _aName(aName), - myAdaptGen(ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0)), - _aCaseName(caseName) - { - MESSAGE("Constructeur") ; - setupUi(this); - setModal(modal); - InitConnect(); - - if ( _aName == QString("") ) {SetNewName();}; - } - -// ------------------------------------------------------------------------ -MonCreateBoundaryCAO::~MonCreateBoundaryCAO() -// ------------------------------------------------------------------------ -{ - // no need to delete child widgets, Qt does it all for us -} -// ------------------------------------------------------------------------ -void MonCreateBoundaryCAO::InitConnect() -// ------------------------------------------------------------------------ -{ - connect( PushFichier, SIGNAL(pressed()), this, SLOT(SetCAOFile())); - connect( buttonOk, SIGNAL(pressed()), this, SLOT( PushOnOK())); - connect( buttonApply, SIGNAL(pressed()), this, SLOT( PushOnApply())); - connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); - connect( buttonHelp, SIGNAL(pressed()), this, SLOT( PushOnHelp())); - connect( CBGroupe, SIGNAL(stateChanged(int)), this, SLOT( SetFiltrage())); -} - -// ------------------------------------------------------------------------ -bool MonCreateBoundaryCAO::PushOnApply() -// ------------------------------------------------------------------------ -// Appele lorsque l'un des boutons Ok ou Apply est presse -// -{ -// Verifications - - QString aName=LEName->text().trimmed(); - if (aName=="") { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_BOUN_NAME") ); - return false; - } - -// La CAO - QString aCAOFile=LEFileName->text().trimmed(); - if (aCAOFile ==QString("")) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_BOUN_CAO") ); - return false; - } - -// Creation de l'objet CORBA si ce n'est pas deja fait sous le meme nom - if ( _aName != aName ) - { - try - { - _aName=aName; - aBoundary=myAdaptGen->CreateBoundaryCAO(CORBA::string_dup(_aName.toStdString().c_str()), aCAOFile.toStdString().c_str()); - _parent->AddBoundaryCAO(_aName); - aBoundary->SetCaseCreation(_aCaseName.toStdString().c_str()); - } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - return false; - } - } - -// Les groupes - AssocieLesGroupes(); - - HOMARD_UTILS::updateObjBrowser(); - return true; -} - - -// ------------------------------------------------------------------------ -void MonCreateBoundaryCAO::PushOnOK() -// ------------------------------------------------------------------------ -{ - if (PushOnApply()) this->close(); - if ( _parent ) { _parent->raise(); _parent->activateWindow(); }; -} -// ------------------------------------------------------------------------ -void MonCreateBoundaryCAO::PushOnHelp() -// ------------------------------------------------------------------------ -{ - std::string LanguageShort = myAdaptGen->GetLanguageShort(); - HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("CAO"), QString(LanguageShort.c_str())); -} -// ------------------------------------------------------------------------ -void MonCreateBoundaryCAO::AssocieLesGroupes() -// ------------------------------------------------------------------------ -{ - ADAPT::ListGroupType_var aSeqGroupe = new ADAPT::ListGroupType; - aSeqGroupe->length(_listeGroupesBoundary.size()); - QStringList::const_iterator it; - int i=0; - for (it = _listeGroupesBoundary.constBegin(); it != _listeGroupesBoundary.constEnd(); it++) - aSeqGroupe[i++]=(*it).toStdString().c_str(); - aBoundary->SetGroups(aSeqGroupe); - -} - -// ------------------------------------------------- -void MonCreateBoundaryCAO::SetNewName() -// -------------------------------------------------- -{ - - ADAPT::listeBoundarys_var MyObjects = myAdaptGen->GetAllBoundarysName(); - int num = 0; QString aName=""; - while (aName == QString("") ) - { - aName.setNum(num+1) ; - aName.insert(0, QString("Boun_")) ; - for ( int i=0; ilength(); i++) - { - if ( aName == QString(MyObjects[i])) - { - num ++ ; - aName = "" ; - break ; - } - } - } - LEName->setText(aName); -} -// ------------------------------------------------------------------------ -void MonCreateBoundaryCAO::SetCAOFile() -// ------------------------------------------------------------------------ -{ - QString aCAOFile = HOMARD_QT_COMMUN::PushNomFichier( false, QString("xao") ); - if (!(aCAOFile.isEmpty())) LEFileName->setText(aCAOFile); -} - -// ------------------------------------------------------------------------ -void MonCreateBoundaryCAO::setGroups (QStringList listGroup) -// ------------------------------------------------------------------------ -{ - _listeGroupesBoundary = listGroup; -} -// ------------------------------------------------------------------------ -void MonCreateBoundaryCAO::SetFiltrage() -// // ------------------------------------------------------------------------ -{ - if (!CBGroupe->isChecked()) return; - if (_aCaseName.toStdString().c_str() == QString()) { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_BOUN_CASE") ); - return; - } - - MonCreateListGroupCAO *aDlg = new MonCreateListGroupCAO(NULL, this, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), - _aCaseName, _listeGroupesBoundary) ; - aDlg->show(); -} - diff --git a/src/ADAPTGUI/MonCreateBoundaryCAO.h b/src/ADAPTGUI/MonCreateBoundaryCAO.h deleted file mode 100644 index 26b11f883..000000000 --- a/src/ADAPTGUI/MonCreateBoundaryCAO.h +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_CREATEBOUNDARYCAO_H -#define MON_CREATEBOUNDARYCAO_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) -#include CORBA_CLIENT_HEADER(HOMARD_Boundary) - -#include "ui_CreateBoundaryCAO.h" -#include - -class MonCreateCase; -class HOMARD_EXPORT MonCreateBoundaryCAO : public QDialog, public Ui_CreateBoundaryCAO -{ - Q_OBJECT - -public: - MonCreateBoundaryCAO( MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString caseName, QString BoundaryName ); - ~MonCreateBoundaryCAO(); - virtual void setGroups (QStringList listGroup); - -protected : - - MonCreateCase *_parent; - - QString _aName; - QString _aCaseName; - - - ADAPT::HOMARD_Boundary_var aBoundary; - ADAPT::ADAPT_Gen_var myAdaptGen; - - QStringList _listeGroupesBoundary; - - virtual void AssocieLesGroupes(); - virtual void InitConnect(); - virtual void SetNewName(); - -public slots: - - virtual void SetCAOFile(); - virtual void SetFiltrage(); - virtual void PushOnOK(); - virtual bool PushOnApply(); - virtual void PushOnHelp(); -}; - -#endif // MON_CREATEBOUNDARYCAO_H diff --git a/src/ADAPTGUI/MonCreateBoundaryDi.cxx b/src/ADAPTGUI/MonCreateBoundaryDi.cxx deleted file mode 100644 index 5d551a1e5..000000000 --- a/src/ADAPTGUI/MonCreateBoundaryDi.cxx +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonCreateBoundaryDi.h" -#include "MonCreateListGroup.h" -#include "MonCreateCase.h" - -#include -#include - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include "HomardQtCommun.h" -#include - -using namespace std; - -// ------------------------------------------------------------------------------- -MonCreateBoundaryDi::MonCreateBoundaryDi(MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen0, - QString caseName, QString aName) -// --------------------------------------------------------------------------------- -/* Constructs a MonCreateBoundaryDi */ - : - QDialog(0), Ui_CreateBoundaryDi(), - _parent(parent), _aName(aName), - myAdaptGen(ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0)), - _aCaseName(caseName) - { - MESSAGE("Constructeur") ; - setupUi(this); - setModal(modal); - InitConnect(); - - if ( _aName == QString("") ) {SetNewName();}; - } - -// ------------------------------------------------------------------------ -MonCreateBoundaryDi::~MonCreateBoundaryDi() -// ------------------------------------------------------------------------ -{ - // no need to delete child widgets, Qt does it all for us -} -// ------------------------------------------------------------------------ -void MonCreateBoundaryDi::InitConnect() -// ------------------------------------------------------------------------ -{ - connect( PushFichier, SIGNAL(pressed()), this, SLOT(SetMeshFile())); - connect( buttonOk, SIGNAL(pressed()), this, SLOT( PushOnOK())); - connect( buttonApply, SIGNAL(pressed()), this, SLOT( PushOnApply())); - connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); - connect( buttonHelp, SIGNAL(pressed()), this, SLOT( PushOnHelp())); - connect( CBGroupe, SIGNAL(stateChanged(int)), this, SLOT( SetFiltrage())); -} - -// ------------------------------------------------------------------------ -bool MonCreateBoundaryDi::PushOnApply() -// ------------------------------------------------------------------------ -// Appele lorsque l'un des boutons Ok ou Apply est presse -// -{ -// Verifications - - QString aName=LEName->text().trimmed(); - if (aName=="") { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_BOUN_NAME") ); - return false; - } - -// Le maillage de la frontiere discrete - QString aMeshFile=LEFileName->text().trimmed(); - if (aMeshFile ==QString("")) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_BOUN_MESH") ); - return false; - } - -// Le nom du maillage de la frontiere discrete - QString aMeshName = HOMARD_QT_COMMUN::LireNomMaillage(aMeshFile); - if (aMeshName == "" ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_MED_FILE_2") ); - return false; - } - -// Creation de l'objet CORBA si ce n'est pas deja fait sous le meme nom - if ( _aName != aName ) - { - try - { - _aName=aName; - aBoundary=myAdaptGen->CreateBoundaryDi(CORBA::string_dup(_aName.toStdString().c_str()), aMeshName.toStdString().c_str(), aMeshFile.toStdString().c_str()); - _parent->AddBoundaryDi(_aName); - aBoundary->SetCaseCreation(_aCaseName.toStdString().c_str()); - } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - return false; - } - } - -// Les groupes - AssocieLesGroupes(); - - HOMARD_UTILS::updateObjBrowser(); - return true; -} - - -// ------------------------------------------------------------------------ -void MonCreateBoundaryDi::PushOnOK() -// ------------------------------------------------------------------------ -{ - if (PushOnApply()) this->close(); - if ( _parent ) { _parent->raise(); _parent->activateWindow(); }; -} -// ------------------------------------------------------------------------ -void MonCreateBoundaryDi::PushOnHelp() -// ------------------------------------------------------------------------ -{ - std::string LanguageShort = myAdaptGen->GetLanguageShort(); - HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-discrete"), QString(LanguageShort.c_str())); -} -// ------------------------------------------------------------------------ -void MonCreateBoundaryDi::AssocieLesGroupes() -// ------------------------------------------------------------------------ -{ - ADAPT::ListGroupType_var aSeqGroupe = new ADAPT::ListGroupType; - aSeqGroupe->length(_listeGroupesBoundary.size()); - QStringList::const_iterator it; - int i=0; - for (it = _listeGroupesBoundary.constBegin(); it != _listeGroupesBoundary.constEnd(); it++) - aSeqGroupe[i++]=(*it).toStdString().c_str(); - aBoundary->SetGroups(aSeqGroupe); - -} - -// ------------------------------------------------- -void MonCreateBoundaryDi::SetNewName() -// -------------------------------------------------- -{ - - ADAPT::listeBoundarys_var MyObjects = myAdaptGen->GetAllBoundarysName(); - int num = 0; QString aName=""; - while (aName == QString("") ) - { - aName.setNum(num+1) ; - aName.insert(0, QString("Boun_")) ; - for ( int i=0; ilength(); i++) - { - if ( aName == QString(MyObjects[i])) - { - num ++ ; - aName = "" ; - break ; - } - } - } - LEName->setText(aName); -} -// ------------------------------------------------------------------------ -void MonCreateBoundaryDi::SetMeshFile() -// ------------------------------------------------------------------------ -{ - QString aMeshFile = HOMARD_QT_COMMUN::PushNomFichier( false, QString("med") ); - if (!(aMeshFile.isEmpty())) LEFileName->setText(aMeshFile); -} - -// ------------------------------------------------------------------------ -void MonCreateBoundaryDi::setGroups (QStringList listGroup) -// ------------------------------------------------------------------------ -{ - _listeGroupesBoundary = listGroup; -} -// ------------------------------------------------------------------------ -void MonCreateBoundaryDi::SetFiltrage() -// // ------------------------------------------------------------------------ -{ - if (!CBGroupe->isChecked()) return; - if (_aCaseName.toStdString().c_str() == QString()) { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_BOUN_CASE") ); - return; - } - - MonCreateListGroup *aDlg = new MonCreateListGroup(NULL, this, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), - _aCaseName, _listeGroupesBoundary) ; - aDlg->show(); -} - diff --git a/src/ADAPTGUI/MonCreateBoundaryDi.h b/src/ADAPTGUI/MonCreateBoundaryDi.h deleted file mode 100644 index b26496321..000000000 --- a/src/ADAPTGUI/MonCreateBoundaryDi.h +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_CREATEBOUNDARYDI_H -#define MON_CREATEBOUNDARYDI_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) -#include CORBA_CLIENT_HEADER(HOMARD_Boundary) - -#include "ui_CreateBoundaryDi.h" -#include - -class MonCreateCase; -class HOMARD_EXPORT MonCreateBoundaryDi : public QDialog, public Ui_CreateBoundaryDi -{ - Q_OBJECT - -public: - MonCreateBoundaryDi( MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString caseName, QString BoundaryName ); - ~MonCreateBoundaryDi(); - virtual void setGroups (QStringList listGroup); - -protected : - - MonCreateCase *_parent; - - QString _aName; - QString _aCaseName; - - - ADAPT::HOMARD_Boundary_var aBoundary; - ADAPT::ADAPT_Gen_var myAdaptGen; - - QStringList _listeGroupesBoundary; - - virtual void AssocieLesGroupes(); - virtual void InitConnect(); - virtual void SetNewName(); - -public slots: - - virtual void SetMeshFile(); - virtual void SetFiltrage(); - virtual void PushOnOK(); - virtual bool PushOnApply(); - virtual void PushOnHelp(); -}; - -#endif // MON_CREATEBOUNDARYDI_H diff --git a/src/ADAPTGUI/MonCreateCase.cxx b/src/ADAPTGUI/MonCreateCase.cxx deleted file mode 100644 index 65e3f4adf..000000000 --- a/src/ADAPTGUI/MonCreateCase.cxx +++ /dev/null @@ -1,694 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonCreateCase.h" -#include "MonCreateBoundaryCAO.h" -#include "MonEditBoundaryCAO.h" -#include "MonCreateBoundaryAn.h" -#include "MonEditBoundaryAn.h" -#include "MonCreateBoundaryDi.h" -#include "MonEditBoundaryDi.h" -#include "HOMARD.hxx" - -#include -#include - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include "HomardQtCommun.h" -#include - -#ifdef WIN32 -#include -#endif - -using namespace std; - -// ----------------------------------------------------------------------------------------- -/* Constructs a MonCreateCase - * Inherits from CasHomard - * Sets attributes to default values - */ -// ----------------------------------------------------------------------------------------- -MonCreateCase::MonCreateCase( bool modal, ADAPT::ADAPT_Gen_var myAdaptGen0 ) - : - Ui_CreateCase(), - _aCaseName(""),_aDirName(""), - _ConfType(0), - _ExtType(0), - _Pyram(0) -{ - MESSAGE("Debut du constructeur de MonCreateCase"); - myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0); - setupUi(this); - setModal(modal); - InitConnect(); - - SetNewName() ; - - GBBoundaryC->setVisible(0); - GBBoundaryA->setVisible(0); - GBBoundaryD->setVisible(0); - - CBBoundaryA->setVisible(0); - CBBoundaryD->setVisible(0); - - GBAdvancedOptions->setVisible(0); - Comment->setVisible(0); - CBPyramid->setChecked(false); -// - adjustSize(); - -// MESSAGE("Fin du constructeur de MonCreateCase"); -} -// ------------------------------------------------------------------------ -MonCreateCase::~MonCreateCase() -// ------------------------------------------------------------------------ -{ - // no need to delete child widgets, Qt does it all for us -} -// ------------------------------------------------------------------------ -void MonCreateCase::InitConnect() -// ------------------------------------------------------------------------ -{ - connect( LEName, SIGNAL(textChanged(QString)), this, SLOT(CaseNameChanged())); - connect( PushDir, SIGNAL(pressed()), this, SLOT(SetDirName())); - connect( PushFichier, SIGNAL(pressed()), this, SLOT(SetFileName())); - - connect( RBConforme, SIGNAL(clicked()), this, SLOT(SetConforme())); - connect( RBNonConforme, SIGNAL(clicked()), this, SLOT(SetNonConforme())); - - connect( RBBoundaryNo, SIGNAL(clicked()), this, SLOT(SetBoundaryNo())); - connect( RBBoundaryCAO, SIGNAL(clicked()), this, SLOT(SetBoundaryCAO())); - connect( RBBoundaryNonCAO, SIGNAL(clicked()), this, SLOT(SetBoundaryNonCAO())); - - connect( PBBoundaryCAONew, SIGNAL(pressed()), this, SLOT(PushBoundaryCAONew())); - connect( PBBoundaryCAOEdit, SIGNAL(pressed()), this, SLOT(PushBoundaryCAOEdit()) ); - connect( PBBoundaryCAOHelp, SIGNAL(pressed()), this, SLOT(PushBoundaryCAOHelp()) ); - connect( CBBoundaryD, SIGNAL(stateChanged(int)), this, SLOT(SetBoundaryD())); - connect( PBBoundaryDiNew, SIGNAL(pressed()), this, SLOT(PushBoundaryDiNew())); - connect( PBBoundaryDiEdit, SIGNAL(pressed()), this, SLOT(PushBoundaryDiEdit()) ); - connect( PBBoundaryDiHelp, SIGNAL(pressed()), this, SLOT(PushBoundaryDiHelp()) ); - connect( CBBoundaryA, SIGNAL(stateChanged(int)), this, SLOT(SetBoundaryA())); - connect( PBBoundaryAnNew, SIGNAL(pressed()), this, SLOT(PushBoundaryAnNew())); - connect( PBBoundaryAnEdit, SIGNAL(pressed()), this, SLOT(PushBoundaryAnEdit()) ); - connect( PBBoundaryAnHelp, SIGNAL(pressed()), this, SLOT(PushBoundaryAnHelp()) ); - - connect( CBAdvanced, SIGNAL(stateChanged(int)), this, SLOT(SetAdvanced())); - connect( RBStandard, SIGNAL(clicked()), this, SLOT(SetStandard())); - connect( RBBox, SIGNAL(clicked()), this, SLOT(SetBox())); - connect( RBNC1NpA, SIGNAL(clicked()), this, SLOT(SetNC1NpA())); - connect( RBNCQuelconque, SIGNAL(clicked()), this, SLOT(SetNCQuelconque())); - - connect( RBMED, SIGNAL(clicked()), this, SLOT(SetMED())); - connect( RBSaturne, SIGNAL(clicked()), this, SLOT(SetSaturne())); - connect( RBSaturne2D, SIGNAL(clicked()), this, SLOT(SetSaturne2D())); - - connect( buttonOk, SIGNAL(pressed()), this, SLOT(PushOnOK())); - connect( buttonApply, SIGNAL(pressed()), this, SLOT(PushOnApply(0))); - connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); - connect( buttonHelp, SIGNAL(pressed()), this, SLOT(PushOnHelp())); -} -// ------------------------------------------------------------------------ -void MonCreateCase::InitBoundarys() -// ------------------------------------------------------------------------ -// Initialisation des menus avec les frontieres deja enregistrees -{ - MESSAGE("InitBoundarys"); -// Pour les frontieres analytiques : la colonne des groupes - ADAPT::ListGroupType_var _listeGroupesCas = aCase->GetGroups(); - QTableWidgetItem *__colItem = new QTableWidgetItem(); - __colItem->setText(QApplication::translate("CreateCase", "", 0)); - TWBoundary->setHorizontalHeaderItem(0, __colItem); - for ( int i = 0; i < _listeGroupesCas->length(); i++ ) - { - TWBoundary->insertRow(i); - TWBoundary->setItem( i, 0, new QTableWidgetItem(QString((_listeGroupesCas)[i]).trimmed())); - TWBoundary->item( i, 0 )->setFlags(Qt::ItemIsEnabled |Qt::ItemIsSelectable ); - } -// Pour les frontieres CAO : la liste a saisir -// Pour les frontieres discretes : la liste a saisir -// Pour les frontieres analytiques : les colonnes de chaque frontiere - ADAPT::HOMARD_Boundary_var myBoundary ; - ADAPT::listeBoundarys_var mesBoundarys = myAdaptGen->GetAllBoundarysName(); -// MESSAGE("Nombre de frontieres enregistrees : "<length()); - for (int i=0; ilength(); i++) - { - myBoundary = myAdaptGen->GetBoundary(mesBoundarys[i]); - int type_obj = myBoundary->GetType() ; - if ( type_obj==-1 ) { CBBoundaryCAO->addItem(QString(mesBoundarys[i])); } - else if ( type_obj==0 ) { CBBoundaryDi->addItem(QString(mesBoundarys[i])); } - else { AddBoundaryAn(QString(mesBoundarys[i])); } - } -// Ajustement - TWBoundary->resizeColumnsToContents(); - TWBoundary->resizeRowsToContents(); - TWBoundary->clearSelection(); -} -// ------------------------------- -bool MonCreateCase::PushOnApply(int option) -// -------------------------------- -{ - MESSAGE("PushOnApply"); - QString aCaseName=LEName->text().trimmed(); - if ( aCaseName == "" ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_CASE_NAME") ); - return false; - } - - QString aDirName=LEDirName->text().trimmed(); - if (aDirName == QString("")) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_CASE_DIRECTORY_1") ); - return false; - } - - if ( aDirName != _aDirName) - { QString CaseNameDir = myAdaptGen->VerifieDir( aDirName.toStdString().c_str()) ; - if ( ( CaseNameDir != "" ) & ( CaseNameDir != aCaseName ) ) - { - QString texte ; - texte = QObject::tr("HOM_CASE_DIRECTORY_2") + CaseNameDir ; - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - texte ); - return false; - } - } - if (CHDIR(aDirName.toStdString().c_str()) != 0) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_CASE_DIRECTORY_3") ); - return false; - } - - QString aFileName=LEFileName->text().trimmed(); - if (aFileName ==QString("")) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_CASE_MESH") ); - return false; - } - - QString aMeshName = HOMARD_QT_COMMUN::LireNomMaillage(aFileName); - if (aMeshName == "" ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_MED_FILE_2") ); - return false; - } - -// On verifie qu'un groupe n'est pas associe a deux frontieres differentes - if (CBBoundaryA->isChecked()) - { - QStringList ListeGroup ; - QString NomGroup ; - int nbcol = TWBoundary->columnCount(); - int nbrow = TWBoundary->rowCount(); - for ( int col=1; col< nbcol; col++) - { - for ( int row=0; row< nbrow; row++) - { - if ( TWBoundary->item( row, col )->checkState() == Qt::Checked ) - { -// Nom du groupe - NomGroup = QString(TWBoundary->item(row, 0)->text()) ; -// MESSAGE("NomGroup "<CreateCase( \ - CORBA::string_dup(_aCaseName.toStdString().c_str()), \ - CORBA::string_dup(aMeshName.toStdString().c_str()), \ - CORBA::string_dup(aFileName.toStdString().c_str()) ); - } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - return false; - } - LEFileName->setReadOnly(true); - PushFichier->hide(); - InitBoundarys(); - } - -// Repertoire et type - aCase->SetDirName(aDirName.toStdString().c_str()); - _aDirName=aDirName; - aCase->SetConfType(_ConfType); - aCase->SetExtType(_ExtType); - -// Menage des eventuelles frontieres deja enregistrees - aCase->SupprBoundaryGroup() ; - - // Enregistrement et publication dans l'arbre d'etudes a la sortie definitive - if ( option > 0 ) - { - if (RBBoundaryCAO->isChecked()) - { - QString monBoundaryCAOName=CBBoundaryCAO->currentText(); - if (monBoundaryCAOName != "" ) - { - aCase->AddBoundary(monBoundaryCAOName.toStdString().c_str()); - } - } - if (CBBoundaryD->isChecked()) - { - QString monBoundaryDiName=CBBoundaryDi->currentText(); - if (monBoundaryDiName != "" ) - { - aCase->AddBoundary(monBoundaryDiName.toStdString().c_str()); - } - } - if (CBBoundaryA->isChecked()) - { - QString NomGroup ; - int nbcol = TWBoundary->columnCount(); - int nbrow = TWBoundary->rowCount(); - for ( int col=1; col< nbcol; col++) - { - for ( int row=0; row< nbrow; row++) - { - if ( TWBoundary->item( row, col )->checkState() == Qt::Checked ) - { - // Nom du groupe - NomGroup = QString(TWBoundary->item(row, 0)->text()) ; - // Nom de la frontiere - QTableWidgetItem *__colItem = new QTableWidgetItem(); - __colItem = TWBoundary->horizontalHeaderItem(col); - aCase->AddBoundaryGroup(QString(__colItem->text()).toStdString().c_str(), NomGroup.toStdString().c_str()); - } - } - } - } - } - - -// Options avancees - if (CBAdvanced->isChecked()) - { -// Autorisation des pyramides - if (CBPyramid->isChecked()) { _Pyram = 1 ; } - } - aCase->SetPyram(_Pyram); - - HOMARD_UTILS::updateObjBrowser(); - - return true; -} -// --------------------------- -void MonCreateCase::PushOnOK() -// --------------------------- -{ - bool bOK = PushOnApply(1); - if ( bOK ) this->close(); -} -//------------------------------ -void MonCreateCase::PushOnHelp() -//------------------------------- -{ - std::string LanguageShort = myAdaptGen->GetLanguageShort(); - HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""), QString(LanguageShort.c_str())); -} -// --------------------------------- -void MonCreateCase::SetNewName() -// ------------------------------ -{ - ADAPT::listeCases_var MyCases = myAdaptGen->GetAllCasesName(); - int num = 0; QString aCaseName=""; - while (aCaseName=="" ) - { - aCaseName.setNum(num+1) ; - aCaseName.insert(0, QString("Case_")) ; - for ( int i=0; ilength(); i++) - { - if ( aCaseName == QString((MyCases)[i])) - { - num ++ ; - aCaseName = "" ; - break ; - } - } - } - LEName->clear() ; - LEName->insert(aCaseName); -} - -// ------------------------------------------------------------------------ -void MonCreateCase::SetDirName() -// ------------------------------------------------------------------------ -{ - QString aDirName=QFileDialog::getExistingDirectory (); - if (!(aDirName.isEmpty()))LEDirName->setText(aDirName); -} -// ------------------------------------------------------------------------ -void MonCreateCase::SetFileName() -// ------------------------------------------------------------------------ -{ - QString fileName0 = LEFileName->text().trimmed(); - QString fileName = HOMARD_QT_COMMUN::PushNomFichier( false, QString("med") ) ; - if (fileName.isEmpty()) fileName = fileName0 ; - LEFileName->setText(fileName); -} -// ------------------------------------------------------------------------ -void MonCreateCase::SetConforme() -// ------------------------------------------------------------------------ -{ -// - _ConfType=0; - RBNC1NpA->setVisible(0); - RBNCQuelconque->setVisible(0); -// - adjustSize(); -} -// ------------------------------------------------------------------------ -void MonCreateCase::SetNonConforme() -// ------------------------------------------------------------------------ -{ -// - _ConfType=1; - RBNC1NpA->setVisible(1); - RBNCQuelconque->setVisible(1); -// - adjustSize(); -} -// ------------------------------------------------------------------------ -void MonCreateCase::SetStandard() -// ------------------------------------------------------------------------ -{ - if ( ( _ConfType == 0 ) || ( _ConfType == -1 ) ) { _ConfType = 0 ; } - else { _ConfType = 1 ; } - RBStandard->setChecked(true); -} -// ------------------------------------------------------------------------ -void MonCreateCase::SetBox() -// ------------------------------------------------------------------------ -{ - if ( ( _ConfType == 0 ) || ( _ConfType == -1 ) ) { _ConfType = -1 ; } - else { _ConfType = -2 ; } -} -// ------------------------------------------------------------------------ -void MonCreateCase::SetNC1NpA() -// ------------------------------------------------------------------------ -{ - _ConfType = 2; -} -// ------------------------------------------------------------------------ -void MonCreateCase::SetNCQuelconque() -// ------------------------------------------------------------------------ -{ - _ConfType = 3; -} -// ------------------------------------------------------------------------ -void MonCreateCase::SetMED() -// ------------------------------------------------------------------------ -{ - _ExtType = 0 ; - RBMED->setChecked(true); -} -// ------------------------------------------------------------------------ -void MonCreateCase::SetSaturne() -// ------------------------------------------------------------------------ -{ - _ExtType = 1 ; - RBSaturne->setChecked(true); -} -// ------------------------------------------------------------------------ -void MonCreateCase::SetSaturne2D() -// ------------------------------------------------------------------------ -{ - _ExtType = 2 ; - RBSaturne2D->setChecked(true); -} -// ------------------------------------------------------------------------ -void MonCreateCase::SetBoundaryNo() -// ------------------------------------------------------------------------ -{ -// - GBBoundaryC->setVisible(0); - GBBoundaryA->setVisible(0); - GBBoundaryD->setVisible(0); - CBBoundaryD->setVisible(0); - CBBoundaryA->setVisible(0); -// - adjustSize(); -} -// ------------------------------------------------------------------------ -void MonCreateCase::SetBoundaryCAO() -// ------------------------------------------------------------------------ -{ -// - GBBoundaryC->setVisible(1); - GBBoundaryA->setVisible(0); - GBBoundaryD->setVisible(0); - CBBoundaryD->setVisible(0); - CBBoundaryA->setVisible(0); -// - adjustSize(); -} -// ------------------------------------------------------------------------ -void MonCreateCase::SetBoundaryNonCAO() -// ------------------------------------------------------------------------ -{ -// - GBBoundaryC->setVisible(0); - CBBoundaryD->setVisible(1); - CBBoundaryA->setVisible(1); -// - adjustSize(); -} -// ------------------------------------------------------------------------ -void MonCreateCase::AddBoundaryCAO(QString newBoundary) -// ------------------------------------------------------------------------ -{ - CBBoundaryCAO->insertItem(0,newBoundary); - CBBoundaryCAO->setCurrentIndex(0); -} -// ------------------------------------------------------------------------ -void MonCreateCase::PushBoundaryCAONew() -// ------------------------------------------------------------------------ -{ - MonCreateBoundaryCAO *BoundaryDlg = new MonCreateBoundaryCAO(this, true, - ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), _aCaseName, "") ; - BoundaryDlg->show(); -} -// ------------------------------------------------------------------------ -void MonCreateCase::PushBoundaryCAOEdit() -// ------------------------------------------------------------------------ -{ - if (CBBoundaryCAO->currentText() == QString("")) return; - MonEditBoundaryCAO *BoundaryDlg = new MonEditBoundaryCAO(this, true, - ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), _aCaseName, CBBoundaryCAO->currentText() ) ; - BoundaryDlg->show(); -} -// ------------------------------------------------------------------------ -void MonCreateCase::PushBoundaryCAOHelp() -// ------------------------------------------------------------------------ -{ - std::string LanguageShort = myAdaptGen->GetLanguageShort(); - HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("CAO"), QString(LanguageShort.c_str())); -} -// ------------------------------------------------------------------------ -void MonCreateCase::SetBoundaryD() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetBoundaryD "); - if (CBBoundaryD->isChecked()) - { - bool bOK = PushOnApply(0); - if (bOK) { GBBoundaryD->setVisible(1); } - else { GBBoundaryD->setVisible(0); - CBBoundaryD->setChecked(0); - CBBoundaryD->setCheckState(Qt::Unchecked); } - } - else { GBBoundaryD->setVisible(0); } -// - adjustSize(); -} -// ------------------------------------------------------------------------ -void MonCreateCase::AddBoundaryDi(QString newBoundary) -// ------------------------------------------------------------------------ -{ - CBBoundaryDi->insertItem(0,newBoundary); - CBBoundaryDi->setCurrentIndex(0); -} -// ------------------------------------------------------------------------ -void MonCreateCase::PushBoundaryDiNew() -// ------------------------------------------------------------------------ -{ - MonCreateBoundaryDi *BoundaryDlg = new MonCreateBoundaryDi(this, true, - ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), _aCaseName, "") ; - BoundaryDlg->show(); -} -// ------------------------------------------------------------------------ -void MonCreateCase::PushBoundaryDiEdit() -// ------------------------------------------------------------------------ -{ - if (CBBoundaryDi->currentText() == QString("")) return; - MonEditBoundaryDi *BoundaryDlg = new MonEditBoundaryDi(this, true, - ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), _aCaseName, CBBoundaryDi->currentText() ) ; - BoundaryDlg->show(); -} -// ------------------------------------------------------------------------ -void MonCreateCase::PushBoundaryDiHelp() -// ------------------------------------------------------------------------ -{ - std::string LanguageShort = myAdaptGen->GetLanguageShort(); - HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-discrete"), QString(LanguageShort.c_str())); -} -// ------------------------------------------------------------------------ -void MonCreateCase::SetBoundaryA() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetBoundaryA "); - if (CBBoundaryA->isChecked()) - { - bool bOK = PushOnApply(0); - if (bOK) { GBBoundaryA->setVisible(1); } - else { GBBoundaryA->setVisible(0); - CBBoundaryA->setChecked(0); - CBBoundaryA->setCheckState(Qt::Unchecked); } - } - else { GBBoundaryA->setVisible(0); } -// - adjustSize(); -} -// ------------------------------------------------------------------------ -void MonCreateCase::AddBoundaryAn(QString newBoundary) -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de AddBoundaryAn "); -// Ajout d'une nouvelle colonne - int nbcol = TWBoundary->columnCount(); -// MESSAGE("nbcol " << nbcol); - nbcol += 1 ; - TWBoundary->setColumnCount ( nbcol ) ; - QTableWidgetItem *__colItem = new QTableWidgetItem(); - __colItem->setText(QApplication::translate("CreateCase", newBoundary.toStdString().c_str(), 0)); - TWBoundary->setHorizontalHeaderItem(nbcol-1, __colItem); -/* TWBoundary->horizontalHeaderItem(nbcol-1)->setFlags( Qt::ItemIsSelectable|Qt::ItemIsEnabled );*/ -// Chaque case est a cocher - int nbrow = TWBoundary->rowCount(); -// MESSAGE("nbrow " << nbrow); - for ( int i = 0; i < nbrow; i++ ) - { - TWBoundary->setItem( i, nbcol-1, new QTableWidgetItem( QString ("") ) ); - TWBoundary->item( i, nbcol-1 )->setFlags( 0 ); - TWBoundary->item( i, nbcol-1 )->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled ); - TWBoundary->item( i, nbcol-1 )->setCheckState( Qt::Unchecked ); - } - TWBoundary->resizeColumnToContents(nbcol-1); -// TWBoundary->resizeRowsToContents(); -// MESSAGE("Fin de AddBoundaryAn "); -} -// ------------------------------------------------------------------------ -void MonCreateCase::PushBoundaryAnNew() -// ------------------------------------------------------------------------ -{ - MonCreateBoundaryAn *BoundaryDlg = new MonCreateBoundaryAn(this, true, - ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), _aCaseName) ; - BoundaryDlg->show(); -} -// ------------------------------------------------------------------------ -void MonCreateCase::PushBoundaryAnEdit() -// ------------------------------------------------------------------------ -{ - QString nom=""; - int nbcol = TWBoundary->columnCount(); - for ( int i = 1; i < nbcol; i++ ) - { - QTableWidgetItem *__colItem = new QTableWidgetItem(); - __colItem = TWBoundary->horizontalHeaderItem(i); - nom = QString(__colItem->text()) ; - MESSAGE("nom "<show(); } - } -} -// ------------------------------------------------------------------------ -void MonCreateCase::PushBoundaryAnHelp() -// ------------------------------------------------------------------------ -{ - std::string LanguageShort = myAdaptGen->GetLanguageShort(); - HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-analytique"), QString(LanguageShort.c_str())); -} -// ------------------------------------------------------------------------ -void MonCreateCase::CaseNameChanged() -// ------------------------------------------------------------------------ -{ - if (_aCaseName != LEName->text().trimmed()) - { - LEFileName->setReadOnly(false); - PushFichier->show(); - } -} -// ------------------------------------------------------------------------ -void MonCreateCase::SetAdvanced() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetAdvanced "); - if (CBAdvanced->isChecked()) - { GBAdvancedOptions->setVisible(1); - GBConforme->setVisible(1); - RBStandard->setVisible(1); - RBBox->setVisible(1); - if ( ( _ConfType == 0 ) || ( _ConfType == -1 ) ) - { RBNC1NpA->setVisible(0); - RBNCQuelconque->setVisible(0);} - else - { RBNC1NpA->setVisible(1); - RBNCQuelconque->setVisible(1);} - GBFormat->setVisible(1); - RBMED->setVisible(1); - RBSaturne2D->setVisible(1); - } - else - { GBAdvancedOptions->setVisible(0); - CBPyramid->setChecked(false); - _Pyram = 0 ; - SetStandard() ; - SetMED() ; - } -// - adjustSize(); -} diff --git a/src/ADAPTGUI/MonCreateCase.h b/src/ADAPTGUI/MonCreateCase.h deleted file mode 100644 index 36f01b884..000000000 --- a/src/ADAPTGUI/MonCreateCase.h +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_CREATECASE_H -#define MON_CREATECASE_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) -#include CORBA_CLIENT_HEADER(HOMARD_Cas) - -#include "ui_CreateCase.h" -#include - -class HOMARD_EXPORT MonCreateCase : public QDialog, public Ui_CreateCase -{ - Q_OBJECT - -public: - MonCreateCase( bool modal, ADAPT::ADAPT_Gen_var myAdaptGen ); - ~MonCreateCase(); - - void AddBoundaryCAO(QString newBoundary); - void AddBoundaryAn(QString newBoundary); - void AddBoundaryDi(QString newBoundary); - -protected : - QString _aCaseName; - QString _aDirName; - - int _ConfType; - int _ExtType; - - int _Pyram; - - ADAPT::HOMARD_Cas_var aCase ; - ADAPT::ADAPT_Gen_var myAdaptGen; - - virtual void InitConnect(); - virtual void InitBoundarys(); - virtual void SetNewName(); - -public slots: - virtual void SetDirName(); - virtual void SetFileName(); - - virtual void SetConforme(); - virtual void SetNonConforme(); - virtual void SetStandard(); - virtual void SetBox(); - virtual void SetNC1NpA(); - virtual void SetNCQuelconque(); - - virtual void SetMED(); - virtual void SetSaturne(); - virtual void SetSaturne2D(); - - virtual void SetBoundaryNo(); - virtual void SetBoundaryCAO(); - virtual void SetBoundaryNonCAO(); - virtual void PushBoundaryCAONew(); - virtual void PushBoundaryCAOEdit(); - virtual void PushBoundaryCAOHelp(); - virtual void SetBoundaryD(); - virtual void PushBoundaryDiNew(); - virtual void PushBoundaryDiEdit(); - virtual void PushBoundaryDiHelp(); - virtual void SetBoundaryA(); - virtual void PushBoundaryAnNew(); - virtual void PushBoundaryAnEdit(); - virtual void PushBoundaryAnHelp(); - - virtual void SetAdvanced(); - - virtual void PushOnOK(); - virtual bool PushOnApply(int option); - virtual void PushOnHelp(); - - virtual void CaseNameChanged(); -}; - -#endif // MON_CREATECASE_H diff --git a/src/ADAPTGUI/MonCreateHypothesis.cxx b/src/ADAPTGUI/MonCreateHypothesis.cxx deleted file mode 100644 index 6c87eb011..000000000 --- a/src/ADAPTGUI/MonCreateHypothesis.cxx +++ /dev/null @@ -1,945 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonCreateHypothesis.h" -#include "MonCreateListGroup.h" -#include "MonCreateIteration.h" -#include "MonCreateZone.h" -#include "MonEditZone.h" - -#include -#include - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include "HomardQtCommun.h" -#include - -using namespace std; - -// ------------------------------------------------------------------------------- -MonCreateHypothesis::MonCreateHypothesis(MonCreateIteration* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen0, - QString Name, - QString caseName, QString aFieldFile) -// --------------------------------------------------------------------------------- -/* Constructs a MonCreateHypothesis */ - : - QScrollArea(0), Ui_CreateHypothesis(), - _parent(parent), _Name(Name), - _aCaseName(caseName), _aFieldFile(aFieldFile), - _aFieldName(""), - _aTypeAdap(-2), _aTypeRaff(1), _aTypeDera(0), - _TypeThR(3), _ThreshR(0), - _TypeThC(0), _ThreshC(0), - _UsField(0), _UsCmpI(0), _TypeFieldInterp(0), - _NivMax(-1), - _DiamMin(-1.), - _AdapInit(0), - _ExtraOutput(1) - -{ - MESSAGE("Constructeur") ; - myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0); - setupUi(this); - if ( modal ) { setWindowModality(Qt::WindowModal); } - else { setWindowModality(Qt::NonModal); } - setWindowFlags( Qt::WindowStaysOnTopHint ) ; - InitConnect(); - - SetNewName(); - if (_aFieldFile != QString("")) - { RBChamp->setChecked(1); - SetChamp(); - } - else - { RBUniforme->setChecked(1); - SetUniforme(); - } - SetFieldNo(); - GBAdvancedOptions->setVisible(0); - CBOutputLevel->setChecked(false); - CBOutputQuality->setChecked(false); - CBOutputDiameter->setChecked(false); - CBOutputParent->setChecked(false); - CBOutputVoisins->setChecked(false); - _ExtraOutput = 1 ; -// - adjustSize(); -} - -// ------------------------------------------------------------------------ -MonCreateHypothesis::~MonCreateHypothesis() -// ------------------------------------------------------------------------ -{ - // no need to delete child widgets, Qt does it all for us -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::InitConnect() -// ------------------------------------------------------------------------ -{ - connect( RBUniforme, SIGNAL(clicked()), this, SLOT(SetUniforme())); - connect( RBChamp, SIGNAL(clicked()), this, SLOT(SetChamp())); - connect( RBZone, SIGNAL(clicked()), this, SLOT(SetZone())); - connect( RBUniRaff, SIGNAL(clicked()), this, SLOT(SetUniRaff())); - connect( RBUniDera, SIGNAL(clicked()), this, SLOT(SetUniDera())); - - connect( CBFieldName, SIGNAL(activated(int)), this, SLOT( SetFieldName())); - connect( RBRPE, SIGNAL(clicked()), this, SLOT(SetRPE())); - connect( RBRRel, SIGNAL(clicked()), this, SLOT(SetRRel())); - connect( RBRMuSigma, SIGNAL(clicked()), this, SLOT(SetRMS())); - connect( RBRAbs, SIGNAL(clicked()), this, SLOT(SetRAbs())); - connect( RBRNo, SIGNAL(clicked()), this, SLOT(SetRNo())); - connect( RBCPE, SIGNAL(clicked()), this, SLOT(SetCPE())); - connect( RBCRel, SIGNAL(clicked()), this, SLOT(SetCRel())); - connect( RBCMuSigma, SIGNAL(clicked()), this, SLOT(SetCMS())); - connect( RBCAbs, SIGNAL(clicked()), this, SLOT(SetCAbs())); - connect( RBCNo, SIGNAL(clicked()), this, SLOT(SetCNo())); - connect( RBL2, SIGNAL(clicked()), this, SLOT(SetUCL2())); - connect( RBInf, SIGNAL(clicked()), this, SLOT(SetUCInf())); - connect( CBJump, SIGNAL(stateChanged(int)), this, SLOT(SetUseField())); - connect( PBZoneNew, SIGNAL(pressed()), this, SLOT(PushZoneNew())); - connect( PBZoneEdit, SIGNAL(pressed()), this, SLOT(PushZoneEdit()) ); - connect( PBZoneDelete, SIGNAL(pressed()), this, SLOT(PushZoneDelete()) ); - connect( CBGroupe, SIGNAL(stateChanged(int)), this, SLOT(SetFiltrage())); - - connect( RBFieldNo, SIGNAL(clicked()), this, SLOT(SetFieldNo())); - connect( RBFieldAll, SIGNAL(clicked()), this, SLOT(SetFieldAll())); - connect( RBFieldChosen,SIGNAL(clicked()), this, SLOT(SetFieldChosen())); - - connect( CBAdvanced, SIGNAL(stateChanged(int)), this, SLOT(SetAdvanced())); - connect( RBAIN, SIGNAL(clicked()), this, SLOT(SetAIN())); - connect( RBAIR, SIGNAL(clicked()), this, SLOT(SetAIR())); - connect( RBAID, SIGNAL(clicked()), this, SLOT(SetAID())); - - connect( buttonOk, SIGNAL(pressed()), this, SLOT( PushOnOK())); - connect( buttonApply, SIGNAL(pressed()), this, SLOT( PushOnApply())); - connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); - connect( buttonHelp, SIGNAL(pressed()), this, SLOT( PushOnHelp())); -} - -// ------------------------------------------------------------------------ -bool MonCreateHypothesis::PushOnApply() -// ------------------------------------------------------------------------ -// Appele lorsque l'un des boutons Ok ou Apply est presse -// -{ -// Verifications - - - if (LEName->text().trimmed()=="") { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_HYPO_NAME") ); - return false; - } - - if (VerifieZone() == false) return false; - if (VerifieComposant() == false) return false; - -// Creation de l'objet CORBA si ce n'est pas deja fait sous le meme nom - if (LEName->text().trimmed() != _Name) - { - _Name=LEName->text().trimmed(); - try - { - aHypothesis=myAdaptGen->CreateHypothesis(CORBA::string_dup(_Name.toStdString().c_str()) ); - _parent->addHypothese(_Name); - } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QString(CORBA::string_dup(S_ex.details.text)) ); - return false; - } - } - -// Mise en place des attributs - if ( _aTypeAdap == -1 ) - { - int TypeRaffDera ; - if ( _aTypeRaff == 1 ) { TypeRaffDera = 1 ; } - else { TypeRaffDera = -1 ; } - aHypothesis->SetUnifRefinUnRef(TypeRaffDera); - } - aHypothesis->SetTypeFieldInterp(_TypeFieldInterp); - aHypothesis->SetCaseCreation(_aCaseName.toStdString().c_str()); - - AssocieLesZones(); - AssocieComposants(); - AssocieLesGroupes(); - AssocieFieldInterp(); - -// Options avancees - if (CBAdvanced->isChecked()) - { -// Enregistrement du niveau maximal - _NivMax = SpinBoxNivMax->value() ; - aHypothesis->SetNivMax(_NivMax); -// Enregistrement du diametre minimal - _DiamMin = doubleSpinBoxDiamMin->value() ; - aHypothesis->SetDiamMin(_DiamMin); -// Enregistrement de l'intialisation de l'adaptation - aHypothesis->SetAdapInit(_AdapInit); -// Sortie optionnelle des niveaux de raffinement, des diametres, des qualites - _ExtraOutput = 1 ; - if (CBOutputLevel->isChecked()) { _ExtraOutput = 2 ; } - if (CBOutputQuality->isChecked()) { _ExtraOutput = 3*_ExtraOutput ; } - if (CBOutputDiameter->isChecked()) { _ExtraOutput = 5*_ExtraOutput ; } - if (CBOutputParent->isChecked()) { _ExtraOutput = 7*_ExtraOutput ; } - if (CBOutputVoisins->isChecked()) { _ExtraOutput = 11*_ExtraOutput ; } - aHypothesis->SetExtraOutput(_ExtraOutput); - } - - HOMARD_UTILS::updateObjBrowser() ; - - return true; -} - - -// ------------------------------------------------------------------------ -void MonCreateHypothesis::PushOnOK() -// ------------------------------------------------------------------------ -{ - if (PushOnApply()) this->close(); - if ( _parent ) { _parent->raise(); _parent->activateWindow(); }; -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::PushOnHelp() -// ------------------------------------------------------------------------ -{ - std::string LanguageShort = myAdaptGen->GetLanguageShort(); - HOMARD_UTILS::PushOnHelp(QString("gui_create_hypothese.html"), QString(""), QString(LanguageShort.c_str())); -} -// ------------------------------------------------- -void MonCreateHypothesis::SetNewName() -// -------------------------------------------------- -{ - - ADAPT::listeHypotheses_var MyObjects = myAdaptGen->GetAllHypothesesName(); - int num = 0;// - QString aName=""; - while (aName=="" ) - { - aName.setNum(num+1) ; - aName.insert(0, QString("Hypo_")) ; - for ( int i=0; ilength(); i++) - { - if ( aName == QString(MyObjects[i])) - { - num ++ ; - aName = "" ; - break ; - } - } - } - LEName->setText(aName); -} - -// -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetUniforme() -// ------------------------------------------------------------------------ -{ - GBFieldManagement->setVisible(0); - if ( _TypeFieldInterp == 0 ) { GBFieldFile->setVisible(0); } - else { GBFieldFile->setVisible(1); } - GBAreaManagement->setVisible(0); - GBUniform->setVisible(1); - - _aTypeAdap = -1 ; -// - adjustSize(); -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetChamp() -// ------------------------------------------------------------------------ -{ - if (_aFieldFile == QString("")) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_HYPO_FIELD_FILE") ); - close(); - if ( _parent ) { _parent->raise(); _parent->activateWindow(); }; - return; - } - LEFieldFile->setText(_aFieldFile); - LEFieldFile->setReadOnly(1); - InitFields(); - GBUniform->setVisible(0); - GBAreaManagement->setVisible(0); - GBFieldManagement->setVisible(1); - GBFieldFile->setVisible(1); - - GBUniform->adjustSize(); - GBAreaManagement->adjustSize(); - GBFieldManagement->adjustSize(); - GBFieldFile->adjustSize(); - - _aTypeAdap = 1 ; -// - adjustSize(); -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetZone() -// ------------------------------------------------------------------------ -{ - GetAllZones(); - GBUniform->setVisible(0); - GBFieldManagement->setVisible(0); - if ( _TypeFieldInterp == 0 ) { GBFieldFile->setVisible(0); } - else { GBFieldFile->setVisible(1); } - GBAreaManagement->setVisible(1); - - _aTypeRaff = 1 ; - _aTypeDera = 0 ; - _aTypeAdap = 0 ; -// - adjustSize(); -} - -// ------------------------------------------------------------------------ -void MonCreateHypothesis::PushZoneNew() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de MonCreateHypothesis::PushZoneNew") - MonCreateZone *aDlg = new MonCreateZone(this, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), _aCaseName) ; - aDlg->show(); -} - -// ------------------------------------------------------------------------ -void MonCreateHypothesis::PushZoneEdit() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de MonCreateHypothesis::PushZoneEdit") - int colonne = TWZone->currentColumn(); - QTableWidgetItem * monItem = TWZone->currentItem(); - if (colonne !=2 || monItem == NULL) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_HYPO_ZONE_1") ); - return; - } - QString zoneName = monItem->text().trimmed(); - MonEditZone *aDlg = new MonEditZone(this, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), _aCaseName, zoneName) ; - aDlg->show(); -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::PushZoneDelete() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de MonCreateHypothesis::PushZoneDelete") - QMessageBox::warning( 0, QObject::tr("HOM_WARNING"), - QObject::tr("HOM_INACTIVE_BUTTON") ); - return; -} - -// ------------------------------------------------------------------------ -void MonCreateHypothesis::GetAllZones() -// ------------------------------------------------------------------------ -// Recuperation de toutes les zones enregistrees dans l'arbre d'etude -// et affichage dans le tableau -// Par defaut, aucune n'est selectionnee -{ - MESSAGE("Debut de GetAllZones") ; - ADAPT::listeZones_var mesZones = myAdaptGen->GetAllZonesName(); - int nbrow=TWZone->rowCount(); - for ( int row=0; row< nbrow; row++) - { - TWZone->removeRow(row); - } - TWZone->setRowCount(0); - int row=0; - for (int i=0; ilength(); i++) - { - TWZone->insertRow(row); -// - TWZone->setItem( row, 0, new QTableWidgetItem( QString ("") ) ); - TWZone->item( row, 0 )->setFlags( 0 ); - TWZone->item( row, 0 )->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled ); - TWZone->item( row, 0 )->setCheckState( Qt::Unchecked ); -// - TWZone->setItem( row, 1, new QTableWidgetItem( QString ("") ) ); - TWZone->item( row, 1 )->setFlags( 0 ); - TWZone->item( row, 1 )->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled ); - TWZone->item( row, 1 )->setCheckState( Qt::Unchecked ); -// - TWZone->setItem( row, 2, new QTableWidgetItem(QString(mesZones[i]).trimmed())); - TWZone->item( row, 2 )->setFlags(Qt::ItemIsEnabled |Qt::ItemIsSelectable ); -// - row += 1; - } - TWZone->resizeColumnsToContents(); - TWZone->resizeRowsToContents(); - TWZone->clearSelection(); -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::addZoneinTWZone(QString newZone) -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de addZoneinTWZone") ; - int row = TWZone->rowCount() ; -// Par defaut, on suppose qu'une nouvelle zone est destinee au raffinement - TWZone->setRowCount( row+1 ); -// - TWZone->setItem( row, 0, new QTableWidgetItem( QString ("") ) ); - TWZone->item( row, 0 )->setFlags( Qt::ItemIsEditable|Qt::ItemIsUserCheckable|Qt::ItemIsEnabled ); - TWZone->item( row, 0 )->setCheckState( Qt::Checked ); -// - TWZone->setItem( row, 1, new QTableWidgetItem( QString ("") ) ); - TWZone->item( row, 1 )->setFlags( Qt::ItemIsEditable|Qt::ItemIsUserCheckable|Qt::ItemIsEnabled ); - TWZone->item( row, 1 )->setCheckState( Qt::Unchecked ); -// - TWZone->setItem( row, 2, new QTableWidgetItem( newZone ) ); - TWZone->scrollToItem( TWZone->item( row, 2 ) ); -// - TWZone->resizeRowsToContents(); - TWZone->resizeColumnToContents(1); - TWZone->clearSelection(); -// - TWZone->item( row, 2 )->setFlags( Qt::ItemIsEnabled |Qt::ItemIsSelectable ); -} -// ------------------------------------------------------------------------ -QStringList MonCreateHypothesis::GetZonesChecked() -// ------------------------------------------------------------------------ -// Retourne les zones enregistrees -{ - MESSAGE("Debut de GetZonesChecked") ; - QStringList ListeZone ; -// On ne peut pas avoir selectionne les deux options - int Pbm = 0 ; - for ( int row=0; row< TWZone->rowCount(); row++) - { - if ( ( TWZone->item( row, 0 )->checkState() == Qt::Checked ) && ( TWZone->item( row, 1 )->checkState() == Qt::Checked ) ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_HYPO_ZONE_3") ); - Pbm = 1 ; - } - } -// Si tout va bien, on affecte -// Attention, on insere en tete, donc on commence d'inserer le type, psui le nom de la zone - if ( Pbm == 0 ) - { - QString Raff = "1" ; - QString Dera = "-1" ; - for ( int row=0; row< TWZone->rowCount(); row++) - { -// MESSAGE ("row "<item(row, 2)->text().toStdString()); -// En raffinement : - if ( TWZone->item(row,0)->checkState() == Qt::Checked ) - { ListeZone.insert(0, Raff) ; - ListeZone.insert(0, QString(TWZone->item(row, 2)->text()) ) ; } -// En deraffinement : - if ( TWZone->item(row,1)->checkState() == Qt::Checked ) - { ListeZone.insert(0, Dera) ; - ListeZone.insert(0, QString(TWZone->item(row, 2)->text()) ) ; } - } - MESSAGE("Fin de GetZonesChecked ; longueur de ListeZone : "<rowCount(); row++) - if ( TWCMP->item( row, 0 )->checkState() == Qt::Checked ) - ListeComposant.insert(0, QString(TWCMP->item(row, 1)->text()) ) ; - // Choix du texte des radio-boutons selon 1 ou plusieurs composantes - if ( ListeComposant.count() < 2 ) - { RBL2->setText(QObject::tr("HOM_HYPO_NORM_ABS")); - RBInf->setText(QObject::tr("HOM_HYPO_NORM_REL")); - } - else - { RBL2->setText(QObject::tr("HOM_HYPO_NORM_L2")); - RBInf->setText(QObject::tr("HOM_HYPO_NORM_INF")); - } - return ListeComposant ; -// -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::AssocieFieldInterp() -// ------------------------------------------------------------------------ -{ - if ( _TypeFieldInterp != 2 ) return; - for ( int row=0; row< TWField->rowCount(); row++) - { - if ( TWField->item( row, 0 )->checkState() == Qt::Checked ) - { - aHypothesis->AddFieldInterp(TWField->item(row, 1)->text().toStdString().c_str()); - } - } -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetUniRaff() -// ------------------------------------------------------------------------ -{ - _aTypeRaff = 1 ; - _aTypeDera = 0 ; -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetUniDera() -// ------------------------------------------------------------------------ -{ - _aTypeRaff = 0 ; - _aTypeDera = 1 ; -} - -// ------------------------------------------------------------------------ -void MonCreateHypothesis::InitFields() -// ------------------------------------------------------------------------ -{ - CBFieldName->clear(); - std::list listeChamp = HOMARD_QT_COMMUN::GetListeChamps(QString(_aFieldFile) ); - // Mise en place de la liste dans le menu pour l'indicateur d'erreur - std:: list::const_iterator it; - for ( it=listeChamp.begin() ; it != listeChamp.end(); it++) - { - CBFieldName->insertItem(0,QString(*it)); - } - SetFieldName(); -} -// --------------------------------------- -void MonCreateHypothesis::SetFieldName() -// ------------------------------------------- -{ - MESSAGE("Debut de SetFieldName"); - _aFieldName=CBFieldName->currentText(); - if (QString(_aFieldFile) == QString("") || QString(_aFieldName) == QString("") ) { return; } - - int nbrow= TWCMP->rowCount() ; - for ( int row=0; row < nbrow ; row++) - { - TWCMP->removeRow(row); - } - TWCMP->setRowCount(0); - //TWCMP->resizeRowsToContents(); - - std::list maListe =HOMARD_QT_COMMUN::GetListeComposants(_aFieldFile, _aFieldName); - std::list::const_iterator it; - for ( it=maListe.begin() ; it != maListe.end(); it++) - { - TWCMP->insertRow(0); - TWCMP->setItem( 0, 0, new QTableWidgetItem( QString ("") ) ); - TWCMP->item( 0, 0 )->setFlags( 0 ); - TWCMP->item( 0, 0 )->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled ); - TWCMP->item( 0, 0 )->setCheckState( Qt::Checked ); - TWCMP->setItem( 0, 1, new QTableWidgetItem(QString((*it)).trimmed())); - TWCMP->item( 0, 1 )->setFlags( Qt::ItemIsEnabled |Qt::ItemIsSelectable ); - } - TWCMP->resizeColumnsToContents(); - TWCMP->resizeRowsToContents(); - TWCMP->clearSelection(); - // Choix du texte des radio-boutons selon 1 ou plusieurs composantes - if ( TWCMP->rowCount() == 1 ) - { RBL2->setText(QObject::tr("HOM_HYPO_NORM_ABS")); - RBInf->setText(QObject::tr("HOM_HYPO_NORM_REL")); - } - else - { RBL2->setText(QObject::tr("HOM_HYPO_NORM_L2")); - RBInf->setText(QObject::tr("HOM_HYPO_NORM_INF")); - } - // Par defaut, on propose la valeur absolue / norme L2 - SetUCL2(); -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetRPE() -// ------------------------------------------------------------------------ -{ - _aTypeRaff = 1 ; - _TypeThR = 3 ; - RBRPE->setChecked(true); - SpinBox_RPE->setEnabled(true); - SpinBox_RRel->setEnabled(false); - SpinBox_RAbs->setEnabled(false); - SpinBox_RMuSigma->setEnabled(false); -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetRRel() -// ------------------------------------------------------------------------ -{ - _aTypeRaff = 1 ; - _TypeThR = 2 ; - RBRRel->setChecked(true); - SpinBox_RPE->setEnabled(false); - SpinBox_RRel->setEnabled(true); - SpinBox_RAbs->setEnabled(false); - SpinBox_RMuSigma->setEnabled(false); -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetRAbs() -// ------------------------------------------------------------------------ -{ - _aTypeRaff = 1 ; - _TypeThR = 1 ; - RBRAbs->setChecked(true); - SpinBox_RPE->setEnabled(false); - SpinBox_RRel->setEnabled(false); - SpinBox_RAbs->setEnabled(true); - SpinBox_RMuSigma->setEnabled(false); -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetRMS() -// ------------------------------------------------------------------------ -{ - _aTypeRaff = 1 ; - _TypeThR = 4 ; - RBRMuSigma->setChecked(true); - SpinBox_RPE->setEnabled(false); - SpinBox_RRel->setEnabled(false); - SpinBox_RAbs->setEnabled(false); - SpinBox_RMuSigma->setEnabled(true); -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetRNo() -// ------------------------------------------------------------------------ -{ - _aTypeRaff = 0 ; - _TypeThR = 0; - RBRNo->setChecked(true); - SpinBox_RPE->setEnabled(false); - SpinBox_RRel->setEnabled(false); - SpinBox_RAbs->setEnabled(false); - SpinBox_RMuSigma->setEnabled(false); -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetCPE() -// ------------------------------------------------------------------------ -{ - _aTypeDera = 1 ; - _TypeThC = 3 ; - RBCPE->setChecked(true); - SpinBox_CPE->setEnabled(true); - SpinBox_CRel->setEnabled(false); - SpinBox_CAbs->setEnabled(false); - SpinBox_CMuSigma->setEnabled(false); -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetCRel() -// ------------------------------------------------------------------------ -{ - _aTypeDera = 1 ; - _TypeThC = 2 ; - RBCRel->setChecked(true); - SpinBox_CPE->setEnabled(false); - SpinBox_CRel->setEnabled(true); - SpinBox_CAbs->setEnabled(false); - SpinBox_CMuSigma->setEnabled(false); -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetCAbs() -// ------------------------------------------------------------------------ -{ - _aTypeDera = 1 ; - _TypeThC = 1 ; - RBCAbs->setChecked(true); - SpinBox_CPE->setEnabled(false); - SpinBox_CRel->setEnabled(false); - SpinBox_CAbs->setEnabled(true); - SpinBox_CMuSigma->setEnabled(false); -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetCMS() -// ------------------------------------------------------------------------ -{ - _aTypeDera = 1 ; - _TypeThC = 4 ; - RBCMuSigma->setChecked(true); - SpinBox_CPE->setEnabled(false); - SpinBox_CRel->setEnabled(false); - SpinBox_CAbs->setEnabled(false); - SpinBox_CMuSigma->setEnabled(true); -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetCNo() -// ------------------------------------------------------------------------ -{ - _aTypeDera = 0 ; - _TypeThC = 0; - RBCNo->setChecked(true); - SpinBox_CPE->setEnabled(false); - SpinBox_CRel->setEnabled(false); - SpinBox_CAbs->setEnabled(false); - SpinBox_CMuSigma->setEnabled(false); -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetUCL2() -// ------------------------------------------------------------------------ -{ - _UsCmpI = 0 ; - RBL2->setChecked(true); -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetUCInf() -// ------------------------------------------------------------------------ -{ - if ( TWCMP->rowCount() == 1 ) { _UsCmpI = 2 ; } - else { _UsCmpI = 1 ; } - RBInf->setChecked(true); -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetUseField() -// ------------------------------------------------------------------------ -{ - if ( CBJump->isChecked() ) { _UsField = 1 ; } - else { _UsField = 0 ; } -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetFiltrage() -// ------------------------------------------------------------------------ -{ - if (!CBGroupe->isChecked()) return; - MonCreateListGroup *aDlg = new MonCreateListGroup(this, NULL, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen),_aCaseName, _aListeGroupes) ; - aDlg->show(); -} - -// ------------------------------------------------------------------------ -void MonCreateHypothesis::setGroups(QStringList listGroup) -// ------------------------------------------------------------------------ -{ - _aListeGroupes=listGroup; -} -// ------------------------------------------------------------------------ -bool MonCreateHypothesis::VerifieZone() -// ------------------------------------------------------------------------ -{ - if ( _aTypeAdap != 0 ) return true; - MESSAGE("Debut de VerifieZone") ; - _aListeZone = GetZonesChecked() ; - MESSAGE(". Longueur de _aListeZone : "<<_aListeZone.count()) ; - if (_aListeZone.count() == 0) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_HYPO_ZONE_2") ); - return false; - } - MESSAGE("Fin de VerifieZone") ; - return true; -} -// ------------------------------------------------------------------------ -bool MonCreateHypothesis::VerifieComposant() -// ------------------------------------------------------------------------ -{ - if ( _aTypeAdap != 1 ) return true; - _aListeComposant = GetListCompChecked() ; - if (_aListeComposant.count() == 0) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_HYPO_COMP") ); - return false; - } - return true; -} - -// ------------------------------------------------------------------------ -void MonCreateHypothesis::AssocieLesZones() -// ------------------------------------------------------------------------ -{ - MESSAGE( "Debut de AssocieLesZones" ); - if ( _aTypeAdap != 0 ) return; - _aListeZone = GetZonesChecked() ; - MESSAGE(". Longueur de _aListeZone : "<<_aListeZone.count()) ; - QString Raff = "1" ; - int TypeUse ; - for ( int i=0 ; i< _aListeZone.count() ; i++ ) - { if ( _aListeZone[i+1] == Raff ) { TypeUse = 1 ; } - else { TypeUse = -1 ; } - aHypothesis->AddZone(_aListeZone[i].toStdString().c_str(), TypeUse); - i += 1 ; - } - MESSAGE( "Fin de AssocieLesZones" ); -}; -// ------------------------------------------------------------------------ -void MonCreateHypothesis::AssocieComposants() -// ------------------------------------------------------------------------ -{ - if ( _aTypeAdap != 1 ) return; - MESSAGE( "Dans AssocieComposants, _TypeThC : " << _TypeThC ); - MESSAGE( "Dans AssocieComposants, _TypeThR : " << _TypeThR ); - - _ThreshR = 0; - if ( _TypeThR == 1 ) { _ThreshR = SpinBox_RAbs->value();} - if ( _TypeThR == 2 ) { _ThreshR = SpinBox_RRel->value();} - if ( _TypeThR == 3 ) { _ThreshR = SpinBox_RPE->value(); } - if ( _TypeThR == 4 ) { _ThreshR = SpinBox_RMuSigma->value(); } - - _ThreshC = 0; - if ( _TypeThC == 1 ) { _ThreshC = SpinBox_CAbs->value();} - if ( _TypeThC == 2 ) { _ThreshC = SpinBox_CRel->value();} - if ( _TypeThC == 3 ) { _ThreshC = SpinBox_CPE->value(); } - if ( _TypeThC == 4 ) { _ThreshC = SpinBox_CMuSigma->value(); } - - _aFieldName=CBFieldName->currentText(); - aHypothesis->SetField(CORBA::string_dup(_aFieldName.toStdString().c_str()) ) ; - if ( _TypeThR > 0 ) { aHypothesis->SetRefinThr( _TypeThR, _ThreshR ) ; } - if ( _TypeThC > 0 ) { aHypothesis->SetUnRefThr( _TypeThC, _ThreshC ) ; } - aHypothesis->SetUseField( _UsField ) ; - aHypothesis->SetUseComp( _UsCmpI ) ; - _aListeComposant = GetListCompChecked() ; - for ( int i=0 ; i< _aListeComposant.count() ; i++ ) - { aHypothesis->AddComp(_aListeComposant[i].toStdString().c_str()); } -}; -// ------------------------------------------------------------------------ -void MonCreateHypothesis::AssocieLesGroupes() -// ------------------------------------------------------------------------ -{ - ADAPT::ListGroupType_var aSeqGroupe = new ADAPT::ListGroupType; - aSeqGroupe->length(_aListeGroupes.size()); - QStringList::const_iterator it; - int i=0; - for (it = _aListeGroupes.constBegin(); it != _aListeGroupes.constEnd(); it++) - aSeqGroupe[i++]=(*it).toStdString().c_str(); - aHypothesis->SetGroups(aSeqGroupe); - -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetFieldNo() -// ------------------------------------------------------------------------ -// Par defaut, on n'interpole rien -{ - if ( _aTypeAdap == 1 ) { GBFieldFile->setVisible(1); } - else { GBFieldFile->setVisible(0); } - TWField->setVisible(0); -// - _TypeFieldInterp = 0 ; -// - adjustSize(); -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetFieldAll() -// ------------------------------------------------------------------------ -// Par defaut, on interpole tout -{ - if (_aFieldFile == QString("")) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_HYPO_FIELD_FILE") ); - close(); - if ( _parent ) { _parent->raise(); _parent->activateWindow(); }; - return; - } - LEFieldFile->setText(_aFieldFile); - LEFieldFile->setReadOnly(1); - GBFieldFile->setVisible(1); - TWField->setVisible(0); -// - _TypeFieldInterp = 1 ; -// - adjustSize(); -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetFieldChosen() -// ------------------------------------------------------------------------ -{ - if (_aFieldFile == QString("")) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_HYPO_FIELD_FILE") ); - close(); - if ( _parent ) { _parent->raise(); _parent->activateWindow(); }; - return; - } - LEFieldFile->setText(_aFieldFile); - LEFieldFile->setReadOnly(1); - GBFieldFile->setVisible(1); - // Recuperation de la liste des champs contenus dans le fichier _aFieldFile - std::list listeChamp = HOMARD_QT_COMMUN::GetListeChamps(QString(_aFieldFile) ); - - // Initialisation de la table - TWField->clear(); - int nbrow=TWField->rowCount(); - for ( int row=0; row< nbrow; row++) - { - TWField->removeRow(row); - } - TWField->setRowCount(0); - std:: list::const_iterator it; - int row=0; - for ( it=listeChamp.begin() ; it != listeChamp.end(); it++) - { - TWField->insertRow(row); - TWField->setItem( row, 0, new QTableWidgetItem( QString ("") ) ); - TWField->item( row, 0 )->setFlags( 0 ); - TWField->item( row, 0 )->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled ); - TWField->item( row, 0 )->setCheckState( Qt::Unchecked ); - TWField->setItem( row, 1, new QTableWidgetItem(QString(*it).trimmed())); - TWField->item( row, 1 )->setFlags(Qt::ItemIsEnabled |Qt::ItemIsSelectable ); - row=row+1; - } - TWField->resizeColumnsToContents(); - TWField->resizeRowsToContents(); - TWField->clearSelection(); - TWField->setVisible(1); - - _TypeFieldInterp = 2 ; -// - adjustSize(); -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetAdvanced() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetAdvanced "); - if (CBAdvanced->isChecked()) - { GBAdvancedOptions->setVisible(1); - if (_aFieldFile != QString("")) { GBAdapInit->setVisible(1) ; } - else { GBAdapInit->setVisible(0) ; } - } - else - { GBAdvancedOptions->setVisible(0); - _NivMax = -1 ; - _DiamMin = -1. ; - _AdapInit = 0 ; - CBOutputLevel->setChecked(false); - CBOutputQuality->setChecked(false); - CBOutputDiameter->setChecked(false); - CBOutputParent->setChecked(false); - CBOutputVoisins->setChecked(false); - _ExtraOutput = 1 ; - } -// - adjustSize(); -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetAIN() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetAIN "); - _AdapInit = 0 ; -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetAIR() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetAIR "); - _AdapInit = 1 ; -} -// ------------------------------------------------------------------------ -void MonCreateHypothesis::SetAID() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetAID "); - _AdapInit = -1 ; -} diff --git a/src/ADAPTGUI/MonCreateHypothesis.h b/src/ADAPTGUI/MonCreateHypothesis.h deleted file mode 100644 index 42f41f1ef..000000000 --- a/src/ADAPTGUI/MonCreateHypothesis.h +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_CREATEHYPOTHESIS_H -#define MON_CREATEHYPOTHESIS_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) -#include CORBA_CLIENT_HEADER(HOMARD_Hypothesis) - -#include "ui_CreateHypothesis.h" -#include - -class MonCreateIteration; -class HOMARD_EXPORT MonCreateHypothesis : public QScrollArea, public Ui_CreateHypothesis -{ - Q_OBJECT - -public: - MonCreateHypothesis( MonCreateIteration* parent, bool modal, ADAPT::ADAPT_Gen_var myAdaptGen, - QString aHypotheseName, QString caseName, QString aFieldFile); - ~MonCreateHypothesis(); - - virtual void addZoneinTWZone(QString newZone); - virtual void setGroups(QStringList listGroup); - -protected : - // MonCreateHypothesis( MonCreateIteration* parent, ADAPT::ADAPT_Gen_var myAdaptGen, - // QString caseName, QString aFieldFile); - - MonCreateIteration *_parent; - - QString _Name; - QString _aFieldFile ; - QString _aFieldName; - QString _aCaseName; - - int _aTypeAdap; - int _aTypeRaff; - int _aTypeDera; - - int _TypeThR; - double _ThreshR; - int _TypeThC; - double _ThreshC; - - int _UsField; - int _UsCmpI; - int _TypeFieldInterp; - - int _NivMax; - double _DiamMin; - int _AdapInit; - int _ExtraOutput; - - ADAPT::HOMARD_Hypothesis_var aHypothesis; - ADAPT::ADAPT_Gen_var myAdaptGen; - - QStringList _aListeZone; - QStringList _aListeComposant; - QStringList _aListeGroupes; - - virtual void InitConnect(); - virtual void InitFields(); - virtual void GetAllZones(); - virtual void SetNewName(); - - virtual void AssocieFieldInterp(); - virtual void AssocieLesZones(); - virtual void AssocieComposants(); - virtual void AssocieLesGroupes(); - virtual bool VerifieZone(); - virtual bool VerifieComposant(); - - virtual QStringList GetZonesChecked(); - virtual QStringList GetListCompChecked(); - -public slots: - - virtual void SetUniforme(); - virtual void SetChamp(); - virtual void SetZone(); - virtual void SetUniRaff(); - virtual void SetUniDera(); - virtual void SetFieldName(); - virtual void SetRPE(); - virtual void SetRAbs(); - virtual void SetRRel(); - virtual void SetRMS(); - virtual void SetRNo(); - virtual void SetCPE(); - virtual void SetCAbs(); - virtual void SetCRel(); - virtual void SetCMS(); - virtual void SetCNo(); - virtual void SetUCL2(); - virtual void SetUCInf(); - virtual void SetUseField(); - virtual void PushZoneNew(); - virtual void PushZoneEdit(); - virtual void PushZoneDelete(); - virtual void SetFiltrage(); - virtual void SetFieldNo(); - virtual void SetFieldAll(); - virtual void SetFieldChosen(); - - virtual void SetAdvanced(); - virtual void SetAIN(); - virtual void SetAIR(); - virtual void SetAID(); - - virtual void PushOnOK(); - virtual bool PushOnApply(); - virtual void PushOnHelp(); -}; - -#endif // MON_CREATEHYPOTHESIS_H diff --git a/src/ADAPTGUI/MonCreateIteration.cxx b/src/ADAPTGUI/MonCreateIteration.cxx deleted file mode 100644 index 27befda2d..000000000 --- a/src/ADAPTGUI/MonCreateIteration.cxx +++ /dev/null @@ -1,339 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonCreateIteration.h" -#include "MonCreateHypothesis.h" -#include "MonEditHypothesis.h" - -#include -#include - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include "HomardQtCommun.h" -#include - -using namespace std; - -// ----------------------------------------------------------------------------------------------------- -MonCreateIteration::MonCreateIteration(QWidget* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen0, QString IterParentName ): -// ----------------------------------------------------------------------------------------------------- -/* Constructs a MonCreateIteration - * Inherits from CasHomard - * Sets attributes to default values - */ - QScrollArea(0), - Ui_CreateIteration(), - _Name(""), - _IterParentName(IterParentName), - _CaseName("") - { - MESSAGE("Constructeur"); - myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0); - setupUi(this); - if ( modal ) { setWindowModality(Qt::WindowModal); } - else { setWindowModality(Qt::NonModal); } - InitConnect(); - - SetNewName(); - GetHypotheses(); - if (_IterParentName != QString("")) { SetIterParentName(); } - else { setWindowModality(Qt::NonModal) ; /* permet selection de l'iteration dans l arbre d etude */} - SetTSNo(); -// - adjustSize(); - } -// ------------------------------------------------------------------------ -MonCreateIteration::~MonCreateIteration() -// ------------------------------------------------------------------------ -{ - // no need to delete child widgets, Qt does it all for us -} -// ------------------------------------------------------------------------ -void MonCreateIteration::InitConnect() -// ------------------------------------------------------------------------ -{ - connect( PBIterParent, SIGNAL(pressed()), this, SLOT( SetIterParentName())); - connect( PBHypoEdit, SIGNAL(pressed()), this, SLOT( PushHypoEdit() ) ); - connect( PBHypoNew, SIGNAL(pressed()), this, SLOT( PushHypoNew() ) ); - connect( PushFieldFile, SIGNAL(pressed()), this, SLOT( SetFieldFile() ) ); - connect( RBNo, SIGNAL(clicked()), this, SLOT( SetTSNo())); - connect( RBLast, SIGNAL(clicked()), this, SLOT( SetTSLast())); - connect( RBChosen, SIGNAL(clicked()), this, SLOT( SetTSChosen())); - - connect( buttonOk, SIGNAL(pressed()), this, SLOT( PushOnOK() ) ); - connect( buttonApply, SIGNAL(pressed()), this, SLOT( PushOnApply() ) ); - connect( buttonCancel, SIGNAL(pressed()), this, SLOT( close() ) ); - connect( buttonHelp, SIGNAL(pressed()), this, SLOT( PushOnHelp() ) ); -} -// ------------------------------------------------------------------------ -void MonCreateIteration::GetHypotheses() -// ------------------------------------------------------------------------ -{ - ADAPT::listeHypotheses_var mesHypotheses = myAdaptGen->GetAllHypothesesName(); - for (int i=0; ilength(); i++) - { - CBHypothese->addItem(QString(mesHypotheses[i])); - } -} -// ------------------------------------------------------------------------ -bool MonCreateIteration::PushOnApply() -// ------------------------------------------------------------------------ -// Appele lorsque l'un des boutons Ok ou Apply est presse -{ - MESSAGE("PushOnApply"); -// - QString aName = LEName->text().trimmed(); - if ( aName == QString ("")) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_ITER_NAME") ); - return false; - } - - if ( _IterParentName == QString ("")) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_ITER_STARTING_POINT") ); - return false; - } - QString aMeshName_np1=LEMeshName_np1->text().trimmed(); - if (aMeshName_np1 == "" ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_ITER_MESH") ); - return false; - } - QString monHypoName=CBHypothese->currentText(); - if (monHypoName == "" ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_ITER_HYPO") ); - return false; - } - ADAPT::HOMARD_Hypothesis_var _myHypothesis = myAdaptGen->GetHypothesis(monHypoName.toStdString().c_str()); - ADAPT::listeTypes_var ListTypes (_myHypothesis->GetAdapRefinUnRef()); - int TypeAdap = ListTypes[0]; - if ( TypeAdap == 1 && LEFieldFile->text().trimmed() == QString("") ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_ITER_FIELD_FILE") ); - return false; - } - - MESSAGE ("aMeshName_np1.toStdString " << aMeshName_np1.toStdString()); - MESSAGE ("_CaseName.toStdString " << _CaseName.toStdString() ); - MESSAGE ("_IterParentName.toStdString " << _IterParentName.toStdString() ); - -// Creation de l'objet CORBA si ce n'est pas deja fait sous le meme nom - if (_Name != aName) - { - try - { - _Name = aName; - std::cerr << _Name.toStdString() << std::endl; - aIter = myAdaptGen->CreateIteration( \ - CORBA::string_dup(_Name.toStdString().c_str()), - CORBA::string_dup(_IterParentName.toStdString().c_str())); - } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - return false; - } - } -// Mise en place des attributs - std::string IterName = aIter->GetName() ; - - if ( LEFieldFile->text().trimmed() != QString("")) - { - QString FieldFile=LEFieldFile->text().trimmed(); - aIter->SetFieldFile(CORBA::string_dup(FieldFile.toStdString().c_str())); - int rank = SpinBox_Rank->value(); - int step = SpinBox_TimeStep->value(); - if ( step == -2 ) { aIter->SetTimeStepRankLast(); } - else { aIter->SetTimeStepRank(step,rank); } - } - myAdaptGen->AssociateIterHypo (IterName.c_str(), monHypoName.toStdString().c_str()); - aIter->SetMeshName(CORBA::string_dup(aMeshName_np1.toStdString().c_str())); - - HOMARD_UTILS::updateObjBrowser() ; - - return true; -} -// ------------------------------------------------------------------------ -void MonCreateIteration::PushOnOK() -// ------------------------------------------------------------------------ -{ - bool bOK = PushOnApply(); - if ( bOK ) this->close(); -} -// ------------------------------------------------------------------------ -void MonCreateIteration::PushOnHelp() -// ------------------------------------------------------------------------ -{ - std::string LanguageShort = myAdaptGen->GetLanguageShort(); - HOMARD_UTILS::PushOnHelp(QString("gui_create_iteration.html"), QString(""), QString(LanguageShort.c_str())); -} -// ------------------------------------------------------------------------ -void MonCreateIteration::SetIterParentName() -// ------------------------------------------------------------------------ -{ - if (_IterParentName == QString("")) { - _IterParentName=HOMARD_QT_COMMUN::SelectionArbreEtude(QString("IterationHomard"), 1); - if (_IterParentName == QString("")) { raise();return;}; - } - _CaseName=HOMARD_QT_COMMUN::SelectionCasEtude(); - ADAPT::HOMARD_Iteration_var aIterParent = myAdaptGen->GetIteration(_IterParentName.toStdString().c_str()) ; - QString MeshName = aIterParent->GetMeshName(); - - LEMeshName_n->setText(MeshName); - LEMeshName_n->setReadOnly(1); - LEMeshName_np1->setText(MeshName); - - LEIterationParentName->setText(_IterParentName); -} -// ------------------------------------------------- -void MonCreateIteration::SetNewName() -// -------------------------------------------------- -{ -// Recherche d'un nom par defaut qui n'existe pas encore - - ADAPT::listeIterations_var MyObjects=myAdaptGen->GetAllIterationsName(); - int num = 0;// - QString aName=""; - while (aName=="" ) - { - aName.setNum(num+1) ; - aName.insert(0, QString("Iter_")); - for ( int i=0; i< MyObjects->length(); i++) - { - if ( aName == QString((MyObjects)[i])) - { - num ++ ; - aName = "" ; - break ; - } - } - } - LEName->setText(aName); -} -// ------------------------------------------------------------------------ -void MonCreateIteration::PushHypoEdit() -// ------------------------------------------------------------------------ -{ - if (CBHypothese->currentText() == QString("")) return; - if (_IterParentName == QString("")) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_ITER_STARTING_POINT") ); - raise(); - return; - } - QString aFieldFile=LEFieldFile->text().trimmed(); - MonEditHypothesis *HypoDlg = new MonEditHypothesis(this, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen),CBHypothese->currentText(), _CaseName, aFieldFile) ; - HypoDlg->show(); -} - -// ------------------------------------------------------------------------ -void MonCreateIteration::addHypothese(QString newHypothese) -// ------------------------------------------------------------------------ -{ - CBHypothese->insertItem(0,newHypothese); - CBHypothese->setCurrentIndex(0); -} -// ------------------------------------------------------------------------ -void MonCreateIteration::PushHypoNew() -// ------------------------------------------------------------------------ -{ - if (_IterParentName == QString("")) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_ITER_STARTING_POINT") ); - raise(); - return; - } - if ( _CaseName == QString("")) - { - ADAPT::HOMARD_Iteration_var aIterParent = myAdaptGen->GetIteration(_IterParentName.toStdString().c_str()) ; - _CaseName = aIterParent->GetCaseName(); - } - QString aFieldFile=LEFieldFile->text().trimmed(); - MonCreateHypothesis *HypoDlg = new MonCreateHypothesis(this, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), QString(""), _CaseName, aFieldFile) ; - HypoDlg->show(); -} -// ------------------------------------------------------------------------ -void MonCreateIteration::SetFieldFile() -// ------------------------------------------------------------------------ -{ - QString fileName0 = LEFieldFile->text().trimmed(); - QString fileName = HOMARD_QT_COMMUN::PushNomFichier( false, QString("med") ) ; - if (fileName.isEmpty()) fileName = fileName0 ; - LEFieldFile->setText(fileName); - raise(); -} -// ------------------------------------------------------------------------ -void MonCreateIteration::SetTSNo() -// ------------------------------------------------------------------------ -// Si on ne tient pas compte du pas de temps, on declare que le pas de temps -// vaut -1, valeur par defaut de med -{ - Rank->setVisible(0); - SpinBox_Rank->setVisible(0); - SpinBox_Rank->setValue(-1); - - TimeStep->setVisible(0); - SpinBox_TimeStep->setVisible(0); - SpinBox_TimeStep->setValue(-1); -// - adjustSize(); -} -// ------------------------------------------------------------------------ -void MonCreateIteration::SetTSLast() -// ------------------------------------------------------------------------ -// Si on choisit le dernier instant, on declare que le pas de temps vaut -2 -{ - Rank->setVisible(0); - SpinBox_Rank->setVisible(0); - SpinBox_Rank->setValue(-2); - - TimeStep->setVisible(0); - SpinBox_TimeStep->setVisible(0); - SpinBox_TimeStep->setValue(-2); -// - adjustSize(); -} -// ------------------------------------------------------------------------ -void MonCreateIteration::SetTSChosen() -// ------------------------------------------------------------------------ -// Si choisit un instant, on prepositionne a 0 -{ - Rank->setVisible(1); - SpinBox_Rank->setVisible(1); - SpinBox_Rank->setValue(0); - - TimeStep->setVisible(1); - SpinBox_TimeStep->setVisible(1); - SpinBox_TimeStep->setValue(0); -// - adjustSize(); -} - diff --git a/src/ADAPTGUI/MonCreateIteration.h b/src/ADAPTGUI/MonCreateIteration.h deleted file mode 100644 index 383110d5c..000000000 --- a/src/ADAPTGUI/MonCreateIteration.h +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_CREATEITERATION_H -#define MON_CREATEITERATION_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) -#include CORBA_CLIENT_HEADER(HOMARD_Cas) - -#include "ui_CreateIteration.h" -#include - -class HOMARD_EXPORT MonCreateIteration : public QScrollArea, public Ui_CreateIteration -{ - Q_OBJECT - -public: - MonCreateIteration( QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myAdaptGen, QString IterParentName ); - ~MonCreateIteration(); - - void addHypothese(QString newHypothese); - - -protected : - MonCreateIteration( QWidget* parent, ADAPT::ADAPT_Gen_var myAdaptGen, QString IterParentName ); - - QString _Name; - QString _IterParentName; - QString _CaseName; - - - ADAPT::HOMARD_Iteration_var aIter ; - ADAPT::HOMARD_Iteration_var aIterParent ; - ADAPT::HOMARD_Cas_var aCas ; - ADAPT::ADAPT_Gen_var myAdaptGen; - - - virtual void InitConnect(); - virtual void GetHypotheses(); - virtual void SetNewName(); - -public slots: - virtual void SetIterParentName(); - virtual void PushHypoEdit(); - virtual void PushHypoNew(); - virtual void PushOnOK(); - virtual bool PushOnApply(); - virtual void PushOnHelp(); - virtual void SetFieldFile(); - virtual void SetTSNo(); - virtual void SetTSLast(); - virtual void SetTSChosen(); - -}; - -#endif // MON_CREATEITERATION_H diff --git a/src/ADAPTGUI/MonCreateListGroup.cxx b/src/ADAPTGUI/MonCreateListGroup.cxx deleted file mode 100644 index 3c4ef4c48..000000000 --- a/src/ADAPTGUI/MonCreateListGroup.cxx +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonCreateListGroup.h" -#include "MonCreateHypothesis.h" -#include "MonCreateBoundaryDi.h" - -#include - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include "HomardQtCommun.h" -#include - -#include -#include -#include -#include -#include - -using namespace std; - -// -------------------------------------------------------------------------------------------------------------- -MonCreateListGroup::MonCreateListGroup(MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen0, QString aCaseName, QStringList listeGroupesHypo) : -// -------------------------------------------------------------------------------------------------------------- -// - QDialog(0), Ui_CreateListGroup(), - _aCaseName (aCaseName), - _listeGroupesHypo (listeGroupesHypo), - _parentHyp(parentHyp), - _parentBound(parentBound) -{ - MESSAGE("Debut de MonCreateListGroup") - myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0); - setupUi(this); - setModal(modal); - InitConnect(); - InitGroupes(); -} -// -------------------------------------------------------------------------------------------------------------- -MonCreateListGroup::MonCreateListGroup(MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, - ADAPT::ADAPT_Gen_var myAdaptGen, QString aCaseName, QStringList listeGroupesHypo) : -// -------------------------------------------------------------------------------------------------------------- -// - QDialog(0), Ui_CreateListGroup(), - _aCaseName (aCaseName), - _listeGroupesHypo (listeGroupesHypo), - _parentHyp(parentHyp), - _parentBound(parentBound) -{ - myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen); - setupUi(this); - InitConnect(); -} - -// ------------------------------------------------------------------------ -MonCreateListGroup::~MonCreateListGroup() -// ------------------------------------------------------------------------ -{ - // no need to delete child widgets, Qt does it all for us -} -// ------------------------------------------------------------------------ -void MonCreateListGroup::InitConnect() -// ------------------------------------------------------------------------ -{ - connect( buttonOk, SIGNAL( pressed() ), this, SLOT( PushOnOK() ) ); - connect( buttonApply, SIGNAL( pressed() ), this, SLOT( PushOnApply() ) ); - connect( buttonCancel, SIGNAL( pressed() ), this, SLOT( close() ) ); - connect( buttonHelp, SIGNAL( pressed() ), this, SLOT( PushOnHelp() ) ); -} -// ------------------------------------------------------------------------ -bool MonCreateListGroup::PushOnApply() -// ------------------------------------------------------------------------ -// Appele lorsque l'un des boutons Ok ou Apply est presse -// -{ - QStringList ListeGroup ; - for ( int row=0; row< TWGroupe->rowCount(); row++) - { - if ( TWGroupe->item( row, 0 )->checkState() == Qt::Checked ) - ListeGroup.insert(0, QString(TWGroupe->item(row, 1)->text()) ); - } - if ( _parentHyp ) { _parentHyp->setGroups(ListeGroup);}; - if ( _parentBound ) { _parentBound->setGroups(ListeGroup);}; - return true; -} - - -// ------------------------------------------------------------------------ -void MonCreateListGroup::PushOnOK() -// ------------------------------------------------------------------------ -{ - if (PushOnApply()) - { - this->close(); - if ( _parentHyp ) { _parentHyp->raise(); _parentHyp->activateWindow(); }; - if ( _parentBound ) { _parentBound->raise(); _parentBound->activateWindow(); }; - } -} -// ------------------------------------------------------------------------ -void MonCreateListGroup::PushOnHelp() -// ------------------------------------------------------------------------ -{ - std::string LanguageShort = myAdaptGen->GetLanguageShort(); - HOMARD_UTILS::PushOnHelp(QString("gui_create_hypothese.html"), QString(""), QString(LanguageShort.c_str())); -} -// ------------------------------------------------------------------------ -void MonCreateListGroup::InitGroupes() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de MonCreateListGroup::InitGroupes "); - for ( int row=0; row< TWGroupe->rowCount(); row++) - TWGroupe->removeRow(row); - TWGroupe->setRowCount(0); - if (_aCaseName == QString("")) { return; }; - ADAPT::HOMARD_Cas_var monCas= myAdaptGen->GetCase(_aCaseName.toStdString().c_str()); - ADAPT::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); - for ( int i = 0; i < _listeGroupesCas->length(); i++ ) - { - TWGroupe->insertRow(i); - TWGroupe->setItem( i, 0, new QTableWidgetItem( QString ("") ) ); - TWGroupe->item( i, 0 )->setFlags( 0 ); - TWGroupe->item( i, 0 )->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled ); - if (_listeGroupesHypo.contains (QString((_listeGroupesCas)[i]))) - {TWGroupe->item( i, 0 )->setCheckState( Qt::Checked );} - else - {TWGroupe->item( i, 0 )->setCheckState( Qt::Unchecked );} - TWGroupe->setItem( i, 1, new QTableWidgetItem(QString((_listeGroupesCas)[i]).trimmed())); - TWGroupe->item( i, 1 )->setFlags(Qt::ItemIsEnabled |Qt::ItemIsSelectable ); - } - TWGroupe->resizeColumnsToContents(); - TWGroupe->resizeRowsToContents(); - TWGroupe->clearSelection(); -// MESSAGE("Fin de MonCreateListGroup::InitGroupes "); -} - diff --git a/src/ADAPTGUI/MonCreateListGroup.h b/src/ADAPTGUI/MonCreateListGroup.h deleted file mode 100644 index 9422e8be2..000000000 --- a/src/ADAPTGUI/MonCreateListGroup.h +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_CREATELISTGROUP_H -#define MON_CREATELISTGROUP_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) - -#include "ui_CreateListGroup.h" -#include - -class MonCreateHypothesis; -class MonCreateBoundaryDi; -class HOMARD_EXPORT MonCreateListGroup : public QDialog, public Ui_CreateListGroup -{ - Q_OBJECT - -public: - MonCreateListGroup( MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, bool modal, ADAPT::ADAPT_Gen_var myAdaptGen, QString aCaseName, QStringList listeGroupesHypo); - MonCreateListGroup( MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, ADAPT::ADAPT_Gen_var myAdaptGen, QString aCaseName, QStringList listeGroupesHypo); - virtual ~MonCreateListGroup(); - -protected : - - ADAPT::ADAPT_Gen_var myAdaptGen; - - MonCreateHypothesis * _parentHyp; - MonCreateBoundaryDi * _parentBound; - QString _aCaseName; - QStringList _listeGroupesHypo; - - virtual void InitConnect(); - virtual void InitGroupes(); - -public slots: - virtual void PushOnOK(); - virtual bool PushOnApply(); - virtual void PushOnHelp(); - -}; - -#endif // MON_CREATELISTGROUP_H diff --git a/src/ADAPTGUI/MonCreateListGroupCAO.cxx b/src/ADAPTGUI/MonCreateListGroupCAO.cxx deleted file mode 100644 index 5df4690dd..000000000 --- a/src/ADAPTGUI/MonCreateListGroupCAO.cxx +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonCreateListGroupCAO.h" -#include "MonCreateHypothesis.h" -#include "MonCreateBoundaryCAO.h" - -#include - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include "HomardQtCommun.h" -#include - -#include -#include -#include -#include -#include - -using namespace std; - -// -------------------------------------------------------------------------------------------------------------- -MonCreateListGroupCAO::MonCreateListGroupCAO(MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen0, QString aCaseName, QStringList listeGroupesHypo) : -// -------------------------------------------------------------------------------------------------------------- -// - QDialog(0), Ui_CreateListGroup(), - _aCaseName (aCaseName), - _listeGroupesHypo (listeGroupesHypo), - _parentHyp(parentHyp), - _parentBound(parentBound) -{ - MESSAGE("Debut de MonCreateListGroupCAO") - myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0); - setupUi(this); - setModal(modal); - InitConnect(); - InitGroupes(); -} -// -------------------------------------------------------------------------------------------------------------- -MonCreateListGroupCAO::MonCreateListGroupCAO(MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, - ADAPT::ADAPT_Gen_var myAdaptGen, QString aCaseName, QStringList listeGroupesHypo) : -// -------------------------------------------------------------------------------------------------------------- -// - QDialog(0), Ui_CreateListGroup(), - _aCaseName (aCaseName), - _listeGroupesHypo (listeGroupesHypo), - _parentHyp(parentHyp), - _parentBound(parentBound) -{ - myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen); - setupUi(this); - InitConnect(); -} - -// ------------------------------------------------------------------------ -MonCreateListGroupCAO::~MonCreateListGroupCAO() -// ------------------------------------------------------------------------ -{ - // no need to delete child widgets, Qt does it all for us -} -// ------------------------------------------------------------------------ -void MonCreateListGroupCAO::InitConnect() -// ------------------------------------------------------------------------ -{ - connect( buttonOk, SIGNAL( pressed() ), this, SLOT( PushOnOK() ) ); - connect( buttonApply, SIGNAL( pressed() ), this, SLOT( PushOnApply() ) ); - connect( buttonCancel, SIGNAL( pressed() ), this, SLOT( close() ) ); - connect( buttonHelp, SIGNAL( pressed() ), this, SLOT( PushOnHelp() ) ); -} -// ------------------------------------------------------------------------ -bool MonCreateListGroupCAO::PushOnApply() -// ------------------------------------------------------------------------ -// Appele lorsque l'un des boutons Ok ou Apply est presse -// -{ - QStringList ListeGroup ; - for ( int row=0; row< TWGroupe->rowCount(); row++) - { - if ( TWGroupe->item( row, 0 )->checkState() == Qt::Checked ) - ListeGroup.insert(0, QString(TWGroupe->item(row, 1)->text()) ); - } - if ( _parentHyp ) { _parentHyp->setGroups(ListeGroup);}; - if ( _parentBound ) { _parentBound->setGroups(ListeGroup);}; - return true; -} - - -// ------------------------------------------------------------------------ -void MonCreateListGroupCAO::PushOnOK() -// ------------------------------------------------------------------------ -{ - if (PushOnApply()) this->close(); - if ( _parentHyp ) { _parentHyp->raise(); _parentHyp->activateWindow(); }; - if ( _parentBound ) { _parentBound->raise(); _parentBound->activateWindow(); }; -} -// ------------------------------------------------------------------------ -void MonCreateListGroupCAO::PushOnHelp() -// ------------------------------------------------------------------------ -{ - std::string LanguageShort = myAdaptGen->GetLanguageShort(); - HOMARD_UTILS::PushOnHelp(QString("gui_create_hypothese.html"), QString(""), QString(LanguageShort.c_str())); -} -// ------------------------------------------------------------------------ -void MonCreateListGroupCAO::InitGroupes() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de MonCreateListGroupCAO::InitGroupes "); - for ( int row=0; row< TWGroupe->rowCount(); row++) - TWGroupe->removeRow(row); - TWGroupe->setRowCount(0); - if (_aCaseName == QString("")) { return; }; - ADAPT::HOMARD_Cas_var monCas= myAdaptGen->GetCase(_aCaseName.toStdString().c_str()); - ADAPT::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); - for ( int i = 0; i < _listeGroupesCas->length(); i++ ) - { - TWGroupe->insertRow(i); - TWGroupe->setItem( i, 0, new QTableWidgetItem( QString ("") ) ); - TWGroupe->item( i, 0 )->setFlags( 0 ); - TWGroupe->item( i, 0 )->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled ); - if (_listeGroupesHypo.contains (QString((_listeGroupesCas)[i]))) - {TWGroupe->item( i, 0 )->setCheckState( Qt::Checked );} - else - {TWGroupe->item( i, 0 )->setCheckState( Qt::Unchecked );} - TWGroupe->setItem( i, 1, new QTableWidgetItem(QString((_listeGroupesCas)[i]).trimmed())); - TWGroupe->item( i, 1 )->setFlags(Qt::ItemIsEnabled |Qt::ItemIsSelectable ); - } - TWGroupe->resizeColumnsToContents(); - TWGroupe->resizeRowsToContents(); - TWGroupe->clearSelection(); -// MESSAGE("Fin de MonCreateListGroupCAO::InitGroupes "); -} - diff --git a/src/ADAPTGUI/MonCreateListGroupCAO.h b/src/ADAPTGUI/MonCreateListGroupCAO.h deleted file mode 100644 index 1e291d331..000000000 --- a/src/ADAPTGUI/MonCreateListGroupCAO.h +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_CREATELISTGROUPCAO_H -#define MON_CREATELISTGROUPCAO_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) - -#include "ui_CreateListGroup.h" -#include - -class MonCreateHypothesis; -class MonCreateBoundaryCAO; -class HOMARD_EXPORT MonCreateListGroupCAO : public QDialog, public Ui_CreateListGroup -{ - Q_OBJECT - -public: - MonCreateListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, bool modal, ADAPT::ADAPT_Gen_var myAdaptGen, QString aCaseName, QStringList listeGroupesHypo); - MonCreateListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, ADAPT::ADAPT_Gen_var myAdaptGen, QString aCaseName, QStringList listeGroupesHypo); - virtual ~MonCreateListGroupCAO(); - -protected : - - ADAPT::ADAPT_Gen_var myAdaptGen; - - MonCreateHypothesis * _parentHyp; - MonCreateBoundaryCAO * _parentBound; - QString _aCaseName; - QStringList _listeGroupesHypo; - - virtual void InitConnect(); - virtual void InitGroupes(); - -public slots: - virtual void PushOnOK(); - virtual bool PushOnApply(); - virtual void PushOnHelp(); - -}; - -#endif // MON_CREATELISTGROUPCAO_H diff --git a/src/ADAPTGUI/MonCreateYACS.cxx b/src/ADAPTGUI/MonCreateYACS.cxx deleted file mode 100644 index e0ae6fda1..000000000 --- a/src/ADAPTGUI/MonCreateYACS.cxx +++ /dev/null @@ -1,342 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonCreateYACS.h" -#include "HOMARD.hxx" - -#include -#include - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include "HomardQtCommun.h" -#include - -#ifdef WIN32 -#include -#endif -using namespace std; - -// ---------------------------------------------------------------------- -MonCreateYACS::MonCreateYACS (bool modal, ADAPT::ADAPT_Gen_var myAdaptGen0, QString CaseName ): -// ---------------------------------------------------------------------- -/* Constructs a MonCreateYACS - * Sets attributes to default values - */ -// ---------------------------------------------------------------------- - Ui_CreateYACS(), - _aCaseName(CaseName), - _aScriptFile(""), - _aDirName(""), - _aMeshFile(""), - _Type(1) - // Les valeurs de _Type, _MaxIter, _MaxNode, _MaxElem doivent etre les memes que celles dans ADAPT_Gen_i::CreateYACSSchema - // et doivent correspondre aux defauts des boutons - { -// MESSAGE("Debut du constructeur de MonCreateYACS"); - myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0); - setupUi(this); - if ( modal ) { setWindowModality(Qt::WindowModal); } - else { setWindowModality(Qt::NonModal); } - - InitConnect(); - - SetNewName() ; - - if (_aCaseName != QString("")) { SetCaseName(); } - else { setWindowModality(Qt::NonModal); /* permet selection du cas dans l arbre d etude */} -// -// Les valeurs definies dans les preferences - _MaxIter = myAdaptGen->GetYACSMaxIter(); - _MaxNode = myAdaptGen->GetYACSMaxNode(); - _MaxElem = myAdaptGen->GetYACSMaxElem(); - MESSAGE ("Valeur par defaut de MaxIter = " << _MaxIter<<", MaxNode = "<< _MaxNode<<", MaxElem = "<< _MaxElem); - SpinBoxMaxIter->setValue(_MaxIter) ; - SpinBoxMaxNode->setValue(_MaxNode) ; - SpinBoxMaxElem->setValue(_MaxElem) ; -// - adjustSize(); - } - -// ---------------------------------------------------------------------- -MonCreateYACS::MonCreateYACS(ADAPT::ADAPT_Gen_var myAdaptGen0, - QString caseName): -// ---------------------------------------------------------------------- -// Constructeur appele par MonEditYACS -// -myAdaptGen(myAdaptGen0), -_Name (""), -Chgt (false) -{ -// MESSAGE("Debut du constructeur de MonCreateYACS appele par MonEditYACS"); - setupUi(this) ; - - setWindowModality(Qt::WindowModal); - InitConnect() ; -// - adjustSize(); -} -// ------------------------------------------------------------------------ -MonCreateYACS::~MonCreateYACS() -// ------------------------------------------------------------------------ -{ - // no need to delete child widgets, Qt does it all for us -} -// ------------------------------------------------------------------------ -void MonCreateYACS::InitConnect() -// ------------------------------------------------------------------------ -{ - connect( PBCaseName, SIGNAL(pressed()), this, SLOT(SetCaseName())); - connect( PBScriptFile, SIGNAL(pressed()), this, SLOT(SetScriptFile())); - connect( PBDir, SIGNAL(pressed()), this, SLOT(SetDirName())); - connect( PBMeshFile, SIGNAL(pressed()), this, SLOT(SetMeshFile())); - - connect( RBConstant, SIGNAL(clicked()), this, SLOT(SetConstant())); - connect( RBVariable, SIGNAL(clicked()), this, SLOT(SetVariable())); - - connect( buttonOk, SIGNAL(pressed()), this, SLOT(PushOnOK())); - connect( buttonApply, SIGNAL(pressed()), this, SLOT(PushOnApply())); - connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); - connect( buttonHelp, SIGNAL(pressed()), this, SLOT(PushOnHelp())); -} -// ------------------------------- -bool MonCreateYACS::PushOnApply() -// -------------------------------- -{ - MESSAGE("PushOnApply"); - -// Le fichier du script - QString aFileName=LEScriptFile->text().trimmed(); - if (aFileName ==QString("")) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_SCRIPT_FILE") ); - return false; - } - -// Le repertoire de calcul - QString aDirName=LEDirName->text().trimmed(); - if (aDirName == QString("")) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_CASE_DIRECTORY_4") ); - return false; - } - if ( aDirName != _aDirName) - { QString CaseNameDir = myAdaptGen->VerifieDir( aDirName.toStdString().c_str()) ; - if ( CaseNameDir != "" ) - { - QString texte ; - texte = QObject::tr("HOM_CASE_DIRECTORY_2") + CaseNameDir ; - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - texte ); - return false; - } - } - if (CHDIR(aDirName.toStdString().c_str()) != 0) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_CASE_DIRECTORY_3") ); - return false; - } - -// Le fichier du tout premier maillage - aFileName=LEMeshFile->text().trimmed(); - if (aFileName ==QString("")) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_CASE_MESH") ); - return false; - } - QString aMeshName = HOMARD_QT_COMMUN::LireNomMaillage(aFileName); - if (aMeshName == "" ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_MED_FILE_2") ); - return false; - } - - bool bOK = CreateOrUpdate() ; - - if ( bOK ) { HOMARD_UTILS::updateObjBrowser() ; } - - return bOK; -} -// --------------------------------------------------- -bool MonCreateYACS:: CreateOrUpdate() -//---------------------------------------------------- -// Creation ou modification du schema -{ - MESSAGE("CreateOrUpdate"); - bool bOK = true ; - - // 1. Verification des donnees - // 1.1. Le cas - if ( _aCaseName == QString ("")) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_CASE_NAME") ); - return false; - } - // 1.2. Les donnees - QString aScriptFile=LEScriptFile->text().trimmed(); - if ( aScriptFile != _aScriptFile ) - { - _aScriptFile = aScriptFile ; - Chgt = true ; - } - QString aDirName=LEDirName->text().trimmed(); - if ( aDirName != _aDirName ) - { - _aDirName = aDirName ; - Chgt = true ; - } - QString aMeshFile=LEMeshFile->text().trimmed(); - if ( aMeshFile != _aMeshFile ) - { - _aMeshFile = aMeshFile ; - Chgt = true ; - } - - // 2. Creation de l'objet CORBA - try - { - _Name=LEName->text().trimmed(); - aYACS=myAdaptGen->CreateYACSSchema(CORBA::string_dup(_Name.toStdString().c_str()), CORBA::string_dup(_aCaseName.toStdString().c_str()), CORBA::string_dup(_aScriptFile.toStdString().c_str()), CORBA::string_dup(_aDirName.toStdString().c_str()), CORBA::string_dup(_aMeshFile.toStdString().c_str())); - } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - bOK = false; - } - - // 3. Options - if ( bOK ) - { - // 3.1. Le type du schema - aYACS->SetType(_Type) ; - - // 3.2. Les maximums - _MaxIter = SpinBoxMaxIter->value() ; - aYACS->SetMaxIter(_MaxIter) ; - - _MaxNode = SpinBoxMaxNode->value() ; - aYACS->SetMaxNode(_MaxNode) ; - - _MaxElem = SpinBoxMaxElem->value() ; - aYACS->SetMaxElem(_MaxElem) ; - - } - - // 4. Ecriture du fichier - if ( bOK ) - { - int codret = aYACS->Write() ; - if ( codret != 0 ) { bOK = false ; } - } - - return bOK; -} -// --------------------------- -void MonCreateYACS::PushOnOK() -// --------------------------- -{ - bool bOK = PushOnApply(); - if ( bOK ) this->close(); -} -//------------------------------ -void MonCreateYACS::PushOnHelp() -//------------------------------- -{ - std::string LanguageShort = myAdaptGen->GetLanguageShort(); - HOMARD_UTILS::PushOnHelp(QString("yacs.html"), QString(""), QString(LanguageShort.c_str())); -} -// ------------------------------------------------- -void MonCreateYACS::SetNewName() -// -------------------------------------------------- -{ - - ADAPT::listeYACSs_var MyObjects = myAdaptGen->GetAllYACSsName(); - int num = 0; QString aName=""; - while (aName == QString("") ) - { - aName.setNum(num+1) ; - aName.insert(0, QString("YACS_")) ; - for ( int i=0; ilength(); i++) - { - if ( aName == QString(MyObjects[i])) - { - num ++ ; - aName = "" ; - break ; - } - } - } - LEName->setText(aName); -} -// ------------------------------------------------------------------------ -void MonCreateYACS::SetCaseName() -// ------------------------------------------------------------------------ -{ - MESSAGE ("SetCaseName avec _aCaseName = " << _aCaseName.toStdString() ); - if (_aCaseName == QString("")) - { - _aCaseName=HOMARD_QT_COMMUN::SelectionArbreEtude(QString("CasHomard"), 1); - if (_aCaseName == QString("")) { raise();return;}; - } - LECaseName->setText(_aCaseName); -} -// ------------------------------------------------------------------------ -void MonCreateYACS::SetDirName() -// ------------------------------------------------------------------------ -{ - QString aDirName=QFileDialog::getExistingDirectory (); - if (!(aDirName.isEmpty()))LEDirName->setText(aDirName); -} -// ------------------------------------------------------------------------ -void MonCreateYACS::SetScriptFile() -// ------------------------------------------------------------------------ -{ - QString fileName0 = LEScriptFile->text().trimmed(); - QString fileName = HOMARD_QT_COMMUN::PushNomFichier( false, QString("py") ) ; - if (fileName.isEmpty()) fileName = fileName0 ; - LEScriptFile->setText(fileName); -} -// ------------------------------------------------------------------------ -void MonCreateYACS::SetMeshFile() -// ------------------------------------------------------------------------ -{ - QString fileName0 = LEMeshFile->text().trimmed(); - QString fileName = HOMARD_QT_COMMUN::PushNomFichier( false, QString("med") ) ; - if (fileName.isEmpty()) fileName = fileName0 ; - LEMeshFile->setText(fileName); -} -// ------------------------------------------------------------------------ -void MonCreateYACS::SetConstant() -// ------------------------------------------------------------------------ -{ - _Type = 1 ; -} -// ------------------------------------------------------------------------ -void MonCreateYACS::SetVariable() -// ------------------------------------------------------------------------ -{ - _Type = 2 ; -} diff --git a/src/ADAPTGUI/MonCreateYACS.h b/src/ADAPTGUI/MonCreateYACS.h deleted file mode 100644 index ea93be821..000000000 --- a/src/ADAPTGUI/MonCreateYACS.h +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_CREATEYACS_H -#define MON_CREATEYACS_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) -#include CORBA_CLIENT_HEADER(HOMARD_Cas) - -#include "ui_CreateYACS.h" -#include - -class HOMARD_EXPORT MonCreateYACS : public QScrollArea, public Ui_CreateYACS -{ - Q_OBJECT - - public: - MonCreateYACS( bool modal, ADAPT::ADAPT_Gen_var myAdaptGen, QString CaseName); - virtual ~MonCreateYACS(); - - protected : - MonCreateYACS( ADAPT::ADAPT_Gen_var myAdaptGen, QString CaseName); - - QString _Name; - QString _aCaseName; - QString _aScriptFile; - QString _aDirName; - QString _aMeshFile; - - int _Type; - int _MaxIter; - int _MaxNode; - int _MaxElem; - - bool Chgt; - - ADAPT::HOMARD_YACS_var aYACS; - ADAPT::ADAPT_Gen_var myAdaptGen; - - virtual void InitConnect(); - virtual bool CreateOrUpdate(); - - public slots: - virtual void SetNewName(); - - virtual void SetCaseName(); - virtual void SetDirName(); - - virtual void SetScriptFile(); - virtual void SetMeshFile(); - -// virtual void SetType(int Type); - virtual void SetConstant(); - virtual void SetVariable(); - - virtual void PushOnOK(); - virtual bool PushOnApply(); - virtual void PushOnHelp(); - -}; - -#endif // MON_CREATEYACS_H diff --git a/src/ADAPTGUI/MonCreateZone.cxx b/src/ADAPTGUI/MonCreateZone.cxx deleted file mode 100644 index aeb3b6ac9..000000000 --- a/src/ADAPTGUI/MonCreateZone.cxx +++ /dev/null @@ -1,713 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonCreateZone.h" -#include "MonCreateHypothesis.h" - -#include -#include - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include "HomardQtCommun.h" -#include - -#include -#include -#include -#include -#include - -using namespace std; - -// ---------------------------------------------------------------------- -MonCreateZone::MonCreateZone(MonCreateHypothesis* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen0, - QString caseName) : -// ---------------------------------------------------------------------- -/* Constructs a MonCreateZone - appele pour une vraie creation - initialise une boite et non une sphere -*/ - QDialog(0), Ui_CreateZone(), - _parent(parent), - _Name (""), - _aCaseName(caseName), - _Orient(0), - _Type(2), - _Xcentre(0), _Ycentre(0), _Zcentre(0), _Rayon(0), - _ZoneXcentre(0), _ZoneYcentre(0), _ZoneZcentre(0), _ZoneRayon(0), - _Xmin(0), _Xmax(0), _Xincr(0), _Ymin(0), _Ymax(0), _Yincr(0), _Zmin(0), _Zmax(0), _Zincr(0), - _ZoneXmin(0), _ZoneXmax(0), _ZoneYmin(0), _ZoneYmax(0), _ZoneZmin(0), _ZoneZmax(0), - _Xaxis(0), _Yaxis(0), _Zaxis(0), _RayonInt(0), _Haut(0), - _ZoneXaxis(0), _ZoneYaxis(0), _ZoneZaxis(0), _ZoneRayonInt(0), _ZoneHaut(0), - _DMax(0), - Chgt (false) - { - MESSAGE("Constructeur") ; - myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0) ; - setupUi(this) ; - setModal(modal) ; - InitConnect( ) ; - - SetNewName() ; - InitValZone() ; // Cherche les valeurs de la boite englobante le maillage - InitMinMax() ; // Initialise les bornes des boutons - SetBox() ; // Propose une boite en premier choix - - } -// ---------------------------------------------------------------------- -MonCreateZone::MonCreateZone(MonCreateHypothesis* parent, - ADAPT::ADAPT_Gen_var myAdaptGen0, - QString caseName): -// ---------------------------------------------------------------------- -// Constructeur appele par MonEditZone -// - QDialog(0), Ui_CreateZone(), - myAdaptGen(myAdaptGen0), - _parent(parent), - _Name (""), - _aCaseName(caseName), - _Orient(0), - _Type(2), - _Xcentre(0), _Ycentre(0), _Zcentre(0), _Rayon(0), - _ZoneXcentre(0), _ZoneYcentre(0), _ZoneZcentre(0), _ZoneRayon(0), - _ZoneXmin(0), _ZoneXmax(0), _ZoneYmin(0), _ZoneYmax(0), _ZoneZmin(0), _ZoneZmax(0), - _Xaxis(0), _Yaxis(0), _Zaxis(0), _RayonInt(0), _Haut(0), - _ZoneXaxis(0), _ZoneYaxis(0), _ZoneZaxis(0), _ZoneRayonInt(0), _ZoneHaut(0), - // Pour affichage lors de l edition d une Zone sans nom de Cas - _Xmin(1), _Xmax(1), _Xincr(1), _Ymin(1), _Ymax(1), _Yincr(1), _Zmin(1), _Zmax(1), _Zincr(1), - _DMax(1), - Chgt (false) - { - // MESSAGE("Debut de MonCreateZone") - setupUi(this) ; - - setModal(true) ; - InitConnect() ; - } - -// ------------------------------------------------------------------------ -MonCreateZone::~MonCreateZone() -// ------------------------------------------------------------------------ -{ - // no need to delete child widgets, Qt does it all for us -} -// ------------------------------------------------------------------------ -void MonCreateZone::InitConnect() -// ------------------------------------------------------------------------ -{ - connect( RBBox, SIGNAL(clicked()) , this, SLOT(SetBox()) ) ; - connect( RBSphere, SIGNAL(clicked()) , this, SLOT(SetSphere()) ) ; - connect( RBCylinder, SIGNAL(clicked()) , this, SLOT(SetCylinder()) ) ; - connect( RBPipe, SIGNAL(clicked()) , this, SLOT(SetPipe()) ) ; - connect( buttonOk, SIGNAL( pressed() ), this, SLOT( PushOnOK() ) ) ; - connect( buttonApply, SIGNAL( pressed() ), this, SLOT( PushOnApply() ) ) ; - connect( buttonCancel, SIGNAL( pressed() ), this, SLOT( close() ) ) ; - connect( buttonHelp, SIGNAL( pressed() ), this, SLOT( PushOnHelp() ) ) ; -} -// ------------------------------------------------------------------------ -void MonCreateZone::InitValZone() -// ------------------------------------------------------------------------ -{ -// -// 1. Les coordonnees extremes du maillage -// - if (_aCaseName == QString("")) { return; } - - ADAPT::HOMARD_Cas_var aCas = myAdaptGen->GetCase(_aCaseName.toStdString().c_str()) ; - ADAPT::extrema_var MesExtremes = aCas->GetBoundingBox() ; - int num = MesExtremes->length() ; - ASSERT(num == 10) ; - _Xmin=MesExtremes[0]; _Xmax=MesExtremes[1]; _Xincr=MesExtremes[2]; - _Ymin=MesExtremes[3]; _Ymax=MesExtremes[4]; _Yincr=MesExtremes[5]; - _Zmin=MesExtremes[6]; _Zmax=MesExtremes[7]; _Zincr=MesExtremes[8]; - _DMax=MesExtremes[9]; - if ( _Xincr < 0 ) { _Orient = 2 ; } - else if ( _Yincr < 0 ) { _Orient = 3 ; } - else if ( _Zincr < 0 ) { _Orient = 1 ; } - MESSAGE ("_Xmin : " << _Xmin << " _Xmax : " << _Xmax << " _Xincr : " << _Xincr ) ; - MESSAGE ("_Ymin : " << _Ymin << " _Ymax : " << _Ymax << " _Yincr : " << _Yincr ) ; - MESSAGE ("_Zmin : " << _Zmin << " _Zmax : " << _Zmax << " _Zincr : " << _Zincr) ; - MESSAGE ("_DMax : " << _DMax) ; - MESSAGE ("_Orient : " << _Orient) ; -// 2. Caracteristiques des zones -// en X - if ( _Xincr < 0 ) - { - _ZoneXmin = _Xmin; - _ZoneXmax = _Xmax; - } - else - { - _ZoneXmin = _Xmin - _Xincr; - _ZoneXmax = _Xmax + _Xincr; - } - _Xcentre=(_Xmin + _Xmax)/2.; -// en Y - if ( _Yincr < 0 ) - { - _ZoneYmin = _Ymin; - _ZoneYmax = _Ymax; - } - else - { - _ZoneYmin = _Ymin - _Yincr; - _ZoneYmax = _Ymax + _Yincr; - } - _Ycentre=(_Ymin + _Ymax)/2.; -// en Z - if ( _Zincr < 0 ) - { - _ZoneZmin = _Zmin; - _ZoneZmax = _Zmax; - } - else - { - _ZoneZmin = _Zmin - _Zincr; - _ZoneZmax = _Zmax + _Zincr; - } - _Zcentre=(_Zmin + _Zmax)/2.; -// Rayons - _Rayon= _DMax/4.; - _RayonInt= _DMax/8.; -// Axe et hauteur pour cylindre et tuyau - _Haut= _DMax/2.; -// 3. Gestion des icones - SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr() ; - QPixmap pix = resMgr->loadPixmap( "HOMARD", "boxdxyz.png" ) ; - if ( _Orient == 0 ) { pix = resMgr->loadPixmap( "HOMARD", "boxdxyz.png" ) ; } - else { pix = resMgr->loadPixmap( "HOMARD", "boxdxy.png" ) ; } - QIcon IS=QIcon(pix) ; - RBBox->setIcon(IS) ; - - if ( _Orient == 0 ) { pix = resMgr->loadPixmap( "HOMARD", "cylinderpointvector.png" ) ; } - else { pix = resMgr->loadPixmap( "HOMARD", "disk.png" ) ; - RBCylinder->setText(QApplication::translate("CreateZone", "Disk", 0)); - TLXbase->setText(QApplication::translate("CreateZone", "X centre", 0)); - TLYbase->setText(QApplication::translate("CreateZone", "Y centre", 0)); - TLZbase->setText(QApplication::translate("CreateZone", "Z centre", 0)); } - IS=QIcon(pix) ; - RBCylinder->setIcon(IS) ; - - if ( _Orient == 0 ) { pix = resMgr->loadPixmap( "HOMARD", "pipe.png" ) ; } - else { pix = resMgr->loadPixmap( "HOMARD", "diskwithhole.png" ) ; - RBPipe->setText(QApplication::translate("CreateZone", "Disk with hole", 0)); - TLXbase_p->setText(QApplication::translate("CreateZone", "X centre", 0)); - TLYbase_p->setText(QApplication::translate("CreateZone", "Y centre", 0)); - TLZbase_p->setText(QApplication::translate("CreateZone", "Z centre", 0)); } - IS=QIcon(pix) ; - RBPipe->setIcon(IS) ; - - if ( _Orient == 0 ) { pix = resMgr->loadPixmap( "HOMARD", "spherepoint.png" ) ; - IS=QIcon(pix) ; - RBSphere->setIcon(IS) ; } - else { RBSphere->setVisible(0) ; } -} - -// ------------------------------------------------------------------------ -void MonCreateZone::InitMinMax() -// ------------------------------------------------------------------------ -{ -// en X - if ( _Xincr > 0) { - SpinBox_Xmini->setRange(_ZoneXmin,_ZoneXmax) ; - SpinBox_Xmaxi->setRange(_ZoneXmin,_ZoneXmax) ; - SpinBox_Xmini->setSingleStep(_Xincr) ; - SpinBox_Xmaxi->setSingleStep(_Xincr) ; - SpinBox_Xcentre->setSingleStep(_Xincr) ; - } - else { - SpinBox_Xmini->setValue(_ZoneXmin) ; - SpinBox_Xmaxi->setValue(_ZoneXmax) ; - SpinBox_Xcentre->setValue(_Xcentre) ; - SpinBox_Xbase->setValue(_Xcentre) ; - SpinBox_Xbase_p->setValue(_Xcentre) ; - SpinBox_Xmini->setEnabled(false) ; - SpinBox_Xmaxi->setEnabled(false) ; - SpinBox_Xcentre->setEnabled(false) ; - SpinBox_Xbase->setEnabled(false) ; - SpinBox_Xbase_p->setEnabled(false) ; - } -// en Y - if ( _Yincr > 0) { - SpinBox_Ymini->setRange(_ZoneYmin,_ZoneYmax) ; - SpinBox_Ymaxi->setRange(_ZoneYmin,_ZoneYmax) ; - SpinBox_Ymini->setSingleStep(_Yincr) ; - SpinBox_Ymaxi->setSingleStep(_Yincr) ; - SpinBox_Ycentre->setSingleStep(_Yincr) ; - } - else { - SpinBox_Ymini->setValue(_ZoneYmin) ; - SpinBox_Ymaxi->setValue(_ZoneYmax) ; - SpinBox_Ycentre->setValue(_Ycentre) ; - SpinBox_Ybase->setValue(_Ycentre) ; - SpinBox_Ybase_p->setValue(_Ycentre) ; - SpinBox_Ymini->setEnabled(false) ; - SpinBox_Ymaxi->setEnabled(false) ; - SpinBox_Ycentre->setEnabled(false) ; - SpinBox_Ybase->setEnabled(false) ; - SpinBox_Ybase_p->setEnabled(false) ; - } -// en Z - if ( _Zincr > 0) { - SpinBox_Zmini->setRange(_ZoneZmin,_ZoneZmax) ; - SpinBox_Zmaxi->setRange(_ZoneZmin,_ZoneZmax) ; - SpinBox_Zmini->setSingleStep(_Zincr) ; - SpinBox_Zmaxi->setSingleStep(_Zincr) ; - SpinBox_Zcentre->setSingleStep(_Zincr) ; - } - else { - SpinBox_Zmini->setValue(_ZoneZmin) ; - SpinBox_Zmaxi->setValue(_ZoneZmax) ; - SpinBox_Zcentre->setValue(_Zcentre) ; - SpinBox_Zbase->setValue(_Zcentre) ; - SpinBox_Zbase_p->setValue(_Zcentre) ; - SpinBox_Zmini->setEnabled(false) ; - SpinBox_Zmaxi->setEnabled(false) ; - SpinBox_Zcentre->setEnabled(false) ; - SpinBox_Zbase->setEnabled(false) ; - SpinBox_Zbase_p->setEnabled(false) ; - } -// Rayons - SpinBox_Rayon->setSingleStep(_Rayon/10.) ; - SpinBox_Radius->setSingleStep(_Rayon/10.) ; - SpinBox_Radius_int->setSingleStep(_Rayon/20.) ; - SpinBox_Radius_ext->setSingleStep(_Rayon/10.) ; -// Axe et hauteur -// Si une coordonnee est constante, inutile de demander l'axe et la hauteur - if ( _Orient > 0) { - SpinBox_Xaxis->setVisible(0) ; - SpinBox_Yaxis->setVisible(0) ; - SpinBox_Zaxis->setVisible(0) ; - SpinBox_Haut->setVisible(0) ; - TLXaxis->setVisible(0) ; - TLYaxis->setVisible(0) ; - TLZaxis->setVisible(0) ; - TLHaut->setVisible(0) ; - SpinBox_Xaxis_p->setVisible(0) ; - SpinBox_Yaxis_p->setVisible(0) ; - SpinBox_Zaxis_p->setVisible(0) ; - SpinBox_Haut_p->setVisible(0) ; - TLXaxis_p->setVisible(0) ; - TLYaxis_p->setVisible(0) ; - TLZaxis_p->setVisible(0) ; - TLHaut_p->setVisible(0) ; - } - else { - SpinBox_Haut->setSingleStep(_Rayon/10.) ; - SpinBox_Haut_p->setSingleStep(_Rayon/10.) ; - } -} -// ------------------------------------------------------------------------ -bool MonCreateZone::PushOnApply() -// ------------------------------------------------------------------------ -// Appele lorsque l'un des boutons Ok ou Apply est presse -// -{ - if (LEName->text().trimmed()=="") - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_ZONE_NAME") ) ; - return false; - } - - switch (_Type) - { - case 11 : // il s agit d un rectangle - { } - case 12 : // il s agit d un rectangle - { } - case 13 : // il s agit d un rectangle - { } - case 2 : // il s agit d un parallelipipede rectangle - { - if ( (_ZoneXmin != SpinBox_Xmini->value()) || - (_ZoneXmax != SpinBox_Xmaxi->value()) || - (_ZoneYmin != SpinBox_Ymini->value()) || - (_ZoneYmax != SpinBox_Ymaxi->value()) || - (_ZoneZmin != SpinBox_Zmini->value()) || - (_ZoneZmax != SpinBox_Zmaxi->value()) ) - { - Chgt = true; - _ZoneXmin= SpinBox_Xmini->value() ; _ZoneXmax= SpinBox_Xmaxi->value() ; - _ZoneYmin= SpinBox_Ymini->value() ; _ZoneYmax= SpinBox_Ymaxi->value() ; - _ZoneZmin= SpinBox_Zmini->value() ; _ZoneZmax= SpinBox_Zmaxi->value() ; - } - break ; - } - case 4 : // il s agit d une sphere - { - if ( (_ZoneXcentre != SpinBox_Xcentre->value()) || - (_ZoneYcentre != SpinBox_Ycentre->value()) || - (_ZoneZcentre != SpinBox_Zbase->value()) || - (_ZoneRayon != SpinBox_Rayon->value()) ) - { - Chgt = true; - _ZoneXcentre=SpinBox_Xcentre->value() ; - _ZoneYcentre=SpinBox_Ycentre->value() ; - _ZoneZcentre=SpinBox_Zcentre->value() ; - _ZoneRayon=SpinBox_Rayon->value() ; - } - break ; - } - case 31 : // il s agit d un disque issu d'un cylindre - { } - case 32 : // il s agit d un disque issu d'un cylindre - { } - case 33 : // il s agit d un disque issu d'un cylindre - { } - case 5 : // il s agit d un cylindre - { - if ( (_ZoneXcentre != SpinBox_Xbase->value()) || - (_ZoneYcentre != SpinBox_Ybase->value()) || - (_ZoneZcentre != SpinBox_Zbase->value()) || - (_ZoneRayon != SpinBox_Radius->value()) || - (_ZoneHaut != SpinBox_Haut->value()) || - (_ZoneXaxis != SpinBox_Xaxis->value()) || - (_ZoneYaxis != SpinBox_Yaxis->value()) || - (_ZoneZaxis != SpinBox_Zaxis->value()) ) - { - Chgt = true; - _ZoneXcentre=SpinBox_Xbase->value() ; - _ZoneYcentre=SpinBox_Ybase->value() ; - _ZoneZcentre=SpinBox_Zbase->value() ; - _ZoneXaxis=SpinBox_Xaxis->value() ; - _ZoneYaxis=SpinBox_Yaxis->value() ; - _ZoneZaxis=SpinBox_Zaxis->value() ; - _ZoneRayon=SpinBox_Radius->value() ; - _ZoneHaut=SpinBox_Haut->value() ; - } - break ; - } - case 61 : // il s agit d un disque avec trou - { } - case 62 : // il s agit d un disque avec trou - { } - case 63 : // il s agit d un disque avec trou - { } - case 7 : // il s agit d un tuyau - { - if ( (_ZoneXcentre != SpinBox_Xbase_p->value()) || - (_ZoneYcentre != SpinBox_Ybase_p->value()) || - (_ZoneZcentre != SpinBox_Zbase_p->value()) || - (_ZoneRayonInt != SpinBox_Radius_int->value()) || - (_ZoneRayon != SpinBox_Radius_ext->value()) || - (_ZoneHaut != SpinBox_Haut_p->value()) || - (_ZoneXaxis != SpinBox_Xaxis_p->value()) || - (_ZoneYaxis != SpinBox_Yaxis_p->value()) || - (_ZoneZaxis != SpinBox_Zaxis_p->value()) ) - { - Chgt = true; - _ZoneXcentre=SpinBox_Xbase_p->value() ; - _ZoneYcentre=SpinBox_Ybase_p->value() ; - _ZoneZcentre=SpinBox_Zbase_p->value() ; - _ZoneXaxis=SpinBox_Xaxis_p->value() ; - _ZoneYaxis=SpinBox_Yaxis_p->value() ; - _ZoneZaxis=SpinBox_Zaxis_p->value() ; - _ZoneRayonInt=SpinBox_Radius_int->value() ; - _ZoneRayon=SpinBox_Radius_ext->value() ; - _ZoneHaut=SpinBox_Haut_p->value() ; - } - break ; - } - } - -// Controles -// Pour un rectangle ou un parallelepipede : - if ( ( _Type >= 11 && _Type <= 13 ) || _Type == 2 ) - { - if ((_ZoneXmin >= _ZoneXmax) && (_Xincr > 0)) { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_ZONE_LIMIT").arg("X") ) ; - return false; } - - if ((_ZoneYmin >= _ZoneYmax) && (_Yincr > 0)) { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_ZONE_LIMIT").arg("Y") ) ; - return false; } - - if ((_ZoneZmin >= _ZoneZmax) && (_Zincr > 0)) { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_ZONE_LIMIT").arg("Z") ) ; - return false; } - } -// L'axe pour un cylindre ou un tuyau : - if ( _Type == 5 || _Type == 7 ) - { - double daux = _ZoneXaxis*_ZoneXaxis + _ZoneYaxis*_ZoneYaxis + _ZoneZaxis*_ZoneZaxis ; - if ( daux < 0.0000001 ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_AXE") ); - return false; - } - } -// Rayons pour disque avec trou ou un tuyau : - if ( ( _Type >= 61 && _Type <= 63 ) || _Type == 7 ) - { - if ( _ZoneRayonInt >= _ZoneRayon ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_ZONE_RAYON") ); - return false; - } - } -// -// Création ou mise à jour de la zone -// - bool bOK = CreateOrUpdateZone() ; - - if ( bOK ) { HOMARD_UTILS::updateObjBrowser() ; } - - return bOK; - -} -// --------------------------------------------------- -bool MonCreateZone::CreateOrUpdateZone() -//---------------------------------------------------- -// Creation de la zone -{ - MESSAGE("Debut de CreateOrUpdateZone avec _Type ="<<_Type<<", _Name ="<<_Name.toStdString().c_str()<<" et LEName ="<text().trimmed().toStdString().c_str()); -// - if (_Name != LEName->text().trimmed()) - { - _Name = LEName->text().trimmed() ; - try - { - switch (_Type) - { - case 11 : // il s agit d un rectangle, dans le plan (X,Y) - { aZone = myAdaptGen->CreateZoneBox2D(CORBA::string_dup(_Name.toStdString().c_str()), \ - _ZoneXmin, _ZoneXmax, _ZoneYmin, _ZoneYmax, _Orient ); - break; - } - case 12 : // il s agit d un rectangle, dans le plan (Y,Z) - { aZone = myAdaptGen->CreateZoneBox2D(CORBA::string_dup(_Name.toStdString().c_str()), \ - _ZoneYmin, _ZoneYmax, _ZoneZmin, _ZoneZmax, _Orient ); - break; - } - case 13 : // il s agit d un rectangle, dans le plan (Z,X) - { aZone = myAdaptGen->CreateZoneBox2D(CORBA::string_dup(_Name.toStdString().c_str()), \ - _ZoneZmin, _ZoneZmax, _ZoneXmin, _ZoneXmax, _Orient ); - break; - } - case 2 : // il s agit d un parallelepipede - { aZone = myAdaptGen->CreateZoneBox(CORBA::string_dup(_Name.toStdString().c_str()), \ - _ZoneXmin, _ZoneXmax, _ZoneYmin, _ZoneYmax, _ZoneZmin, _ZoneZmax ); - break; - } - case 4 : // il s agit d une sphere - { aZone = myAdaptGen->CreateZoneSphere(CORBA::string_dup(_Name.toStdString().c_str()), \ - _ZoneXcentre, _ZoneYcentre, _ZoneZcentre, _ZoneRayon ); - break; - } - case 31 : // il s agit d un disque issu d'un cylindre, dans le plan (X,Y) - { aZone = myAdaptGen->CreateZoneDisk(CORBA::string_dup(_Name.toStdString().c_str()), \ - _ZoneXcentre, _ZoneYcentre, _ZoneRayon, _Orient ); - break; - } - case 32 : // il s agit d un disque issu d'un cylindre, dans le plan (Y,Z) - { aZone = myAdaptGen->CreateZoneDisk(CORBA::string_dup(_Name.toStdString().c_str()), \ - _ZoneYcentre, _ZoneZcentre, _ZoneRayon, _Orient ); - break; - } - case 33 : // il s agit d un disque issu d'un cylindre, dans le plan (Z,X) - { aZone = myAdaptGen->CreateZoneDisk(CORBA::string_dup(_Name.toStdString().c_str()), \ - _ZoneZcentre, _ZoneXcentre, _ZoneRayon, _Orient ); - break; - } - case 5 : // il s agit d un cylindre - { aZone = myAdaptGen->CreateZoneCylinder(CORBA::string_dup(_Name.toStdString().c_str()), \ - _ZoneXcentre, _ZoneYcentre, _ZoneZcentre, _ZoneXaxis, _ZoneYaxis, _ZoneZaxis, _ZoneRayon, _ZoneHaut ); - break; - } - case 61 : // il s agit d un disque avec trou, dans le plan (X,Y) - { aZone = myAdaptGen->CreateZoneDiskWithHole(CORBA::string_dup(_Name.toStdString().c_str()), \ - _ZoneXcentre, _ZoneYcentre, _ZoneRayon, _ZoneRayonInt, _Orient ); - break; - } - case 62 : // il s agit d un disque avec trou, dans le plan (Y,Z) - { aZone = myAdaptGen->CreateZoneDiskWithHole(CORBA::string_dup(_Name.toStdString().c_str()), \ - _ZoneYcentre, _ZoneZcentre, _ZoneRayon, _ZoneRayonInt, _Orient ); - break; - } - case 63 : // il s agit d un disque avec trou, dans le plan (Z,X) - { aZone = myAdaptGen->CreateZoneDiskWithHole(CORBA::string_dup(_Name.toStdString().c_str()), \ - _ZoneZcentre, _ZoneXcentre, _ZoneRayon, _ZoneRayonInt, _Orient ); - break; - } - case 7 : // il s agit d un tuyau - { aZone = myAdaptGen->CreateZonePipe(CORBA::string_dup(_Name.toStdString().c_str()), \ - _ZoneXcentre, _ZoneYcentre, _ZoneZcentre, _ZoneXaxis, _ZoneYaxis, _ZoneZaxis, _ZoneRayon, _ZoneHaut, _ZoneRayonInt ); - break; - } - } - } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - return false ; - } - _parent->addZoneinTWZone(_Name) ; -// Mise en place des attributs - aZone->SetLimit(_Xincr, _Yincr, _Zincr) ; - - return true; - } - else { - QMessageBox::warning( 0, QObject::tr("HOM_WARNING"), - QObject::tr("HOM_SELECT_OBJECT_4") ); - return false ; - } - MESSAGE("Fin de CreateOrUpdateZone"); -} -// ------------------------------------------------------------------------ -void MonCreateZone::PushOnOK() -// ------------------------------------------------------------------------ -{ - if (PushOnApply()) this->close() ; -} -// ------------------------------------------------------------------------ -void MonCreateZone::PushOnHelp() -// ------------------------------------------------------------------------ -{ - std::string LanguageShort = myAdaptGen->GetLanguageShort(); - HOMARD_UTILS::PushOnHelp(QString("gui_create_zone.html"), QString(""), QString(LanguageShort.c_str())); -} - -// ----------------------------------- -void MonCreateZone::SetNewName() -// ----------------------------------- -{ - MESSAGE("SetNewName"); -// Recherche d'un nom par defaut qui n'existe pas encore - - ADAPT::listeZones_var MyObjects = myAdaptGen->GetAllZonesName() ; - int num = 0; QString aName=""; - while (aName=="" ) - { - aName.setNum(num+1) ; - aName.insert(0, QString("Zone_")) ; - for ( int i=0; ilength() ; i++) - { - if ( aName == QString(MyObjects[i])) - { - num ++ ; - aName = "" ; - break ; - } - } - } - LEName->setText(aName); - MESSAGE("SetNewName aName ="<setVisible(1) ; - gBSphere->setVisible(0) ; - gBCylindre->setVisible(0) ; - gBPipe->setVisible(0) ; - adjustSize() ; - _Type=2; -// Sachant que l'increment est le 1/100eme de l'ecart (min/max), cela revient -// a initialiser la boite sur une boite 'centrale' comprise entre 2/5 et 3/5 - if ( _Xincr > 0 ) { SpinBox_Xmini->setValue(_Xcentre-10*_Xincr) ; - SpinBox_Xmaxi->setValue(_Xcentre+10*_Xincr) ; } - else { _Type=12 ; } - if ( _Yincr > 0 ) { SpinBox_Ymini->setValue(_Ycentre-10*_Yincr) ; - SpinBox_Ymaxi->setValue(_Ycentre+10*_Yincr) ; } - else { _Type=13 ; } - if ( _Zincr > 0 ) { SpinBox_Zmini->setValue(_Zcentre-10*_Zincr) ; - SpinBox_Zmaxi->setValue(_Zcentre+10*_Zincr) ; } - else { _Type=11 ; } - MESSAGE("Fin de SetBox") -} -// ------------------------------------------------------------------------ -void MonCreateZone::SetSphere() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetSphere") - gBBox->setVisible(0) ; - gBSphere->setVisible(1) ; - gBCylindre->setVisible(0) ; - gBPipe->setVisible(0) ; - adjustSize() ; - _Type=4; - SpinBox_Xcentre->setValue(_Xcentre) ; - SpinBox_Ycentre->setValue(_Ycentre) ; - SpinBox_Zcentre->setValue(_Zcentre) ; - SpinBox_Rayon->setValue(_Rayon) ; - MESSAGE("Fin de SetSphere") -} -// ------------------------------------------------------------------------ -void MonCreateZone::SetCylinder() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetCylinder") - gBBox->setVisible(0) ; - gBSphere->setVisible(0) ; - gBCylindre->setVisible(1) ; - gBPipe->setVisible(0) ; - adjustSize() ; - _Type=5; - if ( _Xincr > 0 ) { SpinBox_Xbase->setValue(_Xcentre) ; - SpinBox_Xaxis->setValue(0.) ; } - else { _Type=32 ; } - if ( _Yincr > 0 ) { SpinBox_Ybase->setValue(_Ycentre) ; - SpinBox_Yaxis->setValue(0.) ; } - else { _Type=33 ; } - if ( _Zincr > 0 ) { SpinBox_Zbase->setValue(_Zcentre) ; - SpinBox_Zaxis->setValue(1.) ; } - else { _Type=31 ; } - SpinBox_Radius->setValue(_Rayon) ; - SpinBox_Haut->setValue(_Haut) ; - MESSAGE("Fin de SetCylinder") -} -// ------------------------------------------------------------------------ -void MonCreateZone::SetPipe() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetPipe") - gBBox->setVisible(0) ; - gBSphere->setVisible(0) ; - gBCylindre->setVisible(0) ; - gBPipe->setVisible(1) ; - adjustSize() ; - _Type=7; - if ( _Xincr > 0 ) { SpinBox_Xbase_p->setValue(_Xcentre) ; - SpinBox_Xaxis_p->setValue(0.) ; } - else { _Type=62 ; } - if ( _Yincr > 0 ) { SpinBox_Ybase_p->setValue(_Ycentre) ; - SpinBox_Yaxis_p->setValue(0.) ; } - else { _Type=63 ; } - if ( _Zincr > 0 ) { SpinBox_Zbase_p->setValue(_Zcentre) ; - SpinBox_Zaxis_p->setValue(1.) ; } - else { _Type=61 ; } - SpinBox_Radius_int->setValue(_RayonInt) ; - SpinBox_Radius_ext->setValue(_Rayon) ; - SpinBox_Haut_p->setValue(_Haut) ; - MESSAGE("Fin de SetPipe") -} - - diff --git a/src/ADAPTGUI/MonCreateZone.h b/src/ADAPTGUI/MonCreateZone.h deleted file mode 100644 index 4eb700a43..000000000 --- a/src/ADAPTGUI/MonCreateZone.h +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_CREATEZONE_H -#define MON_CREATEZONE_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) - -#include "ui_CreateZone.h" -#include - -class MonCreateHypothesis; -class HOMARD_EXPORT MonCreateZone : public QDialog, public Ui_CreateZone -{ - Q_OBJECT - -public: - MonCreateZone( MonCreateHypothesis* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString caseName); - virtual ~MonCreateZone(); - -protected : - MonCreateZone( MonCreateHypothesis* parent, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString caseName); - - MonCreateHypothesis * _parent; - - QString _Name; - QString _aCaseName; - - int _Orient; - int _Type; - double _Xcentre, _Ycentre, _Zcentre, _Rayon ; - double _Xmin, _Xmax, _Xincr, _Ymin, _Ymax, _Yincr, _Zmin, _Zmax, _Zincr ; - double _ZoneXcentre, _ZoneYcentre, _ZoneZcentre, _ZoneRayon ; - double _ZoneXmin, _ZoneXmax, _ZoneYmin, _ZoneYmax, _ZoneZmin, _ZoneZmax ; - double _Xaxis, _Yaxis, _Zaxis, _RayonInt, _Haut ; - double _ZoneXaxis, _ZoneYaxis, _ZoneZaxis, _ZoneRayonInt, _ZoneHaut ; - double _DMax ; - - bool Chgt; - - ADAPT::HOMARD_Zone_var aZone ; - ADAPT::ADAPT_Gen_var myAdaptGen; - - virtual void InitConnect(); - virtual void InitValZone(); - virtual void InitMinMax(); - virtual void SetNewName(); - virtual bool CreateOrUpdateZone(); - -public slots: - virtual void SetBox(); - virtual void SetSphere(); - virtual void SetCylinder(); - virtual void SetPipe(); - virtual void PushOnOK(); - virtual bool PushOnApply(); - virtual void PushOnHelp(); - -}; - -#endif // MON_CREATEZONE_H diff --git a/src/ADAPTGUI/MonEditBoundaryAn.cxx b/src/ADAPTGUI/MonEditBoundaryAn.cxx deleted file mode 100644 index 03ceaf4bb..000000000 --- a/src/ADAPTGUI/MonEditBoundaryAn.cxx +++ /dev/null @@ -1,399 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonEditBoundaryAn.h" - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include - -using namespace std; - -// ------------------------------------------------------------------------ -MonEditBoundaryAn::MonEditBoundaryAn( MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString caseName, QString Name ): -// ------------------------------------------------------------------------ -/* Constructs a MonEditBoundaryAn - herite de MonCreateBoundaryAn -*/ - MonCreateBoundaryAn(parent, myAdaptGen, caseName) -{ - MESSAGE("Debut de MonEditBoundaryAn pour " << Name.toStdString().c_str()); - setWindowTitle(QObject::tr("HOM_BOUN_A_EDIT_WINDOW_TITLE")); - _Name=Name; - aBoundaryAn = myAdaptGen->GetBoundary(_Name.toStdString().c_str()); - InitValEdit(); -} -// ------------------------------------------------------------------------ -MonEditBoundaryAn::~MonEditBoundaryAn() -// ------------------------------------------------------------------------ -{ - // no need to delete child widgets, Qt does it all for us -} -// ------------------------------------------------------------------------ -void MonEditBoundaryAn::InitValEdit() -// ------------------------------------------------------------------------ -{ - LEName->setText(_Name); - LEName->setReadOnly(true); - _Type = aBoundaryAn->GetType(); - MESSAGE("_Type : "<<_Type); - InitValBoundaryAnLimit(); - if (_aCaseName != QString("")) InitValBoundaryAn(); - switch (_Type) - { - case 1 : // il s agit d un cylindre - { - InitValBoundaryAnCylindre(); - SetCylinder(); - break; - } - case 2: // il s agit d une sphere - { - InitValBoundaryAnSphere(); - SetSphere(); - break; - } - case 3: // il s agit d un cone defini par un axe et un angle - { - InitValBoundaryAnConeA(); - SetConeA(); - break; - } - case 4: // il s agit d un cone defini par les 2 rayons - { - InitValBoundaryAnConeR(); - SetConeR(); - break; - } - case 5: // il s agit d un tore - { - InitValBoundaryAnTore(); - SetTore(); - break; - } - }; -} -// ------------------------------------------------------------------------ -void MonEditBoundaryAn::InitValBoundaryAnLimit() -// ------------------------------------------------------------------------ -{ - ADAPT::double_array_var mesCoordLimits = aBoundaryAn->GetLimit(); - ASSERT(mesCoordLimits->length() == 3 ); - _Xincr=mesCoordLimits[0]; - _Yincr=mesCoordLimits[1]; - _Zincr=mesCoordLimits[2]; -} -// ------------------------------------------------------------------------ -void MonEditBoundaryAn::InitValBoundaryAnCylindre() -// ------------------------------------------------------------------------ -{ - ADAPT::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords(); - ASSERT(mesCoordBoundary->length() == 7 ); - _BoundaryAnXcentre=mesCoordBoundary[0]; - _BoundaryAnYcentre=mesCoordBoundary[1]; - _BoundaryAnZcentre=mesCoordBoundary[2]; - _BoundaryAnXaxis=mesCoordBoundary[3]; - _BoundaryAnYaxis=mesCoordBoundary[4]; - _BoundaryAnZaxis=mesCoordBoundary[5]; - _BoundaryAnRayon=mesCoordBoundary[6]; -} -// ------------------------------------------------------------------------ -void MonEditBoundaryAn::InitValBoundaryAnSphere() -// ------------------------------------------------------------------------ -{ - ADAPT::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords(); - ASSERT(mesCoordBoundary->length() == 4 ); - _BoundaryAnXcentre=mesCoordBoundary[0]; - _BoundaryAnYcentre=mesCoordBoundary[1]; - _BoundaryAnZcentre=mesCoordBoundary[2]; - _BoundaryAnRayon=mesCoordBoundary[3]; -} -// ------------------------------------------------------------------------ -void MonEditBoundaryAn::InitValBoundaryAnConeA() -// ------------------------------------------------------------------------ -{ - ADAPT::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords(); - ASSERT(mesCoordBoundary->length() == 7 ); - _BoundaryAnXaxisCone=mesCoordBoundary[0]; - _BoundaryAnYaxisCone=mesCoordBoundary[1]; - _BoundaryAnZaxisCone=mesCoordBoundary[2]; - _BoundaryAngle=mesCoordBoundary[3]; - _BoundaryAnXorigCone=mesCoordBoundary[4]; - _BoundaryAnYorigCone=mesCoordBoundary[5]; - _BoundaryAnZorigCone=mesCoordBoundary[6]; - convertRayonAngle(-1) ; -} -// ------------------------------------------------------------------------ -void MonEditBoundaryAn::InitValBoundaryAnConeR() -// ------------------------------------------------------------------------ -{ - ADAPT::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords(); - ASSERT(mesCoordBoundary->length() == 8 ); - _BoundaryAnXcone1=mesCoordBoundary[0]; - _BoundaryAnYcone1=mesCoordBoundary[1]; - _BoundaryAnZcone1=mesCoordBoundary[2]; - _BoundaryAnRayon1=mesCoordBoundary[3]; - _BoundaryAnXcone2=mesCoordBoundary[4]; - _BoundaryAnYcone2=mesCoordBoundary[5]; - _BoundaryAnZcone2=mesCoordBoundary[6]; - _BoundaryAnRayon2=mesCoordBoundary[7]; - convertRayonAngle(1) ; -} -// ------------------------------------------------------------------------ -void MonEditBoundaryAn::InitValBoundaryAnTore() -// ------------------------------------------------------------------------ -{ - ADAPT::double_array_var mesCoordBoundary = aBoundaryAn->GetCoords(); - ASSERT(mesCoordBoundary->length() == 8 ); - _BoundaryAnXcentre=mesCoordBoundary[0]; - _BoundaryAnYcentre=mesCoordBoundary[1]; - _BoundaryAnZcentre=mesCoordBoundary[2]; - _BoundaryAnXaxis=mesCoordBoundary[3]; - _BoundaryAnYaxis=mesCoordBoundary[4]; - _BoundaryAnZaxis=mesCoordBoundary[5]; - _BoundaryAnRayon1=mesCoordBoundary[6]; - _BoundaryAnRayon2=mesCoordBoundary[7]; -} -// ------------------------------------------------------------------------ -void MonEditBoundaryAn::SetCylinder() -// ------------------------------------------------------------------------ -{ - gBCylindre->setVisible(1); - gBSphere->setVisible(0); - gBCone->setVisible(0); - gBTore->setVisible(0); - RBCylindre->setChecked(1); - _Type=1; - RBSphere->setDisabled(true); - RBCone->setDisabled(true); - RBTore->setDisabled(true); - - SpinBox_Xcent->setValue(_BoundaryAnXcentre); - SpinBox_Ycent->setValue(_BoundaryAnYcentre); - SpinBox_Zcent->setValue(_BoundaryAnZcentre); - - SpinBox_Xaxis->setValue(_BoundaryAnXaxis); - SpinBox_Yaxis->setValue(_BoundaryAnYaxis); - SpinBox_Zaxis->setValue(_BoundaryAnZaxis); - - - SpinBox_Xaxis->setSingleStep(0.1); - SpinBox_Xcentre->setSingleStep(_Xincr); - SpinBox_Yaxis->setSingleStep(0.1); - SpinBox_Ycentre->setSingleStep(_Yincr); - SpinBox_Zaxis->setSingleStep(0.1); - SpinBox_Zcentre->setSingleStep(_Zincr); -// Rayon - SpinBox_Radius->setValue(_BoundaryAnRayon); - SpinBox_Radius->setSingleStep(_BoundaryAnRayon/10.); -// - adjustSize(); -} -// ------------------------------------------------------------------------ -void MonEditBoundaryAn::SetSphere() -// ------------------------------------------------------------------------ -{ - gBCylindre->setVisible(0); - gBSphere->setVisible(1); - RBSphere->setChecked(1); - gBCone->setVisible(0); - gBTore->setVisible(0); - RBCylindre->setDisabled(true); - RBCone->setDisabled(true); - RBTore->setDisabled(true); - _Type=2 ; - - SpinBox_Xcentre->setValue(_BoundaryAnXcentre); - if ( _Xincr > 0) { SpinBox_Xcentre->setSingleStep(_Xincr); } - else { SpinBox_Xcentre->setSingleStep(1) ; } - - SpinBox_Ycentre->setValue(_BoundaryAnYcentre); - if ( _Yincr > 0) { SpinBox_Ycentre->setSingleStep(_Yincr); } - else { SpinBox_Ycentre->setSingleStep(1) ; } - - SpinBox_Zcentre->setValue(_BoundaryAnZcentre); - if ( _Zincr > 0) { SpinBox_Zcentre->setSingleStep(_Zincr); } - else { SpinBox_Zcentre->setSingleStep(1);} - - SpinBox_Rayon->setValue(_BoundaryAnRayon); -// - adjustSize(); -} -// ------------------------------------------------------------------------ -void MonEditBoundaryAn::SetConeA() -// ------------------------------------------------------------------------ -{ - gBCylindre->setVisible(0); - gBSphere->setVisible(0); - gBCone->setVisible(1); - RBCone->setChecked(1); - gBTore->setVisible(0); - RB_Def_angle->setChecked(1); - RBCylindre->setDisabled(true); - RBSphere->setDisabled(true); - RBTore->setDisabled(true); - _Type=3; -// - TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X axis", 0)); - SpinBox_Cone_X1->setValue(_BoundaryAnXaxisCone); - TLCone_Y1->setText(QApplication::translate("CreateBoundaryAn", "Y axis", 0)); - SpinBox_Cone_Y1->setValue(_BoundaryAnYaxisCone); - TLCone_Z1->setText(QApplication::translate("CreateBoundaryAn", "Z axis", 0)); - SpinBox_Cone_Z1->setValue(_BoundaryAnZaxisCone); -// - TLCone_X2->setText(QApplication::translate("CreateBoundaryAn", "X centre", 0)); - SpinBox_Cone_X2->setValue(_BoundaryAnXorigCone); - TLCone_Y2->setText(QApplication::translate("CreateBoundaryAn", "Y centre", 0)); - SpinBox_Cone_Y2->setValue(_BoundaryAnYorigCone); - TLCone_Z2->setText(QApplication::translate("CreateBoundaryAn", "Z centre", 0)); - SpinBox_Cone_Z2->setValue(_BoundaryAnZorigCone); -// - TLCone_V1->setText(QApplication::translate("CreateBoundaryAn", "Angle", 0)); - SpinBox_Cone_V1->setValue(_BoundaryAngle); - SpinBox_Cone_V1->setSingleStep(1.); - SpinBox_Cone_V1->setMaximum(90.); -// - TLCone_V2->setVisible(0); - SpinBox_Cone_V2->setVisible(0); -// - adjustSize(); -} -// ------------------------------------------------------------------------ -void MonEditBoundaryAn::SetConeR() -// ------------------------------------------------------------------------ -{ - gBCylindre->setVisible(0); - gBSphere->setVisible(0); - gBCone->setVisible(1); - gBTore->setVisible(0); - RBCone->setChecked(1); - RB_Def_radius->setChecked(1); - RBCylindre->setDisabled(true); - RBSphere->setDisabled(true); - RBTore->setDisabled(true); - _Type=4; -// - TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X centre 1", 0)); - SpinBox_Cone_X1->setValue(_BoundaryAnXcone1); - TLCone_Y1->setText(QApplication::translate("CreateBoundaryAn", "Y centre 1", 0)); - SpinBox_Cone_Y1->setValue(_BoundaryAnYcone1); - TLCone_Z1->setText(QApplication::translate("CreateBoundaryAn", "Z centre 1", 0)); - SpinBox_Cone_Z1->setValue(_BoundaryAnZcone1); -// - TLCone_V1->setText(QApplication::translate("CreateBoundaryAn", "Radius 1", 0)); - SpinBox_Cone_V1->setSingleStep(_Rayon/10.); - SpinBox_Cone_V1->setMaximum(100000.*_DMax); - SpinBox_Cone_V1->setValue(_BoundaryAnRayon1); -// - TLCone_X2->setText(QApplication::translate("CreateBoundaryAn", "X centre 2", 0)); - SpinBox_Cone_X2->setValue(_BoundaryAnXcone2); - TLCone_Y2->setText(QApplication::translate("CreateBoundaryAn", "Y centre 2", 0)); - SpinBox_Cone_Y2->setValue(_BoundaryAnYcone2); - TLCone_Z2->setText(QApplication::translate("CreateBoundaryAn", "Z centre 2", 0)); - SpinBox_Cone_Z2->setValue(_BoundaryAnZcone2); -// - TLCone_V2->setVisible(1); - SpinBox_Cone_V2->setVisible(1); - TLCone_V2->setText(QApplication::translate("CreateBoundaryAn", "Radius 2", 0)); - SpinBox_Cone_V2->setValue(_BoundaryAnRayon2); -// - adjustSize(); -} -// ------------------------------------------------------------------------ -void MonEditBoundaryAn::SetTore() -// ------------------------------------------------------------------------ -{ - gBCylindre->setVisible(0); - gBSphere->setVisible(0); - gBCone->setVisible(0); - gBTore->setVisible(1); - RBTore->setChecked(1); - _Type=5; - RBCylindre->setDisabled(true); - RBSphere->setDisabled(true); - RBCone->setDisabled(true); - - SpinBoxToreXcent->setValue(_BoundaryAnXcentre); - SpinBoxToreYcent->setValue(_BoundaryAnYcentre); - SpinBoxToreZcent->setValue(_BoundaryAnZcentre); - - SpinBoxToreXaxe->setValue(_BoundaryAnXaxis); - SpinBoxToreYaxe->setValue(_BoundaryAnYaxis); - SpinBoxToreZaxe->setValue(_BoundaryAnZaxis); - - - SpinBoxToreXaxe->setSingleStep(0.1); - SpinBoxToreXcent->setSingleStep(_Xincr); - SpinBoxToreYaxe->setSingleStep(0.1); - SpinBoxToreYcent->setSingleStep(_Yincr); - SpinBoxToreZaxe->setSingleStep(0.1); - SpinBoxToreZcent->setSingleStep(_Zincr); -// Rayon de revolution - SpinBoxToreRRev->setValue(_BoundaryAnRayon1); - SpinBoxToreRRev->setSingleStep(_BoundaryAnRayon1/10.); -// Rayon primaire - SpinBoxToreRPri->setValue(_BoundaryAnRayon2); - SpinBoxToreRPri->setSingleStep(_BoundaryAnRayon2/10.); -// - adjustSize(); -} -// --------------------------------------------------- -bool MonEditBoundaryAn::CreateOrUpdateBoundaryAn() -//---------------------------------------------------- -// Mise a jour des attributs de la BoundaryAn -{ - switch (_Type) - { - case 1 : // il s agit d un cylindre - { - aBoundaryAn->SetCylinder(_BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnXaxis, _BoundaryAnYaxis, _BoundaryAnZaxis, _BoundaryAnRayon ); - break; - } - case 2 : // il s agit d une sphere - { - aBoundaryAn->SetSphere(_BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnRayon); - break; - } - case 3 : // il s agit d un cone defini par un axe et un angle - { - aBoundaryAn = myAdaptGen->CreateBoundaryConeA(CORBA::string_dup(_Name.toStdString().c_str()), \ - _BoundaryAnXaxisCone, _BoundaryAnYaxisCone, _BoundaryAnZaxisCone, _BoundaryAngle, \ - _BoundaryAnXorigCone, _BoundaryAnYorigCone, _BoundaryAnYorigCone); - break; - } - case 4 : // il s agit d un cone defini par les 2 rayons - { - aBoundaryAn = myAdaptGen->CreateBoundaryConeR(CORBA::string_dup(_Name.toStdString().c_str()), \ - _BoundaryAnXcone1, _BoundaryAnYcone1, _BoundaryAnZcone1, _BoundaryAnRayon1, \ - _BoundaryAnXcone2, _BoundaryAnYcone2, _BoundaryAnZcone2, _BoundaryAnRayon2); - break; - } - case 5 : // il s agit d un tore - { - aBoundaryAn->SetTorus(_BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnXaxis, _BoundaryAnYaxis, _BoundaryAnZaxis, _BoundaryAnRayon1, _BoundaryAnRayon2 ); - break; - } - } - if (Chgt) myAdaptGen->InvalideBoundary(_Name.toStdString().c_str()); - HOMARD_UTILS::updateObjBrowser(); - return true; -} - diff --git a/src/ADAPTGUI/MonEditBoundaryAn.h b/src/ADAPTGUI/MonEditBoundaryAn.h deleted file mode 100644 index fcc9167f7..000000000 --- a/src/ADAPTGUI/MonEditBoundaryAn.h +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_EDITBOUNDARYAN_H -#define MON_EDITBOUNDARYAN_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) - -#include - -class HOMARD_EXPORT MonEditBoundaryAn : public MonCreateBoundaryAn -{ - Q_OBJECT -public: - MonEditBoundaryAn( MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString caseName, QString Name); - virtual ~MonEditBoundaryAn(); - -protected : - bool CreateOrUpdateBoundaryAn(); - void InitValEdit(); - void InitValBoundaryAnLimit(); - void SetCylinder(); - void SetSphere(); - void SetConeR(); - void SetConeA(); - void SetTore(); - void InitValBoundaryAnCylindre(); - void InitValBoundaryAnSphere(); - void InitValBoundaryAnConeR(); - void InitValBoundaryAnConeA(); - void InitValBoundaryAnTore(); - -public slots: - -}; - -#endif // MON_EDITZONE_H diff --git a/src/ADAPTGUI/MonEditBoundaryCAO.cxx b/src/ADAPTGUI/MonEditBoundaryCAO.cxx deleted file mode 100644 index a0c6abb28..000000000 --- a/src/ADAPTGUI/MonEditBoundaryCAO.cxx +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonEditBoundaryCAO.h" -#include "MonEditListGroupCAO.h" - -#include - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include "HomardQtCommun.h" -#include - -using namespace std; - -// ------------------------------------------------------------------------------------------------------------------------------------- -MonEditBoundaryCAO::MonEditBoundaryCAO( MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString caseName, QString Name): -// ------------------------------------------------------------------------------------------------------------------------------------- -/* Constructs a MonEditBoundaryCAO - herite de MonCreateBoundaryCAO -*/ - MonCreateBoundaryCAO(parent, modal, myAdaptGen, caseName, Name) -{ - MESSAGE("Debut de Boundary pour " << Name.toStdString().c_str()); - setWindowTitle(QObject::tr("HOM_BOUN_C_EDIT_WINDOW_TITLE")); - try - { - aBoundary=myAdaptGen->GetBoundary(CORBA::string_dup(_aName.toStdString().c_str())); - if (caseName==QString("")) { _aCaseName=aBoundary->GetCaseCreation();} - InitValEdit(); - } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - return; - } - - ADAPT::ListGroupType_var maListe = aBoundary->GetGroups(); - for ( int i = 0; i < maListe->length(); i++ ) - _listeGroupesBoundary << QString(maListe[i]); - -} -// ------------------------------ -MonEditBoundaryCAO::~MonEditBoundaryCAO() -// ------------------------------ -{ -} -// ------------------------------ -void MonEditBoundaryCAO::InitValEdit() -// ------------------------------ -{ - LEName->setText(_aName); - LEName->setReadOnly(true); - - QString aDataFile = aBoundary->GetDataFile(); - LEFileName->setText(aDataFile); - LEFileName->setReadOnly(1); - PushFichier->setVisible(0); -// - adjustSize(); -} -// ------------------------------ -bool MonEditBoundaryCAO::PushOnApply() -// ------------------------------ -{ - return true; -} -// ------------------------------------------------------------------------ -void MonEditBoundaryCAO::SetFiltrage() -// // ------------------------------------------------------------------------ -{ - if (!CBGroupe->isChecked()) return; - if (_aCaseName.toStdString().c_str() == QString()) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_BOUN_CASE") ); - return; - } - ADAPT::HOMARD_Cas_var monCas= myAdaptGen->GetCase(_aCaseName.toStdString().c_str()); - ADAPT::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); - - MonEditListGroupCAO *aDlg = new MonEditListGroupCAO(NULL, this, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), - _aCaseName, _listeGroupesBoundary) ; - aDlg->show(); -} - diff --git a/src/ADAPTGUI/MonEditBoundaryCAO.h b/src/ADAPTGUI/MonEditBoundaryCAO.h deleted file mode 100644 index 802727623..000000000 --- a/src/ADAPTGUI/MonEditBoundaryCAO.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_EDITBOUNDARYCAO_H -#define MON_EDITBOUNDARYCAO_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) - -#include - -class HOMARD_EXPORT MonEditBoundaryCAO : public MonCreateBoundaryCAO -{ - Q_OBJECT -public: - MonEditBoundaryCAO( MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString caseName, QString Name ); - virtual ~MonEditBoundaryCAO(); - -protected : - virtual void InitValEdit(); - virtual bool PushOnApply(); - virtual void SetFiltrage(); - -public slots: - -}; - -#endif diff --git a/src/ADAPTGUI/MonEditBoundaryDi.cxx b/src/ADAPTGUI/MonEditBoundaryDi.cxx deleted file mode 100644 index afbe926b4..000000000 --- a/src/ADAPTGUI/MonEditBoundaryDi.cxx +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonEditBoundaryDi.h" -#include "MonEditListGroup.h" - -#include - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include "HomardQtCommun.h" -#include - -using namespace std; - -// ------------------------------------------------------------------------------------------------------------------------------------- -MonEditBoundaryDi::MonEditBoundaryDi( MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString caseName, QString Name): -// ------------------------------------------------------------------------------------------------------------------------------------- -/* Constructs a MonEditBoundaryDi - herite de MonCreateBoundaryDi -*/ - MonCreateBoundaryDi(parent, modal, myAdaptGen, caseName, Name) -{ - MESSAGE("Debut de Boundary pour " << Name.toStdString().c_str()); - setWindowTitle(QObject::tr("HOM_BOUN_D_EDIT_WINDOW_TITLE")); - try - { - aBoundary=myAdaptGen->GetBoundary(CORBA::string_dup(_aName.toStdString().c_str())); - if (caseName==QString("")) { _aCaseName=aBoundary->GetCaseCreation();} - InitValEdit(); - } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - return; - } - - ADAPT::ListGroupType_var maListe = aBoundary->GetGroups(); - for ( int i = 0; i < maListe->length(); i++ ) - _listeGroupesBoundary << QString(maListe[i]); - -} -// ------------------------------ -MonEditBoundaryDi::~MonEditBoundaryDi() -// ------------------------------ -{ -} -// ------------------------------ -void MonEditBoundaryDi::InitValEdit() -// ------------------------------ -{ - LEName->setText(_aName); - LEName->setReadOnly(true); - - QString aDataFile = aBoundary->GetDataFile(); - LEFileName->setText(aDataFile); - LEFileName->setReadOnly(1); - PushFichier->setVisible(0); -// - adjustSize(); -} -// ------------------------------ -bool MonEditBoundaryDi::PushOnApply() -// ------------------------------ -{ - return true; -} -// ------------------------------------------------------------------------ -void MonEditBoundaryDi::SetFiltrage() -// // ------------------------------------------------------------------------ -{ - if (!CBGroupe->isChecked()) return; - if (_aCaseName.toStdString().c_str() == QString()) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_BOUN_CASE") ); - return; - } - ADAPT::HOMARD_Cas_var monCas= myAdaptGen->GetCase(_aCaseName.toStdString().c_str()); - ADAPT::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); - - MonEditListGroup *aDlg = new MonEditListGroup(NULL, this, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), - _aCaseName, _listeGroupesBoundary) ; - aDlg->show(); -} - diff --git a/src/ADAPTGUI/MonEditBoundaryDi.h b/src/ADAPTGUI/MonEditBoundaryDi.h deleted file mode 100644 index 635a7b084..000000000 --- a/src/ADAPTGUI/MonEditBoundaryDi.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_EDITBOUNDARYDI_H -#define MON_EDITBOUNDARYDI_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) - -#include - -class HOMARD_EXPORT MonEditBoundaryDi : public MonCreateBoundaryDi -{ - Q_OBJECT -public: - MonEditBoundaryDi( MonCreateCase* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString caseName, QString Name ); - virtual ~MonEditBoundaryDi(); - -protected : - virtual void InitValEdit(); - virtual bool PushOnApply(); - virtual void SetFiltrage(); - -public slots: - -}; - -#endif diff --git a/src/ADAPTGUI/MonEditCase.cxx b/src/ADAPTGUI/MonEditCase.cxx deleted file mode 100644 index c68c22811..000000000 --- a/src/ADAPTGUI/MonEditCase.cxx +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonEditCase.h" - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include "HomardQtCommun.h" -#include - -using namespace std; - -// ------------------------------------------------------------- -/* Constructs a MonEditCase - herite de MonCreateCase -*/ -// ------------------------------------------------------------- -MonEditCase::MonEditCase ( bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString CaseName ): - MonCreateCase(modal, myAdaptGen) -{ - MESSAGE("Debut de MonEditCase" << CaseName.toStdString().c_str()); - setWindowTitle(QObject::tr("HOM_CASE_EDIT_WINDOW_TITLE")); - _aCaseName = CaseName; - aCase = myAdaptGen->GetCase(_aCaseName.toStdString().c_str()); - InitValEdit(); -} -// ------------------------------ -MonEditCase::~MonEditCase() -// ------------------------------ -{ -} -// ------------------------------ -void MonEditCase::InitValEdit() -// ------------------------------ -{ - MESSAGE("InitValEdit"); - LEName->setText(_aCaseName); - LEName->setReadOnly(true); - - QString aDirName = aCase->GetDirName(); - LEDirName->setText(aDirName); - LEDirName->setReadOnly(true); - PushDir->setVisible(0); - - QString _aitername=aCase->GetIter0Name(); - ADAPT::HOMARD_Iteration_var aIter = myAdaptGen->GetIteration(_aitername.toStdString().c_str()); - QString aFileName = aIter->GetMeshFile(); - LEFileName->setText(aFileName); - LEFileName->setReadOnly(true); - PushFichier->setVisible(0); - - int ConfType=aCase->GetConfType(); - if ( ( ConfType == 0 ) || ( ConfType == -1 ) ) { RBConforme->setChecked(true); } - else { RBNonConforme->setChecked(true); }; - RBConforme->setEnabled(false); - RBNonConforme->setEnabled(false); - int ExtType=aCase->GetExtType(); - - -// Suivi de frontiere -// A priori, aucun affichage - GBTypeBoun->setVisible(0); - CBBoundaryD->setVisible(0); - CBBoundaryA->setVisible(0); - GBBoundaryC->setVisible(0); - GBBoundaryD->setVisible(0); - GBBoundaryA->setVisible(0); -// On passe en revue tous les couples (frontiere,groupe) du cas - ADAPT::ListBoundaryGroupType_var mesBoundarys = aCase->GetBoundaryGroup(); - if (mesBoundarys->length()>0) - { - QStringList ListeFron ; - QString NomFron ; - bool BounCAO = false ; - bool BounDi = false ; - bool BounAn = false ; - for (int i=0; ilength(); i++) - { -// Nom de la frontiere - NomFron = mesBoundarys[i++]; - MESSAGE("NomFron "<GetBoundary(NomFron.toStdString().c_str()); - int type_obj = myBoundary->GetType() ; - MESSAGE("type_obj "<addItem(NomFron); - } -// C'est une frontiere discrete -// Rermarque : on ne gere pas les groupes - else if ( type_obj==0 ) - { - BounDi = true ; - CBBoundaryDi->addItem(NomFron); - } -// C'est une frontiere analytique - else - { - BounAn = true ; - int nbcol = TWBoundary->columnCount(); -// On ajoute une ligne pour le groupe - TWBoundary->insertRow(0); -// La colonne 0 comporte le nom du groupe - TWBoundary->setItem( 0, 0, new QTableWidgetItem(QString(mesBoundarys[i]).trimmed())); -// TWBoundary->item( 0, 0 )->setFlags(Qt::ItemIsEnabled |Qt::ItemIsSelectable ); -// Chacune des colonnes suivantes est associé a une frontiere deja presente : on y met une -// case non cochee - for ( int j = 1; j < nbcol; j++ ) - { - TWBoundary->setItem( 0, j, new QTableWidgetItem( QString ("") ) ); - TWBoundary->item( 0, j )->setFlags( 0 ); - TWBoundary->item( 0, j )->setFlags( Qt::ItemIsUserCheckable ); - TWBoundary->item( 0, j )->setCheckState( Qt::Unchecked ); - } -// On cherche si la frontiere en cours d'examen a deja ete rencontree : -// si oui, on stocke son numero de colonne - int ok = -1 ; - for ( int nufr = 0 ; nufritem( 0, ok )->setCheckState( Qt::Checked ); - } - } - MESSAGE("BounCAO "<setVisible(1); - if ( BounCAO ) - { RBBoundaryCAO->setChecked(true); - GBBoundaryC->setVisible(1); - CBBoundaryCAO->setDisabled(true); - PBBoundaryCAONew->setVisible(0); - PBBoundaryCAOHelp->setVisible(0); } - if ( BounDi ) - { RBBoundaryNonCAO->setChecked(true); - GBBoundaryD->setVisible(1); - CBBoundaryDi->setDisabled(true); - PBBoundaryDiNew->setVisible(0); - PBBoundaryDiHelp->setVisible(0); } - if ( BounAn ) - { RBBoundaryNonCAO->setChecked(true); - GBBoundaryA->setVisible(1); -// On rend les cases non modifiables. -// On ne peut pas le faire pour tout le tableau sinon on perd l'ascenseur ! - int nbcol = TWBoundary->columnCount(); - int nbrow = TWBoundary->rowCount(); - for ( int i = 0; i < nbrow; i++ ) - { for ( int j = 0; j < nbcol; j++ ) TWBoundary->item( i, j )->setFlags( Qt::ItemIsSelectable ); } -// on met un nom blanc au coin - QTableWidgetItem *__colItem = new QTableWidgetItem(); - __colItem->setText(QApplication::translate("CreateCase", "", 0)); - TWBoundary->setHorizontalHeaderItem(0, __colItem); -// on cache les boutons inutiles - PBBoundaryAnNew->setVisible(0); - PBBoundaryAnHelp->setVisible(0); - } - RBBoundaryNo->setEnabled(false); - RBBoundaryCAO->setEnabled(false); - RBBoundaryNonCAO->setEnabled(false); - } -// -// Les options avancees (non modifiables) - CBAdvanced->setVisible(0) ; - CBAdvanced->setEnabled(false) ; - int Pyram = aCase->GetPyram(); - MESSAGE("Pyram "< 0 ) || ( ConfType < 0 ) || ( ConfType > 1 ) || ( ExtType > 0 ) ) - { GBAdvancedOptions->setVisible(1); -// - if ( Pyram > 0 ) - { CBPyramid->setChecked(true); - CBPyramid->setVisible(1); - } - else - { CBPyramid->setChecked(false); - CBPyramid->setVisible(0); - } - CBPyramid->setEnabled(false); -// - if ( ( ConfType == 0 ) || ( ConfType == -1 ) ) - { if ( ConfType == 0 ) { RBStandard->setChecked(true); } - else { RBBox->setChecked(true); } - RBStandard->setVisible(1); - RBBox->setVisible(1); - RBNC1NpA->setVisible(0); - RBNCQuelconque->setVisible(0); - } - else - { if (ConfType==-2) { RBBox->setChecked(true);}; - if (ConfType==1) { RBStandard->setChecked(true);}; - if (ConfType==2) { RBNC1NpA->setChecked(true);}; - if (ConfType==3) { RBNCQuelconque->setChecked(true);}; - RBStandard->setVisible(1); - RBBox->setVisible(1); - RBNC1NpA->setVisible(1); - RBNCQuelconque->setVisible(1); - } - RBStandard->setEnabled(false); - RBBox->setEnabled(false); - RBNC1NpA->setEnabled(false); - RBNCQuelconque->setEnabled(false); -// - if ( ExtType == 0 ) - { GBFormat->setVisible(0); - RBMED->setChecked(true); - } - else - { GBFormat->setVisible(1); - RBMED->setVisible(1); - RBSaturne->setVisible(1); - RBSaturne2D->setVisible(1); - if ( ExtType == 1 ) { RBSaturne->setChecked(true); } - else { RBSaturne2D->setChecked(true); } - } - RBMED->setEnabled(false); - RBSaturne->setEnabled(false); - RBSaturne2D->setEnabled(false); - } - else - { GBAdvancedOptions->setVisible(0); - CBPyramid->setChecked(false); - RBStandard->setChecked(true); - RBMED->setChecked(true); - } -// -// L'etat - int etat = aCase->GetState(); - MESSAGE("etat "<setText(QApplication::translate("CreateCase", "HOM_CASE_EDIT_STATE_0", 0)); } - else { Comment->setText(QApplication::translate("CreateCase", "HOM_CASE_EDIT_STATE", 0)); } - - Comment->setVisible(1); -// - adjustSize(); -} - -// ------------------------------------- -bool MonEditCase::PushOnApply() -// ------------------------------------- -{ - return true ; -}; diff --git a/src/ADAPTGUI/MonEditCase.h b/src/ADAPTGUI/MonEditCase.h deleted file mode 100644 index 70625cb6b..000000000 --- a/src/ADAPTGUI/MonEditCase.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_EDITCASE_H -#define MON_EDITCASE_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) - -#include - -class HOMARD_EXPORT MonEditCase : public MonCreateCase -{ - Q_OBJECT -public: - MonEditCase( bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString Name ); - virtual ~MonEditCase(); - -protected : - virtual void InitValEdit(); - virtual bool PushOnApply(); - -public slots: - -}; - -#endif diff --git a/src/ADAPTGUI/MonEditFile.cxx b/src/ADAPTGUI/MonEditFile.cxx deleted file mode 100644 index 623b3c33c..000000000 --- a/src/ADAPTGUI/MonEditFile.cxx +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonEditFile.h" - -#include -#include -#include - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include "HomardQtCommun.h" -#include - -using namespace std; - -/* --------------------------------------------------------- - * MonEditFile classe derivee de EditFile - * elle meme generee par uic - * Ouvre le fichier passe en parametre - * et affiche le texte correspondant dans la fenetre de log - * --------------------------------------------------------- - */ - -/* --------------------------------------------------------- - * MonEditFile Constructeur - * --------------------------------------------------------- - */ -MonEditFile::MonEditFile( QWidget* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString aFileName, int option): -// QWidget(0), - Ui_EditFile(), - _aFileName (aFileName), - _option (option), - _codret (0) -{ - MESSAGE("Debut de MonEditFile " << aFileName.toStdString().c_str()); - setupUi(this); - InitConnect(); - EditText(); -} -/* - * Destroys the object and frees any allocated resources - */ -MonEditFile::~MonEditFile() -{ - MESSAGE("Destructeur de ~MonEditFile"); -} -// ------------------------------------------------------------------------ -void MonEditFile::InitConnect() -// ------------------------------------------------------------------------ -{ - connect( buttonQuit, SIGNAL(pressed()), this, SLOT(close())); - connect( buttonPrint, SIGNAL(pressed()), this, SLOT(PushOnPrint())); -} -// ------------------------------------------------------------------------ -void MonEditFile::EditText() -// ------------------------------------------------------------------------ -{ -// Creation de l'objet fichier QT associe - QFile file( _aFileName ); -// Ouverture - bool bOpen = file.open( QIODevice::ReadOnly | QIODevice::Text ) ; -// - if ( bOpen ) - { -// Lecture -// Remarque : il serait plus clair de tout lire d'un coup mais cela ne marche pas ! -// alors on fait ligne par ligne et on cumule en ajoutant un saut de ligne. - QTextStream stream( &file ); - QString tout; - while ( !stream.atEnd() ) - { - tout = tout + stream.readLine() + "\n" ; - } -// tout = stream.readAll() ; - QTBEditFile->setPlainText( tout ); - } - else - { - // Option = 0 : emission d'un message d'erreur - if ( _option == 0 ) - { - MESSAGE( "EditText " << _aFileName.toStdString().c_str() << " est impossible a ouvrir "); - QMessageBox::warning( 0, QObject::tr("HOM_WARNING"), - QObject::tr("HOM_SELECT_FILE_3") ); - } - // Sinon : rien - _codret = 1 ; - } -} -// ------------------------------------------------------------------------ -void MonEditFile::PushOnPrint() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de MonEditFile::PushOnPrint") - QMessageBox::warning( 0, QObject::tr("HOM_WARNING"), - QObject::tr("HOM_INACTIVE_BUTTON") ); - return; -} - - diff --git a/src/ADAPTGUI/MonEditFile.h b/src/ADAPTGUI/MonEditFile.h deleted file mode 100644 index e60071080..000000000 --- a/src/ADAPTGUI/MonEditFile.h +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_EDITFILE_H -#define MON_EDITFILE_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include "SALOME_Selection.h" -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) -#include CORBA_CLIENT_HEADER(HOMARD_Cas) - -#include "ui_EditFile.h" -#include - -class QListBox; -class QDialog; - -class HOMARD_EXPORT MonEditFile : public QWidget, public Ui_EditFile -{ - Q_OBJECT - -public: - MonEditFile( QWidget* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString FileName, int option ); - ~MonEditFile(); - int _codret ; - -protected : - - ADAPT::ADAPT_Gen_var myAdaptGen; - QString _aFileName ; - int _option ; - - virtual void InitConnect(); - virtual void EditText(); - -public slots: - virtual void PushOnPrint(); - -}; - -#endif // MON_EDITFILE_H diff --git a/src/ADAPTGUI/MonEditHypothesis.cxx b/src/ADAPTGUI/MonEditHypothesis.cxx deleted file mode 100644 index 997667b81..000000000 --- a/src/ADAPTGUI/MonEditHypothesis.cxx +++ /dev/null @@ -1,463 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonEditHypothesis.h" -#include "MonEditListGroup.h" - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include "HomardQtCommun.h" -#include "HOMARD.hxx" -#include - -using namespace std; - -// ---------------------------------------------------------------------------- -MonEditHypothesis::MonEditHypothesis( MonCreateIteration* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString Name, - QString caseName, QString aFieldFile ): -// ---------------------------------------------------------------------------- -/* Constructs a MonEditHypothesis - herite de MonCreateHypothesis -*/ - MonCreateHypothesis(parent, modal,myAdaptGen, Name, caseName, aFieldFile) -{ - MESSAGE("Hypothese " << Name.toStdString().c_str()); - setWindowTitle(QObject::tr("HOM_HYPO_EDIT_WINDOW_TITLE")); - aHypothesis = myAdaptGen->GetHypothesis(_Name.toStdString().c_str()); - if (caseName == QString("") ){ _aCaseName = aHypothesis->GetCaseCreation();} - InitValEdit(); - InitGroupes(); -} -// ------------------------------ -MonEditHypothesis::~MonEditHypothesis() -// ------------------------------ -{ -} -// ------------------------------ -void MonEditHypothesis::InitGroupes() -// ------------------------------ -{ - ADAPT::ListGroupType_var maListe = aHypothesis->GetGroups(); - for ( int i = 0; i < maListe->length(); i++ ) - _aListeGroupes << QString(maListe[i]); - - if (maListe->length() == 0) { CBGroupe->hide();} -} - -// ------------------------------ -void MonEditHypothesis::InitValEdit() -// ------------------------------ -{ - MESSAGE("Debut de InitValEdit"); - LEName->setText(_Name); - LEName->setReadOnly(true); - ADAPT::listeTypes_var ListTypes (aHypothesis->GetAdapRefinUnRef()); - ASSERT( ListTypes->length()==3) ; - _aTypeAdap = ListTypes[0]; - _aTypeRaff = ListTypes[1]; - _aTypeDera = ListTypes[2]; - - if (_aTypeAdap == -1) InitAdaptUniforme(); - if (_aTypeAdap == 0) InitAdaptZone(); - if (_aTypeAdap == 1) InitAdaptChamps(); - - RBUniDera->setDisabled(true); - RBUniRaff->setDisabled(true); - - InitFieldInterp(); - - if (_aTypeAdap == 1 || _TypeFieldInterp >= 1 ) - { - if (_aFieldFile == QString("")) { GBFieldFile->setVisible(0); } - else - { - GBFieldFile->setVisible(1); - LEFieldFile->setText(_aFieldFile); - LEFieldFile->setReadOnly(1); - } - } - else - { - GBFieldFile->setVisible(0); - } -// Les options avancees (non modifiables) - CBAdvanced->setVisible(0) ; - int NivMax = aHypothesis->GetNivMax(); - double DiamMin = aHypothesis->GetDiamMin(); - int AdapInit = aHypothesis->GetAdapInit(); - int ExtraOutput = aHypothesis->GetExtraOutput(); - if ( NivMax > 0 || DiamMin > 0 || AdapInit != 0 || ExtraOutput != 1 ) - { GBAdvancedOptions->setVisible(1); - if ( NivMax > 0 ) - { SpinBoxNivMax->setValue(NivMax); - SpinBoxNivMax->setDisabled(true); } - else - { TLMaximalLevel->setVisible(0); - SpinBoxNivMax->setVisible(0); } - if ( DiamMin > 0 ) - { doubleSpinBoxDiamMin->setValue(DiamMin); - doubleSpinBoxDiamMin->setDisabled(true); } - else - { TLMinimalDiameter->setVisible(0); - doubleSpinBoxDiamMin->setVisible(0); } - if ( AdapInit != 0 ) - { - if ( AdapInit > 0 ) - { RBAIR->setChecked(true); } - else - { RBAID->setChecked(true); } - RBAIN->setEnabled(false); - RBAIR->setEnabled(false); - RBAID->setEnabled(false); - } - else - { GBAdapInit->setVisible(0) ; - } - if ( ExtraOutput % 2 == 0 ) - { - CBOutputLevel->setChecked(true); - CBOutputLevel->setEnabled(false); - } - else { CBOutputLevel->setVisible(0) ; } - if ( ExtraOutput % 3 == 0 ) - { - CBOutputQuality->setChecked(true); - CBOutputQuality->setEnabled(false); - } - else { CBOutputQuality->setVisible(0) ; } - if ( ExtraOutput % 5 == 0 ) - { - CBOutputDiameter->setChecked(true); - CBOutputDiameter->setEnabled(false); - } - else { CBOutputDiameter->setVisible(0) ; } - if ( ExtraOutput % 7 == 0 ) - { - CBOutputParent->setChecked(true); - CBOutputParent->setEnabled(false); - } - else { CBOutputParent->setVisible(0) ; } - if ( ExtraOutput % 11 == 0 ) - { - CBOutputVoisins->setChecked(true); - CBOutputVoisins->setEnabled(false); - } - else { CBOutputVoisins->setVisible(0) ; } - } - else - { GBAdvancedOptions->setVisible(0); } -// -} -// ---------------------------------------- -void MonEditHypothesis::InitAdaptUniforme() -// ---------------------------------------- -// Affichage des informations pour une adaptation uniforme -{ -// Choix des options generales - GBFieldManagement->setVisible(0); - GBAreaManagement->setVisible(0); - GBUniform->setVisible(1); - RBUniforme->setChecked(true); - RBUniforme->setEnabled(false); - RBChamp->setEnabled(false); - RBZone->setEnabled(false); -// -// Raffinement ou deraffinement ? - if (_aTypeDera == 0) - { - VERIFICATION(_aTypeRaff==1); - RBUniDera->setChecked(false); - RBUniRaff->setChecked(true); - } - if (_aTypeDera == 1) - { - VERIFICATION(_aTypeRaff==0); - RBUniDera->setChecked(true); - RBUniRaff->setChecked(false); - } -// - adjustSize(); -// -} -// ------------------------------------- -void MonEditHypothesis::InitAdaptZone() -// ------------------------------------- -// Affichage des informations pour une adaptation selon des zones : -{ - MESSAGE ("Debut de InitAdaptZone"); -// Choix des options generales - GBUniform->setVisible(0); - GBFieldManagement->setVisible(0); - GBAreaManagement->setVisible(1); - RBZone->setChecked(true); - RBChamp->setEnabled(false); - RBUniforme->setEnabled(false); - RBZone->setEnabled(false); - -// Recuperation de toutes les zones decrites et notation de celles retenues - GetAllZones(); - ADAPT::listeZonesHypo_var mesZonesAvant = aHypothesis->GetZones(); - for (int i=0; ilength(); i++) - { - MESSAGE ("i"<rowCount(); j++) - { - MESSAGE (". j"<item(j,2)->text().toStdString()); - if ( TWZone->item(j,2)->text().toStdString() == string(mesZonesAvant[i]) ) - { - MESSAGE ("OK avec "<item( j,0 )->setCheckState( Qt::Checked ); - TWZone->item( j,1 )->setCheckState( Qt::Unchecked ); } - else - { - MESSAGE ("... DERA"); - TWZone->item( j,0 )->setCheckState( Qt::Unchecked ); - TWZone->item( j,1 )->setCheckState( Qt::Checked ); } - break; - } - } - i += 1 ; - } -// -// Inactivation des choix - for ( int j =0 ; j < TWZone->rowCount(); j++) - { - TWZone->item( j, 0 )->setFlags(0); - TWZone->item( j, 1 )->setFlags(0); - } - PBZoneNew->setVisible(0); -// - adjustSize(); -// -} -// ------------------------------------- -void MonEditHypothesis::InitAdaptChamps() -// ------------------------------------- -// Affichage des informations pour une adaptation selon un champ : -// . Nom du champ -// . Composantes -// . Seuils -// . Absolu/relatif -{ - MESSAGE ("Debut de InitAdaptChamps"); -// Choix des options generales - GBUniform->setVisible(0); - GBAreaManagement->setVisible(0); - GBFieldManagement->setVisible(1); - RBChamp->setChecked(true); - RBUniforme->setEnabled(false); - RBChamp->setEnabled(false); - RBZone->setEnabled(false); - - ADAPT::InfosHypo_var aInfosHypo = aHypothesis->GetField(); - _aFieldName = aInfosHypo->FieldName; - _TypeThR = aInfosHypo->TypeThR; - _ThreshR = aInfosHypo->ThreshR; - _TypeThC = aInfosHypo->TypeThC; - _ThreshC = aInfosHypo->ThreshC; - _UsField = aInfosHypo->UsField; - _UsCmpI = aInfosHypo->UsCmpI; - - CBFieldName->insertItem(0,_aFieldName); - CBFieldName->setCurrentIndex(0); - CBFieldName->setEnabled(false); - //SetFieldName(Qt::Unchecked); - - ADAPT::listeComposantsHypo_var mesComposantsAvant = aHypothesis->GetComps(); - TWCMP->clear(); - TWCMP->setRowCount(0); - TWCMP->resizeRowsToContents(); - for (int i=0; ilength(); i++) - { - TWCMP->insertRow(0); - TWCMP->setItem( 0, 0, new QTableWidgetItem( QString ("") ) ); - TWCMP->item( 0, 0 )->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled); - TWCMP->item( 0, 0 )->setCheckState(Qt::Checked ); - TWCMP->item( 0, 0 )->setFlags( 0 ); - TWCMP->setItem( 0, 1, new QTableWidgetItem(QString(mesComposantsAvant[i]).trimmed())); - TWCMP->item( 0, 1 )->setFlags( Qt::ItemIsEnabled |Qt::ItemIsSelectable ); - } - TWCMP->resizeColumnsToContents(); - TWCMP->resizeRowsToContents(); - TWCMP->clearSelection(); - - // Les seuils de raffinement - RBRAbs->setEnabled(false) ; - RBRRel->setEnabled(false) ; - RBRPE->setEnabled(false) ; - RBRMuSigma->setEnabled(false) ; - RBRNo->setEnabled(false) ; - if (_aTypeRaff== 0 ) - { - SetRNo(); - RBRNo->setEnabled(true) ; - } - else - { - if ( _TypeThR == 1 ) { SpinBox_RAbs->setValue(_ThreshR); SetRAbs(); RBRAbs->setEnabled(true);} - if ( _TypeThR == 2 ) { SpinBox_RRel->setValue(_ThreshR); SetRRel(); RBRRel->setEnabled(true);} - if ( _TypeThR == 3 ) { SpinBox_RPE->setValue(_ThreshR); SetRPE(); RBRPE->setEnabled(true);} - if ( _TypeThR == 4 ) { SpinBox_RMuSigma->setValue(_ThreshR); SetRMS(); RBRMuSigma->setEnabled(true);} - } - - // Les seuils de deraffinement - RBCAbs->setEnabled(false) ; - RBCRel->setEnabled(false) ; - RBCPE->setEnabled(false) ; - RBCMuSigma->setEnabled(false) ; - RBCNo->setEnabled(false) ; - if (_aTypeDera== 0 ) - { - SetCNo(); - RBCNo->setEnabled(true) ; - } - else - { - if ( _TypeThC == 1 ) { SpinBox_CAbs->setValue(_ThreshC); SetCAbs(); RBCAbs->setEnabled(true);} - if ( _TypeThC == 2 ) { SpinBox_CRel->setValue(_ThreshC); SetCRel(); RBCRel->setEnabled(true);} - if ( _TypeThC == 3 ) { SpinBox_CPE->setValue(_ThreshC); SetCPE(); RBCPE->setEnabled(true);} - if ( _TypeThC == 4 ) { SpinBox_CMuSigma->setValue(_ThreshC); SetCMS(); RBCMuSigma->setEnabled(true);} - } - // Le choix de la prise en compte des composantes - if ( TWCMP->rowCount() == 1 ) - { RBL2->setText(QObject::tr("HOM_HYPO_NORM_ABS")); - RBInf->setText(QObject::tr("HOM_HYPO_NORM_REL")); - } - else - { RBL2->setText(QObject::tr("HOM_HYPO_NORM_L2")); - RBInf->setText(QObject::tr("HOM_HYPO_NORM_INF")); - } - if ( _UsField == 0 ) { CBJump->hide(); } - else - { - CBJump->setChecked(true); - CBJump->setEnabled(false); - } - if ( _UsCmpI == 0 ) - { - RBL2->setChecked(true); - RBL2->setEnabled(true); - RBInf->setEnabled(false) ; - } - else - { - RBL2->setEnabled(false) ; - RBInf->setChecked(true); - RBInf->setEnabled(true); - } -// - adjustSize(); -} -// ------------------------------------- -void MonEditHypothesis::InitFieldInterp() -// ------------------------------------- -// Affichage des informations pour les interpolations -{ - MESSAGE ("Debut de InitFieldInterp"); -// Choix des options generales - _TypeFieldInterp = aHypothesis->GetTypeFieldInterp(); - MESSAGE ("_TypeFieldInterp = " << _TypeFieldInterp); -// -// Aucune interpolation - if ( _TypeFieldInterp == 0 ) - { - RBFieldNo->setChecked(true); - TWField->setVisible(0); - } -// Interpolation de tous les champs - if ( _TypeFieldInterp == 1 ) - { - RBFieldAll->setChecked(true); - TWField->setVisible(0); - } -// Interpolation de champs choisis - if ( _TypeFieldInterp == 2 ) - { - RBFieldChosen->setChecked(true); -// - TWField->setVisible(1); - ADAPT::listeFieldInterpsHypo_var mesChampsAvant = aHypothesis->GetFieldInterps(); - TWField->clear(); - TWField->setRowCount(0); - TWField->resizeRowsToContents(); - for (int iaux=0; iauxlength(); iaux++) - { - TWField->insertRow(0); - TWField->setItem( 0, 0, new QTableWidgetItem( QString ("") ) ); - TWField->item( 0, 0 )->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled); - TWField->item( 0, 0 )->setCheckState(Qt::Checked ); - TWField->item( 0, 0 )->setFlags( 0 ); - TWField->setItem( 0, 1, new QTableWidgetItem(QString(mesChampsAvant[iaux]).trimmed())); - TWField->item( 0, 1 )->setFlags( Qt::ItemIsEnabled |Qt::ItemIsSelectable ); - iaux++; - } - TWField->resizeColumnsToContents(); - TWField->resizeRowsToContents(); - TWField->clearSelection(); - } - RBFieldNo->setEnabled(false) ; - RBFieldAll->setEnabled(false) ; - RBFieldChosen->setEnabled(false) ; -} - -// ------------------------------------- -bool MonEditHypothesis::PushOnApply() -// ------------------------------------- -{ -// Pour du raffinement selon un champ, les seuils ont-ils change ? - if ( _aTypeAdap == 1 ) - { - if (_aTypeRaff!= 0 ) - { - if (_TypeThR == 1) { _ThreshR = SpinBox_RAbs->value(); } - if (_TypeThR == 2) { _ThreshR = SpinBox_RRel->value(); } - if (_TypeThR == 3) { _ThreshR = SpinBox_RPE->value(); } - if (_TypeThR == 4) { _ThreshR = SpinBox_RMuSigma->value(); } - aHypothesis->SetRefinThr(_TypeThR, _ThreshR) ; - } - if (_aTypeDera!= 0 ) - { - if (_TypeThC == 1) { _ThreshC = SpinBox_CAbs->value() ; } - if (_TypeThC == 2) { _ThreshC = SpinBox_CRel->value() ; } - if (_TypeThC == 3) { _ThreshC = SpinBox_CPE->value() ; } - if (_TypeThC == 4) { _ThreshC = SpinBox_CMuSigma->value() ; } - aHypothesis->SetUnRefThr(_TypeThC, _ThreshC) ; - } - - myAdaptGen->InvalideHypo(_Name.toStdString().c_str()); - HOMARD_UTILS::updateObjBrowser(); - } - return true; -}; -// ------------------------------------------------------------------------ -void MonEditHypothesis::SetFiltrage() -// ------------------------------------------------------------------------ -{ - if (CBGroupe->isChecked()) - { - MonEditListGroup *aDlg = new MonEditListGroup(this, NULL, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen),_aCaseName, _aListeGroupes) ; - aDlg->show(); - } -} - diff --git a/src/ADAPTGUI/MonEditHypothesis.h b/src/ADAPTGUI/MonEditHypothesis.h deleted file mode 100644 index ef5a3e592..000000000 --- a/src/ADAPTGUI/MonEditHypothesis.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_EDITHYPOTHESIS_H -#define MON_EDITHYPOTHESIS_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) - -#include - -class HOMARD_EXPORT MonEditHypothesis : public MonCreateHypothesis -{ - Q_OBJECT -public: - MonEditHypothesis( MonCreateIteration* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString caseName, QString Name, QString aFieldFile ); - virtual ~MonEditHypothesis(); - -protected : - virtual void InitValEdit(); - virtual void InitAdaptUniforme(); - virtual void InitAdaptZone(); - virtual void InitAdaptChamps(); - virtual void InitGroupes(); - virtual void InitFieldInterp(); - virtual void SetFiltrage(); - virtual bool PushOnApply(); - -public slots: - -}; - -#endif diff --git a/src/ADAPTGUI/MonEditIteration.cxx b/src/ADAPTGUI/MonEditIteration.cxx deleted file mode 100644 index 8e75e0f6e..000000000 --- a/src/ADAPTGUI/MonEditIteration.cxx +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonEditIteration.h" - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include "HomardQtCommun.h" -#include - -using namespace std; - -// ------------------------------------------------------------------------------------------------------------------------------------- -MonEditIteration::MonEditIteration ( QWidget* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString IterParentName, QString IterName ): -// ------------------------------------------------------------------------------------------------------------------------------------- -/* Constructs a MonEditIteration - herite de MonCreateIteration -*/ - MonCreateIteration(parent, modal, myAdaptGen, IterParentName), - _rank(-1), _step(-1), _IterationName(""), _FieldFile(""),_aTypeAdap() -{ - MESSAGE("Debut de MonEditIteration" << IterName.toStdString().c_str()); - setWindowTitle(QObject::tr("HOM_ITER_EDIT_WINDOW_TITLE")); - _IterationName = IterName; - aIter = myAdaptGen->GetIteration(_IterationName.toStdString().c_str()); - -// Attention au cas ou c'est une iteration initiale : il faut inhiber l'essentiel - int etat = aIter->GetState() ; - if ( etat <= 0 ) { InitValEdit0(etat); } - else { InitValEdit(); } -} -// ------------------------------ -MonEditIteration::~MonEditIteration() -// ------------------------------ -{ -} - -// ------------------------------ -void MonEditIteration::InitValEdit0(int etat) -// ------------------------------ -// Cas d'une iteration initiale d'un cas (initial ou poursuite) -{ -// - LEName->setText(_IterationName); - LEName->setReadOnly(true); - -// Invisibilite de l'iteration parent - Iter_Parent->setVisible(0); - PBIterParent->setVisible(0); - LEIterationParentName->setVisible(0); - -// Affichage bloque du nom du maillage de l'iteration courante - QString MeshName = aIter->GetMeshName(); - Mesh_n->setText(QObject::tr("HOM_ITER_STARTING_POINT_0")); - LEMeshName_n->setText(MeshName); - LEMeshName_n->setReadOnly(1); - -// Message general - if ( etat == 0 ) { Mesh_np1->setText(QObject::tr("HOM_ITER_STARTING_POINT_1")) ; } - else { Mesh_np1->setText(QObject::tr("HOM_ITER_STARTING_POINT_2")) ; } - LEMeshName_np1->setVisible(0); -// -// Invisibilite des hypotheses et des champs - Hypothese->setVisible(0); - GBField->setVisible(0); -// -} -// ------------------------------ -void MonEditIteration::InitValEdit() -// ------------------------------ -// Cas d'une iteration courante -{ -// Affichage bloque du nom de l'iteration - LEName->setText(_IterationName); - LEName->setReadOnly(true); - - // Affichage bloque du nom de l'iteration parent - _IterParentName = aIter->GetIterParentName(); - LEIterationParentName->setText(_IterParentName); - LEIterationParentName->setReadOnly(true); - PBIterParent->setEnabled(false); - PBIterParent->setVisible(0); - - // Affichage bloque du nom du maillage de l'iteration parent - aIterParent = myAdaptGen->GetIteration(_IterParentName.toStdString().c_str()); - QString MeshNameParent = aIterParent->GetMeshName(); - LEMeshName_n->setText(MeshNameParent); - LEMeshName_n->setReadOnly(1); - - // Affichage bloque du nom du maillage de l'iteration courante - QString MeshName = aIter->GetMeshName(); - LEMeshName_np1->setText(MeshName); - LEMeshName_np1->setReadOnly(1); - - // Affichage de la bonne hypothese - QString HypoName = aIter->GetHypoName(); - CBHypothese->insertItem(0,HypoName); - CBHypothese->setCurrentIndex(0); - CBHypothese->setEnabled(false); - PBHypoNew->setVisible(0); - - // Pour une adaptation selon un champ - ADAPT::HOMARD_Hypothesis_var myHypo = myAdaptGen->GetHypothesis(HypoName.toStdString().c_str()) ; - _aTypeAdap = myHypo->GetAdapType() ; - if ( _aTypeAdap == 1 ) - { - _FieldFile = aIter->GetFieldFile(); - LEFieldFile->setText(_FieldFile); - _step = aIter->GetTimeStep() ; - SpinBox_TimeStep->setValue(_step); - _rank = aIter->GetRank() ; - SpinBox_Rank->setValue(_rank); - - // Cas ou on prend le dernier pas de temps ou sans pas de temps - if ( _step <= -1 ) - { - Rank->setVisible(0); - SpinBox_Rank->setVisible(0); - TimeStep->setVisible(0); - SpinBox_TimeStep->setVisible(0); - - if ( _step == -2 ) { RBLast->setChecked(true); } - else { RBNo->setChecked(true); } - } - - // Cas avec pas de temps - else - { - Rank->setVisible(1); - SpinBox_Rank->setVisible(1); - TimeStep->setVisible(1); - SpinBox_TimeStep->setVisible(1); - RBChosen->setChecked(true); - } - } - else - { - GBField->setVisible(0); - } -// - adjustSize(); -// -} - -// ------------------------------------- -bool MonEditIteration::PushOnApply() -// ------------------------------------- -{ - if ( _aTypeAdap == 1) - { -// Pour du raffinement selon un champ, les instants ont-ils change ? - if ( (_FieldFile != LEFieldFile->text().trimmed()) || - ( _rank != SpinBox_Rank->value()) || - ( _step != SpinBox_TimeStep->value())) - { - _FieldFile = LEFieldFile->text().trimmed(); - aIter->SetFieldFile(CORBA::string_dup(_FieldFile.toStdString().c_str())); - _rank = SpinBox_Rank->value(); - _step = SpinBox_TimeStep->value(); - if ( _step == -2 ) { aIter->SetTimeStepRankLast(); } - else { aIter->SetTimeStepRank(_step, _rank); } - myAdaptGen->InvalideIter(_IterationName.toStdString().c_str()); - HOMARD_UTILS::updateObjBrowser(); - } - } - return true; - -}; diff --git a/src/ADAPTGUI/MonEditIteration.h b/src/ADAPTGUI/MonEditIteration.h deleted file mode 100644 index 76abc6025..000000000 --- a/src/ADAPTGUI/MonEditIteration.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_EDITITERATION_H -#define MON_EDITITERATION_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) - -#include - -class HOMARD_EXPORT MonEditIteration : public MonCreateIteration -{ - Q_OBJECT -public: - MonEditIteration( QWidget* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString IterParentName, QString Name ); - virtual ~MonEditIteration(); - -protected : - QString _FieldFile ; - QString _IterationName ; - int _aTypeAdap ; - int _rank ; - int _step ; - - virtual void InitValEdit(); - virtual void InitValEdit0(int etat); - virtual bool PushOnApply(); - -public slots: - -}; - -#endif diff --git a/src/ADAPTGUI/MonEditListGroup.cxx b/src/ADAPTGUI/MonEditListGroup.cxx deleted file mode 100644 index c931c7ba7..000000000 --- a/src/ADAPTGUI/MonEditListGroup.cxx +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonEditListGroup.h" -#include - -using namespace std; -//--------------------------------------------------------------------- -MonEditListGroup::MonEditListGroup( MonCreateHypothesis* parentHyp, - MonCreateBoundaryDi* parentBound, - bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString aCaseName, - QStringList listeGroupesHypo): -//--------------------------------------------------------------------- -MonCreateListGroup(parentHyp,parentBound,myAdaptGen,aCaseName,listeGroupesHypo) -{ - MESSAGE("Debut de MonEditListGroup"); - setWindowTitle(QObject::tr("HOM_GROU_EDIT_WINDOW_TITLE")); - setModal(true); - InitGroupes(); -} - -//------------------------------------ -MonEditListGroup:: ~MonEditListGroup() -//------------------------------------ -{ -} -// ------------------------------------- -void MonEditListGroup:: InitGroupes() -// ------------------------------------- -{ - for (int i = 0; i < _listeGroupesHypo.size(); i++ ) - { - std::cerr << _listeGroupesHypo[i].toStdString().c_str() << std::endl; - TWGroupe->insertRow(i); - TWGroupe->setItem( i, 0, new QTableWidgetItem( QString ("") ) ); - TWGroupe->item( i, 0 )->setFlags( 0 ); - TWGroupe->item( i, 0 )->setCheckState( Qt::Checked ); - TWGroupe->setItem( i, 1, new QTableWidgetItem(_listeGroupesHypo[i])); - } - TWGroupe->resizeRowsToContents(); -} - - diff --git a/src/ADAPTGUI/MonEditListGroup.h b/src/ADAPTGUI/MonEditListGroup.h deleted file mode 100644 index 0e90cf837..000000000 --- a/src/ADAPTGUI/MonEditListGroup.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_EDITLISTGROUP_H -#define MON_EDITLISTGROUP_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) - -#include - -class MonCreateHypothesis; -class MonCreateBoundaryDi; -class HOMARD_EXPORT MonEditListGroup : public MonCreateListGroup -{ - Q_OBJECT - -public: - MonEditListGroup( MonCreateHypothesis* parentHyp, MonCreateBoundaryDi* parentBound, bool modal, ADAPT::ADAPT_Gen_var myAdaptGen, QString aCaseName, QStringList listeGroupesHypo); - virtual ~MonEditListGroup(); - -protected : - - virtual void InitGroupes(); - -}; - -#endif // MON_EDITLISTGROUP_H diff --git a/src/ADAPTGUI/MonEditListGroupCAO.cxx b/src/ADAPTGUI/MonEditListGroupCAO.cxx deleted file mode 100644 index c29d2288c..000000000 --- a/src/ADAPTGUI/MonEditListGroupCAO.cxx +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonEditListGroupCAO.h" -#include - -using namespace std; -//--------------------------------------------------------------------- -MonEditListGroupCAO::MonEditListGroupCAO( MonCreateHypothesis* parentHyp, - MonCreateBoundaryCAO* parentBound, - bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString aCaseName, - QStringList listeGroupesHypo): -//--------------------------------------------------------------------- -MonCreateListGroupCAO(parentHyp,parentBound,myAdaptGen,aCaseName,listeGroupesHypo) -{ - MESSAGE("Debut de MonEditListGroupCAO"); - setWindowTitle(QObject::tr("HOM_GROU_EDIT_WINDOW_TITLE")); - setModal(true); - InitGroupes(); -} - -//------------------------------------ -MonEditListGroupCAO:: ~MonEditListGroupCAO() -//------------------------------------ -{ -} -// ------------------------------------- -void MonEditListGroupCAO:: InitGroupes() -// ------------------------------------- -{ - for (int i = 0; i < _listeGroupesHypo.size(); i++ ) - { - std::cerr << _listeGroupesHypo[i].toStdString().c_str() << std::endl; - TWGroupe->insertRow(i); - TWGroupe->setItem( i, 0, new QTableWidgetItem( QString ("") ) ); - TWGroupe->item( i, 0 )->setFlags( 0 ); - TWGroupe->item( i, 0 )->setCheckState( Qt::Checked ); - TWGroupe->setItem( i, 1, new QTableWidgetItem(_listeGroupesHypo[i])); - } - TWGroupe->resizeRowsToContents(); -} - - diff --git a/src/ADAPTGUI/MonEditListGroupCAO.h b/src/ADAPTGUI/MonEditListGroupCAO.h deleted file mode 100644 index a32d87402..000000000 --- a/src/ADAPTGUI/MonEditListGroupCAO.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_EDITLISTGROUPCAO_H -#define MON_EDITLISTGROUPCAO_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) - -#include - -class MonCreateHypothesis; -class MonCreateBoundaryCAO; -class HOMARD_EXPORT MonEditListGroupCAO : public MonCreateListGroupCAO -{ - Q_OBJECT - -public: - MonEditListGroupCAO( MonCreateHypothesis* parentHyp, MonCreateBoundaryCAO* parentBound, bool modal, ADAPT::ADAPT_Gen_var myAdaptGen, QString aCaseName, QStringList listeGroupesHypo); - virtual ~MonEditListGroupCAO(); - -protected : - - virtual void InitGroupes(); - -}; - -#endif // MON_EDITLISTGROUPCAO_H diff --git a/src/ADAPTGUI/MonEditYACS.cxx b/src/ADAPTGUI/MonEditYACS.cxx deleted file mode 100644 index 3b346ed2d..000000000 --- a/src/ADAPTGUI/MonEditYACS.cxx +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonEditYACS.h" - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include "HomardQtCommun.h" -#include - -using namespace std; - -// ------------------------------------------------------------- -/* Constructs a MonEditYACS - herite de MonCreateYACS -*/ -// ------------------------------------------------------------- -MonEditYACS::MonEditYACS ( bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString Name ): - MonCreateYACS(myAdaptGen, Name) -{ - MESSAGE("Debut de MonEditYACS" << Name.toStdString().c_str()); - setWindowTitle(QObject::tr("HOM_YACS_EDIT_WINDOW_TITLE")); - _Name = Name; - aYACS = myAdaptGen->GetYACS(_Name.toStdString().c_str()); - InitValEdit(); -} -// ------------------------------ -MonEditYACS::~MonEditYACS() -// ------------------------------ -{ -} -// ------------------------------ -void MonEditYACS::InitValEdit() -// ------------------------------ -{ - MESSAGE("InitValEdit"); - LEName->setText(_Name); - LEName->setReadOnly(true); - - _aCaseName = aYACS->GetCaseName(); - LECaseName->setText(_aCaseName); - LECaseName->setReadOnly(true); - PBCaseName->setVisible(0); - - _aScriptFile = aYACS->GetScriptFile(); - LEScriptFile->setText(_aScriptFile); - - _aDirName = aYACS->GetDirName(); - LEDirName->setText(_aDirName); - LEDirName->setReadOnly(true); - - _aMeshFile = aYACS->GetMeshFile(); - LEMeshFile->setText(_aMeshFile); - - _Type=aYACS->GetType(); - if(_Type==1) { RBConstant->setChecked(true); } - else { RBVariable->setChecked(true); }; - RBConstant->setEnabled(false); - RBVariable->setEnabled(false); - - _MaxIter = aYACS->GetMaxIter(); - SpinBoxMaxIter->setValue(_MaxIter) ; - _MaxNode = aYACS->GetMaxNode(); - SpinBoxMaxNode->setValue(_MaxNode) ; - _MaxElem = aYACS->GetMaxElem(); - SpinBoxMaxElem->setValue(_MaxElem) ; -// -} - -// --------------------------------------------------- -bool MonEditYACS:: CreateOrUpdate() -//---------------------------------------------------- -// Edition/modification du schema -{ - MESSAGE("CreateOrUpdate"); - bool chgt = false ; - int valeur_i ; - // A. Recuperation et comparaison des valeurs - // A.1. Le script de lancement - QString aScriptFile=LEScriptFile->text().trimmed(); - if ( aScriptFile != _aScriptFile ) - { -// MESSAGE("modification de ScriptFile : "<<_aScriptFile.toStdString()<<" devient "<SetScriptFile(CORBA::string_dup(_aScriptFile.toStdString().c_str())) ; - chgt = true ; - } - // A.2. Le maillage initial - QString aMeshFile=LEMeshFile->text().trimmed(); - if ( aMeshFile != _aMeshFile ) - { -// MESSAGE("modification de aMeshFile : "<<_aMeshFile.toStdString()<<" devient "<SetMeshFile(CORBA::string_dup(_aMeshFile.toStdString().c_str())) ; - chgt = true ; - } - // A.3. La convergence - valeur_i = SpinBoxMaxIter->value() ; - if ( valeur_i != _MaxIter ) - { -// MESSAGE("modification de MaxIter : "<<_MaxIter<<" devient "<SetMaxIter(_MaxIter) ; - chgt = true ; - } - valeur_i = SpinBoxMaxNode->value() ; - if ( valeur_i != _MaxNode ) - { -// MESSAGE("modification de MaxNode : "<<_MaxNode<<" devient "<SetMaxNode(_MaxNode) ; - chgt = true ; - } - valeur_i = SpinBoxMaxElem->value() ; - if ( valeur_i != _MaxElem ) - { -// MESSAGE("modification de MaxElem : "<<_MaxElem<<" devient "<SetMaxElem(_MaxElem) ; - chgt = true ; - } -// B. Si changement - if ( chgt ) - { - myAdaptGen->InvalideYACS(_Name.toStdString().c_str()); - } - - HOMARD_UTILS::updateObjBrowser(); - return true ; -} diff --git a/src/ADAPTGUI/MonEditYACS.h b/src/ADAPTGUI/MonEditYACS.h deleted file mode 100644 index ddb1b5dcc..000000000 --- a/src/ADAPTGUI/MonEditYACS.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_EDITYACS_H -#define MON_EDITYACS_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) - -#include - -class HOMARD_EXPORT MonEditYACS : public MonCreateYACS -{ - Q_OBJECT -public: - MonEditYACS( bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString Name ); - virtual ~MonEditYACS(); - -protected : - virtual void InitValEdit(); - virtual bool CreateOrUpdate(); - -public slots: - -}; - -#endif diff --git a/src/ADAPTGUI/MonEditZone.cxx b/src/ADAPTGUI/MonEditZone.cxx deleted file mode 100644 index c2ec454f7..000000000 --- a/src/ADAPTGUI/MonEditZone.cxx +++ /dev/null @@ -1,432 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonEditZone.h" - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include -#include -#include -#include -#include -#include - -using namespace std; - -// ------------------------------------------------------------------------ -MonEditZone::MonEditZone( MonCreateHypothesis* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString caseName, QString Name ): -// ------------------------------------------------------------------------ -/* Constructs a MonEditZone - herite de MonCreateZone -*/ - MonCreateZone(parent, myAdaptGen, caseName) -{ - MESSAGE("Debut de MonEditZone pour " << Name.toStdString().c_str()); - setWindowTitle(QObject::tr("HOM_ZONE_EDIT_WINDOW_TITLE")); - _Name=Name; - aZone = myAdaptGen->GetZone(_Name.toStdString().c_str()); - InitValEdit(); -} -// ------------------------------------------------------------------------ -MonEditZone::~MonEditZone() -// ------------------------------------------------------------------------ -{ - // no need to delete child widgets, Qt does it all for us -} -// ------------------------------------------------------------------------ -void MonEditZone::InitValEdit() -// ------------------------------------------------------------------------ -{ - MESSAGE("InitValEdit "); - LEName->setText(_Name); - LEName->setReadOnly(true); - _Type = aZone->GetType(); - MESSAGE("InitValEdit _Type ="<<_Type); - InitValZoneLimit(); - if (_aCaseName != QString("")) InitValZone(); - switch (_Type) - { - case 11 : // il s agit d un rectangle - { } - case 12 : // il s agit d un rectangle - { } - case 13 : // il s agit d un rectangle - { } - case 2 : // il s agit d une boite - { - InitValZoneBox(); - SetBox(); - break; - } - case 4 : // il s agit d une sphere - { - InitValZoneSphere(); - SetSphere(); - break; - } - case 31 : // il s agit d un cercle issu d'un cylindre - { } - case 32 : // il s agit d un cercle issu d'un cylindre - { } - case 33 : // il s agit d un cercle issu d'un cylindre - { } - case 5 : // il s agit d un cylindre - { - InitValZoneCylinder(); - SetCylinder(); - break; - } - case 61 : // il s agit d un disque avec trou issu d'un tuyau - { } - case 62 : // il s agit d un disque avec trou issu d'un tuyau - { } - case 63 : // il s agit d un disque avec trou issu d'un tuyau - { } - case 7 : // il s agit d un tuyau - { - InitValZonePipe(); - SetPipe(); - break; - } - }; -} -// ------------------------------------------------------------------------ -void MonEditZone::InitValZoneLimit() -// ------------------------------------------------------------------------ -{ - ADAPT::double_array_var mesCoordLimits = aZone->GetLimit(); - ASSERT(mesCoordLimits->length() == 3 ); - _Xincr=mesCoordLimits[0]; - _Yincr=mesCoordLimits[1]; - _Zincr=mesCoordLimits[2]; -} -// ------------------------------------------------------------------------ -void MonEditZone::InitValZoneBox() -// ------------------------------------------------------------------------ -{ - ADAPT::double_array_var mesCoordZones = aZone->GetCoords(); - ASSERT(mesCoordZones->length() == 6 ); - _ZoneXmin=mesCoordZones[0]; - _ZoneXmax=mesCoordZones[1]; - _ZoneYmin=mesCoordZones[2]; - _ZoneYmax=mesCoordZones[3]; - _ZoneZmin=mesCoordZones[4]; - _ZoneZmax=mesCoordZones[5]; -} -// ------------------------------------------------------------------------ -void MonEditZone::InitValZoneSphere() -// ------------------------------------------------------------------------ -{ - ADAPT::double_array_var mesCoordZones = aZone->GetCoords(); - ASSERT(mesCoordZones->length() == 4 ); - _ZoneXcentre=mesCoordZones[0]; - _ZoneYcentre=mesCoordZones[1]; - _ZoneZcentre=mesCoordZones[2]; - _ZoneRayon=mesCoordZones[3]; - -} -// ------------------------------------------------------------------------ -void MonEditZone::InitValZoneCylinder() -// ------------------------------------------------------------------------ -{ - ADAPT::double_array_var mesCoordZones = aZone->GetCoords(); - ASSERT(mesCoordZones->length() == 8 ); - _ZoneXcentre=mesCoordZones[0]; - _ZoneYcentre=mesCoordZones[1]; - _ZoneZcentre=mesCoordZones[2]; - _ZoneXaxis=mesCoordZones[3]; - _ZoneYaxis=mesCoordZones[4]; - _ZoneZaxis=mesCoordZones[5]; - _ZoneRayon=mesCoordZones[6]; - _ZoneHaut=mesCoordZones[7]; -} -// ------------------------------------------------------------------------ -void MonEditZone::InitValZonePipe() -// ------------------------------------------------------------------------ -{ - ADAPT::double_array_var mesCoordZones = aZone->GetCoords(); - ASSERT(mesCoordZones->length() == 9 ); - _ZoneXcentre=mesCoordZones[0]; - _ZoneYcentre=mesCoordZones[1]; - _ZoneZcentre=mesCoordZones[2]; - _ZoneXaxis=mesCoordZones[3]; - _ZoneYaxis=mesCoordZones[4]; - _ZoneZaxis=mesCoordZones[5]; - _ZoneRayon=mesCoordZones[6]; - _ZoneHaut=mesCoordZones[7]; - _ZoneRayonInt=mesCoordZones[8]; -} -// ------------------------------------------------------------------------ -void MonEditZone::SetBox() -// ------------------------------------------------------------------------ -{ - MESSAGE("SetBox "); - gBBox->setVisible(1); - gBSphere->setVisible(0); - gBCylindre->setVisible(0) ; - gBPipe->setVisible(0) ; - RBBox->setChecked(1); - adjustSize(); - RBCylinder->setDisabled(true); - RBPipe->setDisabled(true); - if ( _Type == 2 ) { RBSphere->setDisabled(true); } - else { RBSphere->setVisible(0); - RBPipe->setText(QApplication::translate("CreateZone", "Disk with hole", 0)); - RBCylinder->setText(QApplication::translate("CreateZone", "Disk", 0)); - SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr() ; - QPixmap pix = resMgr->loadPixmap( "HOMARD", "boxdxy.png" ) ; - QIcon IS=QIcon(pix) ; - RBBox->setIcon(IS) ; } - adjustSize(); - - SpinBox_Xmini->setValue(_ZoneXmin); - SpinBox_Xmaxi->setValue(_ZoneXmax); - - double incr ; - if ( _Xincr > 0 ) {incr=_Xincr;} else{incr=1.;} - SpinBox_Xmini->setSingleStep(incr); - SpinBox_Xmaxi->setSingleStep(incr); - - SpinBox_Ymini->setValue(_ZoneYmin); - SpinBox_Ymaxi->setValue(_ZoneYmax); - if ( _Yincr > 0 ) {incr=_Yincr;} else{incr=1.;} - SpinBox_Ymini->setSingleStep(incr); - SpinBox_Ymaxi->setSingleStep(incr); - - SpinBox_Zmini->setValue(_ZoneZmin); - SpinBox_Zmaxi->setValue(_ZoneZmax); - if ( _Zincr > 0 ) {incr=_Zincr;} else{incr=1.;} - SpinBox_Zmini->setSingleStep(incr); - SpinBox_Zmaxi->setSingleStep(incr); - - if ( _Type == 12 ) { SpinBox_Xmini->setDisabled(true) ; - SpinBox_Xmaxi->setDisabled(true) ; } - else if ( _Type == 13 ) { SpinBox_Ymini->setDisabled(true) ; - SpinBox_Ymaxi->setDisabled(true) ; } - else if ( _Type == 11 ) { SpinBox_Zmini->setDisabled(true) ; - SpinBox_Zmaxi->setDisabled(true) ; } - -} -// ------------------------------------------------------------------------ -void MonEditZone::SetSphere() -// ------------------------------------------------------------------------ -{ - gBBox->setVisible(0); - gBSphere->setVisible(1); - gBCylindre->setVisible(0) ; - gBPipe->setVisible(0) ; - RBSphere->setChecked(1); - RBBox->setDisabled(true); - RBCylinder->setDisabled(true); - RBPipe->setDisabled(true); - adjustSize(); - - SpinBox_Xcentre->setValue(_ZoneXcentre); - if ( _Xincr > 0) { SpinBox_Xcentre->setSingleStep(_Xincr); } - else { SpinBox_Xcentre->setSingleStep(1) ; } - - SpinBox_Ycentre->setValue(_ZoneYcentre); - if ( _Yincr > 0) { SpinBox_Ycentre->setSingleStep(_Yincr); } - else { SpinBox_Ycentre->setSingleStep(1) ; } - - SpinBox_Zcentre->setValue(_ZoneZcentre); - if ( _Zincr > 0) { SpinBox_Zcentre->setSingleStep(_Zincr); } - else { SpinBox_Zcentre->setSingleStep(1);} - - SpinBox_Rayon->setValue(_ZoneRayon); -} -// ------------------------------------------------------------------------ -void MonEditZone::SetCylinder() -// ------------------------------------------------------------------------ -{ - MESSAGE("SetCylinder _Xincr ="<<_Xincr<< " _Yincr ="<<_Yincr<< " _Zincr ="<<_Zincr); - gBBox->setVisible(0); - gBSphere->setVisible(0); - gBCylindre->setVisible(1) ; - gBPipe->setVisible(0) ; - RBCylinder->setChecked(1); - RBBox->setDisabled(true); - RBPipe->setDisabled(true); - if ( _Type == 5 ) { RBSphere->setDisabled(true); } - else { RBSphere->setVisible(0); - RBPipe->setText(QApplication::translate("CreateZone", "Disk with hole", 0)); - RBCylinder->setText(QApplication::translate("CreateZone", "Disk", 0)); - TLXbase->setText(QApplication::translate("CreateZone", "X centre", 0)); - TLYbase->setText(QApplication::translate("CreateZone", "Y centre", 0)); - TLZbase->setText(QApplication::translate("CreateZone", "Z centre", 0)); - SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr() ; - QPixmap pix = resMgr->loadPixmap( "HOMARD", "disk.png" ) ; - QIcon IS=QIcon(pix) ; - RBCylinder->setIcon(IS) ; } - adjustSize(); - - SpinBox_Xbase->setValue(_ZoneXcentre); - if ( _Xincr > 0) { SpinBox_Xbase->setSingleStep(_Xincr); } - else { SpinBox_Xbase->setSingleStep(1) ; } - - SpinBox_Ybase->setValue(_ZoneYcentre); - if ( _Yincr > 0) { SpinBox_Ybase->setSingleStep(_Yincr); } - else { SpinBox_Ybase->setSingleStep(1) ; } - - SpinBox_Zbase->setValue(_ZoneZcentre); - if ( _Zincr > 0) { SpinBox_Zbase->setSingleStep(_Zincr); } - else { SpinBox_Zbase->setSingleStep(1) ;} - - SpinBox_Radius->setValue(_ZoneRayon); - - if ( _Type == 5 ) - { SpinBox_Xaxis->setValue(_ZoneXaxis) ; - SpinBox_Yaxis->setValue(_ZoneYaxis) ; - SpinBox_Zaxis->setValue(_ZoneZaxis) ; - SpinBox_Haut->setValue(_ZoneHaut) ; - } - else - { SpinBox_Xaxis->setVisible(0) ; - SpinBox_Yaxis->setVisible(0) ; - SpinBox_Zaxis->setVisible(0) ; - SpinBox_Haut->setVisible(0) ; - TLXaxis->setVisible(0) ; - TLYaxis->setVisible(0) ; - TLZaxis->setVisible(0) ; - TLHaut->setVisible(0) ; - if ( _Type == 32 ) { SpinBox_Xbase->setDisabled(true) ; } - else if ( _Type == 33 ) { SpinBox_Ybase->setDisabled(true) ; } - else if ( _Type == 31 ) { SpinBox_Zbase->setDisabled(true) ; } - } -} -// ------------------------------------------------------------------------ -void MonEditZone::SetPipe() -// ------------------------------------------------------------------------ -{ - MESSAGE("SetPipe _Xincr ="<<_Xincr<< " _Yincr ="<<_Yincr<< " _Zincr ="<<_Zincr); - gBBox->setVisible(0); - gBSphere->setVisible(0); - gBCylindre->setVisible(0) ; - gBPipe->setVisible(1) ; - RBPipe->setChecked(1); - RBBox->setDisabled(true); - RBCylinder->setDisabled(true); - if ( _Type == 7 ) { RBSphere->setDisabled(true); } - else { RBSphere->setVisible(0); - RBPipe->setText(QApplication::translate("CreateZone", "Disk with hole", 0)); - RBCylinder->setText(QApplication::translate("CreateZone", "Disk", 0)); - TLXbase_p->setText(QApplication::translate("CreateZone", "X centre", 0)); - TLYbase_p->setText(QApplication::translate("CreateZone", "Y centre", 0)); - TLZbase_p->setText(QApplication::translate("CreateZone", "Z centre", 0)); - SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr() ; - QPixmap pix = resMgr->loadPixmap( "HOMARD", "diskwithhole.png" ) ; - QIcon IS=QIcon(pix) ; - RBPipe->setIcon(IS) ; } - adjustSize(); - - SpinBox_Xbase_p->setValue(_ZoneXcentre); - if ( _Xincr > 0) { SpinBox_Xbase_p->setSingleStep(_Xincr); } - else { SpinBox_Xbase_p->setSingleStep(1) ; } - - SpinBox_Ybase_p->setValue(_ZoneYcentre); - if ( _Yincr > 0) { SpinBox_Ybase_p->setSingleStep(_Yincr); } - else { SpinBox_Ybase_p->setSingleStep(1) ; } - - SpinBox_Zbase_p->setValue(_ZoneZcentre); - if ( _Zincr > 0) { SpinBox_Zbase_p->setSingleStep(_Zincr); } - else { SpinBox_Zbase_p->setSingleStep(1) ;} - - SpinBox_Radius_int->setValue(_ZoneRayonInt); - SpinBox_Radius_ext->setValue(_ZoneRayon); - - if ( _Type == 7 ) - { SpinBox_Xaxis_p->setValue(_ZoneXaxis) ; - SpinBox_Yaxis_p->setValue(_ZoneYaxis) ; - SpinBox_Zaxis_p->setValue(_ZoneZaxis) ; - SpinBox_Haut_p->setValue(_ZoneHaut) ; - } - else - { SpinBox_Xaxis_p->setVisible(0) ; - SpinBox_Yaxis_p->setVisible(0) ; - SpinBox_Zaxis_p->setVisible(0) ; - SpinBox_Haut_p->setVisible(0) ; - TLXaxis_p->setVisible(0) ; - TLYaxis_p->setVisible(0) ; - TLZaxis_p->setVisible(0) ; - TLHaut_p->setVisible(0) ; - if ( _Type == 62 ) { SpinBox_Xbase_p->setDisabled(true) ; } - else if ( _Type == 63 ) { SpinBox_Ybase_p->setDisabled(true) ; } - else if ( _Type == 61 ) { SpinBox_Zbase_p->setDisabled(true) ; } - } -} - - -// --------------------------------------------------- -bool MonEditZone::CreateOrUpdateZone() -//---------------------------------------------------- -// Pas de Creation de la zone -// Mise a jour des attributs de la Zone -{ - try - { - switch (_Type) - { - case 11 : // il s agit d un rectangle - { } - case 12 : // il s agit d un rectangle - { } - case 13 : // il s agit d un rectangle - { } - case 2 : // il s agit d un parallelepipede - { aZone->SetBox( _ZoneXmin, _ZoneXmax, _ZoneYmin, _ZoneYmax, _ZoneZmin, _ZoneZmax ); - break; - } - case 4 : // il s agit d une sphere - { aZone->SetSphere( _ZoneXcentre, _ZoneYcentre, _ZoneZcentre, _ZoneRayon ); - break; - } - case 31 : // il s agit d un disque issu d'un cylindre - { } - case 32 : // il s agit d un disque issu d'un cylindre - { } - case 33 : // il s agit d un disque issu d'un cylindre - { } - case 5 : // il s agit d un cylindre - { aZone->SetCylinder( _ZoneXcentre, _ZoneYcentre, _ZoneZcentre, _ZoneXaxis, _ZoneYaxis, _ZoneZaxis, _ZoneRayon, _ZoneHaut ); - break; - } - case 61 : // il s agit d un disque issu d'un cylindre - { } - case 62 : // il s agit d un disque issu d'un cylindre - { } - case 63 : // il s agit d un disque issu d'un cylindre - { } - case 7 : // il s agit d un tuyau - { aZone->SetPipe( _ZoneXcentre, _ZoneYcentre, _ZoneZcentre, _ZoneXaxis, _ZoneYaxis, _ZoneZaxis, _ZoneRayon, _ZoneHaut, _ZoneRayonInt ); - break; - } - } - if (Chgt) myAdaptGen->InvalideZone(_Name.toStdString().c_str()); - HOMARD_UTILS::updateObjBrowser(); - } - catch( const SALOME::SALOME_Exception& S_ex ) { - SalomeApp_Tools::QtCatchCorbaException( S_ex ); - return false; - } - return true; -} - diff --git a/src/ADAPTGUI/MonEditZone.h b/src/ADAPTGUI/MonEditZone.h deleted file mode 100644 index c561f14d1..000000000 --- a/src/ADAPTGUI/MonEditZone.h +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_EDITZONE_H -#define MON_EDITZONE_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) - -#include - -class HOMARD_EXPORT MonEditZone : public MonCreateZone -{ - Q_OBJECT -public: - MonEditZone( MonCreateHypothesis* parent, bool modal, - ADAPT::ADAPT_Gen_var myAdaptGen, - QString caseName, QString Name); - virtual ~MonEditZone(); - -protected : - void SetBox(); - void SetSphere(); - void SetCylinder(); - void SetPipe(); - bool CreateOrUpdateZone(); - void InitValEdit(); - void InitValZoneLimit(); - void InitValZoneBox(); - void InitValZoneSphere(); - void InitValZoneCylinder(); - void InitValZonePipe(); - -public slots: - -}; - -#endif // MON_EDITZONE_H diff --git a/src/ADAPTGUI/MonIterInfo.cxx b/src/ADAPTGUI/MonIterInfo.cxx deleted file mode 100644 index 8d922f887..000000000 --- a/src/ADAPTGUI/MonIterInfo.cxx +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonIterInfo.h" - -#include -#include -#include -#include - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include "HomardQtCommun.h" -#include "MonEditFile.h" -#include - -using namespace std; - -// ----------------------------------------------------------------------------------------- -MonIterInfo::MonIterInfo(QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myAdaptGen0, QString IterName) -// ----------------------------------------------------------------------------------------- -/* Constructs a MonIterInfo - * Inherits from CasHomard - * Sets attributes to default values - */ - : - Ui_IterInfo(), - _IterName(IterName), - _aCaseName(""), - _BlockSize(0), - _Connection(0), - _Diametre(0), - _Entanglement(0), - _Quality(0), - _Option(-1) -{ - MESSAGE("appel de _duplicate"); - myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0); - setupUi(this); - setModal(modal); - InitConnect(); - - adjustSize(); -} - -// ------------------------------------------------------------------------ -MonIterInfo::~MonIterInfo() -// ------------------------------------------------------------------------ -{ - // no need to delete child widgets, Qt does it all for us -} -// ------------------------------------------------------------------------ -void MonIterInfo::InitConnect() -// ------------------------------------------------------------------------ -{ - MESSAGE("InitConnect"); - connect( CBBlockSize, SIGNAL(stateChanged(int)), this, SLOT(SetBlockSize())); - connect( CBConnection, SIGNAL(stateChanged(int)), this, SLOT(SetConnection())); - connect( CBDiametre, SIGNAL(stateChanged(int)), this, SLOT(SetDiametre())); - connect( CBEntanglement, SIGNAL(stateChanged(int)), this, SLOT(SetEntanglement())); - connect( CBQuality, SIGNAL(stateChanged(int)), this, SLOT(SetQuality())); - - connect( buttonOk, SIGNAL(pressed()), this, SLOT(PushOnOK())); - connect( buttonApply, SIGNAL(pressed()), this, SLOT(PushOnApply())); - connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); - connect( buttonHelp, SIGNAL(pressed()), this, SLOT(PushOnHelp())); -} -// ------------------------------- -bool MonIterInfo::PushOnApply() -// -------------------------------- -{ - MESSAGE("PushOnApply"); - - // Au moins une option a ete choisie - if ( ( _Quality == 0 ) && ( _Diametre == 0 ) && ( _Connection == 0 ) && ( _BlockSize == 0 ) && ( _Entanglement == 0 ) ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_MESH_INFO_1") ); - return false; - } - - // Recuperation de l'iteration - aIter = myAdaptGen->GetIteration(_IterName.toStdString().c_str()) ; - - // Lancement de l'analyse - try - { - aIter->MeshInfoOption( _Quality, _Diametre, _Connection, _BlockSize, _Entanglement, _Option ); - } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - return false; - } - - // Le bilan de l'analyse a afficher - QString aFileName = aIter->GetFileInfo() ; - MonEditFile *aDlg = new MonEditFile( 0, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), aFileName, 0 ) ; - if ( aDlg->_codret == 0 ) { aDlg->show(); } - - - HOMARD_UTILS::updateObjBrowser(); - return true; -} -// --------------------------- -void MonIterInfo::PushOnOK() -// --------------------------- -{ - bool bOK = PushOnApply(); - if ( bOK ) this->close(); -} -//------------------------------ -void MonIterInfo::PushOnHelp() -//------------------------------- -{ - std::string LanguageShort = myAdaptGen->GetLanguageShort(); - HOMARD_UTILS::PushOnHelp(QString("gui_mesh_info.html"), QString(""), QString(LanguageShort.c_str())); -} -// ------------------------------------------------------------------------ -void MonIterInfo::SetBlockSize() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetBlockSize "); - if ( CBBlockSize->isChecked() ) { _BlockSize = 1 ; } - else { _BlockSize = 0 ; } -} -// ------------------------------------------------------------------------ -void MonIterInfo::SetConnection() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetConnection "); - if ( CBConnection->isChecked() ) { _Connection = 1 ; } - else { _Connection = 0 ; } -} -// ------------------------------------------------------------------------ -void MonIterInfo::SetDiametre() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetDiametre "); - if ( CBDiametre->isChecked() ) { _Diametre = 1 ; } - else { _Diametre = 0 ; } -} -// ------------------------------------------------------------------------ -void MonIterInfo::SetEntanglement() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetEntanglement "); - if ( CBEntanglement->isChecked() ) { _Entanglement = 1 ; } - else { _Entanglement = 0 ; } -} -// ------------------------------------------------------------------------ -void MonIterInfo::SetQuality() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetQuality "); - if ( CBQuality->isChecked() ) { _Quality = 1 ; } - else { _Quality = 0 ; } -} diff --git a/src/ADAPTGUI/MonIterInfo.h b/src/ADAPTGUI/MonIterInfo.h deleted file mode 100644 index 8627efbd4..000000000 --- a/src/ADAPTGUI/MonIterInfo.h +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_ITERINFO_H -#define MON_ITERINFO_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) -#include CORBA_CLIENT_HEADER(HOMARD_Cas) - -#include "ui_IterInfo.h" -#include -#include - -class QListBox; - -class HOMARD_EXPORT MonIterInfo : public QDialog, public Ui_IterInfo -{ - Q_OBJECT - -public: - MonIterInfo( QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myAdaptGen, QString IterName); - ~MonIterInfo(); - -protected : - MonIterInfo( QWidget* parent, ADAPT::ADAPT_Gen_var myAdaptGen, QString IterName ); - - QString _IterName; - QString _aCaseName; - - int _BlockSize; - int _Connection; - int _Diametre; - int _Entanglement; - int _Quality; - int _Option; - - ADAPT::HOMARD_Iteration_var aIter ; - ADAPT::ADAPT_Gen_var myAdaptGen; - - virtual void InitConnect(); - -public slots: - - virtual void SetBlockSize(); - virtual void SetConnection(); - virtual void SetEntanglement(); - virtual void SetDiametre(); - virtual void SetQuality(); - - virtual void PushOnOK(); - virtual bool PushOnApply(); - virtual void PushOnHelp(); - -}; - -#endif // MON_ITERINFO_H diff --git a/src/ADAPTGUI/MonMeshInfo.cxx b/src/ADAPTGUI/MonMeshInfo.cxx deleted file mode 100644 index 3589c5f9a..000000000 --- a/src/ADAPTGUI/MonMeshInfo.cxx +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonMeshInfo.h" -#include "HOMARD.hxx" - -#include -#include - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include "HomardQtCommun.h" -#include "MonEditFile.h" -#include - -#ifdef WIN32 -#include -#endif - -using namespace std; - -// ----------------------------------------------------------------------------------------- -MonMeshInfo::MonMeshInfo(QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myAdaptGen0) -// ----------------------------------------------------------------------------------------- -/* Constructs a MonMeshInfo - * Inherits from CasHomard - * Sets attributes to default values - */ - : - Ui_MeshInfo(), - _aCaseName(""),_aDirName(""), - _BlockSize(0), - _Connection(0), - _Diametre(0), - _Entanglement(0), - _Quality(0) -{ - myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0); - setupUi(this); - setModal(modal); - InitConnect(); - - SetNewCaseName() ; - adjustSize(); -} - -// ------------------------------------------------------------------------ -MonMeshInfo::~MonMeshInfo() -// ------------------------------------------------------------------------ -{ - // no need to delete child widgets, Qt does it all for us -} -// ------------------------------------------------------------------------ -void MonMeshInfo::InitConnect() -// ------------------------------------------------------------------------ -{ - connect( LECaseName, SIGNAL(textChanged(QString)), this, SLOT(CaseNameChanged())); - connect( PushDir, SIGNAL(pressed()), this, SLOT(SetDirName())); - connect( PushFichier, SIGNAL(pressed()), this, SLOT(SetFileName())); - - connect( CBBlockSize, SIGNAL(stateChanged(int)), this, SLOT(SetBlockSize())); - connect( CBConnection, SIGNAL(stateChanged(int)), this, SLOT(SetConnection())); - connect( CBDiametre, SIGNAL(stateChanged(int)), this, SLOT(SetDiametre())); - connect( CBEntanglement, SIGNAL(stateChanged(int)), this, SLOT(SetEntanglement())); - connect( CBQuality, SIGNAL(stateChanged(int)), this, SLOT(SetQuality())); - - connect( buttonOk, SIGNAL(pressed()), this, SLOT(PushOnOK())); - connect( buttonApply, SIGNAL(pressed()), this, SLOT(PushOnApply())); - connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); - connect( buttonHelp, SIGNAL(pressed()), this, SLOT(PushOnHelp())); -} -// ------------------------------- -bool MonMeshInfo::PushOnApply() -// -------------------------------- -{ - MESSAGE("PushOnApply"); - QString aCaseName=LECaseName->text().trimmed(); - if ( aCaseName == "" ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_CASE_NAME") ); - return false; - } - - QString aDirName=LEDirName->text().trimmed(); - if (aDirName == QString("")) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_CASE_DIRECTORY_1") ); - return false; - } - if ( aDirName != _aDirName) - { QString CaseNameDir = myAdaptGen->VerifieDir( aDirName.toStdString().c_str()) ; - if ( CaseNameDir != "" ) - { - QString texte ; - texte = QObject::tr("HOM_CASE_DIRECTORY_2") + CaseNameDir ; - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - texte ); - return false; - } - } - if (CHDIR(aDirName.toStdString().c_str()) != 0) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_CASE_DIRECTORY_3") ); - return false; - } - - QString aFileName=LEFileName->text().trimmed(); - if (aFileName ==QString("")) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_CASE_MESH") ); - return false; - } - - QString aMeshName = HOMARD_QT_COMMUN::LireNomMaillage(aFileName); - if (aMeshName == "" ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_MED_FILE_2") ); - return false; - } - if ( ( _Quality == 0 ) && ( _Diametre == 0 ) && ( _Connection == 0 ) && ( _BlockSize == 0 ) && ( _Entanglement == 0 ) ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_MESH_INFO") ); - return false; - } - - if (aCaseName != _aCaseName ) - { - _aCaseName = aCaseName; - try - { - myAdaptGen->MeshInfo( \ - CORBA::string_dup(_aCaseName.toStdString().c_str()), \ - CORBA::string_dup(aMeshName.toStdString().c_str()), \ - CORBA::string_dup(aFileName.toStdString().c_str()), \ - CORBA::string_dup(aDirName.toStdString().c_str()), \ - _Quality, _Diametre, _Connection, _BlockSize, _Entanglement ); - } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - return false; - } - } - - // Le bilan de l'analyse a afficher - aCase = myAdaptGen->GetCase(_aCaseName.toStdString().c_str()); - string iter0 = aCase->GetIter0Name(); - ADAPT::HOMARD_Iteration_var aIter = myAdaptGen->GetIteration(iter0.c_str()); - aFileName = aIter->GetFileInfo() ; - MonEditFile *aDlg = new MonEditFile( 0, true, ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), aFileName, 1 ) ; - if ( aDlg->_codret == 0 ) { aDlg->show(); } - -HOMARD_UTILS::updateObjBrowser(); - return true; -} -// --------------------------- -void MonMeshInfo::PushOnOK() -// --------------------------- -{ - bool bOK = PushOnApply(); - if ( bOK ) this->close(); -} -//------------------------------ -void MonMeshInfo::PushOnHelp() -//------------------------------- -{ - std::string LanguageShort = myAdaptGen->GetLanguageShort(); - HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""), QString(LanguageShort.c_str())); -} -// --------------------------------- -void MonMeshInfo::SetNewCaseName() -// ------------------------------ -{ - ADAPT::listeCases_var MyCases = myAdaptGen->GetAllCasesName(); - int num = 0; QString aCaseName=""; - while (aCaseName=="" ) - { - aCaseName.setNum(num+1) ; - aCaseName.insert(0, QString("Case_")) ; - for ( int i=0; ilength(); i++) - { - if ( aCaseName == QString((MyCases)[i]) ) - { - num ++ ; - aCaseName = "" ; - break ; - } - } - } - LECaseName->clear() ; - LECaseName->insert(aCaseName); -} -// ------------------------------------------------------------------------ -void MonMeshInfo::SetDirName() -// ------------------------------------------------------------------------ -{ - QString aDirName=QFileDialog::getExistingDirectory (); - if (!(aDirName.isEmpty()))LEDirName->setText(aDirName); -} -// ------------------------------------------------------------------------ -void MonMeshInfo::SetFileName() -// ------------------------------------------------------------------------ -{ - QString fileName0 = LEFileName->text().trimmed(); - QString fileName = HOMARD_QT_COMMUN::PushNomFichier( false, QString("med") ) ; - if (fileName.isEmpty()) fileName = fileName0 ; - LEFileName->setText(fileName); -} -// ------------------------------------------------------------------------ -void MonMeshInfo::CaseNameChanged() -// ------------------------------------------------------------------------ -{ - if (_aCaseName != LECaseName->text().trimmed()) - { - LEFileName->setReadOnly(false); - PushFichier->show(); - } -} -// ------------------------------------------------------------------------ -void MonMeshInfo::SetBlockSize() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetBlockSize "); - if ( CBBlockSize->isChecked() ) { _BlockSize = 1 ; } - else { _BlockSize = 0 ; } -} -// ------------------------------------------------------------------------ -void MonMeshInfo::SetConnection() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetConnection "); - if ( CBConnection->isChecked() ) { _Connection = 1 ; } - else { _Connection = 0 ; } -} -// ------------------------------------------------------------------------ -void MonMeshInfo::SetDiametre() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetDiametre "); - if ( CBDiametre->isChecked() ) { _Diametre = 1 ; } - else { _Diametre = 0 ; } -} -// ------------------------------------------------------------------------ -void MonMeshInfo::SetEntanglement() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetEntanglement "); - if ( CBEntanglement->isChecked() ) { _Entanglement = 1 ; } - else { _Entanglement = 0 ; } -} -// ------------------------------------------------------------------------ -void MonMeshInfo::SetQuality() -// ------------------------------------------------------------------------ -{ - MESSAGE("Debut de SetQuality "); - if ( CBQuality->isChecked() ) { _Quality = 1 ; } - else { _Quality = 0 ; } -} diff --git a/src/ADAPTGUI/MonMeshInfo.h b/src/ADAPTGUI/MonMeshInfo.h deleted file mode 100644 index ec29de706..000000000 --- a/src/ADAPTGUI/MonMeshInfo.h +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_MESHINFO_H -#define MON_MESHINFO_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) -#include CORBA_CLIENT_HEADER(HOMARD_Cas) - -#include "ui_MeshInfo.h" -#include - -class HOMARD_EXPORT MonMeshInfo : public QDialog, public Ui_MeshInfo -{ - Q_OBJECT - -public: - MonMeshInfo( QWidget* parent, bool modal, ADAPT::ADAPT_Gen_var myAdaptGen); - ~MonMeshInfo(); - -protected : - QString _aCaseName; - QString _aDirName; - - int _BlockSize; - int _Connection; - int _Diametre; - int _Entanglement; - int _Quality; - - ADAPT::HOMARD_Cas_var aCase ; - ADAPT::ADAPT_Gen_var myAdaptGen; - - virtual void InitConnect(); - virtual void SetNewCaseName(); - -public slots: - virtual void SetDirName(); - virtual void SetFileName(); - - virtual void SetBlockSize(); - virtual void SetConnection(); - virtual void SetEntanglement(); - virtual void SetDiametre(); - virtual void SetQuality(); - - virtual void PushOnOK(); - virtual bool PushOnApply(); - virtual void PushOnHelp(); - - virtual void CaseNameChanged(); -}; - -#endif // MON_MESHINFO_H diff --git a/src/ADAPTGUI/MonPursueIteration.cxx b/src/ADAPTGUI/MonPursueIteration.cxx deleted file mode 100644 index ebecd5fa6..000000000 --- a/src/ADAPTGUI/MonPursueIteration.cxx +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MonPursueIteration.h" -#include "HOMARD.hxx" - -#include -#include - -#include "SalomeApp_Tools.h" -#include "HOMARDGUI_Utils.h" -#include "HomardQtCommun.h" -#include - -#ifdef WIN32 -#include -#endif - -using namespace std; - -// ----------------------------------------------------------------------------------------- -/* Constructs a MonPursueIteration - * Sets attributes to default values - */ -// ----------------------------------------------------------------------------------------- -MonPursueIteration::MonPursueIteration ( bool modal, ADAPT::ADAPT_Gen_var myAdaptGen0 ) - : - Ui_PursueIteration(), - _aCaseName(""), _aDirName(""), _aDirNameStart("") -{ - MESSAGE("Debut du constructeur de MonPursueIteration"); - myAdaptGen=ADAPT::ADAPT_Gen::_duplicate(myAdaptGen0); - setupUi(this); - setModal(modal); - - InitConnect(); - - SetNewCaseName() ; - _Type = 1 ; - GBIterationintoCase->setVisible(0); - SpinBoxNumber->setVisible(0); - - adjustSize(); - MESSAGE("Fin du constructeur de MonPursueIteration"); -} - -// ------------------------------------------------------------------------ -MonPursueIteration::~MonPursueIteration() -// ------------------------------------------------------------------------ -{ - // no need to delete child widgets, Qt does it all for us -} -// ------------------------------------------------------------------------ -void MonPursueIteration::InitConnect() -// ------------------------------------------------------------------------ -{ - connect( PushDir, SIGNAL(pressed()), this, SLOT(SetDirName())); - - connect( RBIteration, SIGNAL(clicked()), this, SLOT(FromIteration())); - connect( RBCase, SIGNAL(clicked()), this, SLOT(FromCase())); - connect( PushDirStart, SIGNAL(pressed()), this, SLOT(SetDirNameStart())); - - connect( RBCaseLastIteration, SIGNAL(clicked()), this, SLOT(CaseLastIteration())); - connect( RBCaseNIteration, SIGNAL(clicked()), this, SLOT(CaseNIteration())); - - connect( buttonOk, SIGNAL(pressed()), this, SLOT(PushOnOK())); - connect( buttonApply, SIGNAL(pressed()), this, SLOT(PushOnApply())); - connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); - connect( buttonHelp, SIGNAL(pressed()), this, SLOT(PushOnHelp())); -} -// ------------------------------- -bool MonPursueIteration::PushOnApply() -// -------------------------------- -{ - MESSAGE("PushOnApply"); -// 1. Enregistrement du repertoire du cas - QString aDirName=LEDirName->text().trimmed(); - if (aDirName == QString("")) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_CASE_DIRECTORY_1") ); - return false; - } - if ( aDirName != _aDirName) - { QString CaseNameDir = myAdaptGen->VerifieDir( aDirName.toStdString().c_str()) ; - if ( CaseNameDir != "" ) - { - QString texte ; - texte = QObject::tr("HOM_CASE_DIRECTORY_2") + CaseNameDir ; - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - texte ); - return false; - } - } - if (CHDIR(aDirName.toStdString().c_str()) != 0) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_CASE_DIRECTORY_3") ); - return false; - } -// 2. Enregistrement du repertoire de depart - QString aDirNameStart=LEDirNameStart->text().trimmed(); - if (aDirNameStart == QString("")) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_START_DIRECTORY_1") ); - return false; - } - if (CHDIR(aDirNameStart.toStdString().c_str()) != 0) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr("HOM_START_DIRECTORY_3") ); - return false; - } - -// 3. Enregistrement du numero d'iteration - int Number ; - if ( _Type == 3 ) { Number = SpinBoxNumber->value() ; } - -// 4. Creation du cas - QString _aCaseName=LECaseName->text().trimmed(); - _aDirNameStart=aDirNameStart; - - MESSAGE("_aCaseName = "<<_aCaseName.toStdString().c_str()); - MESSAGE("_aDirNameStart = "<<_aDirNameStart.toStdString().c_str()); - MESSAGE("_Type = "<<_Type); - switch (_Type) - { - case 1 : // Poursuite a partir d'une iteration - { - try - { - MESSAGE("Poursuite a partir d'une iteration"); - aCase = myAdaptGen->CreateCaseFromIteration( \ - CORBA::string_dup(_aCaseName.toStdString().c_str()), \ - CORBA::string_dup(_aDirNameStart.toStdString().c_str()) ); - } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - return false ; - } - break; - } - case 2 : // Poursuite a partir de la derniere iteration dans un cas - { - try - { - MESSAGE("Poursuite a partir de la derniere iteration dans un cas"); - aCase = myAdaptGen->CreateCaseFromCaseLastIteration( \ - CORBA::string_dup(_aCaseName.toStdString().c_str()), \ - CORBA::string_dup(_aDirNameStart.toStdString().c_str()) ); - } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - return false ; - } - break; - } - case 3 : // Poursuite a partir d'une iteration dans un cas - { - try - { - MESSAGE("Poursuite a partir d'une iteration dans un cas"); - aCase = myAdaptGen->CreateCaseFromCaseIteration( \ - CORBA::string_dup(_aCaseName.toStdString().c_str()), \ - CORBA::string_dup(_aDirNameStart.toStdString().c_str()), \ - Number ); - } - catch( SALOME::SALOME_Exception& S_ex ) - { - QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), - QObject::tr(CORBA::string_dup(S_ex.details.text)) ); - return false ; - } - break; - } - } - - aCase->SetDirName(aDirName.toStdString().c_str()); - _aDirName=aDirName; - - HOMARD_UTILS::updateObjBrowser(); - - return true; -} -// --------------------------- -void MonPursueIteration::PushOnOK() -// --------------------------- -{ - bool bOK = PushOnApply(); - if ( bOK ) this->close(); -} -//------------------------------ -void MonPursueIteration::PushOnHelp() -//------------------------------- -{ - std::string LanguageShort = myAdaptGen->GetLanguageShort(); - HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""), QString(LanguageShort.c_str())); -} -// --------------------------------- -void MonPursueIteration::SetNewCaseName() -// ------------------------------ -{ - ADAPT::listeCases_var MyCases = myAdaptGen->GetAllCasesName(); - int num = 0; QString aCaseName=""; - while (aCaseName=="" ) - { - aCaseName.setNum(num+1) ; - aCaseName.insert(0, QString("Case_")) ; - for ( int i=0; ilength(); i++) - { - if ( aCaseName == QString((MyCases)[i])) - { - num ++ ; - aCaseName = "" ; - break ; - } - } - } - LECaseName->clear() ; - LECaseName->insert(aCaseName); -} -// ------------------------------------------------------------------------ -void MonPursueIteration::SetDirName() -// ------------------------------------------------------------------------ -{ - QString aDirName=QFileDialog::getExistingDirectory (); - if (!(aDirName.isEmpty()))LEDirName->setText(aDirName); -} -// ------------------------------------------------------------------------ -void MonPursueIteration::SetDirNameStart() -// ------------------------------------------------------------------------ -{ - QString aDirName=QFileDialog::getExistingDirectory (); - if (!(aDirName.isEmpty()))LEDirNameStart->setText(aDirName); -} -// ------------------------------------------------------------------------ -void MonPursueIteration::FromIteration() -// ------------------------------------------------------------------------ -{ - GBIterationintoCase->setVisible(0); - SpinBoxNumber->setVisible(0); - _Type = 1 ; - adjustSize(); -} -// ------------------------------------------------------------------------ -void MonPursueIteration::FromCase() -// ------------------------------------------------------------------------ -{ - GBIterationintoCase->setVisible(1); - CaseLastIteration(); -} -// ------------------------------------------------------------------------ -void MonPursueIteration::CaseLastIteration() -// ------------------------------------------------------------------------ -{ - SpinBoxNumber->setVisible(0); - _Type = 2 ; - adjustSize(); -} -// ------------------------------------------------------------------------ -void MonPursueIteration::CaseNIteration() -// ------------------------------------------------------------------------ -{ - SpinBoxNumber->setVisible(1); - _Type = 3 ; - adjustSize(); -} diff --git a/src/ADAPTGUI/MonPursueIteration.h b/src/ADAPTGUI/MonPursueIteration.h deleted file mode 100644 index 00dd62015..000000000 --- a/src/ADAPTGUI/MonPursueIteration.h +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef MON_PURSUEITERATION_H -#define MON_PURSUEITERATION_H - -#include "HOMARDGUI_Exports.hxx" - -#include -#include - -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) -#include CORBA_CLIENT_HEADER(ADAPT_Gen) -#include CORBA_CLIENT_HEADER(HOMARD_Cas) - -#include "ui_PursueIteration.h" -#include - -class HOMARD_EXPORT MonPursueIteration : public QDialog, public Ui_PursueIteration -{ - Q_OBJECT - - public: - MonPursueIteration( bool modal, ADAPT::ADAPT_Gen_var myAdaptGen ); - virtual ~MonPursueIteration(); - - protected : - QString _aCaseName; - QString _aDirName; - QString _aDirNameStart; - - int _Type ; - - ADAPT::HOMARD_Cas_var aCase ; - ADAPT::ADAPT_Gen_var myAdaptGen; - - virtual void InitConnect(); - virtual void SetNewCaseName(); - - public slots: - virtual void SetDirName(); - - virtual void FromIteration(); - virtual void FromCase(); - virtual void SetDirNameStart(); - - virtual void CaseLastIteration(); - virtual void CaseNIteration(); - - virtual void PushOnOK(); - virtual bool PushOnApply(); - virtual void PushOnHelp(); - -}; - -#endif // MON_PURSUEITERATION_H diff --git a/src/ADAPTGUI/PursueIteration.ui b/src/ADAPTGUI/PursueIteration.ui deleted file mode 100644 index ad3de2352..000000000 --- a/src/ADAPTGUI/PursueIteration.ui +++ /dev/null @@ -1,252 +0,0 @@ - - - PursueIteration - - - - 0 - 0 - 601 - 300 - - - - - 0 - 0 - - - - Pursue an iteration - - - true - - - - - - 6 - - - 0 - - - - - Name - - - - - - - - 382 - 21 - - - - - - - - - - 6 - - - 0 - - - - - Directory - - - - - - - - - - false - - - - - - - - 382 - 21 - - - - - - - - - - From an iteration - - - true - - - - - - - From a case - - - - - - - 6 - - - 0 - - - - - Directory - - - - - - - - - - false - - - - - - - - 382 - 21 - - - - - - - - - - Iteration into the case - - - - - - Last iteration - - - true - - - - - - - Iteration number - - - - - - - 1789 - - - - - - - - - - - - - - 9 - - - 6 - - - - - Help - - - false - - - - - - - Apply - - - false - - - - - - - OK - - - false - - - - - - - Cancel - - - false - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 128 - 25 - - - - - - - - - diff --git a/src/ADAPT_I/ADAPT_Gen_i.cxx b/src/ADAPT_I/ADAPT_Gen_i.cxx deleted file mode 100644 index eb58aeee3..000000000 --- a/src/ADAPT_I/ADAPT_Gen_i.cxx +++ /dev/null @@ -1,5432 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "ADAPT_Gen_i.hxx" -#include "HOMARD_Cas_i.hxx" -#include "HOMARD_Hypothesis_i.hxx" -#include "HOMARD_Iteration_i.hxx" -#include "HOMARD_Boundary_i.hxx" -#include "HOMARD_Zone_i.hxx" -#include "HOMARD_YACS_i.hxx" -#include "HomardDriver.hxx" -#include "HOMARD_DriverTools.hxx" -#include "HomardMedCommun.h" -#include "YACSDriver.hxx" -#include "HOMARD.hxx" - -#include "FrontTrack.hxx" - -#include "SMESH_version.h" - -#include "utilities.h" -#include "Basics_Utils.hxx" -#include "Basics_DirUtils.hxx" -#include "Utils_SINGLETON.hxx" -#include "Utils_CorbaException.hxx" -#include "SALOMEDS_Tool.hxx" -#include "SALOME_LifeCycleCORBA.hxx" -#include "SALOMEconfig.h" -#include -#include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog) -#include CORBA_CLIENT_HEADER(SMESH_Gen) - -#include -#include -#include -#ifndef WIN32 -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef WIN32 -#include -#endif - -using namespace std; - -//============================================================================= -//functions -//============================================================================= -std::string RemoveTabulation( std::string theScript ) -{ - std::string::size_type aPos = 0; - while( aPos < theScript.length() ) - { - aPos = theScript.find( "\n\t", aPos ); - if( aPos == std::string::npos ) - break; - theScript.replace( aPos, 2, "\n" ); - aPos++; - } - return theScript; -} -//============================================================================= -/*! - * standard constructor - */ -//============================================================================= -ADAPT_Gen_i::ADAPT_Gen_i( CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::ObjectId * contId, - const char *instanceName, - const char *interfaceName) : -Engines_Component_i(orb, poa, contId, instanceName, interfaceName) -{ - MESSAGE("constructor"); - _thisObj = this; - _id = _poa->activate_object(_thisObj); - - myHomard = new ::ADAPT_Gen(); - _NS = SINGLETON_::Instance(); - ASSERT(SINGLETON_::IsAlreadyExisting()); - _NS->init_orb(_orb); - - myStudy = SALOMEDS::Study::_duplicate( SMESH_Gen_i::getStudyServant() ); - - _tag_gene = 0 ; - _tag_boun = 0 ; - _tag_hypo = 0 ; - _tag_yacs = 0 ; - _tag_zone = 0 ; - - SetPreferences( ) ; -} -//================================= -/*! - * standard destructor - */ -//================================ -ADAPT_Gen_i::~ADAPT_Gen_i() -{ -} -//============================================================================= -//============================================================================= -// Utilitaires pour l'étude -//============================================================================= -//============================================================================= -void ADAPT_Gen_i::UpdateStudy() -{ - ASSERT(!CORBA::is_nil(myStudy)); - SALOMEDS::StudyBuilder_var myBuilder = myStudy->NewBuilder(); - - // Create SComponent labelled 'homard' if it doesn't already exit - SALOMEDS::SComponent_var homardFather = myStudy->FindComponent(ComponentDataType()); - if (CORBA::is_nil(homardFather)) - { - myBuilder->NewCommand(); - MESSAGE("Add Component HOMARD"); - - bool aLocked = myStudy->GetProperties()->IsLocked(); - if (aLocked) myStudy->GetProperties()->SetLocked(false); - - homardFather = myBuilder->NewComponent(ComponentDataType()); - SALOMEDS::GenericAttribute_var anAttr = myBuilder->FindOrCreateAttribute(homardFather,"AttributeName"); - SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr); - CORBA::Object_var objVarN = _NS->Resolve("/Kernel/ModulCatalog"); - SALOME_ModuleCatalog::ModuleCatalog_var Catalogue = - SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN); - SALOME_ModuleCatalog::Acomponent_var Comp = Catalogue->GetComponent(ComponentDataType()); - if (!Comp->_is_nil()) - { - aName->SetValue(ComponentDataType()); - } - - anAttr = myBuilder->FindOrCreateAttribute(homardFather,"AttributePixMap"); - SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); - aPixmap->SetPixMap("HOMARD_2.png"); - myBuilder->DefineComponentInstance(homardFather, ADAPT_Gen::_this()); - - if (aLocked) myStudy->GetProperties()->SetLocked(true); - myBuilder->CommitCommand(); - } -} - -//============================================================================= -//============================================================================= -// Utilitaires pour l'iteration -//============================================================================= -//============================================================================= -void ADAPT_Gen_i::SetEtatIter(const char* nomIter, const CORBA::Long Etat) -//===================================================================================== -{ - MESSAGE( "SetEtatIter : affectation de l'etat " << Etat << " a l'iteration " << nomIter ); - ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; - if (CORBA::is_nil(myIteration)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid iteration"; - throw SALOME::SALOME_Exception(es); - return ; - }; - - myIteration->SetState(Etat); - - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); - SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration))); - - std::string icone ; - if ( Etat <= 0 ) - icone = "iter0.png" ; - else if ( Etat == 2 ) - icone = "iter_calculee.png" ; - else - icone = "iter_non_calculee.png" ; - PublishInStudyAttr(aStudyBuilder, aIterSO, NULL , NULL, icone.c_str(), NULL) ; - - aStudyBuilder->CommitCommand(); - -} -//============================================================================= -//============================================================================= -// -//============================================================================= -//============================================================================= -// Destruction des structures identifiees par leurs noms -//============================================================================= -//============================================================================= -CORBA::Long ADAPT_Gen_i::DeleteBoundary(const char* BoundaryName) -{ - MESSAGE ( "DeleteBoundary : BoundaryName = " << BoundaryName ); - ADAPT::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; - if (CORBA::is_nil(myBoundary)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid boundary"; - throw SALOME::SALOME_Exception(es); - return 1 ; - }; - -// On verifie que la frontiere n'est plus utilisee - ADAPT::listeCases* maListe = GetAllCasesName(); - int numberOfCases = maListe->length(); - MESSAGE ( ".. Nombre de cas = " << numberOfCases ); - std::string CaseName ; - ADAPT::ListBoundaryGroupType* ListBoundaryGroupType ; - int numberOfitems ; - ADAPT::HOMARD_Cas_var myCase ; - for (int NumeCas = 0; NumeCas< numberOfCases; NumeCas++) - { - CaseName = std::string((*maListe)[NumeCas]); - MESSAGE ( "... Examen du cas = " << CaseName.c_str() ); - myCase = myStudyContext._mesCas[CaseName]; - ASSERT(!CORBA::is_nil(myCase)); - ListBoundaryGroupType = myCase->GetBoundaryGroup(); - numberOfitems = ListBoundaryGroupType->length(); - MESSAGE ( "... number of string for Boundary+Group = " << numberOfitems); - for (int NumBoundary = 0; NumBoundary< numberOfitems; NumBoundary=NumBoundary+2) - { - if ( std::string((*ListBoundaryGroupType)[NumBoundary]) == BoundaryName ) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "This boundary is used in a case and cannot be deleted."; - throw SALOME::SALOME_Exception(es); - return 2 ; - }; - }; - } - - // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete - myStudyContext._mesBoundarys.erase(BoundaryName); - SALOMEDS::Study::ListOfSObject_var listSO = myStudy->FindObjectByName(BoundaryName, ComponentDataType()); - SALOMEDS::SObject_var aSO =listSO[0]; - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); - myStudy->NewBuilder()->RemoveObjectWithChildren(aSO); - - return 0 ; -} -//============================================================================= -CORBA::Long ADAPT_Gen_i::DeleteCase(const char* nomCas, CORBA::Long Option) -{ - // Pour detruire un cas - MESSAGE ( "DeleteCase : nomCas = " << nomCas << ", avec option = " << Option ); - ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; - if (CORBA::is_nil(myCase)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid case context"; - throw SALOME::SALOME_Exception(es); - return 1; - }; - // On commence par detruire toutes les iterations en partant de l'initiale et y compris elle - CORBA::String_var nomIter = myCase->GetIter0Name(); - CORBA::Long Option1 = 0 ; - if ( DeleteIterationOption(nomIter, Option1, Option) != 0 ) - { - return 2; - }; - - // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete - myStudyContext._mesCas.erase(nomCas); - SALOMEDS::Study::ListOfSObject_var listSO = myStudy->FindObjectByName(nomCas, ComponentDataType()); - SALOMEDS::SObject_var aSO =listSO[0]; - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); - myStudy->NewBuilder()->RemoveObjectWithChildren(aSO); - - return 0 ; -} -//============================================================================= -CORBA::Long ADAPT_Gen_i::DeleteHypo(const char* nomHypo) -{ - MESSAGE ( "DeleteHypo : nomHypo = " << nomHypo ); - ADAPT::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; - if (CORBA::is_nil(myHypo)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid hypothesis"; - throw SALOME::SALOME_Exception(es); - return 1 ; - }; - -// On verifie que l'hypothese n'est plus utilisee - ADAPT::listeIters* maListeIter = myHypo->GetIterations(); - int numberOfIter = maListeIter->length(); - if ( numberOfIter > 0 ) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "This hypothesis is used in an iteration and cannot be deleted."; - throw SALOME::SALOME_Exception(es); - return 2 ; - }; - - // suppression du lien avec les zones eventuelles - ADAPT::listeZonesHypo* maListe = myHypo->GetZones(); - int numberOfZones = maListe->length(); - MESSAGE ( ".. Nombre de zones = " << numberOfZones ); - for (int NumeZone = 0; NumeZone< numberOfZones; NumeZone++) - { - std::string ZoneName = std::string((*maListe)[NumeZone]); - MESSAGE ( ".. suppression du lien avec la zone = " << ZoneName.c_str() ); - DissociateHypoZone(nomHypo, ZoneName.c_str()) ; - NumeZone += 1 ; - } - - // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete - myStudyContext._mesHypotheses.erase(nomHypo); - SALOMEDS::Study::ListOfSObject_var listSO = myStudy->FindObjectByName(nomHypo, ComponentDataType()); - SALOMEDS::SObject_var aSO =listSO[0]; - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); - myStudy->NewBuilder()->RemoveObjectWithChildren(aSO); - - return 0 ; -} -//============================================================================= -CORBA::Long ADAPT_Gen_i::DeleteIteration(const char* nomIter, CORBA::Long Option) -{ - // Option = 0 : On ne supprime pas le fichier du maillage associe - // Option = 1 : On supprime le fichier du maillage associe - // Pour detruire une iteration courante - MESSAGE ( "DeleteIteration : nomIter = " << nomIter << ", avec option = " << Option ); - CORBA::Long Option1 = 1 ; - return DeleteIterationOption(nomIter, Option1, Option); -} -//============================================================================= -CORBA::Long ADAPT_Gen_i::DeleteIterationOption(const char* nomIter, CORBA::Long Option1, CORBA::Long Option2) -{ - // Option1 = 0 : On autorise la destruction de l'iteration 0 - // Option1 = 1 : On interdit la destruction de l'iteration 0 - - // Option2 = 0 : On ne supprime pas le fichier du maillage associe - // Option2 = 1 : On supprime le fichier du maillage associe - MESSAGE ( "DeleteIterationOption : nomIter = " << nomIter << ", avec options = " << Option1<< ", " << Option2 ); - ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; - if (CORBA::is_nil(myIteration)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid iteration"; - throw SALOME::SALOME_Exception(es); - return 1 ; - }; - - int numero = myIteration->GetNumber(); - MESSAGE ( "DeleteIterationOption : numero = " << numero ); - if ( numero == 0 && Option1 == 1 ) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "This iteration cannot be deleted."; - throw SALOME::SALOME_Exception(es); - return 2 ; - }; - - // On detruit recursivement toutes les filles - ADAPT::listeIterFilles* maListe = myIteration->GetIterations(); - int numberOfIter = maListe->length(); - for (int NumeIter = 0; NumeIter< numberOfIter; NumeIter++) - { - std::string nomIterFille = std::string((*maListe)[NumeIter]); - MESSAGE ( ".. appel recursif de DeleteIterationOption pour nomIter = " << nomIterFille.c_str() ); - DeleteIterationOption(nomIterFille.c_str(), Option1, Option2); - } - - // On arrive ici pour une iteration sans fille - MESSAGE ( "Destruction effective de " << nomIter ); - // On commence par invalider l'iteration pour faire le menage des dependances - // et eventuellement du maillage associe - int option ; - if ( numero == 0 ) { option = 0 ; } - else { option = Option2 ; } - InvalideIterOption(nomIter, option) ; - - // Retrait dans la descendance de l'iteration parent - if ( numero > 0 ) - { - std::string nomIterationParent = myIteration->GetIterParentName(); - MESSAGE ( "Retrait dans la descendance de nomIterationParent " << nomIterationParent ); - ADAPT::HOMARD_Iteration_var myIterationParent = myStudyContext._mesIterations[nomIterationParent]; - if (CORBA::is_nil(myIterationParent)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid iteration"; - throw SALOME::SALOME_Exception(es); - return 3 ; - }; - myIterationParent->UnLinkNextIteration(nomIter); - } - - // suppression du lien avec l'hypothese - if ( numero > 0 ) - { - std::string nomHypo = myIteration->GetHypoName(); - ADAPT::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; - ASSERT(!CORBA::is_nil(myHypo)); - myHypo->UnLinkIteration(nomIter); - } - - // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete - myStudyContext._mesIterations.erase(nomIter); - SALOMEDS::Study::ListOfSObject_var listSO = myStudy->FindObjectByName(nomIter, ComponentDataType()); - SALOMEDS::SObject_var aSO =listSO[0]; - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); - myStudy->NewBuilder()->RemoveObjectWithChildren(aSO); - // on peut aussi faire RemoveObject -// MESSAGE ( "Au final" ); -// ADAPT::listeIterations* Liste = GetAllIterationsName() ; -// numberOfIter = Liste->length(); -// for (int NumeIter = 0; NumeIter< numberOfIter; NumeIter++) -// { -// std::string nomIterFille = std::string((*Liste)[NumeIter]); -// MESSAGE ( ".. nomIter = " << nomIterFille.c_str() ); -// } - - return 0 ; -} -//============================================================================= -CORBA::Long ADAPT_Gen_i::DeleteYACS(const char* nomYACS, CORBA::Long Option) -{ - // Option = 0 : On ne supprime pas le fichier du schema associe - // Option = 1 : On supprime le fichier du schema associe - MESSAGE ( "DeleteYACS : nomYACS = " << nomYACS << ", avec option = " << Option ); - ADAPT::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; - if (CORBA::is_nil(myYACS)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid schema YACS"; - throw SALOME::SALOME_Exception(es); - return 1 ; - }; - // Suppression eventuelle du fichier XML - if ( Option == 1 ) - { - std::string nomFichier = myYACS->GetXMLFile(); - std::string commande = "rm -rf " + nomFichier ; - MESSAGE ( "commande = " << commande ); - if ((system(commande.c_str())) != 0) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "The xml file for the schema YACS cannot be removed." ; - throw SALOME::SALOME_Exception(es); - return 2 ; - } - } - // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete - myStudyContext._mesYACSs.erase(nomYACS); - SALOMEDS::Study::ListOfSObject_var listSO = myStudy->FindObjectByName(nomYACS, ComponentDataType()); - SALOMEDS::SObject_var aSO =listSO[0]; - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); - myStudy->NewBuilder()->RemoveObjectWithChildren(aSO); - - return 0 ; -} -//============================================================================= -CORBA::Long ADAPT_Gen_i::DeleteZone(const char* nomZone) -{ - MESSAGE ( "DeleteZone : nomZone = " << nomZone ); - ADAPT::HOMARD_Zone_var myZone = myStudyContext._mesZones[nomZone]; - if (CORBA::is_nil(myZone)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid zone"; - throw SALOME::SALOME_Exception(es); - return 1 ; - }; - -// On verifie que la zone n'est plus utilisee - ADAPT::listeHypo* maListe = myZone->GetHypo(); - int numberOfHypo = maListe->length(); - MESSAGE ( ".. Nombre d'hypotheses = " << numberOfHypo ); - if ( numberOfHypo > 0 ) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "This zone is used in a hypothesis and cannot be deleted."; - throw SALOME::SALOME_Exception(es); - return 2 ; - }; -// - // comme on a un _var comme pointeur CORBA, on ne se preoccupe pas du delete - myStudyContext._mesZones.erase(nomZone); - SALOMEDS::Study::ListOfSObject_var listSO = myStudy->FindObjectByName(nomZone, ComponentDataType()); - SALOMEDS::SObject_var aSO =listSO[0]; - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); - myStudy->NewBuilder()->RemoveObjectWithChildren(aSO); - - return 0 ; -} -//============================================================================= -//============================================================================= -// -//============================================================================= -//============================================================================= -// Invalidation des structures identifiees par leurs noms -//============================================================================= -//============================================================================= -void ADAPT_Gen_i::InvalideBoundary(const char* BoundaryName) -{ - MESSAGE( "InvalideBoundary : BoundaryName = " << BoundaryName ); - ADAPT::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; - if (CORBA::is_nil(myBoundary)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid boundary"; - throw SALOME::SALOME_Exception(es); - return ; - } - else - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "No change is allowed in a boundary. Ask for evolution."; - throw SALOME::SALOME_Exception(es); - return ; - }; -} -//============================================================================= -void ADAPT_Gen_i::InvalideHypo(const char* nomHypo) -{ - MESSAGE( "InvalideHypo : nomHypo = " << nomHypo ); - ADAPT::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; - if (CORBA::is_nil(myHypo)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid hypothesis"; - throw SALOME::SALOME_Exception(es); - return ; - }; - - ADAPT::listeIters* maListe = myHypo->GetIterations(); - int numberOfIter = maListe->length(); - for (int NumeIter = 0; NumeIter< numberOfIter; NumeIter++) - { - std::string nomIter = std::string((*maListe)[NumeIter]); - MESSAGE( ".. nomIter = " << nomIter ); - InvalideIter(nomIter.c_str()); - } -} -//============================================================================= -void ADAPT_Gen_i::InvalideIter(const char* nomIter) -{ - MESSAGE("InvalideIter : nomIter = " << nomIter); - // Pour invalider totalement une iteration courante - CORBA::Long Option = 1 ; - return InvalideIterOption(nomIter, Option); -} -//============================================================================= -void ADAPT_Gen_i::InvalideIterOption(const char* nomIter, CORBA::Long Option) -{ - // Option = 0 : On ne supprime pas le fichier du maillage associe - // Option = 1 : On supprime le fichier du maillage associe - MESSAGE ( "InvalideIterOption : nomIter = " << nomIter << ", avec option = " << Option ); - ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; - if (CORBA::is_nil(myIteration)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid iteration"; - throw SALOME::SALOME_Exception(es); - return ; - }; - - ADAPT::listeIterFilles* maListe = myIteration->GetIterations(); - int numberOfIter = maListe->length(); - for (int NumeIter = 0; NumeIter< numberOfIter; NumeIter++) - { - std::string nomIterFille = std::string((*maListe)[NumeIter]); - MESSAGE ( ".. appel recursif de InvalideIter pour nomIter = " << nomIterFille.c_str() ); - InvalideIter(nomIterFille.c_str()); - } - - // On arrive ici pour une iteration sans fille - MESSAGE ( "Invalidation effective de " << nomIter ); - SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration))); - SALOMEDS::ChildIterator_var aIter = myStudy->NewChildIterator(aIterSO); - for (; aIter->More(); aIter->Next()) - { - SALOMEDS::SObject_var so = aIter->Value(); - SALOMEDS::GenericAttribute_var anAttr; - if (!so->FindAttribute(anAttr, "AttributeComment")) continue; - SALOMEDS::AttributeComment_var aCommentAttr = SALOMEDS::AttributeComment::_narrow(anAttr); - std::string value (aCommentAttr->Value()); - if(value == std::string("IterationHomard")) continue; - if(value == std::string("HypoHomard")) continue; - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); - aStudyBuilder->RemoveObject(so); - } - - int etat = myIteration->GetState(); - if ( etat > 0 ) - { - SetEtatIter(nomIter,1); - const char * nomCas = myIteration->GetCaseName(); - ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; - if (CORBA::is_nil(myCase)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid case context"; - throw SALOME::SALOME_Exception(es); - return ; - }; - std::string nomDir = myIteration->GetDirName(); - std::string nomFichier = myIteration->GetMeshFile(); - std::string commande = "rm -rf " + std::string(nomDir); - if ( Option == 1 ) { commande = commande + ";rm -rf " + std::string(nomFichier) ; } - MESSAGE ( "commande = " << commande ); - if ((system(commande.c_str())) != 0) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "The directory for the calculation cannot be cleared." ; - throw SALOME::SALOME_Exception(es); - return ; - } - // Suppression du maillage publie dans SMESH - std::string MeshName = myIteration->GetMeshName() ; - DeleteResultInSmesh(nomFichier, MeshName) ; - }; - -} -//============================================================================= -void ADAPT_Gen_i::InvalideIterInfo(const char* nomIter) -{ - MESSAGE("InvalideIterInfo : nomIter = " << nomIter); - ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; - if (CORBA::is_nil(myIteration)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid iteration"; - throw SALOME::SALOME_Exception(es); - return ; - }; - - SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration))); - SALOMEDS::ChildIterator_var aIter = myStudy->NewChildIterator(aIterSO); - for (; aIter->More(); aIter->Next()) - { - SALOMEDS::SObject_var so = aIter->Value(); - SALOMEDS::GenericAttribute_var anAttr; - if (!so->FindAttribute(anAttr, "AttributeComment")) continue; - SALOMEDS::AttributeComment_var aCommentAttr = SALOMEDS::AttributeComment::_narrow(anAttr); - std::string value (aCommentAttr->Value()); -/* MESSAGE("... value = " << value);*/ - if( (value == std::string("logInfo")) || ( value == std::string("SummaryInfo")) ) - { - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); - aStudyBuilder->RemoveObject(so); - } - } - - const char * nomCas = myIteration->GetCaseName(); - ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; - if (CORBA::is_nil(myCase)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid case context"; - throw SALOME::SALOME_Exception(es); - return ; - }; - const char* nomDir = myIteration->GetDirName(); - std::string commande = "rm -f " + std::string(nomDir) + "/info* " ; - commande += std::string(nomDir) + "/Liste.*info" ; -/* MESSAGE ( "commande = " << commande );*/ - if ((system(commande.c_str())) != 0) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "The directory for the calculation cannot be cleared." ; - throw SALOME::SALOME_Exception(es); - return ; - } -} -//============================================================================= -void ADAPT_Gen_i::InvalideYACS(const char* YACSName) -{ - MESSAGE( "InvalideYACS : YACSName = " << YACSName ); - ADAPT::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[YACSName]; - if (CORBA::is_nil(myYACS)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid schema YACS"; - throw SALOME::SALOME_Exception(es); - return ; - }; - // - SALOMEDS::SObject_var aYACSSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myYACS))); - SALOMEDS::ChildIterator_var aYACS = myStudy->NewChildIterator(aYACSSO); - for (; aYACS->More(); aYACS->Next()) - { - SALOMEDS::SObject_var so = aYACS->Value(); - SALOMEDS::GenericAttribute_var anAttr; - if (!so->FindAttribute(anAttr, "AttributeComment")) continue; - SALOMEDS::AttributeComment_var aCommentAttr = SALOMEDS::AttributeComment::_narrow(anAttr); - std::string value (aCommentAttr->Value()); - if( value == std::string("xml") ) - { - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); - aStudyBuilder->RemoveObject(so); - } - } - std::string nomFichier = myYACS->GetXMLFile(); - std::string commande = "rm -rf " + std::string(nomFichier) ; - MESSAGE ( "commande = " << commande ); - if ((system(commande.c_str())) != 0) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "The XML file for the schema YACS cannot be removed." ; - throw SALOME::SALOME_Exception(es); - return ; - } -} -//============================================================================= -void ADAPT_Gen_i::InvalideZone(const char* ZoneName) -{ - MESSAGE( "InvalideZone : ZoneName = " << ZoneName ); - ADAPT::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName]; - if (CORBA::is_nil(myZone)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid zone"; - throw SALOME::SALOME_Exception(es); - return ; - }; - ADAPT::listeHypo* maListe = myZone->GetHypo(); - int numberOfHypo = maListe->length(); - MESSAGE( ".. numberOfHypo = " << numberOfHypo ); - for (int NumeHypo = 0; NumeHypo< numberOfHypo; NumeHypo++) - { - std::string nomHypo = std::string((*maListe)[NumeHypo]); - MESSAGE( ".. nomHypo = " << nomHypo ); - InvalideHypo(nomHypo.c_str()); - } -} -//============================================================================= -//============================================================================= -// -//============================================================================= -//============================================================================= -// Association de lien entre des structures identifiees par leurs noms -//============================================================================= -//============================================================================= -void ADAPT_Gen_i::AssociateCaseIter(const char* nomCas, const char* nomIter, const char* labelIter) -{ - MESSAGE( "AssociateCaseIter : " << nomCas << ", " << nomIter << ", " << labelIter ); - - ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; - if (CORBA::is_nil(myCase)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid case"; - throw SALOME::SALOME_Exception(es); - return ; - }; - - ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; - if (CORBA::is_nil(myIteration)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid iteration"; - throw SALOME::SALOME_Exception(es); - return ; - }; - - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); - SALOMEDS::SObject_var aCasSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myCase))); - if (CORBA::is_nil(aCasSO)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid case"; - throw SALOME::SALOME_Exception(es); - return ; - }; - - aStudyBuilder->NewCommand(); - SALOMEDS::SObject_var newStudyIter = aStudyBuilder->NewObject(aCasSO); - PublishInStudyAttr(aStudyBuilder, newStudyIter, nomIter , labelIter, - "iter_non_calculee.png", _orb->object_to_string(myIteration)) ; - aStudyBuilder->CommitCommand(); - - myCase->AddIteration(nomIter); - myIteration->SetCaseName(nomCas); -} -//===================================================================================== -void ADAPT_Gen_i::AssociateHypoZone(const char* nomHypothesis, const char* ZoneName, CORBA::Long TypeUse) -{ - MESSAGE ( "AssociateHypoZone : nomHypo = " << nomHypothesis << ", ZoneName= " << ZoneName << ", TypeUse = " << TypeUse); - - ADAPT::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypothesis]; - ASSERT(!CORBA::is_nil(myHypo)); - SALOMEDS::SObject_var aHypoSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myHypo))); - ASSERT(!CORBA::is_nil(aHypoSO)); - - ADAPT::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName]; - ASSERT(!CORBA::is_nil(myZone)); - SALOMEDS::SObject_var aZoneSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myZone))); - ASSERT(!CORBA::is_nil(aZoneSO)); - - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); - - aStudyBuilder->NewCommand(); - - SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aHypoSO); - aStudyBuilder->Addreference(aSubSO, aZoneSO); - - aStudyBuilder->CommitCommand(); - - myZone->AddHypo(nomHypothesis); - myHypo->AddZone0(ZoneName, TypeUse); -}; -//============================================================================= -void ADAPT_Gen_i::AssociateIterHypo(const char* nomIter, const char* nomHypo) -{ - MESSAGE("AssociateIterHypo : nomHypo = " << nomHypo << " nomIter = " << nomIter); - - // Verification de l'existence de l'hypothese - ADAPT::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; - ASSERT(!CORBA::is_nil(myHypo)); - SALOMEDS::SObject_var aHypoSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myHypo))); - ASSERT(!CORBA::is_nil(aHypoSO)); - - // Verification de l'existence de l'iteration - ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[nomIter]; - ASSERT(!CORBA::is_nil(myIteration)); - SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration))); - ASSERT(!CORBA::is_nil(aIterSO)); - - // Gestion de l'arbre d'etudes - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); - aStudyBuilder->NewCommand(); - SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aIterSO); - aStudyBuilder->Addreference(aSubSO, aHypoSO); - aStudyBuilder->CommitCommand(); - - // Liens reciproques - myIteration->SetHypoName(nomHypo); - myHypo->LinkIteration(nomIter); - - // On stocke les noms des champ a interpoler pour le futur controle de la donnée des pas de temps - myIteration->SupprFieldInterps() ; - ADAPT::listeFieldInterpsHypo* ListField = myHypo->GetFieldInterps(); - int numberOfFieldsx2 = ListField->length(); - for (int iaux = 0; iaux< numberOfFieldsx2; iaux++) - { - std::string FieldName = std::string((*ListField)[iaux]) ; - myIteration->SetFieldInterp(FieldName.c_str()) ; - iaux++ ; - } -}; -//============================================================================= -//============================================================================= -// -//============================================================================= -//============================================================================= -// Dissociation de lien entre des structures identifiees par leurs noms -//============================================================================= -//============================================================================= -void ADAPT_Gen_i::DissociateHypoZone(const char* nomHypothesis, const char* ZoneName) -{ - MESSAGE ( "DissociateHypoZone : ZoneName= " << ZoneName << ", nomHypo = " << nomHypothesis); - - ADAPT::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypothesis]; - ASSERT(!CORBA::is_nil(myHypo)); - SALOMEDS::SObject_var aHypoSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myHypo))); - ASSERT(!CORBA::is_nil(aHypoSO)); - - ADAPT::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName]; - ASSERT(!CORBA::is_nil(myZone)); - SALOMEDS::SObject_var aZoneSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myZone))); - ASSERT(!CORBA::is_nil(aZoneSO)); - - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); - - SALOMEDS::ChildIterator_var it = myStudy->NewChildIterator(aHypoSO); - for (; it->More(); it->Next()) - { - SALOMEDS::SObject_var aHypObj = it->Value(); - SALOMEDS::SObject_var ptrObj; - if (aHypObj->ReferencedObject(ptrObj)) - { - if (std::string(ptrObj->GetName()) == std::string(aZoneSO->GetName())) - { - aStudyBuilder->NewCommand(); - aStudyBuilder->RemoveObject(aHypObj); - aStudyBuilder->CommitCommand(); - break; - } - } - } - - myZone->SupprHypo(nomHypothesis); - myHypo->SupprZone(ZoneName); -}; -//============================================================================= -//============================================================================= -// - -//============================================================================= -//============================================================================= -// Recuperation des listes -//============================================================================= -//============================================================================= -ADAPT::listeBoundarys* ADAPT_Gen_i::GetAllBoundarysName() -{ - MESSAGE("GetAllBoundarysName"); - IsValidStudy () ; - - ADAPT::listeBoundarys_var ret = new ADAPT::listeBoundarys; - ret->length(myStudyContext._mesBoundarys.size()); - std::map::const_iterator it; - int i = 0; - for (it = myStudyContext._mesBoundarys.begin(); - it != myStudyContext._mesBoundarys.end(); it++) - { - ret[i++] = CORBA::string_dup((*it).first.c_str()); - } - - return ret._retn(); -} -//============================================================================= -ADAPT::listeCases* ADAPT_Gen_i::GetAllCasesName() -{ - MESSAGE("GetAllCasesName"); - IsValidStudy () ; - - ADAPT::listeCases_var ret = new ADAPT::listeCases; - ret->length(myStudyContext._mesCas.size()); - std::map::const_iterator it; - int i = 0; - for (it = myStudyContext._mesCas.begin(); - it != myStudyContext._mesCas.end(); it++) - { - ret[i++] = CORBA::string_dup((*it).first.c_str()); - } - - return ret._retn(); -} -//============================================================================= -ADAPT::listeHypotheses* ADAPT_Gen_i::GetAllHypothesesName() -{ - MESSAGE("GetAllHypothesesName"); - IsValidStudy () ; - - ADAPT::listeHypotheses_var ret = new ADAPT::listeHypotheses; - ret->length(myStudyContext._mesHypotheses.size()); - std::map::const_iterator it; - int i = 0; - for (it = myStudyContext._mesHypotheses.begin(); - it != myStudyContext._mesHypotheses.end(); it++) - { - ret[i++] = CORBA::string_dup((*it).first.c_str()); - } - - return ret._retn(); -} -//============================================================================= -ADAPT::listeIterations* ADAPT_Gen_i::GetAllIterationsName() -{ - MESSAGE("GetAllIterationsName"); - IsValidStudy () ; - - ADAPT::listeIterations_var ret = new ADAPT::listeIterations; - ret->length(myStudyContext._mesIterations.size()); - std::map::const_iterator it; - int i = 0; - for (it = myStudyContext._mesIterations.begin(); - it != myStudyContext._mesIterations.end(); it++) - { - ret[i++] = CORBA::string_dup((*it).first.c_str()); - } - - return ret._retn(); -} -//============================================================================= -ADAPT::listeYACSs* ADAPT_Gen_i::GetAllYACSsName() -{ - MESSAGE("GetAllYACSsName"); - IsValidStudy () ; - - ADAPT::listeYACSs_var ret = new ADAPT::listeYACSs; - ret->length(myStudyContext._mesYACSs.size()); - std::map::const_iterator it; - int i = 0; - for (it = myStudyContext._mesYACSs.begin(); - it != myStudyContext._mesYACSs.end(); it++) - { - ret[i++] = CORBA::string_dup((*it).first.c_str()); - } - - return ret._retn(); -} -//============================================================================= -ADAPT::listeZones* ADAPT_Gen_i::GetAllZonesName() -{ - MESSAGE("GetAllZonesName"); - IsValidStudy () ; - - ADAPT::listeZones_var ret = new ADAPT::listeZones; - ret->length(myStudyContext._mesZones.size()); - std::map::const_iterator it; - int i = 0; - for (it = myStudyContext._mesZones.begin(); - it != myStudyContext._mesZones.end(); it++) - { - ret[i++] = CORBA::string_dup((*it).first.c_str()); - } - - return ret._retn(); -} -//============================================================================= -//============================================================================= - -//============================================================================= -//============================================================================= -// Recuperation des structures identifiees par leurs noms -//============================================================================= -//============================================================================= -ADAPT::HOMARD_Boundary_ptr ADAPT_Gen_i::GetBoundary(const char* nomBoundary) -{ - ADAPT::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[nomBoundary]; - ASSERT(!CORBA::is_nil(myBoundary)); - return ADAPT::HOMARD_Boundary::_duplicate(myBoundary); -} -//============================================================================= -ADAPT::HOMARD_Cas_ptr ADAPT_Gen_i::GetCase(const char* nomCas) -{ - ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; - ASSERT(!CORBA::is_nil(myCase)); - return ADAPT::HOMARD_Cas::_duplicate(myCase); -} -//============================================================================= -ADAPT::HOMARD_Hypothesis_ptr ADAPT_Gen_i::GetHypothesis(const char* nomHypothesis) -{ - ADAPT::HOMARD_Hypothesis_var myHypothesis = myStudyContext._mesHypotheses[nomHypothesis]; - ASSERT(!CORBA::is_nil(myHypothesis)); - return ADAPT::HOMARD_Hypothesis::_duplicate(myHypothesis); -} -//============================================================================= -ADAPT::HOMARD_Iteration_ptr ADAPT_Gen_i::GetIteration(const char* NomIterationation) -{ - ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[NomIterationation]; - ASSERT(!CORBA::is_nil(myIteration)); - return ADAPT::HOMARD_Iteration::_duplicate(myIteration); -} -//============================================================================= -ADAPT::HOMARD_YACS_ptr ADAPT_Gen_i::GetYACS(const char* nomYACS) -{ - ADAPT::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; - ASSERT(!CORBA::is_nil(myYACS)); - return ADAPT::HOMARD_YACS::_duplicate(myYACS); -} -//============================================================================= -ADAPT::HOMARD_Zone_ptr ADAPT_Gen_i::GetZone(const char* ZoneName) -{ - ADAPT::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName]; - ASSERT(!CORBA::is_nil(myZone)); - return ADAPT::HOMARD_Zone::_duplicate(myZone); -} -//============================================================================= -//============================================================================= - -//============================================================================= -//============================================================================= -// Informations -//============================================================================= -//============================================================================= -void ADAPT_Gen_i::MeshInfo(const char* nomCas, const char* MeshName, const char* MeshFile, const char* DirName, CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte) -{ - INFOS ( "MeshInfo : nomCas = " << nomCas << ", MeshName = " << MeshName << ", MeshFile = " << MeshFile ); - INFOS ( "Qual = " << Qual << ", Diam = " << Diam << ", Conn = " << Conn << ", Tail = " << Tail << ", Inte = " << Inte ); - IsValidStudy () ; - -// Creation du cas - int option = 1 ; - if ( _PublisMeshIN != 0 ) option = 2 ; - ADAPT::HOMARD_Cas_ptr myCase = CreateCase0(nomCas, MeshName, MeshFile, 1, 0, option) ; - myCase->SetDirName(DirName) ; -// Analyse - myCase->MeshInfo(Qual, Diam, Conn, Tail, Inte) ; - - return ; -} -//============================================================================= -//============================================================================= - -//============================================================================= -//============================================================================= -// Recuperation des structures par le contexte -//============================================================================= -//============================================================================= -ADAPT::HOMARD_Iteration_ptr ADAPT_Gen_i::LastIteration(const char* nomCas) -{ - ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; - ASSERT(!CORBA::is_nil(myCase)); -// - ADAPT::HOMARD_Iteration_var myIteration = myCase->LastIteration(); - ASSERT(!CORBA::is_nil(myIteration)); -// - return ADAPT::HOMARD_Iteration::_duplicate(myIteration); -} -//============================================================================= -//============================================================================= - -//============================================================================= -//============================================================================= -// Nouvelles structures -//============================================================================= -//============================================================================= -ADAPT::HOMARD_Cas_ptr ADAPT_Gen_i::newCase() -{ - ADAPT::ADAPT_Gen_var engine = POA_ADAPT::ADAPT_Gen::_this(); - HOMARD_Cas_i* aServant = new HOMARD_Cas_i(_orb, engine); - ADAPT::HOMARD_Cas_var aCase = ADAPT::HOMARD_Cas::_narrow(aServant->_this()); - return aCase._retn(); -} -//============================================================================= -ADAPT::HOMARD_Hypothesis_ptr ADAPT_Gen_i::newHypothesis() -{ - ADAPT::ADAPT_Gen_var engine = POA_ADAPT::ADAPT_Gen::_this(); - HOMARD_Hypothesis_i* aServant = new HOMARD_Hypothesis_i(_orb, engine); - ADAPT::HOMARD_Hypothesis_var aHypo = ADAPT::HOMARD_Hypothesis::_narrow(aServant->_this()); - return aHypo._retn(); -} -//============================================================================= -ADAPT::HOMARD_Iteration_ptr ADAPT_Gen_i::newIteration() -{ - ADAPT::ADAPT_Gen_var engine = POA_ADAPT::ADAPT_Gen::_this(); - HOMARD_Iteration_i* aServant = new HOMARD_Iteration_i(_orb, engine); - ADAPT::HOMARD_Iteration_var aIter = ADAPT::HOMARD_Iteration::_narrow(aServant->_this()); - return aIter._retn(); -} -//============================================================================= -ADAPT::HOMARD_Boundary_ptr ADAPT_Gen_i::newBoundary() -{ - ADAPT::ADAPT_Gen_var engine = POA_ADAPT::ADAPT_Gen::_this(); - HOMARD_Boundary_i* aServant = new HOMARD_Boundary_i(_orb, engine); - ADAPT::HOMARD_Boundary_var aBoundary = ADAPT::HOMARD_Boundary::_narrow(aServant->_this()); - return aBoundary._retn(); -} -//============================================================================= -ADAPT::HOMARD_Zone_ptr ADAPT_Gen_i::newZone() -{ - ADAPT::ADAPT_Gen_var engine = POA_ADAPT::ADAPT_Gen::_this(); - HOMARD_Zone_i* aServant = new HOMARD_Zone_i(_orb, engine); - ADAPT::HOMARD_Zone_var aZone = ADAPT::HOMARD_Zone::_narrow(aServant->_this()); - return aZone._retn(); -} -//============================================================================= -ADAPT::HOMARD_YACS_ptr ADAPT_Gen_i::newYACS() -{ - ADAPT::ADAPT_Gen_var engine = POA_ADAPT::ADAPT_Gen::_this(); - HOMARD_YACS_i* aServant = new HOMARD_YACS_i(_orb, engine); - ADAPT::HOMARD_YACS_var aYACS = ADAPT::HOMARD_YACS::_narrow(aServant->_this()); - return aYACS._retn(); -} -//============================================================================= -//============================================================================= - -//============================================================================= -//============================================================================= -// Creation des structures identifiees par leurs noms -//============================================================================= -//============================================================================= -ADAPT::HOMARD_Cas_ptr ADAPT_Gen_i::CreateCase(const char* nomCas, const char* MeshName, const char* MeshFile) -// -// Creation d'un cas initial -// nomCas : nom du cas a creer -// MeshName, MeshFile : nom et fichier du maillage correspondant -// -{ - INFOS ( "CreateCase : nomCas = " << nomCas << ", MeshName = " << MeshName << ", MeshFile = " << MeshFile ); - - int option = 1 ; - if ( _PublisMeshIN != 0 ) option = 2 ; - ADAPT::HOMARD_Cas_ptr myCase = CreateCase0(nomCas, MeshName, MeshFile, 0, 0, option) ; - -// Valeurs par defaut des filtrages - myCase->SetPyram(0); - - return ADAPT::HOMARD_Cas::_duplicate(myCase); -} -//============================================================================= -ADAPT::HOMARD_Cas_ptr ADAPT_Gen_i::CreateCaseFromIteration(const char* nomCas, const char* DirNameStart) -// -// nomCas : nom du cas a creer -// DirNameStart : nom du répertoire contenant l'iteration de reprise -// -{ - INFOS ( "CreateCaseFromIteration : nomCas = " << nomCas << ", DirNameStart = " << DirNameStart ); - std::string nomDirWork = getenv("PWD") ; - int codret ; - - // A. Decodage du point de reprise - // A.1. Controle du répertoire de depart de l'iteration - codret = CHDIR(DirNameStart) ; - if ( codret != 0 ) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "The directory of the iteration does not exist."; - throw SALOME::SALOME_Exception(es); - return 0; - }; - // A.2. Reperage des fichiers du répertoire de reprise - std::string file_configuration = "" ; - std::string file_maillage_homard = "" ; - int bilan ; -#ifndef WIN32 - DIR *dp; - struct dirent *dirp; - dp = opendir(DirNameStart); - while ( (dirp = readdir(dp)) != NULL ) - { - std::string file_name(dirp->d_name); -// MESSAGE ( file_name ); - bilan = file_name.find("HOMARD.Configuration.") ; - if ( bilan != string::npos ) { file_configuration = file_name ; } - bilan = file_name.find("maill.") ; - if ( bilan != string::npos ) - { - bilan = file_name.find(".hom.med") ; - if ( bilan != string::npos ) { file_maillage_homard = file_name ; } - } - } - closedir(dp); -#else - HANDLE hFind = INVALID_HANDLE_VALUE; - WIN32_FIND_DATA ffd; - hFind = FindFirstFile(DirNameStart, &ffd); - if (INVALID_HANDLE_VALUE != hFind) { - while (FindNextFile(hFind, &ffd) != 0) { - if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories - std::string file_name(ffd.cFileName); - bilan = file_name.find("HOMARD.Configuration.") ; - if ( bilan != string::npos ) { file_configuration = file_name ; } - bilan = file_name.find("maill.") ; - if ( bilan != string::npos ) - { - bilan = file_name.find(".hom.med") ; - if ( bilan != string::npos ) { file_maillage_homard = file_name ; } - } - } - FindClose(hFind); - } -#endif - MESSAGE ( "==> file_configuration : " << file_configuration ) ; - MESSAGE ( "==> file_maillage_homard : " << file_maillage_homard ) ; - // A.3. Controle - if ( ( file_configuration == "" ) || ( file_maillage_homard == "" ) ) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - std::string text ; - if ( file_configuration == "" ) { text = "The configuration file cannot be found." ; } - else { text = "The HOMARD mesh file cannot be found." ; } - es.text = CORBA::string_dup(text.c_str()); - throw SALOME::SALOME_Exception(es); - } - - // B. Lecture du fichier de configuration - // ATTENTION : on doit veiller a la coherence entre HomardDriver et CreateCaseFromIteration - int NumeIter ; - int TypeExt = 0 ; - int TypeConf = 0 ; - int Pyram = 0 ; - char* MeshName ; - char* MeshFile ; - // le constructeur de ifstream permet d'ouvrir un fichier en lecture - std::ifstream fichier( file_configuration.c_str() ); - if ( fichier ) // ce test échoue si le fichier n'est pas ouvert - { - std::string ligne; // variable contenant chaque ligne lue - std::string mot_cle; - std::string argument; - int decalage; - // cette boucle sur les lignes s'arrête dès qu'une erreur de lecture survient - while ( std::getline( fichier, ligne ) ) - { - // B.1. Pour la ligne courante, on identifie le premier mot : le mot-cle - std::istringstream ligne_bis(ligne); // variable contenant chaque ligne sous forme de flux - ligne_bis >> mot_cle ; - // B.2. Des valeurs entieres : le second bloc de la ligne - if ( mot_cle == "NumeIter" ) - { - ligne_bis >> NumeIter ; - NumeIter += 1 ; - } - // B.3. Des valeurs caracteres brutes : le second bloc de la ligne est la valeur - else if ( ( mot_cle == "TypeConf" ) || ( mot_cle == "TypeElem" ) ) - { - ligne_bis >> argument ; - - if ( mot_cle == "TypeConf" ) - { - if ( argument == "conforme" ) { TypeConf = 1 ; } - else if ( argument == "non_conforme_1_noeud" ) { TypeConf = 2 ; } - else if ( argument == "non_conforme_1_arete" ) { TypeConf = 3 ; } - else if ( argument == "non_conforme_indicateur" ) { TypeConf = 4 ; } - } - else if ( mot_cle == "TypeElem" ) - { - if ( argument == "ignore_pyra" ) { Pyram = 1 ; } - else if ( argument == "HOMARD" ) { Pyram = 0 ; } - } - } - // B.4. Des valeurs caracteres : le deuxieme bloc de la ligne peut etre encadre par des quotes : - // il faut les supprimer - else if ( ( mot_cle == "CCNoMNP1" ) || ( mot_cle == "CCMaiNP1" ) ) - { - ligne_bis >> argument ; - if ( argument[0] == '"' ) { decalage = 1 ; } - else { decalage = 0 ; } - size_t size = argument.size() + 1 - 2*decalage ; - - if ( mot_cle == "CCNoMNP1" ) - { - MeshName = new char[ size ]; - strncpy( MeshName, argument.c_str()+decalage, size ); - MeshName[size-1] = '\0' ; - } - else if ( mot_cle == "CCMaiNP1" ) - { - MeshFile = new char[ size ]; - strncpy( MeshFile, argument.c_str()+decalage, size ); - MeshFile[size-1] = '\0' ; - } - } - } - MESSAGE ( "==> TypeConf : " << TypeConf ) ; - MESSAGE ( "==> MeshName : " << MeshName ) ; - MESSAGE ( "==> MeshFile : " << MeshFile ) ; - MESSAGE ( "==> NumeIter : " << NumeIter ) ; - MESSAGE ( "==> Pyram : " << Pyram ) ; - } - else - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - std::string text = "The configuration file cannot be read." ; - es.text = CORBA::string_dup(text.c_str()); - throw SALOME::SALOME_Exception(es); - } - - // C. Creation effective du cas - - int option = 1 ; - if ( _PublisMeshIN != 0 ) option = 2 ; - ADAPT::HOMARD_Cas_ptr myCase = CreateCase0(nomCas, MeshName, MeshFile, 1, NumeIter, option) ; - - // D. Parametrages lus dans le fichier de configuration - - myCase->SetConfType (TypeConf) ; - myCase->SetExtType (TypeExt) ; - myCase->SetPyram (Pyram) ; - - // E. Copie du fichier de maillage homard - // E.1. Répertoire associe au cas - char* nomDirCase = myCase->GetDirName() ; - // E.2. Répertoire associe a l'iteration de ce cas - char* IterName ; - IterName = myCase->GetIter0Name() ; - ADAPT::HOMARD_Iteration_var Iter = GetIteration(IterName) ; - char* nomDirIter = CreateDirNameIter(nomDirCase, 0 ); - Iter->SetDirNameLoc(nomDirIter); - std::string nomDirIterTotal ; - nomDirIterTotal = std::string(nomDirCase) + "/" + std::string(nomDirIter) ; -#ifndef WIN32 - if (mkdir(nomDirIterTotal.c_str(), S_IRWXU|S_IRGRP|S_IXGRP) != 0) -#else - if (_mkdir(nomDirIterTotal.c_str()) != 0) -#endif - { - MESSAGE ( "nomDirIterTotal : " << nomDirIterTotal ) ; - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - std::string text = "The directory for the computation cannot be created." ; - es.text = CORBA::string_dup(text.c_str()); - throw SALOME::SALOME_Exception(es); - } - // E.3. Copie du maillage HOMARD au format MED - codret = CHDIR(DirNameStart) ; - std::string commande = "cp " + file_maillage_homard + " " + nomDirIterTotal ; - MESSAGE ( "commande : " << commande ) ; - codret = system(commande.c_str()) ; - MESSAGE ( "codret : " << codret ) ; - if ( codret != 0 ) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "The starting point for the case cannot be copied into the working directory."; - throw SALOME::SALOME_Exception(es); - return 0; - }; - - // F. Menage - - delete[] MeshName ; - delete[] MeshFile ; - - CHDIR(nomDirWork.c_str()); - return ADAPT::HOMARD_Cas::_duplicate(myCase); -} -//============================================================================= -ADAPT::HOMARD_Cas_ptr ADAPT_Gen_i::CreateCaseFromCaseLastIteration(const char* nomCas, const char* DirNameStart) -// -// nomCas : nom du cas a creer -// DirNameStart : nom du répertoire du cas contenant l'iteration de reprise -// -{ - INFOS ( "CreateCaseFromCaseLastIteration : nomCas = " << nomCas << ", DirNameStart = " << DirNameStart ); - - std::string DirNameStartIter = CreateCase1(DirNameStart, -1) ; - - DirNameStartIter = string(DirNameStart) + "/" + DirNameStartIter ; - ADAPT::HOMARD_Cas_ptr myCase = CreateCaseFromIteration(nomCas, DirNameStartIter.c_str()) ; - - return ADAPT::HOMARD_Cas::_duplicate(myCase); -} -//============================================================================= -ADAPT::HOMARD_Cas_ptr ADAPT_Gen_i::CreateCaseFromCaseIteration(const char* nomCas, const char* DirNameStart, CORBA::Long Number) -// -// nomCas : nom du cas a creer -// DirNameStart : nom du répertoire du cas contenant l'iteration de reprise -// Number : numero de l'iteration de depart -// -{ - INFOS ( "CreateCaseFromCaseIteration : nomCas = " << nomCas << ", DirNameStart = " << DirNameStart << ", Number = " << Number ); - if ( Number < 0 ) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "The number of iteration must be positive."; - throw SALOME::SALOME_Exception(es); - return 0; - }; - - std::string DirNameStartIter = CreateCase1(DirNameStart, Number) ; - - DirNameStartIter = string(DirNameStart) + "/" + DirNameStartIter ; - ADAPT::HOMARD_Cas_ptr myCase = CreateCaseFromIteration(nomCas, DirNameStartIter.c_str()) ; - - return ADAPT::HOMARD_Cas::_duplicate(myCase); -} -//============================================================================= -std::string ADAPT_Gen_i::CreateCase1(const char* DirNameStart, CORBA::Long Number) -// -// Retourne le nom du répertoire ou se trouve l'iteration voulue. -// DirNameStart : nom du répertoire du cas contenant l'iteration de reprise -// Number : numero de l'iteration de depart ou -1 si on cherche la derniere -// -{ - MESSAGE ( "CreateCase1 : DirNameStart = " << DirNameStart << ", Number = " << Number ); - std::string nomDirWork = getenv("PWD") ; - std::string DirNameStartIter ; - int codret ; - int NumeIterMax = -1 ; - - // A.1. Controle du répertoire de depart du cas - codret = CHDIR(DirNameStart) ; - if ( codret != 0 ) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "The directory of the case for the pursuit does not exist."; - throw SALOME::SALOME_Exception(es); - return 0; - }; - // A.2. Reperage des sous-répertoire du répertoire de reprise - bool existe = false ; -#ifndef WIN32 - DIR *dp; - struct dirent *dirp; - dp = opendir(DirNameStart); - while ( (dirp = readdir(dp)) != NULL ) { - std::string DirName_1(dirp->d_name); -#else - HANDLE hFind = INVALID_HANDLE_VALUE; - WIN32_FIND_DATA ffd; - hFind = FindFirstFile(DirNameStart, &ffd); - if (INVALID_HANDLE_VALUE != hFind) { - while (FindNextFile(hFind, &ffd) != 0) { - std::string DirName_1 = ""; - if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - DirName_1 = std::string(ffd.cFileName); - } -#endif - if ( ( DirName_1 != "." ) && ( DirName_1 != ".." ) ) - { - if ( CHDIR(DirName_1.c_str()) == 0 ) - { -// On cherche le fichier de configuration dans ce sous-répertoire - codret = CHDIR(DirNameStart); -#ifndef WIN32 - DIR *dp_1; - struct dirent *dirp_1; - dp_1 = opendir(DirName_1.c_str()) ; - while ( (dirp_1 = readdir(dp_1)) != NULL ) - { - std::string file_name_1(dirp_1->d_name); -#else - HANDLE hFind1 = INVALID_HANDLE_VALUE; - WIN32_FIND_DATA ffd1; - hFind1 = FindFirstFile(DirName_1.c_str(), &ffd1); - while (FindNextFile(hFind1, &ffd1) != 0) - { - if (ffd1.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories - std::string file_name_1(ffd1.cFileName); -#endif - int bilan = file_name_1.find("HOMARD.Configuration.") ; - if ( bilan != string::npos ) - { - // Decodage du fichier pour trouver le numero d'iteration - CHDIR(DirName_1.c_str()) ; - - std::ifstream fichier( file_name_1.c_str() ); - if ( fichier ) // ce test échoue si le fichier n'est pas ouvert - { - int NumeIter ; - std::string ligne; // variable contenant chaque ligne lue - std::string mot_cle; - // cette boucle sur les lignes s'arrête dès qu'une erreur de lecture survient - while ( std::getline( fichier, ligne ) ) - { - // B.1. Pour la ligne courante, on identifie le premier mot : le mot-cle - std::istringstream ligne_bis(ligne); // variable contenant chaque ligne sous forme de flux - ligne_bis >> mot_cle ; - if ( mot_cle == "NumeIter" ) - { - ligne_bis >> NumeIter ; - NumeIter += 1 ; -// MESSAGE ( "==> NumeIter : " << NumeIter ) ; - if ( Number == - 1 ) - { - if ( NumeIter >= NumeIterMax ) - { - NumeIterMax = NumeIter ; - DirNameStartIter = DirName_1 ; - } - } - else - { - if ( NumeIter == Number ) - { - DirNameStartIter = DirName_1 ; - existe = true ; - break ; - } - } - } - } - } - else - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - std::string text = "The configuration file cannot be read." ; - es.text = CORBA::string_dup(text.c_str()); - throw SALOME::SALOME_Exception(es); - } - CHDIR(DirNameStart) ; - } - if ( existe ) { break ; } - } -#ifndef WIN32 - closedir(dp_1); -#else - FindClose(hFind1); -#endif - if ( existe ) { break ; } - } - } - } -#ifndef WIN32 - closedir(dp); -#else - FindClose(hFind); -#endif - CHDIR(nomDirWork.c_str()); - - if ( ( Number >= 0 && ( !existe ) ) || ( Number < 0 && ( NumeIterMax == -1 ) ) ) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "The directory of the iteration does not exist."; - throw SALOME::SALOME_Exception(es); - return 0; - }; - - return DirNameStartIter ; -} -//============================================================================= -ADAPT::HOMARD_Cas_ptr ADAPT_Gen_i::CreateCase0(const char* nomCas, const char* MeshName, const char* MeshFile, CORBA::Long MeshOption, CORBA::Long NumeIter, CORBA::Long Option) -// -// nomCas : nom du cas a creer -// MeshName, MeshFile : nom et fichier du maillage correspondant -// MeshOption : 0 : le maillage fourni est obligatoirement present ==> erreur si absent -// 1 : le maillage fourni peut ne pas exister ==> on continue si absent -// -1 : le maillage n'est pas fourni -// NumeIter : numero de l'iteration correspondante : 0, pour un depart, n>0 pour une poursuite -// Option : multiple de nombres premiers -// 1 : aucune option -// x2 : publication du maillage dans SMESH -{ - MESSAGE ( "CreateCase0 : nomCas = " << nomCas ); - MESSAGE ( "CreateCase0 : MeshName = " << MeshName << ", MeshFile = " << MeshFile << ", MeshOption = " << MeshOption ); - MESSAGE ( "CreateCase0 : NumeIter = " << NumeIter << ", Option = " << Option ); -// - // A. Controles - // A.1. L'etude - IsValidStudy () ; - - // A.2. Controle du nom : - if ((myStudyContext._mesCas).find(nomCas)!=(myStudyContext._mesCas).end()) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "This case has already been defined."; - throw SALOME::SALOME_Exception(es); - return 0; - }; - - // A.3. Controle du fichier du maillage - int existeMeshFile ; - if ( MeshOption >= 0 ) - { - existeMeshFile = MEDFileExist ( MeshFile ) ; - MESSAGE ( "CreateCase0 : existeMeshFile = " << existeMeshFile ); - if ( ( existeMeshFile == 0 ) && ( MeshOption == 0 ) ) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "The mesh file does not exist."; - throw SALOME::SALOME_Exception(es); - return 0; - } - } - else { existeMeshFile = 0 ; } - - // B. Creation de l'objet cas et publication -// MESSAGE ( "CreateCase0 : Creation de l'objet" ); - ADAPT::HOMARD_Cas_var myCase = newCase(); - myCase->SetName(nomCas); - SALOMEDS::SObject_var aSO; - SALOMEDS::SObject_var aResultSO=PublishInStudy(aSO, myCase, nomCas); - myStudyContext._mesCas[nomCas] = myCase; - - // C. Caracteristiques du maillage - if ( existeMeshFile != 0 ) - { - // Les valeurs extremes des coordonnées -// MESSAGE ( "CreateCase0 : Les valeurs extremes des coordonnées" ); - std::vector LesExtremes =GetBoundingBoxInMedFile(MeshFile) ; - ADAPT::extrema_var aSeq = new ADAPT::extrema() ; - if (LesExtremes.size()!=10) { return 0; } - aSeq->length(10) ; - for (int i =0 ; i< LesExtremes.size() ; i++) - aSeq[i]=LesExtremes[i] ; - myCase->SetBoundingBox(aSeq) ; - // Les groupes -// MESSAGE ( "CreateCase0 : Les groupes" ); - std::set LesGroupes =GetListeGroupesInMedFile(MeshFile) ; - ADAPT::ListGroupType_var aSeqGroupe = new ADAPT::ListGroupType ; - aSeqGroupe->length(LesGroupes.size()); - std::set::const_iterator it ; - int i = 0 ; - for (it=LesGroupes.begin() ; it != LesGroupes.end() ; it++) - aSeqGroupe[i++]=(*it).c_str() ; - myCase->SetGroups(aSeqGroupe) ; - } - - // D. L'iteration initiale du cas - MESSAGE ( "CreateCase0 : iteration initiale du cas" ); - // D.1. Recherche d'un nom : par defaut, on prend le nom du maillage correspondant. - // Si ce nom d'iteration existe deja, on incremente avec 0, 1, 2, etc. - int monNum = 0; - std::string NomIteration = std::string(MeshName) ; - while ( (myStudyContext._mesIterations).find(NomIteration) != (myStudyContext._mesIterations.end()) ) - { - std::ostringstream nom; - nom << MeshName << monNum; - NomIteration = nom.str(); - monNum += 1; - } - MESSAGE ( "CreateCas0 : ==> NomIteration = " << NomIteration ); - - // D.2. Creation de l'iteration - ADAPT::HOMARD_Iteration_var anIter = newIteration(); - myStudyContext._mesIterations[NomIteration] = anIter; - anIter->SetName(NomIteration.c_str()); - AssociateCaseIter (nomCas, NomIteration.c_str(), "IterationHomard"); - - // D.4. Maillage correspondant - if ( existeMeshFile != 0 ) - { - anIter->SetMeshFile(MeshFile); - if ( Option % 2 == 0 ) { PublishResultInSmesh(MeshFile, 0); } - } - anIter->SetMeshName(MeshName); - - // D.5. Numero d'iteration - anIter->SetNumber(NumeIter); - - // D.6. Etat - SetEtatIter(NomIteration.c_str(), -NumeIter); -// - - return ADAPT::HOMARD_Cas::_duplicate(myCase); -} -//============================================================================= -ADAPT::HOMARD_Hypothesis_ptr ADAPT_Gen_i::CreateHypothesis(const char* nomHypothesis) -{ - INFOS ( "CreateHypothesis : nomHypothesis = " << nomHypothesis ); - IsValidStudy () ; - - // A. Controle du nom : - if ((myStudyContext._mesHypotheses).find(nomHypothesis) != (myStudyContext._mesHypotheses).end()) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "This hypothesis has already been defined."; - throw SALOME::SALOME_Exception(es); - return 0; - } - - // B. Creation de l'objet - ADAPT::HOMARD_Hypothesis_var myHypothesis = newHypothesis(); - if (CORBA::is_nil(myHypothesis)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Unable to create the hypothesis"; - throw SALOME::SALOME_Exception(es); - return 0; - }; - myHypothesis->SetName(nomHypothesis); - - // C. Enregistrement - myStudyContext._mesHypotheses[nomHypothesis] = myHypothesis; - - SALOMEDS::SObject_var aSO; - SALOMEDS::SObject_var aResultSO=PublishInStudy(aSO, myHypothesis, nomHypothesis); - - // D. Valeurs par defaut des options avancees - myHypothesis->SetNivMax(-1); - myHypothesis->SetDiamMin(-1.0); - myHypothesis->SetAdapInit(0); - myHypothesis->SetExtraOutput(1); - - return ADAPT::HOMARD_Hypothesis::_duplicate(myHypothesis); -} - -//============================================================================= -ADAPT::HOMARD_Iteration_ptr ADAPT_Gen_i::CreateIteration(const char* NomIteration, const char* nomIterParent) -//============================================================================= -{ - INFOS ("CreateIteration : NomIteration = " << NomIteration << ", nomIterParent = " << nomIterParent); - IsValidStudy () ; - - ADAPT::HOMARD_Iteration_var myIterationParent = myStudyContext._mesIterations[nomIterParent]; - if (CORBA::is_nil(myIterationParent)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "The parent iteration is not defined."; - throw SALOME::SALOME_Exception(es); - return 0; - }; - - const char* nomCas = myIterationParent->GetCaseName(); - MESSAGE ("CreateIteration : nomCas = " << nomCas); - ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; - if (CORBA::is_nil(myCase)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid case context"; - throw SALOME::SALOME_Exception(es); - return 0; - }; - const char* nomDirCase = myCase->GetDirName(); - - // Controle du nom : - if ((myStudyContext._mesIterations).find(NomIteration)!=(myStudyContext._mesIterations).end()) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "This iteration has already been defined."; - throw SALOME::SALOME_Exception(es); - return 0; - }; - - ADAPT::HOMARD_Iteration_var myIteration = newIteration(); - if (CORBA::is_nil(myIteration)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Unable to create the iteration"; - throw SALOME::SALOME_Exception(es); - return 0; - }; - myStudyContext._mesIterations[std::string(NomIteration)] = myIteration; -// Nom de l'iteration et du maillage - myIteration->SetName(NomIteration); - myIteration->SetMeshName(NomIteration); - myIteration->SetState(1); - - int numero = myIterationParent->GetNumber() + 1; - myIteration->SetNumber(numero); - -// Nombre d'iterations deja connues pour le cas, permettant -// la creation d'un sous-répertoire unique - int nbitercase = myCase->GetNumberofIter(); - char* nomDirIter = CreateDirNameIter(nomDirCase, nbitercase ); - myIteration->SetDirNameLoc(nomDirIter); - -// Le nom du fichier du maillage MED est indice par le nombre d'iterations du cas. -// Si on a une chaine unique depuis le depart, ce nombre est le meme que le -// numero d'iteration dans la sucession : maill.01.med, maill.02.med, etc... C'est la -// situation la plus frequente. -// Si on a plusieurs branches, donc des iterations du meme niveau d'adaptation, utiliser -// le nombre d'iterations du cas permet d'eviter les collisions. - int jaux ; - if ( nbitercase < 100 ) { jaux = 2 ; } - else if ( nbitercase < 1000 ) { jaux = 3 ; } - else if ( nbitercase < 10000 ) { jaux = 4 ; } - else if ( nbitercase < 100000 ) { jaux = 5 ; } - else { jaux = 9 ; } - std::ostringstream iaux ; - iaux << std::setw(jaux) << std::setfill('0') << nbitercase ; - std::stringstream MeshFile; - MeshFile << nomDirCase << "/maill." << iaux.str() << ".med"; - myIteration->SetMeshFile(MeshFile.str().c_str()); - -// Association avec le cas - std::string label = "IterationHomard_" + std::string(nomIterParent); - AssociateCaseIter(nomCas, NomIteration, label.c_str()); -// Lien avec l'iteration precedente - myIterationParent->LinkNextIteration(NomIteration); - myIteration->SetIterParentName(nomIterParent); - // Gestion de l'arbre d'etudes - SALOMEDS::SObject_var aIterSOParent = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIterationParent))); - SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration))); - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); - aStudyBuilder->NewCommand(); - SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aIterSO); - aStudyBuilder->Addreference(aSubSO, aIterSOParent); - aStudyBuilder->CommitCommand(); - - return ADAPT::HOMARD_Iteration::_duplicate(myIteration); -} -//============================================================================= -ADAPT::HOMARD_Boundary_ptr ADAPT_Gen_i::CreateBoundary(const char* BoundaryName, CORBA::Long BoundaryType) -{ - MESSAGE ("CreateBoundary : BoundaryName = " << BoundaryName << ", BoundaryType = " << BoundaryType); - IsValidStudy () ; - - // Controle du nom : - if ((myStudyContext._mesBoundarys).find(BoundaryName)!=(myStudyContext._mesBoundarys).end()) - { - MESSAGE ("CreateBoundary : la frontiere " << BoundaryName << " existe deja"); - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "This boundary has already been defined"; - throw SALOME::SALOME_Exception(es); - return 0; - }; - - ADAPT::HOMARD_Boundary_var myBoundary = newBoundary(); - myBoundary->SetName(BoundaryName); - myBoundary->SetType(BoundaryType); - - myStudyContext._mesBoundarys[BoundaryName] = myBoundary; - - SALOMEDS::SObject_var aSO; - SALOMEDS::SObject_var aResultSO=PublishInStudy(aSO, myBoundary, BoundaryName); - - return ADAPT::HOMARD_Boundary::_duplicate(myBoundary); -} -//============================================================================= -ADAPT::HOMARD_Boundary_ptr ADAPT_Gen_i::CreateBoundaryCAO(const char* BoundaryName, const char* CAOFile) -{ - INFOS ("CreateBoundaryCAO : BoundaryName = " << BoundaryName << ", CAOFile = " << CAOFile ); - ADAPT::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, -1); - myBoundary->SetDataFile( CAOFile ) ; - - return ADAPT::HOMARD_Boundary::_duplicate(myBoundary); -} -//============================================================================= -ADAPT::HOMARD_Boundary_ptr ADAPT_Gen_i::CreateBoundaryDi(const char* BoundaryName, const char* MeshName, const char* MeshFile) -{ - INFOS ("CreateBoundaryDi : BoundaryName = " << BoundaryName << ", MeshName = " << MeshName << ", MeshFile = " << MeshFile ); - ADAPT::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 0); - myBoundary->SetDataFile( MeshFile ) ; - myBoundary->SetMeshName( MeshName ) ; - - return ADAPT::HOMARD_Boundary::_duplicate(myBoundary); -} -//============================================================================= -ADAPT::HOMARD_Boundary_ptr ADAPT_Gen_i::CreateBoundaryCylinder(const char* BoundaryName, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, - CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, - CORBA::Double Rayon) -{ - INFOS ("CreateBoundaryCylinder : BoundaryName = " << BoundaryName ) ; -// - SALOME::ExceptionStruct es; - int error = 0 ; - if ( Rayon <= 0.0 ) - { es.text = "The radius must be positive." ; - error = 1 ; } - double daux = fabs(Xaxe) + fabs(Yaxe) + fabs(Zaxe) ; - if ( daux < 0.0000001 ) - { es.text = "The axis must be a non 0 vector." ; - error = 2 ; } - if ( error != 0 ) - { - es.type = SALOME::BAD_PARAM; - throw SALOME::SALOME_Exception(es); - return 0; - }; -// - ADAPT::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 1) ; - myBoundary->SetCylinder( Xcentre, Ycentre, Zcentre, Xaxe, Yaxe, Zaxe, Rayon ) ; - - return ADAPT::HOMARD_Boundary::_duplicate(myBoundary) ; -} -//============================================================================= -ADAPT::HOMARD_Boundary_ptr ADAPT_Gen_i::CreateBoundarySphere(const char* BoundaryName, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, - CORBA::Double Rayon) -{ - INFOS ("CreateBoundarySphere : BoundaryName = " << BoundaryName ) ; -// - SALOME::ExceptionStruct es; - int error = 0 ; - if ( Rayon <= 0.0 ) - { es.text = "The radius must be positive." ; - error = 1 ; } - if ( error != 0 ) - { - es.type = SALOME::BAD_PARAM; - throw SALOME::SALOME_Exception(es); - return 0; - }; -// - ADAPT::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 2) ; - myBoundary->SetSphere( Xcentre, Ycentre, Zcentre, Rayon ) ; - - return ADAPT::HOMARD_Boundary::_duplicate(myBoundary) ; -} -//============================================================================= -ADAPT::HOMARD_Boundary_ptr ADAPT_Gen_i::CreateBoundaryConeA(const char* BoundaryName, - CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, CORBA::Double Angle, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre) -{ - INFOS ("CreateBoundaryConeA : BoundaryName = " << BoundaryName ) ; -// - SALOME::ExceptionStruct es; - int error = 0 ; - if ( Angle <= 0.0 || Angle >= 90.0 ) - { es.text = "The angle must be included higher than 0 degree and lower than 90 degrees." ; - error = 1 ; } - double daux = fabs(Xaxe) + fabs(Yaxe) + fabs(Zaxe) ; - if ( daux < 0.0000001 ) - { es.text = "The axis must be a non 0 vector." ; - error = 2 ; } - if ( error != 0 ) - { - es.type = SALOME::BAD_PARAM; - throw SALOME::SALOME_Exception(es); - return 0; - }; -// - ADAPT::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 3) ; - myBoundary->SetConeA( Xaxe, Yaxe, Zaxe, Angle, Xcentre, Ycentre, Zcentre ) ; - - return ADAPT::HOMARD_Boundary::_duplicate(myBoundary) ; -} -//============================================================================= -ADAPT::HOMARD_Boundary_ptr ADAPT_Gen_i::CreateBoundaryConeR(const char* BoundaryName, - CORBA::Double Xcentre1, CORBA::Double Ycentre1, CORBA::Double Zcentre1, CORBA::Double Rayon1, - CORBA::Double Xcentre2, CORBA::Double Ycentre2, CORBA::Double Zcentre2, CORBA::Double Rayon2) -{ - INFOS ("CreateBoundaryConeR : BoundaryName = " << BoundaryName ) ; -// - SALOME::ExceptionStruct es; - int error = 0 ; - if ( Rayon1 < 0.0 || Rayon2 < 0.0 ) - { es.text = "The radius must be positive." ; - error = 1 ; } - double daux = fabs(Rayon2-Rayon1) ; - if ( daux < 0.0000001 ) - { es.text = "The radius must be different." ; - error = 2 ; } - daux = fabs(Xcentre2-Xcentre1) + fabs(Ycentre2-Ycentre1) + fabs(Zcentre2-Zcentre1) ; - if ( daux < 0.0000001 ) - { es.text = "The centers must be different." ; - error = 3 ; } - if ( error != 0 ) - { - es.type = SALOME::BAD_PARAM; - throw SALOME::SALOME_Exception(es); - return 0; - }; -// - ADAPT::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 4) ; - myBoundary->SetConeR( Xcentre1, Ycentre1, Zcentre1, Rayon1, Xcentre2, Ycentre2, Zcentre2, Rayon2 ) ; - - return ADAPT::HOMARD_Boundary::_duplicate(myBoundary) ; -} -//============================================================================= -ADAPT::HOMARD_Boundary_ptr ADAPT_Gen_i::CreateBoundaryTorus(const char* BoundaryName, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, - CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, - CORBA::Double RayonRev, CORBA::Double RayonPri) -{ - INFOS ("CreateBoundaryTorus : BoundaryName = " << BoundaryName ) ; -// - SALOME::ExceptionStruct es; - int error = 0 ; - if ( ( RayonRev <= 0.0 ) || ( RayonPri <= 0.0 ) ) - { es.text = "The radius must be positive." ; - error = 1 ; } - double daux = fabs(Xaxe) + fabs(Yaxe) + fabs(Zaxe) ; - if ( daux < 0.0000001 ) - { es.text = "The axis must be a non 0 vector." ; - error = 2 ; } - if ( error != 0 ) - { - es.type = SALOME::BAD_PARAM; - throw SALOME::SALOME_Exception(es); - return 0; - }; -// - ADAPT::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 5) ; - myBoundary->SetTorus( Xcentre, Ycentre, Zcentre, Xaxe, Yaxe, Zaxe, RayonRev, RayonPri ) ; - - return ADAPT::HOMARD_Boundary::_duplicate(myBoundary) ; -} -//============================================================================= -ADAPT::HOMARD_Zone_ptr ADAPT_Gen_i::CreateZone(const char* ZoneName, CORBA::Long ZoneType) -{ - MESSAGE ("CreateZone : ZoneName = " << ZoneName << ", ZoneType = " << ZoneType); - IsValidStudy () ; - - // Controle du nom : - if ((myStudyContext._mesZones).find(ZoneName)!=(myStudyContext._mesZones).end()) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "This zone has already been defined"; - throw SALOME::SALOME_Exception(es); - return 0; - }; - - ADAPT::HOMARD_Zone_var myZone = newZone(); - myZone->SetName(ZoneName); - myZone->SetType(ZoneType); - - myStudyContext._mesZones[ZoneName] = myZone; - - SALOMEDS::SObject_var aSO; - SALOMEDS::SObject_var aResultSO=PublishInStudy(aSO, myZone, ZoneName); - - return ADAPT::HOMARD_Zone::_duplicate(myZone); -} -//============================================================================= -ADAPT::HOMARD_Zone_ptr ADAPT_Gen_i::CreateZoneBox(const char* ZoneName, - CORBA::Double Xmini, CORBA::Double Xmaxi, - CORBA::Double Ymini, CORBA::Double Ymaxi, - CORBA::Double Zmini, CORBA::Double Zmaxi) -{ - INFOS ("CreateZoneBox : ZoneName = " << ZoneName ) ; -// - SALOME::ExceptionStruct es; - int error = 0 ; - if ( Xmini > Xmaxi ) - { es.text = "The X coordinates are not coherent." ; - error = 1 ; } - if ( Ymini > Ymaxi ) - { es.text = "The Y coordinates are not coherent." ; - error = 2 ; } - if ( Zmini > Zmaxi ) - { es.text = "The Z coordinates are not coherent." ; - error = 3 ; } - if ( error != 0 ) - { - es.type = SALOME::BAD_PARAM; - throw SALOME::SALOME_Exception(es); - return 0; - }; -// - ADAPT::HOMARD_Zone_var myZone = CreateZone(ZoneName, 2) ; - myZone->SetBox ( Xmini, Xmaxi, Ymini, Ymaxi, Zmini, Zmaxi) ; - - return ADAPT::HOMARD_Zone::_duplicate(myZone) ; -} -//============================================================================= -ADAPT::HOMARD_Zone_ptr ADAPT_Gen_i::CreateZoneSphere(const char* ZoneName, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, CORBA::Double Rayon) -{ - INFOS ("CreateZoneSphere : ZoneName = " << ZoneName ) ; -// - SALOME::ExceptionStruct es; - int error = 0 ; - if ( Rayon <= 0.0 ) - { es.text = "The radius must be positive." ; - error = 1 ; } - if ( error != 0 ) - { - es.type = SALOME::BAD_PARAM; - throw SALOME::SALOME_Exception(es); - return 0; - }; -// - ADAPT::HOMARD_Zone_var myZone = CreateZone(ZoneName, 4) ; - myZone->SetSphere( Xcentre, Ycentre, Zcentre, Rayon ) ; - - return ADAPT::HOMARD_Zone::_duplicate(myZone) ; -} -//============================================================================= -ADAPT::HOMARD_Zone_ptr ADAPT_Gen_i::CreateZoneCylinder(const char* ZoneName, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, - CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, - CORBA::Double Rayon, CORBA::Double Haut) -{ - INFOS ("CreateZoneCylinder : ZoneName = " << ZoneName ) ; -// - SALOME::ExceptionStruct es; - int error = 0 ; - if ( Rayon <= 0.0 ) - { es.text = "The radius must be positive." ; - error = 1 ; } - double daux = fabs(Xaxe) + fabs(Yaxe) + fabs(Zaxe) ; - if ( daux < 0.0000001 ) - { es.text = "The axis must be a non 0 vector." ; - error = 2 ; } - if ( Haut <= 0.0 ) - { es.text = "The height must be positive." ; - error = 3 ; } - if ( error != 0 ) - { - es.type = SALOME::BAD_PARAM; - throw SALOME::SALOME_Exception(es); - return 0; - }; -// - ADAPT::HOMARD_Zone_var myZone = CreateZone(ZoneName, 5) ; - myZone->SetCylinder( Xcentre, Ycentre, Zcentre, Xaxe, Yaxe, Zaxe, Rayon, Haut ) ; - - return ADAPT::HOMARD_Zone::_duplicate(myZone) ; -} -//============================================================================= -ADAPT::HOMARD_Zone_ptr ADAPT_Gen_i::CreateZonePipe(const char* ZoneName, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, - CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, - CORBA::Double Rayon, CORBA::Double Haut, CORBA::Double Rayonint) -{ - INFOS ("CreateZonePipe : ZoneName = " << ZoneName ) ; -// - SALOME::ExceptionStruct es; - int error = 0 ; - if ( Rayon <= 0.0 || Rayonint <= 0.0 ) - { es.text = "The radius must be positive." ; - error = 1 ; } - double daux = fabs(Xaxe) + fabs(Yaxe) + fabs(Zaxe) ; - if ( daux < 0.0000001 ) - { es.text = "The axis must be a non 0 vector." ; - error = 2 ; } - if ( Haut <= 0.0 ) - { es.text = "The height must be positive." ; - error = 3 ; } - if ( Rayon <= Rayonint ) - { es.text = "The external radius must be higher than the internal radius." ; - error = 4 ; } - if ( error != 0 ) - { - es.type = SALOME::BAD_PARAM; - throw SALOME::SALOME_Exception(es); - return 0; - }; -// - ADAPT::HOMARD_Zone_var myZone = CreateZone(ZoneName, 7) ; - myZone->SetPipe( Xcentre, Ycentre, Zcentre, Xaxe, Yaxe, Zaxe, Rayon, Haut, Rayonint ) ; - - return ADAPT::HOMARD_Zone::_duplicate(myZone) ; -} -//============================================================================= -ADAPT::HOMARD_Zone_ptr ADAPT_Gen_i::CreateZoneBox2D(const char* ZoneName, - CORBA::Double Umini, CORBA::Double Umaxi, - CORBA::Double Vmini, CORBA::Double Vmaxi, - CORBA::Long Orient) -{ - INFOS ("CreateZoneBox2D : ZoneName = " << ZoneName ) ; -// MESSAGE ("Umini = " << Umini << ", Umaxi =" << Umaxi ) ; -// MESSAGE ("Vmini = " << Vmini << ", Vmaxi =" << Vmaxi ) ; -// MESSAGE ("Orient = " << Orient ) ; -// - SALOME::ExceptionStruct es; - int error = 0 ; - if ( Umini > Umaxi ) - { es.text = "The first coordinates are not coherent." ; - error = 1 ; } - if ( Vmini > Vmaxi ) - { es.text = "The second coordinates are not coherent." ; - error = 2 ; } - if ( Orient < 1 || Orient > 3 ) - { es.text = "The orientation must be 1, 2 or 3." ; - error = 3 ; } - if ( error != 0 ) - { - es.type = SALOME::BAD_PARAM; - throw SALOME::SALOME_Exception(es); - return 0; - }; -// - double Xmini, Xmaxi ; - double Ymini, Ymaxi ; - double Zmini, Zmaxi ; - if ( Orient == 1 ) - { Xmini = Umini ; - Xmaxi = Umaxi ; - Ymini = Vmini ; - Ymaxi = Vmaxi ; - Zmini = 0. ; - Zmaxi = 0. ; } - else if ( Orient == 2 ) - { Xmini = 0. ; - Xmaxi = 0. ; - Ymini = Umini ; - Ymaxi = Umaxi ; - Zmini = Vmini ; - Zmaxi = Vmaxi ; } - else if ( Orient == 3 ) - { Xmini = Vmini ; - Xmaxi = Vmaxi ; - Ymini = 0. ; - Ymaxi = 0. ; - Zmini = Umini ; - Zmaxi = Umaxi ; } - else { VERIFICATION( (Orient>=1) && (Orient<=3) ) ; } - - ADAPT::HOMARD_Zone_var myZone = CreateZone(ZoneName, 10+Orient) ; - myZone->SetBox ( Xmini, Xmaxi, Ymini, Ymaxi, Zmini, Zmaxi) ; - - return ADAPT::HOMARD_Zone::_duplicate(myZone) ; -} -//============================================================================= -ADAPT::HOMARD_Zone_ptr ADAPT_Gen_i::CreateZoneDisk(const char* ZoneName, - CORBA::Double Ucentre, CORBA::Double Vcentre, - CORBA::Double Rayon, - CORBA::Long Orient) -{ - INFOS ("CreateZoneDisk : ZoneName = " << ZoneName ) ; -// - SALOME::ExceptionStruct es; - int error = 0 ; - if ( Rayon <= 0.0 ) - { es.text = "The radius must be positive." ; - error = 1 ; } - if ( Orient < 1 || Orient > 3 ) - { es.text = "The orientation must be 1, 2 or 3." ; - error = 3 ; } - if ( error != 0 ) - { - es.type = SALOME::BAD_PARAM; - throw SALOME::SALOME_Exception(es); - return 0; - }; -// - double Xcentre ; - double Ycentre ; - double Zcentre ; - if ( Orient == 1 ) - { Xcentre = Ucentre ; - Ycentre = Vcentre ; - Zcentre = 0. ; } - else if ( Orient == 2 ) - { Xcentre = 0. ; - Ycentre = Ucentre ; - Zcentre = Vcentre ; } - else if ( Orient == 3 ) - { Xcentre = Vcentre ; - Ycentre = 0. ; - Zcentre = Ucentre ; } - else { VERIFICATION( (Orient>=1) && (Orient<=3) ) ; } - - ADAPT::HOMARD_Zone_var myZone = CreateZone(ZoneName, 30+Orient) ; - myZone->SetCylinder( Xcentre, Ycentre, Zcentre, 0., 0., 1., Rayon, 1. ) ; - - return ADAPT::HOMARD_Zone::_duplicate(myZone) ; -} -//============================================================================= -ADAPT::HOMARD_Zone_ptr ADAPT_Gen_i::CreateZoneDiskWithHole(const char* ZoneName, - CORBA::Double Ucentre, CORBA::Double Vcentre, - CORBA::Double Rayon, CORBA::Double Rayonint, - CORBA::Long Orient) -{ - INFOS ("CreateZoneDiskWithHole : ZoneName = " << ZoneName ) ; -// - SALOME::ExceptionStruct es; - int error = 0 ; - if ( Rayon <= 0.0 || Rayonint <= 0.0 ) - { es.text = "The radius must be positive." ; - error = 1 ; } - if ( Orient < 1 || Orient > 3 ) - { es.text = "The orientation must be 1, 2 or 3." ; - error = 3 ; } - if ( Rayon <= Rayonint ) - { es.text = "The external radius must be higher than the internal radius." ; - error = 4 ; } - if ( error != 0 ) - { - es.type = SALOME::BAD_PARAM; - throw SALOME::SALOME_Exception(es); - return 0; - }; -// - double Xcentre ; - double Ycentre ; - double Zcentre ; - if ( Orient == 1 ) - { Xcentre = Ucentre ; - Ycentre = Vcentre ; - Zcentre = 0. ; } - else if ( Orient == 2 ) - { Xcentre = 0. ; - Ycentre = Ucentre ; - Zcentre = Vcentre ; } - else if ( Orient == 3 ) - { Xcentre = Vcentre ; - Ycentre = 0. ; - Zcentre = Ucentre ; } - else { VERIFICATION( (Orient>=1) && (Orient<=3) ) ; } - - ADAPT::HOMARD_Zone_var myZone = CreateZone(ZoneName, 60+Orient) ; - myZone->SetPipe( Xcentre, Ycentre, Zcentre, 0., 0., 1., Rayon, 1., Rayonint ) ; - - return ADAPT::HOMARD_Zone::_duplicate(myZone) ; -} -//============================================================================= -//============================================================================= - - - - -//============================================================================= -//============================================================================= -// Traitement d'une iteration -// etatMenage = 1 : destruction du répertoire d'execution -// modeHOMARD = 1 : adaptation -// != 1 : information avec les options modeHOMARD -// Option1 >0 : appel depuis python -// <0 : appel depuis GUI -// Option2 : multiple de nombres premiers -// 1 : aucune option -// x2 : publication du maillage dans SMESH -//============================================================================= -CORBA::Long ADAPT_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMenage, CORBA::Long modeHOMARD, CORBA::Long Option1, CORBA::Long Option2) -{ - INFOS ( "Compute : traitement de " << NomIteration << ", avec modeHOMARD = " << modeHOMARD << ", Option1 = " << Option1 << ", Option2 = " << Option2 ); - - // A. Prealable - int codret = 0; - - // A.1. L'objet iteration - ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[NomIteration]; - ASSERT(!CORBA::is_nil(myIteration)); - - // A.2. Controle de la possibilite d'agir - // A.2.1. Etat de l'iteration - int etat = myIteration->GetState(); - MESSAGE ( "etat = "<GetNumber(); - std::string siterp1 ; - std::stringstream saux1 ; - saux1 << NumeIter ; - siterp1 = saux1.str() ; - if (NumeIter < 10) { siterp1 = "0" + siterp1 ; } - - std::string siter ; - if ( modeHOMARD==1 ) - { - std::stringstream saux0 ; - int iaux = max(0, NumeIter-1) ; - saux0 << iaux ; - siter = saux0.str() ; - if (NumeIter < 11) { siter = "0" + siter ; } - } - else - { siter = siterp1 ; } - - // A.4. Le cas - const char* nomCas = myIteration->GetCaseName(); - ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; - ASSERT(!CORBA::is_nil(myCase)); - - // B. Les répertoires - // B.1. Le répertoire courant - std::string nomDirWork = getenv("PWD") ; - // B.2. Le sous-répertoire de l'iteration a traiter - char* DirCompute = ComputeDirManagement(myCase, myIteration, etatMenage); - MESSAGE( ". DirCompute = " << DirCompute ); - - // C. Le fichier des messages - // C.1. Le deroulement de l'execution de HOMARD - std::string LogFile = DirCompute ; - LogFile += "/Liste" ; - if ( modeHOMARD == 1 ) { LogFile += "." + siter + ".vers." + siterp1 ; } - LogFile += ".log" ; - MESSAGE (". LogFile = " << LogFile); - if ( modeHOMARD == 1 ) { myIteration->SetLogFile(LogFile.c_str()); } - // C.2. Le bilan de l'analyse du maillage - std::string FileInfo = DirCompute ; - FileInfo += "/" ; - if ( modeHOMARD == 1 ) { FileInfo += "apad" ; } - else - { if ( NumeIter == 0 ) { FileInfo += "info_av" ; } - else { FileInfo += "info_ap" ; } - } - FileInfo += "." + siterp1 + ".bilan" ; - myIteration->SetFileInfo(FileInfo.c_str()); - - // D. On passe dans le répertoire de l'iteration a calculer - MESSAGE ( ". On passe dans DirCompute = " << DirCompute ); - CHDIR(DirCompute); - - // E. Les données de l'exécution HOMARD - // E.1. L'objet du texte du fichier de configuration - HomardDriver* myDriver = new HomardDriver(siter, siterp1); - myDriver->TexteInit(DirCompute, LogFile, _Langue); - - // E.2. Le maillage associe a l'iteration - const char* NomMesh = myIteration->GetMeshName(); - MESSAGE ( ". NomMesh = " << NomMesh ); - const char* MeshFile = myIteration->GetMeshFile(); - MESSAGE ( ". MeshFile = " << MeshFile ); - - // E.3. Les données du traitement HOMARD - int iaux ; - if ( modeHOMARD == 1 ) - { - iaux = 1 ; - myDriver->TexteMaillageHOMARD( DirCompute, siterp1, iaux ) ; - myDriver->TexteMaillage(NomMesh, MeshFile, 1); - codret = ComputeAdap(myCase, myIteration, etatMenage, myDriver, Option1, Option2) ; - } - else - { - InvalideIterInfo(NomIteration); - myDriver->TexteInfo( modeHOMARD, NumeIter ) ; - iaux = 0 ; - myDriver->TexteMaillageHOMARD( DirCompute, siterp1, iaux ) ; - myDriver->TexteMaillage(NomMesh, MeshFile, 0); - myDriver->CreeFichierDonn(); - } - - // E.4. Ajout des informations liees a l'eventuel suivi de frontiere - int BoundaryOption = DriverTexteBoundary(myCase, myDriver) ; - - // E.5. Ecriture du texte dans le fichier - MESSAGE ( ". Ecriture du texte dans le fichier de configuration ; codret = "<CreeFichier(); } - -// G. Execution -// - int codretexec = 1789 ; - if (codret == 0) - { - codretexec = myDriver->ExecuteHomard(Option1); -// - MESSAGE ( "Erreur en executant HOMARD : " << codretexec ); - // En mode adaptation, on ajuste l'etat de l'iteration - if ( modeHOMARD == 1 ) - { - if (codretexec == 0) { SetEtatIter(NomIteration,2); } - else { SetEtatIter(NomIteration,1); } - // GERALD -- QMESSAGE BOX - } - } - - // H. Gestion des resultats - if (codret == 0) - { - std::string Commentaire ; - // H.1. Le fichier des messages, dans tous les cas - Commentaire = "log" ; - if ( modeHOMARD == 1 ) { Commentaire += " " + siterp1 ; } - else { Commentaire += "Info" ; } - PublishFileUnderIteration(NomIteration, LogFile.c_str(), Commentaire.c_str()); - - // H.2. Si tout s'est bien passe : - if (codretexec == 0) - { - // H.2.1. Le fichier de bilan - Commentaire = "Summary" ; - if ( modeHOMARD == 1 ) { Commentaire += " " + siterp1 ; } - else { Commentaire += "Info" ; } - PublishFileUnderIteration(NomIteration, FileInfo.c_str(), Commentaire.c_str()); - // H.2.2. Le fichier de maillage obtenu - if ( modeHOMARD == 1 ) - { - std::stringstream saux0 ; - Commentaire = "Mesh" ; - Commentaire += " " + siterp1 ; - PublishFileUnderIteration(NomIteration, MeshFile, Commentaire.c_str()); - if ( Option2 % 2 == 0 ) { PublishResultInSmesh(MeshFile, 1); } - } - } - // H.3 Message d'erreur - if (codretexec != 0) - { - std::string text = "" ; - // Message d'erreur en cas de probleme en adaptation - if ( modeHOMARD == 1 ) - { - text = "Error during the adaptation.\n" ; - bool stopvu = false ; - std::ifstream fichier( LogFile.c_str() ); - if ( fichier ) // ce test échoue si le fichier n'est pas ouvert - { - std::string ligne; // variable contenant chaque ligne lue - while ( std::getline( fichier, ligne ) ) - { -// INFOS(ligne); - if ( stopvu ) - { text += ligne+ "\n"; } - else - { - int position = ligne.find( "===== HOMARD ===== STOP =====" ) ; - if ( position > 0 ) { stopvu = true ; } - } - } - } - } - text += "\n\nSee the file " + LogFile + "\n" ; - INFOS ( text ) ; - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = CORBA::string_dup(text.c_str()); - throw SALOME::SALOME_Exception(es); -// - // En mode information, on force le succes pour pouvoir consulter le fichier log - if ( modeHOMARD != 1 ) { codretexec = 0 ; } - } - } - - // I. Menage et retour dans le répertoire du cas - if (codret == 0) - { - delete myDriver; - MESSAGE ( ". On retourne dans nomDirWork = " << nomDirWork ); - - CHDIR(nomDirWork.c_str()); - } - - // J. Suivi de la frontière CAO -// std::cout << "- codret : " << codret << std::endl; -// std::cout << "- modeHOMARD : " << modeHOMARD << std::endl; -// std::cout << "- BoundaryOption : " << BoundaryOption << std::endl; -// std::cout << "- codretexec : " << codretexec << std::endl; - if (codret == 0) - { - if ( ( modeHOMARD == 1 ) && ( BoundaryOption % 5 == 0 ) && (codretexec == 0) ) - { - INFOS ( "Suivi de frontière CAO" ); - codret = ComputeCAO(myCase, myIteration, Option1, Option2) ; - } - } - - return codretexec ; -} -//============================================================================= -// Calcul d'une iteration : partie spécifique à l'adaptation -//============================================================================= -CORBA::Long ADAPT_Gen_i::ComputeAdap(ADAPT::HOMARD_Cas_var myCase, ADAPT::HOMARD_Iteration_var myIteration, CORBA::Long etatMenage, HomardDriver* myDriver, CORBA::Long Option1, CORBA::Long Option2) -{ - MESSAGE ( "ComputeAdap avec Option1 = " << Option1 << ", Option2 = " << Option2 ); - - // A. Prealable - // A.1. Bases - int codret = 0; - // Numero de l'iteration - int NumeIter = myIteration->GetNumber(); - std::stringstream saux0 ; - saux0 << NumeIter-1 ; - std::string siter = saux0.str() ; - if (NumeIter < 11) { siter = "0" + siter ; } - - // A.2. On verifie qu il y a une hypothese (erreur improbable); - const char* nomHypo = myIteration->GetHypoName(); - if (std::string(nomHypo) == std::string("")) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "This iteration does not have any associated hypothesis."; - throw SALOME::SALOME_Exception(es); - return 2; - }; - ADAPT::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; - ASSERT(!CORBA::is_nil(myHypo)); - - // B. L'iteration parent - const char* nomIterationParent = myIteration->GetIterParentName(); - ADAPT::HOMARD_Iteration_var myIterationParent = myStudyContext._mesIterations[nomIterationParent]; - ASSERT(!CORBA::is_nil(myIterationParent)); - // Si l'iteration parent n'est pas calculee, on le fait (recursivite amont) - if ( myIterationParent->GetState() == 1 ) - { - int iaux = 1 ; - int codret = Compute(nomIterationParent, etatMenage, iaux, Option1, Option2); - if (codret != 0) - { - // GERALD -- QMESSAGE BOX - VERIFICATION("Pb au calcul de l'iteration precedente" == 0); - } - }; - - // C. Le sous-répertoire de l'iteration precedente - char* DirComputePa = ComputeDirPaManagement(myCase, myIteration); - MESSAGE( ". DirComputePa = " << DirComputePa ); - - // D. Les données de l'adaptation HOMARD - // D.1. Le type de conformite - int ConfType = myCase->GetConfType(); - MESSAGE ( ". ConfType = " << ConfType ); - - // D.1. Le type externe - int ExtType = myCase->GetExtType(); - MESSAGE ( ". ExtType = " << ExtType ); - - // D.3. Le maillage de depart - const char* NomMeshParent = myIterationParent->GetMeshName(); - MESSAGE ( ". NomMeshParent = " << NomMeshParent ); - const char* MeshFileParent = myIterationParent->GetMeshFile(); - MESSAGE ( ". MeshFileParent = " << MeshFileParent ); - - // D.4. Le maillage associe a l'iteration - const char* MeshFile = myIteration->GetMeshFile(); - MESSAGE ( ". MeshFile = " << MeshFile ); - FILE *file = fopen(MeshFile,"r"); - if (file != NULL) - { - fclose(file); - if (etatMenage == 0) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - std::string text = "MeshFile : " + std::string(MeshFile) + " already exists "; - es.text = CORBA::string_dup(text.c_str()); - throw SALOME::SALOME_Exception(es); - return 4; - } - else - { - std::string commande = "rm -f " + std::string(MeshFile); - codret = system(commande.c_str()); - if (codret != 0) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "The mesh file cannot be deleted."; - throw SALOME::SALOME_Exception(es); - return 5; - } - } - } - - // D.5. Les types de raffinement et de deraffinement - // Les appels corba sont lourds, il vaut mieux les grouper - ADAPT::listeTypes* ListTypes = myHypo->GetAdapRefinUnRef(); - ASSERT(ListTypes->length() == 3); - int TypeAdap = (*ListTypes)[0]; - int TypeRaff = (*ListTypes)[1]; - int TypeDera = (*ListTypes)[2]; -// MESSAGE ( ". TypeAdap = " << TypeAdap << ", TypeRaff = " << TypeRaff << ", TypeDera = " << TypeDera ); - - // E. Texte du fichier de configuration - // E.1. Incontournables du texte - myDriver->TexteAdap(ExtType); - int iaux = 0 ; - myDriver->TexteMaillageHOMARD( DirComputePa, siter, iaux ) ; - myDriver->TexteMaillage(NomMeshParent, MeshFileParent, 0); - myDriver->TexteConfRaffDera(ConfType, TypeAdap, TypeRaff, TypeDera); - - // E.2. Ajout des informations liees aux zones eventuelles - if ( TypeAdap == 0 ) - { DriverTexteZone(myHypo, myDriver) ; } - - // E.3. Ajout des informations liees aux champs eventuels - if ( TypeAdap == 1 ) - { DriverTexteField(myIteration, myHypo, myDriver) ; } - - // E.4. Ajout des informations liees au filtrage eventuel par les groupes - ADAPT::ListGroupType* listeGroupes = myHypo->GetGroups(); - int numberOfGroups = listeGroupes->length(); - MESSAGE( ". Filtrage par " << numberOfGroups << " groupes"); - if (numberOfGroups > 0) - { - for (int NumGroup = 0; NumGroup< numberOfGroups; NumGroup++) - { - std::string GroupName = std::string((*listeGroupes)[NumGroup]); - MESSAGE( "... GroupName = " << GroupName ); - myDriver->TexteGroup(GroupName); - } - } - - // E.5. Ajout des informations liees a l'eventuelle interpolation des champs - DriverTexteFieldInterp(myIteration, myHypo, myDriver) ; - - // E.6. Ajout des options avancees - int Pyram = myCase->GetPyram(); - MESSAGE ( ". Pyram = " << Pyram ); - int NivMax = myHypo->GetNivMax(); - MESSAGE ( ". NivMax = " << NivMax ); - double DiamMin = myHypo->GetDiamMin() ; - MESSAGE ( ". DiamMin = " << DiamMin ); - int AdapInit = myHypo->GetAdapInit(); - MESSAGE ( ". AdapInit = " << AdapInit ); - int ExtraOutput = myHypo->GetExtraOutput(); - MESSAGE ( ". ExtraOutput = " << ExtraOutput ); - myDriver->TexteAdvanced(Pyram, NivMax, DiamMin, AdapInit, ExtraOutput); - - // E.7. Ajout des informations sur le deroulement de l'execution - int MessInfo = myIteration->GetInfoCompute(); - MESSAGE ( ". MessInfo = " << MessInfo ); - myDriver->TexteInfoCompute(MessInfo); - - return codret ; -} -//============================================================================= -// Calcul d'une iteration : partie spécifique au suivi de frontière CAO -//============================================================================= -CORBA::Long ADAPT_Gen_i::ComputeCAO(ADAPT::HOMARD_Cas_var myCase, ADAPT::HOMARD_Iteration_var myIteration, CORBA::Long Option1, CORBA::Long Option2) -{ - MESSAGE ( "ComputeCAO avec Option1 = " << Option1 << ", Option2 = " << Option2 ); - - // A. Prealable - // A.1. Bases - int codret = 0; - // A.2. Le sous-répertoire de l'iteration en cours de traitement - char* DirCompute = myIteration->GetDirName(); - // A.3. Le maillage résultat de l'iteration en cours de traitement - char* MeshFile = myIteration->GetMeshFile(); - - // B. Les données pour FrontTrack - // B.1. Le maillage à modifier - const std::string theInputMedFile = MeshFile; - MESSAGE ( ". theInputMedFile = " << theInputMedFile ); - - // B.2. Le maillage après modification : fichier identique - const std::string theOutputMedFile = MeshFile ; - MESSAGE ( ". theOutputMedFile = " << theInputMedFile ); - - // B.3. La liste des fichiers contenant les numéros des noeuds à bouger - std::vector< std::string > theInputNodeFiles ; - MESSAGE ( ". DirCompute = " << DirCompute ); - int bilan ; - int icpt = 0 ; -#ifndef WIN32 - DIR *dp; - struct dirent *dirp; - dp = opendir(DirCompute); - while ( (dirp = readdir(dp)) != NULL ) - { - std::string file_name(dirp->d_name); - bilan = file_name.find("fr") ; - if ( bilan != string::npos ) - { - std::stringstream filename_total ; - filename_total << DirCompute << "/" << file_name ; - theInputNodeFiles.push_back(filename_total.str()) ; - icpt += 1 ; - } - } -#else - HANDLE hFind = INVALID_HANDLE_VALUE; - WIN32_FIND_DATA ffd; - hFind = FindFirstFile(DirNameStart, &ffd); - if (INVALID_HANDLE_VALUE != hFind) { - while (FindNextFile(hFind, &ffd) != 0) { - std::string file_name(ffd.cFileName); - bilan = file_name.find("fr") ; - if ( bilan != string::npos ) - { - std::stringstream filename_total ; - filename_total << DirCompute << "/" << file_name ; - theInputNodeFiles.push_back(filename_total.str()) ; - icpt += 1 ; - } - } - FindClose(hFind); - } -#endif - for ( int i = 0; i < icpt; i++ ) - { MESSAGE ( ". theInputNodeFiles["<< i << "] = " << theInputNodeFiles[i] ); } - - // B.4. Le fichier de la CAO - ADAPT::ListBoundaryGroupType* ListBoundaryGroupType = myCase->GetBoundaryGroup(); - std::string BoundaryName = std::string((*ListBoundaryGroupType)[0]); - MESSAGE ( ". BoundaryName = " << BoundaryName ); - ADAPT::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; - const std::string theXaoFileName = myBoundary->GetDataFile(); - MESSAGE ( ". theXaoFileName = " << theXaoFileName ); - - // B.5. Parallélisme - bool theIsParallel = false; - - // C. Lancement des projections - MESSAGE ( ". Lancement des projections" ); - FrontTrack* myFrontTrack = new FrontTrack(); - myFrontTrack->track(theInputMedFile, theOutputMedFile, theInputNodeFiles, theXaoFileName, theIsParallel); - - // D. Transfert des coordonnées modifiées dans le fichier historique de HOMARD - // On lance une exécution spéciale de HOMARD en attendant de savoir le faire avec MEDCoupling - MESSAGE ( ". Transfert des coordonnées" ); - codret = ComputeCAObis(myIteration, Option1, Option2) ; - - return codret ; -} -//============================================================================= -//============================================================================= -// Transfert des coordonnées en suivi de frontière CAO -// Option1 >0 : appel depuis python -// <0 : appel depuis GUI -// Option2 : multiple de nombres premiers -// 1 : aucune option -// x2 : publication du maillage dans SMESH -//============================================================================= -CORBA::Long ADAPT_Gen_i::ComputeCAObis(ADAPT::HOMARD_Iteration_var myIteration, CORBA::Long Option1, CORBA::Long Option2) -{ - MESSAGE ( "ComputeCAObis, avec Option1 = " << Option1 << ", Option2 = " << Option2 ); - - // A. Prealable - int codret = 0; - - // A.1. Controle de la possibilite d'agir - // A.1.1. Etat de l'iteration - int etat = myIteration->GetState(); - MESSAGE ( "etat = "<GetNumber(); - std::string siterp1 ; - std::stringstream saux1 ; - saux1 << NumeIter ; - siterp1 = saux1.str() ; - if (NumeIter < 10) { siterp1 = "0" + siterp1 ; } - MESSAGE ( "siterp1 = "<GetCaseName(); - ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[CaseName]; - ASSERT(!CORBA::is_nil(myCase)); - - // A.4. Le sous-répertoire de l'iteration a traiter - char* DirCompute = myIteration->GetDirName(); - MESSAGE( ". DirCompute = " << DirCompute ); - - // C. Le fichier des messages - std::string LogFile = DirCompute ; - LogFile += "/Liste." + siterp1 + ".maj_coords.log" ; - MESSAGE (". LogFile = " << LogFile); - myIteration->SetFileInfo(LogFile.c_str()); - - // D. On passe dans le répertoire de l'iteration a calculer - MESSAGE ( ". On passe dans DirCompute = " << DirCompute ); - CHDIR(DirCompute); - - // E. Les données de l'exécution HOMARD - // E.1. L'objet du texte du fichier de configuration - HomardDriver* myDriver = new HomardDriver("", siterp1); - myDriver->TexteInit(DirCompute, LogFile, _Langue); - - // E.2. Le maillage associe a l'iteration - const char* NomMesh = myIteration->GetMeshName(); - MESSAGE ( ". NomMesh = " << NomMesh ); - const char* MeshFile = myIteration->GetMeshFile(); - MESSAGE ( ". MeshFile = " << MeshFile ); - - // E.3. Les données du traitement HOMARD - int iaux ; - myDriver->TexteMajCoords( NumeIter ) ; - iaux = 0 ; - myDriver->TexteMaillageHOMARD( DirCompute, siterp1, iaux ) ; - myDriver->TexteMaillage(NomMesh, MeshFile, 0); -// - // E.4. Ecriture du texte dans le fichier - MESSAGE ( ". Ecriture du texte dans le fichier de configuration ; codret = "<CreeFichier(); } - -// F. Execution -// - int codretexec = 1789 ; - if (codret == 0) - { - codretexec = myDriver->ExecuteHomard(Option1); - MESSAGE ( "Erreur en executant HOMARD : " << codretexec ); - } - - // G. Gestion des resultats - if (codret == 0) - { - // G.1. Le fichier des messages, dans tous les cas - const char* NomIteration = myIteration->GetName(); - std::string Commentaire = "logmaj_coords" ; - PublishFileUnderIteration(NomIteration, LogFile.c_str(), Commentaire.c_str()); - // G.2 Message d'erreur - if (codretexec != 0) - { - std::string text = "\n\nSee the file " + LogFile + "\n" ; - INFOS ( text ) ; - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = CORBA::string_dup(text.c_str()); - throw SALOME::SALOME_Exception(es); - - // On force le succes pour pouvoir consulter le fichier log - codretexec = 0 ; - } - } - - // H. Menage et retour dans le répertoire du cas - if (codret == 0) { delete myDriver; } - - return codret ; -} -//============================================================================= -// Creation d'un nom de sous-répertoire pour l'iteration au sein d'un répertoire parent -// nomrep : nom du répertoire parent -// num : le nom du sous-répertoire est sous la forme 'In', n est >= num -//============================================================================= -char* ADAPT_Gen_i::CreateDirNameIter(const char* nomrep, CORBA::Long num ) -{ - MESSAGE ( "CreateDirNameIter : nomrep ="<< nomrep << ", num = "<d_name); -#else - HANDLE hFind = INVALID_HANDLE_VALUE; - WIN32_FIND_DATA ffd; - hFind = FindFirstFile(nomrep, &ffd); - if (INVALID_HANDLE_VALUE != hFind) { - while (FindNextFile(hFind, &ffd) != 0) { - if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories - std::string file_name(ffd.cFileName); -#endif - if ( file_name == DirNameA.str() ) { existe = true ; } - } -#ifndef WIN32 - closedir(dp); -#else - FindClose(hFind); -#endif - if ( !existe ) - { - DirName = DirNameA.str() ; - a_chercher = false ; - break ; - } - } - num += 1; - } - - MESSAGE ( "==> DirName = " << DirName); - MESSAGE ( ". On retourne dans nomDirActuel = " << nomDirActuel ); - CHDIR(nomDirActuel.c_str()); - return CORBA::string_dup( DirName.c_str() ); -} -//============================================================================= -// Calcul d'une iteration : gestion du répertoire de calcul -// Si le sous-répertoire existe : -// etatMenage = 0 : on sort en erreur si le répertoire n'est pas vide -// etatMenage = 1 : on fait le menage du répertoire -// etatMenage = -1 : on ne fait rien -//============================================================================= -char* ADAPT_Gen_i::ComputeDirManagement(ADAPT::HOMARD_Cas_var myCase, ADAPT::HOMARD_Iteration_var myIteration, CORBA::Long etatMenage) -{ - MESSAGE ( "ComputeDirManagement : répertoires pour le calcul" ); - // B.2. Le répertoire du cas - const char* nomDirCase = myCase->GetDirName(); - MESSAGE ( ". nomDirCase = " << nomDirCase ); - - // B.3. Le sous-répertoire de l'iteration a calculer, puis le répertoire complet a creer - // B.3.1. Le nom du sous-répertoire - const char* nomDirIt = myIteration->GetDirNameLoc(); - - // B.3.2. Le nom complet du sous-répertoire - std::stringstream DirCompute ; - DirCompute << nomDirCase << "/" << nomDirIt; - MESSAGE (". DirCompute = " << DirCompute.str() ); - - // B.3.3. Si le sous-répertoire n'existe pas, on le cree - if (CHDIR(DirCompute.str().c_str()) != 0) - { -#ifndef WIN32 - if (mkdir(DirCompute.str().c_str(), S_IRWXU|S_IRGRP|S_IXGRP) != 0) -#else - if (_mkdir(DirCompute.str().c_str()) != 0) -#endif - { - // GERALD -- QMESSAGE BOX - std::cerr << "Pb Creation du répertoire DirCompute = " << DirCompute.str() << std::endl; - VERIFICATION("Pb a la creation du répertoire" == 0); - } - } - else - { -// Le répertoire existe -// On demande de faire le menage de son contenu : - if (etatMenage == 1) - { - MESSAGE (". Menage du répertoire DirCompute = " << DirCompute.str()); - std::string commande = "rm -rf " + DirCompute.str()+"/*" ; - int codret = system(commande.c_str()); - if (codret != 0) - { - // GERALD -- QMESSAGE BOX - std::cerr << ". Menage du répertoire de calcul" << DirCompute.str() << std::endl; - VERIFICATION("Pb au menage du répertoire de calcul" == 0); - } - } -// On n'a pas demande de faire le menage de son contenu : on sort en erreur : - else - { - if (etatMenage == 0) - { -#ifndef WIN32 - DIR *dp; - struct dirent *dirp; - dp = opendir(DirCompute.str().c_str()); - bool result = true; - while ((dirp = readdir(dp)) != NULL && result ) - { - std::string file_name(dirp->d_name); - result = file_name.empty() || file_name == "." || file_name == ".."; //if any file - break and return false - } - closedir(dp); -#else - HANDLE hFind = INVALID_HANDLE_VALUE; - WIN32_FIND_DATA ffd; - hFind = FindFirstFile(DirCompute.str().c_str(), &ffd); - bool result = true; - if (INVALID_HANDLE_VALUE != hFind) { - while (FindNextFile(hFind, &ffd) != 0) { - if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories - std::string file_name(ffd.cFileName); - result = file_name.empty() || file_name == "." || file_name == ".."; //if any file - break and return false - } - } - FindClose(hFind); -#endif - if ( result == false) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - std::string text = "Directory : " + DirCompute.str() + " is not empty"; - es.text = CORBA::string_dup(text.c_str()); - throw SALOME::SALOME_Exception(es); - VERIFICATION("Directory is not empty" == 0); - } - } - } - } - - return CORBA::string_dup( DirCompute.str().c_str() ); -} -//============================================================================= -// Calcul d'une iteration : gestion du répertoire de calcul de l'iteration parent -//============================================================================= -char* ADAPT_Gen_i::ComputeDirPaManagement(ADAPT::HOMARD_Cas_var myCase, ADAPT::HOMARD_Iteration_var myIteration) -{ - MESSAGE ( "ComputeDirPaManagement : répertoires pour le calcul" ); - // Le répertoire du cas - const char* nomDirCase = myCase->GetDirName(); - MESSAGE ( ". nomDirCase = " << nomDirCase ); - - // Le sous-répertoire de l'iteration precedente - - const char* nomIterationParent = myIteration->GetIterParentName(); - ADAPT::HOMARD_Iteration_var myIterationParent = myStudyContext._mesIterations[nomIterationParent]; - const char* nomDirItPa = myIterationParent->GetDirNameLoc(); - std::stringstream DirComputePa ; - DirComputePa << nomDirCase << "/" << nomDirItPa; - MESSAGE( ". nomDirItPa = " << nomDirItPa); - MESSAGE( ". DirComputePa = " << DirComputePa.str() ); - - return CORBA::string_dup( DirComputePa.str().c_str() ); -} -//============================================================================= -// Calcul d'une iteration : ecriture des zones dans le fichier de configuration -//============================================================================= -void ADAPT_Gen_i::DriverTexteZone(ADAPT::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver) -{ - MESSAGE ( "... DriverTexteZone" ); - ADAPT::listeZonesHypo* ListZone = myHypo->GetZones(); - int numberOfZonesx2 = ListZone->length(); - int NumZone ; - - for (int iaux = 0; iaux< numberOfZonesx2; iaux++) - { - std::string ZoneName = std::string((*ListZone)[iaux]); - MESSAGE ( "... ZoneName = " << ZoneName); - ADAPT::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName]; - ASSERT(!CORBA::is_nil(myZone)); - - int ZoneType = myZone->GetType(); - std::string TypeUsestr = std::string((*ListZone)[iaux+1]); - int TypeUse = atoi( TypeUsestr.c_str() ); - MESSAGE ( "... ZoneType = " << ZoneType << ", TypeUse = "<GetCoords(); - if ( ZoneType == 2 || ( ZoneType>=11 && ZoneType <=13 ) ) // Cas d un parallelepipede ou d'un rectangle - { myDriver->TexteZone(NumZone, ZoneType, TypeUse, (*zone)[0], (*zone)[1], (*zone)[2], (*zone)[3], (*zone)[4], (*zone)[5], 0., 0., 0.); } - else if ( ZoneType == 4 ) // Cas d une sphere - { myDriver->TexteZone(NumZone, ZoneType, TypeUse, (*zone)[0], (*zone)[1], (*zone)[2], (*zone)[3], 0., 0., 0., 0., 0.); } - else if ( ZoneType == 5 || ( ZoneType>=31 && ZoneType <=33 ) ) // Cas d un cylindre ou d'un disque - { myDriver->TexteZone(NumZone, ZoneType, TypeUse, (*zone)[0], (*zone)[1], (*zone)[2], (*zone)[3], (*zone)[4], (*zone)[5], (*zone)[6], (*zone)[7], 0.); } - else if ( ZoneType == 7 || ( ZoneType>=61 && ZoneType <=63 ) ) // Cas d un tuyau ou disque perce - { myDriver->TexteZone(NumZone, ZoneType, TypeUse, (*zone)[0], (*zone)[1], (*zone)[2], (*zone)[3], (*zone)[4], (*zone)[5], (*zone)[6], (*zone)[7], (*zone)[8]); } - else { VERIFICATION("ZoneType est incorrect." == 0) ; } - iaux += 1 ; - } - return ; -} -//============================================================================= -// Calcul d'une iteration : ecriture des champs dans le fichier de configuration -//============================================================================= -void ADAPT_Gen_i::DriverTexteField(ADAPT::HOMARD_Iteration_var myIteration, ADAPT::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver) -{ - MESSAGE ( "... DriverTexteField" ); -// Le fichier du champ - char* FieldFile = myIteration->GetFieldFile(); - MESSAGE ( ". FieldFile = " << FieldFile ); - if (strlen(FieldFile) == 0) - { - // GERALD -- QMESSAGE BOX - std::cerr << "Le fichier du champ n'a pas ete fourni." << std::endl; - VERIFICATION("The file for the field is not given." == 0); - } -// Les caracteristiques d'instants du champ de pilotage - int TimeStep = myIteration->GetTimeStep(); - MESSAGE( ". TimeStep = " << TimeStep ); - int Rank = myIteration->GetRank(); - MESSAGE( ". Rank = " << Rank ); -// Les informations sur les champs - ADAPT::InfosHypo* aInfosHypo = myHypo->GetField(); -// Le nom - const char* FieldName = aInfosHypo->FieldName; -// Les seuils - int TypeThR = aInfosHypo->TypeThR; - double ThreshR = aInfosHypo->ThreshR; - int TypeThC = aInfosHypo->TypeThC; - double ThreshC = aInfosHypo->ThreshC; -// Saut entre mailles ou non ? - int UsField = aInfosHypo->UsField; - MESSAGE( ". UsField = " << UsField ); -// L'usage des composantes - int UsCmpI = aInfosHypo->UsCmpI; - MESSAGE( ". UsCmpI = " << UsCmpI ); -// - myDriver->TexteField(FieldName, FieldFile, TimeStep, Rank, TypeThR, ThreshR, TypeThC, ThreshC, UsField, UsCmpI); -// -// Les composantes - ADAPT::listeComposantsHypo* mescompo = myHypo->GetComps(); - int numberOfCompos = mescompo->length(); - MESSAGE( ". numberOfCompos = " << numberOfCompos ); - for (int NumeComp = 0; NumeComp< numberOfCompos; NumeComp++) - { - std::string nomCompo = std::string((*mescompo)[NumeComp]); - MESSAGE( "... nomCompo = " << nomCompo ); - myDriver->TexteCompo(NumeComp, nomCompo); - } - return ; -} -//============================================================================= -// Calcul d'une iteration : ecriture des frontieres dans le fichier de configuration -// On ecrit dans l'ordre : -// 1. la definition des frontieres -// 2. les liens avec les groupes -// 3. un entier resumant le type de comportement pour les frontieres -//============================================================================= -int ADAPT_Gen_i::DriverTexteBoundary(ADAPT::HOMARD_Cas_var myCase, HomardDriver* myDriver) -{ - MESSAGE ( "... DriverTexteBoundary" ); - // 1. Recuperation des frontieres - std::list ListeBoundaryTraitees ; - ADAPT::ListBoundaryGroupType* ListBoundaryGroupType = myCase->GetBoundaryGroup(); - int numberOfitems = ListBoundaryGroupType->length(); - MESSAGE ( "... number of string for Boundary+Group = " << numberOfitems); - int BoundaryOption = 1 ; - // 2. Parcours des frontieres pour ecrire leur description - int NumBoundaryAnalytical = 0 ; - for (int NumBoundary = 0; NumBoundary< numberOfitems; NumBoundary=NumBoundary+2) - { - std::string BoundaryName = std::string((*ListBoundaryGroupType)[NumBoundary]); - MESSAGE ( "... BoundaryName = " << BoundaryName); - // 2.1. La frontiere a-t-elle deja ete ecrite ? - // Cela arrive quand elle est liee a plusieurs groupes. Il ne faut l'ecrire que la premiere fois - int A_faire = 1 ; - std::list::const_iterator it = ListeBoundaryTraitees.begin(); - while (it != ListeBoundaryTraitees.end()) - { - MESSAGE ( "..... BoundaryNameTraitee = " << *it); - if ( BoundaryName == *it ) { A_faire = 0 ; } - it++; - } - // 2.2. Ecriture de la frontiere - if ( A_faire == 1 ) - { - // 2.2.1. Caracteristiques de la frontiere - ADAPT::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; - ASSERT(!CORBA::is_nil(myBoundary)); - int BoundaryType = myBoundary->GetType(); - MESSAGE ( "... BoundaryType = " << BoundaryType ); - // 2.2.2. Ecriture selon le type - // 2.2.2.1. Cas d une frontiere CAO - if (BoundaryType == -1) - { -// const char* CAOFile = myBoundary->GetDataFile() ; -// MESSAGE ( ". CAOFile = " << CAOFile ); - if ( BoundaryOption % 5 != 0 ) { BoundaryOption = BoundaryOption*5 ; } - } - // 2.2.2.2. Cas d une frontiere discrete - else if (BoundaryType == 0) - { - const char* MeshName = myBoundary->GetMeshName() ; - MESSAGE ( ". MeshName = " << MeshName ); - const char* MeshFile = myBoundary->GetDataFile() ; - MESSAGE ( ". MeshFile = " << MeshFile ); - myDriver->TexteBoundaryDi( MeshName, MeshFile); - if ( BoundaryOption % 2 != 0 ) { BoundaryOption = BoundaryOption*2 ; } - } - // 2.2.2.3. Cas d une frontiere analytique - else - { - NumBoundaryAnalytical++ ; - ADAPT::double_array* coor = myBoundary->GetCoords(); - if (BoundaryType == 1) // Cas d un cylindre - { - myDriver->TexteBoundaryAn(BoundaryName, NumBoundaryAnalytical, BoundaryType, (*coor)[0], (*coor)[1], (*coor)[2], (*coor)[3], (*coor)[4], (*coor)[5], (*coor)[6], 0.); - if ( BoundaryOption % 3 != 0 ) { BoundaryOption = BoundaryOption*3 ; } - } - else if (BoundaryType == 2) // Cas d une sphere - { - myDriver->TexteBoundaryAn(BoundaryName, NumBoundaryAnalytical, BoundaryType, (*coor)[0], (*coor)[1], (*coor)[2], (*coor)[3], 0., 0., 0., 0.); - if ( BoundaryOption % 3 != 0 ) { BoundaryOption = BoundaryOption*3 ; } - } - else if (BoundaryType == 3) // Cas d un cone defini par un axe et un angle - { - myDriver->TexteBoundaryAn(BoundaryName, NumBoundaryAnalytical, BoundaryType, (*coor)[0], (*coor)[1], (*coor)[2], (*coor)[3], (*coor)[4], (*coor)[5], (*coor)[6], 0.); - if ( BoundaryOption % 3 != 0 ) { BoundaryOption = BoundaryOption*3 ; } - } - else if (BoundaryType == 4) // Cas d un cone defini par les 2 rayons - { - myDriver->TexteBoundaryAn(BoundaryName, NumBoundaryAnalytical, BoundaryType, (*coor)[0], (*coor)[1], (*coor)[2], (*coor)[3], (*coor)[4], (*coor)[5], (*coor)[6], (*coor)[7]); - if ( BoundaryOption % 3 != 0 ) { BoundaryOption = BoundaryOption*3 ; } - } - else if (BoundaryType == 5) // Cas d un tore - { - myDriver->TexteBoundaryAn(BoundaryName, NumBoundaryAnalytical, BoundaryType, (*coor)[0], (*coor)[1], (*coor)[2], (*coor)[3], (*coor)[4], (*coor)[5], (*coor)[6], (*coor)[7]); - if ( BoundaryOption % 3 != 0 ) { BoundaryOption = BoundaryOption*3 ; } - } - } - // 2.2.3. Memorisation du traitement - ListeBoundaryTraitees.push_back( BoundaryName ); - } - } - // 3. Parcours des frontieres pour ecrire les liens avec les groupes - NumBoundaryAnalytical = 0 ; - for (int NumBoundary = 0; NumBoundary< numberOfitems; NumBoundary=NumBoundary+2) - { - std::string BoundaryName = std::string((*ListBoundaryGroupType)[NumBoundary]); - MESSAGE ( "... BoundaryName = " << BoundaryName); - ADAPT::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; - ASSERT(!CORBA::is_nil(myBoundary)); - int BoundaryType = myBoundary->GetType(); - MESSAGE ( "... BoundaryType = " << BoundaryType ); - // 3.1. Recuperation du nom du groupe - std::string GroupName = std::string((*ListBoundaryGroupType)[NumBoundary+1]); - MESSAGE ( "... GroupName = " << GroupName); - // 3.2. Cas d une frontiere CAO - if ( BoundaryType == -1 ) - { - if ( GroupName.size() > 0 ) { myDriver->TexteBoundaryCAOGr ( GroupName ) ; } - } - // 3.3. Cas d une frontiere discrete - else if ( BoundaryType == 0 ) - { - if ( GroupName.size() > 0 ) { myDriver->TexteBoundaryDiGr ( GroupName ) ; } - } - // 3.4. Cas d une frontiere analytique - else - { - NumBoundaryAnalytical++ ; - myDriver->TexteBoundaryAnGr ( BoundaryName, NumBoundaryAnalytical, GroupName ) ; - } - } - // 4. Ecriture de l'option finale - myDriver->TexteBoundaryOption(BoundaryOption); -// - return BoundaryOption ; -} -//============================================================================= -// Calcul d'une iteration : ecriture des interpolations dans le fichier de configuration -//============================================================================= -void ADAPT_Gen_i::DriverTexteFieldInterp(ADAPT::HOMARD_Iteration_var myIteration, ADAPT::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver) -{ - MESSAGE ( "... DriverTexteFieldInterp" ); - int TypeFieldInterp = myHypo->GetTypeFieldInterp(); - MESSAGE ( "... TypeFieldInterp = " << TypeFieldInterp); - if (TypeFieldInterp != 0) - { -// Le fichier des champs - char* FieldFile = myIteration->GetFieldFile(); - MESSAGE ( ". FieldFile = " << FieldFile ); - if (strlen(FieldFile) == 0) - { - // GERALD -- QMESSAGE BOX - VERIFICATION("The file for the field is not given." == 0); - } - // - const char* MeshFile = myIteration->GetMeshFile(); - myDriver->TexteFieldInterp(FieldFile, MeshFile); - - // Les champs - // Interpolation de tous les champs - if ( TypeFieldInterp == 1 ) - { - myDriver->TexteFieldInterpAll(); - } - // Interpolation de certains champs - else if (TypeFieldInterp == 2) - { - // Les champs et leurs instants pour l'iteration - ADAPT::listeFieldInterpTSRsIter* ListFieldTSR = myIteration->GetFieldInterpsTimeStepRank(); - int numberOfFieldsx3 = ListFieldTSR->length(); - MESSAGE( ". pour iteration, numberOfFields = " << numberOfFieldsx3/3 ); - // Les champs pour l'hypothese - ADAPT::listeFieldInterpsHypo* ListField = myHypo->GetFieldInterps(); - int numberOfFieldsx2 = ListField->length(); - MESSAGE( ". pour hypothese, numberOfFields = " << numberOfFieldsx2/2 ); - // On parcourt tous les champs de l'hypothese - int NumField = 0 ; - for (int iaux = 0; iaux< numberOfFieldsx2; iaux++) - { - // Le nom du champ - std::string FieldName = std::string((*ListField)[iaux]) ; - // Le type d'interpolation - std::string TypeInterpstr = std::string((*ListField)[iaux+1]) ; - MESSAGE( "... FieldName = " << FieldName << ", TypeInterp = " << TypeInterpstr ); - // On cherche ?? savoir si des instants ont ??t?? pr??cis??s pour cette it??ration - int tsrvu = 0; - for (int jaux = 0; jaux< numberOfFieldsx3; jaux++) - { - // Le nom du champ - std::string FieldName2 = std::string((*ListFieldTSR)[jaux]) ; - MESSAGE( "..... FieldName2 = " << FieldName2 ); - // Quand c'est le bon champ, on ecrit le pas de temps - if ( FieldName == FieldName2 ) - { - tsrvu = 1 ; - // Le pas de temps - std::string TimeStepstr = std::string((*ListFieldTSR)[jaux+1]) ; - // Le numero d'ordre - std::string Rankstr = std::string((*ListFieldTSR)[jaux+2]) ; - MESSAGE( "..... TimeStepstr = " << TimeStepstr <<", Rankstr = "<TexteFieldInterpNameType(NumField, FieldName, TypeInterpstr, TimeStep, Rank); - } - jaux += 2 ; - } - // Si aucun instant n'a été défini - if ( tsrvu == 0 ) - { - NumField += 1 ; - myDriver->TexteFieldInterpNameType(NumField, FieldName, TypeInterpstr, -1, -1); - } - iaux++ ; - } - } - } - return ; -} -//=========================================================================== -//=========================================================================== - - -//=========================================================================== -//=========================================================================== -// Publications -//=========================================================================== -//=========================================================================== -SALOMEDS::SObject_ptr ADAPT_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr theSObject, - CORBA::Object_ptr theObject, - const char* theName) -{ - MESSAGE("PublishInStudy pour " << theName); - SALOMEDS::SObject_var aResultSO; - if (CORBA::is_nil(myStudy)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid study context"; - throw SALOME::SALOME_Exception(es); - return 0; - }; - -// Recuperation de l'objet correspondant, en essayant chacun des types possibles -// Rq : Iteration est publiee ailleurs - ADAPT::HOMARD_Boundary_var aBoundary = ADAPT::HOMARD_Boundary::_narrow(theObject); - ADAPT::HOMARD_Cas_var aCase = ADAPT::HOMARD_Cas::_narrow(theObject); - ADAPT::HOMARD_Hypothesis_var aHypo = ADAPT::HOMARD_Hypothesis::_narrow(theObject); - ADAPT::HOMARD_YACS_var aYACS = ADAPT::HOMARD_YACS::_narrow(theObject); - ADAPT::HOMARD_Zone_var aZone = ADAPT::HOMARD_Zone::_narrow(theObject); - - UpdateStudy(); - -// Controle de la non publication d'un objet de meme nom - if ( (!aBoundary->_is_nil()) || (!aHypo->_is_nil()) || (!aYACS->_is_nil()) || (!aZone->_is_nil()) ) - { - SALOMEDS::Study::ListOfSObject_var listSO = myStudy->FindObjectByName(theName, ComponentDataType()); - if (listSO->length() >= 1) - { - MESSAGE("This name "<length()<<" time(s)"); - aResultSO = listSO[0]; - return aResultSO._retn(); - } - } - - // Caracteristiques de l'etude - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); - aStudyBuilder->NewCommand(); - if(!aBoundary->_is_nil()) - aResultSO = PublishBoundaryInStudy(aStudyBuilder, aBoundary, theName); - else if(!aCase->_is_nil()) - aResultSO = PublishCaseInStudy(aStudyBuilder, aCase, theName); - else if(!aHypo->_is_nil()) - aResultSO = PublishHypotheseInStudy(aStudyBuilder, aHypo, theName); - else if(!aYACS->_is_nil()) - aResultSO = PublishYACSInStudy(aStudyBuilder, aYACS, theName); - else if(!aZone->_is_nil()) - aResultSO = PublishZoneInStudy(aStudyBuilder, aZone, theName); - - aStudyBuilder->CommitCommand(); - - return aResultSO._retn(); -}; -//============================================================================= -SALOMEDS::SObject_ptr ADAPT_Gen_i::PublishBoundaryInStudy( SALOMEDS::StudyBuilder_var aStudyBuilder, - ADAPT::HOMARD_Boundary_ptr theObject, const char* theName) -{ - MESSAGE("PublishBoundaryStudy pour "<FindComponent(ComponentDataType()); - if (theFatherHomard->_is_nil()) - { - MESSAGE("theFatherHomard->_is_nil()"); - return aResultSO._retn(); - } - - // On ajoute la categorie des boundarys dans l etude si necessaire - if ( _tag_boun == 0 ) - { - _tag_gene += 1 ; - _tag_boun = _tag_gene ; - } - MESSAGE("PublishBoundaryInStudy _tag_gene = "<<_tag_gene << ", _tag_boun = "<<_tag_boun ); - SALOMEDS::SObject_var aSObject; - if (!theFatherHomard->FindSubObject(_tag_boun, aSObject)) - { - MESSAGE("Ajout de la categorie des boundarys"); - aSObject = aStudyBuilder->NewObjectToTag(theFatherHomard, _tag_boun); - PublishInStudyAttr(aStudyBuilder, aSObject, "Boundaries", "BoundList", "zone_icone_2.png", NULL ) ; - } - else { MESSAGE("La categorie des boundarys existe deja."); } - - CORBA::Long BoundaryType = myBoundary->GetType(); -// MESSAGE("BoundaryType : "<NewObject(aSObject); - PublishInStudyAttr(aStudyBuilder, aResultSO, theName, value.c_str(), icone.c_str(), _orb->object_to_string(theObject)); - return aResultSO._retn(); -} -//============================================================================= -SALOMEDS::SObject_ptr ADAPT_Gen_i::PublishCaseInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, - ADAPT::HOMARD_Cas_ptr theObject, const char* theName) -{ - MESSAGE("PublishCaseInStudy pour "<_is_nil()"); - return aResultSO._retn(); - } - if (myStudy->_is_nil()) { - MESSAGE("ADAPT_Gen_i::myStudy->_is_nil()"); - return aResultSO._retn(); - } - - // On recupere le module pere dans l etude - SALOMEDS::SComponent_var theFatherHomard = myStudy->FindComponent(ComponentDataType()); - if (theFatherHomard->_is_nil()) - { - MESSAGE("theFatherHomard->_is_nil()"); - return aResultSO._retn(); - } - - _tag_gene += 1 ; - MESSAGE("PublishCaseInStudy _tag_gene = "<<_tag_gene ); - aResultSO = aStudyBuilder->NewObject(theFatherHomard); - PublishInStudyAttr(aStudyBuilder, aResultSO, theName, "CasHomard", "cas_calcule.png", - _orb->object_to_string(theObject) ) ; - - return aResultSO._retn(); -} -//============================================================================= -SALOMEDS::SObject_ptr ADAPT_Gen_i::PublishHypotheseInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, - ADAPT::HOMARD_Hypothesis_ptr theObject, const char* theName) -{ - MESSAGE("PublishHypotheseInStudy pour "<FindComponent(ComponentDataType()); - if (theFatherHomard->_is_nil()) - { - MESSAGE("theFatherHomard->_is_nil()"); - return aResultSO._retn(); - } - - // On ajoute la categorie des hypotheses dans l etude si necessaire - SALOMEDS::SObject_var aSObject; - if ( _tag_hypo == 0 ) - { - _tag_gene += 1 ; - _tag_hypo = _tag_gene ; - } - MESSAGE("PublishHypotheseInStudy _tag_gene = "<<_tag_gene << ", _tag_hypo = "<<_tag_hypo ); - if (!theFatherHomard->FindSubObject(_tag_hypo, aSObject)) - { - MESSAGE("Ajout de la categorie des hypotheses"); - aSObject = aStudyBuilder->NewObjectToTag(theFatherHomard, _tag_hypo); - PublishInStudyAttr(aStudyBuilder, aSObject, "Hypothesis", "HypoList", "hypotheses.png", NULL); - } - else { MESSAGE("La categorie des hypotheses existe deja."); } - -// Creation du resultat dans l'etude - aResultSO = aStudyBuilder->NewObject(aSObject); - PublishInStudyAttr(aStudyBuilder, aResultSO, theName, "HypoHomard", NULL, _orb->object_to_string(theObject) ) ; - - return aResultSO._retn(); -} -//============================================================================= -SALOMEDS::SObject_ptr ADAPT_Gen_i::PublishYACSInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, - ADAPT::HOMARD_YACS_ptr theObject, const char* theName) -{ - MESSAGE("PublishYACSInStudy pour "<FindComponent(ComponentDataType()); - if (theFatherHomard->_is_nil()) - { - MESSAGE("theFatherHomard->_is_nil()"); - return aResultSO._retn(); - } - // On ajoute la categorie des schemas YACS dans l etude si necessaire - if ( _tag_yacs == 0 ) - { - _tag_gene += 1 ; - _tag_yacs = _tag_gene ; - } - MESSAGE("PublishZoneStudy _tag_gene = "<<_tag_gene << ", _tag_yacs = "<<_tag_yacs ); - SALOMEDS::SObject_var aSObject; - if (!theFatherHomard->FindSubObject(_tag_yacs, aSObject)) - { - MESSAGE("Ajout de la categorie des schemas YACS"); - aSObject = aStudyBuilder->NewObjectToTag(theFatherHomard, _tag_yacs); - PublishInStudyAttr(aStudyBuilder, aSObject, "YACS", "YACSList", "full_view.png", NULL); - } - else { MESSAGE("La categorie des schemas YACS existe deja."); } - -// Creation du resultat dans l'etude - aResultSO = aStudyBuilder->NewObject(aSObject); - PublishInStudyAttr(aStudyBuilder, aResultSO, theName, "YACSHomard", "schema.png", _orb->object_to_string(theObject) ) ; - - return aResultSO._retn(); -} - -//============================================================================= -SALOMEDS::SObject_ptr ADAPT_Gen_i::PublishZoneInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, - ADAPT::HOMARD_Zone_ptr theObject, const char* theName) -{ - MESSAGE("PublishZoneStudy pour "<_is_nil()"); - return aResultSO._retn(); - } - if (myStudy->_is_nil()) - { - MESSAGE("PublishZoneInStudy : myStudy->_is_nil()"); - return aResultSO._retn(); - } - SALOMEDS::SComponent_var theFatherHomard = myStudy->FindComponent(ComponentDataType()); - if (theFatherHomard->_is_nil()) - { - MESSAGE("PublishZoneInStudy : theFatherHomard->_is_nil()"); - return aResultSO._retn(); - } - - // Caracteristique de la zone - ADAPT::HOMARD_Zone_var myZone = myStudyContext._mesZones[theName]; - CORBA::Long ZoneType = myZone->GetType(); - - // On ajoute la categorie des zones dans l etude si necessaire - if ( _tag_zone == 0 ) - { - _tag_gene += 1 ; - _tag_zone = _tag_gene ; - } - MESSAGE("PublishZoneStudy _tag_gene = "<<_tag_gene << ", _tag_zone = "<<_tag_zone ); - SALOMEDS::SObject_var aSObject; - if (!theFatherHomard->FindSubObject(_tag_zone, aSObject)) - { - MESSAGE("Ajout de la categorie des zones"); - aSObject = aStudyBuilder->NewObjectToTag(theFatherHomard, _tag_zone); - PublishInStudyAttr(aStudyBuilder, aSObject, "Zones", "ZoneList", "zone_icone_2.png", NULL ) ; - } - else { MESSAGE("La categorie des zones existe deja."); } - - aResultSO = aStudyBuilder->NewObject(aSObject); - std::string icone ; - switch (ZoneType) - { - case 11 : - { } - case 12 : - { } - case 13 : - { icone = "boxdxy_2.png" ; - break ; - } - case 2 : - { icone = "boxdxyz_2.png" ; - break ; - } - case 31 : - { } - case 32 : - { } - case 33 : - { icone = "disk_2.png" ; - break ; - } - case 4 : - { icone = "spherepoint_2.png" ; - break ; - } - case 5 : - { icone = "cylinderpointvector_2.png" ; - break ; - } - case 61 : - { } - case 62 : - { } - case 63 : - { icone = "diskwithhole_2.png" ; - break ; - } - case 7 : - { icone = "pipe_2.png" ; - break ; - } - } - PublishInStudyAttr(aStudyBuilder, aResultSO, theName, "ZoneHomard", icone.c_str(), _orb->object_to_string(theObject) ) ; - - return aResultSO._retn(); -} -//=========================================================================== -void ADAPT_Gen_i::PublishInStudyAttr(SALOMEDS::StudyBuilder_var aStudyBuilder, - SALOMEDS::SObject_var aResultSO, - const char* name, const char* comment, const char* icone, const char* ior) -{ - MESSAGE("PublishInStudyAttr pour name = "<SetValue(name); - } - -// Ajout du commentaire - if ( comment != NULL ) - { - anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeComment"); - SALOMEDS::AttributeComment_var aCommentAttrib = SALOMEDS::AttributeComment::_narrow(anAttr); - aCommentAttrib->SetValue(comment); - } - -// Ajout de l'icone - if ( icone != NULL ) - { - anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributePixMap"); - SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); - aPixmap->SetPixMap(icone); - } - -// Ajout de l ior - if ( ior != NULL ) - { - anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeIOR"); - SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); - anIOR->SetValue(ior); - } -}; - -//===================================================================================== -void ADAPT_Gen_i::PublishBoundaryUnderCase(const char* CaseName, const char* BoundaryName) -{ - MESSAGE ( "PublishBoundaryUnderCase : CaseName = " << CaseName << ", BoundaryName= " << BoundaryName ); - - ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[CaseName]; - ASSERT(!CORBA::is_nil(myCase)); - SALOMEDS::SObject_var aCaseSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myCase))); - ASSERT(!CORBA::is_nil(aCaseSO)); - - ADAPT::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; - ASSERT(!CORBA::is_nil(myBoundary)); - SALOMEDS::SObject_var aBoundarySO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myBoundary))); - ASSERT(!CORBA::is_nil(aBoundarySO)); - - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); - - aStudyBuilder->NewCommand(); - - SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aCaseSO); - aStudyBuilder->Addreference(aSubSO, aBoundarySO); -// aStudyBuilder->RemoveReference(aSubSO); - - aStudyBuilder->CommitCommand(); - -}; -//===================================================================================== -void ADAPT_Gen_i::PublishCaseUnderYACS(const char* nomYACS, const char* CaseName) -{ - MESSAGE ( "PublishCaseUnderYACS : nomYACS = " << nomYACS << ", CaseName= " << CaseName ); - - ADAPT::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; - ASSERT(!CORBA::is_nil(myYACS)); - SALOMEDS::SObject_var aYACSSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myYACS))); - ASSERT(!CORBA::is_nil(aYACSSO)); - - ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[CaseName]; - ASSERT(!CORBA::is_nil(myCase)); - SALOMEDS::SObject_var aCaseSO = SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myCase))); - ASSERT(!CORBA::is_nil(aCaseSO)); - - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); - - aStudyBuilder->NewCommand(); - - SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aYACSSO); - aStudyBuilder->Addreference(aSubSO, aCaseSO); - - aStudyBuilder->CommitCommand(); - -}; -//============================================================================= -void ADAPT_Gen_i::PublishResultInSmesh(const char* NomFich, CORBA::Long Option) -// Option = 0 : fichier issu d'une importation -// Option = 1 : fichier issu d'une execution HOMARD -{ - MESSAGE( "PublishResultInSmesh " << NomFich << ", avec Option = " << Option); - if (CORBA::is_nil(myStudy)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid study context"; - throw SALOME::SALOME_Exception(es); - return ; - }; - -// Le module SMESH est-il actif ? - SALOMEDS::SObject_var aSmeshSO = myStudy->FindComponent("SMESH"); -// - if (!CORBA::is_nil(aSmeshSO)) - { -// On verifie que le fichier n est pas deja publie - SALOMEDS::ChildIterator_var aIter = myStudy->NewChildIterator(aSmeshSO); - for (; aIter->More(); aIter->Next()) - { - SALOMEDS::SObject_var aSO = aIter->Value(); - SALOMEDS::GenericAttribute_var aGAttr; - if (aSO->FindAttribute(aGAttr,"AttributeExternalFileDef")) - { - SALOMEDS::AttributeExternalFileDef_var anAttr = SALOMEDS::AttributeExternalFileDef::_narrow(aGAttr); - CORBA::String_var value=anAttr->Value(); - if (strcmp((const char*)value,NomFich) == 0) - { - MESSAGE ( "PublishResultInSmesh : le fichier " << NomFich << " est deja publie." ); - // Pour un fichier importe, on ne republie pas - if ( Option == 0 ) { return; } - // Pour un fichier calcule, on commence par faire la depublication - else - { - MESSAGE ( "PublishResultInSmesh : depublication" ); - SALOMEDS::AttributeName_var anAttr2 = SALOMEDS::AttributeName::_narrow(aGAttr); - CORBA::String_var value2=anAttr2->Value(); - std::string MeshName = string(value2) ; - MESSAGE ( "PublishResultInSmesh : depublication de " << MeshName ); - DeleteResultInSmesh(NomFich, MeshName) ; - } - } - } - } - } - -// On enregistre le fichier - MESSAGE( "Enregistrement du fichier"); - SALOME_LifeCycleCORBA* myLCC = new SALOME_LifeCycleCORBA(_NS); - SMESH::SMESH_Gen_var aSmeshEngine = SMESH::SMESH_Gen::_narrow(myLCC->FindOrLoad_Component("FactoryServer","SMESH")); - ASSERT(!CORBA::is_nil(aSmeshEngine)); - aSmeshEngine->UpdateStudy(); - SMESH::DriverMED_ReadStatus theStatus; - //aSmeshEngine->CreateMeshesFromMED(NomFich, theStatus); - -// On met a jour les attributs AttributeExternalFileDef et AttributePixMap - SMESH::mesh_array* mesMaillages=aSmeshEngine->CreateMeshesFromMED(NomFich, theStatus); - for (int i = 0; i < mesMaillages->length(); i++) - { - MESSAGE( ". Mise a jour des attributs du maillage"); - SMESH::SMESH_Mesh_var monMaillage= (*mesMaillages)[i]; - SALOMEDS::SObject_var aSO=SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(monMaillage))); - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); - SALOMEDS::GenericAttribute_var aGAttr = aStudyBuilder->FindOrCreateAttribute(aSO, "AttributeExternalFileDef"); - SALOMEDS::AttributeExternalFileDef_var anAttr = SALOMEDS::AttributeExternalFileDef::_narrow(aGAttr); - anAttr->SetValue(NomFich); - SALOMEDS::GenericAttribute_var aPixMap = aStudyBuilder->FindOrCreateAttribute(aSO, "AttributePixMap" ); - SALOMEDS::AttributePixMap_var anAttr2 = SALOMEDS::AttributePixMap::_narrow(aPixMap); - const char* icone ; - if ( Option == 0 ) { icone = "mesh_tree_importedmesh.png" ; } - else { icone = "mesh_tree_mesh.png" ; } - anAttr2->SetPixMap( icone ); - } - -} -//============================================================================= -void ADAPT_Gen_i::DeleteResultInSmesh(std::string NomFich, std::string MeshName) -{ - MESSAGE ("DeleteResultInSmesh pour le maillage " << MeshName << " dans le fichier " << NomFich ); - if (CORBA::is_nil(myStudy)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid study context"; - throw SALOME::SALOME_Exception(es); - return ; - }; - -// Le module SMESH est-il actif ? - SALOMEDS::SObject_var aSmeshSO = myStudy->FindComponent("SMESH"); -// - if (CORBA::is_nil(aSmeshSO)) - { - return ; - }; -// On verifie que le fichier est deja publie - SALOMEDS::StudyBuilder_var myBuilder = myStudy->NewBuilder(); - SALOMEDS::ChildIterator_var aIter = myStudy->NewChildIterator(aSmeshSO); - for (; aIter->More(); aIter->Next()) - { - SALOMEDS::SObject_var aSO = aIter->Value(); - SALOMEDS::GenericAttribute_var aGAttr; - if (aSO->FindAttribute(aGAttr,"AttributeExternalFileDef")) - { - SALOMEDS::AttributeExternalFileDef_var anAttr = SALOMEDS::AttributeExternalFileDef::_narrow(aGAttr); - CORBA::String_var value=anAttr->Value(); - if (strcmp((const char*)value,NomFich.c_str()) == 0) - { - if (aSO->FindAttribute(aGAttr,"AttributeName")) - { - SALOMEDS::AttributeName_var anAttr2 = SALOMEDS::AttributeName::_narrow(aGAttr); - CORBA::String_var value2=anAttr2->Value(); - if (strcmp((const char*)value2,MeshName.c_str()) == 0) - { - myBuilder->RemoveObjectWithChildren( aSO ) ; - } - } - } - } - } - return ; -} -//============================================================================= -void ADAPT_Gen_i::PublishMeshIterInSmesh(const char* NomIter) -{ - MESSAGE( "PublishMeshIterInSmesh " << NomIter); - ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[NomIter]; - - SALOMEDS::SObject_var aIterSO=SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration))); - if (CORBA::is_nil(myIteration)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid iterationStudy Object"; - throw SALOME::SALOME_Exception(es); - return ; - }; - const char* MeshFile = myIteration->GetMeshFile() ; - const char* MeshName = myIteration->GetMeshName() ; - CORBA::Long Option = -1 ; - int etat = myIteration->GetState(); -// Iteration initiale - if ( etat <= 0 ) { Option = 0 ; } -// ou iteration calculee - else if ( etat == 2 ) { Option = 1 ; } -// Publication effective apres menage eventuel - if ( Option >= 0 ) - { - DeleteResultInSmesh(MeshFile, MeshName) ; - PublishResultInSmesh(MeshFile, Option) ; - } - -} -//============================================================================= -void ADAPT_Gen_i::PublishFileUnderIteration(const char* NomIter, const char* NomFich, const char* Commentaire) -{ -// MESSAGE ("PublishFileUnderIteration pour l'iteration " << NomIter << " du fichier " << NomFich << " avec le commentaire " << Commentaire ); - ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[NomIter]; - - SALOMEDS::SObject_var aIterSO=SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myIteration))); - if (CORBA::is_nil(myIteration)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid iterationStudy Object"; - throw SALOME::SALOME_Exception(es); - return ; - }; - - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); - - aStudyBuilder->NewCommand(); - - SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aIterSO); -// Pour les fichiers med, on affiche une icone de maillage -// Pour les fichiers qui sont du texte, on affiche une icone de fichier texte 'texte' -// Le reperage se fait par la 1ere lettre du commentaire : I pour Iteration n - std::string icone ; - std::string ior = " " ; - if ( Commentaire[0] == 'M' ) - { icone = "med.png" ; } - else - { icone = "texte_2.png" ; } - PublishInStudyAttr(aStudyBuilder, aSubSO, NomFich, Commentaire, icone.c_str(), ior.c_str() ) ; - - aStudyBuilder->CommitCommand(); -} -// -//============================================================================= -void ADAPT_Gen_i::PublishFileUnderYACS(const char* nomYACS, const char* NomFich, const char* Commentaire) -{ -// MESSAGE ("PublishFileUnderYACS pour le schema " << nomYACS << " du fichier " << NomFich << " avec le commentaire " << Commentaire ); - ADAPT::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; - - SALOMEDS::SObject_var aYACSSO=SALOMEDS::SObject::_narrow(myStudy->FindObjectIOR(_orb->object_to_string(myYACS))); - if (CORBA::is_nil(myYACS)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Invalid YACSStudy Object"; - throw SALOME::SALOME_Exception(es); - return ; - }; - - SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); - - aStudyBuilder->NewCommand(); - - SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aYACSSO); - std::string icone = "texte_2.png" ; - std::string ior = " " ; - PublishInStudyAttr(aStudyBuilder, aSubSO, NomFich, Commentaire, icone.c_str(), ior.c_str() ) ; - - aStudyBuilder->CommitCommand(); -} -// -//============================================================================= -//============================================================================= -// YACS -//============================================================================= -//============================================================================= -//============================================================================= -// Creation d'un schema YACS -// nomCas : nom du cas a traiter -// FileName : nom du fichier contenant le script de lancement du calcul -// DirName : le répertoire de lancement des calculs du schéma -//============================================================================= -ADAPT::HOMARD_YACS_ptr ADAPT_Gen_i::CreateYACSSchema (const char* nomYACS, const char* nomCas, const char* ScriptFile, const char* DirName, const char* MeshFile) -{ - INFOS ( "CreateYACSSchema : Schema YACS " << nomYACS ); - INFOS ( ". nomCas : " << nomCas); - INFOS ( ". ScriptFile : " << ScriptFile); - INFOS ( ". DirName : " << DirName); - INFOS ( ". MeshFile : " << MeshFile); - - // A. Controle du nom : - if ((myStudyContext._mesYACSs).find(nomYACS) != (myStudyContext._mesYACSs).end()) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "This schema YACS has already been defined."; - throw SALOME::SALOME_Exception(es); - return 0; - } - - // B. Creation de l'objet - ADAPT::HOMARD_YACS_var myYACS = newYACS(); - if (CORBA::is_nil(myYACS)) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = "Unable to create the schema YACS"; - throw SALOME::SALOME_Exception(es); - return 0; - }; - myYACS->SetName( nomYACS ) ; - - // C. Enregistrement - myStudyContext._mesYACSs[nomYACS] = myYACS; - - SALOMEDS::SObject_var aSO; - SALOMEDS::SObject_var aResultSO=PublishInStudy(aSO, myYACS, nomYACS); - - PublishCaseUnderYACS(nomYACS, nomCas); - - // D. Caracterisation - // D.1. Options - myYACS->SetDirName( DirName ) ; - myYACS->SetMeshFile( MeshFile ) ; - myYACS->SetScriptFile( ScriptFile ) ; - myYACS->SetCaseName( nomCas ) ; - // D.2. Defaut - int defaut_i ; - // D.2.1. Type constant - myYACS->SetType( 1 ) ; - // D.2.2. Convergence - defaut_i = GetYACSMaxIter() ; - myYACS->SetMaxIter( defaut_i ) ; - defaut_i = GetYACSMaxNode() ; - myYACS->SetMaxNode( defaut_i ) ; - defaut_i = GetYACSMaxElem() ; - myYACS->SetMaxElem( defaut_i ) ; - // D.3. Fichier de sauvegarde dans le répertoire du cas - ADAPT::HOMARD_Cas_ptr caseyacs = GetCase(nomCas) ; - std::string dirnamecase = caseyacs->GetDirName() ; - std::string XMLFile ; - XMLFile = dirnamecase + "/schema.xml" ; - myYACS->SetXMLFile( XMLFile.c_str() ) ; - - return ADAPT::HOMARD_YACS::_duplicate(myYACS); -} -//============================================================================= -// Ecriture d'un schema YACS -//============================================================================= -CORBA::Long ADAPT_Gen_i::YACSWrite(const char* nomYACS) -{ - INFOS ( "YACSWrite : Ecriture de " << nomYACS ); -// Le répertoire du cas - ADAPT::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; - ASSERT(!CORBA::is_nil(myYACS)); -// Le nom du fichier du schema - std::string XMLFile ; - XMLFile = myYACS->GetXMLFile() ; - - int codret = YACSWriteOnFile(nomYACS, XMLFile.c_str()) ; - - return codret ; -} -//============================================================================= -// Ecriture d'un schema YACS sur un fichier donne -//============================================================================= -CORBA::Long ADAPT_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* XMLFile) -{ - INFOS ( "YACSWriteOnFile : Ecriture de " << nomYACS << " sur " << XMLFile ); - - // A. Prealable - int codret = 0; - - // B. L'objet YACS - // B.1. L'objet - ADAPT::HOMARD_YACS_var myYACS = myStudyContext._mesYACSs[nomYACS]; - ASSERT(!CORBA::is_nil(myYACS)); - // B.2. Les caracteristiques - std::string DirName = myYACS->GetDirName() ; - std::string MeshFile = myYACS->GetMeshFile() ; - std::string ScriptFile = myYACS->GetScriptFile() ; - // B.3. Les caracteristiques de convergence - int MaxIter = myYACS->GetMaxIter() ; - int MaxNode = myYACS->GetMaxNode() ; - int MaxElem = myYACS->GetMaxElem() ; - - // C. Le cas - // C.1. L'objet cas - const char* nomCas = myYACS->GetCaseName(); - ADAPT::HOMARD_Cas_var myCase = myStudyContext._mesCas[nomCas]; - ASSERT(!CORBA::is_nil(myCase)); - // C.2. Les instructions python associees au cas - CORBA::String_var dumpCorbaCase = myCase->GetDumpPython(); - std::string pythonCas = dumpCorbaCase.in(); - MESSAGE ("pythonCas :\n"<GetIter0() ; - std::string Iter0Name = myCase->GetIter0Name() ; - MESSAGE (". Iter0Name = " << Iter0Name); - std::string MeshName = Iter0->GetMeshName(); - MESSAGE (". MeshName = " << MeshName); - // D.2. L'iteration numero 1 - ADAPT::listeIterFilles* maListe = Iter0->GetIterations(); - int numberOfIter = maListe->length(); - if ( numberOfIter > 1 ) - { - MESSAGE (". numberOfIter = " << numberOfIter); - SALOME::ExceptionStruct es ; - es.type = SALOME::BAD_PARAM; - std::string text = "Une seule iteration est permise." ; - es.text = CORBA::string_dup(text.c_str()); - throw SALOME::SALOME_Exception(es); - return 0; - } - std::string Iter1Name = std::string((*maListe)[0]); - MESSAGE ("... Iter1Name = " << Iter1Name); - ADAPT::HOMARD_Iteration_var Iter1 = GetIteration(Iter1Name.c_str()) ; - // D.3. Les instructions python associees a l'iteration - CORBA::String_var dumpCorbaIter = Iter1->GetDumpPython(); - std::string pythonIter = dumpCorbaIter.in(); - MESSAGE ("pythonIter :\n"<GetHypoName(); - MESSAGE (". nomHypo = " << nomHypo); - ADAPT::HOMARD_Hypothesis_var myHypo = myStudyContext._mesHypotheses[nomHypo]; - ASSERT(!CORBA::is_nil(myHypo)); - // E.2. Les caracteristiques de l'adaptation - ADAPT::listeTypes* ListTypes = myHypo->GetAdapRefinUnRef(); - ASSERT(ListTypes->length() == 3); - int TypeAdap = (*ListTypes)[0]; -// int TypeRaff = (*ListTypes)[1]; -// int TypeDera = (*ListTypes)[2]; - // E.3. Les instructions python associees a l'hypothese - CORBA::String_var dumpCorbaHypo = myHypo->GetDumpPython(); - std::string pythonHypo = dumpCorbaHypo.in(); - MESSAGE ("pythonHypo :\n"<Texte_DataInit_MeshFile(MeshFile); } - // G.1.3. Le script de lancement - else if ( mot_cle == "Alternance_Calcul_HOMARD_Calcul" ) - { myDriver->Texte_Alternance_Calcul_HOMARD_Calcul(ScriptFile); } - // G.1.4. Les options du cas - else if ( mot_cle == "Iter_1_Case_Options" ) - { myDriver->Texte_Iter_1_Case_Options(pythonCas); } - // G.1.5. Execution de HOMARD : le répertoire du cas - else if ( mot_cle == "HOMARD_Exec_DirName" ) - { myDriver->Texte_HOMARD_Exec_DirName(); } - // G.1.6. Execution de HOMARD : le nom du maillage - else if ( mot_cle == "HOMARD_Exec_MeshName" ) - { - myDriver->Texte_HOMARD_Exec_MeshName(MeshName); - std::string node ; - if ( _LangueShort == "fr" ) { node = "Boucle_de_convergence.Alternance_Calcul_HOMARD" ; } - else { node = "Convergence_Loop.Alternation_Computation_HOMARD" ; } - node += ".Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase" ; - myDriver->TexteParametre( node, "MeshName", "string", MeshName ) ; - } - // G.1.7. Execution de HOMARD : les options de l'hypothese - else if ( mot_cle == "HOMARD_Exec_Hypo_Options" ) - { myDriver->Texte_python_1( pythonHypo, 3, "Hypo" ) ; } - // G.1.8. Execution de HOMARD : les options de l'iteration - else if ( mot_cle == "HOMARD_Exec_Iter_Options" ) - { myDriver->Texte_python_2( pythonIter, "TimeStep", "Iter" ) ; } - // G.1.9. a. Creation eventuelles des zones et frontieres - // b. Enchainement - else if ( mot_cle == "Iter_1" ) - { - std::string texte_control = "" ; - if ( TypeAdap == 0 ) { texte_control += YACSDriverTexteZone( myHypo, myDriver ) ; } - texte_control += YACSDriverTexteBoundary( myCase, myDriver ) ; - texte_control += myDriver->Texte_Iter_1_control() ; - myDriver->TexteAdd(texte_control); - } - // G.1.10. Les tests de convergence - else if ( mot_cle == "Analyse_Test_Convergence" ) - { myDriver->TexteAnalyse_Test_Convergence(MaxIter, MaxNode, MaxElem); } - // G.1.11. Les parametres - else if ( mot_cle == "PARAMETRES" ) - { myDriver->TexteAddParametres(); } - // G.1.n. La ligne est recopiee telle quelle - else { myDriver->TexteAdd(ligne); } - } - // G.2. Ecriture du texte dans le fichier - if ( codret == 0 ) - { myDriver->CreeFichier(); } - } - else - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - std::string text = "The reference file for the YACS schema cannot be read." ; - es.text = CORBA::string_dup(text.c_str()); - throw SALOME::SALOME_Exception(es); - } - - delete myDriver; - - // H. Publication du fichier dans l'arbre - - std::string Commentaire = "xml" ; - PublishFileUnderYACS(nomYACS, XMLFile, Commentaire.c_str()); - - return codret ; -} -//============================================================================= -// Ecriture d'un schema YACS : ecriture des zones associees a une hypothese -//============================================================================= -std::string ADAPT_Gen_i::YACSDriverTexteZone(ADAPT::HOMARD_Hypothesis_var myHypo, YACSDriver* myDriver) -{ - MESSAGE ( "YACSDriverTexteZone" ); - // A. Les zones associees a cette hypothese - ADAPT::listeZonesHypo* ListZone = myHypo->GetZones(); - int numberOfZonesx2 = ListZone->length(); - - // B. Parcours des zones - std::string texte_control ; - for (int iaux = 0; iaux< numberOfZonesx2; iaux++) - { - // 1. Reperage de la zone - std::string ZoneName = std::string((*ListZone)[iaux]); - MESSAGE ( "\n. ZoneName = " << ZoneName << " - " <GetDumpPython(); - std::string pythonStructure_0 = dumpCorbaZone.in(); - MESSAGE ("pythonStructure_0 :"<GetBoundaryGroup(); - int numberOfitems = ListBoundaryGroupType->length(); - - // B. Parcours des frontieres - std::string texte_control ; - std::list ListeBoundaryTraitees ; - for (int NumBoundary = 0; NumBoundary< numberOfitems; NumBoundary=NumBoundary+2) - { - std::string BoundaryName = std::string((*ListBoundaryGroupType)[NumBoundary]); - MESSAGE ( "... BoundaryName = " << BoundaryName); - // Attention a n'ecrire la definition qu'une seule fois car elle peut se trouver - // plusieurs fois dans la definition du cas, d'ou la liste ListeBoundaryTraitees - int A_faire = 1 ; - std::list::const_iterator it = ListeBoundaryTraitees.begin(); - while (it != ListeBoundaryTraitees.end()) - { - MESSAGE ( "..... BoundaryNameTraitee = " << *it); - if ( BoundaryName == *it ) { A_faire = 0 ; } - it++; - } - if ( A_faire == 1 ) - { - // 1. Caracteristiques de la frontiere - ADAPT::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[BoundaryName]; - ASSERT(!CORBA::is_nil(myBoundary)); - // 2. Les instructions python associees a la frontiere - // La premiere ligne est un commentaire a eliminer - // La seconde ligne est l'instruction a proprement parler ; on ne garde que ce qui suit le "." - CORBA::String_var dumpCorbaBoundary = myBoundary->GetDumpPython(); - std::string pythonStructure_0 = dumpCorbaBoundary.in(); - MESSAGE ("pythonStructure_0 :"<URL())); - aFileName += "_HOMARD.dat"; - - // initialize sequence of file names - SALOMEDS_Tool::ListOfFiles aFileSeq; - aFileSeq.reserve(1); - aFileSeq.push_back(CORBA::string_dup(aFileName.c_str())) ; - - // get full path to the data file - aFileName = tmpDir + aFileName; - - // save data - // -> create file - std::ofstream f(aFileName.c_str()); - - // clear temporary id map - context._idmap.clear(); - - int id = 1; - - // -> save cases - std::map::const_iterator it_case; - for (it_case = context._mesCas.begin(); it_case != context._mesCas.end(); ++it_case) { - ADAPT::HOMARD_Cas_var aCas = it_case->second; - PortableServer::ServantBase_var aServant = GetServant(aCas); - HOMARD_Cas_i* aCasServant = dynamic_cast(aServant.in()); - if (aCasServant) { - f << ADAPT::GetSignature(ADAPT::Case) << aCasServant->Dump() << std::endl; - context._idmap[id++] = dynamic_cast(aCasServant); - } - } - // -> save zones - std::map::const_iterator it_zone; - for (it_zone = context._mesZones.begin(); it_zone != context._mesZones.end(); ++it_zone) { - ADAPT::HOMARD_Zone_var aZone = it_zone->second; - PortableServer::ServantBase_var aServant = GetServant(aZone); - HOMARD_Zone_i* aZoneServant = dynamic_cast(aServant.in()); - if (aZoneServant) { - f << ADAPT::GetSignature(ADAPT::Zone) << aZoneServant->Dump() << std::endl; - context._idmap[id++] = dynamic_cast(aZoneServant); - } - } - // -> save hypotheses - std::map::const_iterator it_hypo; - for (it_hypo = context._mesHypotheses.begin(); it_hypo != context._mesHypotheses.end(); ++it_hypo) { - ADAPT::HOMARD_Hypothesis_var aHypo = it_hypo->second; - PortableServer::ServantBase_var aServant = GetServant(aHypo); - HOMARD_Hypothesis_i* aHypoServant = dynamic_cast(aServant.in()); - if (aHypoServant) { - f << ADAPT::GetSignature(ADAPT::Hypothesis) << aHypoServant->Dump() << std::endl; - context._idmap[id++] = dynamic_cast(aHypoServant); - } - } - // -> save iterations - std::map::const_iterator it_iter; - for (it_iter = context._mesIterations.begin(); it_iter != context._mesIterations.end(); ++it_iter) { - ADAPT::HOMARD_Iteration_var aIter = it_iter->second; - PortableServer::ServantBase_var aServant = GetServant(aIter); - HOMARD_Iteration_i* aIterServant = dynamic_cast(aServant.in()); - if (aIterServant) { - f << ADAPT::GetSignature(ADAPT::Iteration) << aIterServant->Dump() << std::endl; - context._idmap[id++] = dynamic_cast(aIterServant); - } - } - // -> save boundaries - std::map::const_iterator it_boundary; - for (it_boundary = context._mesBoundarys.begin(); it_boundary != context._mesBoundarys.end(); ++it_boundary) { - ADAPT::HOMARD_Boundary_var aBoundary = it_boundary->second; - PortableServer::ServantBase_var aServant = GetServant(aBoundary); - HOMARD_Boundary_i* aBoundaryServant = dynamic_cast(aServant.in()); - if (aBoundaryServant) { - f << ADAPT::GetSignature(ADAPT::Boundary) << aBoundaryServant->Dump() << std::endl; - context._idmap[id++] = dynamic_cast(aBoundaryServant); - } - } - // -> close file - MESSAGE ("close file"); - f.close(); - - // put temporary files to the stream - MESSAGE ("put temporary files to the stream"); - aStreamFile = SALOMEDS_Tool::PutFilesToStream(tmpDir.c_str(), aFileSeq, isMultiFile); - - // remove temporary files - MESSAGE ("remove temporary files"); - if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(tmpDir.c_str(), aFileSeq, true); - - // return data stream - MESSAGE ("return data stream"); - return aStreamFile._retn(); -}; - -//=========================================================================== -SALOMEDS::TMPFile* ADAPT_Gen_i::SaveASCII(SALOMEDS::SComponent_ptr theComponent, - const char* theURL, - CORBA::Boolean isMultiFile) -{ - // No specific ASCII persistence - SALOMEDS::TMPFile_var aStreamFile = Save(theComponent, theURL, isMultiFile); - return aStreamFile._retn(); -}; - -//=========================================================================== -CORBA::Boolean ADAPT_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, - const SALOMEDS::TMPFile& theStream, - const char* theURL, - CORBA::Boolean isMultiFile) -{ - MESSAGE ("Load pour theURL = "<< theURL); - - // set current study - if (myStudy->_is_nil()) - UpdateStudy(); - - // get temporary directory name - std::string tmpDir = isMultiFile ? std::string(theURL) : SALOMEDS_Tool::GetTmpDir(); - - // Convert the stream into sequence of files to process - SALOMEDS_Tool::ListOfFiles aFileSeq = SALOMEDS_Tool::PutStreamToFiles(theStream, - tmpDir.c_str(), - isMultiFile); - // HOMARD data file name - std::string aFileName = ""; - if (isMultiFile) - aFileName = SALOMEDS_Tool::GetNameFromPath(Kernel_Utils::encode(SMESH_Gen_i::getStudyServant()->URL())); - aFileName = tmpDir + aFileName + "_HOMARD.dat"; - - StudyContext& context = myStudyContext; - - // save data - // -> create file - std::ifstream f(aFileName.c_str()); - - // clear context - context._mesCas.clear(); - context._mesHypotheses.clear(); - context._mesIterations.clear(); - context._mesZones.clear(); - context._mesBoundarys.clear(); - context._idmap.clear(); - - int id = 1; - std::string line; - - while (f) { - std::getline(f, line); - std::string bounSignature = ADAPT::GetSignature(ADAPT::Boundary); - std::string caseSignature = ADAPT::GetSignature(ADAPT::Case); - std::string hypoSignature = ADAPT::GetSignature(ADAPT::Hypothesis); - std::string iterSignature = ADAPT::GetSignature(ADAPT::Iteration); - std::string zoneSignature = ADAPT::GetSignature(ADAPT::Zone); - std::string yacsSignature = ADAPT::GetSignature(ADAPT::YACS); - if (line.substr(0, bounSignature.size()) == bounSignature) { - // re-create boundary - MESSAGE ("Recreation de la frontiere" ); - ADAPT::HOMARD_Boundary_var aBoundary = newBoundary(); - PortableServer::ServantBase_var aServant = GetServant(aBoundary); - HOMARD_Boundary_i* aBoundaryServant = dynamic_cast(aServant.in()); - if (aBoundaryServant && aBoundaryServant->Restore(line.substr(bounSignature.size()))) { - context._mesBoundarys[aBoundary->GetName()] = aBoundary; - context._idmap[id] = dynamic_cast(aBoundaryServant); - } - } - else if (line.substr(0, caseSignature.size()) == caseSignature) { - // re-create case - MESSAGE ("Recreation du cas" ); - ADAPT::HOMARD_Cas_var aCase = newCase(); - PortableServer::ServantBase_var aServant = GetServant(aCase); - HOMARD_Cas_i* aCaseServant = dynamic_cast(aServant.in()); - if (aCaseServant && aCaseServant->Restore(line.substr(caseSignature.size()))) { - context._mesCas[aCase->GetName()] = aCase; - context._idmap[id] = dynamic_cast(aCaseServant); - } - } - else if (line.substr(0, hypoSignature.size()) == hypoSignature) { - // re-create hypothesis - MESSAGE ("Recreation de l hypothese" ); - ADAPT::HOMARD_Hypothesis_var aHypo = newHypothesis(); - PortableServer::ServantBase_var aServant = GetServant(aHypo); - HOMARD_Hypothesis_i* aHypoServant = dynamic_cast(aServant.in()); - if (aHypoServant && aHypoServant->Restore(line.substr(hypoSignature.size()))) { - context._mesHypotheses[aHypo->GetName()] = aHypo; - context._idmap[id] = dynamic_cast(aHypoServant); - } - } - else if (line.substr(0, iterSignature.size()) == iterSignature) { - // re-create iteration - MESSAGE ("Recreation de l'iteration" ); - ADAPT::HOMARD_Iteration_var aIter = newIteration(); - PortableServer::ServantBase_var aServant = GetServant(aIter); - HOMARD_Iteration_i* aIterServant = dynamic_cast(aServant.in()); - if (aIterServant && aIterServant->Restore(line.substr(iterSignature.size()))) { - context._mesIterations[aIter->GetName()] = aIter; - context._idmap[id] = dynamic_cast(aIterServant); - } - } - else if (line.substr(0, zoneSignature.size()) == zoneSignature) { - MESSAGE ("Recreation de la zone" ); - // re-create zone - ADAPT::HOMARD_Zone_var aZone = newZone(); - PortableServer::ServantBase_var aServant = GetServant(aZone); - HOMARD_Zone_i* aZoneServant = dynamic_cast(aServant.in()); - if (aZoneServant && aZoneServant->Restore(line.substr(zoneSignature.size()))) { - context._mesZones[aZone->GetName()] = aZone; - context._idmap[id] = dynamic_cast(aZoneServant); - } - } - else if (line.substr(0, zoneSignature.size()) == yacsSignature) { - MESSAGE ("Recreation du schema YACS" ); - // re-create YACS - ADAPT::HOMARD_YACS_var aYACS = newYACS(); - PortableServer::ServantBase_var aServant = GetServant(aYACS); - HOMARD_YACS_i* aYACSServant = dynamic_cast(aServant.in()); - if (aYACSServant && aYACSServant->Restore(line.substr(yacsSignature.size()))) { - context._mesYACSs[aYACS->GetName()] = aYACS; - context._idmap[id] = dynamic_cast(aYACSServant); - } - } - id++; - } - - // -> close file - f.close(); - - // Remove temporary files created from the stream - if (!isMultiFile) - SALOMEDS_Tool::RemoveTemporaryFiles(tmpDir.c_str(), aFileSeq, true); - - return true; -}; - -//=========================================================================== -CORBA::Boolean ADAPT_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent, - const SALOMEDS::TMPFile& theStream, - const char* theURL, - CORBA::Boolean isMultiFile) -{ - // No specific ASCII persistence - return Load(theComponent, theStream, theURL, isMultiFile); -}; - -//=========================================================================== -void ADAPT_Gen_i::Close(SALOMEDS::SComponent_ptr theComponent) -{ -}; - -//=========================================================================== -char* ADAPT_Gen_i::ComponentDataType() -{ - return CORBA::string_dup("HOMARD"); -}; - -//=========================================================================== -char* ADAPT_Gen_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject, - const char* IORString, - CORBA::Boolean isMultiFile, - CORBA::Boolean isASCII) -{ - CORBA::String_var aString(""); - if (!CORBA::is_nil(theSObject) && strcmp(IORString, "") != 0) { - StudyContext context = myStudyContext; - CORBA::Object_var anObj = _orb->string_to_object(IORString); - if (!CORBA::is_nil(anObj)) { - PortableServer::ServantBase_var aServant = GetServant(anObj); - PortableServer::ServantBase* aStorable = dynamic_cast(aServant.in()); - if (aStorable) { - std::map::const_iterator it; - for (it = context._idmap.begin(); it != context._idmap.end(); ++it) { - if (it->second == aStorable) { - std::stringstream os; - os << it->first; - aString = CORBA::string_dup(os.str().c_str()); - } - } - } - } - } - return aString._retn(); -}; - -//=========================================================================== -char* ADAPT_Gen_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, - const char* aLocalPersistentID, - CORBA::Boolean isMultiFile, - CORBA::Boolean isASCII) -{ - CORBA::String_var aString(""); - if (!CORBA::is_nil(theSObject) && strcmp(aLocalPersistentID, "") != 0) { - StudyContext context = myStudyContext; - int id = atoi(aLocalPersistentID); - if (id > 0 && context._idmap.find(id) != context._idmap.end()) { - CORBA::Object_var object = _poa->servant_to_reference(context._idmap[ id ]); - if (!CORBA::is_nil(object)) { - aString = _orb->object_to_string(object); - } - } - } - return aString._retn(); -}; - -//=========================================================================== -CORBA::Boolean ADAPT_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR) -{ - if(CORBA::is_nil(myStudy)) - return false; - - ADAPT::HOMARD_Cas_var aCas = ADAPT::HOMARD_Cas::_narrow(theIOR); - if(!aCas->_is_nil()) - return true; - - ADAPT::HOMARD_Hypothesis_var aHypo = ADAPT::HOMARD_Hypothesis::_narrow(theIOR); - if(!aHypo->_is_nil()) - return true; - - ADAPT::HOMARD_Zone_var aZone = ADAPT::HOMARD_Zone::_narrow(theIOR); - if(!aZone->_is_nil()) - return true; - - ADAPT::HOMARD_Boundary_var aBoundary = ADAPT::HOMARD_Boundary::_narrow(theIOR); - if(!aBoundary->_is_nil()) - return true; - - /* Iteration is not published directly - ADAPT::HOMARD_Iteration_var aIter = ADAPT::HOMARD_Iteration::_narrow(theIOR); - if(!aIter->_is_nil()) - return true; - */ - return false; -}; - -//=========================================================================== -CORBA::Boolean ADAPT_Gen_i::CanCopy(SALOMEDS::SObject_ptr theObject) -{ - // No Copy/Paste support - return false; -}; - -//=========================================================================== -SALOMEDS::TMPFile* ADAPT_Gen_i::CopyFrom(SALOMEDS::SObject_ptr theObject, - CORBA::Long& theObjectID) -{ - // No Copy/Paste support - SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0); - return aStreamFile._retn(); -}; - -//=========================================================================== -CORBA::Boolean ADAPT_Gen_i::CanPaste(const char *theComponentName, - CORBA::Long theObjectID) -{ - // No Copy/Paste support - return false; -}; - -//=========================================================================== -SALOMEDS::SObject_ptr ADAPT_Gen_i::PasteInto(const SALOMEDS::TMPFile& theStream, - CORBA::Long theObjectID, - SALOMEDS::SObject_ptr theSObject) -{ - // No Copy/Paste support - SALOMEDS::SObject_var aResultSO; - return aResultSO._retn(); -}; - -//=========================================================================== -PortableServer::ServantBase_var ADAPT_Gen_i::GetServant(CORBA::Object_ptr theObject) -{ - PortableServer::Servant aServant = 0; - if (!CORBA::is_nil(theObject)) { - try { - aServant = _poa->reference_to_servant(theObject); - } - catch (...) { - } - } - return aServant; -} - -//========================================================================== -Engines::TMPFile* ADAPT_Gen_i::DumpPython(CORBA::Boolean isPublished, - CORBA::Boolean isMultiFile, - CORBA::Boolean& isValidScript) -{ - MESSAGE ("Entree dans DumpPython"); - isValidScript=1; - - SALOMEDS::SObject_var aSO = SMESH_Gen_i::getStudyServant()->FindComponent("HOMARD"); - if(CORBA::is_nil(aSO)) - return new Engines::TMPFile(0); - - std::string aScript = "\"\"\"\n"; - aScript += "Python script for HOMARD\n"; - aScript += "Copyright 1996, 2011, 2015 EDF\n"; - aScript += "\"\"\"\n"; - aScript += "__revision__ = \"V1.2\"\n"; - aScript += "import HOMARD\n"; - if( isMultiFile ) - aScript += "import salome\n"; - aScript += "homard = salome.lcc.FindOrLoadComponent('FactoryServer','HOMARD')\n"; - aScript += "\thomard.UpdateStudy()\n"; - MESSAGE (". Au depart \n"< 0) - { - MESSAGE (". Ecritures des frontieres"); - aScript += "#\n# Creation of the boundaries"; - aScript += "\n# =========================="; - } - std::map::const_iterator it_boundary; - for (it_boundary = myStudyContext._mesBoundarys.begin(); - it_boundary != myStudyContext._mesBoundarys.end(); ++it_boundary) - { - ADAPT::HOMARD_Boundary_var maBoundary = (*it_boundary).second; - CORBA::String_var dumpCorbaBoundary = maBoundary->GetDumpPython(); - std::string dumpBoundary = dumpCorbaBoundary.in(); - MESSAGE (dumpBoundary<<"\n"); - aScript += dumpBoundary; - } - - - if (myStudyContext._mesZones.size() > 0) - { - MESSAGE (". Ecritures des zones"); - aScript += "#\n# Creation of the zones"; - aScript += "\n# ====================="; - } - std::map::const_iterator it_zone; - for ( it_zone = myStudyContext._mesZones.begin(); - it_zone != myStudyContext._mesZones.end(); ++it_zone) - { - ADAPT::HOMARD_Zone_var myZone = (*it_zone).second; - CORBA::String_var dumpCorbaZone = myZone->GetDumpPython(); - std::string dumpZone = dumpCorbaZone.in(); - MESSAGE (dumpZone<<"\n"); - aScript += dumpZone; - } - - - if (myStudyContext._mesHypotheses.size() > 0) - { - MESSAGE (". Ecritures des hypotheses"); - aScript += "#\n# Creation of the hypotheses"; - aScript += "\n# =========================="; - } - std::map::const_iterator it_hypo; - for ( it_hypo = myStudyContext._mesHypotheses.begin(); - it_hypo != myStudyContext._mesHypotheses.end(); it_hypo++) - { - ADAPT::HOMARD_Hypothesis_var monHypo = (*it_hypo).second; - CORBA::String_var dumpCorbaHypo = monHypo->GetDumpPython(); - std::string dumpHypo = dumpCorbaHypo.in(); - MESSAGE (dumpHypo<<"\n"); - aScript += dumpHypo; - } - - - if (myStudyContext._mesCas.size() > 0) - { - MESSAGE (". Ecritures des cas"); - aScript += "#\n# Creation of the cases"; - aScript += "\n# ====================="; - } - std::map::const_iterator it_cas; - for (it_cas = myStudyContext._mesCas.begin(); - it_cas != myStudyContext._mesCas.end(); it_cas++) - { - std::string nomCas = (*it_cas).first; - std::string dumpCas = std::string("\n# Creation of the case ") ; - dumpCas += nomCas + std::string("\n"); - dumpCas += std::string("\t") + nomCas; - dumpCas += std::string(" = homard.CreateCase(\"") + nomCas + std::string("\", \""); - - ADAPT::HOMARD_Cas_var myCase = (*it_cas).second; - CORBA::String_var cIter0= myCase->GetIter0Name(); - std::string iter0 = cIter0.in(); - - ADAPT::HOMARD_Iteration_var myIteration = myStudyContext._mesIterations[iter0]; - CORBA::String_var cMesh0= myIteration->GetMeshFile(); - std::string mesh0 = cMesh0.in(); - CORBA::String_var cMeshName0= myIteration->GetMeshName(); - std::string meshName0 = cMeshName0.in(); - dumpCas += meshName0 + std::string("\", \"")+ mesh0 + std::string("\")\n"); - CORBA::String_var dumpCorbaCase = myCase->GetDumpPython(); - std::string dumpCas2= dumpCorbaCase.in(); - - MESSAGE (dumpCas< 0) - { - MESSAGE (". Ecritures des iterations"); - aScript += "#\n# Creation of the iterations" ; - aScript += "\n# =========================="; - } - std::map::const_iterator it_iter; - for (it_iter = myStudyContext._mesIterations.begin(); - it_iter != myStudyContext._mesIterations.end(); ++it_iter) - { - ADAPT::HOMARD_Iteration_var aIter = (*it_iter).second; - CORBA::String_var dumpCorbaIter = aIter->GetDumpPython(); - std::string dumpIter = dumpCorbaIter.in(); - MESSAGE (dumpIter<<"\n"); - aScript += dumpIter; - } - - - if (myStudyContext._mesYACSs.size() > 0) - { - MESSAGE (". Ecritures des schemas YACS"); - aScript += "#\n# Creation of the schemas YACS"; - aScript += "\n# ============================"; - } - std::map::const_iterator it_yacs; - for ( it_yacs = myStudyContext._mesYACSs.begin(); - it_yacs != myStudyContext._mesYACSs.end(); ++it_yacs) - { - ADAPT::HOMARD_YACS_var myYACS = (*it_yacs).second; - CORBA::String_var dumpCorbaYACS = myYACS->GetDumpPython(); - std::string dumpYACS = dumpCorbaYACS.in(); - MESSAGE (dumpYACS<<"\n"); - aScript += dumpYACS; - } - - MESSAGE (". Ecritures finales"); - if( isMultiFile ) - aScript += "\n\tpass"; - aScript += "\n"; - - if( !isMultiFile ) // remove unnecessary tabulation - aScript = RemoveTabulation( aScript ); - -// MESSAGE ("A ecrire \n"<::const_iterator it; - for (it = myStudyContext._mesCas.begin(); - it != myStudyContext._mesCas.end(); it++) - { - if (std::string(nomDir) == std::string(it->second->GetDirName())) - { - casename = std::string(it->second->GetName()) ; - break ; - } - } - return CORBA::string_dup( casename.c_str() ); -} -/*//============================================================================= -void SALOMEException( std::string message ) -{ - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - es.text = message; - throw SALOME::SALOME_Exception(es); - return ; -}*/ -//============================================================================= -char* ADAPT_Gen_i::getVersion() -{ -#if HOMARD_DEVELOPMENT - return CORBA::string_dup(SMESH_VERSION_STR"dev"); -#else - return CORBA::string_dup(SMESH_VERSION_STR); -#endif -} -//=============================================================================== -// Recuperation de la chaine de caracteres par rapport a l'apparition d'un caractere -// ligne : la ligne a manipuler -// caractere : le caractere a reperer -// option : 0 : la chaine avant la premiere apparition du caractere -// 1 : la chaine apres la premiere apparition du caractere -// 2 : la chaine avant la derniere apparition du caractere -// 3 : la chaine apres la derniere apparition du caractere -// Si le caractere est absent, on retourne la chaine totale -//=============================================================================== -std::string ADAPT_Gen_i::GetStringInTexte( const std::string ligne, const std::string caractere, int option ) -{ -// MESSAGE("GetStringInTexte, recherche de '"<> mot_cle ; - chaine = GetStringInTexte ( mot_cle, "\"", 1 ) ; - chaine = GetStringInTexte ( chaine, "\"", 0 ) ; - if ( chaine == "language" ) { section_langue = true ; } - if ( chaine == "HOMARD" ) { section_homard = true ; } - // MESSAGE ( "section_langue = "<" ) - { /*MESSAGE ( "Fin de la section : "<< ligne<<", section_langue = "<> PublisMeshIN ; } - if ( chaine2 == "homard_publish_mesh_out" ) { chainebis >> PublisMeshOUT ; } - // 3.2.2. Les maximum pour YACS - if ( chaine2 == "homard_yacs_max_iter" ) { chainebis >> YACSMaxIter ; } - if ( chaine2 == "homard_yacs_max_node" ) { chainebis >> YACSMaxNode ; } - if ( chaine2 == "homard_yacs_max_elem" ) { chainebis >> YACSMaxElem ; } - if ( chaine2 == "homard_yacs_type_test" ) { YACSTypeTestchaine = chaine ; } - } - } - } - } - } - - // C. Enregistrements - MESSAGE ("Enregistrement de LanguageShort = " << LanguageShort ); - SetLanguageShort( LanguageShort.c_str() ) ; - - MESSAGE ("Enregistrement de PublisMeshIN = " << PublisMeshIN<<", PublisMeshOUT = "<< PublisMeshOUT); - SetPublisMesh(PublisMeshIN, PublisMeshOUT) ; - - MESSAGE ("Enregistrement de YACSMaxIter = " << YACSMaxIter<<", YACSMaxNode = "<< YACSMaxNode<<", YACSMaxElem = "<< YACSMaxElem); - SetYACSMaximum(YACSMaxIter, YACSMaxNode, YACSMaxElem) ; - - MESSAGE ("Enregistrement de TypeTest = " << YACSTypeTestchaine.c_str() ); - int YACSTypeTest ; - if ( ( YACSTypeTestchaine == "VTest > VRef" ) || ( YACSTypeTestchaine == "VTest > VRef" ) ) { YACSTypeTest = 1 ; } - else if ( ( YACSTypeTestchaine == "VTest < VRef" ) || ( YACSTypeTestchaine == "VTest < VRef" ) ) { YACSTypeTest = 2 ; } - else { YACSTypeTest = 0 ; } - MESSAGE ("==> TypeTest = " << YACSTypeTest ); - SetYACSConvergenceType( YACSTypeTest ) ; - - return ; -} -//=============================================================================== -// Langue de SALOME -//=============================================================================== -void ADAPT_Gen_i::SetLanguageShort(const char* LanguageShort) -{ -// MESSAGE ("SetLanguageShort pour LanguageShort = " << LanguageShort ); - _LangueShort = LanguageShort ; - if ( _LangueShort == "fr" ) { _Langue = "Francais" ; } - else { _Langue = "English" ; } - return ; -} -char* ADAPT_Gen_i::GetLanguageShort() -{ -// MESSAGE ("GetLanguageShort"); - return CORBA::string_dup( _LangueShort.c_str() ); -} -//=============================================================================== -// Options de publications -//=============================================================================== -void ADAPT_Gen_i::SetPublisMesh(CORBA::Long PublisMeshIN, CORBA::Long PublisMeshOUT) -{ - _PublisMeshIN = PublisMeshIN ; - _PublisMeshOUT = PublisMeshOUT ; - return ; -} -CORBA::Long ADAPT_Gen_i::GetPublisMeshIN() -{ - return _PublisMeshIN ; -} -CORBA::Long ADAPT_Gen_i::GetPublisMeshOUT() -{ - return _PublisMeshOUT ; -} -//=============================================================================== -// YACS - test de convergence -//=============================================================================== -void ADAPT_Gen_i::SetYACSMaximum(CORBA::Long YACSMaxIter, CORBA::Long YACSMaxNode, CORBA::Long YACSMaxElem) -{ - _YACSMaxIter = YACSMaxIter ; - _YACSMaxNode = YACSMaxNode ; - _YACSMaxElem = YACSMaxElem ; - return ; -} -CORBA::Long ADAPT_Gen_i::GetYACSMaxIter() -{ - return _YACSMaxIter ; -} -CORBA::Long ADAPT_Gen_i::GetYACSMaxNode() -{ - return _YACSMaxNode ; -} -CORBA::Long ADAPT_Gen_i::GetYACSMaxElem() -{ - return _YACSMaxElem ; -} -void ADAPT_Gen_i::SetYACSConvergenceType(CORBA::Long YACSTypeTest) -{ - _YACSTypeTest = YACSTypeTest ; - return ; -} -CORBA::Long ADAPT_Gen_i::GetYACSConvergenceType() -{ - return _YACSTypeTest ; -} - -//============================================================================= -extern "C" -{ - HOMARDENGINE_EXPORT - PortableServer::ObjectId* ADAPTEngine_factory(CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::ObjectId* contId, - const char* instanceName, - const char* interfaceName) - { - MESSAGE("PortableServer::ObjectId* ADAPTEngine_factory()"); - ADAPT_Gen_i* myADAPT_Gen = new ADAPT_Gen_i(orb, poa, contId, instanceName, interfaceName); - return myADAPT_Gen->getId(); - } -} diff --git a/src/ADAPT_I/ADAPT_Gen_i.hxx b/src/ADAPT_I/ADAPT_Gen_i.hxx deleted file mode 100644 index 4ef3172f1..000000000 --- a/src/ADAPT_I/ADAPT_Gen_i.hxx +++ /dev/null @@ -1,347 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef _ADAPT_GEN_I_HXX_ -#define _ADAPT_GEN_I_HXX_ - -#include -#include CORBA_SERVER_HEADER(ADAPT_Gen) -#include CORBA_SERVER_HEADER(HOMARD_Cas) -#include CORBA_SERVER_HEADER(HOMARD_Hypothesis) -#include CORBA_SERVER_HEADER(HOMARD_Iteration) -#include CORBA_SERVER_HEADER(HOMARD_Zone) -#include CORBA_SERVER_HEADER(HOMARD_Boundary) -#include CORBA_SERVER_HEADER(HOMARD_YACS) -#include CORBA_CLIENT_HEADER(SALOMEDS) -#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) - -#include "HOMARD_i.hxx" -#include "ADAPT_Gen.hxx" -#include "HomardDriver.hxx" -#include "YACSDriver.hxx" -#include "FrontTrack.hxx" -#include "SALOME_Component_i.hxx" -#include "SALOME_NamingService.hxx" -#include "Utils_CorbaException.hxx" - -#include -#include - -class HOMARDENGINE_EXPORT ADAPT_Gen_i: - public virtual Engines_Component_i, - public virtual POA_ADAPT::ADAPT_Gen -{ -public: - ADAPT_Gen_i( CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::ObjectId* contId, - const char* instanceName, - const char* interfaceName ); - virtual ~ADAPT_Gen_i(); - - -// Generalites - -// Les creations - ADAPT::HOMARD_Boundary_ptr CreateBoundary (const char* nomBoundary, CORBA::Long typeBoundary); - ADAPT::HOMARD_Boundary_ptr CreateBoundaryCAO(const char* nomBoundary, - const char* DataFile); - ADAPT::HOMARD_Boundary_ptr CreateBoundaryDi (const char* nomBoundary, - const char* MeshName, const char* DataFile); - ADAPT::HOMARD_Boundary_ptr CreateBoundaryCylinder (const char* nomBoundary, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, - CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis, - CORBA::Double Rayon); - ADAPT::HOMARD_Boundary_ptr CreateBoundarySphere (const char* nomBoundary, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, - CORBA::Double Rayon); - ADAPT::HOMARD_Boundary_ptr CreateBoundaryConeR (const char* nomBoundary, - CORBA::Double Xcentre1, CORBA::Double Ycentre1, CORBA::Double Zcentre1, CORBA::Double Rayon1, - CORBA::Double Xcentre2, CORBA::Double Ycentre2, CORBA::Double Zcentre2, CORBA::Double Rayon2); - ADAPT::HOMARD_Boundary_ptr CreateBoundaryConeA (const char* nomBoundary, - CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis, CORBA::Double Angle, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre); - ADAPT::HOMARD_Boundary_ptr CreateBoundaryTorus (const char* nomBoundary, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, - CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis, - CORBA::Double RayonRev, CORBA::Double RayonPri); - - ADAPT::HOMARD_Cas_ptr CreateCase (const char* nomCas, const char* MeshName, const char* FileName); - ADAPT::HOMARD_Cas_ptr CreateCaseFromIteration (const char* nomCas, const char* DirNameStart); - ADAPT::HOMARD_Cas_ptr CreateCaseFromCaseLastIteration (const char* nomCas, const char* DirNameStart); - ADAPT::HOMARD_Cas_ptr CreateCaseFromCaseIteration (const char* nomCas, const char* DirNameStart, CORBA::Long Number); - ADAPT::HOMARD_Cas_ptr CreateCase0 (const char* nomCas, const char* MeshName, const char* FileName, CORBA::Long MeshOption, CORBA::Long NumeIter, CORBA::Long Option); - std::string CreateCase1 (const char* DirNameStart, CORBA::Long Number); - - ADAPT::HOMARD_Hypothesis_ptr CreateHypothesis(const char* nomHypothesis); - - ADAPT::HOMARD_Iteration_ptr CreateIteration (const char* nomIter, const char* nomIterParent); - - ADAPT::HOMARD_Zone_ptr CreateZone (const char* nomZone, CORBA::Long typeZone); - ADAPT::HOMARD_Zone_ptr CreateZoneBox (const char* nomZone, - CORBA::Double Xmini, CORBA::Double Xmaxi, - CORBA::Double Ymini, CORBA::Double Ymaxi, - CORBA::Double Zmini, CORBA::Double Zmaxi); - ADAPT::HOMARD_Zone_ptr CreateZoneBox2D (const char* nomZone, - CORBA::Double Umini, CORBA::Double Umaxi, - CORBA::Double Vmini, CORBA::Double Vmaxi, - CORBA::Long Orient); - ADAPT::HOMARD_Zone_ptr CreateZoneCylinder (const char* nomZone, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, - CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, - CORBA::Double Rayon, CORBA::Double Haut); - ADAPT::HOMARD_Zone_ptr CreateZoneDisk (const char* nomZone, - CORBA::Double Ucentre, CORBA::Double Vcentre, - CORBA::Double Rayon, - CORBA::Long Orient); - ADAPT::HOMARD_Zone_ptr CreateZoneDiskWithHole (const char* nomZone, - CORBA::Double Ucentre, CORBA::Double Vcentre, - CORBA::Double Rayon, CORBA::Double Rayonint, - CORBA::Long Orient); - ADAPT::HOMARD_Zone_ptr CreateZonePipe (const char* nomZone, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, - CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, - CORBA::Double Rayon, CORBA::Double Haut, CORBA::Double Rayonint); - ADAPT::HOMARD_Zone_ptr CreateZoneSphere (const char* nomZone, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, CORBA::Double Rayon); - -// Les informations - ADAPT::HOMARD_Boundary_ptr GetBoundary (const char* nomBoundary); - ADAPT::HOMARD_Cas_ptr GetCase (const char* nomCas); - ADAPT::HOMARD_Hypothesis_ptr GetHypothesis (const char* nomHypothesis); - ADAPT::HOMARD_Iteration_ptr GetIteration (const char* nomIteration); - ADAPT::HOMARD_YACS_ptr GetYACS (const char* nomYACS); - ADAPT::HOMARD_Zone_ptr GetZone (const char* nomZone); - - ADAPT::listeBoundarys* GetAllBoundarysName(); - ADAPT::listeCases* GetAllCasesName(); - ADAPT::listeHypotheses* GetAllHypothesesName(); - ADAPT::listeIterations* GetAllIterationsName(); - ADAPT::listeYACSs* GetAllYACSsName(); - ADAPT::listeZones* GetAllZonesName(); - - void MeshInfo (const char* nomCas, - const char* MeshName, const char* FileName, const char* DirName, - CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte); - - ADAPT::HOMARD_Iteration_ptr LastIteration (const char* nomCas); - -// L'etude - void UpdateStudy(); - void IsValidStudy(); - -// Liens entre structures - void InvalideBoundary(const char* nomBoundary); - void InvalideHypo(const char* nomHypo); - void InvalideIter(const char* nomIter); - void InvalideIterOption(const char* nomIter, CORBA::Long Option); - void InvalideIterInfo(const char* nomIter); - void InvalideYACS(const char* nomYACS); - void InvalideZone(const char* nomZone); - - CORBA::Long DeleteBoundary(const char* nomBoundary); - CORBA::Long DeleteCase(const char* nomCas, CORBA::Long Option); - CORBA::Long DeleteHypo(const char* nomHypothesis); - CORBA::Long DeleteIteration(const char* nomIter, CORBA::Long Option); - CORBA::Long DeleteIterationOption(const char* nomIter, CORBA::Long Option1, CORBA::Long Option2); - CORBA::Long DeleteYACS(const char* nomYACS, CORBA::Long Option); - CORBA::Long DeleteZone(const char* nomZone); - - void AssociateIterHypo(const char* nomIter, const char* nomHypothesis); - - void AssociateHypoZone(const char* nomHypothesis, const char* nomZone, CORBA::Long TypeUse); - void DissociateHypoZone(const char* nomHypothesis, const char* nomZone); - - void AssociateCaseIter(const char* nomCas, const char* nomIter, - const char* labelIter); - -// Actions - void SetEtatIter(const char* nomIter,const CORBA::Long Etat); - char* CreateDirNameIter(const char* nomrep, CORBA::Long num ); - - CORBA::Long Compute(const char* nomIteration, CORBA::Long etatMenage, CORBA::Long modeHOMARD, CORBA::Long Option1, CORBA::Long Option2); - CORBA::Long ComputeAdap(ADAPT::HOMARD_Cas_var myCase, ADAPT::HOMARD_Iteration_var myIteration, CORBA::Long etatMenage, HomardDriver* myDriver, CORBA::Long Option1, CORBA::Long Option2); - CORBA::Long ComputeCAO(ADAPT::HOMARD_Cas_var myCase, ADAPT::HOMARD_Iteration_var myIteration, CORBA::Long Option1, CORBA::Long Option2); - CORBA::Long ComputeCAObis(ADAPT::HOMARD_Iteration_var myIteration, CORBA::Long Option1, CORBA::Long Option2); - char* ComputeDirManagement(ADAPT::HOMARD_Cas_var myCase, ADAPT::HOMARD_Iteration_var myIteration, CORBA::Long etatMenage); - char* ComputeDirPaManagement(ADAPT::HOMARD_Cas_var myCase, ADAPT::HOMARD_Iteration_var myIteration); - void DriverTexteZone(ADAPT::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver); - void DriverTexteField(ADAPT::HOMARD_Iteration_var myIteration, ADAPT::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver); - int DriverTexteBoundary(ADAPT::HOMARD_Cas_var myCase, HomardDriver* myDriver); - void DriverTexteFieldInterp(ADAPT::HOMARD_Iteration_var myIteration, ADAPT::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver); - - char* VerifieDir(const char* nomDir); - - void PublishFileUnderIteration(const char* NomIter, const char* NomFich, const char* Commentaire); - void PublishFileUnderYACS(const char* NomYACS, const char* NomFich, const char* Commentaire); - void PublishBoundaryUnderCase(const char* CaseName, const char* BoundaryName); - void PublishCaseUnderYACS(const char* YACSName, const char* CaseName); - void PublishResultInSmesh(const char* NomFich, CORBA::Long Option); - void DeleteResultInSmesh(std::string NomFich, std::string MeshName); - void PublishMeshIterInSmesh(const char* NomIter); - -// YACS - ADAPT::HOMARD_YACS_ptr CreateYACSSchema (const char* YACSName, const char* nomCas, const char* ScriptFile, const char* DirName, const char* MeshFile); - CORBA::Long YACSWrite(const char* nomYACS); - CORBA::Long YACSWriteOnFile(const char* nomYACS, const char* XMLFile); - std::string YACSDriverTexteZone(ADAPT::HOMARD_Hypothesis_var myHypo, YACSDriver* myDriver); - std::string YACSDriverTexteBoundary(ADAPT::HOMARD_Cas_var myCase, YACSDriver* myDriver); - -// Preferences - void SetPreferences() ; - void SetLanguageShort(const char* LanguageShort); - char* GetLanguageShort(); - void SetPublisMesh(CORBA::Long PublisMeshIN, CORBA::Long PublisMeshOUT); - CORBA::Long GetPublisMeshIN(); - CORBA::Long GetPublisMeshOUT(); - void SetYACSMaximum(CORBA::Long YACSMaxIter, CORBA::Long YACSMaxNode, CORBA::Long YACSMaxElem); - CORBA::Long GetYACSMaxIter(); - CORBA::Long GetYACSMaxNode(); - CORBA::Long GetYACSMaxElem(); - void SetYACSConvergenceType(CORBA::Long YACSTypeTest); - CORBA::Long GetYACSConvergenceType(); - - - // --------------------------------------------------------------- - // next functions are inherited from SALOMEDS::Driver interface - // --------------------------------------------------------------- - - // --> Persistence - virtual SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent, - const char* theURL, - CORBA::Boolean isMultiFile); - - virtual SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent, - const char* theURL, - CORBA::Boolean isMultiFile); - - virtual CORBA::Boolean Load(SALOMEDS::SComponent_ptr theComponent, - const SALOMEDS::TMPFile& theStream, - const char* theURL, - CORBA::Boolean isMultiFile); - - virtual CORBA::Boolean LoadASCII(SALOMEDS::SComponent_ptr theComponent, - const SALOMEDS::TMPFile& theStream, - const char* theURL, - CORBA::Boolean isMultiFile); - - virtual void Close(SALOMEDS::SComponent_ptr IORSComponent); - - virtual char* ComponentDataType(); - - virtual char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject, - const char* IORString, - CORBA::Boolean isMultiFile, - CORBA::Boolean isASCII); - - virtual char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, - const char* aLocalPersistentID, - CORBA::Boolean isMultiFile, - CORBA::Boolean isASCII); - - // --> Data publishing - virtual CORBA::Boolean CanPublishInStudy(CORBA::Object_ptr theIOR); - - virtual SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::SObject_ptr theSObject, - CORBA::Object_ptr theObject, - const char* theName); - - // --> Copy/Paste - virtual CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject); - - virtual SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, - CORBA::Long& theObjectID); - - virtual CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID); - - virtual SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream, - CORBA::Long theObjectID, - SALOMEDS::SObject_ptr theObject); - -// virtual void SALOMEException( std::string message ); - -private: - SALOMEDS::SObject_ptr PublishBoundaryInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, - ADAPT::HOMARD_Boundary_ptr theObject, const char* theName); - SALOMEDS::SObject_ptr PublishCaseInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, - ADAPT::HOMARD_Cas_ptr theObject, const char* theName); - SALOMEDS::SObject_ptr PublishHypotheseInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, - ADAPT::HOMARD_Hypothesis_ptr theObject, const char* theName); - SALOMEDS::SObject_ptr PublishYACSInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, - ADAPT::HOMARD_YACS_ptr theObject, const char* theName); - SALOMEDS::SObject_ptr PublishZoneInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, - ADAPT::HOMARD_Zone_ptr theObject, const char* theName); - virtual void PublishInStudyAttr(SALOMEDS::StudyBuilder_var aStudyBuilder, - SALOMEDS::SObject_var aResultSO, - const char* theName, const char* comment, const char* icone, const char* ior); - - PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject); - - ADAPT::HOMARD_Boundary_ptr newBoundary(); - ADAPT::HOMARD_Cas_ptr newCase(); - ADAPT::HOMARD_Hypothesis_ptr newHypothesis(); - ADAPT::HOMARD_Iteration_ptr newIteration(); - ADAPT::HOMARD_YACS_ptr newYACS(); - ADAPT::HOMARD_Zone_ptr newZone(); - - - virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished, - CORBA::Boolean isMultiFile, - CORBA::Boolean& isValidScript); - - virtual char* getVersion(); - std::string GetStringInTexte( const std::string Texte, const std::string String, int option ) ; - -private: - struct StudyContext - { - std::map _mesBoundarys; - std::map _mesCas; - std::map _mesHypotheses; - std::map _mesIterations; - std::map _mesYACSs; - std::map _mesZones; - std::map _idmap; - }; - - ::ADAPT_Gen* myHomard; - SALOMEDS::Study_var myStudy; - StudyContext myStudyContext; - SALOME_NamingService* _NS; - - int _tag_gene ; - int _tag_boun ; - int _tag_hypo ; - int _tag_yacs ; - int _tag_zone ; - -// Preferences - std::string _Langue ; - std::string _LangueShort ; - int _PublisMeshIN ; - int _PublisMeshOUT ; - int _YACSMaxIter ; - int _YACSMaxNode ; - int _YACSMaxElem ; - int _YACSTypeTest ; - ; - -}; - -#endif diff --git a/src/ADAPT_I/CMakeLists.txt b/src/ADAPT_I/CMakeLists.txt deleted file mode 100644 index 42b4ccc1a..000000000 --- a/src/ADAPT_I/CMakeLists.txt +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright (C) 2012-2020 CEA/DEN, EDF R&D -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# --- options --- -# additional include directories -INCLUDE_DIRECTORIES( - ${OMNIORB_INCLUDE_DIR} - ${KERNEL_INCLUDE_DIRS} - ${MEDFILE_INCLUDE_DIRS} - ${SMESH_INCLUDE_DIRS} - ${GEOM_INCLUDE_DIRS} - ${HDF5_INCLUDE_DIRS} - ${PROJECT_BINARY_DIR} - ${PROJECT_BINARY_DIR}/idl - ${PROJECT_BINARY_DIR}/adm_local/unix - ${PROJECT_SOURCE_DIR}/src/ADAPTFrontTrack - ${PROJECT_SOURCE_DIR}/src/ADAPT - ${PROJECT_SOURCE_DIR}/src/ADAPTGUI - ${PROJECT_SOURCE_DIR}/src/SMESH_I - ${PROJECT_SOURCE_DIR}/src/SMESH - ${PROJECT_SOURCE_DIR}/src/SMESHDS - ${PROJECT_SOURCE_DIR}/src/SMDS - ${PROJECT_SOURCE_DIR}/src/SMESHUtils - ${MEDCOUPLING_INCLUDE_DIRS} -) -# additional preprocessor / compiler flags -ADD_DEFINITIONS( - ${OMNIORB_DEFINITIONS} -) - -# libraries to link to -SET(_link_LIBRARIES - ${MEDFILE_C_LIBRARIES} - ${KERNEL_SalomeContainer} - ${KERNEL_SalomeNS} - ${KERNEL_Registry} - ${KERNEL_SalomeHDFPersist} - ${KERNEL_SalomeLifeCycleCORBA} - ${KERNEL_TOOLSDS} - ${KERNEL_SalomeGenericObj} - ${SMESH_SalomeIDLSMESH} - ${SMESH_SMESHEngine} - ${MEDCoupling_medloader} - SMESHimpl - ADAPTFrontTrack - ADAPTImpl -) - -# --- headers --- - -# header files / no moc processing -SET(ADAPTEngine_HEADERS - HOMARD_Cas_i.hxx - HOMARD_Hypothesis_i.hxx - HOMARD_Iteration_i.hxx - HOMARD_Zone_i.hxx - ADAPT_Gen_i.hxx - HOMARD_Boundary_i.hxx - HOMARD_YACS_i.hxx - HomardMedCommun.h - HOMARD_i.hxx - #~MG_ADAPT_i.hxx -) - -# --- sources --- - -# sources / static -SET(ADAPTEngine_SOURCES - HOMARD_Cas_i.cxx - HOMARD_Hypothesis_i.cxx - HOMARD_Iteration_i.cxx - ADAPT_Gen_i.cxx - HOMARD_Zone_i.cxx - HOMARD_Boundary_i.cxx - HOMARD_YACS_i.cxx - HomardMedCommun.cxx - #~MG_ADAPT_i.cxx -) - -# --- rules --- - -ADD_LIBRARY(ADAPTEngine ${ADAPTEngine_SOURCES}) -TARGET_LINK_LIBRARIES(ADAPTEngine ${_link_LIBRARIES} ) -INSTALL(TARGETS ADAPTEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) - -INSTALL(FILES ${ADAPTEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) diff --git a/src/ADAPT_I/HOMARD_Boundary_i.cxx b/src/ADAPT_I/HOMARD_Boundary_i.cxx deleted file mode 100644 index cc1097767..000000000 --- a/src/ADAPT_I/HOMARD_Boundary_i.cxx +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier -// -#include "HOMARD_Boundary_i.hxx" -#include "ADAPT_Gen_i.hxx" -#include "HOMARD_Boundary.hxx" -#include "HOMARD_DriverTools.hxx" - -#include "utilities.h" - -//============================================================================= -/*! - * standard constructor - */ -//============================================================================= -HOMARD_Boundary_i::HOMARD_Boundary_i() -{ - MESSAGE( "Default constructor, not for use" ); - ASSERT( 0 ); -} -//============================================================================= -/*! - * standard constructor - */ -//============================================================================= -HOMARD_Boundary_i::HOMARD_Boundary_i( CORBA::ORB_ptr orb, - ADAPT::ADAPT_Gen_var engine ) -{ - MESSAGE( "HOMARD_Boundary_i" ); - _gen_i = engine; - _orb = orb; - myHomardBoundary = new ::HOMARD_Boundary(); - ASSERT( myHomardBoundary ); -} -//============================================================================= -/*! - * standard destructor - */ -//============================================================================= -HOMARD_Boundary_i::~HOMARD_Boundary_i() -{ -} -//============================================================================= -//============================================================================= -// Generalites -//============================================================================= -//============================================================================= -void HOMARD_Boundary_i::SetName( const char* Name ) -{ - ASSERT( myHomardBoundary ); - myHomardBoundary->SetName( Name ); -} -//============================================================================= -char* HOMARD_Boundary_i::GetName() -{ - ASSERT( myHomardBoundary ); - return CORBA::string_dup( myHomardBoundary->GetName().c_str() ); -} -//============================================================================= -CORBA::Long HOMARD_Boundary_i::Delete() -{ - ASSERT( myHomardBoundary ); - char* BoundaryName = GetName() ; - MESSAGE ( "Delete : destruction de la frontiere " << BoundaryName ); - return _gen_i->DeleteBoundary(BoundaryName) ; -} -//============================================================================= -char* HOMARD_Boundary_i::GetDumpPython() -{ - ASSERT( myHomardBoundary ); - return CORBA::string_dup( myHomardBoundary->GetDumpPython().c_str() ); -} -//============================================================================= -std::string HOMARD_Boundary_i::Dump() const -{ - return ADAPT::Dump( *myHomardBoundary ); -} -//============================================================================= -bool HOMARD_Boundary_i::Restore( const std::string& stream ) -{ - return ADAPT::Restore( *myHomardBoundary, stream ); -} -//============================================================================= -//============================================================================= -// Caracteristiques -//============================================================================= -//============================================================================= -void HOMARD_Boundary_i::SetType( CORBA::Long Type ) -{ - ASSERT( myHomardBoundary ); - myHomardBoundary->SetType( Type ); -} -//============================================================================= -CORBA::Long HOMARD_Boundary_i::GetType() -{ - ASSERT( myHomardBoundary ); - return CORBA::Long( myHomardBoundary->GetType() ); -} -//============================================================================= -void HOMARD_Boundary_i::SetMeshName( const char* MeshName ) -{ - ASSERT( myHomardBoundary ); - myHomardBoundary->SetMeshName( MeshName ); -} -//============================================================================= -char* HOMARD_Boundary_i::GetMeshName() -{ - ASSERT( myHomardBoundary ); - return CORBA::string_dup( myHomardBoundary->GetMeshName().c_str() ); -} -//============================================================================= -void HOMARD_Boundary_i::SetDataFile( const char* DataFile ) -{ - ASSERT( myHomardBoundary ); - myHomardBoundary->SetDataFile( DataFile ); - int PublisMeshIN = _gen_i->GetPublisMeshIN () ; - if ( PublisMeshIN != 0 ) { _gen_i->PublishResultInSmesh(DataFile, 0); } -} -//============================================================================= -char* HOMARD_Boundary_i::GetDataFile() -{ - ASSERT( myHomardBoundary ); - return CORBA::string_dup( myHomardBoundary->GetDataFile().c_str() ); -} -//============================================================================= -void HOMARD_Boundary_i::SetCylinder( double X0, double X1, double X2, double X3, double X4, double X5, double X6 ) -{ - ASSERT( myHomardBoundary ); - myHomardBoundary->SetCylinder( X0, X1, X2, X3, X4, X5, X6 ); -} -//============================================================================= -void HOMARD_Boundary_i::SetSphere( double Xcentre, double Ycentre, double ZCentre, double rayon ) -{ - ASSERT( myHomardBoundary ); - myHomardBoundary->SetSphere( Xcentre, Ycentre, ZCentre, rayon ); -} -//============================================================================= -void HOMARD_Boundary_i::SetConeR( double Xcentre1, double Ycentre1, double Zcentre1, double Rayon1, double Xcentre2, double Ycentre2, double Zcentre2, double Rayon2) -{ - ASSERT( myHomardBoundary ); - myHomardBoundary->SetConeR( Xcentre1, Ycentre1, Zcentre1, Rayon1, Xcentre2, Ycentre2, Zcentre2, Rayon2 ); -} -//============================================================================= -void HOMARD_Boundary_i::SetConeA( double Xaxe, double Yaxe, double Zaxe, double Angle, double Xcentre, double Ycentre, double Zcentre) -{ - ASSERT( myHomardBoundary ); - myHomardBoundary->SetConeA( Xaxe, Yaxe, Zaxe, Angle, Xcentre, Ycentre, Zcentre ); -} -//============================================================================= -void HOMARD_Boundary_i::SetTorus( double X0, double X1, double X2, double X3, double X4, double X5, double X6, double X7 ) -{ - ASSERT( myHomardBoundary ); - myHomardBoundary->SetTorus( X0, X1, X2, X3, X4, X5, X6, X7 ); -} -//============================================================================= -ADAPT::double_array* HOMARD_Boundary_i::GetCoords() -{ - ASSERT( myHomardBoundary ); - ADAPT::double_array_var aResult = new ADAPT::double_array(); - std::vector mesCoor = myHomardBoundary->GetCoords(); - aResult->length( mesCoor .size() ); - std::vector::const_iterator it; - int i = 0; - for ( it = mesCoor.begin(); it != mesCoor.end(); it++ ) - aResult[i++] = (*it); - return aResult._retn(); -} -//============================================================================= -void HOMARD_Boundary_i::SetLimit( double Xincr, double Yincr, double Zincr ) -{ - ASSERT( myHomardBoundary ); - myHomardBoundary->SetLimit( Xincr, Yincr, Zincr ); -} -//============================================================================= -ADAPT::double_array* HOMARD_Boundary_i::GetLimit() -{ - ASSERT( myHomardBoundary ); - ADAPT::double_array_var aResult = new ADAPT::double_array(); - std::vector mesCoor = myHomardBoundary->GetLimit(); - aResult->length( mesCoor .size() ); - std::vector::const_iterator it; - int i = 0; - for ( it = mesCoor.begin(); it != mesCoor.end(); it++ ) - aResult[i++] = (*it); - return aResult._retn(); -} -//============================================================================= -void HOMARD_Boundary_i::AddGroup( const char* Group) -{ - ASSERT( myHomardBoundary ); - myHomardBoundary->AddGroup( Group ); -} -//============================================================================= -void HOMARD_Boundary_i::SetGroups(const ADAPT::ListGroupType& ListGroup) -{ - ASSERT( myHomardBoundary ); - std::list ListString; - for ( int i = 0; i < ListGroup.length(); i++ ) - { - ListString.push_back(std::string(ListGroup[i])); - } - myHomardBoundary->SetGroups( ListString ); -} -//============================================================================= -ADAPT::ListGroupType* HOMARD_Boundary_i::GetGroups() -{ - ASSERT( myHomardBoundary ); - const std::list& ListString = myHomardBoundary->GetGroups(); - ADAPT::ListGroupType_var aResult = new ADAPT::ListGroupType; - aResult->length( ListString.size() ); - std::list::const_iterator it; - int i = 0; - for ( it = ListString.begin(); it != ListString.end(); it++ ) - { - aResult[i++] = CORBA::string_dup( (*it).c_str() ); - } - return aResult._retn(); -} -//============================================================================= -//============================================================================= -// Liens avec les autres structures -//============================================================================= -//============================================================================= -void HOMARD_Boundary_i::SetCaseCreation( const char* NomCaseCreation ) -{ - ASSERT( myHomardBoundary ); - myHomardBoundary->SetCaseCreation( NomCaseCreation ); -} -//============================================================================= -char* HOMARD_Boundary_i::GetCaseCreation() -{ - ASSERT( myHomardBoundary ); - return CORBA::string_dup( myHomardBoundary->GetCaseCreation().c_str() ); -} - - - diff --git a/src/ADAPT_I/HOMARD_Boundary_i.hxx b/src/ADAPT_I/HOMARD_Boundary_i.hxx deleted file mode 100644 index 37b06921e..000000000 --- a/src/ADAPT_I/HOMARD_Boundary_i.hxx +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier -// - -#ifndef _HOMARD_Boundary_I_HXX_ -#define _HOMARD_Boundary_I_HXX_ - -#include -#include CORBA_SERVER_HEADER(ADAPT_Gen) -#include CORBA_SERVER_HEADER(HOMARD_Boundary) - -#include "HOMARD_i.hxx" -#include "SALOME_Component_i.hxx" -#include "SALOME_NamingService.hxx" -#include "Utils_CorbaException.hxx" - -#include - -class HOMARD_Boundary; - -class HOMARDENGINE_EXPORT HOMARD_Boundary_i: - public virtual Engines_Component_i, - public virtual POA_ADAPT::HOMARD_Boundary, - public virtual PortableServer::ServantBase -{ -public: - HOMARD_Boundary_i( CORBA::ORB_ptr orb, ADAPT::ADAPT_Gen_var gen_i ); - HOMARD_Boundary_i(); - - virtual ~HOMARD_Boundary_i(); - -// Generalites - void SetName( const char* Name ); - char* GetName(); - - CORBA::Long Delete(); - - char* GetDumpPython(); - - std::string Dump() const; - bool Restore( const std::string& stream ); - -// Caracteristiques - void SetType( CORBA::Long Type ); - CORBA::Long GetType(); - - void SetMeshName( const char* MeshName ); - char* GetMeshName(); - - void SetDataFile( const char* DataFile ); - char* GetDataFile(); - - void SetCylinder( double Xcentre, double Ycentre, double ZCentre, - double Xaxe, double Yaxe, double Zaxe, - double rayon ); - void SetSphere( double Xcentre, double Ycentre, double ZCentre, - double rayon ); - void SetConeR( double Xcentre1, double Ycentre1, double Zcentre1, double Rayon1, - double Xcentre2, double Ycentre2, double Zcentre2, double Rayon2); - void SetConeA( double Xaxe, double Yaxe, double Zaxe, double Angle, - double Xcentre, double Ycentre, double ZCentre); - void SetTorus( double Xcentre, double Ycentre, double ZCentre, - double Xaxe, double Yaxe, double Zaxe, - double rayonRev, double rayonPri ); - - ADAPT::double_array* GetCoords(); - - void SetLimit( double Xincr, double Yincr, double Zincr); - ADAPT::double_array* GetLimit(); - - void AddGroup( const char* Group); - void SetGroups(const ADAPT::ListGroupType& ListGroup); - ADAPT::ListGroupType* GetGroups(); - -// Liens avec les autres structures - void SetCaseCreation( const char* NomCaseCreation ); - char* GetCaseCreation(); - - -private: - ::HOMARD_Boundary* myHomardBoundary; - - CORBA::ORB_ptr _orb; - ADAPT::ADAPT_Gen_var _gen_i; -}; - -#endif diff --git a/src/ADAPT_I/HOMARD_Cas_i.cxx b/src/ADAPT_I/HOMARD_Cas_i.cxx deleted file mode 100644 index 432faf678..000000000 --- a/src/ADAPT_I/HOMARD_Cas_i.cxx +++ /dev/null @@ -1,599 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier -// - -#include "HOMARD_Cas_i.hxx" -#include "ADAPT_Gen_i.hxx" -#include "HOMARD_Cas.hxx" -#include "HOMARD_DriverTools.hxx" -#include "HOMARD.hxx" - -#include "utilities.h" -#include -#include - -#ifdef WIN32 -#include -#endif - -//============================================================================= -/*! - * standard constructor - */ -//============================================================================= -HOMARD_Cas_i::HOMARD_Cas_i() -{ - MESSAGE( "Default constructor, not for use" ); - ASSERT( 0 ); -} - -//============================================================================= -/*! - * standard constructor - */ -//============================================================================= -HOMARD_Cas_i::HOMARD_Cas_i( CORBA::ORB_ptr orb, - ADAPT::ADAPT_Gen_var engine ) -{ - MESSAGE( "HOMARD_Cas_i" ); - _gen_i = engine; - _orb = orb; - myHomardCas = new ::HOMARD_Cas(); - ASSERT( myHomardCas ); -} - -//============================================================================= -/*! - * standard destructor - */ -//============================================================================= -HOMARD_Cas_i::~HOMARD_Cas_i() -{ -} -//============================================================================= -//============================================================================= -// Generalites -//============================================================================= -//============================================================================= -void HOMARD_Cas_i::SetName( const char* Name ) -{ - ASSERT( myHomardCas ); - myHomardCas->SetName( Name ); -} -//============================================================================= -char* HOMARD_Cas_i::GetName() -{ - ASSERT( myHomardCas ); - return CORBA::string_dup( myHomardCas->GetName().c_str() ); -} -//============================================================================= -CORBA::Long HOMARD_Cas_i::Delete( CORBA::Long Option ) -{ - ASSERT( myHomardCas ); - char* CaseName = GetName() ; - MESSAGE ( "Delete : destruction du cas " << CaseName << ", Option = " << Option ); - return _gen_i->DeleteCase(CaseName, Option) ; -} -//============================================================================= -char* HOMARD_Cas_i::GetDumpPython() -{ - ASSERT( myHomardCas ); - return CORBA::string_dup( myHomardCas->GetDumpPython().c_str() ); -} -//============================================================================= -std::string HOMARD_Cas_i::Dump() const -{ - return ADAPT::Dump( *myHomardCas ); -} -//============================================================================= -bool HOMARD_Cas_i::Restore( const std::string& stream ) -{ - return ADAPT::Restore( *myHomardCas, stream ); -} -//============================================================================= -//============================================================================= -// Caracteristiques -//============================================================================= -//============================================================================= -void HOMARD_Cas_i::SetDirName( const char* NomDir ) -{ - ASSERT( myHomardCas ); - int codret ; - // A. recuperation du nom ; on ne fait rien si c'est le meme - char* oldrep = GetDirName() ; - if ( strcmp(oldrep,NomDir) == 0 ) - { - return ; - } - MESSAGE ( "SetDirName : passage de oldrep = "<< oldrep << " a NomDir = "<VerifieDir(NomDir) ; - if ( ( std::string(casenamedir).size() > 0 ) & ( strcmp(CaseName,casenamedir)!=0 ) ) - { - INFOS ( "Le repertoire " << NomDir << " est deja utilise pour le cas "<< casenamedir ); - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - std::string text ; - text = "The directory " + std::string(NomDir) + " is already used for the case " + std::string(casenamedir) ; - es.text = CORBA::string_dup(text.c_str()); - throw SALOME::SALOME_Exception(es); - } - // C. Changement/creation du repertoire - codret = myHomardCas->SetDirName( NomDir ); - if ( codret != 0 ) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - std::string text ; - if ( codret == 1 ) { text = "The directory for the case cannot be modified because some iterations are already defined." ; } - else { text = "The directory for the case cannot be reached." ; } - es.text = CORBA::string_dup(text.c_str()); - throw SALOME::SALOME_Exception(es); - } - // D. En cas de reprise, deplacement du point de depart - if ( GetState() != 0 ) - { - MESSAGE ( "etat : " << GetState() ) ; - // D.1. Nom local du repertoire de l'iteration de depart dans le repertoire actuel du cas - ADAPT::HOMARD_Iteration_ptr Iter = GetIter0() ; - char* DirNameIter = Iter->GetDirNameLoc() ; - MESSAGE ( "SetDirName : nom actuel pour le repertoire de l iteration, DirNameIter = "<< DirNameIter); - // D.2. Recherche d'un nom local pour l'iteration de depart dans le futur repertoire du cas - char* nomDirIter = _gen_i->CreateDirNameIter(NomDir, 0 ); - MESSAGE ( "SetDirName : nom futur pour le repertoire de l iteration, nomDirIter = "<< nomDirIter); - // D.3. Creation du futur repertoire local pour l'iteration de depart - std::string nomDirIterTotal ; - nomDirIterTotal = std::string(NomDir) + "/" + std::string(nomDirIter) ; -#ifndef WIN32 - if (mkdir(nomDirIterTotal.c_str(), S_IRWXU|S_IRGRP|S_IXGRP) != 0) -#else - if (_mkdir(nomDirIterTotal.c_str()) != 0) -#endif - { - MESSAGE ( "nomDirIterTotal : " << nomDirIterTotal ) ; - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - std::string text = "The directory for the starting iteration cannot be created." ; - es.text = CORBA::string_dup(text.c_str()); - throw SALOME::SALOME_Exception(es); - } - // D.4. Deplacement du contenu du repertoire - std::string oldnomDirIterTotal ; - oldnomDirIterTotal = std::string(oldrep) + "/" + std::string(DirNameIter) ; - std::string commande = "mv " + std::string(oldnomDirIterTotal) + "/*" + " " + std::string(nomDirIterTotal) ; - codret = system(commande.c_str()) ; - if ( codret != 0 ) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - std::string text = "The starting point for the case cannot be moved into the new directory." ; - es.text = CORBA::string_dup(text.c_str()); - throw SALOME::SALOME_Exception(es); - } - commande = "rm -rf " + std::string(oldnomDirIterTotal) ; - codret = system(commande.c_str()) ; - if ( codret != 0 ) - { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - std::string text = "The starting point for the case cannot be deleted." ; - es.text = CORBA::string_dup(text.c_str()); - throw SALOME::SALOME_Exception(es); - } - // D.5. Memorisation du nom du repertoire de l'iteration - Iter->SetDirNameLoc(nomDirIter) ; - } - return ; -} -//============================================================================= -char* HOMARD_Cas_i::GetDirName() -{ - ASSERT( myHomardCas ); - return CORBA::string_dup( myHomardCas->GetDirName().c_str() ); -} -//============================================================================= -CORBA::Long HOMARD_Cas_i::GetState() -{ - ASSERT( myHomardCas ); -// Nom de l'iteration initiale - char* Iter0Name = GetIter0Name() ; - ADAPT::HOMARD_Iteration_ptr Iter = _gen_i->GetIteration(Iter0Name) ; - int state = Iter->GetNumber() ; - return state ; -} -//============================================================================= -CORBA::Long HOMARD_Cas_i::GetNumberofIter() -{ - ASSERT( myHomardCas ); - return myHomardCas->GetNumberofIter(); -} -//============================================================================= -void HOMARD_Cas_i::SetConfType( CORBA::Long ConfType ) -{ - ASSERT( myHomardCas ); -// VERIFICATION( (ConfType>=-2) && (ConfType<=3) ); - myHomardCas->SetConfType( ConfType ); -} -//============================================================================= -CORBA::Long HOMARD_Cas_i::GetConfType() -{ - ASSERT( myHomardCas ); - return myHomardCas->GetConfType(); -} -//============================================================================= -void HOMARD_Cas_i::SetExtType( CORBA::Long ExtType ) -{ - ASSERT( myHomardCas ); -// VERIFICATION( (ExtType>=0) && (ExtType<=2) ); - myHomardCas->SetExtType( ExtType ); -} -//============================================================================= -CORBA::Long HOMARD_Cas_i::GetExtType() -{ - ASSERT( myHomardCas ); - return myHomardCas->GetExtType(); -} -//============================================================================= -void HOMARD_Cas_i::SetBoundingBox( const ADAPT::extrema& LesExtrema ) -{ - ASSERT( myHomardCas ); - std::vector VExtrema; - ASSERT( LesExtrema.length() == 10 ); - VExtrema.resize( LesExtrema.length() ); - for ( int i = 0; i < LesExtrema.length(); i++ ) - { - VExtrema[i] = LesExtrema[i]; - } - myHomardCas->SetBoundingBox( VExtrema ); -} -//============================================================================= -ADAPT::extrema* HOMARD_Cas_i::GetBoundingBox() -{ - ASSERT(myHomardCas ); - ADAPT::extrema_var aResult = new ADAPT::extrema(); - std::vector LesExtremes = myHomardCas->GetBoundingBox(); - ASSERT( LesExtremes.size() == 10 ); - aResult->length( 10 ); - for ( int i = 0; i < LesExtremes.size(); i++ ) - { - aResult[i] = LesExtremes[i]; - } - return aResult._retn(); -} -//============================================================================= -void HOMARD_Cas_i::AddGroup( const char* Group) -{ - ASSERT( myHomardCas ); - myHomardCas->AddGroup( Group ); -} -//============================================================================= -void HOMARD_Cas_i::SetGroups( const ADAPT::ListGroupType& ListGroup ) -{ - ASSERT( myHomardCas ); - std::list ListString ; - for ( int i = 0; i < ListGroup.length(); i++ ) - { - ListString.push_back(std::string(ListGroup[i])); - } - myHomardCas->SetGroups( ListString ); -} -//============================================================================= -ADAPT::ListGroupType* HOMARD_Cas_i::GetGroups() -{ - ASSERT(myHomardCas ); - const std::list& ListString = myHomardCas->GetGroups(); - ADAPT::ListGroupType_var aResult = new ADAPT::ListGroupType(); - aResult->length( ListString.size() ); - std::list::const_iterator it; - int i = 0; - for ( it = ListString.begin(); it != ListString.end(); it++ ) - { - aResult[i++] = CORBA::string_dup( (*it).c_str() ); - } - return aResult._retn(); -} -//============================================================================= -void HOMARD_Cas_i::AddBoundary(const char* BoundaryName) -{ - MESSAGE ("HOMARD_Cas_i::AddBoundary : BoundaryName = "<< BoundaryName ); - const char * Group = "" ; - AddBoundaryGroup( BoundaryName, Group) ; -} -//============================================================================= -void HOMARD_Cas_i::AddBoundaryGroup( const char* BoundaryName, const char* Group) -{ - MESSAGE ("HOMARD_Cas_i::AddBoundaryGroup : BoundaryName = "<< BoundaryName << ", Group = " << Group ); - ASSERT( myHomardCas ); - // A. Préalables - // A.1. Caractéristiques de la frontière à ajouter - ADAPT::HOMARD_Boundary_ptr myBoundary = _gen_i->GetBoundary(BoundaryName) ; - ASSERT(!CORBA::is_nil(myBoundary)); - int BoundaryType = myBoundary->GetType(); - MESSAGE ( ". BoundaryType = " << BoundaryType ); - // A.2. La liste des frontiere+groupes - const std::list& ListBoundaryGroup = myHomardCas->GetBoundaryGroup(); - std::list::const_iterator it; - // B. Controles - const char * boun ; - int erreur = 0 ; - while ( erreur == 0 ) - { - // B.1. Si on ajoute une frontière CAO, elle doit être la seule frontière - if ( BoundaryType == -1 ) - { - for ( it = ListBoundaryGroup.begin(); it != ListBoundaryGroup.end(); it++ ) - { - boun = (*it).c_str() ; - MESSAGE (".. Frontiere enregistrée : "<< boun ); - if ( *it != BoundaryName ) - { erreur = 1 ; - break ; } - // On saute le nom du groupe - it++ ; - } - } - if ( erreur != 0 ) { break ; } - // B.2. Si on ajoute une frontière non CAO, il ne doit pas y avoir de frontière CAO - if ( BoundaryType != -1 ) - { - for ( it = ListBoundaryGroup.begin(); it != ListBoundaryGroup.end(); it++ ) - { - boun = (*it).c_str() ; - MESSAGE (".. Frontiere enregistrée : "<< boun ); - ADAPT::HOMARD_Boundary_ptr myBoundary_0 = _gen_i->GetBoundary(boun) ; - int BoundaryType_0 = myBoundary_0->GetType(); - MESSAGE ( ".. BoundaryType_0 = " << BoundaryType_0 ); - if ( BoundaryType_0 == -1 ) - { erreur = 2 ; - break ; } - // On saute le nom du groupe - it++ ; - } - if ( erreur != 0 ) { break ; } - } - // B.3. Si on ajoute une frontière discrète, il ne doit pas y avoir d'autre frontière discrète - if ( BoundaryType == 0 ) - { - for ( it = ListBoundaryGroup.begin(); it != ListBoundaryGroup.end(); it++ ) - { - boun = (*it).c_str() ; - MESSAGE (".. Frontiere enregistrée : "<< boun ); - if ( boun != BoundaryName ) - { - ADAPT::HOMARD_Boundary_ptr myBoundary_0 = _gen_i->GetBoundary(boun) ; - int BoundaryType_0 = myBoundary_0->GetType(); - MESSAGE ( ".. BoundaryType_0 = " << BoundaryType_0 ); - if ( BoundaryType_0 == 0 ) - { erreur = 3 ; - break ; } - } - // On saute le nom du groupe - it++ ; - } - if ( erreur != 0 ) { break ; } - } - // B.4. Pour une nouvelle frontiere, publication dans l'arbre d'etudes sous le cas - bool existe = false ; - for ( it = ListBoundaryGroup.begin(); it != ListBoundaryGroup.end(); it++ ) - { - MESSAGE (".. Frontiere : "<< *it ); - if ( *it == BoundaryName ) { existe = true ; } - // On saute le nom du groupe - it++ ; - } - if ( !existe ) - { - char* CaseName = GetName() ; - MESSAGE ( "AddBoundaryGroup : insertion de la frontiere dans l'arbre de " << CaseName ); - _gen_i->PublishBoundaryUnderCase(CaseName, BoundaryName) ; - } - // B.5. Le groupe est-il deja enregistre pour une frontiere de ce cas ? - for ( it = ListBoundaryGroup.begin(); it != ListBoundaryGroup.end(); it++ ) - { - boun = (*it).c_str() ; - it++ ; - MESSAGE (".. Groupe enregistré : "<< *it ); - if ( *it == Group ) - { erreur = 5 ; - break ; } - } - if ( erreur != 0 ) { break ; } - // - break ; - } - // F. Si aucune erreur, enregistrement du couple (frontiere,groupe) dans la reference du cas - // Sinon, arrêt - if ( erreur == 0 ) - { myHomardCas->AddBoundaryGroup( BoundaryName, Group ); } - else - { - std::stringstream ss; - ss << erreur; - std::string str = ss.str(); - std::string texte ; - texte = "Erreur numéro " + str + " pour la frontière à enregistrer : " + std::string(BoundaryName) ; - if ( erreur == 1 ) { texte += "\nIl existe déjà la frontière " ; } - else if ( erreur == 2 ) { texte += "\nIl existe déjà la frontière CAO " ; } - else if ( erreur == 3 ) { texte += "\nIl existe déjà une frontière discrète : " ; } - else if ( erreur == 5 ) { texte += "\nLe groupe " + std::string(Group) + " est déjà enregistré pour la frontière " ; } - texte += std::string(boun) ; - // - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; -#ifdef _DEBUG_ - texte += "\nInvalid AddBoundaryGroup"; -#endif - INFOS(texte) ; - es.text = CORBA::string_dup(texte.c_str()); - throw SALOME::SALOME_Exception(es); - } -} -//============================================================================= -ADAPT::ListBoundaryGroupType* HOMARD_Cas_i::GetBoundaryGroup() -{ - MESSAGE ("GetBoundaryGroup"); - ASSERT(myHomardCas ); - const std::list& ListBoundaryGroup = myHomardCas->GetBoundaryGroup(); - ADAPT::ListBoundaryGroupType_var aResult = new ADAPT::ListBoundaryGroupType(); - aResult->length( ListBoundaryGroup.size() ); - std::list::const_iterator it; - int i = 0; - for ( it = ListBoundaryGroup.begin(); it != ListBoundaryGroup.end(); it++ ) - { - aResult[i++] = CORBA::string_dup( (*it).c_str() ); - } - return aResult._retn(); -} -//============================================================================= -void HOMARD_Cas_i::SupprBoundaryGroup() -{ - MESSAGE ("SupprBoundaryGroup"); - ASSERT(myHomardCas ); - myHomardCas->SupprBoundaryGroup(); -} -//============================================================================= -void HOMARD_Cas_i::SetPyram( CORBA::Long Pyram ) -{ - MESSAGE ("SetPyram, Pyram = " << Pyram ); - ASSERT( myHomardCas ); - myHomardCas->SetPyram( Pyram ); -} -//============================================================================= -CORBA::Long HOMARD_Cas_i::GetPyram() -{ - MESSAGE ("GetPyram"); - ASSERT( myHomardCas ); - return myHomardCas->GetPyram(); -} -//============================================================================= -void HOMARD_Cas_i::MeshInfo(CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte) -{ - MESSAGE ( "MeshInfo : information sur le maillage initial du cas" ); - ASSERT( myHomardCas ); -// -// Nom de l'iteration - char* IterName = GetIter0Name() ; - CORBA::Long etatMenage = -1 ; - CORBA::Long modeHOMARD = 7 ; - CORBA::Long Option1 = 1 ; - CORBA::Long Option2 = 1 ; - if ( Qual != 0 ) { modeHOMARD = modeHOMARD*5 ; } - if ( Diam != 0 ) { modeHOMARD = modeHOMARD*19 ; } - if ( Conn != 0 ) { modeHOMARD = modeHOMARD*11 ; } - if ( Tail != 0 ) { modeHOMARD = modeHOMARD*13 ; } - if ( Inte != 0 ) { modeHOMARD = modeHOMARD*3 ; } - CORBA::Long codret = _gen_i->Compute(IterName, etatMenage, modeHOMARD, Option1, Option2) ; - MESSAGE ( "MeshInfo : codret = " << codret ); - return ; -} -//============================================================================= -//============================================================================= -// Liens avec les autres structures -//============================================================================= -//============================================================================= -char* HOMARD_Cas_i::GetIter0Name() -{ - ASSERT( myHomardCas ); - return CORBA::string_dup( myHomardCas->GetIter0Name().c_str() ); -} -//============================================================================= -ADAPT::HOMARD_Iteration_ptr HOMARD_Cas_i::GetIter0() -{ -// Nom de l'iteration initiale - char* Iter0Name = GetIter0Name() ; - MESSAGE ( "GetIter0 : Iter0Name = " << Iter0Name ); - return _gen_i->GetIteration(Iter0Name) ; -} -//============================================================================= -ADAPT::HOMARD_Iteration_ptr HOMARD_Cas_i::NextIteration( const char* IterName ) -{ -// Nom de l'iteration parent - char* NomIterParent = GetIter0Name() ; - MESSAGE ( "NextIteration : IterName = " << IterName ); - MESSAGE ( "NextIteration : NomIterParent = " << NomIterParent ); - return _gen_i->CreateIteration(IterName, NomIterParent) ; -} -//============================================================================= -ADAPT::HOMARD_Iteration_ptr HOMARD_Cas_i::LastIteration( ) -{ - ADAPT::HOMARD_Iteration_ptr Iter ; - ADAPT::listeIterFilles_var ListeIterFilles ; - char* IterName ; -// Iteration initiale du cas - IterName = GetIter0Name() ; -// On va explorer la descendance de cette iteration initiale -// jusqu'a trouver celle qui n'a pas de filles - int nbiterfilles = 1 ; - while ( nbiterfilles == 1 ) - { -// L'iteration associee -// MESSAGE ( ".. IterName = " << IterName ); - Iter = _gen_i->GetIteration(IterName) ; -// Les filles de cette iteration - ListeIterFilles = Iter->GetIterations() ; - nbiterfilles = ListeIterFilles->length() ; -// MESSAGE ( ".. nbiterfilles = " << nbiterfilles ); -// S'il y a au moins 2 filles, arret : on ne sait pas faire - VERIFICATION( nbiterfilles <= 1 ) ; -// S'il y a une fille unique, on recupere le nom de la fille et on recommence - if ( nbiterfilles == 1 ) - { IterName = ListeIterFilles[0] ; } - } -// - return Iter ; -} -//============================================================================= -void HOMARD_Cas_i::AddIteration( const char* NomIteration ) -{ - ASSERT( myHomardCas ); - myHomardCas->AddIteration( NomIteration ); -} -//============================================================================= -//============================================================================= -// YACS -//============================================================================= -//============================================================================= -//============================================================================= -// Creation d'un schema YACS -// YACSName : nom du schema -// ScriptFile : nom du fichier contenant le script de lancement du calcul -// DirName : le repertoire de lancement des calculs du sch?ma -// MeshFile : nom du fichier contenant le maillage pour le premier calcul -//============================================================================= -ADAPT::HOMARD_YACS_ptr HOMARD_Cas_i::CreateYACSSchema( const char* YACSName, const char* ScriptFile, const char* DirName, const char* MeshFile ) -{ -// Nom du cas - const char* CaseName = GetName() ; - MESSAGE ( "CreateYACSSchema : Schema YACS pour le cas " << YACSName); - MESSAGE ( "nomCas : " << CaseName); - MESSAGE ( "ScriptFile : " << ScriptFile); - MESSAGE ( "DirName : " << DirName); - MESSAGE ( "MeshFile : " << MeshFile); - return _gen_i->CreateYACSSchema(YACSName, CaseName, ScriptFile, DirName, MeshFile) ; -} diff --git a/src/ADAPT_I/HOMARD_Cas_i.hxx b/src/ADAPT_I/HOMARD_Cas_i.hxx deleted file mode 100644 index 60027606a..000000000 --- a/src/ADAPT_I/HOMARD_Cas_i.hxx +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier -// - -#ifndef _HOMARD_CAS_I_HXX_ -#define _HOMARD_CAS_I_HXX_ - -#include -#include CORBA_SERVER_HEADER(ADAPT_Gen) -#include CORBA_SERVER_HEADER(HOMARD_Cas) - -#include "HOMARD_i.hxx" -#include "SALOME_Component_i.hxx" -#include "SALOME_NamingService.hxx" -#include "Utils_CorbaException.hxx" - -#include - -class HOMARD_Cas; - -class HOMARDENGINE_EXPORT HOMARD_Cas_i: - public virtual Engines_Component_i, - public virtual POA_ADAPT::HOMARD_Cas, - public virtual PortableServer::ServantBase -{ -public: - HOMARD_Cas_i( CORBA::ORB_ptr orb, ADAPT::ADAPT_Gen_var gen_i ); - HOMARD_Cas_i(); - - virtual ~HOMARD_Cas_i(); - -// Generalites - void SetName( const char* Name ); - char* GetName(); - - CORBA::Long Delete( CORBA::Long Option ); - - char* GetDumpPython(); - - std::string Dump() const; - bool Restore( const std::string& stream ); - -// Caracteristiques - void SetDirName( const char* NomDir ); - char* GetDirName(); - - CORBA::Long GetState(); - - CORBA::Long GetNumberofIter(); - - void SetConfType( CORBA::Long ConfType ); - CORBA::Long GetConfType(); - - void SetExtType( CORBA::Long ExtType ); - CORBA::Long GetExtType(); - - void SetBoundingBox( const ADAPT::extrema& LesExtremes ); - ADAPT::extrema* GetBoundingBox(); - - void AddGroup( const char* Group); - void SetGroups(const ADAPT::ListGroupType& ListGroup); - ADAPT::ListGroupType* GetGroups(); - - void AddBoundary(const char* Boundary); - void AddBoundaryGroup(const char* Boundary, const char* Group); - ADAPT::ListBoundaryGroupType* GetBoundaryGroup(); - void SupprBoundaryGroup( ); - - void SetPyram( CORBA::Long Pyram ); - CORBA::Long GetPyram(); - - void MeshInfo(CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte); - -// Liens avec les autres structures - char* GetIter0Name(); - ADAPT::HOMARD_Iteration_ptr GetIter0() ; - - ADAPT::HOMARD_Iteration_ptr NextIteration( const char* Name ) ; - - ADAPT::HOMARD_Iteration_ptr LastIteration() ; - - void AddIteration( const char* NomIteration ); - -// YACS - ADAPT::HOMARD_YACS_ptr CreateYACSSchema( const char* YACSName, const char* ScriptFile, const char* DirName, const char* MeshFile ); - -private: - ::HOMARD_Cas* myHomardCas; - - CORBA::ORB_ptr _orb; - ADAPT::ADAPT_Gen_var _gen_i; -}; - -#endif diff --git a/src/ADAPT_I/HOMARD_Hypothesis_i.cxx b/src/ADAPT_I/HOMARD_Hypothesis_i.cxx deleted file mode 100644 index b039bc3a8..000000000 --- a/src/ADAPT_I/HOMARD_Hypothesis_i.cxx +++ /dev/null @@ -1,506 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier -// - -#include "HOMARD_Hypothesis_i.hxx" -#include "ADAPT_Gen_i.hxx" -#include "HOMARD_Hypothesis.hxx" -#include "HOMARD_DriverTools.hxx" - -#include "utilities.h" - -//============================================================================= -/*! - * standard constructor - */ -//============================================================================= -HOMARD_Hypothesis_i::HOMARD_Hypothesis_i() -{ - MESSAGE( "Default constructor, not for use" ); - ASSERT( 0 ); -} - -//============================================================================= -/*! - * standard constructor - */ -//============================================================================= -HOMARD_Hypothesis_i::HOMARD_Hypothesis_i( CORBA::ORB_ptr orb, - ADAPT::ADAPT_Gen_var engine ) -{ - MESSAGE( "standard constructor" ); - _gen_i = engine; - _orb = orb; - myHomardHypothesis = new ::HOMARD_Hypothesis(); - ASSERT( myHomardHypothesis ); -} - -//============================================================================= -/*! - * standard destructor - */ -//============================================================================= -HOMARD_Hypothesis_i::~HOMARD_Hypothesis_i() -{ -} -//============================================================================= -//============================================================================= -// Generalites -//============================================================================= -//============================================================================= -void HOMARD_Hypothesis_i::SetName( const char* Name ) -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->SetName( Name ); -} -//============================================================================= -char* HOMARD_Hypothesis_i::GetName() -{ - ASSERT( myHomardHypothesis ); - return CORBA::string_dup( myHomardHypothesis->GetName().c_str() ); -} -//============================================================================= -CORBA::Long HOMARD_Hypothesis_i::Delete() -{ - ASSERT( myHomardHypothesis ); - char* HypoName = GetName() ; - MESSAGE ( "Delete : destruction de l'hypothese " << HypoName ); - return _gen_i->DeleteHypo(HypoName) ; -} -//============================================================================= -char* HOMARD_Hypothesis_i::GetDumpPython() -{ - ASSERT( myHomardHypothesis ); - return CORBA::string_dup( myHomardHypothesis->GetDumpPython().c_str() ); -} -//============================================================================= -std::string HOMARD_Hypothesis_i::Dump() const -{ - return ADAPT::Dump( *myHomardHypothesis ); -} -//============================================================================= -bool HOMARD_Hypothesis_i::Restore( const std::string& stream ) -{ - return ADAPT::Restore( *myHomardHypothesis, stream ); -} -//============================================================================= -//============================================================================= -// Caracteristiques -//============================================================================= -//============================================================================= -void HOMARD_Hypothesis_i::SetUnifRefinUnRef( CORBA::Long TypeRaffDera ) -{ - ASSERT( myHomardHypothesis ); - VERIFICATION( (TypeRaffDera==1) || (TypeRaffDera==-1) ); - int TypeRaff, TypeDera ; - if ( TypeRaffDera == 1 ) - { - TypeRaff = 1 ; - TypeDera = 0 ; - } - else if ( TypeRaffDera == -1 ) - { - TypeRaff = 0 ; - TypeDera = 1 ; - } - myHomardHypothesis->SetAdapType( -1 ); - myHomardHypothesis->SetRefinTypeDera( TypeRaff, TypeDera ); -} -//============================================================================= -ADAPT::listeTypes* HOMARD_Hypothesis_i::GetAdapRefinUnRef() -{ - ASSERT( myHomardHypothesis ); - ADAPT::listeTypes_var aResult = new ADAPT::listeTypes; - aResult->length( 3 ); - aResult[0] = CORBA::Long( myHomardHypothesis->GetAdapType() ); - aResult[1] = CORBA::Long( myHomardHypothesis->GetRefinType() ); - aResult[2] = CORBA::Long( myHomardHypothesis->GetUnRefType() ); - return aResult._retn(); -} -//============================================================================= -CORBA::Long HOMARD_Hypothesis_i::GetAdapType() -{ - ASSERT( myHomardHypothesis ); - return CORBA::Long( myHomardHypothesis->GetAdapType() ); -} -//============================================================================= -CORBA::Long HOMARD_Hypothesis_i::GetRefinType() -{ - ASSERT( myHomardHypothesis ); - return CORBA::Long( myHomardHypothesis->GetRefinType() ); -} -//============================================================================= -CORBA::Long HOMARD_Hypothesis_i::GetUnRefType() -{ - ASSERT( myHomardHypothesis ); - return CORBA::Long( myHomardHypothesis->GetUnRefType() ); -} -//============================================================================= -void HOMARD_Hypothesis_i::SetField( const char* FieldName ) -{ - myHomardHypothesis->SetField( FieldName ); -} -//============================================================================= -char* HOMARD_Hypothesis_i::GetFieldName() -{ - ASSERT( myHomardHypothesis ); - return CORBA::string_dup( myHomardHypothesis->GetFieldName().c_str() ); -} -//============================================================================= -void HOMARD_Hypothesis_i::SetUseField( CORBA::Long UsField ) -{ - myHomardHypothesis->SetUseField( UsField ); -} -//============================================================================= -ADAPT::InfosHypo* HOMARD_Hypothesis_i::GetField() -{ - ASSERT( myHomardHypothesis ); - ADAPT::InfosHypo* aInfosHypo = new ADAPT::InfosHypo(); - aInfosHypo->FieldName = CORBA::string_dup( myHomardHypothesis->GetFieldName().c_str() ); - aInfosHypo->TypeThR = CORBA::Long( myHomardHypothesis->GetRefinThrType() ); - aInfosHypo->ThreshR = CORBA::Double( myHomardHypothesis->GetThreshR() ); - aInfosHypo->TypeThC = CORBA::Long( myHomardHypothesis->GetUnRefThrType() ); - aInfosHypo->ThreshC = CORBA::Double( myHomardHypothesis->GetThreshC() ); - aInfosHypo->UsField = CORBA::Long( myHomardHypothesis->GetUseField() ); - aInfosHypo->UsCmpI = CORBA::Long( myHomardHypothesis->GetUseComp() ); - return aInfosHypo; -} -//============================================================================= -void HOMARD_Hypothesis_i::SetUseComp( CORBA::Long UsCmpI ) -{ - myHomardHypothesis->SetUseComp( UsCmpI ); -} -//============================================================================= -void HOMARD_Hypothesis_i::AddComp( const char* NomComp ) -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->AddComp( NomComp ); -} -//============================================================================= -void HOMARD_Hypothesis_i::SupprComp( const char* NomComp ) -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->SupprComp(NomComp); -} -//============================================================================= -void HOMARD_Hypothesis_i::SupprComps() -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->SupprComps(); -} -//============================================================================= -ADAPT::listeComposantsHypo* HOMARD_Hypothesis_i::GetComps() -{ - ASSERT( myHomardHypothesis ); - const std::list& ListString = myHomardHypothesis->GetComps(); - ADAPT::listeComposantsHypo_var aResult = new ADAPT::listeComposantsHypo; - aResult->length( ListString.size() ); - std::list::const_iterator it; - int i = 0; - for ( it = ListString.begin(); it != ListString.end(); it++ ) - { - aResult[i++] = CORBA::string_dup( (*it).c_str() ); - } - return aResult._retn(); -} -//============================================================================= -void HOMARD_Hypothesis_i::SetRefinThr( CORBA::Long TypeThR, CORBA::Double ThreshR ) -{ - myHomardHypothesis->SetAdapType( 1 ); - if ( TypeThR > 0 ) - { - int TypeDera = myHomardHypothesis->GetUnRefType() ; - myHomardHypothesis->SetRefinTypeDera( 1, TypeDera ); - } - myHomardHypothesis->SetRefinThr( TypeThR, ThreshR ); -} -//============================================================================= -CORBA::Long HOMARD_Hypothesis_i::GetRefinThrType() -{ - ASSERT( myHomardHypothesis ); - return CORBA::Long( myHomardHypothesis->GetRefinThrType() ); -} -//============================================================================= -void HOMARD_Hypothesis_i::SetUnRefThr( CORBA::Long TypeThC, CORBA::Double ThreshC ) -{ - myHomardHypothesis->SetAdapType( 1 ); - if ( TypeThC > 0 ) - { - int TypeRaff = myHomardHypothesis->GetRefinType() ; - myHomardHypothesis->SetRefinTypeDera( TypeRaff, 1 ); - } - myHomardHypothesis->SetUnRefThr( TypeThC, ThreshC ); -} -//============================================================================= -CORBA::Long HOMARD_Hypothesis_i::GetUnRefThrType() -{ - ASSERT( myHomardHypothesis ); - return CORBA::Long( myHomardHypothesis->GetUnRefThrType() ); -} -//============================================================================= -void HOMARD_Hypothesis_i::SetNivMax( CORBA::Long NivMax ) -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->SetNivMax( NivMax ); -} -//============================================================================= -CORBA::Long HOMARD_Hypothesis_i::GetNivMax() -{ - ASSERT( myHomardHypothesis ); - return myHomardHypothesis->GetNivMax(); -} -//============================================================================= -void HOMARD_Hypothesis_i::SetDiamMin( CORBA::Double DiamMin ) -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->SetDiamMin( DiamMin ); -} -//============================================================================= -CORBA::Double HOMARD_Hypothesis_i::GetDiamMin() -{ - ASSERT( myHomardHypothesis ); - return myHomardHypothesis->GetDiamMin(); -} -//============================================================================= -void HOMARD_Hypothesis_i::SetAdapInit( CORBA::Long AdapInit ) -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->SetAdapInit( AdapInit ); -} -//============================================================================= -CORBA::Long HOMARD_Hypothesis_i::GetAdapInit() -{ - ASSERT( myHomardHypothesis ); - return myHomardHypothesis->GetAdapInit(); -} -//============================================================================= -void HOMARD_Hypothesis_i::SetExtraOutput( CORBA::Long ExtraOutput ) -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->SetExtraOutput( ExtraOutput ); -} -//============================================================================= -CORBA::Long HOMARD_Hypothesis_i::GetExtraOutput() -{ - ASSERT( myHomardHypothesis ); - return myHomardHypothesis->GetExtraOutput(); -} -//============================================================================= -void HOMARD_Hypothesis_i::AddGroup( const char* Group) -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->AddGroup( Group ); -} -//============================================================================= -void HOMARD_Hypothesis_i::SupprGroup( const char* Group ) -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->SupprGroup(Group); -} -//============================================================================= -void HOMARD_Hypothesis_i::SupprGroups() -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->SupprGroups(); -} -//============================================================================= -void HOMARD_Hypothesis_i::SetGroups(const ADAPT::ListGroupType& ListGroup) -{ - ASSERT( myHomardHypothesis ); - std::list ListString; - for ( int i = 0; i < ListGroup.length(); i++ ) - { - ListString.push_back(std::string(ListGroup[i])); - } - myHomardHypothesis->SetGroups( ListString ); -} -//============================================================================= -ADAPT::ListGroupType* HOMARD_Hypothesis_i::GetGroups() -{ - ASSERT( myHomardHypothesis ); - const std::list& ListString = myHomardHypothesis->GetGroups(); - ADAPT::ListGroupType_var aResult = new ADAPT::ListGroupType; - aResult->length( ListString.size() ); - std::list::const_iterator it; - int i = 0; - for ( it = ListString.begin(); it != ListString.end(); it++ ) - { - aResult[i++] = CORBA::string_dup( (*it).c_str() ); - } - return aResult._retn(); -} -//============================================================================= -void HOMARD_Hypothesis_i::SetTypeFieldInterp( CORBA::Long TypeFieldInterp ) -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->SetTypeFieldInterp( TypeFieldInterp ); -} -//============================================================================= -CORBA::Long HOMARD_Hypothesis_i::GetTypeFieldInterp() -{ - ASSERT( myHomardHypothesis ); - return CORBA::Long( myHomardHypothesis->GetTypeFieldInterp() ); -} -//============================================================================= -void HOMARD_Hypothesis_i::AddFieldInterp( const char* FieldInterp ) -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->AddFieldInterpType( FieldInterp, 0 ); -} -//============================================================================= -void HOMARD_Hypothesis_i::AddFieldInterpType( const char* FieldInterp, CORBA::Long TypeInterp ) -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->AddFieldInterpType( FieldInterp, TypeInterp ); -} -//============================================================================= -void HOMARD_Hypothesis_i::SupprFieldInterp( const char* FieldInterp ) -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->SupprFieldInterp(FieldInterp); -} -//============================================================================= -void HOMARD_Hypothesis_i::SupprFieldInterps() -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->SupprFieldInterps(); -} -//============================================================================= -ADAPT::listeFieldInterpsHypo* HOMARD_Hypothesis_i::GetFieldInterps() -{ - ASSERT( myHomardHypothesis ); - const std::list& ListString = myHomardHypothesis->GetFieldInterps(); - ADAPT::listeFieldInterpsHypo_var aResult = new ADAPT::listeFieldInterpsHypo; - aResult->length( ListString.size() ); - std::list::const_iterator it; - int i = 0; - for ( it = ListString.begin(); it != ListString.end(); it++ ) - { - aResult[i++] = CORBA::string_dup( (*it).c_str() ); - } - return aResult._retn(); -} -//============================================================================= -//============================================================================= -// Liens avec les autres structures -//============================================================================= -//============================================================================= -void HOMARD_Hypothesis_i::SetCaseCreation( const char* NomCaseCreation ) -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->SetCaseCreation( NomCaseCreation ); -} -//============================================================================= -char* HOMARD_Hypothesis_i::GetCaseCreation() -{ - ASSERT( myHomardHypothesis ); - return CORBA::string_dup( myHomardHypothesis->GetCaseCreation().c_str() ); -} -//============================================================================= -void HOMARD_Hypothesis_i::LinkIteration( const char* NomIteration ) -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->LinkIteration( NomIteration ); -} -//============================================================================= -void HOMARD_Hypothesis_i::UnLinkIteration( const char* NomIteration ) -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->UnLinkIteration( NomIteration ); -} -//============================================================================= -ADAPT::listeIters* HOMARD_Hypothesis_i::GetIterations() -{ - ASSERT( myHomardHypothesis ); - const std::list& ListString = myHomardHypothesis->GetIterations(); - ADAPT::listeIters_var aResult = new ADAPT::listeIters; - aResult->length( ListString.size() ); - std::list::const_iterator it; - int i = 0; - for ( it = ListString.begin(); it != ListString.end(); it++ ) - { - aResult[i++] = CORBA::string_dup( (*it).c_str() ); - } - return aResult._retn(); -} -//============================================================================= -void HOMARD_Hypothesis_i::AddZone( const char* NomZone, CORBA::Long TypeUse ) -{ - MESSAGE ("Dans AddZone pour " << NomZone << " et TypeUse = " << TypeUse ) ; - ASSERT( myHomardHypothesis ); - VERIFICATION( (TypeUse==1) || (TypeUse==-1) ); - myHomardHypothesis->SetAdapType( 0 ); - int TypeRaff, TypeDera ; - if ( TypeUse == 1 ) - { - TypeRaff = 1 ; - TypeDera = myHomardHypothesis->GetUnRefType() ; - } - else if ( TypeUse == -1 ) - { - TypeRaff = myHomardHypothesis->GetRefinType() ; - TypeDera = 1 ; - } - myHomardHypothesis->SetRefinTypeDera( TypeRaff, TypeDera ); - char* NomHypo = GetName() ; - return _gen_i->AssociateHypoZone(NomHypo, NomZone, TypeUse) ; -} -//============================================================================= -void HOMARD_Hypothesis_i::AddZone0( const char* NomZone, CORBA::Long TypeUse ) -{ - MESSAGE ("Dans AddZone0 pour " << NomZone) ; - ASSERT( myHomardHypothesis ); - myHomardHypothesis->AddZone( NomZone, TypeUse ); -} -//============================================================================= -void HOMARD_Hypothesis_i::SupprZone(const char * NomZone) -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->SupprZone( NomZone); -} -//============================================================================= -void HOMARD_Hypothesis_i::SupprZones() -{ - ASSERT( myHomardHypothesis ); - myHomardHypothesis->SupprZones(); -} -//============================================================================= -ADAPT::listeZonesHypo* HOMARD_Hypothesis_i::GetZones() -{ - ASSERT( myHomardHypothesis ); - const std::list& ListString = myHomardHypothesis->GetZones(); - ADAPT::listeZonesHypo_var aResult = new ADAPT::listeZonesHypo; - aResult->length( ListString.size() ); - std::list::const_iterator it; - int i = 0; - for ( it = ListString.begin(); it != ListString.end(); it++ ) - { - aResult[i++] = CORBA::string_dup( (*it).c_str() ); - } - return aResult._retn(); -} diff --git a/src/ADAPT_I/HOMARD_Hypothesis_i.hxx b/src/ADAPT_I/HOMARD_Hypothesis_i.hxx deleted file mode 100644 index d5dc6f98e..000000000 --- a/src/ADAPT_I/HOMARD_Hypothesis_i.hxx +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier -// - -#ifndef _HOMARD_HYPOTHESIS_I_HXX_ -#define _HOMARD_HYPOTHESIS_I_HXX_ - -#include -#include CORBA_SERVER_HEADER(ADAPT_Gen) -#include CORBA_SERVER_HEADER(HOMARD_Hypothesis) - -#include "HOMARD_i.hxx" -#include "SALOME_Component_i.hxx" -#include "SALOME_NamingService.hxx" -#include "Utils_CorbaException.hxx" - -#include - -class HOMARD_Hypothesis; - -class HOMARDENGINE_EXPORT HOMARD_Hypothesis_i: - public virtual Engines_Component_i, - public virtual POA_ADAPT::HOMARD_Hypothesis, - public virtual PortableServer::ServantBase -{ -public: - HOMARD_Hypothesis_i( CORBA::ORB_ptr orb, ADAPT::ADAPT_Gen_var gen_i ); - HOMARD_Hypothesis_i(); - - virtual ~HOMARD_Hypothesis_i(); - -// Generalites - void SetName( const char* Name ); - char* GetName(); - - CORBA::Long Delete(); - - char* GetDumpPython(); - - std::string Dump() const; - bool Restore( const std::string& stream ); - -// Caracteristiques - void SetUnifRefinUnRef( CORBA::Long TypeRaffDera ); - ADAPT::listeTypes* GetAdapRefinUnRef(); - CORBA::Long GetAdapType(); - CORBA::Long GetRefinType(); - CORBA::Long GetUnRefType(); - - void SetField( const char* FieldName ); - char* GetFieldName(); - void SetUseField(CORBA::Long UsField); - ADAPT::InfosHypo* GetField(); - - void SetUseComp(CORBA::Long UsCmpI); - void AddComp( const char* NomComp ); - void SupprComp( const char* NomComp ); - void SupprComps(); - ADAPT::listeComposantsHypo* GetComps(); - - void SetRefinThr(CORBA::Long TypeThR, CORBA::Double ThreshR); - CORBA::Long GetRefinThrType(); - void SetUnRefThr(CORBA::Long TypeThC, CORBA::Double ThreshC); - CORBA::Long GetUnRefThrType(); - - void SetNivMax( CORBA::Long NivMax ); - CORBA::Long GetNivMax(); - - void SetDiamMin( CORBA::Double DiamMin ); - CORBA::Double GetDiamMin(); - - void SetAdapInit( CORBA::Long AdapInit ); - CORBA::Long GetAdapInit(); - - void SetExtraOutput( CORBA::Long ExtraOutput ); - CORBA::Long GetExtraOutput(); - - void AddGroup( const char* Group); - void SupprGroup( const char* Group ); - void SupprGroups(); - void SetGroups(const ADAPT::ListGroupType& ListGroup); - ADAPT::ListGroupType* GetGroups(); - - void SetTypeFieldInterp( CORBA::Long TypeFieldInterp ); - CORBA::Long GetTypeFieldInterp(); - void AddFieldInterp( const char* FieldInterp ); - void AddFieldInterpType( const char* FieldInterp, CORBA::Long TypeInterp ); - void SupprFieldInterp( const char* FieldInterp ); - void SupprFieldInterps(); - ADAPT::listeFieldInterpsHypo* GetFieldInterps(); - -// Liens avec les autres structures - void SetCaseCreation( const char* NomCaseCreation ); - char* GetCaseCreation(); - - void LinkIteration( const char* NomIteration ); - void UnLinkIteration( const char* NomIteration ); - ADAPT::listeIters* GetIterations(); - - void AddZone( const char* NomZone, CORBA::Long TypeUse ); - void AddZone0( const char* NomZone, CORBA::Long TypeUse ); - void SupprZone( const char* NomZone ); - void SupprZones(); - ADAPT::listeZonesHypo* GetZones(); - -private: - ::HOMARD_Hypothesis* myHomardHypothesis; - - CORBA::ORB_ptr _orb; - ADAPT::ADAPT_Gen_var _gen_i; -}; - -#endif diff --git a/src/ADAPT_I/HOMARD_Iteration_i.cxx b/src/ADAPT_I/HOMARD_Iteration_i.cxx deleted file mode 100644 index 5990a6b71..000000000 --- a/src/ADAPT_I/HOMARD_Iteration_i.cxx +++ /dev/null @@ -1,465 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier -// - -#include "HOMARD_Iteration_i.hxx" -#include "ADAPT_Gen_i.hxx" -#include "HOMARD_Iteration.hxx" -#include "HOMARD_DriverTools.hxx" - -#include "SALOMEDS_Tool.hxx" - -#include "utilities.h" - -//============================================================================= -/*! - * standard constructor - */ -//============================================================================= -HOMARD_Iteration_i::HOMARD_Iteration_i() -{ - MESSAGE( "Default constructor, not for use" ); - ASSERT( 0 ); -} -//============================================================================= -/*! - * standard constructor - */ -//============================================================================= -HOMARD_Iteration_i::HOMARD_Iteration_i( CORBA::ORB_ptr orb, - ADAPT::ADAPT_Gen_var engine ) -{ - MESSAGE("constructor"); - _gen_i = engine; - _orb = orb; - myHomardIteration = new ::HOMARD_Iteration(); - ASSERT( myHomardIteration ); -} -//============================================================================= -/*! - * standard destructor - */ -//============================================================================= -HOMARD_Iteration_i::~HOMARD_Iteration_i() -{ -} -//============================================================================= -//============================================================================= -// Generalites -//============================================================================= -//============================================================================= -void HOMARD_Iteration_i::SetName( const char* Name ) -{ - ASSERT( myHomardIteration ); - myHomardIteration->SetName( Name ); -} -//============================================================================= -char* HOMARD_Iteration_i::GetName() -{ - ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetName().c_str() ); -} -//============================================================================= -CORBA::Long HOMARD_Iteration_i::Delete( CORBA::Long Option ) -{ - ASSERT( myHomardIteration ); - char* IterName = GetName() ; - MESSAGE ( "Delete : destruction de l'iteration " << IterName << ", Option = " << Option ); - return _gen_i->DeleteIteration(IterName, Option) ; -} -//============================================================================= -char* HOMARD_Iteration_i::GetDumpPython() -{ - ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetDumpPython().c_str() ); -} -//============================================================================= -std::string HOMARD_Iteration_i::Dump() const -{ - return ADAPT::Dump( *myHomardIteration ); -} -//============================================================================= -bool HOMARD_Iteration_i::Restore( const std::string& stream ) -{ - return ADAPT::Restore( *myHomardIteration, stream ); -} -//============================================================================= -//============================================================================= -// Caracteristiques -//============================================================================= -//============================================================================= -void HOMARD_Iteration_i::SetDirNameLoc( const char* NomDir ) -{ - ASSERT( myHomardIteration ); - myHomardIteration->SetDirNameLoc( NomDir ); -} -//============================================================================= -char* HOMARD_Iteration_i::GetDirNameLoc() -{ - ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetDirNameLoc().c_str() ); -} -//============================================================================= -char* HOMARD_Iteration_i::GetDirName() -{ - ASSERT( myHomardIteration ); - std::string casename = myHomardIteration->GetCaseName() ; - ADAPT::HOMARD_Cas_ptr caseiter = _gen_i->GetCase(casename.c_str()) ; - std::string dirnamecase = caseiter->GetDirName() ; - std::string dirname = dirnamecase + "/" + GetDirNameLoc() ; - return CORBA::string_dup( dirname.c_str() ); -} -//============================================================================= -void HOMARD_Iteration_i::SetNumber( CORBA::Long NumIter ) -{ - ASSERT( myHomardIteration ); - myHomardIteration->SetNumber( NumIter ); -} -//============================================================================= -CORBA::Long HOMARD_Iteration_i::GetNumber() -{ - ASSERT( myHomardIteration ); - return myHomardIteration->GetNumber() ; -} -//============================================================================= -void HOMARD_Iteration_i::SetState( CORBA::Long Etat ) -{ - ASSERT( myHomardIteration ); - myHomardIteration->SetState( Etat ); -} -//============================================================================= -CORBA::Long HOMARD_Iteration_i::GetState() -{ - ASSERT( myHomardIteration ); - return myHomardIteration->GetState() ; -} -//============================================================================= -void HOMARD_Iteration_i::SetMeshName( const char* NomMesh ) -{ - ASSERT( myHomardIteration ); - myHomardIteration->SetMeshName( NomMesh ); -} -//============================================================================= -char* HOMARD_Iteration_i::GetMeshName() -{ - ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetMeshName().c_str() ); -} -//============================================================================= -void HOMARD_Iteration_i::SetMeshFile( const char* MeshFile ) -{ - ASSERT( myHomardIteration ); - myHomardIteration->SetMeshFile( MeshFile ); -} -//============================================================================= -char* HOMARD_Iteration_i::GetMeshFile() -{ - ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetMeshFile().c_str() ); -} -//============================================================================= -void HOMARD_Iteration_i::SetFieldFile( const char* FieldFile ) -{ - ASSERT( myHomardIteration ); - myHomardIteration->SetFieldFile( FieldFile ); -} -//============================================================================= -char* HOMARD_Iteration_i::GetFieldFile() -{ - ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetFieldFile().c_str() ); -} -//============================================================================= -// Instants pour le champ de pilotage -//============================================================================= -void HOMARD_Iteration_i::SetTimeStep( CORBA::Long TimeStep ) -{ - ASSERT( myHomardIteration ); - myHomardIteration->SetTimeStep( TimeStep ); -} -//============================================================================= -void HOMARD_Iteration_i::SetTimeStepRank( CORBA::Long TimeStep, CORBA::Long Rank ) -{ - ASSERT( myHomardIteration ); - myHomardIteration->SetTimeStepRank( TimeStep, Rank ); -} -//============================================================================= -void HOMARD_Iteration_i::SetTimeStepRankLast() -{ - ASSERT( myHomardIteration ); - myHomardIteration->SetTimeStepRankLast(); -} -//============================================================================= -CORBA::Long HOMARD_Iteration_i::GetTimeStep() -{ - ASSERT( myHomardIteration ); - return CORBA::Long( myHomardIteration->GetTimeStep() ); -} -//============================================================================= -CORBA::Long HOMARD_Iteration_i::GetRank() -{ - ASSERT( myHomardIteration ); - return CORBA::Long( myHomardIteration->GetRank() ); -} -//============================================================================= -// Instants pour un champ a interpoler -//============================================================================= -void HOMARD_Iteration_i::SetFieldInterpTimeStep( const char* FieldInterp, CORBA::Long TimeStep ) -{ - SetFieldInterpTimeStepRank( FieldInterp, TimeStep, TimeStep ); -} -//============================================================================= -void HOMARD_Iteration_i::SetFieldInterpTimeStepRank( const char* FieldInterp, CORBA::Long TimeStep, CORBA::Long Rank ) -{ - ASSERT( myHomardIteration ); - myHomardIteration->SetFieldInterpTimeStepRank( FieldInterp, TimeStep, Rank ); -} -//============================================================================= -ADAPT::listeFieldInterpTSRsIter* HOMARD_Iteration_i::GetFieldInterpsTimeStepRank() -{ - ASSERT( myHomardIteration ); - const std::list& ListString = myHomardIteration->GetFieldInterpsTimeStepRank(); - ADAPT::listeFieldInterpTSRsIter_var aResult = new ADAPT::listeFieldInterpTSRsIter; - aResult->length( ListString.size() ); - std::list::const_iterator it; - int i = 0; - for ( it = ListString.begin(); it != ListString.end(); it++ ) - { - aResult[i++] = CORBA::string_dup( (*it).c_str() ); - } - return aResult._retn(); -} -//============================================================================= -void HOMARD_Iteration_i::SetFieldInterp( const char* FieldInterp ) -{ - myHomardIteration->SetFieldInterp( FieldInterp ); -} -//============================================================================= -ADAPT::listeFieldInterpsIter* HOMARD_Iteration_i::GetFieldInterps() -{ - ASSERT( myHomardIteration ); - const std::list& ListString = myHomardIteration->GetFieldInterps(); - ADAPT::listeFieldInterpsIter_var aResult = new ADAPT::listeFieldInterpsIter; - aResult->length( ListString.size() ); - std::list::const_iterator it; - int i = 0; - for ( it = ListString.begin(); it != ListString.end(); it++ ) - { - aResult[i++] = CORBA::string_dup( (*it).c_str() ); - } - return aResult._retn(); -} -//============================================================================= -void HOMARD_Iteration_i::SupprFieldInterps() -{ - ASSERT( myHomardIteration ); - myHomardIteration->SupprFieldInterps(); -} -//============================================================================= -void HOMARD_Iteration_i::SetLogFile( const char* LogFile ) -{ - ASSERT( myHomardIteration ); - myHomardIteration->SetLogFile( LogFile ); -} -//============================================================================= -char* HOMARD_Iteration_i::GetLogFile() -{ - ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetLogFile().c_str() ); -} -//============================================================================= -CORBA::Long HOMARD_Iteration_i::Compute(CORBA::Long etatMenage, CORBA::Long Option) -{ - MESSAGE ( "Compute : calcul d'une iteration, etatMenage = "<Compute(IterName, etatMenage, modeHOMARD, Option1, Option) ; -} -//============================================================================= -void HOMARD_Iteration_i::MeshInfo(CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte) -{ - MESSAGE ( "MeshInfo : information sur le maillage associe a une iteration" ); - ASSERT( myHomardIteration ); -// - int Option = 1 ; - MeshInfoOption( Qual, Diam, Conn, Tail, Inte, Option ) ; -// - return ; -} -//============================================================================= -void HOMARD_Iteration_i::MeshInfoOption(CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte, CORBA::Long Option) -{ - MESSAGE ( "MeshInfoOption : information sur le maillage associe a une iteration" ); - ASSERT( myHomardIteration ); -// -// Nom de l'iteration - char* IterName = GetName() ; - CORBA::Long etatMenage = -1 ; - CORBA::Long modeHOMARD = 7 ; - if ( Qual != 0 ) { modeHOMARD = modeHOMARD*5 ; } - if ( Diam != 0 ) { modeHOMARD = modeHOMARD*19 ; } - if ( Conn != 0 ) { modeHOMARD = modeHOMARD*11 ; } - if ( Tail != 0 ) { modeHOMARD = modeHOMARD*13 ; } - if ( Inte != 0 ) { modeHOMARD = modeHOMARD*3 ; } - MESSAGE ( "MeshInfoOption : information sur le maillage de l'iteration " << IterName ); - CORBA::Long Option2 = 1 ; - CORBA::Long codret = _gen_i->Compute(IterName, etatMenage, modeHOMARD, Option, Option2) ; - MESSAGE ( "MeshInfoOption : codret = " << codret ); -// - return ; -} -//============================================================================= -void HOMARD_Iteration_i::SetFileInfo( const char* FileInfo ) -{ - ASSERT( myHomardIteration ); - myHomardIteration->SetFileInfo( FileInfo ); -} -//============================================================================= -char* HOMARD_Iteration_i::GetFileInfo() -{ - ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetFileInfo().c_str() ); -} -//============================================================================= -//============================================================================= -// Liens avec les autres iterations -//============================================================================= -//============================================================================= -ADAPT::HOMARD_Iteration_ptr HOMARD_Iteration_i::NextIteration( const char* IterName ) -{ -// Nom de l'iteration parent - char* NomIterParent = GetName() ; - MESSAGE ( "NextIteration : creation de l'iteration " << IterName << " comme fille de " << NomIterParent ); - return _gen_i->CreateIteration(IterName, NomIterParent) ; -} -//============================================================================= -void HOMARD_Iteration_i::LinkNextIteration( const char* NomIteration ) -{ - ASSERT( myHomardIteration ); - myHomardIteration->LinkNextIteration( NomIteration ); -} -//============================================================================= -void HOMARD_Iteration_i::UnLinkNextIteration( const char* NomIteration ) -{ - ASSERT( myHomardIteration ); - myHomardIteration->UnLinkNextIteration( NomIteration ); -} -//============================================================================= -ADAPT::listeIterFilles* HOMARD_Iteration_i::GetIterations() -{ - ASSERT( myHomardIteration ); - const std::list& maListe = myHomardIteration->GetIterations(); - ADAPT::listeIterFilles_var aResult = new ADAPT::listeIterFilles; - aResult->length( maListe.size() ); - std::list::const_iterator it; - int i = 0; - for ( it = maListe.begin(); it != maListe.end(); it++ ) - { - aResult[i++] = CORBA::string_dup( (*it).c_str() ); - } - return aResult._retn(); -} -//============================================================================= -void HOMARD_Iteration_i::SetIterParentName( const char* NomIterParent ) -{ - ASSERT( myHomardIteration ); - myHomardIteration->SetIterParentName( NomIterParent ); -} -//============================================================================= -char* HOMARD_Iteration_i::GetIterParentName() -{ - ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetIterParentName().c_str() ); -} -//============================================================================= -ADAPT::HOMARD_Iteration_ptr HOMARD_Iteration_i::GetIterParent() -{ -// Nom de l'iteration parent - char* NomIterParent = GetIterParentName() ; - MESSAGE ( "GetIterParent : NomIterParent = " << NomIterParent ); - return _gen_i->GetIteration(NomIterParent) ; -} -//============================================================================= -//============================================================================= -// Liens avec les autres structures -//============================================================================= -//============================================================================= -void HOMARD_Iteration_i::SetCaseName( const char* NomCas ) -{ - ASSERT( myHomardIteration ); - myHomardIteration->SetCaseName( NomCas ); -} -//============================================================================= -char* HOMARD_Iteration_i::GetCaseName() -{ - ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetCaseName().c_str() ); -} -//============================================================================= -void HOMARD_Iteration_i::AssociateHypo( const char* NomHypo ) -{ - ASSERT( myHomardIteration ); -// -// Nom de l'iteration - char* IterName = GetName() ; - MESSAGE ( ". IterName = " << IterName ); - return _gen_i->AssociateIterHypo(IterName, NomHypo) ; -} -//============================================================================= -void HOMARD_Iteration_i::SetHypoName( const char* NomHypo ) -{ - ASSERT( myHomardIteration ); - myHomardIteration->SetHypoName( NomHypo ); -} -//============================================================================= -char* HOMARD_Iteration_i::GetHypoName() -{ - ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetHypoName().c_str() ); -} -//============================================================================= -//============================================================================= -// Divers -//============================================================================= -//============================================================================= -void HOMARD_Iteration_i::SetInfoCompute( CORBA::Long MessInfo ) -{ - ASSERT( myHomardIteration ); - myHomardIteration->SetInfoCompute( MessInfo ); -} -//============================================================================= -CORBA::Long HOMARD_Iteration_i::GetInfoCompute() -{ - ASSERT( myHomardIteration ); - return myHomardIteration->GetInfoCompute() ; -} diff --git a/src/ADAPT_I/HOMARD_Iteration_i.hxx b/src/ADAPT_I/HOMARD_Iteration_i.hxx deleted file mode 100644 index 87d353e77..000000000 --- a/src/ADAPT_I/HOMARD_Iteration_i.hxx +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier -// - -#ifndef _HOMARD_ITERATION_I_HXX_ -#define _HOMARD_ITERATION_I_HXX_ - -#include -#include CORBA_SERVER_HEADER(ADAPT_Gen) -#include CORBA_SERVER_HEADER(HOMARD_Iteration) - -#include "HOMARD_i.hxx" -#include "SALOME_Component_i.hxx" -#include "SALOME_NamingService.hxx" -#include "Utils_CorbaException.hxx" - -#include - -class HOMARD_Iteration; - -class HOMARDENGINE_EXPORT HOMARD_Iteration_i: - public virtual Engines_Component_i, - public virtual POA_ADAPT::HOMARD_Iteration, - public virtual PortableServer::ServantBase -{ -public: - HOMARD_Iteration_i( CORBA::ORB_ptr orb, - ADAPT::ADAPT_Gen_var gen_i ); - HOMARD_Iteration_i(); - - virtual ~HOMARD_Iteration_i(); - -// Generalites - void SetName( const char* Name ); - char* GetName(); - - CORBA::Long Delete( CORBA::Long Option ); - - char* GetDumpPython(); - - std::string Dump() const; - bool Restore( const std::string& stream ); - -// Caracteristiques - void SetDirNameLoc( const char* NomDir ); - char* GetDirNameLoc(); - - char* GetDirName(); - - void SetNumber( CORBA::Long NumIter ); - CORBA::Long GetNumber(); - - void SetState( CORBA::Long etat ); - CORBA::Long GetState(); - - void SetMeshName( const char* NomMesh ); - char* GetMeshName(); - - void SetMeshFile( const char* MeshFile ); - char* GetMeshFile(); - - void SetFieldFile( const char* FieldFile ); - char* GetFieldFile(); -// Instants pour le champ de pilotage - void SetTimeStep( CORBA::Long TimeStep ); - void SetTimeStepRank( CORBA::Long TimeStep, CORBA::Long Rank ); - void SetTimeStepRankLast(); - CORBA::Long GetTimeStep(); - CORBA::Long GetRank(); -// Instants pour un champ a interpoler - void SetFieldInterpTimeStep( const char* FieldInterp, CORBA::Long TimeStep ); - void SetFieldInterpTimeStepRank( const char* FieldInterp, CORBA::Long TimeStep, CORBA::Long Rank ); - ADAPT::listeFieldInterpTSRsIter* GetFieldInterpsTimeStepRank(); - void SetFieldInterp( const char* FieldInterp ); - ADAPT::listeFieldInterpsIter* GetFieldInterps(); - void SupprFieldInterps(); - - void SetLogFile( const char* LogFile ); - char* GetLogFile(); - - CORBA::Long Compute(CORBA::Long etatMenage, CORBA::Long Option); - - void MeshInfo(CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte); - - void MeshInfoOption(CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte, CORBA::Long Option); - - void SetFileInfo( const char* FileInfo ); - char* GetFileInfo(); - - // Liens avec les autres iterations - ADAPT::HOMARD_Iteration_ptr NextIteration( const char* Name) ; - - void LinkNextIteration( const char* NomIteration ); - void UnLinkNextIteration( const char* NomIteration ); - ADAPT::listeIterFilles* GetIterations(); - - void SetIterParentName( const char* NomIterParent ); - char* GetIterParentName(); - ADAPT::HOMARD_Iteration_ptr GetIterParent() ; - -// Liens avec les autres structures - void SetCaseName( const char* NomCas ); - char* GetCaseName(); - - void AssociateHypo( const char* NomHypo); - void SetHypoName( const char* NomHypo ); - char* GetHypoName(); - -// Divers - void SetInfoCompute( CORBA::Long MessInfo ); - CORBA::Long GetInfoCompute(); - -private: - ::HOMARD_Iteration* myHomardIteration; - - CORBA::ORB_ptr _orb; - ADAPT::ADAPT_Gen_var _gen_i; -}; - -#endif diff --git a/src/ADAPT_I/HOMARD_YACS_i.cxx b/src/ADAPT_I/HOMARD_YACS_i.cxx deleted file mode 100644 index ae6977b23..000000000 --- a/src/ADAPT_I/HOMARD_YACS_i.cxx +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier -// - -#include "HOMARD_YACS_i.hxx" -#include "ADAPT_Gen_i.hxx" -#include "HOMARD_YACS.hxx" -#include "HOMARD_DriverTools.hxx" - -#include "SALOMEDS_Tool.hxx" - -#include "utilities.h" - -//============================================================================= -/*! - * standard constructor - */ -//============================================================================= -HOMARD_YACS_i::HOMARD_YACS_i() -{ - MESSAGE( "Default constructor, not for use" ); - ASSERT( 0 ); -} -//============================================================================= -/*! - * standard constructor - */ -//============================================================================= -HOMARD_YACS_i::HOMARD_YACS_i( CORBA::ORB_ptr orb, - ADAPT::ADAPT_Gen_var engine ) -{ - MESSAGE("constructor"); - _gen_i = engine; - _orb = orb; - myHomardYACS = new ::HOMARD_YACS(); - ASSERT( myHomardYACS ); -} -//============================================================================= -/*! - * standard destructor - */ -//============================================================================= -HOMARD_YACS_i::~HOMARD_YACS_i() -{ -} -//============================================================================= -//============================================================================= -// Generalites -//============================================================================= -//============================================================================= -void HOMARD_YACS_i::SetName( const char* Name ) -{ - ASSERT( myHomardYACS ); - myHomardYACS->SetName( Name ); -} -//============================================================================= -char* HOMARD_YACS_i::GetName() -{ - ASSERT( myHomardYACS ); - return CORBA::string_dup( myHomardYACS->GetName().c_str() ); -} -//============================================================================= -CORBA::Long HOMARD_YACS_i::Delete( CORBA::Long Option ) -{ - ASSERT( myHomardYACS ); - char* YACSName = GetName() ; - MESSAGE ( "Delete : destruction du schema " << YACSName << ", Option = " << Option ); - return _gen_i->DeleteYACS(YACSName, Option) ; -} -//============================================================================= -char* HOMARD_YACS_i::GetDumpPython() -{ - ASSERT( myHomardYACS ); - return CORBA::string_dup( myHomardYACS->GetDumpPython().c_str() ); -} -//============================================================================= -std::string HOMARD_YACS_i::Dump() const -{ - return ADAPT::Dump( *myHomardYACS ); -} -//============================================================================= -bool HOMARD_YACS_i::Restore( const std::string& stream ) -{ - return ADAPT::Restore( *myHomardYACS, stream ); -} -//============================================================================= -//============================================================================= -// Caracteristiques -//============================================================================= -//============================================================================= -void HOMARD_YACS_i::SetType( CORBA::Long Type ) -{ - ASSERT( myHomardYACS ); - myHomardYACS->SetType( Type ); -} -//============================================================================= -CORBA::Long HOMARD_YACS_i::GetType() -{ - ASSERT( myHomardYACS ); - return CORBA::Long( myHomardYACS->GetType() ); -} -//============================================================================= -//============================================================================= -// Caracteristiques de la convergence -//============================================================================= -//============================================================================= -void HOMARD_YACS_i::SetMaxIter( CORBA::Long MaxIter ) -{ - ASSERT( myHomardYACS ); - myHomardYACS->SetMaxIter( MaxIter ); -} -//============================================================================= -CORBA::Long HOMARD_YACS_i::GetMaxIter() -{ - ASSERT( myHomardYACS ); - return CORBA::Long( myHomardYACS->GetMaxIter() ); -} -//============================================================================= -void HOMARD_YACS_i::SetMaxNode( CORBA::Long MaxNode ) -{ - ASSERT( myHomardYACS ); - myHomardYACS->SetMaxNode( MaxNode ); -} -//============================================================================= -CORBA::Long HOMARD_YACS_i::GetMaxNode() -{ - ASSERT( myHomardYACS ); - return CORBA::Long( myHomardYACS->GetMaxNode() ); -} -//============================================================================= -void HOMARD_YACS_i::SetMaxElem( CORBA::Long MaxElem ) -{ - ASSERT( myHomardYACS ); - myHomardYACS->SetMaxElem( MaxElem ); -} -//============================================================================= -CORBA::Long HOMARD_YACS_i::GetMaxElem() -{ - ASSERT( myHomardYACS ); - return CORBA::Long( myHomardYACS->GetMaxElem() ); -} -//============================================================================= -void HOMARD_YACS_i::SetTestConvergence( CORBA::Long TypeTest, CORBA::Double VRef) -{ - ASSERT( myHomardYACS ); - myHomardYACS->SetTestConvergence( TypeTest, VRef ); -} -//============================================================================= -CORBA::Long HOMARD_YACS_i::GetTestConvergenceType() -{ - ASSERT( myHomardYACS ); - return CORBA::Long( myHomardYACS->GetTestConvergenceType() ); -} -//============================================================================= -CORBA::Double HOMARD_YACS_i::GetTestConvergenceVRef() -{ - ASSERT( myHomardYACS ); - return CORBA::Long( myHomardYACS->GetTestConvergenceVRef() ); -} -//============================================================================= -//============================================================================= -// Repertoire et fichiers -//============================================================================= -//============================================================================= -void HOMARD_YACS_i::SetDirName( const char* NomDir ) -{ - ASSERT( myHomardYACS ); - myHomardYACS->SetDirName( NomDir ); -} -//============================================================================= -char* HOMARD_YACS_i::GetDirName() -{ - ASSERT( myHomardYACS ); - return CORBA::string_dup( myHomardYACS->GetDirName().c_str() ); -} -//============================================================================= -void HOMARD_YACS_i::SetMeshFile( const char* MeshFile ) -{ - ASSERT( myHomardYACS ); - myHomardYACS->SetMeshFile( MeshFile ); -} -//============================================================================= -char* HOMARD_YACS_i::GetMeshFile() -{ - ASSERT( myHomardYACS ); - return CORBA::string_dup( myHomardYACS->GetMeshFile().c_str() ); -} -//============================================================================= -void HOMARD_YACS_i::SetScriptFile( const char* ScriptFile ) -{ - ASSERT( myHomardYACS ); - myHomardYACS->SetScriptFile( ScriptFile ); -} -//============================================================================= -char* HOMARD_YACS_i::GetScriptFile() -{ - ASSERT( myHomardYACS ); - return CORBA::string_dup( myHomardYACS->GetScriptFile().c_str() ); -} -//============================================================================= -void HOMARD_YACS_i::SetXMLFile( const char* XMLFile ) -{ - ASSERT( myHomardYACS ); - MESSAGE ( "SetXMLFile : SetXMLFile = " << XMLFile ); - myHomardYACS->SetXMLFile( XMLFile ); -} -//============================================================================= -char* HOMARD_YACS_i::GetXMLFile() -{ - ASSERT( myHomardYACS ); - return CORBA::string_dup( myHomardYACS->GetXMLFile().c_str() ); -} -//============================================================================= -//============================================================================= -// Liens avec les autres structures -//============================================================================= -//============================================================================= -void HOMARD_YACS_i::SetCaseName( const char* NomCas ) -{ - ASSERT( myHomardYACS ); - myHomardYACS->SetCaseName( NomCas ); -} -//============================================================================= -char* HOMARD_YACS_i::GetCaseName() -{ - ASSERT( myHomardYACS ); - return CORBA::string_dup( myHomardYACS->GetCaseName().c_str() ); -} -//============================================================================= -CORBA::Long HOMARD_YACS_i::Write() -{ -// - char* nomYACS = GetName() ; - return _gen_i->YACSWrite(nomYACS) ; -} -//============================================================================= -CORBA::Long HOMARD_YACS_i::WriteOnFile( const char* XMLFile ) -{ - MESSAGE ( "WriteOnFile : ecriture du schema sur " << XMLFile ); - ASSERT( myHomardYACS ); -// -// Memorisation du fichier associe - SetXMLFile( XMLFile ) ; -// -// Nom du schema - char* nomYACS = GetName() ; - return _gen_i->YACSWriteOnFile(nomYACS, XMLFile) ; -} -//============================================================================= -//============================================================================= -//============================================================================= -// Divers -//============================================================================= -//============================================================================= diff --git a/src/ADAPT_I/HOMARD_YACS_i.hxx b/src/ADAPT_I/HOMARD_YACS_i.hxx deleted file mode 100644 index 45c17851d..000000000 --- a/src/ADAPT_I/HOMARD_YACS_i.hxx +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier -// - -#ifndef _HOMARD_YACS_I_HXX_ -#define _HOMARD_YACS_I_HXX_ - -#include -#include CORBA_SERVER_HEADER(ADAPT_Gen) -#include CORBA_SERVER_HEADER(HOMARD_YACS) - -#include "HOMARD_i.hxx" -#include "SALOME_Component_i.hxx" -#include "SALOME_NamingService.hxx" -#include "Utils_CorbaException.hxx" - -#include - -class HOMARD_YACS; - -class HOMARDENGINE_EXPORT HOMARD_YACS_i: - public virtual Engines_Component_i, - public virtual POA_ADAPT::HOMARD_YACS, - public virtual PortableServer::ServantBase -{ -public: - HOMARD_YACS_i( CORBA::ORB_ptr orb, - ADAPT::ADAPT_Gen_var gen_i ); - HOMARD_YACS_i(); - - virtual ~HOMARD_YACS_i(); - -// Generalites - void SetName( const char* Name ); - char* GetName(); - - CORBA::Long Delete( CORBA::Long Option ); - - char* GetDumpPython(); - - std::string Dump() const; - bool Restore( const std::string& stream ); - -// Caracteristiques - void SetType( CORBA::Long Type ); - CORBA::Long GetType(); - - void SetMaxIter( CORBA::Long MaxIter ); - CORBA::Long GetMaxIter(); - void SetMaxNode( CORBA::Long MaxNode ); - CORBA::Long GetMaxNode(); - void SetMaxElem( CORBA::Long MaxElem ); - CORBA::Long GetMaxElem(); - - void SetTestConvergence( CORBA::Long TypeTest, CORBA::Double VRef ); - CORBA::Long GetTestConvergenceType(); - CORBA::Double GetTestConvergenceVRef(); - - void SetDirName( const char* NomDir ); - char* GetDirName(); - - void SetMeshFile( const char* MeshFile ); - char* GetMeshFile(); - - void SetScriptFile( const char* ScriptFile ); - char* GetScriptFile(); - - void SetXMLFile( const char* XMLFile ); - char* GetXMLFile(); - - CORBA::Long Write() ; - CORBA::Long WriteOnFile( const char* XMLFile ) ; - - // Liens avec les autres structures - void SetCaseName( const char* NomCas ); - char* GetCaseName(); - -// Divers - -private: - ::HOMARD_YACS* myHomardYACS; - - CORBA::ORB_ptr _orb; - ADAPT::ADAPT_Gen_var _gen_i; -}; - -#endif diff --git a/src/ADAPT_I/HOMARD_Zone_i.cxx b/src/ADAPT_I/HOMARD_Zone_i.cxx deleted file mode 100644 index b8ee19062..000000000 --- a/src/ADAPT_I/HOMARD_Zone_i.cxx +++ /dev/null @@ -1,218 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier -// - -#include "HOMARD_Zone_i.hxx" -#include "ADAPT_Gen_i.hxx" -#include "HOMARD_Zone.hxx" -#include "HOMARD_DriverTools.hxx" - -#include "utilities.h" - -//============================================================================= -/*! - * standard constructor - */ -//============================================================================= -HOMARD_Zone_i::HOMARD_Zone_i() -{ - MESSAGE( "Default constructor, not for use" ); - ASSERT( 0 ); -} - -//============================================================================= -/*! - * standard constructor - */ -//============================================================================= -HOMARD_Zone_i::HOMARD_Zone_i( CORBA::ORB_ptr orb, - ADAPT::ADAPT_Gen_var engine ) -{ - MESSAGE( "HOMARD_Zone_i" ); - _gen_i = engine; - _orb = orb; - myHomardZone = new ::HOMARD_Zone(); - ASSERT( myHomardZone ); -} -//============================================================================= -/*! - * standard destructor - */ -//============================================================================= - -HOMARD_Zone_i::~HOMARD_Zone_i() -{ -} -//============================================================================= -//============================================================================= -// Generalites -//============================================================================= -//============================================================================= -void HOMARD_Zone_i::SetName( const char* Name ) -{ - ASSERT( myHomardZone ); - myHomardZone->SetName( Name ); -} -//============================================================================= -char* HOMARD_Zone_i::GetName() -{ - ASSERT( myHomardZone ); - return CORBA::string_dup( myHomardZone->GetName().c_str() ); -} -//============================================================================= -CORBA::Long HOMARD_Zone_i::Delete() -{ - ASSERT( myHomardZone ); - char* ZoneName = GetName() ; - MESSAGE ( "Delete : destruction de la zone " << ZoneName ); - return _gen_i->DeleteZone(ZoneName) ; -} -//============================================================================= -char* HOMARD_Zone_i::GetDumpPython() -{ - ASSERT( myHomardZone ); - return CORBA::string_dup( myHomardZone->GetDumpPython().c_str() ); -} -//============================================================================= -std::string HOMARD_Zone_i::Dump() const -{ - return ADAPT::Dump( *myHomardZone ); -} -//============================================================================= -bool HOMARD_Zone_i::Restore( const std::string& stream ) -{ - return ADAPT::Restore( *myHomardZone, stream ); -} -//============================================================================= -//============================================================================= -// Caracteristiques -//============================================================================= -//============================================================================= -void HOMARD_Zone_i::SetType( CORBA::Long Type ) -{ - ASSERT( myHomardZone ); - myHomardZone->SetType( Type ); -} -//============================================================================= -CORBA::Long HOMARD_Zone_i::GetType() -{ - ASSERT( myHomardZone ); - return CORBA::Long( myHomardZone->GetType() ); -} -//============================================================================= -void HOMARD_Zone_i::SetBox( double X0, double X1, double X2, double X3, double X4, double X5 ) -{ - ASSERT( myHomardZone ); - myHomardZone->SetBox( X0, X1, X2, X3, X4, X5 ); -} -//============================================================================= -void HOMARD_Zone_i::SetCylinder( double Xcentre, double Ycentre, double Zcentre, - double Xaxis, double Yaxis, double Zaxis, - double Rayon, double Haut ) -{ - ASSERT( myHomardZone ); - myHomardZone->SetCylinder( Xcentre, Ycentre, Zcentre, Xaxis, Yaxis, Zaxis, Rayon, Haut ); -} -//============================================================================= -void HOMARD_Zone_i::SetPipe( double Xcentre, double Ycentre, double Zcentre, - double Xaxis, double Yaxis, double Zaxis, - double Rayon, double Haut, double Rayonint ) -{ - ASSERT( myHomardZone ); - myHomardZone->SetPipe( Xcentre, Ycentre, Zcentre, Xaxis, Yaxis, Zaxis, Rayon, Haut, Rayonint ); -} -//============================================================================= -void HOMARD_Zone_i::SetSphere( double Xcentre, double Ycentre, double Zcentre, double Rayon ) -{ - ASSERT( myHomardZone ); - myHomardZone->SetSphere( Xcentre, Ycentre, Zcentre, Rayon ); -} -//============================================================================= -ADAPT::double_array* HOMARD_Zone_i::GetCoords() -{ - ASSERT( myHomardZone ); - ADAPT::double_array_var aResult = new ADAPT::double_array(); - std::vector mesCoor = myHomardZone->GetCoords(); - aResult->length( mesCoor .size() ); - std::vector::const_iterator it; - int i = 0; - for ( it = mesCoor.begin(); it != mesCoor.end(); it++ ) - aResult[i++] = (*it); - return aResult._retn(); -} -//============================================================================= -void HOMARD_Zone_i::SetLimit( double Xincr, double Yincr, double Zincr ) -{ - MESSAGE ("SetLimit, Xincr : " << Xincr << ", Yincr : " << Yincr << ", Zincr : " << Zincr) ; - ASSERT( myHomardZone ); - myHomardZone->SetLimit( Xincr, Yincr, Zincr ); -} -//============================================================================= -ADAPT::double_array* HOMARD_Zone_i::GetLimit() -{ - ASSERT( myHomardZone ); - ADAPT::double_array_var aResult = new ADAPT::double_array(); - std::vector mesCoor = myHomardZone->GetLimit(); - aResult->length( mesCoor .size() ); - std::vector::const_iterator it; - int i = 0; - for ( it = mesCoor.begin(); it != mesCoor.end(); it++ ) - aResult[i++] = (*it); - return aResult._retn(); -} -//============================================================================= -//============================================================================= -// Liens avec les autres structures -//============================================================================= -//============================================================================= -void HOMARD_Zone_i::AddHypo( const char* NomHypo ) -{ - MESSAGE ( " AddHypo, NomHypo= " << NomHypo); - ASSERT( myHomardZone ); - myHomardZone->AddHypo( NomHypo ); -} -//============================================================================= -ADAPT::listeHypo* HOMARD_Zone_i::GetHypo() -{ - ASSERT( myHomardZone ); - const std::list& maListe = myHomardZone->GetHypo(); - ADAPT::listeHypo_var aResult = new ADAPT::listeHypo; - aResult->length( maListe.size() ); - std:: list::const_iterator it; - int i = 0; - for ( it = maListe.begin(); it != maListe.end(); it++ ) - aResult[i++] = CORBA::string_dup( (*it).c_str() ); - return aResult._retn(); -} -//============================================================================= -void HOMARD_Zone_i::SupprHypo( const char* NomHypo ) -{ - ASSERT( myHomardZone ); - myHomardZone->SupprHypo( NomHypo ); -} - diff --git a/src/ADAPT_I/HOMARD_Zone_i.hxx b/src/ADAPT_I/HOMARD_Zone_i.hxx deleted file mode 100644 index ee4e29e7c..000000000 --- a/src/ADAPT_I/HOMARD_Zone_i.hxx +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier -// - -#ifndef _HOMARD_Zone_I_HXX_ -#define _HOMARD_Zone_I_HXX_ - -#include -#include CORBA_SERVER_HEADER(ADAPT_Gen) -#include CORBA_SERVER_HEADER(HOMARD_Zone) - -#include "HOMARD_i.hxx" -#include "SALOME_Component_i.hxx" -#include "SALOME_NamingService.hxx" -#include "Utils_CorbaException.hxx" - -#include - -class HOMARD_Zone; - -class HOMARDENGINE_EXPORT HOMARD_Zone_i: - public virtual Engines_Component_i, - public virtual POA_ADAPT::HOMARD_Zone, - public virtual PortableServer::ServantBase -{ -public: - HOMARD_Zone_i( CORBA::ORB_ptr orb, ADAPT::ADAPT_Gen_var gen_i ); - HOMARD_Zone_i(); - - virtual ~HOMARD_Zone_i(); - -// Generalites - void SetName( const char* Name ); - char* GetName(); - - CORBA::Long Delete(); - - char* GetDumpPython(); - - std::string Dump() const; - bool Restore( const std::string& stream ); - -// Caracteristiques - void SetType( CORBA::Long Type ); - CORBA::Long GetType(); - - void SetBox( double Xmini, double Xmaxi, - double Ymini, double Ymaxi, - double Zmini, double Zmaxi ); - - void SetCylinder( double Xcentre, double Ycentre, double ZCentre, - double Xaxis, double Yaxis, double Zaxis, - double Rayon, double Haut ); - - void SetPipe( double Xcentre, double Ycentre, double ZCentre, - double Xaxis, double Yaxis, double Zaxis, - double Rayon, double Haut, double Rayonint ); - - void SetSphere( double Xcentre, double Ycentre, double ZCentre, - double Rayon ); - - ADAPT::double_array* GetCoords(); - - void SetLimit( double Xincr, double Yincr, double Zincr); - ADAPT::double_array* GetLimit(); - -// Liens avec les autres structures - void AddHypo( const char *NomHypo ); - ADAPT::listeHypo* GetHypo(); - void SupprHypo( const char *NomHypo ); - -private: - ::HOMARD_Zone* myHomardZone; - - CORBA::ORB_ptr _orb; - ADAPT::ADAPT_Gen_var _gen_i; -}; - -#endif diff --git a/src/ADAPT_I/HOMARD_i.hxx b/src/ADAPT_I/HOMARD_i.hxx deleted file mode 100644 index 359e33143..000000000 --- a/src/ADAPT_I/HOMARD_i.hxx +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef _HOMARD_I_HXX_ -#define _HOMARD_I_HXX_ - -#ifdef WIN32 - #if defined HOMARDENGINE_EXPORTS || defined ADAPTEngine_EXPORTS - #define HOMARDENGINE_EXPORT __declspec( dllexport ) - #else - #define HOMARDENGINE_EXPORT __declspec( dllimport ) - #endif -#else - #define HOMARDENGINE_EXPORT -#endif - -#endif //_HOMARD_I_HXX_ - - diff --git a/src/ADAPT_I/HomardMedCommun.cxx b/src/ADAPT_I/HomardMedCommun.cxx deleted file mode 100644 index 4fc06c891..000000000 --- a/src/ADAPT_I/HomardMedCommun.cxx +++ /dev/null @@ -1,335 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "HomardMedCommun.h" - -#include -#include -#include -#include -#include - -#include - -#include "utilities.h" -// ======================================================================= -int MEDFileExist( const char * aFile ) -// Retourne 1 si le fichier existe, 0 sinon -// ======================================================================= -{ - int existe ; - med_idt medIdt = MEDfileOpen(aFile,MED_ACC_RDONLY); - if ( medIdt < 0 ) { existe = 0 ; } - else { MEDfileClose(medIdt); - existe = 1 ; } - return existe ; -} -// ======================================================================= -std::set GetListeGroupesInMedFile(const char * aFile) -// ======================================================================= -{ - std::set ListeGroupes; - med_err erreur = 0 ; - med_idt medIdt ; - while ( erreur == 0 ) - { - // Ouverture du fichier - medIdt = MEDfileOpen(aFile,MED_ACC_RDONLY); - if ( medIdt < 0 ) - { - erreur = 1 ; - break ; - } - // Caracteristiques du maillage - char meshname[MED_NAME_SIZE+1]; - med_int spacedim,meshdim; - med_mesh_type meshtype; - char descriptionription[MED_COMMENT_SIZE+1]; - char dtunit[MED_SNAME_SIZE+1]; - med_sorting_type sortingtype; - med_int nstep; - med_axis_type axistype; - int naxis = MEDmeshnAxis(medIdt,1); - char *axisname=new char[naxis*MED_SNAME_SIZE+1]; - char *axisunit=new char[naxis*MED_SNAME_SIZE+1]; - erreur = MEDmeshInfo(medIdt, - 1, - meshname, - &spacedim, - &meshdim, - &meshtype, - descriptionription, - dtunit, - &sortingtype, - &nstep, - &axistype, - axisname, - axisunit); - delete[] axisname ; - delete[] axisunit ; - if ( erreur < 0 ) { break ; } - // Nombre de familles - med_int nfam ; - nfam = MEDnFamily(medIdt,meshname) ; - if ( nfam < 0 ) - { - erreur = 2 ; - break ; - } - // Lecture des caracteristiques des familles - for (int i=0;i 0 ) - { - char familyname[MED_NAME_SIZE+1]; - med_int numfam; - char* gro = (char*) malloc(MED_LNAME_SIZE*ngro+1); - erreur = MEDfamilyInfo(medIdt, - meshname, - i+1, - familyname, - &numfam, - gro); - if ( erreur < 0 ) - { - free(gro); - break ; - } - // Lecture des groupes pour une famille de mailles - if ( numfam < 0) - { - for (int j=0;j 0 ) MEDfileClose(medIdt); - - return ListeGroupes; -} - -// ======================================================================= -std::vector GetBoundingBoxInMedFile(const char * aFile) -// ======================================================================= -{ -// Le vecteur en retour contiendra les informations suivantes : -// en position 0 et 1 Xmin, Xmax et en position 2 Dx si < 0 2D -// en position 3 et 4 Ymin, Ymax et en position 5 Dy si < 0 2D -// en position 6 et 7 Zmin, Zmax et en position 8 Dz si < 0 2D -// 9 distance max dans le maillage - - std::vector LesExtremes; - med_err erreur = 0 ; - med_idt medIdt ; - while ( erreur == 0 ) - { - // Ouverture du fichier - medIdt = MEDfileOpen(aFile,MED_ACC_RDONLY); - if ( medIdt < 0 ) - { - erreur = 1 ; - break ; - } - //Nombre de maillage : on ne peut en lire qu'un seul - med_int numberOfMeshes = MEDnMesh(medIdt) ; - if (numberOfMeshes != 1 ) - { - erreur = 2 ; - break ; - } - // Caracteristiques du maillage - char meshname[MED_NAME_SIZE+1]; - med_int spacedim,meshdim; - med_mesh_type meshtype; - char descriptionription[MED_COMMENT_SIZE+1]; - char dtunit[MED_SNAME_SIZE+1]; - med_sorting_type sortingtype; - med_int nstep; - med_axis_type axistype; - int naxis = MEDmeshnAxis(medIdt,1); - char *axisname=new char[naxis*MED_SNAME_SIZE+1]; - char *axisunit=new char[naxis*MED_SNAME_SIZE+1]; - erreur = MEDmeshInfo(medIdt, - 1, - meshname, - &spacedim, - &meshdim, - &meshtype, - descriptionription, - dtunit, - &sortingtype, - &nstep, - &axistype, - axisname, - axisunit); - delete[] axisname ; - delete[] axisunit ; - if ( erreur < 0 ) { break ; } - - // Nombre de noeuds - med_bool chgt,trsf; - med_int nnoe = MEDmeshnEntity(medIdt, - meshname, - MED_NO_DT, - MED_NO_IT, - MED_NODE, - MED_NO_GEOTYPE, - MED_COORDINATE, - MED_NO_CMODE, - &chgt, - &trsf); - if ( nnoe < 0 ) - { - erreur = 4; - break ; - } - - // Les coordonnees - med_float* coo = (med_float*) malloc(sizeof(med_float)*nnoe*spacedim); - - erreur = MEDmeshNodeCoordinateRd(medIdt, - meshname, - MED_NO_DT, - MED_NO_IT, - MED_NO_INTERLACE, - coo); - if ( erreur < 0 ) - { - free(coo) ; - break ; - } - - // Calcul des extremes - med_float xmin,xmax,ymin,ymax,zmin,zmax; - - xmin=coo[0]; - xmax=coo[0]; - for (int i=1;i 1) - { - ymin=coo[nnoe]; ymax=coo[nnoe]; - for (int i=nnoe+1;i<2*nnoe;i++) - { - ymin = std::min(ymin,coo[i]); - ymax = std::max(ymax,coo[i]); - } - } - else - { - ymin=0; - ymax=0; - zmin=0; - zmax=0; - } -// - if (spacedim > 2) - { - zmin=coo[2*nnoe]; zmax=coo[2*nnoe]; - for (int i=2*nnoe+1;i<3*nnoe;i++) - { - zmin = std::min(zmin,coo[i]); - zmax = std::max(zmax,coo[i]); - } - } - else - { - zmin=0; - zmax=0; - } - - MESSAGE( "_______________________________________"); - MESSAGE( "xmin : " << xmin << " xmax : " << xmax ); - MESSAGE( "ymin : " << ymin << " ymax : " << ymax ); - MESSAGE( "zmin : " << zmin << " zmax : " << zmax ); - MESSAGE( "_______________________________________" ); - double epsilon = 1.e-6 ; - LesExtremes.push_back(xmin); - LesExtremes.push_back(xmax); - LesExtremes.push_back(0); - LesExtremes.push_back(ymin); - LesExtremes.push_back(ymax); - LesExtremes.push_back(0); - LesExtremes.push_back(zmin); - LesExtremes.push_back(zmax); - LesExtremes.push_back(0); - - - double max1=std::max ( LesExtremes[1] - LesExtremes[0] , LesExtremes[4] - LesExtremes[3] ) ; - double max2=std::max ( max1 , LesExtremes[7] - LesExtremes[6] ) ; - LesExtremes.push_back(max2); - -// LesExtremes[0] = Xmini du maillage -// LesExtremes[1] = Xmaxi du maillage -// LesExtremes[2] = increment de progression en X -// LesExtremes[3,4,5] : idem pour Y -// LesExtremes[6,7,8] : idem pour Z -// LesExtremes[9] = ecart maximal entre coordonnees -// On fait un traitement pour dans le cas d'une coordonnee constante -// inhiber ce cas en mettant un increment negatif -// - double diff = LesExtremes[1] - LesExtremes[0]; - if ( fabs(diff) > epsilon*max2 ) { LesExtremes[2] = diff/100.; } - else { LesExtremes[2] = -1. ; } - - diff = LesExtremes[4] - LesExtremes[3]; - if ( fabs(diff) > epsilon*max2 ) { LesExtremes[5]=diff/100.; } - else { LesExtremes[5] = -1. ; } - - diff = LesExtremes[7] - LesExtremes[6]; - if ( fabs(diff) > epsilon*max2 ) { LesExtremes[8]=diff/100.; } - else { LesExtremes[8] = -1. ; } - - MESSAGE ( "_______________________________________" ); - MESSAGE ( "xmin : " << LesExtremes[0] << " xmax : " << LesExtremes[1] << " xincr : " << LesExtremes[2] ); - MESSAGE ( "ymin : " << LesExtremes[3] << " ymax : " << LesExtremes[4] << " yincr : " << LesExtremes[5] ); - MESSAGE ( "zmin : " << LesExtremes[6] << " zmax : " << LesExtremes[7] << " zincr : " << LesExtremes[8] ); - MESSAGE ( "dmax : " << LesExtremes[9] ); - MESSAGE ( "_______________________________________" ); - - free(coo) ; - break ; - } - // Fermeture du fichier - if ( medIdt > 0 ) MEDfileClose(medIdt); - - return LesExtremes; -} - diff --git a/src/ADAPT_I/HomardMedCommun.h b/src/ADAPT_I/HomardMedCommun.h deleted file mode 100644 index 0ab2a3ff3..000000000 --- a/src/ADAPT_I/HomardMedCommun.h +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef HOMARDMEDCOMMUN_H -#define HOMARDMEDCOMMUN_H - -#include "HOMARD_i.hxx" -#include -#include -#include - -HOMARDENGINE_EXPORT int MEDFileExist( const char * aFile ); -HOMARDENGINE_EXPORT std::vector GetBoundingBoxInMedFile( const char * aFile); -HOMARDENGINE_EXPORT std::set GetListeGroupesInMedFile(const char * aFile); - -#endif // HOMARD%MEDCOMMUN_H diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1142d5784..59296f308 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -40,10 +40,6 @@ SET(SUBDIRS_COMMON StdMeshers_I SMESH_PY Tools - ADAPT - ADAPT_I - ADAPTFrontTrack - ADAPTFrontTrack_SWIG ) IF(SALOME_SMESH_ENABLE_MEFISTO) @@ -69,7 +65,6 @@ IF(SALOME_BUILD_GUI) PluginUtils SMESH_SWIG_WITHIHM StdMeshersGUI - ADAPTGUI ) ENDIF(SALOME_BUILD_GUI) diff --git a/src/SMESHGUI/CMakeLists.txt b/src/SMESHGUI/CMakeLists.txt index f4fa5526d..5b5bd4a8c 100644 --- a/src/SMESHGUI/CMakeLists.txt +++ b/src/SMESHGUI/CMakeLists.txt @@ -43,12 +43,8 @@ INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/src/SMESHClient ${PROJECT_SOURCE_DIR}/src/MEDWrapper ${PROJECT_SOURCE_DIR}/src/ADAPT - ${PROJECT_SOURCE_DIR}/src/ADAPT_I - ${PROJECT_SOURCE_DIR}/src/ADAPTGUI ${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}/idl - ${PROJECT_BINARY_DIR}/src/ADAPTGUI - ${PROJECT_BINARY_DIR}/src/ADAPT_I ${MEDCOUPLING_INCLUDE_DIRS} ) @@ -79,9 +75,6 @@ SET(_link_LIBRARIES SMDS SMESHControls SMESHObject - ADAPTGUI - ADAPTImpl - ADAPTEngine ${MEDCoupling_medloader} ) diff --git a/src/SMESHGUI/MG_ADAPTGUI.cxx b/src/SMESHGUI/MG_ADAPTGUI.cxx index 1e4b4a5df..102e388a6 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.cxx +++ b/src/SMESHGUI/MG_ADAPTGUI.cxx @@ -30,13 +30,7 @@ #include "SalomeApp_Application.h" #include "SalomeApp_Module.h" #include "SalomeApp_Study.h" -//~#include "SMESH_Actor.h" #include -//~#include -//~#include -//~#include -//~#include -//~#include #include #include #include @@ -600,14 +594,14 @@ SMESHGUI_MgAdaptArguments::SMESHGUI_MgAdaptArguments( QWidget* parent ) visibleTimeStepRankLabel (false); // Connections - connect( meshInGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( modeChanged( int ) ) ); - connect( sizeMapDefGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( sizeMapDefChanged( int ) ) ); - connect( selectMedFilebutton, SIGNAL( pressed( ) ), this, SLOT( onSelectMedFilebuttonClicked( ) ) ); - connect(medFileCheckBox, SIGNAL (stateChanged(int)), this, SLOT(onMedFileCheckBox(int) ) ); - connect(publishOut, SIGNAL (stateChanged(int)), this, SLOT(onPublishOut(int) ) ); - connect(selectOutMedFilebutton, SIGNAL( pressed()), this, SLOT(onSelectOutMedFilebutton())); - connect(selectMedFileBackgroundbutton, SIGNAL(pressed()), this, SLOT(onSelectMedFileBackgroundbutton()) ); - connect( timeStepGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( timeStepGroupChanged( int ) ) ); + connect( meshInGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( modeChanged( int ) ) ); + connect( sizeMapDefGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( sizeMapDefChanged( int ) ) ); + connect( selectMedFilebutton, SIGNAL( pressed( ) ), this, SLOT( onSelectMedFilebuttonClicked( ) ) ); + connect( medFileCheckBox, SIGNAL (stateChanged(int)), this, SLOT(onMedFileCheckBox(int) ) ); + connect( publishOut, SIGNAL (stateChanged(int)), this, SLOT(onPublishOut(int) ) ); + connect( selectOutMedFilebutton, SIGNAL( pressed()), this, SLOT(onSelectOutMedFilebutton())); + connect( selectMedFileBackgroundbutton, SIGNAL(pressed()), this, SLOT(onSelectMedFileBackgroundbutton()) ); + connect( timeStepGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( timeStepGroupChanged( int ) ) ); emit updateSelection(); } @@ -639,14 +633,14 @@ void SMESHGUI_MgAdaptArguments::onLastTimeStep(bool disableOther) timeStep->setValue(-1); noTimeStep->setDisabled(disableOther); } -void SMESHGUI_MgAdaptArguments::onChosenTimeStep(bool disableOther, int max) +void SMESHGUI_MgAdaptArguments::onChosenTimeStep(bool disableOther, int vmax) { chosenTimeStep->setChecked(true); visibleTimeStepRankLabel (true); rankSpinBox->setValue(0); timeStep->setValue(0); - if (max) timeStep->setMaximum(max); + if (vmax) timeStep->setMaximum(vmax); } void SMESHGUI_MgAdaptArguments::visibleTimeStepRankLabel(bool visible) @@ -692,7 +686,7 @@ void SMESHGUI_MgAdaptArguments::onSelectMedFileBackgroundbutton() { fieldNameCmb->insertItem(0,QString(it->first)); int typeStepInField = it->second > 2 ? 2 : it->second ; - timeStepGroupChanged(typeStepInField, true); + timeStepGroupChanged(typeStepInField, false); } } @@ -792,8 +786,10 @@ void SMESHGUI_MgAdaptArguments::onLocalSelected(QString filePath) for ( it = myFieldList.begin() ; it != myFieldList.end(); it++) { fieldNameCmb->insertItem(0,QString(it->first)); + // Je ne comprends pas le rapport entre pas de temps et apparition d'un nouveau champ... GN int typeStepInField = it->second > 2 ? 2 : it->second ; - timeStepGroupChanged(typeStepInField, true); +// std::cout << "SMESHGUI_MgAdaptArguments::onLocalSelected typeStepInField : " << typeStepInField << std::endl; + timeStepGroupChanged(typeStepInField, false); } } @@ -901,7 +897,7 @@ void SMESHGUI_MgAdaptArguments::sizeMapDefChanged( int theSizeMap ) } -void SMESHGUI_MgAdaptArguments::timeStepGroupChanged(int timeStepType, bool disableOther, int max) +void SMESHGUI_MgAdaptArguments::timeStepGroupChanged(int timeStepType, bool disableOther, int vmax) { switch (timeStepType) { @@ -912,7 +908,7 @@ void SMESHGUI_MgAdaptArguments::timeStepGroupChanged(int timeStepType, bool disa onLastTimeStep(disableOther); break; case 2 : - onChosenTimeStep(disableOther, max); + onChosenTimeStep(disableOther, vmax); default: break; } diff --git a/src/SMESHGUI/MG_ADAPTGUI.hxx b/src/SMESHGUI/MG_ADAPTGUI.hxx index 2319d735c..cd2bf2bbf 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.hxx +++ b/src/SMESHGUI/MG_ADAPTGUI.hxx @@ -227,7 +227,7 @@ protected slots: private slots: void modeChanged( int); void sizeMapDefChanged(int); - void timeStepGroupChanged(int timeStepType, bool disableOther = false, int max = 0); + void timeStepGroupChanged(int timeStepType, bool disableOther = false, int vmax = 0); void onSelectMedFilebuttonClicked(); void clear(); void onMedFileCheckBox(int); @@ -237,7 +237,7 @@ private slots: void onLocalSelected(QString); void onNoTimeStep(bool disableOther = false); void onLastTimeStep(bool disableOther = false); - void onChosenTimeStep(bool disableOther = false, int max = 0); + void onChosenTimeStep(bool disableOther = false, int vmax = 0); void visibleTimeStepRankLabel(bool visible); private: diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 3b460089d..c66890cf3 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -3036,14 +3036,6 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) break; } // Adaptation - begin - case SMESHOp::OpUniformRefinement: - case SMESHOp::OpHONewCase: - case SMESHOp::OpHOCaseFollow: - case SMESHOp::OpHONewIter: - case SMESHOp::OpHOIterCompute: - case SMESHOp::OpHOIterComputePublish: - case SMESHOp::OpHOEdit: - case SMESHOp::OpHODelete: case SMESHOp::OpMGAdapt: { SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_nil(); @@ -4288,14 +4280,6 @@ void SMESHGUI::initialize( CAM_Application* app ) createSMESHAction( SMESHOp::OpDisableAutoColor, "DISABLE_AUTO_COLOR" ); // Adaptation - begin - createSMESHAction( SMESHOp::OpUniformRefinement, "REF_ALL", "ICON_REF_ALL" ); - createSMESHAction( SMESHOp::OpHONewCase, "HOMARD_CREATE_CASE", "ICON_HOMARD_CREATE_CASE" ); - createSMESHAction( SMESHOp::OpHOCaseFollow, "HOMARD_FOLLOW_ITERATION", "ICON_HOMARD_FOLLOW_ITERATION" ); - createSMESHAction( SMESHOp::OpHONewIter, "HOMARD_NEW_ITERATION", "ICON_HOMARD_NEW_ITERATION" ); - createSMESHAction( SMESHOp::OpHOIterCompute, "HOMARD_COMPUTE", "ICON_HOMARD_COMPUTE" ); - createSMESHAction( SMESHOp::OpHOIterComputePublish, "HOMARD_COMPUTE_PUBLISH", "ICON_HOMARD_COMPUTE_PUBLISH" ); - createSMESHAction( SMESHOp::OpHOEdit, "EDIT", "ICON_DLG_EDIT_MESH" ); - createSMESHAction( SMESHOp::OpHODelete, "DELETE", "ICON_DELETE" ); createSMESHAction( SMESHOp::OpMGAdapt, "MG_ADAPT", "ICON_MG_ADAPT" ); // Adaptation - end @@ -4358,7 +4342,6 @@ void SMESHGUI::initialize( CAM_Application* app ) removeId = createMenu( tr( "MEN_REMOVE" ), modifyId, 403 ), //renumId = createMenu( tr( "MEN_RENUM" ), modifyId, 404 ), transfId = createMenu( tr( "MEN_TRANSF" ), modifyId, 405 ), - refHomardId = createMenu( tr( "MEN_REF_HOMARD" ), adaptId, -1, 10 ), basicPropId = createMenu( tr( "MEN_BASIC_PROPERTIES" ), measureId, -1, 10 ); //createMenu( SMESHOp::OpImportDAT, importId, -1 ); @@ -4515,16 +4498,6 @@ void SMESHGUI::initialize( CAM_Application* app ) createMenu( SMESHOp::OpPatternMapping, modifyId, -1 ); // Adaptation - begin - createMenu( SMESHOp::OpUniformRefinement, adaptId, -1 ); - createMenu( SMESHOp::OpHONewCase, refHomardId, -1 ); - createMenu( SMESHOp::OpHOCaseFollow, refHomardId, -1 ); - createMenu( separator(), refHomardId, -1 ); - createMenu( SMESHOp::OpHONewIter, refHomardId, -1 ); - createMenu( SMESHOp::OpHOIterCompute, refHomardId, -1 ); - createMenu( SMESHOp::OpHOIterComputePublish, refHomardId, -1 ); - createMenu( separator(), refHomardId, -1 ); - createMenu( SMESHOp::OpHOEdit, refHomardId, -1 ); - createMenu( SMESHOp::OpHODelete, refHomardId, -1 ); createMenu( SMESHOp::OpMGAdapt, adaptId, -1 ); // Adaptation - end @@ -4673,12 +4646,6 @@ void SMESHGUI::initialize( CAM_Application* app ) // Adaptation - begin int adaptTb = createTool( tr( "TB_ADAPTATION" ),QString( "SMESHAdaptationToolbar" ) ) ; - createTool( SMESHOp::OpUniformRefinement, adaptTb ); - createTool( SMESHOp::OpHONewCase, adaptTb ); - createTool( SMESHOp::OpHOCaseFollow, adaptTb ); - createTool( SMESHOp::OpHONewIter, adaptTb ); - createTool( SMESHOp::OpHOIterCompute, adaptTb ); - createTool( SMESHOp::OpHOIterComputePublish, adaptTb ); createTool( SMESHOp::OpMGAdapt, adaptTb ); // Adaptation - end @@ -4764,12 +4731,6 @@ void SMESHGUI::initialize( CAM_Application* app ) popupMgr()->insert( separator(), -1, 0 ); // Adaptation - begin - createPopupItem( SMESHOp::OpUniformRefinement, OB, mesh ); - createPopupItem( SMESHOp::OpHONewCase, OB, mesh ); -// createPopupItem( SMESHOp::OpHOCaseFollow, OB, mesh ); -// createPopupItem( SMESHOp::OpHONewIter, OB, mesh ); -// createPopupItem( SMESHOp::OpHOIterCompute, OB, mesh ); -// createPopupItem( SMESHOp::OpHOIterComputePublish, OB, mesh ); createPopupItem( SMESHOp::OpMGAdapt, OB, mesh ); // Adaptation - end @@ -5208,9 +5169,9 @@ bool SMESHGUI::activateModule( SUIT_Study* study ) << wrap("GMF", "li"); lab = tr("INFO_AVAILABLE_FORMATS") + ":" + wrap(items.join(""), "ul"); items.clear(); - + app->infoPanel()->addLabel(lab, gb); - + gb = app->infoPanel()->addGroup(tr("INFO_GRP_CHECK_MESH")); lab = tr("INFO_DISPLAY") + "
"; items << wrap(tr("INFO_QUALITY_AREA"), "li") @@ -5220,7 +5181,7 @@ bool SMESHGUI::activateModule( SUIT_Study* study ) lab = lab + tr("INFO_QUALITY_INFO") + ":" + wrap(items.join(""), "ul"); items.clear(); lab = lab + tr("INFO_CLIPPING"); - + app->infoPanel()->addLabel(lab, gb); // << Help Panel @@ -5809,34 +5770,6 @@ void SMESHGUI::createPreferences() // Adaptation tab ------------------------------------------------------------------------ int adaptTab = addPreference( tr( "ADAPT_PREF_TAB_GENERAL" ) ); int bloc, pref ; - // Refinement with HOMARD - bloc = addPreference( tr( "ADAPT_PREF_HOMARD_PUBLICATION" ), adaptTab ); - setPreferenceProperty( bloc, "columns", 1 ); - pref = addPreference( tr( "ADAPT_PREF_HOMARD_PUBLICATION_MAILLAGE_IN" ), bloc, LightApp_Preferences::Bool, "HOMARD", "homard_publish_mesh_in" ); - pref = addPreference( tr( "ADAPT_PREF_HOMARD_PUBLICATION_MAILLAGE_OUT" ), bloc, LightApp_Preferences::Bool, "HOMARD", "homard_publish_mesh_out" ); - - // YACS with HOMARD - bloc = addPreference( tr( "ADAPT_PREF_HOMARD_YACS" ), adaptTab ); - setPreferenceProperty( bloc, "columns", 1 ); - pref = addPreference( tr( "ADAPT_PREF_HOMARD_YACS_MAX_ITER" ), bloc, LightApp_Preferences::IntSpin, "HOMARD", "homard_yacs_max_iter" ); - setPreferenceProperty( pref, "min", 0 ); - setPreferenceProperty( pref, "max", 100000000 ); - setPreferenceProperty( pref, "step", 1 ); - pref = addPreference( tr( "ADAPT_PREF_HOMARD_YACS_MAX_NODE" ), bloc, LightApp_Preferences::IntSpin, "HOMARD", "homard_yacs_max_node" ); - setPreferenceProperty( pref, "min", 0 ); - setPreferenceProperty( pref, "max", 100000000 ); - setPreferenceProperty( pref, "step", 1000 ); - pref = addPreference( tr( "ADAPT_PREF_HOMARD_YACS_MAX_ELEM" ), bloc, LightApp_Preferences::IntSpin, "HOMARD", "homard_yacs_max_elem" ); - setPreferenceProperty( pref, "min", 0 ); - setPreferenceProperty( pref, "max", 100000000 ); - setPreferenceProperty( pref, "step", 1000 ); - pref = addPreference( tr( "ADAPT_PREF_HOMARD_YACS_TYPE_CONVERGENCE" ), bloc, LightApp_Preferences::Selector, "HOMARD", "homard_yacs_type_test" ); - QStringList aListOfTypeTest; - aListOfTypeTest << tr( "ADAPT_PREF_NONE" ); - aListOfTypeTest << "VTest > VRef"; - aListOfTypeTest << "VTest < VRef"; - setPreferenceProperty( pref, "strings", aListOfTypeTest ); - // MG-Adapt bloc = addPreference( tr( "ADAPT_PREF_MG_ADAPT" ), adaptTab ); setPreferenceProperty( bloc, "columns", 1 ); @@ -6070,14 +6003,6 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const op = new SMESHGUI_Add0DElemsOnAllNodesOp(); break; // Adaptation - begin - case SMESHOp::OpUniformRefinement: - case SMESHOp::OpHONewCase: - case SMESHOp::OpHOCaseFollow: - case SMESHOp::OpHONewIter: - case SMESHOp::OpHOIterCompute: - case SMESHOp::OpHOIterComputePublish: - case SMESHOp::OpHOEdit: - case SMESHOp::OpHODelete: case SMESHOp::OpMGAdapt: break; // Adaptation - end diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx index afd74b0dd..8121932be 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx @@ -35,9 +35,6 @@ #include #include -// HOMARD includes -// #include "MonCreateCase.h" - // SALOME KERNEL includes #include "utilities.h" #include @@ -70,7 +67,7 @@ SMESHGUI_AdaptDlg::~SMESHGUI_AdaptDlg() void SMESHGUI_AdaptDlg::action (int theCommandID) //======================================================================= { - std::cout << "SMESHGUI_AdaptDlg::action avec theCommandID : " << theCommandID << std::endl; +// std::cout << "SMESHGUI_AdaptDlg::action avec theCommandID : " << theCommandID << std::endl; // Preferences // recupPreferences(); @@ -107,46 +104,6 @@ void SMESHGUI_AdaptDlg::action (int theCommandID) // // SUIT_ResourceMgr* resMgr = mySMESHGUI->getApp()->resourceMgr(); // -// // B. Les valeurs -// // B.1. La langue -// -// _LanguageShort = resMgr->stringValue("language", "language", "en" ); -// INFOS ("Enregistrement de LanguageShort = " << _LanguageShort.toStdString().c_str() ); -// // adaptGen->SetLanguageShort(_LanguageShort.toStdString().c_str()); -// -// // B.2. Les publications avec HOMARD -// bool publish_mesh ; -// -// publish_mesh = resMgr->booleanValue("HOMARD", "homard_publish_mesh_in", false ); -// if ( publish_mesh ) { _PublisMeshIN = 1 ; } -// else { _PublisMeshIN = 0 ; } -// -// publish_mesh = resMgr->booleanValue("HOMARD", "homard_publish_mesh_out", false ); -// if ( publish_mesh ) { _PublisMeshOUT = 1 ; } -// else { _PublisMeshOUT = 0 ; } -// -// INFOS ("Enregistrement de PublisMeshIN = " << _PublisMeshIN<<", PublisMeshOUT = "<< _PublisMeshOUT); -// // adaptGen->SetPublisMesh(_PublisMeshIN, _PublisMeshOUT); -// -// // B.3. Les maximum pour YACS avec HOMARD -// -// _YACSMaxIter = resMgr->integerValue("HOMARD", "homard_yacs_max_iter", 0 ); -// _YACSMaxNode = resMgr->integerValue("HOMARD", "homard_yacs_max_node", 0 ); -// _YACSMaxElem = resMgr->integerValue("HOMARD", "homard_yacs_max_elem", 0 ); -// -// INFOS ("Enregistrement de YACSMaxIter = " << _YACSMaxIter<<", YACSMaxNode = "<< _YACSMaxNode<<", YACSMaxElem = "<< _YACSMaxElem); -// // adaptGen->SetYACSMaximum(_YACSMaxIter, _YACSMaxNode, _YACSMaxElem); -// -// // B.4. La convergence pour YACS avec HOMARD -// -// QString QString_v = resMgr->stringValue ( "HOMARD", "homard_yacs_type_test", "None" ); -// if ( ( QString_v == "VTest > VRef" ) || ( QString_v == "VTest > VRef" ) ) { _YACSTypeTest = 1 ; } -// else if ( ( QString_v == "VTest < VRef" ) || ( QString_v == "VTest < VRef" ) ) { _YACSTypeTest = 2 ; } -// else { _YACSTypeTest = 0 ; } -// -// INFOS ("Enregistrement de YACSTypeTest = " << _YACSTypeTest); -// // adaptGen->SetYACSConvergenceType(_YACSTypeTest); -// // } /*! @@ -156,7 +113,7 @@ void SMESHGUI_AdaptDlg::action (int theCommandID) */ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) { - std::cout << "OnGUIEvent avec theCommandID : " << theCommandID << std::endl; +// std::cout << "SMESHGUI_AdaptDlg:OnGUIEvent avec theCommandID : " << theCommandID << std::endl; // A. Controles SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); if ( !app ) return false; @@ -183,57 +140,16 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) SCRUTE(theCommandID); switch (theCommandID) { - case 8000: // Raffinement uniforme - { - INFOS("Raffinement uniforme"); -// A faire - break; - } - case 8011: // Création d'un Cas - { - INFOS("Création d'un Cas"); -// MonCreateCase *aDlg = new MonCreateCase( true, -// ADAPT::ADAPT_Gen::_duplicate(adaptGen) ) ; -// aDlg->show(); - break; - } - case 8012: // Création d'un cas en poursuite d'une itération - { - INFOS("Création d'un cas en poursuite d'une itération"); -// A faire - break; - } - case 8013: // Création d'une itération - { - INFOS("Création d'une itération" ); -// A faire - break; - } - case 8014: // Calcule une itération - { - INFOS("Calcule une itération" ); -// A faire - break; - } - case 8015: // Calcule une itération et publication - { - INFOS("Calcule une itération et publication"); -// A faire - break; - } case 8020: // Adaptation avec MG-Adpat { - INFOS("Interface avec MG-Adapt" ); -// A faire +// INFOS("Interface avec MG-Adapt" ); - SMESH::MG_ADAPT_ptr model = SMESHGUI::GetSMESHGen()->CreateMG_ADAPT();// = new SMESH::MG_ADAPT_var(); - //~SMESH::MG_ADAPT_ptr model = SMESH::MG_ADAPT_i::CreateMG_ADAPT(); + SMESH::MG_ADAPT_ptr model = SMESHGUI::GetSMESHGen()->CreateMG_ADAPT(); bool isCreation = false; if (mySMESHGUI->isStudyLocked()) break; mySMESHGUI->EmitSignalDeactivateDialog(); SMESHGUI_MG_ADAPTDRIVER *mgAdapt = new SMESHGUI_MG_ADAPTDRIVER(mySMESHGUI, model, isCreation); mgAdapt->show(); - //~delete model; break; } diff --git a/src/SMESHGUI/SMESHGUI_Operations.h b/src/SMESHGUI/SMESHGUI_Operations.h index 6edc79469..d63c592c0 100644 --- a/src/SMESHGUI/SMESHGUI_Operations.h +++ b/src/SMESHGUI/SMESHGUI_Operations.h @@ -187,14 +187,6 @@ namespace SMESHOp { OpCreateBoundaryElements = 4514, // MENU MODIFICATION - CREATE BOUNDARY ELEMENTS OpSplitBiQuadratic = 4515, // MENU MODIFICATION - SPLIT BI-QUADRATIC TO LINEAR // Adaptation ---------------------//-------------------------------- - OpUniformRefinement = 8000, // MENU ADAPTATION - HOMARD - UNIFORM REFINEMENT - OpHONewCase = 8011, // MENU ADAPTATION - HOMARD - FREE REFINEMENT - New Case - OpHOCaseFollow = 8012, // MENU ADAPTATION - HOMARD - FREE REFINEMENT - New Case Follow - OpHONewIter = 8013, // MENU ADAPTATION - HOMARD - FREE REFINEMENT - New Iteration - OpHOIterCompute = 8014, // MENU ADAPTATION - HOMARD - FREE REFINEMENT - Compute Iteration - OpHOIterComputePublish = 8015, // MENU ADAPTATION - HOMARD - FREE REFINEMENT - Compute Iteration and Publish - OpHOEdit = 8016, // MENU ADAPTATION - HOMARD - FREE REFINEMENT - Edit objects - OpHODelete = 8017, // MENU ADAPTATION - HOMARD - FREE REFINEMENT - Delete objects OpMGAdapt = 8020, // MENU ADAPTATION - MG-ADAPT // Measurements -------------------//-------------------------------- OpPropertiesLength = 5000, // MENU MEASUREMENTS - BASIC PROPERTIES - LENGTH diff --git a/src/SMESHGUI/SMESH_images.ts b/src/SMESHGUI/SMESH_images.ts index 635b11e5a..317a769cb 100644 --- a/src/SMESHGUI/SMESH_images.ts +++ b/src/SMESHGUI/SMESH_images.ts @@ -83,30 +83,6 @@ ICON_CREATE_GEO_GROUP mesh_groups_from_gemetry.png
- - ICON_REF_ALL - adapt_ref_all.png - - - ICON_HOMARD_CREATE_CASE - adapt_ref_homard.png - - - ICON_HOMARD_FOLLOW_ITERATION - adapt_hom_iter_poursuite.png - - - ICON_HOMARD_NEW_ITERATION - adapt_hom_iter_next - - - ICON_HOMARD_COMPUTE - mesh_compute.png - - - ICON_HOMARD_COMPUTE_PUBLISH - mesh_compute.png - ICON_MG_ADAPT adapt_mg_adapt.png @@ -682,7 +658,7 @@ ICON_MEASURE_AREA mesh_measure_area.png - + ICON_MEASURE_VOLUME mesh_measure_volume.png diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index 90a784488..23c92f86b 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -340,34 +340,6 @@ MEN_CONSTRUCT_GROUP Construct Group - - MEN_REF_ALL - Uniform refinement - - - MEN_REF_HOMARD - Adaptation with HOMARD - - - MEN_HOMARD_CREATE_CASE - New case for adaptation with HOMARD - - - MEN_HOMARD_FOLLOW_ITERATION - Existing case - - - MEN_HOMARD_NEW_ITERATION - New iteration - - - MEN_HOMARD_COMPUTE - Compute - - - MEN_HOMARD_COMPUTE_PUBLISH - Compute and publish - MEN_MG_ADAPT Remesh with MG_Adapt @@ -3057,38 +3029,6 @@ Check algorithm documentation for supported geometry ADAPT_PREF_NONE None - - ADAPT_PREF_HOMARD_PUBLICATION - Publication of meshes with HOMARD - - - ADAPT_PREF_HOMARD_PUBLICATION_MAILLAGE_IN - IN mesh - - - ADAPT_PREF_HOMARD_PUBLICATION_MAILLAGE_OUT - OUT mesh - - - ADAPT_PREF_HOMARD_YACS - A YACS schema with HOMARD - - - ADAPT_PREF_HOMARD_YACS_MAX_ITER - Maximal number of iterations - - - ADAPT_PREF_HOMARD_YACS_MAX_NODE - Maximal number of nodes - - - ADAPT_PREF_HOMARD_YACS_MAX_ELEM - Maximal number of elements - - - ADAPT_PREF_HOMARD_YACS_TYPE_CONVERGENCE - Test type for a YACS schema with HOMARD - ADAPT_PREF_MG_ADAPT Adaptation with MG-Adapt @@ -3372,38 +3312,6 @@ Use Display Entity menu command to show them. STB_CONSTRUCT_GROUP Construct Group - - STB_REF_ALL - Uniform refinement - - - STB_REF_HOMARD - Refinement with HOMARD - - - STB_HOMARD_CREATE_CASE - Creation of a new case for adaptation with HOMARD - - - STB_HOMARD_FOLLOW_ITERATION - Creation of a new case: pursuit of a stored iteration - - - STB_HOMARD_NEW_ITERATION - Creation of a next iteration - - - STB_HOMARD_COMPUTE - Compute the refinement - - - STB_HOMARD_COMPUTE_PUBLISH - Compute the refinement and publish the final mesh - - - STB_EDIT - Edit - STB_MG_ADAPT Remesh with MG_Adapt @@ -4112,30 +4020,6 @@ Use Display Entity menu command to show them. TOP_CONSTRUCT_GROUP Construct Group - - TOP_REF_ALL - Uniform refinement - - - TOP_HOMARD_CREATE_CASE - New case - - - TOP_HOMARD_FOLLOW_ITERATION - Existing case - - - TOP_HOMARD_NEW_ITERATION - New iteration - - - TOP_HOMARD_COMPUTE - Compute - - - TOP_HOMARD_COMPUTE_PUBLISH - Compute and publish - TOP_MG_ADAPT Remesh with MG_Adapt @@ -7040,7 +6924,7 @@ select mesh or sub-mesh and try again CONCURRENT_SUBMESH_APPEARS -The assigned algorithm has the same priority as one assigned to an +The assigned algorithm has the same priority as one assigned to an adjacent sub-mesh, hence it's undefined which algorithm to use for meshing boundary shared by two sub-meshes. Would you like to set the order of sub-mesh computation? diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index a23d20e5a..95306a7ec 100644 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -340,34 +340,6 @@ MEN_CONSTRUCT_GROUP Construire un groupe - - MEN_REF_ALL - Raffinement uniforme - - - MEN_REF_HOMARD - Raffinement avec HOMARD - - - MEN_HOMARD_CREATE_CASE - Création d'un cas d'adaptation - - - MEN_HOMARD_FOLLOW_ITERATION - Poursuite d'une itération d'adaptation - - - MEN_HOMARD_NEW_ITERATION - Création d'une itération d'adaptation - - - MEN_HOMARD_COMPUTE - Calculer - - - MEN_HOMARD_COMPUTE_PUBLISH - Calculer et publier - MEN_MG_ADAPT Remaillage avec MG_Adapt @@ -3051,38 +3023,6 @@ Référez-vous à la documentation sur l'algorithme et la géométrie supportée ADAPT_PREF_NONE Sans - - ADAPT_PREF_HOMARD_PUBLICATION - Publication des maillages avec HOMARD - - - ADAPT_PREF_HOMARD_PUBLICATION_MAILLAGE_IN - Le maillage d'entrée - - - ADAPT_PREF_HOMARD_PUBLICATION_MAILLAGE_OUT - Le maillage de sortie - - - ADAPT_PREF_HOMARD_YACS - Schéma YACS avec HOMARD - - - ADAPT_PREF_HOMARD_YACS_MAX_ITER - Nombre maximal d'itérations - - - ADAPT_PREF_HOMARD_YACS_MAX_NODE - Nombre maximal de noeuds - - - ADAPT_PREF_HOMARD_YACS_MAX_ELEM - Nombre maximal d'éléments - - - ADAPT_PREF_HOMARD_YACS_TYPE_CONVERGENCE - Type de test pour la convergence - ADAPT_PREF_MG_ADAPT Adaptation avec MG-Adapt @@ -3367,38 +3307,6 @@ Utilisez le menu "Visualiser une entité" pour les afficher. STB_CONSTRUCT_GROUP Construire un groupe - - STB_REF_ALL - Raffinement uniforme - - - STB_REF_HOMARD - Adaptation avec HOMARD - - - STB_HOMARD_CREATE_CASE - Création d'un nouveau cas d'adaptation avec HOMARD - - - STB_HOMARD_FOLLOW_ITERATION - Création d'un nouveau cas : poursuite d'une itération stockée - - - STB_HOMARD_NEW_ITERATION - Création d'une nouvelle itération - - - STB_HOMARD_COMPUTE - Calcule le raffinement - - - STB_HOMARD_COMPUTE_PUBLISH - Calcule le raffinement et publie le maillage résultat - - - STB_EDIT - Edit - STB_MG_ADAPT Remaillage avec MG_Adapt @@ -4107,30 +4015,6 @@ Utilisez le menu "Visualiser une entité" pour les afficher. TOP_CONSTRUCT_GROUP Construire un groupe - - TOP_REF_ALL - Raffinement uniforme - - - TOP_HOMARD_CREATE_CASE - Création d'un cas d'adaptation avec HOMARD - - - TOP_HOMARD_FOLLOW_ITERATION - Poursuite d'une itération d'adaptation avec HOMARD - - - TOP_HOMARD_NEW_ITERATION - Création d'une itération - - - TOP_HOMARD_COMPUTE - Calculer - - - TOP_HOMARD_COMPUTE_PUBLISH - Calculer et publier - TOP_MG_ADAPT Remaillage avec MG_Adapt diff --git a/src/SMESH_I/MG_ADAPT_i.cxx b/src/SMESH_I/MG_ADAPT_i.cxx index 51160b1df..befc5beb8 100644 --- a/src/SMESH_I/MG_ADAPT_i.cxx +++ b/src/SMESH_I/MG_ADAPT_i.cxx @@ -17,16 +17,6 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// Remarques : -// L'ordre de description des fonctions est le meme dans tous les fichiers -// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx : -// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore -// 2. Les caracteristiques -// 3. Le lien avec les autres structures -// -// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier -// - #include "MG_ADAPT_i.hxx" //~#include "ADAPT_Gen_i.hxx" #include "string.h" @@ -126,13 +116,13 @@ SMESH::MG_ADAPT_OBJECT_ptr SMESH_Gen_i::Adaptation( const char* adaptationType) SMESH::MG_ADAPT_OBJECT_var anObj = mg_adapt_object->_this(); return anObj._retn(); } - + } //~SMESH::MG_ADAPT_ptr MG_ADAPT_i::CreateMG_ADAPT() //~{ - - //~SMESH_Gen_i* smeshGen_i = SMESH_Gen_i::GetSMESHGen(); + + //~SMESH_Gen_i* smeshGen_i = SMESH_Gen_i::GetSMESHGen(); //~SMESH::MG_ADAPT_i* aMGadapt = new SMESH::MG_ADAPT_i(smeshGen_i->GetPOA()); //~SMESH::MG_ADAPT_var anObj = aMGadapt->_this(); //~return anObj._retn(); @@ -179,7 +169,7 @@ void MG_ADAPT_i::setData( SMESH::MgAdaptHypothesisData& data) copyHypothesisDataToImpl(data, baseData); myMgAdapt->setData(baseData); delete baseData; -} +} void MG_ADAPT_i::setMedFileIn(const char* str) { myMgAdapt->setMedFileIn(str); @@ -240,7 +230,7 @@ void MG_ADAPT_i::setTimeStep(CORBA::Long t) { myMgAdapt->setTimeStep(t); } -CORBA::Long MG_ADAPT_i::getTimeStep() +CORBA::Long MG_ADAPT_i::getTimeStep() { return myMgAdapt->getTimeStep(); } @@ -286,11 +276,11 @@ bool MG_ADAPT_i::getRemoveOnSuccess() { myMgAdapt->getRemoveOnSuccess(); } -SMESH::MgAdaptHypothesisData* MG_ADAPT_i::getData() +SMESH::MgAdaptHypothesisData* MG_ADAPT_i::getData() { SMESH::MgAdaptHypothesisData* result = new SMESH::MgAdaptHypothesisData(); ::MG_ADAPT::MgAdaptHypothesisData* from = myMgAdapt->getData(); - copyHypothesisDataFromImpl(from, result); + copyHypothesisDataFromImpl(from, result); return result; } void MG_ADAPT_i::setUseLocalMap(bool mybool) @@ -322,7 +312,7 @@ void MG_ADAPT_i::setConstantSize(double value) { myMgAdapt->setConstantValue(value); } -double MG_ADAPT_i::getConstantSize() +double MG_ADAPT_i::getConstantSize() { return myMgAdapt->getConstantValue(); } @@ -360,19 +350,19 @@ void MG_ADAPT_i::setSizeMapType(const char* type) setUseLocalMap(false); setUseBackgroundMap(false); setUseConstantValue(false); - + if (!strcmp("Local", type)) setUseLocalMap(true); else if (!strcmp("Background", type)) setUseBackgroundMap(true); - else + else setUseConstantValue(true); } void MG_ADAPT_i::setWorkingDir(const char* dir) { myMgAdapt->setWorkingDir(dir); } -char* MG_ADAPT_i::getWorkingDir() +char* MG_ADAPT_i::getWorkingDir() { return CORBA::string_dup(myMgAdapt->getWorkingDir().c_str()); } @@ -418,7 +408,7 @@ char* MG_ADAPT_i::getErrMsg() { return CORBA::string_dup(errStr.c_str()); } -char* MG_ADAPT_i::getFileName() +char* MG_ADAPT_i::getFileName() { return CORBA::string_dup(myMgAdapt->getFileName().c_str()); } @@ -428,7 +418,7 @@ char* MG_ADAPT_i::getExeName() } void MG_ADAPT_i::copyMgAdaptHypothesisData( const SMESH::MgAdaptHypothesisData& data) { - ::MG_ADAPT::MgAdaptHypothesisData* baseData = new ::MG_ADAPT::MgAdaptHypothesisData(); + ::MG_ADAPT::MgAdaptHypothesisData* baseData = new ::MG_ADAPT::MgAdaptHypothesisData(); copyHypothesisDataToImpl(data, baseData); myMgAdapt->copyMgAdaptHypothesisData(baseData); delete baseData; @@ -439,7 +429,7 @@ void MG_ADAPT_i::copyMgAdaptHypothesisData( const SMESH::MgAdaptHypothesisData& //~myMgAdapt->checkDirPath(str); //~} -bool MG_ADAPT_i::hasOptionDefined( const char* optionName ) +bool MG_ADAPT_i::hasOptionDefined( const char* optionName ) { return myMgAdapt->hasOptionDefined(optionName); } @@ -447,14 +437,14 @@ void MG_ADAPT_i::setOptionValue(const char* optionName, const char* optionValue) throw (std::invalid_argument) { myMgAdapt->setOptionValue(optionName, optionValue); -} +} char* MG_ADAPT_i::getOptionValue(const char* optionName, bool& isDefault) throw (std::invalid_argument) { return CORBA::string_dup(myMgAdapt->getOptionValue(optionName, &isDefault).c_str()); } -str_array* MG_ADAPT_i::getCustomOptionValuesStrVec() +str_array* MG_ADAPT_i::getCustomOptionValuesStrVec() { SMESH::str_array_var result = new SMESH::str_array(); std::vector vals = myMgAdapt->getCustomOptionValuesStrVec(); @@ -462,7 +452,7 @@ str_array* MG_ADAPT_i::getCustomOptionValuesStrVec() for (int i = 0; isetMedFileIn(medFileIn.c_str()); mg->setMedFileOut(medFileOut.c_str()); mg->setSizeMapFile(medFileBackground.c_str()); @@ -523,8 +513,8 @@ CORBA::Long MG_ADAPT_OBJECT_i::Compute(bool publish) return -1; } hypothesis->setPublish(publish); - return hypothesis->compute(); -} + return hypothesis->compute(); +} bool MG_ADAPT_OBJECT_i::checkMeshFileIn() { @@ -539,11 +529,11 @@ bool MG_ADAPT_OBJECT_i::checkMeshFileIn() medFileIn+= ".med"; myMesh->ExportMED(medFileIn.c_str(), false, -1, toOverwrite, toFindOutDim); hypothesis->setMedFileIn(medFileIn.c_str()); - ret = true; + ret = true; } } else ret = true; - + return ret; } From 36e723d3d39def077f49db994e6bbe4693ace7f0 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Wed, 3 Feb 2021 15:55:16 +0100 Subject: [PATCH 075/100] Remplacement des taquets de tabulations paor des espaces --- src/SMESH/MG_ADAPT.cxx | 1625 +++++++++--------- src/SMESH/MG_ADAPT.hxx | 435 +++-- src/SMESHGUI/MG_ADAPTGUI.cxx | 1903 +++++++++++----------- src/SMESHGUI/MG_ADAPTGUI.hxx | 295 ++-- src/SMESHGUI/SMESHGUI.cxx | 18 +- src/SMESHGUI/SMESHGUI_AdaptDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx | 759 ++++----- src/SMESH_I/MG_ADAPT_i.cxx | 407 +++-- src/SMESH_I/MG_ADAPT_i.hxx | 182 +-- 9 files changed, 2783 insertions(+), 2843 deletions(-) diff --git a/src/SMESH/MG_ADAPT.cxx b/src/SMESH/MG_ADAPT.cxx index b59fde866..640305541 100644 --- a/src/SMESH/MG_ADAPT.cxx +++ b/src/SMESH/MG_ADAPT.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // file : MG_ADAPT.cxx #include "MG_ADAPT.hxx" @@ -41,469 +41,460 @@ using namespace MG_ADAPT; static std::string removeFile(std::string fileName, int& notOk) { - std::string errStr; - notOk = std::remove(fileName.c_str()); - if (notOk) errStr = ToComment(" \n error while removing file : ") - << fileName; - else errStr= ToComment("\n file : ")<< fileName << " succesfully deleted! \n "; + std::string errStr; + notOk = std::remove(fileName.c_str()); + if (notOk) errStr = ToComment("\n error while removing file : ") << fileName; + else errStr = ToComment("\n file : ") << fileName << " succesfully deleted! \n "; - return errStr; + return errStr; } std::string remove_extension(const std::string& filename) { - size_t lastdot = filename.find_last_of("."); - if (lastdot == std::string::npos) return filename; - return filename.substr(0, lastdot); + size_t lastdot = filename.find_last_of("."); + if (lastdot == std::string::npos) return filename; + return filename.substr(0, lastdot); } namespace { struct GET_DEFAULT // struct used to get default value from GetOptionValue() { - bool isDefault; - operator bool* () { - return &isDefault; - } + bool isDefault; + operator bool* () { + return &isDefault; + } }; } //---------------------------------------------------------------------------------------- MgAdapt::MgAdapt() { - data = new MgAdaptHypothesisData(); - data->myInMeshName = ""; - data->fromMedFile = defaultFromMedFile(); - data->myFileInDir = defaultWorkingDirectory(); - data->myMeshFileIn = ""; - data->myFileOutDir = defaultWorkingDirectory(); - data->myOutMeshName = ""; - data->myMeshFileOut = ""; - data->myMeshOutMed = defaultMeshOutMed(); - data->myPublish = defaultPublish(); - data->myUseLocalMap = defaultUseLocalMap(); - data->myUseBackgroundMap = defaultUseBackgroundMap(); - data->myFileSizeMapDir = defaultWorkingDirectory(); - data->myMeshFileBackground = ""; - data->myUseConstantValue = defaultUseConstantValue(); - data->myConstantValue = 0.0; - data->myFieldName = ""; - data->myUseNoTimeStep = defaultUseNoTimeStep(); - data->myUseLastTimeStep = defaultUseLastTimeStep(); - data->myUseChosenTimeStep = defaultUseChosenTimeStep(); - data->myTimeStep = -2; - data->myRank = -2; - data->myWorkingDir = defaultWorkingDirectory(); - data->myLogFile = defaultLogFile(); - data->myVerboseLevel = defaultVerboseLevel(); - data->myPrintLogInFile = defaultPrintLogInFile(); - data->myKeepFiles = defaultKeepFiles(); - data->myRemoveLogOnSuccess = defaultRemoveLogOnSuccess(); + data = new MgAdaptHypothesisData(); + data->myInMeshName = ""; + data->fromMedFile = defaultFromMedFile(); + data->myFileInDir = defaultWorkingDirectory(); + data->myMeshFileIn = ""; + data->myFileOutDir = defaultWorkingDirectory(); + data->myOutMeshName = ""; + data->myMeshFileOut = ""; + data->myMeshOutMed = defaultMeshOutMed(); + data->myPublish = defaultPublish(); + data->myUseLocalMap = defaultUseLocalMap(); + data->myUseBackgroundMap = defaultUseBackgroundMap(); + data->myFileSizeMapDir = defaultWorkingDirectory(); + data->myMeshFileBackground = ""; + data->myUseConstantValue = defaultUseConstantValue(); + data->myConstantValue = 0.0; + data->myFieldName = ""; + data->myUseNoTimeStep = defaultUseNoTimeStep(); + data->myUseLastTimeStep = defaultUseLastTimeStep(); + data->myUseChosenTimeStep = defaultUseChosenTimeStep(); + data->myTimeStep = -2; + data->myRank = -2; + data->myWorkingDir = defaultWorkingDirectory(); + data->myLogFile = defaultLogFile(); + data->myVerboseLevel = defaultVerboseLevel(); + data->myPrintLogInFile = defaultPrintLogInFile(); + data->myKeepFiles = defaultKeepFiles(); + data->myRemoveLogOnSuccess = defaultRemoveLogOnSuccess(); - buildModel(); - setAll(); + buildModel(); + setAll(); } MgAdapt::MgAdapt(MgAdaptHypothesisData* myData) { - data = new MgAdaptHypothesisData(); - setData(myData); - buildModel(); + data = new MgAdaptHypothesisData(); + setData(myData); + buildModel(); } MgAdapt::MgAdapt( const MgAdapt& copy) { + data = new MgAdaptHypothesisData(); + MgAdaptHypothesisData *copyData = copy.getData(); + copyMgAdaptHypothesisData(copyData); + setAll(); - data = new MgAdaptHypothesisData(); - MgAdaptHypothesisData *copyData = copy.getData(); - copyMgAdaptHypothesisData(copyData); - setAll(); - - this->_option2value = copy._option2value; - this->_customOption2value = copy._customOption2value; - this->_defaultOptionValues = copy._defaultOptionValues; - this->_doubleOptions = copy._doubleOptions; - this->_charOptions = copy._charOptions; - this->_boolOptions = copy._boolOptions; - + this->_option2value = copy._option2value; + this->_customOption2value = copy._customOption2value; + this->_defaultOptionValues = copy._defaultOptionValues; + this->_doubleOptions = copy._doubleOptions; + this->_charOptions = copy._charOptions; + this->_boolOptions = copy._boolOptions; } - - //----------------------------------------------------------------------------------------- MgAdapt::~MgAdapt() { - - delete data; - + delete data; } void MgAdapt::buildModel() { - const char* boolOptionNames[] = { "compute_ridges", // yes - "" // mark of end - }; - // const char* intOptionNames[] = { "max_number_of_errors_printed", // 1 - // "max_number_of_threads", // 4 - // "" // mark of end - // }; - const char* doubleOptionNames[] = { "max_memory", // 0 - "" // mark of end - }; - const char* charOptionNames[] = { "components", // "yes" - "adaptation", // both + const char* boolOptionNames[] = { "compute_ridges", // yes + "" // mark of end + }; + // const char* intOptionNames[] = { "max_number_of_errors_printed", // 1 + // "max_number_of_threads", // 4 + // "" // mark of end + // }; + const char* doubleOptionNames[] = { "max_memory", // 0 "" // mark of end }; + const char* charOptionNames[] = { "components", // "yes" + "adaptation", // both + "" // mark of end + }; - int i = 0; - while (boolOptionNames[i][0]) - { - _boolOptions.insert( boolOptionNames[i] ); - _option2value[boolOptionNames[i++]].clear(); - } - // i = 0; - // while (intOptionNames[i][0]) - // _option2value[intOptionNames[i++]].clear(); + int i = 0; + while (boolOptionNames[i][0]) + { + _boolOptions.insert( boolOptionNames[i] ); + _option2value[boolOptionNames[i++]].clear(); + } + // i = 0; + // while (intOptionNames[i][0]) + // _option2value[intOptionNames[i++]].clear(); - i = 0; - while (doubleOptionNames[i][0]) { - _doubleOptions.insert(doubleOptionNames[i]); - _option2value[doubleOptionNames[i++]].clear(); - } - i = 0; - while (charOptionNames[i][0]) { - _charOptions.insert(charOptionNames[i]); - _option2value[charOptionNames[i++]].clear(); - } + i = 0; + while (doubleOptionNames[i][0]) { + _doubleOptions.insert(doubleOptionNames[i]); + _option2value[doubleOptionNames[i++]].clear(); + } + i = 0; + while (charOptionNames[i][0]) { + _charOptions.insert(charOptionNames[i]); + _option2value[charOptionNames[i++]].clear(); + } - // default values to be used while MG-Adapt + // default values to be used while MG-Adapt - _defaultOptionValues["adaptation" ] = "both"; - _defaultOptionValues["components" ] = "outside components"; - _defaultOptionValues["compute_ridges" ] = "yes"; - _defaultOptionValues["max_memory" ] = ToComment(defaultMaximumMemory()); + _defaultOptionValues["adaptation" ] = "both"; + _defaultOptionValues["components" ] = "outside components"; + _defaultOptionValues["compute_ridges" ] = "yes"; + _defaultOptionValues["max_memory" ] = ToComment(defaultMaximumMemory()); } //============================================================================= TOptionValues MgAdapt::getOptionValues() const { - TOptionValues vals; - TOptionValues::const_iterator op_val = _option2value.begin(); - for ( ; op_val != _option2value.end(); ++op_val ) - vals.insert( make_pair( op_val->first, getOptionValue( op_val->first, GET_DEFAULT() ))); + TOptionValues vals; + TOptionValues::const_iterator op_val = _option2value.begin(); + for ( ; op_val != _option2value.end(); ++op_val ) + vals.insert( make_pair( op_val->first, getOptionValue( op_val->first, GET_DEFAULT() ))); - return vals; + return vals; } std::vector MgAdapt::getOptionValuesStrVec() const { - std::vector vals; - TOptionValues::const_iterator op_val = _option2value.begin(); - for ( ; op_val != _option2value.end(); ++op_val ) - vals.push_back(op_val->first+":"+getOptionValue( op_val->first, GET_DEFAULT() )); + std::vector vals; + TOptionValues::const_iterator op_val = _option2value.begin(); + for ( ; op_val != _option2value.end(); ++op_val ) + vals.push_back(op_val->first+":"+getOptionValue( op_val->first, GET_DEFAULT() )); - return vals; + return vals; } std::vector MgAdapt::getCustomOptionValuesStrVec() const { - std::vector vals; - TOptionValues::const_iterator op_val; - for ( op_val = _customOption2value.begin(); op_val != _customOption2value.end(); ++op_val ) - { - vals.push_back(op_val->first+":"+getOptionValue( op_val->first, GET_DEFAULT() )); - } - return vals; + std::vector vals; + TOptionValues::const_iterator op_val; + for ( op_val = _customOption2value.begin(); op_val != _customOption2value.end(); ++op_val ) + { + vals.push_back(op_val->first+":"+getOptionValue( op_val->first, GET_DEFAULT() )); + } + return vals; } const TOptionValues& MgAdapt::getCustomOptionValues() const { - return _customOption2value; + return _customOption2value; } void MgAdapt::setData(MgAdaptHypothesisData* myData) { - copyMgAdaptHypothesisData(myData); - setAll(); + copyMgAdaptHypothesisData(myData); + setAll(); } MgAdaptHypothesisData* MgAdapt::getData() const { - return data; + return data; } void MgAdapt::setMedFileIn(std::string fileName) { - medFileIn = fileName; - if (medFileOut == "") // default MED file Out - medFileOut = remove_extension( fileName )+ ".adapt.med"; + medFileIn = fileName; + if (medFileOut == "") // default MED file Out + medFileOut = remove_extension( fileName )+ ".adapt.med"; } std::string MgAdapt::getMedFileIn() { - return medFileIn; + return medFileIn; } void MgAdapt::setMedFileOut(std::string fileOut) { - medFileOut = fileOut; + medFileOut = fileOut; } std::string MgAdapt::getMedFileOut() { - return medFileOut; + return medFileOut; } void MgAdapt::setMeshOutMed(bool mybool) { - meshOutMed = mybool; + meshOutMed = mybool; } bool MgAdapt::getMeshOutMed() { - return meshOutMed; + return meshOutMed; } void MgAdapt::setPublish(bool mybool) { - publish = mybool; + publish = mybool; } bool MgAdapt::getPublish() { - return publish; + return publish; } void MgAdapt::setFieldName(std::string myFieldName) { - fieldName = myFieldName; + fieldName = myFieldName; } std::string MgAdapt::getFieldName() { - return fieldName; + return fieldName; } void MgAdapt::setTimeStep(int time) { - timeStep = time; + timeStep = time; } int MgAdapt::getTimeStep() const { - return timeStep; + return timeStep; } void MgAdapt::setRankTimeStep(int time, int myRank) { - timeStep = time; - rank = myRank; + timeStep = time; + rank = myRank; } int MgAdapt::getRank() { - return rank; + return rank; } void MgAdapt::setTimeStepRankLast() { - myUseLastTimeStep = true; - myUseChosenTimeStep = false; - myUseNoTimeStep = false; - //~med_int aRank, tmst; - //~std::string fieldFile = useBackgroundMap ? sizeMapFile : medFileIn; - //~getTimeStepInfos(fieldFile, tmst, aRank); - //~setRankTimeStep((int) tmst, (int) aRank); + myUseLastTimeStep = true; + myUseChosenTimeStep = false; + myUseNoTimeStep = false; + //~med_int aRank, tmst; + //~std::string fieldFile = useBackgroundMap ? sizeMapFile : medFileIn; + //~getTimeStepInfos(fieldFile, tmst, aRank); + //~setRankTimeStep((int) tmst, (int) aRank); } void MgAdapt::setNoTimeStep() { - myUseLastTimeStep = false; - myUseChosenTimeStep = false; - myUseNoTimeStep = true; - //~int aRank = (int)MED_NO_IT; - //~int tmst = (int)MED_NO_DT ; - //~setRankTimeStep(tmst, aRank); + myUseLastTimeStep = false; + myUseChosenTimeStep = false; + myUseNoTimeStep = true; + //~int aRank = (int)MED_NO_IT; + //~int tmst = (int)MED_NO_DT ; + //~setRankTimeStep(tmst, aRank); } void MgAdapt::setChosenTimeStepRank() { - myUseLastTimeStep = false; - myUseChosenTimeStep = true; - myUseNoTimeStep = false; - //~int aRank = (int)MED_NO_IT; - //~int tmst = (int)MED_NO_DT ; - //~setRankTimeStep(tmst, aRank); + myUseLastTimeStep = false; + myUseChosenTimeStep = true; + myUseNoTimeStep = false; + //~int aRank = (int)MED_NO_IT; + //~int tmst = (int)MED_NO_DT ; + //~setRankTimeStep(tmst, aRank); } void MgAdapt::setUseLocalMap(bool myLocal) { - useLocalMap = myLocal; + useLocalMap = myLocal; } bool MgAdapt::getUseLocalMap() { - return useLocalMap; + return useLocalMap; } void MgAdapt::setUseBackgroundMap(bool bckg) { - useBackgroundMap = bckg; + useBackgroundMap = bckg; } bool MgAdapt::getUseBackgroundMap() { - return useBackgroundMap; + return useBackgroundMap; } void MgAdapt::setUseConstantValue(bool cnst) { - useConstantValue = cnst; + useConstantValue = cnst; } bool MgAdapt::getUseConstantValue() { - return useConstantValue; + return useConstantValue; } void MgAdapt::setLogFile(std::string myLogFile) { - logFile = myLogFile; + logFile = myLogFile; } std::string MgAdapt::getLogFile() { - return logFile; + return logFile; } void MgAdapt::setVerbosityLevel(int verboLevel) { - verbosityLevel = verboLevel; + verbosityLevel = verboLevel; } int MgAdapt::getVerbosityLevel() { - return verbosityLevel; + return verbosityLevel; } void MgAdapt::setRemoveOnSuccess(bool rmons) { - removeOnSuccess = rmons; + removeOnSuccess = rmons; } bool MgAdapt::getRemoveOnSuccess() { - return removeOnSuccess; + return removeOnSuccess; } void MgAdapt::setSizeMapFile(std::string mapFile) { - sizeMapFile = mapFile; + sizeMapFile = mapFile; } std::string MgAdapt::getSizeMapFile() { - return sizeMapFile; + return sizeMapFile; } void MgAdapt::setMeshName(std::string name) { - meshName = name; + meshName = name; } std::string MgAdapt::getMeshName() { - return meshName; + return meshName; } void MgAdapt::setMeshNameOut(std::string name) { - meshNameOut = name; + meshNameOut = name; } std::string MgAdapt::getMeshNameOut() { - return meshNameOut; + return meshNameOut; } void MgAdapt::setFromMedFile(bool mybool) { - fromMedFile = mybool; + fromMedFile = mybool; } bool MgAdapt::isFromMedFile() { - return fromMedFile; + return fromMedFile; } void MgAdapt::setConstantValue(double cnst) { - constantValue = cnst; + constantValue = cnst; } double MgAdapt::getConstantValue() const { - return constantValue; + return constantValue; } void MgAdapt::setWorkingDir(std::string dir) { - workingDir = dir; + workingDir = dir; } std::string MgAdapt::getWorkingDir() const { - return workingDir; + return workingDir; } void MgAdapt::setKeepWorkingFiles(bool mybool) { - toKeepWorkingFiles = mybool; + toKeepWorkingFiles = mybool; } bool MgAdapt::getKeepWorkingFiles() { - return toKeepWorkingFiles; + return toKeepWorkingFiles; } void MgAdapt::setPrintLogInFile(bool print) { - printLogInFile = print; + printLogInFile = print; } bool MgAdapt::getPrintLogInFile() { - return printLogInFile; + return printLogInFile; } bool MgAdapt::setAll() { - setFromMedFile(data->fromMedFile); - std::string file; - checkDirPath(data->myFileInDir); - file = data->myFileInDir+data->myMeshFileIn; - setMedFileIn(file); - setMeshName(data->myInMeshName); - setMeshNameOut(data->myOutMeshName); - checkDirPath(data->myFileOutDir); - std::string out = data->myFileOutDir+data->myMeshFileOut; - setMedFileOut(out); - setPublish(data->myPublish); - setMeshOutMed(data->myMeshOutMed); - setUseLocalMap(data->myUseLocalMap); - setUseBackgroundMap(data->myUseBackgroundMap); - setUseConstantValue(data->myUseConstantValue); + setFromMedFile(data->fromMedFile); + std::string file; + checkDirPath(data->myFileInDir); + file = data->myFileInDir+data->myMeshFileIn; + setMedFileIn(file); + setMeshName(data->myInMeshName); + setMeshNameOut(data->myOutMeshName); + checkDirPath(data->myFileOutDir); + std::string out = data->myFileOutDir+data->myMeshFileOut; + setMedFileOut(out); + setPublish(data->myPublish); + setMeshOutMed(data->myMeshOutMed); + setUseLocalMap(data->myUseLocalMap); + setUseBackgroundMap(data->myUseBackgroundMap); + setUseConstantValue(data->myUseConstantValue); - std::string mapfile; - if (useBackgroundMap) - { + std::string mapfile; + if (useBackgroundMap) + { + checkDirPath(data->myFileSizeMapDir); + mapfile = data->myFileSizeMapDir+data->myMeshFileBackground; + setFieldName(data->myFieldName); + } + else if (useConstantValue) + { + setConstantValue(data->myConstantValue); + } + else + { + mapfile =""; + setConstantValue(0.0); + setFieldName(data->myFieldName); + } - checkDirPath(data->myFileSizeMapDir); - mapfile = data->myFileSizeMapDir+data->myMeshFileBackground; - setFieldName(data->myFieldName); - } - else if (useConstantValue) - { - setConstantValue(data->myConstantValue); - } - else - { - mapfile =""; - setConstantValue(0.0); - setFieldName(data->myFieldName); + setSizeMapFile(mapfile); + if (data->myUseNoTimeStep) + setNoTimeStep(); + else if (data->myUseLastTimeStep) + setTimeStepRankLast(); + else + { + setChosenTimeStepRank(); + setRankTimeStep(data->myTimeStep, data->myRank); + } + /* Advanced options */ + setWorkingDir(data->myWorkingDir); + checkDirPath(data->myWorkingDir); + setLogFile(data->myWorkingDir+defaultLogFile()); + setVerbosityLevel(data->myVerboseLevel); + setRemoveOnSuccess(data->myRemoveLogOnSuccess); + setPrintLogInFile(data->myPrintLogInFile); + setKeepWorkingFiles(data->myKeepFiles); - } - - setSizeMapFile(mapfile); - if (data->myUseNoTimeStep) - setNoTimeStep(); - else if (data->myUseLastTimeStep) - setTimeStepRankLast(); - else - { - setChosenTimeStepRank(); - setRankTimeStep(data->myTimeStep, data->myRank); - } - /* Advanced options */ - setWorkingDir(data->myWorkingDir); - checkDirPath(data->myWorkingDir); - setLogFile(data->myWorkingDir+defaultLogFile()); - setVerbosityLevel(data->myVerboseLevel); - setRemoveOnSuccess(data->myRemoveLogOnSuccess); - setPrintLogInFile(data->myPrintLogInFile); - setKeepWorkingFiles(data->myKeepFiles); - - return true; + return true; } void MgAdapt::checkDirPath(std::string& dirPath) { - const char lastChar = *dirPath.rbegin(); + const char lastChar = *dirPath.rbegin(); #ifdef WIN32 - if(lastChar != '\\') dirPath+='\\'; + if(lastChar != '\\') dirPath+='\\'; #else - if(lastChar != '/') dirPath+='/'; + if(lastChar != '/') dirPath+='/'; #endif } //============================================================================= @@ -511,61 +502,68 @@ void MgAdapt::setOptionValue(const std::string& optionName, const std::string& optionValue) throw (std::invalid_argument) { - TOptionValues::iterator op_val = _option2value.find(optionName); - if (op_val == _option2value.end()) + TOptionValues::iterator op_val = _option2value.find(optionName); + if (op_val == _option2value.end()) + { + op_val = _customOption2value.find( optionName ); + _customOption2value[ optionName ] = optionValue; + return; + } + + if (op_val->second != optionValue) + { + + std::string lowerOptionValue = toLowerStr(optionValue); + const char* ptr = lowerOptionValue.c_str(); + // strip white spaces + while (ptr[0] == ' ') + ptr++; + int i = strlen(ptr); + while (i != 0 && ptr[i - 1] == ' ') + i--; + // check value type + bool typeOk = true; + std::string typeName; + if (i == 0) { - op_val = _customOption2value.find( optionName ); - _customOption2value[ optionName ] = optionValue; - return; + // empty string } - - if (op_val->second != optionValue) + else if (_charOptions.count(optionName)) { - - std::string lowerOptionValue = toLowerStr(optionValue); - const char* ptr = lowerOptionValue.c_str(); - // strip white spaces - while (ptr[0] == ' ') - ptr++; - int i = strlen(ptr); - while (i != 0 && ptr[i - 1] == ' ') - i--; - // check value type - bool typeOk = true; - std::string typeName; - if (i == 0) { - // empty string - } else if (_charOptions.count(optionName)) { - // do not check strings - } else if (_doubleOptions.count(optionName)) { - // check if value is double - toDbl(ptr, &typeOk); - typeName = "real"; - } else if (_boolOptions.count(optionName)) { - // check if value is bool - toBool(ptr, &typeOk); - typeName = "bool"; - } else { - // check if value is int - toInt(ptr, &typeOk); - typeName = "integer"; - } - if ( typeOk ) // check some specific values ? - { - } - if ( !typeOk ) - { - std::string msg = "Advanced option '" + optionName + "' = '" + optionValue + "' but must be " + typeName; - throw std::invalid_argument(msg); - } - std::string value( ptr, i ); - if ( _defaultOptionValues[ optionName ] == value ) - value.clear(); - - - op_val->second = value; - + // do not check strings } + else if (_doubleOptions.count(optionName)) + { + // check if value is double + toDbl(ptr, &typeOk); + typeName = "real"; + } + else if (_boolOptions.count(optionName)) + { + // check if value is bool + toBool(ptr, &typeOk); + typeName = "bool"; + } + else + { + // check if value is int + toInt(ptr, &typeOk); + typeName = "integer"; + } + if ( typeOk ) // check some specific values ? + { + } + if ( !typeOk ) + { + std::string msg = "Advanced option '" + optionName + "' = '" + optionValue + "' but must be " + typeName; + throw std::invalid_argument(msg); + } + std::string value( ptr, i ); + if ( _defaultOptionValues[ optionName ] == value ) value.clear(); + + op_val->second = value; + + } } //============================================================================= //! Return option value. If isDefault provided, it can be a default value, @@ -574,26 +572,25 @@ throw (std::invalid_argument) std::string MgAdapt::getOptionValue(const std::string& optionName, bool* isDefault) const throw (std::invalid_argument) { - TOptionValues::const_iterator op_val = _option2value.find(optionName); - if (op_val == _option2value.end()) + TOptionValues::const_iterator op_val = _option2value.find(optionName); + if (op_val == _option2value.end()) + { + op_val = _customOption2value.find(optionName); + if (op_val == _customOption2value.end()) { - op_val = _customOption2value.find(optionName); - if (op_val == _customOption2value.end()) - { - std::string msg = "Unknown MG-Adapt option: <" + optionName + ">"; - throw std::invalid_argument(msg); - } + std::string msg = "Unknown MG-Adapt option: <" + optionName + ">"; + throw std::invalid_argument(msg); } - std::string val = op_val->second; - if ( isDefault ) *isDefault = ( val.empty() ); + } + std::string val = op_val->second; + if ( isDefault ) *isDefault = ( val.empty() ); - if ( val.empty() && isDefault ) - { - op_val = _defaultOptionValues.find( optionName ); - if (op_val != _defaultOptionValues.end()) - val = op_val->second; - } - return val; + if ( val.empty() && isDefault ) + { + op_val = _defaultOptionValues.find( optionName ); + if (op_val != _defaultOptionValues.end()) val = op_val->second; + } + return val; } //================================================================================ /*! @@ -604,20 +601,20 @@ throw (std::invalid_argument) double MgAdapt::toDbl(const std::string& str, bool* isOk ) throw (std::invalid_argument) { - if ( str.empty() ) throw std::invalid_argument("Empty value provided"); + if ( str.empty() ) throw std::invalid_argument("Empty value provided"); - char * endPtr; - double val = strtod(&str[0], &endPtr); - bool ok = (&str[0] != endPtr); + char * endPtr; + double val = strtod(&str[0], &endPtr); + bool ok = (&str[0] != endPtr); - if ( isOk ) *isOk = ok; + if ( isOk ) *isOk = ok; - if ( !ok ) - { - std::string msg = "Not a real value:'" + str + "'"; - throw std::invalid_argument(msg); - } - return val; + if ( !ok ) + { + std::string msg = "Not a real value:'" + str + "'"; + throw std::invalid_argument(msg); + } + return val; } //================================================================================ /*! @@ -626,10 +623,10 @@ throw (std::invalid_argument) //================================================================================ std::string MgAdapt::toLowerStr(const std::string& str) { - std::string s = str; - for ( size_t i = 0; i <= s.size(); ++i ) - s[i] = tolower( s[i] ); - return s; + std::string s = str; + for ( size_t i = 0; i <= s.size(); ++i ) + s[i] = tolower( s[i] ); + return s; } //================================================================================ /*! @@ -640,25 +637,26 @@ std::string MgAdapt::toLowerStr(const std::string& str) bool MgAdapt::toBool(const std::string& str, bool* isOk ) throw (std::invalid_argument) { - std::string s = str; - if ( isOk ) *isOk = true; + std::string s = str; + if ( isOk ) *isOk = true; - for ( size_t i = 0; i <= s.size(); ++i ) - s[i] = tolower( s[i] ); + for ( size_t i = 0; i <= s.size(); ++i ) + s[i] = tolower( s[i] ); - if ( s == "1" || s == "true" || s == "active" || s == "yes" ) - return true; + if ( s == "1" || s == "true" || s == "active" || s == "yes" ) + return true; - if ( s == "0" || s == "false" || s == "inactive" || s == "no" ) - return false; - - if ( isOk ) - *isOk = false; - else { - std::string msg = "Not a Boolean value:'" + str + "'"; - throw std::invalid_argument(msg); - } + if ( s == "0" || s == "false" || s == "inactive" || s == "no" ) return false; + + if ( isOk ) + *isOk = false; + else + { + std::string msg = "Not a Boolean value:'" + str + "'"; + throw std::invalid_argument(msg); + } + return false; } //================================================================================ /*! @@ -669,34 +667,34 @@ throw (std::invalid_argument) int MgAdapt::toInt(const std::string& str, bool* isOk ) throw (std::invalid_argument) { - if ( str.empty() ) throw std::invalid_argument("Empty value provided"); + if ( str.empty() ) throw std::invalid_argument("Empty value provided"); - char * endPtr; - int val = (int)strtol( &str[0], &endPtr, 10); - bool ok = (&str[0] != endPtr); + char * endPtr; + int val = (int)strtol( &str[0], &endPtr, 10); + bool ok = (&str[0] != endPtr); - if ( isOk ) *isOk = ok; + if ( isOk ) *isOk = ok; - if ( !ok ) - { - std::string msg = "Not an integer value:'" + str + "'"; - throw std::invalid_argument(msg); - } - return val; + if ( !ok ) + { + std::string msg = "Not an integer value:'" + str + "'"; + throw std::invalid_argument(msg); + } + return val; } //============================================================================= bool MgAdapt::hasOptionDefined( const std::string& optionName ) const { - bool isDefault = false; - try - { - getOptionValue( optionName, &isDefault ); - } - catch ( std::invalid_argument ) - { - return false; - } - return !isDefault; + bool isDefault = false; + try + { + getOptionValue( optionName, &isDefault ); + } + catch ( std::invalid_argument ) + { + return false; + } + return !isDefault; } //================================================================================ /*! @@ -706,57 +704,56 @@ bool MgAdapt::hasOptionDefined( const std::string& optionName ) const std::string MgAdapt::getCommandToRun(MgAdapt* hyp) { - return hyp ? hyp->getCommandToRun() : ToComment("error with hypothesis!"); + return hyp ? hyp->getCommandToRun() : ToComment("error with hypothesis!"); } int MgAdapt::compute(std::string& errStr) { - std::string cmd = getCommandToRun(); - int err = 0; - execCmd( cmd.c_str(), err ); // run + std::string cmd = getCommandToRun(); + int err = 0; + execCmd( cmd.c_str(), err ); // run - if ( err ) - { - errStr = ToComment("system(mg-adapt.exe ...) command failed with error: ") - << strerror( errno ); - } - else - { - convertMeshFile(meshFormatOutputMesh, solFormatOutput); - } - if (!err) cleanUp(); - return err; + if ( err ) + { + errStr = ToComment("system(mg-adapt.exe ...) command failed with error: ") << strerror( errno ); + } + else + { + convertMeshFile(meshFormatOutputMesh, solFormatOutput); + } + if (!err) cleanUp(); + return err; } void MgAdapt::execCmd( const char* cmd, int& err) { - err = 1; - std::array buffer; - std::streambuf* buf; - outFileStream fileStream; - if (printLogInFile) - { - fileStream.open(logFile); - buf = fileStream.rdbuf(); - } - else - { - buf = std::cout.rdbuf(); - } - std::ostream logStream(buf); + err = 1; + std::array buffer; + std::streambuf* buf; +outFileStream fileStream; + if (printLogInFile) + { + fileStream.open(logFile); + buf = fileStream.rdbuf(); + } + else + { + buf = std::cout.rdbuf(); + } + std::ostream logStream(buf); - std::unique_ptr pipe(popen(cmd, "r"), pclose ); - if(!pipe) - { - throw std::runtime_error("popen() failed!"); - } - while(fgets(buffer.data(), buffer.size(), pipe.get()) !=nullptr ) - { - logStream< pipe(popen(cmd, "r"), pclose ); + if(!pipe) + { + throw std::runtime_error("popen() failed!"); + } + while(fgets(buffer.data(), buffer.size(), pipe.get()) !=nullptr ) + { + logStream<::iterator it = tmpFilesToBeDeleted.begin(); - for (; it!=tmpFilesToBeDeleted.end(); ++it) - { - errStr=removeFile(*it, notOk); - if (notOk) - { - appendMsgToLogFile(errStr); - } + std::vector< std::string>::iterator it = tmpFilesToBeDeleted.begin(); + for (; it!=tmpFilesToBeDeleted.end(); ++it) + { + errStr=removeFile(*it, notOk); + if (notOk) + { + appendMsgToLogFile(errStr); + } - } + } } void MgAdapt::appendMsgToLogFile(std::string& msg) { - std::ofstream logStream; - logStream.open(logFile, std::ofstream::out | std::ofstream::app); - logStream<< msg; - logStream.close(); + std::ofstream logStream; + logStream.open(logFile, std::ofstream::out | std::ofstream::app); + logStream<< msg; + logStream.close(); } //================================================================================ /*! @@ -799,115 +796,109 @@ void MgAdapt::appendMsgToLogFile(std::string& msg) std::string MgAdapt::getCommandToRun() { - /* - || return system command with args and options - || - */ - std::string errStr; - std::string cmd = getExeName(); - std::string meshIn(""), sizeMapIn(""), solFileIn(""); - updateTimeStepRank(); - convertMedFile(meshIn, solFileIn, sizeMapIn); - if (!isFileExist(meshIn) || !isFileExist(solFileIn)) + /* + || return system command with args and options + || + */ + std::string errStr; + std::string cmd = getExeName(); + std::string meshIn(""), sizeMapIn(""), solFileIn(""); + updateTimeStepRank(); + convertMedFile(meshIn, solFileIn, sizeMapIn); + if (!isFileExist(meshIn) || !isFileExist(solFileIn)) + { + errStr = ToComment(" failed to find .mesh or .sol file from converter ")<< strerror( errno ); + return errStr; + } + tmpFilesToBeDeleted.push_back(meshIn); + tmpFilesToBeDeleted.push_back(solFileIn); + if(useBackgroundMap && !isFileExist(sizeMapIn)) + { + errStr = ToComment(" failed to find .mesh size map file from converter ")<< strerror( errno ); + return errStr; + } + + cmd+= " --in "+ meshIn; + meshFormatOutputMesh = getFileName()+".mesh"; + tmpFilesToBeDeleted.push_back(meshFormatOutputMesh); + cmd+= " --out "+ meshFormatOutputMesh; + if (useLocalMap || useConstantValue) cmd+= " --sizemap "+ solFileIn; + else // (useBackgroundMap) + { + cmd+= " --background_mesh "+ sizeMapIn ; + cmd+= " --background_sizemap "+ solFileIn; + tmpFilesToBeDeleted.push_back(sizeMapIn); + } + //~else + //~{ + //~// constant value TODO + //~} + /* sizemap file is not adapted in case of only surface adaptation see MeshGems docs */ + std::string adapOp = "adaptation"; + std::string adpOpVal = getOptionValue(adapOp); + std::string surfaceAdapt = "surface"; + if(surfaceAdapt != adpOpVal ) + { + std::string solFileOut = getFileName()+".sol"; + cmd+= " --write_sizemap "+ solFileOut; + solFormatOutput.push_back(solFileOut); + tmpFilesToBeDeleted.push_back(solFileOut); + } + if (verbosityLevel != defaultVerboseLevel()) + { + cmd+= " --verbose "+ ToComment(verbosityLevel); + } + + std::string option, value; + bool isDefault; + const TOptionValues* options[] = { &_option2value, &_customOption2value }; + for ( int iOp = 0; iOp < 2; ++iOp ) + { + TOptionValues::const_iterator o2v = options[iOp]->begin(); + for ( ; o2v != options[iOp]->end(); ++o2v ) { - errStr = ToComment(" failed to find .mesh or .sol file from converter ")<< strerror( errno ); - return errStr; - } - tmpFilesToBeDeleted.push_back(meshIn); - tmpFilesToBeDeleted.push_back(solFileIn); - if(useBackgroundMap && !isFileExist(sizeMapIn)) - { - - errStr = ToComment(" failed to find .mesh size map file from converter ")<< strerror( errno ); - return errStr; - - } - - - cmd+= " --in "+ meshIn; - meshFormatOutputMesh = getFileName()+".mesh"; - tmpFilesToBeDeleted.push_back(meshFormatOutputMesh); - cmd+= " --out "+ meshFormatOutputMesh; - if (useLocalMap || useConstantValue) cmd+= " --sizemap "+ solFileIn; - else // (useBackgroundMap) - { - cmd+= " --background_mesh "+ sizeMapIn ; - cmd+= " --background_sizemap "+ solFileIn; - tmpFilesToBeDeleted.push_back(sizeMapIn); - } - //~else - //~{ - //~// constant value TODO - //~} - /* sizemap file is not adapted in case of only surface adaptation see MeshGems docs */ - std::string adapOp = "adaptation"; - std::string adpOpVal = getOptionValue(adapOp); - std::string surfaceAdapt = "surface"; - if(surfaceAdapt != adpOpVal ) - { - std::string solFileOut = getFileName()+".sol"; - cmd+= " --write_sizemap "+ solFileOut; - solFormatOutput.push_back(solFileOut); - tmpFilesToBeDeleted.push_back(solFileOut); - } - if (verbosityLevel != defaultVerboseLevel()) - { - - cmd+= " --verbose "+ ToComment(verbosityLevel); - } - - std::string option, value; - bool isDefault; - const TOptionValues* options[] = { &_option2value, &_customOption2value }; - for ( int iOp = 0; iOp < 2; ++iOp ) - { - TOptionValues::const_iterator o2v = options[iOp]->begin(); - for ( ; o2v != options[iOp]->end(); ++o2v ) - { - option = o2v->first; - value = getOptionValue( option, &isDefault ); - - if ( isDefault ) - continue; - if ( value.empty() )//value == NoValue() ) - { - if ( _defaultOptionValues.count( option )) - continue; // non-custom option with no value - //value.clear(); - } - if ( strncmp( "no", option.c_str(), 2 ) == 0 ) // options w/o values: --no_* - { - if ( !value.empty() && toBool( value ) == false ) - continue; - value.clear(); - } - if ( option[0] != '-' ) - cmd += " --"; - else - cmd += " "; - cmd += option + " " + value; - } + option = o2v->first; + value = getOptionValue( option, &isDefault ); + + if ( isDefault ) + continue; + if ( value.empty() )//value == NoValue() ) + { + if ( _defaultOptionValues.count( option )) + continue; // non-custom option with no value + //value.clear(); + } + if ( strncmp( "no", option.c_str(), 2 ) == 0 ) // options w/o values: --no_* + { + if ( !value.empty() && toBool( value ) == false ) + continue; + value.clear(); + } + if ( option[0] != '-' ) + cmd += " --"; + else + cmd += " "; + cmd += option + " " + value; } + } //~} //~cmd+= " >" #ifdef WIN32 cmd += " < NUL"; #endif - return cmd; + return cmd; } - bool MgAdapt::isFileExist(const std::string& fName) { - if ( fName.empty() ) - return false; + if ( fName.empty() ) return false; - boost::system::error_code err; - bool res = boost::filesystem::exists( fName, err ); + boost::system::error_code err; + bool res = boost::filesystem::exists( fName, err ); - return err ? false : res; + return err ? false : res; } //======================================================================= //function : defaultMaximumMemory @@ -922,46 +913,48 @@ bool MgAdapt::isFileExist(const std::string& fName) double MgAdapt::defaultMaximumMemory() { #if defined(WIN32) - // See http://msdn.microsoft.com/en-us/library/aa366589.aspx - MEMORYSTATUSEX statex; - statex.dwLength = sizeof (statex); - long err = GlobalMemoryStatusEx (&statex); - if (err != 0) { - double totMB = (double)statex.ullAvailPhys / 1024. / 1024.; - return (double)( 0.7 * totMB ); - } + // See http://msdn.microsoft.com/en-us/library/aa366589.aspx + MEMORYSTATUSEX statex; + statex.dwLength = sizeof (statex); + long err = GlobalMemoryStatusEx (&statex); + if (err != 0) + { + double totMB = (double)statex.ullAvailPhys / 1024. / 1024.; + return (double)( 0.7 * totMB ); + } #elif !defined(__APPLE__) - struct sysinfo si; - long err = sysinfo( &si ); - if ( err == 0 ) { - long ramMB = si.totalram * si.mem_unit / 1024 / 1024; - return ( 0.7 * ramMB ); - } + struct sysinfo si; + long err = sysinfo( &si ); + if ( err == 0 ) + { + long ramMB = si.totalram * si.mem_unit / 1024 / 1024; + return ( 0.7 * ramMB ); + } #endif - return 1024; + return 1024; } - //======================================================================= //function : defaultWorkingDirectory //======================================================================= std::string MgAdapt::defaultWorkingDirectory() { - TCollection_AsciiString aTmpDir; + TCollection_AsciiString aTmpDir; - char *Tmp_dir = getenv("SALOME_TMP_DIR"); - if(Tmp_dir != NULL) { - aTmpDir = Tmp_dir; - } - else { + char *Tmp_dir = getenv("SALOME_TMP_DIR"); + if(Tmp_dir != NULL) + { + aTmpDir = Tmp_dir; + } + else { #ifdef WIN32 - aTmpDir = TCollection_AsciiString("C:\\"); + aTmpDir = TCollection_AsciiString("C:\\"); #else - aTmpDir = TCollection_AsciiString("/tmp/"); + aTmpDir = TCollection_AsciiString("/tmp/"); #endif - } - return aTmpDir.ToCString(); + } + return aTmpDir.ToCString(); } //================================================================================ /*! @@ -971,21 +964,21 @@ std::string MgAdapt::defaultWorkingDirectory() std::string MgAdapt::getFileName() const { - std::string aTmpDir = workingDir; - const char lastChar = *aTmpDir.rbegin(); + std::string aTmpDir = workingDir; + const char lastChar = *aTmpDir.rbegin(); #ifdef WIN32 - if(lastChar != '\\') aTmpDir+='\\'; + if(lastChar != '\\') aTmpDir+='\\'; #else - if(lastChar != '/') aTmpDir+='/'; + if(lastChar != '/') aTmpDir+='/'; #endif - TCollection_AsciiString aGenericName = (char*)aTmpDir.c_str(); - aGenericName += "MgAdapt_"; - aGenericName += getpid(); - aGenericName += "_"; - aGenericName += Abs((Standard_Integer)(long) aGenericName.ToCString()); + TCollection_AsciiString aGenericName = (char*)aTmpDir.c_str(); + aGenericName += "MgAdapt_"; + aGenericName += getpid(); + aGenericName += "_"; + aGenericName += Abs((Standard_Integer)(long) aGenericName.ToCString()); - return aGenericName.ToCString(); + return aGenericName.ToCString(); } //======================================================================= //function : defaultLogFile @@ -993,104 +986,104 @@ std::string MgAdapt::getFileName() const std::string MgAdapt::defaultLogFile() { - std::string alogFile("MG_ADAPT.log"); - return alogFile; + std::string alogFile("MG_ADAPT.log"); + return alogFile; } //======================================================================= //function : defaultUseConstantValue //======================================================================= -bool MgAdapt::defaultUseConstantValue() +bool MgAdapt::defaultUseConstantValue() { - return false; + return false; } //======================================================================= //function : defaultUseNoTimeStep //======================================================================= -bool MgAdapt::defaultUseNoTimeStep() +bool MgAdapt::defaultUseNoTimeStep() { - return true; + return true; } //======================================================================= //function : defaultRemoveLogOnSuccess //======================================================================= -bool MgAdapt::defaultRemoveLogOnSuccess() +bool MgAdapt::defaultRemoveLogOnSuccess() { - return true; + return true; } //======================================================================= //function : defaultPrintLogInFile //======================================================================= -bool MgAdapt::defaultPrintLogInFile() +bool MgAdapt::defaultPrintLogInFile() { - return false; + return false; } //======================================================================= //function : defaultUseChosenTimeStep //======================================================================= -bool MgAdapt::defaultUseChosenTimeStep() +bool MgAdapt::defaultUseChosenTimeStep() { - return false; + return false; } //======================================================================= //function : UseLastTimeStep //======================================================================= -bool MgAdapt::defaultUseLastTimeStep() +bool MgAdapt::defaultUseLastTimeStep() { - return false; + return false; } //======================================================================= //function : defaultUseBackgroundMap //======================================================================= -bool MgAdapt::defaultUseBackgroundMap() +bool MgAdapt::defaultUseBackgroundMap() { - return false; + return false; } //======================================================================= //function : defaultKeepFiles //======================================================================= -bool MgAdapt::defaultKeepFiles() +bool MgAdapt::defaultKeepFiles() { - return false; + return false; } //======================================================================= //function : defaultUseLocalMap //======================================================================= -bool MgAdapt::defaultUseLocalMap() +bool MgAdapt::defaultUseLocalMap() { - return true; + return true; } //======================================================================= //function : defaultPublish //======================================================================= -bool MgAdapt::defaultPublish() +bool MgAdapt::defaultPublish() { - return false; + return false; } //======================================================================= //function : defaultMeshOutMed //======================================================================= -bool MgAdapt::defaultMeshOutMed() +bool MgAdapt::defaultMeshOutMed() { - return true; + return true; } //======================================================================= //function : defaultFromMedFile //======================================================================= -bool MgAdapt::defaultFromMedFile() +bool MgAdapt::defaultFromMedFile() { - return true; + return true; } //======================================================================= //function : defaultVerboseLevel @@ -1098,355 +1091,337 @@ bool MgAdapt::defaultFromMedFile() int MgAdapt::defaultVerboseLevel() { - return 3; + return 3; } std::string MgAdapt::getExeName() { - return "mg-adapt.exe"; + return "mg-adapt.exe"; } void MgAdapt::copyMgAdaptHypothesisData( const MgAdaptHypothesisData* from) { - - data->myFileInDir = from->myFileInDir; - data->myMeshFileIn = from->myMeshFileIn; - data->myMeshFileBackground = from->myMeshFileBackground; - data->myOutMeshName = from->myOutMeshName; - data->myMeshFileOut = from->myMeshFileOut; - data->myFileOutDir = from->myFileOutDir; - data->myFileSizeMapDir = from->myFileSizeMapDir; - data->myFieldName = from->myFieldName; - data->fromMedFile = from->fromMedFile; - data->myPublish = from->myPublish; - data->myMeshOutMed = from->myMeshOutMed; - data->myUseLocalMap = from->myUseLocalMap; - data->myUseBackgroundMap = from->myUseBackgroundMap; - data->myUseConstantValue = from->myUseConstantValue; - data->myConstantValue = from->myConstantValue; - data->myTimeStep = from->myTimeStep; - data->myRank = from->myRank; - data->myUseNoTimeStep = from->myUseNoTimeStep; - data->myUseLastTimeStep = from->myUseLastTimeStep; - data->myUseChosenTimeStep = from->myUseChosenTimeStep; - data->myWorkingDir = from->myWorkingDir; - data->myLogFile = from->myLogFile; - data->myPrintLogInFile = from->myPrintLogInFile; - data->myKeepFiles = from->myKeepFiles; - data->myRemoveLogOnSuccess = from->myRemoveLogOnSuccess; - data->myVerboseLevel = from->myVerboseLevel; - + data->myFileInDir = from->myFileInDir; + data->myMeshFileIn = from->myMeshFileIn; + data->myMeshFileBackground = from->myMeshFileBackground; + data->myOutMeshName = from->myOutMeshName; + data->myMeshFileOut = from->myMeshFileOut; + data->myFileOutDir = from->myFileOutDir; + data->myFileSizeMapDir = from->myFileSizeMapDir; + data->myFieldName = from->myFieldName; + data->fromMedFile = from->fromMedFile; + data->myPublish = from->myPublish; + data->myMeshOutMed = from->myMeshOutMed; + data->myUseLocalMap = from->myUseLocalMap; + data->myUseBackgroundMap = from->myUseBackgroundMap; + data->myUseConstantValue = from->myUseConstantValue; + data->myConstantValue = from->myConstantValue; + data->myTimeStep = from->myTimeStep; + data->myRank = from->myRank; + data->myUseNoTimeStep = from->myUseNoTimeStep; + data->myUseLastTimeStep = from->myUseLastTimeStep; + data->myUseChosenTimeStep = from->myUseChosenTimeStep; + data->myWorkingDir = from->myWorkingDir; + data->myLogFile = from->myLogFile; + data->myPrintLogInFile = from->myPrintLogInFile; + data->myKeepFiles = from->myKeepFiles; + data->myRemoveLogOnSuccess = from->myRemoveLogOnSuccess; + data->myVerboseLevel = from->myVerboseLevel; } void MgAdapt::convertMedFile(std::string& meshFormatMeshFileName, std::string& solFormatFieldFileName, std::string& meshFormatsizeMapFile) { + std::vector fieldFileNames; + MEDCoupling::MeshFormatWriter writer; + MEDCoupling::MCAuto mfd = MEDCoupling::MEDFileData::New(medFileIn); + MEDCoupling::MEDFileMeshes* meshes = mfd->getMeshes(); + MEDCoupling::MEDFileMesh* fileMesh = meshes->getMeshAtPos(0); // ok only one mesh in file! + if (meshNameOut =="") + meshNameOut = fileMesh->getName(); + storeGroupsAndFams(fileMesh); - std::vector fieldFileNames; - MEDCoupling::MeshFormatWriter writer; - MEDCoupling::MCAuto mfd = MEDCoupling::MEDFileData::New(medFileIn); - MEDCoupling::MEDFileMeshes* meshes = mfd->getMeshes(); - MEDCoupling::MEDFileMesh* fileMesh = meshes->getMeshAtPos(0); // ok only one mesh in file! - if (meshNameOut =="") - meshNameOut = fileMesh->getName(); - storeGroupsAndFams(fileMesh); + MEDCoupling::MCAuto fields = MEDCoupling::MEDFileFields::New(); + solFormatFieldFileName = getFileName(); + solFormatFieldFileName+=".sol"; + fieldFileNames.push_back(solFormatFieldFileName); - MEDCoupling::MCAuto fields = MEDCoupling::MEDFileFields::New(); - solFormatFieldFileName = getFileName(); - solFormatFieldFileName+=".sol"; - fieldFileNames.push_back(solFormatFieldFileName); + if (useBackgroundMap) + { + meshFormatsizeMapFile = getFileName(); + meshFormatsizeMapFile += ".mesh"; + buildBackGroundMeshAndSolFiles(fieldFileNames, meshFormatsizeMapFile); + } + else if(useLocalMap) + { + MEDCoupling::MCAuto fts = dynamic_cast( mfd->getFields()->getFieldWithName(fieldName) ); + MEDCoupling::MCAuto f = fts->getTimeStep(timeStep, rank); + MEDCoupling::MCAuto tmFts = MEDCoupling::MEDFileFieldMultiTS::New(); + tmFts->pushBackTimeStep(f); - if (useBackgroundMap) - { + fields->pushField(tmFts); - meshFormatsizeMapFile = getFileName(); - meshFormatsizeMapFile += ".mesh"; - buildBackGroundMeshAndSolFiles(fieldFileNames, meshFormatsizeMapFile); + writer.setFieldFileNames( fieldFileNames); + } + else + { + MEDCoupling::MCAuto mesh = fileMesh->getMeshAtLevel(1); // nodes mesh + MEDCoupling::MCAuto umesh = mesh->buildUnstructured(); // nodes mesh + int dim = umesh->getSpaceDimension(); + int version = sizeof(double) < 8 ? 1 : 2; + mcIdType nbNodes = umesh->getNumberOfNodes(); + buildConstantSizeMapSolFile(solFormatFieldFileName, dim, version, nbNodes); + } - } - else if(useLocalMap) - { - - MEDCoupling::MCAuto fts = dynamic_cast( mfd->getFields()->getFieldWithName(fieldName) ); - MEDCoupling::MCAuto f = fts->getTimeStep(timeStep, rank); - MEDCoupling::MCAuto tmFts = MEDCoupling::MEDFileFieldMultiTS::New(); - tmFts->pushBackTimeStep(f); - - fields->pushField(tmFts); - - writer.setFieldFileNames( fieldFileNames); - } - - else - { - MEDCoupling::MCAuto mesh = fileMesh->getMeshAtLevel(1); // nodes mesh - MEDCoupling::MCAuto umesh = mesh->buildUnstructured(); // nodes mesh - int dim = umesh->getSpaceDimension(); - int version = sizeof(double) < 8 ? 1 : 2; - mcIdType nbNodes = umesh->getNumberOfNodes(); - buildConstantSizeMapSolFile(solFormatFieldFileName, dim, version, nbNodes); - - } - - mfd->setFields( fields ); - meshFormatMeshFileName = getFileName(); - meshFormatMeshFileName+=".mesh"; - writer.setMeshFileName(meshFormatMeshFileName); - writer.setMEDFileDS( mfd); - writer.write(); + mfd->setFields( fields ); + meshFormatMeshFileName = getFileName(); + meshFormatMeshFileName+=".mesh"; + writer.setMeshFileName(meshFormatMeshFileName); + writer.setMEDFileDS( mfd); + writer.write(); } void MgAdapt::convertMeshFile(std::string& meshFormatIn, std::vector< std::string>& solFieldFileNames) const { - MEDCoupling::MeshFormatReader reader(meshFormatIn, solFieldFileNames); + MEDCoupling::MeshFormatReader reader(meshFormatIn, solFieldFileNames); - MEDCoupling::MCAuto mfd = reader.loadInMedFileDS(); - // write MED - MEDCoupling::MEDFileMeshes* meshes = mfd->getMeshes(); - MEDCoupling::MEDFileMesh* fileMesh = meshes->getMeshAtPos(0); // ok only one mesh in file! - fileMesh->setName(meshNameOut); - restoreGroupsAndFams(fileMesh); - mfd->write(medFileOut, 2); + MEDCoupling::MCAuto mfd = reader.loadInMedFileDS(); + // write MED + MEDCoupling::MEDFileMeshes* meshes = mfd->getMeshes(); + MEDCoupling::MEDFileMesh* fileMesh = meshes->getMeshAtPos(0); // ok only one mesh in file! + fileMesh->setName(meshNameOut); + restoreGroupsAndFams(fileMesh); + mfd->write(medFileOut, 2); } - void MgAdapt::storeGroupsAndFams(MEDCoupling::MEDFileMesh* fileMesh) { - storefams(fileMesh); - storeGroups(fileMesh); + storefams(fileMesh); + storeGroups(fileMesh); } void MgAdapt::restoreGroupsAndFams(MEDCoupling::MEDFileMesh* fileMesh) const { - restorefams(fileMesh); - restoreGroups(fileMesh); + restorefams(fileMesh); + restoreGroups(fileMesh); } void MgAdapt::storeGroups(MEDCoupling::MEDFileMesh* fileMesh) { - std::map > grpFams = fileMesh->getGroupInfo(); - std::map >::iterator g2ff = grpFams.begin(); + std::map > grpFams = fileMesh->getGroupInfo(); + std::map >::iterator g2ff = grpFams.begin(); - for ( ; g2ff != grpFams.end(); ++g2ff ) + for ( ; g2ff != grpFams.end(); ++g2ff ) + { + std::string groupName = g2ff->first; + std::vector famNames = g2ff->second; + + if ( famNames.empty() ) continue; + std::size_t k = 0; + std::vector< mcIdType> famListId; + for ( size_t i = 0; i < famNames.size(); ++i ) { - std::string groupName = g2ff->first; - std::vector famNames = g2ff->second; - - if ( famNames.empty() ) continue; - std::size_t k = 0; - std::vector< mcIdType> famListId; - for ( size_t i = 0; i < famNames.size(); ++i ) - { - famListId.push_back( fileMesh->getFamilyId( famNames[i].c_str() ) ); - } - group grp(groupName, famListId, famNames); - groupVec.push_back(grp); + famListId.push_back( fileMesh->getFamilyId( famNames[i].c_str() ) ); } + group grp(groupName, famListId, famNames); + groupVec.push_back(grp); + } } void MgAdapt::storefams(MEDCoupling::MEDFileMesh* fileMesh) { - std::map grpFams = fileMesh->getFamilyInfo(); - std::map::iterator f = grpFams.begin(); + std::map grpFams = fileMesh->getFamilyInfo(); + std::map::iterator f = grpFams.begin(); - for ( ; f != grpFams.end(); ++f ) - { - if(!f->second) continue; // FAMILLE_ZERO - family fs(f->first, f->second); - famVec.push_back(fs); - } + for ( ; f != grpFams.end(); ++f ) + { + if(!f->second) continue; // FAMILLE_ZERO + family fs(f->first, f->second); + famVec.push_back(fs); + } } void MgAdapt::restorefams(MEDCoupling::MEDFileMesh* fileMesh) const { - std::vector::const_iterator fIt = famVec.begin(); + std::vector::const_iterator fIt = famVec.begin(); - for (; fIt!=famVec.end(); ++fIt) + for (; fIt!=famVec.end(); ++fIt) + { + try // { - try // - { - std::string givenFamNameFromMeshGemConverter = fileMesh->getFamilyNameGivenId( std::abs(fIt->_famId) ); - fileMesh->changeFamilyId(std::abs(fIt->_famId), fIt->_famId); - fileMesh->changeFamilyName(givenFamNameFromMeshGemConverter, fIt->_famName); - } - catch (const std::exception& e) - { - std::cerr<getFamilyNameGivenId( std::abs(fIt->_famId) ); + fileMesh->changeFamilyId(std::abs(fIt->_famId), fIt->_famId); + fileMesh->changeFamilyName(givenFamNameFromMeshGemConverter, fIt->_famName); } + catch (const std::exception& e) + { + std::cerr< > info; - std::vector ::const_iterator grpFams = groupVec.begin(); + std::map > info; + std::vector ::const_iterator grpFams = groupVec.begin(); - for (; grpFams!=groupVec.end(); ++grpFams) - { - info.insert(std::pair > (grpFams->_name, grpFams->_famNames) ); - } + for (; grpFams!=groupVec.end(); ++grpFams) + { + info.insert(std::pair > (grpFams->_name, grpFams->_famNames) ); + } - fileMesh->setGroupInfo(info); + fileMesh->setGroupInfo(info); } void MgAdapt::buildConstantSizeMapSolFile(const std::string& solFormatFieldFileName, const int dim, const int version, const mcIdType nbNodes) const { - MeshFormat::Localizer loc; - MeshFormat::MeshFormatParser writer; - int fileId = writer.GmfOpenMesh( solFormatFieldFileName.c_str(), GmfWrite, version, dim); - int typTab[] = {GmfSca}; - writer.GmfSetKwd(fileId, MeshFormat::GmfSolAtVertices, (int)nbNodes, 1, typTab); - for (mcIdType i = 0; i& fieldFileNames, const std::string& meshFormatsizeMapFile) const { - MEDCoupling::MCAuto tmpMfd = MEDCoupling::MEDFileData::New(sizeMapFile); - MEDCoupling::MEDFileFields* tmpFields = tmpMfd->getFields(); - MEDCoupling::MEDFileAnyTypeFieldMultiTS* fts = tmpFields->getFieldWithName(fieldName); - MEDCoupling::MCAuto fts1 = dynamic_cast(fts); - MEDCoupling::MCAuto f = fts1->getTimeStep(timeStep, rank); - MEDCoupling::MCAuto tmFts = MEDCoupling::MEDFileFieldMultiTS::New(); - tmFts->pushBackTimeStep(f); + MEDCoupling::MCAuto tmpMfd = MEDCoupling::MEDFileData::New(sizeMapFile); + MEDCoupling::MEDFileFields* tmpFields = tmpMfd->getFields(); + MEDCoupling::MEDFileAnyTypeFieldMultiTS* fts = tmpFields->getFieldWithName(fieldName); + MEDCoupling::MCAuto fts1 = dynamic_cast(fts); + MEDCoupling::MCAuto f = fts1->getTimeStep(timeStep, rank); + MEDCoupling::MCAuto tmFts = MEDCoupling::MEDFileFieldMultiTS::New(); + tmFts->pushBackTimeStep(f); - MEDCoupling::MCAuto tmp_fields = MEDCoupling::MEDFileFields::New(); - tmp_fields->pushField(tmFts); + MEDCoupling::MCAuto tmp_fields = MEDCoupling::MEDFileFields::New(); + tmp_fields->pushField(tmFts); - - tmpMfd->setFields( tmp_fields ); - MEDCoupling::MeshFormatWriter tmpWriter; - tmpWriter.setMeshFileName(meshFormatsizeMapFile); - tmpWriter.setFieldFileNames( fieldFileNames); - tmpWriter.setMEDFileDS(tmpMfd); - tmpWriter.write(); + tmpMfd->setFields( tmp_fields ); + MEDCoupling::MeshFormatWriter tmpWriter; + tmpWriter.setMeshFileName(meshFormatsizeMapFile); + tmpWriter.setFieldFileNames( fieldFileNames); + tmpWriter.setMEDFileDS(tmpMfd); + tmpWriter.write(); } // ======================================================================= med_idt MgAdapt::openMedFile(const std::string aFile) // ======================================================================= // renvoie le medId associe au fichier Med apres ouverture { - med_idt medIdt = MEDfileOpen(aFile.c_str(),MED_ACC_RDONLY); - if (medIdt <0) - { - //~addMessage( ToComment(" error: Can't open ") << aFile, /*fatal=*/true ); - ; - } - return medIdt; + med_idt medIdt = MEDfileOpen(aFile.c_str(),MED_ACC_RDONLY); + if (medIdt <0) + { + //~addMessage( ToComment(" error: Can't open ") << aFile, /*fatal=*/true ); + ; + } + return medIdt; } MgAdapt::Status MgAdapt::addMessage(const std::string& msg, - const bool isFatal/*=false*/) + const bool isFatal/*=false*/) { - if ( isFatal ) - _myErrorMessages.clear(); // warnings are useless if a fatal error encounters + if ( isFatal ) + _myErrorMessages.clear(); // warnings are useless if a fatal error encounters - _myErrorMessages.push_back( msg ); + _myErrorMessages.push_back( msg ); - //~MESSAGE(msg); +//~MESSAGE(msg); #ifdef _DEBUG_ - std::cout << msg << std::endl; + std::cout << msg << std::endl; #endif - return ( _myStatus = isFatal ? MgAdapt::DRS_FAIL : MgAdapt::DRS_WARN_SKIP_ELEM ); + return ( _myStatus = isFatal ? MgAdapt::DRS_FAIL : MgAdapt::DRS_WARN_SKIP_ELEM ); } - - - // ======================================================================= void MgAdapt::getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit) // ======================================================================= { // Il faut voir si plusieurs maillages - - herr_t erreur = 0 ; - med_idt medIdt ; + herr_t erreur = 0 ; + med_idt medIdt ; - // Ouverture du fichier - //~SCRUTE(aFile.toStdString()); - medIdt = openMedFile(aFile); - if ( medIdt < 0 ) return ; - // Lecture du nombre de champs - med_int ncha = MEDnField(medIdt) ; - if (ncha < 1 ) - { - //~addMessage( ToComment(" error: there is no field in ") << aFile, /*fatal=*/true ); - return; - } - // Lecture des caracteristiques du champs + // Ouverture du fichier + //~SCRUTE(aFile.toStdString()); + medIdt = openMedFile(aFile); + if ( medIdt < 0 ) return ; + // Lecture du nombre de champs + med_int ncha = MEDnField(medIdt) ; + if (ncha < 1 ) + { + //~addMessage( ToComment(" error: there is no field in ") << aFile, /*fatal=*/true ); + return; + } + // Lecture des caracteristiques du champs - // Lecture du type du champ, des noms des composantes et du nom de l'unite - char nomcha [MED_NAME_SIZE+1]; - strcpy(nomcha, fieldName.c_str()); + // Lecture du type du champ, des noms des composantes et du nom de l'unite + char nomcha [MED_NAME_SIZE+1]; + strcpy(nomcha, fieldName.c_str()); // Lecture du nombre de composantes - med_int ncomp = MEDfieldnComponentByName(medIdt, nomcha); - char meshname[MED_NAME_SIZE+1]; - char * comp = (char*) malloc(ncomp*MED_SNAME_SIZE+1); - char * unit = (char*) malloc(ncomp*MED_SNAME_SIZE+1); - char dtunit[MED_SNAME_SIZE+1]; - med_bool local; - med_field_type typcha; - med_int nbofcstp; - erreur = MEDfieldInfoByName (medIdt, nomcha, meshname,&local,&typcha,comp,unit,dtunit, &nbofcstp); - free(comp); - free(unit); - if ( erreur < 0 ) + med_int ncomp = MEDfieldnComponentByName(medIdt, nomcha); + char meshname[MED_NAME_SIZE+1]; + char * comp = (char*) malloc(ncomp*MED_SNAME_SIZE+1); + char * unit = (char*) malloc(ncomp*MED_SNAME_SIZE+1); + char dtunit[MED_SNAME_SIZE+1]; + med_bool local; + med_field_type typcha; + med_int nbofcstp; + erreur = MEDfieldInfoByName (medIdt, nomcha, meshname,&local,&typcha,comp,unit,dtunit, &nbofcstp); + free(comp); + free(unit); + if ( erreur < 0 ) + { + //~addMessage( ToComment(" error: error while reading field ") << nomcha << " in file " << aFile , /*fatal=*/true ); + return; + } + + med_float dt; + med_int tmp_numdt, tmp_numit; + + //~med_int step = data->myUseLastTimeStep ? nbofcstp : data->myTimeStep+1; + //~myPrint("step ", step); + erreur = MEDfieldComputingStepInfo ( medIdt, nomcha, 1, &numdt, &numit, &dt ); + for(med_int step = 1; step <= nbofcstp; step++ ) + { + erreur = MEDfieldComputingStepInfo ( medIdt, nomcha, step, &tmp_numdt, &tmp_numit, &dt ); + if(tmp_numdt > numdt) { - //~addMessage( ToComment(" error: error while reading field ") << nomcha << " in file " << aFile , /*fatal=*/true ); - return; + numdt = tmp_numdt; + numit = tmp_numit; } + } + if ( erreur < 0 ) + { + //~addMessage( ToComment(" error: error while reading field ") << nomcha << "step (numdt, numit) = " <<"("<< numdt<< ", " \ + numit<< ")" <<" in file " << aFile , /*fatal=*/true ); + return; + } - med_float dt; - med_int tmp_numdt, tmp_numit; - - //~med_int step = data->myUseLastTimeStep ? nbofcstp : data->myTimeStep+1; - //~myPrint("step ", step); - erreur = MEDfieldComputingStepInfo ( medIdt, nomcha, 1, &numdt, &numit, &dt ); - for(med_int step = 1; step <= nbofcstp; step++ ) - { - erreur = MEDfieldComputingStepInfo ( medIdt, nomcha, step, &tmp_numdt, &tmp_numit, &dt ); - if(tmp_numdt > numdt) - { - numdt = tmp_numdt; - numit = tmp_numit; - } - } - if ( erreur < 0 ) - { - - //~addMessage( ToComment(" error: error while reading field ") << nomcha << "step (numdt, numit) = " <<"("<< numdt<< ", " \ - numit<< ")" <<" in file " << aFile , /*fatal=*/true ); - return; - } - - - - // Fermeture du fichier - if ( medIdt > 0 ) MEDfileClose(medIdt); - + // Fermeture du fichier + if ( medIdt > 0 ) MEDfileClose(medIdt); } void MgAdapt::updateTimeStepRank() { - med_int arank; - med_int tmst; - if (myUseNoTimeStep) - { - arank = MED_NO_IT; - tmst = MED_NO_DT ; - setRankTimeStep((int)tmst, (int)arank); - } - else if (myUseLastTimeStep) - { - std::string fieldFile = useBackgroundMap ? sizeMapFile : medFileIn; - getTimeStepInfos(fieldFile, tmst, arank); - setRankTimeStep((int)tmst, (int)arank); - } + med_int arank; + med_int tmst; + if (myUseNoTimeStep) + { + arank = MED_NO_IT; + tmst = MED_NO_DT ; + setRankTimeStep((int)tmst, (int)arank); + } + else if (myUseLastTimeStep) + { + std::string fieldFile = useBackgroundMap ? sizeMapFile : medFileIn; + getTimeStepInfos(fieldFile, tmst, arank); + setRankTimeStep((int)tmst, (int)arank); + } } diff --git a/src/SMESH/MG_ADAPT.hxx b/src/SMESH/MG_ADAPT.hxx index c97ad15d3..887d6dc25 100644 --- a/src/SMESH/MG_ADAPT.hxx +++ b/src/SMESH/MG_ADAPT.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -14,9 +14,9 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// File : MG_ADAPT.hxx +// File : MG_ADAPT.hxx // #ifndef MG_ADAPT_HXX #define MG_ADAPT_HXX @@ -40,22 +40,21 @@ namespace MG_ADAPT{ class MgAdapt; typedef std::map< std::string, std::string > TOptionValues; -typedef std::set< std::string > TOptionNames; +typedef std::set< std::string > TOptionNames; struct MgAdaptHypothesisData { - std::string myFileInDir, myMeshFileIn, myInMeshName, myMeshFileBackground, myOutMeshName, - myMeshFileOut, myFileOutDir, myFileSizeMapDir, myFieldName; - bool fromMedFile; - bool myPublish, myMeshOutMed; - bool myUseLocalMap, myUseBackgroundMap, myUseConstantValue; - double myConstantValue; - int myRank, myTimeStep; - bool myUseNoTimeStep, myUseLastTimeStep, myUseChosenTimeStep; - std::string myWorkingDir, myLogFile; - bool myPrintLogInFile, myKeepFiles, myRemoveLogOnSuccess; - int myVerboseLevel; - + std::string myFileInDir, myMeshFileIn, myInMeshName, myMeshFileBackground, myOutMeshName, + myMeshFileOut, myFileOutDir, myFileSizeMapDir, myFieldName; + bool fromMedFile; + bool myPublish, myMeshOutMed; + bool myUseLocalMap, myUseBackgroundMap, myUseConstantValue; + double myConstantValue; + int myRank, myTimeStep; + bool myUseNoTimeStep, myUseLastTimeStep, myUseChosenTimeStep; + std::string myWorkingDir, myLogFile; + bool myPrintLogInFile, myKeepFiles, myRemoveLogOnSuccess; + int myVerboseLevel; }; class outFileStream : public std::ofstream{ @@ -68,43 +67,43 @@ public: */ class ToComment : public std::string { - std::ostringstream _s ; + std::ostringstream _s ; public : - ToComment():std::string("") {} + ToComment():std::string("") {} - ToComment(const ToComment& c):std::string() { - _s << c.c_str() ; - this->std::string::operator=( _s.str() ); - } + ToComment(const ToComment& c):std::string() { + _s << c.c_str() ; + this->std::string::operator=( _s.str() ); + } - ToComment & operator=(const ToComment& c) { - _s << c.c_str() ; - this->std::string::operator=( _s.str() ); - return *this; - } + ToComment & operator=(const ToComment& c) { + _s << c.c_str() ; + this->std::string::operator=( _s.str() ); + return *this; + } - template - ToComment( const T &anything ) { - _s << anything ; - this->std::string::operator=( _s.str() ); - } + template + ToComment( const T &anything ) { + _s << anything ; + this->std::string::operator=( _s.str() ); + } - template - ToComment & operator<<( const T &anything ) { - _s << anything ; - this->std::string::operator=( _s.str() ); - return *this ; - } + template + ToComment & operator<<( const T &anything ) { + _s << anything ; + this->std::string::operator=( _s.str() ); + return *this ; + } - operator char*() const { - return (char*)c_str(); - } + operator char*() const { + return (char*)c_str(); + } - std::ostream& Stream() { - return _s; - } + std::ostream& Stream() { + return _s; + } }; @@ -113,227 +112,223 @@ class MgAdapt public: - MgAdapt(); - MgAdapt(MgAdaptHypothesisData*); - MgAdapt(const MgAdapt&); - ~MgAdapt(); - void buildModel(); - void setData( MgAdaptHypothesisData* data); + MgAdapt(); + MgAdapt(MgAdaptHypothesisData*); + MgAdapt(const MgAdapt&); + ~MgAdapt(); + void buildModel(); + void setData( MgAdaptHypothesisData* data); - void setMedFileIn(std::string fileName); - std::string getMedFileIn(); + void setMedFileIn(std::string fileName); + std::string getMedFileIn(); - void setMedFileOut(std::string fileOut); - std::string getMedFileOut(); + void setMedFileOut(std::string fileOut); + std::string getMedFileOut(); - void setMeshName(std::string name); - std::string getMeshName(); + void setMeshName(std::string name); + std::string getMeshName(); - void setMeshNameOut(std::string name); - std::string getMeshNameOut(); + void setMeshNameOut(std::string name); + std::string getMeshNameOut(); - void setMeshOutMed(bool mybool); - bool getMeshOutMed(); + void setMeshOutMed(bool mybool); + bool getMeshOutMed(); - void setPublish(bool mybool); - bool getPublish(); + void setPublish(bool mybool); + bool getPublish(); - void setFieldName(std::string myFieldName); - std::string getFieldName(); + void setFieldName(std::string myFieldName); + std::string getFieldName(); - void setTimeStep(int time); - int getTimeStep() const; + void setTimeStep(int time); + int getTimeStep() const; - void setRankTimeStep(int time, int myRank); - int getRank(); - - void setTimeStepRankLast(); - void setNoTimeStep(); - void setChosenTimeStepRank(); - void updateTimeStepRank(); - - void setLogFile(std::string); - std::string getLogFile(); + void setRankTimeStep(int time, int myRank); + int getRank(); - void setVerbosityLevel(int verbosity); - int getVerbosityLevel(); + void setTimeStepRankLast(); + void setNoTimeStep(); + void setChosenTimeStepRank(); + void updateTimeStepRank(); - void setRemoveOnSuccess(bool mybool); - bool getRemoveOnSuccess(); + void setLogFile(std::string); + std::string getLogFile(); - MgAdaptHypothesisData* getData() const; + void setVerbosityLevel(int verbosity); + int getVerbosityLevel(); - void setUseLocalMap(bool mybool); - bool getUseLocalMap(); + void setRemoveOnSuccess(bool mybool); + bool getRemoveOnSuccess(); - void setUseBackgroundMap(bool mybool); - bool getUseBackgroundMap(); + MgAdaptHypothesisData* getData() const; - void setUseConstantValue(bool mybool); - bool getUseConstantValue(); + void setUseLocalMap(bool mybool); + bool getUseLocalMap(); - void setConstantValue(double cnst); - double getConstantValue() const; + void setUseBackgroundMap(bool mybool); + bool getUseBackgroundMap(); - void setSizeMapFile(std::string mapFile); - std::string getSizeMapFile(); + void setUseConstantValue(bool mybool); + bool getUseConstantValue(); - void setFromMedFile(bool mybool); - bool isFromMedFile(); + void setConstantValue(double cnst); + double getConstantValue() const; - void setKeepWorkingFiles(bool mybool); - bool getKeepWorkingFiles(); + void setSizeMapFile(std::string mapFile); + std::string getSizeMapFile(); - void setPrintLogInFile(bool mybool); - bool getPrintLogInFile(); + void setFromMedFile(bool mybool); + bool isFromMedFile(); - void setWorkingDir(std::string dir); - std::string getWorkingDir() const; + void setKeepWorkingFiles(bool mybool); + bool getKeepWorkingFiles(); + + void setPrintLogInFile(bool mybool); + bool getPrintLogInFile(); + + void setWorkingDir(std::string dir); + std::string getWorkingDir() const; - bool setAll(); - static std::string getCommandToRun(MgAdapt* ); - std::string getCommandToRun() ; - int compute(std::string& errStr); - std::string getFileName() const; - static std::string getExeName(); - void copyMgAdaptHypothesisData( const MgAdaptHypothesisData* from) ; + bool setAll(); + static std::string getCommandToRun(MgAdapt* ); + std::string getCommandToRun() ; + int compute(std::string& errStr); + std::string getFileName() const; + static std::string getExeName(); + void copyMgAdaptHypothesisData( const MgAdaptHypothesisData* from) ; - void checkDirPath(std::string& dirPath); + void checkDirPath(std::string& dirPath); - bool hasOptionDefined( const std::string& optionName ) const; - void setOptionValue(const std::string& optionName, - const std::string& optionValue) throw (std::invalid_argument); - std::string getOptionValue(const std::string& optionName, - bool* isDefault=0) const throw (std::invalid_argument); - std::vector getCustomOptionValuesStrVec() const; - std::vector getOptionValuesStrVec() const; + bool hasOptionDefined( const std::string& optionName ) const; + void setOptionValue(const std::string& optionName, + const std::string& optionValue) throw (std::invalid_argument); + std::string getOptionValue(const std::string& optionName, + bool* isDefault=0) const throw (std::invalid_argument); + std::vector getCustomOptionValuesStrVec() const; + std::vector getOptionValuesStrVec() const; - TOptionValues getOptionValues() const; - const TOptionValues& getCustomOptionValues() const ; - static double toDbl(const std::string&, bool* isOk = 0) throw (std::invalid_argument); - static bool toBool(const std::string&, bool* isOk = 0) throw (std::invalid_argument); - static int toInt(const std::string&, bool* isOk = 0 ) throw (std::invalid_argument); - static std::string toLowerStr(const std::string& str); + TOptionValues getOptionValues() const; + const TOptionValues& getCustomOptionValues() const ; + static double toDbl(const std::string&, bool* isOk = 0) throw (std::invalid_argument); + static bool toBool(const std::string&, bool* isOk = 0) throw (std::invalid_argument); + static int toInt(const std::string&, bool* isOk = 0 ) throw (std::invalid_argument); + static std::string toLowerStr(const std::string& str); + /* default values */ + static std::string defaultWorkingDirectory(); + static std::string defaultLogFile(); + static bool defaultKeepFiles(); + static bool defaultRemoveLogOnSuccess(); + static int defaultVerboseLevel(); + static bool defaultPrintLogInFile(); + static bool defaultFromMedFile(); + static bool defaultMeshOutMed(); + static bool defaultPublish(); + static bool defaultUseLocalMap(); + static bool defaultUseBackgroundMap(); + static bool defaultUseConstantValue(); + static bool defaultUseNoTimeStep(); + static bool defaultUseLastTimeStep(); + static bool defaultUseChosenTimeStep(); + static double defaultMaximumMemory(); + static bool isFileExist(const std::string& fName); - /* default values */ - static std::string defaultWorkingDirectory(); - static std::string defaultLogFile(); - static bool defaultKeepFiles(); - static bool defaultRemoveLogOnSuccess(); - static int defaultVerboseLevel(); - static bool defaultPrintLogInFile(); - static bool defaultFromMedFile(); - static bool defaultMeshOutMed(); - static bool defaultPublish(); - static bool defaultUseLocalMap(); - static bool defaultUseBackgroundMap(); - static bool defaultUseConstantValue(); - static bool defaultUseNoTimeStep(); - static bool defaultUseLastTimeStep(); - static bool defaultUseChosenTimeStep(); - static double defaultMaximumMemory(); - static bool isFileExist(const std::string& fName); + enum Status { + DRS_OK, + DRS_EMPTY, // a file contains no mesh with the given name + DRS_WARN_RENUMBER, // a file has overlapped ranges of element numbers, + // so the numbers from the file are ignored + DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data + DRS_WARN_DESCENDING, // some elements were skipped due to descending connectivity + DRS_FAIL, // general failure (exception etc.) + DRS_NO_TIME_STEP // general failure (exception etc.) + }; + struct group { + std::string _name; + std::vector _famListId; + std::vector _famNames; + group(std::string name, std::vector famListId, std::vector famNames):_name(name) + { + std::vector::iterator it = famListId.begin(); + for (; it!=famListId.end(); ++it) + _famListId.push_back(*it); + std::vector::iterator itt = famNames.begin(); + for (; itt!=famNames.end(); ++itt) + _famNames.push_back(*itt); + } + }; - enum Status { - DRS_OK, - DRS_EMPTY, // a file contains no mesh with the given name - DRS_WARN_RENUMBER, // a file has overlapped ranges of element numbers, - // so the numbers from the file are ignored - DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data - DRS_WARN_DESCENDING, // some elements were skipped due to descending connectivity - DRS_FAIL, // general failure (exception etc.) - DRS_NO_TIME_STEP // general failure (exception etc.) - }; - - struct group { - - std::string _name; - std::vector _famListId; - std::vector _famNames; - group(std::string name, std::vector famListId, std::vector famNames):_name(name) - { - std::vector::iterator it = famListId.begin(); - for (; it!=famListId.end(); ++it) - _famListId.push_back(*it); - - std::vector::iterator itt = famNames.begin(); - for (; itt!=famNames.end(); ++itt) - _famNames.push_back(*itt); - } - }; - - struct family { - std::string _famName; - mcIdType _famId; - family(std::string famName, MEDCoupling::mcIdType famId):_famName(famName), _famId(famId) {} - }; + struct family { + std::string _famName; + mcIdType _famId; + family(std::string famName, MEDCoupling::mcIdType famId):_famName(famName), _famId(famId) {} + }; private : - bool fromMedFile; + bool fromMedFile; - std::string medFileIn; - std::string medFileOut; - std::string meshName; - std::string meshNameOut; - bool publish, meshOutMed; - bool useLocalMap, useBackgroundMap, useConstantValue; - bool myUseLastTimeStep, myUseNoTimeStep, myUseChosenTimeStep; - std::string sizeMapFile; - std::string fieldName; - double constantValue; - int rank, timeStep; + std::string medFileIn; + std::string medFileOut; + std::string meshName; + std::string meshNameOut; + bool publish, meshOutMed; + bool useLocalMap, useBackgroundMap, useConstantValue; + bool myUseLastTimeStep, myUseNoTimeStep, myUseChosenTimeStep; + std::string sizeMapFile; + std::string fieldName; + double constantValue; + int rank, timeStep; - /* advanced options */ + /* advanced options */ - std::string logFile; - std::string workingDir; - int verbosityLevel; - bool removeOnSuccess; - bool toKeepWorkingFiles; - bool printLogInFile; + std::string logFile; + std::string workingDir; + int verbosityLevel; + bool removeOnSuccess; + bool toKeepWorkingFiles; + bool printLogInFile; - /* Model DATA */ - MgAdaptHypothesisData* data; + /* Model DATA */ + MgAdaptHypothesisData* data; - /* */ + /* */ - TOptionValues _option2value, _customOption2value; // user defined values - TOptionValues _defaultOptionValues; // default values - TOptionNames _doubleOptions, _charOptions, _boolOptions; // to find a type of option + TOptionValues _option2value, _customOption2value; // user defined values + TOptionValues _defaultOptionValues; // default values + TOptionNames _doubleOptions, _charOptions, _boolOptions; // to find a type of option - std::vector _myErrorMessages; - Status _myStatus; - std::string meshFormatOutputMesh; - std::vector< std::string> solFormatOutput; - std::vector groupVec; - std::vector famVec; - std::vector< std::string> tmpFilesToBeDeleted; + std::vector _myErrorMessages; + Status _myStatus; + std::string meshFormatOutputMesh; + std::vector< std::string> solFormatOutput; + std::vector groupVec; + std::vector famVec; + std::vector< std::string> tmpFilesToBeDeleted; - /* convert MED-->.mesh format */ - void convertMedFile(std::string& meshIn,std::string& solFileIn, std::string& sizeMapIn) ; - void storeGroups(MEDCoupling::MEDFileMesh* fileMesh); - void restoreGroups(MEDCoupling::MEDFileMesh* fileMesh) const; - void storefams(MEDCoupling::MEDFileMesh* fileMesh); - void restorefams(MEDCoupling::MEDFileMesh* fileMesh) const; - void storeGroupsAndFams(MEDCoupling::MEDFileMesh* fileMesh); - void restoreGroupsAndFams(MEDCoupling::MEDFileMesh* fileMesh) const; - void convertMeshFile(std::string& meshFormatIn, std::vector< std::string>& solFieldFileNames) const ; - void buildConstantSizeMapSolFile(const std::string& solFormatFieldFileName, const int dim, const int version, const mcIdType nbNodes) const; - void buildBackGroundMeshAndSolFiles(const std::vector& fieldFileNames, const std::string& meshFormatsizeMapFile) const; - void getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit); - Status addMessage(const std::string& msg, const bool isFatal = false); - med_idt openMedFile(const std::string aFile) ; - void execCmd( const char* cmd, int& err); - void cleanUp(); - void appendMsgToLogFile(std::string& msg); + /* convert MED-->.mesh format */ + void convertMedFile(std::string& meshIn,std::string& solFileIn, std::string& sizeMapIn) ; + void storeGroups(MEDCoupling::MEDFileMesh* fileMesh); + void restoreGroups(MEDCoupling::MEDFileMesh* fileMesh) const; + void storefams(MEDCoupling::MEDFileMesh* fileMesh); + void restorefams(MEDCoupling::MEDFileMesh* fileMesh) const; + void storeGroupsAndFams(MEDCoupling::MEDFileMesh* fileMesh); + void restoreGroupsAndFams(MEDCoupling::MEDFileMesh* fileMesh) const; + void convertMeshFile(std::string& meshFormatIn, std::vector< std::string>& solFieldFileNames) const ; + void buildConstantSizeMapSolFile(const std::string& solFormatFieldFileName, const int dim, const int version, const mcIdType nbNodes) const; + void buildBackGroundMeshAndSolFiles(const std::vector& fieldFileNames, const std::string& meshFormatsizeMapFile) const; + void getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit); + Status addMessage(const std::string& msg, const bool isFatal = false); + med_idt openMedFile(const std::string aFile) ; + void execCmd( const char* cmd, int& err); + void cleanUp(); + void appendMsgToLogFile(std::string& msg); }; } diff --git a/src/SMESHGUI/MG_ADAPTGUI.cxx b/src/SMESHGUI/MG_ADAPTGUI.cxx index 102e388a6..b2ab3b7d6 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.cxx +++ b/src/SMESHGUI/MG_ADAPTGUI.cxx @@ -95,88 +95,87 @@ const int MARGIN = 9; // layout margin SMESHGUI_MgAdaptDlg::SMESHGUI_MgAdaptDlg( SalomeApp_Module* theModule, SMESH::MG_ADAPT_ptr myModel, QWidget* parent, bool isCreation ) : mySMESHGUI( theModule ), QDialog(parent) { - //~model = new MgAdapt(*myModel); - model = SMESH::MG_ADAPT::_duplicate(myModel); - myData = model->getData(); - buildDlg(); - if (!isCreation) readParamsFromHypo(); + //~model = new MgAdapt(*myModel); + model = SMESH::MG_ADAPT::_duplicate(myModel); + myData = model->getData(); + buildDlg(); + if (!isCreation) readParamsFromHypo(); } -void SMESHGUI_MgAdaptDlg::buildDlg() +void SMESHGUI_MgAdaptDlg::buildDlg() { - setModal( false ); - setAttribute( Qt::WA_DeleteOnClose, true ); - setWindowTitle( tr( "ADAPT_PREF_MG_ADAPT" ) ); - setSizeGripEnabled( true ); + setModal( false ); + setAttribute( Qt::WA_DeleteOnClose, true ); + setWindowTitle( tr( "ADAPT_PREF_MG_ADAPT" ) ); + setSizeGripEnabled( true ); + + myTabWidget = new QTabWidget( this ); + + // Arguments + + myArgs = new SMESHGUI_MgAdaptArguments( myTabWidget ); + SMESH::str_array* str = model->getOptionValuesStrVec(); + SMESH::str_array* str2 = model->getCustomOptionValuesStrVec(); + std::vector s; + for (int i = 0; i< str->length(); i++) s.push_back( (*str)[i].in()); + for (int j = str->length(); j< str2->length(); j++) s.push_back((*str2)[ j - str->length() ].in() ); + //~str.insert( str.end(), str2.begin(), str2.end() ); + + myAdvOpt = new MgAdaptAdvWidget(myTabWidget, &s); + + int argsTab = myTabWidget->addTab( myArgs, tr( "Args" ) ); + int advTab = myTabWidget->addTab( myAdvOpt, tr( "ADVOP" ) ); + + myAdvOpt->workingDirectoryLabel ->setText (tr( "WORKING_DIR" )); + myAdvOpt->workingDirectoryPushButton ->setText (tr( "SELECT_DIR" )); + myAdvOpt->keepWorkingFilesCheck ->setText (tr( "KEEP_WORKING_FILES" )); + myAdvOpt->verboseLevelLabel ->setText (tr( "VERBOSE_LEVEL" )); + myAdvOpt->removeLogOnSuccessCheck ->setText (tr( "REMOVE_LOG_ON_SUCCESS" )); + myAdvOpt->logInFileCheck ->setText (tr( "LOG_IN_FILE" )); + myAdvOpt->logGroupBox ->setTitle(tr( "LOG_GROUP_TITLE" )); + + // buttons + QPushButton* okBtn = new QPushButton( tr( "SMESH_BUT_OK" ), this ); + okBtn->setAutoDefault( true ); + okBtn->setDefault( true ); + okBtn->setFocus(); + QPushButton* buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), this); + buttonApply->setAutoDefault(true); + QPushButton* buttonApplyAndClose = new QPushButton(tr("SMESH_BUT_APPLY_AND_CLOSE"), this); + buttonApplyAndClose->setAutoDefault(true); + QPushButton* cancelBtn = new QPushButton( tr( "SMESH_BUT_CANCEL" ), this ); + cancelBtn->setAutoDefault( true ); + QPushButton* helpBtn = new QPushButton( tr( "SMESH_BUT_HELP" ), this ); + helpBtn->setAutoDefault( true ); + + QHBoxLayout* btnLayout = new QHBoxLayout; + btnLayout->setSpacing( SPACING ); + btnLayout->setMargin( 0 ); + btnLayout->addWidget( buttonApplyAndClose ); + btnLayout->addStretch( 10 ); + btnLayout->addWidget( buttonApply ); + btnLayout->addStretch( 10 ); + btnLayout->addWidget( okBtn ); + btnLayout->addStretch( 10 ); + btnLayout->addWidget( cancelBtn ); + btnLayout->addStretch( 10 ); + btnLayout->addWidget( helpBtn ); + okBtn->hide(); // tab 1 + + QVBoxLayout* l = new QVBoxLayout ( this ); + l->setMargin( MARGIN ); + l->setSpacing( SPACING ); + l->addWidget( myTabWidget ); + l->addStretch(); + l->addLayout( btnLayout ); - myTabWidget = new QTabWidget( this ); - - // Arguments - - myArgs = new SMESHGUI_MgAdaptArguments( myTabWidget ); - SMESH::str_array* str = model->getOptionValuesStrVec(); - SMESH::str_array* str2 = model->getCustomOptionValuesStrVec(); - std::vector s; - for (int i = 0; i< str->length(); i++) s.push_back( (*str)[i].in()); - for (int j = str->length(); j< str2->length(); j++) s.push_back((*str2)[ j - str->length() ].in() ); - //~str.insert( str.end(), str2.begin(), str2.end() ); - - myAdvOpt = new MgAdaptAdvWidget(myTabWidget, &s); - - int argsTab = myTabWidget->addTab( myArgs, tr( "Args" ) ); - int advTab = myTabWidget->addTab( myAdvOpt, tr( "ADVOP" ) ); - - myAdvOpt->workingDirectoryLabel ->setText (tr( "WORKING_DIR" )); - myAdvOpt->workingDirectoryPushButton ->setText (tr( "SELECT_DIR" )); - myAdvOpt->keepWorkingFilesCheck ->setText (tr( "KEEP_WORKING_FILES" )); - myAdvOpt->verboseLevelLabel ->setText (tr( "VERBOSE_LEVEL" )); - myAdvOpt->removeLogOnSuccessCheck ->setText (tr( "REMOVE_LOG_ON_SUCCESS" )); - myAdvOpt->logInFileCheck ->setText (tr( "LOG_IN_FILE" )); - myAdvOpt->logGroupBox ->setTitle(tr( "LOG_GROUP_TITLE" )); - - // buttons - QPushButton* okBtn = new QPushButton( tr( "SMESH_BUT_OK" ), this ); - okBtn->setAutoDefault( true ); - okBtn->setDefault( true ); - okBtn->setFocus(); - QPushButton* buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), this); - buttonApply->setAutoDefault(true); - QPushButton* buttonApplyAndClose = new QPushButton(tr("SMESH_BUT_APPLY_AND_CLOSE"), this); - buttonApplyAndClose->setAutoDefault(true); - QPushButton* cancelBtn = new QPushButton( tr( "SMESH_BUT_CANCEL" ), this ); - cancelBtn->setAutoDefault( true ); - QPushButton* helpBtn = new QPushButton( tr( "SMESH_BUT_HELP" ), this ); - helpBtn->setAutoDefault( true ); - - QHBoxLayout* btnLayout = new QHBoxLayout; - btnLayout->setSpacing( SPACING ); - btnLayout->setMargin( 0 ); - btnLayout->addWidget( buttonApplyAndClose ); - btnLayout->addStretch( 10 ); - btnLayout->addWidget( buttonApply ); - btnLayout->addStretch( 10 ); - btnLayout->addWidget( okBtn ); - btnLayout->addStretch( 10 ); - btnLayout->addWidget( cancelBtn ); - btnLayout->addStretch( 10 ); - btnLayout->addWidget( helpBtn ); - okBtn->hide(); // tab 1 - - QVBoxLayout* l = new QVBoxLayout ( this ); - l->setMargin( MARGIN ); - l->setSpacing( SPACING ); - l->addWidget( myTabWidget ); - l->addStretch(); - l->addLayout( btnLayout ); - - - connect( okBtn, SIGNAL( clicked() ), this, SLOT( clickOnOk() ) ); - connect( helpBtn, SIGNAL( clicked() ), this, SLOT( clickOnHelp() ) ); - connect(cancelBtn, SIGNAL(clicked()), this, SLOT(reject())); - connect(buttonApply, SIGNAL(clicked()), this,SLOT(clickOnApply())); - connect(buttonApplyAndClose, SIGNAL(clicked()), this,SLOT(clickOnOk())); - connect(myArgs, SIGNAL(meshDimSignal(ADAPTATION_MODE)), myAdvOpt, SLOT( onMeshDimChanged(ADAPTATION_MODE)) ); + connect( okBtn, SIGNAL(clicked()), this, SLOT( clickOnOk() ) ); + connect( helpBtn, SIGNAL(clicked()), this, SLOT( clickOnHelp() ) ); + connect(cancelBtn, SIGNAL(clicked()), this, SLOT(reject())); + connect(buttonApply, SIGNAL(clicked()), this,SLOT(clickOnApply())); + connect(buttonApplyAndClose, SIGNAL(clicked()), this,SLOT(clickOnOk())); + connect(myArgs, SIGNAL(meshDimSignal(ADAPTATION_MODE)), myAdvOpt, SLOT( onMeshDimChanged(ADAPTATION_MODE)) ); } @@ -195,192 +194,190 @@ SMESHGUI_MgAdaptDlg::~SMESHGUI_MgAdaptDlg() //~} SMESH::MG_ADAPT_ptr SMESHGUI_MgAdaptDlg::getModel() const { - return model; + return model; } /*! - \brief Perform clean-up actions on the dialog box closing. +\brief Perform clean-up actions on the dialog box closing. */ bool SMESHGUI_MgAdaptDlg::clickOnApply() { - readParamsFromWidgets(); - return true; + readParamsFromWidgets(); + return true; } void SMESHGUI_MgAdaptDlg::clickOnOk() { - clickOnApply(); - reject(); + clickOnApply(); + reject(); } void SMESHGUI_MgAdaptDlg::reject() { - QDialog::reject(); + QDialog::reject(); } bool SMESHGUI_MgAdaptDlg::readParamsFromHypo( ) const { - bool ret = true; - myArgs->aMedfile->setChecked(myData->fromMedFile) ; - if (myData->fromMedFile) - { + bool ret = true; + myArgs->aMedfile->setChecked(myData->fromMedFile) ; + if (myData->fromMedFile) + { - *(myArgs->myFileInDir) = QString(myData->myFileInDir) ; - myArgs->selectMedFileLineEdit->setText(QString(myData->myMeshFileIn)) ; - // myData->myInMeshName = // TODO + *(myArgs->myFileInDir) = QString(myData->myFileInDir) ; + myArgs->selectMedFileLineEdit->setText(QString(myData->myMeshFileIn)) ; + // myData->myInMeshName = // TODO - } - else - { - myArgs->aBrowserObject->setText(QString(myData->myInMeshName)); - //~ myArgs->myFileInDir =""; // TODO - //~ myArgs->selectMedFileLineEdit->setText(); // TODO - } - myArgs->meshNameLineEdit->setText(QString(myData->myOutMeshName)); - myArgs->medFileCheckBox->setChecked(myData->myMeshOutMed); + } + else + { + myArgs->aBrowserObject->setText(QString(myData->myInMeshName)); + //~ myArgs->myFileInDir =""; // TODO + //~ myArgs->selectMedFileLineEdit->setText(); // TODO + } + myArgs->meshNameLineEdit->setText(QString(myData->myOutMeshName)); + myArgs->medFileCheckBox->setChecked(myData->myMeshOutMed); - if(myData->myMeshOutMed) - { - *(myArgs->myFileOutDir) = QString(myData->myFileOutDir); - myArgs->selectOutMedFileLineEdit->setText(QString(myData->myMeshFileOut)); + if(myData->myMeshOutMed) + { + *(myArgs->myFileOutDir) = QString(myData->myFileOutDir); + myArgs->selectOutMedFileLineEdit->setText(QString(myData->myMeshFileOut)); + } + else + { + *(myArgs->myFileOutDir) = QString(""); //TODO + } - } - else - { - *(myArgs->myFileOutDir) = QString(""); //TODO - } + myArgs->publishOut->setChecked(myData->myPublish); - myArgs->publishOut->setChecked(myData->myPublish); + myArgs->localButton->setChecked(myData->myUseLocalMap); + myArgs->backgroundButton->setChecked(myData->myUseBackgroundMap); + myArgs->constantButton->setChecked(myData->myUseConstantValue); - myArgs->localButton->setChecked(myData->myUseLocalMap); - myArgs->backgroundButton->setChecked(myData->myUseBackgroundMap); - myArgs->constantButton->setChecked(myData->myUseConstantValue); + if (myData->myUseConstantValue) + { + myArgs->dvalue->setValue(myData->myConstantValue); + } + else + { + myArgs->dvalue->setValue(0.0); + } - if (myData->myUseConstantValue) - { - myArgs->dvalue->setValue(myData->myConstantValue); - } - else - { - myArgs->dvalue->setValue(0.0); - } + if (myData->myUseBackgroundMap) + { - if (myData->myUseBackgroundMap) - { + *(myArgs->myFileSizeMapDir) = QString(myData->myFileSizeMapDir) ; + myArgs->selectMedFileBackgroundLineEdit->setText(QString(myData->myMeshFileBackground)); + } + else + { + *(myArgs->myFileSizeMapDir) = QString("") ; //TODO + myArgs->selectMedFileBackgroundLineEdit->setText(""); //TODO + } - *(myArgs->myFileSizeMapDir) = QString(myData->myFileSizeMapDir) ; - myArgs->selectMedFileBackgroundLineEdit->setText(QString(myData->myMeshFileBackground)); - } - else - { - *(myArgs->myFileSizeMapDir) = QString("") ; //TODO - myArgs->selectMedFileBackgroundLineEdit->setText(""); //TODO - } + myArgs->fieldNameCmb->setCurrentText(QString(myData->myFieldName)); + myArgs->noTimeStep->setChecked(myData->myUseNoTimeStep); + myArgs->lastTimeStep->setChecked( myData->myUseLastTimeStep); + myArgs->chosenTimeStep->setChecked(myData->myUseChosenTimeStep); + if (myData->myUseChosenTimeStep) + { + myArgs->rankSpinBox->setValue(myData->myRank); + myArgs->timeStep->setValue(myData->myTimeStep); + } - myArgs->fieldNameCmb->setCurrentText(QString(myData->myFieldName)); - myArgs->noTimeStep->setChecked(myData->myUseNoTimeStep); - myArgs->lastTimeStep->setChecked( myData->myUseLastTimeStep); - myArgs->chosenTimeStep->setChecked(myData->myUseChosenTimeStep); - if (myData->myUseChosenTimeStep) - { - myArgs->rankSpinBox->setValue(myData->myRank); - myArgs->timeStep->setValue(myData->myTimeStep); - } + myAdvOpt->workingDirectoryLineEdit->setText(QString(myData->myWorkingDir)); + myAdvOpt->logInFileCheck->setChecked(myData->myPrintLogInFile); - myAdvOpt->workingDirectoryLineEdit->setText(QString(myData->myWorkingDir)); - myAdvOpt->logInFileCheck->setChecked(myData->myPrintLogInFile); + myAdvOpt->verboseLevelSpin->setValue(myData->myVerboseLevel); + myAdvOpt->removeLogOnSuccessCheck->setChecked(myData->myRemoveLogOnSuccess); + myAdvOpt->keepWorkingFilesCheck->setChecked(myData->myKeepFiles); - myAdvOpt->verboseLevelSpin->setValue(myData->myVerboseLevel); - myAdvOpt->removeLogOnSuccessCheck->setChecked(myData->myRemoveLogOnSuccess); - myAdvOpt->keepWorkingFilesCheck->setChecked(myData->myKeepFiles); - - return ret; + return ret; } bool SMESHGUI_MgAdaptDlg::readParamsFromWidgets() { - bool ret = true; - SMESH::MgAdaptHypothesisData* aData = new SMESH::MgAdaptHypothesisData(); - aData->fromMedFile = myArgs->aMedfile->isChecked(); - if (aData->fromMedFile) - { + bool ret = true; + SMESH::MgAdaptHypothesisData* aData = new SMESH::MgAdaptHypothesisData(); + aData->fromMedFile = myArgs->aMedfile->isChecked(); + if (aData->fromMedFile) + { - aData->myFileInDir = CORBA::string_dup(myArgs->myFileInDir->toStdString().c_str()); - aData->myMeshFileIn = CORBA::string_dup(myArgs->selectMedFileLineEdit->text().toStdString().c_str()); - // aData->myInMeshName = // TODO - } - else // TODO browser - { - aData->myInMeshName = CORBA::string_dup(myArgs->aBrowserObject->text().toStdString().c_str()); - aData->myFileInDir = CORBA::string_dup(myAdvOpt->workingDirectoryLineEdit->text().toStdString().c_str()); + aData->myFileInDir = CORBA::string_dup(myArgs->myFileInDir->toStdString().c_str()); + aData->myMeshFileIn = CORBA::string_dup(myArgs->selectMedFileLineEdit->text().toStdString().c_str()); + // aData->myInMeshName = // TODO + } + else // TODO browser + { + aData->myInMeshName = CORBA::string_dup(myArgs->aBrowserObject->text().toStdString().c_str()); + aData->myFileInDir = CORBA::string_dup(myAdvOpt->workingDirectoryLineEdit->text().toStdString().c_str()); - TCollection_AsciiString aGenericName = (char*)aData->myFileInDir; - TCollection_AsciiString aGenericName2 = "MgAdapt_"; - aGenericName2 += getpid(); - aGenericName2 += "_"; - aGenericName2 += Abs((Standard_Integer)(long) aGenericName.ToCString()); - aGenericName2 += ".med"; - aGenericName+=aGenericName2; - emit myArgs->toExportMED(aGenericName.ToCString()); - aData->myMeshFileIn = aGenericName2.ToCString(); - } - aData->myOutMeshName = CORBA::string_dup(myArgs->meshNameLineEdit->text().toStdString().c_str()); - aData->myMeshOutMed = myArgs->medFileCheckBox->isChecked(); - if(aData->myMeshOutMed) - { - aData->myFileOutDir = CORBA::string_dup(myArgs->myFileOutDir->toStdString().c_str()); - aData->myMeshFileOut = CORBA::string_dup(myArgs->selectOutMedFileLineEdit->text().toStdString().c_str()); + TCollection_AsciiString aGenericName = (char*)aData->myFileInDir; + TCollection_AsciiString aGenericName2 = "MgAdapt_"; + aGenericName2 += getpid(); + aGenericName2 += "_"; + aGenericName2 += Abs((Standard_Integer)(long) aGenericName.ToCString()); + aGenericName2 += ".med"; + aGenericName+=aGenericName2; + emit myArgs->toExportMED(aGenericName.ToCString()); + aData->myMeshFileIn = aGenericName2.ToCString(); + } + aData->myOutMeshName = CORBA::string_dup(myArgs->meshNameLineEdit->text().toStdString().c_str()); + aData->myMeshOutMed = myArgs->medFileCheckBox->isChecked(); + if(aData->myMeshOutMed) + { + aData->myFileOutDir = CORBA::string_dup(myArgs->myFileOutDir->toStdString().c_str()); + aData->myMeshFileOut = CORBA::string_dup(myArgs->selectOutMedFileLineEdit->text().toStdString().c_str()); - } - else - { - aData->myMeshFileOut = ""; - } + } + else + { + aData->myMeshFileOut = ""; + } - aData->myPublish = myArgs->publishOut->isChecked(); + aData->myPublish = myArgs->publishOut->isChecked(); - aData->myUseLocalMap = myArgs->localButton->isChecked(); - aData->myUseBackgroundMap = myArgs->backgroundButton->isChecked(); - aData->myUseConstantValue = myArgs->constantButton->isChecked(); - if (aData->myUseConstantValue) - { - aData->myConstantValue = myArgs->dvalue->value(); - } - else - { - aData->myConstantValue = 0.0; - } - if (aData->myUseBackgroundMap) - { - aData->myFileSizeMapDir = CORBA::string_dup(myArgs->myFileSizeMapDir->toStdString().c_str()); - aData->myMeshFileBackground = CORBA::string_dup(myArgs->selectMedFileBackgroundLineEdit->text().toStdString().c_str()); - } - else - { - aData->myMeshFileBackground = ""; - } + aData->myUseLocalMap = myArgs->localButton->isChecked(); + aData->myUseBackgroundMap = myArgs->backgroundButton->isChecked(); + aData->myUseConstantValue = myArgs->constantButton->isChecked(); + if (aData->myUseConstantValue) + { + aData->myConstantValue = myArgs->dvalue->value(); + } + else + { + aData->myConstantValue = 0.0; + } + if (aData->myUseBackgroundMap) + { + aData->myFileSizeMapDir = CORBA::string_dup(myArgs->myFileSizeMapDir->toStdString().c_str()); + aData->myMeshFileBackground = CORBA::string_dup(myArgs->selectMedFileBackgroundLineEdit->text().toStdString().c_str()); + } + else + { + aData->myMeshFileBackground = ""; + } - aData->myFieldName = CORBA::string_dup(myArgs->fieldNameCmb->currentText().toStdString().c_str()); - aData->myUseNoTimeStep = myArgs->noTimeStep->isChecked(); - aData->myUseLastTimeStep = myArgs->lastTimeStep->isChecked(); - aData->myUseChosenTimeStep = myArgs->chosenTimeStep->isChecked(); - if (aData->myUseChosenTimeStep) - { - aData->myRank = myArgs->rankSpinBox->value(); - aData->myTimeStep = myArgs->timeStep->value(); + aData->myFieldName = CORBA::string_dup(myArgs->fieldNameCmb->currentText().toStdString().c_str()); + aData->myUseNoTimeStep = myArgs->noTimeStep->isChecked(); + aData->myUseLastTimeStep = myArgs->lastTimeStep->isChecked(); + aData->myUseChosenTimeStep = myArgs->chosenTimeStep->isChecked(); + if (aData->myUseChosenTimeStep) + { + aData->myRank = myArgs->rankSpinBox->value(); + aData->myTimeStep = myArgs->timeStep->value(); - } + } - - aData->myWorkingDir = CORBA::string_dup(myAdvOpt->workingDirectoryLineEdit->text().toStdString().c_str()); - aData->myPrintLogInFile = myAdvOpt->logInFileCheck->isChecked(); - aData->myVerboseLevel = myAdvOpt->verboseLevelSpin->value(); - aData->myRemoveLogOnSuccess = myAdvOpt->removeLogOnSuccessCheck->isChecked(); - aData->myKeepFiles = myAdvOpt->keepWorkingFilesCheck->isChecked(); - model->setData(*aData); - QString msg; - checkParams(msg); - delete aData; - return ret; + aData->myWorkingDir = CORBA::string_dup(myAdvOpt->workingDirectoryLineEdit->text().toStdString().c_str()); + aData->myPrintLogInFile = myAdvOpt->logInFileCheck->isChecked(); + aData->myVerboseLevel = myAdvOpt->verboseLevelSpin->value(); + aData->myRemoveLogOnSuccess = myAdvOpt->removeLogOnSuccessCheck->isChecked(); + aData->myKeepFiles = myAdvOpt->keepWorkingFilesCheck->isChecked(); + model->setData(*aData); + QString msg; + checkParams(msg); + delete aData; + return ret; } bool SMESHGUI_MgAdaptDlg::storeParamsToHypo( const SMESH::MgAdaptHypothesisData& ) const { @@ -391,59 +388,60 @@ bool SMESHGUI_MgAdaptDlg::storeParamsToHypo( const SMESH::MgAdaptHypothesisData& */ void SMESHGUI_MgAdaptDlg::clickOnHelp() { - // QString aHelpFile; - // if ( myTabWidget->currentIndex() == MinDistance ) { - // aHelpFile = "measurements.html#min-distance-anchor"; - // } else if ( myTabWidget->currentIndex() == BoundingBox ) { - // aHelpFile = "measurements.html#bounding-box-anchor"; - // } else if ( myTabWidget->currentWidget() == myAngle ) { - // aHelpFile = "measurements.html#angle-anchor"; - // } else { - // aHelpFile = "measurements.html#basic-properties-anchor"; - // } + // QString aHelpFile; + // if ( myTabWidget->currentIndex() == MinDistance ) { + // aHelpFile = "measurements.html#min-distance-anchor"; + // } else if ( myTabWidget->currentIndex() == BoundingBox ) { + // aHelpFile = "measurements.html#bounding-box-anchor"; + // } else if ( myTabWidget->currentWidget() == myAngle ) { + // aHelpFile = "measurements.html#angle-anchor"; + // } else { + // aHelpFile = "measurements.html#basic-properties-anchor"; + // } - // SMESH::ShowHelpFile( aHelpFile ); + // SMESH::ShowHelpFile( aHelpFile ); } bool SMESHGUI_MgAdaptDlg::checkParams(QString& msg) { - if ( !QFileInfo( myAdvOpt->workingDirectoryLineEdit->text().trimmed() ).isWritable() ) { - SUIT_MessageBox::warning( this, - tr( "SMESH_WRN_WARNING" ), - tr( "GHS3D_PERMISSION_DENIED" ) ); - return false; - } + if ( !QFileInfo( myAdvOpt->workingDirectoryLineEdit->text().trimmed() ).isWritable() ) + { + SUIT_MessageBox::warning( this, + tr( "SMESH_WRN_WARNING" ), + tr( "GHS3D_PERMISSION_DENIED" ) ); + return false; + } - myAdvOpt->myOptionTable->setFocus(); - QApplication::instance()->processEvents(); + myAdvOpt->myOptionTable->setFocus(); + QApplication::instance()->processEvents(); - QString name, value; - bool isDefault, ok = true; - int iRow = 0, nbRows = myAdvOpt->myOptionTable->topLevelItemCount(); - for ( ; iRow < nbRows; ++iRow ) + QString name, value; + bool isDefault, ok = true; + int iRow = 0, nbRows = myAdvOpt->myOptionTable->topLevelItemCount(); + for ( ; iRow < nbRows; ++iRow ) + { + QTreeWidgetItem* row = myAdvOpt->myOptionTable->topLevelItem( iRow ); + myAdvOpt->GetOptionAndValue( row, name, value, isDefault ); + + if ( name.simplified().isEmpty() ) + continue; // invalid custom option + + if ( isDefault ) // not selected option + value.clear(); + + try { - QTreeWidgetItem* row = myAdvOpt->myOptionTable->topLevelItem( iRow ); - myAdvOpt->GetOptionAndValue( row, name, value, isDefault ); - - if ( name.simplified().isEmpty() ) - continue; // invalid custom option - - if ( isDefault ) // not selected option - value.clear(); - - try { - model->setOptionValue( name.toLatin1().constData(), value.toLatin1().constData() ); - } - catch ( const SALOME::SALOME_Exception& ex ) - { - msg = ex.details.text.in(); - ok = false; - break; - } + model->setOptionValue( name.toLatin1().constData(), value.toLatin1().constData() ); } + catch ( const SALOME::SALOME_Exception& ex ) + { + msg = ex.details.text.in(); + ok = false; + break; + } + } - - return ok; + return ok; } //================================================================================= @@ -454,155 +452,153 @@ SMESHGUI_MgAdaptArguments::SMESHGUI_MgAdaptArguments( QWidget* parent ) :QWidget(parent) { + myFileInDir = new QString(""); + myFileOutDir = new QString(""); + myFileSizeMapDir = new QString(""); + if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() ) + { + *myFileInDir = QDir::currentPath(); + *myFileOutDir = QDir::currentPath(); + *myFileSizeMapDir = QDir::currentPath(); + } + else + { + *myFileInDir = SUIT_FileDlg::getLastVisitedPath(); + *myFileOutDir = SUIT_FileDlg::getLastVisitedPath(); + *myFileSizeMapDir = SUIT_FileDlg::getLastVisitedPath(); + } - myFileInDir = new QString(""); - myFileOutDir = new QString(""); - myFileSizeMapDir = new QString(""); - if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() ) - { - *myFileInDir = QDir::currentPath(); - *myFileOutDir = QDir::currentPath(); - *myFileSizeMapDir = QDir::currentPath(); - } - else - { - *myFileInDir = SUIT_FileDlg::getLastVisitedPath(); - *myFileOutDir = SUIT_FileDlg::getLastVisitedPath(); - *myFileSizeMapDir = SUIT_FileDlg::getLastVisitedPath(); - } + meshDim = 0; + // Mesh in + aMeshIn = new QGroupBox( tr( "MeshIn" ), this ); + aMedfile = new QRadioButton( tr( "MEDFile" ), aMeshIn ); + aBrowser = new QRadioButton( tr( "Browser" ), aMeshIn ); + aBrowserObject = new QLineEdit( aMeshIn ); + selectMedFilebutton = new QPushButton("", aMeshIn); + selectMedFileLineEdit = new QLineEdit( aMeshIn ); - meshDim = 0; - // Mesh in - aMeshIn = new QGroupBox( tr( "MeshIn" ), this ); - aMedfile = new QRadioButton( tr( "MEDFile" ), aMeshIn ); - aBrowser = new QRadioButton( tr( "Browser" ), aMeshIn ); - aBrowserObject = new QLineEdit( aMeshIn ); - selectMedFilebutton = new QPushButton("", aMeshIn); - selectMedFileLineEdit = new QLineEdit( aMeshIn ); + meshIn = new QGridLayout( aMeshIn ); - meshIn = new QGridLayout( aMeshIn ); + meshIn->setMargin( MARGIN ); + meshIn->setSpacing( SPACING ); + meshIn->addWidget( aMedfile, 0, 0, 1,1 ); + meshIn->addWidget( aBrowser, 0, 1,1,1); + meshIn->addWidget( aBrowserObject, 0, 2, 1, 1 ); + meshIn->addWidget( selectMedFilebutton, 1, 0,1, 1); + meshIn->addWidget( selectMedFileLineEdit, 1, 1, 1, 1 ); + hspacer = new QSpacerItem(188, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - meshIn->setMargin( MARGIN ); - meshIn->setSpacing( SPACING ); - meshIn->addWidget( aMedfile, 0, 0, 1,1 ); - meshIn->addWidget( aBrowser, 0, 1,1,1); - meshIn->addWidget( aBrowserObject, 0, 2, 1, 1 ); - meshIn->addWidget( selectMedFilebutton, 1, 0,1, 1); - meshIn->addWidget( selectMedFileLineEdit, 1, 1, 1, 1 ); - hspacer = new QSpacerItem(188, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + meshInGroup = new QButtonGroup( this ); + meshInGroup->addButton( aMedfile, 0 ); + meshInGroup->addButton( aBrowser, 1 ); - meshInGroup = new QButtonGroup( this ); - meshInGroup->addButton( aMedfile, 0 ); - meshInGroup->addButton( aBrowser, 1 ); + //Mesh out - //Mesh out + aMeshOut = new QGroupBox( tr( "MeshOut" ), this ); + meshName = new QLabel(tr("MeshName"), aMeshOut); + secondHspacer = new QSpacerItem(100, 30); + meshNameLineEdit = new QLineEdit(aMeshOut) ; + medFileCheckBox = new QCheckBox(tr("MEDFile"), aMeshOut); + selectOutMedFilebutton = new QPushButton("", aMeshOut); + thirdHspacer = new QSpacerItem(188, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + selectOutMedFileLineEdit = new QLineEdit(aMeshOut) ; + publishOut = new QCheckBox(tr("Publish_MG_ADAPT"), aMeshOut); - aMeshOut = new QGroupBox( tr( "MeshOut" ), this ); - meshName = new QLabel(tr("MeshName"), aMeshOut); - secondHspacer = new QSpacerItem(100, 30); - meshNameLineEdit = new QLineEdit(aMeshOut) ; - medFileCheckBox = new QCheckBox(tr("MEDFile"), aMeshOut); - selectOutMedFilebutton = new QPushButton("", aMeshOut); - thirdHspacer = new QSpacerItem(188, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - selectOutMedFileLineEdit = new QLineEdit(aMeshOut) ; - publishOut = new QCheckBox(tr("Publish_MG_ADAPT"), aMeshOut); + meshOut = new QGridLayout( aMeshOut ); - meshOut = new QGridLayout( aMeshOut ); + meshOut->setMargin( MARGIN ); + meshOut->setSpacing( SPACING ); + meshOut->addWidget( meshName, 0, 0, 1,1 ); + meshOut->addItem( secondHspacer, 0, 1, 1, 1 ); + meshOut->addWidget( meshNameLineEdit, 0, 2,1,1); + meshOut->addWidget( medFileCheckBox, 1, 0,1,1 ); + meshOut->addWidget( selectOutMedFilebutton, 1, 1,1,1 ); + meshOut->addWidget( selectOutMedFileLineEdit, 1, 2,1,1); + meshOut->addWidget( publishOut, 2, 0,1,1 ); - meshOut->setMargin( MARGIN ); - meshOut->setSpacing( SPACING ); - meshOut->addWidget( meshName, 0, 0, 1,1 ); - meshOut->addItem( secondHspacer, 0, 1, 1, 1 ); - meshOut->addWidget( meshNameLineEdit, 0, 2,1,1); - meshOut->addWidget( medFileCheckBox, 1, 0,1,1 ); - meshOut->addWidget( selectOutMedFilebutton, 1, 1,1,1 ); - meshOut->addWidget( selectOutMedFileLineEdit, 1, 2,1,1); - meshOut->addWidget( publishOut, 2, 0,1,1 ); + //size map definition - //size map definition + sizeMapDefinition = new QGroupBox(tr("SIZE_MAP_DEF"), this); + localButton = new QRadioButton(tr("LOCAL_MG_ADAPT"), sizeMapDefinition); + backgroundButton = new QRadioButton(tr("BACKGRND_MG_ADAPT"), sizeMapDefinition); + constantButton = new QRadioButton(tr("CNST_MG_ADAPT"), sizeMapDefinition); + medFileBackground = new QLabel(tr("MED_FILE_BCKG"), sizeMapDefinition); + selectMedFileBackgroundbutton = new QPushButton(tr(""), sizeMapDefinition); + selectMedFileBackgroundLineEdit = new QLineEdit(sizeMapDefinition); + valueLabel = new QLabel(tr("VALUE_MG_ADAPT"), sizeMapDefinition); + dvalue = new QDoubleSpinBox(sizeMapDefinition); + sizeMapDefGroup = new QButtonGroup( this ); + sizeMapDefGroup->addButton( localButton, 0 ); + sizeMapDefGroup->addButton( backgroundButton, 1 ); + sizeMapDefGroup->addButton( constantButton, 2 ); - sizeMapDefinition = new QGroupBox(tr("SIZE_MAP_DEF"), this); - localButton = new QRadioButton(tr("LOCAL_MG_ADAPT"), sizeMapDefinition); - backgroundButton = new QRadioButton(tr("BACKGRND_MG_ADAPT"), sizeMapDefinition); - constantButton = new QRadioButton(tr("CNST_MG_ADAPT"), sizeMapDefinition); - medFileBackground = new QLabel(tr("MED_FILE_BCKG"), sizeMapDefinition); - selectMedFileBackgroundbutton = new QPushButton(tr(""), sizeMapDefinition); - selectMedFileBackgroundLineEdit = new QLineEdit(sizeMapDefinition); - valueLabel = new QLabel(tr("VALUE_MG_ADAPT"), sizeMapDefinition); - dvalue = new QDoubleSpinBox(sizeMapDefinition); - sizeMapDefGroup = new QButtonGroup( this ); - sizeMapDefGroup->addButton( localButton, 0 ); - sizeMapDefGroup->addButton( backgroundButton, 1 ); - sizeMapDefGroup->addButton( constantButton, 2 ); + sizeMapDefGroupLayout = new QGridLayout(sizeMapDefinition); + sizeMapDefGroupLayout->addWidget(localButton, 0,0); + sizeMapDefGroupLayout->addWidget(backgroundButton, 0,1); + sizeMapDefGroupLayout->addWidget(constantButton, 0,2); + sizeMapDefGroupLayout->addWidget(medFileBackground, 1,0); + sizeMapDefGroupLayout->addWidget(selectMedFileBackgroundbutton, 1,1); + sizeMapDefGroupLayout->addWidget(selectMedFileBackgroundLineEdit, 1,2); + sizeMapDefGroupLayout->addWidget(valueLabel, 2,0); + sizeMapDefGroupLayout->addWidget(dvalue, 2,1); - sizeMapDefGroupLayout = new QGridLayout(sizeMapDefinition); - sizeMapDefGroupLayout->addWidget(localButton, 0,0); - sizeMapDefGroupLayout->addWidget(backgroundButton, 0,1); - sizeMapDefGroupLayout->addWidget(constantButton, 0,2); - sizeMapDefGroupLayout->addWidget(medFileBackground, 1,0); - sizeMapDefGroupLayout->addWidget(selectMedFileBackgroundbutton, 1,1); - sizeMapDefGroupLayout->addWidget(selectMedFileBackgroundLineEdit, 1,2); - sizeMapDefGroupLayout->addWidget(valueLabel, 2,0); - sizeMapDefGroupLayout->addWidget(dvalue, 2,1); + // size Map field + sizeMapField = new QGroupBox(tr("SIZE_MAP_FIELD"), this); + fieldName = new QLabel(tr("MG_ADAPT_FIELD_NAME"), sizeMapField); + fieldNameCmb = new QComboBox(sizeMapField); + noTimeStep = new QRadioButton(tr("MG_ADAPT_NO_T_ST"), sizeMapField); + lastTimeStep = new QRadioButton(tr("MG_ADAPT_L_ST"), sizeMapField); + chosenTimeStep = new QRadioButton(tr("MG_ADAPT_CH_ST"), sizeMapField); + timeStepLabel = new QLabel(tr("MG_ADAPT_TSTP"), sizeMapField); + timeStep = new QSpinBox(sizeMapField); + //~timeStep->setMinimum(-1); + rankLabel = new QLabel(tr("MG_ADAPT_RANK"), sizeMapField); + rankSpinBox = new QSpinBox(sizeMapField); + rankSpinBox->setMinimum(-1); - // size Map field - sizeMapField = new QGroupBox(tr("SIZE_MAP_FIELD"), this); - fieldName = new QLabel(tr("MG_ADAPT_FIELD_NAME"), sizeMapField); - fieldNameCmb = new QComboBox(sizeMapField); - noTimeStep = new QRadioButton(tr("MG_ADAPT_NO_T_ST"), sizeMapField); - lastTimeStep = new QRadioButton(tr("MG_ADAPT_L_ST"), sizeMapField); - chosenTimeStep = new QRadioButton(tr("MG_ADAPT_CH_ST"), sizeMapField); - timeStepLabel = new QLabel(tr("MG_ADAPT_TSTP"), sizeMapField); - timeStep = new QSpinBox(sizeMapField); - //~timeStep->setMinimum(-1); - rankLabel = new QLabel(tr("MG_ADAPT_RANK"), sizeMapField); - rankSpinBox = new QSpinBox(sizeMapField); - rankSpinBox->setMinimum(-1); + timeStepGroup = new QButtonGroup(this); + timeStepGroup->addButton(noTimeStep, 0); + timeStepGroup->addButton(lastTimeStep, 1); + timeStepGroup->addButton(chosenTimeStep, 2); - timeStepGroup = new QButtonGroup(this); - timeStepGroup->addButton(noTimeStep, 0); - timeStepGroup->addButton(lastTimeStep, 1); - timeStepGroup->addButton(chosenTimeStep, 2); + sizeMapFieldGroupLayout = new QGridLayout(sizeMapField); - sizeMapFieldGroupLayout = new QGridLayout(sizeMapField); + sizeMapFieldGroupLayout->addWidget(fieldName, 0,0); + sizeMapFieldGroupLayout->addWidget(fieldNameCmb, 0,1); + sizeMapFieldGroupLayout->addWidget(noTimeStep, 1,0); + sizeMapFieldGroupLayout->addWidget(lastTimeStep, 1,1); + sizeMapFieldGroupLayout->addWidget(chosenTimeStep, 1,2); + sizeMapFieldGroupLayout->addWidget(timeStepLabel, 2,0); + sizeMapFieldGroupLayout->addWidget(timeStep, 2,1); + sizeMapFieldGroupLayout->addWidget(rankLabel, 2,2); + sizeMapFieldGroupLayout->addWidget(rankSpinBox, 2,3); - sizeMapFieldGroupLayout->addWidget(fieldName, 0,0); - sizeMapFieldGroupLayout->addWidget(fieldNameCmb, 0,1); - sizeMapFieldGroupLayout->addWidget(noTimeStep, 1,0); - sizeMapFieldGroupLayout->addWidget(lastTimeStep, 1,1); - sizeMapFieldGroupLayout->addWidget(chosenTimeStep, 1,2); - sizeMapFieldGroupLayout->addWidget(timeStepLabel, 2,0); - sizeMapFieldGroupLayout->addWidget(timeStep, 2,1); - sizeMapFieldGroupLayout->addWidget(rankLabel, 2,2); - sizeMapFieldGroupLayout->addWidget(rankSpinBox, 2,3); + QGridLayout* argumentsLayout = new QGridLayout( this ); + argumentsLayout->setMargin( MARGIN ); + argumentsLayout->setSpacing( SPACING ); + argumentsLayout->addWidget( aMeshIn, 0, 0, 1, 3 ); + argumentsLayout->addWidget( aMeshOut, 1, 0, 1, 3 ); + argumentsLayout->addWidget( sizeMapDefinition, 2, 0, 1, 3 ); + argumentsLayout->addWidget( sizeMapField, 3, 0, 1, 3 ); + argumentsLayout->setColumnStretch( 1, 5 ); + argumentsLayout->setRowStretch( 4, 5 ); - QGridLayout* argumentsLayout = new QGridLayout( this ); - argumentsLayout->setMargin( MARGIN ); - argumentsLayout->setSpacing( SPACING ); + // Initial state + setMode( Mesh, Local); + medFileCheckBox->setChecked(true); + visibleTimeStepRankLabel (false); - argumentsLayout->addWidget( aMeshIn, 0, 0, 1, 3 ); - argumentsLayout->addWidget( aMeshOut, 1, 0, 1, 3 ); - argumentsLayout->addWidget( sizeMapDefinition, 2, 0, 1, 3 ); - argumentsLayout->addWidget( sizeMapField, 3, 0, 1, 3 ); - argumentsLayout->setColumnStretch( 1, 5 ); - argumentsLayout->setRowStretch( 4, 5 ); - - // Initial state - setMode( Mesh, Local); - medFileCheckBox->setChecked(true); - visibleTimeStepRankLabel (false); - - // Connections - connect( meshInGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( modeChanged( int ) ) ); - connect( sizeMapDefGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( sizeMapDefChanged( int ) ) ); - connect( selectMedFilebutton, SIGNAL( pressed( ) ), this, SLOT( onSelectMedFilebuttonClicked( ) ) ); - connect( medFileCheckBox, SIGNAL (stateChanged(int)), this, SLOT(onMedFileCheckBox(int) ) ); - connect( publishOut, SIGNAL (stateChanged(int)), this, SLOT(onPublishOut(int) ) ); - connect( selectOutMedFilebutton, SIGNAL( pressed()), this, SLOT(onSelectOutMedFilebutton())); - connect( selectMedFileBackgroundbutton, SIGNAL(pressed()), this, SLOT(onSelectMedFileBackgroundbutton()) ); - connect( timeStepGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( timeStepGroupChanged( int ) ) ); - emit updateSelection(); + // Connections + connect( meshInGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( modeChanged( int ) ) ); + connect( sizeMapDefGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( sizeMapDefChanged( int ) ) ); + connect( selectMedFilebutton, SIGNAL( pressed( ) ), this, SLOT( onSelectMedFilebuttonClicked( ) ) ); + connect( medFileCheckBox, SIGNAL (stateChanged(int)), this, SLOT(onMedFileCheckBox(int) ) ); + connect( publishOut, SIGNAL (stateChanged(int)), this, SLOT(onPublishOut(int) ) ); + connect( selectOutMedFilebutton, SIGNAL( pressed()), this, SLOT(onSelectOutMedFilebutton())); + connect( selectMedFileBackgroundbutton, SIGNAL(pressed()), this, SLOT(onSelectMedFileBackgroundbutton()) ); + connect( timeStepGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( timeStepGroupChanged( int ) ) ); + emit updateSelection(); } //================================================================================= @@ -615,184 +611,177 @@ SMESHGUI_MgAdaptArguments::~SMESHGUI_MgAdaptArguments() void SMESHGUI_MgAdaptArguments::onNoTimeStep(bool disableOther) { - noTimeStep->setChecked(true); + noTimeStep->setChecked(true); - visibleTimeStepRankLabel (false); - rankSpinBox->setValue(-2); - timeStep->setValue(-2); + visibleTimeStepRankLabel (false); + rankSpinBox->setValue(-2); + timeStep->setValue(-2); - lastTimeStep->setDisabled(disableOther); - chosenTimeStep->setDisabled(disableOther); + lastTimeStep->setDisabled(disableOther); + chosenTimeStep->setDisabled(disableOther); } void SMESHGUI_MgAdaptArguments::onLastTimeStep(bool disableOther) { - lastTimeStep->setChecked(true); + lastTimeStep->setChecked(true); - visibleTimeStepRankLabel (false); - rankSpinBox->setValue(-1); - timeStep->setValue(-1); - noTimeStep->setDisabled(disableOther); + visibleTimeStepRankLabel (false); + rankSpinBox->setValue(-1); + timeStep->setValue(-1); + noTimeStep->setDisabled(disableOther); } void SMESHGUI_MgAdaptArguments::onChosenTimeStep(bool disableOther, int vmax) { - chosenTimeStep->setChecked(true); + chosenTimeStep->setChecked(true); - visibleTimeStepRankLabel (true); - rankSpinBox->setValue(0); - timeStep->setValue(0); - if (vmax) timeStep->setMaximum(vmax); + visibleTimeStepRankLabel (true); + rankSpinBox->setValue(0); + timeStep->setValue(0); + if (vmax) timeStep->setMaximum(vmax); } void SMESHGUI_MgAdaptArguments::visibleTimeStepRankLabel(bool visible) { - rankLabel->setVisible(visible); - rankSpinBox->setVisible(visible); + rankLabel->setVisible(visible); + rankSpinBox->setVisible(visible); - timeStepLabel->setVisible(visible); - timeStep->setVisible(visible); + timeStepLabel->setVisible(visible); + timeStep->setVisible(visible); } void SMESHGUI_MgAdaptArguments::onSelectOutMedFilebutton() { - QString filtre = QString("Med") ; - filtre += QString(" files (*.") + QString("med") + QString(");;"); - QString fileName = QFileDialog::getSaveFileName(this, tr("SAVE_MED"), - QString(""), filtre); - QFileInfo myFileInfo(fileName); - selectOutMedFileLineEdit->setText(myFileInfo.fileName()); - *myFileOutDir = myFileInfo.path(); + QString filtre = QString("Med") ; + filtre += QString(" files (*.") + QString("med") + QString(");;"); + QString fileName = QFileDialog::getSaveFileName(this, tr("SAVE_MED"), QString(""), filtre); + QFileInfo myFileInfo(fileName); + selectOutMedFileLineEdit->setText(myFileInfo.fileName()); + *myFileOutDir = myFileInfo.path(); } void SMESHGUI_MgAdaptArguments::onSelectMedFileBackgroundbutton() { - QString fileName0 = selectMedFileBackgroundbutton->text().trimmed(); + QString fileName0 = selectMedFileBackgroundbutton->text().trimmed(); - QString fileName = getMedFileName(false); - if (fileName != QString::null) + QString fileName = getMedFileName(false); + if (fileName != QString::null) + { + myFieldList = GetListeChamps(fileName); + if (myFieldList.empty()) { - myFieldList = GetListeChamps(fileName); - if (myFieldList.empty()) - { - fileName = fileName0; - fieldNameCmb->clear(); - } - else - { - // fill field name Combobox - fieldNameCmb->clear(); - std::map::const_iterator it; - for ( it=myFieldList.begin() ; it != myFieldList.end(); it++) - { - fieldNameCmb->insertItem(0,QString(it->first)); - int typeStepInField = it->second > 2 ? 2 : it->second ; - timeStepGroupChanged(typeStepInField, false); - } - - } - + fileName = fileName0; + fieldNameCmb->clear(); } else { - fileName = fileName0; - fieldNameCmb->clear(); + // fill field name Combobox + fieldNameCmb->clear(); + std::map::const_iterator it; + for ( it=myFieldList.begin() ; it != myFieldList.end(); it++) + { + fieldNameCmb->insertItem(0,QString(it->first)); + int typeStepInField = it->second > 2 ? 2 : it->second ; + timeStepGroupChanged(typeStepInField, false); + } } + } + else + { + fileName = fileName0; + fieldNameCmb->clear(); + } - QFileInfo myFileInfo(fileName); - *myFileSizeMapDir = myFileInfo.path(); - selectMedFileBackgroundLineEdit->setText(myFileInfo.fileName()); + QFileInfo myFileInfo(fileName); + *myFileSizeMapDir = myFileInfo.path(); + selectMedFileBackgroundLineEdit->setText(myFileInfo.fileName()); } void SMESHGUI_MgAdaptArguments::onMedFileCheckBox(int state) { - if (state == Qt::Checked) - { - selectOutMedFilebutton->show(); - selectOutMedFileLineEdit->show(); - selectOutMedFilebutton->setEnabled(true); - selectOutMedFileLineEdit->setEnabled(true); - } - else - { - selectOutMedFilebutton->setEnabled(false); - selectOutMedFileLineEdit->setEnabled(false); - publishOut->setChecked(true); - } + if (state == Qt::Checked) + { + selectOutMedFilebutton->show(); + selectOutMedFileLineEdit->show(); + selectOutMedFilebutton->setEnabled(true); + selectOutMedFileLineEdit->setEnabled(true); + } + else + { + selectOutMedFilebutton->setEnabled(false); + selectOutMedFileLineEdit->setEnabled(false); + publishOut->setChecked(true); + } } void SMESHGUI_MgAdaptArguments::onPublishOut(int state) { - if (state == Qt::Unchecked) - { - medFileCheckBox->setChecked(true); - } + if (state == Qt::Unchecked) + { + medFileCheckBox->setChecked(true); + } } void SMESHGUI_MgAdaptArguments::onSelectMedFilebuttonClicked() { - // bool keep = false; - QString fileName0 = selectMedFileLineEdit->text().trimmed(); + // bool keep = false; + QString fileName0 = selectMedFileLineEdit->text().trimmed(); - QString fileName = getMedFileName(false); - if(fileName != QString::null) + QString fileName = getMedFileName(false); + if(fileName != QString::null) + { + QString aMeshName = lireNomMaillage(fileName.trimmed(), meshDim); + if (aMeshName == QString::null ) { - QString aMeshName = lireNomMaillage(fileName.trimmed(), meshDim); - if (aMeshName == QString::null ) - { - QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), - QObject::tr("MG_ADAPT_MED_FILE_2") ); - fileName = fileName0; - } - else - { - meshNameLineEdit->setText(aMeshName); - ADAPTATION_MODE aMode = meshDim == 3 ? ADAPTATION_MODE::BOTH : ADAPTATION_MODE::SURFACE; // and when dimesh 3 without 2D mesh? - emit meshDimSignal(aMode); - } - + QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), + QObject::tr("MG_ADAPT_MED_FILE_2") ); + fileName = fileName0; } else { - return; + meshNameLineEdit->setText(aMeshName); + ADAPTATION_MODE aMode = meshDim == 3 ? ADAPTATION_MODE::BOTH : ADAPTATION_MODE::SURFACE; // and when dimesh 3 without 2D mesh? + emit meshDimSignal(aMode); } + } + else + { + return; + } - - QFileInfo myFileInfo(fileName); - *myFileInDir = myFileInfo.path(); - *myFileOutDir = myFileInfo.path(); - selectMedFileLineEdit->setText(myFileInfo.fileName()); - QString outF = fileName == QString::null ? myFileInfo.fileName() : - QString( remove_extension(myFileInfo.fileName().toStdString() ).c_str() )+ QString(".adapt.med"); - selectOutMedFileLineEdit->setText(outF); - onLocalSelected(myFileInfo.filePath()); + QFileInfo myFileInfo(fileName); + *myFileInDir = myFileInfo.path(); + *myFileOutDir = myFileInfo.path(); + selectMedFileLineEdit->setText(myFileInfo.fileName()); + QString outF = fileName == QString::null ? myFileInfo.fileName() : + QString( remove_extension(myFileInfo.fileName().toStdString() ).c_str() )+ QString(".adapt.med"); + selectOutMedFileLineEdit->setText(outF); + onLocalSelected(myFileInfo.filePath()); } void SMESHGUI_MgAdaptArguments::onLocalSelected(QString filePath) { - myFieldList = GetListeChamps(filePath, false); - if (myFieldList.empty()) + myFieldList = GetListeChamps(filePath, false); + if (myFieldList.empty()) + { + if (localButton->isChecked()) { - if (localButton->isChecked()) - { - fieldNameCmb->clear(); - } - + fieldNameCmb->clear(); } - else + } + else + { + // fill field name Combobox + fieldNameCmb->clear(); + std::map::const_iterator it; + for ( it = myFieldList.begin() ; it != myFieldList.end(); it++) { - // fill field name Combobox - fieldNameCmb->clear(); - std::map::const_iterator it; - for ( it = myFieldList.begin() ; it != myFieldList.end(); it++) - { - fieldNameCmb->insertItem(0,QString(it->first)); - // Je ne comprends pas le rapport entre pas de temps et apparition d'un nouveau champ... GN - int typeStepInField = it->second > 2 ? 2 : it->second ; + fieldNameCmb->insertItem(0,QString(it->first)); + // Je ne comprends pas le rapport entre pas de temps et apparition d'un nouveau champ... GN + int typeStepInField = it->second > 2 ? 2 : it->second ; // std::cout << "SMESHGUI_MgAdaptArguments::onLocalSelected typeStepInField : " << typeStepInField << std::endl; - timeStepGroupChanged(typeStepInField, false); - } - + timeStepGroupChanged(typeStepInField, false); } + } } // ======================================================================= // Gestion les boutons qui permettent de @@ -804,132 +793,128 @@ void SMESHGUI_MgAdaptArguments::onLocalSelected(QString filePath) QString SMESHGUI_MgAdaptArguments::getMedFileName(bool avertir) { - QString aFile = QString::null; - QString filtre = QString("Med") ; - filtre += QString(" files (*.") + QString("med") + QString(");;"); - aFile = SUIT_FileDlg::getOpenFileName(0, QObject::tr("MG_ADAPT_SELECT_FILE_0"), QString(""), filtre ); + QString aFile = QString::null; + QString filtre = QString("Med") ; + filtre += QString(" files (*.") + QString("med") + QString(");;"); + aFile = SUIT_FileDlg::getOpenFileName(0, QObject::tr("MG_ADAPT_SELECT_FILE_0"), QString(""), filtre ); - return aFile; + return aFile; } void SMESHGUI_MgAdaptArguments::setMode(const Mode theMode, const SIZEMAP theSizeMap ) { - QRadioButton* aButton = qobject_cast( meshInGroup->button( theMode ) ); - QRadioButton* bButton = qobject_cast( sizeMapDefGroup->button( theSizeMap ) ); - if ( aButton ) { - aButton->setChecked( true ); - modeChanged( theMode ); - } - if ( bButton ) { - bButton->setChecked( true ); - sizeMapDefChanged( theSizeMap ); - } + QRadioButton* aButton = qobject_cast( meshInGroup->button( theMode ) ); + QRadioButton* bButton = qobject_cast( sizeMapDefGroup->button( theSizeMap ) ); + if ( aButton ) + { + aButton->setChecked( true ); + modeChanged( theMode ); + } + if ( bButton ) + { + bButton->setChecked( true ); + sizeMapDefChanged( theSizeMap ); + } } void SMESHGUI_MgAdaptArguments::modeChanged( int theMode ) { - clear(); - if(theMode == Mesh) - { - aBrowserObject->hide(); - selectMedFileLineEdit->show(); - selectMedFilebutton->show(); - localButton->setEnabled(true); - } - else - { - selectMedFileLineEdit->hide(); - selectMedFilebutton->hide(); - localButton->setEnabled(false); - aBrowserObject->show(); - sizeMapDefChanged(Background); - emit updateSelection(); - } - - - + clear(); + if(theMode == Mesh) + { + aBrowserObject->hide(); + selectMedFileLineEdit->show(); + selectMedFilebutton->show(); + localButton->setEnabled(true); + } + else + { + selectMedFileLineEdit->hide(); + selectMedFilebutton->hide(); + localButton->setEnabled(false); + aBrowserObject->show(); + sizeMapDefChanged(Background); + emit updateSelection(); + } } void SMESHGUI_MgAdaptArguments::sizeMapDefChanged( int theSizeMap ) { - fieldNameCmb->clear(); - if(theSizeMap == Local) + fieldNameCmb->clear(); + if(theSizeMap == Local) + { + localButton->setEnabled(true); + localButton->setChecked(true); + medFileBackground->hide(); + selectMedFileBackgroundbutton->hide(); + selectMedFileBackgroundLineEdit->hide(); + selectMedFileBackgroundLineEdit->clear(); + valueLabel->hide(); + dvalue->hide(); + + sizeMapField->setEnabled(true); + if (!selectMedFileLineEdit->text().isEmpty()) { - localButton->setEnabled(true); - localButton->setChecked(true); - medFileBackground->hide(); - selectMedFileBackgroundbutton->hide(); - selectMedFileBackgroundLineEdit->hide(); - selectMedFileBackgroundLineEdit->clear(); - valueLabel->hide(); - dvalue->hide(); - - sizeMapField->setEnabled(true); - if (!selectMedFileLineEdit->text().isEmpty()) - { - QFileInfo myFileInfo(QDir(*myFileInDir), selectMedFileLineEdit->text()); - onLocalSelected(myFileInfo.filePath()); - } + QFileInfo myFileInfo(QDir(*myFileInDir), selectMedFileLineEdit->text()); + onLocalSelected(myFileInfo.filePath()); } - else if (theSizeMap == Background) - { - medFileBackground->show(); - backgroundButton->setChecked(true); - selectMedFileBackgroundbutton->show(); - selectMedFileBackgroundLineEdit->show(); - valueLabel->hide(); - dvalue->hide(); - sizeMapField->setEnabled(true); - - } - else - { - medFileBackground->hide(); - constantButton->setChecked(true); - selectMedFileBackgroundbutton->hide(); - selectMedFileBackgroundLineEdit->clear(); - selectMedFileBackgroundLineEdit->hide(); - valueLabel->show(); - dvalue->show(); - sizeMapField->setEnabled(false); - - } - + } + else if (theSizeMap == Background) + { + medFileBackground->show(); + backgroundButton->setChecked(true); + selectMedFileBackgroundbutton->show(); + selectMedFileBackgroundLineEdit->show(); + valueLabel->hide(); + dvalue->hide(); + sizeMapField->setEnabled(true); + } + else + { + medFileBackground->hide(); + constantButton->setChecked(true); + selectMedFileBackgroundbutton->hide(); + selectMedFileBackgroundLineEdit->clear(); + selectMedFileBackgroundLineEdit->hide(); + valueLabel->show(); + dvalue->show(); + sizeMapField->setEnabled(false); + } } void SMESHGUI_MgAdaptArguments::timeStepGroupChanged(int timeStepType, bool disableOther, int vmax) { - switch (timeStepType) - { - case 0 : - onNoTimeStep(disableOther); - break; - case 1 : - onLastTimeStep(disableOther); - break; - case 2 : - onChosenTimeStep(disableOther, vmax); - default: - break; - } + switch (timeStepType) + { + case 0 : + onNoTimeStep(disableOther); + break; + case 1 : + onLastTimeStep(disableOther); + break; + case 2 : + onChosenTimeStep(disableOther, vmax); + default: + break; + } } void SMESHGUI_MgAdaptArguments::clear() { - selectMedFileLineEdit->clear(); - aBrowserObject->clear(); + selectMedFileLineEdit->clear(); + aBrowserObject->clear(); - meshNameLineEdit->clear(); - selectOutMedFileLineEdit->clear(); + meshNameLineEdit->clear(); + selectOutMedFileLineEdit->clear(); } med_int SMESHGUI_MgAdaptArguments::getMeshDim() const { - return meshDim; + return meshDim; } QWidget* ItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &o, const QModelIndex &index) const { - bool editable = index.data( EDITABLE_ROLE ).toInt(); - return editable ? QItemDelegate::createEditor( parent, o, index ) : 0; + bool editable = index.data( EDITABLE_ROLE ).toInt(); + return editable ? QItemDelegate::createEditor( parent, o, index ) : 0; } ////////////////////////////////////////// @@ -937,20 +922,20 @@ QWidget* ItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem ////////////////////////////////////////// MgAdaptAdvWidget::MgAdaptAdvWidget( QWidget* parent, std::vector * options, Qt::WindowFlags f ) - : QWidget( parent, f ), myOptions(options) + : QWidget( parent, f ), myOptions(options) { - setupWidget(); - myOptionTable->header()->setSectionResizeMode( QHeaderView::ResizeToContents ); - myOptionTable->setItemDelegate( new ItemDelegate( myOptionTable ) ); + setupWidget(); + myOptionTable->header()->setSectionResizeMode( QHeaderView::ResizeToContents ); + myOptionTable->setItemDelegate( new ItemDelegate( myOptionTable ) ); - for ( int i = 0, nb = myOptions->size(); i < nb; ++i ) - { - AddOption( (*myOptions)[i].c_str() ); - } + for ( int i = 0, nb = myOptions->size(); i < nb; ++i ) + { + AddOption( (*myOptions)[i].c_str() ); + } - connect( myOptionTable, SIGNAL( itemChanged(QTreeWidgetItem *, int)), SLOT( itemChanged(QTreeWidgetItem *, int ))); - connect( addBtn, SIGNAL( clicked() ), this, SLOT( onAddOption() ) ); - connect(workingDirectoryPushButton, SIGNAL(pressed()), this, SLOT(_onWorkingDirectoryPushButton())); + connect( myOptionTable, SIGNAL( itemChanged(QTreeWidgetItem *, int)), SLOT( itemChanged(QTreeWidgetItem *, int ))); + connect( addBtn, SIGNAL(clicked()), this, SLOT( onAddOption() ) ); + connect(workingDirectoryPushButton, SIGNAL(pressed()), this, SLOT(_onWorkingDirectoryPushButton())); } MgAdaptAdvWidget::~MgAdaptAdvWidget() @@ -959,251 +944,241 @@ MgAdaptAdvWidget::~MgAdaptAdvWidget() void MgAdaptAdvWidget::AddOption( const char* option, bool isCustom ) { + QString name, value; + bool isDefault = false; + if ( option ) + { + QStringList name_value_type = QString(option).split( ":", QString::KeepEmptyParts ); + if ( name_value_type.size() > 0 ) + name = name_value_type[0]; + if ( name_value_type.size() > 1 ) + value = name_value_type[1]; + if ( name_value_type.size() > 2 ) + isDefault = !name_value_type[2].toInt(); + } + QTreeWidget* table = myOptionTable; + //table->setExpanded( true ); - - QString name, value; - bool isDefault = false; - if ( option ) + QTreeWidgetItem* row; + if (optionTreeWidgetItem.size()) + { + std::map::iterator it = optionTreeWidgetItem.find(name); + if(it != optionTreeWidgetItem.end()) return; // option exist + else { - QStringList name_value_type = QString(option).split( ":", QString::KeepEmptyParts ); - if ( name_value_type.size() > 0 ) - name = name_value_type[0]; - if ( name_value_type.size() > 1 ) - value = name_value_type[1]; - if ( name_value_type.size() > 2 ) - isDefault = !name_value_type[2].toInt(); - + row = getNewQTreeWidgetItem(table, option, name, isCustom); } - QTreeWidget* table = myOptionTable; - //table->setExpanded( true ); + } + else + { + row = getNewQTreeWidgetItem(table, option, name, isCustom); + } + row->setText( 0, tr( name.toLatin1().constData() )); + row->setText( 1, tr( value.toLatin1().constData() )); + row->setCheckState( 0, isDefault ? Qt::Unchecked : Qt::Checked); + row->setData( NAME_COL, PARAM_NAME, name ); - QTreeWidgetItem* row; - if (optionTreeWidgetItem.size()) - { - std::map::iterator it = optionTreeWidgetItem.find(name); - if(it != optionTreeWidgetItem.end()) return; // option exist - else - { - row = getNewQTreeWidgetItem(table, option, name, isCustom); - } - } - else - { - row = getNewQTreeWidgetItem(table, option, name, isCustom); - } - row->setText( 0, tr( name.toLatin1().constData() )); - row->setText( 1, tr( value.toLatin1().constData() )); - row->setCheckState( 0, isDefault ? Qt::Unchecked : Qt::Checked); - row->setData( NAME_COL, PARAM_NAME, name ); - - if ( isCustom ) - { - myOptionTable->scrollToItem( row ); - myOptionTable->setCurrentItem( row ); - myOptionTable->editItem( row, NAME_COL ); - } + if ( isCustom ) + { + myOptionTable->scrollToItem( row ); + myOptionTable->setCurrentItem( row ); + myOptionTable->editItem( row, NAME_COL ); + } } QTreeWidgetItem* MgAdaptAdvWidget::getNewQTreeWidgetItem(QTreeWidget* table, const char* option, QString& name, bool isCustom) { - QTreeWidgetItem* row = new QTreeWidgetItem( table ); - row->setData( NAME_COL, EDITABLE_ROLE, int( isCustom && !option )); - row->setFlags( row->flags() | Qt::ItemIsEditable ); - optionTreeWidgetItem.insert(std::pair (name, row)); + QTreeWidgetItem* row = new QTreeWidgetItem( table ); + row->setData( NAME_COL, EDITABLE_ROLE, int( isCustom && !option )); + row->setFlags( row->flags() | Qt::ItemIsEditable ); + optionTreeWidgetItem.insert(std::pair (name, row)); - return row; + return row; } void MgAdaptAdvWidget::onAddOption() { - AddOption( NULL, true ); + AddOption( NULL, true ); } void MgAdaptAdvWidget::GetOptionAndValue( QTreeWidgetItem * tblRow, QString& option, QString& value, bool& isDefault) { - option = tblRow->data( NAME_COL, PARAM_NAME ).toString(); - value = tblRow->text( VALUE_COL ); - isDefault = ! tblRow->checkState( NAME_COL ); + option = tblRow->data( NAME_COL, PARAM_NAME ).toString(); + value = tblRow->text( VALUE_COL ); + isDefault = ! tblRow->checkState( NAME_COL ); } - void MgAdaptAdvWidget::itemChanged(QTreeWidgetItem* tblRow, int column) { - if ( tblRow ) + if ( tblRow ) + { + myOptionTable->blockSignals( true ); + + tblRow->setData( VALUE_COL, EDITABLE_ROLE, int( tblRow->checkState( NAME_COL ))); + + int c = tblRow->checkState( NAME_COL ) ? 0 : 150; + tblRow->setForeground( VALUE_COL, QBrush( QColor( c, c, c ))); + + if ( column == NAME_COL && tblRow->data( NAME_COL, EDITABLE_ROLE ).toInt() ) // custom table { - myOptionTable->blockSignals( true ); - - tblRow->setData( VALUE_COL, EDITABLE_ROLE, int( tblRow->checkState( NAME_COL ))); - - int c = tblRow->checkState( NAME_COL ) ? 0 : 150; - tblRow->setForeground( VALUE_COL, QBrush( QColor( c, c, c ))); - - if ( column == NAME_COL && tblRow->data( NAME_COL, EDITABLE_ROLE ).toInt() ) // custom table - { - tblRow->setData( NAME_COL, PARAM_NAME, tblRow->text( NAME_COL )); - } - - myOptionTable->blockSignals( false ); + tblRow->setData( NAME_COL, PARAM_NAME, tblRow->text( NAME_COL )); } + + myOptionTable->blockSignals( false ); + } } void MgAdaptAdvWidget::setupWidget() { - if (this->objectName().isEmpty()) - this->setObjectName(QString(tr("MG-ADAPT-ADV"))); - this->resize(337, 369); - gridLayout_4 = new QGridLayout(this); - gridLayout_4->setObjectName(QString("gridLayout_4")); - myOptionTable = new MgAdaptAdvWidgetTreeWidget(this); - QFont font; - font.setBold(false); - font.setWeight(50); - QTreeWidgetItem *__qtreewidgetitem = new QTreeWidgetItem(); - __qtreewidgetitem->setFont(1, font); - __qtreewidgetitem->setFont(0, font); - __qtreewidgetitem->setText(1, tr("OPTION_VALUE_COLUMN")); - __qtreewidgetitem->setText(0, tr("OPTION_NAME_COLUMN")); - myOptionTable->setHeaderItem(__qtreewidgetitem); - myOptionTable->setObjectName(QString("myOptionTable")); - myOptionTable->setEditTriggers(QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed); - myOptionTable->setTabKeyNavigation(true); + if (this->objectName().isEmpty()) + this->setObjectName(QString(tr("MG-ADAPT-ADV"))); + this->resize(337, 369); + gridLayout_4 = new QGridLayout(this); + gridLayout_4->setObjectName(QString("gridLayout_4")); + myOptionTable = new MgAdaptAdvWidgetTreeWidget(this); + QFont font; + font.setBold(false); + font.setWeight(50); + QTreeWidgetItem *__qtreewidgetitem = new QTreeWidgetItem(); + __qtreewidgetitem->setFont(1, font); + __qtreewidgetitem->setFont(0, font); + __qtreewidgetitem->setText(1, tr("OPTION_VALUE_COLUMN")); + __qtreewidgetitem->setText(0, tr("OPTION_NAME_COLUMN")); + myOptionTable->setHeaderItem(__qtreewidgetitem); + myOptionTable->setObjectName(QString("myOptionTable")); + myOptionTable->setEditTriggers(QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed); + myOptionTable->setTabKeyNavigation(true); - gridLayout_4->addWidget(myOptionTable, 0, 0, 1, 2); + gridLayout_4->addWidget(myOptionTable, 0, 0, 1, 2); - addBtn = new QPushButton(this); - addBtn->setObjectName(QString("addBtn")); + addBtn = new QPushButton(this); + addBtn->setObjectName(QString("addBtn")); - gridLayout_4->addWidget(addBtn, 1, 0, 1, 1); + gridLayout_4->addWidget(addBtn, 1, 0, 1, 1); - horizontalSpacer = new QSpacerItem(188, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + horizontalSpacer = new QSpacerItem(188, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - gridLayout_4->addItem(horizontalSpacer, 1, 1, 1, 1); + gridLayout_4->addItem(horizontalSpacer, 1, 1, 1, 1); - logGroupBox = new QGroupBox(this); - logGroupBox->setObjectName(QString("logGroupBox")); - gridLayout_2 = new QGridLayout(logGroupBox); - gridLayout_2->setObjectName(QString("gridLayout_2")); - gridLayout = new QGridLayout(); - gridLayout->setObjectName(QString("gridLayout")); - workingDirectoryLabel = new QLabel(logGroupBox); - workingDirectoryLabel->setObjectName(QString("workingDirectoryLabel")); + logGroupBox = new QGroupBox(this); + logGroupBox->setObjectName(QString("logGroupBox")); + gridLayout_2 = new QGridLayout(logGroupBox); + gridLayout_2->setObjectName(QString("gridLayout_2")); + gridLayout = new QGridLayout(); + gridLayout->setObjectName(QString("gridLayout")); + workingDirectoryLabel = new QLabel(logGroupBox); + workingDirectoryLabel->setObjectName(QString("workingDirectoryLabel")); - gridLayout->addWidget(workingDirectoryLabel, 0, 0, 1, 1); + gridLayout->addWidget(workingDirectoryLabel, 0, 0, 1, 1); - workingDirectoryLineEdit = new QLineEdit(logGroupBox); - workingDirectoryLineEdit->setObjectName(QString("workingDirectoryLineEdit")); + workingDirectoryLineEdit = new QLineEdit(logGroupBox); + workingDirectoryLineEdit->setObjectName(QString("workingDirectoryLineEdit")); - gridLayout->addWidget(workingDirectoryLineEdit, 0, 1, 1, 1); + gridLayout->addWidget(workingDirectoryLineEdit, 0, 1, 1, 1); - workingDirectoryPushButton = new QPushButton(logGroupBox); - workingDirectoryPushButton->setObjectName(QString("workingDirectoryPushButton")); + workingDirectoryPushButton = new QPushButton(logGroupBox); + workingDirectoryPushButton->setObjectName(QString("workingDirectoryPushButton")); - gridLayout->addWidget(workingDirectoryPushButton, 0, 2, 1, 1); + gridLayout->addWidget(workingDirectoryPushButton, 0, 2, 1, 1); - verboseLevelLabel = new QLabel(logGroupBox); - verboseLevelLabel->setObjectName(QString("verboseLevelLabel")); + verboseLevelLabel = new QLabel(logGroupBox); + verboseLevelLabel->setObjectName(QString("verboseLevelLabel")); - gridLayout->addWidget(verboseLevelLabel, 1, 0, 1, 1); + gridLayout->addWidget(verboseLevelLabel, 1, 0, 1, 1); - verboseLevelSpin = new QSpinBox(logGroupBox); - verboseLevelSpin->setObjectName(QString("verboseLevelSpin")); + verboseLevelSpin = new QSpinBox(logGroupBox); + verboseLevelSpin->setObjectName(QString("verboseLevelSpin")); - gridLayout->addWidget(verboseLevelSpin, 1, 1, 1, 1); + gridLayout->addWidget(verboseLevelSpin, 1, 1, 1, 1); - gridLayout_2->addLayout(gridLayout, 0, 0, 1, 1); + gridLayout_2->addLayout(gridLayout, 0, 0, 1, 1); - horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QString("horizontalLayout")); - logInFileCheck = new QCheckBox(logGroupBox); - logInFileCheck->setObjectName(QString("logInFileCheck")); - logInFileCheck->setChecked(true); + horizontalLayout = new QHBoxLayout(); + horizontalLayout->setObjectName(QString("horizontalLayout")); + logInFileCheck = new QCheckBox(logGroupBox); + logInFileCheck->setObjectName(QString("logInFileCheck")); + logInFileCheck->setChecked(true); - horizontalLayout->addWidget(logInFileCheck); + horizontalLayout->addWidget(logInFileCheck); - removeLogOnSuccessCheck = new QCheckBox(logGroupBox); - removeLogOnSuccessCheck->setObjectName(QString("removeLogOnSuccessCheck")); - removeLogOnSuccessCheck->setChecked(true); + removeLogOnSuccessCheck = new QCheckBox(logGroupBox); + removeLogOnSuccessCheck->setObjectName(QString("removeLogOnSuccessCheck")); + removeLogOnSuccessCheck->setChecked(true); - horizontalLayout->addWidget(removeLogOnSuccessCheck); + horizontalLayout->addWidget(removeLogOnSuccessCheck); - gridLayout_2->addLayout(horizontalLayout, 1, 0, 1, 1); + gridLayout_2->addLayout(horizontalLayout, 1, 0, 1, 1); - keepWorkingFilesCheck = new QCheckBox(logGroupBox); - keepWorkingFilesCheck->setObjectName(QString("keepWorkingFilesCheck")); - keepWorkingFilesCheck->setAutoExclusive(false); + keepWorkingFilesCheck = new QCheckBox(logGroupBox); + keepWorkingFilesCheck->setObjectName(QString("keepWorkingFilesCheck")); + keepWorkingFilesCheck->setAutoExclusive(false); - gridLayout_2->addWidget(keepWorkingFilesCheck, 2, 0, 1, 1); + gridLayout_2->addWidget(keepWorkingFilesCheck, 2, 0, 1, 1); - gridLayout_4->addWidget(logGroupBox, 3, 0, 1, 2); - - - // retranslateUi(this); - - // QMetaObject::connectSlotsByName(this); + gridLayout_4->addWidget(logGroupBox, 3, 0, 1, 2); } void MgAdaptAdvWidget::_onWorkingDirectoryPushButton() { - QString aDirName=QFileDialog::getExistingDirectory (); - if (!(aDirName.isEmpty()))workingDirectoryLineEdit->setText(aDirName); + QString aDirName=QFileDialog::getExistingDirectory (); + if (!(aDirName.isEmpty()))workingDirectoryLineEdit->setText(aDirName); } void MgAdaptAdvWidget::onMeshDimChanged(ADAPTATION_MODE aMode) { - /* default adaptation mode - * assume that if meshDim == 2 -->adaptation surface - * if meshDim == 3 and if there is not 2D mesh -->VOLUME - * else BOTH - */ +/* default adaptation mode + * assume that if meshDim == 2 -->adaptation surface + * if meshDim == 3 and if there is not 2D mesh -->VOLUME + * else BOTH + */ - QString adaptation("adaptation"), value; - switch(aMode) - { - case ADAPTATION_MODE::SURFACE: - { - value ="surface"; - setOptionValue(adaptation, value); - break; - } - case ADAPTATION_MODE::BOTH : - { - value = "both"; - setOptionValue(adaptation, value); - break; - } - case ADAPTATION_MODE::VOLUME : - { - value = "volume"; - setOptionValue(adaptation, value); - break; - } - } + QString adaptation("adaptation"), value; + switch(aMode) + { + case ADAPTATION_MODE::SURFACE: + { + value ="surface"; + setOptionValue(adaptation, value); + break; + } + case ADAPTATION_MODE::BOTH : + { + value = "both"; + setOptionValue(adaptation, value); + break; + } + case ADAPTATION_MODE::VOLUME : + { + value = "volume"; + setOptionValue(adaptation, value); + break; + } + } } void MgAdaptAdvWidget::setOptionValue(QString& option, QString& value) { - - std::map::iterator it = optionTreeWidgetItem.find(option); - if (it != optionTreeWidgetItem.end()) - { - it->second->setText( 0, tr( option.toLatin1().constData() )); - it->second->setText( 1, tr( value.toLatin1().constData() )); - it->second->setCheckState( 0, Qt::Checked ); - it->second->setData( NAME_COL, PARAM_NAME, option ); - myOptionTable->editItem( it->second, NAME_COL ); - } + std::map::iterator it = optionTreeWidgetItem.find(option); + if (it != optionTreeWidgetItem.end()) + { + it->second->setText( 0, tr( option.toLatin1().constData() )); + it->second->setText( 1, tr( value.toLatin1().constData() )); + it->second->setCheckState( 0, Qt::Checked ); + it->second->setData( NAME_COL, PARAM_NAME, option ); + myOptionTable->editItem( it->second, NAME_COL ); + } } namespace { bool isEditable( const QModelIndex& index ) { - return index.isValid() && - index.flags() & Qt::ItemIsEditable && - index.flags() & Qt::ItemIsEnabled && - ( !index.data( Qt::UserRole + 1 ).isValid() || index.data( Qt::UserRole + 1 ).toInt() != 0 ); + return index.isValid() && + index.flags() & Qt::ItemIsEditable && + index.flags() & Qt::ItemIsEnabled && + ( !index.data( Qt::UserRole + 1 ).isValid() || index.data( Qt::UserRole + 1 ).toInt() != 0 ); } } @@ -1214,56 +1189,56 @@ MgAdaptAdvWidgetTreeWidget::MgAdaptAdvWidgetTreeWidget( QWidget* parent ) QModelIndex MgAdaptAdvWidgetTreeWidget::moveCursor( CursorAction action, Qt::KeyboardModifiers modifiers ) { - QModelIndex current = currentIndex(); - int column = current.column(); - if ( action == MoveNext ) { - if ( column < columnCount()-1 ) { - QModelIndex next = current.sibling( current.row(), column+1 ); - if ( isEditable( next ) ) - return next; - } - else { - QModelIndex next = current.sibling( current.row()+1, 0 ); - if ( isEditable( next ) ) - return next; - } + QModelIndex current = currentIndex(); + int column = current.column(); + if ( action == MoveNext ) + { + if ( column < columnCount()-1 ) + { + QModelIndex next = current.sibling( current.row(), column+1 ); + if ( isEditable( next ) ) return next; } - else if ( action == MovePrevious ) { - if ( column == 0 ) { - QModelIndex next = current.sibling( current.row()-1, columnCount()-1 ); - if ( isEditable( next ) ) - return next; - } - else { - QModelIndex next = current.sibling( current.row(), column-1 ); - if ( isEditable( next ) ) - return next; - } + else + { + QModelIndex next = current.sibling( current.row()+1, 0 ); + if ( isEditable( next ) ) return next; } - return QTreeWidget::moveCursor( action, modifiers ); + } + else if ( action == MovePrevious ) + { + if ( column == 0 ) { + QModelIndex next = current.sibling( current.row()-1, columnCount()-1 ); + if ( isEditable( next ) ) return next; + } + else { + QModelIndex next = current.sibling( current.row(), column-1 ); + if ( isEditable( next ) ) return next; + } + } + return QTreeWidget::moveCursor( action, modifiers ); } void MgAdaptAdvWidgetTreeWidget::keyPressEvent( QKeyEvent* e ) { - switch ( e->key() ) { + switch ( e->key() ) + { case Qt::Key_F2: { - QModelIndex index = currentIndex(); - if ( !isEditable( index ) ) { - for ( int i = 0; i < columnCount(); i++ ) { - QModelIndex sibling = index.sibling( index.row(), i ); - if ( isEditable( sibling ) ) { - if ( !edit( sibling, EditKeyPressed, e ) ) - e->ignore(); - } - } + QModelIndex index = currentIndex(); + if ( !isEditable( index ) ) { + for ( int i = 0; i < columnCount(); i++ ) { + QModelIndex sibling = index.sibling( index.row(), i ); + if ( isEditable( sibling ) ) { + if ( !edit( sibling, EditKeyPressed, e ) ) e->ignore(); + } } + } } break; default: - break; - } - QTreeWidget::keyPressEvent( e ); + break; + } + QTreeWidget::keyPressEvent( e ); } @@ -1272,175 +1247,173 @@ void MgAdaptAdvWidgetTreeWidget::keyPressEvent( QKeyEvent* e ) // ======================================================================= med_idt OuvrirFichier(QString aFile) { - med_idt medIdt = MEDfileOpen(aFile.toStdString().c_str(),MED_ACC_RDONLY); - if (medIdt <0) - { - QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), - QObject::tr("MG_ADAPT_MED_FILE_1") ); - } - return medIdt; + med_idt medIdt = MEDfileOpen(aFile.toStdString().c_str(),MED_ACC_RDONLY); + if (medIdt <0) + { + QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), + QObject::tr("MG_ADAPT_MED_FILE_1") ); + } + return medIdt; } // ====================================================== // ======================================================== QString lireNomMaillage(QString aFile, med_int& meshdim) { - QString nomMaillage = QString::null ; - int erreur = 0 ; - med_idt medIdt ; - - // Ouverture du fichier - medIdt = OuvrirFichier(aFile); - if ( medIdt < 0 ) - { - erreur = 1 ; - return nomMaillage; - } - med_int numberOfMeshes = MEDnMesh(medIdt) ; - if (numberOfMeshes == 0 ) - { - QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), - QObject::tr("MG_ADAPT_MED_FILE_2") ); - erreur = 2 ; - return nomMaillage; - } - if (numberOfMeshes > 1 ) - { - QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), - QObject::tr("MG_ADAPT_MED_FILE_3") ); - erreur = 3 ; - return nomMaillage; - } - - nomMaillage = lireNomMaillage2(medIdt,1, meshdim); - // Fermeture du fichier - if ( medIdt > 0 ) MEDfileClose(medIdt); + QString nomMaillage = QString::null ; + int erreur = 0 ; + med_idt medIdt ; + // Ouverture du fichier + medIdt = OuvrirFichier(aFile); + if ( medIdt < 0 ) + { + erreur = 1 ; return nomMaillage; + } + med_int numberOfMeshes = MEDnMesh(medIdt) ; + if (numberOfMeshes == 0 ) + { + QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), + QObject::tr("MG_ADAPT_MED_FILE_2") ); + erreur = 2 ; + return nomMaillage; + } + if (numberOfMeshes > 1 ) + { + QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), + QObject::tr("MG_ADAPT_MED_FILE_3") ); + erreur = 3 ; + return nomMaillage; + } + + nomMaillage = lireNomMaillage2(medIdt,1, meshdim); + // Fermeture du fichier + if ( medIdt > 0 ) MEDfileClose(medIdt); + + return nomMaillage; } // ======================================================================= // ======================================================================= QString lireNomMaillage2(med_idt medIdt,int meshId, med_int& meshdim ) { - QString NomMaillage=QString::null; - char meshname[MED_NAME_SIZE+1]; - med_int spacedim; - med_mesh_type meshtype; - char descriptionription[MED_COMMENT_SIZE+1]; - char dtunit[MED_SNAME_SIZE+1]; - med_sorting_type sortingtype; - med_int nstep; - med_axis_type axistype; - int naxis = MEDmeshnAxis(medIdt,1); - char *axisname=new char[naxis*MED_SNAME_SIZE+1]; - char *axisunit=new char[naxis*MED_SNAME_SIZE+1]; - med_err aRet = MEDmeshInfo(medIdt, - meshId, - meshname, - &spacedim, - &meshdim, - &meshtype, - descriptionription, - dtunit, - &sortingtype, - &nstep, - &axistype, - axisname, - axisunit); + QString NomMaillage=QString::null; + char meshname[MED_NAME_SIZE+1]; + med_int spacedim; + med_mesh_type meshtype; + char descriptionription[MED_COMMENT_SIZE+1]; + char dtunit[MED_SNAME_SIZE+1]; + med_sorting_type sortingtype; + med_int nstep; + med_axis_type axistype; + int naxis = MEDmeshnAxis(medIdt,1); + char *axisname=new char[naxis*MED_SNAME_SIZE+1]; + char *axisunit=new char[naxis*MED_SNAME_SIZE+1]; + med_err aRet = MEDmeshInfo(medIdt, + meshId, + meshname, + &spacedim, + &meshdim, + &meshtype, + descriptionription, + dtunit, + &sortingtype, + &nstep, + &axistype, + axisname, + axisunit); - if ( aRet < 0 ) { - QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), \ - QObject::tr("MG_ADAPT_MED_FILE_4") ); - } - else { - NomMaillage=QString(meshname); - } + if ( aRet < 0 ) { + QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), \ + QObject::tr("MG_ADAPT_MED_FILE_4") ); + } + else { + NomMaillage=QString(meshname); + } - delete[] axisname ; - delete[] axisunit ; + delete[] axisname ; + delete[] axisunit ; - return NomMaillage; + return NomMaillage; } - - // ======================================================================= std::map GetListeChamps(QString aFile, bool errorMessage) // ======================================================================= { // Il faut voir si plusieurs maillages - MESSAGE("GetListeChamps"); - std::map ListeChamp ; + MESSAGE("GetListeChamps"); + std::map ListeChamp ; - med_err erreur = 0 ; - med_idt medIdt ; + med_err erreur = 0 ; + med_idt medIdt ; - while ( erreur == 0 ) + while ( erreur == 0 ) + { + // Ouverture du fichier + SCRUTE(aFile.toStdString()); + medIdt = OuvrirFichier(aFile); + if ( medIdt < 0 ) + { + erreur = 1 ; + break ; + } + // Lecture du nombre de champs + med_int ncha = MEDnField(medIdt) ; + if (ncha < 1 ) + { + if(errorMessage) + { + QMessageBox::critical( 0, QObject::tr("_ERROR"), + QObject::tr("HOM_MED_FILE_5") ); + } + erreur = 2 ; + break ; + } + // Lecture des caracteristiques des champs + for (int i=0; i< ncha; i++) { - // Ouverture du fichier - SCRUTE(aFile.toStdString()); - medIdt = OuvrirFichier(aFile); - if ( medIdt < 0 ) - { - erreur = 1 ; - break ; - } - // Lecture du nombre de champs - med_int ncha = MEDnField(medIdt) ; - if (ncha < 1 ) - { - if(errorMessage) - { - QMessageBox::critical( 0, QObject::tr("_ERROR"), - QObject::tr("HOM_MED_FILE_5") ); - } - erreur = 2 ; - break ; - } - // Lecture des caracteristiques des champs - for (int i=0; i< ncha; i++) - { // Lecture du nombre de composantes - med_int ncomp = MEDfieldnComponent(medIdt,i+1); + med_int ncomp = MEDfieldnComponent(medIdt,i+1); // Lecture du type du champ, des noms des composantes et du nom de l'unite - char nomcha [MED_NAME_SIZE+1]; - char meshname[MED_NAME_SIZE+1]; - char * comp = (char*) malloc(ncomp*MED_SNAME_SIZE+1); - char * unit = (char*) malloc(ncomp*MED_SNAME_SIZE+1); - char dtunit[MED_SNAME_SIZE+1]; - med_bool local; - med_field_type typcha; - med_int nbofcstp; - erreur = MEDfieldInfo(medIdt,i+1,nomcha,meshname,&local,&typcha,comp,unit,dtunit,&nbofcstp) ; - free(comp); - free(unit); - if ( erreur < 0 ) - { - if(errorMessage) - { - QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), - QObject::tr("MG_ADAPT_MED_FILE_6") ); - } - break ; - } - - ListeChamp.insert(std::pair (QString(nomcha), nbofcstp)); - + char nomcha [MED_NAME_SIZE+1]; + char meshname[MED_NAME_SIZE+1]; + char * comp = (char*) malloc(ncomp*MED_SNAME_SIZE+1); + char * unit = (char*) malloc(ncomp*MED_SNAME_SIZE+1); + char dtunit[MED_SNAME_SIZE+1]; + med_bool local; + med_field_type typcha; + med_int nbofcstp; + erreur = MEDfieldInfo(medIdt,i+1,nomcha,meshname,&local,&typcha,comp,unit,dtunit,&nbofcstp) ; + free(comp); + free(unit); + if ( erreur < 0 ) + { + if(errorMessage) + { + QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), + QObject::tr("MG_ADAPT_MED_FILE_6") ); } break ; + } + + ListeChamp.insert(std::pair (QString(nomcha), nbofcstp)); + } + break ; + } // Fermeture du fichier - if ( medIdt > 0 ) MEDfileClose(medIdt); + if ( medIdt > 0 ) MEDfileClose(medIdt); - return ListeChamp; + return ListeChamp; } -std::string remove_extension(const std::string& filename) { - size_t lastdot = filename.find_last_of("."); - if (lastdot == std::string::npos) return filename; - return filename.substr(0, lastdot); +std::string remove_extension(const std::string& filename) +{ + size_t lastdot = filename.find_last_of("."); + if (lastdot == std::string::npos) return filename; + return filename.substr(0, lastdot); } - diff --git a/src/SMESHGUI/MG_ADAPTGUI.hxx b/src/SMESHGUI/MG_ADAPTGUI.hxx index cd2bf2bbf..853b2683e 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.hxx +++ b/src/SMESHGUI/MG_ADAPTGUI.hxx @@ -1,4 +1,7 @@ -// Copyright (C) 2011-2020 CEA/DEN, EDF R&D +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -16,9 +19,8 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // - // SMESH SMESHGUI : GUI for the adaptation in the SMESH component -// File : MG_ADAPTGUI.hxx +// File : MG_ADAPTGUI.hxx // #ifndef MG_ADAPTGUI_HXX #define MG_ADAPTGUI_HXX @@ -103,9 +105,9 @@ std::string remove_extension(const std::string& filename); enum ADAPTATION_MODE{ - SURFACE, // surface adaption when meshDim == 2 - VOLUME, // - BOTH + SURFACE, // surface adaption when meshDim == 2 + VOLUME, // + BOTH }; //================================================================================= // class : SMESHGUI_MgAdaptDlg @@ -113,148 +115,146 @@ enum ADAPTATION_MODE{ //================================================================================= class SMESHGUI_MgAdaptDlg : public QDialog { - Q_OBJECT; + Q_OBJECT; public: - //! Property type - enum Mode { Arguments, AdvancedOptions}; - SMESHGUI_MgAdaptDlg( SalomeApp_Module*, SMESH::MG_ADAPT_ptr, QWidget* parent= 0,bool isCreation = true ); - ~SMESHGUI_MgAdaptDlg(); + //! Property type + enum Mode { Arguments, AdvancedOptions}; + SMESHGUI_MgAdaptDlg( SalomeApp_Module*, SMESH::MG_ADAPT_ptr, QWidget* parent= 0,bool isCreation = true ); + ~SMESHGUI_MgAdaptDlg(); - void buildDlg(); - void reject(); - bool checkParams(QString& msg) ; - //~void setModel(MgAdapt*); - SMESH::MG_ADAPT_ptr getModel() const; + void buildDlg(); + void reject(); + bool checkParams(QString& msg) ; + //~void setModel(MgAdapt*); + SMESH::MG_ADAPT_ptr getModel() const; public slots: protected slots: - virtual bool clickOnApply(); +virtual bool clickOnApply(); private slots: - virtual void clickOnHelp(); - virtual void clickOnOk(); +virtual void clickOnHelp(); +virtual void clickOnOk(); protected : - SMESHGUI_MgAdaptArguments* myArgs; - MgAdaptAdvWidget* myAdvOpt; - bool readParamsFromHypo( ) const ; - bool readParamsFromWidgets( ) ; - bool storeParamsToHypo( const SMESH::MgAdaptHypothesisData & ) const; + SMESHGUI_MgAdaptArguments* myArgs; + MgAdaptAdvWidget* myAdvOpt; + bool readParamsFromHypo( ) const ; + bool readParamsFromWidgets( ) ; + bool storeParamsToHypo( const SMESH::MgAdaptHypothesisData & ) const; private: - - SalomeApp_Module* mySMESHGUI; /* Current SMESHGUI object */ - QTabWidget* myTabWidget; + SalomeApp_Module* mySMESHGUI; /* Current SMESHGUI object */ + QTabWidget* myTabWidget; - SMESH::MgAdaptHypothesisData* myData; - SMESH::MG_ADAPT_ptr model; + SMESH::MgAdaptHypothesisData* myData; + SMESH::MG_ADAPT_ptr model; }; class SMESHGUI_MgAdaptArguments : public QWidget { - Q_OBJECT; + Q_OBJECT; public: - //! Property type - enum Mode { Mesh, Browser}; - enum SIZEMAP { Local, Background, Constant}; - SMESHGUI_MgAdaptArguments( QWidget* parent); - ~SMESHGUI_MgAdaptArguments(); - void setMode( const Mode, const SIZEMAP ); - med_int getMeshDim() const; + //! Property type + enum Mode { Mesh, Browser}; + enum SIZEMAP { Local, Background, Constant}; + SMESHGUI_MgAdaptArguments( QWidget* parent); + ~SMESHGUI_MgAdaptArguments(); + void setMode( const Mode, const SIZEMAP ); + med_int getMeshDim() const; - QString* myFileInDir; - QString* myFileOutDir; - QString* myFileSizeMapDir; - QGroupBox* aMeshIn ; - QRadioButton* aMedfile; - QRadioButton* aBrowser ; - QLineEdit* aBrowserObject; - QPushButton* selectMedFilebutton ; - QSpacerItem* hspacer; - QLineEdit* selectMedFileLineEdit ; - QButtonGroup* meshInGroup ; - QGridLayout* meshIn ; + QString* myFileInDir; + QString* myFileOutDir; + QString* myFileSizeMapDir; + QGroupBox* aMeshIn ; + QRadioButton* aMedfile; + QRadioButton* aBrowser ; + QLineEdit* aBrowserObject; + QPushButton* selectMedFilebutton ; + QSpacerItem* hspacer; + QLineEdit* selectMedFileLineEdit ; + QButtonGroup* meshInGroup ; + QGridLayout* meshIn ; - QGroupBox* aMeshOut ; - QLabel* meshName; - QLineEdit* meshNameLineEdit; - QSpacerItem* secondHspacer; - QCheckBox* medFileCheckBox; - QPushButton* selectOutMedFilebutton; - QLineEdit* selectOutMedFileLineEdit; - QSpacerItem* thirdHspacer; - QCheckBox* publishOut; - QGridLayout* meshOut ; + QGroupBox* aMeshOut ; + QLabel* meshName; + QLineEdit* meshNameLineEdit; + QSpacerItem* secondHspacer; + QCheckBox* medFileCheckBox; + QPushButton* selectOutMedFilebutton; + QLineEdit* selectOutMedFileLineEdit; + QSpacerItem* thirdHspacer; + QCheckBox* publishOut; + QGridLayout* meshOut ; - QGroupBox* sizeMapDefinition ; - QRadioButton* localButton; - QRadioButton* backgroundButton ; - QRadioButton* constantButton ; - QLabel* medFileBackground; - QPushButton* selectMedFileBackgroundbutton; - QLineEdit* selectMedFileBackgroundLineEdit; - QLabel* valueLabel; - QDoubleSpinBox* dvalue; - QButtonGroup* sizeMapDefGroup ; - QGridLayout* sizeMapDefGroupLayout; + QGroupBox* sizeMapDefinition ; + QRadioButton* localButton; + QRadioButton* backgroundButton ; + QRadioButton* constantButton ; + QLabel* medFileBackground; + QPushButton* selectMedFileBackgroundbutton; + QLineEdit* selectMedFileBackgroundLineEdit; + QLabel* valueLabel; + QDoubleSpinBox* dvalue; + QButtonGroup* sizeMapDefGroup ; + QGridLayout* sizeMapDefGroupLayout; - QGroupBox* sizeMapField; - QLabel* fieldName; - QComboBox* fieldNameCmb; - QRadioButton* noTimeStep; - QRadioButton* lastTimeStep ; - QRadioButton* chosenTimeStep; - QLabel* timeStepLabel; - QSpinBox* timeStep; - QLabel* rankLabel; - QSpinBox* rankSpinBox; - QButtonGroup* timeStepGroup; - QGridLayout* sizeMapFieldGroupLayout; + QGroupBox* sizeMapField; + QLabel* fieldName; + QComboBox* fieldNameCmb; + QRadioButton* noTimeStep; + QRadioButton* lastTimeStep ; + QRadioButton* chosenTimeStep; + QLabel* timeStepLabel; + QSpinBox* timeStep; + QLabel* rankLabel; + QSpinBox* rankSpinBox; + QButtonGroup* timeStepGroup; + QGridLayout* sizeMapFieldGroupLayout; signals: - void updateSelection(); - void toExportMED(const char *); - void meshDimSignal(ADAPTATION_MODE aMode); + void updateSelection(); + void toExportMED(const char *); + void meshDimSignal(ADAPTATION_MODE aMode); public slots: protected slots: private slots: - void modeChanged( int); - void sizeMapDefChanged(int); - void timeStepGroupChanged(int timeStepType, bool disableOther = false, int vmax = 0); - void onSelectMedFilebuttonClicked(); - void clear(); - void onMedFileCheckBox(int); - void onPublishOut(int); - void onSelectOutMedFilebutton(); - void onSelectMedFileBackgroundbutton(); - void onLocalSelected(QString); - void onNoTimeStep(bool disableOther = false); - void onLastTimeStep(bool disableOther = false); - void onChosenTimeStep(bool disableOther = false, int vmax = 0); - void visibleTimeStepRankLabel(bool visible); + void modeChanged( int); + void sizeMapDefChanged(int); + void timeStepGroupChanged(int timeStepType, bool disableOther = false, int vmax = 0); + void onSelectMedFilebuttonClicked(); + void clear(); + void onMedFileCheckBox(int); + void onPublishOut(int); + void onSelectOutMedFilebutton(); + void onSelectMedFileBackgroundbutton(); + void onLocalSelected(QString); + void onNoTimeStep(bool disableOther = false); + void onLastTimeStep(bool disableOther = false); + void onChosenTimeStep(bool disableOther = false, int vmax = 0); + void visibleTimeStepRankLabel(bool visible); private: - QString getMedFileName(bool avertir); - LightApp_SelectionMgr* selMgr ; - med_int meshDim; - std::map myFieldList; - + QString getMedFileName(bool avertir); + LightApp_SelectionMgr* selMgr ; + med_int meshDim; + std::map myFieldList; }; enum { - OPTION_ID_COLUMN = 0, - OPTION_TYPE_COLUMN, - OPTION_NAME_COLUMN = 0, - OPTION_VALUE_COLUMN, - NB_COLUMNS, + OPTION_ID_COLUMN = 0, + OPTION_TYPE_COLUMN, + OPTION_NAME_COLUMN = 0, + OPTION_VALUE_COLUMN, + NB_COLUMNS, }; ////////////////////////////////////////// @@ -262,44 +262,44 @@ enum { ////////////////////////////////////////// class MgAdaptAdvWidget : public QWidget { - Q_OBJECT + Q_OBJECT public: - MgAdaptAdvWidget( QWidget* = 0, std::vector * = nullptr, Qt::WindowFlags = 0 ); - ~MgAdaptAdvWidget(); - std::vector < std::string > * myOptions; - QGridLayout *gridLayout_4; - MgAdaptAdvWidgetTreeWidget *myOptionTable; - QPushButton *addBtn; - QSpacerItem *horizontalSpacer; - QGroupBox *logGroupBox; - QGridLayout *gridLayout_2; - QGridLayout *gridLayout; - QLabel *workingDirectoryLabel; - QLineEdit *workingDirectoryLineEdit; - QPushButton *workingDirectoryPushButton; - QLabel *verboseLevelLabel; - QSpinBox *verboseLevelSpin; - QHBoxLayout *horizontalLayout; - QCheckBox *logInFileCheck; - QCheckBox *removeLogOnSuccessCheck; - QCheckBox *keepWorkingFilesCheck; + MgAdaptAdvWidget( QWidget* = 0, std::vector * = nullptr, Qt::WindowFlags = 0 ); + ~MgAdaptAdvWidget(); + std::vector < std::string > * myOptions; + QGridLayout *gridLayout_4; + MgAdaptAdvWidgetTreeWidget *myOptionTable; + QPushButton *addBtn; + QSpacerItem *horizontalSpacer; + QGroupBox *logGroupBox; + QGridLayout *gridLayout_2; + QGridLayout *gridLayout; + QLabel *workingDirectoryLabel; + QLineEdit *workingDirectoryLineEdit; + QPushButton *workingDirectoryPushButton; + QLabel *verboseLevelLabel; + QSpinBox *verboseLevelSpin; + QHBoxLayout *horizontalLayout; + QCheckBox *logInFileCheck; + QCheckBox *removeLogOnSuccessCheck; + QCheckBox *keepWorkingFilesCheck; + + void AddOption( const char* name_value_type, bool isCustom = false ); + void GetOptionAndValue( QTreeWidgetItem * tblRow, QString& option, QString& value, bool& dflt ); + void setupWidget(); - void AddOption( const char* name_value_type, bool isCustom = false ); - void GetOptionAndValue( QTreeWidgetItem * tblRow, QString& option, QString& value, bool& dflt ); - void setupWidget(); public slots: - - void onAddOption(); - void itemChanged(QTreeWidgetItem * tblRow, int column); - void onMeshDimChanged(ADAPTATION_MODE aMode); + void onAddOption(); + void itemChanged(QTreeWidgetItem * tblRow, int column); + void onMeshDimChanged(ADAPTATION_MODE aMode); private slots: - void _onWorkingDirectoryPushButton(); + void _onWorkingDirectoryPushButton(); private: - void setOptionValue(QString& option, QString& value); - std::map optionTreeWidgetItem; + void setOptionValue(QString& option, QString& value); + std::map optionTreeWidgetItem; - QTreeWidgetItem* getNewQTreeWidgetItem(QTreeWidget* table, const char* option, QString& name, bool isCustom); + QTreeWidgetItem* getNewQTreeWidgetItem(QTreeWidget* table, const char* option, QString& name, bool isCustom); }; @@ -307,26 +307,23 @@ enum { EDITABLE_ROLE = Qt::UserRole + 1, PARAM_NAME, NAME_COL = 0, VALUE_COL }; - - class ItemDelegate: public QItemDelegate { public: - ItemDelegate(QObject* parent=0): QItemDelegate(parent) {} - QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &o, const QModelIndex &index) const; + ItemDelegate(QObject* parent=0): QItemDelegate(parent) {} + QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &o, const QModelIndex &index) const; }; class MgAdaptAdvWidgetTreeWidget : public QTreeWidget { - Q_OBJECT + Q_OBJECT public: - MgAdaptAdvWidgetTreeWidget( QWidget* ); + MgAdaptAdvWidgetTreeWidget( QWidget* ); protected: - QModelIndex moveCursor( CursorAction, Qt::KeyboardModifiers ); - void keyPressEvent( QKeyEvent* ); + QModelIndex moveCursor( CursorAction, Qt::KeyboardModifiers ); + void keyPressEvent( QKeyEvent* ); }; - #endif // MG_ADAPTGUI_HXX diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index c66890cf3..a16812234 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -5154,7 +5154,7 @@ bool SMESHGUI::activateModule( SUIT_Study* study ) lab = lab + tr("INFO_COMPUTE") + "
"; lab = lab + tr("INFO_REFINE") + ":"; items << wrap(tr("INFO_REFINE_LOCAL_SIZE"), "li") - << wrap(tr("INFO_REFINE_SUBMESH"), "li"); + << wrap(tr("INFO_REFINE_SUBMESH"), "li"); lab = lab + wrap(items.join(""), "ul"); items.clear(); @@ -5162,11 +5162,11 @@ bool SMESHGUI::activateModule( SUIT_Study* study ) gb = app->infoPanel()->addGroup(tr("INFO_GRP_IMPORT_MESH")); items << wrap("UNV", "li") - << wrap("MED", "li") - << wrap("STL", "li") - << wrap("CGNS", "li") - << wrap("SAUV", "li") - << wrap("GMF", "li"); + << wrap("MED", "li") + << wrap("STL", "li") + << wrap("CGNS", "li") + << wrap("SAUV", "li") + << wrap("GMF", "li"); lab = tr("INFO_AVAILABLE_FORMATS") + ":" + wrap(items.join(""), "ul"); items.clear(); @@ -5175,9 +5175,9 @@ bool SMESHGUI::activateModule( SUIT_Study* study ) gb = app->infoPanel()->addGroup(tr("INFO_GRP_CHECK_MESH")); lab = tr("INFO_DISPLAY") + "
"; items << wrap(tr("INFO_QUALITY_AREA"), "li") - << wrap(tr("INFO_QUALITY_VOLUME"), "li") - << wrap(tr("INFO_QUALITY_ASPECT_RATION"), "li") - << wrap("...", "li"); + << wrap(tr("INFO_QUALITY_VOLUME"), "li") + << wrap(tr("INFO_QUALITY_ASPECT_RATION"), "li") + << wrap("...", "li"); lab = lab + tr("INFO_QUALITY_INFO") + ":" + wrap(items.join(""), "ul"); items.clear(); lab = lab + tr("INFO_CLIPPING"); diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx index 8121932be..a37c196d3 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx @@ -146,7 +146,7 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) SMESH::MG_ADAPT_ptr model = SMESHGUI::GetSMESHGen()->CreateMG_ADAPT(); bool isCreation = false; - if (mySMESHGUI->isStudyLocked()) break; + if (mySMESHGUI->isStudyLocked()) break; mySMESHGUI->EmitSignalDeactivateDialog(); SMESHGUI_MG_ADAPTDRIVER *mgAdapt = new SMESHGUI_MG_ADAPTDRIVER(mySMESHGUI, model, isCreation); mgAdapt->show(); diff --git a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx index 85a719b40..77ccb41d2 100644 --- a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx +++ b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx @@ -104,8 +104,8 @@ #include -const int SPACING = 6; // layout spacing -const int MARGIN = 9; // layout margin +const int SPACING = 6; // layout spacing +const int MARGIN = 9; // layout margin SALOME_ListIO mySelected; @@ -116,8 +116,8 @@ SALOME_ListIO mySelected; //================================================================ Handle(SALOME_InteractiveObject) firstIObject() { - const SALOME_ListIO& aList = selectedIO(); - return aList.Extent() > 0 ? aList.First() : Handle(SALOME_InteractiveObject)(); + const SALOME_ListIO& aList = selectedIO(); + return aList.Extent() > 0 ? aList.First() : Handle(SALOME_InteractiveObject)(); } //================================================================ // Function : selectedIO @@ -125,15 +125,15 @@ Handle(SALOME_InteractiveObject) firstIObject() //================================================================ const SALOME_ListIO& selectedIO() { - SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* > ( SUIT_Session::session()->activeApplication() ); - LightApp_SelectionMgr* aSelectionMgr = app->selectionMgr(); - if( aSelectionMgr ) - { - aSelectionMgr->selectedObjects( mySelected ); - for (SALOME_ListIteratorOfListIO it (mySelected); it.More(); it.Next()) - SCRUTE(it.Value()->getEntry()); - }; - return mySelected; + SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* > ( SUIT_Session::session()->activeApplication() ); + LightApp_SelectionMgr* aSelectionMgr = app->selectionMgr(); + if( aSelectionMgr ) + { + aSelectionMgr->selectedObjects( mySelected ); + for (SALOME_ListIteratorOfListIO it (mySelected); it.More(); it.Next()) + SCRUTE(it.Value()->getEntry()); + }; + return mySelected; } //================================================================ // Function : getStudy @@ -141,76 +141,78 @@ const SALOME_ListIO& selectedIO() //================================================================ _PTR(Study) getStudy() { - static _PTR(Study) _study; - if(!_study) - _study = SalomeApp_Application::getStudy(); - return _study; + static _PTR(Study) _study; + if(!_study) + _study = SalomeApp_Application::getStudy(); + return _study; } bool createAndPublishMed(QString fileName) { - SMESH::DriverMED_ReadStatus res; - SMESH::mesh_array_var aMeshes = new SMESH::mesh_array; - // SMESHGUI aGui; + SMESH::DriverMED_ReadStatus res; + SMESH::mesh_array_var aMeshes = new SMESH::mesh_array; + // SMESHGUI aGui; - aMeshes = SMESHGUI::GetSMESHGen()->CreateMeshesFromMED( fileName.toUtf8().constData(), res ); - _PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshes[0] ); - _PTR(Study) aStudy = SMESH::getStudy(); - QStringList anEntryList; - // bool isEmpty; - if ( aMeshSO ) { - _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder(); - _PTR(AttributePixMap) aPixmap = aBuilder->FindOrCreateAttribute( aMeshSO, "AttributePixMap" ); - aPixmap->SetPixMap( "ICON_SMESH_TREE_MESH_IMPORTED" ); - anEntryList.append( aMeshSO->GetID().c_str() ); - } - else { - // isEmpty = true; - return false; - } - SMESHGUI::GetSMESHGUI()->updateObjBrowser(); + aMeshes = SMESHGUI::GetSMESHGen()->CreateMeshesFromMED( fileName.toUtf8().constData(), res ); + _PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshes[0] ); + _PTR(Study) aStudy = SMESH::getStudy(); + QStringList anEntryList; + // bool isEmpty; + if ( aMeshSO ) + { + _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder(); + _PTR(AttributePixMap) aPixmap = aBuilder->FindOrCreateAttribute( aMeshSO, "AttributePixMap" ); + aPixmap->SetPixMap( "ICON_SMESH_TREE_MESH_IMPORTED" ); + anEntryList.append( aMeshSO->GetID().c_str() ); + } + else + { + // isEmpty = true; + return false; + } + SMESHGUI::GetSMESHGUI()->updateObjBrowser(); - // browse to the published meshes - if( LightApp_Application* anApp = - dynamic_cast( SUIT_Session::session()->activeApplication() ) ) - anApp->browseObjects( anEntryList ); - return true; + // browse to the published meshes + if( LightApp_Application* anApp = + dynamic_cast( SUIT_Session::session()->activeApplication() ) ) + anApp->browseObjects( anEntryList ); + return true; } bool createMgAdaptObject(MgAdapt *myMgAdapt ) { - // SMESH::SMESH_Mesh_var newMesh = SMESHGUI::GetSMESHGen()->CreateEmptyMesh(); + // SMESH::SMESH_Mesh_var newMesh = SMESHGUI::GetSMESHGen()->CreateEmptyMesh(); - // _PTR(SObject) aHypothesis; - _PTR(Study) aStudy = SMESH::getStudy(); - QStringList anEntryList; - _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder(); - _PTR(SComponent) mgadapt = aStudy->FindComponent("MG-ADAPT"); - _PTR(GenericAttribute) ga; - if (!aBuilder->FindAttribute(mgadapt, ga, "AttributeName") ) - { - mgadapt = aBuilder->NewComponent("MG-ADAPT"); - _PTR(AttributeName) Name = aBuilder->FindOrCreateAttribute(mgadapt, "AttributeName"); - Name->SetValue("MG-ADAPT"); - _PTR(AttributePixMap) myPixmap = aBuilder->FindOrCreateAttribute( mgadapt, "AttributePixMap" ); - myPixmap->SetPixMap( "ICON_MG_ADAPT" ); - anEntryList.append( mgadapt->GetID().c_str() ); - } + // _PTR(SObject) aHypothesis; + _PTR(Study) aStudy = SMESH::getStudy(); + QStringList anEntryList; + _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder(); + _PTR(SComponent) mgadapt = aStudy->FindComponent("MG-ADAPT"); + _PTR(GenericAttribute) ga; + if (!aBuilder->FindAttribute(mgadapt, ga, "AttributeName") ) + { + mgadapt = aBuilder->NewComponent("MG-ADAPT"); + _PTR(AttributeName) Name = aBuilder->FindOrCreateAttribute(mgadapt, "AttributeName"); + Name->SetValue("MG-ADAPT"); + _PTR(AttributePixMap) myPixmap = aBuilder->FindOrCreateAttribute( mgadapt, "AttributePixMap" ); + myPixmap->SetPixMap( "ICON_MG_ADAPT" ); + anEntryList.append( mgadapt->GetID().c_str() ); + } - _PTR(SObject) obj = aBuilder->NewObject(mgadapt); - _PTR(AttributeName) myName = aBuilder->FindOrCreateAttribute(obj, "AttributeName"); - myName->SetValue("hypo"); - _PTR(AttributePixMap) aPixmap = aBuilder->FindOrCreateAttribute( obj, "AttributePixMap" ); - aPixmap->SetPixMap( "ICON_SMESH_TREE_HYPO" ); - anEntryList.append( obj->GetID().c_str() ); + _PTR(SObject) obj = aBuilder->NewObject(mgadapt); + _PTR(AttributeName) myName = aBuilder->FindOrCreateAttribute(obj, "AttributeName"); + myName->SetValue("hypo"); + _PTR(AttributePixMap) aPixmap = aBuilder->FindOrCreateAttribute( obj, "AttributePixMap" ); + aPixmap->SetPixMap( "ICON_SMESH_TREE_HYPO" ); + anEntryList.append( obj->GetID().c_str() ); - SMESHGUI::GetSMESHGUI()->updateObjBrowser(); + SMESHGUI::GetSMESHGUI()->updateObjBrowser(); - // // browse to the published meshes - if( LightApp_Application* anApp = - dynamic_cast( SUIT_Session::session()->activeApplication() ) ) - anApp->browseObjects( anEntryList ); - return true; + // // browse to the published meshes + if( LightApp_Application* anApp = + dynamic_cast( SUIT_Session::session()->activeApplication() ) ) + anApp->browseObjects( anEntryList ); + return true; } @@ -221,122 +223,121 @@ bool createMgAdaptObject(MgAdapt *myMgAdapt ) //================================================================ int IObjectCount() { - SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); - LightApp_SelectionMgr* aSelectionMgr = app->selectionMgr(); - if( aSelectionMgr ) - { - aSelectionMgr->selectedObjects( mySelected ); - SCRUTE(mySelected.Extent()); - return mySelected.Extent(); - } - return 0; + SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); + LightApp_SelectionMgr* aSelectionMgr = app->selectionMgr(); + if( aSelectionMgr ) + { + aSelectionMgr->selectedObjects( mySelected ); + SCRUTE(mySelected.Extent()); + return mySelected.Extent(); + } + return 0; } SMESHGUI_MG_ADAPTDRIVER::SMESHGUI_MG_ADAPTDRIVER( SMESHGUI* theModule, SMESH::MG_ADAPT_ptr myModel, bool isCreation ) - : mySMESHGUI( theModule ), - myFilterDlg(0), - myIsApplyAndClose( false ), - SMESHGUI_MgAdaptDlg((SalomeApp_Module*)theModule, myModel, SMESHGUI::desktop(), isCreation) + : mySMESHGUI( theModule ), + myFilterDlg(0), + myIsApplyAndClose( false ), + SMESHGUI_MgAdaptDlg((SalomeApp_Module*)theModule, myModel, SMESHGUI::desktop(), isCreation) { - resMgr = resourceMgr(); + resMgr = resourceMgr(); - selMgr = selectionMgr(); + selMgr = selectionMgr(); - // connections - connect(myArgs, SIGNAL(updateSelection()), this, SLOT(updateSelection())); - connect(myArgs, SIGNAL(toExportMED(const char*)), this, SLOT(exportMED(const char*))); + // connections + connect(myArgs, SIGNAL(updateSelection()), this, SLOT(updateSelection())); + connect(myArgs, SIGNAL(toExportMED(const char*)), this, SLOT(exportMED(const char*))); } SUIT_ResourceMgr* SMESHGUI_MG_ADAPTDRIVER::resourceMgr() { - return dynamic_cast( SUIT_Session::session()->resourceMgr() ); + return dynamic_cast( SUIT_Session::session()->resourceMgr() ); } LightApp_SelectionMgr* SMESHGUI_MG_ADAPTDRIVER::selectionMgr() { - SalomeApp_Application* anApp = dynamic_cast( SUIT_Session::session()->activeApplication() ); - if( anApp ) - return dynamic_cast( anApp->selectionMgr() ); - else - return 0; + SalomeApp_Application* anApp = dynamic_cast( SUIT_Session::session()->activeApplication() ); + if( anApp ) + return dynamic_cast( anApp->selectionMgr() ); + else + return 0; } void SMESHGUI_MG_ADAPTDRIVER::updateSelection() { - disconnect( selMgr, 0, this, 0 ); - selMgr->clearFilters(); + disconnect( selMgr, 0, this, 0 ); + selMgr->clearFilters(); - SMESH::SetPointRepresentation( true ); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() ) - aViewWindow->SetSelectionMode( ActorSelection ); - if (myArgs->aBrowser->isChecked()) - { - connect( selMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( selectionChanged() )); - selectionChanged(); - } + SMESH::SetPointRepresentation( true ); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() ) + aViewWindow->SetSelectionMode( ActorSelection ); + if (myArgs->aBrowser->isChecked()) + { + connect( selMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( selectionChanged() )); + selectionChanged(); + } } void SMESHGUI_MG_ADAPTDRIVER::selectionChanged() { - //~ get selected mesh - SALOME_ListIO aList; - selMgr->selectedObjects(aList); - QString aString = ""; - int nbSel = aList.Extent(); - if (nbSel != 1) + //~ get selected mesh + SALOME_ListIO aList; + selMgr->selectedObjects(aList); + QString aString = ""; + int nbSel = aList.Extent(); + if (nbSel != 1) + return; + + Handle(SALOME_InteractiveObject) IO = aList.First(); + SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO(IO); + if ( !mesh->_is_nil() ) + { + myMesh = mesh; + + mySelectedObject = SMESH::IObjectToInterface( IO ); + if ( mySelectedObject->_is_nil() ) return; + } + else + return; - Handle(SALOME_InteractiveObject) IO = aList.First(); - SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO(IO); - if ( !mesh->_is_nil() ) - { - myMesh = mesh; - - mySelectedObject = SMESH::IObjectToInterface( IO ); - if ( mySelectedObject->_is_nil() ) - return; - - } - else - return; - - SMESH::GetNameOfSelectedIObjects( selMgr, aString ); - if ( aString.isEmpty() ) aString = " "; - else aString = aString.trimmed(); + SMESH::GetNameOfSelectedIObjects( selMgr, aString ); + if ( aString.isEmpty() ) aString = " "; + else aString = aString.trimmed(); - bool ok = !aString.isEmpty(); - if ( !mesh->_is_nil() ) - { - myArgs->aBrowserObject->setText( aString ); - myArgs->meshNameLineEdit->setText( aString ); - myArgs->selectOutMedFileLineEdit->setText(aString+QString(".med")); - ADAPTATION_MODE aMode; - int nbVolumes = myMesh->NbVolumes(); - int nbFaces = myMesh->NbFaces(); - if(nbFaces > 0 && nbVolumes > 0) aMode = ADAPTATION_MODE::BOTH; - else if(nbFaces > 0) aMode = ADAPTATION_MODE::SURFACE; - else aMode = ADAPTATION_MODE::VOLUME; - emit myArgs->meshDimSignal(aMode); - } + bool ok = !aString.isEmpty(); + if ( !mesh->_is_nil() ) + { + myArgs->aBrowserObject->setText( aString ); + myArgs->meshNameLineEdit->setText( aString ); + myArgs->selectOutMedFileLineEdit->setText(aString+QString(".med")); + ADAPTATION_MODE aMode; + int nbVolumes = myMesh->NbVolumes(); + int nbFaces = myMesh->NbFaces(); + if(nbFaces > 0 && nbVolumes > 0) aMode = ADAPTATION_MODE::BOTH; + else if(nbFaces > 0) aMode = ADAPTATION_MODE::SURFACE; + else aMode = ADAPTATION_MODE::VOLUME; + emit myArgs->meshDimSignal(aMode); + } } void SMESHGUI_MG_ADAPTDRIVER::exportMED(const char* tmp_file) { - bool toOverwrite = true; - bool toFindOutDim = true; - myMesh->ExportMED(tmp_file, false, -1, toOverwrite, toFindOutDim); + bool toOverwrite = true; + bool toFindOutDim = true; + myMesh->ExportMED(tmp_file, false, -1, toOverwrite, toFindOutDim); } void SMESHGUI_MG_ADAPTDRIVER::setMyMesh(SMESH::SMESH_Mesh_var mesh) { - myMesh = mesh; + myMesh = mesh; } SMESH::SMESH_Mesh_var SMESHGUI_MG_ADAPTDRIVER::getMyMesh() { - return myMesh; + return myMesh; } //================================================================================= @@ -345,43 +346,42 @@ SMESH::SMESH_Mesh_var SMESHGUI_MG_ADAPTDRIVER::getMyMesh() //================================================================================= void SMESHGUI_MG_ADAPTDRIVER::clickOnOk() { - setIsApplyAndClose( true ); - clickOnApply(); - reject(); + setIsApplyAndClose( true ); + clickOnApply(); + reject(); } bool SMESHGUI_MG_ADAPTDRIVER::clickOnApply() { - if ( SMESHGUI::isStudyLocked() ) - return false; - if( !isValid() ) - return false; + if ( SMESHGUI::isStudyLocked() ) + return false; + if( !isValid() ) + return false; - SMESHGUI_MgAdaptDlg::clickOnApply(); + SMESHGUI_MgAdaptDlg::clickOnApply(); - bool ok = execute(); - if (getModel()->getPublish()) this->createMeshInObjectBrowser(); + bool ok = execute(); + if (getModel()->getPublish()) this->createMeshInObjectBrowser(); - return ok; + return ok; } bool SMESHGUI_MG_ADAPTDRIVER::execute() { - - int err; - //~std::string errStr; - char* errStr; - try - { - err = getModel()->compute(); - errStr = getModel()->getErrMsg(); - std::string msg = err == 0 ? " ok" : std::string("Not ok \n")+CORBA::string_dup(errStr) ; - } - catch (const std::exception& e) - { - std::cerr<compute(); + errStr = getModel()->getErrMsg(); + std::string msg = err == 0 ? " ok" : std::string("Not ok \n")+CORBA::string_dup(errStr) ; + } + catch (const std::exception& e) + { + std::cerr<clear(); - myNbOkElements = 0; + if ( ResetControls ) + { + myLineEditElements->clear(); + myNbOkElements = 0; - buttonOk->setEnabled(false); - buttonApply->setEnabled(false); + buttonOk->setEnabled(false); + buttonApply->setEnabled(false); - //~myActor = 0; - myMesh = SMESH::SMESH_Mesh::_nil(); + //~myActor = 0; + myMesh = SMESH::SMESH_Mesh::_nil(); - myIdSourceCheck->setChecked(true); + myIdSourceCheck->setChecked(true); - onConstructor( 0 ); - } + onConstructor( 0 ); + } } @@ -418,23 +418,21 @@ void SMESHGUI_MG_ADAPTDRIVER::Init (bool ResetControls) void SMESHGUI_MG_ADAPTDRIVER::onConstructor( int withGeom ) { - myGeomLabel ->setVisible( withGeom ); - myGeomNameEdit ->setVisible( withGeom ); - myReuseHypCheck ->setVisible( withGeom ); - myCopyElementsCheck->setVisible( withGeom ); - myFilterBtn ->setVisible( !withGeom ); - myIdSourceCheck ->setVisible( !withGeom ); + myGeomLabel ->setVisible( withGeom ); + myGeomNameEdit ->setVisible( withGeom ); + myReuseHypCheck ->setVisible( withGeom ); + myCopyElementsCheck->setVisible( withGeom ); + myFilterBtn ->setVisible( !withGeom ); + myIdSourceCheck ->setVisible( !withGeom ); - if ( !withGeom ) - myMeshNameEdit->setText( SMESH::UniqueMeshName("Mesh")); + if ( !withGeom ) + myMeshNameEdit->setText( SMESH::UniqueMeshName("Mesh")); } - //~void SMESHGUI_MG_ADAPTDRIVER::onSelectIdSource( bool ) //~{} - //================================================================================= // function : enterEvent() // purpose : @@ -442,13 +440,13 @@ void SMESHGUI_MG_ADAPTDRIVER::onConstructor( int withGeom ) void SMESHGUI_MG_ADAPTDRIVER::enterEvent (QEvent*) { - // if ( !ConstructorsBox->isEnabled() ) { - // SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ); - // if ( aViewWindow && !mySelector ) { - // mySelector = aViewWindow->GetSelector(); - // } - // activateThisDialog(); - // } + // if ( !ConstructorsBox->isEnabled() ) { + // SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ); + // if ( aViewWindow && !mySelector ) { + // mySelector = aViewWindow->GetSelector(); + // } + // activateThisDialog(); + // } } @@ -459,14 +457,15 @@ void SMESHGUI_MG_ADAPTDRIVER::enterEvent (QEvent*) void SMESHGUI_MG_ADAPTDRIVER::keyPressEvent( QKeyEvent* e ) { - QDialog::keyPressEvent( e ); - if ( e->isAccepted() ) - return; + QDialog::keyPressEvent( e ); + if ( e->isAccepted() ) + return; - if ( e->key() == Qt::Key_F1 ) { - e->accept(); - clickOnHelp(); - } + if ( e->key() == Qt::Key_F1 ) + { + e->accept(); + clickOnHelp(); + } } @@ -477,22 +476,21 @@ void SMESHGUI_MG_ADAPTDRIVER::keyPressEvent( QKeyEvent* e ) void SMESHGUI_MG_ADAPTDRIVER::clickOnHelp() { - LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); - if (app) - app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); - else { - QString platform; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + QString platform; #ifdef WIN32 - platform = "winapplication"; + platform = "winapplication"; #else - platform = "application"; + platform = "application"; #endif - SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); - } + SUIT_MessageBox::warning(this, tr("WRN_WARNING"), + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser",platform)). + arg(myHelpFileName)); + } } @@ -502,74 +500,74 @@ void SMESHGUI_MG_ADAPTDRIVER::clickOnHelp() //======================================================================= QString SMESHGUI_MG_ADAPTDRIVER::getErrorMsg( SMESH::string_array_var theInvalidEntries, - QStringList & theEntriesToBrowse ) + QStringList & theEntriesToBrowse ) { - if ( theInvalidEntries->length() == 0 ) - return tr("OPERATION_FAILED"); + if ( theInvalidEntries->length() == 0 ) + return tr("OPERATION_FAILED"); - // theInvalidEntries - SObject's that hold geometry objects whose - // counterparts are not found in the newGeometry, followed by SObject's - // holding mesh sub-objects that are invalid because they depend on a not found - // preceding sub-shape + // theInvalidEntries - SObject's that hold geometry objects whose + // counterparts are not found in the newGeometry, followed by SObject's + // holding mesh sub-objects that are invalid because they depend on a not found + // preceding sub-shape - QString msg = tr("SUBSHAPES_NOT_FOUND_MSG") + "\n"; + QString msg = tr("SUBSHAPES_NOT_FOUND_MSG") + "\n"; - QString objString; - for ( CORBA::ULong i = 0; i < theInvalidEntries->length(); ++i ) + QString objString; + for ( CORBA::ULong i = 0; i < theInvalidEntries->length(); ++i ) + { + _PTR(SObject) so = SMESH::getStudy()->FindObjectID( theInvalidEntries[i].in() ); + + int objType = SMESHGUI_Selection::type( theInvalidEntries[i].in() ); + if ( objType < 0 ) // geom object { - _PTR(SObject) so = SMESH::getStudy()->FindObjectID( theInvalidEntries[i].in() ); - - int objType = SMESHGUI_Selection::type( theInvalidEntries[i].in() ); - if ( objType < 0 ) // geom object - { - objString += "\n"; - if ( so ) - objString += so->GetName().c_str(); - else - objString += theInvalidEntries[i].in(); // it's something like "FACE #2" - } - else // smesh object - { - theEntriesToBrowse.push_back( theInvalidEntries[i].in() ); - - objString += "\n "; - switch ( objType ) { - case SMESH::MESH: - objString += tr("SMESH_MESH"); - break; - case SMESH::HYPOTHESIS: - objString += tr("SMESH_HYPOTHESIS"); - break; - case SMESH::ALGORITHM: - objString += tr("SMESH_ALGORITHM"); - break; - case SMESH::SUBMESH_VERTEX: - case SMESH::SUBMESH_EDGE: - case SMESH::SUBMESH_FACE: - case SMESH::SUBMESH_SOLID: - case SMESH::SUBMESH_COMPOUND: - case SMESH::SUBMESH: - objString += tr("SMESH_SUBMESH"); - break; - case SMESH::GROUP: - objString += tr("SMESH_GROUP"); - break; - default: - ; - } - objString += " \""; - if ( so ) - objString += so->GetName().c_str(); - objString += "\" ("; - objString += theInvalidEntries[i].in(); - objString += ")"; - } + objString += "\n"; + if ( so ) + objString += so->GetName().c_str(); + else + objString += theInvalidEntries[i].in(); // it's something like "FACE #2" } - if ( !objString.isEmpty() ) - msg += objString; + else // smesh object + { + theEntriesToBrowse.push_back( theInvalidEntries[i].in() ); - return msg; + objString += "\n "; + switch ( objType ) { + case SMESH::MESH: + objString += tr("SMESH_MESH"); + break; + case SMESH::HYPOTHESIS: + objString += tr("SMESH_HYPOTHESIS"); + break; + case SMESH::ALGORITHM: + objString += tr("SMESH_ALGORITHM"); + break; + case SMESH::SUBMESH_VERTEX: + case SMESH::SUBMESH_EDGE: + case SMESH::SUBMESH_FACE: + case SMESH::SUBMESH_SOLID: + case SMESH::SUBMESH_COMPOUND: + case SMESH::SUBMESH: + objString += tr("SMESH_SUBMESH"); + break; + case SMESH::GROUP: + objString += tr("SMESH_GROUP"); + break; + default: + ; + } + objString += " \""; + if ( so ) + objString += so->GetName().c_str(); + objString += "\" ("; + objString += theInvalidEntries[i].in(); + objString += ")"; + } + } + if ( !objString.isEmpty() ) + msg += objString; + + return msg; } //================================================================================= @@ -579,64 +577,66 @@ QString SMESHGUI_MG_ADAPTDRIVER::getErrorMsg( SMESH::string_array_var theInvalid bool SMESHGUI_MG_ADAPTDRIVER::isValid() { - bool ok = true; - return ok; + bool ok = true; + return ok; } bool SMESHGUI_MG_ADAPTDRIVER::createMeshInObjectBrowser() { - QString filename(getModel()->getMedFileOut()); - QStringList errors; - QStringList anEntryList; - bool isEmpty = false; - bool ok = false; - SMESH::SMESH_Gen_var SMESH_Gen_ptr = SMESHGUI::GetSMESHGen(); - if (!SMESH_Gen_ptr) { - std::cerr << "Could not retrieve SMESH_Gen_ptr" << std::endl; - throw SALOME_Exception(LOCALIZED("Could not retrieve SMESH::GetSMESHGen()")); - } - SMESH::mesh_array_var aMeshes = new SMESH::mesh_array; - aMeshes->length( 1 ); // one mesh only - SMESH::DriverMED_ReadStatus res; - aMeshes = SMESH_Gen_ptr->CreateMeshesFromMED( filename.toUtf8().constData(), res ); - if ( res != SMESH::DRS_OK ) { - errors.append( QString( "%1 :\n\t%2" ).arg( filename ).arg( QObject::tr( QString( "SMESH_DRS_%1" ).arg( res ).toLatin1().data() ) ) ); - } - _PTR(Study) aStudy = SMESH::getStudy(); - for ( int i = 0, iEnd = aMeshes->length(); i < iEnd; i++ ) + QString filename(getModel()->getMedFileOut()); + QStringList errors; + QStringList anEntryList; + bool isEmpty = false; + bool ok = false; + SMESH::SMESH_Gen_var SMESH_Gen_ptr = SMESHGUI::GetSMESHGen(); + if (!SMESH_Gen_ptr) { + std::cerr << "Could not retrieve SMESH_Gen_ptr" << std::endl; + throw SALOME_Exception(LOCALIZED("Could not retrieve SMESH::GetSMESHGen()")); + } + SMESH::mesh_array_var aMeshes = new SMESH::mesh_array; + aMeshes->length( 1 ); // one mesh only + SMESH::DriverMED_ReadStatus res; + aMeshes = SMESH_Gen_ptr->CreateMeshesFromMED( filename.toUtf8().constData(), res ); + if ( res != SMESH::DRS_OK ) { + errors.append( QString( "%1 :\n\t%2" ).arg( filename ).arg( QObject::tr( QString( "SMESH_DRS_%1" ).arg( res ).toLatin1().data() ) ) ); + } + _PTR(Study) aStudy = SMESH::getStudy(); + for ( int i = 0, iEnd = aMeshes->length(); i < iEnd; i++ ) + { + _PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshes[i] ); + if ( aMeshSO ) { - _PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshes[i] ); - if ( aMeshSO ) { - _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder(); - _PTR(AttributePixMap) aPixmap = aBuilder->FindOrCreateAttribute( aMeshSO, "AttributePixMap" ); - aPixmap->SetPixMap( "ICON_SMESH_TREE_MESH_IMPORTED" ); // put REFINED mesh ico - anEntryList.append( aMeshSO->GetID().c_str() ); - } - else { - isEmpty = true; - } + _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder(); + _PTR(AttributePixMap) aPixmap = aBuilder->FindOrCreateAttribute( aMeshSO, "AttributePixMap" ); + aPixmap->SetPixMap( "ICON_SMESH_TREE_MESH_IMPORTED" ); // put REFINED mesh ico + anEntryList.append( aMeshSO->GetID().c_str() ); } - // update Object browser - SMESHGUI::GetSMESHGUI()->updateObjBrowser(); - // browse to the published meshes - if( LightApp_Application* anApp = - dynamic_cast( SUIT_Session::session()->activeApplication() ) ) - anApp->browseObjects( anEntryList ); + else + { + isEmpty = true; + } + } + // update Object browser + SMESHGUI::GetSMESHGUI()->updateObjBrowser(); + // browse to the published meshes + if( LightApp_Application* anApp = + dynamic_cast( SUIT_Session::session()->activeApplication() ) ) + anApp->browseObjects( anEntryList ); - // show Error message box if there were errors - if ( errors.count() > 0 ) { - SUIT_MessageBox::critical( SMESHGUI::desktop(), - QObject::tr( "SMESH_ERROR" ), - QObject::tr( "SMESH_IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) ); - } + // show Error message box if there were errors + if ( errors.count() > 0 ) { + SUIT_MessageBox::critical( SMESHGUI::desktop(), + QObject::tr( "SMESH_ERROR" ), + QObject::tr( "SMESH_IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) ); + } - // show warning message box, if some imported mesh is empty - if ( isEmpty ) { - SUIT_MessageBox::warning( SMESHGUI::desktop(), - QObject::tr( "SMESH_WRN_WARNING" ), - QObject::tr( "SMESH_DRS_SOME_EMPTY" ) ); - } - return true; + // show warning message box, if some imported mesh is empty + if ( isEmpty ) { + SUIT_MessageBox::warning( SMESHGUI::desktop(), + QObject::tr( "SMESH_WRN_WARNING" ), + QObject::tr( "SMESH_DRS_SOME_EMPTY" ) ); + } + return true; } //================================================================ @@ -646,7 +646,7 @@ bool SMESHGUI_MG_ADAPTDRIVER::createMeshInObjectBrowser() //================================================================ void SMESHGUI_MG_ADAPTDRIVER::setIsApplyAndClose( const bool theFlag ) { - myIsApplyAndClose = theFlag; + myIsApplyAndClose = theFlag; }//================================================================ // function : isApplyAndClose // Purpose : Get value of the flag indicating that the dialog is @@ -654,7 +654,7 @@ void SMESHGUI_MG_ADAPTDRIVER::setIsApplyAndClose( const bool theFlag ) //================================================================ bool SMESHGUI_MG_ADAPTDRIVER::isApplyAndClose() const { - return myIsApplyAndClose; + return myIsApplyAndClose; } //================================================================================= @@ -663,16 +663,16 @@ bool SMESHGUI_MG_ADAPTDRIVER::isApplyAndClose() const //================================================================================= void SMESHGUI_MG_ADAPTDRIVER::deactivateActiveDialog() { - - if (ConstructorsBox->isEnabled()) { - ConstructorsBox->setEnabled(false); - GroupArguments->setEnabled(false); - GroupButtons->setEnabled(false); - mySMESHGUI->ResetState(); - mySMESHGUI->SetActiveDialogBox(0); - if ( selMgr ) - selMgr->removeFilter( myIdSourceFilter ); - } + if (ConstructorsBox->isEnabled()) + { + ConstructorsBox->setEnabled(false); + GroupArguments->setEnabled(false); + GroupButtons->setEnabled(false); + mySMESHGUI->ResetState(); + mySMESHGUI->SetActiveDialogBox(0); + if ( selMgr ) + selMgr->removeFilter( myIdSourceFilter ); + } } //================================================================================= @@ -682,17 +682,17 @@ void SMESHGUI_MG_ADAPTDRIVER::deactivateActiveDialog() void SMESHGUI_MG_ADAPTDRIVER::activateThisDialog() { - /* Emit a signal to deactivate the active dialog */ - // mySMESHGUI->EmitSignalDeactivateDialog(); - // ConstructorsBox->setEnabled(true); - // GroupArguments->setEnabled(true); - // GroupButtons->setEnabled(true); + /* Emit a signal to deactivate the active dialog */ + // mySMESHGUI->EmitSignalDeactivateDialog(); + // ConstructorsBox->setEnabled(true); + // GroupArguments->setEnabled(true); + // GroupButtons->setEnabled(true); - // mySMESHGUI->SetActiveDialogBox((QDialog*)this); + // mySMESHGUI->SetActiveDialogBox((QDialog*)this); - // onSelectIdSource( myIdSourceCheck->isChecked() ); + // onSelectIdSource( myIdSourceCheck->isChecked() ); - // SelectionIntoArgument(); + // SelectionIntoArgument(); } //================================================================================= @@ -701,29 +701,30 @@ void SMESHGUI_MG_ADAPTDRIVER::activateThisDialog() //================================================================================= void SMESHGUI_MG_ADAPTDRIVER::setFilters() { - if(myMesh->_is_nil()) { - SUIT_MessageBox::critical(this, - tr("SMESH_ERROR"), - tr("NO_MESH_SELECTED")); - return; - } - if ( !myFilterDlg ) - myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL ); + if(myMesh->_is_nil()) + { + SUIT_MessageBox::critical(this, + tr("SMESH_ERROR"), + tr("NO_MESH_SELECTED")); + return; + } + if ( !myFilterDlg ) + myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL ); - QList types; - if ( myMesh->NbEdges() ) types << SMESH::EDGE; - if ( myMesh->NbFaces() ) types << SMESH::FACE; - if ( myMesh->NbVolumes() ) types << SMESH::VOLUME; - if ( myMesh->NbBalls() ) types << SMESH::BALL; - if ( myMesh->Nb0DElements()) types << SMESH::ELEM0D; - if ( types.count() > 1 ) types << SMESH::ALL; + QList types; + if ( myMesh->NbEdges() ) types << SMESH::EDGE; + if ( myMesh->NbFaces() ) types << SMESH::FACE; + if ( myMesh->NbVolumes() ) types << SMESH::VOLUME; + if ( myMesh->NbBalls() ) types << SMESH::BALL; + if ( myMesh->Nb0DElements()) types << SMESH::ELEM0D; + if ( types.count() > 1 ) types << SMESH::ALL; - myFilterDlg->Init( types ); - myFilterDlg->SetSelection(); - myFilterDlg->SetMesh( myMesh ); - myFilterDlg->SetSourceWg( myLineEditElements ); + myFilterDlg->Init( types ); + myFilterDlg->SetSelection(); + myFilterDlg->SetMesh( myMesh ); + myFilterDlg->SetSourceWg( myLineEditElements ); - myFilterDlg->show(); + myFilterDlg->show(); } //================================================================================= @@ -732,13 +733,13 @@ void SMESHGUI_MG_ADAPTDRIVER::setFilters() //================================================================================= void SMESHGUI_MG_ADAPTDRIVER::onOpenView() { - if ( mySelector ) { - SMESH::SetPointRepresentation(false); - } - else { - mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector(); - activateThisDialog(); - } + if ( mySelector ) { + SMESH::SetPointRepresentation(false); + } + else { + mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector(); + activateThisDialog(); + } } //================================================================================= @@ -747,6 +748,6 @@ void SMESHGUI_MG_ADAPTDRIVER::onOpenView() //================================================================================= void SMESHGUI_MG_ADAPTDRIVER::onCloseView() { - deactivateActiveDialog(); - mySelector = 0; + deactivateActiveDialog(); + mySelector = 0; } diff --git a/src/SMESH_I/MG_ADAPT_i.cxx b/src/SMESH_I/MG_ADAPT_i.cxx index befc5beb8..ec2c9d30d 100644 --- a/src/SMESH_I/MG_ADAPT_i.cxx +++ b/src/SMESH_I/MG_ADAPT_i.cxx @@ -40,61 +40,61 @@ using namespace SMESH; void MG_ADAPT_i::copyHypothesisDataToImpl(const SMESH::MgAdaptHypothesisData& from, ::MG_ADAPT::MgAdaptHypothesisData* to) const { - to->myFileInDir = from.myFileInDir; - to->myMeshFileIn = from.myMeshFileIn; - to->myMeshFileBackground = from.myMeshFileBackground; - to->myOutMeshName = from.myOutMeshName; - to->myMeshFileOut = from.myMeshFileOut; - to->myFileOutDir = from.myFileOutDir; - to->myFileSizeMapDir = from.myFileSizeMapDir; - to->myFieldName = from.myFieldName; - to->fromMedFile = from.fromMedFile; - to->myPublish = from.myPublish; - to->myMeshOutMed = from.myMeshOutMed; - to->myUseLocalMap = from.myUseLocalMap; - to->myUseBackgroundMap = from.myUseBackgroundMap; - to->myUseConstantValue = from.myUseConstantValue; - to->myConstantValue = from.myConstantValue; - to->myTimeStep = from.myTimeStep; - to->myRank = from.myRank; - to->myUseNoTimeStep = from.myUseNoTimeStep; - to->myUseLastTimeStep = from.myUseLastTimeStep; - to->myUseChosenTimeStep = from.myUseChosenTimeStep; - to->myWorkingDir = from.myWorkingDir; - to->myLogFile = from.myLogFile; - to->myPrintLogInFile = from.myPrintLogInFile; - to->myKeepFiles = from.myKeepFiles; - to->myRemoveLogOnSuccess = from.myRemoveLogOnSuccess; - to->myVerboseLevel = from.myVerboseLevel; + to->myFileInDir = from.myFileInDir; + to->myMeshFileIn = from.myMeshFileIn; + to->myMeshFileBackground = from.myMeshFileBackground; + to->myOutMeshName = from.myOutMeshName; + to->myMeshFileOut = from.myMeshFileOut; + to->myFileOutDir = from.myFileOutDir; + to->myFileSizeMapDir = from.myFileSizeMapDir; + to->myFieldName = from.myFieldName; + to->fromMedFile = from.fromMedFile; + to->myPublish = from.myPublish; + to->myMeshOutMed = from.myMeshOutMed; + to->myUseLocalMap = from.myUseLocalMap; + to->myUseBackgroundMap = from.myUseBackgroundMap; + to->myUseConstantValue = from.myUseConstantValue; + to->myConstantValue = from.myConstantValue; + to->myTimeStep = from.myTimeStep; + to->myRank = from.myRank; + to->myUseNoTimeStep = from.myUseNoTimeStep; + to->myUseLastTimeStep = from.myUseLastTimeStep; + to->myUseChosenTimeStep = from.myUseChosenTimeStep; + to->myWorkingDir = from.myWorkingDir; + to->myLogFile = from.myLogFile; + to->myPrintLogInFile = from.myPrintLogInFile; + to->myKeepFiles = from.myKeepFiles; + to->myRemoveLogOnSuccess = from.myRemoveLogOnSuccess; + to->myVerboseLevel = from.myVerboseLevel; } void MG_ADAPT_i::copyHypothesisDataFromImpl(const ::MG_ADAPT::MgAdaptHypothesisData* from, SMESH::MgAdaptHypothesisData* to) const { - to->myFileInDir = CORBA::string_dup(from->myFileInDir.c_str()); - to->myMeshFileIn = CORBA::string_dup(from->myMeshFileIn.c_str()); - to->myMeshFileBackground = CORBA::string_dup(from->myMeshFileBackground.c_str()); - to->myOutMeshName = CORBA::string_dup(from->myOutMeshName.c_str()); - to->myMeshFileOut = CORBA::string_dup(from->myMeshFileOut.c_str()); - to->myFileOutDir = CORBA::string_dup(from->myFileOutDir.c_str()); - to->myFileSizeMapDir = CORBA::string_dup(from->myFileSizeMapDir.c_str()); - to->myFieldName = CORBA::string_dup(from->myFieldName.c_str()); - to->fromMedFile = from->fromMedFile; - to->myPublish = from->myPublish; - to->myMeshOutMed = from->myMeshOutMed; - to->myUseLocalMap = from->myUseLocalMap; - to->myUseBackgroundMap = from->myUseBackgroundMap; - to->myUseConstantValue = from->myUseConstantValue; - to->myConstantValue = from->myConstantValue; - to->myTimeStep = from->myTimeStep; - to->myRank = from->myRank; - to->myUseNoTimeStep = from->myUseNoTimeStep; - to->myUseLastTimeStep = from->myUseLastTimeStep; - to->myUseChosenTimeStep = from->myUseChosenTimeStep; - to->myWorkingDir = CORBA::string_dup(from->myWorkingDir.c_str()); - to->myLogFile = CORBA::string_dup(from->myLogFile.c_str()); - to->myPrintLogInFile = from->myPrintLogInFile; - to->myKeepFiles = from->myKeepFiles; - to->myRemoveLogOnSuccess = from->myRemoveLogOnSuccess; - to->myVerboseLevel = from->myVerboseLevel; + to->myFileInDir = CORBA::string_dup(from->myFileInDir.c_str()); + to->myMeshFileIn = CORBA::string_dup(from->myMeshFileIn.c_str()); + to->myMeshFileBackground = CORBA::string_dup(from->myMeshFileBackground.c_str()); + to->myOutMeshName = CORBA::string_dup(from->myOutMeshName.c_str()); + to->myMeshFileOut = CORBA::string_dup(from->myMeshFileOut.c_str()); + to->myFileOutDir = CORBA::string_dup(from->myFileOutDir.c_str()); + to->myFileSizeMapDir = CORBA::string_dup(from->myFileSizeMapDir.c_str()); + to->myFieldName = CORBA::string_dup(from->myFieldName.c_str()); + to->fromMedFile = from->fromMedFile; + to->myPublish = from->myPublish; + to->myMeshOutMed = from->myMeshOutMed; + to->myUseLocalMap = from->myUseLocalMap; + to->myUseBackgroundMap = from->myUseBackgroundMap; + to->myUseConstantValue = from->myUseConstantValue; + to->myConstantValue = from->myConstantValue; + to->myTimeStep = from->myTimeStep; + to->myRank = from->myRank; + to->myUseNoTimeStep = from->myUseNoTimeStep; + to->myUseLastTimeStep = from->myUseLastTimeStep; + to->myUseChosenTimeStep = from->myUseChosenTimeStep; + to->myWorkingDir = CORBA::string_dup(from->myWorkingDir.c_str()); + to->myLogFile = CORBA::string_dup(from->myLogFile.c_str()); + to->myPrintLogInFile = from->myPrintLogInFile; + to->myKeepFiles = from->myKeepFiles; + to->myRemoveLogOnSuccess = from->myRemoveLogOnSuccess; + to->myVerboseLevel = from->myVerboseLevel; } SMESH::MG_ADAPT_ptr SMESH_Gen_i::CreateMG_ADAPT() { @@ -111,12 +111,12 @@ SMESH::MG_ADAPT_ptr SMESH_Gen_i::CreateAdaptationHypothesis() SMESH::MG_ADAPT_OBJECT_ptr SMESH_Gen_i::Adaptation( const char* adaptationType) { - if (!strcmp(adaptationType, "MG_Adapt")){ - SMESH::MG_ADAPT_OBJECT_i* mg_adapt_object = new SMESH::MG_ADAPT_OBJECT_i(); - SMESH::MG_ADAPT_OBJECT_var anObj = mg_adapt_object->_this(); - return anObj._retn(); - } - + if (!strcmp(adaptationType, "MG_Adapt")) + { + SMESH::MG_ADAPT_OBJECT_i* mg_adapt_object = new SMESH::MG_ADAPT_OBJECT_i(); + SMESH::MG_ADAPT_OBJECT_var anObj = mg_adapt_object->_this(); + return anObj._retn(); + } } //~SMESH::MG_ADAPT_ptr MG_ADAPT_i::CreateMG_ADAPT() @@ -165,181 +165,180 @@ MG_ADAPT_i::~MG_ADAPT_i() } void MG_ADAPT_i::setData( SMESH::MgAdaptHypothesisData& data) { - ::MG_ADAPT::MgAdaptHypothesisData* baseData = new ::MG_ADAPT::MgAdaptHypothesisData(); - copyHypothesisDataToImpl(data, baseData); - myMgAdapt->setData(baseData); - delete baseData; + ::MG_ADAPT::MgAdaptHypothesisData* baseData = new ::MG_ADAPT::MgAdaptHypothesisData(); + copyHypothesisDataToImpl(data, baseData); + myMgAdapt->setData(baseData); + delete baseData; } void MG_ADAPT_i::setMedFileIn(const char* str) { - myMgAdapt->setMedFileIn(str); + myMgAdapt->setMedFileIn(str); } char* MG_ADAPT_i::getMedFileIn() { - return CORBA::string_dup(myMgAdapt->getMedFileIn().c_str()); + return CORBA::string_dup(myMgAdapt->getMedFileIn().c_str()); } void MG_ADAPT_i::setMedFileOut(const char* str) { - myMgAdapt->setMedFileOut(str); + myMgAdapt->setMedFileOut(str); } char* MG_ADAPT_i::getMedFileOut() { - return CORBA::string_dup(myMgAdapt->getMedFileOut().c_str()); + return CORBA::string_dup(myMgAdapt->getMedFileOut().c_str()); } void MG_ADAPT_i::setMeshName(const char* str) { - myMgAdapt->setMeshName(str); + myMgAdapt->setMeshName(str); } char* MG_ADAPT_i::getMeshName() { - return CORBA::string_dup(myMgAdapt->getMeshName().c_str()); + return CORBA::string_dup(myMgAdapt->getMeshName().c_str()); } void MG_ADAPT_i::setMeshNameOut(const char* str) { - myMgAdapt->setMeshNameOut(str); + myMgAdapt->setMeshNameOut(str); } char* MG_ADAPT_i::getMeshNameOut() { - return CORBA::string_dup(myMgAdapt->getMeshNameOut().c_str()); + return CORBA::string_dup(myMgAdapt->getMeshNameOut().c_str()); } void MG_ADAPT_i::setMeshOutMed(bool mybool) { - myMgAdapt->setMeshOutMed(mybool); + myMgAdapt->setMeshOutMed(mybool); } bool MG_ADAPT_i::getMeshOutMed() { - return myMgAdapt->getMeshOutMed(); + return myMgAdapt->getMeshOutMed(); } void MG_ADAPT_i::setPublish(bool mybool) { - myMgAdapt->setPublish(mybool); + myMgAdapt->setPublish(mybool); } bool MG_ADAPT_i::getPublish() { - return myMgAdapt->getPublish(); + return myMgAdapt->getPublish(); } void MG_ADAPT_i::setSizeMapFieldName(const char* str) { - myMgAdapt->setFieldName(str); + myMgAdapt->setFieldName(str); } char* MG_ADAPT_i::getSizeMapFieldName() { - return CORBA::string_dup(myMgAdapt->getFieldName().c_str()); + return CORBA::string_dup(myMgAdapt->getFieldName().c_str()); } void MG_ADAPT_i::setTimeStep(CORBA::Long t) { - myMgAdapt->setTimeStep(t); + myMgAdapt->setTimeStep(t); } CORBA::Long MG_ADAPT_i::getTimeStep() { - return myMgAdapt->getTimeStep(); + return myMgAdapt->getTimeStep(); } void MG_ADAPT_i::setTimeStepRank(CORBA::Long t, CORBA::Long r) { - myMgAdapt->setChosenTimeStepRank(); - myMgAdapt->setRankTimeStep(t, r); + myMgAdapt->setChosenTimeStepRank(); + myMgAdapt->setRankTimeStep(t, r); } CORBA::Long MG_ADAPT_i::getRank() { - return myMgAdapt->getRank(); + return myMgAdapt->getRank(); } void MG_ADAPT_i::setTimeStepRankLast() { - myMgAdapt->setTimeStepRankLast(); + myMgAdapt->setTimeStepRankLast(); } void MG_ADAPT_i::setNoTimeStep() { - myMgAdapt->setNoTimeStep(); + myMgAdapt->setNoTimeStep(); } void MG_ADAPT_i::setLogFile(const char* str) { - myMgAdapt->setLogFile(str); + myMgAdapt->setLogFile(str); } char* MG_ADAPT_i::getLogFile() { - return CORBA::string_dup(myMgAdapt->getLogFile().c_str()); + return CORBA::string_dup(myMgAdapt->getLogFile().c_str()); } void MG_ADAPT_i::setVerbosityLevel(CORBA::Long v) { - myMgAdapt->setVerbosityLevel(v); + myMgAdapt->setVerbosityLevel(v); } CORBA::Long MG_ADAPT_i::getVerbosityLevel() { - return myMgAdapt->getVerbosityLevel(); + return myMgAdapt->getVerbosityLevel(); } void MG_ADAPT_i::setRemoveOnSuccess(bool mybool) { - myMgAdapt->setRemoveOnSuccess(mybool); + myMgAdapt->setRemoveOnSuccess(mybool); } bool MG_ADAPT_i::getRemoveOnSuccess() { - myMgAdapt->getRemoveOnSuccess(); + myMgAdapt->getRemoveOnSuccess(); } SMESH::MgAdaptHypothesisData* MG_ADAPT_i::getData() { - SMESH::MgAdaptHypothesisData* result = new SMESH::MgAdaptHypothesisData(); - ::MG_ADAPT::MgAdaptHypothesisData* from = myMgAdapt->getData(); - copyHypothesisDataFromImpl(from, result); - return result; + SMESH::MgAdaptHypothesisData* result = new SMESH::MgAdaptHypothesisData(); + ::MG_ADAPT::MgAdaptHypothesisData* from = myMgAdapt->getData(); + copyHypothesisDataFromImpl(from, result); + return result; } void MG_ADAPT_i::setUseLocalMap(bool mybool) { - myMgAdapt->setUseLocalMap(mybool); + myMgAdapt->setUseLocalMap(mybool); } bool MG_ADAPT_i::getUseLocalMap() { - return myMgAdapt->getUseLocalMap(); + return myMgAdapt->getUseLocalMap(); } void MG_ADAPT_i::setUseBackgroundMap(bool mybool) { - myMgAdapt->setUseBackgroundMap(mybool); + myMgAdapt->setUseBackgroundMap(mybool); } bool MG_ADAPT_i::getUseBackgroundMap() { - return myMgAdapt->getUseBackgroundMap(); + return myMgAdapt->getUseBackgroundMap(); } void MG_ADAPT_i::setUseConstantValue(bool mybool) { - myMgAdapt->setUseConstantValue(mybool); + myMgAdapt->setUseConstantValue(mybool); } bool MG_ADAPT_i::getUseConstantValue() { - return myMgAdapt->getUseConstantValue(); + return myMgAdapt->getUseConstantValue(); } - void MG_ADAPT_i::setConstantSize(double value) { - myMgAdapt->setConstantValue(value); + myMgAdapt->setConstantValue(value); } double MG_ADAPT_i::getConstantSize() { - return myMgAdapt->getConstantValue(); + return myMgAdapt->getConstantValue(); } void MG_ADAPT_i::setSizeMapFile(const char* str) { - myMgAdapt->setSizeMapFile(str); + myMgAdapt->setSizeMapFile(str); } char* MG_ADAPT_i::getSizeMapFile() { - return CORBA::string_dup(myMgAdapt->getSizeMapFile().c_str()); + return CORBA::string_dup(myMgAdapt->getSizeMapFile().c_str()); } void MG_ADAPT_i::setFromMedFile(bool mybool) { - myMgAdapt->setFromMedFile(mybool); + myMgAdapt->setFromMedFile(mybool); } bool MG_ADAPT_i::isFromMedFile() { - return myMgAdapt->isFromMedFile(); + return myMgAdapt->isFromMedFile(); } void MG_ADAPT_i::setKeepWorkingFiles(bool mybool) { - myMgAdapt->setKeepWorkingFiles(mybool); + myMgAdapt->setKeepWorkingFiles(mybool); } bool MG_ADAPT_i::getKeepWorkingFiles() { - return myMgAdapt->getKeepWorkingFiles(); + return myMgAdapt->getKeepWorkingFiles(); } //~void MG_ADAPT_i::setPrCORBA::LongLogInFile(bool); @@ -347,193 +346,193 @@ bool MG_ADAPT_i::getKeepWorkingFiles() void MG_ADAPT_i::setSizeMapType(const char* type) { - setUseLocalMap(false); - setUseBackgroundMap(false); - setUseConstantValue(false); + setUseLocalMap(false); + setUseBackgroundMap(false); + setUseConstantValue(false); - if (!strcmp("Local", type)) - setUseLocalMap(true); - else if (!strcmp("Background", type)) - setUseBackgroundMap(true); - else - setUseConstantValue(true); + if (!strcmp("Local", type)) + setUseLocalMap(true); + else if (!strcmp("Background", type)) + setUseBackgroundMap(true); + else + setUseConstantValue(true); } void MG_ADAPT_i::setWorkingDir(const char* dir) { - myMgAdapt->setWorkingDir(dir); + myMgAdapt->setWorkingDir(dir); } char* MG_ADAPT_i::getWorkingDir() { - return CORBA::string_dup(myMgAdapt->getWorkingDir().c_str()); + return CORBA::string_dup(myMgAdapt->getWorkingDir().c_str()); } bool MG_ADAPT_i::setAll() { - return myMgAdapt->setAll(); + return myMgAdapt->setAll(); } char* MG_ADAPT_i::getCommandToRun() { - return CORBA::string_dup(myMgAdapt->getCommandToRun().c_str()); + return CORBA::string_dup(myMgAdapt->getCommandToRun().c_str()); } //~CORBA::Long MG_ADAPT_i::compute(::CORBA::String_out errStr) //~{ - //~std::string err(""); - //~CORBA::Long ret = myMgAdapt->compute(err); - //~errStr = err.c_str(); - //~return ret; + //~std::string err(""); + //~CORBA::Long ret = myMgAdapt->compute(err); + //~errStr = err.c_str(); + //~return ret; //~} CORBA::Long MG_ADAPT_i::compute() { - errStr = ""; - CORBA::Long ret; - try - { - ret = myMgAdapt->compute(errStr); - } - catch (const std::exception& e) - { - std::cerr<getPublish()) - { - SMESH_Gen_i* smeshGen_i = SMESH_Gen_i::GetSMESHGen(); - SMESH::DriverMED_ReadStatus theStatus; - smeshGen_i->CreateMeshesFromMED(myMgAdapt->getMedFileOut().c_str(), theStatus); - } - //~errStr = err.c_str(); - return ret; + errStr = ""; + CORBA::Long ret; + try + { + ret = myMgAdapt->compute(errStr); + } + catch (const std::exception& e) + { + std::cerr<getPublish()) + { + SMESH_Gen_i* smeshGen_i = SMESH_Gen_i::GetSMESHGen(); + SMESH::DriverMED_ReadStatus theStatus; + smeshGen_i->CreateMeshesFromMED(myMgAdapt->getMedFileOut().c_str(), theStatus); + } + //~errStr = err.c_str(); + return ret; } char* MG_ADAPT_i::getErrMsg() { - return CORBA::string_dup(errStr.c_str()); + return CORBA::string_dup(errStr.c_str()); } char* MG_ADAPT_i::getFileName() { - return CORBA::string_dup(myMgAdapt->getFileName().c_str()); + return CORBA::string_dup(myMgAdapt->getFileName().c_str()); } char* MG_ADAPT_i::getExeName() { - return CORBA::string_dup(myMgAdapt->getExeName().c_str()); + return CORBA::string_dup(myMgAdapt->getExeName().c_str()); } void MG_ADAPT_i::copyMgAdaptHypothesisData( const SMESH::MgAdaptHypothesisData& data) { - ::MG_ADAPT::MgAdaptHypothesisData* baseData = new ::MG_ADAPT::MgAdaptHypothesisData(); - copyHypothesisDataToImpl(data, baseData); - myMgAdapt->copyMgAdaptHypothesisData(baseData); - delete baseData; + ::MG_ADAPT::MgAdaptHypothesisData* baseData = new ::MG_ADAPT::MgAdaptHypothesisData(); + copyHypothesisDataToImpl(data, baseData); + myMgAdapt->copyMgAdaptHypothesisData(baseData); + delete baseData; } //~void MG_ADAPT_i::checkDirPath(char*& str) //~{ - //~myMgAdapt->checkDirPath(str); + //~myMgAdapt->checkDirPath(str); //~} bool MG_ADAPT_i::hasOptionDefined( const char* optionName ) { - return myMgAdapt->hasOptionDefined(optionName); + return myMgAdapt->hasOptionDefined(optionName); } void MG_ADAPT_i::setOptionValue(const char* optionName, - const char* optionValue) throw (std::invalid_argument) + const char* optionValue) throw (std::invalid_argument) { - myMgAdapt->setOptionValue(optionName, optionValue); + myMgAdapt->setOptionValue(optionName, optionValue); } char* MG_ADAPT_i::getOptionValue(const char* optionName, - bool& isDefault) throw (std::invalid_argument) + bool& isDefault) throw (std::invalid_argument) { - return CORBA::string_dup(myMgAdapt->getOptionValue(optionName, &isDefault).c_str()); + return CORBA::string_dup(myMgAdapt->getOptionValue(optionName, &isDefault).c_str()); } str_array* MG_ADAPT_i::getCustomOptionValuesStrVec() { - SMESH::str_array_var result = new SMESH::str_array(); - std::vector vals = myMgAdapt->getCustomOptionValuesStrVec(); - result->length(vals.size()); - for (int i = 0; i vals = myMgAdapt->getCustomOptionValuesStrVec(); + result->length(vals.size()); + for (int i = 0; i vals = myMgAdapt->getOptionValuesStrVec(); - result->length(vals.size()); - for (int i = 0; i vals = myMgAdapt->getOptionValuesStrVec(); + result->length(vals.size()); + for (int i = 0; isetPrintLogInFile(mybool); + myMgAdapt->setPrintLogInFile(mybool); } bool MG_ADAPT_i::getPrintLogInFile() { - return myMgAdapt->getPrintLogInFile(); + return myMgAdapt->getPrintLogInFile(); } //~TOptionValues MG_ADAPT_i::getOptionValues() const; //~const TOptionValues& MG_ADAPT_i::getCustomOptionValues() const ; MG_ADAPT_OBJECT_i::MG_ADAPT_OBJECT_i(): SALOME::GenericObj_i( SMESH_Gen_i::GetPOA() ) { - medFileIn=""; - medFileOut=""; - medFileBackground=""; - publish = false; - //~myMesh = CORBA::nil; + medFileIn=""; + medFileOut=""; + medFileBackground=""; + publish = false; + //~myMesh = CORBA::nil; } void MG_ADAPT_OBJECT_i::setMeshIn(SMESH::SMESH_Mesh_ptr theMesh ) { - myMesh = SMESH::SMESH_Mesh::_duplicate(theMesh); + myMesh = SMESH::SMESH_Mesh::_duplicate(theMesh); } void MG_ADAPT_OBJECT_i::setMEDFileIn(const char* f) { - medFileIn = f; + medFileIn = f; } void MG_ADAPT_OBJECT_i::setMEDFileOut(const char* f) { - medFileOut = f; + medFileOut = f; } void MG_ADAPT_OBJECT_i::setMEDFileBackground(const char* f) { - medFileBackground = f; + medFileBackground = f; } void MG_ADAPT_OBJECT_i::AddHypothesis(SMESH::MG_ADAPT_ptr mg) { - mg->setMedFileIn(medFileIn.c_str()); - mg->setMedFileOut(medFileOut.c_str()); - mg->setSizeMapFile(medFileBackground.c_str()); - hypothesis = SMESH::MG_ADAPT::_duplicate(mg); + mg->setMedFileIn(medFileIn.c_str()); + mg->setMedFileOut(medFileOut.c_str()); + mg->setSizeMapFile(medFileBackground.c_str()); + hypothesis = SMESH::MG_ADAPT::_duplicate(mg); } CORBA::Long MG_ADAPT_OBJECT_i::Compute(bool publish) { - if(!checkMeshFileIn()){ - std::cerr<< "\n Error : Please check the MED file input or mesh input. \n"; - return -1; - } - hypothesis->setPublish(publish); - return hypothesis->compute(); + if(!checkMeshFileIn()){ + std::cerr<< "\n Error : Please check the MED file input or mesh input. \n"; + return -1; + } + hypothesis->setPublish(publish); + return hypothesis->compute(); } bool MG_ADAPT_OBJECT_i::checkMeshFileIn() { - bool ret = false; // 1 ok , 0 nook - if(!::MG_ADAPT::MgAdapt::isFileExist(medFileIn)) + bool ret = false; // 1 ok , 0 nook + if(!::MG_ADAPT::MgAdapt::isFileExist(medFileIn)) + { + if(!myMesh->_is_nil()) { - if(!myMesh->_is_nil()) - { - bool toOverwrite = true; - bool toFindOutDim = true; - medFileIn = hypothesis->getFileName(); - medFileIn+= ".med"; - myMesh->ExportMED(medFileIn.c_str(), false, -1, toOverwrite, toFindOutDim); - hypothesis->setMedFileIn(medFileIn.c_str()); - ret = true; - } - } - else - ret = true; + bool toOverwrite = true; + bool toFindOutDim = true; + medFileIn = hypothesis->getFileName(); + medFileIn+= ".med"; + myMesh->ExportMED(medFileIn.c_str(), false, -1, toOverwrite, toFindOutDim); + hypothesis->setMedFileIn(medFileIn.c_str()); + ret = true; + } + } + else + ret = true; - return ret; + return ret; } diff --git a/src/SMESH_I/MG_ADAPT_i.hxx b/src/SMESH_I/MG_ADAPT_i.hxx index daedce449..b25953175 100644 --- a/src/SMESH_I/MG_ADAPT_i.hxx +++ b/src/SMESH_I/MG_ADAPT_i.hxx @@ -28,129 +28,129 @@ class SMESH_I_EXPORT MG_ADAPT_i : public virtual POA_SMESH::MG_ADAPT { public: - //~MG_ADAPT_i( CORBA::ORB_ptr orb, ADAPT::ADAPT_Gen_var gen_i ); - //~static SMESH::MG_ADAPT_ptr CreateMG_ADAPT(); - //~MG_ADAPT_i(PortableServer::POA_var poa); - MG_ADAPT_i(); - virtual ~MG_ADAPT_i(); - //~void setData( SMESH::MgAdaptHypothesisData* data); - void setData( SMESH::MgAdaptHypothesisData& data); + //~MG_ADAPT_i( CORBA::ORB_ptr orb, ADAPT::ADAPT_Gen_var gen_i ); + //~static SMESH::MG_ADAPT_ptr CreateMG_ADAPT(); + //~MG_ADAPT_i(PortableServer::POA_var poa); + MG_ADAPT_i(); + virtual ~MG_ADAPT_i(); + //~void setData( SMESH::MgAdaptHypothesisData* data); + void setData( SMESH::MgAdaptHypothesisData& data); - void setMedFileIn(const char* str); - char* getMedFileIn(); + void setMedFileIn(const char* str); + char* getMedFileIn(); - void setMedFileOut(const char* str); - char* getMedFileOut(); + void setMedFileOut(const char* str); + char* getMedFileOut(); - void setMeshName(const char* str); - char* getMeshName(); + void setMeshName(const char* str); + char* getMeshName(); - void setMeshNameOut(const char* str); - char* getMeshNameOut(); + void setMeshNameOut(const char* str); + char* getMeshNameOut(); - void setMeshOutMed(bool mybool); - bool getMeshOutMed(); + void setMeshOutMed(bool mybool); + bool getMeshOutMed(); - void setPublish(bool mybool); - bool getPublish(); + void setPublish(bool mybool); + bool getPublish(); - void setSizeMapFieldName(const char* str); - char* getSizeMapFieldName(); + void setSizeMapFieldName(const char* str); + char* getSizeMapFieldName(); - void setTimeStep(CORBA::Long t); - CORBA::Long getTimeStep() ; + void setTimeStep(CORBA::Long t); + CORBA::Long getTimeStep() ; - void setTimeStepRank(CORBA::Long t, CORBA::Long r ); - CORBA::Long getRank(); - - void setTimeStepRankLast(); - void setNoTimeStep(); + void setTimeStepRank(CORBA::Long t, CORBA::Long r ); + CORBA::Long getRank(); - void setLogFile(const char* str); - char* getLogFile(); + void setTimeStepRankLast(); + void setNoTimeStep(); - void setVerbosityLevel(CORBA::Long v); - CORBA::Long getVerbosityLevel(); + void setLogFile(const char* str); + char* getLogFile(); - void setRemoveOnSuccess(bool mybool); - bool getRemoveOnSuccess(); + void setVerbosityLevel(CORBA::Long v); + CORBA::Long getVerbosityLevel(); - SMESH::MgAdaptHypothesisData* getData() ; - void setSizeMapType(const char* type); - void setUseLocalMap(bool mybool); - bool getUseLocalMap(); + void setRemoveOnSuccess(bool mybool); + bool getRemoveOnSuccess(); - void setUseBackgroundMap(bool mybool); - bool getUseBackgroundMap(); + SMESH::MgAdaptHypothesisData* getData() ; + void setSizeMapType(const char* type); + void setUseLocalMap(bool mybool); + bool getUseLocalMap(); - void setUseConstantValue(bool mybool); - bool getUseConstantValue(); + void setUseBackgroundMap(bool mybool); + bool getUseBackgroundMap(); - void setConstantSize(double value); - double getConstantSize(); + void setUseConstantValue(bool mybool); + bool getUseConstantValue(); - void setSizeMapFile(const char* str); - char* getSizeMapFile(); + void setConstantSize(double value); + double getConstantSize(); - void setFromMedFile(bool mybool); - bool isFromMedFile(); + void setSizeMapFile(const char* str); + char* getSizeMapFile(); - void setKeepWorkingFiles(bool mybool); - bool getKeepWorkingFiles(); + void setFromMedFile(bool mybool); + bool isFromMedFile(); - //~void setPrCORBA::LongLogInFile(bool); - //~bool getPrCORBA::LongLogInFile(); + void setKeepWorkingFiles(bool mybool); + bool getKeepWorkingFiles(); - void setWorkingDir(const char* str); - char* getWorkingDir() ; + //~void setPrCORBA::LongLogInFile(bool); + //~bool getPrCORBA::LongLogInFile(); - void setPrintLogInFile(bool mybool); - bool getPrintLogInFile(); - - bool setAll(); - char* getCommandToRun() ; - //~CORBA::Long compute(::CORBA::String_out errStr); - CORBA::Long compute(); - char* getFileName(); - char* getExeName(); - void copyMgAdaptHypothesisData( const SMESH::MgAdaptHypothesisData& data ) ; - //~void copyMgAdaptHypothesisData( const SMESH::MgAdaptHypothesisData& data ) { - //~copyMgAdaptHypothesisData(&data); - //~} + void setWorkingDir(const char* str); + char* getWorkingDir() ; - //~void checkDirPath(char*& str); - - bool hasOptionDefined( const char* optionName ) ; - void setOptionValue(const char* optionName, - const char* optionValue) throw (std::invalid_argument); - char* getOptionValue(const char* optionName, - bool& isDefault) throw (std::invalid_argument); - str_array* getCustomOptionValuesStrVec() ; - str_array* getOptionValuesStrVec() ; - void copyHypothesisDataFromImpl(const ::MG_ADAPT::MgAdaptHypothesisData* from, SMESH::MgAdaptHypothesisData* to) const; - void copyHypothesisDataToImpl(const SMESH::MgAdaptHypothesisData& from, ::MG_ADAPT::MgAdaptHypothesisData* to) const; - //~TOptionValues getOptionValues() const; - //~const TOptionValues& getCustomOptionValues() const ; - char* getErrMsg(); + void setPrintLogInFile(bool mybool); + bool getPrintLogInFile(); + + bool setAll(); + char* getCommandToRun() ; + //~CORBA::Long compute(::CORBA::String_out errStr); + CORBA::Long compute(); + char* getFileName(); + char* getExeName(); + void copyMgAdaptHypothesisData( const SMESH::MgAdaptHypothesisData& data ) ; + //~void copyMgAdaptHypothesisData( const SMESH::MgAdaptHypothesisData& data ) { + //~copyMgAdaptHypothesisData(&data); + //~} + + //~void checkDirPath(char*& str); + + bool hasOptionDefined( const char* optionName ) ; + void setOptionValue(const char* optionName, + const char* optionValue) throw (std::invalid_argument); + char* getOptionValue(const char* optionName, + bool& isDefault) throw (std::invalid_argument); + str_array* getCustomOptionValuesStrVec() ; + str_array* getOptionValuesStrVec() ; + void copyHypothesisDataFromImpl(const ::MG_ADAPT::MgAdaptHypothesisData* from, SMESH::MgAdaptHypothesisData* to) const; + void copyHypothesisDataToImpl(const SMESH::MgAdaptHypothesisData& from, ::MG_ADAPT::MgAdaptHypothesisData* to) const; + //~TOptionValues getOptionValues() const; + //~const TOptionValues& getCustomOptionValues() const ; + char* getErrMsg(); private: ::MG_ADAPT::MgAdapt* myMgAdapt; std::string errStr; //~CORBA::ORB_ptr _orb; //~ADAPT::ADAPT_Gen_var _gen_i; - + }; class SMESH_I_EXPORT MG_ADAPT_OBJECT_i: - public virtual SALOME::GenericObj_i, - public virtual POA_SMESH::MG_ADAPT_OBJECT { + public virtual SALOME::GenericObj_i, + public virtual POA_SMESH::MG_ADAPT_OBJECT { public : - MG_ADAPT_OBJECT_i(); - void setMeshIn( SMESH::SMESH_Mesh_ptr theMesh ); - void setMEDFileIn(const char* f); - void setMEDFileOut(const char* f); - void setMEDFileBackground(const char* f); - void AddHypothesis(SMESH::MG_ADAPT_ptr); - CORBA::Long Compute(bool Publish); + MG_ADAPT_OBJECT_i(); + void setMeshIn( SMESH::SMESH_Mesh_ptr theMesh ); + void setMEDFileIn(const char* f); + void setMEDFileOut(const char* f); + void setMEDFileBackground(const char* f); + void AddHypothesis(SMESH::MG_ADAPT_ptr); + CORBA::Long Compute(bool Publish); private: std::string medFileIn, medFileOut, medFileBackground; bool checkMeshFileIn(); From 7a00196b6343ad4e34f095b5ad3f97c0d63aa440 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Mon, 8 Feb 2021 15:28:54 +0100 Subject: [PATCH 076/100] Documentation --- doc/salome/gui/SMESH/images/adaptation_01.png | Bin 0 -> 27514 bytes doc/salome/gui/SMESH/images/adaptation_02.png | Bin 0 -> 27968 bytes doc/salome/gui/SMESH/input/adaptation.rst | 38 ++++++++++++++++++ doc/salome/gui/SMESH/input/tui_adaptation.rst | 15 +++++++ 4 files changed, 53 insertions(+) create mode 100644 doc/salome/gui/SMESH/images/adaptation_01.png create mode 100644 doc/salome/gui/SMESH/images/adaptation_02.png create mode 100644 doc/salome/gui/SMESH/input/adaptation.rst create mode 100644 doc/salome/gui/SMESH/input/tui_adaptation.rst diff --git a/doc/salome/gui/SMESH/images/adaptation_01.png b/doc/salome/gui/SMESH/images/adaptation_01.png new file mode 100644 index 0000000000000000000000000000000000000000..67cb8b64ede75b2d067f945f092479f036375c3a GIT binary patch literal 27514 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 WaQs6|9(Z^bL|OjvgF;zjzyAY@C@MVw literal 0 HcmV?d00001 diff --git a/doc/salome/gui/SMESH/images/adaptation_02.png b/doc/salome/gui/SMESH/images/adaptation_02.png new file mode 100644 index 0000000000000000000000000000000000000000..1f3f9edcca9f3a14eea144aa7b72628375f8ecbd GIT binary patch literal 27968 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 literal 0 HcmV?d00001 diff --git a/doc/salome/gui/SMESH/input/adaptation.rst b/doc/salome/gui/SMESH/input/adaptation.rst new file mode 100644 index 000000000..bb048aefb --- /dev/null +++ b/doc/salome/gui/SMESH/input/adaptation.rst @@ -0,0 +1,38 @@ +.. _adaptation_page: + +********** +Adaptation +********** + +Mesh module provides the possibility to perform different adaptations of a mesh. + +.. note:: + A mesh adaptation based on splitting is available by the HOMARD module. + +.. _mg_adapt_anchor: + +MG_Adapt +######## + +For meshes made of triangles and/or tetrahedra, remeshing operations are available with the MG-Adapt plugin. The remeshing is based on wanted mesh sizes defined over the mesh or as a constant. The boundaries are dedeuced from the initial mesh. + +To start **Remeshing** operation, select **MG Adapt** tab in **Adaptation** dialog. + +.. image:: ../images/adaptation_01.png + :align: center + + +* **Mesh In** is the initial mesh to remesh. +* **Mesh Out** is the resulting mesh after remeshing. By default, the name of the initial mesh is kept and the file name is based on the name of the initial mesh. +* **Size map definition** is a choice between **Local**, **Background** and **Constant**. + +- If the choice is **Background**, the name of the MED file must be given. +- If the choice is **Local** or **Background**, the name of the field must be selected from the list, together with time step. + +.. image:: ../images/adaptation_02.png + :align: center + +.. note:: + The exhaustive description of MG-Adapt can be read into its documentation. It can be reached bu the general help button. + +**See Also** a sample TUI Script of :ref:`tui_adaptation_page`. diff --git a/doc/salome/gui/SMESH/input/tui_adaptation.rst b/doc/salome/gui/SMESH/input/tui_adaptation.rst new file mode 100644 index 000000000..9bf8a29a4 --- /dev/null +++ b/doc/salome/gui/SMESH/input/tui_adaptation.rst @@ -0,0 +1,15 @@ +.. _tui_adaptation_page: + + +********** +Adaptation +********** + +.. _tui_mg_adapt: + +MG_Adapt +======== + + + +**See Also** the GUI :ref:`adaptation_page`. From 5560a9e80a471ebacca45950a78bfcb91bae75e7 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Mon, 8 Feb 2021 15:29:58 +0100 Subject: [PATCH 077/100] documentation --- doc/salome/gui/SMESH/input/index.rst | 14 ++++++++------ doc/salome/gui/SMESH/input/smeshpy_interface.rst | 7 ++++--- resources/SalomeApp.xml.in | 3 +++ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/doc/salome/gui/SMESH/input/index.rst b/doc/salome/gui/SMESH/input/index.rst index c6a2ade37..fcd97b7b8 100644 --- a/doc/salome/gui/SMESH/input/index.rst +++ b/doc/salome/gui/SMESH/input/index.rst @@ -14,15 +14,16 @@ Introduction to Mesh module * :ref:`creating meshes ` in different ways: - * by meshing geometrical models previously created or imported by the Geometry component; + * by meshing geometrical models previously created or imported by the Geometry component; * bottom-up, using :ref:`mesh edition `, especially :ref:`extrusion ` and :ref:`revolution `; - * by generation of the 3D mesh from the 2D mesh not based on the geometry (:ref:`imported ` for example); - + * by generation of the 3D mesh from the 2D mesh not based on the geometry (:ref:`imported ` for example); + * :ref:`importing and exporting meshes ` in various formats; -* :ref:`modifying meshes ` with a vast array of dedicated operations; +* :ref:`modifying meshes ` with a vast array of dedicated operations; * :ref:`creating groups ` of mesh elements; * filtering mesh entities (nodes or elements) using :ref:`Filters ` functionality for :ref:`creating groups ` and applying :ref:`mesh modifications `; * :ref:`viewing meshes ` in the VTK viewer and :ref:`getting info ` on mesh and its sub-objects; +* :ref:`remeshing meshes `; * applying to meshes :ref:`Quality Controls `, allowing to highlight important elements; * taking various :ref:`measurements ` of the mesh objects. @@ -35,7 +36,7 @@ It is possible to use the variables predefined in :ref:`Salome notebook ` (generate mesh nodes and elements): .. code-block:: python mesh.Compute() An easiest way to start with Python scripting is to do something in -GUI and then to get a corresponding Python script via +GUI and then to get a corresponding Python script via **File > Dump Study** menu item. Don't forget that you can get all methods of any object in hand (e.g. a mesh group or a hypothesis) by calling *dir()* Python built-in function. @@ -95,6 +95,7 @@ the following links: tui_transforming_meshes tui_viewing_meshes tui_quality_controls + tui_adaptation tui_measurements tui_work_on_objects_from_gui tui_notebook_smesh diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in index 90649ffdd..c11851f4f 100644 --- a/resources/SalomeApp.xml.in +++ b/resources/SalomeApp.xml.in @@ -111,6 +111,9 @@ + + + From d90a581cefcc55423f12edd390bd91118a4a6b0c Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Mon, 8 Feb 2021 15:52:38 +0100 Subject: [PATCH 078/100] =?UTF-8?q?Gestion=20des=20erreurs=20de=20donn?= =?UTF-8?q?=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/salome/gui/SMESH/input/adaptation.rst | 2 +- src/SMESHGUI/MG_ADAPTGUI.cxx | 238 ++++++++++++---------- src/SMESHGUI/MG_ADAPTGUI.hxx | 7 +- src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx | 57 +++--- src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.h | 8 +- src/SMESHGUI/SMESH_msg_en.ts | 12 +- src/SMESHGUI/SMESH_msg_fr.ts | 8 + 7 files changed, 184 insertions(+), 148 deletions(-) diff --git a/doc/salome/gui/SMESH/input/adaptation.rst b/doc/salome/gui/SMESH/input/adaptation.rst index bb048aefb..624851d75 100644 --- a/doc/salome/gui/SMESH/input/adaptation.rst +++ b/doc/salome/gui/SMESH/input/adaptation.rst @@ -33,6 +33,6 @@ To start **Remeshing** operation, select **MG Adapt** tab in **Adaptation** dial :align: center .. note:: - The exhaustive description of MG-Adapt can be read into its documentation. It can be reached bu the general help button. + The exhaustive description of MG-Adapt can be read into its documentation. It can be reached by the general help button. **See Also** a sample TUI Script of :ref:`tui_adaptation_page`. diff --git a/src/SMESHGUI/MG_ADAPTGUI.cxx b/src/SMESHGUI/MG_ADAPTGUI.cxx index b2ab3b7d6..8a31faa72 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.cxx +++ b/src/SMESHGUI/MG_ADAPTGUI.cxx @@ -84,7 +84,6 @@ #include - const int SPACING = 6; // layout spacing const int MARGIN = 9; // layout margin @@ -135,32 +134,25 @@ void SMESHGUI_MgAdaptDlg::buildDlg() myAdvOpt->logGroupBox ->setTitle(tr( "LOG_GROUP_TITLE" )); // buttons - QPushButton* okBtn = new QPushButton( tr( "SMESH_BUT_OK" ), this ); - okBtn->setAutoDefault( true ); - okBtn->setDefault( true ); - okBtn->setFocus(); + QPushButton* buttonOk = new QPushButton(tr("SMESH_BUT_APPLY_AND_CLOSE"), this); + buttonOk->setAutoDefault(false); QPushButton* buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), this); - buttonApply->setAutoDefault(true); - QPushButton* buttonApplyAndClose = new QPushButton(tr("SMESH_BUT_APPLY_AND_CLOSE"), this); - buttonApplyAndClose->setAutoDefault(true); - QPushButton* cancelBtn = new QPushButton( tr( "SMESH_BUT_CANCEL" ), this ); - cancelBtn->setAutoDefault( true ); - QPushButton* helpBtn = new QPushButton( tr( "SMESH_BUT_HELP" ), this ); - helpBtn->setAutoDefault( true ); + buttonApply->setAutoDefault(false); + QPushButton* buttonCancel = new QPushButton( tr( "SMESH_BUT_CANCEL" ), this ); + buttonCancel->setAutoDefault( false ); + QPushButton* buttonHelp = new QPushButton( tr( "SMESH_BUT_HELP" ), this ); + buttonHelp->setAutoDefault( false ); QHBoxLayout* btnLayout = new QHBoxLayout; btnLayout->setSpacing( SPACING ); btnLayout->setMargin( 0 ); - btnLayout->addWidget( buttonApplyAndClose ); + btnLayout->addWidget( buttonOk ); btnLayout->addStretch( 10 ); btnLayout->addWidget( buttonApply ); btnLayout->addStretch( 10 ); - btnLayout->addWidget( okBtn ); + btnLayout->addWidget( buttonCancel ); btnLayout->addStretch( 10 ); - btnLayout->addWidget( cancelBtn ); - btnLayout->addStretch( 10 ); - btnLayout->addWidget( helpBtn ); - okBtn->hide(); // tab 1 + btnLayout->addWidget( buttonHelp ); QVBoxLayout* l = new QVBoxLayout ( this ); l->setMargin( MARGIN ); @@ -169,13 +161,12 @@ void SMESHGUI_MgAdaptDlg::buildDlg() l->addStretch(); l->addLayout( btnLayout ); + connect( buttonOk, SIGNAL(pressed()), this, SLOT(PushOnOK())); + connect( buttonApply, SIGNAL(pressed()), this, SLOT(PushOnApply())); + connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); + connect( buttonHelp, SIGNAL(pressed()), this, SLOT(PushOnHelp())); - connect( okBtn, SIGNAL(clicked()), this, SLOT( clickOnOk() ) ); - connect( helpBtn, SIGNAL(clicked()), this, SLOT( clickOnHelp() ) ); - connect(cancelBtn, SIGNAL(clicked()), this, SLOT(reject())); - connect(buttonApply, SIGNAL(clicked()), this,SLOT(clickOnApply())); - connect(buttonApplyAndClose, SIGNAL(clicked()), this,SLOT(clickOnOk())); - connect(myArgs, SIGNAL(meshDimSignal(ADAPTATION_MODE)), myAdvOpt, SLOT( onMeshDimChanged(ADAPTATION_MODE)) ); + connect( myArgs, SIGNAL(meshDimSignal(ADAPTATION_MODE)), myAdvOpt, SLOT( onMeshDimChanged(ADAPTATION_MODE)) ); } @@ -199,15 +190,15 @@ SMESH::MG_ADAPT_ptr SMESHGUI_MgAdaptDlg::getModel() const /*! \brief Perform clean-up actions on the dialog box closing. */ -bool SMESHGUI_MgAdaptDlg::clickOnApply() +bool SMESHGUI_MgAdaptDlg::PushOnApply() { - readParamsFromWidgets(); - return true; + bool ret = readParamsFromWidgets(); + return ret; } -void SMESHGUI_MgAdaptDlg::clickOnOk() +void SMESHGUI_MgAdaptDlg::PushOnOK() { - clickOnApply(); - reject(); + bool ret = PushOnApply(); + if ( ret ) reject(); } void SMESHGUI_MgAdaptDlg::reject() { @@ -292,103 +283,127 @@ bool SMESHGUI_MgAdaptDlg::readParamsFromHypo( ) const } - bool SMESHGUI_MgAdaptDlg::readParamsFromWidgets() { - bool ret = true; + MESSAGE ("readParamsFromWidgets") ; + bool ret = true ; SMESH::MgAdaptHypothesisData* aData = new SMESH::MgAdaptHypothesisData(); - aData->fromMedFile = myArgs->aMedfile->isChecked(); - if (aData->fromMedFile) + while ( ret ) { + // 1. Fichier du maillage de départ + aData->fromMedFile = myArgs->aMedfile->isChecked(); + if (aData->fromMedFile) + { + aData->myFileInDir = CORBA::string_dup(myArgs->myFileInDir->toStdString().c_str()); + aData->myMeshFileIn = CORBA::string_dup(myArgs->selectMedFileLineEdit->text().toStdString().c_str()); + // aData->myInMeshName = // TODO + } + else // TODO browser + { + QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), + QObject::tr("MG_ADAPT_MED_FILE_4") ); + ret = false ; + break ; + // aData->myInMeshName = CORBA::string_dup(myArgs->aBrowserObject->text().toStdString().c_str()); + // aData->myFileInDir = CORBA::string_dup(myAdvOpt->workingDirectoryLineEdit->text().toStdString().c_str()); + // + // TCollection_AsciiString aGenericName = (char*)aData->myFileInDir; + // TCollection_AsciiString aGenericName2 = "MgAdapt_"; + // aGenericName2 += getpid(); + // aGenericName2 += "_"; + // aGenericName2 += Abs((Standard_Integer)(long) aGenericName.ToCString()); + // aGenericName2 += ".med"; + // aGenericName+=aGenericName2; + // emit myArgs->toExportMED(aGenericName.ToCString()); + // aData->myMeshFileIn = aGenericName2.ToCString(); + } + // 2. Fichier du maillage de sortie + aData->myOutMeshName = CORBA::string_dup(myArgs->meshNameLineEdit->text().toStdString().c_str()); + aData->myMeshOutMed = myArgs->medFileCheckBox->isChecked(); + if(aData->myMeshOutMed) + { + aData->myFileOutDir = CORBA::string_dup(myArgs->myFileOutDir->toStdString().c_str()); + aData->myMeshFileOut = CORBA::string_dup(myArgs->selectOutMedFileLineEdit->text().toStdString().c_str()); + } + else + { + aData->myMeshFileOut = ""; + } + aData->myPublish = myArgs->publishOut->isChecked(); - aData->myFileInDir = CORBA::string_dup(myArgs->myFileInDir->toStdString().c_str()); - aData->myMeshFileIn = CORBA::string_dup(myArgs->selectMedFileLineEdit->text().toStdString().c_str()); - // aData->myInMeshName = // TODO - } - else // TODO browser - { - aData->myInMeshName = CORBA::string_dup(myArgs->aBrowserObject->text().toStdString().c_str()); - aData->myFileInDir = CORBA::string_dup(myAdvOpt->workingDirectoryLineEdit->text().toStdString().c_str()); + // 3. Type de carte de tailles + aData->myUseLocalMap = myArgs->localButton->isChecked(); + aData->myUseBackgroundMap = myArgs->backgroundButton->isChecked(); + aData->myUseConstantValue = myArgs->constantButton->isChecked(); + // 3.1. Constante + if (aData->myUseConstantValue) + { + aData->myConstantValue = myArgs->dvalue->value(); + } + else + { + aData->myConstantValue = 0.0; + } + // 3.2. Arrière-plan + if (aData->myUseBackgroundMap) + { + aData->myFileSizeMapDir = CORBA::string_dup(myArgs->myFileSizeMapDir->toStdString().c_str()); + aData->myMeshFileBackground = CORBA::string_dup(myArgs->selectMedFileBackgroundLineEdit->text().toStdString().c_str()); + } + else + { + aData->myMeshFileBackground = ""; + } - TCollection_AsciiString aGenericName = (char*)aData->myFileInDir; - TCollection_AsciiString aGenericName2 = "MgAdapt_"; - aGenericName2 += getpid(); - aGenericName2 += "_"; - aGenericName2 += Abs((Standard_Integer)(long) aGenericName.ToCString()); - aGenericName2 += ".med"; - aGenericName+=aGenericName2; - emit myArgs->toExportMED(aGenericName.ToCString()); - aData->myMeshFileIn = aGenericName2.ToCString(); - } - aData->myOutMeshName = CORBA::string_dup(myArgs->meshNameLineEdit->text().toStdString().c_str()); - aData->myMeshOutMed = myArgs->medFileCheckBox->isChecked(); - if(aData->myMeshOutMed) - { - aData->myFileOutDir = CORBA::string_dup(myArgs->myFileOutDir->toStdString().c_str()); - aData->myMeshFileOut = CORBA::string_dup(myArgs->selectOutMedFileLineEdit->text().toStdString().c_str()); + // 4. Le champ + if ( ! aData->myUseConstantValue ) + { + if ( strlen(myArgs->fieldNameCmb->currentText().toStdString().c_str()) == 0 ) + { + QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), + QObject::tr("MG_ADAPT_MED_FILE_5") ); + ret = false ; + break ; + } + { + aData->myFieldName = CORBA::string_dup(myArgs->fieldNameCmb->currentText().toStdString().c_str()); + aData->myUseNoTimeStep = myArgs->noTimeStep->isChecked(); + aData->myUseLastTimeStep = myArgs->lastTimeStep->isChecked(); + aData->myUseChosenTimeStep = myArgs->chosenTimeStep->isChecked(); + if (aData->myUseChosenTimeStep) + { + aData->myRank = myArgs->rankSpinBox->value(); + aData->myTimeStep = myArgs->timeStep->value(); + } + } + } - } - else - { - aData->myMeshFileOut = ""; + // 5. Options avancées + aData->myWorkingDir = CORBA::string_dup(myAdvOpt->workingDirectoryLineEdit->text().toStdString().c_str()); + aData->myPrintLogInFile = myAdvOpt->logInFileCheck->isChecked(); + aData->myVerboseLevel = myAdvOpt->verboseLevelSpin->value(); + aData->myRemoveLogOnSuccess = myAdvOpt->removeLogOnSuccessCheck->isChecked(); + aData->myKeepFiles = myAdvOpt->keepWorkingFilesCheck->isChecked(); + model->setData(*aData); + + QString msg; + checkParams(msg); + break ; } - aData->myPublish = myArgs->publishOut->isChecked(); - - - aData->myUseLocalMap = myArgs->localButton->isChecked(); - aData->myUseBackgroundMap = myArgs->backgroundButton->isChecked(); - aData->myUseConstantValue = myArgs->constantButton->isChecked(); - if (aData->myUseConstantValue) - { - aData->myConstantValue = myArgs->dvalue->value(); - } - else - { - aData->myConstantValue = 0.0; - } - if (aData->myUseBackgroundMap) - { - aData->myFileSizeMapDir = CORBA::string_dup(myArgs->myFileSizeMapDir->toStdString().c_str()); - aData->myMeshFileBackground = CORBA::string_dup(myArgs->selectMedFileBackgroundLineEdit->text().toStdString().c_str()); - } - else - { - aData->myMeshFileBackground = ""; - } - - aData->myFieldName = CORBA::string_dup(myArgs->fieldNameCmb->currentText().toStdString().c_str()); - aData->myUseNoTimeStep = myArgs->noTimeStep->isChecked(); - aData->myUseLastTimeStep = myArgs->lastTimeStep->isChecked(); - aData->myUseChosenTimeStep = myArgs->chosenTimeStep->isChecked(); - if (aData->myUseChosenTimeStep) - { - aData->myRank = myArgs->rankSpinBox->value(); - aData->myTimeStep = myArgs->timeStep->value(); - - } - - aData->myWorkingDir = CORBA::string_dup(myAdvOpt->workingDirectoryLineEdit->text().toStdString().c_str()); - aData->myPrintLogInFile = myAdvOpt->logInFileCheck->isChecked(); - aData->myVerboseLevel = myAdvOpt->verboseLevelSpin->value(); - aData->myRemoveLogOnSuccess = myAdvOpt->removeLogOnSuccessCheck->isChecked(); - aData->myKeepFiles = myAdvOpt->keepWorkingFilesCheck->isChecked(); - model->setData(*aData); - QString msg; - checkParams(msg); delete aData; + return ret; } bool SMESHGUI_MgAdaptDlg::storeParamsToHypo( const SMESH::MgAdaptHypothesisData& ) const { - } /*! \brief Show help page */ -void SMESHGUI_MgAdaptDlg::clickOnHelp() +void SMESHGUI_MgAdaptDlg::PushOnHelp() { - // QString aHelpFile; +// QString aHelpFile; // if ( myTabWidget->currentIndex() == MinDistance ) { // aHelpFile = "measurements.html#min-distance-anchor"; // } else if ( myTabWidget->currentIndex() == BoundingBox ) { @@ -399,7 +414,7 @@ void SMESHGUI_MgAdaptDlg::clickOnHelp() // aHelpFile = "measurements.html#basic-properties-anchor"; // } - // SMESH::ShowHelpFile( aHelpFile ); +// SMESH::ShowHelpFile( aHelpFile ); } bool SMESHGUI_MgAdaptDlg::checkParams(QString& msg) { @@ -407,7 +422,7 @@ bool SMESHGUI_MgAdaptDlg::checkParams(QString& msg) { SUIT_MessageBox::warning( this, tr( "SMESH_WRN_WARNING" ), - tr( "GHS3D_PERMISSION_DENIED" ) ); + tr( "NO_PERMISSION" ) ); return false; } @@ -473,7 +488,7 @@ SMESHGUI_MgAdaptArguments::SMESHGUI_MgAdaptArguments( QWidget* parent ) aMeshIn = new QGroupBox( tr( "MeshIn" ), this ); aMedfile = new QRadioButton( tr( "MEDFile" ), aMeshIn ); aBrowser = new QRadioButton( tr( "Browser" ), aMeshIn ); - aBrowserObject = new QLineEdit( aMeshIn ); + aBrowserObject = new QLineEdit( aMeshIn ); selectMedFilebutton = new QPushButton("", aMeshIn); selectMedFileLineEdit = new QLineEdit( aMeshIn ); @@ -1416,4 +1431,3 @@ std::string remove_extension(const std::string& filename) if (lastdot == std::string::npos) return filename; return filename.substr(0, lastdot); } - diff --git a/src/SMESHGUI/MG_ADAPTGUI.hxx b/src/SMESHGUI/MG_ADAPTGUI.hxx index 853b2683e..823a5afa9 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.hxx +++ b/src/SMESHGUI/MG_ADAPTGUI.hxx @@ -131,11 +131,12 @@ public: public slots: protected slots: + virtual bool PushOnApply(); -virtual bool clickOnApply(); private slots: -virtual void clickOnHelp(); -virtual void clickOnOk(); + virtual void PushOnHelp(); + virtual void PushOnOK(); + protected : SMESHGUI_MgAdaptArguments* myArgs; diff --git a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx index 77ccb41d2..fc1496380 100644 --- a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx +++ b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx @@ -341,27 +341,44 @@ SMESH::SMESH_Mesh_var SMESHGUI_MG_ADAPTDRIVER::getMyMesh() } //================================================================================= -// function : ClickOnOk() +// function : PushOnOk() // purpose : //================================================================================= -void SMESHGUI_MG_ADAPTDRIVER::clickOnOk() +void SMESHGUI_MG_ADAPTDRIVER::PushOnOK() { setIsApplyAndClose( true ); - clickOnApply(); - reject(); + bool ret = PushOnApply(); +// std::cout << "SMESHGUI_MG_ADAPTDRIVER::PushOnOK ret : " <getPublish()) this->createMeshInObjectBrowser(); + if ( ok ) + { + ok = execute(); + if (getModel()->getPublish()) this->createMeshInObjectBrowser(); +// std::cout << "SMESHGUI_MG_ADAPTDRIVER::PushOnApply ok 2 : " <key() == Qt::Key_F1 ) { e->accept(); - clickOnHelp(); + PushOnHelp(); } } //================================================================================= -// function : clickOnHelp() +// function : PushOnHelp() // purpose : //================================================================================= -void SMESHGUI_MG_ADAPTDRIVER::clickOnHelp() +void SMESHGUI_MG_ADAPTDRIVER::PushOnHelp() { - LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); - if (app) - app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); - else { - QString platform; -#ifdef WIN32 - platform = "winapplication"; -#else - platform = "application"; -#endif - SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser",platform)). - arg(myHelpFileName)); - } + QString aHelpFile = "adaptation.html#_mg_adapt_anchor"; + + SMESH::ShowHelpFile( aHelpFile ); } diff --git a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.h b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.h index e73a77795..f68398525 100644 --- a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.h +++ b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.h @@ -190,10 +190,10 @@ private slots: void exportMED(const char* ); - virtual bool clickOnApply(); - virtual void clickOnOk(); - virtual void clickOnHelp(); - //~void SelectionIntoArgument(); + virtual bool PushOnApply(); + virtual void PushOnOK(); + virtual void PushOnHelp(); + void deactivateActiveDialog(); void activateThisDialog(); void onConstructor( int ); diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index 23c92f86b..fcac5cfe7 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -430,7 +430,7 @@
LOCAL_MG_ADAPT - local + Local BACKGRND_MG_ADAPT @@ -450,12 +450,20 @@ SIZE_MAP_DEF - size map definition + Size map definition ADVOP Advanced Options + + MG_ADAPT_DIAG_1 + Adaptation succeeded. + + + MG_ADAPT_DIAG_2 + Adaptation failed. + MEN_CONV_TO_QUAD Convert to/from quadratic diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index 95306a7ec..9cdbdd649 100644 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -456,6 +456,14 @@ ADVOP Options avancées + + MG_ADAPT_DIAG_1 + Adaptation réussie. + + + MG_ADAPT_DIAG_2 + Echec de l'adaptation. + MEN_CONV_TO_QUAD Convertir vers/depuis quadratique From eb0b4337d36979eb6170299162e92d7a227a0d53 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Mon, 8 Feb 2021 17:19:42 +0100 Subject: [PATCH 079/100] exemple de python --- doc/salome/examples/adaptation_ex01.py | 62 +++++++++++++++++++ doc/salome/gui/SMESH/input/tui_adaptation.rst | 5 +- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 doc/salome/examples/adaptation_ex01.py diff --git a/doc/salome/examples/adaptation_ex01.py b/doc/salome/examples/adaptation_ex01.py new file mode 100644 index 000000000..1a91facdd --- /dev/null +++ b/doc/salome/examples/adaptation_ex01.py @@ -0,0 +1,62 @@ +# Remeshing with MG-Adapt +import os +import salome +salome.salome_init() + +import SMESH +from salome.smesh import smeshBuilder +smesh = smeshBuilder.New() + +# directory +rootdir = ... + +# Test 1 : remeshing with a local size, surface +#--- Creation of the object for the adaptation --- +objet_adapt = smesh.Adaptation('MG_Adapt') + +#--- Initial mesh --- +objet_adapt.setMEDFileIn(os.path.join(rootdir, "maill.01.med")) +#--- Final mesh --- +objet_adapt.setMEDFileOut(os.path.join(rootdir, "maill.01.adapt.med")) + +#--- Creation of the hypothesis --- +hypo = smesh.CreateAdaptationHypothesis() +# Options +hypo.setSizeMapType('Local') +hypo.setSizeMapFieldName('TAILLE') +hypo.setTimeStepRankLast() +hypo.setOptionValue("adaptation", "surface") + +#--- Link between hypothesis and object --- +objet_adapt.AddHypothesis(hypo) + +#--- Compute without publication +err = objet_adapt.Compute(False) + + + +# Test 2 : remeshing with a background size, volume +#--- Creation of the object for the adaptation --- +objet_adapt = smesh.Adaptation('MG_Adapt') + +#--- Initial mesh --- +objet_adapt.setMEDFileIn(os.path.join(rootdir, "maill.02.med")) +#--- Background mesh --- +objet_adapt.setMEDFileBackground(rootdir, "maill.size.02.med")) +#--- Final mesh --- +objet_adapt.setMEDFileOut(os.path.join(rootdir, "maill.02.adapt.med")) + +#--- Creation of the hypothesis --- +hypo = smesh.CreateAdaptationHypothesis() +# Options +hypo.setSizeMapType('Background') +hypo.setSizeMapFieldName('TAILLE') +hypo.setTimeStepRank(1,1) +hypo.setOptionValue("adaptation", "both") + +#--- Link between hypothesis and object --- +objet_adapt.AddHypothesis(hypo) + +#--- Compute without publication +err = objet_adapt.Compute(False) + diff --git a/doc/salome/gui/SMESH/input/tui_adaptation.rst b/doc/salome/gui/SMESH/input/tui_adaptation.rst index 9bf8a29a4..7db15c66a 100644 --- a/doc/salome/gui/SMESH/input/tui_adaptation.rst +++ b/doc/salome/gui/SMESH/input/tui_adaptation.rst @@ -1,6 +1,5 @@ .. _tui_adaptation_page: - ********** Adaptation ********** @@ -10,6 +9,10 @@ Adaptation MG_Adapt ======== +.. literalinclude:: ../../../examples/adaptation_ex01.py + :language: python + +:download:`Download this script <../../../examples/adaptation_ex01.py>` **See Also** the GUI :ref:`adaptation_page`. From 1524b928e6f009541dfb251673585a8ecea7d651 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Mon, 8 Feb 2021 17:36:32 +0100 Subject: [PATCH 080/100] =?UTF-8?q?M=C3=A9nage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/salome/examples/adaptation_ex01.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/salome/examples/adaptation_ex01.py b/doc/salome/examples/adaptation_ex01.py index 1a91facdd..7956f9560 100644 --- a/doc/salome/examples/adaptation_ex01.py +++ b/doc/salome/examples/adaptation_ex01.py @@ -33,6 +33,9 @@ objet_adapt.AddHypothesis(hypo) #--- Compute without publication err = objet_adapt.Compute(False) +#--- Clean +del objet_adapt + # Test 2 : remeshing with a background size, volume @@ -60,3 +63,6 @@ objet_adapt.AddHypothesis(hypo) #--- Compute without publication err = objet_adapt.Compute(False) +#--- Clean +del objet_adapt + From 96c02d08b9291187c0c6f3081aa6f86f68b5586f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Tue, 9 Feb 2021 12:24:42 +0100 Subject: [PATCH 081/100] =?UTF-8?q?r=C3=A9cup=C3=A9ration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SMESH_I/SMESH_Gen_i.hxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/SMESH_I/SMESH_Gen_i.hxx b/src/SMESH_I/SMESH_Gen_i.hxx index fb16909b8..c5db5cc70 100644 --- a/src/SMESH_I/SMESH_Gen_i.hxx +++ b/src/SMESH_I/SMESH_Gen_i.hxx @@ -470,6 +470,10 @@ public: static int CountInPyDump(const TCollection_AsciiString& text); + SMESH::MG_ADAPT_ptr CreateMG_ADAPT(); + SMESH::MG_ADAPT_ptr CreateAdaptationHypothesis(); + SMESH::MG_ADAPT_OBJECT_ptr Adaptation( const char* adaptationType); + // ***************************************** // Internal methods // ***************************************** From f6eed752d8db33498d18c91f2c546e6dcf4bd4f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Tue, 9 Feb 2021 14:53:06 +0100 Subject: [PATCH 082/100] =?UTF-8?q?Mise=20=C3=A0=20jour?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SMESH_I/SMESH_Gen_i.hxx | 38 ++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/src/SMESH_I/SMESH_Gen_i.hxx b/src/SMESH_I/SMESH_Gen_i.hxx index c5db5cc70..817abd07c 100644 --- a/src/SMESH_I/SMESH_Gen_i.hxx +++ b/src/SMESH_I/SMESH_Gen_i.hxx @@ -35,6 +35,7 @@ #include CORBA_CLIENT_HEADER(GEOM_Gen) #include CORBA_CLIENT_HEADER(SALOMEDS) #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog) #include "SMESH_Gen.hxx" #include "SMESH_Mesh_i.hxx" @@ -93,9 +94,7 @@ private: // =========================================================== // SMESH module's engine // ========================================================== -class SMESH_I_EXPORT SMESH_Gen_i: - public virtual POA_SMESH::SMESH_Gen, - public virtual Engines_Component_i +class SMESH_I_EXPORT SMESH_Gen_i : public POA_SMESH::SMESH_Gen, public Engines_Component_i { public: // Get last created instance of the class @@ -109,16 +108,23 @@ public: // Get SALOME_LifeCycleCORBA object static SALOME_LifeCycleCORBA* GetLCC(); // Retrieve and get GEOM engine reference - static GEOM::GEOM_Gen_var GetGeomEngine( bool isShaper ); static GEOM::GEOM_Gen_var GetGeomEngine( GEOM::GEOM_Object_ptr ); + // Retrieve Study depending on Session / Standalone mode + virtual GEOM::GEOM_Gen_var GetGeomEngine( bool isShaper ) = 0; + SALOMEDS::Study_var getStudyServant() const { return this->getStudyServantVirtual(); } + virtual SALOMEDS::Study_var getStudyServantVirtual() const = 0 ; + virtual SALOME_ModuleCatalog::ModuleCatalog_var getModuleCatalog() const = 0; + SALOMEDS::SObject_ptr publish(CORBA::Object_ptr theIOR, + SALOMEDS::SObject_ptr theFatherObject, + const int theTag = 0, + const char* thePixMap = 0, + const bool theSelectable = true); // Get object of the CORBA reference static PortableServer::ServantBase_var GetServant( CORBA::Object_ptr theObject ); // Get CORBA object corresponding to the SALOMEDS::SObject static CORBA::Object_var SObjectToObject( SALOMEDS::SObject_ptr theSObject ); // Get the SALOMEDS::SObject corresponding to a CORBA object - static SALOMEDS::SObject_ptr ObjectToSObject( CORBA::Object_ptr theObject ); - // Get the SALOMEDS::Study from naming service - static SALOMEDS::Study_var getStudyServant(); + SALOMEDS::SObject_ptr ObjectToSObject( CORBA::Object_ptr theObject ); // Get GEOM Object corresponding to TopoDS_Shape static GEOM::GEOM_Object_ptr ShapeToGeomObject( const TopoDS_Shape& theShape ); // Get TopoDS_Shape corresponding to GEOM_Object @@ -133,7 +139,8 @@ public: PortableServer::POA_ptr poa, PortableServer::ObjectId* contId, const char* instanceName, - const char* interfaceName ); + const char* interfaceName, + bool checkNS = true); // Destructor virtual ~SMESH_Gen_i(); @@ -468,7 +475,7 @@ public: void CleanPythonTrace(); - static int CountInPyDump(const TCollection_AsciiString& text); + int CountInPyDump(const TCollection_AsciiString& text); SMESH::MG_ADAPT_ptr CreateMG_ADAPT(); SMESH::MG_ADAPT_ptr CreateAdaptationHypothesis(); @@ -526,12 +533,12 @@ public: SMESH::SMESH_Hypothesis_ptr theHyp); SALOMEDS::SObject_ptr GetMeshOrSubmeshByShape (SMESH::SMESH_Mesh_ptr theMesh, GEOM::GEOM_Object_ptr theShape); - static void SetName(SALOMEDS::SObject_ptr theSObject, - const char* theName, - const char* theDefaultName = 0); + void SetName(SALOMEDS::SObject_ptr theSObject, + const char* theName, + const char* theDefaultName = 0); - static void SetPixMap(SALOMEDS::SObject_ptr theSObject, - const char* thePixMap); + void SetPixMap(SALOMEDS::SObject_ptr theSObject, const char *thePixMap); + void addReference (SALOMEDS::SObject_ptr theSObject, CORBA::Object_ptr theToObject, int theTag = 0); // Get study context StudyContext* GetStudyContext(); @@ -641,8 +648,9 @@ private: const TopoDS_Shape& Shape, double* Tolerance = NULL); -private: +protected: static GEOM::GEOM_Gen_var myGeomGen; +private: static CORBA::ORB_var myOrb; // ORB reference static PortableServer::POA_var myPoa; // POA reference static SALOME_NamingService* myNS; // Naming Service From 52a01fdffe92192f1246c5d644e2b4a7da7c3f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Tue, 9 Feb 2021 15:09:36 +0100 Subject: [PATCH 083/100] Tabulations --- idl/MG_ADAPT.idl | 239 +++++++++++++++++++++++------------------------ 1 file changed, 117 insertions(+), 122 deletions(-) diff --git a/idl/MG_ADAPT.idl b/idl/MG_ADAPT.idl index 3a593fde7..59ca6a1fd 100644 --- a/idl/MG_ADAPT.idl +++ b/idl/MG_ADAPT.idl @@ -21,7 +21,6 @@ #ifndef MG_ADAPT_IDL #define MG_ADAPT_IDL - #include "SALOME_Component.idl" #include "SALOME_Exception.idl" #include "SALOME_GenericObj.idl" @@ -29,130 +28,126 @@ #include "SMESH_Mesh.idl" module SMESH{ - - typedef sequence str_array ; - struct MgAdaptHypothesisData - { - string myFileInDir, myMeshFileIn, myInMeshName, myMeshFileBackground, myOutMeshName, - myMeshFileOut, myFileOutDir, myFileSizeMapDir, myFieldName; - boolean fromMedFile; - boolean myPublish, myMeshOutMed; - boolean myUseLocalMap, myUseBackgroundMap, myUseConstantValue; - double myConstantValue; - long myRank, myTimeStep; - boolean myUseNoTimeStep, myUseLastTimeStep, myUseChosenTimeStep; - string myWorkingDir, myLogFile; - boolean myPrintLogInFile, myKeepFiles, myRemoveLogOnSuccess; - long myVerboseLevel; - }; - - - interface MG_ADAPT : SALOME::GenericObj - { - //MG_ADAPT CreateMG_ADAPT(in PortableServer::POA_var poa); - void setData( inout MgAdaptHypothesisData data); - - void setMedFileIn(in string MedFileIn ); - string getMedFileIn(); - - void setMedFileOut(in string MedFileOut); - string getMedFileOut(); - - void setMeshName(in string s); - string getMeshName(); - - void setMeshNameOut(in string s); - string getMeshNameOut(); - - void setMeshOutMed(in boolean b); - boolean getMeshOutMed(); - - void setPublish(in boolean b); - boolean getPublish(); - - void setSizeMapFieldName(in string s); - string getSizeMapFieldName(); - - void setTimeStep(in long s); - long getTimeStep() ; - - void setTimeStepRank(in long s, in long f); - long getRank(); - - void setTimeStepRankLast(); - void setNoTimeStep(); - - void setLogFile(in string f); - string getLogFile(); - - void setVerbosityLevel(in long f); - long getVerbosityLevel(); - - void setRemoveOnSuccess(in boolean f); - boolean getRemoveOnSuccess(); - - MgAdaptHypothesisData getData(); - - void setUseLocalMap(in boolean f); - boolean getUseLocalMap(); - - void setUseBackgroundMap(in boolean f); - boolean getUseBackgroundMap(); - - void setUseConstantValue(in boolean f); - boolean getUseConstantValue(); - - void setConstantSize(in double f); - double getConstantSize() ; - - void setSizeMapFile(in string f); - string getSizeMapFile(); - - void setFromMedFile(in boolean f); - boolean isFromMedFile(); - - void setKeepWorkingFiles(in boolean f); - boolean getKeepWorkingFiles(); - - void setPrintLogInFile(in boolean f); - boolean getPrintLogInFile(); - - void setWorkingDir(in string f); - string getWorkingDir() ; - - void setSizeMapType(in string f); - boolean setAll(); - string getCommandToRun() ; - //long compute(out string errStr); - long compute(); - string getErrMsg(); - string getFileName() ; - string getExeName(); - void copyMgAdaptHypothesisData(in MgAdaptHypothesisData f ) ; - - //void checkDirPath(inout string f); + typedef sequence str_array ; + struct MgAdaptHypothesisData + { + string myFileInDir, myMeshFileIn, myInMeshName, myMeshFileBackground, myOutMeshName, + myMeshFileOut, myFileOutDir, myFileSizeMapDir, myFieldName; + boolean fromMedFile; + boolean myPublish, myMeshOutMed; + boolean myUseLocalMap, myUseBackgroundMap, myUseConstantValue; + double myConstantValue; + long myRank, myTimeStep; + boolean myUseNoTimeStep, myUseLastTimeStep, myUseChosenTimeStep; + string myWorkingDir, myLogFile; + boolean myPrintLogInFile, myKeepFiles, myRemoveLogOnSuccess; + long myVerboseLevel; + }; + interface MG_ADAPT : SALOME::GenericObj + { + //MG_ADAPT CreateMG_ADAPT(in PortableServer::POA_var poa); + void setData( inout MgAdaptHypothesisData data); + + void setMedFileIn(in string MedFileIn ); + string getMedFileIn(); + + void setMedFileOut(in string MedFileOut); + string getMedFileOut(); + + void setMeshName(in string s); + string getMeshName(); + + void setMeshNameOut(in string s); + string getMeshNameOut(); + + void setMeshOutMed(in boolean b); + boolean getMeshOutMed(); + + void setPublish(in boolean b); + boolean getPublish(); + + void setSizeMapFieldName(in string s); + string getSizeMapFieldName(); + + void setTimeStep(in long s); + long getTimeStep() ; + + void setTimeStepRank(in long s, in long f); + long getRank(); + + void setTimeStepRankLast(); + void setNoTimeStep(); + + void setLogFile(in string f); + string getLogFile(); + + void setVerbosityLevel(in long f); + long getVerbosityLevel(); + + void setRemoveOnSuccess(in boolean f); + boolean getRemoveOnSuccess(); + + MgAdaptHypothesisData getData(); + + void setUseLocalMap(in boolean f); + boolean getUseLocalMap(); + + void setUseBackgroundMap(in boolean f); + boolean getUseBackgroundMap(); + + void setUseConstantValue(in boolean f); + boolean getUseConstantValue(); + + void setConstantSize(in double f); + double getConstantSize() ; + + void setSizeMapFile(in string f); + string getSizeMapFile(); + + void setFromMedFile(in boolean f); + boolean isFromMedFile(); + + void setKeepWorkingFiles(in boolean f); + boolean getKeepWorkingFiles(); + + void setPrintLogInFile(in boolean f); + boolean getPrintLogInFile(); + + void setWorkingDir(in string f); + string getWorkingDir() ; + + void setSizeMapType(in string f); + boolean setAll(); + string getCommandToRun() ; + //long compute(out string errStr); + long compute(); + string getErrMsg(); + string getFileName() ; + string getExeName(); + void copyMgAdaptHypothesisData(in MgAdaptHypothesisData f ) ; + + //void checkDirPath(inout string f); + + boolean hasOptionDefined( in string optionName ) ; + void setOptionValue(in string optionName, in string optionValue) raises (SALOME::SALOME_Exception); + string getOptionValue(in string optionName, inout boolean isDefault) raises (SALOME::SALOME_Exception); + str_array getCustomOptionValuesStrVec() ; + str_array getOptionValuesStrVec() ; + }; + + typedef MG_ADAPT MG_ADAPT_HYPOTHESIS; + interface MG_ADAPT_OBJECT : SALOME::GenericObj + { + void setMeshIn(in SMESH_Mesh theMesh ); + void setMEDFileIn(in string f); + void setMEDFileOut(in string f); + void setMEDFileBackground(in string f); + void AddHypothesis(in MG_ADAPT mg); + long Compute(in boolean Publish); + }; - boolean hasOptionDefined( in string optionName ) ; - void setOptionValue(in string optionName, - in string optionValue) raises (SALOME::SALOME_Exception); - string getOptionValue(in string optionName, - inout boolean isDefault) raises (SALOME::SALOME_Exception); - str_array getCustomOptionValuesStrVec() ; - str_array getOptionValuesStrVec() ; - }; - typedef MG_ADAPT MG_ADAPT_HYPOTHESIS; - interface MG_ADAPT_OBJECT : SALOME::GenericObj - { - void setMeshIn(in SMESH_Mesh theMesh ); - void setMEDFileIn(in string f); - void setMEDFileOut(in string f); - void setMEDFileBackground(in string f); - void AddHypothesis(in MG_ADAPT mg); - long Compute(in boolean Publish); - }; - }; #endif // MG_ADAPT_IDL From 4c3cd911ff21491cc56420b5aab654e8c745e0e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Tue, 9 Feb 2021 17:05:33 +0100 Subject: [PATCH 084/100] Message d'erreur en l'absence de fichier --- src/SMESH/MG_ADAPT.cxx | 46 +++++++++++++++++++++++++++++++------- src/SMESH_I/MG_ADAPT_i.cxx | 4 +--- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/src/SMESH/MG_ADAPT.cxx b/src/SMESH/MG_ADAPT.cxx index 640305541..9a44b93d7 100644 --- a/src/SMESH/MG_ADAPT.cxx +++ b/src/SMESH/MG_ADAPT.cxx @@ -30,6 +30,9 @@ #include "MEDFileField.hxx" #include "MEDCouplingFieldDouble.hxx" +#include +#include + #include #include #include @@ -219,9 +222,25 @@ MgAdaptHypothesisData* MgAdapt::getData() const } void MgAdapt::setMedFileIn(std::string fileName) { - medFileIn = fileName; - if (medFileOut == "") // default MED file Out - medFileOut = remove_extension( fileName )+ ".adapt.med"; + if ( isFileExist(fileName) ) + { + medFileIn = fileName; + + if (medFileOut == "") // default MED file Out + medFileOut = remove_extension( fileName )+ ".adapt.med"; + } + else + { + std::cout << "\nThe file " + fileName + " does not exist.\n" << std::endl; +// SALOME::ExceptionStruct es; +// es.type = SALOME::BAD_PARAM; +// std::string text = "\nThe file " + fileName + " does not exist.\n" ; +// std::cout << text << std::endl; +// es.text = "The mesh file does not exist."; +// es.text = CORBA::string_dup(text.c_str()); +// throw SALOME::SALOME_Exception(es); + throw SALOME_Exception(("The file " + fileName + " does not exist." ).c_str() ); + } } std::string MgAdapt::getMedFileIn() @@ -233,7 +252,6 @@ void MgAdapt::setMedFileOut(std::string fileOut) { medFileOut = fileOut; } - std::string MgAdapt::getMedFileOut() { return medFileOut; @@ -363,7 +381,15 @@ bool MgAdapt::getRemoveOnSuccess() } void MgAdapt::setSizeMapFile(std::string mapFile) { - sizeMapFile = mapFile; + if ( mapFile == "" || isFileExist(mapFile) ) + { + sizeMapFile = mapFile; + } + else + { + std::cout << "\nThe file " + mapFile + " does not exist.\n" << std::endl; + throw SALOME_Exception(("The file " + mapFile + " does not exist." ).c_str() ); + } } std::string MgAdapt::getSizeMapFile() { @@ -428,7 +454,6 @@ bool MgAdapt::getPrintLogInFile() return printLogInFile; } - bool MgAdapt::setAll() { @@ -1315,8 +1340,13 @@ med_idt MgAdapt::openMedFile(const std::string aFile) med_idt medIdt = MEDfileOpen(aFile.c_str(),MED_ACC_RDONLY); if (medIdt <0) { - //~addMessage( ToComment(" error: Can't open ") << aFile, /*fatal=*/true ); - ; + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + std::string text = "The med file " + aFile + " cannot be opened." ; +// es.text = "The mesh file does not exist."; + es.text = CORBA::string_dup(text.c_str()); + throw SALOME::SALOME_Exception(es); + return 0; } return medIdt; } diff --git a/src/SMESH_I/MG_ADAPT_i.cxx b/src/SMESH_I/MG_ADAPT_i.cxx index ec2c9d30d..fbe27fd47 100644 --- a/src/SMESH_I/MG_ADAPT_i.cxx +++ b/src/SMESH_I/MG_ADAPT_i.cxx @@ -18,14 +18,12 @@ // #include "MG_ADAPT_i.hxx" -//~#include "ADAPT_Gen_i.hxx" + #include "string.h" #include "SMESH_Gen_i.hxx" #include #include #include CORBA_CLIENT_HEADER(SALOMEDS) -//~#include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog) -//~#include CORBA_CLIENT_HEADER(SMESH_Gen) //============================================================================= From 85b2ed944eec74a8d3ae2ea7c35b961ae9eabc88 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Wed, 10 Feb 2021 13:50:13 +0100 Subject: [PATCH 085/100] =?UTF-8?q?Contr=C3=B4le=20du=20choix=20des=20pas?= =?UTF-8?q?=20de=20temps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SMESH/MG_ADAPT.cxx | 61 +++++++++++++++++++++++++++--------- src/SMESH/MG_ADAPT.hxx | 3 +- src/SMESHGUI/MG_ADAPTGUI.cxx | 6 ++-- 3 files changed, 52 insertions(+), 18 deletions(-) diff --git a/src/SMESH/MG_ADAPT.cxx b/src/SMESH/MG_ADAPT.cxx index 9a44b93d7..76934c6a7 100644 --- a/src/SMESH/MG_ADAPT.cxx +++ b/src/SMESH/MG_ADAPT.cxx @@ -32,6 +32,7 @@ #include #include +#include "Utils_CorbaException.hxx" #include #include @@ -231,15 +232,11 @@ void MgAdapt::setMedFileIn(std::string fileName) } else { - std::cout << "\nThe file " + fileName + " does not exist.\n" << std::endl; -// SALOME::ExceptionStruct es; -// es.type = SALOME::BAD_PARAM; -// std::string text = "\nThe file " + fileName + " does not exist.\n" ; -// std::cout << text << std::endl; -// es.text = "The mesh file does not exist."; -// es.text = CORBA::string_dup(text.c_str()); -// throw SALOME::SALOME_Exception(es); - throw SALOME_Exception(("The file " + fileName + " does not exist." ).c_str() ); + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + std::string text = "\nThe file " + fileName + " does not exist.\n" ; + es.text = CORBA::string_dup(text.c_str()); + throw SALOME::SALOME_Exception(es); } } @@ -387,8 +384,11 @@ void MgAdapt::setSizeMapFile(std::string mapFile) } else { - std::cout << "\nThe file " + mapFile + " does not exist.\n" << std::endl; - throw SALOME_Exception(("The file " + mapFile + " does not exist." ).c_str() ); + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + std::string text = "\nThe file " + mapFile + " does not exist.\n" ; + es.text = CORBA::string_dup(text.c_str()); + throw SALOME::SALOME_Exception(es); } } std::string MgAdapt::getSizeMapFile() @@ -1152,6 +1152,39 @@ void MgAdapt::copyMgAdaptHypothesisData( const MgAdaptHypothesisData* from) data->myVerboseLevel = from->myVerboseLevel; } +bool MgAdapt::checkTimeStepRank(std::string fileIn) +{ + INFOS("checkTimeStepRank"); + bool ret = false ; + MEDCoupling::MCAuto mfd = MEDCoupling::MEDFileData::New(fileIn); + MEDCoupling::MCAuto fts = dynamic_cast( mfd->getFields()->getFieldWithName(fieldName) ); +// std::cout << "--- timeStep " << timeStep << std::endl; +// std::cout << "--- rank " << rank << std::endl; + std::vector timevalue; + std::vector< std::pair > timesteprank = fts->getTimeSteps(timevalue); + std::size_t jaux(timesteprank.size()); + for(std::size_t j=0;j fts = dynamic_cast( mfd->getFields()->getFieldWithName(fieldName) ); MEDCoupling::MCAuto f = fts->getTimeStep(timeStep, rank); MEDCoupling::MCAuto tmFts = MEDCoupling::MEDFileFieldMultiTS::New(); @@ -1342,11 +1377,9 @@ med_idt MgAdapt::openMedFile(const std::string aFile) { SALOME::ExceptionStruct es; es.type = SALOME::BAD_PARAM; - std::string text = "The med file " + aFile + " cannot be opened." ; -// es.text = "The mesh file does not exist."; + std::string text = "\nThe med file " + aFile + " cannot be opened.\n" ; es.text = CORBA::string_dup(text.c_str()); throw SALOME::SALOME_Exception(es); - return 0; } return medIdt; } diff --git a/src/SMESH/MG_ADAPT.hxx b/src/SMESH/MG_ADAPT.hxx index 887d6dc25..0684c2838 100644 --- a/src/SMESH/MG_ADAPT.hxx +++ b/src/SMESH/MG_ADAPT.hxx @@ -272,7 +272,6 @@ public: private : bool fromMedFile; - std::string medFileIn; std::string medFileOut; std::string meshName; @@ -329,6 +328,8 @@ private : void execCmd( const char* cmd, int& err); void cleanUp(); void appendMsgToLogFile(std::string& msg); + bool checkTimeStepRank(std::string fileIn) ; + }; } diff --git a/src/SMESHGUI/MG_ADAPTGUI.cxx b/src/SMESHGUI/MG_ADAPTGUI.cxx index 8a31faa72..8e7a593b1 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.cxx +++ b/src/SMESHGUI/MG_ADAPTGUI.cxx @@ -566,7 +566,7 @@ SMESHGUI_MgAdaptArguments::SMESHGUI_MgAdaptArguments( QWidget* parent ) chosenTimeStep = new QRadioButton(tr("MG_ADAPT_CH_ST"), sizeMapField); timeStepLabel = new QLabel(tr("MG_ADAPT_TSTP"), sizeMapField); timeStep = new QSpinBox(sizeMapField); - //~timeStep->setMinimum(-1); + timeStep->setMinimum(-1); rankLabel = new QLabel(tr("MG_ADAPT_RANK"), sizeMapField); rankSpinBox = new QSpinBox(sizeMapField); rankSpinBox->setMinimum(-1); @@ -649,8 +649,8 @@ void SMESHGUI_MgAdaptArguments::onChosenTimeStep(bool disableOther, int vmax) chosenTimeStep->setChecked(true); visibleTimeStepRankLabel (true); - rankSpinBox->setValue(0); - timeStep->setValue(0); + rankSpinBox->setValue(-1); + timeStep->setValue(-1); if (vmax) timeStep->setMaximum(vmax); } From 58ca79c858e1151163fef7def2ae32334b6ce7f8 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Wed, 10 Feb 2021 14:41:44 +0100 Subject: [PATCH 086/100] =?UTF-8?q?contr=C3=B4le=20du=20nom=20du=20champ?= =?UTF-8?q?=20de=20la=20carte=20de=20taille?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SMESH/MG_ADAPT.cxx | 44 ++++++++++++++++++++++++++++++++---------- src/SMESH/MG_ADAPT.hxx | 1 + 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/src/SMESH/MG_ADAPT.cxx b/src/SMESH/MG_ADAPT.cxx index 76934c6a7..e73758b5d 100644 --- a/src/SMESH/MG_ADAPT.cxx +++ b/src/SMESH/MG_ADAPT.cxx @@ -1152,9 +1152,33 @@ void MgAdapt::copyMgAdaptHypothesisData( const MgAdaptHypothesisData* from) data->myVerboseLevel = from->myVerboseLevel; } +bool MgAdapt::checkFieldName(std::string fileIn) +{ + bool ret = false ; + MEDCoupling::MCAuto mfd = MEDCoupling::MEDFileData::New(fileIn); + std::vector fieldNames(mfd->getFields()->getFieldsNames()); + std::size_t jaux(fieldNames.size()); + for(std::size_t j=0;j mfd = MEDCoupling::MEDFileData::New(fileIn); MEDCoupling::MCAuto fts = dynamic_cast( mfd->getFields()->getFieldWithName(fieldName) ); @@ -1165,19 +1189,15 @@ bool MgAdapt::checkTimeStepRank(std::string fileIn) std::size_t jaux(timesteprank.size()); for(std::size_t j=0;j fts = dynamic_cast( mfd->getFields()->getFieldWithName(fieldName) ); MEDCoupling::MCAuto f = fts->getTimeStep(timeStep, rank); MEDCoupling::MCAuto tmFts = MEDCoupling::MEDFileFieldMultiTS::New(); diff --git a/src/SMESH/MG_ADAPT.hxx b/src/SMESH/MG_ADAPT.hxx index 0684c2838..be289729a 100644 --- a/src/SMESH/MG_ADAPT.hxx +++ b/src/SMESH/MG_ADAPT.hxx @@ -328,6 +328,7 @@ private : void execCmd( const char* cmd, int& err); void cleanUp(); void appendMsgToLogFile(std::string& msg); + bool checkFieldName(std::string fileIn) ; bool checkTimeStepRank(std::string fileIn) ; }; From b54385ddd41b61114e7d1088048f2f1131c30f1d Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Wed, 10 Feb 2021 16:31:01 +0100 Subject: [PATCH 087/100] les champs par medcoupling --- src/SMESH/MG_ADAPT.cxx | 26 +++++++++---- src/SMESH/MG_ADAPT.hxx | 1 + src/SMESHGUI/CMakeLists.txt | 1 - src/SMESHGUI/MG_ADAPTGUI.cxx | 52 +++++--------------------- src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.h | 2 - 5 files changed, 30 insertions(+), 52 deletions(-) diff --git a/src/SMESH/MG_ADAPT.cxx b/src/SMESH/MG_ADAPT.cxx index e73758b5d..d22075995 100644 --- a/src/SMESH/MG_ADAPT.cxx +++ b/src/SMESH/MG_ADAPT.cxx @@ -1152,22 +1152,31 @@ void MgAdapt::copyMgAdaptHypothesisData( const MgAdaptHypothesisData* from) data->myVerboseLevel = from->myVerboseLevel; } +std::vector MgAdapt::getListFieldsNames(std::string fileIn) +{ + MEDCoupling::MCAuto mfd = MEDCoupling::MEDFileData::New(fileIn); + std::vector listFieldsNames(mfd->getFields()->getFieldsNames()); + return listFieldsNames ; +} + bool MgAdapt::checkFieldName(std::string fileIn) { bool ret = false ; - MEDCoupling::MCAuto mfd = MEDCoupling::MEDFileData::New(fileIn); - std::vector fieldNames(mfd->getFields()->getFieldsNames()); - std::size_t jaux(fieldNames.size()); + std::vector listFieldsNames = getListFieldsNames(fileIn); + std::size_t jaux(listFieldsNames.size()); for(std::size_t j=0;j getListFieldsNames(std::string fileIn) ; bool checkFieldName(std::string fileIn) ; bool checkTimeStepRank(std::string fileIn) ; diff --git a/src/SMESHGUI/CMakeLists.txt b/src/SMESHGUI/CMakeLists.txt index 5b5bd4a8c..237f63801 100644 --- a/src/SMESHGUI/CMakeLists.txt +++ b/src/SMESHGUI/CMakeLists.txt @@ -42,7 +42,6 @@ INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/src/Controls ${PROJECT_SOURCE_DIR}/src/SMESHClient ${PROJECT_SOURCE_DIR}/src/MEDWrapper - ${PROJECT_SOURCE_DIR}/src/ADAPT ${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}/idl ${MEDCOUPLING_INCLUDE_DIRS} diff --git a/src/SMESHGUI/MG_ADAPTGUI.cxx b/src/SMESHGUI/MG_ADAPTGUI.cxx index 8e7a593b1..401b97484 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.cxx +++ b/src/SMESHGUI/MG_ADAPTGUI.cxx @@ -23,6 +23,8 @@ #include "MG_ADAPTGUI.hxx" +#include "MEDFileData.hxx" + #include "SUIT_Desktop.h" #include "SUIT_Application.h" #include "SUIT_Session.h" @@ -1363,21 +1365,13 @@ std::map GetListeChamps(QString aFile, bool errorMessage) std::map ListeChamp ; med_err erreur = 0 ; - med_idt medIdt ; while ( erreur == 0 ) { - // Ouverture du fichier - SCRUTE(aFile.toStdString()); - medIdt = OuvrirFichier(aFile); - if ( medIdt < 0 ) - { - erreur = 1 ; - break ; - } - // Lecture du nombre de champs - med_int ncha = MEDnField(medIdt) ; - if (ncha < 1 ) + MEDCoupling::MCAuto mfd = MEDCoupling::MEDFileData::New(aFile.toStdString()); + std::vector listFieldsNames(mfd->getFields()->getFieldsNames()); + std::size_t jaux(listFieldsNames.size()); + if (jaux < 1 ) { if(errorMessage) { @@ -1387,40 +1381,14 @@ std::map GetListeChamps(QString aFile, bool errorMessage) erreur = 2 ; break ; } - // Lecture des caracteristiques des champs - for (int i=0; i< ncha; i++) + med_int nbofcstp = 1; + for(std::size_t j=0;j (QString(nomcha), nbofcstp)); - +// std::cout << listFieldsNames[j] << std::endl; + ListeChamp.insert(std::pair (QString(listFieldsNames[j].c_str()), nbofcstp)); } break ; } - // Fermeture du fichier - if ( medIdt > 0 ) MEDfileClose(medIdt); return ListeChamp; } diff --git a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.h b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.h index f68398525..20e09dd95 100644 --- a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.h +++ b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.h @@ -43,9 +43,7 @@ #include #include // model -//~#include "MG_ADAPT.h" #include "MG_ADAPTGUI.hxx" -//~#include "MG_ADAPT.hxx" #include CORBA_SERVER_HEADER(MG_ADAPT) From 6b6029858bb706c17c908901759a1e72bb9c67cb Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Wed, 10 Feb 2021 18:00:43 +0100 Subject: [PATCH 088/100] =?UTF-8?q?Exceptions=20oubli=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- idl/MG_ADAPT.idl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/idl/MG_ADAPT.idl b/idl/MG_ADAPT.idl index 59ca6a1fd..6a4c7c983 100644 --- a/idl/MG_ADAPT.idl +++ b/idl/MG_ADAPT.idl @@ -141,12 +141,12 @@ module SMESH{ typedef MG_ADAPT MG_ADAPT_HYPOTHESIS; interface MG_ADAPT_OBJECT : SALOME::GenericObj { - void setMeshIn(in SMESH_Mesh theMesh ); - void setMEDFileIn(in string f); - void setMEDFileOut(in string f); - void setMEDFileBackground(in string f); - void AddHypothesis(in MG_ADAPT mg); - long Compute(in boolean Publish); + void setMeshIn(in SMESH_Mesh theMesh ) raises (SALOME::SALOME_Exception); + void setMEDFileIn(in string f) raises (SALOME::SALOME_Exception); + void setMEDFileOut(in string f) raises (SALOME::SALOME_Exception); + void setMEDFileBackground(in string f) raises (SALOME::SALOME_Exception); + void AddHypothesis(in MG_ADAPT mg) raises (SALOME::SALOME_Exception); + long Compute(in boolean Publish) raises (SALOME::SALOME_Exception); }; }; From 36da8034494ef9123c793a446e79eee7080fa29c Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Wed, 10 Feb 2021 18:01:16 +0100 Subject: [PATCH 089/100] Usage de medcoupling pour le nom du maillage --- src/SMESHGUI/MG_ADAPTGUI.cxx | 65 +++++------------------------------- src/SMESHGUI/MG_ADAPTGUI.hxx | 1 - src/SMESHGUI/SMESH_msg_en.ts | 4 --- src/SMESHGUI/SMESH_msg_fr.ts | 4 --- 4 files changed, 8 insertions(+), 66 deletions(-) diff --git a/src/SMESHGUI/MG_ADAPTGUI.cxx b/src/SMESHGUI/MG_ADAPTGUI.cxx index 401b97484..c1df37aa7 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.cxx +++ b/src/SMESHGUI/MG_ADAPTGUI.cxx @@ -24,6 +24,7 @@ #include "MG_ADAPTGUI.hxx" #include "MEDFileData.hxx" +#include "MEDLoader.hxx" #include "SUIT_Desktop.h" #include "SUIT_Application.h" @@ -1278,82 +1279,32 @@ med_idt OuvrirFichier(QString aFile) QString lireNomMaillage(QString aFile, med_int& meshdim) { QString nomMaillage = QString::null ; - int erreur = 0 ; - med_idt medIdt ; - // Ouverture du fichier - medIdt = OuvrirFichier(aFile); - if ( medIdt < 0 ) - { - erreur = 1 ; - return nomMaillage; - } - med_int numberOfMeshes = MEDnMesh(medIdt) ; + std::vector listMeshesNames = MEDCoupling::GetMeshNames(aFile.toStdString()); + + std::size_t numberOfMeshes(listMeshesNames.size()); +// std::cout << "numberOfMeshes:" << numberOfMeshes << std::endl; if (numberOfMeshes == 0 ) { QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), QObject::tr("MG_ADAPT_MED_FILE_2") ); - erreur = 2 ; return nomMaillage; } if (numberOfMeshes > 1 ) { QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), QObject::tr("MG_ADAPT_MED_FILE_3") ); - erreur = 3 ; return nomMaillage; } - nomMaillage = lireNomMaillage2(medIdt,1, meshdim); - // Fermeture du fichier - if ( medIdt > 0 ) MEDfileClose(medIdt); +// std::cout << "numberOfMeshes:" << numberOfMeshes << std::endl; + std::cout << "nomMaillage:" << listMeshesNames[0] << std::endl; + nomMaillage = QString(listMeshesNames[0].c_str()); return nomMaillage; } // ======================================================================= -// ======================================================================= -QString lireNomMaillage2(med_idt medIdt,int meshId, med_int& meshdim ) -{ - QString NomMaillage=QString::null; - char meshname[MED_NAME_SIZE+1]; - med_int spacedim; - med_mesh_type meshtype; - char descriptionription[MED_COMMENT_SIZE+1]; - char dtunit[MED_SNAME_SIZE+1]; - med_sorting_type sortingtype; - med_int nstep; - med_axis_type axistype; - int naxis = MEDmeshnAxis(medIdt,1); - char *axisname=new char[naxis*MED_SNAME_SIZE+1]; - char *axisunit=new char[naxis*MED_SNAME_SIZE+1]; - med_err aRet = MEDmeshInfo(medIdt, - meshId, - meshname, - &spacedim, - &meshdim, - &meshtype, - descriptionription, - dtunit, - &sortingtype, - &nstep, - &axistype, - axisname, - axisunit); - - if ( aRet < 0 ) { - QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), \ - QObject::tr("MG_ADAPT_MED_FILE_4") ); - } - else { - NomMaillage=QString(meshname); - } - - delete[] axisname ; - delete[] axisunit ; - - return NomMaillage; -} // ======================================================================= std::map GetListeChamps(QString aFile, bool errorMessage) diff --git a/src/SMESHGUI/MG_ADAPTGUI.hxx b/src/SMESHGUI/MG_ADAPTGUI.hxx index 823a5afa9..7be0fdbc4 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.hxx +++ b/src/SMESHGUI/MG_ADAPTGUI.hxx @@ -99,7 +99,6 @@ class QFileDialog; std::map GetListeChamps(QString aFile, bool errorMessage = true); QString lireNomMaillage(QString aFile, med_int& meshDim); -QString lireNomMaillage2(med_idt medIdt,int meshId, med_int& meshDim); med_idt OuvrirFichier(QString aFile); std::string remove_extension(const std::string& filename); diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index fcac5cfe7..32fb70b88 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -396,10 +396,6 @@ MG_ADAPT_MED_FILE_5 No field in this MED file. - - MG_ADAPT_MED_FILE_6 - The field(s) in this MED file cannot be read. - MG_ADAPT_ERROR Error diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index 9cdbdd649..b69f4650a 100644 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -396,10 +396,6 @@ MG_ADAPT_MED_FILE_5 Ce fichier MED ne contient aucun champ. - - MG_ADAPT_MED_FILE_6 - Impossible de lire le(s) champ(s) de ce fichier MED. - MG_ADAPT_ERROR Erreur From a23e1b0daf9aba788275accff0243565b668de50 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Thu, 11 Feb 2021 08:43:57 +0100 Subject: [PATCH 090/100] MEDcoupling pour la dimension du maillage --- src/SMESHGUI/MG_ADAPTGUI.cxx | 71 ++++++++++++++++-------------------- src/SMESHGUI/MG_ADAPTGUI.hxx | 3 +- 2 files changed, 32 insertions(+), 42 deletions(-) diff --git a/src/SMESHGUI/MG_ADAPTGUI.cxx b/src/SMESHGUI/MG_ADAPTGUI.cxx index c1df37aa7..9fae60140 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.cxx +++ b/src/SMESHGUI/MG_ADAPTGUI.cxx @@ -1259,65 +1259,54 @@ void MgAdaptAdvWidgetTreeWidget::keyPressEvent( QKeyEvent* e ) QTreeWidget::keyPressEvent( e ); } - -// ======================================================================= -// renvoie le medId associe au fichier Med apres ouverture -// ======================================================================= -med_idt OuvrirFichier(QString aFile) -{ - med_idt medIdt = MEDfileOpen(aFile.toStdString().c_str(),MED_ACC_RDONLY); - if (medIdt <0) - { - QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), - QObject::tr("MG_ADAPT_MED_FILE_1") ); - } - return medIdt; -} - // ====================================================== // ======================================================== QString lireNomMaillage(QString aFile, med_int& meshdim) { QString nomMaillage = QString::null ; - std::vector listMeshesNames = MEDCoupling::GetMeshNames(aFile.toStdString()); - - std::size_t numberOfMeshes(listMeshesNames.size()); -// std::cout << "numberOfMeshes:" << numberOfMeshes << std::endl; - if (numberOfMeshes == 0 ) + while ( true ) { - QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), - QObject::tr("MG_ADAPT_MED_FILE_2") ); - return nomMaillage; - } - if (numberOfMeshes > 1 ) - { - QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), - QObject::tr("MG_ADAPT_MED_FILE_3") ); - return nomMaillage; - } + std::vector listMeshesNames = MEDCoupling::GetMeshNames(aFile.toStdString()); -// std::cout << "numberOfMeshes:" << numberOfMeshes << std::endl; - std::cout << "nomMaillage:" << listMeshesNames[0] << std::endl; - nomMaillage = QString(listMeshesNames[0].c_str()); + std::size_t numberOfMeshes(listMeshesNames.size()); + // std::cout << "numberOfMeshes:" << numberOfMeshes << std::endl; + if (numberOfMeshes == 0 ) + { + QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), + QObject::tr("MG_ADAPT_MED_FILE_2") ); + break ; + } + if (numberOfMeshes > 1 ) + { + QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"), + QObject::tr("MG_ADAPT_MED_FILE_3") ); + break ; + } + +// std::cout << "nomMaillage:" << listMeshesNames[0] << std::endl; + nomMaillage = QString(listMeshesNames[0].c_str()); + + // Dimension du maillage + MEDCoupling::MCAuto mfd = MEDCoupling::MEDFileData::New(aFile.toStdString()); + meshdim = mfd->getMeshes()->getMeshAtPos(0)->getMeshDimension() ; +// std::cout << "meshdim:" << meshdim << std::endl; + + break ; + } return nomMaillage; } -// ======================================================================= - // ======================================================================= std::map GetListeChamps(QString aFile, bool errorMessage) // ======================================================================= { // Il faut voir si plusieurs maillages - MESSAGE("GetListeChamps"); std::map ListeChamp ; - med_err erreur = 0 ; - - while ( erreur == 0 ) + while ( true ) { MEDCoupling::MCAuto mfd = MEDCoupling::MEDFileData::New(aFile.toStdString()); std::vector listFieldsNames(mfd->getFields()->getFieldsNames()); @@ -1329,9 +1318,9 @@ std::map GetListeChamps(QString aFile, bool errorMessage) QMessageBox::critical( 0, QObject::tr("_ERROR"), QObject::tr("HOM_MED_FILE_5") ); } - erreur = 2 ; break ; } + // nbofcstp inutile pour le moment med_int nbofcstp = 1; for(std::size_t j=0;j GetListeChamps(QString aFile, bool errorMessage) return ListeChamp; } +// ======================================================================= std::string remove_extension(const std::string& filename) +// ======================================================================= { size_t lastdot = filename.find_last_of("."); if (lastdot == std::string::npos) return filename; diff --git a/src/SMESHGUI/MG_ADAPTGUI.hxx b/src/SMESHGUI/MG_ADAPTGUI.hxx index 7be0fdbc4..3204a11af 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.hxx +++ b/src/SMESHGUI/MG_ADAPTGUI.hxx @@ -99,9 +99,8 @@ class QFileDialog; std::map GetListeChamps(QString aFile, bool errorMessage = true); QString lireNomMaillage(QString aFile, med_int& meshDim); -med_idt OuvrirFichier(QString aFile); -std::string remove_extension(const std::string& filename); +std::string remove_extension(const std::string& filename); enum ADAPTATION_MODE{ SURFACE, // surface adaption when meshDim == 2 From 37d8c5a41ce1ba24b5cae45cf8e15e8e169595f8 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Thu, 11 Feb 2021 10:35:50 +0100 Subject: [PATCH 091/100] =?UTF-8?q?contr=C3=B4les?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SMESH/MG_ADAPT.cxx | 69 ++++++++++++++++++++++++++++-------------- src/SMESH/MG_ADAPT.hxx | 5 +-- 2 files changed, 49 insertions(+), 25 deletions(-) diff --git a/src/SMESH/MG_ADAPT.cxx b/src/SMESH/MG_ADAPT.cxx index d22075995..66ab95aa1 100644 --- a/src/SMESH/MG_ADAPT.cxx +++ b/src/SMESH/MG_ADAPT.cxx @@ -133,7 +133,7 @@ MgAdapt::~MgAdapt() void MgAdapt::buildModel() { - const char* boolOptionNames[] = { "compute_ridges", // yes + const char* boolOptionNames[] = { "compute_ridges", // yes "" // mark of end }; // const char* intOptionNames[] = { "max_number_of_errors_printed", // 1 @@ -143,8 +143,8 @@ void MgAdapt::buildModel() const char* doubleOptionNames[] = { "max_memory", // 0 "" // mark of end }; - const char* charOptionNames[] = { "components", // "yes" - "adaptation", // both + const char* charOptionNames[] = { "components", // "yes" + "adaptation", // both "" // mark of end }; @@ -171,10 +171,10 @@ void MgAdapt::buildModel() // default values to be used while MG-Adapt - _defaultOptionValues["adaptation" ] = "both"; - _defaultOptionValues["components" ] = "outside components"; - _defaultOptionValues["compute_ridges" ] = "yes"; - _defaultOptionValues["max_memory" ] = ToComment(defaultMaximumMemory()); + _defaultOptionValues["adaptation" ] = "both"; + _defaultOptionValues["components" ] = "outside components"; + _defaultOptionValues["compute_ridges"] = "yes"; + _defaultOptionValues["max_memory" ] = ToComment(defaultMaximumMemory()); } //============================================================================= @@ -527,6 +527,8 @@ void MgAdapt::setOptionValue(const std::string& optionName, const std::string& optionValue) throw (std::invalid_argument) { +// INFOS("setOptionValue"); +// std::cout << "optionName: " << optionName << ", optionValue: " << optionValue << std::endl; TOptionValues::iterator op_val = _option2value.find(optionName); if (op_val == _option2value.end()) { @@ -586,6 +588,7 @@ throw (std::invalid_argument) std::string value( ptr, i ); if ( _defaultOptionValues[ optionName ] == value ) value.clear(); +// std::cout << "==> value: " << value << std::endl; op_val->second = value; } @@ -594,9 +597,11 @@ throw (std::invalid_argument) //! Return option value. If isDefault provided, it can be a default value, // then *isDefault == true. If isDefault is not provided, the value will be // empty if it equals a default one. -std::string MgAdapt::getOptionValue(const std::string& optionName, bool* isDefault) const +std::string MgAdapt::getOptionValue(const std::string& optionName, bool* isDefault) const throw (std::invalid_argument) { +// INFOS("getOptionValue"); +// std::cout << "optionName: " << optionName << ", isDefault: " << isDefault << std::endl; TOptionValues::const_iterator op_val = _option2value.find(optionName); if (op_val == _option2value.end()) { @@ -615,6 +620,8 @@ throw (std::invalid_argument) op_val = _defaultOptionValues.find( optionName ); if (op_val != _defaultOptionValues.end()) val = op_val->second; } +// std::cout << "==> val: " << val << std::endl; + return val; } //================================================================================ @@ -858,9 +865,11 @@ std::string MgAdapt::getCommandToRun() //~{ //~// constant value TODO //~} - /* sizemap file is not adapted in case of only surface adaptation see MeshGems docs */ std::string adapOp = "adaptation"; std::string adpOpVal = getOptionValue(adapOp); + // Check coherence between mesh dimension and option +// checkDimensionOption(adpOpVal); + /* sizemap file is not adapted in case of only surface adaptation see MeshGems docs */ std::string surfaceAdapt = "surface"; if(surfaceAdapt != adpOpVal ) { @@ -869,10 +878,6 @@ std::string MgAdapt::getCommandToRun() solFormatOutput.push_back(solFileOut); tmpFilesToBeDeleted.push_back(solFileOut); } - if (verbosityLevel != defaultVerboseLevel()) - { - cmd+= " --verbose "+ ToComment(verbosityLevel); - } std::string option, value; bool isDefault; @@ -906,6 +911,12 @@ std::string MgAdapt::getCommandToRun() cmd += option + " " + value; } } + + // Verbosity Level + if (verbosityLevel != defaultVerboseLevel()) + { + cmd+= " --verbose "+ ToComment(verbosityLevel); + } //~} //~cmd+= " >" #ifdef WIN32 @@ -1159,7 +1170,23 @@ std::vector MgAdapt::getListFieldsNames(std::string fileIn) return listFieldsNames ; } -bool MgAdapt::checkFieldName(std::string fileIn) +void MgAdapt::checkDimensionOption(std::string adpOpVal) +{ + // Pas correct. + MEDCoupling::MCAuto mfd = MEDCoupling::MEDFileData::New(medFileIn); + int meshdim = mfd->getMeshes()->getMeshAtPos(0)->getMeshDimension() ; + + if ( ( meshdim == 2 ) & ( adpOpVal != "surface" ) ) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + std::string text = "Mesh dimension is 2; the option should be 'surface' instead of '" + adpOpVal + "'." ; + es.text = CORBA::string_dup(text.c_str()); + throw SALOME::SALOME_Exception(es); + } +} + +void MgAdapt::checkFieldName(std::string fileIn) { bool ret = false ; std::vector listFieldsNames = getListFieldsNames(fileIn); @@ -1183,10 +1210,9 @@ bool MgAdapt::checkFieldName(std::string fileIn) es.text = CORBA::string_dup(text.c_str()); throw SALOME::SALOME_Exception(es); } - return ret ; } -bool MgAdapt::checkTimeStepRank(std::string fileIn) +void MgAdapt::checkTimeStepRank(std::string fileIn) { bool ret = false ; MEDCoupling::MCAuto mfd = MEDCoupling::MEDFileData::New(fileIn); @@ -1215,7 +1241,6 @@ bool MgAdapt::checkTimeStepRank(std::string fileIn) es.text = CORBA::string_dup(text.c_str()); throw SALOME::SALOME_Exception(es); } - return ret ; } void MgAdapt::convertMedFile(std::string& meshFormatMeshFileName, std::string& solFormatFieldFileName, std::string& meshFormatsizeMapFile) @@ -1236,18 +1261,16 @@ void MgAdapt::convertMedFile(std::string& meshFormatMeshFileName, std::string& s if (useBackgroundMap) { - bool ret ; - ret = checkFieldName(sizeMapFile) ; - ret = checkTimeStepRank(sizeMapFile) ; + checkFieldName(sizeMapFile) ; + checkTimeStepRank(sizeMapFile) ; meshFormatsizeMapFile = getFileName(); meshFormatsizeMapFile += ".mesh"; buildBackGroundMeshAndSolFiles(fieldFileNames, meshFormatsizeMapFile); } else if(useLocalMap) { - bool ret ; - ret = checkFieldName(medFileIn) ; - ret = checkTimeStepRank(medFileIn) ; + checkFieldName(medFileIn) ; + checkTimeStepRank(medFileIn) ; MEDCoupling::MCAuto fts = dynamic_cast( mfd->getFields()->getFieldWithName(fieldName) ); MEDCoupling::MCAuto f = fts->getTimeStep(timeStep, rank); MEDCoupling::MCAuto tmFts = MEDCoupling::MEDFileFieldMultiTS::New(); diff --git a/src/SMESH/MG_ADAPT.hxx b/src/SMESH/MG_ADAPT.hxx index 9364add29..68f699baf 100644 --- a/src/SMESH/MG_ADAPT.hxx +++ b/src/SMESH/MG_ADAPT.hxx @@ -329,8 +329,9 @@ private : void cleanUp(); void appendMsgToLogFile(std::string& msg); std::vector getListFieldsNames(std::string fileIn) ; - bool checkFieldName(std::string fileIn) ; - bool checkTimeStepRank(std::string fileIn) ; + void checkDimensionOption(std::string adpOpVal) ; + void checkFieldName(std::string fileIn) ; + void checkTimeStepRank(std::string fileIn) ; }; From af3f09b8435e6d57669e0c7ebef3d04de37de2f0 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Fri, 12 Feb 2021 14:50:59 +0100 Subject: [PATCH 092/100] Option d'adaptation enfocntion de la dimension des maillages --- src/SMESH/MG_ADAPT.cxx | 68 +++++++++++++++++++++++++++++------------- src/SMESH/MG_ADAPT.hxx | 2 +- 2 files changed, 49 insertions(+), 21 deletions(-) diff --git a/src/SMESH/MG_ADAPT.cxx b/src/SMESH/MG_ADAPT.cxx index 66ab95aa1..c3e95da76 100644 --- a/src/SMESH/MG_ADAPT.cxx +++ b/src/SMESH/MG_ADAPT.cxx @@ -539,7 +539,6 @@ throw (std::invalid_argument) if (op_val->second != optionValue) { - std::string lowerOptionValue = toLowerStr(optionValue); const char* ptr = lowerOptionValue.c_str(); // strip white spaces @@ -586,11 +585,11 @@ throw (std::invalid_argument) throw std::invalid_argument(msg); } std::string value( ptr, i ); +// std::cout << "==> value: " << value << std::endl; if ( _defaultOptionValues[ optionName ] == value ) value.clear(); // std::cout << "==> value: " << value << std::endl; op_val->second = value; - } } //============================================================================= @@ -744,6 +743,8 @@ std::string MgAdapt::getCommandToRun(MgAdapt* hyp) int MgAdapt::compute(std::string& errStr) { std::string cmd = getCommandToRun(); +// std::cout << cmd << std::endl; + int err = 0; execCmd( cmd.c_str(), err ); // run @@ -865,13 +866,11 @@ std::string MgAdapt::getCommandToRun() //~{ //~// constant value TODO //~} - std::string adapOp = "adaptation"; - std::string adpOpVal = getOptionValue(adapOp); - // Check coherence between mesh dimension and option -// checkDimensionOption(adpOpVal); - /* sizemap file is not adapted in case of only surface adaptation see MeshGems docs */ - std::string surfaceAdapt = "surface"; - if(surfaceAdapt != adpOpVal ) + // Check coherence between mesh dimension and option fo adaptation + checkDimensionOptionAdaptation(); + +// sizemap file is written only if level is higher than 3 + if ( verbosityLevel > 3) { std::string solFileOut = getFileName()+".sol"; cmd+= " --write_sizemap "+ solFileOut; @@ -891,23 +890,24 @@ std::string MgAdapt::getCommandToRun() value = getOptionValue( option, &isDefault ); if ( isDefault ) - continue; + continue; if ( value.empty() )//value == NoValue() ) { if ( _defaultOptionValues.count( option )) - continue; // non-custom option with no value + continue; // non-custom option with no value //value.clear(); } if ( strncmp( "no", option.c_str(), 2 ) == 0 ) // options w/o values: --no_* { if ( !value.empty() && toBool( value ) == false ) - continue; + continue; value.clear(); } if ( option[0] != '-' ) cmd += " --"; else cmd += " "; +// std::cout << "--- option: '" << option << ", value: '" << value <<"'"<< std::endl; cmd += option + " " + value; } } @@ -922,6 +922,8 @@ std::string MgAdapt::getCommandToRun() #ifdef WIN32 cmd += " < NUL"; #endif +// std::cout << "--- cmd :"<< std::endl; +// std::cout << cmd << std::endl; return cmd; } @@ -1170,19 +1172,45 @@ std::vector MgAdapt::getListFieldsNames(std::string fileIn) return listFieldsNames ; } -void MgAdapt::checkDimensionOption(std::string adpOpVal) +void MgAdapt::checkDimensionOptionAdaptation() { - // Pas correct. + // Quand le maillage est 3D, tout est possible + // Quand le maillage est 2D, il faut 'surface' sauf si carte de fonds 3D MEDCoupling::MCAuto mfd = MEDCoupling::MEDFileData::New(medFileIn); int meshdim = mfd->getMeshes()->getMeshAtPos(0)->getMeshDimension() ; +// std::cout << "meshdim = " << meshdim << std::endl; - if ( ( meshdim == 2 ) & ( adpOpVal != "surface" ) ) + if ( meshdim == 2 ) { - SALOME::ExceptionStruct es; - es.type = SALOME::BAD_PARAM; - std::string text = "Mesh dimension is 2; the option should be 'surface' instead of '" + adpOpVal + "'." ; - es.text = CORBA::string_dup(text.c_str()); - throw SALOME::SALOME_Exception(es); + std::string optionName = "adaptation"; + std::string optionValue = getOptionValue(optionName); +// std::cout << "optionValue = '" << optionValue <<"'"<< std::endl; + bool a_tester = false ; + // carte locale ou constante : impératif d'avoir "surface" + if ( useLocalMap || useConstantValue) a_tester = true ; + // carte de fond : impératif d'avoir "surface" si le fonds est aussi 2D + else + { + MEDCoupling::MCAuto mfdbg = MEDCoupling::MEDFileData::New(sizeMapFile); + int meshdimbg = mfdbg->getMeshes()->getMeshAtPos(0)->getMeshDimension() ; +// std::cout << "meshdimbg = " << meshdimbg << std::endl; + if ( meshdimbg == 2 ) a_tester = true ; + } + if ( a_tester ) + { + if ( optionValue == "" ) setOptionValue (optionName, "surface"); + else + { + if ( optionValue != "surface" ) + { + SALOME::ExceptionStruct es; + es.type = SALOME::BAD_PARAM; + std::string text = "Mesh dimension is 2; the option should be 'surface' instead of '" + optionValue + "'." ; + es.text = CORBA::string_dup(text.c_str()); + throw SALOME::SALOME_Exception(es); + } + } + } } } diff --git a/src/SMESH/MG_ADAPT.hxx b/src/SMESH/MG_ADAPT.hxx index 68f699baf..ba128314b 100644 --- a/src/SMESH/MG_ADAPT.hxx +++ b/src/SMESH/MG_ADAPT.hxx @@ -329,7 +329,7 @@ private : void cleanUp(); void appendMsgToLogFile(std::string& msg); std::vector getListFieldsNames(std::string fileIn) ; - void checkDimensionOption(std::string adpOpVal) ; + void checkDimensionOptionAdaptation() ; void checkFieldName(std::string fileIn) ; void checkTimeStepRank(std::string fileIn) ; From 0b1452b15de601cbc30e771a4aac70c3413fb80d Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Fri, 12 Feb 2021 15:40:12 +0100 Subject: [PATCH 093/100] Filtrage des options selon les dimensions --- src/SMESHGUI/MG_ADAPTGUI.cxx | 37 ++++++++++++++++++++++++++++-------- src/SMESHGUI/MG_ADAPTGUI.hxx | 7 ++++--- 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/src/SMESHGUI/MG_ADAPTGUI.cxx b/src/SMESHGUI/MG_ADAPTGUI.cxx index 9fae60140..a449cdd0b 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.cxx +++ b/src/SMESHGUI/MG_ADAPTGUI.cxx @@ -487,6 +487,7 @@ SMESHGUI_MgAdaptArguments::SMESHGUI_MgAdaptArguments( QWidget* parent ) } meshDim = 0; + meshDimBG = 0; // Mesh in aMeshIn = new QGroupBox( tr( "MeshIn" ), this ); aMedfile = new QRadioButton( tr( "MEDFile" ), aMeshIn ); @@ -701,6 +702,10 @@ void SMESHGUI_MgAdaptArguments::onSelectMedFileBackgroundbutton() int typeStepInField = it->second > 2 ? 2 : it->second ; timeStepGroupChanged(typeStepInField, false); } + // Dimension du maillage de fonds + MEDCoupling::MCAuto mfd = MEDCoupling::MEDFileData::New(fileName.toStdString()); + meshDimBG = mfd->getMeshes()->getMeshAtPos(0)->getMeshDimension() ; + valueAdaptation (); } } else @@ -756,8 +761,9 @@ void SMESHGUI_MgAdaptArguments::onSelectMedFilebuttonClicked() else { meshNameLineEdit->setText(aMeshName); - ADAPTATION_MODE aMode = meshDim == 3 ? ADAPTATION_MODE::BOTH : ADAPTATION_MODE::SURFACE; // and when dimesh 3 without 2D mesh? - emit meshDimSignal(aMode); + valueAdaptation (); +// ADAPTATION_MODE aMode = meshDim == 3 ? ADAPTATION_MODE::BOTH : ADAPTATION_MODE::SURFACE; // and when dimesh 3 without 2D mesh? +// emit meshDimSignal(aMode); } } else @@ -776,6 +782,20 @@ void SMESHGUI_MgAdaptArguments::onSelectMedFilebuttonClicked() } +void SMESHGUI_MgAdaptArguments::valueAdaptation() +{ + ADAPTATION_MODE aMode ; + if ( meshDimBG < 3 ) + { + aMode = meshDim == 3 ? ADAPTATION_MODE::BOTH : ADAPTATION_MODE::SURFACE; + } + else + { + aMode = ADAPTATION_MODE::BOTH; + } + emit meshDimSignal(aMode); +} + void SMESHGUI_MgAdaptArguments::onLocalSelected(QString filePath) { myFieldList = GetListeChamps(filePath, false); @@ -886,7 +906,6 @@ void SMESHGUI_MgAdaptArguments::sizeMapDefChanged( int theSizeMap ) valueLabel->hide(); dvalue->hide(); sizeMapField->setEnabled(true); - } else { @@ -899,6 +918,8 @@ void SMESHGUI_MgAdaptArguments::sizeMapDefChanged( int theSizeMap ) dvalue->show(); sizeMapField->setEnabled(false); } + meshDimBG = 0; + valueAdaptation(); } void SMESHGUI_MgAdaptArguments::timeStepGroupChanged(int timeStepType, bool disableOther, int vmax) { @@ -925,10 +946,10 @@ void SMESHGUI_MgAdaptArguments::clear() meshNameLineEdit->clear(); selectOutMedFileLineEdit->clear(); } -med_int SMESHGUI_MgAdaptArguments::getMeshDim() const -{ - return meshDim; -} +// med_int SMESHGUI_MgAdaptArguments::getMeshDim() const +// { +// return meshDim; +// } QWidget* ItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &o, const QModelIndex &index) const { bool editable = index.data( EDITABLE_ROLE ).toInt(); @@ -1149,7 +1170,7 @@ void MgAdaptAdvWidget::_onWorkingDirectoryPushButton() void MgAdaptAdvWidget::onMeshDimChanged(ADAPTATION_MODE aMode) { /* default adaptation mode - * assume that if meshDim == 2 -->adaptation surface + * assume that if meshDim == 2 and no 3D backgrounmesh-->adaptation surface * if meshDim == 3 and if there is not 2D mesh -->VOLUME * else BOTH */ diff --git a/src/SMESHGUI/MG_ADAPTGUI.hxx b/src/SMESHGUI/MG_ADAPTGUI.hxx index 3204a11af..5121d1102 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.hxx +++ b/src/SMESHGUI/MG_ADAPTGUI.hxx @@ -103,8 +103,8 @@ QString lireNomMaillage(QString aFile, med_int& meshDim); std::string remove_extension(const std::string& filename); enum ADAPTATION_MODE{ - SURFACE, // surface adaption when meshDim == 2 - VOLUME, // + SURFACE, + VOLUME, BOTH }; //================================================================================= @@ -164,7 +164,6 @@ public: SMESHGUI_MgAdaptArguments( QWidget* parent); ~SMESHGUI_MgAdaptArguments(); void setMode( const Mode, const SIZEMAP ); - med_int getMeshDim() const; QString* myFileInDir; QString* myFileOutDir; @@ -239,12 +238,14 @@ private slots: void onLastTimeStep(bool disableOther = false); void onChosenTimeStep(bool disableOther = false, int vmax = 0); void visibleTimeStepRankLabel(bool visible); + void valueAdaptation (); private: QString getMedFileName(bool avertir); LightApp_SelectionMgr* selMgr ; med_int meshDim; + med_int meshDimBG; std::map myFieldList; }; From 256d1cf236b83eef1c3920c271c4078368cb1804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Mon, 15 Feb 2021 15:39:22 +0100 Subject: [PATCH 094/100] Ajout des cas-tests --- doc/salome/examples/CMakeLists.txt | 1 + doc/salome/examples/MGAdaptTests.py | 469 ++++++++++++++++++ .../examples/MGAdapt_med_files/test_01.med | Bin 0 -> 22900 bytes .../examples/MGAdapt_med_files/test_02.med | Bin 0 -> 25800 bytes .../examples/MGAdapt_med_files/test_02_bg.med | Bin 0 -> 71843 bytes .../examples/MGAdapt_med_files/test_04.med | Bin 0 -> 103188 bytes .../examples/MGAdapt_med_files/test_06.med | Bin 0 -> 23491 bytes .../examples/MGAdapt_med_files/test_07.med | Bin 0 -> 25636 bytes .../examples/MGAdapt_med_files/test_08.med | Bin 0 -> 8702 bytes .../examples/MGAdapt_med_files/test_08_bg.med | Bin 0 -> 24752 bytes .../examples/MGAdapt_med_files/test_10.med | Bin 0 -> 63374 bytes .../examples/MGAdapt_med_files/test_11.med | Bin 0 -> 90631 bytes doc/salome/examples/tests.set | 1 + 13 files changed, 471 insertions(+) create mode 100755 doc/salome/examples/MGAdaptTests.py create mode 100644 doc/salome/examples/MGAdapt_med_files/test_01.med create mode 100644 doc/salome/examples/MGAdapt_med_files/test_02.med create mode 100644 doc/salome/examples/MGAdapt_med_files/test_02_bg.med create mode 100644 doc/salome/examples/MGAdapt_med_files/test_04.med create mode 100644 doc/salome/examples/MGAdapt_med_files/test_06.med create mode 100644 doc/salome/examples/MGAdapt_med_files/test_07.med create mode 100644 doc/salome/examples/MGAdapt_med_files/test_08.med create mode 100644 doc/salome/examples/MGAdapt_med_files/test_08_bg.med create mode 100644 doc/salome/examples/MGAdapt_med_files/test_10.med create mode 100644 doc/salome/examples/MGAdapt_med_files/test_11.med diff --git a/doc/salome/examples/CMakeLists.txt b/doc/salome/examples/CMakeLists.txt index 52f2cf71f..78060692c 100644 --- a/doc/salome/examples/CMakeLists.txt +++ b/doc/salome/examples/CMakeLists.txt @@ -47,3 +47,4 @@ INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${TEST_INSTALL_DIRECTORY} RENAME CTestTestfile.cmake) INSTALL(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY}) +INSTALL(DIRECTORY MGAdapt_med_files DESTINATION ${TEST_INSTALL_DIRECTORY}) diff --git a/doc/salome/examples/MGAdaptTests.py b/doc/salome/examples/MGAdaptTests.py new file mode 100755 index 000000000..e549db9f5 --- /dev/null +++ b/doc/salome/examples/MGAdaptTests.py @@ -0,0 +1,469 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +"""Tests des adaptations par MGAdapt en TUI + +Copyright 2021 EDF +Gérald NICOLAS ++33.1.78.19.43.52 +""" + +__revision__ = "V04.01" + +#========================= Les imports - Début =================================== + +import os +import sys + +import salome + +import SMESH +from salome.smesh import smeshBuilder +smesh = smeshBuilder.New() + +#========================== Les imports - Fin ==================================== + +#========================= Paramétrage - Début =================================== +# 1. REPDATA = répertoire du cas +HOME = os.environ["HOME"] +REPDATA = os.path.join(HOME, "MAILLAGE", "TEST_REMAILLAGE", "MGAdapt_med_files") +PATH_SMESH = os.getenv("SMESH_ROOT_DIR") +print (PATH_SMESH) +PATH_SMESH = os.getenv("TEST_INSTALL_DIRECTORY") +print (PATH_SMESH) +REPDATA = os.path.join(PATH_SMESH, "MGAdapt_med_files") +print (REPDATA) +# +# 2. Repérage des données +D_DATA = dict() +D_DATA["01"] = "01" +D_DATA["02"] = "02" +D_DATA["03"] = "01" +D_DATA["04"] = "04" +D_DATA["05"] = "04" +D_DATA["06"] = "06" +D_DATA["07"] = "07" +D_DATA["08"] = "08" +D_DATA["10"] = "10" +D_DATA["11"] = "11" +#========================== Paramétrage - Fin ==================================== + +class MGAdaptTest (object): + + """Test de l'adaptation par MGAdapt + +Options facultatives +******************** +Le(s) nom du/des tests à passer. Si aucun n'est donné, tous les cas sont passés. + """ + +# A. La base + + message_info = "" + _verbose = 0 + _verbose_max = 0 + affiche_aide_globale = 0 + +# B. Les variables + + l_cas = None + rep_test = None + nro_cas = None + cas = None + +#=========================== Début de la méthode ================================= + + def __init__ ( self, liste_option ): + + """Le constructeur de la classe MGAdaptTest""" + + self.l_cas = list() + + for option in liste_option : + + #print (option) + saux = option.upper() + #print (saux) + if saux in ( "-H", "-HELP" ): + self.affiche_aide_globale = 1 + elif saux == "-V" : + self._verbose = 1 + elif saux == "-VMAX" : + self._verbose = 1 + self._verbose_max = 1 + else : + self.l_cas.append(option) + + if not self.l_cas: + for cle in D_DATA.keys(): + self.l_cas.append(cle) + self.l_cas.sort() + + if self._verbose_max: + print ("Liste des cas : {}".format(self.l_cas)) + +#=========================== Fin de la méthode ================================== + +#=========================== Début de la méthode ================================= + + def __del__(self): + """A la suppression de l'instance de classe""" + if self._verbose_max: + print ("Suppression de l'instance de la classe.") + +#=========================== Fin de la méthode ================================== + +#=========================== Début de la méthode ================================= + + def _add_file_in (self, objet_adapt): + """Ajout du fichier med d'entrée + +Entrées/Sorties : + :objet_adapt: l'objet du module + """ + if self._verbose_max: + print ("_add_file_in pour {}".format(self.nro_cas)) + + ficmed = os.path.join (REPDATA, "test_{}.med".format(D_DATA[self.nro_cas])) + if self._verbose_max: + print ("Fichier {}".format(ficmed)) + if not os.path.isfile(ficmed): + erreur = 1 + message = "Le fichier {} est inconnu.".format(ficmed) + else: + objet_adapt.setMEDFileIn(ficmed) + erreur = 0 + message = "" + + return erreur, message + +#=========================== Fin de la méthode ================================== + +#=========================== Début de la méthode ================================= + + def _add_file_out (self, objet_adapt): + """Ajout du fichier de sortie + +Entrées/Sorties : + :objet_adapt: l'objet du module + """ + if self._verbose_max: + print ("_add_file_out pour {}".format(self.nro_cas)) + + ficmed = os.path.join (REPDATA, "test_{}.adapt.tui.med".format(self.nro_cas)) + if os.path.isfile(ficmed): + os.remove(ficmed) + + objet_adapt.setMEDFileOut(ficmed) + + if self._verbose: + print (". Maillage adapté dans le fichier {}".format(ficmed)) + + return + +#=========================== Fin de la méthode ================================== + +#=========================== Début de la méthode ================================= + + def _add_file_bkg (self, objet_adapt): + """Ajout du fichier med de fond + +Entrées/Sorties : + :objet_adapt: l'objet du module + """ + if self._verbose_max: + print ("_add_file_bkg pour {}".format(self.nro_cas)) + + ficmed = os.path.join (REPDATA, "test_{}_bg.med".format(D_DATA[self.nro_cas])) + if self._verbose_max: + print ("Fichier {}".format(ficmed)) + if not os.path.isfile(ficmed): + erreur = 1 + message = "Le fichier {} est inconnu.".format(ficmed) + else: + objet_adapt.setMEDFileBackground(ficmed) + erreur = 0 + message = "" + + return erreur, message + +#=========================== Fin de la méthode ================================== + +#=========================== Début de la méthode ================================= + + def _hypo_creation (self, maptype, option, niveau=3): + """Création d'une hypothèse + +Entrées : + :maptype: type de carte : "Local", "Background", "Constant" + :option: nom du champ si "Local" ou "Background", valeur si "Constant" + :niveau: niveau de verbosité + +Sortie : + :hypo: l'objet hypothèse + """ + if self._verbose_max: + print ("_hypo_creation pour {} avec {}".format(maptype,option)) + + erreur = 0 + message = "" + + while not erreur : + + #--- Création de l'hypothèse --- + hypo = smesh.CreateAdaptationHypothesis() + + # Type de données + if ( maptype in ("Local", "Background", "Constant") ): + hypo.setSizeMapType(maptype) + else: + message = "Le type de carte {} est inconnu.".format(maptype) + erreur = 2 + break + + # Valeur + if ( maptype in ("Local", "Background") ): + hypo.setSizeMapFieldName(option) + else: + hypo.setConstantSize(option) + + # Verbosité + self._hypo_verbose (hypo, niveau) + + break + + return erreur, message, hypo +#=========================== Fin de la méthode ================================== + +#=========================== Début de la méthode ================================= + + def _hypo_verbose (self, hypo, niveau=10): + """Débogage des hypothèses + +Entrées : + :niveau: niveau de verbosité + +Entrées/Sorties : + :hypo: l'objet hypothèse + """ + + hypo.setVerbosityLevel(niveau) + + if self._verbose_max: + + hypo.setPrintLogInFile(True) + hypo.setKeepWorkingFiles(True) + hypo.setRemoveOnSuccess(False) + + return +#=========================== Fin de la méthode ================================== + +#=========================== Début de la méthode ================================= + + def _calcul (self, objet_adapt, hypo): + """Calcul + +Entrées : + :objet_adapt: l'objet du module + :hypo: l'objet hypothèse + """ + + #--- association de l'hypothese à l'objet de l'adaptation + objet_adapt.AddHypothesis(hypo) + + #-- Calcul + if self._verbose_max: + print (hypo.getCommandToRun()) + erreur = objet_adapt.Compute(False) + if erreur: + message = "Echec dans l'adaptation." + else: + message = "" + + return erreur, message + +#=========================== Fin de la méthode ================================== + +#=========================== Début de la méthode ================================= + + def _test_00 (self, objet_adapt): + """Test générique + +Entrées/Sorties : + :objet_adapt: l'objet du module + """ + + erreur = 0 + message = "" + + while not erreur : + + #--- les fichiers MED ---# + erreur, message = self._add_file_in (objet_adapt) + if erreur: + break + self._add_file_out (objet_adapt) + if self.nro_cas in ("02", "08"): + erreur, message = self._add_file_bkg (objet_adapt) + if erreur: + break + + #--- Création de l'hypothèse --- + if self.nro_cas in ("01", "04", "05", "06", "07", "10"): + maptype = "Local" + option = "TAILLE" + elif self.nro_cas in ("02", "08"): + maptype = "Background" + option = "TAILLE" + elif self.nro_cas in ("03",): + maptype = "Constant" + option = 0.5 + if self.nro_cas in ("11",): + maptype = "Local" + option = "Taille de maille" + if self._verbose: + niveau = 3 + elif self._verbose_max: + niveau = 10 + else: + niveau = 0 + erreur, message, hypo = self._hypo_creation(maptype, option, niveau) + if erreur: + break + + #-- Ajout des options + if self.nro_cas in ("04", "06", "07", "08", "10", "11"): + hypo.setTimeStepRankLast() + elif self.nro_cas in ("05",): + hypo.setTimeStepRank(1,1) + + # options facultatives + if self.nro_cas in ("03",): + hypo.setOptionValue("adaptation", "surface") + + #-- Calcul + try : + erreur, message = self._calcul (objet_adapt, hypo) + except : + erreur = 1871 + message = "Erreur dans le calcul par SMESH" + + break + + return erreur, message + +#=========================== Fin de la méthode ================================== + +#=========================== Début de la méthode ================================= + + def _traitement_cas (self ): + """Traitement d'un cas + + +Sorties : + :erreur: code d'erreur + :message: message d'erreur + """ + + nom_fonction = __name__ + "/_traitement_cas" + blabla = "\nDans {} :".format(nom_fonction) + + if self._verbose_max: + print (blabla) + +# 1. Préalables + + erreur = 0 + message = "" + if self._verbose: + print ("Passage du cas '{}'".format(self.nro_cas)) + + if ( self.nro_cas in ("01", "02", "03", "04", "05", "06", "07", "08", "10" , "11") ): + objet_adapt = smesh.Adaptation('MG_Adapt') + erreur, message = self._test_00 (objet_adapt) + del objet_adapt + + else: + erreur = 1 + message = "Le cas '{}' est inconnu.".format(self.nro_cas) + + return erreur, message + +#=========================== Fin de la méthode ================================== + +#=========================== Début de la méthode ================================= + + def lancement (self): + + """Lancement + +Sorties : + :erreur: code d'erreur + :message: message d'erreur + """ + + nom_fonction = __name__ + "/lancement" + blabla = "\nDans {} :".format(nom_fonction) + + erreur = 0 + message = "" + + if self._verbose_max: + print (blabla) + + for nom_cas in self.l_cas: + self.nro_cas = nom_cas + erreur_t, message_t = self._traitement_cas () + if erreur_t: + erreur += 1 + message += "\nErreur n°{} pour le cas {} :\n".format(erreur_t,nom_cas) + message += message_t + + if ( erreur and self._verbose_max ): + print (blabla, message) + + return erreur, message + +#=========================== Fin de la méthode ================================== + +#========================== Fin de la classe ==================================== + +#================================================================================== +# Lancement +#================================================================================== + +if __name__ == "__main__" : + +# 1. Options + + L_OPTIONS = list() + #L_OPTIONS.append("-h") + #L_OPTIONS.append("-v") + #L_OPTIONS.append("-vmax") + #L_OPTIONS.append("01") + #L_OPTIONS.append("02") + #L_OPTIONS.append("03") + #L_OPTIONS.append("07") + #L_OPTIONS.append("10") + #L_OPTIONS.append("11") + #L_OPTIONS.append("04") + #L_OPTIONS.append("05") + #L_OPTIONS.append("06") + #L_OPTIONS.append("08") + +# 2. Lancement de la classe + + #print ("L_OPTIONS :", L_OPTIONS) + MGADAPT_TEST = MGAdaptTest(L_OPTIONS) + if MGADAPT_TEST.affiche_aide_globale: + sys.stdout.write(MGADAPT_TEST.__doc__+"\n") + else: + ERREUR, MESSAGE_ERREUR = MGADAPT_TEST.lancement() + if ERREUR: + sys.stdout.write(MGADAPT_TEST.__doc__+"\n") + MESSAGE_ERREUR += "\n {} erreur(s)\n".format(ERREUR) + sys.stderr.write(MESSAGE_ERREUR) + assert(False) + + del MGADAPT_TEST + + #sys.exit(0) diff --git a/doc/salome/examples/MGAdapt_med_files/test_01.med b/doc/salome/examples/MGAdapt_med_files/test_01.med new file mode 100644 index 0000000000000000000000000000000000000000..71664bb313795fbc68c61bad62619edab72264b3 GIT binary patch literal 22900 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 literal 0 HcmV?d00001 diff --git a/doc/salome/examples/MGAdapt_med_files/test_02_bg.med b/doc/salome/examples/MGAdapt_med_files/test_02_bg.med new file mode 100644 index 0000000000000000000000000000000000000000..15f1b868b857090c150f78397a18502bf819de77 GIT binary patch literal 71843 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 literal 0 HcmV?d00001 diff --git a/doc/salome/examples/MGAdapt_med_files/test_04.med b/doc/salome/examples/MGAdapt_med_files/test_04.med new file mode 100644 index 0000000000000000000000000000000000000000..81c116fa5997a8c0754bc8f039c49c2725752af6 GIT binary patch literal 103188 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 Dcex{j literal 0 HcmV?d00001 diff --git a/doc/salome/examples/MGAdapt_med_files/test_07.med b/doc/salome/examples/MGAdapt_med_files/test_07.med new file mode 100644 index 0000000000000000000000000000000000000000..e100452baaefb0baf741b82865c7a81798138cea GIT binary patch literal 25636 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 literal 0 HcmV?d00001 diff --git a/doc/salome/examples/MGAdapt_med_files/test_08.med b/doc/salome/examples/MGAdapt_med_files/test_08.med new file mode 100644 index 0000000000000000000000000000000000000000..e23077e8ecc9f5118606a2376f7b2ca527d39e95 GIT binary patch literal 8702 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 literal 0 HcmV?d00001 diff --git a/doc/salome/examples/MGAdapt_med_files/test_10.med b/doc/salome/examples/MGAdapt_med_files/test_10.med new file mode 100644 index 0000000000000000000000000000000000000000..221291f4e49ea7c03cd4166289f4976acf2b08ba GIT binary patch literal 63374 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

+RCM?;?Wq(((_>1$HW}wjEnH^L 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 literal 0 HcmV?d00001 diff --git a/doc/salome/examples/MGAdapt_med_files/test_11.med b/doc/salome/examples/MGAdapt_med_files/test_11.med new file mode 100644 index 0000000000000000000000000000000000000000..7d8b6cff4cfc161ef782792d6800e0a7fcbf0f14 GIT binary patch literal 90631 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 z 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 literal 0 HcmV?d00001 diff --git a/doc/salome/examples/tests.set b/doc/salome/examples/tests.set index de0775473..9b8382560 100644 --- a/doc/salome/examples/tests.set +++ b/doc/salome/examples/tests.set @@ -183,6 +183,7 @@ SET(GOOD_TESTS quad_medial_axis_algo.py defining_hypotheses_len_near_vertex.py test_polyhedron_per_solid.py + MGAdaptTests.py ) set(SESSION_FREE_TESTS From 0683f65332adfe482a1b3f4dff835902661e8471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Mon, 15 Feb 2021 16:09:48 +0100 Subject: [PATCH 095/100] Test de MGAdapt en standalone --- doc/salome/examples/MGAdaptTests.py | 15 +++++++++++---- doc/salome/examples/tests.set | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/doc/salome/examples/MGAdaptTests.py b/doc/salome/examples/MGAdaptTests.py index e549db9f5..f41ac4c04 100755 --- a/doc/salome/examples/MGAdaptTests.py +++ b/doc/salome/examples/MGAdaptTests.py @@ -1,21 +1,27 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -"""Tests des adaptations par MGAdapt en TUI +"""Tests des adaptations par MGAdapt en standalone Copyright 2021 EDF Gérald NICOLAS +33.1.78.19.43.52 """ -__revision__ = "V04.01" +__revision__ = "V04.02" #========================= Les imports - Début =================================== -import os import sys - import salome +import os +salome.standalone() +salome.salome_init() + +l=list(os.environ.keys()) +l.sort() +print (l) + import SMESH from salome.smesh import smeshBuilder smesh = smeshBuilder.New() @@ -462,6 +468,7 @@ if __name__ == "__main__" : sys.stdout.write(MGADAPT_TEST.__doc__+"\n") MESSAGE_ERREUR += "\n {} erreur(s)\n".format(ERREUR) sys.stderr.write(MESSAGE_ERREUR) + raise Exception(MESSAGE_ERREUR) assert(False) del MGADAPT_TEST diff --git a/doc/salome/examples/tests.set b/doc/salome/examples/tests.set index 9b8382560..5a9894f00 100644 --- a/doc/salome/examples/tests.set +++ b/doc/salome/examples/tests.set @@ -183,12 +183,12 @@ SET(GOOD_TESTS quad_medial_axis_algo.py defining_hypotheses_len_near_vertex.py test_polyhedron_per_solid.py - MGAdaptTests.py ) set(SESSION_FREE_TESTS basic_geom_smesh_without_session.py basic_shaper_smesh_without_session.py + MGAdaptTests.py ) SET(EXAMPLES_TESTS ${BAD_TESTS} ${GOOD_TESTS} ${SESSION_FREE_TESTS} testme.py) From eea4e23c282c3ee61b5713074da35b45353391df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20NICOLAS?= Date: Mon, 15 Feb 2021 16:29:37 +0100 Subject: [PATCH 096/100] =?UTF-8?q?R=C3=A9pertoire=20correct?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/salome/examples/MGAdaptTests.py | 41 +++++++++++------------------ 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/doc/salome/examples/MGAdaptTests.py b/doc/salome/examples/MGAdaptTests.py index f41ac4c04..8352e294f 100755 --- a/doc/salome/examples/MGAdaptTests.py +++ b/doc/salome/examples/MGAdaptTests.py @@ -7,21 +7,17 @@ Gérald NICOLAS +33.1.78.19.43.52 """ -__revision__ = "V04.02" +__revision__ = "V04.03" #========================= Les imports - Début =================================== import sys +import os import salome -import os salome.standalone() salome.salome_init() -l=list(os.environ.keys()) -l.sort() -print (l) - import SMESH from salome.smesh import smeshBuilder smesh = smeshBuilder.New() @@ -30,27 +26,20 @@ smesh = smeshBuilder.New() #========================= Paramétrage - Début =================================== # 1. REPDATA = répertoire du cas -HOME = os.environ["HOME"] -REPDATA = os.path.join(HOME, "MAILLAGE", "TEST_REMAILLAGE", "MGAdapt_med_files") -PATH_SMESH = os.getenv("SMESH_ROOT_DIR") -print (PATH_SMESH) -PATH_SMESH = os.getenv("TEST_INSTALL_DIRECTORY") -print (PATH_SMESH) -REPDATA = os.path.join(PATH_SMESH, "MGAdapt_med_files") -print (REPDATA) +REPDATA = "MGAdapt_med_files" # # 2. Repérage des données D_DATA = dict() -D_DATA["01"] = "01" -D_DATA["02"] = "02" -D_DATA["03"] = "01" -D_DATA["04"] = "04" -D_DATA["05"] = "04" -D_DATA["06"] = "06" -D_DATA["07"] = "07" -D_DATA["08"] = "08" -D_DATA["10"] = "10" -D_DATA["11"] = "11" +D_DATA["01"] = "01" # 2D plan ; carte locale +D_DATA["02"] = "02" # 2D plan ; carte en arrière-plan +D_DATA["03"] = "01" # 2D plan ; taille constante +D_DATA["04"] = "04" # 3D ; carte locale et dernier pas de temps +D_DATA["05"] = "04" # 3D ; carte locale et pas de temps n°1 +D_DATA["06"] = "06" # 2D non plan; carte locale +D_DATA["07"] = "07" # 2D plan ; carte locale anisotrope +D_DATA["08"] = "08" # 3D ; carte en arrière-plan anisotrope +D_DATA["10"] = "10" # 2D plan ; carte locale et maillage initial quadratique +D_DATA["11"] = "11" # 2D plan ; carte locale et maillage initial en quadrangles #========================== Paramétrage - Fin ==================================== class MGAdaptTest (object): @@ -100,7 +89,7 @@ Le(s) nom du/des tests à passer. Si aucun n'est donné, tous les cas sont pass self.l_cas.append(option) if not self.l_cas: - for cle in D_DATA.keys(): + for cle in D_DATA: self.l_cas.append(cle) self.l_cas.sort() @@ -468,7 +457,7 @@ if __name__ == "__main__" : sys.stdout.write(MGADAPT_TEST.__doc__+"\n") MESSAGE_ERREUR += "\n {} erreur(s)\n".format(ERREUR) sys.stderr.write(MESSAGE_ERREUR) - raise Exception(MESSAGE_ERREUR) + #raise Exception(MESSAGE_ERREUR) assert(False) del MGADAPT_TEST From 5ba7997f9e902db704fcdc60fa9809e7e1fc6c16 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Tue, 16 Feb 2021 09:01:50 +0100 Subject: [PATCH 097/100] =?UTF-8?q?coh=C3=A9rence=20des=20tests=20sur=20MG?= =?UTF-8?q?=5FAdapt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sts.py => MGAdaptTests_without_session.py} | 0 doc/salome/examples/adaptation_ex01.py | 68 ------------------- doc/salome/examples/tests.set | 2 +- 3 files changed, 1 insertion(+), 69 deletions(-) rename doc/salome/examples/{MGAdaptTests.py => MGAdaptTests_without_session.py} (100%) delete mode 100644 doc/salome/examples/adaptation_ex01.py diff --git a/doc/salome/examples/MGAdaptTests.py b/doc/salome/examples/MGAdaptTests_without_session.py similarity index 100% rename from doc/salome/examples/MGAdaptTests.py rename to doc/salome/examples/MGAdaptTests_without_session.py diff --git a/doc/salome/examples/adaptation_ex01.py b/doc/salome/examples/adaptation_ex01.py deleted file mode 100644 index 7956f9560..000000000 --- a/doc/salome/examples/adaptation_ex01.py +++ /dev/null @@ -1,68 +0,0 @@ -# Remeshing with MG-Adapt -import os -import salome -salome.salome_init() - -import SMESH -from salome.smesh import smeshBuilder -smesh = smeshBuilder.New() - -# directory -rootdir = ... - -# Test 1 : remeshing with a local size, surface -#--- Creation of the object for the adaptation --- -objet_adapt = smesh.Adaptation('MG_Adapt') - -#--- Initial mesh --- -objet_adapt.setMEDFileIn(os.path.join(rootdir, "maill.01.med")) -#--- Final mesh --- -objet_adapt.setMEDFileOut(os.path.join(rootdir, "maill.01.adapt.med")) - -#--- Creation of the hypothesis --- -hypo = smesh.CreateAdaptationHypothesis() -# Options -hypo.setSizeMapType('Local') -hypo.setSizeMapFieldName('TAILLE') -hypo.setTimeStepRankLast() -hypo.setOptionValue("adaptation", "surface") - -#--- Link between hypothesis and object --- -objet_adapt.AddHypothesis(hypo) - -#--- Compute without publication -err = objet_adapt.Compute(False) - -#--- Clean -del objet_adapt - - - -# Test 2 : remeshing with a background size, volume -#--- Creation of the object for the adaptation --- -objet_adapt = smesh.Adaptation('MG_Adapt') - -#--- Initial mesh --- -objet_adapt.setMEDFileIn(os.path.join(rootdir, "maill.02.med")) -#--- Background mesh --- -objet_adapt.setMEDFileBackground(rootdir, "maill.size.02.med")) -#--- Final mesh --- -objet_adapt.setMEDFileOut(os.path.join(rootdir, "maill.02.adapt.med")) - -#--- Creation of the hypothesis --- -hypo = smesh.CreateAdaptationHypothesis() -# Options -hypo.setSizeMapType('Background') -hypo.setSizeMapFieldName('TAILLE') -hypo.setTimeStepRank(1,1) -hypo.setOptionValue("adaptation", "both") - -#--- Link between hypothesis and object --- -objet_adapt.AddHypothesis(hypo) - -#--- Compute without publication -err = objet_adapt.Compute(False) - -#--- Clean -del objet_adapt - diff --git a/doc/salome/examples/tests.set b/doc/salome/examples/tests.set index 5a9894f00..5b7fb54df 100644 --- a/doc/salome/examples/tests.set +++ b/doc/salome/examples/tests.set @@ -45,6 +45,7 @@ SET(BAD_TESTS radial_prism_3d_algo.py test_smeshplugin_mg_tetra_parallele.py test_smeshplugins.py + MGAdaptTests_without_session.py ) SET(GOOD_TESTS @@ -188,7 +189,6 @@ SET(GOOD_TESTS set(SESSION_FREE_TESTS basic_geom_smesh_without_session.py basic_shaper_smesh_without_session.py - MGAdaptTests.py ) SET(EXAMPLES_TESTS ${BAD_TESTS} ${GOOD_TESTS} ${SESSION_FREE_TESTS} testme.py) From 4092d891078251c1451a4ba206388ad5001537f2 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Wed, 17 Feb 2021 17:57:14 +0100 Subject: [PATCH 098/100] Etiquettes sur les pushbutton --- src/SMESHGUI/MG_ADAPTGUI.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/SMESHGUI/MG_ADAPTGUI.cxx b/src/SMESHGUI/MG_ADAPTGUI.cxx index a449cdd0b..b8ee3c879 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.cxx +++ b/src/SMESHGUI/MG_ADAPTGUI.cxx @@ -493,8 +493,8 @@ SMESHGUI_MgAdaptArguments::SMESHGUI_MgAdaptArguments( QWidget* parent ) aMedfile = new QRadioButton( tr( "MEDFile" ), aMeshIn ); aBrowser = new QRadioButton( tr( "Browser" ), aMeshIn ); aBrowserObject = new QLineEdit( aMeshIn ); - selectMedFilebutton = new QPushButton("", aMeshIn); - selectMedFileLineEdit = new QLineEdit( aMeshIn ); + selectMedFilebutton = new QPushButton("...", aMeshIn); + selectMedFileLineEdit = new QLineEdit( aMeshIn ); meshIn = new QGridLayout( aMeshIn ); @@ -518,7 +518,7 @@ SMESHGUI_MgAdaptArguments::SMESHGUI_MgAdaptArguments( QWidget* parent ) secondHspacer = new QSpacerItem(100, 30); meshNameLineEdit = new QLineEdit(aMeshOut) ; medFileCheckBox = new QCheckBox(tr("MEDFile"), aMeshOut); - selectOutMedFilebutton = new QPushButton("", aMeshOut); + selectOutMedFilebutton = new QPushButton("...", aMeshOut); thirdHspacer = new QSpacerItem(188, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); selectOutMedFileLineEdit = new QLineEdit(aMeshOut) ; publishOut = new QCheckBox(tr("Publish_MG_ADAPT"), aMeshOut); @@ -542,7 +542,7 @@ SMESHGUI_MgAdaptArguments::SMESHGUI_MgAdaptArguments( QWidget* parent ) backgroundButton = new QRadioButton(tr("BACKGRND_MG_ADAPT"), sizeMapDefinition); constantButton = new QRadioButton(tr("CNST_MG_ADAPT"), sizeMapDefinition); medFileBackground = new QLabel(tr("MED_FILE_BCKG"), sizeMapDefinition); - selectMedFileBackgroundbutton = new QPushButton(tr(""), sizeMapDefinition); + selectMedFileBackgroundbutton = new QPushButton("...", sizeMapDefinition); selectMedFileBackgroundLineEdit = new QLineEdit(sizeMapDefinition); valueLabel = new QLabel(tr("VALUE_MG_ADAPT"), sizeMapDefinition); dvalue = new QDoubleSpinBox(sizeMapDefinition); @@ -1093,6 +1093,7 @@ void MgAdaptAdvWidget::setupWidget() gridLayout_4->addWidget(myOptionTable, 0, 0, 1, 2); addBtn = new QPushButton(this); + addBtn->setText(QApplication::translate("SMESH_AdvOptionsWdg", "ADD_OPTION_BTN", Q_NULLPTR)); addBtn->setObjectName(QString("addBtn")); gridLayout_4->addWidget(addBtn, 1, 0, 1, 1); From ded5e634c9bc8912e88db3c72f60c471ee017594 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Wed, 17 Feb 2021 22:22:22 +0100 Subject: [PATCH 099/100] Forward medcoupling exception thrown in case of problem of conversion --- idl/MG_ADAPT.idl | 3 +-- src/SMESH/MG_ADAPT.cxx | 10 ++++------ src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx | 8 ++++---- src/SMESH_I/MG_ADAPT_i.cxx | 24 ++++++++---------------- src/SMESH_I/MG_ADAPT_i.hxx | 3 +-- 5 files changed, 18 insertions(+), 30 deletions(-) diff --git a/idl/MG_ADAPT.idl b/idl/MG_ADAPT.idl index 6a4c7c983..7608ab67a 100644 --- a/idl/MG_ADAPT.idl +++ b/idl/MG_ADAPT.idl @@ -122,8 +122,7 @@ module SMESH{ void setSizeMapType(in string f); boolean setAll(); string getCommandToRun() ; - //long compute(out string errStr); - long compute(); + void compute() raises(SALOME::SALOME_Exception); string getErrMsg(); string getFileName() ; string getExeName(); diff --git a/src/SMESH/MG_ADAPT.cxx b/src/SMESH/MG_ADAPT.cxx index c3e95da76..f0accd50d 100644 --- a/src/SMESH/MG_ADAPT.cxx +++ b/src/SMESH/MG_ADAPT.cxx @@ -1244,9 +1244,7 @@ void MgAdapt::checkTimeStepRank(std::string fileIn) { bool ret = false ; MEDCoupling::MCAuto mfd = MEDCoupling::MEDFileData::New(fileIn); - MEDCoupling::MCAuto fts = dynamic_cast( mfd->getFields()->getFieldWithName(fieldName) ); -// std::cout << "--- timeStep " << timeStep << std::endl; -// std::cout << "--- rank " << rank << std::endl; + MEDCoupling::MCAuto fts( mfd->getFields()->getFieldWithName(fieldName) ); std::vector timevalue; std::vector< std::pair > timesteprank = fts->getTimeSteps(timevalue); std::size_t jaux(timesteprank.size()); @@ -1299,7 +1297,7 @@ void MgAdapt::convertMedFile(std::string& meshFormatMeshFileName, std::string& s { checkFieldName(medFileIn) ; checkTimeStepRank(medFileIn) ; - MEDCoupling::MCAuto fts = dynamic_cast( mfd->getFields()->getFieldWithName(fieldName) ); + MEDCoupling::MCAuto fts( mfd->getFields()->getFieldWithName(fieldName) ); MEDCoupling::MCAuto f = fts->getTimeStep(timeStep, rank); MEDCoupling::MCAuto tmFts = MEDCoupling::MEDFileFieldMultiTS::New(); tmFts->pushBackTimeStep(f); @@ -1438,8 +1436,8 @@ void MgAdapt::buildBackGroundMeshAndSolFiles(const std::vector& fie { MEDCoupling::MCAuto tmpMfd = MEDCoupling::MEDFileData::New(sizeMapFile); MEDCoupling::MEDFileFields* tmpFields = tmpMfd->getFields(); - MEDCoupling::MEDFileAnyTypeFieldMultiTS* fts = tmpFields->getFieldWithName(fieldName); - MEDCoupling::MCAuto fts1 = dynamic_cast(fts); + MEDCoupling::MCAuto fts( tmpFields->getFieldWithName(fieldName) ); + MEDCoupling::MCAuto fts1 = MEDCoupling::DynamicCastSafe(fts); MEDCoupling::MCAuto f = fts1->getTimeStep(timeStep, rank); MEDCoupling::MCAuto tmFts = MEDCoupling::MEDFileFieldMultiTS::New(); tmFts->pushBackTimeStep(f); diff --git a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx index fc1496380..d3bed87fd 100644 --- a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx +++ b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx @@ -385,12 +385,12 @@ bool SMESHGUI_MG_ADAPTDRIVER::PushOnApply() bool SMESHGUI_MG_ADAPTDRIVER::execute() { - int err; - //~std::string errStr; + int err = 1; char* errStr; try { - err = getModel()->compute(); + getModel()->compute(); + err = 0; errStr = getModel()->getErrMsg(); std::string msg = err == 0 ? " ok" : std::string("Not ok \n")+CORBA::string_dup(errStr) ; } @@ -398,7 +398,7 @@ bool SMESHGUI_MG_ADAPTDRIVER::execute() { std::cerr<getCommandToRun().c_str()); } -//~CORBA::Long MG_ADAPT_i::compute(::CORBA::String_out errStr) -//~{ - //~std::string err(""); - //~CORBA::Long ret = myMgAdapt->compute(err); - //~errStr = err.c_str(); - //~return ret; -//~} -CORBA::Long MG_ADAPT_i::compute() +void MG_ADAPT_i::compute() { errStr = ""; - CORBA::Long ret; try { - ret = myMgAdapt->compute(errStr); + myMgAdapt->compute(errStr); } catch (const std::exception& e) { - std::cerr<getPublish()) + if(myMgAdapt->getPublish()) { SMESH_Gen_i* smeshGen_i = SMESH_Gen_i::GetSMESHGen(); SMESH::DriverMED_ReadStatus theStatus; smeshGen_i->CreateMeshesFromMED(myMgAdapt->getMedFileOut().c_str(), theStatus); } - //~errStr = err.c_str(); - return ret; } char* MG_ADAPT_i::getErrMsg() { @@ -510,7 +501,8 @@ CORBA::Long MG_ADAPT_OBJECT_i::Compute(bool publish) return -1; } hypothesis->setPublish(publish); - return hypothesis->compute(); + hypothesis->compute(); + return 0; } bool MG_ADAPT_OBJECT_i::checkMeshFileIn() diff --git a/src/SMESH_I/MG_ADAPT_i.hxx b/src/SMESH_I/MG_ADAPT_i.hxx index b25953175..edc398d07 100644 --- a/src/SMESH_I/MG_ADAPT_i.hxx +++ b/src/SMESH_I/MG_ADAPT_i.hxx @@ -109,8 +109,7 @@ public: bool setAll(); char* getCommandToRun() ; - //~CORBA::Long compute(::CORBA::String_out errStr); - CORBA::Long compute(); + void compute(); char* getFileName(); char* getExeName(); void copyMgAdaptHypothesisData( const SMESH::MgAdaptHypothesisData& data ) ; From 5c3b242751087298b8088e318b4a1cfc309768b9 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Thu, 18 Feb 2021 09:06:30 +0100 Subject: [PATCH 100/100] =?UTF-8?q?Pr=C3=A9paration=20pour=20le=20cas=20si?= =?UTF-8?q?mple=20pr=C3=A9cision?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../examples/MGAdaptTests_without_session.py | 43 ++++++++++-------- .../examples/MGAdapt_med_files/test_13.med | Bin 0 -> 249077 bytes 2 files changed, 25 insertions(+), 18 deletions(-) create mode 100644 doc/salome/examples/MGAdapt_med_files/test_13.med diff --git a/doc/salome/examples/MGAdaptTests_without_session.py b/doc/salome/examples/MGAdaptTests_without_session.py index 8352e294f..4855345c1 100755 --- a/doc/salome/examples/MGAdaptTests_without_session.py +++ b/doc/salome/examples/MGAdaptTests_without_session.py @@ -7,7 +7,7 @@ Gérald NICOLAS +33.1.78.19.43.52 """ -__revision__ = "V04.03" +__revision__ = "V04.04" #========================= Les imports - Début =================================== @@ -40,6 +40,7 @@ D_DATA["07"] = "07" # 2D plan ; carte locale anisotrope D_DATA["08"] = "08" # 3D ; carte en arrière-plan anisotrope D_DATA["10"] = "10" # 2D plan ; carte locale et maillage initial quadratique D_DATA["11"] = "11" # 2D plan ; carte locale et maillage initial en quadrangles +D_DATA["13"] = "13" # 3D ; carte locale en simple précision et dernier pas de temps #========================== Paramétrage - Fin ==================================== class MGAdaptTest (object): @@ -303,18 +304,21 @@ Entrées/Sorties : break #--- Création de l'hypothèse --- - if self.nro_cas in ("01", "04", "05", "06", "07", "10"): + if self.nro_cas in ("01", "04", "05", "06", "07", "10", "11", "13"): maptype = "Local" - option = "TAILLE" + if self.nro_cas in ("01", "04", "05", "06", "07", "10"): + option = "TAILLE" + elif self.nro_cas in ("11",): + option = "Taille de maille" + elif self.nro_cas in ("13",): + option = "Elevation" elif self.nro_cas in ("02", "08"): maptype = "Background" option = "TAILLE" elif self.nro_cas in ("03",): maptype = "Constant" option = 0.5 - if self.nro_cas in ("11",): - maptype = "Local" - option = "Taille de maille" + if self._verbose: niveau = 3 elif self._verbose_max: @@ -330,6 +334,8 @@ Entrées/Sorties : hypo.setTimeStepRankLast() elif self.nro_cas in ("05",): hypo.setTimeStepRank(1,1) + elif self.nro_cas in ("13",): + hypo.setTimeStepRank(0,0) # options facultatives if self.nro_cas in ("03",): @@ -372,7 +378,7 @@ Sorties : if self._verbose: print ("Passage du cas '{}'".format(self.nro_cas)) - if ( self.nro_cas in ("01", "02", "03", "04", "05", "06", "07", "08", "10" , "11") ): + if ( self.nro_cas in ("01", "02", "03", "04", "05", "06", "07", "08", "10" ,"11" ,"13") ): objet_adapt = smesh.Adaptation('MG_Adapt') erreur, message = self._test_00 (objet_adapt) del objet_adapt @@ -410,7 +416,7 @@ Sorties : erreur_t, message_t = self._traitement_cas () if erreur_t: erreur += 1 - message += "\nErreur n°{} pour le cas {} :\n".format(erreur_t,nom_cas) + message += "\nErreur n° {} pour le cas {} :\n".format(erreur_t,nom_cas) message += message_t if ( erreur and self._verbose_max ): @@ -434,16 +440,17 @@ if __name__ == "__main__" : #L_OPTIONS.append("-h") #L_OPTIONS.append("-v") #L_OPTIONS.append("-vmax") - #L_OPTIONS.append("01") - #L_OPTIONS.append("02") - #L_OPTIONS.append("03") - #L_OPTIONS.append("07") - #L_OPTIONS.append("10") - #L_OPTIONS.append("11") - #L_OPTIONS.append("04") - #L_OPTIONS.append("05") - #L_OPTIONS.append("06") - #L_OPTIONS.append("08") + L_OPTIONS.append("01") + L_OPTIONS.append("02") + L_OPTIONS.append("03") + L_OPTIONS.append("07") + L_OPTIONS.append("10") + L_OPTIONS.append("11") + L_OPTIONS.append("04") + L_OPTIONS.append("05") + L_OPTIONS.append("06") + L_OPTIONS.append("08") + #L_OPTIONS.append("13") # 2. Lancement de la classe diff --git a/doc/salome/examples/MGAdapt_med_files/test_13.med b/doc/salome/examples/MGAdapt_med_files/test_13.med new file mode 100644 index 0000000000000000000000000000000000000000..32a8af19f946d57271dc5f98adf8a2cda583bf09 GIT binary patch literal 249077 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 b%;15Y