diff --git a/src/AppParCurves/AppParCurves_BSpGradient.cdl b/src/AppParCurves/AppParCurves_BSpGradient.cdl index 64e4dd63d0..69c8fd46bc 100644 --- a/src/AppParCurves/AppParCurves_BSpGradient.cdl +++ b/src/AppParCurves/AppParCurves_BSpGradient.cdl @@ -179,6 +179,7 @@ MError3d: Real; MError2d: Real; mylambda1: Real; mylambda2: Real; +myIsLambdaDefined: Boolean; Done: Boolean; end BSpGradient from AppParCurves; diff --git a/src/AppParCurves/AppParCurves_BSpGradient.gxx b/src/AppParCurves/AppParCurves_BSpGradient.gxx index 4105b9dc31..abed1d250f 100644 --- a/src/AppParCurves/AppParCurves_BSpGradient.gxx +++ b/src/AppParCurves/AppParCurves_BSpGradient.gxx @@ -43,9 +43,6 @@ static OSD_Chronometer chr1; -static Standard_Boolean islambdadefined = Standard_False; - - static AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, @@ -104,7 +101,10 @@ AppParCurves_BSpGradient:: const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIterations): - ParError(FirstPoint, LastPoint,0.0) + ParError(FirstPoint, LastPoint,0.0), + mylambda1(0.0), + mylambda2(0.0), + myIsLambdaDefined(Standard_False) { Perform(SSP, FirstPoint, LastPoint, TheConstraints, Parameters, Knots, Mults, Deg, Tol3d, Tol2d, NbIterations); @@ -125,11 +125,11 @@ AppParCurves_BSpGradient:: const Standard_Integer NbIterations, const Standard_Real lambda1, const Standard_Real lambda2): - ParError(FirstPoint, LastPoint,0.0) + ParError(FirstPoint, LastPoint,0.0), + mylambda1(lambda1), + mylambda2(lambda2), + myIsLambdaDefined(Standard_True) { - mylambda1 = lambda1; - mylambda2 = lambda2; - islambdadefined = Standard_True; Perform(SSP, FirstPoint, LastPoint, TheConstraints, Parameters, Knots, Mults, Deg, Tol3d, Tol2d, NbIterations); } @@ -207,7 +207,7 @@ void AppParCurves_BSpGradient:: if (FirstCons >= AppParCurves_TangencyPoint || LastCons >= AppParCurves_TangencyPoint) { - if (!islambdadefined) { + if (!myIsLambdaDefined) { AppParCurves_BSpParLeastSquare thefitt(SSP, Knots, Mults, FirstPoint, LastPoint, FirstCons, LastCons, Parameters, nbpoles);