]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
patch for hypofilter (to avoid the exception) hydro/imps_2015_1
authorisn <isn@opencascade.com>
Wed, 23 Nov 2016 16:32:36 +0000 (19:32 +0300)
committerasl <asl@opencascade.com>
Tue, 29 Nov 2016 09:19:54 +0000 (12:19 +0300)
Signed-off-by: asl <asl@opencascade.com>
src/SMESH/SMESH_HypoFilter.cxx

index fcebe63d36e8f8b73987123254e26c77504f6a09..1687fcf4d714906488910c78cedd5bc68c4c5530 100644 (file)
@@ -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  :