+
+ // IPAL53099. Set correct neighbors to INTERNAL EDGEs, which can be connected to
+ // EDGEs of the outer WIRE but this fact can't be detected by their order.
+ if ( nbW > 1 )
+ {
+ int iFirst = 0, iLast;
+ for ( nbE = nbEdgesInWires.begin(); nbE != nbEdgesInWires.end(); ++nbE )
+ {
+ iLast = iFirst + *nbE - 1;
+ TopoDS_Vertex vv[2] = { SMESH_MesherHelper::IthVertex( 0, edges[ iFirst ]._edge ),
+ SMESH_MesherHelper::IthVertex( 1, edges[ iLast ]._edge ) };
+ bool isConnectOk = ( vv[0].IsSame( vv[1] ));
+ if ( !isConnectOk )
+ {
+ // look for an EDGE of the outer WIRE connected to vv
+ TopoDS_Vertex v0, v1;
+ for ( iE = 0; iE < nbEdgesInWires.front(); ++iE )
+ {
+ v0 = SMESH_MesherHelper::IthVertex( 0, edges[ iE ]._edge );
+ v1 = SMESH_MesherHelper::IthVertex( 1, edges[ iE ]._edge );
+ if ( vv[0].IsSame( v0 ) || vv[0].IsSame( v1 ))
+ edges[ iFirst ]._iL = iE;
+ if ( vv[1].IsSame( v0 ) || vv[1].IsSame( v1 ))
+ edges[ iLast ]._iR = iE;
+ }
+ }
+ iFirst += *nbE;
+ }
+ }