Salome HOME
PAL18696 SMESH : version of MED export
authoreap <eap@opencascade.com>
Tue, 29 Jan 2008 13:44:05 +0000 (13:44 +0000)
committereap <eap@opencascade.com>
Tue, 29 Jan 2008 13:44:05 +0000 (13:44 +0000)
+  static std::string GetVersionString(const MED::EVersion theVersion, int theNbDigits=2);

src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx
src/DriverMED/DriverMED_W_SMESHDS_Mesh.h

index cf9381ce9b1519bbe3c1dd95920f74a49c84f6cf..c0315233da06de6f5c0dd1483abdacf8e2aedea1 100644 (file)
@@ -66,6 +66,24 @@ void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName)
   return SetFile(theFileName,MED::eV2_2);
 }
 
   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;
 void DriverMED_W_SMESHDS_Mesh::SetMeshName(const std::string& theMeshName)
 {
   myMeshName = theMeshName;
index 1c8cec4b744f177d2869140a47a2c8cf01ec2846..899c4375bd13644293b859d0034718421873a88a 100644 (file)
@@ -27,6 +27,8 @@
 #ifndef _INCLUDE_DRIVERMED_W_SMESHDS_MESH
 #define _INCLUDE_DRIVERMED_W_SMESHDS_MESH
 
 #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"
 
 #include "Driver_SMESHDS_Mesh.h"
 #include "MED_Factory.hxx"
 
@@ -38,7 +40,7 @@ class SMESHDS_Mesh;
 class SMESHDS_GroupBase;
 class SMESHDS_SubMesh;
 
 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:
 
 {
   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);
 
   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()
    */
 
   /*! sets file name; only for usage with Add(), not Write()
    */