1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0030581: Modeling Data - Standard_OutOfRange within Geom_BSplineSurface::LocateV()

Geom2d_BSplineCurve::LocateU(),Geom_BSplineCurve::LocateU, Law_BSpline::LocateU()
Geom_BSplineSurface::LocateU() and Geom_BSplineSurface::LocateV()
have been corrected with missing range checks.
BSplCLib::Hunt() documentation has been corrected to reflect its actual implementation.
This commit is contained in:
kgv
2019-03-16 09:33:37 +03:00
committed by apn
parent 737e9a8da4
commit 437ef7713e
8 changed files with 71 additions and 60 deletions

View File

@@ -14,14 +14,6 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
// 03-02-97 : pmn ->LocateU sur Periodic (PRO6963),
// bon appel a LocateParameter (PRO6973) et mise en conformite avec
// le cdl de LocateU, lorsque U est un noeud (PRO6988)
#define No_Standard_OutOfRange
#define No_Standard_DimensionError
#include <BSplCLib.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <Geom2d_Geometry.hxx>
@@ -820,7 +812,12 @@ void Geom2d_BSplineCurve::LocateU
else {
I1 = 1;
BSplCLib::Hunt (CKnots, NewU, I1);
while ( Abs( CKnots(I1+1) - NewU) <= PParametricTolerance) I1++;
I1 = Max (Min (I1, CKnots.Upper()), CKnots.Lower());
while (I1 + 1 <= CKnots.Upper()
&& Abs (CKnots (I1 + 1) - NewU) <= PParametricTolerance)
{
I1++;
}
if ( Abs( CKnots(I1) - NewU) <= PParametricTolerance) {
I2 = I1;
}