0025616: Avoid Classes using "new" to allocate Instances but not defining a copy...
[occt.git] / src / ProjLib / ProjLib_ProjectOnSurface.cxx
index 64889da..c71c2ce 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.
@@ -25,9 +25,7 @@
 #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>
@@ -87,35 +85,52 @@ static Standard_Boolean OnSurface_D1(const Standard_Real , // U,
 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;
+};
 
 
 //=====================================================================//