From: eap Date: Tue, 27 Apr 2010 09:25:36 +0000 (+0000) Subject: PAL21718: Composite Side Discretisation 1D Algorithm works incorrently with attached... X-Git-Tag: V5_1_4rc1~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=48bd54b61b3c84f7c926c5bb7859fd079135f76d;p=modules%2Fsmesh.git PAL21718: Composite Side Discretisation 1D Algorithm works incorrently with attached shape. * Avoid pb with internal edges --- diff --git a/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx b/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx index b21833666..17161d9ef 100644 --- a/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx +++ b/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx @@ -74,24 +74,16 @@ namespace { */ //================================================================================ - TopoDS_Edge nextC1Edge(const TopoDS_Edge& edge, - SMESH_Mesh & aMesh, - const bool forward) + TopoDS_Edge nextC1Edge(TopoDS_Edge edge, + SMESH_Mesh & aMesh, + const bool forward) { + if (edge.Orientation() > TopAbs_REVERSED) // INTERNAL + edge.Orientation( TopAbs_FORWARD ); TopoDS_Edge eNext; TopTools_MapOfShape edgeCounter; edgeCounter.Add( edge ); - TopoDS_Vertex v; - if (edge.Orientation() <= TopAbs_REVERSED) // FORWARD || REVERSED - v = forward ? TopExp::LastVertex(edge,true) : TopExp::FirstVertex(edge,true); - else { - TopoDS_Iterator vIt (edge); - if (forward) - for (; vIt.More(); vIt.Next()) - v = TopoDS::Vertex(vIt.Value()); // last - else if (vIt.More()) - v = TopoDS::Vertex(vIt.Value()); // first - } + TopoDS_Vertex v = forward ? TopExp::LastVertex(edge,true) : TopExp::FirstVertex(edge,true); TopTools_ListIteratorOfListOfShape ancestIt = aMesh.GetAncestors( v ); for ( ; ancestIt.More(); ancestIt.Next() ) { @@ -102,18 +94,10 @@ namespace { if ( edgeCounter.Extent() < 3 && !eNext.IsNull() ) { if ( SMESH_Algo::IsContinuous( edge, eNext )) { // care of orientation - TopoDS_Vertex vn; - if (eNext.Orientation() <= TopAbs_REVERSED) // FORWARD || REVERSED - vn = forward ? TopExp::FirstVertex(eNext,true) : TopExp::LastVertex(eNext,true); - else { - TopoDS_Iterator vIt (eNext); - if (forward) - vn = TopoDS::Vertex(vIt.Value()); // first - else if (vIt.More()) - for (; vIt.More(); vIt.Next()) - vn = TopoDS::Vertex(vIt.Value()); // last - } - + if (eNext.Orientation() > TopAbs_REVERSED) // INTERNAL + eNext.Orientation( TopAbs_FORWARD ); + TopoDS_Vertex vn = + forward ? TopExp::FirstVertex(eNext,true) : TopExp::LastVertex(eNext,true); bool reverse = (!v.IsSame(vn)); if ( reverse ) eNext.Reverse(); @@ -315,14 +299,17 @@ StdMeshers_CompositeSegment_1D::GetFaceSide(SMESH_Mesh& aMesh, const bool ignoreMeshed) { list< TopoDS_Edge > edges; - edges.push_back( anEdge ); + if ( anEdge.Orientation() <= TopAbs_REVERSED ) + edges.push_back( anEdge ); + else + edges.push_back( TopoDS::Edge( anEdge.Oriented( TopAbs_FORWARD ))); // PAL21718 list hypList; SMESH_Algo* theAlgo = aMesh.GetGen()->GetAlgo( aMesh, anEdge ); if ( theAlgo ) hypList = theAlgo->GetUsedHypothesis(aMesh, anEdge, false); for ( int forward = 0; forward < 2; ++forward ) { - TopoDS_Edge eNext = nextC1Edge( anEdge, aMesh, forward ); + TopoDS_Edge eNext = nextC1Edge( edges.back(), aMesh, forward ); while ( !eNext.IsNull() ) { if ( ignoreMeshed ) { // eNext must not have computed mesh