]> OCCT Git - occt.git/blob
20cd8e1cd379e3c0fe27ebde3723253596f47c96
[occt.git] /
1 // Created on: 1995-06-06
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox_HeaderFile
18 #define _BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22
23 #include <gp_Pnt.hxx>
24 #include <gp_Vec.hxx>
25 #include <gp_Dir2d.hxx>
26 #include <math_FunctionSetWithDerivatives.hxx>
27 #include <math_Vector.hxx>
28 class StdFail_UndefinedDerivative;
29 class BRepAdaptor_Surface;
30 class BRepApprox_SurfaceTool;
31 class IntSurf_Quadric;
32 class IntSurf_QuadricTool;
33 class math_Matrix;
34 class gp_Pnt;
35 class gp_Vec;
36 class gp_Dir2d;
37
38 class BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox : public math_FunctionSetWithDerivatives
39 {
40 public:
41   DEFINE_STANDARD_ALLOC
42
43   Standard_EXPORT BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox();
44
45   Standard_EXPORT BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox(
46     const BRepAdaptor_Surface& PS,
47     const IntSurf_Quadric&     IS);
48
49   Standard_EXPORT BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox(const IntSurf_Quadric& IS);
50
51   void Set(const BRepAdaptor_Surface& PS);
52
53   void SetImplicitSurface(const IntSurf_Quadric& IS);
54
55   void Set(const Standard_Real Tolerance);
56
57   Standard_EXPORT Standard_Integer NbVariables() const;
58
59   Standard_EXPORT Standard_Integer NbEquations() const;
60
61   Standard_EXPORT Standard_Boolean Value(const math_Vector& X, math_Vector& F);
62
63   Standard_EXPORT Standard_Boolean Derivatives(const math_Vector& X, math_Matrix& D);
64
65   Standard_EXPORT Standard_Boolean Values(const math_Vector& X, math_Vector& F, math_Matrix& D);
66
67   Standard_Real Root() const;
68
69   //! Returns the value Tol so that if Abs(Func.Root())<Tol
70   //! the function is considered null.
71   Standard_Real Tolerance() const;
72
73   const gp_Pnt& Point() const;
74
75   Standard_EXPORT Standard_Boolean IsTangent();
76
77   const gp_Vec& Direction3d();
78
79   const gp_Dir2d& Direction2d();
80
81   const BRepAdaptor_Surface& PSurface() const;
82
83   const IntSurf_Quadric& ISurface() const;
84
85 protected:
86 private:
87   Standard_Address surf;
88   Standard_Address func;
89   Standard_Real    u;
90   Standard_Real    v;
91   Standard_Real    tol;
92   gp_Pnt           pntsol;
93   Standard_Real    valf;
94   Standard_Boolean computed;
95   Standard_Boolean tangent;
96   Standard_Real    tgdu;
97   Standard_Real    tgdv;
98   gp_Vec           gradient;
99   Standard_Boolean derived;
100   gp_Vec           d1u;
101   gp_Vec           d1v;
102   gp_Vec           d3d;
103   gp_Dir2d         d2d;
104 };
105
106 #define ThePSurface BRepAdaptor_Surface
107 #define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
108 #define ThePSurfaceTool BRepApprox_SurfaceTool
109 #define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>
110 #define TheISurface IntSurf_Quadric
111 #define TheISurface_hxx <IntSurf_Quadric.hxx>
112 #define TheISurfaceTool IntSurf_QuadricTool
113 #define TheISurfaceTool_hxx <IntSurf_QuadricTool.hxx>
114 #define IntImp_ZerImpFunc BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox
115 #define IntImp_ZerImpFunc_hxx <BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox.hxx>
116
117 #include <IntImp_ZerImpFunc.lxx>
118
119 #undef ThePSurface
120 #undef ThePSurface_hxx
121 #undef ThePSurfaceTool
122 #undef ThePSurfaceTool_hxx
123 #undef TheISurface
124 #undef TheISurface_hxx
125 #undef TheISurfaceTool
126 #undef TheISurfaceTool_hxx
127 #undef IntImp_ZerImpFunc
128 #undef IntImp_ZerImpFunc_hxx
129
130 #endif // _BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox_HeaderFile