0022972: Eliminate macro definitions that has compiler-provided analogs (WNT and...
[occt.git] / src / AppCont / AppCont_Function.hxx
1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 //
4 // This file is part of Open CASCADE Technology software library.
5 //
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.
11 //
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
14
15 #ifndef AppCont_Function_HeaderFile
16 #define AppCont_Function_HeaderFile
17
18 #include <gp_Pnt.hxx>
19 #include <gp_Pnt2d.hxx>
20 #include <gp_Vec.hxx>
21 #include <gp_Vec2d.hxx>
22 #include <NCollection_Array1.hxx>
23 #include <Standard_Integer.hxx>
24
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
28 {
29 public:
30
31   Standard_EXPORT AppCont_Function()
32   {
33     myNbPnt = -1;
34     myNbPnt2d = -1;
35   }
36
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
40   {
41     theNbPnt = myNbPnt;
42     theNbPnt2d = myNbPnt2d;
43   }
44
45   //! Get number of 3d points returned by "Value" and "D1" functions.
46   Standard_EXPORT Standard_Integer GetNbOf3dPoints() const
47   {
48     return myNbPnt;
49   }
50
51   //! Get number of 2d points returned by "Value" and "D1" functions.
52   Standard_EXPORT Standard_Integer GetNbOf2dPoints() const
53   {
54     return myNbPnt2d;
55   }
56
57   //! Destructor
58   Standard_EXPORT virtual ~AppCont_Function() {}
59
60   //! Returns the first parameter of the function.
61   Standard_EXPORT virtual Standard_Real FirstParameter() const = 0;
62
63   //! Returns the last parameter of the function.
64   Standard_EXPORT virtual Standard_Real LastParameter() const = 0;
65
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;
70
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;
75
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
81   {
82     IsPeriodic = Standard_False;
83     thePeriod = 0.0;
84   };
85
86
87 protected:
88   Standard_Integer myNbPnt;
89   Standard_Integer myNbPnt2d;
90 };
91
92 #endif