0032806: Coding - get rid of unused headers [Contap to Extrema]
[occt.git] / src / Extrema / Extrema_GlobOptFuncCQuadric.hxx
1 // Copyright (c) 2020 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
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.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement
13
14 #ifndef _Extrema_GlobOptFuncCQuadric_HeaderFile
15 #define _Extrema_GlobOptFuncCQuadric_HeaderFile
16
17
18 #include <Adaptor3d_Surface.hxx>
19 #include <math_MultipleVarFunction.hxx>
20 #include <GeomAbs_SurfaceType.hxx>
21 #include <gp_Pln.hxx>
22 #include <gp_Cylinder.hxx>
23 #include <gp_Cone.hxx>
24 #include <gp_Sphere.hxx>
25 #include <gp_Torus.hxx>
26
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
30 {
31 public:
32
33   //! Curve and surface should exist during all the lifetime of Extrema_GlobOptFuncCQuadric.
34   Standard_EXPORT  Extrema_GlobOptFuncCQuadric(const Adaptor3d_Curve *C);
35
36   Standard_EXPORT  Extrema_GlobOptFuncCQuadric(const Adaptor3d_Curve *C, 
37                                                const Standard_Real   theTf, 
38                                                const Standard_Real   theTl);
39
40   Standard_EXPORT  Extrema_GlobOptFuncCQuadric(const Adaptor3d_Curve   *C,
41                                                const Adaptor3d_Surface *S);
42
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);
48
49   Standard_EXPORT virtual Standard_Integer NbVariables() const;
50
51   Standard_EXPORT virtual Standard_Boolean Value(const math_Vector &theX,
52                                                  Standard_Real     &theF);
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;
56
57 private:
58
59   Standard_Boolean checkInputData(const math_Vector   &X,
60                                   Standard_Real       &ct);
61
62   void value(Standard_Real ct,
63              Standard_Real &F);
64
65
66   const Adaptor3d_Curve   *myC;
67   const Adaptor3d_Surface *myS;
68   GeomAbs_SurfaceType mySType;
69   gp_Pln myPln;
70   gp_Cone myCone;
71   gp_Cylinder myCylinder;
72   gp_Sphere mySphere;
73   gp_Torus myTorus;
74   gp_Pnt myPTrim[4];
75   // Boundaries
76   Standard_Real myTf;
77   Standard_Real myTl;
78   Standard_Real myUf;
79   Standard_Real myUl;
80   Standard_Real myVf;
81   Standard_Real myVl;
82
83 };
84
85 #endif