X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHOMARD%2FHOMARD_Hypothesis.cxx;h=a3ca10fe7abceb1238e578d67203178eb8faa7cf;hb=c123dff5c25c5ceda257978935eadeb06dd41a64;hp=65f742a64d3c253c744b566bab9863fff675ffbe;hpb=bb11ce636438c6e102403a0a0f290646df23e40c;p=modules%2Fhomard.git diff --git a/src/HOMARD/HOMARD_Hypothesis.cxx b/src/HOMARD/HOMARD_Hypothesis.cxx index 65f742a6..a3ca10fe 100644 --- a/src/HOMARD/HOMARD_Hypothesis.cxx +++ b/src/HOMARD/HOMARD_Hypothesis.cxx @@ -385,7 +385,7 @@ void HOMARD_Hypothesis::UnLinkIteration( const char* NomIteration ) if ( it != _ListIter.end() ) { MESSAGE ("Dans UnLinkIteration pour " << NomIteration) ; - _ListIter.erase( it ) ; + it = _ListIter.erase( it ) ; } } //============================================================================= @@ -402,20 +402,28 @@ const std::list& HOMARD_Hypothesis::GetIterations() const void HOMARD_Hypothesis::AddZone( const char* NomZone, int TypeUse ) { MESSAGE ("Dans AddZone pour " << NomZone) ; +// On commence par la supprimer au cas ou elle aurait deja ete inseree +// Cela peut se produire dans un schema YACS quand on repasse plusieurs fois par la +// definition de l'hypothese + SupprZone( NomZone ) ; +// Insertion veritable +// . Nom de la zone _ListZone.push_back( std::string( NomZone ) ); +// . Usage de la zone std::stringstream saux1 ; saux1 << TypeUse ; - std::string saux2 = saux1.str() ; - _ListZone.push_back( saux2 ); + _ListZone.push_back( saux1.str() ); } //============================================================================= void HOMARD_Hypothesis::SupprZone( const char* NomZone ) { MESSAGE ("Dans SupprZone pour " << NomZone) ; std::list::iterator it = find( _ListZone.begin(), _ListZone.end(), NomZone ); +// Attention a supprimer le nom de zone et le type d'usage if ( it != _ListZone.end() ) { - _ListZone.erase( it ); + it = _ListZone.erase( it ); + it = _ListZone.erase( it ); } } //=============================================================================