]> SALOME platform Git repositories - modules/homard.git/blobdiff - src/HOMARD/HOMARD_Hypothesis.cxx
Salome HOME
Remplacement de mktemp par mkdtemp ou mkstemp.
[modules/homard.git] / src / HOMARD / HOMARD_Hypothesis.cxx
index f27051da278cf2fabde5cf760beec7354068f163..cfccb10e6c453cb6e0c0e89037e499a64176d778 100644 (file)
@@ -231,7 +231,7 @@ int HOMARD_Hypothesis::GetUseComp() const
 //=============================================================================
 void HOMARD_Hypothesis::AddComp( const char* NomComp )
 {
-// On commence par la supprimer au cas ou elle aurait deja ete inseree
+// On commence par supprimer la composante 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
   SupprComp( NomComp ) ;
@@ -341,9 +341,26 @@ const int HOMARD_Hypothesis::GetLevelOutput() const
 //=============================================================================
 void HOMARD_Hypothesis::AddGroup( const char* Group)
 {
+// On commence par supprimer le groupe au cas ou il aurait deja ete insere
+// Cela peut se produire dans un schema YACS quand on repasse plusieurs fois par la
+// definition de l'hypothese
+  SupprGroup( Group ) ;
+// Insertion veritable
   _ListGroupSelected.push_back(Group);
 }
 //=============================================================================
+void HOMARD_Hypothesis::SupprGroup( const char* Group )
+{
+  MESSAGE ("SupprGroup pour "<<Group) ;
+  std::list<std::string>::iterator it = find( _ListGroupSelected.begin(), _ListGroupSelected.end(), Group );
+  if ( it != _ListGroupSelected.end() ) { it = _ListGroupSelected.erase( it ); }
+}
+//=============================================================================
+void HOMARD_Hypothesis::SupprGroups()
+{
+  _ListGroupSelected.clear();
+}
+//=============================================================================
 void HOMARD_Hypothesis::SetGroups( const std::list<std::string>& ListGroup )
 {
   _ListGroupSelected.clear();