1 // Copyright (c) 2020 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement
14 #ifndef _Extrema_GlobOptFuncCQuadric_HeaderFile
15 #define _Extrema_GlobOptFuncCQuadric_HeaderFile
18 #include <Adaptor3d_Surface.hxx>
19 #include <math_MultipleVarFunction.hxx>
20 #include <GeomAbs_SurfaceType.hxx>
22 #include <gp_Cylinder.hxx>
23 #include <gp_Cone.hxx>
24 #include <gp_Sphere.hxx>
25 #include <gp_Torus.hxx>
27 //! This class implements function which calculate square Eucluidean distance
28 //! between point on surface and nearest point on Conic.
29 class Extrema_GlobOptFuncCQuadric : public math_MultipleVarFunction
33 //! Curve and surface should exist during all the lifetime of Extrema_GlobOptFuncCQuadric.
34 Standard_EXPORT Extrema_GlobOptFuncCQuadric(const Adaptor3d_Curve *C);
36 Standard_EXPORT Extrema_GlobOptFuncCQuadric(const Adaptor3d_Curve *C,
37 const Standard_Real theTf,
38 const Standard_Real theTl);
40 Standard_EXPORT Extrema_GlobOptFuncCQuadric(const Adaptor3d_Curve *C,
41 const Adaptor3d_Surface *S);
43 Standard_EXPORT void LoadQuad(const Adaptor3d_Surface *S,
44 const Standard_Real theUf,
45 const Standard_Real theUl,
46 const Standard_Real theVf,
47 const Standard_Real theVl);
49 Standard_EXPORT virtual Standard_Integer NbVariables() const;
51 Standard_EXPORT virtual Standard_Boolean Value(const math_Vector &theX,
53 //! Parameters of quadric for point on curve defined by theCT
54 Standard_EXPORT void QuadricParameters(const math_Vector& theCT,
55 math_Vector& theUV) const;
59 Standard_Boolean checkInputData(const math_Vector &X,
62 void value(Standard_Real ct,
66 const Adaptor3d_Curve *myC;
67 const Adaptor3d_Surface *myS;
68 GeomAbs_SurfaceType mySType;
71 gp_Cylinder myCylinder;