Salome HOME
// PAL18941(a saved study with a mesh belong Z is opened and the mesh is...
[modules/smesh.git] / src / DriverMED / DriverMED_W_SMESHDS_Mesh.cxx
index cf9381ce9b1519bbe3c1dd95920f74a49c84f6cf..f5370662b8c79d07566f61206a240e6992369f86 100644 (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;
@@ -265,6 +283,14 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
         // PAL16857(SMESH not conform to the MED convention):
         if ( aMeshDimension == 2 && anIsZDimension ) // 2D only if mesh is in XOY plane
           aMeshDimension = 3;
+        // PAL18941(a saved study with a mesh belong Z is opened and the mesh is belong X)
+        if ( aMeshDimension == 1 && !anIsXDimension ) // 1D only if mesh is along OX
+          if ( anIsYDimension ) {
+            aMeshDimension = 2;
+            anIsXDimension = true;
+          } else {
+            aMeshDimension = 3;
+          }
       }
 
       SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator();