Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-14 09:14:05

0001 // Created on: 1997-05-12
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 _BSplSLib_EvaluatorFunction_HeaderFile
0018 #define _BSplSLib_EvaluatorFunction_HeaderFile
0019 
0020 #ifndef _Standard_Integer_HeaderFile
0021   #include <Standard_Integer.hxx>
0022 #endif
0023 #ifndef _Standard_Real_HeaderFile
0024   #include <Standard_Real.hxx>
0025 #endif
0026 #ifndef _Standard_PrimitiveTypes_HeaderFile
0027 #endif
0028 
0029 // History - C function pointer converted to a virtual class
0030 // in order to get rid of usage of static functions and static data
0031 class BSplSLib_EvaluatorFunction
0032 {
0033 public:
0034   //! Empty constructor
0035   BSplSLib_EvaluatorFunction() = default;
0036 
0037   //! Destructor should be declared as virtual
0038   virtual ~BSplSLib_EvaluatorFunction() = default;
0039 
0040   //! Function evaluation method to be defined by descendant
0041   virtual void Evaluate(const int    theDerivativeRequest,
0042                         const double theUParameter,
0043                         const double theVParameter,
0044                         double&      theResult,
0045                         int&         theErrorCode) const = 0;
0046 
0047   //! Shortcut for function-call style usage
0048   void operator()(const int    theDerivativeRequest,
0049                   const double theUParameter,
0050                   const double theVParameter,
0051                   double&      theResult,
0052                   int&         theErrorCode) const
0053   {
0054     Evaluate(theDerivativeRequest, theUParameter, theVParameter, theResult, theErrorCode);
0055   }
0056 
0057 private:
0058   //! Copy constructor is declared private to forbid copying
0059   BSplSLib_EvaluatorFunction(const BSplSLib_EvaluatorFunction&) = default;
0060 
0061   //! Assignment operator is declared private to forbid copying
0062   void operator=(const BSplSLib_EvaluatorFunction&) {}
0063 };
0064 
0065 #endif