From: eap Date: Tue, 29 Jan 2008 13:44:05 +0000 (+0000) Subject: PAL18696 SMESH : version of MED export X-Git-Tag: V3_2_10~21 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=3ae362f0376f7b786ded2138ccb2aacfc5334d54 PAL18696 SMESH : version of MED export + static std::string GetVersionString(const MED::EVersion theVersion, int theNbDigits=2); --- diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx index cf9381ce9..c0315233d 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx @@ -66,6 +66,24 @@ void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName) return SetFile(theFileName,MED::eV2_2); } +string DriverMED_W_SMESHDS_Mesh::GetVersionString(const MED::EVersion theVersion, 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); + ostringstream name; + if ( theNbDigits > 0 ) + name << majeur; + if ( theNbDigits > 1 ) + name << "." << mineur; + if ( theNbDigits > 2 ) + name << "." << release; + return name.str(); +} + void DriverMED_W_SMESHDS_Mesh::SetMeshName(const std::string& theMeshName) { myMeshName = theMeshName; diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.h b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.h index 1c8cec4b7..899c4375b 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.h +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.h @@ -27,6 +27,8 @@ #ifndef _INCLUDE_DRIVERMED_W_SMESHDS_MESH #define _INCLUDE_DRIVERMED_W_SMESHDS_MESH +#include "SMESH_DriverMED.hxx" + #include "Driver_SMESHDS_Mesh.h" #include "MED_Factory.hxx" @@ -38,7 +40,7 @@ class SMESHDS_Mesh; class SMESHDS_GroupBase; class SMESHDS_SubMesh; -class DriverMED_W_SMESHDS_Mesh: public Driver_SMESHDS_Mesh +class MESHDRIVERMED_EXPORT DriverMED_W_SMESHDS_Mesh: public Driver_SMESHDS_Mesh { public: @@ -46,6 +48,7 @@ class DriverMED_W_SMESHDS_Mesh: public Driver_SMESHDS_Mesh virtual void SetFile(const std::string& theFileName); void SetFile(const std::string& theFileName, MED::EVersion theId); + static std::string GetVersionString(const MED::EVersion theVersion, int theNbDigits=2); /*! sets file name; only for usage with Add(), not Write() */