From 6c8252b448b68adc879ae1499999f9163cacd2a5 Mon Sep 17 00:00:00 2001 From: isn Date: Wed, 23 Nov 2016 19:32:36 +0300 Subject: [PATCH] patch for hypofilter (to avoid the exception) Signed-off-by: asl --- src/SMESH/SMESH_HypoFilter.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 : -- 2.39.2