0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / BRepAlgo / BRepAlgo_NormalProjection.cxx
index c0f167f..3ffb47a 100644 (file)
@@ -5,8 +5,8 @@
 //
 // 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 version 2.1 as published
+// 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 <BRepAlgo_NormalProjection.ixx>
-#include <ProjLib_CompProjectedCurve.hxx>
-#include <TopTools_HSequenceOfShape.hxx>
-#include <TopExp_Explorer.hxx>
-#include <TopAbs.hxx>
+
+#include <Adaptor3d_Curve.hxx>
+#include <Approx_CurveOnSurface.hxx>
+#include <BRep_Builder.hxx>
 #include <BRepAdaptor_Curve.hxx>
 #include <BRepAdaptor_HCurve.hxx>
-#include <BRepAdaptor_Surface.hxx>
 #include <BRepAdaptor_HSurface.hxx>
-#include <ProjLib_HCompProjectedCurve.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TopoDS_Shape.hxx>
-#include <Approx_CurveOnSurface.hxx>
-#include <TopoDS.hxx>
-#include <BRep_Builder.hxx>
+#include <BRepAdaptor_Surface.hxx>
+#include <BRepAlgo_BooleanOperations.hxx>
+#include <BRepAlgo_NormalProjection.hxx>
+#include <BRepAlgo_SequenceOfSequenceOfInteger.hxx>
+#include <BRepLib_MakeEdge.hxx>
 #include <BRepLib_MakeVertex.hxx>
 #include <BRepLib_MakeWire.hxx>
-#include <Geom2dAdaptor_HCurve.hxx>
+#include <BRepTools.hxx>
+#include <BRepTopAdaptor_FClass2d.hxx>
+#include <Geom2d_BSplineCurve.hxx>
 #include <Geom2d_Curve.hxx>
+#include <Geom2d_TrimmedCurve.hxx>
+#include <Geom2dAdaptor_HCurve.hxx>
 #include <Geom_BSplineCurve.hxx>
 #include <GeomAdaptor.hxx>
-#include <BRepLib_MakeEdge.hxx>
-#include <BRepAlgo_BooleanOperations.hxx>
-#include <TopOpeBRepBuild_HBuilder.hxx>
-#include <BRepTopAdaptor_FClass2d.hxx>
 #include <Precision.hxx>
-#include <BRepAlgo_SequenceOfSequenceOfInteger.hxx>
-#include <TopExp.hxx>
-#include <BRepTools.hxx>
+#include <ProjLib_CompProjectedCurve.hxx>
+#include <ProjLib_HCompProjectedCurve.hxx>
+#include <Standard_ConstructionError.hxx>
+#include <Standard_NoSuchObject.hxx>
+#include <StdFail_NotDone.hxx>
 #include <TColgp_Array1OfPnt2d.hxx>
-#include <TColStd_Array1OfReal.hxx>
 #include <TColStd_Array1OfInteger.hxx>
-#include <Geom2d_TrimmedCurve.hxx>
-#include <Geom2d_BSplineCurve.hxx>
+#include <TColStd_Array1OfReal.hxx>
+#include <TopAbs.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopOpeBRepBuild_HBuilder.hxx>
+#include <TopTools_HSequenceOfShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
 #include <OSD_Timer.hxx>
 
 OSD_Chronometer chr_total, chr_init, chr_approx, chr_booltool;
@@ -195,7 +200,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
 
  void BRepAlgo_NormalProjection::Build() 
 {
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   Standard_Integer init_count = 0, approx_count = 0, booltool_count = 0;
   t_total = 0;
   t_init = 0;
@@ -266,12 +271,12 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
       TolU = hsur->UResolution(myTol3d)/20;
       TolV = hsur->VResolution(myTol3d)/20;
       // Projection
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
       InitChron(chr_init);
 #endif
       Projector = 
        ProjLib_CompProjectedCurve(hsur, hcur, TolU, TolV, myMaxDist);
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
       ResultChron(chr_init,t_init);
       init_count++;
 #endif
@@ -290,7 +295,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
       
       for(k = 1; k <= Projector.NbCurves(); k++){
        if(Projector.IsSinglePnt(k, P2d)){
-#ifdef DEBUG
+#ifdef OCCT_DEBUG
          cout << "Projection of edge "<<i<<" on face "<<j;
          cout << " is punctual"<<endl<<endl;
 #endif
@@ -308,7 +313,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
          
          /**************************************************************/
          if (Projector.IsUIso(k, UIso)) {
-#ifdef DEBUG
+#ifdef OCCT_DEBUG
            cout << "Projection of edge "<<i<<" on face "<<j;
            cout << " is U-isoparametric"<<endl<<endl;
 #endif
@@ -325,7 +330,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
            Only3d = Standard_True;
          }
          else if (Projector.IsVIso(k, VIso)) {
-#ifdef DEBUG
+#ifdef OCCT_DEBUG
            cout << "Projection of edge "<<i<<" on face "<<j;
            cout << " is V-isoparametric"<<endl<<endl;
 #endif
@@ -359,13 +364,13 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
             BB.UpdateVertex(TopExp::LastVertex(TopoDS::Edge(prj)),myTol3d);
          }
          else {
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
            InitChron(chr_approx);
 #endif
            Approx_CurveOnSurface appr(HPCur, hsur, Udeb, Ufin, myTol3d, 
                                       myContinuity, myMaxDegree, myMaxSeg, 
                                       Only3d, Only2d);
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
            ResultChron(chr_approx,t_approx);
            approx_count++;
            
@@ -438,7 +443,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
                  }             
               }
              if (Degenerated) {
-#ifdef DEBUG
+#ifdef OCCT_DEBUG
                  cout << "Projection of edge "<<i<<" on face "<<j;
                  cout << " is degenerated "<<endl<<endl;
 #endif
@@ -471,7 +476,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
          if(myFaceBounds) {
            // Trimming edges by face bounds 
             // if the solution is degenerated, use of BoolTool is avoided
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
            InitChron(chr_booltool);
 #endif
             if(!Degenerated){
@@ -487,7 +492,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
                 LS = HB->Splits(prj, TopAbs_IN);
               Iter.Initialize(LS);
               if(Iter.More()) {
-#ifdef DEBUG
+#ifdef OCCT_DEBUG
                   cout << " BooleanOperations :"  << Iter.More()<<" solutions " << endl; 
 #endif
                  for(; Iter.More(); Iter.Next()) {
@@ -517,7 +522,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
               }
             }
             else {
-#ifdef DEB
+#ifdef OCCT_DEBUG
                  cout << " BooleanOperations : no solution " << endl;
 #endif
 
@@ -536,7 +541,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
                 myAncestorMap.Bind(prj, Edges->Value(i));   
                 myCorresp.Bind(prj, Faces->Value(j));
              }
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
               ResultChron(chr_booltool,t_booltool);
               booltool_count++;
 #endif
@@ -561,7 +566,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
   
   myIsDone = Standard_True; 
   
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_total,t_total);
   
   cout<<"Build - Total time  : "<<t_total<<" includes:" <<endl;