Salome HOME
IPAL54452: Compact mesh after merge operations
[modules/smesh.git] / src / SMDS / SMDS_Mesh.cxx
index 25742c55bd3f31e4f94527665bccabecbfe109f0..d6a40165c1ec7fb99e9ce13bd7d3454afcc47de8 100644 (file)
@@ -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();
@@ -2997,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 );