0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / Approx / Approx_CurvilinearParameter.cxx
old mode 100755 (executable)
new mode 100644 (file)
index fb11906..be46c18
@@ -1,51 +1,51 @@
 // Created on: 1997-08-22
 // Created by: Sergey SOKOLOV
 // Copyright (c) 1997-1999 Matra Datavision
-// Copyright (c) 1999-2012 OPEN CASCADE SAS
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
 //
-// The content of this file is subject to the Open CASCADE Technology Public
-// License Version 6.5 (the "License"). You may not use the content of this file
-// except in compliance with the License. Please obtain a copy of the License
-// at http://www.opencascade.org and read it completely before using this file.
+// This file is part of Open CASCADE Technology software library.
 //
-// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+// 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.
 //
-// The Original Code and all software distributed under the License is
-// distributed on an "AS IS" basis, without warranty of any kind, and the
-// Initial Developer hereby disclaims all such warranties, including without
-// limitation, any warranties of merchantability, fitness for a particular
-// purpose or non-infringement. Please see the License for the specific terms
-// and conditions governing the rights and limitations under the License.
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
 
 
-#include <Approx_CurvilinearParameter.ixx>
-
+#include <Adaptor2d_HCurve2d.hxx>
 #include <Adaptor3d_Curve.hxx>
+#include <Adaptor3d_CurveOnSurface.hxx>
+#include <Adaptor3d_HCurve.hxx>
+#include <Adaptor3d_HSurface.hxx>
+#include <AdvApprox_ApproxAFunction.hxx>
+#include <AdvApprox_PrefAndRec.hxx>
+#include <Approx_CurvilinearParameter.hxx>
+#include <Approx_CurvlinFunc.hxx>
+#include <CPnts_AbscissaPoint.hxx>
 #include <GCPnts_AbscissaPoint.hxx>
+#include <Geom2d_BSplineCurve.hxx>
+#include <Geom_BSplineCurve.hxx>
+#include <GeomAbs_Shape.hxx>
+#include <GeomAdaptor_HCurve.hxx>
+#include <GeomAdaptor_HSurface.hxx>
 #include <gp_Pnt.hxx>
 #include <gp_Pnt2d.hxx>
 #include <gp_Vec.hxx>
 #include <gp_Vec2d.hxx>
-#include <GeomAbs_Shape.hxx>
-#include <AdvApprox_ApproxAFunction.hxx>
-#include <Geom_BSplineCurve.hxx>
-#include <TColStd_HArray1OfReal.hxx>
-#include <TColStd_HArray1OfInteger.hxx>
-#include <TColgp_Array1OfPnt.hxx>
-#include <GeomAdaptor_HCurve.hxx>
-#include <GeomAdaptor_HSurface.hxx>
-#include <TColStd_Array1OfReal.hxx>
-#include <AdvApprox_PrefAndRec.hxx>
-#include <Adaptor3d_CurveOnSurface.hxx>
+#include <math_Vector.hxx>
 #include <Precision.hxx>
-#include <Geom2d_BSplineCurve.hxx>
+#include <Standard_ConstructionError.hxx>
+#include <Standard_OutOfRange.hxx>
+#include <TColgp_Array1OfPnt.hxx>
 #include <TColgp_Array1OfPnt2d.hxx>
-#include <math_Vector.hxx>
-#include <CPnts_AbscissaPoint.hxx>
-#include <Approx_CurvlinFunc.hxx>
+#include <TColStd_Array1OfReal.hxx>
+#include <TColStd_HArray1OfInteger.hxx>
+#include <TColStd_HArray1OfReal.hxx>
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
 #include <OSD_Timer.hxx>
 static OSD_Chronometer chr_total, chr_init, chr_approx;
 
@@ -134,7 +134,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_
                                                         const Standard_Integer MaxDegree,
                                                         const Standard_Integer MaxSegments)
 {
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   t_total = t_init = t_approx = t_uparam = 0;
   uparam_count = 0;
   InitChron(chr_total);
@@ -147,11 +147,11 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_
   Handle(TColStd_HArray1OfReal) ThreeDTol  = new TColStd_HArray1OfReal(1,Num3DSS);
   ThreeDTol->Init(Tol); 
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   InitChron(chr_init);
 #endif
   Handle(Approx_CurvlinFunc) fonct = new Approx_CurvlinFunc(C3D, Tol/10);
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_init, t_init);
 #endif
 
@@ -166,7 +166,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_
   fonct->Intervals(CutPnts_C3,GeomAbs_C3);
   AdvApprox_PrefAndRec CutTool(CutPnts_C2,CutPnts_C3);
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   InitChron(chr_approx);
 #endif
 
@@ -177,7 +177,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_
                                     MaxDegree, MaxSegments,
                                     evC, CutTool);
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_approx, t_approx);
 #endif
 
@@ -194,7 +194,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_
   }
   myMaxError3d = aApprox.MaxError(3,1);
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_total, t_total);
 
   cout<<" total reparametrization time = "<<t_total<<endl;
@@ -272,7 +272,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
                                                         const Standard_Integer MaxDegree,
                                                         const Standard_Integer MaxSegments)
 {
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   t_total = t_init = t_approx = t_uparam = 0;
   uparam_count = 0;
   InitChron(chr_total);
@@ -297,11 +297,11 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
   Handle(TColStd_HArray1OfReal) ThreeDTol = new TColStd_HArray1OfReal(1,Num3DSS);
   ThreeDTol->Init(Tol/2.); 
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   InitChron(chr_init);
 #endif
   Handle(Approx_CurvlinFunc) fonct = new Approx_CurvlinFunc(C2D, Surf, Tol/20);
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_init, t_init);
 #endif
 
@@ -316,7 +316,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
   fonct->Intervals(CutPnts_C3,GeomAbs_C3);
   AdvApprox_PrefAndRec CutTool(CutPnts_C2,CutPnts_C3);
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   InitChron(chr_approx);
 #endif
 
@@ -327,7 +327,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
                                     MaxDegree, MaxSegments,
                                     evCOnS, CutTool);
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_approx, t_approx);
 #endif
 
@@ -355,7 +355,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
   myMaxError2d1 = Max (aApprox.MaxError(1,1),aApprox.MaxError(1,2));
   myMaxError3d  = aApprox.MaxError(3,1);
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_total, t_total);
 
   cout<<" total reparametrization time = "<<t_total<<endl;
@@ -437,7 +437,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
 {
   Standard_Integer i;
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   t_total = t_init = t_approx = t_uparam = 0;
   uparam_count = 0;
   InitChron(chr_total);
@@ -462,11 +462,11 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
   Handle(TColStd_HArray1OfReal) ThreeDTol = new TColStd_HArray1OfReal(1,Num3DSS);
   ThreeDTol->Init(Tol/2); 
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   InitChron(chr_init);
 #endif
   Handle(Approx_CurvlinFunc) fonct = new Approx_CurvlinFunc(C2D1, C2D2, Surf1, Surf2, Tol/20);
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_init, t_init);
 #endif
 
@@ -481,7 +481,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
   fonct->Intervals(CutPnts_C3,GeomAbs_C3);
   AdvApprox_PrefAndRec CutTool(CutPnts_C2,CutPnts_C3);  
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   InitChron(chr_approx);
 #endif
 
@@ -492,7 +492,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
                                     MaxDegree, MaxSegments,
                                     evCOn2S, CutTool);
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_approx, t_approx);
 #endif
 
@@ -528,7 +528,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
   myMaxError2d2 = Max (aApprox.MaxError(1,3),aApprox.MaxError(1,4));
   myMaxError3d  = aApprox.MaxError(3,1);
 
-#ifdef __OCC_DEBUG_CHRONO
+#ifdef OCCT_DEBUG_CHRONO
   ResultChron(chr_total, t_total);
 
   cout<<" total reparametrization time = "<<t_total<<endl;
@@ -664,7 +664,7 @@ void Approx_CurvilinearParameter::ToleranceComputation(const Handle(Adaptor2d_HC
   TolV = Tol / (4.*Max_dS_dv);
   TolW = Tol / (4.*Max_dS_dw);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   cout << "TolV = " << TolV << endl;
   cout << "TolW = " << TolW << endl;
 #endif