- TopoDS_Vertex VV1[2], VV2[2];
- TopExp::Vertices( edge1, VV1[0], VV1[1], true );
- TopExp::Vertices( edge2, VV2[0], VV2[1], true );
- list< TopoDS_Edge > edges1, edges2;
- int nbE = FindFaceAssociation( face1, VV1, face2, VV2, edges1, edges2 );
- if ( !nbE ) RETURN_BAD_RESULT("FindFaceAssociation() failed");
- if ( nbE == 2 ) // only 2 edges
- {
- // take care of proper association of propagated edges
- bool same1 = edge1.IsSame( edges1.front() );
- bool same2 = edge2.IsSame( edges2.front() );
- if ( same1 != same2 )
- Reverse(edges2, nbE);
- }
- // store association
- list< TopoDS_Edge >::iterator eIt1 = edges1.begin();
- list< TopoDS_Edge >::iterator eIt2 = edges2.begin();
- for ( ; eIt1 != edges1.end(); ++eIt1, ++eIt2 )
- {
- InsertAssociation( *eIt1, *eIt2, theMap, bidirect);
- VV1[0] = TopExp::FirstVertex( *eIt1, true );
- VV2[0] = TopExp::FirstVertex( *eIt2, true );
- InsertAssociation( VV1[0], VV2[0], theMap, bidirect);
- }
- return true;