+ // Unassign algorithms in order to have all SMESH_subMeshEventListenerData deleted (22874)
+ SMESHDS_SubMeshIteratorPtr smIt = _myMeshDS->SubMeshes();
+ while ( smIt->more() ) {
+ // avoid usual removal of elements while processing RemoveHypothesis( algo ) event
+ const_cast<SMESHDS_SubMesh*>( smIt->next() )->Clear();
+ }
+ const ShapeToHypothesis & hyps = _myMeshDS->GetHypotheses();
+ for ( ShapeToHypothesis::Iterator s2hyps( hyps ); s2hyps.More(); s2hyps.Next() )
+ {
+ const TopoDS_Shape& s = s2hyps.Key();
+ THypList hyps = s2hyps.ChangeValue(); // copy
+ THypList::const_iterator h = hyps.begin();
+ for ( ; h != hyps.end(); ++h )
+ if ( (*h)->GetType() != SMESHDS_Hypothesis::PARAM_ALGO )
+ RemoveHypothesis( s, (*h)->GetID() );
+ }
+