From: isn Date: Wed, 23 Nov 2016 16:32:36 +0000 (+0300) Subject: patch for hypofilter (to avoid the exception) X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fhydro%2Fimps_2015_1;p=modules%2Fsmesh.git patch for hypofilter (to avoid the exception) Signed-off-by: asl --- diff --git a/src/SMESH/SMESH_HypoFilter.cxx b/src/SMESH/SMESH_HypoFilter.cxx index fcebe63d3..1687fcf4d 100644 --- a/src/SMESH/SMESH_HypoFilter.cxx +++ b/src/SMESH/SMESH_HypoFilter.cxx @@ -131,24 +131,26 @@ void SMESH_HypoFilter::IsMoreLocalThanPredicate::findPreferable() { const int shapeID = _mesh.GetMeshDS()->ShapeToIndex( _shape ); const TListOfListOfInt& listOfShapeIDList = _mesh.GetMeshOrder(); - TListOfListOfInt::const_iterator listsIt = listOfShapeIDList.begin(); + TListOfListOfInt::const_iterator listsIt = listOfShapeIDList.begin(); for ( ; listsIt != listOfShapeIDList.end(); ++listsIt ) { - const TListOfInt& idList = *listsIt; + const TListOfInt& idList = *listsIt; TListOfInt::const_iterator idIt = std::find( idList.begin(), idList.end(), shapeID ); if ( idIt != idList.end() && *idIt != idList.front() ) { - for ( ; idIt != idList.end(); --idIt ) + for ( --idIt; true; --idIt ) { const TopoDS_Shape& shape = _mesh.GetMeshDS()->IndexToShape( *idIt ); if ( !shape.IsNull()) _preferableShapes.Add( shape ); + + if ( idIt == idList.begin() ) + break; } } } } - //======================================================================= //function : IsMoreLocalThanPredicate::IsOk //purpose :