-// MESSAGE (".. Frontiere : "<< *it );
- if ( *it == BoundaryName ) { existe = true ; }
- it++ ;
- }
- // B.2. Pour une nouvelle frontiere, publication dans l'arbre d'etudes sous le cas
- if ( !existe )
- {
- char* CaseName = GetName() ;
- MESSAGE ( "AddBoundaryGroup : insertion de la frontiere dans l'arbre de " << CaseName );
- _gen_i->PublishBoundaryUnderCase(CaseName, BoundaryName) ;
+ // B.1. Si on ajoute une frontière CAO, elle doit être la seule frontière
+ if ( BoundaryType == -1 )
+ {
+ for ( it = ListBoundaryGroup.begin(); it != ListBoundaryGroup.end(); it++ )
+ {
+ boun = (*it).c_str() ;
+ MESSAGE (".. Frontiere enregistrée : "<< boun );
+ if ( *it != BoundaryName )
+ { erreur = 1 ;
+ break ; }
+ // On saute le nom du groupe
+ it++ ;
+ }
+ }
+ if ( erreur != 0 ) { break ; }
+ // B.2. Si on ajoute une frontière non CAO, il ne doit pas y avoir de frontière CAO
+ if ( BoundaryType != -1 )
+ {
+ for ( it = ListBoundaryGroup.begin(); it != ListBoundaryGroup.end(); it++ )
+ {
+ boun = (*it).c_str() ;
+ MESSAGE (".. Frontiere enregistrée : "<< boun );
+ HOMARD::HOMARD_Boundary_ptr myBoundary_0 = _gen_i->GetBoundary(boun) ;
+ int BoundaryType_0 = myBoundary_0->GetType();
+ MESSAGE ( ".. BoundaryType_0 = " << BoundaryType_0 );
+ if ( BoundaryType_0 == -1 )
+ { erreur = 2 ;
+ break ; }
+ // On saute le nom du groupe
+ it++ ;
+ }
+ if ( erreur != 0 ) { break ; }
+ }
+ // B.3. Si on ajoute une frontière discrète, il ne doit pas y avoir d'autre frontière discrète
+ if ( BoundaryType == 0 )
+ {
+ for ( it = ListBoundaryGroup.begin(); it != ListBoundaryGroup.end(); it++ )
+ {
+ boun = (*it).c_str() ;
+ MESSAGE (".. Frontiere enregistrée : "<< boun );
+ if ( boun != BoundaryName )
+ {
+ HOMARD::HOMARD_Boundary_ptr myBoundary_0 = _gen_i->GetBoundary(boun) ;
+ int BoundaryType_0 = myBoundary_0->GetType();
+ MESSAGE ( ".. BoundaryType_0 = " << BoundaryType_0 );
+ if ( BoundaryType_0 == 0 )
+ { erreur = 3 ;
+ break ; }
+ }
+ // On saute le nom du groupe
+ it++ ;
+ }
+ if ( erreur != 0 ) { break ; }
+ }
+ // B.4. Pour une nouvelle frontiere, publication dans l'arbre d'etudes sous le cas
+ bool existe = false ;
+ for ( it = ListBoundaryGroup.begin(); it != ListBoundaryGroup.end(); it++ )
+ {
+ MESSAGE (".. Frontiere : "<< *it );
+ if ( *it == BoundaryName ) { existe = true ; }
+ // On saute le nom du groupe
+ it++ ;
+ }
+ if ( !existe )
+ {
+ char* CaseName = GetName() ;
+ MESSAGE ( "AddBoundaryGroup : insertion de la frontiere dans l'arbre de " << CaseName );
+ _gen_i->PublishBoundaryUnderCase(CaseName, BoundaryName) ;
+ }
+ // B.5. Le groupe est-il deja enregistre pour une frontiere de ce cas ?
+ for ( it = ListBoundaryGroup.begin(); it != ListBoundaryGroup.end(); it++ )
+ {
+ boun = (*it).c_str() ;
+ it++ ;
+ MESSAGE (".. Groupe enregistré : "<< *it );
+ if ( *it == Group )
+ { erreur = 5 ;
+ break ; }
+ }
+ if ( erreur != 0 ) { break ; }
+ //
+ break ;