1 // Created on: 1992-05-06
2 // Created by: Jacques GOUSSARD
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _IntPatch_TheSurfFunction_HeaderFile
18 #define _IntPatch_TheSurfFunction_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Address.hxx>
25 #include <Standard_Real.hxx>
27 #include <Standard_Boolean.hxx>
29 #include <gp_Dir2d.hxx>
30 #include <math_FunctionSetWithDerivatives.hxx>
31 #include <Standard_Integer.hxx>
32 #include <math_Vector.hxx>
33 class StdFail_UndefinedDerivative;
34 class Adaptor3d_HSurface;
35 class Adaptor3d_HSurfaceTool;
36 class IntSurf_Quadric;
37 class IntSurf_QuadricTool;
45 class IntPatch_TheSurfFunction : public math_FunctionSetWithDerivatives
52 Standard_EXPORT IntPatch_TheSurfFunction();
54 Standard_EXPORT IntPatch_TheSurfFunction(const Handle(Adaptor3d_HSurface)& PS, const IntSurf_Quadric& IS);
56 Standard_EXPORT IntPatch_TheSurfFunction(const IntSurf_Quadric& IS);
58 void Set (const Handle(Adaptor3d_HSurface)& PS);
60 void SetImplicitSurface (const IntSurf_Quadric& IS);
62 void Set (const Standard_Real Tolerance);
64 Standard_EXPORT Standard_Integer NbVariables() const;
66 Standard_EXPORT Standard_Integer NbEquations() const;
68 Standard_EXPORT Standard_Boolean Value (const math_Vector& X, math_Vector& F);
70 Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D);
72 Standard_EXPORT Standard_Boolean Values (const math_Vector& X, math_Vector& F, math_Matrix& D);
74 Standard_Real Root() const;
76 //! Returns the value Tol so that if Abs(Func.Root())<Tol
77 //! the function is considered null.
78 Standard_Real Tolerance() const;
80 const gp_Pnt& Point() const;
82 Standard_EXPORT Standard_Boolean IsTangent();
84 const gp_Vec& Direction3d();
86 const gp_Dir2d& Direction2d();
88 const Handle(Adaptor3d_HSurface)& PSurface() const;
90 const IntSurf_Quadric& ISurface() const;
105 Standard_Address surf;
106 Standard_Address func;
112 Standard_Boolean computed;
113 Standard_Boolean tangent;
117 Standard_Boolean derived;
126 #define ThePSurface Handle(Adaptor3d_HSurface)
127 #define ThePSurface_hxx <Adaptor3d_HSurface.hxx>
128 #define ThePSurfaceTool Adaptor3d_HSurfaceTool
129 #define ThePSurfaceTool_hxx <Adaptor3d_HSurfaceTool.hxx>
130 #define TheISurface IntSurf_Quadric
131 #define TheISurface_hxx <IntSurf_Quadric.hxx>
132 #define TheISurfaceTool IntSurf_QuadricTool
133 #define TheISurfaceTool_hxx <IntSurf_QuadricTool.hxx>
134 #define IntImp_ZerImpFunc IntPatch_TheSurfFunction
135 #define IntImp_ZerImpFunc_hxx <IntPatch_TheSurfFunction.hxx>
137 #include <IntImp_ZerImpFunc.lxx>
140 #undef ThePSurface_hxx
141 #undef ThePSurfaceTool
142 #undef ThePSurfaceTool_hxx
144 #undef TheISurface_hxx
145 #undef TheISurfaceTool
146 #undef TheISurfaceTool_hxx
147 #undef IntImp_ZerImpFunc
148 #undef IntImp_ZerImpFunc_hxx
153 #endif // _IntPatch_TheSurfFunction_HeaderFile