0025711: Get rid of static variable islambdadefined in AppParCurves_BSpGradient.gxx
authorazv <azv@opencascade.com>
Fri, 16 Jan 2015 07:32:51 +0000 (10:32 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 29 Jan 2015 09:54:42 +0000 (12:54 +0300)
src/AppParCurves/AppParCurves_BSpGradient.cdl
src/AppParCurves/AppParCurves_BSpGradient.gxx

index 64e4dd6..69c8fd4 100644 (file)
@@ -179,6 +179,7 @@ MError3d:     Real;
 MError2d:     Real;
 mylambda1:    Real;
 mylambda2:    Real;
+myIsLambdaDefined: Boolean;
 Done:         Boolean;
 
 end BSpGradient from AppParCurves;
index 4105b9d..abed1d2 100644 (file)
@@ -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);