From: jfa Date: Wed, 21 Apr 2010 12:46:40 +0000 (+0000) Subject: Mantis issue 0020422: EDF 1070 GEOM: Partition anomaly - REGRESSION from 4.1.x. X-Git-Tag: V5_1_4rc1~36 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7bf524013921b8b5bd58de72719a7d661e14bced;p=modules%2Fsmesh.git Mantis issue 0020422: EDF 1070 GEOM: Partition anomaly - REGRESSION from 4.1.x. --- diff --git a/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx b/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx index eee3ef012..a3a78e6ec 100644 --- a/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx +++ b/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx @@ -81,7 +81,16 @@ namespace { TopTools_MapOfShape edgeCounter; edgeCounter.Add( edge ); TopoDS_Vertex v; - v = forward ? TopExp::LastVertex( edge,1 ) : TopExp::FirstVertex( edge,1 ); + 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 + } TopTools_ListIteratorOfListOfShape ancestIt = aMesh.GetAncestors( v ); for ( ; ancestIt.More(); ancestIt.Next() ) { @@ -92,11 +101,19 @@ namespace { if ( edgeCounter.Extent() < 3 && !eNext.IsNull() ) { if ( SMESH_Algo::IsContinuous( edge, eNext )) { // care of orientation - bool reverse; - if ( forward ) - reverse = ( !v.IsSame( TopExp::FirstVertex( eNext, true ))); - else - reverse = ( !v.IsSame( TopExp::LastVertex( eNext, true ))); + 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 + } + + bool reverse = (!v.IsSame(vn)); if ( reverse ) eNext.Reverse(); return eNext;