1 // Copyright (c) 2014-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #ifndef _GCPnts_DistFunction_HeaderFile
15 #define _GCPnts_DistFunction_HeaderFile
18 #include <math_Function.hxx>
19 #include <math_MultipleVarFunction.hxx>
20 #include <Adaptor3d_Curve.hxx>
24 //! Class to define function, which calculates square distance between point on curve
25 //! C(u), U1 <= u <= U2 and line passing through points C(U1) and C(U2)
26 //! This function is used in any minimisation algorithm to define maximal deviation between curve and line,
27 //! which required one variable function without derivative (for ex. math_BrentMinimum)
28 class GCPnts_DistFunction : public math_Function
31 Standard_EXPORT GCPnts_DistFunction(const Adaptor3d_Curve& theCurve,
32 const Standard_Real U1, const Standard_Real U2);
34 Standard_EXPORT GCPnts_DistFunction(const GCPnts_DistFunction& theOther);
36 Standard_EXPORT virtual Standard_Boolean Value (const Standard_Real X,
39 GCPnts_DistFunction & operator = (const GCPnts_DistFunction & theOther);
41 const Adaptor3d_Curve& myCurve;
47 //! The same as class GCPnts_DistFunction, but it can be used in minimization algorithms that
48 //! requires multi variable function
49 class GCPnts_DistFunctionMV : public math_MultipleVarFunction
52 Standard_EXPORT GCPnts_DistFunctionMV(GCPnts_DistFunction& theCurvLinDist);
54 Standard_EXPORT virtual Standard_Boolean Value (const math_Vector& X,
57 Standard_EXPORT virtual Standard_Integer NbVariables() const;
60 GCPnts_DistFunctionMV & operator = (const GCPnts_DistFunctionMV & theOther);
61 GCPnts_DistFunction& myMaxCurvLinDist;
67 #endif // _GCPnts_DistFunction_HeaderFile