Ménage avant intégration

This commit is contained in:
GERALD NICOLAS 2021-02-01 11:26:34 +01:00
parent 5e46af5968
commit 55f658966b
149 changed files with 72 additions and 38714 deletions

View File

@ -65,7 +65,7 @@ SET(BUILD_SHARED_LIBS TRUE)
# ============
OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON)
OPTION(SALOME_BUILD_DOC "Generate SALOME SMESH documentation" ON)
# Advanced options:
OPTION(SALOME_BUILD_GUI "Enable GUI" ON)
OPTION(SALOME_SMESH_USE_CGNS "Enable import/export to CGNS format" OFF)
@ -142,7 +142,7 @@ IF(SALOME_BUILD_GUI)
IF(EXISTS ${GUI_ROOT_DIR})
FIND_PACKAGE(SalomeGUI)
SALOME_GUI_WITH_CORBA() #check whether GUI built with CORBA
SALOME_GUI_MODE(SALOME_USE_VTKVIEWER SALOME_USE_SALOMEOBJECT
SALOME_GUI_MODE(SALOME_USE_VTKVIEWER SALOME_USE_SALOMEOBJECT
OPTIONAL SALOME_USE_PLOT2DVIEWER SALOME_USE_PYCONSOLE)
##
## Prerequisites From GUI:
@ -207,7 +207,7 @@ ENDIF(EXISTS ${MEDCOUPLING_ROOT_DIR})
# VTK is obligatiry for the SMESH
FIND_PACKAGE(SalomeVTK REQUIRED)
FIND_PACKAGE(SalomeOpenCASCADE REQUIRED)
FIND_PACKAGE(SalomeOpenCASCADE REQUIRED)
IF(SALOME_SMESH_USE_CGNS)
FIND_PACKAGE(SalomeCGNS)
@ -233,7 +233,7 @@ IF(WIN32)
MESSAGE(STATUS "Build MEFISTO2D mesher using Fortran to C generator")
ELSE(${F2C_FOUND})
MESSAGE(FATAL "Fortran to C generator is not found: MEFISTO2D mesher cannot be compiled! Please define F2C_ROOT_DIR !")
ENDIF(${F2C_FOUND})
ENDIF(${F2C_FOUND})
ENDIF(WIN32)
IF(SALOME_SMESH_ENABLE_MEFISTO)
@ -252,32 +252,32 @@ SET(SALOME_INSTALL_BINS "${SALOME_INSTALL_BINS}" CACHE PATH "Install path: SALOM
SET(SALOME_INSTALL_LIBS "${SALOME_INSTALL_LIBS}" CACHE PATH "Install path: SALOME libs")
SET(SALOME_INSTALL_IDLS "${SALOME_INSTALL_IDLS}" CACHE PATH "Install path: SALOME IDL files")
SET(SALOME_INSTALL_HEADERS "${SALOME_INSTALL_HEADERS}" CACHE PATH "Install path: SALOME headers")
SET(SALOME_INSTALL_SCRIPT_SCRIPTS "${SALOME_INSTALL_SCRIPT_SCRIPTS}" CACHE PATH
SET(SALOME_INSTALL_SCRIPT_SCRIPTS "${SALOME_INSTALL_SCRIPT_SCRIPTS}" CACHE PATH
"Install path: SALOME scripts")
SET(SALOME_INSTALL_SCRIPT_DATA "${SALOME_INSTALL_SCRIPT_DATA}" CACHE PATH
SET(SALOME_INSTALL_SCRIPT_DATA "${SALOME_INSTALL_SCRIPT_DATA}" CACHE PATH
"Install path: SALOME script data")
SET(SALOME_INSTALL_SCRIPT_PYTHON "${SALOME_INSTALL_SCRIPT_PYTHON}" CACHE PATH
SET(SALOME_INSTALL_SCRIPT_PYTHON "${SALOME_INSTALL_SCRIPT_PYTHON}" CACHE PATH
"Install path: SALOME Python scripts")
SET(SALOME_INSTALL_APPLISKEL_SCRIPTS "${SALOME_INSTALL_APPLISKEL_SCRIPTS}" CACHE PATH
SET(SALOME_INSTALL_APPLISKEL_SCRIPTS "${SALOME_INSTALL_APPLISKEL_SCRIPTS}" CACHE PATH
"Install path: SALOME application skeleton - scripts")
SET(SALOME_INSTALL_APPLISKEL_PYTHON "${SALOME_INSTALL_APPLISKEL_PYTHON}" CACHE PATH
SET(SALOME_INSTALL_APPLISKEL_PYTHON "${SALOME_INSTALL_APPLISKEL_PYTHON}" CACHE PATH
"Install path: SALOME application skeleton - Python")
SET(SALOME_INSTALL_PYTHON "${SALOME_INSTALL_PYTHON}" CACHE PATH "Install path: SALOME Python stuff")
SET(SALOME_INSTALL_PYTHON_SHARED "${SALOME_INSTALL_PYTHON_SHARED}" CACHE PATH
SET(SALOME_INSTALL_PYTHON_SHARED "${SALOME_INSTALL_PYTHON_SHARED}" CACHE PATH
"Install path: SALOME Python shared modules")
SET(SALOME_INSTALL_CMAKE_LOCAL "${SALOME_INSTALL_CMAKE_LOCAL}" CACHE PATH
"Install path: local SALOME CMake files")
SET(SALOME_INSTALL_CMAKE_LOCAL "${SALOME_INSTALL_CMAKE_LOCAL}" CACHE PATH
"Install path: local SALOME CMake files")
SET(SALOME_INSTALL_AMCONFIG_LOCAL "${SALOME_INSTALL_AMCONFIG_LOCAL}" CACHE PATH
"Install path: local SALOME config files (obsolete, to be removed)")
SET(SALOME_INSTALL_RES "${SALOME_INSTALL_RES}" CACHE PATH "Install path: SALOME resources")
SET(SALOME_INSTALL_DOC "${SALOME_INSTALL_DOC}" CACHE PATH "Install path: SALOME documentation")
# Specific to SMESH:
SET(SALOME_SMESH_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/smesh" CACHE PATH
SET(SALOME_SMESH_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/smesh" CACHE PATH
"Install path: SALOME SMESH specific data")
SET(SALOME_SMESH_INSTALL_PLUGINS share/salome/plugins/smesh CACHE PATH
SET(SALOME_SMESH_INSTALL_PLUGINS share/salome/plugins/smesh CACHE PATH
"Install path: SALOME SMESH plugins")
MARK_AS_ADVANCED(SALOME_INSTALL_BINS SALOME_INSTALL_LIBS SALOME_INSTALL_IDLS SALOME_INSTALL_HEADERS)
MARK_AS_ADVANCED(SALOME_INSTALL_SCRIPT_SCRIPTS SALOME_INSTALL_SCRIPT_DATA SALOME_INSTALL_SCRIPT_PYTHON)
MARK_AS_ADVANCED(SALOME_INSTALL_APPLISKEL_SCRIPTS SALOME_INSTALL_APPLISKEL_PYTHON SALOME_INSTALL_CMAKE_LOCAL SALOME_INSTALL_RES)
@ -299,9 +299,9 @@ SET(SALOME_ADAPT_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/adapt" CACHE PATH
SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS}
${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON}
${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON_SHARED})
SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS})
SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS})
# Sources
# Sources
# ========
ADD_SUBDIRECTORY(idl)
@ -328,28 +328,27 @@ INCLUDE(CMakePackageConfigHelpers)
# List of targets in this project we want to make visible to the rest of the world.
# They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup"
SET(_${PROJECT_NAME}_exposed_targets
SET(_${PROJECT_NAME}_exposed_targets
SMESHControls MeshDriver MeshDriverDAT MeshDriverGMF MeshDriverMED
MeshDriverSTL MeshDriverUNV MEDWrapper
SMDS SMESHimpl SMESHEngine SMESHClient SMESHDS
SMESHUtils StdMeshers StdMeshersEngine MeshJobManagerEngine
SPADDERPluginTesterEngine SalomeIDLSMESH SalomeIDLSPADDER
ADAPTEngine ADAPTFrontTrack ADAPTImpl
)
IF(SALOME_SMESH_ENABLE_MEFISTO)
LIST(APPEND _${PROJECT_NAME}_exposed_targets
MEFISTO2D)
MEFISTO2D)
ENDIF(SALOME_SMESH_ENABLE_MEFISTO)
IF(SALOME_BUILD_GUI)
LIST(APPEND _${PROJECT_NAME}_exposed_targets
SMESHObject SMESHFiltersSelection SMESH PluginUtils StdMeshersGUI ADAPTGUI
SMESHObject SMESHFiltersSelection SMESH PluginUtils StdMeshersGUI
)
ENDIF(SALOME_BUILD_GUI)
IF(SALOME_SMESH_USE_CGNS)
LIST(APPEND _${PROJECT_NAME}_exposed_targets
LIST(APPEND _${PROJECT_NAME}_exposed_targets
MeshDriverCGNS
)
ENDIF(SALOME_SMESH_USE_CGNS)
@ -366,7 +365,7 @@ SET(GEOM_ROOT_DIR "${GEOM_ROOT_DIR}")
SET(MEDFILE_ROOT_DIR "${MEDFILE_ROOT_DIR}")
SET(CGNS_ROOT_DIR "${CGNS_ROOT_DIR}")
SET(TBB_ROOT_DIR "${TBB_ROOT_DIR}")
SET(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include")
# Build variables that will be expanded when configuring Salome<MODULE>Config.cmake:
@ -389,5 +388,5 @@ INSTALL(FILES
DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}")
# Install the export set for use with the install-tree
INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
FILE ${PROJECT_NAME}Targets.cmake)

View File

@ -1,233 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __ADAPT_GEN__
#define __ADAPT_GEN__
#include "SALOME_Component.idl"
#include "SALOME_Exception.idl"
#include "SALOMEDS.idl"
#include "HOMARD_Cas.idl"
#include "HOMARD_Hypothesis.idl"
#include "HOMARD_Iteration.idl"
#include "HOMARD_Zone.idl"
#include "HOMARD_Boundary.idl"
#include "HOMARD_YACS.idl"
module ADAPT
{
typedef sequence<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

View File

@ -36,13 +36,6 @@ SET(SalomeIDLSMESH_IDLSOURCES
SMESH_Pattern.idl
SMESH_MeshEditor.idl
SMESH_Measurements.idl
HOMARD_Boundary.idl
HOMARD_Cas.idl
ADAPT_Gen.idl
HOMARD_Hypothesis.idl
HOMARD_Iteration.idl
HOMARD_YACS.idl
HOMARD_Zone.idl
MG_ADAPT.idl
)

View File

@ -1,99 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// Remarques :
// L'ordre de description des fonctions est le meme dans tous les fichiers
// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore
// 2. Les caracteristiques
// 3. Le lien avec les autres structures
//
// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
//
#ifndef _HOMARD_Boundary_IDL
#define _HOMARD_Boundary_IDL
#include "SALOME_Component.idl"
#include "SALOME_Exception.idl"
#include "SALOMEDS.idl"
#include "HOMARD_Cas.idl"
#include "HOMARD_Zone.idl"
module ADAPT
{
interface HOMARD_Boundary : Engines::EngineComponent
{
// Generalites
void SetName(in string Name) raises (SALOME::SALOME_Exception);
string GetName() raises (SALOME::SALOME_Exception);
long Delete() raises (SALOME::SALOME_Exception);
string GetDumpPython() raises (SALOME::SALOME_Exception);
// Caracteristiques
void SetType (in long Type) raises (SALOME::SALOME_Exception);
long GetType() raises (SALOME::SALOME_Exception);
void SetDataFile(in string DataFile) raises (SALOME::SALOME_Exception);
string GetDataFile() raises (SALOME::SALOME_Exception);
void SetMeshName(in string MeshName) raises (SALOME::SALOME_Exception);
string GetMeshName() raises (SALOME::SALOME_Exception);
void SetCylinder (in double Xcentre, in double Ycentre, in double Zcentre,
in double Xaxe, in double Yaxe, in double Zaxe, in double rayon)
raises (SALOME::SALOME_Exception);
void SetSphere (in double Xcentre, in double Ycentre, in double Zcentre, in double rayon)
raises (SALOME::SALOME_Exception);
void SetConeR (in double Xcentre1, in double Ycentre1, in double Zcentre1, in double Rayon1,
in double Xcentre2, in double Ycentre2, in double Zcentre2, in double Rayon2)
raises (SALOME::SALOME_Exception);
void SetConeA(in double Xaxe,in double Yaxe,in double Zaxe,in double Angle,
in double Xcentre,in double Ycentre,in double ZCentre)
raises (SALOME::SALOME_Exception);
void SetTorus (in double Xcentre, in double Ycentre, in double Zcentre,
in double Xaxe, in double Yaxe, in double Zaxe, in double rayonRev, in double rayonPri)
raises (SALOME::SALOME_Exception);
ADAPT::double_array GetCoords() raises (SALOME::SALOME_Exception);
void SetLimit (in double Xincr, in double Yincr, in double Zincr)
raises (SALOME::SALOME_Exception);
ADAPT::double_array GetLimit() raises (SALOME::SALOME_Exception);
void AddGroup(in string LeGroupe) raises (SALOME::SALOME_Exception);
void SetGroups(in ListGroupType ListGroup) raises (SALOME::SALOME_Exception);
ListGroupType GetGroups() raises (SALOME::SALOME_Exception);
// Liens avec les autres iterations
void SetCaseCreation(in string NomCas) raises (SALOME::SALOME_Exception);
string GetCaseCreation() raises (SALOME::SALOME_Exception);
};
};
#endif

View File

@ -1,107 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// Remarques :
// L'ordre de description des fonctions est le meme dans tous les fichiers
// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore
// 2. Les caracteristiques
// 3. Le lien avec les autres structures
//
// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
//
#ifndef _HOMARD_CAS_IDL
#define _HOMARD_CAS_IDL
#include "SALOME_Component.idl"
#include "SALOME_Exception.idl"
#include "SALOMEDS.idl"
#include "HOMARD_Iteration.idl"
#include "HOMARD_YACS.idl"
module ADAPT
{
typedef sequence<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

View File

@ -1,136 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// Remarques :
// L'ordre de description des fonctions est le meme dans tous les fichiers
// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore
// 2. Les caracteristiques
// 3. Le lien avec les autres structures
//
// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
//
#ifndef _HOMARD_HYPOTHESIS_IDL
#define _HOMARD_HYPOTHESIS_IDL
#include "SALOME_Component.idl"
#include "SALOME_Exception.idl"
#include "SALOMEDS.idl"
#include "HOMARD_Cas.idl"
module ADAPT
{
typedef sequence<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

View File

@ -1,130 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// Remarques :
// L'ordre de description des fonctions est le meme dans tous les fichiers
// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore
// 2. Les caracteristiques
// 3. Le lien avec les autres structures
//
// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
//
#ifndef _HOMARD_ITERATION_IDL
#define _HOMARD_ITERATION_IDL
#include "SALOME_Component.idl"
#include "SALOME_Exception.idl"
#include "SALOMEDS.idl"
module ADAPT
{
typedef sequence<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

View File

@ -1,87 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// Remarques :
// L'ordre de description des fonctions est le meme dans tous les fichiers
// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore
// 2. Les caracteristiques
// 3. Le lien avec les autres structures
//
// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
//
#ifndef _HOMARD_YACS_IDL
#define _HOMARD_YACS_IDL
#include "SALOME_Component.idl"
#include "SALOME_Exception.idl"
#include "SALOMEDS.idl"
module ADAPT
{
interface HOMARD_YACS : Engines::EngineComponent
{
// Generalites
void SetName(in string Name) raises (SALOME::SALOME_Exception);
string GetName() raises (SALOME::SALOME_Exception);
long Delete(in long Option) raises (SALOME::SALOME_Exception);
string GetDumpPython() raises (SALOME::SALOME_Exception);
// Caracteristiques
void SetType (in long Type) raises (SALOME::SALOME_Exception);
long GetType() raises (SALOME::SALOME_Exception);
void SetMaxIter (in long MaxIter) raises (SALOME::SALOME_Exception);
long GetMaxIter() raises (SALOME::SALOME_Exception);
void SetMaxNode (in long MaxNode) raises (SALOME::SALOME_Exception);
long GetMaxNode() raises (SALOME::SALOME_Exception);
void SetMaxElem (in long MaxElem) raises (SALOME::SALOME_Exception);
long GetMaxElem() raises (SALOME::SALOME_Exception);
void SetTestConvergence (in long TypeTest, in double VRef)
raises (SALOME::SALOME_Exception);
long GetTestConvergenceType() raises (SALOME::SALOME_Exception);
double GetTestConvergenceVRef() raises (SALOME::SALOME_Exception);
void SetDirName(in string NomDir) raises (SALOME::SALOME_Exception);
string GetDirName() raises (SALOME::SALOME_Exception);
void SetMeshFile(in string MeshFile) raises (SALOME::SALOME_Exception);
string GetMeshFile() raises (SALOME::SALOME_Exception);
void SetScriptFile(in string ScriptFile) raises (SALOME::SALOME_Exception);
string GetScriptFile() raises (SALOME::SALOME_Exception);
void SetXMLFile(in string XMLFile) raises (SALOME::SALOME_Exception);
string GetXMLFile() raises (SALOME::SALOME_Exception);
long Write() raises (SALOME::SALOME_Exception);
long WriteOnFile( in string YACSFile ) raises (SALOME::SALOME_Exception);
// Liens avec les autres structures
void SetCaseName(in string NomCas) raises (SALOME::SALOME_Exception);
string GetCaseName() raises (SALOME::SALOME_Exception);
// Divers
};
};
#endif

View File

@ -1,83 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// Remarques :
// L'ordre de description des fonctions est le meme dans tous les fichiers
// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore
// 2. Les caracteristiques
// 3. Le lien avec les autres structures
//
// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
//
#ifndef _HOMARD_Zone_IDL
#define _HOMARD_Zone_IDL
#include "SALOME_Component.idl"
#include "SALOME_Exception.idl"
#include "SALOMEDS.idl"
module ADAPT
{
typedef sequence<double > 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

View File

@ -22,11 +22,7 @@
SET(SMESH_RESOURCES_FILES
ModuleMesh.png
adapt_hom_iter_next.png
adapt_hom_iter_poursuite.png
adapt_mg_adapt.png
adapt_ref_all.png
adapt_ref_homard.png
advanced_mesh_info.png
bare_border_face.png
bare_border_volume.png

View File

@ -99,12 +99,6 @@
<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" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

View File

@ -1,41 +0,0 @@
// HOMARD HOMARD : implementation of HOMARD idl descriptions
//
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : 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");
}
//=============================================================================

View File

@ -1,37 +0,0 @@
// HOMARD HOMARD : implementation of HOMARD idl descriptions
//
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : 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

View File

@ -1,79 +0,0 @@
# Copyright (C) 2012-2020 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
${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})

View File

@ -1,53 +0,0 @@
// HOMARD HOMARD : implementation of HOMARD idl descriptions
//
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : HOMARD.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

View File

@ -1,324 +0,0 @@
// HOMARD HOMARD : implementation of HOMARD idl descriptions
//
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : HOMARD_Boundary.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;
}
//=============================================================================

View File

@ -1,111 +0,0 @@
// HOMARD HOMARD : implementation of HOMARD idl descriptions
//
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : HOMARD_Boundary.hxx
// Author : Gerald NICOLAS, EDF
// Module : HOMARD
//
// Remarques :
// L'ordre de description des fonctions est le meme dans tous les fichiers
// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore
// 2. Les caracteristiques
// 3. Le lien avec les autres structures
//
// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
#ifndef _HOMARD_Boundary_HXX_
#define _HOMARD_Boundary_HXX_
#include "HOMARD.hxx"
#include <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

View File

@ -1,283 +0,0 @@
// HOMARD HOMARD : implementation of HOMARD idl descriptions
//
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : HOMARD_Cas.cxx
// Author : Gerald NICOLAS, EDF
// Module : HOMARD
//
// Remarques :
// L'ordre de description des fonctions est le meme dans tous les fichiers
// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore
// 2. Les caracteristiques
// 3. Le lien avec les autres structures
//
// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
#include "HOMARD_Cas.hxx"
#include "utilities.h"
#include "HOMARD.hxx"
#include <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();
}

View File

@ -1,112 +0,0 @@
// HOMARD HOMARD : implementation of HOMARD idl descriptions
//
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : HOMARD_Cas.hxx
// Author : Gerald NICOLAS, EDF
// Module : HOMARD
//
// Remarques :
// L'ordre de description des fonctions est le meme dans tous les fichiers
// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore
// 2. Les caracteristiques
// 3. Le lien avec les autres structures
//
// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
#ifndef _HOMARD_CAS_HXX_
#define _HOMARD_CAS_HXX_
#include "HOMARD.hxx"
#include <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

View File

@ -1,840 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : HOMARD_DriverTools.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
// ----------------------------------------------------------------------------
#include "HOMARD_DriverTools.hxx"
#include "HOMARD_Boundary.hxx"
#include "HOMARD_Cas.hxx"
#include "HOMARD_Hypothesis.hxx"
#include "HOMARD_Iteration.hxx"
#include "HOMARD_Zone.hxx"
#include "HOMARD_YACS.hxx"
#include <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/

View File

@ -1,76 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : HOMARD_DriverTools.hxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
// ----------------------------------------------------------------------------
#ifndef HOMARD_DRIVERTOOLS_H
#define HOMARD_DRIVERTOOLS_H
#include "HOMARD.hxx"
#include <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

View File

@ -1,524 +0,0 @@
// HOMARD HOMARD : implementation of HOMARD idl descriptions
//
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : HOMARD_Hypothesis.cxx
// Author : Gerald NICOLAS, EDF
// Module : HOMARD
//
// Remarques :
// L'ordre de description des fonctions est le meme dans tous les fichiers
// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore
// 2. Les caracteristiques
// 3. Le lien avec les autres structures
//
// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
#include "HOMARD_Hypothesis.hxx"
#include "HOMARD.hxx"
#include "utilities.h"
//=============================================================================
/*!
* default constructor:
*/
//=============================================================================
HOMARD_Hypothesis::HOMARD_Hypothesis():
_Name(""), _NomCasCreation(""),
_TypeAdap(-1), _TypeRaff(0), _TypeDera(0),
_Field(""),
_TypeThR(0), _ThreshR(0),
_TypeThC(0), _ThreshC(0),
_UsField(0), _UsCmpI(0), _TypeFieldInterp(0)
{
MESSAGE("HOMARD_Hypothesis");
}
//=============================================================================
/*!
*/
//=============================================================================
HOMARD_Hypothesis::~HOMARD_Hypothesis()
{
MESSAGE("~HOMARD_Hypothesis");
}
//=============================================================================
//=============================================================================
// Generalites
//=============================================================================
//=============================================================================
void HOMARD_Hypothesis::SetName( const char* Name )
{
_Name = std::string( Name );
}
//=============================================================================
std::string HOMARD_Hypothesis::GetName() const
{
return _Name;
}
//=============================================================================
std::string HOMARD_Hypothesis::GetDumpPython() const
{
std::ostringstream aScript;
aScript << "\n# Creation of the hypothesis " << _Name << "\n" ;
aScript << "\t" << _Name << " = homard.CreateHypothesis(\"" << _Name << "\")\n";
if ( _TypeAdap == -1 )
{
int TypeRaffDera ;
if ( _TypeRaff == 1 ) { TypeRaffDera = 1 ; }
else { TypeRaffDera = -1 ; }
aScript << "\t" << _Name << ".SetUnifRefinUnRef(" << TypeRaffDera << ")\n";
}
// Raffinement selon des zones geometriques
std::list<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;
}

View File

@ -1,157 +0,0 @@
// HOMARD HOMARD : implementation of HOMARD idl descriptions
//
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : HOMARD_Hypothesis.hxx
// Author : Gerald NICOLAS, EDF
// Module : HOMARD
//
// Remarques :
// L'ordre de description des fonctions est le meme dans tous les fichiers
// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore
// 2. Les caracteristiques
// 3. Le lien avec les autres structures
//
// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
#ifndef _HOMARD_HYPOTHESIS_HXX_
#define _HOMARD_HYPOTHESIS_HXX_
#include "HOMARD.hxx"
#include <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

View File

@ -1,394 +0,0 @@
// HOMARD HOMARD : implementation of HOMARD idl descriptions
//
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : HOMARD_Iteration.cxx
// Author : Gerald NICOLAS, EDF
// Module : HOMARD
//
// Remarques :
// L'ordre de description des fonctions est le meme dans tous les fichiers
// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore
// 2. Les caracteristiques
// 3. Le lien avec les autres structures
//
// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
#include "HOMARD_Iteration.hxx"
#include "HOMARD.hxx"
#include "utilities.h"
//=============================================================================
/*!
* default constructor:
*/
//=============================================================================
HOMARD_Iteration::HOMARD_Iteration():
_Name( "" ), _Etat( 0 ),
_NumIter( -1 ),
_NomMesh( "" ), _MeshFile( "" ),
_FieldFile( "" ), _TimeStep( -1 ), _Rank( -1 ),
_LogFile( "" ),
_IterParent( "" ),
_NomHypo( "" ), _NomCas( "" ), _NomDir( "" ),
_FileInfo( "" ),
_MessInfo( 1 )
{
MESSAGE("HOMARD_Iteration");
}
//=============================================================================
/*!
*
*/
//=============================================================================
HOMARD_Iteration::~HOMARD_Iteration()
{
MESSAGE("~HOMARD_Iteration");
}
//=============================================================================
//=============================================================================
// Generalites
//=============================================================================
//=============================================================================
void HOMARD_Iteration::SetName( const char* Name )
{
_Name = std::string( Name );
}
//=============================================================================
std::string HOMARD_Iteration::GetName() const
{
return _Name;
}
//=============================================================================
std::string HOMARD_Iteration::GetDumpPython() const
{
if (_IterParent == "") return std::string(" ") ; // Pas de creation explicite de iteration 0";
MESSAGE (". Ecriture de l iteration " << _Name );
std::ostringstream aScript;
aScript << "\n# Creation of the iteration " << _Name << "\n";
if( _NumIter == 1 )
{
aScript << "\t" << _Name << " = " << _NomCas << ".NextIteration(\"" << _Name << "\")\n";
}
else
{
aScript << "\t" << _Name << " = " << _IterParent << ".NextIteration(\"" << _Name << "\")\n";
}
// L'hypothese (doit etre au debut)
aScript << "\t" << _Name << ".AssociateHypo(\"" << _NomHypo << "\")\n";
// Le nom du maillage produit
// MESSAGE (".. maillage produit " << _NomMesh );
aScript << "\t" << _Name << ".SetMeshName(\"" << _NomMesh << "\")\n" ;
// Le fichier du maillage produit
aScript << "\t" << _Name << ".SetMeshFile(\"" << _MeshFile << "\")\n";
// Le fichier des champs
if ( _FieldFile != "" )
{
aScript << "\t" << _Name << ".SetFieldFile(\"" << _FieldFile << "\")\n";
}
// Si champ de pilotage, valeurs de pas de temps
MESSAGE (". champ de pilotage : _TimeStep = " << _TimeStep << ", _Rank : " << _Rank);
if ( _TimeStep != -1 )
{
if ( _TimeStep == -2 ) {
aScript << "\t" << _Name << ".SetTimeStepRankLast()\n";
}
else
{
if ( _TimeStep != -1 )
{
if ( _Rank == -1 )
{
aScript << "\t" << _Name << ".SetTimeStep( " << _TimeStep << " )\n";
}
else
{
aScript << "\t" << _Name << ".SetTimeStepRank( " << _TimeStep << ", " << _Rank << " )\n";
}
}
}
}
// Les instants d'interpolation
MESSAGE (". instants d'interpolation ");
std::list<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;
}

View File

@ -1,139 +0,0 @@
// HOMARD HOMARD : implementation of HOMARD idl descriptions
//
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : HOMARD_Iteration.hxx
// Author : Gerald NICOLAS, EDF
// Module : HOMARD
//
// Remarques :
// L'ordre de description des fonctions est le meme dans tous les fichiers
// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore
// 2. Les caracteristiques
// 3. Le lien avec les autres structures
//
// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
#ifndef _HOMARD_ITER_HXX_
#define _HOMARD_ITER_HXX_
#include "HOMARD.hxx"
#include <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

View File

@ -1,219 +0,0 @@
// HOMARD HOMARD : implementation of HOMARD idl descriptions
//
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : HOMARD_YACS.cxx
// Author : Gerald NICOLAS, EDF
// Module : HOMARD
//
// Remarques :
// L'ordre de description des fonctions est le meme dans tous les fichiers
// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore
// 2. Les caracteristiques
// 3. Le lien avec les autres structures
//
// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
#include "HOMARD_YACS.hxx"
#include "utilities.h"
//=============================================================================
/*!
* default constructor:
*/
//=============================================================================
HOMARD_YACS::HOMARD_YACS():
_Name( "" ),
_NomCas( "" ),
_NomDir( "" ),
_MeshFile( "" ),
_ScriptFile( "" )
{
MESSAGE("HOMARD_YACS");
}
//=============================================================================
/*!
*
*/
//=============================================================================
HOMARD_YACS::~HOMARD_YACS()
{
MESSAGE("~HOMARD_YACS");
}
//=============================================================================
//=============================================================================
// Generalites
//=============================================================================
//=============================================================================
void HOMARD_YACS::SetName( const char* Name )
{
_Name = std::string( Name );
}
//=============================================================================
std::string HOMARD_YACS::GetName() const
{
return _Name;
}
//=============================================================================
std::string HOMARD_YACS::GetDumpPython() const
{
MESSAGE (". Ecriture du schema " << _Name );
std::ostringstream aScript;
aScript << "\n# Creation of the schema " << _Name << "\n";
// Creation du schema
aScript << "\t" << _Name << " = " << _NomCas << ".CreateYACSSchema(\"" << _Name << "\", \"" << _ScriptFile << "\", \"" << _NomDir << "\", \"" << _MeshFile << "\")\n";
// Le type de schema
aScript << "\t" << _Name << ".SetType(" << _Type << ")\n";
// Les controles de convergences
if ( _MaxIter > 0 ) { aScript << "\t" << _Name << ".SetMaxIter(" << _MaxIter << ")\n"; }
if ( _MaxNode > 0 ) { aScript << "\t" << _Name << ".SetMaxNode(" << _MaxNode << ")\n"; }
if ( _MaxElem > 0 ) { aScript << "\t" << _Name << ".SetMaxElem(" << _MaxElem << ")\n"; }
// L'ecriture du schema
aScript << "\tcodret = " << _Name << ".Write()\n";
MESSAGE (". Fin de l ecriture du schema " << _Name );
return aScript.str();
}
//=============================================================================
//=============================================================================
// Caracteristiques de la convergence
//=============================================================================
//=============================================================================
void HOMARD_YACS::SetType( int Type )
{
_Type = Type;
}
//=============================================================================
int HOMARD_YACS::GetType() const
{
return _Type;
}
//=============================================================================
void HOMARD_YACS::SetMaxIter( int MaxIter )
{
_MaxIter = MaxIter;
}
//=============================================================================
int HOMARD_YACS::GetMaxIter() const
{
return _MaxIter;
}
//=============================================================================
void HOMARD_YACS::SetMaxNode( int MaxNode )
{
_MaxNode = MaxNode;
}
//=============================================================================
int HOMARD_YACS::GetMaxNode() const
{
return _MaxNode;
}
//=============================================================================
void HOMARD_YACS::SetMaxElem( int MaxElem )
{
_MaxElem = MaxElem;
}
//=============================================================================
int HOMARD_YACS::GetMaxElem() const
{
return _MaxElem;
}
//=============================================================================
void HOMARD_YACS::SetTestConvergence( int TypeTest, double VRef )
{
_TypeTest = TypeTest;
_VRef = VRef;
}
//=============================================================================
int HOMARD_YACS::GetTestConvergenceType() const
{
return _TypeTest;
}
//=============================================================================
double HOMARD_YACS::GetTestConvergenceVRef() const
{
return _VRef;
}
//=============================================================================
//=============================================================================
// Repertoire et fichiers
//=============================================================================
//=============================================================================
//=============================================================================
void HOMARD_YACS::SetDirName( const char* NomDir )
{
_NomDir = std::string( NomDir );
}
//=============================================================================
std::string HOMARD_YACS::GetDirName() const
{
return _NomDir;
}
//=============================================================================
void HOMARD_YACS::SetMeshFile( const char* MeshFile )
{
_MeshFile = std::string( MeshFile );
}
//=============================================================================
std::string HOMARD_YACS::GetMeshFile() const
{
return _MeshFile;
}
//=============================================================================
void HOMARD_YACS::SetScriptFile( const char* ScriptFile )
{
_ScriptFile = std::string( ScriptFile );
}
//=============================================================================
std::string HOMARD_YACS::GetScriptFile() const
{
return _ScriptFile;
}
//=============================================================================
void HOMARD_YACS::SetXMLFile( const char* XMLFile )
{
_XMLFile = std::string( XMLFile );
}
//=============================================================================
std::string HOMARD_YACS::GetXMLFile() const
{
return _XMLFile;
}
//=============================================================================
//=============================================================================
// Liens avec les autres structures
//=============================================================================
//=============================================================================
void HOMARD_YACS::SetCaseName( const char* NomCas )
{
_NomCas = std::string( NomCas );
}
//=============================================================================
std::string HOMARD_YACS::GetCaseName() const
{
return _NomCas;
}
//=============================================================================
//=============================================================================
// Divers
//=============================================================================
//=============================================================================

View File

@ -1,103 +0,0 @@
// HOMARD HOMARD : implementation of HOMARD idl descriptions
//
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : HOMARD_YACS.hxx
// Author : Gerald NICOLAS, EDF
// Module : HOMARD
//
// Remarques :
// L'ordre de description des fonctions est le meme dans tous les fichiers
// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore
// 2. Les caracteristiques
// 3. Le lien avec les autres structures
//
// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
#ifndef _HOMARD_YACS_HXX_
#define _HOMARD_YACS_HXX_
#include "HOMARD.hxx"
#include <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

View File

@ -1,325 +0,0 @@
// HOMARD HOMARD : implementation of HOMARD idl descriptions
//
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : HOMARD_Zone.cxx
// Author : Gerald NICOLAS, EDF
// Module : HOMARD
//
// Remarques :
// L'ordre de description des fonctions est le meme dans tous les fichiers
// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore
// 2. Les caracteristiques
// 3. Le lien avec les autres structures
//
// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
#include "HOMARD_Zone.hxx"
#include "HOMARD.hxx"
#include "utilities.h"
//=============================================================================
/*!
* default constructor:
*/
//=============================================================================
HOMARD_Zone::HOMARD_Zone():
_Name( "" ),_Type( 2 ),
_Xmin( 0 ), _Xmax( 0 ), _Ymin( 0 ), _Ymax( 0 ), _Zmin( 0 ), _Zmax( 0 ),
_Xcentre( 0 ), _Ycentre( 0 ), _Zcentre( 0 ), _Rayon( 0 ),
_Xaxe( 0 ), _Yaxe( 0 ), _Zaxe( 0 ), _Haut( 0 ),
_Xincr( 0 ), _Yincr( 0 ), _Zincr( 0 )
{
MESSAGE("HOMARD_Zone") ;
}
//=============================================================================
HOMARD_Zone::~HOMARD_Zone()
{
MESSAGE("~HOMARD_Zone") ;
}
//=============================================================================
//=============================================================================
// Generalites
//=============================================================================
//=============================================================================
void HOMARD_Zone::SetName( const char* Name )
{
_Name = std::string( Name );
}
//=============================================================================
std::string HOMARD_Zone::GetName() const
{
return _Name;
}
//=============================================================================
std::string HOMARD_Zone::GetDumpPython() const
{
// MESSAGE("GetDumpPython avec _Type " << _Type) ;
// MESSAGE("GetDumpPython avec _Name " << _Name) ;
std::ostringstream aScript;
aScript << "\n# Creation of the ";
if ( _Type >= 11 && _Type <= 13 ) { aScript << "rectangle " ; }
else if ( _Type == 2 ) { aScript << "box " ;}
else if ( _Type >= 31 && _Type <= 33 ) { aScript << "disk " ;}
else if ( _Type == 4 ) { aScript << "sphere " ; }
else if ( _Type == 5 ) { aScript << "cylinder " ; }
else if ( _Type >= 61 && _Type <= 63 ) { aScript << "disk with hole " ;}
else if ( _Type == 7 ) { aScript << "pipe " ; }
aScript << _Name << "\n" ;
//
aScript << "\t" << _Name << " = homard.CreateZone" ;
//
switch (_Type)
{
case 11:
{ aScript << "Box2D( \"" << _Name << "\", " << _Xmin << ", " << _Xmax << ", " << _Ymin << ", " << _Ymax << ", 1 )\n";
break ;
}
case 12:
{ aScript << "Box2D( \"" << _Name << "\", " << _Ymin << ", " << _Ymax << ", " << _Zmin << ", " << _Zmax << ", 2 )\n";
break ;
}
case 13:
{ aScript << "Box2D( \"" << _Name << "\", " << _Zmin << ", " << _Zmax << ", " << _Xmin << ", " << _Xmax << ", 3 )\n";
break ;
}
case 2:
{ aScript << "Box( \"" << _Name << "\", " << _Xmin << ", " << _Xmax << ", " << _Ymin << ", " << _Ymax << ", " << _Zmin << ", " << _Zmax << ")\n";
break ;
}
case 4:
{ aScript << "Sphere( \"" << _Name << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Rayon << ")\n";
break ;
}
case 31:
{ aScript << "Disk( \"" << _Name << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Rayon << ", 1 )\n";
break ;
}
case 32:
{ aScript << "Disk( \"" << _Name << "\", " << _Ycentre << ", " << _Zcentre << ", " << _Rayon << ", 2 )\n";
break ;
}
case 33:
{ aScript << "Disk( \"" << _Name << "\", " << _Zcentre << ", " << _Xcentre << ", " << _Rayon << ", 3 )\n";
break ;
}
case 5:
{ aScript << "Cylinder( \"" << _Name << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Xaxe << ", " << _Yaxe << ", " << _Zaxe << ", " << _Rayon << ", " << _Haut << ")\n";
break ;
}
case 61:
{ aScript << "DiskWithHole( \"" << _Name << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Rayon << ", " << _Rayonint << ", 1 )\n";
break ;
}
case 62:
{ aScript << "DiskWithHole( \"" << _Name << "\", " << _Ycentre << ", " << _Zcentre << ", " << _Rayon << ", " << _Rayonint << ", 2 )\n";
break ;
}
case 63:
{ aScript << "DiskWithHole( \"" << _Name << "\", " << _Zcentre << ", " << _Xcentre << ", " << _Rayon << ", " << _Rayonint << ", 3 )\n";
break ;
}
case 7:
{ aScript << "Pipe( \"" << _Name << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Xaxe << ", " << _Yaxe << ", " << _Zaxe << ", " << _Rayon << ", " << _Haut << ", " << _Rayonint << ")\n";
break ;
}
}
return aScript.str() ;
}
//=============================================================================
//=============================================================================
// Caracteristiques
//=============================================================================
//=============================================================================
void HOMARD_Zone::SetType( int Type )
{
_Type = Type;
}
//=============================================================================
int HOMARD_Zone::GetType() const
{
return _Type;
}
//=======================================================================================
void HOMARD_Zone::SetBox( double X0, double X1, double X2, double X3, double X4, double X5 )
{
_Xmin = X0; _Xmax = X1;
_Ymin = X2; _Ymax = X3;
_Zmin = X4; _Zmax = X5;
}
//=======================================================================================
void HOMARD_Zone::SetCylinder( double X0, double X1, double X2,
double X3, double X4, double X5, double X6, double X7 )
{
_Xcentre = X0;
_Ycentre = X1;
_Zcentre = X2;
_Xaxe = X3;
_Yaxe = X4;
_Zaxe = X5;
_Rayon = X6;
_Haut = X7;
}
//=======================================================================================
void HOMARD_Zone::SetPipe( double X0, double X1, double X2,
double X3, double X4, double X5, double X6, double X7, double X8 )
{
_Xcentre = X0;
_Ycentre = X1;
_Zcentre = X2;
_Xaxe = X3;
_Yaxe = X4;
_Zaxe = X5;
_Rayon = X6;
_Haut = X7;
_Rayonint = X8;
}
//======================================================================
void HOMARD_Zone::SetSphere( double X0, double X1, double X2, double X3 )
{
_Xcentre = X0;
_Ycentre = X1;
_Zcentre = X2;
_Rayon = X3;
}
//=======================================================================================
std::vector<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() ;
}

View File

@ -1,95 +0,0 @@
// HOMARD HOMARD : implementation of HOMARD idl descriptions
//
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : HOMARD_Zone.hxx
// Author : Gerald NICOLAS, EDF
// Module : HOMARD
//
// Remarques :
// L'ordre de description des fonctions est le meme dans tous les fichiers
// HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
// 1. Les generalites : Name, Delete, DumpPython, Dump, Restore
// 2. Les caracteristiques
// 3. Le lien avec les autres structures
//
// Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
#ifndef _HOMARD_Zone_HXX_
#define _HOMARD_Zone_HXX_
#include "HOMARD.hxx"
#include <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

File diff suppressed because it is too large Load Diff

View File

@ -1,85 +0,0 @@
// HOMARD HOMARD : implementation of HOMARD idl descriptions
//
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
# 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_ */

View File

@ -1,684 +0,0 @@
// HOMARD HOMARD : implementation of HOMARD idl descriptions
//
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// Pilote l'ecriture du fichier xml pour lancer un schema YACS
#include <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 ;
//
}

View File

@ -1,68 +0,0 @@
// HOMARD HOMARD : implementation of HOMARD idl descriptions
//
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
# 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__ */

View File

@ -1,73 +0,0 @@
# Copyright (C) 2017-2020 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
${OpenCASCADE_INCLUDE_DIR}
${GEOM_INCLUDE_DIRS}
${MEDFILE_INCLUDE_DIRS}
${MEDCOUPLING_INCLUDE_DIRS}
${TBB_INCLUDE_DIRS}
)
# additional preprocessor / compiler flags
ADD_DEFINITIONS(
${OpenCASCADE_DEFINITIONS}
)
IF(ADAPTFRONTTRACK_USE_TBB)
SET(TBB_LIBS ${TBB_LIBRARIES})
ENDIF(ADAPTFRONTTRACK_USE_TBB)
# libraries to link to
SET(_link_LIBRARIES
${OpenCASCADE_FoundationClasses_LIBRARIES}
${OpenCASCADE_ModelingAlgorithms_LIBRARIES}
${OpenCASCADE_ModelingData_LIBRARIES}
${GEOM_XAO}
${MEDCoupling_medloader}
${TBB_LIBS}
)
# --- headers ---
# header files
SET(ADAPTFRONTTRACK_HEADERS
FrontTrack.hxx
)
# --- sources ---
# sources / static
SET(ADAPTFRONTTRACK_SOURCES
FrontTrack.cxx
FrontTrack_NodeGroups.cxx
FrontTrack_NodesOnGeom.cxx
FrontTrack_Projector.cxx
FrontTrack_Utils.cxx
)
# --- rules ---
ADD_LIBRARY(ADAPTFrontTrack ${ADAPTFRONTTRACK_SOURCES})
TARGET_LINK_LIBRARIES(ADAPTFrontTrack ${_link_LIBRARIES} )
INSTALL(TARGETS ADAPTFrontTrack EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${ADAPTFRONTTRACK_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})

View File

@ -1,164 +0,0 @@
// Copyright (C) 2017-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : FrontTrack.cxx
// Created : Tue Apr 25 17:20:28 2017
// Author : Edward AGAPOV (eap)
#include "FrontTrack.hxx"
#include "FrontTrack_NodeGroups.hxx"
#include "FrontTrack_Utils.hxx"
#include <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");
}

View File

@ -1,54 +0,0 @@
// Copyright (C) 2017-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : FrontTrack.hxx
// Created : Tue Apr 25 17:08:52 2017
// Author : Edward AGAPOV (eap)
#ifndef __FrontTrack_HXX__
#define __FrontTrack_HXX__
#include <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

View File

@ -1,134 +0,0 @@
// Copyright (C) 2017-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : FrontTrack_NodeGroups.cxx
// Created : Tue Apr 25 19:17:47 2017
// Author : Edward AGAPOV (eap)
#include "FrontTrack_NodeGroups.hxx"
#include "FrontTrack_Projector.hxx"
#include "FrontTrack_Utils.hxx"
#include <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;
}
}

View File

@ -1,76 +0,0 @@
// Copyright (C) 2017-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : FrontTrack_NodeGroups.hxx
// Created : Tue Apr 25 19:02:49 2017
// Author : Edward AGAPOV (eap)
#ifndef __FrontTrack_NodeGroups_HXX__
#define __FrontTrack_NodeGroups_HXX__
#include "FrontTrack_NodesOnGeom.hxx"
#include "FrontTrack_Projector.hxx"
#include <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

View File

@ -1,511 +0,0 @@
// Copyright (C) 2017-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : FrontTrack_NodesOnGeom.cxx
// Created : Tue Apr 25 20:48:23 2017
// Author : Edward AGAPOV (eap)
#include "FrontTrack_NodesOnGeom.hxx"
#include "FrontTrack_Utils.hxx"
#include <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] );
}

View File

@ -1,117 +0,0 @@
// Copyright (C) 2017-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : FrontTrack_NodesOnGeom.hxx
// Created : Tue Apr 25 19:12:25 2017
// Author : Edward AGAPOV (eap)
#ifndef __FrontTrack_NodesOnGeom_HXX__
#define __FrontTrack_NodesOnGeom_HXX__
#include "FrontTrack_Projector.hxx"
#include <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

View File

@ -1,947 +0,0 @@
// Copyright (C) 2017-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : FrontTrack_Projector.cxx
// Created : Wed Apr 26 20:33:55 2017
// Author : Edward AGAPOV (eap)
#include "FrontTrack_Projector.hxx"
#include <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() );
}

View File

@ -1,95 +0,0 @@
// Copyright (C) 2017-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : FrontTrack_Projector.hxx
// Created : Wed Apr 26 20:12:13 2017
// Author : Edward AGAPOV (eap)
#ifndef __FrontTrack_Projector_HXX__
#define __FrontTrack_Projector_HXX__
#include <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

View File

@ -1,164 +0,0 @@
// Copyright (C) 2017-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : FrontTrack_Utils.cxx
// Created : Tue Apr 25 17:28:58 2017
// Author : Edward AGAPOV (eap)
#include "FrontTrack_Utils.hxx"
#include <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;
}

View File

@ -1,72 +0,0 @@
// Copyright (C) 2017-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : FrontTrack_Utils.hxx
// Created : Tue Apr 25 17:23:33 2017
// Author : Edward AGAPOV (eap)
#ifndef __FrontTrack_Utils_HXX__
#define __FrontTrack_Utils_HXX__
#include "FrontTrack_Projector.hxx"
#include <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

View File

@ -1,83 +0,0 @@
# Copyright (C) 2017-2020 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
INCLUDE(${SWIG_USE_FILE})
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
${PYTHON_INCLUDE_DIRS}
${PTHREAD_INCLUDE_DIR} # pthread dependancy due to python2.7 library
${CMAKE_CURRENT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/src/ADAPTFrontTrack
)
# additional preprocessor / compiler flags
ADD_DEFINITIONS(
${PYTHON_DEFINITIONS}
)
# libraries to link to
SET(_link_LIBRARIES
${PYTHON_LIBRARIES}
${PLATFORM_LIBS}
ADAPTFrontTrack
)
# --- headers ---
# header files / to be processed by moc
SET(ADAPTFrontTrack_Swig_HEADERS
FrontTrack.i
)
# --- sources ---
# sources / static
SET(ADAPTFrontTrack_Swig_SOURCES
${ADAPTFrontTrack_Swig_HEADERS}
)
# swig flags
SET_SOURCE_FILES_PROPERTIES(FrontTrack.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(FrontTrack.i PROPERTIES SWIG_DEFINITIONS "-shadow")
# --- scripts ---
# scripts / swig wrappings
SET(_swig_SCRIPTS
${CMAKE_CURRENT_BINARY_DIR}/FrontTrack.py
)
# --- rules ---
IF(${CMAKE_VERSION} VERSION_LESS "3.8.0")
SWIG_ADD_MODULE(FrontTrack_Swig python ${ADAPTFrontTrack_Swig_SOURCES})
ELSE()
SWIG_ADD_LIBRARY(FrontTrack_Swig LANGUAGE python SOURCES ${ADAPTFrontTrack_Swig_SOURCES})
ENDIF()
SWIG_LINK_LIBRARIES(FrontTrack_Swig ${_link_LIBRARIES})
SWIG_CHECK_GENERATION(FrontTrack_Swig)
IF(WIN32)
SET_TARGET_PROPERTIES(_FrontTrack_Swig PROPERTIES DEBUG_OUTPUT_NAME _FrontTrack_Swig_d)
ENDIF(WIN32)
INSTALL(TARGETS ${SWIG_MODULE_FrontTrack_Swig_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
SALOME_INSTALL_SCRIPTS("${_swig_SCRIPTS}" ${SALOME_INSTALL_PYTHON} EXTRA_DPYS "${SWIG_MODULE_FrontTrack_Swig_REAL_NAME}")

View File

@ -1,67 +0,0 @@
// Copyright (C) 2017-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : FrontTrack.i
// Created : Fri Apr 28 17:36:20 2017
// Author : Edward AGAPOV (eap)
%module FrontTrack
%{
#include "FrontTrack.hxx"
#include <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"

View File

@ -1,415 +0,0 @@
<?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 &quot;%1&quot; 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>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,183 +0,0 @@
# Copyright (C) 2012-2020 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
INCLUDE(UseQtExt)
INCLUDE(UsePyQt)
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
${QT_INCLUDES}
${OpenCASCADE_INCLUDE_DIR}
${PYTHON_INCLUDE_DIRS}
${MEDFILE_INCLUDE_DIRS}
${HDF5_INCLUDE_DIRS}
${OMNIORB_INCLUDE_DIR}
${KERNEL_INCLUDE_DIRS}
${GUI_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_BINARY_DIR}
${PROJECT_BINARY_DIR}/idl
${PROJECT_BINARY_DIR}/adm_local/unix
${PROJECT_SOURCE_DIR}/src/ADAPT
${PROJECT_SOURCE_DIR}/src/ADAPT_I
${PROJECT_SOURCE_DIR}/src/SMESH_I
${PROJECT_SOURCE_DIR}/src/SMESH
${MEDCOUPLING_INCLUDE_DIRS}
)
# additional preprocessor / compiler flags
ADD_DEFINITIONS(
${OMNIORB_DEFINITIONS}
${OpenCASCADE_DEFINITIONS}
${KERNEL_DEFINITIONS}
)
# libraries to link to
SET(_link_LIBRARIES
${MEDFILE_C_LIBRARIES}
${KERNEL_SalomeLifeCycleCORBA}
${KERNEL_SalomeDS}
${GUI_SalomeApp}
${SMESH_SalomeIDLSMESH}
${SMESH_SMESHEngine}
ADAPTEngine
${MEDCoupling_medloader}
SMESHimpl
)
# --- resources ---
# resource files / to be processed by lrelease
SET(_ts_RESOURCES
ADAPT_msg_en.ts
ADAPT_msg_fr.ts
ADAPT_msg_ja.ts
)
# resource files / to be processed by uic
SET(_uic_FILES
CreateBoundaryCAO.ui
CreateBoundaryAn.ui
CreateBoundaryDi.ui
CreateCase.ui
CreateHypothesis.ui
CreateIteration.ui
CreateListGroup.ui
CreateYACS.ui
CreateZone.ui
EditFile.ui
IterInfo.ui
MeshInfo.ui
PursueIteration.ui
)
# --- headers ---
# header files / to be processed by moc
SET(_moc_HEADERS
MonCreateBoundaryCAO.h
MonCreateBoundaryAn.h
MonCreateBoundaryDi.h
MonEditBoundaryCAO.h
MonEditBoundaryAn.h
MonEditBoundaryDi.h
MonCreateCase.h
MonEditCase.h
MonCreateZone.h
MonEditZone.h
MonCreateHypothesis.h
MonEditHypothesis.h
MonCreateListGroup.h
MonCreateListGroupCAO.h
MonEditListGroup.h
MonEditListGroupCAO.h
MonCreateIteration.h
MonEditIteration.h
MonPursueIteration.h
MonMeshInfo.h
MonIterInfo.h
MonCreateYACS.h
MonEditYACS.h
MonEditFile.h
#~MG_ADAPTGUI.hxx
)
# header files / uic wrappings
QT_WRAP_UIC(_uic_HEADERS ${_uic_FILES})
# header files / static
SET(_other_HEADERS
HOMARDGUI_Utils.h
HomardQtCommun.h
HOMARDGUI_Exports.hxx
)
# header files / to install
SET(ADAPT_HEADERS ${_other_HEADERS} ${_moc_HEADERS} ${_uic_HEADERS})
# --- sources ---
# sources / moc wrappings
QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
# sources / static
SET(_other_SOURCES
HOMARDGUI_Utils.cxx
MonCreateBoundaryCAO.cxx
MonCreateBoundaryAn.cxx
MonCreateBoundaryDi.cxx
MonEditBoundaryCAO.cxx
MonEditBoundaryAn.cxx
MonEditBoundaryDi.cxx
MonCreateCase.cxx
MonEditCase.cxx
MonCreateHypothesis.cxx
MonEditHypothesis.cxx
MonCreateListGroup.cxx
MonCreateListGroupCAO.cxx
MonEditListGroup.cxx
MonEditListGroupCAO.cxx
MonCreateIteration.cxx
MonEditIteration.cxx
MonPursueIteration.cxx
MonCreateZone.cxx
MonEditZone.cxx
MonMeshInfo.cxx
MonIterInfo.cxx
MonCreateYACS.cxx
MonEditYACS.cxx
MonEditFile.cxx
HomardQtCommun.cxx
#~MG_ADAPTGUI.cxx
)
# sources / to compile
SET(ADAPT_SOURCES ${_other_SOURCES} ${_moc_SOURCES} ${_uic_HEADERS})
# --- rules ---
ADD_LIBRARY(ADAPTGUI ${ADAPT_SOURCES})
TARGET_LINK_LIBRARIES(ADAPTGUI ${_link_LIBRARIES} )
INSTALL(TARGETS ADAPTGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${ADAPT_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_ADAPT_INSTALL_RES_DATA}")

File diff suppressed because it is too large Load Diff

View File

@ -1,133 +0,0 @@
<?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>

View File

@ -1,133 +0,0 @@
<?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>

View File

@ -1,777 +0,0 @@
<?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>

File diff suppressed because it is too large Load Diff

View File

@ -1,600 +0,0 @@
<?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>

View File

@ -1,121 +0,0 @@
<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>

View File

@ -1,526 +0,0 @@
<?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 &gt; Vref</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QRadioButton" name="RBVMaxAbs">
<property name="text">
<string>Vtest &lt; 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>

File diff suppressed because it is too large Load Diff

View File

@ -1,115 +0,0 @@
<?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>

View File

@ -1,35 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _HOMARDGUI_EXPORTS_H_
#define _HOMARDGUI_EXPORTS_H_
#ifdef WIN32
#if defined HOMARD_EXPORTS || defined Homard_EXPORTS
#define HOMARD_EXPORT __declspec( dllexport )
#else
#define HOMARD_EXPORT __declspec( dllimport )
#endif
#else
#define HOMARD_EXPORT
#endif
#endif //_HOMARDGUI_EXPORTS_H_

View File

@ -1,277 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "HOMARDGUI_Utils.h"
#include "OB_Browser.h"
#include "SUIT_Desktop.h"
#include "SUIT_Application.h"
#include "SUIT_Session.h"
#include "LightApp_SelectionMgr.h"
#include "SalomeApp_Application.h"
#include "SalomeApp_Module.h"
#include "SalomeApp_Study.h"
#include "SALOME_ListIO.hxx"
#include "SALOMEconfig.h"
#include "utilities.h"
#include <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);
// }
}
//=========================================================================================================

View File

@ -1,90 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef HOMARD_H_UTILS
#define HOMARD_H_UTILS
#include "HOMARDGUI_Exports.hxx"
#include <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

View File

@ -1,453 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "HomardQtCommun.h"
#include "HOMARDGUI_Utils.h"
#include <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;
}

View File

@ -1,58 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef HOMARDQTCOMMUN_H
#define HOMARDQTCOMMUN_H
#include "HOMARDGUI_Exports.hxx"
#include <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

View File

@ -1,129 +0,0 @@
<?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>

View File

@ -1,285 +0,0 @@
<?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>

View File

@ -1,809 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MonCreateBoundaryAn.h"
#include "MonCreateCase.h"
#include <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")
}

View File

@ -1,96 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef MON_CREATEBOUNDARYAN_H
#define MON_CREATEBOUNDARYAN_H
#include "HOMARDGUI_Exports.hxx"
#include <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

View File

@ -1,202 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MonCreateBoundaryCAO.h"
#include "MonCreateListGroupCAO.h"
#include "MonCreateCase.h"
#include <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();
}

View File

@ -1,73 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef MON_CREATEBOUNDARYCAO_H
#define MON_CREATEBOUNDARYCAO_H
#include "HOMARDGUI_Exports.hxx"
#include <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

View File

@ -1,211 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MonCreateBoundaryDi.h"
#include "MonCreateListGroup.h"
#include "MonCreateCase.h"
#include <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();
}

View File

@ -1,73 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef MON_CREATEBOUNDARYDI_H
#define MON_CREATEBOUNDARYDI_H
#include "HOMARDGUI_Exports.hxx"
#include <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

View File

@ -1,694 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MonCreateCase.h"
#include "MonCreateBoundaryCAO.h"
#include "MonEditBoundaryCAO.h"
#include "MonCreateBoundaryAn.h"
#include "MonEditBoundaryAn.h"
#include "MonCreateBoundaryDi.h"
#include "MonEditBoundaryDi.h"
#include "HOMARD.hxx"
#include <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();
}

View File

@ -1,102 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef MON_CREATECASE_H
#define MON_CREATECASE_H
#include "HOMARDGUI_Exports.hxx"
#include <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

View File

@ -1,945 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MonCreateHypothesis.h"
#include "MonCreateListGroup.h"
#include "MonCreateIteration.h"
#include "MonCreateZone.h"
#include "MonEditZone.h"
#include <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 ;
}

View File

@ -1,138 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef MON_CREATEHYPOTHESIS_H
#define MON_CREATEHYPOTHESIS_H
#include "HOMARDGUI_Exports.hxx"
#include <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

View File

@ -1,339 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MonCreateIteration.h"
#include "MonCreateHypothesis.h"
#include "MonEditHypothesis.h"
#include <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();
}

View File

@ -1,78 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef MON_CREATEITERATION_H
#define MON_CREATEITERATION_H
#include "HOMARDGUI_Exports.hxx"
#include <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

View File

@ -1,153 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MonCreateListGroup.h"
#include "MonCreateHypothesis.h"
#include "MonCreateBoundaryDi.h"
#include <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 ");
}

View File

@ -1,64 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef MON_CREATELISTGROUP_H
#define MON_CREATELISTGROUP_H
#include "HOMARDGUI_Exports.hxx"
#include <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

View File

@ -1,150 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MonCreateListGroupCAO.h"
#include "MonCreateHypothesis.h"
#include "MonCreateBoundaryCAO.h"
#include <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 ");
}

View File

@ -1,64 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef MON_CREATELISTGROUPCAO_H
#define MON_CREATELISTGROUPCAO_H
#include "HOMARDGUI_Exports.hxx"
#include <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

View File

@ -1,342 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MonCreateYACS.h"
#include "HOMARD.hxx"
#include <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 ;
}

View File

@ -1,84 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef MON_CREATEYACS_H
#define MON_CREATEYACS_H
#include "HOMARDGUI_Exports.hxx"
#include <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

View File

@ -1,713 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MonCreateZone.h"
#include "MonCreateHypothesis.h"
#include <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")
}

View File

@ -1,87 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef MON_CREATEZONE_H
#define MON_CREATEZONE_H
#include "HOMARDGUI_Exports.hxx"
#include <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

View File

@ -1,399 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MonEditBoundaryAn.h"
#include "SalomeApp_Tools.h"
#include "HOMARDGUI_Utils.h"
#include <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;
}

View File

@ -1,61 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef MON_EDITBOUNDARYAN_H
#define MON_EDITBOUNDARYAN_H
#include "HOMARDGUI_Exports.hxx"
#include <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

View File

@ -1,105 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MonEditBoundaryCAO.h"
#include "MonEditListGroupCAO.h"
#include <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();
}

View File

@ -1,51 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef MON_EDITBOUNDARYCAO_H
#define MON_EDITBOUNDARYCAO_H
#include "HOMARDGUI_Exports.hxx"
#include <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

View File

@ -1,105 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MonEditBoundaryDi.h"
#include "MonEditListGroup.h"
#include <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();
}

View File

@ -1,51 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef MON_EDITBOUNDARYDI_H
#define MON_EDITBOUNDARYDI_H
#include "HOMARDGUI_Exports.hxx"
#include <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

View File

@ -1,269 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MonEditCase.h"
#include "SalomeApp_Tools.h"
#include "HOMARDGUI_Utils.h"
#include "HomardQtCommun.h"
#include <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 ;
};

View File

@ -1,50 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef MON_EDITCASE_H
#define MON_EDITCASE_H
#include "HOMARDGUI_Exports.hxx"
#include <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

View File

@ -1,119 +0,0 @@
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MonEditFile.h"
#include <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;
}

Some files were not shown because too many files have changed in this diff Show More