Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-02 10:24:47

0001 
0002 // Copyright (c) 2020 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement
0014 
0015 #ifndef _Extrema_GlobOptFuncConicS_HeaderFile
0016 #define _Extrema_GlobOptFuncConicS_HeaderFile
0017 
0018 #include <Adaptor3d_Surface.hxx>
0019 #include <math_MultipleVarFunction.hxx>
0020 #include <GeomAbs_CurveType.hxx>
0021 #include <gp_Lin.hxx>
0022 #include <gp_Circ.hxx>
0023 #include <gp_Elips.hxx>
0024 #include <gp_Hypr.hxx>
0025 #include <gp_Parab.hxx>
0026 
0027 //! This class implements function which calculate square Eucluidean distance
0028 //! between point on surface and nearest point on Conic.
0029 class Extrema_GlobOptFuncConicS : public math_MultipleVarFunction
0030 {
0031 public:
0032   //! Curve and surface should exist during all the lifetime of Extrema_GlobOptFuncConicS.
0033   Standard_EXPORT Extrema_GlobOptFuncConicS(const Adaptor3d_Curve* C, const Adaptor3d_Surface* S);
0034 
0035   Standard_EXPORT Extrema_GlobOptFuncConicS(const Adaptor3d_Surface* S);
0036 
0037   Standard_EXPORT Extrema_GlobOptFuncConicS(const Adaptor3d_Surface* S,
0038                                             const double             theUf,
0039                                             const double             theUl,
0040                                             const double             theVf,
0041                                             const double             theVl);
0042 
0043   Standard_EXPORT void LoadConic(const Adaptor3d_Curve* S, const double theTf, const double theTl);
0044 
0045   Standard_EXPORT int NbVariables() const override;
0046 
0047   Standard_EXPORT bool Value(const math_Vector& theX, double& theF) override;
0048 
0049   //! Parameter of conic for point on surface defined by theUV
0050   Standard_EXPORT double ConicParameter(const math_Vector& theUV) const;
0051 
0052 private:
0053   bool checkInputData(const math_Vector& X, double& su, double& sv);
0054 
0055   void value(double su, double sv, double& F);
0056 
0057   const Adaptor3d_Curve*   myC;
0058   const Adaptor3d_Surface* myS;
0059   GeomAbs_CurveType        myCType;
0060   gp_Lin                   myLin;
0061   gp_Circ                  myCirc;
0062   gp_Elips                 myElips;
0063   gp_Hypr                  myHypr;
0064   gp_Parab                 myParab;
0065   gp_Pnt                   myCPf;
0066   gp_Pnt                   myCPl;
0067   // Boundaries
0068   double myTf;
0069   double myTl;
0070   double myUf;
0071   double myUl;
0072   double myVf;
0073   double myVl;
0074 };
0075 
0076 #endif