Back to home page

EIC code displayed by LXR

 
 

    


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

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