1 // Created on: 1993-06-03
2 // Created by: Jacques GOUSSARD
3 // Copyright (c) 1993-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 _Contap_SurfFunction_HeaderFile
18 #define _Contap_SurfFunction_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Real.hxx>
25 #include <Contap_TFunction.hxx>
28 #include <gp_Dir2d.hxx>
30 #include <Standard_Boolean.hxx>
31 #include <math_FunctionSetWithDerivatives.hxx>
32 #include <Standard_Integer.hxx>
33 #include <math_Vector.hxx>
34 class Adaptor3d_HSurface;
35 class StdFail_UndefinedDerivative;
43 //! This class describes the function on a parametric surface.
44 //! the form of the function is F(u,v) = 0 where u and v are
45 //! the parameteric coordinates of a point on the surface,
46 //! to compute the contours of the surface.
47 class Contap_SurfFunction : public math_FunctionSetWithDerivatives
54 Standard_EXPORT Contap_SurfFunction();
56 Standard_EXPORT void Set (const Handle(Adaptor3d_HSurface)& S);
58 void Set (const gp_Pnt& Eye);
60 void Set (const gp_Dir& Dir);
62 void Set (const gp_Dir& Dir, const Standard_Real Angle);
64 void Set (const gp_Pnt& Eye, const Standard_Real Angle);
66 void Set (const Standard_Real Tolerance);
68 //! This method has to return 2.
69 Standard_EXPORT Standard_Integer NbVariables() const;
71 //! This method has to return 1.
72 Standard_EXPORT Standard_Integer NbEquations() const;
74 //! The dimension of F is 1.
75 Standard_EXPORT Standard_Boolean Value (const math_Vector& X, math_Vector& F);
77 //! The dimension of D is (1,2).
78 Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D);
80 Standard_EXPORT Standard_Boolean Values (const math_Vector& X, math_Vector& F, math_Matrix& D);
82 //! Root is the value of the function at the solution.
83 //! It is a vector of dimension 1, i-e a real.
84 Standard_Real Root() const;
86 //! Returns the value Tol so that if Abs(Func.Root())<Tol
87 //! the function is considered null.
88 Standard_Real Tolerance() const;
90 //! Returns the value of the solution point on the surface.
91 const gp_Pnt& Point() const;
93 Standard_EXPORT Standard_Boolean IsTangent();
95 const gp_Vec& Direction3d();
97 const gp_Dir2d& Direction2d();
99 Contap_TFunction FunctionType() const;
101 const gp_Pnt& Eye() const;
103 const gp_Dir& Direction() const;
105 Standard_Real Angle() const;
107 const Handle(Adaptor3d_HSurface)& Surface() const;
122 Handle(Adaptor3d_HSurface) mySurf;
123 Standard_Real myMean;
124 Contap_TFunction myType;
128 Standard_Real myCosAng;
138 Standard_Boolean tangent;
139 Standard_Boolean computed;
140 Standard_Boolean derived;
146 #include <Contap_SurfFunction.lxx>
152 #endif // _Contap_SurfFunction_HeaderFile