+
+ // ============
+ // Is partner?
+ // ============
+ bool partner = theShape1.IsPartner( theShape2 );
+ TopTools_DataMapIteratorOfDataMapOfShapeShape vvIt( theMap );
+ for ( ; partner && vvIt.More(); vvIt.Next() )
+ partner = vvIt.Key().IsPartner( vvIt.Value() );
+
+ if ( partner ) // Same shape with different location
+ {
+ // recursively associate all subshapes of theShape1 and theShape2
+ typedef list< pair< TopoDS_Shape, TopoDS_Shape > > TShapePairsList;
+ TShapePairsList shapesQueue( 1, make_pair( theShape1, theShape2 ));
+ TShapePairsList::iterator s1_s2 = shapesQueue.begin();
+ for ( ; s1_s2 != shapesQueue.end(); ++s1_s2 )
+ {
+ InsertAssociation( s1_s2->first, s1_s2->second, theMap, bidirect);
+ TopoDS_Iterator s1It( s1_s2->first), s2It( s1_s2->second );
+ for ( ; s1It.More(); s1It.Next(), s2It.Next() )
+ shapesQueue.push_back( make_pair( s1It.Value(), s2It.Value() ));
+ }
+ return true;
+ }
+