Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-17 09:20:17

0001 // Created on: 2014-01-20
0002 // Created by: Alexaner Malyshev
0003 // Copyright (c) 2014-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement
0015 
0016 #ifndef _Extrema_GlobOptFuncCC_HeaderFile
0017 #define _Extrema_GlobOptFuncCC_HeaderFile
0018 
0019 #include <Adaptor2d_Curve2d.hxx>
0020 #include <Adaptor3d_Curve.hxx>
0021 #include <math_Matrix.hxx>
0022 #include <math_Vector.hxx>
0023 #include <math_MultipleVarFunctionWithHessian.hxx>
0024 
0025 //! This class implements function which calculate Eucluidean distance
0026 //! between point on curve and point on other curve in case of C1 and C2 continuity is C0.
0027 class Extrema_GlobOptFuncCCC0 : public math_MultipleVarFunction
0028 {
0029 public:
0030   Standard_EXPORT Extrema_GlobOptFuncCCC0(const Adaptor3d_Curve& C1, const Adaptor3d_Curve& C2);
0031 
0032   Standard_EXPORT Extrema_GlobOptFuncCCC0(const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2);
0033 
0034   Standard_EXPORT int NbVariables() const override;
0035 
0036   Standard_EXPORT bool Value(const math_Vector& X, double& F) override;
0037 
0038 private:
0039   Extrema_GlobOptFuncCCC0& operator=(const Extrema_GlobOptFuncCCC0& theOther) = delete;
0040 
0041   const Adaptor3d_Curve *  myC1_3d, *myC2_3d;
0042   const Adaptor2d_Curve2d *myC1_2d, *myC2_2d;
0043   int                      myType;
0044 };
0045 
0046 //! This class implements function which calculate Eucluidean distance
0047 //! between point on curve and point on other curve in case of C1 and C2 continuity is C1.
0048 class Extrema_GlobOptFuncCCC1 : public math_MultipleVarFunctionWithGradient
0049 {
0050 public:
0051   Standard_EXPORT Extrema_GlobOptFuncCCC1(const Adaptor3d_Curve& C1, const Adaptor3d_Curve& C2);
0052 
0053   Standard_EXPORT Extrema_GlobOptFuncCCC1(const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2);
0054 
0055   Standard_EXPORT int NbVariables() const override;
0056 
0057   Standard_EXPORT bool Value(const math_Vector& X, double& F) override;
0058 
0059   Standard_EXPORT bool Gradient(const math_Vector& X, math_Vector& G) override;
0060 
0061   Standard_EXPORT bool Values(const math_Vector& X, double& F, math_Vector& G) override;
0062 
0063 private:
0064   Extrema_GlobOptFuncCCC1& operator=(const Extrema_GlobOptFuncCCC1& theOther) = delete;
0065 
0066   const Adaptor3d_Curve *  myC1_3d, *myC2_3d;
0067   const Adaptor2d_Curve2d *myC1_2d, *myC2_2d;
0068   int                      myType;
0069 };
0070 
0071 //! This class implements function which calculate Eucluidean distance
0072 //! between point on curve and point on other curve in case of C1 and C2 continuity is C2.
0073 class Extrema_GlobOptFuncCCC2 : public math_MultipleVarFunctionWithHessian
0074 {
0075 public:
0076   Standard_EXPORT Extrema_GlobOptFuncCCC2(const Adaptor3d_Curve& C1, const Adaptor3d_Curve& C2);
0077 
0078   Standard_EXPORT Extrema_GlobOptFuncCCC2(const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2);
0079 
0080   Standard_EXPORT int NbVariables() const override;
0081 
0082   Standard_EXPORT bool Value(const math_Vector& X, double& F) override;
0083 
0084   Standard_EXPORT bool Gradient(const math_Vector& X, math_Vector& G) override;
0085 
0086   Standard_EXPORT bool Values(const math_Vector& X, double& F, math_Vector& G) override;
0087 
0088   Standard_EXPORT bool Values(const math_Vector& X,
0089                               double&            F,
0090                               math_Vector&       G,
0091                               math_Matrix&       H) override;
0092 
0093 private:
0094   Extrema_GlobOptFuncCCC2& operator=(const Extrema_GlobOptFuncCCC2& theOther) = delete;
0095 
0096   const Adaptor3d_Curve *  myC1_3d, *myC2_3d;
0097   const Adaptor2d_Curve2d *myC1_2d, *myC2_2d;
0098   int                      myType;
0099 };
0100 
0101 #endif