Salome HOME
#16479 [CEA 12950] ViscousLayers hypothesis and periodic condition
[modules/smesh.git] / src / SMESH / SMESH_Mesh.cxx
index 1ea9d48f8340a1ac6ffdfaddc7904ce3c5ee691a..77d19984f10bb7c4b445b7f426dbc85a939fd680 100644 (file)
@@ -1191,6 +1191,13 @@ void SMESH_Mesh::NotifySubMeshesHypothesisModification(const SMESH_Hypothesis* h
   if ( !GetMeshDS()->IsUsedHypothesis( hyp ))
     return;
 
+  int nbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() );
+  if ( hyp && _callUp && !_callUp->IsLoaded() ) // for not loaded mesh (#16648)
+  {
+    _callUp->HypothesisModified( hyp->GetID(), /*updateIcons=*/true );
+    nbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() ); // after loading mesh
+  }
+
   SMESH_Algo *algo;
   const SMESH_HypoFilter* compatibleHypoKind;
   std::list <const SMESHDS_Hypothesis * > usedHyps;
@@ -1258,8 +1265,9 @@ void SMESH_Mesh::NotifySubMeshesHypothesisModification(const SMESH_Hypothesis* h
   HasModificationsToDiscard(); // to reset _isModified flag if mesh becomes empty
   GetMeshDS()->Modified();
 
-  if (_callUp && hyp)
-    _callUp->HypothesisModified( hyp->GetID() );
+  int newNbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() );
+  if ( hyp && _callUp )
+    _callUp->HypothesisModified( hyp->GetID(), newNbEntities != nbEntities );
 }
 
 //=============================================================================