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
37 //! Get number of 3d and 2d points returned by "Value" and "D1" functions.
38 void GetNumberOfPoints(Standard_Integer& theNbPnt, Standard_Integer& theNbPnt2d) const
41 theNbPnt2d = myNbPnt2d;
44 //! Get number of 3d points returned by "Value" and "D1" functions.
45 Standard_Integer GetNbOf3dPoints() const
50 //! Get number of 2d points returned by "Value" and "D1" functions.
51 Standard_Integer GetNbOf2dPoints() const
57 virtual ~AppCont_Function() {}
59 //! Returns the first parameter of the function.
60 virtual Standard_Real FirstParameter() const = 0;
62 //! Returns the last parameter of the function.
63 virtual Standard_Real LastParameter() const = 0;
65 //! Returns the point at parameter <theU>.
66 virtual Standard_Boolean Value (const Standard_Real theU,
67 NCollection_Array1<gp_Pnt2d>& thePnt2d,
68 NCollection_Array1<gp_Pnt>& thePnt) const = 0;
70 //! Returns the derivative at parameter <theU>.
71 virtual Standard_Boolean D1 (const Standard_Real theU,
72 NCollection_Array1<gp_Vec2d>& theVec2d,
73 NCollection_Array1<gp_Vec>& theVec) const = 0;
75 //! Return information about peridicity in output paramateters space.
76 //! @param theDimIdx Defines index in output parameters space. 1 <= theDimIdx <= 3 * myNbPnt + 2 * myNbPnt2d.
77 virtual void PeriodInformation (const Standard_Integer /*theDimIdx*/,
78 Standard_Boolean& IsPeriodic,
79 Standard_Real& thePeriod) const
81 IsPeriodic = Standard_False;
87 Standard_Integer myNbPnt;
88 Standard_Integer myNbPnt2d;