From be2207407e044a7a65700b7750e0f08e42fdb253 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 29 Jan 2008 13:45:04 +0000 Subject: [PATCH] PAL18696 SMESH : version of MED export + /*! + * Return string representation of a MED file version comprising nbDigits + */ + char* GetVersionString(SMESH::MED_VERSION version, CORBA::Short nbDigits); --- idl/SMESH_Mesh.idl | 5 +++++ src/SMESH_I/SMESH_Mesh_i.cxx | 14 ++++++++++++++ src/SMESH_I/SMESH_Mesh_i.hxx | 4 ++++ 3 files changed, 23 insertions(+) diff --git a/idl/SMESH_Mesh.idl b/idl/SMESH_Mesh.idl index 698e4139f..6398a7340 100644 --- a/idl/SMESH_Mesh.idl +++ b/idl/SMESH_Mesh.idl @@ -396,6 +396,11 @@ module SMESH void ExportMED( in string file, in boolean auto_groups ) raises (SALOME::SALOME_Exception); + /*! + * Return string representation of a MED file version comprising nbDigits + */ + string GetVersionString(in MED_VERSION version, in short nbDigits); + /*! * Export Mesh to DAT, UNV and STL Formats * (UNV supported version is I-DEAS 10) diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index 877a0170a..78b6c1cc5 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -37,6 +37,7 @@ #include "SMESH_subMesh_i.hxx" #include "DriverMED_R_SMESHDS_Mesh.h" +#include "DriverMED_W_SMESHDS_Mesh.h" #include "SMDS_VolumeTool.hxx" #include "SMESHDS_Command.hxx" #include "SMESHDS_CommandType.hxx" @@ -245,6 +246,19 @@ SMESH_Mesh_i::ImportMEDFile( const char* theFileName, const char* theMeshName ) return ConvertDriverMEDReadStatus(status); } +//================================================================================ +/*! + * \brief Return string representation of a MED file version comprising nbDigits + */ +//================================================================================ + +char* SMESH_Mesh_i::GetVersionString(SMESH::MED_VERSION version, CORBA::Short nbDigits) +{ + std::string ver = DriverMED_W_SMESHDS_Mesh::GetVersionString(MED::EVersion(version), + nbDigits); + return CORBA::string_dup( ver.c_str() ); +} + //============================================================================= /*! * ImportUNVFile diff --git a/src/SMESH_I/SMESH_Mesh_i.hxx b/src/SMESH_I/SMESH_Mesh_i.hxx index 74fe46d3d..aab2ed902 100644 --- a/src/SMESH_I/SMESH_Mesh_i.hxx +++ b/src/SMESH_I/SMESH_Mesh_i.hxx @@ -165,6 +165,10 @@ public: * Consider maximum group name length stored in MED file. */ CORBA::Boolean HasDuplicatedGroupNamesMED(); + /*! + * Return string representation of a MED file version comprising nbDigits + */ + char* GetVersionString(SMESH::MED_VERSION version, CORBA::Short nbDigits); void ExportToMED( const char* file, CORBA::Boolean auto_groups, SMESH::MED_VERSION theVersion ) throw (SALOME::SALOME_Exception); -- 2.30.2