mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +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:
@@ -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 <Geom_BSplineCurve.hxx>
|
||||
#include <Geom_Geometry.hxx>
|
||||
@@ -809,7 +801,12 @@ void Geom_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;
|
||||
}
|
||||
|
@@ -23,10 +23,6 @@
|
||||
// + bon appel a LocateParameter (PRO6973).
|
||||
// RBD : 15/10/98 ; Le cache est desormais defini sur [-1,1] (pro15537).
|
||||
|
||||
#define No_Standard_OutOfRange
|
||||
#define No_Standard_DimensionError
|
||||
|
||||
|
||||
#include <BSplCLib.hxx>
|
||||
#include <BSplSLib.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
@@ -1360,7 +1356,12 @@ void Geom_BSplineSurface::LocateU
|
||||
else {
|
||||
I1 = 1;
|
||||
BSplCLib::Hunt (Knots, NewU, I1);
|
||||
while ( Abs( Knots(I1+1) - NewU) <= PParametricTolerance) I1++;
|
||||
I1 = Max (Min (I1, Knots.Upper()), Knots.Lower());
|
||||
while (I1 + 1 <= Knots.Upper()
|
||||
&& Abs (Knots (I1 + 1) - NewU) <= PParametricTolerance)
|
||||
{
|
||||
I1++;
|
||||
}
|
||||
if ( Abs( Knots(I1) - NewU) <= PParametricTolerance) {
|
||||
I2 = I1;
|
||||
}
|
||||
@@ -1408,7 +1409,12 @@ void Geom_BSplineSurface::LocateV
|
||||
else {
|
||||
I1 = 1;
|
||||
BSplCLib::Hunt (Knots, NewV, I1);
|
||||
while ( Abs( Knots(I1+1) - NewV) <= PParametricTolerance) I1++;
|
||||
I1 = Max (Min (I1, Knots.Upper()), Knots.Lower());
|
||||
while (I1 + 1 <= Knots.Upper()
|
||||
&& Abs (Knots (I1 + 1) - NewV) <= PParametricTolerance)
|
||||
{
|
||||
I1++;
|
||||
}
|
||||
if ( Abs( Knots(I1) - NewV) <= PParametricTolerance) {
|
||||
I2 = I1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user