68b896c6b20bc1379e7dbb3160d46225cb0a8246
[occt.git] / src / AdvApprox / AdvApprox_EvaluatorFunction.hxx
1 // Created on: 1995-05-29
2 // Created by: Xavier BENVENISTE
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and / or modify it
9 // under the terms of the GNU Lesser General Public version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _Standard_Integer_HeaderFile
18 #include <Standard_Integer.hxx>
19 #endif
20 #ifndef _Standard_Real_HeaderFile
21 #include <Standard_Real.hxx>
22 #endif
23 #ifndef _Standard_PrimitiveTypes_HeaderFile
24 #include <Standard_PrimitiveTypes.hxx>
25 #endif
26 #ifndef _AdvApprox_EvaluatorFunction_HeaderFile
27 #define _AdvApprox_EvaluatorFunction_HeaderFile
28
29 // abv 01.04.2009: the C function pointer converted to a virtual class
30 // in order to get rid of usage of static functions and static data
31
32 //! Interface for a class implementing a function to be approximated
33 //! by AdvApprox_ApproxAFunction
34 class AdvApprox_EvaluatorFunction 
35 {
36  public:
37   
38   //! Empty constructor
39   AdvApprox_EvaluatorFunction () {}
40   
41   //! Destructor should be declared as virtual
42   virtual ~AdvApprox_EvaluatorFunction () {}
43   
44   //! Function evaluation method to be defined by descendant
45   virtual void Evaluate (Standard_Integer *Dimension,
46                          Standard_Real     StartEnd[2],
47                          Standard_Real    *Parameter,
48                          Standard_Integer *DerivativeRequest,
49                          Standard_Real    *Result, // [Dimension]
50                          Standard_Integer *ErrorCode) = 0;
51
52   //! Shortcut for function-call style usage
53   void operator () (Standard_Integer *Dimension,
54                     Standard_Real     StartEnd[2],
55                     Standard_Real    *Parameter,
56                     Standard_Integer *DerivativeRequest,
57                     Standard_Real    *Result, // [Dimension]
58                     Standard_Integer *ErrorCode)
59   { Evaluate (Dimension, StartEnd, Parameter, DerivativeRequest, Result, ErrorCode); }
60   
61  private:
62
63   //! Copy constructor is declared private to forbid copying
64   AdvApprox_EvaluatorFunction (const AdvApprox_EvaluatorFunction&) {}
65
66   //! Assignment operator is declared private to forbid copying
67   void operator = (const AdvApprox_EvaluatorFunction&) {}
68 };
69
70 #endif