Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-05 09:21:43

0001 // Created on: 1997-03-03
0002 // Created by: Xavier BENVENISTE
0003 // Copyright (c) 1997-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _BSplCLib_EvaluatorFunction_HeaderFile
0018 #define _BSplCLib_EvaluatorFunction_HeaderFile
0019 
0020 #include <Standard_TypeDef.hxx>
0021 
0022 // This is a one dimensional function
0023 // NOTE: StartEnd[2]
0024 // Serves to multiply a given vectorial BSpline by a function
0025 
0026 // History - C function pointer converted to a virtual class
0027 // in order to get rid of usage of static functions and static data
0028 class BSplCLib_EvaluatorFunction
0029 {
0030 public:
0031   //! Empty constructor
0032   BSplCLib_EvaluatorFunction() = default;
0033 
0034   //! Destructor should be declared as virtual
0035   virtual ~BSplCLib_EvaluatorFunction() = default;
0036 
0037   //! Function evaluation method to be defined by descendant
0038   virtual void Evaluate(const int     theDerivativeRequest,
0039                         const double* theStartEnd,
0040                         const double  theParameter,
0041                         double&       theResult,
0042                         int&          theErrorCode) const = 0;
0043 
0044   //! Shortcut for function-call style usage
0045   void operator()(const int     theDerivativeRequest,
0046                   const double* theStartEnd,
0047                   const double  theParameter,
0048                   double&       theResult,
0049                   int&          theErrorCode) const
0050   {
0051     Evaluate(theDerivativeRequest, theStartEnd, theParameter, theResult, theErrorCode);
0052   }
0053 
0054   // copying is prohibited
0055   BSplCLib_EvaluatorFunction(const BSplCLib_EvaluatorFunction&)            = delete;
0056   BSplCLib_EvaluatorFunction& operator=(const BSplCLib_EvaluatorFunction&) = delete;
0057 };
0058 
0059 #endif