0026937: Eliminate NO_CXX_EXCEPTION macro support
[occt.git] / src / BRepBlend / BRepBlend_SurfRstLineBuilder.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 6bb9454..40adf8d
@@ -1,22 +1,44 @@
-// File:       BRepBlend_SurfRstLineBuilder.cxx
-// Created:    Fri Jan 24 10:39:44 1997
-// Author:     Jacques GOUSSARD
-// Author:     Laurent BOURESCHE
-//             <lbo@pomalox.paris1.matra-dtv.fr>
-
-#include <stdio.h>
-
-#include <BRepBlend_SurfRstLineBuilder.ixx>
+// Created on: 1997-01-24
+// Created by: Laurent BOURESCHE
+// Copyright (c) 1997-1999 Matra Datavision
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+
+#include <Adaptor2d_HCurve2d.hxx>
+#include <Adaptor3d_HSurface.hxx>
+#include <Adaptor3d_HVertex.hxx>
+#include <Adaptor3d_TopolTool.hxx>
+#include <Blend_FuncInv.hxx>
+#include <Blend_Point.hxx>
+#include <Blend_SurfCurvFuncInv.hxx>
+#include <Blend_SurfPointFuncInv.hxx>
+#include <Blend_SurfRstFunction.hxx>
 #include <BRepBlend_BlendTool.hxx>
-#include <TopAbs.hxx>
-#include <IntSurf.hxx>
-#include <math_FunctionSetRoot.hxx>
-#include <gp_Pnt2d.hxx>
+#include <BRepBlend_Extremity.hxx>
+#include <BRepBlend_Line.hxx>
+#include <BRepBlend_SurfRstLineBuilder.hxx>
 #include <gp_Pnt.hxx>
-#include <gp_Vec2d.hxx>
+#include <gp_Pnt2d.hxx>
 #include <gp_Vec.hxx>
+#include <gp_Vec2d.hxx>
+#include <IntSurf.hxx>
+#include <IntSurf_Transition.hxx>
+#include <math_FunctionSetRoot.hxx>
+#include <TopAbs.hxx>
 
-#ifdef DEB
+#include <stdio.h>
+#ifdef OCCT_DEBUG
 #include <TColStd_Array1OfInteger.hxx>
 #include <TColStd_Array1OfReal.hxx>
 #include <TColgp_Array1OfPnt2d.hxx>
@@ -29,7 +51,8 @@
 #endif
 static Standard_Integer IndexOfSection = 0;
 extern Standard_Boolean Blend_GettraceDRAWSECT(); 
-// Pour debug : visualisation de la section
+#ifdef OCCT_DEBUG_BBPP_N_TRDERIV
+// for debug : visualisation of the section
 static Standard_Boolean BBPP(const Standard_Real param,
                             Blend_SurfRstFunction& Func,
                             const math_Vector& sol,
@@ -74,30 +97,30 @@ static void tracederiv(Blend_SurfRstFunction& Func,
   Standard_Real scal = 1./(param1-param2);
 
   cout<<endl;
-  cout<<"controle des derivees au point : "<<param1<<endl;
+  cout<<"control derivatives at point : "<<param1<<endl;
 
   for(i = 1; i <= hp; i++){
     cout<<endl;
     cout<<"point : "<<i<<endl;
-    cout<<"dx calcule : "<<TDP1(i).X()<<endl;
-    cout<<"dx estime  : "<<scal*(TP1(i).X()-TP2(i).X())<<endl;
-    cout<<"dy calcule : "<<TDP1(i).Y()<<endl;
-    cout<<"dy estime  : "<<scal*(TP1(i).Y()-TP2(i).Y())<<endl;
-    cout<<"dz calcule : "<<TDP1(i).Z()<<endl;
-    cout<<"dz estime  : "<<scal*(TP1(i).Z()-TP2(i).Z())<<endl;
-    cout<<"dw calcule : "<<TDW1(i)<<endl;
-    cout<<"dw estime  : "<<scal*(TW1(i)-TW2(i))<<endl;
+    cout<<"dx calculated : "<<TDP1(i).X()<<endl;
+    cout<<"dx estimated  : "<<scal*(TP1(i).X()-TP2(i).X())<<endl;
+    cout<<"dy calculated : "<<TDP1(i).Y()<<endl;
+    cout<<"dy estimated  : "<<scal*(TP1(i).Y()-TP2(i).Y())<<endl;
+    cout<<"dz calculated : "<<TDP1(i).Z()<<endl;
+    cout<<"dz estimated  : "<<scal*(TP1(i).Z()-TP2(i).Z())<<endl;
+    cout<<"dw calculated : "<<TDW1(i)<<endl;
+    cout<<"dw estimated  : "<<scal*(TW1(i)-TW2(i))<<endl;
   }
   for(i = 1; i <= hp2d; i++){
     cout<<endl;
     cout<<"point 2d : "<<i<<endl;
-    cout<<"dx calcule : "<<TDP2d1(i).X()<<endl;
-    cout<<"dx estime  : "<<scal*(TP2d1(i).X()-TP2d2(i).X())<<endl;
-    cout<<"dy calcule : "<<TDP2d1(i).Y()<<endl;
-    cout<<"dy estime  : "<<scal*(TP2d1(i).Y()-TP2d2(i).Y())<<endl;
+    cout<<"dx calculated : "<<TDP2d1(i).X()<<endl;
+    cout<<"dx estimated  : "<<scal*(TP2d1(i).X()-TP2d2(i).X())<<endl;
+    cout<<"dy calculated : "<<TDP2d1(i).Y()<<endl;
+    cout<<"dy estimated  : "<<scal*(TP2d1(i).Y()-TP2d2(i).Y())<<endl;
   }
 }
-
+#endif
 static void Drawsect(const Standard_Real param,
                     Blend_SurfRstFunction& Func)
 {
@@ -133,12 +156,12 @@ static void Drawsect(const Standard_Real param,
 
 //=======================================================================
 //function :  ArcToRecadre
-//purpose  : Cherche un arc candidat
-//           PrevIndex est utilise pour rejeter un arc deja teste
+//purpose  : Find a suitable arc
+//           PrevIndex is used to reject an already tested arc
 //=======================================================================
 
 Standard_Integer BRepBlend_SurfRstLineBuilder::
-   ArcToRecadre(const math_Vector& sol,
+   ArcToRecadre(const math_Vector& theSol,
                const Standard_Integer PrevIndex, 
                gp_Pnt2d& lastpt2d,
                gp_Pnt2d& pt2d,
@@ -148,10 +171,10 @@ Standard_Integer BRepBlend_SurfRstLineBuilder::
   Standard_Boolean ok = Standard_False;
   Standard_Boolean byinter = (line->NbPoints() != 0), okinter = 0;
   Standard_Real distmin = RealLast();
-  Standard_Real uprev,vprev, prm, dist;
+  Standard_Real uprev = 0.,vprev = 0., prm =  0., dist = 0.;
 
   if(byinter) previousP.ParametersOnS(uprev,vprev);
-  pt2d.SetCoord(sol(1),sol(2));
+  pt2d.SetCoord(theSol(1),theSol(2));
   lastpt2d.SetCoord(uprev,vprev);
   domain1->Init();
 
@@ -260,12 +283,12 @@ void BRepBlend_SurfRstLineBuilder::Perform(Blend_SurfRstFunction&  Func,
   if (State!=Blend_OK) {
     return;
   }
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (Blend_GettraceDRAWSECT()){
     Drawsect(param,Func);
   }
 #endif
-  // Mettre a jour la ligne.
+  // Update the line.
   line->Append(previousP);
   Standard_Real U,V;
   previousP.ParametersOnS(U,V);
@@ -325,16 +348,11 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::PerformFirstSection
   else {
     sens = -1.;
   }
-#ifndef DEB
   Blend_Status State = Blend_OnRst12;
   Standard_Real trst = 0.;
-#else
-  Blend_Status State;
-  Standard_Real trst;
-#endif  
   Standard_Boolean recadp,recadrst,recads;
   Standard_Real wp,wrst,ws;
-  Standard_Real U,V;
+  Standard_Real U = 0.,V = 0.;
   math_Vector infbound(1,3),supbound(1,3),tolerance(1,3);
   math_Vector solinvp(1,3),solinvrst(1,4),solinvs(1,3);
   Handle(Adaptor3d_HVertex) Vtxp,Vtxrst,Vtxs,Vtxc;
@@ -365,7 +383,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::PerformFirstSection
   }
   if (!recads && !recadp && !recadrst) return Standard_False;
   if (recadp && recadrst) {
-    if(sens*(wrst-wp) > tolgui){ //on sort du domaine d abord
+    if(sens*(wrst-wp) > tolgui){ //first one leaves the domain
       wrst = wp;
       U = solinvp(2);
       V = solinvp(3);
@@ -402,7 +420,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::PerformFirstSection
       sol(3) = solinvs(2);
     }
     else if(sens*(ws-wrst)<0){
-      // sol sur surf
+      // ground on surf
       State = Blend_OnRst1;
       param = ws;
       Arc->Value(solinvs(3)).Coord(U,V);
@@ -411,7 +429,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::PerformFirstSection
       sol(3) = solinvs(2);
     }
     else{
-      // sol sur rst
+      // ground on rst
       State = Blend_OnRst2;
       param = wrst;
       sol(1) = U;
@@ -421,7 +439,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::PerformFirstSection
     Func.Set(param);
   }
   else if(recads){
-    // sol sur surf
+    // ground on surf
     State = Blend_OnRst1;
     param = ws;
     Arc->Value(solinvs(3)).Coord(U,V);
@@ -431,7 +449,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::PerformFirstSection
     Func.Set(param);
   }
   else if(recadrst){
-    // sol sur rst
+    // ground on rst
     State = Blend_OnRst2;
     param = wrst;
     sol(1) = U;
@@ -456,7 +474,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Complete(Blend_SurfRstFunction&
                                                        Blend_SurfCurvFuncInv&  FinvC,
                                                        const Standard_Real     Pmin) 
 {
-  if (!done) {StdFail_NotDone::Raise();}
+  if (!done) {throw StdFail_NotDone();}
   if (iscomplete) {return Standard_True;}
   if (sens >0.) {
     previousP = line->Point(1);
@@ -487,7 +505,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
 {
   Standard_Real stepw = pasmax;
   Standard_Integer nbp = line->NbPoints();
-  if(nbp >= 2){ //On reprend le dernier step s il n est pas trop petit.
+  if(nbp >= 2){ //The last step is reproduced if it is not too small.
     if(sens < 0.){
       stepw = (line->Point(2).Parameter() - line->Point(1).Parameter());
     }
@@ -500,21 +518,13 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
   if (sens*(parprec - Bound) >= -tolgui) {
     return;
   }
-#ifndef DEB
   Blend_Status State = Blend_OnRst12;
-#else
-  Blend_Status State;
-#endif
-  TopAbs_State situonc,situons;
-  Standard_Boolean decroch;
+  TopAbs_State situonc = TopAbs_UNKNOWN, situons = TopAbs_UNKNOWN;
+  Standard_Boolean decroch = Standard_False;
   Standard_Boolean Arrive,recadp,recadrst,recads,echecrecad;
   Standard_Real wp,wrst,ws;
-  Standard_Real U,V;
-#ifndef DEB
-  Standard_Real  trst = 0.;
-#else
-  Standard_Real  trst;
-#endif
+  Standard_Real U = 0.,V = 0.;
+  Standard_Real trst = 0.;
   math_Vector infbound(1,3),supbound(1,3);
   math_Vector parinit(1,3),tolerance(1,3);
   math_Vector solinvp(1,3),solinvrst(1,4),solinvs(1,3);
@@ -540,7 +550,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
 
   while (!Arrive) {
     Standard_Boolean bonpoint = 1;
-#if 0
+#ifdef OCCT_DEBUG_BBPP_N_TRDERIV
     //debdebdebdebdebdeb
     Func.Set(param);
     rsnld.Perform(Func,parinit,infbound,supbound);
@@ -585,7 +595,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
        recads = Recadre(FinvC,solinvs,Arc,IsVtxs,Vtxs);
        if (recads) {
          ws = solinvs(1);
-         // Il faut reevaluer le decrochage (BUC60360)
+         // It is necessary to reevaluate the deviation (BUC60360)
          gp_Vec t, n;
          Func.Set(ws);
          Arc->Value(solinvs(3)).Coord(U,V);
@@ -622,7 +632,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
       if(recadp || recads || recadrst) echecrecad = Standard_False; 
       if (!echecrecad) {
        if (recadp && recadrst) {
-         if(sens*(wrst-wp) > tolgui){ //on sort du domaine d abord
+         if(sens*(wrst-wp) > tolgui){ //first one leaves the domain
            wrst = wp;
            U = solinvp(2);
            V = solinvp(3);
@@ -661,7 +671,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
            sol(3) = solinvs(3);
          }
          else if(sens*(ws-wrst)<0){
-           // sol sur surf
+           // ground on surf
            decroch = 0;
            State = Blend_OnRst1;
            param = ws;
@@ -671,7 +681,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
            sol(3) = solinvs(2);
          }
          else{
-           // sol sur rst
+           // ground on rst
            State = Blend_OnRst2;
            param = wrst;
            sol(1) = U;
@@ -681,7 +691,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
          Func.Set(param);
        }
        else if(recads){
-         // sol sur surf
+         // ground on surf
          State = Blend_OnRst1;
          param = ws;
          Arc->Value(solinvs(3)).Coord(U,V);
@@ -691,7 +701,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
          Func.Set(param);
        }
        else if(recadrst){
-         // sol sur rst
+         // ground on rst
          State = Blend_OnRst2;
          param = wrst;
          sol(1) = U;
@@ -705,9 +715,9 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
        State = TestArret(Func,Standard_True,State);
       }
       else{
-       // echec recadrage. On sort avec PointsConfondus
-#if DEB
-       cout<<"SurfRstLineBuilder : echec recadrage"<<endl;
+       // Failed reframing. Leave with PointsConfondus
+#ifdef OCCT_DEBUG
+       cout<<"SurfRstLineBuilder : failed reframing"<<endl;
 #endif
        State = Blend_SamePoints;
       }
@@ -716,12 +726,12 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
     switch (State) {
     case Blend_OK :
       {
-#ifdef DEB
+#ifdef OCCT_DEBUG
        if (Blend_GettraceDRAWSECT()){
          Drawsect(param,Func);
        }
 #endif
-       // Mettre a jour la ligne.
+       // Update the line.
        if (sens>0.) {
          line->Append(previousP);
        }
@@ -737,7 +747,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
                        sol(1),sol(2),
                        previousP.Parameter(),tolesp);
          MakeExtremity(Extrst,Standard_False,rst,sol(3),IsVtxrst,Vtxrst);
-         // Indiquer que fin sur Bound.
+         // Indicate end on Bound.
        }
        else {
          param = param + sens*stepw;
@@ -760,26 +770,26 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
                          previousP.Parameter(),tolesp);
          Arrive = Standard_True;
          if (line->NbPoints()>=2) {
-           // Indiquer qu on s arrete en cours de cheminement
-#if DEB
-           cout<<"SurfRstLineBuilder :On n avance plus dans le cheminement"<<endl;
+           // Indicate that one stops during the processing
+#ifdef OCCT_DEBUG
+           cout<<"SurfRstLineBuilder : No advancement in the processing"<<endl;
 #endif
          }
        }
        else {
-         param = parprec + sens*stepw;  // on ne risque pas de depasser Bound.
+         param = parprec + sens*stepw;  // no risk to exceed Bound.
        }
       }
       break;
       
     case Blend_StepTooSmall :
       {
-#ifdef DEB
+#ifdef OCCT_DEBUG
        if (Blend_GettraceDRAWSECT()){
          Drawsect(param,Func);
        }
 #endif
-       // Mettre a jour la ligne.
+       // Update the line.
        if (sens>0.) {
          line->Append(previousP);
        }
@@ -795,7 +805,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
          Exts.SetValue(previousP.PointOnS(),sol(1),sol(2),
                        previousP.Parameter(),tolesp);
          MakeExtremity(Extrst,Standard_False,rst,sol(3),IsVtxrst,Vtxrst);
-         // Indiquer que fin sur Bound.
+         // Indicate end on Bound.
        }
        else {
          param = param + sens*stepw;
@@ -808,7 +818,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
       
     case Blend_OnRst1  :
       {
-#ifdef DEB
+#ifdef OCCT_DEBUG
        if (Blend_GettraceDRAWSECT()){
          Drawsect(param,Func);
        }
@@ -827,7 +837,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
       
     case Blend_OnRst2  :
       {
-#ifdef DEB
+#ifdef OCCT_DEBUG
        if (Blend_GettraceDRAWSECT()){
          Drawsect(param,Func);
        }
@@ -847,7 +857,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
       
     case Blend_OnRst12  :
       {
-#ifdef DEB
+#ifdef OCCT_DEBUG
        if (Blend_GettraceDRAWSECT()){
          Drawsect(param,Func);
        }
@@ -866,9 +876,9 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
       
     case Blend_SamePoints :
       {
-       // On arrete
-#if DEB
-       cout << "SurfRstLineBuilder Points confondus dans le cheminement" << endl;
+       // Stop
+#ifdef OCCT_DEBUG
+       cout << "SurfRstLineBuilder Points mixed in the processing" << endl;
 #endif
        previousP.ParametersOnS(U,V);
        Exts.SetValue(previousP.PointOnS(),U,V,
@@ -879,10 +889,8 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
        Arrive = Standard_True;
       }
       break;
-#ifndef DEB
     default:
       break;
-#endif
     }
     if (Arrive) {
       if (sens > 0.) {
@@ -899,7 +907,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction&  Func,
 
 //=======================================================================
 //function : Recadre
-//purpose  : Recadre une section Surface / Restriction
+//purpose  : Reframe section Surface / Restriction
 //=======================================================================
 
 Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfCurvFuncInv&    FinvC,
@@ -909,9 +917,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfCurvFuncInv&
                                                       Handle(Adaptor3d_HVertex)&  Vtx) 
 {
   Standard_Boolean recadre = Standard_False;
-#ifdef DEB
-  Standard_Boolean byinter = (line->NbPoints() != 0);
-#endif
+
   gp_Pnt2d pt2d, lastpt2d;
   Standard_Integer IndexSol, nbarc;
   Standard_Real pmin;
@@ -944,24 +950,24 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfCurvFuncInv&
   rsnld.Perform(FinvC,Solinv,infb,supb);
 
   if (!rsnld.IsDone()) {
-#if DEB
+#ifdef OCCT_DEBUG
     cout << "SurfRstLineBuilder : RSNLD not done "<< endl << endl;
 #endif
   }
   else {
-      // On doit verifier la valeur de la fonction
+      // It is necessary to check the value of the function
     rsnld.Root(Solinv);
     recadre = FinvC.IsSolution(Solinv,tolesp);
   }
 
-  // En cas d'echecs, on regarde si un autre arc 
-  // peut faire l'affaire (cas des sorties a proximite d'un vertex)
+  // In case of fail, it is checked if another arc 
+  // can be useful (case of output at the proximity of a vertex)
   if (!recadre) {
 
     IndexSol =  ArcToRecadre(sol, IndexSol, 
                             lastpt2d, pt2d, pmin);
     if (IndexSol == 0) {
-      return Standard_False; // Pas d'autre solution
+      return Standard_False; // No other solution
     }
 
     domain1->Init();
@@ -979,17 +985,17 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfCurvFuncInv&
 
     Solinv(3) = pmin;
   
-    math_FunctionSetRoot rsnld(FinvC,toler,30);
-    rsnld.Perform(FinvC,Solinv,infb,supb);
+    math_FunctionSetRoot aRsnld(FinvC,toler,30);
+    aRsnld.Perform(FinvC,Solinv,infb,supb);
 
-    if (!rsnld.IsDone()) {
-#if DEB
+    if (!aRsnld.IsDone()) {
+#ifdef OCCT_DEBUG
       cout << "SurfRstLineBuilder : RSNLD not done "<< endl << endl;
 #endif
     }
     else {
-      // On doit verifier la valeur de la fonction
-      rsnld.Root(Solinv);
+      // It is necessary to check the value of the function
+      aRsnld.Root(Solinv);
       recadre = FinvC.IsSolution(Solinv,tolesp);
     }
   }  
@@ -1044,7 +1050,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfRstFunction&
   math_FunctionSetRoot rsnld(Finv,toler,30);
   rsnld.Perform(Finv,Solinv,infb,supb);
   if (!rsnld.IsDone()) {
-#if DEB
+#ifdef OCCT_DEBUG
     cout << "SurfRstLineBuilder :RSNLD not done "<< endl;
 #endif
     return Standard_False;
@@ -1074,8 +1080,8 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfRstFunction&
     if (!domain2->MoreVertex()) {
       IsVtx = Standard_False;
     }
-    // On recalcule la section par resolution directe, sinon, on se recuper
-    // des incoherences entre le parametre et sol dues au baillement.
+    // The section is recalculated by direct resolution, otherwis
+    // incoherences between the parameter and the ground caused by yawn are returned.
 
     math_Vector infbound(1,3),supbound(1,3);
     math_Vector parinit(1,3),tolerance(1,3);
@@ -1128,7 +1134,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfPointFuncInv&
   math_FunctionSetRoot rsnld(FinvP,toler,30);
   rsnld.Perform(FinvP,Solinv,infb,supb);
   if (!rsnld.IsDone()) {
-#if DEB
+#ifdef OCCT_DEBUG
     cout << "SurfRstLineBuilder :RSNLD not done "<< endl;
 #endif
     return Standard_False;
@@ -1252,11 +1258,7 @@ void BRepBlend_SurfRstLineBuilder::MakeExtremity(BRepBlend_Extremity&
   else {
     Extrem.SetVertex(Vtx);
     while (Iter->More()) {
-//#ifndef DEB
       Handle(Adaptor2d_HCurve2d) arc = Iter->Value();
-//#else
-//      Handle(Adaptor2d_HCurve2d)& arc = Iter->Value();
-//#endif
       if (arc != Arc) {
        Iter->Initialize(arc);
        Iter->InitVertexIterator();
@@ -1285,9 +1287,9 @@ void BRepBlend_SurfRstLineBuilder::MakeExtremity(BRepBlend_Extremity&
 
 Blend_Status BRepBlend_SurfRstLineBuilder::CheckDeflectionOnSurf(const Blend_Point& CurPoint)
 {
-  //Controles 3d du Blend_CSWalking.
+  //Controls 3d of Blend_CSWalking.
 
-  // regle par tests dans U4 correspond a 11.478 d
+  //rule by tests in U4 corresponds to 11.478 d
   const Standard_Real CosRef3D = 0.98;
   Standard_Real Cosi=0, Cosi2=0;
   Standard_Boolean curpointistangent = CurPoint.IsTangencyPoint();
@@ -1303,18 +1305,14 @@ Blend_Status BRepBlend_SurfRstLineBuilder::CheckDeflectionOnSurf(const Blend_Poi
   if(!prevpointistangent){
     prevTg = previousP.TangentOnS();
   }
-#ifndef DEB
   Standard_Real Norme,prevNorme = 0.;
-#else
-  Standard_Real Norme,prevNorme;
-#endif
   gp_Vec Corde(prevP,Psurf);
   Norme = Corde.SquareMagnitude();
 //  if(!curpointistangent) curNorme = Tgsurf.SquareMagnitude();
   if(!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
 
   if (Norme <= tolesp*tolesp){
-    // il faudra peut etre  forcer meme point
+    // it can be necessary to force same point
     return Blend_SamePoints;
   }
   if(!prevpointistangent){
@@ -1322,7 +1320,7 @@ Blend_Status BRepBlend_SurfRstLineBuilder::CheckDeflectionOnSurf(const Blend_Poi
       return Blend_SamePoints;
     }
     Cosi = sens*Corde*prevTg;
-    if (Cosi <0.) { // angle 3d>pi/2. --> retour arriere
+    if (Cosi <0.) { // angle 3d>pi/2. --> return back
       return Blend_Backward;
     }
     
@@ -1333,7 +1331,7 @@ Blend_Status BRepBlend_SurfRstLineBuilder::CheckDeflectionOnSurf(const Blend_Poi
   }
   
   if(!curpointistangent){
-    // Voir s il faut faire le controle sur le signe de prevtg*Tgsurf
+    // Check if it is necessary to control the sign of prevtg*Tgsurf
     Cosi = sens*Corde*Tgsurf;
     Cosi2 = Cosi * Cosi / Tgsurf.SquareMagnitude() / Norme;
     if (Cosi2 < CosRef3D || Cosi < 0.) { 
@@ -1342,7 +1340,7 @@ Blend_Status BRepBlend_SurfRstLineBuilder::CheckDeflectionOnSurf(const Blend_Poi
   }  
 
   if(!curpointistangent && !prevpointistangent){
-    // Estimation de la fleche courante
+    // Estimation of the current arrow
     Standard_Real FlecheCourante = 
       (prevTg.Normalized().XYZ()-Tgsurf.Normalized().XYZ()).SquareModulus()*Norme/64.;
     
@@ -1350,7 +1348,7 @@ Blend_Status BRepBlend_SurfRstLineBuilder::CheckDeflectionOnSurf(const Blend_Poi
       return Blend_StepTooSmall;
     }
     if (FlecheCourante > fleche*fleche) {
-      // pas trop grand : commentaire interessant
+      // not too great : 
       return Blend_StepTooLarge;
     }
   }
@@ -1365,9 +1363,9 @@ Blend_Status BRepBlend_SurfRstLineBuilder::CheckDeflectionOnSurf(const Blend_Poi
 
 Blend_Status BRepBlend_SurfRstLineBuilder::CheckDeflectionOnRst(const Blend_Point& CurPoint)
 {
-  //Controles 3d du Blend_CSWalking.
+  //Controls 3D of Blend_CSWalking.
 
-  // regle par tests dans U4 correspond a 11.478 d
+  // rule by tests in U4 corresponds to 11.478 d
   const Standard_Real CosRef3D = 0.98;
   Standard_Real Cosi, Cosi2;
   Standard_Boolean curpointistangent = CurPoint.IsTangencyPoint();
@@ -1383,18 +1381,14 @@ Blend_Status BRepBlend_SurfRstLineBuilder::CheckDeflectionOnRst(const Blend_Poin
   if(!prevpointistangent){
     prevTg = previousP.TangentOnC();
   }
-#ifndef DEB
   Standard_Real Norme,prevNorme = 0.;
-#else
-  Standard_Real Norme,prevNorme;
-#endif
   gp_Vec Corde(prevP,Psurf);
   Norme = Corde.SquareMagnitude();
 //  if(!curpointistangent) curNorme = Tgsurf.SquareMagnitude();
   if(!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
 
   if (Norme <= tolesp*tolesp){
-    // il faudra peut etre  forcer meme point
+    // it can be necessary to force same point
     return Blend_SamePoints;
   }
   if(!prevpointistangent){
@@ -1402,7 +1396,7 @@ Blend_Status BRepBlend_SurfRstLineBuilder::CheckDeflectionOnRst(const Blend_Poin
       return Blend_SamePoints;
     }
     Cosi = sens*Corde*prevTg;
-    if (Cosi <0.) { // angle 3d>pi/2. --> retour arriere
+    if (Cosi <0.) { // angle 3d>pi/2. --> return back
       return Blend_Backward;
     }
     
@@ -1413,7 +1407,7 @@ Blend_Status BRepBlend_SurfRstLineBuilder::CheckDeflectionOnRst(const Blend_Poin
   }
   
   if(!curpointistangent){
-    // Voir s il faut faire le controle sur le signe de prevtg*Tgsurf
+    // Check if it is necessary to control the sign of prevtg*Tgsurf
     Cosi = sens*Corde*Tgsurf;
     Cosi2 = Cosi * Cosi / Tgsurf.SquareMagnitude() / Norme;
     if (Cosi2 < CosRef3D || Cosi < 0.) { 
@@ -1422,7 +1416,7 @@ Blend_Status BRepBlend_SurfRstLineBuilder::CheckDeflectionOnRst(const Blend_Poin
   }  
 
   if(!curpointistangent && !prevpointistangent){
-    // Estimation de la fleche courante
+    // Estimation of the current arrow
     Standard_Real FlecheCourante = 
       (prevTg.Normalized().XYZ()-Tgsurf.Normalized().XYZ()).SquareModulus()*Norme/64.;
     
@@ -1430,7 +1424,7 @@ Blend_Status BRepBlend_SurfRstLineBuilder::CheckDeflectionOnRst(const Blend_Poin
       return Blend_StepTooSmall;
     }
     if (FlecheCourante > fleche*fleche) {
-      // pas trop grand : commentaire interessant
+      // not too great
       return Blend_StepTooLarge;
     }
   }
@@ -1457,11 +1451,7 @@ Blend_Status BRepBlend_SurfRstLineBuilder::TestArret(Blend_SurfRstFunction& Func
   gp_Vec tgs,tgrst;
   gp_Vec2d tg2ds,tg2drst;
   Blend_Status StateS,StateRst;
-#ifndef DEB
   IntSurf_TypeTrans tras = IntSurf_Undecided, trarst = IntSurf_Undecided;
-#else
-  IntSurf_TypeTrans tras,trarst;
-#endif
   Blend_Point curpoint;
 
   if (Func.IsSolution(sol,tolesp)) {
@@ -1568,7 +1558,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::CheckInside(Blend_SurfRstFunction
 {
   math_Vector tolerance(1,3);
   Func.GetTolerance(tolerance,tolesp);
-  //cote pcurve.
+  //face pcurve.
   Standard_Real w = sol(3);
   if(w < rst->FirstParameter() - tolerance(3)||
      w > rst->LastParameter() + tolerance(3)){
@@ -1580,11 +1570,11 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::CheckInside(Blend_SurfRstFunction
   }
   else SituOnC = TopAbs_ON;
 
-  //cote surface
+  //face surface
   gp_Pnt2d p2d(sol(1),sol(2));
   SituOnS = domain1->Classify(p2d,Min(tolerance(1),tolerance(2)),0);
 
-  //decrochage
+  //lost contact
   gp_Vec tgs,nors;
   Decroch = Func.Decroch(sol,tgs,nors);