Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Copyright (c) 2014-2014 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _GCPnts_DistFunction_HeaderFile
0015 #define _GCPnts_DistFunction_HeaderFile
0016 
0017 #include <math_Function.hxx>
0018 #include <math_MultipleVarFunction.hxx>
0019 #include <Adaptor3d_Curve.hxx>
0020 
0021 
0022 //! Class to define function, which calculates square distance between point on curve
0023 //! C(u), U1 <= u <= U2 and line passing through points C(U1) and C(U2)
0024 //! This function is used in any minimization algorithm to define maximal deviation between curve and line,
0025 //! which required one variable function without derivative (for ex. math_BrentMinimum)
0026 class GCPnts_DistFunction : public math_Function
0027 {
0028 public:
0029   Standard_EXPORT GCPnts_DistFunction(const Adaptor3d_Curve& theCurve,
0030                                       const Standard_Real U1, const Standard_Real U2);
0031   //
0032   Standard_EXPORT GCPnts_DistFunction(const GCPnts_DistFunction& theOther);
0033 
0034   Standard_EXPORT virtual Standard_Boolean Value (const Standard_Real X,
0035                                                         Standard_Real& F);
0036 private:
0037   GCPnts_DistFunction & operator = (const GCPnts_DistFunction & theOther);
0038 
0039   const Adaptor3d_Curve& myCurve;
0040   gp_Lin myLin;
0041   Standard_Real myU1;
0042   Standard_Real myU2;
0043 };
0044 //
0045 //! The same as class GCPnts_DistFunction, but it can be used in minimization algorithms that
0046 //! requires multi variable function
0047 class GCPnts_DistFunctionMV : public math_MultipleVarFunction
0048 {
0049 public:
0050   Standard_EXPORT GCPnts_DistFunctionMV(GCPnts_DistFunction& theCurvLinDist);
0051 
0052   Standard_EXPORT virtual Standard_Boolean Value (const math_Vector& X,
0053                                                         Standard_Real& F);
0054 
0055   Standard_EXPORT virtual Standard_Integer NbVariables() const;
0056 
0057 private:
0058   GCPnts_DistFunctionMV & operator = (const GCPnts_DistFunctionMV & theOther);
0059   GCPnts_DistFunction& myMaxCurvLinDist;
0060 };
0061 
0062 //
0063 
0064 
0065 #endif // _GCPnts_DistFunction_HeaderFile