1 // Created on: 1997-03-03
2 // Created by: Xavier BENVENISTE
3 // Copyright (c) 1997-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 _BSplCLib_EvaluatorFunction_HeaderFile
18 #define _BSplCLib_EvaluatorFunction_HeaderFile
20 #include <Standard_TypeDef.hxx>
22 // This is a one dimensional function
24 // Serves to multiply a given vectorial BSpline by a function
26 // History - C function pointer converted to a virtual class
27 // in order to get rid of usage of static functions and static data
28 class BSplCLib_EvaluatorFunction
33 BSplCLib_EvaluatorFunction () {}
35 //! Destructor should be declared as virtual
36 virtual ~BSplCLib_EvaluatorFunction () {}
38 //! Function evaluation method to be defined by descendant
39 virtual void Evaluate (const Standard_Integer theDerivativeRequest,
40 const Standard_Real* theStartEnd,
41 const Standard_Real theParameter,
42 Standard_Real& theResult,
43 Standard_Integer& theErrorCode) const = 0;
45 //! Shortcut for function-call style usage
46 void operator () (const Standard_Integer theDerivativeRequest,
47 const Standard_Real* theStartEnd,
48 const Standard_Real theParameter,
49 Standard_Real& theResult,
50 Standard_Integer& theErrorCode) const
52 Evaluate (theDerivativeRequest, theStartEnd, theParameter, theResult, theErrorCode);
57 //! Copy constructor is declared private to forbid copying
58 BSplCLib_EvaluatorFunction (const BSplCLib_EvaluatorFunction&) {}
60 //! Assignment operator is declared private to forbid copying
61 void operator = (const BSplCLib_EvaluatorFunction&) {}