PAL18696 SMESH : version of MED export

+  static std::string GetVersionString(const MED::EVersion theVersion, int theNbDigits=2);
This commit is contained in:
eap 2008-01-29 13:43:39 +00:00
parent 881539145f
commit 277a199f30
2 changed files with 19 additions and 0 deletions

View File

@ -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<eV2_1>(majeur, mineur, release);
else
MED::GetVersionRelease<eV2_2>(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;

View File

@ -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()
*/