0027960: Configuration - fix compilation of OSD_Directory with MinGW-w64
[occt.git] / src / ChFiKPart / ChFiKPart_ComputeData.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 51ec70b..71cbf73
-// File:       ChFiKPart_ComputeData.cxx
-// Created:    Thu Dec 23 16:42:44 1993
-// Author:     Isabelle GRIGNON
-//             <isg@sdsun1>
+// Created on: 1993-12-23
+// Created by: Isabelle GRIGNON
+// Copyright (c) 1993-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 <ChFiKPart_ComputeData.ixx>
-
-#include <Standard_NotImplemented.hxx>
-#include <Standard_ConstructionError.hxx>
-#include <Precision.hxx>
-#include <gp.hxx>
-#include <gp_Pnt2d.hxx>
-#include <gp_Dir2d.hxx>
-#include <gp_Lin2d.hxx>
-#include <gp_Pnt.hxx>
-#include <gp_Dir.hxx>
-#include <gp_Vec.hxx>
-#include <gp_Lin.hxx>
-#include <gp_Ax2.hxx>
-#include <gp_Ax3.hxx>
-#include <gp_Circ.hxx>
-#include <gp_Pln.hxx>
-#include <gp_Cylinder.hxx>
+#include <Adaptor3d_HSurface.hxx>
+#include <BRepAdaptor_HSurface.hxx>
+#include <ChFiDS_ChamfSpine.hxx>
+#include <ChFiDS_FilSpine.hxx>
+#include <ChFiDS_Spine.hxx>
+#include <ChFiDS_SurfData.hxx>
+#include <ChFiKPart_ComputeData.hxx>
+#include <ChFiKPart_ComputeData_ChAsymPlnCon.hxx>
+#include <ChFiKPart_ComputeData_ChAsymPlnCyl.hxx>
+#include <ChFiKPart_ComputeData_ChAsymPlnPln.hxx>
+#include <ChFiKPart_ComputeData_ChPlnCon.hxx>
+#include <ChFiKPart_ComputeData_ChPlnCyl.hxx>
+#include <ChFiKPart_ComputeData_ChPlnPln.hxx>
+#include <ChFiKPart_ComputeData_CS.hxx>
+#include <ChFiKPart_ComputeData_Fcts.hxx>
+#include <ChFiKPart_ComputeData_FilPlnCon.hxx>
+#include <ChFiKPart_ComputeData_FilPlnCyl.hxx>
+#include <ChFiKPart_ComputeData_FilPlnPln.hxx>
+#include <ChFiKPart_ComputeData_Rotule.hxx>
+#include <ChFiKPart_ComputeData_Sphere.hxx>
 #include <ElCLib.hxx>
 #include <ElSLib.hxx>
+#include <Geom2d_BSplineCurve.hxx>
+#include <Geom2d_Circle.hxx>
 #include <Geom2d_Curve.hxx>
 #include <Geom2d_Line.hxx>
-#include <Geom2d_Circle.hxx>
-#include <Geom2d_BSplineCurve.hxx>
+#include <Geom2dAdaptor_Curve.hxx>
+#include <Geom2dInt_GInter.hxx>
+#include <Geom_Circle.hxx>
+#include <Geom_ConicalSurface.hxx>
 #include <Geom_Curve.hxx>
+#include <Geom_CylindricalSurface.hxx>
 #include <Geom_Line.hxx>
-#include <Geom_Circle.hxx>
-#include <Geom_Surface.hxx>
 #include <Geom_Plane.hxx>
-#include <Geom_CylindricalSurface.hxx>
-#include <Geom_ToroidalSurface.hxx>
-#include <Geom_ConicalSurface.hxx>
 #include <Geom_SphericalSurface.hxx>
+#include <Geom_Surface.hxx>
+#include <Geom_ToroidalSurface.hxx>
 #include <GeomAbs_CurveType.hxx>
 #include <GeomAbs_SurfaceType.hxx>
 #include <GeomAdaptor_Curve.hxx>
-#include <Geom2dAdaptor_Curve.hxx>
-//#include <BRepAdaptor_Curve2d.hxx>
-#include <BRepAdaptor_HSurface.hxx>
-#include <IntSurf_Transition.hxx>
-#include <IntSurf_TypeTrans.hxx>
+#include <gp.hxx>
+#include <gp_Ax2.hxx>
+#include <gp_Ax3.hxx>
+#include <gp_Circ.hxx>
+#include <gp_Cylinder.hxx>
+#include <gp_Dir.hxx>
+#include <gp_Dir2d.hxx>
+#include <gp_Lin.hxx>
+#include <gp_Lin2d.hxx>
+#include <gp_Pln.hxx>
+#include <gp_Pnt.hxx>
+#include <gp_Pnt2d.hxx>
+#include <gp_Vec.hxx>
+#include <IntAna_QuadQuadGeo.hxx>
+#include <IntRes2d_IntersectionPoint.hxx>
+#include <IntRes2d_Position.hxx>
 #include <IntRes2d_Transition.hxx>
 #include <IntRes2d_TypeTrans.hxx>
-#include <IntRes2d_Position.hxx>
-#include <IntRes2d_IntersectionPoint.hxx>
-#include <IntAna_QuadQuadGeo.hxx>
-#include <Geom2dInt_GInter.hxx>
+#include <IntSurf_Transition.hxx>
+#include <IntSurf_TypeTrans.hxx>
+#include <Precision.hxx>
+#include <Standard_ConstructionError.hxx>
+#include <Standard_NotImplemented.hxx>
 #include <TopExp.hxx>
-//#include <BRepAdaptor_HCurve2d.hxx>
-#include <ChFiDS_FilSpine.hxx>
-#include <ChFiDS_ChamfSpine.hxx>
-
 #include <TopOpeBRepDS_Curve.hxx>
+#include <TopOpeBRepDS_DataStructure.hxx>
 #include <TopOpeBRepDS_Surface.hxx>
 
-#include <ChFiKPart_ComputeData_Fcts.hxx>
-#include <ChFiKPart_ComputeData_ChPlnPln.hxx>
-#include <ChFiKPart_ComputeData_ChPlnCyl.hxx>
-#include <ChFiKPart_ComputeData_ChPlnCon.hxx>
-#include <ChFiKPart_ComputeData_ChAsymPlnPln.hxx>
-#include <ChFiKPart_ComputeData_ChAsymPlnCyl.hxx>
-#include <ChFiKPart_ComputeData_ChAsymPlnCon.hxx> 
-#include <ChFiKPart_ComputeData_FilPlnCon.hxx>
-#include <ChFiKPart_ComputeData_FilPlnCyl.hxx>
-#include <ChFiKPart_ComputeData_FilPlnPln.hxx>
-
-
-#include <ChFiKPart_ComputeData_CS.hxx>
-#include <ChFiKPart_ComputeData_Rotule.hxx>
-#include <ChFiKPart_ComputeData_Sphere.hxx>
-
-//=======================================================================
-//function : ComputeAbscissa
-//purpose  : 
-//=======================================================================
-
-// Unused :
-#ifdef DEB
-static Standard_Real ComputeAbscissa(const BRepAdaptor_Curve& C,
-                                    const Standard_Real UFirst) 
-{
-  Standard_Real fp = fp = C.FirstParameter();
-  switch (C.GetType()) {
-  case GeomAbs_Line:
-    return UFirst - fp;
-  case GeomAbs_Circle:
-    return C.Circle().Radius()*(UFirst-fp);
-#ifndef DEB
-  default:
-    break;
-#endif
-  }    
-  Standard_NotImplemented::Raise("calcul abscisse non traite ");
-  return 0.;
-}
-#endif
-
+//#include <BRepAdaptor_Curve2d.hxx>
+//#include <BRepAdaptor_HCurve2d.hxx>
 //=======================================================================
 //function : Compute
 //purpose  : 
@@ -108,8 +92,8 @@ static Standard_Real ComputeAbscissa(const BRepAdaptor_Curve& C,
  Standard_Boolean ChFiKPart_ComputeData::Compute
  (TopOpeBRepDS_DataStructure&    DStr, 
   Handle(ChFiDS_SurfData)&       Data, 
-  const Handle_Adaptor3d_HSurface& S1, 
-  const Handle_Adaptor3d_HSurface& S2, 
+  const Handle(Adaptor3d_HSurface)& S1, 
+  const Handle(Adaptor3d_HSurface)& S2, 
   const TopAbs_Orientation       Or1, 
   const TopAbs_Orientation       Or2, 
   const Handle(ChFiDS_Spine)&    Sp, 
@@ -119,11 +103,7 @@ static Standard_Real ComputeAbscissa(const BRepAdaptor_Curve& C,
 
   Handle(ChFiDS_FilSpine)   Spine  = Handle(ChFiDS_FilSpine)::DownCast(Sp);
   Handle(ChFiDS_ChamfSpine) CSpine = Handle(ChFiDS_ChamfSpine)::DownCast(Sp);
-#ifndef DEB
   Standard_Boolean surfok = Standard_False;
-#else
-  Standard_Boolean surfok;
-#endif
   GeomAbs_SurfaceType typ1 = S1->GetType();
   GeomAbs_SurfaceType typ2 = S2->GetType();
   GeomAbs_CurveType   ctyp;
@@ -133,7 +113,7 @@ static Standard_Real ComputeAbscissa(const BRepAdaptor_Curve& C,
   else 
     ctyp = CSpine->CurrentElementarySpine(Iedge).GetType();
 
-  // Recuperation des orientations.
+  // Return orientations.
   TopAbs_Orientation OrFace1 = TopAbs_FORWARD, OrFace2 = TopAbs_FORWARD;
   Handle(BRepAdaptor_HSurface) HS = Handle(BRepAdaptor_HSurface)::DownCast(S1);
   if (!HS.IsNull()) OrFace1 = HS->ChangeSurface().Face().Orientation();
@@ -184,7 +164,7 @@ static Standard_Real ComputeAbscissa(const BRepAdaptor_Curve& C,
                                    Wref,OrFace2,Standard_False);
     }
     else{
-      Standard_NotImplemented::Raise("cas particulier non ecrit");
+      Standard_NotImplemented::Raise("particular case not written");
     }
   }
   else if(!CSpine.IsNull()){
@@ -233,7 +213,7 @@ static Standard_Real ComputeAbscissa(const BRepAdaptor_Curve& C,
                                       Wref,OrFace2,Standard_False); 
       }
       else{
-       Standard_NotImplemented::Raise("cas particulier non ecrit");
+       Standard_NotImplemented::Raise("particular case not written");
       }
     }
     else if (CSpine->IsChamfer() == ChFiDS_TwoDist) {    
@@ -281,7 +261,7 @@ static Standard_Real ComputeAbscissa(const BRepAdaptor_Curve& C,
                                       Wref,OrFace2,Standard_False); 
       }
       else{
-       Standard_NotImplemented::Raise("cas particulier non ecrit");
+       Standard_NotImplemented::Raise("particular case not written");
       }
     }
     else {
@@ -330,7 +310,7 @@ static Standard_Real ComputeAbscissa(const BRepAdaptor_Curve& C,
                                      Wref,OrFace2,Standard_False, DisOnP); 
       }
       else{
-       Standard_NotImplemented::Raise("cas particulier non ecrit");
+       Standard_NotImplemented::Raise("particular case not written");
       }
     }
   }
@@ -365,8 +345,8 @@ Standard_Boolean ChFiKPart_ComputeData::ComputeCorner
     Standard_ConstructionError::Raise
       ("la face du conge torique doit etre plane");
   }
-  // On calcule comme ligne guide le cercle correspondant 
-  // a la section de S2, et divers elements de construction.
+  // The guideline is the circle corresponding 
+  // to the section of S2, and other construction elements.
 
   gp_Cylinder cyl;
   gp_Circ circ;
@@ -449,7 +429,7 @@ Standard_Boolean ChFiKPart_ComputeData::ComputeCorner
       typ1 != GeomAbs_Plane ||
       typ2 != GeomAbs_Plane){
     Standard_ConstructionError::Raise
-      ("rotule torique seulement entre des plans");
+      ("torus joint only between the planes");
   }
   return ChFiKPart_MakeRotule(DStr,Data,S->Plane(),S1->Plane(),
                              S2->Plane(),OS,OS1,OS2,Radius,OfS);