Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:18

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 
0032   //! Empty constructor
0033   BSplCLib_EvaluatorFunction () {}
0034 
0035   //! Destructor should be declared as virtual
0036   virtual ~BSplCLib_EvaluatorFunction () {}
0037 
0038   //! Function evaluation method to be defined by descendant
0039   virtual void Evaluate (const Standard_Integer theDerivativeRequest,
0040                          const Standard_Real*   theStartEnd,
0041                          const Standard_Real    theParameter,
0042                          Standard_Real&         theResult,
0043                          Standard_Integer&      theErrorCode) const = 0;
0044 
0045   //! Shortcut for function-call style usage
0046   void operator () (const Standard_Integer theDerivativeRequest,
0047                     const Standard_Real*   theStartEnd,
0048                     const Standard_Real    theParameter,
0049                     Standard_Real&         theResult,
0050                     Standard_Integer&      theErrorCode) const
0051   {
0052     Evaluate (theDerivativeRequest, theStartEnd, theParameter, theResult, theErrorCode);
0053   }
0054 
0055 private:
0056 
0057   //! Copy constructor is declared private to forbid copying
0058   BSplCLib_EvaluatorFunction (const BSplCLib_EvaluatorFunction&) {}
0059 
0060   //! Assignment operator is declared private to forbid copying
0061   void operator = (const BSplCLib_EvaluatorFunction&) {}
0062 };
0063 
0064 #endif