Integration of OCCT 6.5.0 from SVN
[occt.git] / src / AdvApprox / AdvApprox_EvaluatorFunction.hxx
1 // File:        AdvApprox_EvaluatorFunction.hxx
2 // Created:     Mon May 29 17:04:50 1995
3 // Author:      Xavier BENVENISTE
4 //              <xab@nonox>
5
6 #ifndef _Standard_Integer_HeaderFile
7 #include <Standard_Integer.hxx>
8 #endif
9 #ifndef _Standard_Real_HeaderFile
10 #include <Standard_Real.hxx>
11 #endif
12 #ifndef _Standard_PrimitiveTypes_HeaderFile
13 #include <Standard_PrimitiveTypes.hxx>
14 #endif
15 #ifndef _AdvApprox_EvaluatorFunction_HeaderFile
16 #define _AdvApprox_EvaluatorFunction_HeaderFile
17
18 // abv 01.04.2009: the C function pointer converted to a virtual class
19 // in order to get rid of usage of static functions and static data
20
21 //! Interface for a class implementing a function to be approximated
22 //! by AdvApprox_ApproxAFunction
23 class AdvApprox_EvaluatorFunction 
24 {
25  public:
26   
27   //! Empty constructor
28   AdvApprox_EvaluatorFunction () {}
29   
30   //! Destructor should be declared as virtual
31   virtual ~AdvApprox_EvaluatorFunction () {}
32   
33   //! Function evaluation method to be defined by descendant
34   virtual void Evaluate (Standard_Integer *Dimension,
35                          Standard_Real     StartEnd[2],
36                          Standard_Real    *Parameter,
37                          Standard_Integer *DerivativeRequest,
38                          Standard_Real    *Result, // [Dimension]
39                          Standard_Integer *ErrorCode) = 0;
40
41   //! Shortcut for function-call style usage
42   void operator () (Standard_Integer *Dimension,
43                     Standard_Real     StartEnd[2],
44                     Standard_Real    *Parameter,
45                     Standard_Integer *DerivativeRequest,
46                     Standard_Real    *Result, // [Dimension]
47                     Standard_Integer *ErrorCode)
48   { Evaluate (Dimension, StartEnd, Parameter, DerivativeRequest, Result, ErrorCode); }
49   
50  private:
51
52   //! Copy constructor is declared private to forbid copying
53   AdvApprox_EvaluatorFunction (const AdvApprox_EvaluatorFunction&) {}
54
55   //! Assignment operator is declared private to forbid copying
56   void operator = (const AdvApprox_EvaluatorFunction&) {}
57 };
58
59 #endif