]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #623: Fatal error as result of splitting polyline
authorabk <abk@opencascade.com>
Fri, 10 Jul 2015 14:00:40 +0000 (17:00 +0300)
committerabk <abk@opencascade.com>
Fri, 10 Jul 2015 14:00:40 +0000 (17:00 +0300)
The reason of the error - the incorrect cutting of a topological curve by parameters - was corrected.

src/HYDROData/HYDROData_TopoCurve.cxx

index 9183b3556aa1361eccec6806b5e1b92d8ecc5b29..86c0cf82d73b9ed2270c13f4ad2894c4785e56a7 100644 (file)
@@ -567,8 +567,9 @@ void HYDROData_TopoCurve::Cut(
   std::list<TopoDS_Edge>::iterator aEIt = aCurves[0].myEdges.begin();
   std::deque<std::list<double> >::const_iterator aPLIt = theParameters.begin();
   for (std::deque<std::list<double> >::const_iterator aLastPLIt =
-    theParameters.end(); aPLIt != aLastPLIt; ++aEIt, ++aPLIt)
+    theParameters.end(); aPLIt != aLastPLIt; ++aPLIt)
   {
+    const int aSize = aCurves[aCI].myEdges.size();
     for (Iterator<std::list<double>, std::list<double>::const_iterator> aPIt(
       *aPLIt, (aEIt->Orientation() != TopAbs_REVERSED)); aPIt.More(); ++aPIt)
     {
@@ -586,6 +587,10 @@ void HYDROData_TopoCurve::Cut(
         aEIt = aCurves[aCI].myEdges.begin();
       }
     }
+    if (aCurves[aCI].myEdges.size() == aSize)
+    {
+      ++aEIt;
+    }
   }
   theCurves.push_back(aCurves[aCI]);
 }