-// File: ProjLib_ProjectOnSurface.gxx
-// Created: Thu Sep 15 15:45:43 1994
-// Author: Bruno DUMORTIER
-// <dub@fuegox>
+// Created on: 1994-09-15
+// Created by: Bruno DUMORTIER
+// Copyright (c) 1994-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 <ProjLib_ProjectOnSurface.ixx>
#include <BSplCLib.hxx>
#include <PLib.hxx>
#include <Adaptor3d_HCurve.hxx>
-#include <Handle_Adaptor3d_HCurve.hxx>
#include <Geom_BSplineCurve.hxx>
-#include <Handle_Geom_BSplineCurve.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
class ProjLib_OnSurface : public AppCont_Function
{
- Handle(Adaptor3d_HCurve) myCurve;
- Extrema_ExtPS *myExtPS;
-
- public :
+public:
ProjLib_OnSurface(const Handle(Adaptor3d_HCurve) & C,
- const Handle(Adaptor3d_HSurface) & S)
- : myCurve(C)
- {Standard_Real U = myCurve->FirstParameter();
- gp_Pnt P = myCurve->Value(U);
- Standard_Real Tol = Precision::PConfusion();
- myExtPS = new Extrema_ExtPS(P,S->Surface(),Tol,Tol);}
+ const Handle(Adaptor3d_HSurface) & S)
+ : myCurve(C)
+ {
+ myNbPnt = 1;
+ myNbPnt2d = 0;
+ Standard_Real U = myCurve->FirstParameter();
+ gp_Pnt P = myCurve->Value(U);
+ Standard_Real Tol = Precision::PConfusion();
+ myExtPS = new Extrema_ExtPS(P,S->Surface(),Tol,Tol);
+ }
~ProjLib_OnSurface() { delete myExtPS; }
Standard_Real FirstParameter() const
{return myCurve->FirstParameter();}
-
+
Standard_Real LastParameter() const
{return myCurve->LastParameter();}
- gp_Pnt Value( const Standard_Real t) const
- {return OnSurface_Value(t,myCurve,myExtPS);}
+ Standard_Boolean Value(const Standard_Real theT,
+ NCollection_Array1<gp_Pnt2d>& /*thePnt2d*/,
+ NCollection_Array1<gp_Pnt>& thePnt) const
+ {
+ thePnt(1) = OnSurface_Value(theT, myCurve, myExtPS);
+ return Standard_True;
+ }
+
+ Standard_Boolean D1(const Standard_Real theT,
+ NCollection_Array1<gp_Vec2d>& /*theVec2d*/,
+ NCollection_Array1<gp_Vec>& theVec) const
+ {
+ gp_Pnt aPnt;
+ return OnSurface_D1(theT, aPnt, theVec(1), myCurve, myExtPS);
+ }
- Standard_Boolean D1(const Standard_Real t, gp_Pnt& P, gp_Vec& V) const
- {return OnSurface_D1(t,P,V,myCurve,myExtPS);}
-};
-
+private:
+ ProjLib_OnSurface (const ProjLib_OnSurface&);
+ ProjLib_OnSurface& operator= (const ProjLib_OnSurface&);
+private:
+ Handle(Adaptor3d_HCurve) myCurve;
+ Extrema_ExtPS* myExtPS;
+};
//=====================================================================//