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
6 // This file is part of Open CASCADE Technology software library.
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
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Standard_Integer_HeaderFile
18 #include <Standard_Integer.hxx>
20 #ifndef _Standard_Real_HeaderFile
21 #include <Standard_Real.hxx>
23 #ifndef _Standard_PrimitiveTypes_HeaderFile
24 #include <Standard_PrimitiveTypes.hxx>
26 #ifndef _AdvApprox_EvaluatorFunction_HeaderFile
27 #define _AdvApprox_EvaluatorFunction_HeaderFile
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
32 //! Interface for a class implementing a function to be approximated
33 //! by AdvApprox_ApproxAFunction
34 class AdvApprox_EvaluatorFunction
39 AdvApprox_EvaluatorFunction () {}
41 //! Destructor should be declared as virtual
42 virtual ~AdvApprox_EvaluatorFunction () {}
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;
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); }
63 //! Copy constructor is declared private to forbid copying
64 AdvApprox_EvaluatorFunction (const AdvApprox_EvaluatorFunction&) {}
66 //! Assignment operator is declared private to forbid copying
67 void operator = (const AdvApprox_EvaluatorFunction&) {}