Salome HOME
Fix Edit Mesh regression
[modules/smesh.git] / src / SMDS / SMDS_Mesh.cxx
index 1e048ffd8eae1d7c9dff026cc037672cb957689e..d6a40165c1ec7fb99e9ce13bd7d3454afcc47de8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -2919,8 +2919,7 @@ void SMDS_Mesh::CompactMesh()
 {
   this->myCompactTime = this->myModifTime;
 
-  bool idsChange = ( myNodeFactory->CompactChangePointers() ||
-                     myCellFactory->CompactChangePointers() );
+  bool idsChange = HasNumerationHoles();
   if ( idsChange )
   {
     std::set< SMDS_ElementHolder* >::iterator holder = myElemHolders.begin();
@@ -2980,6 +2979,7 @@ void SMDS_Mesh::Modified()
 {
   if (this->myModified)
   {
+    myGrid->Modified();
     this->myModifTime++;
     myModified = false;
   }
@@ -2996,6 +2996,13 @@ bool SMDS_Mesh::IsCompacted()
   return ( this->myCompactTime == this->myModifTime );
 }
 
+//! are there holes in elements or nodes numeration
+bool SMDS_Mesh::HasNumerationHoles()
+{
+  return ( myNodeFactory->CompactChangePointers() ||
+           myCellFactory->CompactChangePointers() );
+}
+
 void SMDS_Mesh::setNbShapes( size_t nbShapes )
 {
   myNodeFactory->SetNbShapes( nbShapes );