From: eap Date: Tue, 29 Jan 2008 13:43:39 +0000 (+0000) Subject: PAL18696 SMESH : version of MED export X-Git-Tag: for_M2008_07022008~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=277a199f308e2173b3a35eabdee0a7cf3ba1c983;p=modules%2Fsmesh.git 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 80f792298..899c4375b 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.h +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.h @@ -48,6 +48,7 @@ class MESHDRIVERMED_EXPORT 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() */