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