1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #ifndef AppCont_Function_HeaderFile
16 #define AppCont_Function_HeaderFile
19 #include <gp_Pnt2d.hxx>
21 #include <gp_Vec2d.hxx>
22 #include <NCollection_Array1.hxx>
23 #include <Standard_Integer.hxx>
25 //! Class describing a continous 3d and/or function f(u).
26 //! This class must be provided by the user to use the approximation algorithm FittingCurve.
27 class AppCont_Function
31 Standard_EXPORT AppCont_Function()
37 //! Get number of 3d and 2d points returned by "Value" and "D1" functions.
38 Standard_EXPORT void GetNumberOfPoints(Standard_Integer& theNbPnt,
39 Standard_Integer& theNbPnt2d) const
42 theNbPnt2d = myNbPnt2d;
45 //! Get number of 3d points returned by "Value" and "D1" functions.
46 Standard_EXPORT Standard_Integer GetNbOf3dPoints() const
51 //! Get number of 2d points returned by "Value" and "D1" functions.
52 Standard_EXPORT Standard_Integer GetNbOf2dPoints() const
58 Standard_EXPORT virtual ~AppCont_Function() {}
60 //! Returns the first parameter of the function.
61 Standard_EXPORT virtual Standard_Real FirstParameter() const = 0;
63 //! Returns the last parameter of the function.
64 Standard_EXPORT virtual Standard_Real LastParameter() const = 0;
66 //! Returns the point at parameter <theU>.
67 Standard_EXPORT virtual Standard_Boolean Value(const Standard_Real theU,
68 NCollection_Array1<gp_Pnt2d>& thePnt2d,
69 NCollection_Array1<gp_Pnt>& thePnt) const = 0;
71 //! Returns the derivative at parameter <theU>.
72 Standard_EXPORT virtual Standard_Boolean D1(const Standard_Real theU,
73 NCollection_Array1<gp_Vec2d>& theVec2d,
74 NCollection_Array1<gp_Vec>& theVec) const = 0;
76 //! Return information about peridicity in output paramateters space.
77 //! @param theDimIdx Defines index in output parameters space. 1 <= theDimIdx <= 3 * myNbPnt + 2 * myNbPnt2d.
78 Standard_EXPORT virtual void PeriodInformation(const Standard_Integer /*theDimIdx*/,
79 Standard_Boolean& IsPeriodic,
80 Standard_Real& thePeriod) const
82 IsPeriodic = Standard_False;
88 Standard_Integer myNbPnt;
89 Standard_Integer myNbPnt2d;