From 1ade2bddc152869aa6e2095e184bd74436d8678a Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 3 Apr 2013 12:37:35 +0000 Subject: [PATCH] 0021556: EDF 2222 SMESH: 3D mesh after projection impossible Fix association of FACEs by propagation in case if many propagation ways are available. --- src/StdMeshers/StdMeshers_ProjectionUtils.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx index 08136aa73..25bc38a4a 100644 --- a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx +++ b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx @@ -1000,7 +1000,8 @@ bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& the // get outer edge of theShape1 TopoDS_Shape wire = OuterShape( face1, TopAbs_WIRE ); //edge1 = TopoDS::Edge( OuterShape( face1, TopAbs_EDGE )); - map propag_edges; // use map to find the closest propagation edge + // use map to find the closest propagation edge + map > propag_edges; for ( TopoDS_Iterator edgeIt( wire ); edgeIt.More(); edgeIt.Next() ) { edge1 = TopoDS::Edge( edgeIt.Value() ); @@ -1009,7 +1010,8 @@ bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& the edge2 = TopoDS::Edge( exp.Current() ); pair step_edge = GetPropagationEdge( theMesh1, edge2, edge1 ); if ( !step_edge.second.IsNull() ) { // propagation found - propag_edges.insert( step_edge ); + propag_edges.insert( make_pair( step_edge.first, + ( make_pair( edge1, step_edge.second )))); if ( step_edge.first == 1 ) break; // most close found } } @@ -1017,7 +1019,8 @@ bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& the } if ( !propag_edges.empty() ) // propagation found { - edge2 = propag_edges.begin()->second; + edge1 = propag_edges.begin()->second.first; + edge2 = propag_edges.begin()->second.second; TopoDS_Vertex VV1[2], VV2[2]; TopExp::Vertices( edge1, VV1[0], VV1[1], true ); TopExp::Vertices( edge2, VV2[0], VV2[1], true ); -- 2.39.2