b311480e |
1 | // Created on: 1995-05-29 |
2 | // Created by: Xavier BENVENISTE |
3 | // Copyright (c) 1995-1999 Matra Datavision |
4 | // Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | // |
6 | // The content of this file is subject to the Open CASCADE Technology Public |
7 | // License Version 6.5 (the "License"). You may not use the content of this file |
8 | // except in compliance with the License. Please obtain a copy of the License |
9 | // at http://www.opencascade.org and read it completely before using this file. |
10 | // |
11 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | // |
14 | // The Original Code and all software distributed under the License is |
15 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | // Initial Developer hereby disclaims all such warranties, including without |
17 | // limitation, any warranties of merchantability, fitness for a particular |
18 | // purpose or non-infringement. Please see the License for the specific terms |
19 | // and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | #ifndef _Standard_Integer_HeaderFile |
23 | #include <Standard_Integer.hxx> |
24 | #endif |
25 | #ifndef _Standard_Real_HeaderFile |
26 | #include <Standard_Real.hxx> |
27 | #endif |
28 | #ifndef _Standard_PrimitiveTypes_HeaderFile |
29 | #include <Standard_PrimitiveTypes.hxx> |
30 | #endif |
31 | #ifndef _AdvApprox_EvaluatorFunction_HeaderFile |
32 | #define _AdvApprox_EvaluatorFunction_HeaderFile |
33 | |
34 | // abv 01.04.2009: the C function pointer converted to a virtual class |
35 | // in order to get rid of usage of static functions and static data |
36 | |
37 | //! Interface for a class implementing a function to be approximated |
38 | //! by AdvApprox_ApproxAFunction |
39 | class AdvApprox_EvaluatorFunction |
40 | { |
41 | public: |
42 | |
43 | //! Empty constructor |
44 | AdvApprox_EvaluatorFunction () {} |
45 | |
46 | //! Destructor should be declared as virtual |
47 | virtual ~AdvApprox_EvaluatorFunction () {} |
48 | |
49 | //! Function evaluation method to be defined by descendant |
50 | virtual void Evaluate (Standard_Integer *Dimension, |
51 | Standard_Real StartEnd[2], |
52 | Standard_Real *Parameter, |
53 | Standard_Integer *DerivativeRequest, |
54 | Standard_Real *Result, // [Dimension] |
55 | Standard_Integer *ErrorCode) = 0; |
56 | |
57 | //! Shortcut for function-call style usage |
58 | void operator () (Standard_Integer *Dimension, |
59 | Standard_Real StartEnd[2], |
60 | Standard_Real *Parameter, |
61 | Standard_Integer *DerivativeRequest, |
62 | Standard_Real *Result, // [Dimension] |
63 | Standard_Integer *ErrorCode) |
64 | { Evaluate (Dimension, StartEnd, Parameter, DerivativeRequest, Result, ErrorCode); } |
65 | |
66 | private: |
67 | |
68 | //! Copy constructor is declared private to forbid copying |
69 | AdvApprox_EvaluatorFunction (const AdvApprox_EvaluatorFunction&) {} |
70 | |
71 | //! Assignment operator is declared private to forbid copying |
72 | void operator = (const AdvApprox_EvaluatorFunction&) {} |
73 | }; |
74 | |
75 | #endif |