# ============
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)
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:
# 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)
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)
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)
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)
# 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)
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 Salome<MODULE>Config.cmake:
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)
+++ /dev/null
-// 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<string> listeHypotheses;
- typedef sequence<string> listeZones;
- typedef sequence<string> listeIterations;
- typedef sequence<string> listeCases;
- typedef sequence<string> listeBoundarys;
- typedef sequence<string> 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
-
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
)
+++ /dev/null
-// 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
+++ /dev/null
-// 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<double> extrema ;
- typedef sequence<string> ListGroupType ;
- typedef sequence<string> 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
+++ /dev/null
-// 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<string> listeZonesHypo ;
- typedef sequence<string> listeIters ;
- typedef sequence<string> listeComposantsHypo ;
- typedef sequence<long> listeTypes ;
- typedef sequence<string> 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
+++ /dev/null
-// 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<string> listeIterFilles ;
- typedef sequence<string> listeFieldInterpsIter ;
- typedef sequence<string> 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
+++ /dev/null
-// 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
+++ /dev/null
-// 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 > double_array ;
- typedef sequence<string > 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
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
<parameter name="selection_increment" value="0" />
<parameter name="controls_increment" value="2" />
<!-- Adaptation -->
- <parameter name="homard_publish_mesh_in" value="false" />
- <parameter name="homard_publish_mesh_out" value="false" />
- <parameter name="homard_yacs_max_iter" value="0" />
- <parameter name="homard_yacs_max_node" value="0" />
- <parameter name="homard_yacs_max_elem" value="0" />
- <parameter name="homard_yacs_type_test" value="None" />
<parameter name="mg_adapt_file_mesh_out" value="true" />
<parameter name="mg_adapt_publish_mesh_out" value="false" />
<parameter name="mg_adapt_size_map" value="Local" />
+++ /dev/null
-// 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 : ADAPT_Gen.cxx
-// Author : Gerald NICOLAS, EDF
-// Module : HOMARD
-
-#include "ADAPT_Gen.hxx"
-#include "utilities.h"
-
-//=============================================================================
-//=============================================================================
-ADAPT_Gen::ADAPT_Gen()
-{
- MESSAGE("ADAPT_Gen");
-}
-
-//=============================================================================
-//=============================================================================
-ADAPT_Gen::~ADAPT_Gen()
-{
- MESSAGE("~ADAPT_Gen");
-}
-//=============================================================================
+++ /dev/null
-// 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 : ADAPT_Gen.hxx
-// Author : Gerald NICOLAS, EDF
-// Module : HOMARD
-
-#ifndef _ADAPT_GEN_HXX_
-#define _ADAPT_GEN_HXX_
-
-#include "HOMARD.hxx"
-
-class HOMARDIMPL_EXPORT ADAPT_Gen
-{
-public :
- ADAPT_Gen();
- ~ADAPT_Gen();
-};
-
-#endif
+++ /dev/null
-# 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}
- ${MEDCOUPLING_INCLUDE_DIRS}
-)
-
-# additional preprocessor / compiler flags
-ADD_DEFINITIONS(
- ${KERNEL_DEFINITIONS}
-)
-
-# libraries to link to
-SET(_link_LIBRARIES
- ${KERNEL_SALOMELocalTrace}
- ${MEDCoupling_medloader}
-)
-
-# --- headers ---
-
-# header files
-SET(ADAPTImpl_HEADERS
- HOMARD.hxx
- HOMARD_Cas.hxx
- HOMARD_Boundary.hxx
- HOMARD_Hypothesis.hxx
- HOMARD_Iteration.hxx
- HOMARD_Zone.hxx
- ADAPT_Gen.hxx
- HOMARD_DriverTools.hxx
- HOMARD_YACS.hxx
- HomardDriver.hxx
- YACSDriver.hxx
- #~MG_ADAPT.hxx
-)
-
-# --- sources ---
-
-# sources / static
-SET(ADAPTImpl_SOURCES
- HOMARD_Cas.cxx
- HOMARD_Boundary.cxx
- HOMARD_Hypothesis.cxx
- HOMARD_Iteration.cxx
- HOMARD_Zone.cxx
- ADAPT_Gen.cxx
- HOMARD_DriverTools.cxx
- HOMARD_YACS.cxx
- HomardDriver.cxx
- YACSDriver.cxx
- #~MG_ADAPT.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})
+++ /dev/null
-// 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
+++ /dev/null
-// 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<double> HOMARD_Boundary::GetCoords() const
-{
- std::vector<double> 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<double> HOMARD_Boundary::GetLimit() const
-{
- std::vector<double> 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<std::string>& ListGroup )
-{
- _ListGroupSelected.clear();
- std::list<std::string>::const_iterator it = ListGroup.begin();
- while(it != ListGroup.end())
- _ListGroupSelected.push_back((*it++));
-}
-//=============================================================================
-const std::list<std::string>& 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;
-}
-//=============================================================================
+++ /dev/null
-// 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 <vector>
-#include <string>
-#include <list>
-
-#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<double> GetCoords() const;
-
- void SetLimit( double X0, double X1, double X2 );
- std::vector<double> GetLimit() const;
-
- void AddGroup( const char* LeGroupe);
- void SetGroups(const std::list<std::string>& ListGroup );
- const std::list<std::string>& 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<std::string> _ListGroupSelected;
-
-};
-
-
-#endif
+++ /dev/null
-// 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 <iostream>
-#include <sys/stat.h>
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <direct.h>
-#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<std::string>::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 : "<<NomDir);
-// MESSAGE("SetDirName, _NomDir : "<<_NomDir);
- int erreur = 0 ;
- // On vérifie qu'aucun calcul n'a eu lieu pour ce cas
-// MESSAGE("SetDirName, _ListIter.size() : "<<_ListIter.size());
- if ( _ListIter.size() > 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<double>& extremas )
-{
- _Boite.clear();
- _Boite.resize( extremas.size() );
- for ( int i = 0; i < extremas.size(); i++ )
- _Boite[i] = extremas[i];
-}
-//=============================================================================
-const std::vector<double>& 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<std::string>& ListGroup )
-{
- _ListGroup.clear();
- std::list<std::string>::const_iterator it = ListGroup.begin();
- while(it != ListGroup.end())
- {
- _ListGroup.push_back((*it++));
- }
-}
-//=============================================================================
-const std::list<std::string>& 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<std::string>& 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<std::string>& HOMARD_Cas::GetIterations() const
-{
- return _ListIter;
-}
-//=============================================================================
-void HOMARD_Cas::SupprIterations()
-{
- _ListIter.clear();
-}
-
-
+++ /dev/null
-// 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 <string>
-#include <list>
-#include <vector>
-
-#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<double>& extremas );
- const std::vector<double>& GetBoundingBox() const;
-
- void AddGroup( const char* Group);
- void SetGroups( const std::list<std::string>& ListGroup );
- const std::list<std::string>& GetGroups() const;
- void SupprGroups();
-
- void AddBoundary( const char* Boundary );
- void AddBoundaryGroup( const char* Boundary, const char* Group );
- const std::list<std::string>& 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<std::string>& GetIterations() const;
- void SupprIterations();
-
-private:
- std::string _Name;
- std::string _NomDir;
- int _ConfType;
- int _ExtType;
- int _Etat;
-
- std::vector<double> _Boite; // cf HomardQTCommun pour structure du vecteur
- std::list<std::string> _ListGroup;
- std::list<std::string> _ListBoundaryGroup;
-
- int _Pyram;
-
- typedef std::string IterName;
- typedef std::list<IterName> IterNames;
- IterNames _ListIter;
-};
-
-#endif
+++ /dev/null
-// 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 <sstream>
-#include <cstdlib>
-#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 "<<cas.GetName());
- os << cas.GetName();
- os << separator() << cas.GetDirName();
- os << separator() << cas.GetConfType();
- os << separator() << cas.GetExtType();
-
- std::vector<double> coor = cas.GetBoundingBox();
- os << separator() << coor.size();
- for ( int i = 0; i < coor.size(); i++ )
- os << separator() << coor[i];
-
- std::list<std::string> ListString = cas.GetIterations();
- os << separator() << ListString.size();
- std::list<std::string>::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 "<<saux);
- return saux ;
- }
-//
-// ==============
-// 1.2. Iteration
-// ==============
-//
- /*!
- \brief Dump iteration to the string
- \param iteration iteration being dumped
- \return string representation of the iteration
- */
- std::string Dump( const HOMARD_Iteration& iteration )
- {
- std::stringstream os;
- std::string saux ;
- // ...
- MESSAGE( ". Sauvegarde de l'iteration "<<iteration.GetName());
- os << iteration.GetName();
- os << separator() << iteration.GetState();
- os << separator() << iteration.GetNumber();
- os << separator() << iteration.GetMeshFile();
- os << separator() << iteration.GetLogFile();
- os << separator() << iteration.GetMeshName();
- os << separator() << iteration.GetFieldFile();
- os << separator() << iteration.GetTimeStep();
- os << separator() << iteration.GetRank();
- os << separator() << iteration.GetIterParentName();
- //
- std::list<std::string> ListString = iteration.GetIterations();
- os << separator() << ListString.size();
- std::list<std::string>::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 "<<saux);
- return saux ;
- }
-//
-// ==============
-// 1.3. hypothese
-// ==============
- /*!
- \brief Dump hypothesis to the string
- \param hypothesis hypothesis being dumped
- \return string representation of the hypothesis
- */
- std::string Dump( const HOMARD_Hypothesis& hypothesis )
- {
- std::stringstream os;
- std::string saux ;
- // ...
- MESSAGE( ". Sauvegarde de l'hypothese "<<hypothesis.GetName());
- os << hypothesis.GetName();
- os << separator() << hypothesis.GetCaseCreation();
- os << separator() << hypothesis.GetAdapType();
- os << separator() << hypothesis.GetRefinType();
- os << separator() << hypothesis.GetUnRefType();
- os << separator() << hypothesis.GetFieldName();
- os << separator() << hypothesis.GetRefinThrType();
- os << separator() << hypothesis.GetThreshR();
- os << separator() << hypothesis.GetUnRefThrType();
- os << separator() << hypothesis.GetThreshC();
- os << separator() << hypothesis.GetUseField();
- os << separator() << hypothesis.GetUseComp();
- os << separator() << hypothesis.GetTypeFieldInterp();
-
- std::list<std::string> ListString = hypothesis.GetIterations();
- std::list<std::string>::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 "<<saux);
- return saux ;
- }
-//
-// =========
-// 1.4. Zone
-// =========
-
- /*!
- \brief Dump zone to the string
- \param zone zone being dumped
- \return string representation of the zone
- */
- std::string Dump( const HOMARD_Zone& zone )
- {
- std::stringstream os;
- std::string saux ;
- MESSAGE( ". Sauvegarde de la zone "<<zone.GetName());
- os << zone.GetName();
- os << separator() << zone.GetType();
-
- std::vector<double> coords = zone.GetCoords();
- for ( int i = 0; i < coords.size(); i++ )
- os << separator() << ( i < coords.size() ? coords[i] : 0. );
-
- std::vector<double> limit = zone.GetLimit();
- for ( int i = 0; i < 3; i++ )
- os << separator() << ( i < limit.size() ? limit[i] : 0. );
-
- std::list<std::string> hypos = zone.GetHypo();
- os << separator() << hypos.size();
- std::list<std::string>::const_iterator it;
- for ( it = hypos.begin(); it != hypos.end(); ++it )
- os << separator() << *it;
-
- saux = os.str();
-// MESSAGE( ". Fin avec "<<saux);
- return saux ;
- }
-//
-// ==============================
-// 1.5. Archivage d'une frontiere
-// ==============================
-
- /*!
- \brief Dump boundary to the string
- \param boundary boundary being dumped
- \return string representation of the boundary
- */
- std::string Dump( const HOMARD_Boundary& boundary )
- {
- std::stringstream os;
- std::string saux ;
- MESSAGE( ". Sauvegarde de la frontiere "<<boundary.GetName());
-
- int BoundaryType = boundary.GetType() ;
-
- os << boundary.GetName() ;
- os << separator() << BoundaryType ;
- os << separator() << boundary.GetCaseCreation() ;
-
- if ( BoundaryType == -1 )
- {
- os << separator() << boundary.GetDataFile();
- }
- else if ( BoundaryType == 0 )
- {
- os << separator() << boundary.GetMeshName();
- os << separator() << boundary.GetDataFile();
- }
- else {
- std::vector<double> coor = boundary.GetCoords() ;
- for ( int i = 0; i < coor.size(); i++ )
- os << separator() << coor[i];
- std::vector<double> limit = boundary.GetLimit();
- for ( int i = 0; i < limit.size(); i++ )
- os << separator() << limit[i];
- }
-
- std::list<std::string> ListString = boundary.GetGroups();
- std::list<std::string>::const_iterator it;
- os << separator() << ListString.size();
- for ( it = ListString.begin(); it != ListString.end(); ++it )
- os << separator() << *it;
-
- saux = os.str();
-// MESSAGE( ". Fin avec "<<saux);
- return saux ;
- }
-
-//
-// =========
-// 1.6. YACS
-// =========
-
- /*!
- \brief Dump YACS to the string
- \param yacs yacs being dumped
- \return string representation of the zone
- */
- std::string Dump( const HOMARD_YACS& yacs )
- {
- std::stringstream os;
- std::string saux ;
- MESSAGE( ". Sauvegarde du schema YACS "<<yacs.GetName());
- os << yacs.GetName();
- os << separator() << yacs.GetType();
-
- saux = os.str();
-// MESSAGE( ". Fin avec "<<saux);
- return saux ;
- }
-//
-// 2. Restauration des objets
-// ==========================
-// 2.1. Case
-// ==========================
-//
- /*!
- \brief Restore case from the string
- \param cas case being restored
- \param stream string representation of the case
- \return \c true if case is correctly restored or \c false otherwise
- */
- bool Restore( HOMARD_Cas& cas, const std::string& stream )
- {
- MESSAGE( ". Restoration du cas ");
- std::string::size_type start = 0;
- std::string chunk, chunkNext;
- bool ok;
- // ...
- chunk = getNextChunk( stream, start, ok );
- if ( !ok ) return false;
- cas.SetName( chunk.c_str() );
-
- chunk = getNextChunk( stream, start, ok );
- if ( !ok ) return false;
- cas.SetDirName( chunk.c_str() );
-
- chunk = getNextChunk( stream, start, ok );
- if ( !ok ) return false;
- cas.SetConfType( atoi( chunk.c_str() ) );
-
- chunk = getNextChunk( stream, start, ok );
- if ( !ok ) return false;
- cas.SetExtType( atoi( chunk.c_str() ) );
-
- chunk = getNextChunk( stream, start, ok );
- if ( !ok ) return false;
-
- int size = atoi( chunk.c_str() );
- std::vector<double> 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<double> 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<double> 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/
+++ /dev/null
-// 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 <string>
-
-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
+++ /dev/null
-// 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<std::string>::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<std::string>::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<std::string>::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 = "<<UsCmpI) ;
- VERIFICATION( (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 "<<NomComp) ;
- std::list<std::string>::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<std::string>& 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 "<<Group) ;
- std::list<std::string>::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<std::string>& ListGroup )
-{
- _ListGroupSelected.clear();
- std::list<std::string>::const_iterator it = ListGroup.begin();
- while(it != ListGroup.end())
- _ListGroupSelected.push_back((*it++));
-}
-//=============================================================================
-const std::list<std::string>& 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<std::string>::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 = "<<cpt/2);
-// . Indication generale : aucun champ ne reste a interpoler
- if ( cpt == 0 )
- {
- SetTypeFieldInterp ( 0 ) ;
- }
-}
-//=============================================================================
-void HOMARD_Hypothesis::SupprFieldInterps()
-{
- MESSAGE ("SupprFieldInterps") ;
- _ListFieldInterp.clear();
-// . Indication generale : aucun champ ne reste a interpoler
- SetTypeFieldInterp ( 0 ) ;
-}
-//=============================================================================
-const std::list<std::string>& 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<std::string>::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<std::string>& 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<std::string>::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<std::string>& HOMARD_Hypothesis::GetZones() const
-{
- return _ListZone;
-}
+++ /dev/null
-// 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 <string>
-#include <list>
-
-#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<std::string>& 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<std::string>& ListGroup );
- const std::list<std::string>& 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<std::string>& 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<std::string>& GetIterations() const;
-
- void AddZone( const char* NomZone, int TypeUse );
- void SupprZone( const char* NomZone );
- void SupprZones();
- const std::list<std::string>& 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<std::string> _ListIter;
- std::list<std::string> _ListZone;
- std::list<std::string> _ListComp;
- std::list<std::string> _ListGroupSelected;
- std::list<std::string> _ListFieldInterp;
-
-};
-
-#endif
+++ /dev/null
-// 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<std::string>::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<std::string>::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<std::string>& HOMARD_Iteration::GetFieldInterpsTimeStepRank() const
-{
- return _ListFieldInterpTSR;
-}
-//=============================================================================
-void HOMARD_Iteration::SetFieldInterp( const char* FieldInterp )
-{
- _ListFieldInterp.push_back( std::string( FieldInterp ) );
-}
-//=============================================================================
-const std::list<std::string>& 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<std::string>::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<std::string>& 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;
-}
+++ /dev/null
-// 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 <string>
-#include <list>
-
-#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<std::string>& GetFieldInterpsTimeStepRank() const;
- void SetFieldInterp( const char* FieldInterp );
- const std::list<std::string>& 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<std::string>& 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<std::string> _mesIterFilles;
- std::string _FileInfo;
- int _MessInfo;
- // La liste des champs retenus par l'hypothese
- std::list<std::string> _ListFieldInterp;
- // La liste des triplets (champs, pas de temps, numero d'ordre) retenus par l'iteration
- std::list<std::string> _ListFieldInterpTSR;
-};
-
-#endif
+++ /dev/null
-// 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
-//=============================================================================
-//=============================================================================
+++ /dev/null
-// 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 <string>
-#include <list>
-
-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
+++ /dev/null
-// 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<double> HOMARD_Zone::GetCoords() const
-{
- std::vector<double> 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<double> HOMARD_Zone::GetLimit() const
-{
- std::vector<double> 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<std::string>& HOMARD_Zone::GetHypo() const
-{
- return _ListHypo;
-}
-//=============================================================================
-void HOMARD_Zone::SupprHypo( const char* NomHypo )
-{
- std::list<std::string>::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() ;
-}
+++ /dev/null
-// 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 <vector>
-#include <string>
-#include <list>
-
-#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<double> GetCoords() const;
-
- void SetLimit( double X0, double X1, double X2 );
- std::vector<double> GetLimit() const;
-
-// Liens avec les autres structures
- void AddHypo( const char* NomHypo );
- const std::list<std::string>& GetHypo() const;
- void SupprHypo( const char* NomHypo );
- void SupprHypos();
-
-private:
- std::string _Name;
- int _Type;
- std::list<std::string> _ListHypo;
- double _Xmin, _Xmax, _Ymin, _Ymax, _Zmin, _Zmax;
- double _Xcentre, _Ycentre, _Zcentre, _Rayon, _Rayonint;
- double _Xaxe, _Yaxe, _Zaxe, _Haut;
- double _Xincr, _Yincr, _Zincr;
-};
-
-#endif
+++ /dev/null
-// 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 <cstring>
-#ifndef WIN32
-#include <unistd.h>
-#endif
-#include <sys/stat.h>
-
-#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 = "<<siter<<", siterp1 = "<<siterp1);
-// Le repertoire ou se trouve l'executable HOMARD
- std::string dir ;
- if ( getenv("HOMARD_REP_EXE_PRIVATE") != NULL ) { dir = getenv("HOMARD_REP_EXE_PRIVATE") ; }
- else { dir = getenv("HOMARD_REP_EXE") ; }
- MESSAGE("dir ="<<dir);
-// L'executable HOMARD
- std::string executable ;
- if ( getenv("HOMARD_EXE_PRIVATE") != NULL ) { executable = getenv("HOMARD_EXE_PRIVATE") ; }
- else { executable = getenv("HOMARD_EXE") ; }
- MESSAGE("executable ="<<executable);
-// Memorisation du nom complet de l'executable HOMARD
- _HOMARD_Exec = dir + "/" + executable ;
- MESSAGE("==> _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 ="<<DirCompute<<", LogFile ="<<LogFile);
-//
- _Texte = "ListeStd \"" + LogFile + "\"\n" ;
- _Texte += "RepeTrav \"" + DirCompute + "\"\n" ;
- _Texte += "RepeInfo \"" + DirCompute + "\"\n" ;
- _Texte += "Langue \"" + Langue + "\"\n" ;
-//
-}
-//===============================================================================
-void HomardDriver::TexteAdap( int ExtType )
-{
- MESSAGE("TexteAdap");
-//
- _Texte += "Action homa\n" ;
- if ( ExtType == 0 ) { _Texte += "CCAssoci med\n" ; }
- else if ( ExtType == 1 ) { _Texte += "CCAssoci saturne\n" ; }
- else { _Texte += "CCAssoci saturne_2d\n" ; }
- _Texte += "ModeHOMA 1\n" ;
- _Texte += "NumeIter " + _siter + "\n" ;
- _modeHOMARD = 1 ;
-//
-}
-//===============================================================================
-void HomardDriver::TexteInfo( int TypeBila, int NumeIter )
-{
- MESSAGE("TexteInfo: TypeBila ="<<TypeBila<<", NumeIter ="<<NumeIter);
-//
- _Texte += "ModeHOMA 2\n" ;
- std::stringstream saux1 ;
- saux1 << TypeBila ;
- std::string saux2 = saux1.str() ;
- _Texte += "TypeBila " + saux2 + "\n" ;
- if ( NumeIter == 0 )
- {
- _Texte += "NumeIter 0\n" ;
- _Texte += "Action info_av\n" ;
- _Texte += "CCAssoci med\n" ;
- }
- else
- {
- _Texte += "NumeIter " + _siter + "\n" ;
- _Texte += "Action info_ap\n" ;
- _Texte += "CCAssoci homard\n" ;
- }
- _modeHOMARD = 2 ;
-//
-}
-//===============================================================================
-void HomardDriver::TexteMajCoords( int NumeIter )
-{
- MESSAGE("TexteMajCoords: NumeIter ="<<NumeIter);
-//
- _Texte += "ModeHOMA 5\n" ;
- _Texte += "NumeIter " + _siterp1 + "\n" ;
- _Texte += "Action homa\n" ;
- _Texte += "CCAssoci med\n" ;
- _Texte += "EcriFiHO N_SANS_FRONTIERE\n" ;
- _modeHOMARD = 5 ;
-//
-}
-//===============================================================================
-// B. Les maillages en entree et en sortie
-//===============================================================================
-void HomardDriver::TexteMaillage( const std::string NomMesh, const std::string MeshFile, int apres )
-{
- MESSAGE("TexteMaillage, NomMesh = "<<NomMesh);
- MESSAGE("TexteMaillage, MeshFile = "<<MeshFile);
- MESSAGE("TexteMaillage, apres = "<<apres);
- std::string saux ;
- saux = "P1" ;
- if ( apres < 1 ) { saux = "__" ; }
-
- _Texte += "# Maillages Med " + saux + "\n" ;
- _Texte += "CCNoMN" + saux + " \"" + NomMesh + "\"\n" ;
- _Texte += "CCMaiN" + saux + " \"" + MeshFile + "\"\n" ;
-}
-
-//===============================================================================
-void HomardDriver::TexteMaillageHOMARD( const std::string Dir, const std::string liter, int apres )
-{
- MESSAGE("TexteMaillageHOMARD, Dir ="<<Dir<<", liter ="<<liter<<", apres ="<<apres);
- std::string saux ;
- if ( apres < 1 ) { saux = "__" ; }
- else { saux = "P1" ; }
-
- _Texte += "# Maillage HOMARD " + liter + "\n" ;
- _Texte += "HOMaiN" + saux + " Mai" + liter + " \"" + Dir + "/maill." + liter + ".hom.med\"\n" ;
-}
-
-//===============================================================================
-// C. Le pilotage de l'adaptation
-//===============================================================================
-void HomardDriver::TexteConfRaffDera( int ConfType, int TypeAdap, int TypeRaff, int TypeDera )
-{
- MESSAGE("TexteConfRaffDera, ConfType ="<<ConfType);
- MESSAGE("TexteConfRaffDera, TypeAdap ="<<TypeAdap<<", TypeRaff ="<<TypeRaff<<", TypeDera ="<<TypeDera);
-//
-// Type de conformite
-//
- std::string saux ;
- switch (ConfType)
- {
- case -2: //
- {
- saux = "NON_CONFORME_1_ARETE" ;
- break;
- }
- case -1: //
- {
- saux = "CONFORME_BOITES" ;
- break;
- }
- case 0: //
- {
- saux = "CONFORME" ;
- break;
- }
- case 1: //
- {
- saux = "NON_CONFORME" ;
- break;
- }
- case 2: //
- {
- saux = "NON_CONFORME_1_NOEUD" ;
- break;
- }
- case 3: //
- {
- saux = "NON_CONFORME_INDICATEUR" ;
- break;
- }
- }
- _Texte += "# Type de conformite\nTypeConf " + saux + "\n" ;
-//
-// Type de raffinement/deraffinement
-//
- if ( TypeAdap == -1 )
- {
- if ( TypeRaff == 1 )
- {
- saux = "TypeRaff uniforme\n" ;
- }
- else
- {
- saux = "TypeRaff non\n" ;
- }
- if ( TypeDera == 1 )
- {
- saux += "TypeDera uniforme" ;
- }
- else
- {
- saux += "TypeDera non" ;
- }
- }
- else
- {
- if ( TypeRaff == 1 )
- {
- saux = "TypeRaff libre\n" ;
- }
- else
- {
- saux = "TypeRaff non\n" ;
- }
- if ( TypeDera == 1 )
- {
- saux += "TypeDera libre" ;
- }
- else
- {
- saux += "TypeDera non" ;
- }
- }
- _Texte += "# Type de raffinement/deraffinement\n" + saux + "\n" ;
-//
-// MESSAGE("A la fin de HomardDriver::TexteConfRaffDera, _Texte ="<<_Texte);
-}
-//===============================================================================
-void HomardDriver::TexteCompo( int NumeComp, const std::string NomCompo)
-{
- MESSAGE("TexteCompo, NumeComp = "<<NumeComp<<", NomCompo = "<<NomCompo);
- _Texte +="CCCoChaI \"" + NomCompo + "\"\n" ;
-}
-//===============================================================================
-void HomardDriver::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 )
-{
- MESSAGE("TexteZone, NumeZone = "<<NumeZone<<", ZoneType = "<<ZoneType<<", TypeUse = "<<TypeUse);
- MESSAGE("TexteZone, coor = "<< x0<<","<<x1<< ","<< x2<< ","<< x3<<","<<x4<<","<<x5<<","<<x6<<","<<x7<<","<<x8);
-//
- std::string saux, saux2 ;
-//
-// Type de zones
-// On convertit le type de zone au sens du module HOMARD dans Salome, ZoneType, dans le
-// type au sens de l'executable HOMARD, ZoneTypeHOMARD
-// Attention a mettre le bon signe a ZoneTypeHOMARD :
-// >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 = "<<FieldName<<", FieldFile = "<<FieldFile);
- MESSAGE("TexteField, TimeStep = "<<TimeStep<<", Rank = "<<Rank);
-
- std::string saux, saux2 ;
-//
-//
- _Texte += "# Champ d'indicateurs\n" ;
- _Texte += "CCIndica \"" + FieldFile + "\"\n" ;
- _Texte += "CCNoChaI \"" + FieldName + "\"\n" ;
-
-// Cas ou on prend le dernier pas de temps
- if ( TimeStep == -2 )
- { _Texte += "CCNumPTI Last\n" ; }
-// Cas avec pas de temps
- else if ( TimeStep >= 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 = "<<GroupName);
-//
- _Texte += "CCGroAda \"" + GroupName + "\"\n" ;
-//
-}
-//===============================================================================
-// D. Les frontieres
-//===============================================================================
-void HomardDriver::TexteBoundaryOption( int BoundaryOption )
-{
- MESSAGE("TexteBoundaryOption, BoundaryOption = "<<BoundaryOption);
-//
-// Type de suivi de frontiere
-//
- std::stringstream saux1 ;
- saux1 << BoundaryOption ;
- std::string saux = saux1.str() ;
- _Texte += "SuivFron " + saux + "\n" ;
-//
-}//===============================================================================
-void HomardDriver::TexteBoundaryCAOGr( const std::string GroupName )
-{
- MESSAGE("TexteBoundaryCAOGr, GroupName = "<<GroupName);
-//
- _Texte += "GrFroCAO \"" + GroupName + "\"\n" ;
-//
-}
-
-//===============================================================================
-void HomardDriver::TexteBoundaryDi( const std::string MeshName, const std::string MeshFile )
-{
- MESSAGE("TexteBoundaryDi, MeshName = "<<MeshName);
- MESSAGE("TexteBoundaryDi, MeshFile = "<<MeshFile);
-//
- _Texte += "#\n# Frontiere discrete\n" ;
- _Texte += "CCNoMFro \"" + MeshName + "\"\n" ;
- _Texte += "CCFronti \"" + MeshFile + "\"\n" ;
-//
-}
-//===============================================================================
-void HomardDriver::TexteBoundaryDiGr( const std::string GroupName )
-{
- MESSAGE("TexteBoundaryDiGr, GroupName = "<<GroupName);
-//
- _Texte += "CCGroFro \"" + GroupName + "\"\n" ;
-//
-}
-//===============================================================================
-void HomardDriver::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 )
-{
- MESSAGE("TexteBoundaryAn, NameBoundary = "<<NameBoundary);
-// MESSAGE("TexteBoundaryAn, NumeBoundary = "<<NumeBoundary);
- MESSAGE("TexteBoundaryAn, BoundaryType = "<<BoundaryType);
-// MESSAGE("TexteBoundaryAn, coor = "<< x0<<","<<x1<< ","<< x2<< ","<< x3<<","<<x4<<","<<x5<<","<<x6","<<x7);
-//
- std::string saux, saux2 ;
-//
-// Commentaires
-//
- std::stringstream saux1 ;
- saux1 << NumeBoundary ;
- saux2 = saux1.str() ;
- saux = "#\n# Frontiere numero " + saux2 + "\n" ;
- if ( BoundaryType == 1 )
- { saux += "# Cylindre\n" ; }
- if ( BoundaryType == 2 )
- { saux += "# Sphere\n" ; }
- if ( BoundaryType == 3 || BoundaryType == 4 )
- { saux += "# Cone\n" ; }
- if ( BoundaryType == 5 )
- { saux += "# Tore\n" ; }
-//
-// Le nom de la frontiere
-//
- { std::stringstream saux1 ;
- saux1 << NumeBoundary ;
- saux += "FANom " + saux1.str() + " \"" + NameBoundary + "\"\n" ;
- }
-//
-// Type de frontiere
-//
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << BoundaryType ;
- saux += "FAType " + saux1.str() + "\n" ;
- }
-//
-// Cas du cylindre
-//
- if ( BoundaryType == 1 )
- {
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x0 ;
- saux2 = saux1.str() ;
- saux += "FAXCen " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x1 ;
- saux += "FAYCen " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x2 ;
- saux += "FAZCen " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x3 ;
- saux += "FAXAxe " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x4 ;
- saux += "FAYAxe " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x5 ;
- saux += "FAZAxe " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x6 ;
- saux += "FARayon " + saux1.str() + "\n" ;
- }
- }
-//
-// Cas de la sphere
-//
- else if ( BoundaryType == 2 )
- {
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x0 ;
- saux += "FAXCen " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x1 ;
- saux += "FAYCen " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x2 ;
- saux += "FAZCen " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x3 ;
- saux += "FARayon " + saux1.str() + "\n" ;
- }
- }
-//
-// Cas du cone defini par un axe et un angle
-//
- if ( BoundaryType == 3 )
- {
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x0 ;
- saux += "FAXAxe " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x1 ;
- saux += "FAYAxe " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x2 ;
- saux += "FAZAxe " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x3 ;
- saux += "FAAngle " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x4 ;
- saux += "FAXCen " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x5 ;
- saux += "FAYCen " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x6 ;
- saux += "FAZCen " + saux1.str() + "\n" ;
- }
- }
-//
-// Cas du cone defini par les 2 rayons
-//
- if ( BoundaryType == 4 )
- {
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x0 ;
- saux += "FAXCen " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x1 ;
- saux += "FAYCen " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x2 ;
- saux += "FAZCen " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x3 ;
- saux += "FARayon " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x4 ;
- saux += "FAXCen2 " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x5 ;
- saux += "FAYCen2 " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x6 ;
- saux += "FAZCen2 " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x7 ;
- saux += "FARayon2 " + saux1.str() + "\n" ;
- }
- }
-//
-// Cas du tore
-//
- if ( BoundaryType == 5 )
- {
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x0 ;
- saux2 = saux1.str() ;
- saux += "FAXCen " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x1 ;
- saux += "FAYCen " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x2 ;
- saux += "FAZCen " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x3 ;
- saux += "FAXAxe " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x4 ;
- saux += "FAYAxe " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x5 ;
- saux += "FAZAxe " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x6 ;
- saux += "FARayon " + saux1.str() + "\n" ;
- }
- { std::stringstream saux1 ;
- saux1 << NumeBoundary << " " << x7 ;
- saux += "FARayon2 " + saux1.str() + "\n" ;
- }
- }
-//
- _Texte += saux + "#\n" ;
-//
-}
-//===============================================================================
-void HomardDriver::TexteBoundaryAnGr( const std::string NameBoundary, int NumeBoundary, const std::string GroupName )
-{
- MESSAGE("TexteBoundaryAnGr, NameBoundary = "<<NameBoundary);
-// MESSAGE("TexteBoundaryAnGr, NumeBoundary = "<<NumeBoundary);
-// MESSAGE("TexteBoundaryAnGr, GroupName = "<<GroupName);
-//
-// Commentaires
-//
- std::string saux, saux2 ;
- std::stringstream saux1 ;
- saux1 << NumeBoundary ;
- saux2 = saux1.str() ;
- saux = "#\n# Lien Frontiere/Groupe numero " + saux2 + "\n" ;
-//
- saux += "FGNomFro " + saux2 + " \"" + NameBoundary + "\"\n" ;
- saux += "FGNomGro " + saux2 + " \"" + GroupName + "\"\n" ;
-//
- _Texte += saux + "#\n" ;
-//
-}
-//===============================================================================
-// E. Les interpolations
-//===============================================================================
-// Les fichiers d'entree et de sortie des champs a interpoler
-void HomardDriver::TexteFieldInterp( const std::string FieldFile, const std::string MeshFile )
-{
- MESSAGE("TexteFieldInterp, FieldFile = "<<FieldFile<<", MeshFile = "<<MeshFile);
-//
- _Texte += "#\n# Interpolations des champs\n" ;
-//
-// Fichier en entree
- _Texte += "CCSolN__ \"" + FieldFile + "\"\n" ;
-// Fichier en sortie
- _Texte += "CCSolNP1 \"" + MeshFile + "\"\n" ;
-//
-// std::cerr << "A la fin de TexteFieldInterp _Texte ="<<_Texte << std::endl;
-}
-//===============================================================================
-// Tous les champs sont a interpoler
-void HomardDriver::TexteFieldInterpAll( )
-{
- MESSAGE("TexteFieldInterpAll");
-//
- _Texte += "CCChaTou oui\n" ;
-}
-//===============================================================================
-// Ecrit les caracteristiques de chaque interpolation sous la forme :
-// CCChaNom 1 "DEPL" ! Nom du 1er champ a interpoler
-// CCChaTIn 1 0 ! Mode d'interpolation : automatique
-// CCChaNom 2 "VOLUME" ! Nom du 2nd champ a interpoler
-// CCChaTIn 2 1 ! Mode d'interpolation : une variable extensive
-// CCChaPdT 2 14 ! Pas de temps 14
-// CCChaNuO 2 14 ! Numero d'ordre 14
-// etc.
-//
-// NumeChamp : numero d'ordre du champ a interpoler
-// FieldName : nom du champ
-// TypeInterp : type d'interpolation
-// TimeStep : pas de temps retenu (>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 = "<<NumeChamp<<", FieldName = "<<FieldName<<", TypeInterp = "<<TypeInterp);
- MESSAGE("TexteFieldInterpNameType, TimeStep = "<<TimeStep<<", Rank = "<<Rank);
-// Numero d'ordre du champ a interpoler
- std::stringstream saux1 ;
- saux1 << NumeChamp ;
- std::string saux = saux1.str() ;
-// Nom du champ
- _Texte +="CCChaNom " + saux + " \"" + FieldName + "\"\n" ;
-// Type d'interpolation pour le champ
- _Texte +="CCChaTIn " + saux + " " + TypeInterp + "\n" ;
-//
- if ( TimeStep >= 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 ="<<Pyram<<", NivMax ="<<NivMax<<", DiamMin ="<<DiamMin<<", AdapInit ="<<AdapInit<<", ExtraOutput ="<<ExtraOutput);
-
- if ( Pyram > 0 )
- {
- _Texte += "# Autorisation de pyramides dans le maillage initial\n" ;
- _Texte += "TypeElem ignore_pyra\n" ;
- }
- if ( NivMax > 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 ="<<MessInfo);
-
- if ( MessInfo != 0 )
- {
- _Texte += "# Messages d'informations\n" ;
- { std::stringstream saux1 ;
- saux1 << MessInfo ;
- _Texte += "MessInfo " + saux1.str() + "\n" ;
- }
- }
-}
-//===============================================================================
-void HomardDriver::CreeFichier( )
-{
-//
- if ( _modeHOMARD == 1 )
- { _NomFichierConf = _NomFichierConfBase + "." + _siter + ".vers." + _siterp1 ; }
- else if ( _modeHOMARD == 2 )
- { _NomFichierConf = _NomFichierConfBase + "." + _siter + ".info" ; }
- else if ( _modeHOMARD == 5 )
- { _NomFichierConf = _NomFichierConfBase + ".majc" ; }
-//
- std::ofstream Fic(_NomFichierConf.c_str(), std::ios::out ) ;
- if (Fic.is_open() == true) { Fic << _Texte << std::endl ; }
- Fic.close() ;
-//
-}
-//===============================================================================
-// Creation du fichier de donnees pour l'information
-//===============================================================================
-void HomardDriver::CreeFichierDonn( )
-{
-//
- MESSAGE("CreeFichierDonn");
- _NomFichierDonn = "info.donn" ;
-//
- std::string data ;
- data = "0\n" ;
- data += "0\n" ;
- data += "q\n" ;
- std::ofstream Fic(_NomFichierDonn.c_str(), std::ios::out ) ;
- if (Fic.is_open() == true) { Fic << data << std::endl ; }
- Fic.close() ;
-//
-}
-//===============================================================================
-int HomardDriver::ExecuteHomard(int option)
-{
- MESSAGE("ExecuteHomard, avec option = "<<option);
- std::string commande ;
- int codret ;
-// Copie des Fichiers HOMARD
- commande = "cp " + _NomFichierConf + " " + _NomFichierConfBase ;
- codret = system(commande.c_str()) ;
-
-// Execution de HOMARD
- if ( codret == 0)
- {
- commande = _HOMARD_Exec.c_str() ;
- if ( _NomFichierDonn != "" ) { commande += " < " + _NomFichierDonn ; }
- codret = system(commande.c_str());
- if ( codret != 0) { MESSAGE ( "Erreur en executant HOMARD : " << codret ); };
- _NomFichierDonn = "" ;
- };
- return codret ;
-}
+++ /dev/null
-// 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
-//
-
-# ifndef _HOMARDDRIVER_HXX_
-# define _HOMARDDRIVER_HXX_
-
-#include "HOMARD.hxx"
-
-#include <iostream>
-#include <fstream>
-
-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_ */
+++ /dev/null
-// 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 <cstring>
-#ifndef WIN32
-#include <unistd.h>
-#endif
-#include <sys/stat.h>
-
-#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 = "<<XMLFile<<", DirName ="<<DirName);
- _XMLFile = XMLFile;
- _DirName = DirName;
- _LangueShort = LangueShort;
-}
-//=============================================================================
-//=============================================================================
-YACSDriver::~YACSDriver()
-{
-}
-//===============================================================================
-// Ajout d'une ligne simple
-//===============================================================================
-void YACSDriver::TexteAdd( const std::string ligne )
-{
-// MESSAGE("TexteAdd, ligne ="<<ligne);
-//
- _Texte += ligne + "\n" ;
-//
-}
-//===============================================================================
-// Nom du fichier du maillage initial
-//===============================================================================
-void YACSDriver::Texte_DataInit_MeshFile( const std::string Meshfile )
-{
- MESSAGE("TexteInitMeshfile, Meshfile ="<<Meshfile);
-//
- _Texte += " <value><string>" ;
- _Texte += Meshfile ;
- _Texte += "</string></value>\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 : "<<FileName);
-//
- int position = FileName.find_last_of( '/' ) ;
- std::string nomfic = FileName.substr( position+1 ) ;
- position = nomfic.find_last_of( '.' ) ;;
- nomfic = nomfic.substr( 0, position ) ;
- MESSAGE("nomfic : "<<nomfic) ;
-//
- _Texte += "rep_calc = \"" + _DirName + "\"\n" ;
- _Texte += "rep_script = os.path.dirname(\"" + FileName + "\")\n" ;
- _Texte += "sys.path.append(rep_script)\n" ;
- _Texte += "from " + nomfic + " import Script\n" ;
-//
-}
-//===============================================================================
-// Les options du cas
-//===============================================================================
-void YACSDriver::Texte_Iter_1_Case_Options( const std::string pythonTexte )
-{
- MESSAGE("Texte_Iter_1_Case_Options, pythonTexte\n"<<pythonTexte);
-//
- _Texte += "DirName = \"" + _DirName + "/HOMARD\"\n" ;
- _Texte += "Case.SetDirName(DirName)\n" ;
-
- Texte_python_1( pythonTexte, 1, "Case" ) ;
-//
-}
-//===============================================================================
-// La description des zones
-// ZoneType : le type de la zone
-// pythonStructure : le python correspondant a la zone
-// methode : methode associee a la creation de la zone
-// ZoneName : nom de la zone
-//===============================================================================
-std::string YACSDriver::Texte_Iter_1_Zone( int ZoneType, const std::string pythonStructure, const std::string methode, const std::string ZoneName )
-{
- MESSAGE("Texte_Iter_1_Zone, ZoneType = "<<ZoneType<<", pythonStructure = "<<pythonStructure);
- MESSAGE("methode = "<<methode<<", ZoneName = "<<ZoneName );
-//
-// 1. Le nom du noeud
- std::string noeud_2 = methode + "_" + ZoneName ;
- 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." ;
- node += noeud_2 ;
-// 2. Texte de controle : le noeud precedent est _noeud_1, le noeud courant noeud_2.
-// A la fin, on bascule le courant dans le precedent
- std::string texte_control = Texte_control (_noeud_1, noeud_2, 1) ;
- _noeud_1 = noeud_2 ;
-// 3. Definition du service
- std::string motcle ;
- _Texte += " <service name=\"" + noeud_2 + "\">\n" ;
- INFOS("_LangueShort = "<<_LangueShort );
- if ( _LangueShort == "fr" ) { motcle = "Etude_Initialisation" ; }
- else { motcle = "Study_Initialisation" ; }
- INFOS("motcle = "<<motcle );
- _Texte += " <node>" + motcle + ".UpdateStudy</node>\n" ;
- _Texte += " <method>" + methode + "</method>\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 = "<<lignebis );
- if ( iaux == 0 ) { x0 = lignebis ; }
- else if ( iaux == 1 ) { x1 = lignebis ; }
- else if ( iaux == 2 ) { x2 = lignebis ; }
- else if ( iaux == 3 ) { x3 = lignebis ; }
- else if ( iaux == 4 ) { x4 = lignebis ; }
- else if ( iaux == 5 ) { x5 = lignebis ; }
- else if ( iaux == 6 ) { x6 = lignebis ; }
- else if ( iaux == 7 ) { x7 = lignebis ; }
- ligne = GetStringInTexte( ligne, ",", 1 );
- iaux += 1 ;
- }
-// La derniere valeur est toujours mise dans x8
- x8 = GetStringInTexte ( ligne, ")", 0 ) ;
- MESSAGE("coor = "<< x0<<","<<x1<< ","<< x2<< ","<< x3<<","<<x4<<","<<x5<<","<<x6<<","<<x7<<","<<x8);
-// 4.2.2. Cas du parallelepipede (2)
- if ( ZoneType == 2 )
- {
- _Texte += Texte_inport( "double", "Xmini" ) ;
- _Texte += Texte_inport( "double", "Xmaxi" ) ;
- _Texte += Texte_inport( "double", "Ymini" ) ;
- _Texte += Texte_inport( "double", "Ymaxi" ) ;
- _Texte += Texte_inport( "double", "Zmini" ) ;
- _Texte += Texte_inport( "double", "Zmaxi" ) ;
- TexteParametre( node, "Xmini", "double", x0 ) ;
- TexteParametre( node, "Xmaxi", "double", x1 ) ;
- TexteParametre( node, "Ymini", "double", x2 ) ;
- TexteParametre( node, "Ymaxi", "double", x3 ) ;
- TexteParametre( node, "Zmini", "double", x4 ) ;
- TexteParametre( node, "Zmaxi", "double", x8 ) ;
- }
-//
-// 4.2.3. Cas du rectangle (11, 12, 13)
- else if ( ( ZoneType > 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 += " <outport name=\"return\" type=\"HOMARD_Zone\"/>\n" ;
- _Texte += " </service>\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 = "<<BoundaryType<<", pythonStructure = "<<pythonStructure);
- MESSAGE("methode = "<<methode<<", BoundaryName = "<<BoundaryName );
- if (BoundaryType == 0) { MESSAGE("MeshName = "<<MeshName<<", MeshFile = "<<MeshFile ); }
-//
-// 1. Le nom du noeud
- std::string noeud_2 = methode + "_" + BoundaryName ;
- 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." ;
- node += noeud_2 ;
-// 2. Texte de controle : le noeud precedent est _noeud_1, le noeud courant noeud_2.
-// A la fin, on bascule le courant dans le precedent
- std::string texte_control = Texte_control (_noeud_1, noeud_2, 1) ;
- _noeud_1 = noeud_2 ;
-// 3. Definition du service
- std::string motcle ;
- _Texte += " <service name=\"" + noeud_2 + "\">\n" ;
- if ( _LangueShort == "fr" ) { motcle = "Etude_Initialisation" ; }
- else { motcle = "Study_Initialisation" ; }
- _Texte += " <node>" + motcle + ".UpdateStudy</node>\n" ;
- _Texte += " <method>" + methode + "</method>\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 = "<<lignebis );
- if ( iaux == 0 ) { x0 = lignebis ; }
- else if ( iaux == 1 ) { x1 = lignebis ; }
- else if ( iaux == 2 ) { x2 = lignebis ; }
- else if ( iaux == 3 ) { x3 = lignebis ; }
- else if ( iaux == 4 ) { x4 = lignebis ; }
- else if ( iaux == 5 ) { x5 = lignebis ; }
- else if ( iaux == 6 ) { x6 = lignebis ; }
- ligne = GetStringInTexte( ligne, ",", 1 );
- iaux += 1 ;
- }
-// La derniere valeur est toujours mise dans x7
- x7 = GetStringInTexte ( ligne, ")", 0 ) ;
- MESSAGE("Valeurs = "<< x0<<", "<<x1<< ", "<< x2<< ", "<< x3<<", "<<x4<<", "<<x5<<", "<<x6<<", x7"<<x7);
-//
-// 4.3.2. Cas du cylindre (1)
- if ( BoundaryType == 1 )
- {
- _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" ) ;
- 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", x7 ) ;
- }
-//
-// 4.3.3. Cas de la sphere (2)
- else if ( BoundaryType == 2 )
- {
- _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", x7 ) ;
- }
-//
-// 4.3.4. Cas d un cone defini par un axe et un angle
- else if ( BoundaryType == 3 )
- {
- _Texte += Texte_inport( "double", "Xaxis" ) ;
- _Texte += Texte_inport( "double", "Yaxis" ) ;
- _Texte += Texte_inport( "double", "Zaxis" ) ;
- _Texte += Texte_inport( "double", "Angle" ) ;
- _Texte += Texte_inport( "double", "Xcentre" ) ;
- _Texte += Texte_inport( "double", "Ycentre" ) ;
- _Texte += Texte_inport( "double", "Zcentre" ) ;
- TexteParametre( node, "Xaxis", "double", x0 ) ;
- TexteParametre( node, "Yaxis", "double", x1 ) ;
- TexteParametre( node, "Zaxis", "double", x2 ) ;
- TexteParametre( node, "Angle", "double", x3 ) ;
- TexteParametre( node, "Xcentre", "double", x4 ) ;
- TexteParametre( node, "Ycentre", "double", x5 ) ;
- TexteParametre( node, "Zcentre", "double", x7 ) ;
- }
-//
-// 4.3.5. Cas d un cone defini par les 2 rayons
- else if ( BoundaryType == 4 )
- {
- _Texte += Texte_inport( "double", "Xcentre1" ) ;
- _Texte += Texte_inport( "double", "Ycentre1" ) ;
- _Texte += Texte_inport( "double", "Zcentre1" ) ;
- _Texte += Texte_inport( "double", "Radius1" ) ;
- _Texte += Texte_inport( "double", "Xcentre2" ) ;
- _Texte += Texte_inport( "double", "Ycentre2" ) ;
- _Texte += Texte_inport( "double", "Zcentre2" ) ;
- _Texte += Texte_inport( "double", "Radius2" ) ;
- TexteParametre( node, "Xcentre1", "double", x0 ) ;
- TexteParametre( node, "Ycentre1", "double", x1 ) ;
- TexteParametre( node, "Zcentre1", "double", x2 ) ;
- TexteParametre( node, "Radius1", "double", x3 ) ;
- TexteParametre( node, "Xcentre2", "double", x4 ) ;
- TexteParametre( node, "Ycentre2", "double", x5 ) ;
- TexteParametre( node, "Zcentre2", "double", x6 ) ;
- TexteParametre( node, "Radius2", "double", x7 ) ;
- }
-// 4.3.6. Cas du tore (5)
- else if ( BoundaryType == 5 )
- {
- _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", "RRev" ) ;
- _Texte += Texte_inport( "double", "RPri" ) ;
- 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, "RRev", "double", x6 ) ;
- TexteParametre( node, "RPri", "double", x7 ) ;
- }
-//
-// 4.3.7. Erreur
- else
- { VERIFICATION("Type de frontiere inconnu." == 0); }
- }
-//
-// 5. La fin
- _Texte += " <outport name=\"return\" type=\"HOMARD_Boundary\"/>\n" ;
- _Texte += " </service>\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 = "<<noeud_1<<", noeud_2 = "<<noeud_2<<", option = "<<option);
-//
- std::string texte ;
- texte = " <control> " ;
- texte += "<fromnode>" + noeud_1 + "</fromnode>" ;
- texte += " <tonode>" + noeud_2 + "</tonode>" ;
- texte += " </control>" ;
- 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 = "<<inport_type<<", inport_nom = "<<inport_nom);
-//
- std::string texte ;
- texte = " <inport " ;
- texte += "name=\"" + inport_nom + "\" " ;
- texte += "type=\"" + inport_type + "\"" ;
- texte += "/>\n" ;
-
- return texte ;
-//
-}
-//===============================================================================
-// Le repertoire d'execution
-//===============================================================================
-void YACSDriver::Texte_HOMARD_Exec_DirName( )
-{
- MESSAGE("Texte_HOMARD_Exec_DirName");
-//
- _Texte += "DirName = \"" + _DirName + "\"\n" ;
-//
-}
-//===============================================================================
-// Le nom du maillage
-//===============================================================================
-void YACSDriver::Texte_HOMARD_Exec_MeshName( const std::string MeshName )
-{
- MESSAGE("Texte_HOMARD_Exec_MeshName pour "<<MeshName);
-//
- _Texte += "MeshName = \"" + MeshName + "\"\n" ;
-//
-}
-//===============================================================================
-// Manipulation des instructions python - 1
-// pythonTexte : le texte des instructions python a manipuler
-// indice : numero de la premiere ligne voulue
-// concept : nom du concept a inserer
-//===============================================================================
-void YACSDriver::Texte_python_1( const std::string pythonTexte, int indice, const std::string concept )
-{
- MESSAGE("Texte_python_1, pythonTexte\n"<<pythonTexte);
- MESSAGE("indice = "<<indice<<", concept = "<<concept);
-//
-// Conversion de type
- std::istringstream tout (pythonTexte) ;
-// MESSAGE("\ntout :"<<tout);
- std::string ligne; // variable contenant chaque ligne de python
- std::string ligne_bis ; // variable contenant la portion de ligne de python apres '.'
- int cptr = 0 ;
- indice -= 1 ;
- while ( std::getline( tout, ligne ) )
- {
- if ( cptr > 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"<<pythonTexte);
- MESSAGE("mot_cle = "<<mot_cle<<", concept = "<<concept);
-//
-// Conversion de type
- std::istringstream tout (pythonTexte) ;
-// MESSAGE("\ntout :"<<tout);
- std::string ligne; // variable contenant chaque ligne de python
- std::string ligne_bis ; // variable contenant la portion de ligne de python apres '.'
- while ( std::getline( tout, ligne ) )
- {
- int reperage = ligne.find( mot_cle ) ;
- if ( reperage > 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 += " <parameter>\n" ;
- _Texte_parametres += " <tonode>" + node + "</tonode>" ;
- _Texte_parametres += "<toport>" + port + "</toport>\n" ;
- _Texte_parametres += " <value><" + type_value + ">" + value + "</" + type_value + "></value>\n" ;
- _Texte_parametres += " </parameter>\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 '"<<texte<<"' dans '"<<ligne<<"'"<<", option = "<<option);
-//
- std::string chaine = ligne ;
- int position = ligne.find_first_of( texte ) ;
- if ( position > 0 )
- {
- if ( option == 0 ) { chaine = ligne.substr( 0, position ) ; }
- else { chaine = ligne.substr( position+1 ) ; }
- }
-// Conversion de type
- return chaine ;
-//
-}
+++ /dev/null
-// 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
-//
-
-# ifndef __YACSDRIVER_H__
-# define __YACSDRIVER_H__
-
-#include "HOMARD.hxx"
-
-#include <iostream>
-#include <fstream>
-
-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__ */
+++ /dev/null
-# 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})
+++ /dev/null
-// 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 <MCAuto.hxx>
-#include <MEDCouplingMemArray.hxx>
-#include <MEDFileMesh.hxx>
-
-#include <XAO_Xao.hxx>
-#include <XAO_BrepGeometry.hxx>
-
-#include <stdexcept>
-
-#include <OSD_Parallel.hxx>
-
-/*!
- * \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 #"<<i<<": " << theInputNodeFiles[i] << std::endl;
-#endif
- if ( !FT_Utils::fileExists( theInputNodeFiles[i] ))
- throw std::invalid_argument( "Input node file does not exist: " + theInputNodeFiles[i] );
- // the name of the groupe on line #1, then the numbers of nodes on line #>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 #"<<i<<": " << theNodeFiles[i] << std::endl; }
-#endif
-
-#ifdef _DEBUG_
- std::cout << "XAO file: " << theXaoFileName << std::endl;
-#endif
- if ( !FT_Utils::fileExists( theXaoFileName ))
- throw std::invalid_argument( "Input XAO file does not exist: " + theXaoFileName );
-
- // read a mesh
-
-#ifdef _DEBUG_
- std::cout << "Lecture du maillage" << std::endl;
-#endif
- MEDCoupling::MCAuto< MEDCoupling::MEDFileUMesh >
- 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::BrepGeometry*>( 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");
-}
+++ /dev/null
-// 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 <vector>
-#include <string>
-
-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
+++ /dev/null
-// 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 <MEDCouplingMemArray.hxx>
-#include <XAO_BrepGeometry.hxx>
-#include <XAO_Xao.hxx>
-
-#include <BRepBndLib.hxx>
-#include <Bnd_Box.hxx>
-#include <TopExp.hxx>
-#include <TopExp_Explorer.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
-#include <TopoDS_Shape.hxx>
-
-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<XAO::BrepGeometry*>( 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;
- }
-}
+++ /dev/null
-// 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 <vector>
-#include <string>
-
-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
+++ /dev/null
-// 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 <MEDCouplingMemArray.hxx>
-
-#include <cstdio>
-#include <cstdlib>
-#include <list>
-#include <stdexcept>
-
-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] );
-}
+++ /dev/null
-// 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 <Bnd_Box.hxx>
-#include <NCollection_DataMap.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TColStd_DataMapOfIntegerInteger.hxx>
-
-#include <string>
-#include <vector>
-
-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<int> _nodesOrder;
-
-};
-
-#endif
+++ /dev/null
-// 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 <BRepAdaptor_Curve.hxx>
-#include <BRepBndLib.hxx>
-#include <BRepTopAdaptor_FClass2d.hxx>
-#include <BRep_Tool.hxx>
-#include <ElCLib.hxx>
-#include <ElSLib.hxx>
-#include <GCPnts_UniformDeflection.hxx>
-#include <GeomAdaptor_Curve.hxx>
-#include <GeomLib_IsPlanarSurface.hxx>
-#include <ShapeAnalysis_Curve.hxx>
-#include <ShapeAnalysis_Surface.hxx>
-#include <TopExp.hxx>
-#include <TopoDS.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TopoDS_Face.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <gp_Circ.hxx>
-#include <gp_Cylinder.hxx>
-#include <gp_Dir.hxx>
-#include <gp_Pln.hxx>
-#include <gp_Pnt.hxx>
-#include <gp_Sphere.hxx>
-#include <gp_Vec.hxx>
-
-#include <limits>
-
-//-----------------------------------------------------------------------------
-/*!
- * \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<double>::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<double>::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<double>::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() );
-}
+++ /dev/null
-// 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 <TopoDS_Shape.hxx>
-#include <Bnd_Box.hxx>
-
-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
+++ /dev/null
-// 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 <XAO_Xao.hxx>
-#include <XAO_Group.hxx>
-
-#include <fcntl.h>
-#include <boost/filesystem.hpp>
-
-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<int>::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;
-}
+++ /dev/null
-// 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 <vector>
-#include <string>
-#include <map>
-
-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
+++ /dev/null
-# 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}")
+++ /dev/null
-// 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 <Standard_Failure.hxx>
-#include <Standard_ErrorHandler.hxx>
-#include <stdexcept>
-
-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 <std_string.i>
-%include <std_vector.i>
-
-%template(svec) std::vector<std::string>;
-
-//%feature("autodoc", "1");
-//%feature("docstring");
-
-%include "FrontTrack.hxx"
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="en_GB">
-<context>
- <name>@default</name>
- <message>
- <source>HOM_MEN_HOMARD</source>
- <translation>HOMARD</translation>
- </message>
- <message>
- <source>HOM_MEN_MODIFICATION</source>
- <translation>Modification</translation>
- </message>
- <message>
- <source>HOM_MEN_INFORMATION</source>
- <translation>Information</translation>
- </message>
- <message>
- <source>HOM_MEN_YACS</source>
- <translation>YACS</translation>
- </message>
- <message>
- <source>HOM_MEN_NEW_CASE</source>
- <translation>New case</translation>
- </message>
- <message>
- <source>HOM_MEN_NEW_ITERATION</source>
- <translation>Next iteration</translation>
- </message>
- <message>
- <source>HOM_MEN_PURSUE_ITERATION</source>
- <translation>Case: pursuit of a stored iteration</translation>
- </message>
- <message>
- <source>HOM_MEN_COMPUTE</source>
- <translation>Compute</translation>
- </message>
- <message>
- <source>HOM_MEN_COMPUTE_PUBLISH</source>
- <translation>Compute and publish</translation>
- </message>
- <message>
- <source>HOM_MEN_EDIT</source>
- <translation>Edit</translation>
- </message>
- <message>
- <source>HOM_MEN_DELETE</source>
- <translation>Delete</translation>
- </message>
- <message>
- <source>HOM_MEN_MESH_INFO</source>
- <translation>Mesh analysis</translation>
- </message>
- <message>
- <source>HOM_MEN_MESH_PUBLICATION</source>
- <translation>Mesh publication</translation>
- </message>
- <message>
- <source>HOM_MEN_EDIT_MESS_FILE</source>
- <translation>Show the file</translation>
- </message>
- <message>
- <source>HOM_MEN_WRITE</source>
- <translation>Write</translation>
- </message>
- <message>
- <source>HOM_TOP_HOMARD</source>
- <translation>HOMARD</translation>
- </message>
- <message>
- <source>HOM_TOP_NEW_CASE</source>
- <translation>New case</translation>
- </message>
- <message>
- <source>HOM_TOP_NEW_ITERATION</source>
- <translation>Next iteration</translation>
- </message>
- <message>
- <source>HOM_TOP_PURSUE_ITERATION</source>
- <translation>Case: pursuit of a stored iteration</translation>
- </message>
- <message>
- <source>HOM_TOP_COMPUTE</source>
- <translation>Compute</translation>
- </message>
- <message>
- <source>HOM_TOP_COMPUTE_PUBLISH</source>
- <translation>Compute and publish</translation>
- </message>
- <message>
- <source>HOM_TOP_EDIT</source>
- <translation>Edit</translation>
- </message>
- <message>
- <source>HOM_TOP_DELETE</source>
- <translation>Delete</translation>
- </message>
- <message>
- <source>HOM_TOP_EDIT_MESS_FILE</source>
- <translation>Show the file</translation>
- </message>
- <message>
- <source>HOM_STB_HOMARD</source>
- <translation>HOMARD</translation>
- </message>
- <message>
- <source>HOM_STB_NEW_CASE</source>
- <translation>New case</translation>
- </message>
- <message>
- <source>HOM_STB_NEW_ITERATION</source>
- <translation>Next iteration</translation>
- </message>
- <message>
- <source>HOM_STB_PURSUE_ITERATION</source>
- <translation>Case: pursuit of a stored iteration</translation>
- </message>
- <message>
- <source>HOM_STB_COMPUTE</source>
- <translation>Compute</translation>
- </message>
- <message>
- <source>HOM_STB_COMPUTE_PUBLISH</source>
- <translation>Compute and publish</translation>
- </message>
- <message>
- <source>HOM_STB_EDIT</source>
- <translation>Edit</translation>
- </message>
- <message>
- <source>HOM_STB_DELETE</source>
- <translation>Delete</translation>
- </message>
- <message>
- <source>HOM_STB_EDIT_MESS_FILE</source>
- <translation>Show the file</translation>
- </message>
- <message>
- <source>HOM_WARNING</source>
- <translation>Warning</translation>
- </message>
- <message>
- <source>HOM_ERROR</source>
- <translation>Error</translation>
- </message>
- <message>
- <source>HOM_INACTIVE_BUTTON</source>
- <translation>Inactive button</translation>
- </message>
- <message>
- <source>HOM_SELECT_OBJECT_1</source>
- <translation>Select an object.</translation>
- </message>
- <message>
- <source>HOM_SELECT_OBJECT_2</source>
- <translation>Select only one object.</translation>
- </message>
- <message>
- <source>HOM_SELECT_OBJECT_3</source>
- <translation>Select an object with type %1.</translation>
- </message>
- <message>
- <source>HOM_SELECT_OBJECT_4</source>
- <translation>The name of the object is already selected. Modify it or cancel.</translation>
- </message>
- <message>
- <source>HOM_SELECT_FILE_0</source>
- <translation>File selection</translation>
- </message>
- <message>
- <source>HOM_SELECT_FILE_1</source>
- <translation>Select a file.</translation>
- </message>
- <message>
- <source>HOM_SELECT_FILE_2</source>
- <translation>Select only one file.</translation>
- </message>
- <message>
- <source>HOM_SELECT_FILE_3</source>
- <translation>This file cannot be opened.</translation>
- </message>
- <message>
- <source>HOM_SCRIPT_FILE</source>
- <translation>A script file must be given.</translation>
- </message>
- <message>
- <source>HOM_MED_FILE_1</source>
- <translation>This MED file cannot be read.</translation>
- </message>
- <message>
- <source>HOM_MED_FILE_2</source>
- <translation>No mesh in this MED file.</translation>
- </message>
- <message>
- <source>HOM_MED_FILE_3</source>
- <translation>More than one mesh in this MED file.</translation>
- </message>
- <message>
- <source>HOM_MED_FILE_4</source>
- <translation>The mesh in this MED file cannot be read.</translation>
- </message>
- <message>
- <source>HOM_MED_FILE_5</source>
- <translation>No field in this MED file.</translation>
- </message>
- <message>
- <source>HOM_MED_FILE_6</source>
- <translation>The field(s) in this MED file cannot be read.</translation>
- </message>
- <message>
- <source>HOM_SELECT_STUDY</source>
- <translation>Select a study object with associated MED file \n or select a MED file.</translation>
- </message>
- <message>
- <source>HOM_CASE_NAME</source>
- <translation>The case must be named.</translation>
- </message>
- <message>
- <source>HOM_CASE_DIRECTORY_1</source>
- <translation>A directory for the case must be selected.</translation>
- </message>
- <message>
- <source>HOM_CASE_DIRECTORY_2</source>
- <translation>This directory is already used by the case </translation>
- </message>
- <message>
- <source>HOM_CASE_DIRECTORY_3</source>
- <translation>A valid directory for the case must be selected.</translation>
- </message>
- <message>
- <source>HOM_CASE_DIRECTORY_4</source>
- <translation>A directory for the computation must be selected.</translation>
- </message>
- <message>
- <source>HOM_START_DIRECTORY_1</source>
- <translation>A starting directory for the pursuit must be selected.</translation>
- </message>
- <message>
- <source>HOM_START_DIRECTORY_3</source>
- <translation>A valid directory for the pursuit must be selected.</translation>
- </message>
- <message>
- <source>HOM_CASE_MESH</source>
- <translation>The file of the initial mesh must be selected.</translation>
- </message>
- <message>
- <source>HOM_CASE_GROUP</source>
- <translation>The group "%1" cannot be given for more than 1 boundary.</translation>
- </message>
- <message>
- <source>HOM_CASE_EDIT_WINDOW_TITLE</source>
- <translation>Edition of a case</translation>
- </message>
- <message>
- <source>HOM_CASE_EDIT_STATE_0</source>
- <translation>Initial mesh.</translation>
- </message>
- <message>
- <source>HOM_CASE_EDIT_STATE</source>
- <translation>Pursuit of an iteration.</translation>
- </message>
- <message>
- <source>HOM_CASE_PURSUE_WINDOW_TITLE</source>
- <translation>Case: pursuit of a stored iteration</translation>
- </message>
- <message>
- <source>HOM_ITER_NAME</source>
- <translation>The iteration must be named.</translation>
- </message>
- <message>
- <source>HOM_ITER_STARTING_POINT</source>
- <translation>The previous iteration must be given.</translation>
- </message>
- <message>
- <source>HOM_ITER_MESH</source>
- <translation>Give a name for the final mesh.</translation>
- </message>
- <message>
- <source>HOM_ITER_HYPO</source>
- <translation>A hypothesis must be selected.</translation>
- </message>
- <message>
- <source>HOM_ITER_FIELD_FILE</source>
- <translation>With this hypothesis, a file for the field must be given.</translation>
- </message>
- <message>
- <source>HOM_ITER_STARTING_POINT_0</source>
- <translation>Mesh</translation>
- </message>
- <message>
- <source>HOM_ITER_STARTING_POINT_1</source>
- <translation>First iteration of the case.</translation>
- </message>
- <message>
- <source>HOM_ITER_STARTING_POINT_2</source>
- <translation>First iteration of the case for the pursuit.</translation>
- </message>
- <message>
- <source>HOM_ITER_EDIT_WINDOW_TITLE</source>
- <translation>Edition of an iteration</translation>
- </message>
- <message>
- <source>HOM_HYPO_NAME</source>
- <translation>The hypothesis must be named.</translation>
- </message>
- <message>
- <source>HOM_HYPO_FIELD_FILE</source>
- <translation>A file for the field must be given.</translation>
- </message>
- <message>
- <source>HOM_HYPO_ZONE_1</source>
- <translation>A zone must be selected.</translation>
- </message>
- <message>
- <source>HOM_HYPO_ZONE_2</source>
- <translation>At least, one zone must be selected.</translation>
- </message>
- <message>
- <source>HOM_HYPO_ZONE_3</source>
- <translation>Either refinement or coarsening, but not both.</translation>
- </message>
- <message>
- <source>HOM_HYPO_NORM_L2</source>
- <translation>L2 norm</translation>
- </message>
- <message>
- <source>HOM_HYPO_NORM_INF</source>
- <translation>Infinite norm</translation>
- </message>
- <message>
- <source>HOM_HYPO_NORM_ABS</source>
- <translation>Absolute</translation>
- </message>
- <message>
- <source>HOM_HYPO_NORM_REL</source>
- <translation>Relative</translation>
- </message>
- <message>
- <source>HOM_HYPO_COMP</source>
- <translation>At least, one component must be selected.</translation>
- </message>
- <message>
- <source>HOM_HYPO_EDIT_WINDOW_TITLE</source>
- <translation>Edition of a hypothesis</translation>
- </message>
- <message>
- <source>HOM_ZONE_NAME</source>
- <translation>The zone must be named.</translation>
- </message>
- <message>
- <source>HOM_ZONE_LIMIT</source>
- <translation>%1 maxi must be greater than %1 mini.</translation>
- </message>
- <message>
- <source>HOM_ZONE_RAYON</source>
- <translation>The external radius must be greater than the internal radius.</translation>
- </message>
- <message>
- <source>HOM_ZONE_EDIT_WINDOW_TITLE</source>
- <translation>Edition of a zone</translation>
- </message>
- <message>
- <source>HOM_BOUN_NAME</source>
- <translation>The boundary must be named.</translation>
- </message>
- <message>
- <source>HOM_BOUN_MESH</source>
- <translation>The file for the mesh of the boundary must be selected.</translation>
- </message>
- <message>
- <source>HOM_BOUN_CAO</source>
- <translation>The file for the CAO must be selected.</translation>
- </message>
- <message>
- <source>HOM_BOUN_CASE</source>
- <translation>The meshfile of the case is unknown.</translation>
- </message>
- <message>
- <source>HOM_AXE</source>
- <translation>The axis must be a non 0 vector.</translation>
- </message>
- <message>
- <source>HOM_BOUN_C_EDIT_WINDOW_TITLE</source>
- <translation>Edition of a CAO based boundary</translation>
- </message>
- <message>
- <source>HOM_BOUN_A_EDIT_WINDOW_TITLE</source>
- <translation>Edition of an analytical boundary</translation>
- </message>
- <message>
- <source>HOM_BOUN_D_EDIT_WINDOW_TITLE</source>
- <translation>Edition of a discrete boundary</translation>
- </message>
- <message>
- <source>HOM_GROU_EDIT_WINDOW_TITLE</source>
- <translation>Selected groups</translation>
- </message>
- <message>
- <source>HOM_MESH_INFO_0</source>
- <translation>Mesh analysis</translation>
- </message>
- <message>
- <source>HOM_MESH_INFO_1</source>
- <translation>Select at least one option.</translation>
- </message>
- <message>
- <source>HOM_MESH_INFO_2</source>
- <translation>Analysis in the object browser, file </translation>
- </message>
- <message>
- <source>HOM_YACS_EDIT_WINDOW_TITLE</source>
- <translation>Edition of a schema YACS</translation>
- </message>
-</context>
-</TS>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="fr_FR">
-<context>
- <name>@default</name>
- <message>
- <source>HOM_MEN_HOMARD</source>
- <translation>HOMARD</translation>
- </message>
- <message>
- <source>HOM_MEN_MODIFICATION</source>
- <translation>Modification</translation>
- </message>
- <message>
- <source>HOM_MEN_INFORMATION</source>
- <translation>Information</translation>
- </message>
- <message>
- <source>HOM_MEN_YACS</source>
- <translation>YACS</translation>
- </message>
- <message>
- <source>HOM_MEN_NEW_CASE</source>
- <translation>Nouveau cas</translation>
- </message>
- <message>
- <source>HOM_MEN_NEW_ITERATION</source>
- <translation>Itération suivante</translation>
- </message>
- <message>
- <source>HOM_MEN_PURSUE_ITERATION</source>
- <translation>Cas de poursuite d'une itération</translation>
- </message>
- <message>
- <source>HOM_MEN_COMPUTE</source>
- <translation>Calculer</translation>
- </message>
- <message>
- <source>HOM_MEN_COMPUTE_PUBLISH</source>
- <translation>Calculer et publier</translation>
- </message>
- <message>
- <source>HOM_MEN_EDIT</source>
- <translation>Editer</translation>
- </message>
- <message>
- <source>HOM_MEN_DELETE</source>
- <translation>Supprimer</translation>
- </message>
- <message>
- <source>HOM_MEN_MESH_INFO</source>
- <translation>Analyse de maillage</translation>
- </message>
- <message>
- <source>HOM_MEN_MESH_PUBLICATION</source>
- <translation>Publication du maillage</translation>
- </message>
- <message>
- <source>HOM_MEN_EDIT_MESS_FILE</source>
- <translation>Afficher le fichier</translation>
- </message>
- <message>
- <source>HOM_MEN_WRITE</source>
- <translation>Ecrire</translation>
- </message>
- <message>
- <source>HOM_TOP_HOMARD</source>
- <translation>HOMARD</translation>
- </message>
- <message>
- <source>HOM_TOP_NEW_CASE</source>
- <translation>Nouveau cas</translation>
- </message>
- <message>
- <source>HOM_TOP_NEW_ITERATION</source>
- <translation>Itération suivante</translation>
- </message>
- <message>
- <source>HOM_TOP_PURSUE_ITERATION</source>
- <translation>Cas de poursuite d'une itération</translation>
- </message>
- <message>
- <source>HOM_TOP_COMPUTE</source>
- <translation>Calculer</translation>
- </message>
- <message>
- <source>HOM_TOP_COMPUTE_PUBLISH</source>
- <translation>Calculer et publier</translation>
- </message>
- <message>
- <source>HOM_TOP_EDIT</source>
- <translation>Editer</translation>
- </message>
- <message>
- <source>HOM_TOP_DELETE</source>
- <translation>Supprimer</translation>
- </message>
- <message>
- <source>HOM_TOP_EDIT_MESS_FILE</source>
- <translation>Afficher le fichier</translation>
- </message>
- <message>
- <source>HOM_STB_HOMARD</source>
- <translation>HOMARD</translation>
- </message>
- <message>
- <source>HOM_STB_NEW_CASE</source>
- <translation>Nouveau cas</translation>
- </message>
- <message>
- <source>HOM_STB_NEW_ITERATION</source>
- <translation>Itération suivante</translation>
- </message>
- <message>
- <source>HOM_STB_PURSUE_ITERATION</source>
- <translation>Cas de poursuite d'une itération</translation>
- </message>
- <message>
- <source>HOM_STB_COMPUTE</source>
- <translation>Calculer</translation>
- </message>
- <message>
- <source>HOM_STB_COMPUTE_PUBLISH</source>
- <translation>Calculer et publier</translation>
- </message>
- <message>
- <source>HOM_STB_EDIT</source>
- <translation>Editer</translation>
- </message>
- <message>
- <source>HOM_STB_DELETE</source>
- <translation>Supprimer</translation>
- </message>
- <message>
- <source>HOM_STB_EDIT_MESS_FILE</source>
- <translation>Afficher le fichier</translation>
- </message>
- <message>
- <source>HOM_WARNING</source>
- <translation>Avertissement</translation>
- </message>
- <message>
- <source>HOM_ERROR</source>
- <translation>Erreur</translation>
- </message>
- <message>
- <source>HOM_INACTIVE_BUTTON</source>
- <translation>Bouton inactif</translation>
- </message>
- <message>
- <source>OK</source>
- <translation>Appliquer et fermer</translation>
- </message>
- <message>
- <source>Apply</source>
- <translation>Appliquer</translation>
- </message>
- <message>
- <source>Cancel</source>
- <translation>Annuler</translation>
- </message>
- <message>
- <source>Help</source>
- <translation>Aide</translation>
- </message>
- <message>
- <source>New</source>
- <translation>Nouveau</translation>
- </message>
- <message>
- <source>Edit</source>
- <translation>Editer</translation>
- </message>
- <message>
- <source>Quit</source>
- <translation>Quitter</translation>
- </message>
- <message>
- <source>Name</source>
- <translation>Nom</translation>
- </message>
- <message>
- <source>Directory</source>
- <translation>Répertoire</translation>
- </message>
- <message>
- <source>Mesh</source>
- <translation>Maillage</translation>
- </message>
- <message>
- <source>Selection</source>
- <translation>Sélection</translation>
- </message>
- <message>
- <source>None</source>
- <translation>Aucun</translation>
- </message>
- <message>
- <source>All</source>
- <translation>Tout</translation>
- </message>
- <message>
- <source>HOM_SELECT_OBJECT_1</source>
- <translation>Sélectionner un objet.</translation>
- </message>
- <message>
- <source>HOM_SELECT_OBJECT_2</source>
- <translation>Sélectionner un seul objet.</translation>
- </message>
- <message>
- <source>HOM_SELECT_OBJECT_3</source>
- <translation>Sélectionner un objet de type %1.</translation>
- </message>
- <message>
- <source>HOM_SELECT_OBJECT_4</source>
- <translation>Le nom est déjà choisi. Modifiez le ou annulez la saisie.</translation>
- </message>
- <message>
- <source>HOM_SELECT_FILE_0</source>
- <translation>Choix de fichier</translation>
- </message>
- <message>
- <source>HOM_SELECT_FILE_1</source>
- <translation>Sélectionner un fichier.</translation>
- </message>
- <message>
- <source>HOM_SELECT_FILE_2</source>
- <translation>Sélectionner un seul fichier.</translation>
- </message>
- <message>
- <source>HOM_SELECT_FILE_3</source>
- <translation>Impossible d'ouvrir ce fichier.</translation>
- </message>
- <message>
- <source>HOM_SCRIPT_FILE</source>
- <translation>Il faut donner un fichier pour le script python.</translation>
- </message>
- <message>
- <source>HOM_MED_FILE_1</source>
- <translation>Ce fichier MED est illisible.</translation>
- </message>
- <message>
- <source>HOM_MED_FILE_2</source>
- <translation>Ce fichier MED ne contient aucun maillage.</translation>
- </message>
- <message>
- <source>HOM_MED_FILE_3</source>
- <translation>Ce fichier MED contient plus d'un maillage.</translation>
- </message>
- <message>
- <source>HOM_MED_FILE_4</source>
- <translation>Impossible de lire le maillage de ce fichier MED.</translation>
- </message>
- <message>
- <source>HOM_MED_FILE_5</source>
- <translation>Ce fichier MED ne contient aucun champ.</translation>
- </message>
- <message>
- <source>HOM_MED_FILE_6</source>
- <translation>Impossible de lire le(s) champ(s) de ce fichier MED.</translation>
- </message>
- <message>
- <source>HOM_SELECT_STUDY</source>
- <translation>Sélectionner une étude avec un fichier MED associé\n ou sélectionner un fichier MED.</translation>
- </message>
- <message>
- <source>Create a case</source>
- <translation>Création d'un cas</translation>
- </message>
- <message>
- <source>HOM_CASE_NAME</source>
- <translation>Il faut donner un nom au cas.</translation>
- </message>
- <message>
- <source>HOM_CASE_DIRECTORY_1</source>
- <translation>Il faut choisir un répertoire de travail pour le cas.</translation>
- </message>
- <message>
- <source>HOM_CASE_DIRECTORY_2</source>
- <translation>Ce répertoire est déjà utilisé par le cas </translation>
- </message>
- <message>
- <source>HOM_CASE_DIRECTORY_3</source>
- <translation>Un répertoire valide doit être choisi.</translation>
- </message>
- <message>
- <source>HOM_CASE_DIRECTORY_4</source>
- <translation>Il faut choisir un répertoire de travail pour le calcul.</translation>
- </message>
- <message>
- <source>HOM_START_DIRECTORY_1</source>
- <translation>Il faut choisir un répertoire contenant l'itération à poursuivre.</translation>
- </message>
- <message>
- <source>HOM_START_DIRECTORY_3</source>
- <translation>Un répertoire valide contenant l'itération à poursuivre doit être choisi.</translation>
- </message>
- <message>
- <source>HOM_CASE_MESH</source>
- <translation>Il faut choisir le maillage initial.</translation>
- </message>
- <message>
- <source>HOM_CASE_GROUP</source>
- <translation>Le groupe "%1" ne peut pas être attribué à plus d'une frontière.</translation>
- </message>
- <message>
- <source>HOM_CASE_EDIT_WINDOW_TITLE</source>
- <translation>Edition d'un cas</translation>
- </message>
- <message>
- <source>HOM_CASE_EDIT_STATE_0</source>
- <translation>Maillage initial.</translation>
- </message>
- <message>
- <source>HOM_CASE_EDIT_STATE</source>
- <translation>Poursuite d'une itération.</translation>
- </message>
- <message>
- <source>HOM_CASE_PURSUE_WINDOW_TITLE</source>
- <translation>Cas de poursuite d'une itération</translation>
- </message>
- <message>
- <source>The configuration file cannot be found.</source>
- <translation>Le fichier de configuration de HOMARD est introuvable.</translation>
- </message>
- <message>
- <source>The configuration file cannot be read.</source>
- <translation>Le fichier de configuration de HOMARD est illisible.</translation>
- </message>
- <message>
- <source>The HOMARD mesh file cannot be found.</source>
- <translation>Le fichier de maillage de HOMARD est introuvable.</translation>
- </message>
- <message>
- <source>HOM_ITER_NAME</source>
- <translation>Il faut donner un nom à l'itération.</translation>
- </message>
- <message>
- <source>HOM_ITER_STARTING_POINT</source>
- <translation>Il faut désigner l'itération précédente.</translation>
- </message>
- <message>
- <source>HOM_ITER_MESH</source>
- <translation>Donner le nom du maillage final.</translation>
- </message>
- <message>
- <source>HOM_ITER_HYPO</source>
- <translation>Choisir une hypothèse.</translation>
- </message>
- <message>
- <source>HOM_ITER_FIELD_FILE</source>
- <translation>Avec cette hypothèse, il faut fournir le fichier du champ.</translation>
- </message>
- <message>
- <source>HOM_ITER_STARTING_POINT_0</source>
- <translation>Maillage</translation>
- </message>
- <message>
- <source>HOM_ITER_STARTING_POINT_1</source>
- <translation>Itération initiale du cas.</translation>
- </message>
- <message>
- <source>HOM_ITER_STARTING_POINT_2</source>
- <translation>Itération initiale du cas pour la poursuite.</translation>
- </message>
- <message>
- <source>HOM_ITER_EDIT_WINDOW_TITLE</source>
- <translation>Edition d'une itération</translation>
- </message>
- <message>
- <source>Boundary type</source>
- <translation>Type de frontière</translation>
- </message>
- <message>
- <source>No boundary</source>
- <translation>Pas de frontière</translation>
- </message>
- <message>
- <source>Non CAO</source>
- <translation>Autre que CAO</translation>
- </message>
- <message>
- <source>Discrete boundary</source>
- <translation>Frontière discrète</translation>
- </message>
- <message>
- <source>Analytical boundary</source>
- <translation>Frontière analytique</translation>
- </message>
- <message>
- <source>Conformity type</source>
- <translation>Type de conformité</translation>
- </message>
- <message>
- <source>Conformal</source>
- <translation>Conforme</translation>
- </message>
- <message>
- <source>Non conformal</source>
- <translation>Non conforme</translation>
- </message>
- <message>
- <source>Non conformal option</source>
- <translation>Option de non conformité</translation>
- </message>
- <message>
- <source>Conformity +</source>
- <translation>Conformité +</translation>
- </message>
- <message>
- <source>Free</source>
- <translation>Libre</translation>
- </message>
- <message>
- <source>1 hanging node per mesh</source>
- <translation>1 noeud pendant par maille</translation>
- </message>
- <message>
- <source>1 node per edge</source>
- <translation>1 noeud pendant par arête</translation>
- </message>
- <message>
- <source>Advanced options</source>
- <translation>Options avancées</translation>
- </message>
- <message>
- <source>Authorized pyramids</source>
- <translation>Pyramides autorisées</translation>
- </message>
- <message>
- <source>Minimal diameter</source>
- <translation>Diamètre minimal</translation>
- </message>
- <message>
- <source>Initialization of adaptation</source>
- <translation>Initialisation de l'adaptation</translation>
- </message>
- <message>
- <source>Maximal level</source>
- <translation>Niveau maximal</translation>
- </message>
- <message>
- <source>Output of the level of refinement</source>
- <translation>Sortie du niveau de raffinement</translation>
- </message>
- <message>
- <source>Output of the qualities</source>
- <translation>Sortie des qualités</translation>
- </message>
- <message>
- <source>Output of the diameters</source>
- <translation>Sortie des diamètres</translation>
- </message>
- <message>
- <source>Output of the parents</source>
- <translation>Sortie des parents</translation>
- </message>
- <message>
- <source>Output of the neighbours</source>
- <translation>Sortie des voisins</translation>
- </message>
- <message>
- <source>Create an iteration</source>
- <translation>Création d'une itération</translation>
- </message>
- <message>
- <source>Iteration Name</source>
- <translation>Nom de l'itération</translation>
- </message>
- <message>
- <source>Previous iteration</source>
- <translation>Itération précédente</translation>
- </message>
- <message>
- <source>Invalid boundary</source>
- <translation>Frontière non valable</translation>
- </message>
- <message>
- <source>Invalid case</source>
- <translation>Cas non valable</translation>
- </message>
- <message>
- <source>Invalid case context</source>
- <translation>Cas contextuel non valable</translation>
- </message>
- <message>
- <source>Invalid hypothesis</source>
- <translation>Hypothèse non valable</translation>
- </message>
- <message>
- <source>Invalid iteration</source>
- <translation>Itération non valable</translation>
- </message>
- <message>
- <source>Invalid zone</source>
- <translation>Zone non valable</translation>
- </message>
- <message>
- <source>This boundary has already been defined.</source>
- <translation>Cette frontière est déjà définie.</translation>
- </message>
- <message>
- <source>This case has already been defined.</source>
- <translation>Ce cas est déjà défini.</translation>
- </message>
- <message>
- <source>This hypothesis has already been defined.</source>
- <translation>Cette hypothèse est déjà définie.</translation>
- </message>
- <message>
- <source>This iteration has already been defined.</source>
- <translation>Cette itération est déjà définie.</translation>
- </message>
- <message>
- <source>This zone has already been defined.</source>
- <translation>Cette zone est déjà définie.</translation>
- </message>
- <message>
- <source>The parent iteration is not defined.</source>
- <translation>L'itération parent n'est pas définie.</translation>
- </message>
- <message>
- <source>Unable to create the iteration.</source>
- <translation>Impossible de créer l'itération.</translation>
- </message>
- <message>
- <source>The directory for the computation cannot be created.</source>
- <translation>Impossible de créer le répertoire pour le calcul de l'itération.</translation>
- </message>
- <message>
- <source>This iteration is the first of the case and cannot be computed.</source>
- <translation>Cette itération définit le point de départ du cas. Elle ne peut pas être calculée.</translation>
- </message>
- <message>
- <source>This iteration does not have any associated hypothesis.</source>
- <translation>Cette itération n'est associée à aucune hypothèse.</translation>
- </message>
- <message>
- <source>The mesh file does not exist.</source>
- <translation>Le fichier du maillage n'existe pas.</translation>
- </message>
- <message>
- <source>The mesh file cannot be deleted.</source>
- <translation>Impossible de supprimer le fichier du maillage.</translation>
- </message>
- <message>
- <source>Mesh n</source>
- <translation>Maillage n</translation>
- </message>
- <message>
- <source>Mesh n+1</source>
- <translation>Maillage n+1</translation>
- </message>
- <message>
- <source>Field information</source>
- <translation>Information sur les champs</translation>
- </message>
- <message>
- <source>Field file</source>
- <translation>Fichier des champs</translation>
- </message>
- <message>
- <source>No time step</source>
- <translation>Sans pas de temps</translation>
- </message>
- <message>
- <source>Last time step</source>
- <translation>Dernier pas de temps</translation>
- </message>
- <message>
- <source>Chosen time step</source>
- <translation>Pas de temps choisi</translation>
- </message>
- <message>
- <source>Time step</source>
- <translation>Pas de temps</translation>
- </message>
- <message>
- <source>Rank</source>
- <translation>Numéro d'ordre</translation>
- </message>
- <message>
- <source>Hypothesis</source>
- <translation>Hypothèse</translation>
- </message>
- <message>
- <source>Create a hypothesis</source>
- <translation>Création d'une hypothèse</translation>
- </message>
- <message>
- <source>HOM_HYPO_NAME</source>
- <translation>Il faut donner un nom à l'hypothèse.</translation>
- </message>
- <message>
- <source>HOM_HYPO_FIELD_FILE</source>
- <translation>Il faut fournir le fichier du champ.</translation>
- </message>
- <message>
- <source>HOM_HYPO_ZONE_1</source>
- <translation>Choisir une zone.</translation>
- </message>
- <message>
- <source>HOM_HYPO_ZONE_2</source>
- <translation>Il faut choisir au moins une zone.</translation>
- </message>
- <message>
- <source>HOM_HYPO_ZONE_3</source>
- <translation>Raffinement ou déraffinement, mais pas les deux.</translation>
- </message>
- <message>
- <source>HOM_HYPO_NORM_L2</source>
- <translation>Norme L2</translation>
- </message>
- <message>
- <source>HOM_HYPO_NORM_INF</source>
- <translation>Norme infinie</translation>
- </message>
- <message>
- <source>HOM_HYPO_NORM_ABS</source>
- <translation>Absolu</translation>
- </message>
- <message>
- <source>HOM_HYPO_NORM_REL</source>
- <translation>Relatif</translation>
- </message>
- <message>
- <source>HOM_HYPO_COMP</source>
- <translation>Il faut choisir au moins une composante.</translation>
- </message>
- <message>
- <source>HOM_HYPO_EDIT_WINDOW_TITLE</source>
- <translation>Edition d'une hypothèse</translation>
- </message>
- <message>
- <source>Type of adaptation</source>
- <translation>Type d'adaptation</translation>
- </message>
- <message>
- <source>Uniform</source>
- <translation>Uniforme</translation>
- </message>
- <message>
- <source>Driven by a field</source>
- <translation>Pilotage par un champ</translation>
- </message>
- <message>
- <source>With geometrical zones</source>
- <translation>Selon des zones géométriques</translation>
- </message>
- <message>
- <source>Uniform adaptation</source>
- <translation>Adaptation uniforme</translation>
- </message>
- <message>
- <source>Coarsening</source>
- <translation>Déraffinement</translation>
- </message>
- <message>
- <source>Refinement</source>
- <translation>Raffinement</translation>
- </message>
- <message>
- <source>Nothing</source>
- <translation>Rien</translation>
- </message>
- <message>
- <source>File of the fields</source>
- <translation>Fichier des champs</translation>
- </message>
- <message>
- <source>Governing field for the adaptation</source>
- <translation>Champ pilotant l'adaptation</translation>
- </message>
- <message>
- <source>Field name</source>
- <translation>Nom du champ</translation>
- </message>
- <message>
- <source>Jump between elements</source>
- <translation>Saut entre éléments</translation>
- </message>
- <message>
- <source>Component</source>
- <translation>Composante</translation>
- </message>
- <message>
- <source>Refinement threshold</source>
- <translation>Seuil de raffinement</translation>
- </message>
- <message>
- <source>Coarsening threshold</source>
- <translation>Seuil de déraffinement</translation>
- </message>
- <message>
- <source>Percentage of meshes</source>
- <translation>Pourcentage de mailles</translation>
- </message>
- <message>
- <source>Mean + n*(std deviation)</source>
- <translation>Moyenne + n*(ecart-type)</translation>
- </message>
- <message>
- <source>No refinement</source>
- <translation>Sans raffinement</translation>
- </message>
- <message>
- <source>Mean - n*(std deviation)</source>
- <translation>Moyenne - n*(ecart-type)</translation>
- </message>
- <message>
- <source>No coarsening</source>
- <translation>Sans déraffinement</translation>
- </message>
- <message>
- <source>Zone management</source>
- <translation>Gestion des zones</translation>
- </message>
- <message>
- <source>Zone name</source>
- <translation>Nom de la zone</translation>
- </message>
- <message>
- <source>Field Interpolation</source>
- <translation>Interpolation des champs</translation>
- </message>
- <message>
- <source>Chosen</source>
- <translation>Choisi</translation>
- </message>
- <message>
- <source>Create a zone</source>
- <translation>Création d'une zone</translation>
- </message>
- <message>
- <source>HOM_ZONE_NAME</source>
- <translation>Il faut donner un nom à la zone.</translation>
- </message>
- <message>
- <source>HOM_ZONE_LIMIT</source>
- <translation>%1 maxi doit être plus grand que %1 mini.</translation>
- </message>
- <message>
- <source>HOM_ZONE_RAYON</source>
- <translation>Le rayon externe doit être supérieur au rayon interne.</translation>
- </message>
- <message>
- <source>HOM_ZONE_EDIT_WINDOW_TITLE</source>
- <translation>Edition d'une zone</translation>
- </message>
- <message>
- <source>Type of zone</source>
- <translation>Type de la zone</translation>
- </message>
- <message>
- <source>Box</source>
- <translation>Boîte</translation>
- </message>
- <message>
- <source>Sphere</source>
- <translation>Sphère</translation>
- </message>
- <message>
- <source>Cylinder</source>
- <translation>Cylindre</translation>
- </message>
- <message>
- <source>Disk</source>
- <translation>Disque</translation>
- </message>
- <message>
- <source>Disk with hole</source>
- <translation>Disque avec trou</translation>
- </message>
- <message>
- <source>Pipe</source>
- <translation>Tuyau</translation>
- </message>
- <message>
- <source>Coordinates</source>
- <translation>Coordonnées</translation>
- </message>
- <message>
- <source>Get CAO</source>
- <translation>Acquisition de la CAO</translation>
- </message>
- <message>
- <source>Create an analytical boundary</source>
- <translation>Création d'une frontière analytique</translation>
- </message>
- <message>
- <source>Create a discrete boundary</source>
- <translation>Création d'une frontière discrète</translation>
- </message>
- <message>
- <source>Type of boundary</source>
- <translation>Type de la frontière</translation>
- </message>
- <message>
- <source>Torus</source>
- <translation>Tore</translation>
- </message>
- <message>
- <source>Radius</source>
- <translation>Rayon</translation>
- </message>
- <message>
- <source>Radius 1</source>
- <translation>Rayon 1</translation>
- </message>
- <message>
- <source>Radius 2</source>
- <translation>Rayon 2</translation>
- </message>
- <message>
- <source>External radius</source>
- <translation>Rayon externe</translation>
- </message>
- <message>
- <source>Internal radius</source>
- <translation>Rayon interne</translation>
- </message>
- <message>
- <source>Height</source>
- <translation>Hauteur</translation>
- </message>
- <message>
- <source>X axis</source>
- <translation>X axe</translation>
- </message>
- <message>
- <source>Y axis</source>
- <translation>Y axe</translation>
- </message>
- <message>
- <source>Z axis</source>
- <translation>Z axe</translation>
- </message>
- <message>
- <source>R revolution</source>
- <translation>R révolution</translation>
- </message>
- <message>
- <source>Primary R</source>
- <translation>R primaire</translation>
- </message>
- <message>
- <source>HOM_BOUN_NAME</source>
- <translation>Il faut donner un nom à la frontière.</translation>
- </message>
- <message>
- <source>HOM_BOUN_MESH</source>
- <translation>Il faut choisir le fichier qui contient le maillage de la frontière discrète.</translation>
- </message>
- <message>
- <source>HOM_BOUN_CAO</source>
- <translation>Il faut choisir le fichier qui contient la CAO.</translation>
- </message>
- <message>
- <source>HOM_BOUN_CASE</source>
- <translation>Le fichier du maillage du cas est inconnu.</translation>
- </message>
- <message>
- <source>HOM_AXE</source>
- <translation>L'axe doit être un vecteur non nul.</translation>
- </message>
- <message>
- <source>HOM_BOUN_C_EDIT_WINDOW_TITLE</source>
- <translation>Edition d'une frontière basée sur une CAO</translation>
- </message>
- <message>
- <source>HOM_BOUN_A_EDIT_WINDOW_TITLE</source>
- <translation>Edition d'une frontière analytique</translation>
- </message>
- <message>
- <source>HOM_BOUN_D_EDIT_WINDOW_TITLE</source>
- <translation>Edition d'une frontière discrète</translation>
- </message>
- <message>
- <source>HOM_GROU_EDIT_WINDOW_TITLE</source>
- <translation>Groupes choisis</translation>
- </message>
- <message>
- <source>The height must be positive.</source>
- <translation>La hauteur doit être positive.</translation>
- </message>
- <message>
- <source>The radius must be positive.</source>
- <translation>Un rayon doit être positif.</translation>
- </message>
- <message>
- <source>The axis must be a non 0 vector.</source>
- <translation>L'axe doit être un vecteur non nul.</translation>
- </message>
- <message>
- <source>The angle must be included higher than 0 degree and lower than 90 degrees.</source>
- <translation>L'angle doit être compris entre 0 et 90 degrés.</translation>
- </message>
- <message>
- <source>The radius must be different.</source>
- <translation>Les rayons doivent être différents.</translation>
- </message>
- <message>
- <source>The centers must be different.</source>
- <translation>Les centres doivent être différents.</translation>
- </message>
- <message>
- <source>The external radius must be higher than the internal radius.</source>
- <translation>Le rayon externe doit être supérieur au rayon interne.</translation>
- </message>
- <message>
- <source>The X coordinates are not coherent.</source>
- <translation>Les coordonnées en X ne sont pas cohérentes.</translation>
- </message>
- <message>
- <source>The Y coordinates are not coherent.</source>
- <translation>Les coordonnées en Y ne sont pas cohérentes.</translation>
- </message>
- <message>
- <source>The Z coordinates are not coherent.</source>
- <translation>Les coordonnées en Z ne sont pas cohérentes.</translation>
- </message>
- <message>
- <source>The first coordinates are not coherent.</source>
- <translation>Les premières coordonnées ne sont pas cohérentes.</translation>
- </message>
- <message>
- <source>The second coordinates are not coherent.</source>
- <translation>Les secondes coordonnées ne sont pas cohérentes.</translation>
- </message>
- <message>
- <source>The orientation must be 1, 2 or 3.</source>
- <translation>L'orientation vaut 1, 2 ou 3.</translation>
- </message>
- <message>
- <source>HOM_MESH_INFO_0</source>
- <translation>Analyse de maillage</translation>
- </message>
- <message>
- <source>HOM_MESH_INFO_1</source>
- <translation>Choisir au moins une option.</translation>
- </message>
- <message>
- <source>HOM_MESH_INFO_2</source>
- <translation>Bilan de l'analyse dans l'arbre d'études, fichier </translation>
- </message>
- <message>
- <source>Filtering with groups</source>
- <translation>Filtrage par les groupes</translation>
- </message>
- <message>
- <source>Selection of groups</source>
- <translation>Choix des groupes</translation>
- </message>
- <message>
- <source>Selected groups</source>
- <translation>Groupes choisis</translation>
- </message>
- <message>
- <source>Group</source>
- <translation>Groupe</translation>
- </message>
- <message>
- <source>Information on a mesh</source>
- <translation>Analyse d'un maillage</translation>
- </message>
- <message>
- <source>Group size</source>
- <translation>Taille des domaines</translation>
- </message>
- <message>
- <source>Quality</source>
- <translation>Qualité</translation>
- </message>
- <message>
- <source>Connection</source>
- <translation>Connexité</translation>
- </message>
- <message>
- <source>Diametre</source>
- <translation>Diamètre</translation>
- </message>
- <message>
- <source>Entanglement</source>
- <translation>Interpénétration</translation>
- </message>
- <message>
- <source>No change is allowed in a boundary. Ask for evolution.</source>
- <translation>Impossible de changer une donnée dans une frontière. Demander une évolution.</translation>
- </message>
- <message>
- <source>This boundary is used in a case and cannot be deleted.</source>
- <translation>Cette frontière est utilisée dans un cas ; elle ne peut pas être détruite.</translation>
- </message>
- <message>
- <source>This hypothesis is used and cannot be deleted.</source>
- <translation>Cette hypothèse est utilisée dans une itération ; elle ne peut pas être détruite.</translation>
- </message>
- <message>
- <source>This iteration cannot be deleted.</source>
- <translation>Cette itération ne peut pas être détruite.</translation>
- </message>
- <message>
- <source>This zone is used in a hypothesis and cannot be deleted.</source>
- <translation>Cette zone est utilisée dans une hypothèse ; elle ne peut pas être détruite.</translation>
- </message>
- <message>
- <source>The directory for the calculation cannot be cleared.</source>
- <translation>Menage du repertoire de calcul impossible</translation>
- </message>
- <message>
- <source>Starting point</source>
- <translation>Point de départ</translation>
- </message>
- <message>
- <source>From an iteration</source>
- <translation>A partir d'une itération</translation>
- </message>
- <message>
- <source>From a case</source>
- <translation>A partir d'un cas</translation>
- </message>
- <message>
- <source>Iteration into the case</source>
- <translation>Choix d'une itération dans le cas</translation>
- </message>
- <message>
- <source>Last iteration</source>
- <translation>A partir de la dernière itération</translation>
- </message>
- <message>
- <source>Iteration number</source>
- <translation>A partir d'une itération numérotée</translation>
- </message>
- <message>
- <source>The directory of the case does not exist.</source>
- <translation>Le répertoire du cas n'existe pas.</translation>
- </message>
- <message>
- <source>The directory for the case cannot be modified because some iterations are already defined.</source>
- <translation>Impossible de changer le répertoire du cas car des itérations ont déjà été définies.</translation>
- </message>
- <message>
- <source>The directory for the case cannot be reached.</source>
- <translation>Impossible d'atteindre ce répertoire pour le cas.</translation>
- </message>
- <message>
- <source>The starting point for the case cannot be copied into the working directory.</source>
- <translation>Impossible de copier le point de départ du cas dans le répertoire de travail.</translation>
- </message>
- <message>
- <source>The starting point for the case cannot be moved into the new directory.</source>
- <translation>Impossible de déplacer le point de départ du cas dans le nouveau répertoire.</translation>
- </message>
- <message>
- <source>The directory of the case for the pursuit does not exist.</source>
- <translation>Le répertoire du cas de reprise n'existe pas.</translation>
- </message>
- <message>
- <source>The directory of the iteration does not exist.</source>
- <translation>Le répertoire de l'itération de reprise n'existe pas.</translation>
- </message>
- <message>
- <source>The number of iteration must be positive.</source>
- <translation>Le numéro de l'itération doit etre positif.</translation>
- </message>
- <message>
- <source>Number of iteration</source>
- <translation>Numéro de l'itération</translation>
- </message>
- <message>
- <source>Case</source>
- <translation>Cas</translation>
- </message>
- <message>
- <source>Mesh file</source>
- <translation>Maillage initial</translation>
- </message>
- <message>
- <source>Constant</source>
- <translation>Constant</translation>
- </message>
- <message>
- <source>Variable</source>
- <translation>Variable</translation>
- </message>
- <message>
- <source>Type of schema</source>
- <translation>Type de schema</translation>
- </message>
- <message>
- <source>Maximum of ...</source>
- <translation>Maximum de ...</translation>
- </message>
- <message>
- <source>Iterations</source>
- <translation>Itérations</translation>
- </message>
- <message>
- <source>Nodes</source>
- <translation>Noeuds</translation>
- </message>
- <message>
- <source>Elements</source>
- <translation>Eléments</translation>
- </message>
- <message>
- <source>Test of convergence</source>
- <translation>Test de convergence</translation>
- </message>
- <message>
- <source>Edit a file</source>
- <translation>Affichage d'un fichier</translation>
- </message>
- <message>
- <source>Print</source>
- <translation>Imprimer</translation>
- </message>
- <message>
- <source>Invalid study context</source>
- <translation>Etude contextuelle non valable</translation>
- </message>
- <message>
- <source>HOM_YACS_EDIT_WINDOW_TITLE</source>
- <translation>Edition d'un schéma YACS</translation>
- </message>
-</context>
-</TS>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="ja" sourcelanguage="en">
- <context>
- <name>@default</name>
- <message>
- <source>HOM_MEN_HOMARD</source>
- <translation>ロブスター</translation>
- </message>
- <message>
- <source>HOM_MEN_MODIFICATION</source>
- <translation>変更</translation>
- </message>
- <message>
- <source>HOM_MEN_INFORMATION</source>
- <translation>情報</translation>
- </message>
- <message>
- <source>HOM_MEN_YACS</source>
- <translation>YACS</translation>
- </message>
- <message>
- <source>HOM_MEN_NEW_CASE</source>
- <translation>新しいケース</translation>
- </message>
- <message>
- <source>HOM_MEN_NEW_ITERATION</source>
- <translation>新しいイテレーション</translation>
- </message>
- <message>
- <source>HOM_MEN_PURSUE_ITERATION</source>
- <translation>イテレーションの追跡</translation>
- </message>
- <message>
- <source>HOM_MEN_COMPUTE</source>
- <translation>計算します。</translation>
- </message>
- <message>
- <source>HOM_MEN_COMPUTE_PUBLISH</source>
- <translation>計算と発行</translation>
- </message>
- <message>
- <source>HOM_MEN_EDIT</source>
- <translation>編集(&E)</translation>
- </message>
- <message>
- <source>HOM_MEN_DELETE</source>
- <translation>削除</translation>
- </message>
- <message>
- <source>HOM_MEN_MESH_INFO</source>
- <translation>メッシュの解析</translation>
- </message>
- <message>
- <source>HOM_MEN_MESH_PUBLICATION</source>
- <translation>メッシュ発行</translation>
- </message>
- <message>
- <source>HOM_MEN_EDIT_MESS_FILE</source>
- <translation>ファイルを表示します。</translation>
- </message>
- <message>
- <source>HOM_MEN_WRITE</source>
- <translation>書き込み</translation>
- </message>
- <message>
- <source>HOM_TOP_HOMARD</source>
- <translation>ロブスター</translation>
- </message>
- <message>
- <source>HOM_TOP_NEW_CASE</source>
- <translation>新しいケース</translation>
- </message>
- <message>
- <source>HOM_TOP_NEW_ITERATION</source>
- <translation>新しいイテレーション</translation>
- </message>
- <message>
- <source>HOM_TOP_PURSUE_ITERATION</source>
- <translation>イテレーションの追跡</translation>
- </message>
- <message>
- <source>HOM_TOP_COMPUTE</source>
- <translation>計算します。</translation>
- </message>
- <message>
- <source>HOM_TOP_COMPUTE_PUBLISH</source>
- <translation>計算と発行</translation>
- </message>
- <message>
- <source>HOM_TOP_EDIT</source>
- <translation>編集</translation>
- </message>
- <message>
- <source>HOM_TOP_DELETE</source>
- <translation>削除</translation>
- </message>
- <message>
- <source>HOM_TOP_EDIT_MESS_FILE</source>
- <translation>ファイルを表示します。</translation>
- </message>
- <message>
- <source>HOM_STB_HOMARD</source>
- <translation>ロブスター</translation>
- </message>
- <message>
- <source>HOM_STB_NEW_CASE</source>
- <translation>新しいケース</translation>
- </message>
- <message>
- <source>HOM_STB_NEW_ITERATION</source>
- <translation>新しいイテレーション</translation>
- </message>
- <message>
- <source>HOM_STB_PURSUE_ITERATION</source>
- <translation>イテレーションの追跡</translation>
- </message>
- <message>
- <source>HOM_STB_COMPUTE</source>
- <translation>計算</translation>
- </message>
- <message>
- <source>HOM_STB_COMPUTE_PUBLISH</source>
- <translation>計算と発行</translation>
- </message>
- <message>
- <source>HOM_STB_EDIT</source>
- <translation>編集</translation>
- </message>
- <message>
- <source>HOM_STB_DELETE</source>
- <translation>削除</translation>
- </message>
- <message>
- <source>HOM_STB_EDIT_MESS_FILE</source>
- <translation>ファイルを表示します。</translation>
- </message>
- <message>
- <source>HOM_WARNING</source>
- <translation>警告</translation>
- </message>
- <message>
- <source>HOM_ERROR</source>
- <translation>エラー</translation>
- </message>
- <message>
- <source>HOM_INACTIVE_BUTTON</source>
- <translation>アクティブでないボタン</translation>
- </message>
- <message>
- <source>OK</source>
- <translation>Ok</translation>
- </message>
- <message>
- <source>Apply</source>
- <translation>適用</translation>
- </message>
- <message>
- <source>Cancel</source>
- <translation>キャンセル</translation>
- </message>
- <message>
- <source>Help</source>
- <translation>ヘルプ</translation>
- </message>
- <message>
- <source>New</source>
- <translation>新規</translation>
- </message>
- <message>
- <source>Edit</source>
- <translation>編集</translation>
- </message>
- <message>
- <source>Quit</source>
- <translation>終了</translation>
- </message>
- <message>
- <source>Name</source>
- <translation>名前</translation>
- </message>
- <message>
- <source>Directory</source>
- <translation>ディレクトリ</translation>
- </message>
- <message>
- <source>Mesh</source>
- <translation>メッシュ</translation>
- </message>
- <message>
- <source>Selection</source>
- <translation>選択</translation>
- </message>
- <message>
- <source>None</source>
- <translation>なし</translation>
- </message>
- <message>
- <source>All</source>
- <translation>全て</translation>
- </message>
- <message>
- <source>HOM_SELECT_OBJECT_1</source>
- <translation>オブジェクトを選択します。</translation>
- </message>
- <message>
- <source>HOM_SELECT_OBJECT_2</source>
- <translation>1 つのオブジェクトを選択します。</translation>
- </message>
- <message>
- <source>HOM_SELECT_OBJECT_3</source>
- <translation>型 %1 のオブジェクトを選択します。</translation>
- </message>
- <message>
- <source>HOM_SELECT_OBJECT_4</source>
- <translation>The name of the object is already selected. Modify it or cancel.</translation>
- </message>
- <message>
- <source>HOM_SELECT_FILE_0</source>
- <translation>ファイル選択</translation>
- </message>
- <message>
- <source>HOM_SELECT_FILE_1</source>
- <translation>ファイルを選択します。</translation>
- </message>
- <message>
- <source>HOM_SELECT_FILE_2</source>
- <translation>1 つのファイルを選択します。</translation>
- </message>
- <message>
- <source>HOM_SELECT_FILE_3</source>
- <translation>このファイルを開くことができません。</translation>
- </message>
- <message>
- <source>HOM_SCRIPT_FILE</source>
- <translation>我々 は python スクリプトにファイルを与える必要があります。</translation>
- </message>
- <message>
- <source>HOM_MED_FILE_1</source>
- <translation>この医学ファイルは読み取り不可能です。</translation>
- </message>
- <message>
- <source>HOM_MED_FILE_2</source>
- <translation>この医学のファイルには、メッシュが含まれていません。</translation>
- </message>
- <message>
- <source>HOM_MED_FILE_3</source>
- <translation>この医学のファイルにはよりも 1 つのメッシュが含まれています。</translation>
- </message>
- <message>
- <source>HOM_MED_FILE_4</source>
- <translation>音楽配信マック & ファイルのメッシュを読み取れませんでした。</translation>
- </message>
- <message>
- <source>HOM_MED_FILE_5</source>
- <translation>この医学のファイルには、フィールドが含まれていません。</translation>
- </message>
- <message>
- <source>HOM_MED_FILE_6</source>
- <translation>医学ファイル (秒) (秒) フィールドを読み取ることができません。</translation>
- </message>
- <message>
- <source>HOM_SELECT_STUDY</source>
- <translation>研究医 associe
- のファイルを選択または医学ファイルを選択します。</translation>
- </message>
- <message>
- <source>Create a case</source>
- <translation>ケースの作成</translation>
- </message>
- <message>
- <source>HOM_CASE_NAME</source>
- <translation>場合に名前を付ける必要があります。</translation>
- </message>
- <message>
- <source>HOM_CASE_DIRECTORY_1</source>
- <translation>1 つの場合を動作するようにディレクトリを選択する必要があります。</translation>
- </message>
- <message>
- <source>HOM_CASE_DIRECTORY_2</source>
- <translation>このディレクトリは、既に使用中です。</translation>
- </message>
- <message>
- <source>HOM_CASE_DIRECTORY_3</source>
- <translation>有効なディレクトリを選択する必要があります。</translation>
- </message>
- <message>
- <source>HOM_CASE_DIRECTORY_4</source>
- <translation>計算のための作業ディレクトリを選択する必要があります。</translation>
- </message>
- <message>
- <source>HOM_START_DIRECTORY_1</source>
- <translation>追跡のため開始点を選択する必要があります。</translation>
- </message>
- <message>
- <source>HOM_START_DIRECTORY_3</source>
- <translation>追跡のため有効な方向を選択する必要があります。</translation>
- </message>
- <message>
- <source>HOM_CASE_MESH</source>
- <translation>1 つは、初期のメッシュを選択する必要があります。</translation>
- </message>
- <message>
- <source>HOM_CASE_GROUP</source>
- <translation>グループ"%1"は、以上の境界線に割り当てることはできません。</translation>
- </message>
- <message>
- <source>HOM_CASE_EDIT_WINDOW_TITLE</source>
- <translation>場合の編集</translation>
- </message>
- <message>
- <source>HOM_CASE_EDIT_STATE_0</source>
- <translation>初期メッシュ。</translation>
- </message>
- <message>
- <source>HOM_CASE_EDIT_STATE</source>
- <translation>イテレーションの継続。</translation>
- </message>
- <message>
- <source>HOM_CASE_PURSUE_WINDOW_TITLE</source>
- <translation>イテレーションの追跡</translation>
- </message>
- <message>
- <source>The configuration file cannot be found.</source>
- <translation>コンフィギュレーションファイルが見つかりません。</translation>
- </message>
- <message>
- <source>The configuration file cannot be read.</source>
- <translation>コンフィギュレーションファイルが読み込めません。</translation>
- </message>
- <message>
- <source>The HOMARD mesh file cannot be found.</source>
- <translation>HOMARDメッシュファイルが見つかりません。</translation>
- </message>
- <message>
- <source>HOM_ITER_NAME</source>
- <translation>名前を反復処理する必要があります。</translation>
- </message>
- <message>
- <source>HOM_ITER_STARTING_POINT</source>
- <translation>これは、前のイテレーションを指定する必要があります。</translation>
- </message>
- <message>
- <source>HOM_ITER_MESH</source>
- <translation>最終的なメッシュの名前。</translation>
- </message>
- <message>
- <source>HOM_ITER_HYPO</source>
- <translation>仮説を選択します。</translation>
- </message>
- <message>
- <source>HOM_ITER_FIELD_FILE</source>
- <translation>この前提には、ファイルのフィールドを指定する必要があります。</translation>
- </message>
- <message>
- <source>HOM_ITER_STARTING_POINT_0</source>
- <translation>メッシュ</translation>
- </message>
- <message>
- <source>HOM_ITER_STARTING_POINT_1</source>
- <translation>ケースの最初のイテレーションです。</translation>
- </message>
- <message>
- <source>HOM_ITER_STARTING_POINT_2</source>
- <translation>検察側の事件の最初のイテレーションです。</translation>
- </message>
- <message>
- <source>HOM_ITER_EDIT_WINDOW_TITLE</source>
- <translation>イテレーションの編集</translation>
- </message>
- <message>
- <source>Discrete boundary</source>
- <translation>離散境界</translation>
- </message>
- <message>
- <source>Analytical boundary</source>
- <translation>解析的境界</translation>
- </message>
- <message>
- <source>Conformity type</source>
- <translation>適合タイプ</translation>
- </message>
- <message>
- <source>Conformal</source>
- <translation>等角</translation>
- </message>
- <message>
- <source>Non conformal</source>
- <translation>非共形</translation>
- </message>
- <message>
- <source>Non conformal option</source>
- <translation>非共形オプション</translation>
- </message>
- <message>
- <source>Conformity +</source>
- <translation>適合性 +</translation>
- </message>
- <message>
- <source>Free</source>
- <translation>Free</translation>
- </message>
- <message>
- <source>1 hanging node per mesh</source>
- <translation>メッシュあたりの1接続節点</translation>
- </message>
- <message>
- <source>1 node per edge</source>
- <translation>エッジ辺りの1節点</translation>
- </message>
- <message>
- <source>Advanced options</source>
- <translation>詳細オプション</translation>
- </message>
- <message>
- <source>Authorized pyramids</source>
- <translation>認定済みピラミッド</translation>
- </message>
- <message>
- <source>Minimal diameter</source>
- <translation>最小径</translation>
- </message>
- <message>
- <source>Initialization of adaptation</source>
- <translation>適応の初期化</translation>
- </message>
- <message>
- <source>Maximal level</source>
- <translation>最大レベル</translation>
- </message>
- <message>
- <source>Output of the level of refinement</source>
- <translation>リファインレベルの出力</translation>
- </message>
- <message>
- <source>Output of the qualities</source>
- <translation>品質の出力</translation>
- </message>
- <message>
- <source>Output of the diameters</source>
- <translation>直径の出力</translation>
- </message>
- <message>
- <source>Output of the parents</source>
- <translation>親直径の出力</translation>
- </message>
- <message>
- <source>Output of the neighbours</source>
- <translation>隣の直径の出力</translation>
- </message>
- <message>
- <source>Create an iteration</source>
- <translation>イテレーションの作成</translation>
- </message>
- <message>
- <source>Iteration Name</source>
- <translation>イテレーションの名前</translation>
- </message>
- <message>
- <source>Previous iteration</source>
- <translation>以前のイテレーション</translation>
- </message>
- <message>
- <source>Invalid boundary</source>
- <translation>無効な境界</translation>
- </message>
- <message>
- <source>Invalid case</source>
- <translation>無効なケース</translation>
- </message>
- <message>
- <source>Invalid case context</source>
- <translation>ケースの内容が無効です</translation>
- </message>
- <message>
- <source>Invalid hypothesis</source>
- <translation>無効なhypothesis</translation>
- </message>
- <message>
- <source>Invalid iteration</source>
- <translation>無効なイテレーション</translation>
- </message>
- <message>
- <source>Invalid zone</source>
- <translation>無効なゾーン</translation>
- </message>
- <message>
- <source>This boundary has already been defined.</source>
- <translation>この境界は既に定義されています。</translation>
- </message>
- <message>
- <source>This case has already been defined.</source>
- <translation>このケースは既に定義されています。</translation>
- </message>
- <message>
- <source>This hypothesis has already been defined.</source>
- <translation>このhypothesisは既に定義されています。</translation>
- </message>
- <message>
- <source>This iteration has already been defined.</source>
- <translation>このイテレーションは既に定義されています。</translation>
- </message>
- <message>
- <source>This zone has already been defined.</source>
- <translation>このゾーンは既に定義されています。</translation>
- </message>
- <message>
- <source>The parent iteration is not defined.</source>
- <translation>親イテレーションは、定義されていません。</translation>
- </message>
- <message>
- <source>Unable to create the iteration.</source>
- <translation>イテレーションを作成することができません。</translation>
- </message>
- <message>
- <source>The directory for the computation cannot be created.</source>
- <translation>計算のためのディレクトリを作成できません。</translation>
- </message>
- <message>
- <source>This iteration is the first of the case and cannot be computed.</source>
- <translation>このイタレーションはケースの最初であり、計算できません。</translation>
- </message>
- <message>
- <source>This iteration does not have any associated hypothesis.</source>
- <translation>このイタレーションは関連した hypothesis がありません。</translation>
- </message>
- <message>
- <source>The mesh file does not exist.</source>
- <translation>メッシュ ファイルは存在しません。</translation>
- </message>
- <message>
- <source>The mesh file cannot be deleted.</source>
- <translation>メッシュ ファイルを削除できません。</translation>
- </message>
- <message>
- <source>Mesh n</source>
- <translation>メッシュ n</translation>
- </message>
- <message>
- <source>Mesh n+1</source>
- <translation>メッシュ n + 1</translation>
- </message>
- <message>
- <source>Field information</source>
- <translation>フィールド情報</translation>
- </message>
- <message>
- <source>Field file</source>
- <translation>フィールド ファイル</translation>
- </message>
- <message>
- <source>No time step</source>
- <translation>タイムステップなし</translation>
- </message>
- <message>
- <source>Last time step</source>
- <translation>最終タイムステップ</translation>
- </message>
- <message>
- <source>Chosen time step</source>
- <translation>選択されたタイムステップ</translation>
- </message>
- <message>
- <source>Time step</source>
- <translation>タイムステップ</translation>
- </message>
- <message>
- <source>Rank</source>
- <translation>ランク</translation>
- </message>
- <message>
- <source>Hypothesis</source>
- <translation>Hypothesis</translation>
- </message>
- <message>
- <source>Create a hypothesis</source>
- <translation>hypothesis の作成</translation>
- </message>
- <message>
- <source>HOM_HYPO_NAME</source>
- <translation>仮説に名前を付ける必要があります。</translation>
- </message>
- <message>
- <source>HOM_HYPO_FIELD_FILE</source>
- <translation>それはフィールドのファイルを提供する必要があります。</translation>
- </message>
- <message>
- <source>HOM_HYPO_ZONE_1</source>
- <translation>ゾーンを選択します。</translation>
- </message>
- <message>
- <source>HOM_HYPO_ZONE_2</source>
- <translation>1 つは、少なくとも 1 つのゾーンを選択する必要があります。</translation>
- </message>
- <message>
- <source>HOM_HYPO_ZONE_3</source>
- <translation>洗練された、または deraffinement、両方ではないです。</translation>
- </message>
- <message>
- <source>HOM_HYPO_NORM_L2</source>
- <translation>標準の L2</translation>
- </message>
- <message>
- <source>HOM_HYPO_NORM_INF</source>
- <translation>無限の標準</translation>
- </message>
- <message>
- <source>HOM_HYPO_NORM_ABS</source>
- <translation>絶対値</translation>
- </message>
- <message>
- <source>HOM_HYPO_NORM_REL</source>
- <translation>関係</translation>
- </message>
- <message>
- <source>HOM_HYPO_COMP</source>
- <translation>1 つ以上のコンポーネントを選択する必要があります。</translation>
- </message>
- <message>
- <source>HOM_HYPO_EDIT_WINDOW_TITLE</source>
- <translation>仮説の編集</translation>
- </message>
- <message>
- <source>Type of adaptation</source>
- <translation>適合のタイプ</translation>
- </message>
- <message>
- <source>Uniform</source>
- <translation>均一</translation>
- </message>
- <message>
- <source>Driven by a field</source>
- <translation>フィールドによって駆動</translation>
- </message>
- <message>
- <source>With geometrical zones</source>
- <translation>幾何学的ゾーン使用</translation>
- </message>
- <message>
- <source>Uniform adaptation</source>
- <translation>均一な適応</translation>
- </message>
- <message>
- <source>Coarsening</source>
- <translation>粗大化</translation>
- </message>
- <message>
- <source>Refinement</source>
- <translation>リファインメント</translation>
- </message>
- <message>
- <source>Nothing</source>
- <translation>なし</translation>
- </message>
- <message>
- <source>File of the fields</source>
- <translation>フィールドファイル</translation>
- </message>
- <message>
- <source>Governing field for the adaptation</source>
- <translation>適合のためにフィールドを管理</translation>
- </message>
- <message>
- <source>Field name</source>
- <translation>フィールド名</translation>
- </message>
- <message>
- <source>Jump between elements</source>
- <translation>要素間ジャンプ</translation>
- </message>
- <message>
- <source>Component</source>
- <translation>コンポーネント</translation>
- </message>
- <message>
- <source>Refinement threshold</source>
- <translation>リファインメント閾値</translation>
- </message>
- <message>
- <source>Coarsening threshold</source>
- <translation>粗大化閾値</translation>
- </message>
- <message>
- <source>Percentage of meshes</source>
- <translation>メッシュの割合</translation>
- </message>
- <message>
- <source>Mean + n*(std deviation)</source>
- <translation>平均 + n * (標準偏差)</translation>
- </message>
- <message>
- <source>No refinement</source>
- <translation>リファインメントなし</translation>
- </message>
- <message>
- <source>Mean - n*(std deviation)</source>
- <translation>平均 - n * (標準偏差)</translation>
- </message>
- <message>
- <source>No coarsening</source>
- <translation>粗大化なし</translation>
- </message>
- <message>
- <source>Zone management</source>
- <translation>ゾーン管理</translation>
- </message>
- <message>
- <source>Zone name</source>
- <translation>ゾーン名</translation>
- </message>
- <message>
- <source>Field Interpolation</source>
- <translation>フィールド補間</translation>
- </message>
- <message>
- <source>Chosen</source>
- <translation>選択済み</translation>
- </message>
- <message>
- <source>Create a zone</source>
- <translation>ゾーンの作成</translation>
- </message>
- <message>
- <source>HOM_ZONE_NAME</source>
- <translation>領域に名前を必要があります。</translation>
- </message>
- <message>
- <source>HOM_ZONE_LIMIT</source>
- <translation>最大 %1 は %1 のミニよりも大きい必要があります。</translation>
- </message>
- <message>
- <source>HOM_ZONE_RAYON</source>
- <translation>外側の半径は、内側の半径よりも大きい必要があります。</translation>
- </message>
- <message>
- <source>HOM_ZONE_EDIT_WINDOW_TITLE</source>
- <translation>領域の編集</translation>
- </message>
- <message>
- <source>Type of zone</source>
- <translation>ゾーンのタイプ</translation>
- </message>
- <message>
- <source>Box</source>
- <translation>Box</translation>
- </message>
- <message>
- <source>Sphere</source>
- <translation>球</translation>
- </message>
- <message>
- <source>Cylinder</source>
- <translation>円筒</translation>
- </message>
- <message>
- <source>Disk</source>
- <translation>円盤</translation>
- </message>
- <message>
- <source>Disk with hole</source>
- <translation>穴付き円盤</translation>
- </message>
- <message>
- <source>Pipe</source>
- <translation>パイプ</translation>
- </message>
- <message>
- <source>Coordinates</source>
- <translation>座標</translation>
- </message>
- <message>
- <source>Create an analytical boundary</source>
- <translation>分析境界の作成</translation>
- </message>
- <message>
- <source>Create a discrete boundary</source>
- <translation>離散境界の作成</translation>
- </message>
- <message>
- <source>Type of boundary</source>
- <translation>境界のタイプ</translation>
- </message>
- <message>
- <source>Torus</source>
- <translation>環状体</translation>
- </message>
- <message>
- <source>Radius</source>
- <translation>半径</translation>
- </message>
- <message>
- <source>Radius 1</source>
- <translation>半径1</translation>
- </message>
- <message>
- <source>Radius 2</source>
- <translation>半径2</translation>
- </message>
- <message>
- <source>External radius</source>
- <translation>外半径</translation>
- </message>
- <message>
- <source>Internal radius</source>
- <translation>内半径</translation>
- </message>
- <message>
- <source>Height</source>
- <translation>高さ</translation>
- </message>
- <message>
- <source>X axis</source>
- <translation>X 軸</translation>
- </message>
- <message>
- <source>Y axis</source>
- <translation>Y 軸</translation>
- </message>
- <message>
- <source>Z axis</source>
- <translation>Z 軸</translation>
- </message>
- <message>
- <source>R revolution</source>
- <translation>R 回転</translation>
- </message>
- <message>
- <source>Primary R</source>
- <translation>主 R</translation>
- </message>
- <message>
- <source>HOM_BOUN_NAME</source>
- <translation>名前の国境に与えする必要があります。</translation>
- </message>
- <message>
- <source>HOM_BOUN_MESH</source>
- <translation>1 つの枠を含むメッシュを選択する必要があります。</translation>
- </message>
- <message>
- <source>HOM_BOUN_CASE</source>
- <translation>場合ファイルのメッシュが知られています。</translation>
- </message>
- <message>
- <source>HOM_AXE</source>
- <translation>軸は、ゼロ以外のベクトルでなければなりません。</translation>
- </message>
- <message>
- <source>HOM_BOUN_A_EDIT_WINDOW_TITLE</source>
- <translation>分析のフロンティアの編集</translation>
- </message>
- <message>
- <source>HOM_BOUN_D_EDIT_WINDOW_TITLE</source>
- <translation>離散境界の編集</translation>
- </message>
- <message>
- <source>HOM_GROU_EDIT_WINDOW_TITLE</source>
- <translation>選択したグループ</translation>
- </message>
- <message>
- <source>The height must be positive.</source>
- <translation>高さは正でなければなりません。</translation>
- </message>
- <message>
- <source>The radius must be positive.</source>
- <translation>半径は正でなければなりません。</translation>
- </message>
- <message>
- <source>The axis must be a non 0 vector.</source>
- <translation>軸は非 0 のベクトルでなければなりません。</translation>
- </message>
- <message>
- <source>The angle must be included higher than 0 degree and lower than 90 degrees.</source>
- <translation>角度は0 °よりも大きく 90 °未満である必要があります。</translation>
- </message>
- <message>
- <source>The radius must be different.</source>
- <translation>半径が異なる必要があります。</translation>
- </message>
- <message>
- <source>The centers must be different.</source>
- <translation>中心が異なる必要があります。</translation>
- </message>
- <message>
- <source>The external radius must be higher than the internal radius.</source>
- <translation>外部の半径は内部の半径より大きい必要があります。</translation>
- </message>
- <message>
- <source>The X coordinates are not coherent.</source>
- <translation>X座標は論理上問題があります。</translation>
- </message>
- <message>
- <source>The Y coordinates are not coherent.</source>
- <translation>Y座標は論理上問題があります。</translation>
- </message>
- <message>
- <source>The Z coordinates are not coherent.</source>
- <translation>Z座標は論理上問題があります。</translation>
- </message>
- <message>
- <source>The first coordinates are not coherent.</source>
- <translation>最初の座標に論理上問題があります。</translation>
- </message>
- <message>
- <source>The second coordinates are not coherent.</source>
- <translation>2番目の座標に論理上問題があります。</translation>
- </message>
- <message>
- <source>The orientation must be 1, 2 or 3.</source>
- <translation>方向は1、2、3のどれかにする必要があります。</translation>
- </message>
- <message>
- <source>HOM_MESH_INFO_0</source>
- <translation>メッシュの解析</translation>
- </message>
- <message>
- <source>HOM_MESH_INFO_1</source>
- <translation>少なくとも 1 つのオプションを選択します。</translation>
- </message>
- <message>
- <source>HOM_MESH_INFO_2</source>
- <translation>バランス シート分析結果をスタディ ツリーで、ファイル</translation>
- </message>
- <message>
- <source>Filtering with groups</source>
- <translation>グループでフィルタリング</translation>
- </message>
- <message>
- <source>Selection of groups</source>
- <translation>グループの選択</translation>
- </message>
- <message>
- <source>Selected groups</source>
- <translation>選択されたグループ</translation>
- </message>
- <message>
- <source>Group</source>
- <translation>グループ :</translation>
- </message>
- <message>
- <source>Information on a mesh</source>
- <translation>メッシュに関する情報</translation>
- </message>
- <message>
- <source>Group size</source>
- <translation>グループのサイズ</translation>
- </message>
- <message>
- <source>Quality</source>
- <translation>品質</translation>
- </message>
- <message>
- <source>Connection</source>
- <translation>接続</translation>
- </message>
- <message>
- <source>Diametre</source>
- <translation>直径</translation>
- </message>
- <message>
- <source>Entanglement</source>
- <translation>縺れ合い</translation>
- </message>
- <message>
- <source>No change is allowed in a boundary. Ask for evolution.</source>
- <translation>境界内に許可された変更はありません。旋回について尋ねます。</translation>
- </message>
- <message>
- <source>This boundary is used in a case and cannot be deleted.</source>
- <translation>この境界はケースで使用されており、削除できません。</translation>
- </message>
- <message>
- <source>This hypothesis is used and cannot be deleted.</source>
- <translation>このhypothesisは使用されており、削除できません。</translation>
- </message>
- <message>
- <source>This iteration cannot be deleted.</source>
- <translation>このイテレーションは削除できません。</translation>
- </message>
- <message>
- <source>This zone is used in a hypothesis and cannot be deleted.</source>
- <translation>このゾーンはhypothesisで使用されており、削除できません。</translation>
- </message>
- <message>
- <source>The directory for the calculation cannot be cleared.</source>
- <translation>計算用ディレクトリは削除できません。</translation>
- </message>
- <message>
- <source>Starting point</source>
- <translation>始点</translation>
- </message>
- <message>
- <source>From an iteration</source>
- <translation>イテレーションから</translation>
- </message>
- <message>
- <source>From a case</source>
- <translation>ケースから</translation>
- </message>
- <message>
- <source>Iteration into the case</source>
- <translation>ケースへのイテレーション</translation>
- </message>
- <message>
- <source>Last iteration</source>
- <translation>最後のイテレーション</translation>
- </message>
- <message>
- <source>Iteration number</source>
- <translation>イテレーション数</translation>
- </message>
- <message>
- <source>The directory of the case does not exist.</source>
- <translation>ケースのディレクトリは存在しません。</translation>
- </message>
- <message>
- <source>The directory for the case cannot be modified because some iterations are already defined.</source>
- <translation>いくつかのイテレーションが既に定義されているため、ケースのディレクトリを変更できません。</translation>
- </message>
- <message>
- <source>The directory for the case cannot be reached.</source>
- <translation>ケースのディレクトリに到達できません。</translation>
- </message>
- <message>
- <source>The starting point for the case cannot be copied into the working directory.</source>
- <translation>ケースの開始点は作業ディレクトリにコピーできません。</translation>
- </message>
- <message>
- <source>The starting point for the case cannot be moved into the new directory.</source>
- <translation>ケースの開始点は新しいディレクトリに移動できません。</translation>
- </message>
- <message>
- <source>The directory of the case for the pursuit does not exist.</source>
- <translation>追跡用ケースのディレクトリは存在しません。</translation>
- </message>
- <message>
- <source>The directory of the iteration does not exist.</source>
- <translation>イテレーションのディレクトリが存在しません。</translation>
- </message>
- <message>
- <source>The number of iteration must be positive.</source>
- <translation>イテレーション数は正である必要があります。</translation>
- </message>
- <message>
- <source>Number of iteration</source>
- <translation>イテレーション数</translation>
- </message>
- <message>
- <source>Case</source>
- <translation>ケース</translation>
- </message>
- <message>
- <source>Mesh file</source>
- <translation>メッシュファイル</translation>
- </message>
- <message>
- <source>Constant</source>
- <translation>定数</translation>
- </message>
- <message>
- <source>Variable</source>
- <translation>変数</translation>
- </message>
- <message>
- <source>Type of schema</source>
- <translation>スキーマタイプ</translation>
- </message>
- <message>
- <source>Maximum of ...</source>
- <translation>最大の...</translation>
- </message>
- <message>
- <source>Iterations</source>
- <translation>イテレーション</translation>
- </message>
- <message>
- <source>Nodes</source>
- <translation>節点</translation>
- </message>
- <message>
- <source>Elements</source>
- <translation>要素</translation>
- </message>
- <message>
- <source>Test of convergence</source>
- <translation>収束テスト</translation>
- </message>
- <message>
- <source>Edit a file</source>
- <translation>ファイルの編集</translation>
- </message>
- <message>
- <source>Print</source>
- <translation>印刷</translation>
- </message>
- <message>
- <source>Invalid study context</source>
- <translation>無効なスタディの内容</translation>
- </message>
- <message>
- <source>HOM_YACS_EDIT_WINDOW_TITLE</source>
- <translation>YACS スキーマ編集スキーマへんしゅう</translation>
- </message>
- <message>
- <source>PREF_TAB_GENERAL</source>
- <translation>一般的な</translation>
- </message>
- <message>
- <source>PREF_PUBLICATION</source>
- <translation>発行</translation>
- </message>
- <message>
- <source>PREF_PUBLICATION_MAILLAGE_IN</source>
- <translation>メッシュ入力</translation>
- </message>
- <message>
- <source>PREF_PUBLICATION_MAILLAGE_OUT</source>
- <translation>メッシュ出力</translation>
- </message>
- <message>
- <source>PREF_YACS</source>
- <translation>YACS</translation>
- </message>
- <message>
- <source>PREF_YACS_MAX</source>
- <translation>最大の数</translation>
- </message>
- <message>
- <source>PREF_YACS_MAX_ITER</source>
- <translation>繰り返し</translation>
- </message>
- <message>
- <source>PREF_YACS_MAX_NODE</source>
- <translation>節点</translation>
- </message>
- <message>
- <source>PREF_YACS_MAX_ELEM</source>
- <translation>要素</translation>
- </message>
- <message>
- <source>PREF_YACS_CONVERGENCE</source>
- <translation>収束</translation>
- </message>
- <message>
- <source>PREF_YACS_TYPE_TEST</source>
- <translation>テストタイプ</translation>
- </message>
- </context>
-</TS>
+++ /dev/null
-# 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}")
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>CreateBoundaryAn</class>
- <widget class="QDialog" name="CreateBoundaryAn">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>522</width>
- <height>835</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Create an analytical boundary</string>
- </property>
- <property name="autoFillBackground">
- <bool>true</bool>
- </property>
- <property name="sizeGripEnabled">
- <bool>true</bool>
- </property>
- <layout class="QGridLayout" name="gridLayout_5">
- <item row="0" column="0">
- <widget class="QLabel" name="Name">
- <property name="text">
- <string>Name</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="LEName">
- <property name="maxLength">
- <number>32</number>
- </property>
- </widget>
- </item>
- <item row="1" column="0" colspan="2">
- <widget class="QGroupBox" name="TypeBoundary">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>340</width>
- <height>0</height>
- </size>
- </property>
- <property name="title">
- <string>Type of boundary</string>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QRadioButton" name="RBCylindre">
- <property name="text">
- <string>Cylinder</string>
- </property>
- <property name="icon">
- <iconset>
- <normaloff>../../resources/cylinderpointvector.png</normaloff>../../resources/cylinderpointvector.png</iconset>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QRadioButton" name="RBSphere">
- <property name="text">
- <string>Sphere</string>
- </property>
- <property name="icon">
- <iconset>
- <normaloff>../../resources/zone_spherepoint.png</normaloff>../../resources/zone_spherepoint.png</iconset>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QRadioButton" name="RBCone">
- <property name="text">
- <string>Cone</string>
- </property>
- <property name="icon">
- <iconset>
- <normaloff>../../resources/cone.png</normaloff>../../resources/cone.png</iconset>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QRadioButton" name="RBTore">
- <property name="text">
- <string>Torus</string>
- </property>
- <property name="icon">
- <iconset>
- <normaloff>../../resources/toruspointvector.png</normaloff>../../resources/toruspointvector.png</iconset>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="2" column="0" colspan="2">
- <widget class="QGroupBox" name="gBCylindre">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title">
- <string>Coordinates</string>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Xcent">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="TLXcent">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>X centre</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="3" column="1" colspan="2">
- <widget class="QDoubleSpinBox" name="SpinBox_Radius">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="maximum">
- <double>1000000000.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Zcent">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="TLradius">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Radius</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="TLZcent">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Z centre</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="TLYcent">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Y centre</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Ycent">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QLabel" name="TLXaxis">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>X axis</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QLabel" name="TLYaxis">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Y axis</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="2">
- <widget class="QLabel" name="TLZaxis">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Z axis</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="3">
- <widget class="QDoubleSpinBox" name="SpinBox_Zaxis">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="1" column="3">
- <widget class="QDoubleSpinBox" name="SpinBox_Yaxis">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QDoubleSpinBox" name="SpinBox_Xaxis">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="3" column="0" colspan="2">
- <widget class="QGroupBox" name="gBSphere">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title">
- <string>Coordinates</string>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="1" column="3">
- <widget class="QDoubleSpinBox" name="SpinBox_Rayon">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>0.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Zcentre">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QLabel" name="TLRayon">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Radius</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="TLZcentre">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Z centre</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="TLYcentre">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Y centre</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Ycentre">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Xcentre">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="TLXcentre">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>X centre</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="4" column="0" colspan="2">
- <widget class="QGroupBox" name="gBCone">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title">
- <string>Coordinates</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_3">
- <item row="0" column="0" colspan="2">
- <widget class="QGroupBox" name="groupBox">
- <property name="title">
- <string>Definition</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0">
- <widget class="QRadioButton" name="RB_Def_radius">
- <property name="text">
- <string>Radius</string>
- </property>
- <property name="icon">
- <iconset>
- <normaloff>../../resources/conedxyz.png</normaloff>../../resources/conedxyz.png</iconset>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QRadioButton" name="RB_Def_angle">
- <property name="text">
- <string>Angle</string>
- </property>
- <property name="icon">
- <iconset>
- <normaloff>../../resources/conepointvector.png</normaloff>../../resources/conepointvector.png</iconset>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="TLCone_X1">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>X 1</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Cone_X1">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QLabel" name="TLCone_X2">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>X 2</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="3">
- <widget class="QDoubleSpinBox" name="SpinBox_Cone_X2">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="TLCone_Y1">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Y 1</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Cone_Y1">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="2" column="2">
- <widget class="QLabel" name="TLCone_Y2">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Y 2</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="3">
- <widget class="QDoubleSpinBox" name="SpinBox_Cone_Y2">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="TLCone_Z1">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Z 1</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Cone_Z1">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="3" column="2">
- <widget class="QLabel" name="TLCone_Z2">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Z 2</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="3" column="3">
- <widget class="QDoubleSpinBox" name="SpinBox_Cone_Z2">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="4" column="0">
- <widget class="QLabel" name="TLCone_V1">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>V 1</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="4" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Cone_V1">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="maximum">
- <double>1000000000.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="4" column="2">
- <widget class="QLabel" name="TLCone_V2">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>V 2</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="4" column="3">
- <widget class="QDoubleSpinBox" name="SpinBox_Cone_V2">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="maximum">
- <double>1000000000.000000000000000</double>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="5" column="0" colspan="2">
- <widget class="QGroupBox" name="gBTore">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title">
- <string>Coordinates</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_4">
- <item row="0" column="0">
- <widget class="QLabel" name="TLToreXcent">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>X centre</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QDoubleSpinBox" name="SpinBoxToreXcent">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QLabel" name="TLToreXaxe">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>X axis</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QDoubleSpinBox" name="SpinBoxToreXaxe">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="TLToreYcent">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Y centre</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QDoubleSpinBox" name="SpinBoxToreYcent">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QLabel" name="TLToreYaxe">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Y axis</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="3">
- <widget class="QDoubleSpinBox" name="SpinBoxToreYaxe">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="TLToreZcent">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Z centre</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QDoubleSpinBox" name="SpinBoxToreZcent">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="2" column="2">
- <widget class="QLabel" name="TLToreZaxe">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Z axis</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="3">
- <widget class="QDoubleSpinBox" name="SpinBoxToreZaxe">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="TLToreRayRev">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>R revolution</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QDoubleSpinBox" name="SpinBoxToreRRev">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="maximum">
- <double>1000000000.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="3" column="2">
- <widget class="QLabel" name="TLToreRayPri">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Primary R</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="3" column="3">
- <widget class="QDoubleSpinBox" name="SpinBoxToreRPri">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="maximum">
- <double>1000000000.000000000000000</double>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="6" column="0" colspan="2">
- <widget class="QGroupBox" name="GBButtons">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title">
- <string/>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="3">
- <widget class="QPushButton" name="buttonHelp">
- <property name="text">
- <string>Help</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QPushButton" name="buttonCancel">
- <property name="text">
- <string>Cancel</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QPushButton" name="buttonApply">
- <property name="text">
- <string>Apply</string>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QPushButton" name="buttonOk">
- <property name="text">
- <string>OK</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>CreateBoundaryCAO</class>
- <widget class="QDialog" name="CreateBoundaryCAO">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>566</width>
- <height>195</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="windowTitle">
- <string>Get CAO</string>
- </property>
- <property name="autoFillBackground">
- <bool>true</bool>
- </property>
- <property name="sizeGripEnabled">
- <bool>true</bool>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="3" column="0" colspan="3">
- <widget class="QGroupBox" name="GBButtons">
- <property name="title">
- <string/>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="3">
- <widget class="QPushButton" name="buttonHelp">
- <property name="text">
- <string>Help</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QPushButton" name="buttonCancel">
- <property name="text">
- <string>Cancel</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QPushButton" name="buttonApply">
- <property name="text">
- <string>Apply</string>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QPushButton" name="buttonOk">
- <property name="text">
- <string>OK</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="2" column="0" colspan="3">
- <widget class="QCheckBox" name="CBGroupe">
- <property name="text">
- <string>Filtering with groups</string>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QLineEdit" name="LEFileName">
- <property name="minimumSize">
- <size>
- <width>370</width>
- <height>21</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QPushButton" name="PushFichier">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="XAO">
- <property name="text">
- <string>XAO</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1" colspan="2">
- <widget class="QLineEdit" name="LEName">
- <property name="minimumSize">
- <size>
- <width>382</width>
- <height>21</height>
- </size>
- </property>
- <property name="maxLength">
- <number>32</number>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="Name">
- <property name="text">
- <string>Name</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>CreateBoundaryDi</class>
- <widget class="QDialog" name="CreateBoundaryDi">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>566</width>
- <height>169</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="windowTitle">
- <string>Create a discrete boundary</string>
- </property>
- <property name="autoFillBackground">
- <bool>true</bool>
- </property>
- <property name="sizeGripEnabled">
- <bool>true</bool>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="3" column="0" colspan="3">
- <widget class="QGroupBox" name="GBButtons">
- <property name="title">
- <string/>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="3">
- <widget class="QPushButton" name="buttonHelp">
- <property name="text">
- <string>Help</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QPushButton" name="buttonCancel">
- <property name="text">
- <string>Cancel</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QPushButton" name="buttonApply">
- <property name="text">
- <string>Apply</string>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QPushButton" name="buttonOk">
- <property name="text">
- <string>OK</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="2" column="0" colspan="3">
- <widget class="QCheckBox" name="CBGroupe">
- <property name="text">
- <string>Filtering with groups</string>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QLineEdit" name="LEFileName">
- <property name="minimumSize">
- <size>
- <width>370</width>
- <height>21</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QPushButton" name="PushFichier">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="Mesh">
- <property name="text">
- <string>Mesh</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1" colspan="2">
- <widget class="QLineEdit" name="LEName">
- <property name="minimumSize">
- <size>
- <width>382</width>
- <height>21</height>
- </size>
- </property>
- <property name="maxLength">
- <number>32</number>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="Name">
- <property name="text">
- <string>Name</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>CreateCase</class>
- <widget class="QDialog" name="CreateCase">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>600</width>
- <height>1150</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>600</width>
- <height>320</height>
- </size>
- </property>
- <property name="sizeIncrement">
- <size>
- <width>1</width>
- <height>1</height>
- </size>
- </property>
- <property name="baseSize">
- <size>
- <width>600</width>
- <height>320</height>
- </size>
- </property>
- <property name="windowTitle">
- <string>Create a case</string>
- </property>
- <property name="autoFillBackground">
- <bool>true</bool>
- </property>
- <layout class="QGridLayout" name="gridLayout_5">
- <item row="0" column="0">
- <widget class="QWidget" name="WName" native="true">
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0">
- <widget class="QLabel" name="Name">
- <property name="text">
- <string>Name</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="LEName"/>
- </item>
- </layout>
- </widget>
- </item>
- <item row="0" column="2" colspan="2">
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>199</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="1" column="0" colspan="5">
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <widget class="QLabel" name="Directory">
- <property name="text">
- <string>Directory</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="PushDir">
- <property name="text">
- <string/>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="LEDirName">
- <property name="minimumSize">
- <size>
- <width>382</width>
- <height>21</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="2" column="4">
- <spacer>
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>18</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="3" column="0" colspan="5">
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <widget class="QLabel" name="Mesh">
- <property name="text">
- <string>Mesh</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="PushFichier">
- <property name="text">
- <string/>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="LEFileName">
- <property name="minimumSize">
- <size>
- <width>382</width>
- <height>21</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="3" column="5">
- <spacer>
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>0</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="4" column="0">
- <widget class="QGroupBox" name="GBTypeConf">
- <property name="title">
- <string>Conformity type</string>
- </property>
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>9</number>
- </property>
- <item>
- <widget class="QRadioButton" name="RBConforme">
- <property name="text">
- <string>Conformal</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="RBNonConforme">
- <property name="text">
- <string>Non conformal</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="5" column="0" colspan="4">
- <widget class="QGroupBox" name="GBTypeBoun">
- <property name="title">
- <string>Boundary type</string>
- </property>
- <layout class="QHBoxLayout" name="_3">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>9</number>
- </property>
- <item>
- <widget class="QRadioButton" name="RBBoundaryNo">
- <property name="text">
- <string>No boundary</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="RBBoundaryCAO">
- <property name="text">
- <string>CAO</string>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="RBBoundaryNonCAO">
- <property name="text">
- <string>Non CAO</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="5" column="6">
- <spacer>
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>1</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="6" column="0" colspan="3">
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <widget class="QCheckBox" name="CBBoundaryD">
- <property name="text">
- <string>Discrete boundary</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="CBBoundaryA">
- <property name="text">
- <string>Analytical boundary</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="7" column="0" colspan="2">
- <widget class="QGroupBox" name="GBBoundaryC">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title">
- <string>CAO</string>
- </property>
- <layout class="QGridLayout" name="_2">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="3">
- <widget class="QPushButton" name="PBBoundaryCAOEdit">
- <property name="text">
- <string>Edit</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="4">
- <widget class="QPushButton" name="PBBoundaryCAOHelp">
- <property name="text">
- <string>Help</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QComboBox" name="CBBoundaryCAO">
- <property name="currentIndex">
- <number>-1</number>
- </property>
- <property name="sizeAdjustPolicy">
- <enum>QComboBox::AdjustToContents</enum>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <spacer>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>13</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="0" column="2">
- <widget class="QPushButton" name="PBBoundaryCAONew">
- <property name="text">
- <string>New</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="7" column="2">
- <spacer>
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>2</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="8" column="0" colspan="4">
- <widget class="QGroupBox" name="GBBoundaryD">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title">
- <string>Discrete boundary</string>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="0">
- <widget class="QComboBox" name="CBBoundaryDi">
- <property name="currentIndex">
- <number>-1</number>
- </property>
- <property name="sizeAdjustPolicy">
- <enum>QComboBox::AdjustToContents</enum>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <spacer>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>13</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="0" column="3">
- <widget class="QPushButton" name="PBBoundaryDiEdit">
- <property name="text">
- <string>Edit</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="4">
- <widget class="QPushButton" name="PBBoundaryDiHelp">
- <property name="text">
- <string>Help</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QPushButton" name="PBBoundaryDiNew">
- <property name="text">
- <string>New</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="9" column="0" colspan="7">
- <widget class="QGroupBox" name="GBBoundaryA">
- <property name="minimumSize">
- <size>
- <width>548</width>
- <height>200</height>
- </size>
- </property>
- <property name="title">
- <string>Analytical boundary</string>
- </property>
- <layout class="QFormLayout" name="formLayout">
- <item row="0" column="0">
- <widget class="QTableWidget" name="TWBoundary">
- <property name="editTriggers">
- <set>QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked</set>
- </property>
- <property name="showGrid">
- <bool>true</bool>
- </property>
- <property name="rowCount">
- <number>0</number>
- </property>
- <property name="columnCount">
- <number>1</number>
- </property>
- <column>
- <property name="text">
- <string>a_virer</string>
- </property>
- </column>
- </widget>
- </item>
- <item row="0" column="1">
- <layout class="QGridLayout">
- <property name="margin">
- <number>0</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="1" column="0">
- <widget class="QPushButton" name="PBBoundaryAnEdit">
- <property name="text">
- <string>Edit</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QPushButton" name="PBBoundaryAnNew">
- <property name="text">
- <string>New</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QPushButton" name="PBBoundaryAnHelp">
- <property name="text">
- <string>Help</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item row="10" column="0">
- <spacer name="spacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>239</width>
- <height>41</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="11" column="0">
- <widget class="QCheckBox" name="CBAdvanced">
- <property name="text">
- <string>Advanced options</string>
- </property>
- </widget>
- </item>
- <item row="12" column="0" colspan="3">
- <widget class="QGroupBox" name="GBAdvancedOptions">
- <property name="title">
- <string>Advanced options</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_4">
- <item row="0" column="0">
- <widget class="QCheckBox" name="CBPyramid">
- <property name="text">
- <string>Authorized pyramids</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QGroupBox" name="GBConforme">
- <property name="title">
- <string>Conformity +</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_3">
- <item row="0" column="0">
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <widget class="QRadioButton" name="RBStandard">
- <property name="text">
- <string>Standard</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="RBBox">
- <property name="text">
- <string>Box</string>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="RBNC1NpA">
- <property name="text">
- <string>1 node per edge</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="RBNCQuelconque">
- <property name="text">
- <string>Free</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="1" column="0">
- <widget class="QGroupBox" name="GBFormat">
- <property name="title">
- <string>Format</string>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QRadioButton" name="RBMED">
- <property name="text">
- <string>MED</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QRadioButton" name="RBSaturne">
- <property name="text">
- <string>Saturne</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QRadioButton" name="RBSaturne2D">
- <property name="text">
- <string>Saturne 2D</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="12" column="4" colspan="3">
- <spacer name="spacer_3">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>128</width>
- <height>13</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="13" column="0">
- <spacer name="spacer_4">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>239</width>
- <height>41</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="14" column="0">
- <widget class="QLabel" name="Comment">
- <property name="text">
- <string> No comment.</string>
- </property>
- </widget>
- </item>
- <item row="14" column="1">
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>35</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="15" column="0" colspan="2">
- <widget class="QGroupBox" name="GroupButtons">
- <property name="title">
- <string/>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="4">
- <widget class="QPushButton" name="buttonHelp">
- <property name="text">
- <string>Help</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QPushButton" name="buttonApply">
- <property name="text">
- <string>Apply</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QPushButton" name="buttonOk">
- <property name="text">
- <string>OK</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QPushButton" name="buttonCancel">
- <property name="text">
- <string>Cancel</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="15" column="3" colspan="2">
- <spacer name="spacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>128</width>
- <height>25</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- <zorder>WName</zorder>
- <zorder>GBTypeConf</zorder>
- <zorder>GBBoundaryD</zorder>
- <zorder>GBBoundaryA</zorder>
- <zorder>CBAdvanced</zorder>
- <zorder>GBAdvancedOptions</zorder>
- <zorder>Comment</zorder>
- <zorder>GroupButtons</zorder>
- <zorder>GBBoundaryC</zorder>
- <zorder>GBTypeBoun</zorder>
- </widget>
- <resources/>
- <connections/>
-</ui>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>CreateHypothesis</class>
- <widget class="QScrollArea" name="CreateHypothesis">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>848</width>
- <height>1650</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>800</width>
- <height>600</height>
- </size>
- </property>
- <property name="sizeIncrement">
- <size>
- <width>1</width>
- <height>1</height>
- </size>
- </property>
- <property name="baseSize">
- <size>
- <width>800</width>
- <height>1200</height>
- </size>
- </property>
- <property name="windowTitle">
- <string>Create a hypothesis</string>
- </property>
- <property name="widgetResizable">
- <bool>true</bool>
- </property>
- <widget class="QWidget" name="scrollAreaWidgetContents">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>844</width>
- <height>1646</height>
- </rect>
- </property>
- <property name="sizeGripEnabled" stdset="0">
- <bool>true</bool>
- </property>
- <layout class="QGridLayout" name="gridLayout_5">
- <item row="0" column="0">
- <widget class="QWidget" name="WName" native="true">
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="Name">
- <property name="text">
- <string>Name</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="LEName">
- <property name="minimumSize">
- <size>
- <width>282</width>
- <height>31</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="0" column="1">
- <spacer name="horizontalSpacer_9">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>224</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="1" column="0">
- <widget class="QGroupBox" name="GBTypeAdaptation">
- <property name="title">
- <string>Type of adaptation</string>
- </property>
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>9</number>
- </property>
- <item>
- <widget class="QRadioButton" name="RBUniforme">
- <property name="text">
- <string>Uniform</string>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="RBChamp">
- <property name="text">
- <string>Driven by a field</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="RBZone">
- <property name="text">
- <string>With geometrical zones</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="1" column="2">
- <spacer name="horizontalSpacer_6">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="2" column="0">
- <widget class="QCheckBox" name="CBGroupe">
- <property name="text">
- <string>Filtering with groups</string>
- </property>
- </widget>
- </item>
- <item row="2" column="2">
- <spacer name="horizontalSpacer_8">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="3" column="0">
- <widget class="QGroupBox" name="GBUniform">
- <property name="title">
- <string>Uniform adaptation</string>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="1">
- <widget class="QRadioButton" name="RBUniDera">
- <property name="text">
- <string>Coarsening</string>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QRadioButton" name="RBUniRaff">
- <property name="text">
- <string>Refinement</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="3" column="2">
- <spacer name="horizontalSpacer_7">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="4" column="0">
- <widget class="QGroupBox" name="GBFieldFile">
- <property name="title">
- <string/>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="0">
- <widget class="QLabel" name="FieldFile">
- <property name="text">
- <string>File of the fields</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="LEFieldFile">
- <property name="minimumSize">
- <size>
- <width>282</width>
- <height>31</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="5" column="0" colspan="3">
- <widget class="QGroupBox" name="GBFieldManagement">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title">
- <string>Governing field for the adaptation</string>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="0">
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <widget class="QLabel" name="FieldName">
- <property name="text">
- <string>Field name</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="CBFieldName">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="editable">
- <bool>false</bool>
- </property>
- <property name="sizeAdjustPolicy">
- <enum>QComboBox::AdjustToContents</enum>
- </property>
- </widget>
- </item>
- <item>
- <spacer>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>48</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item row="1" column="0">
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <widget class="QTableWidget" name="TWCMP">
- <property name="editTriggers">
- <set>QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked</set>
- </property>
- <property name="showGrid">
- <bool>true</bool>
- </property>
- <property name="rowCount">
- <number>0</number>
- </property>
- <property name="columnCount">
- <number>2</number>
- </property>
- <column>
- <property name="text">
- <string>Selection</string>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Component</string>
- </property>
- </column>
- </widget>
- </item>
- <item>
- <spacer>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>60</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <layout class="QVBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <widget class="QRadioButton" name="RBL2">
- <property name="text">
- <string>L2 norm</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="RBInf">
- <property name="text">
- <string>Infinite norm</string>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QCheckBox" name="CBJump">
- <property name="text">
- <string>Jump between elements</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </item>
- <item row="2" column="0">
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <widget class="QGroupBox" name="GBRefinementThresholds">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title">
- <string>Refinement threshold</string>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="0">
- <widget class="QRadioButton" name="RBRPE">
- <property name="text">
- <string>Percentage of meshes</string>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_RPE">
- <property name="suffix">
- <string> %</string>
- </property>
- <property name="decimals">
- <number>3</number>
- </property>
- <property name="maximum">
- <double>100.000000000000000</double>
- </property>
- <property name="singleStep">
- <double>0.100000000000000</double>
- </property>
- <property name="value">
- <double>2.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QRadioButton" name="RBRRel">
- <property name="text">
- <string>Relative</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_RRel">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="suffix">
- <string> %</string>
- </property>
- <property name="decimals">
- <number>3</number>
- </property>
- <property name="maximum">
- <double>100.000000000000000</double>
- </property>
- <property name="singleStep">
- <double>0.100000000000000</double>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QRadioButton" name="RBRAbs">
- <property name="text">
- <string>Absolute</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_RAbs">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="decimals">
- <number>8</number>
- </property>
- <property name="minimum">
- <double>-1000000000000.000000000000000</double>
- </property>
- <property name="maximum">
- <double>1000000000000.000000000000000</double>
- </property>
- <property name="singleStep">
- <double>0.100000000000000</double>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QRadioButton" name="RBRMuSigma">
- <property name="text">
- <string>Mean + n*(std deviation)</string>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_RMuSigma">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="decimals">
- <number>8</number>
- </property>
- <property name="minimum">
- <double>-1000000000000.000000000000000</double>
- </property>
- <property name="maximum">
- <double>1000000000000.000000000000000</double>
- </property>
- <property name="singleStep">
- <double>0.100000000000000</double>
- </property>
- <property name="value">
- <double>3.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="4" column="0">
- <widget class="QRadioButton" name="RBRNo">
- <property name="text">
- <string>No refinement</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="GBCoarseningThresholds">
- <property name="title">
- <string>Coarsening threshold</string>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="0">
- <widget class="QRadioButton" name="RBCPE">
- <property name="text">
- <string>Percentage of meshes</string>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_CPE">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="suffix">
- <string> %</string>
- </property>
- <property name="decimals">
- <number>3</number>
- </property>
- <property name="maximum">
- <double>100.000000000000000</double>
- </property>
- <property name="singleStep">
- <double>0.100000000000000</double>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QRadioButton" name="RBCRel">
- <property name="text">
- <string>Relative</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_CRel">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="suffix">
- <string> %</string>
- </property>
- <property name="decimals">
- <number>3</number>
- </property>
- <property name="maximum">
- <double>100.000000000000000</double>
- </property>
- <property name="singleStep">
- <double>0.100000000000000</double>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QRadioButton" name="RBCAbs">
- <property name="text">
- <string>Absolute</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_CAbs">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="decimals">
- <number>8</number>
- </property>
- <property name="minimum">
- <double>-1000000000000.000000000000000</double>
- </property>
- <property name="maximum">
- <double>1000000000000.000000000000000</double>
- </property>
- <property name="singleStep">
- <double>0.100000000000000</double>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QRadioButton" name="RBCMuSigma">
- <property name="text">
- <string>Mean - n*(std deviation)</string>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_CMuSigma">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="decimals">
- <number>8</number>
- </property>
- <property name="minimum">
- <double>-1000000000000.000000000000000</double>
- </property>
- <property name="maximum">
- <double>1000000000000.000000000000000</double>
- </property>
- <property name="singleStep">
- <double>0.100000000000000</double>
- </property>
- <property name="value">
- <double>4.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="4" column="0">
- <widget class="QRadioButton" name="RBCNo">
- <property name="text">
- <string>No coarsening</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item row="6" column="0" colspan="2">
- <widget class="QGroupBox" name="GBAreaManagement">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title">
- <string>Zone management</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_4">
- <item row="0" column="0">
- <widget class="QTableWidget" name="TWZone">
- <property name="minimumSize">
- <size>
- <width>400</width>
- <height>0</height>
- </size>
- </property>
- <property name="editTriggers">
- <set>QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked</set>
- </property>
- <property name="showGrid">
- <bool>true</bool>
- </property>
- <property name="rowCount">
- <number>0</number>
- </property>
- <property name="columnCount">
- <number>3</number>
- </property>
- <column>
- <property name="text">
- <string>Refinement</string>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Coarsening</string>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Zone name</string>
- </property>
- </column>
- </widget>
- </item>
- <item row="0" column="1">
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="0" column="2">
- <layout class="QVBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <layout class="QVBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <widget class="QPushButton" name="PBZoneNew">
- <property name="text">
- <string>New</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="PBZoneEdit">
- <property name="text">
- <string>Edit</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="PBZoneDelete">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <spacer>
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>48</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item row="7" column="0">
- <widget class="QGroupBox" name="GBField">
- <property name="title">
- <string>Field Interpolation</string>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="0">
- <layout class="QGridLayout">
- <property name="margin">
- <number>0</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="0">
- <widget class="QRadioButton" name="RBFieldNo">
- <property name="text">
- <string>None</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QRadioButton" name="RBFieldAll">
- <property name="text">
- <string>All</string>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QRadioButton" name="RBFieldChosen">
- <property name="text">
- <string>Chosen</string>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="1" column="0">
- <widget class="QTableWidget" name="TWField">
- <column>
- <property name="text">
- <string>Selection</string>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Field Name</string>
- </property>
- </column>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="7" column="2">
- <spacer name="horizontalSpacer_5">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="8" column="0">
- <widget class="QCheckBox" name="CBAdvanced">
- <property name="text">
- <string>Advanced options</string>
- </property>
- </widget>
- </item>
- <item row="8" column="2">
- <spacer name="horizontalSpacer_4">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="9" column="0" rowspan="2">
- <widget class="QGroupBox" name="GBAdvancedOptions">
- <property name="title">
- <string>Advanced options</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_3">
- <item row="0" column="0">
- <widget class="QLabel" name="TLMinimalDiameter">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Minimal diameter</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QDoubleSpinBox" name="doubleSpinBoxDiamMin">
- <property name="decimals">
- <number>7</number>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="TLMaximalLevel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Maximal level</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QSpinBox" name="SpinBoxNivMax">
- <property name="value">
- <number>99</number>
- </property>
- </widget>
- </item>
- <item row="2" column="0" colspan="2">
- <widget class="QGroupBox" name="GBAdapInit">
- <property name="title">
- <string>Initialization of adaptation</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0">
- <widget class="QRadioButton" name="RBAIN">
- <property name="text">
- <string>Nothing</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QRadioButton" name="RBAIR">
- <property name="text">
- <string>Refinement</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QRadioButton" name="RBAID">
- <property name="text">
- <string>Coarsening</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QCheckBox" name="CBOutputLevel">
- <property name="text">
- <string>Output of the level of refinement</string>
- </property>
- </widget>
- </item>
- <item row="4" column="0">
- <widget class="QCheckBox" name="CBOutputQuality">
- <property name="text">
- <string>Output of the qualities</string>
- </property>
- </widget>
- </item>
- <item row="5" column="0">
- <widget class="QCheckBox" name="CBOutputDiameter">
- <property name="text">
- <string>Output of the diameters</string>
- </property>
- </widget>
- </item>
- <item row="6" column="0">
- <widget class="QCheckBox" name="CBOutputParent">
- <property name="text">
- <string>Output of the parents</string>
- </property>
- </widget>
- </item>
- <item row="7" column="0">
- <widget class="QCheckBox" name="CBOutputVoisins">
- <property name="text">
- <string>Output of the neighbours</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="9" column="2">
- <spacer name="horizontalSpacer_3">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="10" column="1">
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="11" column="0">
- <widget class="QGroupBox" name="GBButtons">
- <property name="title">
- <string/>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="0">
- <widget class="QPushButton" name="buttonOk">
- <property name="text">
- <string>OK</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QPushButton" name="buttonApply">
- <property name="text">
- <string>Apply</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QPushButton" name="buttonCancel">
- <property name="text">
- <string>Cancel</string>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QPushButton" name="buttonHelp">
- <property name="text">
- <string>Help</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </widget>
- </widget>
- <resources/>
- <connections/>
-</ui>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>CreateIteration</class>
- <widget class="QScrollArea" name="CreateIteration">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>777</width>
- <height>668</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>750</width>
- <height>400</height>
- </size>
- </property>
- <property name="sizeIncrement">
- <size>
- <width>1</width>
- <height>1</height>
- </size>
- </property>
- <property name="baseSize">
- <size>
- <width>750</width>
- <height>400</height>
- </size>
- </property>
- <property name="windowTitle">
- <string>Create an iteration</string>
- </property>
- <property name="widgetResizable">
- <bool>true</bool>
- </property>
- <widget class="QWidget" name="scrollAreaWidgetContents">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>773</width>
- <height>664</height>
- </rect>
- </property>
- <property name="sizeGripEnabled" stdset="0">
- <bool>true</bool>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0" colspan="2">
- <widget class="QLabel" name="Iteration_Name">
- <property name="text">
- <string>Iteration Name</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <spacer name="horizontalSpacer_6">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>117</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="0" column="3" colspan="2">
- <widget class="QLineEdit" name="LEName">
- <property name="minimumSize">
- <size>
- <width>290</width>
- <height>21</height>
- </size>
- </property>
- <property name="maxLength">
- <number>64</number>
- </property>
- </widget>
- </item>
- <item row="0" column="5">
- <spacer name="horizontalSpacer_3">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="1" column="0" colspan="2">
- <widget class="QLabel" name="Iter_Parent">
- <property name="text">
- <string>Previous iteration</string>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QPushButton" name="PBIterParent">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>27</height>
- </size>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="1" column="3" colspan="2">
- <widget class="QLineEdit" name="LEIterationParentName">
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>21</height>
- </size>
- </property>
- <property name="maxLength">
- <number>64</number>
- </property>
- <property name="readOnly">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="Mesh_n">
- <property name="text">
- <string>Mesh n</string>
- </property>
- </widget>
- </item>
- <item row="2" column="2">
- <spacer name="horizontalSpacer_7">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>117</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="2" column="3" colspan="3">
- <widget class="QLineEdit" name="LEMeshName_n">
- <property name="minimumSize">
- <size>
- <width>290</width>
- <height>21</height>
- </size>
- </property>
- <property name="maxLength">
- <number>64</number>
- </property>
- <property name="readOnly">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="6">
- <spacer name="horizontalSpacer_4">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="3" column="0" colspan="2">
- <widget class="QLabel" name="Mesh_np1">
- <property name="text">
- <string>Mesh n+1</string>
- </property>
- </widget>
- </item>
- <item row="3" column="2">
- <spacer name="horizontalSpacer_8">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>117</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="3" column="3" colspan="3">
- <widget class="QLineEdit" name="LEMeshName_np1">
- <property name="minimumSize">
- <size>
- <width>290</width>
- <height>21</height>
- </size>
- </property>
- <property name="maxLength">
- <number>64</number>
- </property>
- </widget>
- </item>
- <item row="3" column="6">
- <spacer name="horizontalSpacer_5">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="4" column="0">
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>62</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="5" column="0" colspan="6">
- <widget class="QGroupBox" name="GBField">
- <property name="title">
- <string>Field information</string>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="2" colspan="5">
- <widget class="QLineEdit" name="LEFieldFile">
- <property name="minimumSize">
- <size>
- <width>282</width>
- <height>21</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="1" column="3" colspan="4">
- <spacer>
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>138</width>
- <height>18</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="2" column="6">
- <widget class="QRadioButton" name="RBChosen">
- <property name="text">
- <string>Chosen time step</string>
- </property>
- </widget>
- </item>
- <item row="4" column="6">
- <spacer>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Expanding</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>255</width>
- <height>13</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="4" column="5">
- <widget class="QSpinBox" name="SpinBox_Rank">
- <property name="minimum">
- <number>-1</number>
- </property>
- <property name="maximum">
- <number>1010000</number>
- </property>
- <property name="value">
- <number>-1</number>
- </property>
- </widget>
- </item>
- <item row="4" column="4">
- <widget class="QLabel" name="Rank">
- <property name="text">
- <string>Rank</string>
- </property>
- </widget>
- </item>
- <item row="4" column="2" colspan="2">
- <spacer>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>13</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="4" column="1">
- <widget class="QSpinBox" name="SpinBox_TimeStep">
- <property name="minimum">
- <number>-2</number>
- </property>
- <property name="maximum">
- <number>100000</number>
- </property>
- <property name="value">
- <number>-1</number>
- </property>
- </widget>
- </item>
- <item row="4" column="0">
- <widget class="QLabel" name="TimeStep">
- <property name="text">
- <string>Time step</string>
- </property>
- </widget>
- </item>
- <item row="3" column="0" colspan="4">
- <spacer>
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>138</width>
- <height>28</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="2" column="3" colspan="3">
- <widget class="QRadioButton" name="RBLast">
- <property name="text">
- <string>Last time step</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0" colspan="3">
- <widget class="QRadioButton" name="RBNo">
- <property name="text">
- <string>No time step</string>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QPushButton" name="PushFieldFile">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="FieldFile">
- <property name="text">
- <string>Field file</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="5" column="6">
- <spacer name="horizontalSpacer_10">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>69</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="6" column="0">
- <spacer>
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>22</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="7" column="0" colspan="4">
- <widget class="QGroupBox" name="Hypothese">
- <property name="title">
- <string>Hypothesis</string>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="0">
- <widget class="QComboBox" name="CBHypothese">
- <property name="currentIndex">
- <number>-1</number>
- </property>
- <property name="sizeAdjustPolicy">
- <enum>QComboBox::AdjustToContents</enum>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <spacer>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>13</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="0" column="2">
- <widget class="QPushButton" name="PBHypoEdit">
- <property name="text">
- <string>Edit</string>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QPushButton" name="PBHypoNew">
- <property name="text">
- <string>New</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="7" column="4" colspan="2">
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="8" column="1">
- <spacer>
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>21</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="9" column="0" colspan="4">
- <widget class="QGroupBox" name="GroupButtons">
- <property name="title">
- <string/>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="0">
- <widget class="QPushButton" name="buttonOk">
- <property name="text">
- <string>OK</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- <property name="default">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QPushButton" name="buttonApply">
- <property name="text">
- <string>Apply</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QPushButton" name="buttonCancel">
- <property name="text">
- <string>Cancel</string>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QPushButton" name="buttonHelp">
- <property name="text">
- <string>Help</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="9" column="4" colspan="2">
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="1" column="5">
- <spacer name="horizontalSpacer_9">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>139</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- </widget>
- <resources/>
- <connections/>
-</ui>
+++ /dev/null
-<ui version="4.0" >
- <class>CreateListGroup</class>
- <widget class="QDialog" name="CreateListGroup" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>717</width>
- <height>600</height>
- </rect>
- </property>
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="windowTitle" >
- <string>Selection of groups</string>
- </property>
- <property name="autoFillBackground" >
- <bool>true</bool>
- </property>
- <property name="sizeGripEnabled" >
- <bool>true</bool>
- </property>
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item row="1" column="0" >
- <widget class="QGroupBox" name="GBButtons" >
- <property name="title" >
- <string/>
- </property>
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item row="0" column="3" >
- <widget class="QPushButton" name="buttonHelp" >
- <property name="text" >
- <string>Help</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2" >
- <widget class="QPushButton" name="buttonCancel" >
- <property name="text" >
- <string>Cancel</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1" >
- <widget class="QPushButton" name="buttonApply" >
- <property name="text" >
- <string>Apply</string>
- </property>
- </widget>
- </item>
- <item row="0" column="0" >
- <widget class="QPushButton" name="buttonOk" >
- <property name="text" >
- <string>OK</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="0" column="0" >
- <widget class="QGroupBox" name="GBOptions" >
- <property name="title" >
- <string>Selected groups</string>
- </property>
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item row="0" column="0" >
- <widget class="QTableWidget" name="TWGroupe" >
- <property name="showGrid" >
- <bool>true</bool>
- </property>
- <property name="rowCount" >
- <number>0</number>
- </property>
- <property name="columnCount" >
- <number>2</number>
- </property>
- <column>
- <property name="text" >
- <string>Selection</string>
- </property>
- </column>
- <column>
- <property name="text" >
- <string>Group</string>
- </property>
- </column>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>CreateYACS</class>
- <widget class="QScrollArea" name="CreateYACS">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>684</width>
- <height>649</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>600</width>
- <height>500</height>
- </size>
- </property>
- <property name="sizeIncrement">
- <size>
- <width>1</width>
- <height>1</height>
- </size>
- </property>
- <property name="baseSize">
- <size>
- <width>600</width>
- <height>500</height>
- </size>
- </property>
- <property name="windowTitle">
- <string>Create YACS</string>
- </property>
- <property name="widgetResizable">
- <bool>true</bool>
- </property>
- <widget class="QWidget" name="scrollAreaWidgetContents">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>680</width>
- <height>645</height>
- </rect>
- </property>
- <property name="sizeGripEnabled" stdset="0">
- <bool>true</bool>
- </property>
- <layout class="QGridLayout" name="gridLayout_5">
- <item row="0" column="0">
- <widget class="QWidget" name="WName" native="true">
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0">
- <widget class="QLabel" name="Name">
- <property name="text">
- <string>Name</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="LEName">
- <property name="maxLength">
- <number>32</number>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="0" column="1">
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>131</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="1" column="0" colspan="2">
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="Case">
- <property name="text">
- <string>Case</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QPushButton" name="PBCaseName">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>27</height>
- </size>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QLineEdit" name="LECaseName">
- <property name="minimumSize">
- <size>
- <width>382</width>
- <height>21</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="2" column="0" colspan="2">
- <layout class="QHBoxLayout" name="_2">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <widget class="QLabel" name="Script">
- <property name="text">
- <string>Script</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="PBScriptFile">
- <property name="text">
- <string/>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="LEScriptFile">
- <property name="minimumSize">
- <size>
- <width>382</width>
- <height>21</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="3" column="0" colspan="2">
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <widget class="QLabel" name="DirectoryStart">
- <property name="text">
- <string>Directory</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="PBDir">
- <property name="text">
- <string/>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="LEDirName">
- <property name="minimumSize">
- <size>
- <width>382</width>
- <height>21</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="4" column="0" colspan="2">
- <layout class="QHBoxLayout" name="_3">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <widget class="QLabel" name="MeshFile">
- <property name="text">
- <string>Mesh file</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="PBMeshFile">
- <property name="text">
- <string/>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="LEMeshFile">
- <property name="minimumSize">
- <size>
- <width>382</width>
- <height>21</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="5" column="0">
- <widget class="QGroupBox" name="GBTypeSchema">
- <property name="title">
- <string>Type of schema</string>
- </property>
- <layout class="QHBoxLayout" name="_4">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>9</number>
- </property>
- <item>
- <widget class="QRadioButton" name="RBConstant">
- <property name="text">
- <string>Constant</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="RBVariable">
- <property name="text">
- <string>Variable</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="6" column="0">
- <widget class="QGroupBox" name="GBMax">
- <property name="title">
- <string>Maximum of ...</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_3">
- <item row="0" column="0">
- <widget class="QLabel" name="TLMaxIteration">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Iterations</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QSpinBox" name="SpinBoxMaxIter">
- <property name="minimum">
- <number>0</number>
- </property>
- <property name="maximum">
- <number>999999999</number>
- </property>
- <property name="value">
- <number>0</number>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="TLMaxNodes">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Nodes</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QSpinBox" name="SpinBoxMaxNode">
- <property name="minimum">
- <number>0</number>
- </property>
- <property name="maximum">
- <number>999999999</number>
- </property>
- <property name="singleStep">
- <number>1000</number>
- </property>
- <property name="value">
- <number>0</number>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QLabel" name="TLMaxElem">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Elements</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="3">
- <widget class="QSpinBox" name="SpinBoxMaxElem">
- <property name="minimum">
- <number>0</number>
- </property>
- <property name="maximum">
- <number>999999999</number>
- </property>
- <property name="singleStep">
- <number>1000</number>
- </property>
- <property name="value">
- <number>0</number>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="6" column="1">
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>269</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="7" column="0">
- <widget class="QGroupBox" name="GBConvergence">
- <property name="title">
- <string>Test of convergence</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_4">
- <item row="0" column="0">
- <widget class="QRadioButton" name="RBNone">
- <property name="text">
- <string>None</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QRadioButton" name="RBVMinAbs">
- <property name="text">
- <string>Vtest > Vref</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QRadioButton" name="RBVMaxAbs">
- <property name="text">
- <string>Vtest < Vref</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="labelVref">
- <property name="text">
- <string>Vref</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QDoubleSpinBox" name="doubleSpinBoxConvergence">
- <property name="decimals">
- <number>4</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="7" column="1">
- <spacer name="horizontalSpacer_3">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>269</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="8" column="0">
- <widget class="QGroupBox" name="GroupButtons">
- <property name="title">
- <string/>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="4">
- <widget class="QPushButton" name="buttonHelp">
- <property name="text">
- <string>Help</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QPushButton" name="buttonApply">
- <property name="text">
- <string>Apply</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QPushButton" name="buttonOk">
- <property name="text">
- <string>OK</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QPushButton" name="buttonCancel">
- <property name="text">
- <string>Cancel</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="8" column="1">
- <spacer name="spacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>128</width>
- <height>25</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- </widget>
- <resources/>
- <connections/>
-</ui>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>CreateZone</class>
- <widget class="QDialog" name="CreateZone">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>545</width>
- <height>778</height>
- </rect>
- </property>
- <property name="sizeIncrement">
- <size>
- <width>1</width>
- <height>1</height>
- </size>
- </property>
- <property name="baseSize">
- <size>
- <width>550</width>
- <height>400</height>
- </size>
- </property>
- <property name="windowTitle">
- <string>Create a zone</string>
- </property>
- <property name="autoFillBackground">
- <bool>true</bool>
- </property>
- <property name="sizeGripEnabled">
- <bool>true</bool>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="Name">
- <property name="text">
- <string>Name</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="LEName">
- <property name="maxLength">
- <number>32</number>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <spacer name="horizontalSpacer_3">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>142</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="1" column="0" colspan="4">
- <widget class="QGroupBox" name="TypeZone">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>340</width>
- <height>0</height>
- </size>
- </property>
- <property name="title">
- <string>Type of zone</string>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="3">
- <widget class="QRadioButton" name="RBSphere">
- <property name="text">
- <string>Sphere</string>
- </property>
- <property name="icon">
- <iconset>
- <normaloff>../../resources/zone_spherepoint.png</normaloff>../../resources/zone_spherepoint.png</iconset>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QRadioButton" name="RBPipe">
- <property name="text">
- <string>Pipe</string>
- </property>
- <property name="icon">
- <iconset>
- <normaloff>../../resources/pipe.png</normaloff>../../resources/pipe.png</iconset>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QRadioButton" name="RBCylinder">
- <property name="text">
- <string>Cylinder</string>
- </property>
- <property name="icon">
- <iconset>
- <normaloff>../../resources/cylinderpointvector.png</normaloff>../../resources/cylinderpointvector.png</iconset>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QRadioButton" name="RBBox">
- <property name="text">
- <string>Box</string>
- </property>
- <property name="icon">
- <iconset>
- <normaloff>../../resources/zone_boxdxyz.png</normaloff>../../resources/zone_boxdxyz.png</iconset>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="1" column="4">
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="2" column="0" colspan="4">
- <widget class="QGroupBox" name="gBBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title">
- <string>Coordinates</string>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="0">
- <widget class="QLabel" name="TLXmini">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>X mini</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Xmini">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="TLYmini">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Y mini</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Ymini">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="TLZmini">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Z mini</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Zmini">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QLabel" name="TLXmaxi">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>X maxi</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="2">
- <widget class="QLabel" name="TLZmaxi">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Z maxi</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="3">
- <widget class="QDoubleSpinBox" name="SpinBox_Zmaxi">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QLabel" name="TLYmaxi">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Y maxi</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QDoubleSpinBox" name="SpinBox_Xmaxi">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="1" column="3">
- <widget class="QDoubleSpinBox" name="SpinBox_Ymaxi">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="3" column="0" colspan="4">
- <widget class="QGroupBox" name="gBSphere">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title">
- <string>Coordinates</string>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="0">
- <widget class="QLabel" name="TLXcentre">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>X centre</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Xcentre">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="TLYcentre">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Y centre</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Ycentre">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QLabel" name="TLRayon">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Radius</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="3">
- <widget class="QDoubleSpinBox" name="SpinBox_Rayon">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>0.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="TLZcentre">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Z centre</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Zcentre">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="4" column="0" colspan="4">
- <widget class="QGroupBox" name="gBCylindre">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="focusPolicy">
- <enum>Qt::TabFocus</enum>
- </property>
- <property name="title">
- <string>Coordinates</string>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="4" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Haut">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="maximum">
- <double>1000000000.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="4" column="0">
- <widget class="QLabel" name="TLHaut">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Height</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="TLRadius">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Radius</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QDoubleSpinBox" name="SpinBox_Xaxis">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="1" column="3">
- <widget class="QDoubleSpinBox" name="SpinBox_Yaxis">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="2" column="3">
- <widget class="QDoubleSpinBox" name="SpinBox_Zaxis">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="2" column="2">
- <widget class="QLabel" name="TLZaxis">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Z axis</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QLabel" name="TLYaxis">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Y axis</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QLabel" name="TLXaxis">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>X axis</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Ybase">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="TLYbase">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Y base</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="TLZbase">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Z base</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Zbase">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Radius">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="maximum">
- <double>1000000000.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="TLXbase">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>X base</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Xbase">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="5" column="0" colspan="5">
- <widget class="QGroupBox" name="gBPipe">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title">
- <string>Coordinates</string>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="4" column="0">
- <widget class="QLabel" name="TLHaut_p">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Height</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Xbase_p">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="TLXbase_p">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>X base</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Radius_int">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="maximum">
- <double>1000000000.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Zbase_p">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="TLRadius_int">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Internal radius</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="TLZbase_p">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Z base</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="TLYbase_p">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Y base</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Ybase_p">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QLabel" name="TLXaxis_p">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>X axis</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QLabel" name="TLYaxis_p">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Y axis</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="2">
- <widget class="QLabel" name="TLZaxis_p">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Z axis</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="3">
- <widget class="QDoubleSpinBox" name="SpinBox_Zaxis_p">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="1" column="3">
- <widget class="QDoubleSpinBox" name="SpinBox_Yaxis_p">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QDoubleSpinBox" name="SpinBox_Xaxis_p">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="minimum">
- <double>-999999999.000000000000000</double>
- </property>
- <property name="maximum">
- <double>999999999.000000000000000</double>
- </property>
- <property name="value">
- <double>0.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="3" column="3">
- <widget class="QDoubleSpinBox" name="SpinBox_Radius_ext">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="maximum">
- <double>1000000000.000000000000000</double>
- </property>
- </widget>
- </item>
- <item row="3" column="2">
- <widget class="QLabel" name="TLRadius_ext">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>External radius</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="4" column="1">
- <widget class="QDoubleSpinBox" name="SpinBox_Haut_p">
- <property name="decimals">
- <number>5</number>
- </property>
- <property name="maximum">
- <double>1000000000.000000000000000</double>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="6" column="0" colspan="3">
- <widget class="QGroupBox" name="GBButtons">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title">
- <string/>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="3">
- <widget class="QPushButton" name="buttonHelp">
- <property name="text">
- <string>Help</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QPushButton" name="buttonCancel">
- <property name="text">
- <string>Cancel</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QPushButton" name="buttonApply">
- <property name="text">
- <string>Apply</string>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QPushButton" name="buttonOk">
- <property name="text">
- <string>OK</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="6" column="3" colspan="2">
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>EditFile</class>
- <widget class="QWidget" name="EditFile">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>675</width>
- <height>901</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Edit a file</string>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="2" column="1">
- <spacer>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>331</width>
- <height>49</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="2" column="0">
- <widget class="QGroupBox" name="GroupButtons">
- <property name="title">
- <string/>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="1">
- <widget class="QPushButton" name="buttonPrint">
- <property name="text">
- <string>Print</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- <property name="default">
- <bool>false</bool>
- </property>
- <property name="flat">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QPushButton" name="buttonQuit">
- <property name="text">
- <string>Quit</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- <property name="default">
- <bool>true</bool>
- </property>
- <property name="flat">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="1" column="0" colspan="2">
- <spacer>
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>14</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="0" column="0" colspan="2">
- <widget class="QTextBrowser" name="QTBEditFile">
- <property name="minimumSize">
- <size>
- <width>530</width>
- <height>800</height>
- </size>
- </property>
- <property name="font">
- <font>
- <family>Courier New</family>
- </font>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
+++ /dev/null
-// 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_
-
+++ /dev/null
-// 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 <string>
-
-
-#include <qstring.h>
-#include <qstringlist.h>
-#include <sys/stat.h>
-#ifndef WIN32
-#include <dirent.h>
-#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<SalomeApp_Application*>(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<SalomeApp_Module*>( 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 = "<<TypeObject.toStdString().c_str()<<", option = "<<option);
-// Existence d'un attribut ?
- _PTR(GenericAttribute) anAttr;
- if ( !MonObj->FindAttribute(anAttr, "AttributeComment") ) return false;
-// Quel type ?
- _PTR(AttributeComment) aComment (anAttr);
- QString Type = QString(aComment->Value().c_str());
-// MESSAGE("Type = "<<Type.toStdString().c_str());
-// Est-ce le bon ?
- bool bOK = false ;
- if ( option == 0 )
- {
- int position = Type.lastIndexOf(TypeObject);
-// MESSAGE("position = "<<position);
- if ( position == 0 ) { bOK = true ; }
- }
- else
- {
- if ( Type == TypeObject ) { bOK = true ; }
- }
- return bOK ;
-}
-//================================================================
-// Retourne vrai si l'objet est une frontiere CAO
-//================================================================
-bool HOMARD_UTILS::isBoundaryCAO(_PTR(SObject) MonObj)
-{
- return isObject( MonObj, QString("BoundaryCAOHomard"), -1 ) ;
-}
-//================================================================
-// Retourne vrai si l'objet est une frontiere analytique
-//================================================================
-bool HOMARD_UTILS::isBoundaryAn(_PTR(SObject) MonObj)
-{
- return isObject( MonObj, QString("BoundaryAnHomard"), -1 ) ;
-}
-//================================================================
-// Retourne vrai si l'objet est une frontiere discrete
-//================================================================
-bool HOMARD_UTILS::isBoundaryDi(_PTR(SObject) MonObj)
-{
- return isObject( MonObj, QString("BoundaryDiHomard"), -1 ) ;
-}
-//================================================================
-// Retourne vrai si l'objet est un cas
-//================================================================
-bool HOMARD_UTILS::isCase(_PTR(SObject) MonObj)
-{
- return isObject( MonObj, QString("CasHomard"), -1 ) ;
-}
-//================================================================
-// Retourne vrai si l'objet est une Hypothese
-//================================================================
-bool HOMARD_UTILS::isHypo(_PTR(SObject) MonObj)
-{
- return isObject( MonObj, QString("HypoHomard"), -1 ) ;
-}
-//================================================================
-// Retourne vrai si l'objet est une iteration
-//================================================================
-bool HOMARD_UTILS::isIter(_PTR(SObject) MonObj)
-{
- return isObject( MonObj, QString("IterationHomard"), 0 ) ;
-}
-//================================================================
-// Retourne vrai si l'objet est un schema YACS
-//================================================================
-bool HOMARD_UTILS::isYACS(_PTR(SObject) MonObj)
-{
- return isObject( MonObj, QString("YACSHomard"), -1 ) ;
-}
-//================================================================
-// Retourne vrai si l'objet est une zone
-//================================================================
-bool HOMARD_UTILS::isZone(_PTR(SObject) MonObj)
-{
- return isObject( MonObj, QString("ZoneHomard"), -1 ) ;
-}
-//================================================================
-// Retourne vrai si l'objet est un fichier de type TypeFile
-//================================================================
-bool HOMARD_UTILS::isFileType(_PTR(SObject) MonObj, QString TypeFile)
-{
- return isObject( MonObj, TypeFile, 0 ) ;
-}
-
-//=========================================================================================================
-void HOMARD_UTILS::PushOnHelp(QString monFichierAide, QString contexte, QString LanguageShort)
-{
- 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<ADAPTGUI*>( 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);
-// }
-}
-//=========================================================================================================
+++ /dev/null
-// 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 <SALOMEconfig.h>
-
-#include <omniORB4/CORBA.h>
-#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 <SALOME_ListIO.hxx>
-
-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
+++ /dev/null
-// 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 <utilities.h>
-
-#include <qmessagebox.h>
-#include <qcombobox.h>
-#include <qfiledialog.h>
-#include <qstring.h>
-#include <stdlib.h>
-#ifndef WIN32
-#include <unistd.h>
-#endif
-#include <sys/stat.h>
-
-
-#include "SalomeApp_Tools.h"
-
-using namespace std;
-
-#include <med.h>
-
-// ============================================================================
-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 "<<avertir<<" et TypeFichier = "<<TypeFichier.toStdString().c_str());
- QString aFile = QString::null;
-//
- // A. Filtre
- QString filtre ;
-//
- if ( TypeFichier == "med" ) { filtre = QString("Med") ; }
- else if ( TypeFichier == "py" ) { filtre = QString("Python") ; }
- else { filtre = TypeFichier ; }
-//
- if ( TypeFichier != "" ) { filtre += QString(" files (*.") + TypeFichier + QString(");;") ; }
-//
- filtre += QString("all (*) ") ;
-//
- // B. Selection
- int nbSel = HOMARD_UTILS::IObjectCount() ;
-// MESSAGE("nbSel ="<<nbSel);
- // B.1. Rien n'est selectionne
- if ( nbSel == 0 )
- {
-// aFile = QFileDialog::getOpenFileName(0, QObject::tr("HOM_SELECT_FILE_0"), QString(""), QString("Med files (*.med);;all (*) ") );
- aFile = QFileDialog::getOpenFileName(0, QObject::tr("HOM_SELECT_FILE_0"), QString(""), filtre );
- }
- // B.2. Un objet est selectionne
- else if (nbSel == 1)
- {
- Handle(SALOME_InteractiveObject) aIO = HOMARD_UTILS::firstIObject();
- if ( aIO->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<QString> HOMARD_QT_COMMUN::GetListeChamps(QString aFile)
-// =======================================================================
-{
-// Il faut voir si plusieurs maillages
-
- MESSAGE("GetListeChamps");
- std::list<QString> 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<QString> 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<QString> 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 <ncomp; j++)
- {
- char cible[MED_SNAME_SIZE +1];
- strncpy(cible,comp+j*MED_SNAME_SIZE,MED_SNAME_SIZE );
- cible[MED_SNAME_SIZE ]='\0';
- ListeComposants.push_back(QString(cible));
- }
- }
- // Menage
- free(comp);
- // Sortie si c'est bon
- if ( QString(nomcha) == aChamp ) { break ; }
- }
- break ;
- }
- // Fermeture du fichier
- if ( medIdt > 0 ) MEDfileClose(medIdt);
-
- return ListeComposants;
-}
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include "SALOME_Selection.h"
-#include <SalomeApp_Module.h>
-
-#include <med.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-#include CORBA_CLIENT_HEADER(HOMARD_Cas)
-
-#include <qstring.h>
-#include <vector>
-#include <set>
-
-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<QString> GetListeChamps(QString aFile);
- HOMARD_EXPORT std::list<QString> GetListeComposants(QString aFile, QString aChamp);
-
- HOMARD_EXPORT QString SelectionArbreEtude(QString commentaire, int grave );
- HOMARD_EXPORT QString SelectionCasEtude();
-
-};
-
-#endif // HOMARDQTCOMMUN_H
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>IterInfo</class>
- <widget class="QDialog" name="IterInfo">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>420</width>
- <height>220</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="windowTitle">
- <string>Information on a mesh</string>
- </property>
- <property name="autoFillBackground">
- <bool>true</bool>
- </property>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0" rowspan="2" colspan="2">
- <widget class="QGroupBox" name="GBOptions">
- <property name="title">
- <string>Options</string>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QCheckBox" name="CBQuality">
- <property name="text">
- <string>Quality</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QCheckBox" name="CBConnection">
- <property name="text">
- <string>Connection</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QCheckBox" name="CBDiametre">
- <property name="text">
- <string>Diametre</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QCheckBox" name="CBBlockSize">
- <property name="text">
- <string>Group size</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0" colspan="2">
- <widget class="QCheckBox" name="CBEntanglement">
- <property name="text">
- <string>Entanglement</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="2" column="0" colspan="2">
- <widget class="QGroupBox" name="GroupButtons">
- <property name="title">
- <string/>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="4">
- <widget class="QPushButton" name="buttonHelp">
- <property name="text">
- <string>Help</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QPushButton" name="buttonApply">
- <property name="text">
- <string>Apply</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QPushButton" name="buttonOk">
- <property name="text">
- <string>OK</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QPushButton" name="buttonCancel">
- <property name="text">
- <string>Cancel</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MeshInfo</class>
- <widget class="QDialog" name="MeshInfo">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>536</width>
- <height>372</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="windowTitle">
- <string>Information on a mesh</string>
- </property>
- <property name="autoFillBackground">
- <bool>true</bool>
- </property>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0" colspan="2">
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <widget class="QLabel" name="Name">
- <property name="text">
- <string>Name</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="LECaseName">
- <property name="minimumSize">
- <size>
- <width>382</width>
- <height>21</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="1" column="0" colspan="2">
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <widget class="QLabel" name="Directory">
- <property name="text">
- <string>Directory</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="PushDir">
- <property name="text">
- <string/>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="LEDirName">
- <property name="minimumSize">
- <size>
- <width>382</width>
- <height>21</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="2" column="0">
- <spacer>
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>18</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="3" column="0" colspan="2">
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <widget class="QLabel" name="Mesh_2">
- <property name="text">
- <string>Mesh</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="PushFichier">
- <property name="text">
- <string/>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="LEFileName">
- <property name="minimumSize">
- <size>
- <width>382</width>
- <height>21</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="4" column="0">
- <spacer>
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>1</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="5" column="0">
- <widget class="QGroupBox" name="GBOptions">
- <property name="title">
- <string>Options</string>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QCheckBox" name="CBQuality">
- <property name="text">
- <string>Quality</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QCheckBox" name="CBConnection">
- <property name="text">
- <string>Connection</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QCheckBox" name="CBDiametre">
- <property name="text">
- <string>Diametre</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QCheckBox" name="CBBlockSize">
- <property name="text">
- <string>Group size</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0" colspan="2">
- <widget class="QCheckBox" name="CBEntanglement">
- <property name="text">
- <string>Entanglement</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="6" column="0">
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="7" column="0">
- <widget class="QGroupBox" name="GroupButtons">
- <property name="title">
- <string/>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="4">
- <widget class="QPushButton" name="buttonHelp">
- <property name="text">
- <string>Help</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QPushButton" name="buttonApply">
- <property name="text">
- <string>Apply</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QPushButton" name="buttonOk">
- <property name="text">
- <string>OK</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QPushButton" name="buttonCancel">
- <property name="text">
- <string>Cancel</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="7" column="1">
- <spacer name="spacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>128</width>
- <height>25</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
+++ /dev/null
-// 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 <QFileDialog>
-#include <QMessageBox>
-
-#include "SalomeApp_Tools.h"
-#include "HOMARDGUI_Utils.h"
-#include "HomardQtCommun.h"
-#include <utilities.h>
-
-#include <SUIT_Desktop.h>
-#include <SUIT_MessageBox.h>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_Session.h>
-#include <SUIT_ViewManager.h>
-
-#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 ="<<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; i<MyObjects->length(); 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 = "<<option)
-//
-// o
-// ! .
-// ! .
-// RA! .
-// ! o
-// ! RB! .
-// ! ! .
-// A----------------B----------O
-//
-// Thales : RA/RB = AO/BO ==> 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")
-}
-
-
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-#include CORBA_CLIENT_HEADER(HOMARD_Boundary)
-
-#include "ui_CreateBoundaryAn.h"
-#include <QDialog>
-
-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
+++ /dev/null
-// 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 <QFileDialog>
-#include <QMessageBox>
-
-#include "SalomeApp_Tools.h"
-#include "HOMARDGUI_Utils.h"
-#include "HomardQtCommun.h"
-#include <utilities.h>
-
-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; i<MyObjects->length(); 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();
-}
-
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-#include CORBA_CLIENT_HEADER(HOMARD_Boundary)
-
-#include "ui_CreateBoundaryCAO.h"
-#include <QDialog>
-
-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
+++ /dev/null
-// 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 <QFileDialog>
-#include <QMessageBox>
-
-#include "SalomeApp_Tools.h"
-#include "HOMARDGUI_Utils.h"
-#include "HomardQtCommun.h"
-#include <utilities.h>
-
-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; i<MyObjects->length(); 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();
-}
-
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-#include CORBA_CLIENT_HEADER(HOMARD_Boundary)
-
-#include "ui_CreateBoundaryDi.h"
-#include <QDialog>
-
-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
+++ /dev/null
-// 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 <QFileDialog>
-#include <QMessageBox>
-
-#include "SalomeApp_Tools.h"
-#include "HOMARDGUI_Utils.h"
-#include "HomardQtCommun.h"
-#include <utilities.h>
-
-#ifdef WIN32
-#include <direct.h>
-#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 : "<<mesBoundarys->length());
- for (int i=0; i<mesBoundarys->length(); 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 "<<NomGroup.toStdString().c_str());
- for ( int nugr = 0 ; nugr<ListeGroup.size(); nugr++)
- {
-// MESSAGE("....... "<<ListeGroup[nugr].toStdString().c_str());
- if ( NomGroup == ListeGroup[nugr] )
- {
- QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
- QObject::tr("HOM_CASE_GROUP").arg(NomGroup) );
- return false;
- }
- }
- ListeGroup.insert(0, NomGroup );
- }
- }
- }
- }
-
-// Creation du cas
- if (aCaseName != _aCaseName )
- {
- _aCaseName = aCaseName;
- try
- {
- aCase = myAdaptGen->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; i<MyCases->length(); 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 "<<nom.toStdString().c_str());
- if (nom != QString(""))
- { MonEditBoundaryAn *BoundaryDlg = new MonEditBoundaryAn(this, true,
- ADAPT::ADAPT_Gen::_duplicate(myAdaptGen), _aCaseName, nom ) ;
- BoundaryDlg->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();
-}
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-#include CORBA_CLIENT_HEADER(HOMARD_Cas)
-
-#include "ui_CreateCase.h"
-#include <QWidget>
-
-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
+++ /dev/null
-// 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 <QFileDialog>
-#include <QMessageBox>
-
-#include "SalomeApp_Tools.h"
-#include "HOMARDGUI_Utils.h"
-#include "HomardQtCommun.h"
-#include <utilities.h>
-
-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; i<MyObjects->length(); 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; i<mesZones->length(); 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 "<<row<<", zone : "<<TWZone->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 : "<<ListeZone.count()) ;
- }
-//
-return ListeZone ;
-}
-// ------------------------------------------------------------------------
-QStringList MonCreateHypothesis::GetListCompChecked()
-// ------------------------------------------------------------------------
-// Retourne les composantes retenues
-{
- MESSAGE( "Debut de GetListCompChecked" );
- QStringList ListeComposant ;
-
- ListeComposant.clear();
- for ( int row=0; row< TWCMP->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<QString> listeChamp = HOMARD_QT_COMMUN::GetListeChamps(QString(_aFieldFile) );
- // Mise en place de la liste dans le menu pour l'indicateur d'erreur
- std:: list<QString>::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<QString> maListe =HOMARD_QT_COMMUN::GetListeComposants(_aFieldFile, _aFieldName);
- std::list<QString>::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<QString> 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<QString>::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 ;
-}
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-#include CORBA_CLIENT_HEADER(HOMARD_Hypothesis)
-
-#include "ui_CreateHypothesis.h"
-#include <QScrollArea>
-
-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
+++ /dev/null
-// 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 <QFileDialog>
-#include <QMessageBox>
-
-#include "SalomeApp_Tools.h"
-#include "HOMARDGUI_Utils.h"
-#include "HomardQtCommun.h"
-#include <utilities.h>
-
-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; i<mesHypotheses->length(); 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();
-}
-
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-#include CORBA_CLIENT_HEADER(HOMARD_Cas)
-
-#include "ui_CreateIteration.h"
-#include <QScrollArea>
-
-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
+++ /dev/null
-// 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 <QFileDialog>
-
-#include "SalomeApp_Tools.h"
-#include "HOMARDGUI_Utils.h"
-#include "HomardQtCommun.h"
-#include <utilities.h>
-
-#include <SUIT_Desktop.h>
-#include <SUIT_MessageBox.h>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_Session.h>
-#include <SUIT_ViewManager.h>
-
-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 ");
-}
-
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-
-#include "ui_CreateListGroup.h"
-#include <QDialog>
-
-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
+++ /dev/null
-// 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 <QFileDialog>
-
-#include "SalomeApp_Tools.h"
-#include "HOMARDGUI_Utils.h"
-#include "HomardQtCommun.h"
-#include <utilities.h>
-
-#include <SUIT_Desktop.h>
-#include <SUIT_MessageBox.h>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_Session.h>
-#include <SUIT_ViewManager.h>
-
-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 ");
-}
-
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-
-#include "ui_CreateListGroup.h"
-#include <QDialog>
-
-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
+++ /dev/null
-// 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 <QFileDialog>
-#include <QMessageBox>
-
-#include "SalomeApp_Tools.h"
-#include "HOMARDGUI_Utils.h"
-#include "HomardQtCommun.h"
-#include <utilities.h>
-
-#ifdef WIN32
-#include <direct.h>
-#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; i<MyObjects->length(); 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 ;
-}
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-#include CORBA_CLIENT_HEADER(HOMARD_Cas)
-
-#include "ui_CreateYACS.h"
-#include <QScrollArea>
-
-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
+++ /dev/null
-// 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 <QFileDialog>
-#include <QMessageBox>
-
-#include "SalomeApp_Tools.h"
-#include "HOMARDGUI_Utils.h"
-#include "HomardQtCommun.h"
-#include <utilities.h>
-
-#include <SUIT_Desktop.h>
-#include <SUIT_MessageBox.h>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_Session.h>
-#include <SUIT_ViewManager.h>
-
-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 ="<<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; i<MyObjects->length() ; i++)
- {
- if ( aName == QString(MyObjects[i]))
- {
- num ++ ;
- aName = "" ;
- break ;
- }
- }
- }
- LEName->setText(aName);
- MESSAGE("SetNewName aName ="<<aName.toStdString().c_str());
-}
-// ------------------------------------------------------------------------
-void MonCreateZone::SetBox()
-// ------------------------------------------------------------------------
-{
- MESSAGE("Debut de SetBox")
- gBBox->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")
-}
-
-
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-
-#include "ui_CreateZone.h"
-#include <QDialog>
-
-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
+++ /dev/null
-// 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 <utilities.h>
-
-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;
-}
-
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-
-#include <MonCreateBoundaryAn.h>
-
-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
+++ /dev/null
-// 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 <QMessageBox>
-
-#include "SalomeApp_Tools.h"
-#include "HOMARDGUI_Utils.h"
-#include "HomardQtCommun.h"
-#include <utilities.h>
-
-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();
-}
-
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-
-#include <MonCreateBoundaryCAO.h>
-
-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
+++ /dev/null
-// 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 <QMessageBox>
-
-#include "SalomeApp_Tools.h"
-#include "HOMARDGUI_Utils.h"
-#include "HomardQtCommun.h"
-#include <utilities.h>
-
-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();
-}
-
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-
-#include <MonCreateBoundaryDi.h>
-
-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
+++ /dev/null
-// 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 <utilities.h>
-
-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; i<mesBoundarys->length(); i++)
- {
-// Nom de la frontiere
- NomFron = mesBoundarys[i++];
- MESSAGE("NomFron "<<NomFron.toStdString().c_str());
-// L'objet associe pour en deduire le type
- ADAPT::HOMARD_Boundary_var myBoundary = myAdaptGen->GetBoundary(NomFron.toStdString().c_str());
- int type_obj = myBoundary->GetType() ;
- MESSAGE("type_obj "<<type_obj);
-// C'est une frontiere CAO
-// Remarque : on ne gere pas les groupes
- if ( type_obj==-1 )
- {
- BounCAO = true ;
- CBBoundaryCAO->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 ; nufr<ListeFron.size(); nufr++)
- { if ( ListeFron[nufr] == NomFron ) ok = nufr+1 ; }
-// si non, on ajoute une colonne
- if ( ok < 0 )
- {
- ListeFron.append(NomFron);
- ok = ListeFron.size() ;
- AddBoundaryAn(NomFron);
- }
-// on coche la case correspondant au couple (frontiere,groupe) en cours d'examen
- TWBoundary->item( 0, ok )->setCheckState( Qt::Checked );
- }
- }
- MESSAGE("BounCAO "<<BounCAO<<",BounDi "<<BounDi<<", BounAn "<<BounAn);
- GBTypeBoun->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 "<<Pyram);
- if ( ( 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 "<<etat);
- if ( etat == 0 ) { Comment->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 ;
-};
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-
-#include <MonCreateCase.h>
-
-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
+++ /dev/null
-// 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 <QFile>
-#include <QTextStream>
-#include <QMessageBox>
-
-#include "SalomeApp_Tools.h"
-#include "HOMARDGUI_Utils.h"
-#include "HomardQtCommun.h"
-#include <utilities.h>
-
-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;
-}
-
-
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include "SALOME_Selection.h"
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-#include CORBA_CLIENT_HEADER(HOMARD_Cas)
-
-#include "ui_EditFile.h"
-#include <QWidget>
-
-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
+++ /dev/null
-// 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 <utilities.h>
-
-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; i<mesZonesAvant->length(); i++)
- {
- MESSAGE ("i"<<i<<", zone :"<<string(mesZonesAvant[i])<<", type :"<<string(mesZonesAvant[i+1]));
- for ( int j =0 ; j < TWZone->rowCount(); j++)
- {
- MESSAGE (". j"<<j<<", zone :"<<TWZone->item(j,2)->text().toStdString());
- if ( TWZone->item(j,2)->text().toStdString() == string(mesZonesAvant[i]) )
- {
- MESSAGE ("OK avec "<<string(mesZonesAvant[i]));
- if ( string(mesZonesAvant[i+1]) == "1" )
- {
- MESSAGE ("... RAFF");
- TWZone->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; i<mesComposantsAvant->length(); 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; iaux<mesChampsAvant->length(); 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();
- }
-}
-
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-
-#include <MonCreateHypothesis.h>
-
-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
+++ /dev/null
-// 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 <utilities.h>
-
-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;
-
-};
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-
-#include <MonCreateIteration.h>
-
-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
+++ /dev/null
-// 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 <utilities.h>
-
-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();
-}
-
-
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-
-#include <MonCreateListGroup.h>
-
-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
+++ /dev/null
-// 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 <utilities.h>
-
-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();
-}
-
-
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-
-#include <MonCreateListGroupCAO.h>
-
-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
+++ /dev/null
-// 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 <utilities.h>
-
-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 "<<aScriptFile.toStdString());
- _aScriptFile = aScriptFile ;
- aYACS->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 "<<aMeshFile.toStdString());
- _aMeshFile = aMeshFile ;
- aYACS->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 "<<valeur_i);
- _MaxIter = valeur_i ;
- aYACS->SetMaxIter(_MaxIter) ;
- chgt = true ;
- }
- valeur_i = SpinBoxMaxNode->value() ;
- if ( valeur_i != _MaxNode )
- {
-// MESSAGE("modification de MaxNode : "<<_MaxNode<<" devient "<<valeur_i);
- _MaxNode = valeur_i ;
- aYACS->SetMaxNode(_MaxNode) ;
- chgt = true ;
- }
- valeur_i = SpinBoxMaxElem->value() ;
- if ( valeur_i != _MaxElem )
- {
-// MESSAGE("modification de MaxElem : "<<_MaxElem<<" devient "<<valeur_i);
- _MaxElem = valeur_i ;
- aYACS->SetMaxElem(_MaxElem) ;
- chgt = true ;
- }
-// B. Si changement
- if ( chgt )
- {
- myAdaptGen->InvalideYACS(_Name.toStdString().c_str());
- }
-
- HOMARD_UTILS::updateObjBrowser();
- return true ;
-}
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-
-#include <MonCreateYACS.h>
-
-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
+++ /dev/null
-// 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 <utilities.h>
-#include <SUIT_Desktop.h>
-#include <SUIT_MessageBox.h>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_Session.h>
-#include <SUIT_ViewManager.h>
-
-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;
-}
-
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-
-#include <MonCreateZone.h>
-
-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
+++ /dev/null
-// 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 <QFile>
-#include <QTextStream>
-#include <QFileDialog>
-#include <QMessageBox>
-
-#include "SalomeApp_Tools.h"
-#include "HOMARDGUI_Utils.h"
-#include "HomardQtCommun.h"
-#include "MonEditFile.h"
-#include <utilities.h>
-
-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 ; }
-}
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-#include CORBA_CLIENT_HEADER(HOMARD_Cas)
-
-#include "ui_IterInfo.h"
-#include <QDialog>
-#include <QWidget>
-
-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
+++ /dev/null
-// 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 <QFileDialog>
-#include <QMessageBox>
-
-#include "SalomeApp_Tools.h"
-#include "HOMARDGUI_Utils.h"
-#include "HomardQtCommun.h"
-#include "MonEditFile.h"
-#include <utilities.h>
-
-#ifdef WIN32
-#include <direct.h>
-#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; i<MyCases->length(); 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 ; }
-}
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-#include CORBA_CLIENT_HEADER(HOMARD_Cas)
-
-#include "ui_MeshInfo.h"
-#include <QWidget>
-
-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
+++ /dev/null
-// 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 <QFileDialog>
-#include <QMessageBox>
-
-#include "SalomeApp_Tools.h"
-#include "HOMARDGUI_Utils.h"
-#include "HomardQtCommun.h"
-#include <utilities.h>
-
-#ifdef WIN32
-#include <direct.h>
-#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; i<MyCases->length(); 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();
-}
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#include <SalomeApp_Module.h>
-
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
-#include CORBA_CLIENT_HEADER(ADAPT_Gen)
-#include CORBA_CLIENT_HEADER(HOMARD_Cas)
-
-#include "ui_PursueIteration.h"
-#include <QWidget>
-
-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
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>PursueIteration</class>
- <widget class="QDialog" name="PursueIteration">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>601</width>
- <height>300</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="windowTitle">
- <string>Pursue an iteration</string>
- </property>
- <property name="autoFillBackground">
- <bool>true</bool>
- </property>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0" colspan="2">
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <widget class="QLabel" name="Name">
- <property name="text">
- <string>Name</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="LECaseName">
- <property name="minimumSize">
- <size>
- <width>382</width>
- <height>21</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="1" column="0" colspan="3">
- <layout class="QHBoxLayout" name="_2">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <widget class="QLabel" name="Directory">
- <property name="text">
- <string>Directory</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="PushDir">
- <property name="text">
- <string/>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="LEDirName">
- <property name="minimumSize">
- <size>
- <width>382</width>
- <height>21</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="2" column="0">
- <widget class="QRadioButton" name="RBIteration">
- <property name="text">
- <string>From an iteration</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QRadioButton" name="RBCase">
- <property name="text">
- <string>From a case</string>
- </property>
- </widget>
- </item>
- <item row="3" column="0" colspan="3">
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <widget class="QLabel" name="DirectoryStart">
- <property name="text">
- <string>Directory</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="PushDirStart">
- <property name="text">
- <string/>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="LEDirNameStart">
- <property name="minimumSize">
- <size>
- <width>382</width>
- <height>21</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="4" column="0" colspan="2">
- <widget class="QGroupBox" name="GBIterationintoCase">
- <property name="title">
- <string>Iteration into the case</string>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QRadioButton" name="RBCaseLastIteration">
- <property name="text">
- <string>Last iteration</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QRadioButton" name="RBCaseNIteration">
- <property name="text">
- <string>Iteration number</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QSpinBox" name="SpinBoxNumber">
- <property name="maximum">
- <number>1789</number>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="5" column="0" colspan="2">
- <widget class="QGroupBox" name="GroupButtons">
- <property name="title">
- <string/>
- </property>
- <layout class="QGridLayout">
- <property name="margin">
- <number>9</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <item row="0" column="4">
- <widget class="QPushButton" name="buttonHelp">
- <property name="text">
- <string>Help</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QPushButton" name="buttonApply">
- <property name="text">
- <string>Apply</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QPushButton" name="buttonOk">
- <property name="text">
- <string>OK</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QPushButton" name="buttonCancel">
- <property name="text">
- <string>Cancel</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="5" column="2">
- <spacer name="spacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>128</width>
- <height>25</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
+++ /dev/null
-// 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 <SMESH_Gen_i.hxx>
-#include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
-#include CORBA_CLIENT_HEADER(SMESH_Gen)
-
-#include <cmath>
-#include <stdlib.h>
-#include <sys/stat.h>
-#ifndef WIN32
-#include <dirent.h>
-#endif
-#include <string>
-#include <cstring>
-#include <iostream>
-#include <fstream>
-#include <iomanip>
-#include <set>
-#include <vector>
-#include <stdio.h>
-
-#ifdef WIN32
-#include <direct.h>
-#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_<SALOME_NamingService>::Instance();
- ASSERT(SINGLETON_<SALOME_NamingService>::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<std::string, ADAPT::HOMARD_Boundary_var>::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<std::string, ADAPT::HOMARD_Cas_var>::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<std::string, ADAPT::HOMARD_Hypothesis_var>::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<std::string, ADAPT::HOMARD_Iteration_var>::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<std::string, ADAPT::HOMARD_YACS_var>::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<std::string, ADAPT::HOMARD_Zone_var>::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<double> 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<std::string> LesGroupes =GetListeGroupesInMedFile(MeshFile) ;
- ADAPT::ListGroupType_var aSeqGroupe = new ADAPT::ListGroupType ;
- aSeqGroupe->length(LesGroupes.size());
- std::set<std::string>::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 = "<<etat );
- // A.2.2. On ne calcule pas l'iteration initiale, ni une iteration deja calculee
- if ( modeHOMARD == 1 )
- {
- if ( etat <= 0 )
- {
- SALOME::ExceptionStruct es;
- es.type = SALOME::BAD_PARAM;
- es.text = "This iteration is the first of the case and cannot be computed.";
- throw SALOME::SALOME_Exception(es);
- return 1 ;
- }
- else if ( ( etat == 2 ) & ( modeHOMARD == 1 ) )
- {
- SALOME::ExceptionStruct es;
- es.type = SALOME::BAD_PARAM;
- es.text = "This iteration is already computed.";
- throw SALOME::SALOME_Exception(es);
- return 1 ;
- }
- }
- // A.2.3. On n'analyse pas une iteration non calculee
- else
- {
- if ( etat == 1 )
- {
- SALOME::ExceptionStruct es;
- es.type = SALOME::BAD_PARAM;
- es.text = "This iteration is not computed.";
- throw SALOME::SALOME_Exception(es);
- return 1 ;
- }
- }
-
- // A.3. Numero de l'iteration
- // siterp1 : numero de l'iteration a traiter
- // Si adaptation :
- // siter : numero de l'iteration parent, ou 0 si deja au debut mais cela ne servira pas !
- // Ou si information :
- // siter = siterp1
- int NumeIter = myIteration->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 = "<<codret );
- if (codret == 0)
- { myDriver->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 = "<<etat );
- // A.1.2. L'iteration doit être calculee
- if ( etat == 1 )
- {
- SALOME::ExceptionStruct es;
- es.type = SALOME::BAD_PARAM;
- es.text = "This iteration is not computed.";
- throw SALOME::SALOME_Exception(es);
- return 1 ;
- }
- // A.2. Numero de l'iteration
- // siterp1 : numero de l'iteration a traiter
- int NumeIter = myIteration->GetNumber();
- std::string siterp1 ;
- std::stringstream saux1 ;
- saux1 << NumeIter ;
- siterp1 = saux1.str() ;
- if (NumeIter < 10) { siterp1 = "0" + siterp1 ; }
- MESSAGE ( "siterp1 = "<<siterp1 );
-
- // A.3. Le cas
- const char* CaseName = myIteration->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 = "<<codret );
- if (codret == 0)
- { myDriver->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 = "<<num);
- // On verifie que le répertoire parent existe
- int codret = CHDIR(nomrep) ;
- if ( codret != 0 )
- {
- SALOME::ExceptionStruct es;
- es.type = SALOME::BAD_PARAM;
- es.text = "The directory of the case does not exist.";
- throw SALOME::SALOME_Exception(es);
- return 0;
- };
- std::string nomDirActuel = getenv("PWD") ;
- std::string DirName ;
- // On boucle sur tous les noms possibles jusqu'a trouver un nom correspondant a un répertoire inconnu
- bool a_chercher = true ;
- while ( a_chercher )
- {
- // On passe dans le répertoire parent
-
- CHDIR(nomrep);
- // On recherche un nom sous la forme Iabc, avec abc representant le numero
- int jaux ;
- if ( num < 100 ) { jaux = 2 ; }
- else if ( num < 1000 ) { jaux = 3 ; }
- else if ( num < 10000 ) { jaux = 4 ; }
- else if ( num < 100000 ) { jaux = 5 ; }
- else { jaux = 9 ; }
- std::ostringstream iaux ;
- iaux << std::setw(jaux) << std::setfill('0') << num ;
- std::ostringstream DirNameA ;
- DirNameA << "I" << iaux.str();
- // Si on ne pas peut entrer dans le répertoire, on doit verifier
- // que c'est bien un probleme d'absence
- if ( CHDIR(DirNameA.str().c_str()) != 0 )
- {
- bool existe = false ;
-#ifndef WIN32
- DIR *dp;
- struct dirent *dirp;
- dp = opendir(nomrep);
- while ( (dirp = readdir(dp)) != NULL )
- {
- std::string file_name(dirp->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 = "<<TypeUse);
- NumZone = iaux/2 + 1 ;
- 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
- { 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<std::string> 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<std::string>::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 = "<<Rankstr );
- NumField += 1 ;
- int TimeStep = atoi( TimeStepstr.c_str() );
- int Rank = atoi( Rankstr.c_str() );
- myDriver->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 "<<theName<<" is already used "<<listSO->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 "<<theName);
- SALOMEDS::SObject_var aResultSO;
-
- // Caracteristique de la Boundary
- ADAPT::HOMARD_Boundary_var myBoundary = myStudyContext._mesBoundarys[theName];
-
- // 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();
- }
-
- // 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 : "<<BoundaryType);
- std::string icone ;
- std::string value ;
- switch (BoundaryType)
- {
- case -1 :
- { value = "BoundaryCAOHomard" ;
- icone = "geometry.png" ;
- break;
- }
- case 0 :
- { value = "BoundaryDiHomard" ;
- icone = "mesh_tree_mesh.png" ;
- break;
- }
- case 1 :
- { value = "BoundaryAnHomard" ;
- icone = "cylinderpointvector_2.png" ;
- break;
- }
- case 2 :
- { value = "BoundaryAnHomard" ;
- icone = "spherepoint_2.png" ;
- break;
- }
- case 3 :
- { value = "BoundaryAnHomard" ;
- icone = "conepointvector.png" ;
- break;
- }
- case 4 :
- { value = "BoundaryAnHomard" ;
- icone = "conedxyz.png" ;
- break;
- }
- case 5 :
- { value = "BoundaryAnHomard" ;
- icone = "toruspointvector.png" ;
- break;
- }
- }
- aResultSO = aStudyBuilder->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 "<<theName);
- SALOMEDS::SObject_var aResultSO;
-
- if (CORBA::is_nil(theObject)) {
- MESSAGE("ADAPT_Gen_i::theObject->_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 "<<theName);
- SALOMEDS::SObject_var aResultSO;
-
- // On recupere le module pere dans l etude
- // On ajoute la categorie des hypotheses dans l etude si necessaire
- SALOMEDS::SComponent_var theFatherHomard = myStudy->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 "<<theName);
- SALOMEDS::SObject_var aResultSO;
-
- // On recupere le module pere dans l etude
- // On ajoute la categorie des schemas YACS dans l etude si necessaire
- SALOMEDS::SComponent_var theFatherHomard = myStudy->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 "<<theName);
- SALOMEDS::SObject_var aResultSO;
- if (CORBA::is_nil(theObject))
- {
- MESSAGE("PublishZoneInStudy : theObject->_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 = "<<name<<", comment = "<<comment);
-// MESSAGE("icone = "<<icone);
-// MESSAGE("ior = "<<ior);
- SALOMEDS::GenericAttribute_var anAttr ;
-// Ajout du nom
- if ( name != NULL )
- {
- anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeName");
- SALOMEDS::AttributeName_var aNameAttrib = SALOMEDS::AttributeName::_narrow(anAttr);
- aNameAttrib->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"<<pythonCas<<"\n");
-
- // D. Les iterations
- // D.1. L'iteration initiale
- 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
- 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"<<pythonIter<<"\n");
-
- // E. L'hypothese pour passer de l'iteration initiale a la suivante
- // E.1. La structure
- std::string nomHypo = Iter1->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"<<pythonHypo<<"\n");
-
- // F. Le fichier du schema de reference
- // HOMARD_ROOT_DIR : répertoire ou se trouve le module HOMARD
- std::string XMLFile_base ;
- if ( getenv("HOMARD_ROOT_DIR") != NULL ) { XMLFile_base = getenv("HOMARD_ROOT_DIR") ; }
- else
- {
- SALOME::ExceptionStruct es ;
- es.type = SALOME::BAD_PARAM;
- std::string text = "HOMARD_ROOT_DIR est inconnu." ;
- es.text = CORBA::string_dup(text.c_str());
- throw SALOME::SALOME_Exception(es);
- return 0;
- }
- XMLFile_base += "/share/salome/resources/homard/yacs_01." + _LangueShort + ".xml" ;
-// if ( _Langue ==
- MESSAGE("XMLFile_base ="<<XMLFile_base);
-
- // G. Lecture du schema de reference et insertion des données propres au fil de la rencontre des mots-cles
- YACSDriver* myDriver = new YACSDriver(XMLFile, DirName, _LangueShort);
- std::ifstream fichier( XMLFile_base.c_str() );
- if ( fichier ) // ce test échoue si le fichier n'est pas ouvert
- {
- // G.1. Lecture du schema de reference et insertion des données propres au fil de la rencontre des mots-cles
- std::string ligne; // variable contenant chaque ligne lue
- std::string mot_cle;
- while ( std::getline( fichier, ligne ) )
- {
- // G.1.1. Pour la ligne courante, on identifie le premier mot : le mot-cle eventuel
- std::istringstream ligne_bis(ligne); // variable contenant chaque ligne sous forme de flux
- ligne_bis >> mot_cle ;
- // G.1.2. Le maillage initial
- if ( mot_cle == "DataInit_MeshFile" )
- { myDriver->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 << " - " <<iaux);
- ADAPT::HOMARD_Zone_var myZone = myStudyContext._mesZones[ZoneName];
- ASSERT(!CORBA::is_nil(myZone));
- // 2. Les instructions python associees a la zone
- // 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 dumpCorbaZone = myZone->GetDumpPython();
- std::string pythonStructure_0 = dumpCorbaZone.in();
- MESSAGE ("pythonStructure_0 :"<<pythonStructure_0);
- std::istringstream tout (pythonStructure_0) ;
- std::string ligne ;
- std::string pythonStructure ;
- while ( std::getline( tout, ligne ) )
- { pythonStructure = GetStringInTexte ( ligne, ".", 1 ) ; }
- MESSAGE ("pythonStructure :\n"<<pythonStructure);
- // 3. Decodage du nom du service
- std::string methode = GetStringInTexte ( pythonStructure, "(", 0 ) ;
- MESSAGE ( "... methode = " << methode);
- // 4. Mise en place des instructions
- int ZoneType = myZone->GetType();
- MESSAGE ( "... ZoneType = " << ZoneType);
- std::string texte_control_0 ;
- texte_control_0 = myDriver->Texte_Iter_1_Zone(ZoneType, pythonStructure, methode, ZoneName );
- texte_control += texte_control_0 ;
- // 5. Decalage
- iaux ++ ;
- }
-
- return texte_control ;
-}
-//=============================================================================
-// Ecriture d'un schema YACS : ecriture des frontieres associees au cas
-//=============================================================================
-std::string ADAPT_Gen_i::YACSDriverTexteBoundary(ADAPT::HOMARD_Cas_var myCase, YACSDriver* myDriver)
-{
- MESSAGE ( "YACSDriverTexteBoundary" );
- // A. Les frontieres associees au cas
- ADAPT::ListBoundaryGroupType* ListBoundaryGroupType = myCase->GetBoundaryGroup();
- int numberOfitems = ListBoundaryGroupType->length();
-
- // B. Parcours des frontieres
- std::string texte_control ;
- std::list<std::string> 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<std::string>::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 :"<<pythonStructure_0);
- std::istringstream tout (pythonStructure_0) ;
- std::string ligne ;
- std::string pythonStructure ;
- while ( std::getline( tout, ligne ) )
- { pythonStructure = GetStringInTexte ( ligne, ".", 1 ) ; }
- MESSAGE ("pythonStructure :\n"<<pythonStructure);
- // 3. Decodage du nom du service
- std::string methode = GetStringInTexte ( pythonStructure, "(", 0 ) ;
- MESSAGE ( "... methode = " << methode);
- // 4. Mise en place des instructions
- int BoundaryType = myBoundary->GetType();
- MESSAGE ( "... BoundaryType = " << BoundaryType);
- const char* MeshName ;
- const char* DataFile ;
- if (BoundaryType == -1)
- {
- DataFile = myBoundary->GetDataFile() ;
- MESSAGE ( ". CAOFile = " << DataFile );
- }
- else if (BoundaryType == 0)
- {
- MeshName = myBoundary->GetMeshName() ;
- MESSAGE ( ". MeshName = " << MeshName );
- DataFile = myBoundary->GetDataFile() ;
- MESSAGE ( ". MeshFile = " << DataFile );
- }
- std::string texte_control_0 ;
- texte_control_0 = myDriver->Texte_Iter_1_Boundary(BoundaryType, pythonStructure, methode, BoundaryName, MeshName, DataFile );
- texte_control += texte_control_0 ;
- // 5. Memorisation du traitement
- ListeBoundaryTraitees.push_back( BoundaryName );
- }
- }
-
- return texte_control ;
-}
-//
-//=============================================================================
-//=============================================================================
-// Next functions are inherited from SALOMEDS::Driver interface
-//=============================================================================
-//=============================================================================
-SALOMEDS::TMPFile* ADAPT_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent,
- const char* theURL,
- CORBA::Boolean isMultiFile)
-{
- MESSAGE ("Save for theURL = "<< theURL);
- SALOMEDS::TMPFile_var aStreamFile;
-
- // get temporary directory name
- std::string tmpDir = isMultiFile ? std::string(theURL) : SALOMEDS_Tool::GetTmpDir();
-
- StudyContext& context = myStudyContext;
-
- // HOMARD data file name
- std::string aFileName = "";
- if (isMultiFile)
- aFileName = SALOMEDS_Tool::GetNameFromPath(Kernel_Utils::encode(SMESH_Gen_i::getStudyServant()->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<std::string, ADAPT::HOMARD_Cas_var>::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<HOMARD_Cas_i*>(aServant.in());
- if (aCasServant) {
- f << ADAPT::GetSignature(ADAPT::Case) << aCasServant->Dump() << std::endl;
- context._idmap[id++] = dynamic_cast<PortableServer::ServantBase*>(aCasServant);
- }
- }
- // -> save zones
- std::map<std::string, ADAPT::HOMARD_Zone_var>::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<HOMARD_Zone_i*>(aServant.in());
- if (aZoneServant) {
- f << ADAPT::GetSignature(ADAPT::Zone) << aZoneServant->Dump() << std::endl;
- context._idmap[id++] = dynamic_cast<PortableServer::ServantBase*>(aZoneServant);
- }
- }
- // -> save hypotheses
- std::map<std::string, ADAPT::HOMARD_Hypothesis_var>::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<HOMARD_Hypothesis_i*>(aServant.in());
- if (aHypoServant) {
- f << ADAPT::GetSignature(ADAPT::Hypothesis) << aHypoServant->Dump() << std::endl;
- context._idmap[id++] = dynamic_cast<PortableServer::ServantBase*>(aHypoServant);
- }
- }
- // -> save iterations
- std::map<std::string, ADAPT::HOMARD_Iteration_var>::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<HOMARD_Iteration_i*>(aServant.in());
- if (aIterServant) {
- f << ADAPT::GetSignature(ADAPT::Iteration) << aIterServant->Dump() << std::endl;
- context._idmap[id++] = dynamic_cast<PortableServer::ServantBase*>(aIterServant);
- }
- }
- // -> save boundaries
- std::map<std::string, ADAPT::HOMARD_Boundary_var>::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<HOMARD_Boundary_i*>(aServant.in());
- if (aBoundaryServant) {
- f << ADAPT::GetSignature(ADAPT::Boundary) << aBoundaryServant->Dump() << std::endl;
- context._idmap[id++] = dynamic_cast<PortableServer::ServantBase*>(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<HOMARD_Boundary_i*>(aServant.in());
- if (aBoundaryServant && aBoundaryServant->Restore(line.substr(bounSignature.size()))) {
- context._mesBoundarys[aBoundary->GetName()] = aBoundary;
- context._idmap[id] = dynamic_cast<PortableServer::ServantBase*>(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<HOMARD_Cas_i*>(aServant.in());
- if (aCaseServant && aCaseServant->Restore(line.substr(caseSignature.size()))) {
- context._mesCas[aCase->GetName()] = aCase;
- context._idmap[id] = dynamic_cast<PortableServer::ServantBase*>(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<HOMARD_Hypothesis_i*>(aServant.in());
- if (aHypoServant && aHypoServant->Restore(line.substr(hypoSignature.size()))) {
- context._mesHypotheses[aHypo->GetName()] = aHypo;
- context._idmap[id] = dynamic_cast<PortableServer::ServantBase*>(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<HOMARD_Iteration_i*>(aServant.in());
- if (aIterServant && aIterServant->Restore(line.substr(iterSignature.size()))) {
- context._mesIterations[aIter->GetName()] = aIter;
- context._idmap[id] = dynamic_cast<PortableServer::ServantBase*>(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<HOMARD_Zone_i*>(aServant.in());
- if (aZoneServant && aZoneServant->Restore(line.substr(zoneSignature.size()))) {
- context._mesZones[aZone->GetName()] = aZone;
- context._idmap[id] = dynamic_cast<PortableServer::ServantBase*>(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<HOMARD_YACS_i*>(aServant.in());
- if (aYACSServant && aYACSServant->Restore(line.substr(yacsSignature.size()))) {
- context._mesYACSs[aYACS->GetName()] = aYACS;
- context._idmap[id] = dynamic_cast<PortableServer::ServantBase*>(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<PortableServer::ServantBase*>(aServant.in());
- if (aStorable) {
- std::map<int, PortableServer::ServantBase*>::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"<<aScript);
-
-
- if (myStudyContext._mesBoundarys.size() > 0)
- {
- MESSAGE (". Ecritures des frontieres");
- aScript += "#\n# Creation of the boundaries";
- aScript += "\n# ==========================";
- }
- std::map<std::string, ADAPT::HOMARD_Boundary_var>::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<std::string, ADAPT::HOMARD_Zone_var>::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<std::string, ADAPT::HOMARD_Hypothesis_var>::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<std::string, ADAPT::HOMARD_Cas_var>::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<<dumpCas2<<"\n");
- aScript += dumpCas + dumpCas2;
- };
-
-
- if (myStudyContext._mesIterations.size() > 0)
- {
- MESSAGE (". Ecritures des iterations");
- aScript += "#\n# Creation of the iterations" ;
- aScript += "\n# ==========================";
- }
- std::map<std::string, ADAPT::HOMARD_Iteration_var>::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<std::string, ADAPT::HOMARD_YACS_var>::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"<<aScript);
- const size_t aLen = strlen(aScript.c_str());
- char* aBuffer = new char[aLen+1];
- strcpy(aBuffer, aScript.c_str());
-
- CORBA::Octet* anOctetBuf = (CORBA::Octet*)aBuffer;
- Engines::TMPFile_var aStreamFile = new Engines::TMPFile(aLen+1, aLen+1, anOctetBuf, 1);
-
- MESSAGE ("Sortie de DumpPython");
- return aStreamFile._retn();
-}
-
-
-//=============================================================================
-//=============================================================================
-// Utilitaires
-//=============================================================================
-//=============================================================================
-void ADAPT_Gen_i::IsValidStudy( )
-{
-// MESSAGE( "IsValidStudy" );
- if (CORBA::is_nil(SMESH_Gen_i::getStudyServant()))
- {
- SALOME::ExceptionStruct es;
- es.type = SALOME::BAD_PARAM;
- es.text = "Invalid study context";
- throw SALOME::SALOME_Exception(es);
- };
- return ;
-}
-
-//=============================================================================
-char* ADAPT_Gen_i::VerifieDir(const char* nomDir)
-{
- std::string casename = std::string("") ;
- std::map<std::string, ADAPT::HOMARD_Cas_var>::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 '"<<caractere<<"' dans '"<<ligne<<"'"<<", option = "<<option);
-//
- std::string chaine = ligne ;
- int position ;
- if ( option < 2 ) { position = ligne.find_first_of( caractere ) ; }
- else { position = ligne.find_last_of( caractere ) ; }
-// MESSAGE("position = "<<position);
-// MESSAGE("a = "<<ligne.substr( 0, position ).c_str());
-// MESSAGE("b = "<<ligne.substr( position+1 ).c_str());
-//
- if ( position != std::string::npos )
- {
- if ( ( option == 0 ) || ( option == 2 ) ) { chaine = ligne.substr( 0, position ) ; }
- else { chaine = ligne.substr( position+1 ) ; }
- }
- return chaine ;
-//
-}
-//=============================================================================
-//=============================================================================
-// Gestion des preferences
-//=============================================================================
-//=============================================================================
-// Decodage du fichier d'arcihvage des preferences
-//
-void ADAPT_Gen_i::SetPreferences( )
-{
- MESSAGE ( "SetPreferences" );
-
- std::string ligne, mot_cle, salome_version ;
- bool ok = true ;
-
- // A. Les valeurs par defaut ; elles doivent etre coherentes
- std::string LanguageShort = "en" ;
- int PublisMeshIN = 0 ;
- int PublisMeshOUT = 0 ;
- int YACSMaxIter = 0 ;
- int YACSMaxNode = 0 ;
- int YACSMaxElem = 0 ;
- std::string YACSTypeTestchaine = "None" ;
-
- // B. La version de salome
- // Cela se presente sous la forme :
- // [SALOME KERNEL] : 7.3.0
- std::string File ;
- File = getenv("KERNEL_ROOT_DIR") ;
- File += "/bin/salome/VERSION" ;
- MESSAGE ( "File = "<<File ) ;
- std::ifstream fichier0( File.c_str() ) ;
- if ( fichier0 ) // ce test échoue si le fichier n'est pas ouvert
- {
- std::string ligne; // variable contenant chaque ligne lue
- while ( std::getline( fichier0, ligne ) )
- {
- std::istringstream ligne_bis(ligne); // variable contenant chaque ligne sous forme de flux
- ligne_bis >> mot_cle ;
- if ( mot_cle == "[SALOME" )
- {
- salome_version = GetStringInTexte ( ligne, " ", 3 ) ;
-// MESSAGE ( "salome_version = "<<salome_version<<"|||");
- break ;
- }
- }
- }
- else { ok = false ; }
-
- // B. Decodage du fichier de preferences
- if ( ok )
- {
- std::string PrefFile ;
- PrefFile = Kernel_Utils::HomePath() ;
- PrefFile += "/.config/salome/SalomeApprc." + salome_version ;
- MESSAGE ( "PrefFile = "<<PrefFile ) ;
-
- std::ifstream fichier( PrefFile.c_str() );
- if ( fichier ) // ce test échoue si le fichier n'est pas ouvert
- {
- bool section_langue = false ;
- bool section_homard = false ;
- while ( std::getline( fichier, ligne ) )
- {
- std::string chaine ;
- // 1. Pour la ligne courante, on identifie le premier mot : le mot-cle eventuel
- std::istringstream ligne_bis(ligne); // variable contenant chaque ligne sous forme de flux
- ligne_bis >> mot_cle ;
-
- // 2. Les sections
- // 2.1. Debut d'une section
- // MESSAGE(mot_cle);
- if ( mot_cle == "<section" )
- { /*MESSAGE ( "Debut de la section : "<< ligne);*/
- ligne_bis >> 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 = "<<section_langue<<", section_homard = "<<section_homard);
- }
- // 2.2. Fin d'une section
- else if ( mot_cle == "</section>" )
- { /*MESSAGE ( "Fin de la section : "<< ligne<<", section_langue = "<<section_langue<<", section_homard = "<<section_homard);*/
- section_langue = false ;
- section_homard = false ; }
-
- // 3. Parametres
- // 3.1. La langue
- else if ( section_langue || section_homard )
- { MESSAGE ( "a decoder : "<< ligne);
-// La valeur : entre les deux premieres quotes
- chaine = GetStringInTexte ( ligne, "\"", 1 ) ;
-// MESSAGE("chaine 1 = |"<<chaine<<"|");
- chaine = GetStringInTexte ( chaine, "\"", 0 ) ;
-// MESSAGE("chaine = |"<<chaine<<"|");
-// Le mot_cle : entre les deux dernieres quotes
- std::string chaine2 = GetStringInTexte ( ligne, "\"", 2 ) ;
-// MESSAGE("chaine2 1 = |"<<chaine2<<"|");
- chaine2 = GetStringInTexte ( chaine2, "\"", 3 ) ;
-// MESSAGE("chaine2 = |"<<chaine2<<"|");
- // 3.1. La langue
- if ( section_langue )
- { if ( chaine2 == "language" ) { LanguageShort = chaine ; } }
- // 3.2. HOMARD
- if ( section_homard )
- {
- std::istringstream chainebis( chaine ) ;
- // 3.2.1. Les publications
- 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 == "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();
- }
-}
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#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 <string>
-#include <map>
-
-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<std::string, ADAPT::HOMARD_Boundary_var> _mesBoundarys;
- std::map<std::string, ADAPT::HOMARD_Cas_var> _mesCas;
- std::map<std::string, ADAPT::HOMARD_Hypothesis_var> _mesHypotheses;
- std::map<std::string, ADAPT::HOMARD_Iteration_var> _mesIterations;
- std::map<std::string, ADAPT::HOMARD_YACS_var> _mesYACSs;
- std::map<std::string, ADAPT::HOMARD_Zone_var> _mesZones;
- std::map<int, PortableServer::ServantBase*> _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
+++ /dev/null
-# 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})
+++ /dev/null
-// 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<double> mesCoor = myHomardBoundary->GetCoords();
- aResult->length( mesCoor .size() );
- std::vector<double>::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<double> mesCoor = myHomardBoundary->GetLimit();
- aResult->length( mesCoor .size() );
- std::vector<double>::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<std::string> 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<std::string>& ListString = myHomardBoundary->GetGroups();
- ADAPT::ListGroupType_var aResult = new ADAPT::ListGroupType;
- aResult->length( ListString.size() );
- std::list<std::string>::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() );
-}
-
-
-
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#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 <string>
-
-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
+++ /dev/null
-// 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 <vector>
-#include <sys/stat.h>
-
-#ifdef WIN32
-#include <direct.h>
-#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 = "<<NomDir);
- // B. controle de l'usage du repertoire
- char* CaseName = GetName() ;
- char* casenamedir = _gen_i->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<double> 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<double> 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<std::string> 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<std::string>& ListString = myHomardCas->GetGroups();
- ADAPT::ListGroupType_var aResult = new ADAPT::ListGroupType();
- aResult->length( ListString.size() );
- std::list<std::string>::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<std::string>& ListBoundaryGroup = myHomardCas->GetBoundaryGroup();
- std::list<std::string>::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<std::string>& ListBoundaryGroup = myHomardCas->GetBoundaryGroup();
- ADAPT::ListBoundaryGroupType_var aResult = new ADAPT::ListBoundaryGroupType();
- aResult->length( ListBoundaryGroup.size() );
- std::list<std::string>::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) ;
-}
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#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 <string>
-
-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
+++ /dev/null
-// 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<std::string>& ListString = myHomardHypothesis->GetComps();
- ADAPT::listeComposantsHypo_var aResult = new ADAPT::listeComposantsHypo;
- aResult->length( ListString.size() );
- std::list<std::string>::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<std::string> 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<std::string>& ListString = myHomardHypothesis->GetGroups();
- ADAPT::ListGroupType_var aResult = new ADAPT::ListGroupType;
- aResult->length( ListString.size() );
- std::list<std::string>::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<std::string>& ListString = myHomardHypothesis->GetFieldInterps();
- ADAPT::listeFieldInterpsHypo_var aResult = new ADAPT::listeFieldInterpsHypo;
- aResult->length( ListString.size() );
- std::list<std::string>::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<std::string>& ListString = myHomardHypothesis->GetIterations();
- ADAPT::listeIters_var aResult = new ADAPT::listeIters;
- aResult->length( ListString.size() );
- std::list<std::string>::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<std::string>& ListString = myHomardHypothesis->GetZones();
- ADAPT::listeZonesHypo_var aResult = new ADAPT::listeZonesHypo;
- aResult->length( ListString.size() );
- std::list<std::string>::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();
-}
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#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 <string>
-
-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
+++ /dev/null
-// 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<std::string>& ListString = myHomardIteration->GetFieldInterpsTimeStepRank();
- ADAPT::listeFieldInterpTSRsIter_var aResult = new ADAPT::listeFieldInterpTSRsIter;
- aResult->length( ListString.size() );
- std::list<std::string>::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<std::string>& ListString = myHomardIteration->GetFieldInterps();
- ADAPT::listeFieldInterpsIter_var aResult = new ADAPT::listeFieldInterpsIter;
- aResult->length( ListString.size() );
- std::list<std::string>::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 = "<<etatMenage<<", Option = "<<Option );
- ASSERT( myHomardIteration );
-//
-// Nom de l'iteration
- char* IterName = GetName() ;
- CORBA::Long modeHOMARD = 1 ;
- CORBA::Long Option1 = 1 ;
- MESSAGE ( "Compute : calcul de l'teration " << IterName );
- return _gen_i->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<std::string>& maListe = myHomardIteration->GetIterations();
- ADAPT::listeIterFilles_var aResult = new ADAPT::listeIterFilles;
- aResult->length( maListe.size() );
- std::list<std::string>::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() ;
-}
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#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 <string>
-
-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
+++ /dev/null
-// 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
-//=============================================================================
-//=============================================================================
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#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 <string>
-
-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
+++ /dev/null
-// 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<double> mesCoor = myHomardZone->GetCoords();
- aResult->length( mesCoor .size() );
- std::vector<double>::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<double> mesCoor = myHomardZone->GetLimit();
- aResult->length( mesCoor .size() );
- std::vector<double>::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<std::string>& maListe = myHomardZone->GetHypo();
- ADAPT::listeHypo_var aResult = new ADAPT::listeHypo;
- aResult->length( maListe.size() );
- std:: list<std::string>::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 );
-}
-
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#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 <string>
-
-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
+++ /dev/null
-// 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_
-
-
+++ /dev/null
-// 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 <iostream>
-#include <cstdlib>
-#include <cmath>
-#include <cstring>
-#include <algorithm>
-
-#include <med.h>
-
-#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<std::string> GetListeGroupesInMedFile(const char * aFile)
-// =======================================================================
-{
- std::set<std::string> 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<nfam;i++)
- {
-// Lecture du nombre de groupes
- med_int ngro = MEDnFamilyGroup(medIdt,meshname,i+1);
- if ( ngro < 0 )
- {
- erreur = 3 ;
- break ;
- }
-// Lecture de la famille
- else if ( ngro > 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<ngro;j++)
- {
- char str2[MED_LNAME_SIZE+1];
- strncpy(str2,gro+j*MED_LNAME_SIZE,MED_LNAME_SIZE);
- str2[MED_LNAME_SIZE] = '\0';
- ListeGroupes.insert(std::string(str2));
- }
- }
- free(gro);
- }
- }
- break ;
- }
- // Fermeture du fichier
- if ( medIdt > 0 ) MEDfileClose(medIdt);
-
- return ListeGroupes;
-}
-
-// =======================================================================
-std::vector<double> 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<double> 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<nnoe;i++)
- {
- xmin = std::min(xmin,coo[i]);
- xmax = std::max(xmax,coo[i]);
- }
- //
- if (spacedim > 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;
-}
-
+++ /dev/null
-// 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 <vector>
-#include <set>
-#include <string>
-
-HOMARDENGINE_EXPORT int MEDFileExist( const char * aFile );
-HOMARDENGINE_EXPORT std::vector<double> GetBoundingBoxInMedFile( const char * aFile);
-HOMARDENGINE_EXPORT std::set<std::string> GetListeGroupesInMedFile(const char * aFile);
-
-#endif // HOMARD%MEDCOMMUN_H
StdMeshers_I
SMESH_PY
Tools
- ADAPT
- ADAPT_I
- ADAPTFrontTrack
- ADAPTFrontTrack_SWIG
)
IF(SALOME_SMESH_ENABLE_MEFISTO)
PluginUtils
SMESH_SWIG_WITHIHM
StdMeshersGUI
- ADAPTGUI
)
ENDIF(SALOME_BUILD_GUI)
${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}
)
SMDS
SMESHControls
SMESHObject
- ADAPTGUI
- ADAPTImpl
- ADAPTEngine
${MEDCoupling_medloader}
)
#include "SalomeApp_Application.h"
#include "SalomeApp_Module.h"
#include "SalomeApp_Study.h"
-//~#include "SMESH_Actor.h"
#include <SUIT_MessageBox.h>
-//~#include <SMESH_TypeFilter.hxx>
-//~#include <SMESH_MeshAlgos.hxx>
-//~#include <SMESH_LogicalFilter.hxx>
-//~#include <SMDS_Mesh.hxx>
-//~#include <SMDS_MeshNode.hxx>
#include <LightApp_SelectionMgr.h>
#include <SUIT_OverrideCursor.h>
#include <SUIT_ResourceMgr.h>
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();
}
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)
{
fieldNameCmb->insertItem(0,QString(it->first));
int typeStepInField = it->second > 2 ? 2 : it->second ;
- timeStepGroupChanged(typeStepInField, true);
+ timeStepGroupChanged(typeStepInField, false);
}
}
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);
}
}
}
-void SMESHGUI_MgAdaptArguments::timeStepGroupChanged(int timeStepType, bool disableOther, int max)
+void SMESHGUI_MgAdaptArguments::timeStepGroupChanged(int timeStepType, bool disableOther, int vmax)
{
switch (timeStepType)
{
onLastTimeStep(disableOther);
break;
case 2 :
- onChosenTimeStep(disableOther, max);
+ onChosenTimeStep(disableOther, vmax);
default:
break;
}
private slots:\r
void modeChanged( int);\r
void sizeMapDefChanged(int);\r
- void timeStepGroupChanged(int timeStepType, bool disableOther = false, int max = 0);\r
+ void timeStepGroupChanged(int timeStepType, bool disableOther = false, int vmax = 0);\r
void onSelectMedFilebuttonClicked();\r
void clear();\r
void onMedFileCheckBox(int);\r
void onLocalSelected(QString);\r
void onNoTimeStep(bool disableOther = false);\r
void onLastTimeStep(bool disableOther = false);\r
- void onChosenTimeStep(bool disableOther = false, int max = 0);\r
+ void onChosenTimeStep(bool disableOther = false, int vmax = 0);\r
void visibleTimeStepRankLabel(bool visible);\r
\r
private:\r
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();
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
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 );
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
// 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
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
<< 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") + "<br/>";
items << wrap(tr("INFO_QUALITY_AREA"), "li")
lab = lab + tr("INFO_QUALITY_INFO") + ":" + wrap(items.join(""), "ul");
items.clear();
lab = lab + tr("INFO_CLIPPING");
-
+
app->infoPanel()->addLabel(lab, gb);
// << Help Panel
// 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 );
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
#include <SalomeApp_Application.h>
#include <SalomeApp_Study.h>
-// HOMARD includes
-// #include "MonCreateCase.h"
-
// SALOME KERNEL includes
#include "utilities.h"
#include <SALOME_LifeCycleCORBA.hxx>
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();
//
// 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);
-//
// }
/*!
*/
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;
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;
}
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
<source>ICON_CREATE_GEO_GROUP</source>
<translation>mesh_groups_from_gemetry.png</translation>
</message>
- <message>
- <source>ICON_REF_ALL</source>
- <translation>adapt_ref_all.png</translation>
- </message>
- <message>
- <source>ICON_HOMARD_CREATE_CASE</source>
- <translation>adapt_ref_homard.png</translation>
- </message>
- <message>
- <source>ICON_HOMARD_FOLLOW_ITERATION</source>
- <translation>adapt_hom_iter_poursuite.png</translation>
- </message>
- <message>
- <source>ICON_HOMARD_NEW_ITERATION</source>
- <translation>adapt_hom_iter_next</translation>
- </message>
- <message>
- <source>ICON_HOMARD_COMPUTE</source>
- <translation>mesh_compute.png</translation>
- </message>
- <message>
- <source>ICON_HOMARD_COMPUTE_PUBLISH</source>
- <translation>mesh_compute.png</translation>
- </message>
<message>
<source>ICON_MG_ADAPT</source>
<translation>adapt_mg_adapt.png</translation>
<message>
<source>ICON_MEASURE_AREA</source>
<translation>mesh_measure_area.png</translation>
- </message>
+ </message>
<message>
<source>ICON_MEASURE_VOLUME</source>
<translation>mesh_measure_volume.png</translation>
<source>MEN_CONSTRUCT_GROUP</source>
<translation>Construct Group</translation>
</message>
- <message>
- <source>MEN_REF_ALL</source>
- <translation>Uniform refinement</translation>
- </message>
- <message>
- <source>MEN_REF_HOMARD</source>
- <translation>Adaptation with HOMARD</translation>
- </message>
- <message>
- <source>MEN_HOMARD_CREATE_CASE</source>
- <translation>New case for adaptation with HOMARD</translation>
- </message>
- <message>
- <source>MEN_HOMARD_FOLLOW_ITERATION</source>
- <translation>Existing case</translation>
- </message>
- <message>
- <source>MEN_HOMARD_NEW_ITERATION</source>
- <translation>New iteration</translation>
- </message>
- <message>
- <source>MEN_HOMARD_COMPUTE</source>
- <translation>Compute</translation>
- </message>
- <message>
- <source>MEN_HOMARD_COMPUTE_PUBLISH</source>
- <translation>Compute and publish</translation>
- </message>
<message>
<source>MEN_MG_ADAPT</source>
<translation>Remesh with MG_Adapt</translation>
<source>ADAPT_PREF_NONE</source>
<translation>None</translation>
</message>
- <message>
- <source>ADAPT_PREF_HOMARD_PUBLICATION</source>
- <translation>Publication of meshes with HOMARD</translation>
- </message>
- <message>
- <source>ADAPT_PREF_HOMARD_PUBLICATION_MAILLAGE_IN</source>
- <translation>IN mesh</translation>
- </message>
- <message>
- <source>ADAPT_PREF_HOMARD_PUBLICATION_MAILLAGE_OUT</source>
- <translation>OUT mesh</translation>
- </message>
- <message>
- <source>ADAPT_PREF_HOMARD_YACS</source>
- <translation>A YACS schema with HOMARD</translation>
- </message>
- <message>
- <source>ADAPT_PREF_HOMARD_YACS_MAX_ITER</source>
- <translation>Maximal number of iterations</translation>
- </message>
- <message>
- <source>ADAPT_PREF_HOMARD_YACS_MAX_NODE</source>
- <translation>Maximal number of nodes</translation>
- </message>
- <message>
- <source>ADAPT_PREF_HOMARD_YACS_MAX_ELEM</source>
- <translation>Maximal number of elements</translation>
- </message>
- <message>
- <source>ADAPT_PREF_HOMARD_YACS_TYPE_CONVERGENCE</source>
- <translation>Test type for a YACS schema with HOMARD</translation>
- </message>
<message>
<source>ADAPT_PREF_MG_ADAPT</source>
<translation>Adaptation with MG-Adapt</translation>
<source>STB_CONSTRUCT_GROUP</source>
<translation>Construct Group</translation>
</message>
- <message>
- <source>STB_REF_ALL</source>
- <translation>Uniform refinement</translation>
- </message>
- <message>
- <source>STB_REF_HOMARD</source>
- <translation>Refinement with HOMARD</translation>
- </message>
- <message>
- <source>STB_HOMARD_CREATE_CASE</source>
- <translation>Creation of a new case for adaptation with HOMARD</translation>
- </message>
- <message>
- <source>STB_HOMARD_FOLLOW_ITERATION</source>
- <translation>Creation of a new case: pursuit of a stored iteration</translation>
- </message>
- <message>
- <source>STB_HOMARD_NEW_ITERATION</source>
- <translation>Creation of a next iteration</translation>
- </message>
- <message>
- <source>STB_HOMARD_COMPUTE</source>
- <translation>Compute the refinement</translation>
- </message>
- <message>
- <source>STB_HOMARD_COMPUTE_PUBLISH</source>
- <translation>Compute the refinement and publish the final mesh</translation>
- </message>
- <message>
- <source>STB_EDIT</source>
- <translation>Edit</translation>
- </message>
<message>
<source>STB_MG_ADAPT</source>
<translation>Remesh with MG_Adapt</translation>
<source>TOP_CONSTRUCT_GROUP</source>
<translation>Construct Group</translation>
</message>
- <message>
- <source>TOP_REF_ALL</source>
- <translation>Uniform refinement</translation>
- </message>
- <message>
- <source>TOP_HOMARD_CREATE_CASE</source>
- <translation>New case</translation>
- </message>
- <message>
- <source>TOP_HOMARD_FOLLOW_ITERATION</source>
- <translation>Existing case</translation>
- </message>
- <message>
- <source>TOP_HOMARD_NEW_ITERATION</source>
- <translation>New iteration</translation>
- </message>
- <message>
- <source>TOP_HOMARD_COMPUTE</source>
- <translation>Compute</translation>
- </message>
- <message>
- <source>TOP_HOMARD_COMPUTE_PUBLISH</source>
- <translation>Compute and publish</translation>
- </message>
<message>
<source>TOP_MG_ADAPT</source>
<translation>Remesh with MG_Adapt</translation>
<message>
<source>CONCURRENT_SUBMESH_APPEARS</source>
<translation>
-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? </translation>
<source>MEN_CONSTRUCT_GROUP</source>
<translation>Construire un groupe</translation>
</message>
- <message>
- <source>MEN_REF_ALL</source>
- <translation>Raffinement uniforme</translation>
- </message>
- <message>
- <source>MEN_REF_HOMARD</source>
- <translation>Raffinement avec HOMARD</translation>
- </message>
- <message>
- <source>MEN_HOMARD_CREATE_CASE</source>
- <translation>Création d'un cas d'adaptation</translation>
- </message>
- <message>
- <source>MEN_HOMARD_FOLLOW_ITERATION</source>
- <translation>Poursuite d'une itération d'adaptation</translation>
- </message>
- <message>
- <source>MEN_HOMARD_NEW_ITERATION</source>
- <translation>Création d'une itération d'adaptation</translation>
- </message>
- <message>
- <source>MEN_HOMARD_COMPUTE</source>
- <translation>Calculer</translation>
- </message>
- <message>
- <source>MEN_HOMARD_COMPUTE_PUBLISH</source>
- <translation>Calculer et publier</translation>
- </message>
<message>
<source>MEN_MG_ADAPT</source>
<translation>Remaillage avec MG_Adapt</translation>
<source>ADAPT_PREF_NONE</source>
<translation>Sans</translation>
</message>
- <message>
- <source>ADAPT_PREF_HOMARD_PUBLICATION</source>
- <translation>Publication des maillages avec HOMARD</translation>
- </message>
- <message>
- <source>ADAPT_PREF_HOMARD_PUBLICATION_MAILLAGE_IN</source>
- <translation>Le maillage d'entrée</translation>
- </message>
- <message>
- <source>ADAPT_PREF_HOMARD_PUBLICATION_MAILLAGE_OUT</source>
- <translation>Le maillage de sortie</translation>
- </message>
- <message>
- <source>ADAPT_PREF_HOMARD_YACS</source>
- <translation>Schéma YACS avec HOMARD</translation>
- </message>
- <message>
- <source>ADAPT_PREF_HOMARD_YACS_MAX_ITER</source>
- <translation>Nombre maximal d'itérations</translation>
- </message>
- <message>
- <source>ADAPT_PREF_HOMARD_YACS_MAX_NODE</source>
- <translation>Nombre maximal de noeuds</translation>
- </message>
- <message>
- <source>ADAPT_PREF_HOMARD_YACS_MAX_ELEM</source>
- <translation>Nombre maximal d'éléments</translation>
- </message>
- <message>
- <source>ADAPT_PREF_HOMARD_YACS_TYPE_CONVERGENCE</source>
- <translation>Type de test pour la convergence</translation>
- </message>
<message>
<source>ADAPT_PREF_MG_ADAPT</source>
<translation>Adaptation avec MG-Adapt</translation>
<source>STB_CONSTRUCT_GROUP</source>
<translation>Construire un groupe</translation>
</message>
- <message>
- <source>STB_REF_ALL</source>
- <translation>Raffinement uniforme</translation>
- </message>
- <message>
- <source>STB_REF_HOMARD</source>
- <translation>Adaptation avec HOMARD</translation>
- </message>
- <message>
- <source>STB_HOMARD_CREATE_CASE</source>
- <translation>Création d'un nouveau cas d'adaptation avec HOMARD</translation>
- </message>
- <message>
- <source>STB_HOMARD_FOLLOW_ITERATION</source>
- <translation>Création d'un nouveau cas : poursuite d'une itération stockée</translation>
- </message>
- <message>
- <source>STB_HOMARD_NEW_ITERATION</source>
- <translation>Création d'une nouvelle itération</translation>
- </message>
- <message>
- <source>STB_HOMARD_COMPUTE</source>
- <translation>Calcule le raffinement</translation>
- </message>
- <message>
- <source>STB_HOMARD_COMPUTE_PUBLISH</source>
- <translation>Calcule le raffinement et publie le maillage résultat</translation>
- </message>
- <message>
- <source>STB_EDIT</source>
- <translation>Edit</translation>
- </message>
<message>
<source>STB_MG_ADAPT</source>
<translation>Remaillage avec MG_Adapt</translation>
<source>TOP_CONSTRUCT_GROUP</source>
<translation>Construire un groupe</translation>
</message>
- <message>
- <source>TOP_REF_ALL</source>
- <translation>Raffinement uniforme</translation>
- </message>
- <message>
- <source>TOP_HOMARD_CREATE_CASE</source>
- <translation>Création d'un cas d'adaptation avec HOMARD</translation>
- </message>
- <message>
- <source>TOP_HOMARD_FOLLOW_ITERATION</source>
- <translation>Poursuite d'une itération d'adaptation avec HOMARD</translation>
- </message>
- <message>
- <source>TOP_HOMARD_NEW_ITERATION</source>
- <translation>Création d'une itération</translation>
- </message>
- <message>
- <source>TOP_HOMARD_COMPUTE</source>
- <translation>Calculer</translation>
- </message>
- <message>
- <source>TOP_HOMARD_COMPUTE_PUBLISH</source>
- <translation>Calculer et publier</translation>
- </message>
<message>
<source>TOP_MG_ADAPT</source>
<translation>Remaillage avec MG_Adapt</translation>
// 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"
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();
copyHypothesisDataToImpl(data, baseData);
myMgAdapt->setData(baseData);
delete baseData;
-}
+}
void MG_ADAPT_i::setMedFileIn(const char* str)
{
myMgAdapt->setMedFileIn(str);
{
myMgAdapt->setTimeStep(t);
}
-CORBA::Long MG_ADAPT_i::getTimeStep()
+CORBA::Long MG_ADAPT_i::getTimeStep()
{
return myMgAdapt->getTimeStep();
}
{
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)
{
myMgAdapt->setConstantValue(value);
}
-double MG_ADAPT_i::getConstantSize()
+double MG_ADAPT_i::getConstantSize()
{
return myMgAdapt->getConstantValue();
}
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());
}
{
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());
}
}
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;
//~myMgAdapt->checkDirPath(str);
//~}
-bool MG_ADAPT_i::hasOptionDefined( const char* optionName )
+bool MG_ADAPT_i::hasOptionDefined( const char* optionName )
{
return myMgAdapt->hasOptionDefined(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 <std::string> vals = myMgAdapt->getCustomOptionValuesStrVec();
for (int i = 0; i<vals.size(); i++) result[i] = CORBA::string_dup(vals[i].c_str());
return result._retn();
}
-str_array* MG_ADAPT_i::getOptionValuesStrVec()
+str_array* MG_ADAPT_i::getOptionValuesStrVec()
{
SMESH::str_array_var result = new SMESH::str_array();
}
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());
return -1;
}
hypothesis->setPublish(publish);
- return hypothesis->compute();
-}
+ return hypothesis->compute();
+}
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;
}