Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-06 08:46:12

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 Standard_Real      theUf,
0039                                             const Standard_Real      theUl,
0040                                             const Standard_Real      theVf,
0041                                             const Standard_Real      theVl);
0042 
0043   Standard_EXPORT void LoadConic(const Adaptor3d_Curve* S,
0044                                  const Standard_Real    theTf,
0045                                  const Standard_Real    theTl);
0046 
0047   Standard_EXPORT virtual Standard_Integer NbVariables() const;
0048 
0049   Standard_EXPORT virtual Standard_Boolean Value(const math_Vector& theX, Standard_Real& theF);
0050 
0051   //! Parameter of conic for point on surface defined by theUV
0052   Standard_EXPORT Standard_Real ConicParameter(const math_Vector& theUV) const;
0053 
0054 private:
0055   Standard_Boolean checkInputData(const math_Vector& X, Standard_Real& su, Standard_Real& sv);
0056 
0057   void value(Standard_Real su, Standard_Real sv, Standard_Real& F);
0058 
0059   const Adaptor3d_Curve*   myC;
0060   const Adaptor3d_Surface* myS;
0061   GeomAbs_CurveType        myCType;
0062   gp_Lin                   myLin;
0063   gp_Circ                  myCirc;
0064   gp_Elips                 myElips;
0065   gp_Hypr                  myHypr;
0066   gp_Parab                 myParab;
0067   gp_Pnt                   myCPf;
0068   gp_Pnt                   myCPl;
0069   // Boundaries
0070   Standard_Real myTf;
0071   Standard_Real myTl;
0072   Standard_Real myUf;
0073   Standard_Real myUl;
0074   Standard_Real myVf;
0075   Standard_Real myVl;
0076 };
0077 
0078 #endif