Back to home page

EIC code displayed by LXR

 
 

    


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

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 
0019 #include <Adaptor3d_Surface.hxx>
0020 #include <math_MultipleVarFunction.hxx>
0021 #include <GeomAbs_CurveType.hxx>
0022 #include <gp_Lin.hxx>
0023 #include <gp_Circ.hxx>
0024 #include <gp_Elips.hxx>
0025 #include <gp_Hypr.hxx>
0026 #include <gp_Parab.hxx>
0027 
0028 //! This class implements function which calculate square Eucluidean distance
0029 //! between point on surface and nearest point on Conic.
0030 class Extrema_GlobOptFuncConicS : public math_MultipleVarFunction
0031 {
0032 public:
0033 
0034   //! Curve and surface should exist during all the lifetime of Extrema_GlobOptFuncConicS.
0035   Standard_EXPORT  Extrema_GlobOptFuncConicS(const Adaptor3d_Curve   *C,
0036                                              const Adaptor3d_Surface *S);
0037 
0038   Standard_EXPORT  Extrema_GlobOptFuncConicS(const Adaptor3d_Surface *S);
0039 
0040   Standard_EXPORT  Extrema_GlobOptFuncConicS(const Adaptor3d_Surface *S,
0041                                              const Standard_Real     theUf, 
0042                                              const Standard_Real     theUl,
0043                                              const Standard_Real     theVf, 
0044                                              const Standard_Real     theVl);
0045 
0046   Standard_EXPORT void LoadConic(const Adaptor3d_Curve *S, const Standard_Real theTf, const Standard_Real theTl);
0047 
0048   Standard_EXPORT virtual Standard_Integer NbVariables() const;
0049 
0050   Standard_EXPORT virtual Standard_Boolean Value(const math_Vector &theX,
0051                                                  Standard_Real     &theF);
0052 
0053   //! Parameter of conic for point on surface defined by theUV
0054   Standard_EXPORT Standard_Real ConicParameter(const math_Vector& theUV) const;
0055 
0056 private:
0057 
0058   Standard_Boolean checkInputData(const math_Vector   &X,
0059                                   Standard_Real       &su,
0060                                   Standard_Real       &sv);
0061 
0062   void value(Standard_Real su,
0063              Standard_Real sv,
0064              Standard_Real &F);
0065 
0066 
0067   const Adaptor3d_Curve   *myC;
0068   const Adaptor3d_Surface *myS;
0069   GeomAbs_CurveType myCType;
0070   gp_Lin myLin;
0071   gp_Circ myCirc;
0072   gp_Elips myElips;
0073   gp_Hypr myHypr;
0074   gp_Parab myParab;
0075   gp_Pnt myCPf;
0076   gp_Pnt myCPl;
0077   //Boundaries
0078   Standard_Real myTf;
0079   Standard_Real myTl;
0080   Standard_Real myUf;
0081   Standard_Real myUl;
0082   Standard_Real myVf;
0083   Standard_Real myVl;
0084 
0085 };
0086 
0087 #endif