0026196: Wrong result obtained by projection algorithm.
[occt.git] / src / GeomAdaptor / GeomAdaptor.cxx
old mode 100755 (executable)
new mode 100644 (file)
index fff2f22..7880502
@@ -1,39 +1,51 @@
-// File:      GeomAdaptor.cxx
-// Created:   Wed May  3 17:48:12 1995
-// Author:    Bruno DUMORTIER
-// Copyright: OPEN CASCADE 1995
-
-#include <GeomAdaptor.ixx>
-
-#include <Geom_Line.hxx>
+// Created on: 1995-05-03
+// Created by: Bruno DUMORTIER
+// Copyright (c) 1995-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 <Adaptor3d_Curve.hxx>
+#include <Adaptor3d_HCurve.hxx>
+#include <Adaptor3d_HSurface.hxx>
+#include <Adaptor3d_Surface.hxx>
+#include <Geom_BezierCurve.hxx>
+#include <Geom_BezierSurface.hxx>
+#include <Geom_BSplineCurve.hxx>
+#include <Geom_BSplineSurface.hxx>
 #include <Geom_Circle.hxx>
 #include <Geom_Circle.hxx>
+#include <Geom_ConicalSurface.hxx>
+#include <Geom_Curve.hxx>
+#include <Geom_CylindricalSurface.hxx>
 #include <Geom_Ellipse.hxx>
 #include <Geom_Ellipse.hxx>
-#include <Geom_Parabola.hxx>
 #include <Geom_Hyperbola.hxx>
 #include <Geom_Hyperbola.hxx>
-#include <Geom_BezierCurve.hxx>
-#include <Geom_BSplineCurve.hxx>
-#include <Geom_TrimmedCurve.hxx>
-
+#include <Geom_Line.hxx>
+#include <Geom_OffsetSurface.hxx>
+#include <Geom_Parabola.hxx>
 #include <Geom_Plane.hxx>
 #include <Geom_Plane.hxx>
-#include <Geom_CylindricalSurface.hxx>
-#include <Geom_ConicalSurface.hxx>
+#include <Geom_RectangularTrimmedSurface.hxx>
 #include <Geom_SphericalSurface.hxx>
 #include <Geom_SphericalSurface.hxx>
-#include <Geom_ToroidalSurface.hxx>
-#include <Geom_BezierSurface.hxx>
-#include <Geom_BSplineSurface.hxx>
-#include <Geom_SurfaceOfRevolution.hxx>
+#include <Geom_Surface.hxx>
 #include <Geom_SurfaceOfLinearExtrusion.hxx>
 #include <Geom_SurfaceOfLinearExtrusion.hxx>
-#include <Geom_RectangularTrimmedSurface.hxx>
-#include <Geom_OffsetSurface.hxx>
-
-#include <Adaptor3d_HCurve.hxx>
-#include <Adaptor3d_HSurface.hxx>
+#include <Geom_SurfaceOfRevolution.hxx>
+#include <Geom_ToroidalSurface.hxx>
+#include <Geom_TrimmedCurve.hxx>
+#include <GeomAdaptor.hxx>
 
 //=======================================================================
 //function : MakeCurve
 //purpose  : 
 //=======================================================================
 
 //=======================================================================
 //function : MakeCurve
 //purpose  : 
 //=======================================================================
-
 Handle(Geom_Curve) GeomAdaptor::MakeCurve (const Adaptor3d_Curve& HC)
 {
   Handle(Geom_Curve) C;
 Handle(Geom_Curve) GeomAdaptor::MakeCurve (const Adaptor3d_Curve& HC)
 {
   Handle(Geom_Curve) C;
@@ -74,8 +86,8 @@ Handle(Geom_Curve) GeomAdaptor::MakeCurve (const Adaptor3d_Curve& HC)
   }
 
   // trim the curve if necassary.
   }
 
   // trim the curve if necassary.
-  if (! C.IsNull() &&
-      (HC.FirstParameter() != C->FirstParameter()) ||
+  if ((! C.IsNull() &&
+      (HC.FirstParameter() != C->FirstParameter())) ||
       (HC.LastParameter()  != C->LastParameter())) {
 
     C = new Geom_TrimmedCurve(C,HC.FirstParameter(),HC.LastParameter());
       (HC.LastParameter()  != C->LastParameter())) {
 
     C = new Geom_TrimmedCurve(C,HC.FirstParameter(),HC.LastParameter());
@@ -89,8 +101,8 @@ Handle(Geom_Curve) GeomAdaptor::MakeCurve (const Adaptor3d_Curve& HC)
 //function : MakeSurface
 //purpose  : 
 //=======================================================================
 //function : MakeSurface
 //purpose  : 
 //=======================================================================
-
-Handle(Geom_Surface) GeomAdaptor::MakeSurface(const Adaptor3d_Surface& HS)
+Handle(Geom_Surface) GeomAdaptor::MakeSurface(const Adaptor3d_Surface& HS,
+                                              const Standard_Boolean theTrimFlag)
 {
   Handle(Geom_Surface) S;
 
 {
   Handle(Geom_Surface) S;
 
@@ -136,7 +148,7 @@ Handle(Geom_Surface) GeomAdaptor::MakeSurface(const Adaptor3d_Surface& HS)
 
   case GeomAbs_OffsetSurface:
     S = new Geom_OffsetSurface(GeomAdaptor::MakeSurface(HS.BasisSurface()->Surface()),
 
   case GeomAbs_OffsetSurface:
     S = new Geom_OffsetSurface(GeomAdaptor::MakeSurface(HS.BasisSurface()->Surface()),
-                              HS.OffsetValue());
+                               HS.OffsetValue());
     break;
 
   case GeomAbs_OtherSurface:
     break;
 
   case GeomAbs_OtherSurface:
@@ -144,7 +156,7 @@ Handle(Geom_Surface) GeomAdaptor::MakeSurface(const Adaptor3d_Surface& HS)
     break;
   }
 
     break;
   }
 
-  if ( S.IsNull() )
+  if ( S.IsNull() || !theTrimFlag)
     return S;
 
   // trim the surface if necassary.
     return S;
 
   // trim the surface if necassary.