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

0030754: Coding - the array of weights should begin with Lower, not the constant value 1 within Geom_BSplineCurve.cxx

This commit is contained in:
kgv 2019-06-05 09:34:21 +03:00 committed by bugmaster
parent d6b200e03a
commit 6b41f0f335
2 changed files with 18 additions and 24 deletions

View File

@ -81,20 +81,17 @@ static void CheckCurveData
throw Standard_ConstructionError("BSpline curve: # Poles and degree mismatch"); throw Standard_ConstructionError("BSpline curve: # Poles and degree mismatch");
} }
//======================================================================= //! Check rationality of an array of weights
//function : Rational static Standard_Boolean Rational (const TColStd_Array1OfReal& theWeights)
//purpose : check rationality of an array of weights
//=======================================================================
static Standard_Boolean Rational(const TColStd_Array1OfReal& W)
{ {
Standard_Integer i, n = W.Length(); for (Standard_Integer i = theWeights.Lower(); i < theWeights.Upper(); i++)
Standard_Boolean rat = Standard_False; {
for (i = 1; i < n; i++) { if (Abs (theWeights[i] - theWeights[i + 1]) > gp::Resolution())
rat = Abs(W(i) - W(i+1)) > gp::Resolution(); {
if (rat) break; return Standard_True;
} }
return rat; }
return Standard_False;
} }
//======================================================================= //=======================================================================

View File

@ -79,20 +79,17 @@ static void CheckCurveData
throw Standard_ConstructionError("BSpline curve: # Poles and degree mismatch"); throw Standard_ConstructionError("BSpline curve: # Poles and degree mismatch");
} }
//======================================================================= //! Check rationality of an array of weights
//function : Rational static Standard_Boolean Rational (const TColStd_Array1OfReal& theWeights)
//purpose : check rationality of an array of weights
//=======================================================================
static Standard_Boolean Rational(const TColStd_Array1OfReal& W)
{ {
Standard_Integer i, n = W.Length(); for (Standard_Integer i = theWeights.Lower(); i < theWeights.Upper(); i++)
Standard_Boolean rat = Standard_False; {
for (i = 1; i < n; i++) { if (Abs (theWeights[i] - theWeights[i + 1]) > gp::Resolution())
rat = Abs(W(i) - W(i+1)) > gp::Resolution(); {
if (rat) break; return Standard_True;
} }
return rat; }
return Standard_False;
} }
//======================================================================= //=======================================================================