0022048: Visualization, AIS_InteractiveContext - single object selection should alway...
[occt.git] / src / BSplSLib / BSplSLib_EvaluatorFunction.hxx
CommitLineData
b311480e 1// Created on: 1997-05-12
2// Created by: Xavier BENVENISTE
3// Copyright (c) 1997-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 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
973c2be1 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
7fd59977 17#ifndef _BSplSLib_EvaluatorFunction_HeaderFile
18#define _BSplSLib_EvaluatorFunction_HeaderFile
19
7fd59977 20#ifndef _Standard_Integer_HeaderFile
21#include <Standard_Integer.hxx>
22#endif
23#ifndef _Standard_Real_HeaderFile
24#include <Standard_Real.hxx>
25#endif
26#ifndef _Standard_PrimitiveTypes_HeaderFile
27#include <Standard_PrimitiveTypes.hxx>
28#endif
7fd59977 29
41194117
K
30// Histroy - C function pointer converted to a virtual class
31// in order to get rid of usage of static functions and static data
32class BSplSLib_EvaluatorFunction
33{
34public:
35
36 //! Empty constructor
37 BSplSLib_EvaluatorFunction () {}
38
39 //! Destructor should be declared as virtual
40 virtual ~BSplSLib_EvaluatorFunction () {}
41
42 //! Function evaluation method to be defined by descendant
43 virtual void Evaluate (const Standard_Integer theDerivativeRequest,
44 const Standard_Real theUParameter,
45 const Standard_Real theVParameter,
46 Standard_Real& theResult,
47 Standard_Integer& theErrorCode) const = 0;
48
49 //! Shortcut for function-call style usage
50 void operator () (const Standard_Integer theDerivativeRequest,
51 const Standard_Real theUParameter,
52 const Standard_Real theVParameter,
53 Standard_Real& theResult,
54 Standard_Integer& theErrorCode) const
55 {
56 Evaluate (theDerivativeRequest, theUParameter, theVParameter, theResult, theErrorCode);
57 }
58
59private:
60
61 //! Copy constructor is declared private to forbid copying
62 BSplSLib_EvaluatorFunction (const BSplSLib_EvaluatorFunction&) {}
63
64 //! Assignment operator is declared private to forbid copying
65 void operator = (const BSplSLib_EvaluatorFunction&) {}
66};
7fd59977 67
68#endif