Salome HOME
23413: [CEA 2025] bug SMESH orientation
[modules/smesh.git] / src / SMESH / SMESH_Mesh.cxx
index ff127dece72588a29e297dde56a32e072bd7efb2..eac04a4d1604fda010e7e467e0897f81f132a8b7 100644 (file)
@@ -714,6 +714,7 @@ SMESH_Mesh::AddHypothesis(const TopoDS_Shape & aSubShape,
     }
   }
   HasModificationsToDiscard(); // to reset _isModified flag if a mesh becomes empty
+  GetMeshDS()->Modified();
 
   if(MYDEBUG) subMesh->DumpAlgoState(true);
   if(MYDEBUG) SCRUTE(ret);
@@ -784,6 +785,7 @@ SMESH_Mesh::RemoveHypothesis(const TopoDS_Shape & aSubShape,
   }
 
   HasModificationsToDiscard(); // to reset _isModified flag if mesh become empty
+  GetMeshDS()->Modified();
 
   if(MYDEBUG) subMesh->DumpAlgoState(true);
   if(MYDEBUG) SCRUTE(ret);
@@ -1384,6 +1386,8 @@ bool SMESH_Mesh::HasDuplicatedGroupNamesMED()
      *         - 2D if all mesh nodes lie on XOY coordinate plane, or
      *         - 3D in the rest cases.
      *         If \a theAutoDimension is \c false, the space dimension is always 3.
+ *  \param [in] theAddODOnVertices - to create 0D elements on all vertices
+ *  \param [in] theAllElemsToGroup - to make every element to belong to any group (PAL23413)
  *  \return int - mesh index in the file
  */
 //================================================================================
@@ -1394,7 +1398,8 @@ void SMESH_Mesh::ExportMED(const char *        file,
                            int                 theVersion,
                            const SMESHDS_Mesh* meshPart,
                            bool                theAutoDimension,
-                           bool                theAddODOnVertices)
+                           bool                theAddODOnVertices,
+                           bool                theAllElemsToGroup)
   throw(SALOME_Exception)
 {
   SMESH_TRY;
@@ -1417,6 +1422,8 @@ void SMESH_Mesh::ExportMED(const char *        file,
     myWriter.AddGroupOfFaces();
     myWriter.AddGroupOfVolumes();
   }
+  if ( theAllElemsToGroup )
+    myWriter.AddAllToGroup();
 
   // Pass groups to writer. Provide unique group names.
   //set<string> aGroupNames; // Corrected for Mantis issue 0020028
@@ -1472,7 +1479,9 @@ void SMESH_Mesh::ExportSAUV(const char *file,
   cmd += "from medutilities import my_remove ; my_remove(r'" + medfilename + "')";
   cmd += "\"";
   system(cmd.c_str());
-  ExportMED(medfilename.c_str(), theMeshName, theAutoGroups, 1);
+  ExportMED(medfilename.c_str(), theMeshName, theAutoGroups, /*theVersion=*/1,
+            /*meshPart=*/NULL, /*theAutoDimension=*/false, /*theAddODOnVertices=*/false,
+            /*theAllElemsToGroup=*/true ); // theAllElemsToGroup is for PAL0023413
 #ifdef WIN32
   cmd = "%PYTHONBIN% ";
 #else