From 38beeccb16af86f2e8efd6363011ff0507c4526e Mon Sep 17 00:00:00 2001 From: skl Date: Wed, 21 May 2008 06:31:42 +0000 Subject: [PATCH] Updated for NPAL19665. --- src/StdMeshers/StdMeshers_ProjectionUtils.cxx | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx index 3b69a201f..90b677811 100644 --- a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx +++ b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx @@ -773,6 +773,59 @@ bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& the } break; // try by vertex closeness } + case TopAbs_COMPOUND: { + if ( IsPropagationPossible( theMesh1, theMesh2 )) { + // find boundary(for theShape1) edge + TopoDS_Edge E; + for(TopExp_Explorer exp(theShape1, TopAbs_EDGE); exp.More(); exp.Next() ) { + E = TopoDS::Edge( exp.Current() ); + int NbFacesFromShape1 = 0; + const TopTools_ListOfShape& EAncestors = theMesh1->GetAncestors(E); + TopTools_ListIteratorOfListOfShape itea(EAncestors); + for(; itea.More(); itea.Next()) { + if( itea.Value().ShapeType() != TopAbs_FACE ) continue; + TopoDS_Face face = TopoDS::Face(itea.Value()); + for(TopExp_Explorer expf(theShape1, TopAbs_FACE); expf.More(); expf.Next() ) { + if(face.IsSame(expf.Current())) { + NbFacesFromShape1++; + break; + } + } + } + if(NbFacesFromShape1==1) break; + } + // find association for vertices from edge E + for(TopExp_Explorer eexp(E, TopAbs_VERTEX); eexp.More(); eexp.Next()) { + TopoDS_Vertex V1 = TopoDS::Vertex( eexp.Current() ); + const TopTools_ListOfShape& Ancestors = theMesh1->GetAncestors(V1); + TopTools_ListIteratorOfListOfShape ita(Ancestors); + for(; ita.More(); ita.Next()) { + if( ita.Value().ShapeType() != TopAbs_EDGE ) continue; + TopoDS_Edge edge = TopoDS::Edge(ita.Value()); + bool FromShape1 = false; + for(TopExp_Explorer expe(theShape1, TopAbs_EDGE); expe.More(); expe.Next() ) { + if(edge.IsSame(expe.Current())) { + FromShape1 = true; + break; + } + } + if(!FromShape1) { + // it is an edge between theShape1 and theShape2 + TopExp_Explorer expv(edge, TopAbs_VERTEX); + TopoDS_Vertex V2 = TopoDS::Vertex( expv.Current() ); + if(V2.IsSame(V1)) { + expv.Next(); + V2 = TopoDS::Vertex( expv.Current() ); + } + InsertAssociation( V1, V2, theMap, bidirect); + break; + } + } + } + return FindSubShapeAssociation( theShape1, theMesh1, theShape2, theMesh2, theMap); + } + break; // try by vertex closeness + } default:; } -- 2.39.2