From d0b3a9e937d449e00b681ffce61ff1b370709496 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 6 Apr 2016 17:24:26 +0300 Subject: [PATCH] 0021803: EDF 2351 : Available versions of MED in TUI function ExportMED aren't consistent with GUI behavior Step 1: remove med version enum from MEDWrapper --- CMakeLists.txt | 2 +- SalomeSMESHConfig.cmake.in | 2 - src/DriverMED/CMakeLists.txt | 5 +- src/DriverMED/DriverMED_Family.cxx | 6 +- src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx | 4 +- src/DriverMED/DriverMED_W_Field.cxx | 2 +- src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx | 17 +- src/DriverMED/DriverMED_W_SMESHDS_Mesh.h | 6 +- src/MEDWrapper/Base/CMakeLists.txt | 78 ---- src/MEDWrapper/CMakeLists.txt | 72 +++- src/MEDWrapper/Factory/CMakeLists.txt | 73 ---- src/MEDWrapper/Factory/MED_Factory.cxx | 167 --------- src/MEDWrapper/Factory/MED_Test.cxx | 347 ------------------ src/MEDWrapper/Factory/MED_WrapperFactory.hxx | 46 --- src/MEDWrapper/{Base => }/MED_Algorithm.cxx | 2 +- src/MEDWrapper/{Base => }/MED_Algorithm.hxx | 56 ++- src/MEDWrapper/{Base => }/MED_Common.hxx | 27 +- src/MEDWrapper/{Base => }/MED_CoordUtils.cxx | 2 +- src/MEDWrapper/{Base => }/MED_CoordUtils.hxx | 9 +- src/MEDWrapper/MED_Factory.cxx | 145 ++++++++ src/MEDWrapper/{Factory => }/MED_Factory.hxx | 24 +- src/MEDWrapper/{Base => }/MED_GaussDef.cxx | 43 +-- src/MEDWrapper/{Base => }/MED_GaussDef.hxx | 10 +- src/MEDWrapper/{Base => }/MED_GaussUtils.cxx | 3 +- src/MEDWrapper/{Base => }/MED_GaussUtils.hxx | 7 +- src/MEDWrapper/{Base => }/MED_SharedPtr.hxx | 6 +- src/MEDWrapper/{Base => }/MED_SliceArray.hxx | 6 +- src/MEDWrapper/{Base => }/MED_Structures.cxx | 4 +- src/MEDWrapper/{Base => }/MED_Structures.hxx | 29 +- src/MEDWrapper/{Base => }/MED_TStructures.hxx | 198 +++++----- src/MEDWrapper/{Base => }/MED_TWrapper.hxx | 115 +++--- src/MEDWrapper/{Base => }/MED_Utilities.cxx | 93 +++-- src/MEDWrapper/{Base => }/MED_Utilities.hxx | 13 +- .../{V2_2 => }/MED_V2_2_Wrapper.cxx | 74 +--- .../{V2_2 => }/MED_V2_2_Wrapper.hxx | 66 ++-- src/MEDWrapper/{Base => }/MED_Vector.hxx | 5 +- src/MEDWrapper/{Base => }/MED_Wrapper.cxx | 4 +- src/MEDWrapper/{Base => }/MED_Wrapper.hxx | 21 +- ...MED_WrapperBase.hxx => MED_WrapperDef.hxx} | 30 +- src/MEDWrapper/V2_2/CMakeLists.txt | 63 ---- .../{Factory => }/mprint_version.cxx | 0 src/SMESH/CMakeLists.txt | 2 +- src/SMESH/SMESH_Mesh.cxx | 4 +- src/SMESHClient/CMakeLists.txt | 2 - src/SMESHGUI/CMakeLists.txt | 2 +- src/SMESH_I/CMakeLists.txt | 3 +- src/SMESH_I/SMESH_Gen_i.cxx | 19 +- src/SMESH_I/SMESH_Mesh_i.cxx | 5 +- src/SMESH_I/SMESH_PreMeshInfo.cxx | 7 +- 49 files changed, 570 insertions(+), 1356 deletions(-) delete mode 100644 src/MEDWrapper/Base/CMakeLists.txt delete mode 100644 src/MEDWrapper/Factory/CMakeLists.txt delete mode 100644 src/MEDWrapper/Factory/MED_Factory.cxx delete mode 100644 src/MEDWrapper/Factory/MED_Test.cxx delete mode 100755 src/MEDWrapper/Factory/MED_WrapperFactory.hxx rename src/MEDWrapper/{Base => }/MED_Algorithm.cxx (100%) rename src/MEDWrapper/{Base => }/MED_Algorithm.hxx (94%) rename src/MEDWrapper/{Base => }/MED_Common.hxx (94%) rename src/MEDWrapper/{Base => }/MED_CoordUtils.cxx (100%) rename src/MEDWrapper/{Base => }/MED_CoordUtils.hxx (96%) create mode 100644 src/MEDWrapper/MED_Factory.cxx rename src/MEDWrapper/{Factory => }/MED_Factory.hxx (68%) rename src/MEDWrapper/{Base => }/MED_GaussDef.cxx (92%) rename src/MEDWrapper/{Base => }/MED_GaussDef.hxx (93%) rename src/MEDWrapper/{Base => }/MED_GaussUtils.cxx (99%) rename src/MEDWrapper/{Base => }/MED_GaussUtils.hxx (99%) rename src/MEDWrapper/{Base => }/MED_SharedPtr.hxx (98%) rename src/MEDWrapper/{Base => }/MED_SliceArray.hxx (97%) rename src/MEDWrapper/{Base => }/MED_Structures.cxx (99%) rename src/MEDWrapper/{Base => }/MED_Structures.hxx (99%) rename src/MEDWrapper/{Base => }/MED_TStructures.hxx (84%) rename src/MEDWrapper/{Base => }/MED_TWrapper.hxx (84%) rename src/MEDWrapper/{Base => }/MED_Utilities.cxx (50%) rename src/MEDWrapper/{Base => }/MED_Utilities.hxx (94%) rename src/MEDWrapper/{V2_2 => }/MED_V2_2_Wrapper.cxx (99%) rename src/MEDWrapper/{V2_2 => }/MED_V2_2_Wrapper.hxx (93%) rename src/MEDWrapper/{Base => }/MED_Vector.hxx (99%) rename src/MEDWrapper/{Base => }/MED_Wrapper.cxx (99%) rename src/MEDWrapper/{Base => }/MED_Wrapper.hxx (99%) rename src/MEDWrapper/{Base/MED_WrapperBase.hxx => MED_WrapperDef.hxx} (68%) delete mode 100644 src/MEDWrapper/V2_2/CMakeLists.txt rename src/MEDWrapper/{Factory => }/mprint_version.cxx (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index a2d069f66..dbc813891 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -296,7 +296,7 @@ INCLUDE(CMakePackageConfigHelpers) # They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup" SET(_${PROJECT_NAME}_exposed_targets SMESHControls MeshDriver MeshDriverDAT MeshDriverGMF MeshDriverMED - MeshDriverSTL MeshDriverUNV MEDWrapperBase MEDWrapper MEDWrapper_V2_2 + MeshDriverSTL MeshDriverUNV MEDWrapper SMDS SMESHimpl SMESHEngine SMESHClient SMESHDS SMESHUtils StdMeshers StdMeshersEngine MeshJobManagerEngine SPADDERPluginTesterEngine SalomeIDLSMESH SalomeIDLSPADDER diff --git a/SalomeSMESHConfig.cmake.in b/SalomeSMESHConfig.cmake.in index 6fe86346c..dbe99c27e 100644 --- a/SalomeSMESHConfig.cmake.in +++ b/SalomeSMESHConfig.cmake.in @@ -138,9 +138,7 @@ SET(SMESH_MeshDriverGMF MeshDriverGMF) SET(SMESH_MeshDriverMED MeshDriverMED) SET(SMESH_MeshDriverSTL MeshDriverSTL) SET(SMESH_MeshDriverUNV MeshDriverUNV) -SET(SMESH_MEDWrapperBase MEDWrapperBase) SET(SMESH_MEDWrapper MEDWrapper) -SET(SMESH_MEDWrapper_V2_2 MEDWrapper_V2_2) IF(SALOME_SMESH_ENABLE_MEFISTO) SET(SMESH_MEFISTO2D MEFISTO2D) ENDIF(SALOME_SMESH_ENABLE_MEFISTO) diff --git a/src/DriverMED/CMakeLists.txt b/src/DriverMED/CMakeLists.txt index c392d12ac..ce7b79ae4 100644 --- a/src/DriverMED/CMakeLists.txt +++ b/src/DriverMED/CMakeLists.txt @@ -25,8 +25,7 @@ INCLUDE_DIRECTORIES( ${CAS_INCLUDE_DIRS} ${VTK_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} - ${PROJECT_SOURCE_DIR}/src/MEDWrapper/Base - ${PROJECT_SOURCE_DIR}/src/MEDWrapper/Factory + ${PROJECT_SOURCE_DIR}/src/MEDWrapper ${PROJECT_SOURCE_DIR}/src/Driver ${PROJECT_SOURCE_DIR}/src/SMDS ${PROJECT_SOURCE_DIR}/src/SMESHUtils @@ -45,8 +44,6 @@ SET(_link_LIBRARIES ${Boost_LIBRARIES} MeshDriver MEDWrapper - MEDWrapperBase - MEDWrapper_V2_2 ) SET(_link_LIBRARIES_bin diff --git a/src/DriverMED/DriverMED_Family.cxx b/src/DriverMED/DriverMED_Family.cxx index 577879462..b0f7b818c 100644 --- a/src/DriverMED/DriverMED_Family.cxx +++ b/src/DriverMED/DriverMED_Family.cxx @@ -354,11 +354,7 @@ DriverMED_Family::GetFamilyInfo(const MED::PWrapper& theWrapper, } string aValue = aStr.str(); // PAL19785,0019867 - med forbids whitespace to be the last char in the name - int maxSize; - //if ( theWrapper->GetVersion() == MED::eV2_1 ) - // maxSize = MED::GetNOMLength(); - //else - maxSize = MED::GetNOMLength(); + int maxSize = MED::GetNOMLength(); int lastCharPos = min( maxSize, (int) aValue.size() ) - 1; while ( isspace( aValue[ lastCharPos ] )) aValue.resize( lastCharPos-- ); diff --git a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx index 3164ae065..988660a7d 100644 --- a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx @@ -110,7 +110,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() #endif myFamilies.clear(); if(MYDEBUG) MESSAGE("Perform - myFile : "<GetNbMeshes(); @@ -1021,7 +1021,7 @@ list DriverMED_R_SMESHDS_Mesh::GetMeshNames(Status& theStatus) try { if(MYDEBUG) MESSAGE("GetMeshNames - myFile : " << myFile); theStatus = DRS_OK; - PWrapper aMed = CrWrapper(myFile); + PWrapper aMed = CrWrapperR(myFile); if (TInt aNbMeshes = aMed->GetNbMeshes()) { for (int iMesh = 0; iMesh < aNbMeshes; iMesh++) { diff --git a/src/DriverMED/DriverMED_W_Field.cxx b/src/DriverMED/DriverMED_W_Field.cxx index e4a7e4220..475730607 100644 --- a/src/DriverMED/DriverMED_W_Field.cxx +++ b/src/DriverMED/DriverMED_W_Field.cxx @@ -254,7 +254,7 @@ Driver_Mesh::Status DriverMED_W_Field::Perform() if ( !myMesh ) return addMessage("Supporting mesh not set", /*isFatal=*/true ); - MED::PWrapper medFile = MED::CrWrapper( myFile, MED::eV2_2 ); + MED::PWrapper medFile = MED::CrWrapperW( myFile ); MED::PMeshInfo meshInfo; if ( myMeshId > 0 ) { diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx index f31f262c0..283ed6355 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx @@ -52,7 +52,6 @@ using namespace MED; DriverMED_W_SMESHDS_Mesh::DriverMED_W_SMESHDS_Mesh(): - myMedVersion(MED::eV2_2), myAllSubMeshes (false), myDoGroupOfNodes (false), myDoGroupOfEdges (false), @@ -64,26 +63,16 @@ DriverMED_W_SMESHDS_Mesh::DriverMED_W_SMESHDS_Mesh(): myAddODOnVertices(false) {} -void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName, - MED::EVersion theId) -{ - Driver_SMESHDS_Mesh::SetFile(theFileName); - myMedVersion = theId; -} - void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName) { Driver_SMESHDS_Mesh::SetFile(theFileName); } -string DriverMED_W_SMESHDS_Mesh::GetVersionString(const MED::EVersion theVersion, int theNbDigits) +string DriverMED_W_SMESHDS_Mesh::GetVersionString(int theNbDigits) { TInt majeur, mineur, release; majeur = mineur = release = 0; -// if ( theVersion == eV2_1 ) -// MED::GetVersionRelease(majeur, mineur, release); -// else - MED::GetVersionRelease(majeur, mineur, release); + MED::GetVersionRelease(majeur, mineur, release); ostringstream name; if ( theNbDigits > 0 ) name << majeur; @@ -430,7 +419,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() } } - MED::PWrapper myMed = CrWrapper(myFile,myMedVersion); + MED::PWrapper myMed = CrWrapperW(myFile); PMeshInfo aMeshInfo = myMed->CrMeshInfo(aMeshDimension,aSpaceDimension,aMeshName); //MESSAGE("Add - aMeshName : "<GetName()); myMed->SetMeshInfo(aMeshInfo); diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.h b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.h index 873adf450..27a44bf4b 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.h +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.h @@ -47,11 +47,10 @@ class MESHDRIVERMED_EXPORT DriverMED_W_SMESHDS_Mesh: public Driver_SMESHDS_Mesh DriverMED_W_SMESHDS_Mesh(); - virtual void SetFile(const std::string& theFileName); - void SetFile(const std::string& theFileName, MED::EVersion theId); + void SetFile(const std::string& theFileName); void SetAutoDimension(bool toFindOutDimension) { myAutoDimension = toFindOutDimension; } - static std::string GetVersionString(const MED::EVersion theVersion, int theNbDigits=2); + static std::string GetVersionString(int theNbDigits=2); void AddGroupOfNodes(); void AddGroupOfEdges(); @@ -76,7 +75,6 @@ class MESHDRIVERMED_EXPORT DriverMED_W_SMESHDS_Mesh: public Driver_SMESHDS_Mesh private: - MED::EVersion myMedVersion; std::list myGroups; bool myAllSubMeshes; std::vector mySubMeshes; diff --git a/src/MEDWrapper/Base/CMakeLists.txt b/src/MEDWrapper/Base/CMakeLists.txt deleted file mode 100644 index 85f66d890..000000000 --- a/src/MEDWrapper/Base/CMakeLists.txt +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright (C) 2012-2016 CEA/DEN, EDF R&D, OPEN CASCADE -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# 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( - ${HDF5_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${KERNEL_INCLUDE_DIRS} - ${MEDFILE_INCLUDE_DIRS} -) - -# additional preprocessor / compiler flags -ADD_DEFINITIONS( - ${HDF5_DEFINITIONS} - ${BOOST_DEFINITIONS} -) - -SET(_link_LIBRARIES - ${Boost_LIBRARIES} -) - -# --- headers --- - -# header files / no moc processing -SET(MEDWrapperBase_HEADERS - MED_Common.hxx - MED_Vector.hxx - MED_SharedPtr.hxx - MED_SliceArray.hxx - MED_Wrapper.hxx - MED_TWrapper.hxx - MED_Structures.hxx - MED_TStructures.hxx - MED_Algorithm.hxx - MED_GaussUtils.hxx - MED_CoordUtils.hxx - MED_Utilities.hxx - MED_GaussDef.hxx - MED_WrapperBase.hxx -) - -# --- sources --- - -# sources / static -SET(MEDWrapperBase_SOURCES - MED_Structures.cxx - MED_Wrapper.cxx - MED_Algorithm.cxx - MED_GaussUtils.cxx - MED_CoordUtils.cxx - MED_Utilities.cxx - MED_GaussDef.cxx -) - -# --- rules --- - -ADD_LIBRARY(MEDWrapperBase ${MEDWrapperBase_SOURCES}) -TARGET_LINK_LIBRARIES(MEDWrapperBase ${_link_LIBRARIES}) -INSTALL(TARGETS MEDWrapperBase EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) - -INSTALL(FILES ${MEDWrapperBase_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) diff --git a/src/MEDWrapper/CMakeLists.txt b/src/MEDWrapper/CMakeLists.txt index 73883730b..b08ed4188 100644 --- a/src/MEDWrapper/CMakeLists.txt +++ b/src/MEDWrapper/CMakeLists.txt @@ -17,6 +17,72 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -ADD_SUBDIRECTORY(Base) -ADD_SUBDIRECTORY(V2_2) -ADD_SUBDIRECTORY(Factory) +# --- options --- +# additional include directories +INCLUDE_DIRECTORIES( + ${Boost_INCLUDE_DIRS} + ${HDF5_INCLUDE_DIRS} + ${MEDFILE_INCLUDE_DIRS} + ${KERNEL_INCLUDE_DIRS} +) + +# additional preprocessor / compiler flags +ADD_DEFINITIONS( + ${BOOST_DEFINITIONS} + ${HDF5_DEFINITIONS} +) + +SET(_link_LIBRARIES + ${Boost_LIBRARIES} + ${HDF5_LIBS} + ${MEDFILE_C_LIBRARIES} +) + +# --- headers --- + +# header files / no moc processing +SET(MEDWrapper_HEADERS + MED_Algorithm.hxx + MED_Common.hxx + MED_CoordUtils.hxx + MED_Factory.hxx + MED_GaussDef.hxx + MED_GaussUtils.hxx + MED_SharedPtr.hxx + MED_SliceArray.hxx + MED_Structures.hxx + MED_TStructures.hxx + MED_TWrapper.hxx + MED_Utilities.hxx + MED_V2_2_Wrapper.hxx + MED_Vector.hxx + MED_Wrapper.hxx + MED_WrapperDef.hxx +) + +# --- sources --- + +# sources / static +SET(MEDWrapper_SOURCES + MED_Algorithm.cxx + MED_CoordUtils.cxx + MED_Factory.cxx + MED_GaussDef.cxx + MED_GaussUtils.cxx + MED_Structures.cxx + MED_Utilities.cxx + MED_V2_2_Wrapper.cxx + MED_Wrapper.cxx +) + +# --- rules --- + +ADD_LIBRARY(MEDWrapper ${MEDWrapper_SOURCES}) +TARGET_LINK_LIBRARIES(MEDWrapper ${_link_LIBRARIES}) +INSTALL(TARGETS MEDWrapper EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) + +ADD_EXECUTABLE(mprint_version mprint_version.cxx) +TARGET_LINK_LIBRARIES(mprint_version ${MEDFILE_C_LIBRARIES}) +INSTALL(TARGETS mprint_version EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) + +INSTALL(FILES ${MEDWrapper_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) diff --git a/src/MEDWrapper/Factory/CMakeLists.txt b/src/MEDWrapper/Factory/CMakeLists.txt deleted file mode 100644 index 0a84ab90e..000000000 --- a/src/MEDWrapper/Factory/CMakeLists.txt +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright (C) 2012-2016 CEA/DEN, EDF R&D, OPEN CASCADE -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# 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( - ${HDF5_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${MEDFILE_INCLUDE_DIRS} - ${KERNEL_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR}/../Base - ${CMAKE_CURRENT_SOURCE_DIR}/../V2_2 -) - -# additional preprocessor / compiler flags -ADD_DEFINITIONS( - ${HDF5_DEFINITIONS} - ${BOOST_DEFINITIONS} -) - -SET(_link_LIBRARIES - MEDWrapperBase - MEDWrapper_V2_2 - ${Boost_LIBRARIES} - ${MEDFILE_C_LIBRARIES} -) - -# --- headers --- - -# header files / no moc processing -SET(MEDWrapper_HEADERS - MED_Factory.hxx - MED_WrapperFactory.hxx -) - -# --- sources --- - -# sources / static -SET(MEDWrapper_SOURCES - MED_Factory.cxx -) - -# --- rules --- - -ADD_LIBRARY(MEDWrapper ${MEDWrapper_SOURCES}) -TARGET_LINK_LIBRARIES(MEDWrapper ${_link_LIBRARIES} ${MED_medloader} ) -INSTALL(TARGETS MEDWrapper EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) - -ADD_EXECUTABLE(mprint_version mprint_version.cxx) -TARGET_LINK_LIBRARIES(mprint_version ${_link_LIBRARIES} MEDWrapper) - -ADD_EXECUTABLE(MED_Test MED_Test.cxx) -TARGET_LINK_LIBRARIES(MED_Test ${_link_LIBRARIES} MEDWrapper) - -INSTALL(TARGETS mprint_version MED_Test EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) - -INSTALL(FILES ${MEDWrapper_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) diff --git a/src/MEDWrapper/Factory/MED_Factory.cxx b/src/MEDWrapper/Factory/MED_Factory.cxx deleted file mode 100644 index 49d47fad5..000000000 --- a/src/MEDWrapper/Factory/MED_Factory.cxx +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "MED_Factory.hxx" -#include "MED_Utilities.hxx" -#include "MED_V2_2_Wrapper.hxx" - -#include -#include -#include - -#include -extern "C" -{ -#ifndef WIN32 - #include -#endif -} - -#ifdef _DEBUG_ -static int MYDEBUG = 0; -#else -static int MYDEBUG = 0; -#endif - -namespace MED -{ - - EVersion GetVersionId(const std::string& theFileName, - bool theDoPreCheckInSeparateProcess) - { - INITMSG(MYDEBUG,"GetVersionId - theFileName = '"<&1 > /dev/null"; - - std::string aCommand = aStr.str(); - int aStatus = system(aCommand.c_str()); - - BEGMSG( MYDEBUG,"aCommand = '" << aCommand << "'; aStatus = " << aStatus - << "; errno = " << errno << " = " << strerror( errno ) << std::endl ); - if ( aStatus != 0 && errno != EAGAIN && errno != ENOMEM ) // "Cannot allocate memory" is OK - return aVersion; - } -#endif - // check compatibility of hdf and med versions - med_bool hdfok, medok; - MEDfileCompatibility(theFileName.c_str(), &hdfok, &medok); - if ((!hdfok) /*|| (!medok)*/) // med-2.1 is KO since med-3.0.0 - return aVersion; - - // Next, try to open the file trough the MED API - const char* aFileName = theFileName.c_str(); - med_idt aFid = MEDfileOpen(aFileName,MED_ACC_RDONLY); - - MSG(MYDEBUG,"GetVersionId - theFileName = '"<GetNbProfiles() = "<GetNbProfiles()<GetNbMeshes(); - BEGMSG(MYDEBUG,"GetNbMeshes() = "<GetPMeshInfo(iMesh); - INITMSG(MYDEBUG,"aMeshInfo->GetName() = '"<GetName()<<"'"<GetEntityInfo(aMeshInfo); - - TEntity2TGeom2ElemInfo anEntity2TGeom2ElemInfo = - GetEntity2TGeom2ElemInfo(aMed,aMeshInfo,aEntityInfo); - - TFieldInfo2TimeStampInfoSet aFieldInfo2TimeStampInfoSet = - GetFieldInfo2TimeStampInfoSet(aMed,aMeshInfo,aEntityInfo); - - TEntite2TFieldInfo2TimeStampInfoSet anEntite2TFieldInfo2TimeStampInfoSet = - GetEntite2TFieldInfo2TimeStampInfoSet(aFieldInfo2TimeStampInfoSet); - - TEntite2TFieldInfo2TimeStampInfoSet::const_iterator anEntite2TFieldInfo2TimeStampInfoSetIter = - anEntite2TFieldInfo2TimeStampInfoSet.begin(); - for(; anEntite2TFieldInfo2TimeStampInfoSetIter != anEntite2TFieldInfo2TimeStampInfoSet.end(); anEntite2TFieldInfo2TimeStampInfoSetIter++){ - const TFieldInfo2TimeStampInfoSet& aFieldInfo2TimeStampInfoSet = anEntite2TFieldInfo2TimeStampInfoSetIter->second; - TFieldInfo2TimeStampInfoSet::const_iterator aFieldInfo2TimeStampInfoSetIter = aFieldInfo2TimeStampInfoSet.begin(); - for(; aFieldInfo2TimeStampInfoSetIter != aFieldInfo2TimeStampInfoSet.end(); aFieldInfo2TimeStampInfoSetIter++){ - PFieldInfo aFieldInfo = aFieldInfo2TimeStampInfoSetIter->first; - INITMSG(MYDEBUG, - "GetPFieldInfo "<< - "- aName = '"<GetName()<<"'"<< - "; aType = "<GetType()<< - "; aNbComp = "<GetNbComp()<< - std::endl); - const TTimeStampInfoSet& aTimeStampInfoSet = aFieldInfo2TimeStampInfoSetIter->second; - TTimeStampInfoSet::const_iterator aTimeStampInfoSettIter = aTimeStampInfoSet.begin(); - for(; aTimeStampInfoSettIter != aTimeStampInfoSet.end(); aTimeStampInfoSettIter++){ - PTimeStampInfo aTimeStampInfo = *aTimeStampInfoSettIter; - INITMSG(MYDEBUG, - "GetPTimeStampInfo "<< - "- anEntity = "<GetEntity()<< - "; aNumDt = "<GetNumDt()<< - std::endl); - PTimeStampValueBase aTimeStampValue = - aMed->GetPTimeStampValue(aTimeStampInfo, - aMKey2Profile, - aKey2Gauss); - } - } - } - - continue; - - TFamilyInfoSet aFamilyInfoSet = GetFamilyInfoSet(aMed,aMeshInfo); - - TEntity2FamilySet aEntity2FamilySet = - GetEntity2FamilySet(aMed,anEntity2TGeom2ElemInfo,aFamilyInfoSet); - - TGroupInfo aGroupInfo = GetGroupInfo(aFamilyInfoSet); - - PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo); - TEntity2TGeom2ElemInfo::const_iterator anIter = anEntity2TGeom2ElemInfo.begin(); - for(; anIter != anEntity2TGeom2ElemInfo.end(); anIter++){ - const EEntiteMaillage& anEntity = anIter->first; - if(anEntity != eNOEUD){ - const TGeom2ElemInfo& aGeom2ElemInfo = anIter->second; - TKey2Gauss::const_iterator anIter2 = aKey2Gauss.begin(); - for(; anIter2 != aKey2Gauss.end(); anIter2++){ - const TGaussInfo::TKey& aKey = anIter2->first; - EGeometrieElement aGeom = boost::get<0>(aKey); - TGeom2ElemInfo::const_iterator anIter3 = aGeom2ElemInfo.find(aGeom); - if(anIter3 != aGeom2ElemInfo.end()){ - if(PCellInfo aCellInfo = anIter3->second){ - PGaussInfo aGaussInfo = anIter2->second; - TGaussCoord aGaussCoord; - GetGaussCoord3D(aGaussInfo,aCellInfo,aNodeInfo,aGaussCoord); - } - } - } - } - } - - } - } - MSG(MYDEBUG,"OK"); -} - - -void CopyMed(const PWrapper& theMed, - const PWrapper& theMed2, - int theIncr) -{ - TKey2Gauss aKey2Gauss = GetKey2Gauss(theMed); - TMKey2Profile aMKey2Profile = GetMKey2Profile(theMed); - - TInt aNbMeshes = theMed->GetNbMeshes(); - MSG(MYDEBUG,"aNbMeshes = "<GetPMeshInfo(iMesh+1); -#ifdef _DEBUG_ - TInt aDim = aMeshInfo->myDim; - aName = aMeshInfo->GetName(); - INITMSG(MYDEBUG,"GetMeshInfo - aName = '"<CrMeshInfo(aMeshInfo); - if(MYWRITEDEBUG){ - aName = aMeshInfo2->GetName(); - - aName[0] += theIncr; - aMeshInfo2->SetName(aName); - theMed2->SetMeshInfo(aMeshInfo2); - BEGMSG(MYDEBUG,"aNbMeshes2 = "<GetNbMeshes()<<"\n"); - } - - TEntityInfo aEntityInfo = theMed->GetEntityInfo(aMeshInfo); - - //continue; - - TInt aNbFields = theMed->GetNbFields(); - MSG(MYDEBUG,"GetNbFields() = "<GetPFieldInfo(aMeshInfo,iField+1); -#ifdef _DEBUG_ - TInt aNbComp = aFieldInfo->GetNbComp(); - INITMSG(MYDEBUG,"aName = '"<GetName()<<"'; aNbComp = "<CrFieldInfo(aMeshInfo2,aFieldInfo); - - if(MYWRITEDEBUG){ - aName = aFieldInfo->GetName(); - aName[0] += theIncr; - aFieldInfo2->SetName(aName); - theMed2->SetFieldInfo(aFieldInfo2); - } - - EEntiteMaillage anEntity; - TGeom2Size aGeom2Size; - TInt aNbTimeStamps = - theMed->GetNbTimeStamps(aFieldInfo,aEntityInfo,anEntity,aGeom2Size); - { - INITMSG(MYDEBUG,"GetNbTimeStamps = "<GetPTimeStampInfo(aFieldInfo,anEntity,aGeom2Size,iTimeStamp+1); -#ifdef _DEBUG_ - TInt aNumDt = aTimeStampInfo->GetNumDt(); - INITMSG(MYDEBUG,"aNumDt = "<CrTimeStampInfo(aFieldInfo2,aTimeStampInfo); - - PTimeStampValueBase aTimeStampValue = - theMed->GetPTimeStampValue(aTimeStampInfo, - aMKey2Profile, - aKey2Gauss); - - PTimeStampValueBase aTimeStampValue2 = - theMed->CrTimeStampValue(aTimeStampInfo2, - aTimeStampValue); - - if(MYWRITEDEBUG) theMed2->SetTimeStamp(aTimeStampValue2); - } - } - } - - TInt aNbFam = theMed->GetNbFamilies(aMeshInfo); - MSG(MYDEBUG,"GetNbFamilies() = "<GetPFamilyInfo(aMeshInfo,iFam+1); - TInt aNbGroup = aFamilyInfo->GetNbGroup(); -#ifdef _DEBUG_ - TInt aNbAttr = aFamilyInfo->GetNbAttr(); -#endif - TInt anId = aFamilyInfo->GetId(); - if(anId == 0) - continue; - - aName = aFamilyInfo->GetName(); -#ifdef _DEBUG_ - INITMSG(MYDEBUG,"aName = '"<CrFamilyInfo(aMeshInfo2,aFamilyInfo); - for(TInt iGroup = 0; iGroup < aNbGroup; iGroup++){ - aName = aFamilyInfo->GetGroupName(iGroup); - INITMSG(MYDEBUG,"aGroupName = '"<SetGroupName(iGroup,aName); - } - - if(MYWRITEDEBUG){ - aName = aFamilyInfo->GetName(); - aName[0] += theIncr; - aFamilyInfo2->SetName(aName); - theMed2->SetFamilyInfo(aFamilyInfo2); - INITMSG(MYDEBUG,"GetNbFamilies = "<GetNbFamilies(aMeshInfo2)<GetPNodeInfo(aMeshInfo); - PNodeInfo aNodeInfo2 = theMed->CrNodeInfo(aMeshInfo2,aNodeInfo); - if(MYWRITEDEBUG) theMed2->SetNodeInfo(aNodeInfo2); - continue; - } - TGeom2Size& aGeom2Size = anEntityInfoIter->second; - TGeom2Size::iterator aGeomIter = aGeom2Size.begin(); - for(; aGeomIter != aGeom2Size.end(); aGeomIter++){ - const EGeometrieElement& aGeom = aGeomIter->first; -#ifdef _DEBUG_ - const TInt& aNbElem = aGeomIter->second; - INITMSG(MYDEBUG,"aGeom = "<GetPPolygoneInfo(aMeshInfo,anEntity,aGeom); - PPolygoneInfo aPolygoneInfo2 = theMed->CrPolygoneInfo(aMeshInfo2,aPolygoneInfo); - if(MYWRITEDEBUG) theMed2->SetPolygoneInfo(aPolygoneInfo2); - break; - } - case ePOLYEDRE: { - PPolyedreInfo aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,anEntity,aGeom); - PPolyedreInfo aPolyedreInfo2 = theMed->CrPolyedreInfo(aMeshInfo2,aPolyedreInfo); - if(MYWRITEDEBUG) theMed2->SetPolyedreInfo(aPolyedreInfo2); - break; - } - default: - PCellInfo aCellInfo = theMed->GetPCellInfo(aMeshInfo,anEntity,aGeom); - PCellInfo aCellInfo2 = theMed2->CrCellInfo(aMeshInfo2,aCellInfo); - if(MYWRITEDEBUG) theMed2->SetCellInfo(aCellInfo2); - } - } - } - - } - MSG(MYDEBUG,"OK"); -} - - -void CopyMed(const std::string& theFileName, - const std::string& theFileName2, - MED::EVersion theVersion, - int theNbCopy) -{ - MSG(MYDEBUG,"CopyMed - theFileName = '"< +#include namespace MED { //--------------------------------------------------------------- typedef std::map TGeom2ElemInfo; typedef std::map TEntity2TGeom2ElemInfo; - + typedef std::set TFamilyInfoSet; + typedef std::map TGroupInfo; + typedef boost::tuple TFamilyTSize; + typedef std::set TFamilyTSizeSet; + typedef std::map TEntity2FamilySet; + typedef std::set TTimeStampInfoSet; + typedef std::map TFieldInfo2TimeStampInfoSet; + typedef std::map TEntite2TFieldInfo2TimeStampInfoSet; + typedef std::map TKey2Gauss; + typedef std::map TKey2Profile; + typedef boost::tuple TMKey2Profile; + typedef std::map TFamilyID2NbCells; + + //--------------------------------------------------------------- //! Get set of TElemInfo by its geometrical type and corresponding MED ENTITY MEDWRAPPER_EXPORT TEntity2TGeom2ElemInfo @@ -40,49 +55,34 @@ namespace MED const PMeshInfo& theMeshInfo, const MED::TEntityInfo& theEntityInfo); - //--------------------------------------------------------------- - typedef std::set TFamilyInfoSet; - //! Read set of MED FAMILIES for defined MED file MEDWRAPPER_EXPORT TFamilyInfoSet GetFamilyInfoSet(const PWrapper& theWrapper, const PMeshInfo& theMeshInfo); - //--------------------------------------------------------------- - typedef boost::tuple TFamilyTSize; - + //! Compare two MED FAMILIES + MEDWRAPPER_EXPORT bool operator<(const TFamilyTSize& theLeft, const TFamilyTSize& theRight); - typedef std::set TFamilyTSizeSet; - //--------------------------------------------------------------- - typedef std::map TEntity2FamilySet; - //! Split set of MED FAMILIES by corresponding MED ENTITY MEDWRAPPER_EXPORT TEntity2FamilySet GetEntity2FamilySet(const PWrapper& theWrapper, const TEntity2TGeom2ElemInfo& theEntity2TGeom2ElemInfo, const TFamilyInfoSet& theFamilyInfoSet); - //--------------------------------------------------------------- - typedef std::map TGroupInfo; - //! Split the input set of MED FAMILIES by corresponding MED GROUPS MEDWRAPPER_EXPORT TGroupInfo GetGroupInfo(const TFamilyInfoSet& theFamilyInfoSet); - //--------------------------------------------------------------- - typedef std::set TTimeStampInfoSet; - typedef std::map TFieldInfo2TimeStampInfoSet; - //! Read set of MED TIMESTAMPS groupped by corresponding MED FIELDS MEDWRAPPER_EXPORT TFieldInfo2TimeStampInfoSet @@ -90,19 +90,13 @@ namespace MED const PMeshInfo& theMeshInfo, const MED::TEntityInfo& theEntityInfo); - //--------------------------------------------------------------- - typedef std::map TEntite2TFieldInfo2TimeStampInfoSet; - //! Split the input set of MED TIMESTAMPS by corresponding MED FIELDS and MED ENTITIES MEDWRAPPER_EXPORT TEntite2TFieldInfo2TimeStampInfoSet GetEntite2TFieldInfo2TimeStampInfoSet(const TFieldInfo2TimeStampInfoSet& theFieldInfo2TimeStampInfoSet); - //--------------------------------------------------------------- - typedef std::map TKey2Gauss; - //! Read set of MED GAUSS MEDWRAPPER_EXPORT TKey2Gauss @@ -110,7 +104,6 @@ namespace MED TErr* theErr = NULL, EModeSwitch theMode = eFULL_INTERLACE); - //--------------------------------------------------------------- //! Get MED PROFILE by its name MEDWRAPPER_EXPORT @@ -120,11 +113,7 @@ namespace MED TErr* theErr = NULL, EModeProfil theMode = eCOMPACT); - //--------------------------------------------------------------- - typedef std::map TKey2Profile; - typedef boost::tuple TMKey2Profile; - //! Read set of MED PROFILES MEDWRAPPER_EXPORT TMKey2Profile @@ -139,18 +128,17 @@ namespace MED GetEntityByFamilyId(PGrilleInfo& theInfo, TInt theId); - typedef std::map TFamilyID2NbCells; - + //--------------------------------------------------------------- //! Get Number of cells for theId family, for Grille MEDWRAPPER_EXPORT TFamilyID2NbCells GetFamilyID2NbCells(PGrilleInfo& theInfo); + //--------------------------------------------------------------- //! Convert eNOEUD_ELEMENT to eMAILLE MEDWRAPPER_EXPORT EEntiteMaillage ConvertEntity(const EEntiteMaillage& aEntity); - } -#endif +#endif // MED_Algorithm_HeaderFile diff --git a/src/MEDWrapper/Base/MED_Common.hxx b/src/MEDWrapper/MED_Common.hxx similarity index 94% rename from src/MEDWrapper/Base/MED_Common.hxx rename to src/MEDWrapper/MED_Common.hxx index 390e1d623..9703ec756 100644 --- a/src/MEDWrapper/Base/MED_Common.hxx +++ b/src/MEDWrapper/MED_Common.hxx @@ -23,7 +23,10 @@ #ifndef MED_Common_HeaderFile #define MED_Common_HeaderFile -#include "MED_WrapperBase.hxx" +#include "MED_WrapperDef.hxx" +#include "MED_Vector.hxx" +#include "MED_SharedPtr.hxx" +#include "MED_SliceArray.hxx" #include #include @@ -33,20 +36,12 @@ #include -#include "SALOMEconfig.h" - -#include "MED_Vector.hxx" -#include "MED_SharedPtr.hxx" -#include "MED_SliceArray.hxx" - #ifdef WIN32 #pragma warning(disable:4099) #endif -namespace MED{ - - enum EVersion {eVUnknown = -1, eV2_1, eV2_2}; - +namespace MED +{ typedef enum {eFAUX, eVRAI} EBooleen ; typedef double TFloat; #if defined(HAVE_F77INT64) @@ -98,31 +93,24 @@ namespace MED{ const TEntity2GeomSet& GetEntity2GeomSet(); - template TInt MEDWRAPPER_EXPORT GetDESCLength(); - template TInt MEDWRAPPER_EXPORT GetIDENTLength(); - template TInt MEDWRAPPER_EXPORT GetNOMLength(); - template TInt MEDWRAPPER_EXPORT GetLNOMLength(); - template TInt MEDWRAPPER_EXPORT GetPNOMLength(); - template void MEDWRAPPER_EXPORT GetVersionRelease(TInt& majeur, TInt& mineur, TInt& release); - template MEDWRAPPER_EXPORT TInt GetNbConn(EGeometrieElement typmai, @@ -182,5 +170,4 @@ namespace MED{ typedef SharedPtr PWrapper; } - -#endif +#endif // MED_Common_HeaderFile diff --git a/src/MEDWrapper/Base/MED_CoordUtils.cxx b/src/MEDWrapper/MED_CoordUtils.cxx similarity index 100% rename from src/MEDWrapper/Base/MED_CoordUtils.cxx rename to src/MEDWrapper/MED_CoordUtils.cxx index a703f7a30..2f839df7f 100644 --- a/src/MEDWrapper/Base/MED_CoordUtils.cxx +++ b/src/MEDWrapper/MED_CoordUtils.cxx @@ -19,12 +19,12 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + #include "MED_CoordUtils.hxx" #include "MED_Utilities.hxx" namespace MED { - enum ECoordName{eX, eY, eZ, eNone}; template diff --git a/src/MEDWrapper/Base/MED_CoordUtils.hxx b/src/MEDWrapper/MED_CoordUtils.hxx similarity index 96% rename from src/MEDWrapper/Base/MED_CoordUtils.hxx rename to src/MEDWrapper/MED_CoordUtils.hxx index c41b43dbe..533f1816e 100644 --- a/src/MEDWrapper/Base/MED_CoordUtils.hxx +++ b/src/MEDWrapper/MED_CoordUtils.hxx @@ -19,18 +19,17 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + #ifndef MED_CoordUtils_HeaderFile #define MED_CoordUtils_HeaderFile -#include "MED_WrapperBase.hxx" - +#include "MED_WrapperDef.hxx" #include "MED_Structures.hxx" namespace MED { typedef TFloat (*TGetCoord)(const TCCoordSlice& theCoordSlice); - //--------------------------------------------------------------- class MEDWRAPPER_EXPORT TCoordHelper { @@ -45,12 +44,10 @@ namespace MED }; typedef SharedPtr PCoordHelper; - //--------------------------------------------------------------- MEDWRAPPER_EXPORT PCoordHelper GetCoordHelper(PNodeInfo theNodeInfo); - } -#endif +#endif // MED_CoordUtils_HeaderFile diff --git a/src/MEDWrapper/MED_Factory.cxx b/src/MEDWrapper/MED_Factory.cxx new file mode 100644 index 000000000..34f85e894 --- /dev/null +++ b/src/MEDWrapper/MED_Factory.cxx @@ -0,0 +1,145 @@ +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "MED_Factory.hxx" +#include "MED_Utilities.hxx" +#include "MED_V2_2_Wrapper.hxx" + +#include +#include +#include + +#include +extern "C" +{ +#ifndef WIN32 + #include +#endif +} + +#ifdef _DEBUG_ +static int MYDEBUG = 0; +#else +static int MYDEBUG = 0; +#endif + +namespace MED +{ + enum EStatus { eBad, eDeprecated, eGood }; + + EStatus GetVersionId(const std::string& theFileName) + { + INITMSG(MYDEBUG,"GetVersionId - theFileName = '"< namespace MED { class TShapeFun; typedef std::vector TDoubleVector; + /*! * \brief Description of family of integration points */ @@ -66,4 +64,4 @@ namespace MED }; } -#endif +#endif // MED_GaussDef_HeaderFile diff --git a/src/MEDWrapper/Base/MED_GaussUtils.cxx b/src/MEDWrapper/MED_GaussUtils.cxx similarity index 99% rename from src/MEDWrapper/Base/MED_GaussUtils.cxx rename to src/MEDWrapper/MED_GaussUtils.cxx index 7ce7b07db..a3f25c64c 100644 --- a/src/MEDWrapper/Base/MED_GaussUtils.cxx +++ b/src/MEDWrapper/MED_GaussUtils.cxx @@ -19,6 +19,7 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + #include "MED_GaussUtils.hxx" #include "MED_Utilities.hxx" @@ -30,8 +31,6 @@ static int MYVALUEDEBUG = 0; // static int MYVALUEDEBUG = 0; #endif -//#define _DEBUG_REF_COORDS_ - namespace MED { //--------------------------------------------------------------- diff --git a/src/MEDWrapper/Base/MED_GaussUtils.hxx b/src/MEDWrapper/MED_GaussUtils.hxx similarity index 99% rename from src/MEDWrapper/Base/MED_GaussUtils.hxx rename to src/MEDWrapper/MED_GaussUtils.hxx index 655b7490b..f437a5ab4 100644 --- a/src/MEDWrapper/Base/MED_GaussUtils.hxx +++ b/src/MEDWrapper/MED_GaussUtils.hxx @@ -19,11 +19,11 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + #ifndef MED_GaussUtils_HeaderFile #define MED_GaussUtils_HeaderFile -#include "MED_WrapperBase.hxx" - +#include "MED_WrapperDef.hxx" #include "MED_Structures.hxx" namespace MED @@ -359,7 +359,6 @@ namespace MED TFun& theFun) const; }; //--------------------------------------------------------------- - } -#endif +#endif // MED_GaussUtils_HeaderFile diff --git a/src/MEDWrapper/Base/MED_SharedPtr.hxx b/src/MEDWrapper/MED_SharedPtr.hxx similarity index 98% rename from src/MEDWrapper/Base/MED_SharedPtr.hxx rename to src/MEDWrapper/MED_SharedPtr.hxx index 914946c29..4f462bfe3 100644 --- a/src/MEDWrapper/Base/MED_SharedPtr.hxx +++ b/src/MEDWrapper/MED_SharedPtr.hxx @@ -19,6 +19,7 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + #ifndef MED_SharedPtr_HeaderFile #define MED_SharedPtr_HeaderFile @@ -26,7 +27,6 @@ namespace MED { - //! To extend the boost::shared_ptr to support such features automatic dynamic cast /*! All entities of the MEDWrapper package are handled as pointer. @@ -88,8 +88,6 @@ namespace MED return *(this->get()); } }; - } - -#endif +#endif // MED_SharedPtr_HeaderFile diff --git a/src/MEDWrapper/Base/MED_SliceArray.hxx b/src/MEDWrapper/MED_SliceArray.hxx similarity index 97% rename from src/MEDWrapper/Base/MED_SliceArray.hxx rename to src/MEDWrapper/MED_SliceArray.hxx index 0de392301..9134ea70b 100644 --- a/src/MEDWrapper/Base/MED_SliceArray.hxx +++ b/src/MEDWrapper/MED_SliceArray.hxx @@ -19,10 +19,11 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + #ifndef MED_SliceArray_HeaderFile #define MED_SliceArray_HeaderFile -#ifdef WIN32 // for correctly compiling "valarray" in modules, which are includes this file +#ifdef WIN32 // for correct compiling of "valarray" in modules, which include this file #undef max #undef min #endif @@ -177,9 +178,8 @@ namespace MED return *(myValuePtr + this->get_id_at(theId)); } }; - } #undef MED_TCSLICE_CHECK_RANGE -#endif +#endif // MED_SliceArray_HeaderFile diff --git a/src/MEDWrapper/Base/MED_Structures.cxx b/src/MEDWrapper/MED_Structures.cxx similarity index 99% rename from src/MEDWrapper/Base/MED_Structures.cxx rename to src/MEDWrapper/MED_Structures.cxx index ec1fd661e..800586e34 100644 --- a/src/MEDWrapper/Base/MED_Structures.cxx +++ b/src/MEDWrapper/MED_Structures.cxx @@ -19,9 +19,7 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// File : MED_Structure.cxx -// Author : Eugeny NIKOLAEV -// + #include "MED_Structures.hxx" #include "MED_Utilities.hxx" diff --git a/src/MEDWrapper/Base/MED_Structures.hxx b/src/MEDWrapper/MED_Structures.hxx similarity index 99% rename from src/MEDWrapper/Base/MED_Structures.hxx rename to src/MEDWrapper/MED_Structures.hxx index b2153ed91..564d24dd1 100644 --- a/src/MEDWrapper/Base/MED_Structures.hxx +++ b/src/MEDWrapper/MED_Structures.hxx @@ -23,6 +23,7 @@ #ifndef MED_Structures_HeaderFile #define MED_Structures_HeaderFile +#include "MED_WrapperDef.hxx" #include "MED_Common.hxx" #include "MED_Utilities.hxx" @@ -32,7 +33,6 @@ namespace MED { - //--------------------------------------------------------------- //! Defines a type for managing sequence of strings typedef TVector TString; @@ -65,7 +65,6 @@ namespace MED virtual ~TBase() {} }; - //--------------------------------------------------------------- //! Define a parent class for all named MED entities struct MEDWRAPPER_EXPORT TNameInfo: virtual TBase @@ -76,7 +75,6 @@ namespace MED virtual void SetName(const TString& theValue) = 0; //!< Set a new name }; - //--------------------------------------------------------------- //! Define a parent class for all MED entities that contains a sequence of numbers /*! @@ -99,7 +97,6 @@ namespace MED EModeSwitch GetModeSwitch() const { return myModeSwitch;} }; - //--------------------------------------------------------------- //! Define a base class which represents MED Mesh entity struct MEDWRAPPER_EXPORT TMeshInfo: virtual TNameInfo @@ -116,10 +113,7 @@ namespace MED TString myDesc; //!< Description of the mesh virtual std::string GetDesc() const = 0; //!< Get description for the mesh virtual void SetDesc(const std::string& theValue) = 0; //!< Sets description for the mesh - - }; - //--------------------------------------------------------------- typedef TVector TIntVector; @@ -176,7 +170,6 @@ namespace MED virtual void SetAttrDesc(TInt theId, const std::string& theValue) = 0; }; - //--------------------------------------------------------------- typedef TIntVector TElemNum; typedef SharedPtr PElemNum; @@ -229,7 +222,6 @@ namespace MED virtual void SetElemName(TInt theId, const std::string& theValue) = 0; }; - //--------------------------------------------------------------- typedef TVector TFloatVector; typedef TSlice TFloatVecSlice; @@ -272,7 +264,6 @@ namespace MED virtual void SetCoordUnit(TInt theId, const std::string& theValue) = 0; }; - //--------------------------------------------------------------- typedef TIntVecSlice TConnSlice; typedef TCIntVecSlice TCConnSlice; @@ -423,10 +414,8 @@ namespace MED virtual std::string GetUnitName(TInt theId) const = 0; //! Set unit for the component by its order number virtual void SetUnitName(TInt theId, const std::string& theValue) = 0; - }; - //--------------------------------------------------------------- //! Get dimension of the Gauss coordinates for the defined type of mesh cell MEDWRAPPER_EXPORT @@ -490,7 +479,6 @@ namespace MED TInt GetNbGauss() const { return (TInt)(myGaussCoord.size()/GetDim());} }; - //--------------------------------------------------------------- typedef std::map TGeom2Gauss; typedef std::map TGeom2NbGauss; @@ -536,7 +524,6 @@ namespace MED //! Set unit of time for the MED TimeStamp virtual void SetUnitDt(const std::string& theValue) = 0; }; - //--------------------------------------------------------------- //! The class represents MED Profile entity @@ -565,7 +552,6 @@ namespace MED TInt GetSize() const { return (TInt)myElemNum->size();} }; - //--------------------------------------------------------------- //! The class is a helper one. It provide safe and flexible way to get access to values for a MED TimeStamp struct MEDWRAPPER_EXPORT TMeshValueBase: @@ -818,7 +804,6 @@ namespace MED GetValuePtr(EGeometrieElement theGeom) = 0; }; - //--------------------------------------------------------------- //! The class implements a container for MED TimeStamp values template @@ -886,7 +871,6 @@ namespace MED } }; - //--------------------------------------------------------------- typedef TTimeStampValue TFloatTimeStampValue; typedef SharedPtr PFloatTimeStampValue; @@ -900,7 +884,6 @@ namespace MED PIntTimeStampValue MEDWRAPPER_EXPORT CastToIntTimeStampValue(const PTimeStampValueBase& theTimeStampValue); - //--------------------------------------------------------------- template void @@ -964,7 +947,6 @@ namespace MED } } - //--------------------------------------------------------------- // Backward compatibility declarations typedef TFloatTimeStampValue TTimeStampVal; @@ -978,7 +960,6 @@ namespace MED struct MEDWRAPPER_EXPORT TGrilleInfo: virtual TModeSwitchInfo { - PMeshInfo myMeshInfo; const PMeshInfo& GetMeshInfo() const { return myMeshInfo;} @@ -999,8 +980,6 @@ namespace MED //!Sets grille type void SetGrilleType(EGrilleType theGrilleType); - - TString myCoordNames; //!< Contains names for the coordinate dimensions //! Get name of the coordinate dimension by its order number virtual std::string GetCoordName(TInt theId) const = 0 ; @@ -1013,7 +992,6 @@ namespace MED //! Set name of unit for the coordinate dimension by its order number virtual void SetCoordUnit(TInt theId, const std::string& theValue) = 0; - //! Map of index of axes and Table of indexes for certain axe, now used for eGRILLE_CARTESIENNE and eGRILLE_POLAIRE TIndexes myIndixes; //!Gets a map of Tables (const version) @@ -1072,10 +1050,7 @@ namespace MED TInt GetFamNumNode(TInt theId) const; //! Set number of a MED FAMILY for the mesh node with the order number void SetFamNumNode(TInt theId, TInt theVal); - }; - - } -#endif +#endif // MED_Structures_HeaderFile diff --git a/src/MEDWrapper/Base/MED_TStructures.hxx b/src/MEDWrapper/MED_TStructures.hxx similarity index 84% rename from src/MEDWrapper/Base/MED_TStructures.hxx rename to src/MEDWrapper/MED_TStructures.hxx index b2475c8c0..b687ce369 100644 --- a/src/MEDWrapper/Base/MED_TStructures.hxx +++ b/src/MEDWrapper/MED_TStructures.hxx @@ -19,6 +19,7 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + #ifndef MED_TStructures_HeaderFile #define MED_TStructures_HeaderFile @@ -91,12 +92,11 @@ namespace MED }; //--------------------------------------------------------------- - template struct TTNameInfo: virtual TNameInfo { TTNameInfo(const std::string& theValue) { - myName.resize(GetNOMLength()+1); + myName.resize(GetNOMLength()+1); SetName(theValue); } @@ -104,32 +104,30 @@ namespace MED std::string GetName() const { - return GetString(0, GetNOMLength(), myName); + return GetString(0, GetNOMLength(), myName); } virtual void SetName(const std::string& theValue) { - SetString(0, GetNOMLength(), myName, theValue); + SetString(0, GetNOMLength(), myName, theValue); } virtual void SetName(const TString& theValue) { - SetString(0, GetNOMLength(), myName, theValue); + SetString(0, GetNOMLength(), myName, theValue); } }; - //--------------------------------------------------------------- - template struct TTMeshInfo: virtual TMeshInfo, - virtual TTNameInfo + virtual TTNameInfo { - typedef TTNameInfo TNameInfoBase; + typedef TTNameInfo TNameInfoBase; TTMeshInfo(const PMeshInfo& theInfo): TNameInfoBase(theInfo->GetName()) @@ -138,7 +136,7 @@ namespace MED mySpaceDim = theInfo->GetSpaceDim(); myType = theInfo->GetType(); - myDesc.resize(GetDESCLength()+1); + myDesc.resize(GetDESCLength()+1); SetDesc(theInfo->GetDesc()); } @@ -152,7 +150,7 @@ namespace MED mySpaceDim = theSpaceDim; myType = theType; - myDesc.resize(GetDESCLength()+1); + myDesc.resize(GetDESCLength()+1); SetDesc(theDesc); } @@ -160,25 +158,23 @@ namespace MED std::string GetDesc() const { - return GetString(0, GetDESCLength(), myDesc); + return GetString(0, GetDESCLength(), myDesc); } virtual void SetDesc(const std::string& theValue) { - SetString(0, GetDESCLength(), myDesc, theValue); + SetString(0, GetDESCLength(), myDesc, theValue); } }; - //--------------------------------------------------------------- - template struct TTFamilyInfo: virtual TFamilyInfo, - virtual TTNameInfo + virtual TTNameInfo { - typedef TTNameInfo TNameInfoBase; + typedef TTNameInfo TNameInfoBase; TTFamilyInfo(const PMeshInfo& theMeshInfo, const PFamilyInfo& theInfo): TNameInfoBase(theInfo->GetName()) @@ -188,7 +184,7 @@ namespace MED myId = theInfo->GetId(); myNbGroup = theInfo->GetNbGroup(); - myGroupNames.resize(myNbGroup*GetLNOMLength()+1); + myGroupNames.resize(myNbGroup*GetLNOMLength()+1); if(myNbGroup){ for(TInt anId = 0; anId < myNbGroup; anId++){ SetGroupName(anId,theInfo->GetGroupName(anId)); @@ -198,7 +194,7 @@ namespace MED myNbAttr = theInfo->GetNbAttr(); myAttrId.resize(myNbAttr); myAttrVal.resize(myNbAttr); - myAttrDesc.resize(myNbAttr*GetDESCLength()+1); + myAttrDesc.resize(myNbAttr*GetDESCLength()+1); if(myNbAttr){ for(TInt anId = 0; anId < myNbAttr; anId++){ SetAttrDesc(anId,theInfo->GetAttrDesc(anId)); @@ -220,12 +216,12 @@ namespace MED myId = theId; myNbGroup = theNbGroup; - myGroupNames.resize(theNbGroup*GetLNOMLength()+1); + myGroupNames.resize(theNbGroup*GetLNOMLength()+1); myNbAttr = theNbAttr; myAttrId.resize(theNbAttr); myAttrVal.resize(theNbAttr); - myAttrDesc.resize(theNbAttr*GetDESCLength()+1); + myAttrDesc.resize(theNbAttr*GetDESCLength()+1); } TTFamilyInfo(const PMeshInfo& theMeshInfo, @@ -242,7 +238,7 @@ namespace MED myId = theId; myNbGroup = (TInt)theGroupNames.size(); - myGroupNames.resize(myNbGroup*GetLNOMLength()+1); + myGroupNames.resize(myNbGroup*GetLNOMLength()+1); if(myNbGroup){ TStringSet::const_iterator anIter = theGroupNames.begin(); for(TInt anId = 0; anIter != theGroupNames.end(); anIter++, anId++){ @@ -254,7 +250,7 @@ namespace MED myNbAttr = (TInt)theAttrDescs.size(); myAttrId.resize(myNbAttr); myAttrVal.resize(myNbAttr); - myAttrDesc.resize(myNbAttr*GetDESCLength()+1); + myAttrDesc.resize(myNbAttr*GetDESCLength()+1); if(myNbAttr){ for(TInt anId = 0, anEnd = (TInt)theAttrDescs.size(); anId < anEnd; anId++){ SetAttrDesc(anId,theAttrDescs[anId]); @@ -268,34 +264,32 @@ namespace MED std::string GetGroupName(TInt theId) const { - return GetString(theId, GetLNOMLength(), myGroupNames); + return GetString(theId, GetLNOMLength(), myGroupNames); } virtual void SetGroupName(TInt theId, const std::string& theValue) { - SetString(theId, GetLNOMLength(), myGroupNames, theValue); + SetString(theId, GetLNOMLength(), myGroupNames, theValue); } virtual std::string GetAttrDesc(TInt theId) const { - return GetString(theId, GetDESCLength(), myAttrDesc); + return GetString(theId, GetDESCLength(), myAttrDesc); } virtual void SetAttrDesc(TInt theId, const std::string& theValue) { - SetString(theId, GetDESCLength(), myAttrDesc, theValue); + SetString(theId, GetDESCLength(), myAttrDesc, theValue); } }; - //--------------------------------------------------------------- - template struct TTElemInfo: virtual TElemInfo { TTElemInfo(const PMeshInfo& theMeshInfo, const PElemInfo& theInfo) @@ -314,7 +308,7 @@ namespace MED myIsElemNames = theInfo->IsElemNames(); if(theInfo->IsElemNames()) - myElemNames.reset(new TString(myNbElem*GetPNOMLength() + 1)); + myElemNames.reset(new TString(myNbElem*GetPNOMLength() + 1)); else myElemNames.reset(new TString()); @@ -354,7 +348,7 @@ namespace MED myIsElemNames = theIsElemNames; if(theIsElemNames) - myElemNames.reset(new TString(theNbElem*GetPNOMLength() + 1)); + myElemNames.reset(new TString(theNbElem*GetPNOMLength() + 1)); else myElemNames.reset(new TString()); } @@ -379,7 +373,7 @@ namespace MED myIsElemNames = theElemNames.size()? eVRAI: eFAUX; if(myIsElemNames) - myElemNames.reset(new TString(theNbElem*GetPNOMLength() + 1)); + myElemNames.reset(new TString(theNbElem*GetPNOMLength() + 1)); else myElemNames.reset(new TString()); @@ -404,25 +398,23 @@ namespace MED std::string GetElemName(TInt theId) const { - return GetString(theId,GetPNOMLength(), *myElemNames); + return GetString(theId,GetPNOMLength(), *myElemNames); } virtual void SetElemName(TInt theId, const std::string& theValue) { - SetString(theId,GetPNOMLength(), *myElemNames, theValue); + SetString(theId,GetPNOMLength(), *myElemNames, theValue); } }; - //--------------------------------------------------------------- - template struct TTNodeInfo: virtual TNodeInfo, - virtual TTElemInfo + virtual TTElemInfo { - typedef TTElemInfo TElemInfoBase; + typedef TTElemInfo TElemInfoBase; TTNodeInfo(const PMeshInfo& theMeshInfo, const PNodeInfo& theInfo): TNodeInfo(theInfo), @@ -436,11 +428,11 @@ namespace MED TInt aSpaceDim = theMeshInfo->GetSpaceDim(); - myCoordNames.resize(aSpaceDim*GetPNOMLength()+1); + myCoordNames.resize(aSpaceDim*GetPNOMLength()+1); for(TInt anId = 0; anId < aSpaceDim; anId++) SetCoordName(anId,theInfo->GetCoordName(anId)); - myCoordUnits.resize(aSpaceDim*GetPNOMLength()+1); + myCoordUnits.resize(aSpaceDim*GetPNOMLength()+1); for(TInt anId = 0; anId < aSpaceDim; anId++) SetCoordUnit(anId,theInfo->GetCoordUnit(anId)); } @@ -461,9 +453,9 @@ namespace MED myCoord.reset(new TNodeCoord(theNbElem * theMeshInfo->mySpaceDim)); - myCoordUnits.resize(theMeshInfo->mySpaceDim*GetPNOMLength()+1); + myCoordUnits.resize(theMeshInfo->mySpaceDim*GetPNOMLength()+1); - myCoordNames.resize(theMeshInfo->mySpaceDim*GetPNOMLength()+1); + myCoordNames.resize(theMeshInfo->mySpaceDim*GetPNOMLength()+1); } @@ -489,12 +481,12 @@ namespace MED TInt aSpaceDim = theMeshInfo->GetSpaceDim(); - myCoordNames.resize(aSpaceDim*GetPNOMLength()+1); + myCoordNames.resize(aSpaceDim*GetPNOMLength()+1); if(!theCoordNames.empty()) for(TInt anId = 0; anId < aSpaceDim; anId++) SetCoordName(anId,theCoordNames[anId]); - myCoordUnits.resize(aSpaceDim*GetPNOMLength() + 1); + myCoordUnits.resize(aSpaceDim*GetPNOMLength() + 1); if(!theCoordUnits.empty()) for(TInt anId = 0; anId < aSpaceDim; anId++) SetCoordUnit(anId, theCoordUnits[anId]); @@ -504,38 +496,37 @@ namespace MED std::string GetCoordName(TInt theId) const { - return GetString(theId,GetPNOMLength(),myCoordNames); + return GetString(theId,GetPNOMLength(),myCoordNames); } virtual void SetCoordName(TInt theId, const std::string& theValue) { - SetString(theId,GetPNOMLength(),myCoordNames,theValue); + SetString(theId,GetPNOMLength(),myCoordNames,theValue); } virtual std::string GetCoordUnit(TInt theId) const { - return GetString(theId,GetPNOMLength(),myCoordUnits); + return GetString(theId,GetPNOMLength(),myCoordUnits); } virtual void SetCoordUnit(TInt theId, const std::string& theValue) { - SetString(theId,GetPNOMLength(),myCoordUnits,theValue); + SetString(theId,GetPNOMLength(),myCoordUnits,theValue); } }; //--------------------------------------------------------------- - template struct TTPolygoneInfo: virtual TPolygoneInfo, - virtual TTElemInfo + virtual TTElemInfo { - typedef TTElemInfo TElemInfoBase; + typedef TTElemInfo TElemInfoBase; TTPolygoneInfo(const PMeshInfo& theMeshInfo, const PPolygoneInfo& theInfo): TElemInfoBase(theMeshInfo,theInfo) @@ -597,12 +588,11 @@ namespace MED }; //--------------------------------------------------------------- - template struct TTPolyedreInfo: virtual TPolyedreInfo, - virtual TTElemInfo + virtual TTElemInfo { - typedef TTElemInfo TElemInfoBase; + typedef TTElemInfo TElemInfoBase; TTPolyedreInfo(const PMeshInfo& theMeshInfo, const PPolyedreInfo& theInfo): TElemInfoBase(theMeshInfo,theInfo) @@ -669,12 +659,11 @@ namespace MED }; //--------------------------------------------------------------- - template struct TTCellInfo: virtual TCellInfo, - virtual TTElemInfo + virtual TTElemInfo { - typedef TTElemInfo TElemInfoBase; + typedef TTElemInfo TElemInfoBase; TTCellInfo(const PMeshInfo& theMeshInfo, const PCellInfo& theInfo): TElemInfoBase(theMeshInfo,theInfo) @@ -684,7 +673,7 @@ namespace MED myConnMode = theInfo->GetConnMode(); TInt aConnDim = GetNbNodes(myGeom); - TInt aNbConn = GetNbConn(myGeom, myEntity, myMeshInfo->myDim); + TInt aNbConn = GetNbConn(myGeom, myEntity, myMeshInfo->myDim); myConn.reset(new TElemNum(myNbElem * aNbConn)); for(TInt anElemId = 0; anElemId < myNbElem; anElemId++){ TConnSlice aConnSlice = GetConnSlice(anElemId); @@ -713,7 +702,7 @@ namespace MED myGeom = theGeom; myConnMode = theConnMode; - TInt aNbConn = GetNbConn(theGeom, myEntity, theMeshInfo->myDim); + TInt aNbConn = GetNbConn(theGeom, myEntity, theMeshInfo->myDim); myConn.reset(new TElemNum(theNbElem * aNbConn)); } @@ -738,7 +727,7 @@ namespace MED myConnMode = theConnMode; TInt aConnDim = GetNbNodes(myGeom); - TInt aNbConn = GetNbConn(myGeom, myEntity, myMeshInfo->myDim); + TInt aNbConn = GetNbConn(myGeom, myEntity, myMeshInfo->myDim); myConn.reset(new TElemNum(myNbElem * aNbConn)); for(TInt anElemId = 0; anElemId < myNbElem; anElemId++){ TConnSlice aConnSlice = GetConnSlice(anElemId); @@ -752,18 +741,17 @@ namespace MED TInt GetConnDim() const { - return GetNbConn(myGeom, myEntity, myMeshInfo->myDim); + return GetNbConn(myGeom, myEntity, myMeshInfo->myDim); } }; //--------------------------------------------------------------- - template struct TTBallInfo: virtual TBallInfo, - virtual TTCellInfo + virtual TTCellInfo { - typedef TTCellInfo TCellInfoBase; + typedef TTCellInfo TCellInfoBase; TTBallInfo(const PMeshInfo& theMeshInfo, const PBallInfo& theInfo): TCellInfoBase::TElemInfoBase(theMeshInfo, theInfo), @@ -816,12 +804,11 @@ namespace MED }; //--------------------------------------------------------------- - template struct TTFieldInfo: virtual TFieldInfo, - virtual TTNameInfo + virtual TTNameInfo { - typedef TTNameInfo TNameInfoBase; + typedef TTNameInfo TNameInfoBase; TTFieldInfo(const PMeshInfo& theMeshInfo, const PFieldInfo& theInfo): TNameInfoBase(theInfo->GetName()) @@ -829,12 +816,12 @@ namespace MED myMeshInfo = theMeshInfo; myNbComp = theInfo->GetNbComp(); - myCompNames.resize(myNbComp*GetPNOMLength()+1); + myCompNames.resize(myNbComp*GetPNOMLength()+1); for(TInt anId = 0; anId < myNbComp; anId++){ SetCompName(anId,theInfo->GetCompName(anId)); } - myUnitNames.resize(myNbComp*GetPNOMLength()+1); + myUnitNames.resize(myNbComp*GetPNOMLength()+1); for(TInt anId = 0; anId < myNbComp; anId++){ SetUnitName(anId,theInfo->GetUnitName(anId)); } @@ -856,8 +843,8 @@ namespace MED myMeshInfo = theMeshInfo; myNbComp = theNbComp; - myCompNames.resize(theNbComp*GetPNOMLength()+1); - myUnitNames.resize(theNbComp*GetPNOMLength()+1); + myCompNames.resize(theNbComp*GetPNOMLength()+1); + myUnitNames.resize(theNbComp*GetPNOMLength()+1); myType = theType; @@ -869,39 +856,37 @@ namespace MED std::string GetCompName(TInt theId) const { - return GetString(theId,GetPNOMLength(),myCompNames); + return GetString(theId,GetPNOMLength(),myCompNames); } virtual void SetCompName(TInt theId, const std::string& theValue) { - SetString(theId,GetPNOMLength(),myCompNames,theValue); + SetString(theId,GetPNOMLength(),myCompNames,theValue); } virtual std::string GetUnitName(TInt theId) const { - return GetString(theId,GetPNOMLength(),myUnitNames); + return GetString(theId,GetPNOMLength(),myUnitNames); } virtual void SetUnitName(TInt theId, const std::string& theValue) { - SetString(theId,GetPNOMLength(),myUnitNames,theValue); + SetString(theId,GetPNOMLength(),myUnitNames,theValue); } }; - //--------------------------------------------------------------- - template struct TTGaussInfo: virtual TGaussInfo, - virtual TTNameInfo + virtual TTNameInfo { - typedef TTNameInfo TNameInfoBase; + typedef TTNameInfo TNameInfoBase; TTGaussInfo(const TGaussInfo::TInfo& theInfo, EModeSwitch theMode): @@ -919,9 +904,7 @@ namespace MED } }; - //--------------------------------------------------------------- - template struct TTTimeStampInfo: virtual TTimeStampInfo { TTTimeStampInfo(const PFieldInfo& theFieldInfo, const PTimeStampInfo& theInfo) @@ -935,7 +918,7 @@ namespace MED myNumOrd = theInfo->GetNumOrd(); myDt = theInfo->GetDt(); - myUnitDt.resize(GetPNOMLength()+1); + myUnitDt.resize(GetPNOMLength()+1); SetUnitDt(theInfo->GetUnitDt()); myGeom2NbGauss = theInfo->myGeom2NbGauss; @@ -961,7 +944,7 @@ namespace MED myNumOrd = theNumDt; myDt = theDt; - myUnitDt.resize(GetPNOMLength()+1); + myUnitDt.resize(GetPNOMLength()+1); SetUnitDt(theUnitDt); myGeom2NbGauss = theGeom2NbGauss; @@ -972,25 +955,23 @@ namespace MED std::string GetUnitDt() const { - return GetString(0,GetPNOMLength(),myUnitDt); + return GetString(0,GetPNOMLength(),myUnitDt); } virtual void SetUnitDt(const std::string& theValue) { - SetString(0,GetPNOMLength(),myUnitDt,theValue); + SetString(0,GetPNOMLength(),myUnitDt,theValue); } }; - //--------------------------------------------------------------- - template struct TTProfileInfo: virtual TProfileInfo, - virtual TTNameInfo + virtual TTNameInfo { - typedef TTNameInfo TNameInfoBase; + typedef TTNameInfo TNameInfoBase; TTProfileInfo(const TProfileInfo::TInfo& theInfo, EModeProfil theMode): @@ -1002,9 +983,8 @@ namespace MED } }; - //--------------------------------------------------------------- - template + template struct TTTimeStampValue: virtual TTimeStampValue { TTTimeStampValue(const PTimeStampInfo& theTimeStampInfo, @@ -1097,7 +1077,6 @@ namespace MED }; //--------------------------------------------------------------- - template struct TTGrilleInfo: virtual TGrilleInfo { @@ -1134,11 +1113,11 @@ namespace MED TInt aSpaceDim = theMeshInfo->GetSpaceDim(); if(type == eGRILLE_STANDARD){ myCoord.resize(aSpaceDim*nnoeuds); - myCoordNames.resize(aSpaceDim*GetPNOMLength()+1); - myCoordUnits.resize(aSpaceDim*GetPNOMLength()+1); + myCoordNames.resize(aSpaceDim*GetPNOMLength()+1); + myCoordUnits.resize(aSpaceDim*GetPNOMLength()+1); } else { //if(type == eGRILLE_CARTESIENNE){ - myCoordNames.resize(aSpaceDim*GetPNOMLength()+aSpaceDim); - myCoordUnits.resize(aSpaceDim*GetPNOMLength()+aSpaceDim); + myCoordNames.resize(aSpaceDim*GetPNOMLength()+aSpaceDim); + myCoordUnits.resize(aSpaceDim*GetPNOMLength()+aSpaceDim); } myGrilleStructure.resize(aSpaceDim); myFamNumNode.resize(nnoeuds); @@ -1150,11 +1129,11 @@ namespace MED myMeshInfo = theMeshInfo; TInt aSpaceDim = theMeshInfo->GetSpaceDim(); if(type == eGRILLE_STANDARD){ - myCoordNames.resize(aSpaceDim*GetPNOMLength()+1); - myCoordUnits.resize(aSpaceDim*GetPNOMLength()+1); + myCoordNames.resize(aSpaceDim*GetPNOMLength()+1); + myCoordUnits.resize(aSpaceDim*GetPNOMLength()+1); } else {// if(type == eGRILLE_CARTESIENNE){ - myCoordNames.resize(aSpaceDim*GetPNOMLength()+aSpaceDim); - myCoordUnits.resize(aSpaceDim*GetPNOMLength()+aSpaceDim); + myCoordNames.resize(aSpaceDim*GetPNOMLength()+aSpaceDim); + myCoordUnits.resize(aSpaceDim*GetPNOMLength()+aSpaceDim); } myGrilleStructure.resize(aSpaceDim); } @@ -1167,11 +1146,11 @@ namespace MED TInt aSpaceDim = theMeshInfo->GetSpaceDim(); if(type == eGRILLE_STANDARD){ - myCoordNames.resize(aSpaceDim*GetPNOMLength()+1); - myCoordUnits.resize(aSpaceDim*GetPNOMLength()+1); + myCoordNames.resize(aSpaceDim*GetPNOMLength()+1); + myCoordUnits.resize(aSpaceDim*GetPNOMLength()+1); } else {// if(type == eGRILLE_CARTESIENNE){ - myCoordNames.resize(aSpaceDim*GetPNOMLength()+aSpaceDim); - myCoordUnits.resize(aSpaceDim*GetPNOMLength()+aSpaceDim); + myCoordNames.resize(aSpaceDim*GetPNOMLength()+aSpaceDim); + myCoordUnits.resize(aSpaceDim*GetPNOMLength()+aSpaceDim); } if(type != eGRILLE_STANDARD) @@ -1185,31 +1164,30 @@ namespace MED std::string GetCoordName(TInt theId) const { - return GetString(theId,GetPNOMLength(),myCoordNames); + return GetString(theId,GetPNOMLength(),myCoordNames); } virtual void SetCoordName(TInt theId, const std::string& theValue) { - SetString(theId,GetPNOMLength(),myCoordNames,theValue); + SetString(theId,GetPNOMLength(),myCoordNames,theValue); } virtual std::string GetCoordUnit(TInt theId) const { - return GetString(theId,GetPNOMLength(),myCoordUnits); + return GetString(theId,GetPNOMLength(),myCoordUnits); } virtual void SetCoordUnit(TInt theId, const std::string& theValue) { - SetString(theId,GetPNOMLength(),myCoordUnits,theValue); + SetString(theId,GetPNOMLength(),myCoordUnits,theValue); } - }; } -#endif +#endif // MED_TStructures_HeaderFile diff --git a/src/MEDWrapper/Base/MED_TWrapper.hxx b/src/MEDWrapper/MED_TWrapper.hxx similarity index 84% rename from src/MEDWrapper/Base/MED_TWrapper.hxx rename to src/MEDWrapper/MED_TWrapper.hxx index 4a719be3b..bed64f23a 100644 --- a/src/MEDWrapper/Base/MED_TWrapper.hxx +++ b/src/MEDWrapper/MED_TWrapper.hxx @@ -19,6 +19,7 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + #ifndef MED_TWrapper_HeaderFile #define MED_TWrapper_HeaderFile @@ -27,20 +28,9 @@ namespace MED { - - template class TTWrapper: public TWrapper { public: - //---------------------------------------------------------------------------- - //! Gets version of the MED library used for the MED file - virtual - EVersion - GetVersion() - { - return eVersion; - } - //---------------------------------------------------------------------------- virtual PMeshInfo @@ -49,7 +39,7 @@ namespace MED EMaillage theType = eNON_STRUCTURE, const std::string& theDesc = "") { - return PMeshInfo(new TTMeshInfo + return PMeshInfo(new TTMeshInfo (theDim, theSpaceDim, theValue, @@ -57,13 +47,13 @@ namespace MED theDesc)); } + //---------------------------------------------------------------------------- virtual PMeshInfo CrMeshInfo(const PMeshInfo& theInfo) { - return PMeshInfo(new TTMeshInfo(theInfo)); + return PMeshInfo(new TTMeshInfo(theInfo)); } - //---------------------------------------------------------------------------- virtual @@ -74,7 +64,7 @@ namespace MED TInt theId = 0, const std::string& theValue = "") { - return PFamilyInfo(new TTFamilyInfo + return PFamilyInfo(new TTFamilyInfo (theMeshInfo, theNbGroup, theNbAttr, @@ -82,6 +72,7 @@ namespace MED theValue)); } + //---------------------------------------------------------------------------- virtual PFamilyInfo CrFamilyInfo(const PMeshInfo& theMeshInfo, @@ -92,7 +83,7 @@ namespace MED const MED::TIntVector& theAttrIds = MED::TIntVector(), const MED::TIntVector& theAttrVals = MED::TIntVector()) { - return PFamilyInfo(new TTFamilyInfo + return PFamilyInfo(new TTFamilyInfo (theMeshInfo, theValue, theId, @@ -102,12 +93,13 @@ namespace MED theAttrVals)); } + //---------------------------------------------------------------------------- virtual PFamilyInfo CrFamilyInfo(const PMeshInfo& theMeshInfo, const PFamilyInfo& theInfo) { - return PFamilyInfo(new TTFamilyInfo + return PFamilyInfo(new TTFamilyInfo (theMeshInfo, theInfo)); } @@ -120,13 +112,14 @@ namespace MED EBooleen theIsElemNum = eVRAI, EBooleen theIsElemNames = eVRAI) { - return PElemInfo(new TTElemInfo + return PElemInfo(new TTElemInfo (theMeshInfo, theNbElem, theIsElemNum, theIsElemNames)); } + //---------------------------------------------------------------------------- virtual PElemInfo CrElemInfo(const PMeshInfo& theMeshInfo, @@ -135,7 +128,7 @@ namespace MED const TIntVector& aElemNum, const TStringVector& aElemNames) { - return PElemInfo(new TTElemInfo + return PElemInfo(new TTElemInfo (theMeshInfo, theNbElem, theFamNum, @@ -153,7 +146,7 @@ namespace MED EBooleen theIsElemNum = eVRAI, EBooleen theIsElemNames = eVRAI) { - return PNodeInfo(new TTNodeInfo + return PNodeInfo(new TTNodeInfo (theMeshInfo, theNbElem, theMode, @@ -162,6 +155,7 @@ namespace MED theIsElemNames)); } + //---------------------------------------------------------------------------- virtual PNodeInfo CrNodeInfo(const PMeshInfo& theMeshInfo, @@ -174,7 +168,7 @@ namespace MED const TIntVector& theElemNums = TIntVector(), const TStringVector& theElemNames = TStringVector()) { - return PNodeInfo(new TTNodeInfo + return PNodeInfo(new TTNodeInfo (theMeshInfo, theNodeCoords, theMode, @@ -186,12 +180,13 @@ namespace MED theElemNames)); } + //---------------------------------------------------------------------------- virtual PNodeInfo CrNodeInfo(const PMeshInfo& theMeshInfo, const PNodeInfo& theInfo) { - return PNodeInfo(new TTNodeInfo + return PNodeInfo(new TTNodeInfo (theMeshInfo, theInfo)); } @@ -208,7 +203,7 @@ namespace MED EBooleen theIsElemNum = eVRAI, EBooleen theIsElemNames = eVRAI) { - return PPolygoneInfo(new TTPolygoneInfo + return PPolygoneInfo(new TTPolygoneInfo (theMeshInfo, theEntity, theGeom, @@ -219,6 +214,7 @@ namespace MED theIsElemNames)); } + //---------------------------------------------------------------------------- virtual PPolygoneInfo CrPolygoneInfo(const PMeshInfo& theMeshInfo, @@ -231,7 +227,7 @@ namespace MED const TIntVector& theElemNums = TIntVector(), const TStringVector& theElemNames = TStringVector()) { - return PPolygoneInfo(new TTPolygoneInfo + return PPolygoneInfo(new TTPolygoneInfo (theMeshInfo, theEntity, theGeom, @@ -243,12 +239,13 @@ namespace MED theElemNames)); } + //---------------------------------------------------------------------------- virtual PPolygoneInfo CrPolygoneInfo(const PMeshInfo& theMeshInfo, const PPolygoneInfo& theInfo) { - return PPolygoneInfo(new TTPolygoneInfo + return PPolygoneInfo(new TTPolygoneInfo (theMeshInfo, theInfo)); } @@ -266,7 +263,7 @@ namespace MED EBooleen theIsElemNum = eVRAI, EBooleen theIsElemNames = eVRAI) { - return PPolyedreInfo(new TTPolyedreInfo + return PPolyedreInfo(new TTPolyedreInfo (theMeshInfo, theEntity, theGeom, @@ -278,6 +275,7 @@ namespace MED theIsElemNames)); } + //---------------------------------------------------------------------------- virtual PPolyedreInfo CrPolyedreInfo(const PMeshInfo& theMeshInfo, @@ -291,7 +289,7 @@ namespace MED const TIntVector& theElemNums = TIntVector(), const TStringVector& theElemNames = TStringVector()) { - return PPolyedreInfo(new TTPolyedreInfo + return PPolyedreInfo(new TTPolyedreInfo (theMeshInfo, theEntity, theGeom, @@ -304,12 +302,13 @@ namespace MED theElemNames)); } + //---------------------------------------------------------------------------- virtual PPolyedreInfo CrPolyedreInfo(const PMeshInfo& theMeshInfo, const PPolyedreInfo& theInfo) { - return PPolyedreInfo(new TTPolyedreInfo + return PPolyedreInfo(new TTPolyedreInfo (theMeshInfo, theInfo)); } @@ -326,7 +325,7 @@ namespace MED EBooleen theIsElemNames = eVRAI, EModeSwitch theMode = eFULL_INTERLACE) { - return PCellInfo(new TTCellInfo + return PCellInfo(new TTCellInfo (theMeshInfo, theEntity, theGeom, @@ -337,6 +336,7 @@ namespace MED theMode)); } + //---------------------------------------------------------------------------- virtual PCellInfo CrCellInfo(const PMeshInfo& theMeshInfo, @@ -349,7 +349,7 @@ namespace MED const TStringVector& theElemNames = TStringVector(), EModeSwitch theMode = eFULL_INTERLACE) { - return PCellInfo(new TTCellInfo + return PCellInfo(new TTCellInfo (theMeshInfo, theEntity, theGeom, @@ -361,12 +361,13 @@ namespace MED theMode)); } + //---------------------------------------------------------------------------- virtual PCellInfo CrCellInfo(const PMeshInfo& theMeshInfo, const PCellInfo& theInfo) { - return PCellInfo(new TTCellInfo + return PCellInfo(new TTCellInfo (theMeshInfo, theInfo)); } @@ -377,9 +378,10 @@ namespace MED TInt theNbBalls, EBooleen theIsElemNum = eVRAI) { - return PBallInfo( new TTBallInfo( theMeshInfo, theNbBalls, theIsElemNum )); + return PBallInfo( new TTBallInfo( theMeshInfo, theNbBalls, theIsElemNum )); } + //---------------------------------------------------------------------------- //! Creates a MEDWrapper MED Balls representation virtual PBallInfo CrBallInfo(const PMeshInfo& theMeshInfo, const TIntVector& theNodes, @@ -387,15 +389,16 @@ namespace MED const TIntVector& theFamilyNums = TIntVector(), const TIntVector& theElemNums = TIntVector()) { - return PBallInfo( new TTBallInfo( theMeshInfo, theNodes, theDiameters, + return PBallInfo( new TTBallInfo( theMeshInfo, theNodes, theDiameters, theFamilyNums, theElemNums)); } + //---------------------------------------------------------------------------- //! A copy-constructor for the MEDWrapper MED Balls representation virtual PBallInfo CrBallInfo(const PMeshInfo& theMeshInfo, const PBallInfo& theInfo) { - return PBallInfo( new TTBallInfo( theMeshInfo, theInfo )); + return PBallInfo( new TTBallInfo( theMeshInfo, theInfo )); } //---------------------------------------------------------------------------- @@ -408,7 +411,7 @@ namespace MED EBooleen theIsLocal = eVRAI, TInt theNbRef = 1) { - return PFieldInfo(new TTFieldInfo + return PFieldInfo(new TTFieldInfo (theMeshInfo, theNbComp, theType, @@ -417,16 +420,16 @@ namespace MED theNbRef)); } + //---------------------------------------------------------------------------- virtual PFieldInfo CrFieldInfo(const PMeshInfo& theMeshInfo, const PFieldInfo& theInfo) { - return PFieldInfo(new TTFieldInfo + return PFieldInfo(new TTFieldInfo (theMeshInfo, theInfo)); } - //---------------------------------------------------------------------------- virtual @@ -441,7 +444,7 @@ namespace MED const std::string& theUnitDt = "", const TGeom2Gauss& theGeom2Gauss = TGeom2Gauss()) { - return PTimeStampInfo(new TTTimeStampInfo + return PTimeStampInfo(new TTTimeStampInfo (theFieldInfo, theEntity, theGeom2Size, @@ -453,28 +456,27 @@ namespace MED theGeom2Gauss)); } + //---------------------------------------------------------------------------- virtual PTimeStampInfo CrTimeStampInfo(const PFieldInfo& theFieldInfo, const PTimeStampInfo& theInfo) { - return PTimeStampInfo(new TTTimeStampInfo + return PTimeStampInfo(new TTTimeStampInfo (theFieldInfo, theInfo)); } - //---------------------------------------------------------------------------- virtual PGaussInfo CrGaussInfo(const TGaussInfo::TInfo& theInfo, EModeSwitch theMode = eFULL_INTERLACE) { - return PGaussInfo(new TTGaussInfo + return PGaussInfo(new TTGaussInfo (theInfo, theMode)); } - //---------------------------------------------------------------------------- virtual @@ -482,11 +484,10 @@ namespace MED CrProfileInfo(const TProfileInfo::TInfo& theInfo, EModeProfil theMode = eCOMPACT) { - return PProfileInfo(new TTProfileInfo + return PProfileInfo(new TTProfileInfo (theInfo, theMode)); } - //---------------------------------------------------------------------------- virtual @@ -497,18 +498,19 @@ namespace MED EModeSwitch theMode = eFULL_INTERLACE) { if(theTypeChamp == eFLOAT64) - return PTimeStampValueBase(new TTTimeStampValue + return PTimeStampValueBase(new TTTimeStampValue (theTimeStampInfo, theTypeChamp, theGeom2Profile, theMode)); - return PTimeStampValueBase(new TTTimeStampValue + return PTimeStampValueBase(new TTTimeStampValue (theTimeStampInfo, theTypeChamp, theGeom2Profile, theMode)); } + //---------------------------------------------------------------------------- virtual PTimeStampValueBase CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo, @@ -516,11 +518,11 @@ namespace MED ETypeChamp theTypeChamp) { if(theTypeChamp == eFLOAT64) - return PTimeStampValueBase(new TTTimeStampValue + return PTimeStampValueBase(new TTTimeStampValue (theTimeStampInfo, theInfo, theTypeChamp)); - return PTimeStampValueBase(new TTTimeStampValue + return PTimeStampValueBase(new TTTimeStampValue (theTimeStampInfo, theInfo, theTypeChamp)); @@ -532,47 +534,48 @@ namespace MED CrGrilleInfo(const PMeshInfo& theMeshInfo, const PGrilleInfo& theInfo) { - return PGrilleInfo(new TTGrilleInfo + return PGrilleInfo(new TTGrilleInfo (theMeshInfo, theInfo)); } + + //---------------------------------------------------------------------------- virtual PGrilleInfo CrGrilleInfo(const PMeshInfo& theMeshInfo, const EGrilleType& type) { - return PGrilleInfo(new TTGrilleInfo + return PGrilleInfo(new TTGrilleInfo (theMeshInfo, type)); } + //---------------------------------------------------------------------------- virtual PGrilleInfo CrGrilleInfo(const PMeshInfo& theMeshInfo, const EGrilleType& type, const TInt& nbNodes) { - return PGrilleInfo(new TTGrilleInfo + return PGrilleInfo(new TTGrilleInfo (theMeshInfo, type, nbNodes)); } + //---------------------------------------------------------------------------- virtual PGrilleInfo CrGrilleInfo(const PMeshInfo& theMeshInfo, const EGrilleType& type, const MED::TIntVector& nbNodeVec) { - return PGrilleInfo(new TTGrilleInfo + return PGrilleInfo(new TTGrilleInfo (theMeshInfo, type, nbNodeVec)); } - //---------------------------------------------------------------------------- }; - } - -#endif +#endif // MED_TWrapper_HeaderFile diff --git a/src/MEDWrapper/Base/MED_Utilities.cxx b/src/MEDWrapper/MED_Utilities.cxx similarity index 50% rename from src/MEDWrapper/Base/MED_Utilities.cxx rename to src/MEDWrapper/MED_Utilities.cxx index 7366f22d8..9044e0ec1 100644 --- a/src/MEDWrapper/Base/MED_Utilities.cxx +++ b/src/MEDWrapper/MED_Utilities.cxx @@ -19,18 +19,16 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + #include "MED_Utilities.hxx" #include "MED_Common.hxx" -using namespace std; - #ifdef _DEBUG_ static int MYDEBUG = 0; #else // static int MYDEBUG = 0; #endif - int MED::PrefixPrinter::myCounter = 0; MED::PrefixPrinter::PrefixPrinter(bool theIsActive): @@ -46,68 +44,59 @@ MED::PrefixPrinter::~PrefixPrinter() if(myIsActive){ myCounter--; if(myCounter < 0) - EXCEPTION(runtime_error,"PrefixPrinter::~PrefixPrinter() - myCounter("< #include @@ -30,7 +31,6 @@ #include #include - namespace MED { class MEDWRAPPER_EXPORT PrefixPrinter @@ -51,14 +51,13 @@ namespace MED #define INITMSGA(deb,lev,msg) MED::PrefixPrinter aPrefixPrinter_##lev(deb); BEGMSG(deb,msg) #define INITMSG(deb,msg) INITMSGA(deb,,msg) #define ADDMSG(deb,msg) if(deb) std::cout< TInt - GetDESCLength() + GetDESCLength() { return 200; } - template<> TInt - GetIDENTLength() + GetIDENTLength() { return 8; } - template<> TInt - GetNOMLength() + GetNOMLength() { return 64; } - template<> TInt - GetLNOMLength() + GetLNOMLength() { return 80; } - template<> TInt - GetPNOMLength() + GetPNOMLength() { return 16; } - template<> void - GetVersionRelease(TInt& majeur, TInt& mineur, TInt& release) + GetVersionRelease(TInt& majeur, TInt& mineur, TInt& release) { majeur=MED_MAJOR_NUM; mineur=MED_MINOR_NUM; release=MED_RELEASE_NUM; } - template<> TInt - GetNbConn(EGeometrieElement typmai, + GetNbConn(EGeometrieElement typmai, EEntiteMaillage typent, TInt mdim) { @@ -92,7 +83,6 @@ namespace MED namespace V2_2 { - //--------------------------------------------------------------- class TFile{ TFile(); @@ -142,7 +132,6 @@ namespace MED std::string myFileName; }; - //--------------------------------------------------------------- class TFileWrapper { @@ -161,7 +150,6 @@ namespace MED } }; - //--------------------------------------------------------------- TVWrapper::TVWrapper(const std::string& theFileName): myFile(new TFile(theFileName)) @@ -182,7 +170,6 @@ namespace MED } } - //---------------------------------------------------------------------------- TInt TVWrapper @@ -196,7 +183,6 @@ namespace MED return MEDnMesh(myFile->Id()); } - //---------------------------------------------------------------------------- void TVWrapper @@ -239,7 +225,6 @@ namespace MED EXCEPTION(std::runtime_error,"GetMeshInfo - MEDmeshInfo(...)"); } - //---------------------------------------------------------------------------- void TVWrapper @@ -289,7 +274,6 @@ namespace MED EXCEPTION(std::runtime_error,"SetMeshInfo - MEDmeshCr(...)"); } - //---------------------------------------------------------------------------- void TVWrapper @@ -309,7 +293,6 @@ namespace MED *theErr = aRet; } - //---------------------------------------------------------------------------- TInt TVWrapper @@ -326,7 +309,6 @@ namespace MED return MEDnFamily(myFile->Id(),&aName); } - //---------------------------------------------------------------------------- TInt TVWrapper @@ -346,7 +328,6 @@ namespace MED return MEDnFamily23Attribute(myFile->Id(),&aName,theFamId); } - //---------------------------------------------------------------------------- TInt TVWrapper @@ -366,7 +347,6 @@ namespace MED return MEDnFamilyGroup(myFile->Id(),&aName,theFamId); } - //---------------------------------------------------------------------------- void TVWrapper @@ -409,7 +389,6 @@ namespace MED "; theInfo.myNbAttr = "<Id()); } - //---------------------------------------------------------------------------- TInt TVWrapper @@ -1792,7 +1756,6 @@ namespace MED return MEDfieldnComponent(myFile->Id(),theFieldId); } - //---------------------------------------------------------------------------- void TVWrapper @@ -1842,7 +1805,6 @@ namespace MED EXCEPTION(std::runtime_error,"GetFieldInfo - MEDfieldInfo(...)"); } - //---------------------------------------------------------------------------- void TVWrapper @@ -1879,7 +1841,6 @@ namespace MED EXCEPTION(std::runtime_error,"SetFieldInfo - MEDfieldCr(...)"); } - //---------------------------------------------------------------------------- void TVWrapper @@ -1896,7 +1857,6 @@ namespace MED *theErr = aRet; } - //---------------------------------------------------------------------------- TInt TVWrapper @@ -1910,7 +1870,6 @@ namespace MED return MEDnLocalization(myFile->Id()); } - //---------------------------------------------------------------------------- TGaussInfo::TInfo TVWrapper @@ -1923,7 +1882,7 @@ namespace MED return TGaussInfo::TInfo( TGaussInfo::TKey(ePOINT1,""),0 ); med_int aNbGaussPoints = med_int(); - TVector aName(GetNOMLength()+1); + TVector aName(GetNOMLength()+1); med_geometry_type aGeom = MED_NONE; TErr aRet; @@ -1950,7 +1909,6 @@ namespace MED TInt(aNbGaussPoints)); } - //---------------------------------------------------------------------------- void TVWrapper @@ -1983,7 +1941,6 @@ namespace MED EXCEPTION(std::runtime_error,"GetGaussInfo - MEDlocalizationRd(...)"); } - //---------------------------------------------------------------------------- TInt TVWrapper @@ -2008,7 +1965,7 @@ namespace MED return TProfileInfo::TInfo(); med_int aSize = -1; - TVector aName(GetNOMLength()+1); + TVector aName(GetNOMLength()+1); TErr aRet; aRet = MEDprofileInfo(myFile->Id(), @@ -2217,7 +2174,6 @@ namespace MED return aNbTimeStamps; } - //---------------------------------------------------------------------------- void TVWrapper @@ -2310,7 +2266,6 @@ namespace MED EXCEPTION(std::runtime_error,"GetTimeStampInfo - MEDfieldnValueWithProfile(...)"); } } - //---------------------------------------------------------------------------- void @@ -2343,11 +2298,11 @@ namespace MED TValueHolder aMeshName(aMeshInfo->myName); TGeom2Gauss& aGeom2Gauss = aTimeStampInfo->myGeom2Gauss; - TVector aGaussName(GetNOMLength()+1); + TVector aGaussName(GetNOMLength()+1); med_storage_mode aProfileMode = med_storage_mode(boost::get<0>(theMKey2Profile)); MED::TKey2Profile aKey2Profile = boost::get<1>(theMKey2Profile); - TVector aProfileName(GetNOMLength()+1); + TVector aProfileName(GetNOMLength()+1); TGeom2Size& aGeom2Size = aTimeStampInfo->myGeom2Size; TGeom2Size::iterator anIter = aGeom2Size.begin(); @@ -2480,7 +2435,6 @@ namespace MED } } - //---------------------------------------------------------------------------- void TVWrapper @@ -2518,14 +2472,14 @@ namespace MED for(; anIter != aGeomSet.end(); anIter++){ EGeometrieElement aGeom = *anIter; - TVector aGaussName(GetNOMLength()+1); + TVector aGaussName(GetNOMLength()+1); MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aGeom); if(aGaussIter != aGeom2Gauss.end()){ MED::PGaussInfo aGaussInfo = aGaussIter->second; strcpy(&aGaussName[0],&aGaussInfo->myName[0]); } - TVector aProfileName(GetNOMLength()+1); + TVector aProfileName(GetNOMLength()+1); med_storage_mode aProfileMode = med_storage_mode(eNO_PFLMOD); MED::TGeom2Profile::const_iterator aProfileIter = aGeom2Profile.find(aGeom); if(aProfileIter != aGeom2Profile.end()){ @@ -2562,7 +2516,6 @@ namespace MED INITMSG(MYDEBUG,"TVWrapper::SetTimeStampValue - MED_MODE_ACCES = "< - TInt MED_V22_WRAPPER_EXPORT - GetDESCLength(); + MEDWRAPPER_EXPORT + TInt + GetDESCLength(); - template<> - TInt MED_V22_WRAPPER_EXPORT - GetIDENTLength(); + MEDWRAPPER_EXPORT + TInt + GetIDENTLength(); - template<> - TInt MED_V22_WRAPPER_EXPORT - GetNOMLength(); + MEDWRAPPER_EXPORT + TInt + GetNOMLength(); - template<> - TInt MED_V22_WRAPPER_EXPORT - GetLNOMLength(); + MEDWRAPPER_EXPORT + TInt + GetLNOMLength(); - template<> - TInt MED_V22_WRAPPER_EXPORT - GetPNOMLength(); + MEDWRAPPER_EXPORT + TInt + GetPNOMLength(); - template<> - void MED_V22_WRAPPER_EXPORT - GetVersionRelease(TInt& majeur, TInt& mineur, TInt& release); + MEDWRAPPER_EXPORT + void + GetVersionRelease(TInt& majeur, TInt& mineur, TInt& release); - template<> - TInt MED_V22_WRAPPER_EXPORT - GetNbConn(EGeometrieElement typmai, + MEDWRAPPER_EXPORT + TInt + GetNbConn(EGeometrieElement typmai, EEntiteMaillage typent, TInt mdim); @@ -84,7 +68,7 @@ namespace MED typedef enum {eLECTURE, eLECTURE_ECRITURE, eLECTURE_AJOUT, eCREATION} EModeAcces; //---------------------------------------------------------------------------- - class MED_V22_WRAPPER_EXPORT TVWrapper: public MED::TTWrapper + class MEDWRAPPER_EXPORT TVWrapper: public MED::TTWrapper { TVWrapper(); TVWrapper(const TVWrapper&); @@ -486,4 +470,4 @@ namespace MED } } -#endif +#endif // MED_V2_2_Wrapper_HeaderFile diff --git a/src/MEDWrapper/Base/MED_Vector.hxx b/src/MEDWrapper/MED_Vector.hxx similarity index 99% rename from src/MEDWrapper/Base/MED_Vector.hxx rename to src/MEDWrapper/MED_Vector.hxx index 5e3932d02..b260ddacb 100644 --- a/src/MEDWrapper/Base/MED_Vector.hxx +++ b/src/MEDWrapper/MED_Vector.hxx @@ -19,6 +19,7 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + #ifndef MED_Vector_HeaderFile #define MED_Vector_HeaderFile @@ -31,7 +32,6 @@ namespace MED { - //! Main purpose to introduce the class was to customize operator [] template > class TVector : public std::vector<_Tp, _Alloc> @@ -144,9 +144,8 @@ namespace MED return get_value(__n); } }; - } #undef MED_TVECTOR_CHECK_RANGE -#endif +#endif // MED_Vector_HeaderFile diff --git a/src/MEDWrapper/Base/MED_Wrapper.cxx b/src/MEDWrapper/MED_Wrapper.cxx similarity index 99% rename from src/MEDWrapper/Base/MED_Wrapper.cxx rename to src/MEDWrapper/MED_Wrapper.cxx index 745872228..8cf3bdbfb 100644 --- a/src/MEDWrapper/Base/MED_Wrapper.cxx +++ b/src/MEDWrapper/MED_Wrapper.cxx @@ -19,9 +19,7 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// File : MED_Wrapper.cxx -// Author : Alexey PETROV -// + #include "MED_Wrapper.hxx" #include "MED_Utilities.hxx" diff --git a/src/MEDWrapper/Base/MED_Wrapper.hxx b/src/MEDWrapper/MED_Wrapper.hxx similarity index 99% rename from src/MEDWrapper/Base/MED_Wrapper.hxx rename to src/MEDWrapper/MED_Wrapper.hxx index 1ccf6f4c3..19b29f8a8 100644 --- a/src/MEDWrapper/Base/MED_Wrapper.hxx +++ b/src/MEDWrapper/MED_Wrapper.hxx @@ -23,8 +23,7 @@ #ifndef MED_Wrapper_HeaderFile #define MED_Wrapper_HeaderFile -#include "MED_WrapperBase.hxx" - +#include "MED_WrapperDef.hxx" #include "MED_Structures.hxx" #include "MED_Algorithm.hxx" @@ -32,7 +31,6 @@ namespace MED { - //---------------------------------------------------------------------------- //! Define a base class that wraps the MED API struct MEDWRAPPER_EXPORT TWrapper @@ -44,12 +42,6 @@ namespace MED virtual ~TWrapper(); - //---------------------------------------------------------------------------- - //! Gets version of the MED library used for the MED file - virtual - EVersion - GetVersion() = 0; - //---------------------------------------------------------------------------- //! Creates a MEDWrapper MED Mesh representation virtual @@ -88,7 +80,6 @@ namespace MED GetPMeshInfo(TInt theId, TErr* theErr = NULL); - //---------------------------------------------------------------------------- //! Read number of MED Family entities in the defined MED file virtual @@ -650,7 +641,6 @@ namespace MED SetFieldInfo(const TFieldInfo& theInfo, TErr* theErr = NULL) = 0; - //! Creates a MEDWrapper MED FIELD representation virtual PFieldInfo @@ -673,7 +663,6 @@ namespace MED TInt theId, TErr* theErr = NULL); - //---------------------------------------------------------------------------- //! Read number of MED GAUSS in defined MED Mesh /*! This feature is support only for version of 2.2 and higher */ @@ -710,7 +699,6 @@ namespace MED CrGaussInfo(const TGaussInfo::TInfo& theInfo, EModeSwitch theMode = eFULL_INTERLACE) = 0; - //---------------------------------------------------------------------------- //! Read number of MED TIMESTAMPS in defined MED Mesh /*! @@ -759,7 +747,6 @@ namespace MED const TGeom2Size& theGeom2Size, TInt theId, TErr* theErr = NULL); - //---------------------------------------------------------------------------- //! Read number of MED PROFILES in defined MED Mesh @@ -798,7 +785,6 @@ namespace MED EModeProfil theMode = eCOMPACT, TErr* theErr = NULL); - //---------------------------------------------------------------------------- //! Read the values for MEDWrapper MED TIEMSTAMP from defined MED file virtual @@ -967,10 +953,8 @@ namespace MED TErr* theErr = NULL) { } - }; - //---------------------------------------------------------------------------- //! This class provide thread-safety for MEDWrapper interaction class MEDWRAPPER_EXPORT TLockProxy @@ -986,7 +970,6 @@ namespace MED TWrapper * operator-> () const; }; - //---------------------------------------------------------------------------- //! To specialize the SharedPtr for TWrapper template<> @@ -1049,4 +1032,4 @@ namespace MED typedef SharedPtr PWrapper; } -#endif +#endif // MED_Wrapper_HeaderFile diff --git a/src/MEDWrapper/Base/MED_WrapperBase.hxx b/src/MEDWrapper/MED_WrapperDef.hxx similarity index 68% rename from src/MEDWrapper/Base/MED_WrapperBase.hxx rename to src/MEDWrapper/MED_WrapperDef.hxx index 03913a9ed..473abaabb 100755 --- a/src/MEDWrapper/Base/MED_WrapperBase.hxx +++ b/src/MEDWrapper/MED_WrapperDef.hxx @@ -19,28 +19,18 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// File : MED_WrapperBase.hxx -// Author : Alexander A. BORODIN -// -#ifndef _MED_WrapperBase_HXX_ -#define _MED_WrapperBase_HXX_ + +#ifndef MED_WrapperDef_HeaderFile +#define MED_WrapperDef_HeaderFile #ifdef WIN32 - #if defined MEDWRAPPER_BASE_EXPORTS || defined MEDWrapperBase_EXPORTS - #if defined WIN32 - #define MEDWRAPPER_EXPORT __declspec( dllexport ) - #else - #define MEDWRAPPER_EXPORT - #endif - #else - #if defined WIN32 - #define MEDWRAPPER_EXPORT __declspec( dllimport ) - #else - #define MEDWRAPPER_EXPORT - #endif - #endif +# if defined(MEDWRAPPER_EXPORTS) || defined(MEDWrapper_EXPORTS) +# define MEDWRAPPER_EXPORT __declspec( dllexport ) +# else +# define MEDWRAPPER_EXPORT __declspec( dllimport ) +# endif // WIN32 #else - #define MEDWRAPPER_EXPORT +# define MEDWRAPPER_EXPORT #endif -#endif +#endif // MED_WrapperDef_HeaderFile diff --git a/src/MEDWrapper/V2_2/CMakeLists.txt b/src/MEDWrapper/V2_2/CMakeLists.txt deleted file mode 100644 index e62780c87..000000000 --- a/src/MEDWrapper/V2_2/CMakeLists.txt +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright (C) 2012-2016 CEA/DEN, EDF R&D, OPEN CASCADE -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# 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( - ${MEDFILE_INCLUDE_DIRS} - ${HDF5_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${KERNEL_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR}/../Base -) - -# additional preprocessor / compiler flags -ADD_DEFINITIONS( - ${HDF5_DEFINITIONS} - ${BOOST_DEFINITIONS} -) - -SET(_link_LIBRARIES - ${HDF5_LIBS} - ${MEDFILE_C_LIBRARIES} - ${Boost_LIBRARIES} - MEDWrapperBase -) - -# --- headers --- - -# header files / no moc processing -SET(MEDWrapper_V2_2_HEADERS - MED_V2_2_Wrapper.hxx -) - -# --- sources --- - -# sources / static -SET(MEDWrapper_V2_2_SOURCES - MED_V2_2_Wrapper.cxx -) - -# --- rules --- - -ADD_LIBRARY(MEDWrapper_V2_2 ${MEDWrapper_V2_2_SOURCES}) -TARGET_LINK_LIBRARIES(MEDWrapper_V2_2 ${_link_LIBRARIES}) -INSTALL(TARGETS MEDWrapper_V2_2 EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) - -INSTALL(FILES ${MEDWrapper_V2_2_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) diff --git a/src/MEDWrapper/Factory/mprint_version.cxx b/src/MEDWrapper/mprint_version.cxx similarity index 100% rename from src/MEDWrapper/Factory/mprint_version.cxx rename to src/MEDWrapper/mprint_version.cxx diff --git a/src/SMESH/CMakeLists.txt b/src/SMESH/CMakeLists.txt index 7858c1c4a..e96f78f1b 100644 --- a/src/SMESH/CMakeLists.txt +++ b/src/SMESH/CMakeLists.txt @@ -27,7 +27,7 @@ INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} ${HDF5_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/src/Controls - ${PROJECT_SOURCE_DIR}/src/MEDWrapper/Base + ${PROJECT_SOURCE_DIR}/src/MEDWrapper ${PROJECT_SOURCE_DIR}/src/Driver ${PROJECT_SOURCE_DIR}/src/DriverDAT ${PROJECT_SOURCE_DIR}/src/DriverMED diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index 04d047611..e0a067a6d 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -1393,7 +1393,7 @@ bool SMESH_Mesh::HasDuplicatedGroupNamesMED() void SMESH_Mesh::ExportMED(const char * file, const char* theMeshName, bool theAutoGroups, - int theVersion, + int /*theVersion*/, const SMESHDS_Mesh* meshPart, bool theAutoDimension, bool theAddODOnVertices) @@ -1402,7 +1402,7 @@ void SMESH_Mesh::ExportMED(const char * file, SMESH_TRY; DriverMED_W_SMESHDS_Mesh myWriter; - myWriter.SetFile ( file, MED::EVersion(theVersion) ); + myWriter.SetFile ( file ); myWriter.SetMesh ( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS ); myWriter.SetAutoDimension( theAutoDimension ); myWriter.AddODOnVertices ( theAddODOnVertices ); diff --git a/src/SMESHClient/CMakeLists.txt b/src/SMESHClient/CMakeLists.txt index 4ac6d4322..6dcea0662 100644 --- a/src/SMESHClient/CMakeLists.txt +++ b/src/SMESHClient/CMakeLists.txt @@ -71,8 +71,6 @@ SET(_link_LIBRARIES SMESHDS SMESHControls MEDWrapper - MEDWrapperBase - MEDWrapper_V2_2 ) # --- headers --- diff --git a/src/SMESHGUI/CMakeLists.txt b/src/SMESHGUI/CMakeLists.txt index b3acd18ac..a06cac157 100644 --- a/src/SMESHGUI/CMakeLists.txt +++ b/src/SMESHGUI/CMakeLists.txt @@ -42,7 +42,7 @@ INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/src/SMESHUtils ${PROJECT_SOURCE_DIR}/src/Controls ${PROJECT_SOURCE_DIR}/src/SMESHClient - ${PROJECT_SOURCE_DIR}/src/MEDWrapper/Base + ${PROJECT_SOURCE_DIR}/src/MEDWrapper ${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}/idl ) diff --git a/src/SMESH_I/CMakeLists.txt b/src/SMESH_I/CMakeLists.txt index f8fabc08c..155916e38 100644 --- a/src/SMESH_I/CMakeLists.txt +++ b/src/SMESH_I/CMakeLists.txt @@ -31,8 +31,7 @@ INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/src/Controls ${PROJECT_SOURCE_DIR}/src/SMDS ${PROJECT_SOURCE_DIR}/src/SMESHDS - ${PROJECT_SOURCE_DIR}/src/MEDWrapper/Base - ${PROJECT_SOURCE_DIR}/src/MEDWrapper/Factory + ${PROJECT_SOURCE_DIR}/src/MEDWrapper ${PROJECT_SOURCE_DIR}/src/Driver ${PROJECT_SOURCE_DIR}/src/DriverMED ${PROJECT_SOURCE_DIR}/src/DriverCGNS diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index d4d65b56c..64e0c3e69 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -2965,14 +2965,17 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart, CORBA::Boolean SMESH_Gen_i::GetMEDVersion(const char* theFileName, SMESH::MED_VERSION& theVersion) { - theVersion = SMESH::MED_V2_1; - MED::EVersion aVersion = MED::GetVersionId( theFileName ); - switch( aVersion ) { - case MED::eV2_1 : theVersion = SMESH::MED_V2_1; return true; - case MED::eV2_2 : theVersion = SMESH::MED_V2_2; return true; - case MED::eVUnknown : return false; + theVersion = SMESH::MED_V2_2; + + int major, minor, release; + bool result = MED::GetMEDVersion( theFileName, major, minor, release ); + if ( result ) { + int version = major * 100 + minor; + if ( version < 202 ) theVersion = SMESH::MED_V2_1; + else theVersion = SMESH::MED_V2_2; } - return false; + + return result; } //================================================================================ @@ -2985,7 +2988,7 @@ CORBA::Boolean SMESH_Gen_i::GetMEDVersion(const char* theFileName, SMESH::string_array* SMESH_Gen_i::GetMeshNames(const char* theFileName) { SMESH::string_array_var aResult = new SMESH::string_array(); - MED::PWrapper aMed = MED::CrWrapper( theFileName ); + MED::PWrapper aMed = MED::CrWrapperR( theFileName ); MED::TErr anErr; MED::TInt aNbMeshes = aMed->GetNbMeshes( &anErr ); if( anErr >= 0 ) { diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index 44195b8c8..f2712cab2 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -406,7 +406,7 @@ SMESH_Mesh_i::ImportMEDFile( const char* theFileName, const char* theMeshName ) CreateGroupServants(); int major, minor, release; - if( !MED::getMEDVersion( theFileName, major, minor, release ) ) + if( !MED::GetMEDVersion( theFileName, major, minor, release ) ) major = minor = release = -1; _medFileInfo = new SMESH::MedFileInfo(); _medFileInfo->fileName = theFileName; @@ -455,8 +455,7 @@ SMESH::DriverMED_ReadStatus SMESH_Mesh_i::ImportCGNSFile( const char* theFileNa char* SMESH_Mesh_i::GetVersionString(SMESH::MED_VERSION version, CORBA::Short nbDigits) { - string ver = DriverMED_W_SMESHDS_Mesh::GetVersionString(MED::EVersion(version), - nbDigits); + string ver = DriverMED_W_SMESHDS_Mesh::GetVersionString(nbDigits); return CORBA::string_dup( ver.c_str() ); } diff --git a/src/SMESH_I/SMESH_PreMeshInfo.cxx b/src/SMESH_I/SMESH_PreMeshInfo.cxx index 3d8980ff9..0c63b511a 100644 --- a/src/SMESH_I/SMESH_PreMeshInfo.cxx +++ b/src/SMESH_I/SMESH_PreMeshInfo.cxx @@ -465,10 +465,7 @@ bool SMESH_PreMeshInfo::readMeshInfo() { _isInfoOk = true; - MED::PWrapper aMed = MED::CrWrapper(_medFileName,true); - // if ( aMed->GetVersion() != MED::eV2_2 ) - // return false; - + MED::PWrapper aMed = MED::CrWrapperR(_medFileName); MED::PMeshInfo medMeshInfo = aMed->CrMeshInfo(3,3,SMESH_Comment( _meshID )); // read nb nodes @@ -521,7 +518,7 @@ void SMESH_PreMeshInfo::readGroupInfo() map< int, vector< SMESH_PreMeshInfo* > > famId2grInfo; - MED::PWrapper aMed = MED::CrWrapper(_medFileName,false); + MED::PWrapper aMed = MED::CrWrapperR(_medFileName); MED::PMeshInfo medMeshInfo = aMed->CrMeshInfo(3,3,SMESH_Comment( _meshID )); // read families to fill in famId2grInfo -- 2.39.2