42cf5bc1 |
1 | // Created on: 1996-06-04 |
2 | // Created by: Stagiaire Xuan Trang PHAMPHU |
3 | // Copyright (c) 1996-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 _BlendFunc_Corde_HeaderFile |
18 | #define _BlendFunc_Corde_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <gp_Pnt.hxx> |
25 | #include <gp_Pnt2d.hxx> |
26 | #include <Standard_Real.hxx> |
27 | #include <gp_Vec.hxx> |
28 | #include <gp_Vec2d.hxx> |
29 | #include <Standard_Boolean.hxx> |
30 | #include <math_Vector.hxx> |
31 | class Adaptor3d_HSurface; |
32 | class Adaptor3d_HCurve; |
33 | class Standard_DomainError; |
34 | class math_Matrix; |
35 | class gp_Pnt; |
36 | class gp_Vec; |
37 | class gp_Vec2d; |
38 | |
39 | |
40 | //! This function calculates point (pts) on the curve of |
41 | //! intersection between the normal to a curve (guide) |
42 | //! in a chosen parameter and a surface (surf), so |
43 | //! that pts was at a given distance from the guide. |
44 | //! X(1),X(2) are the parameters U,V of pts on surf. |
45 | class BlendFunc_Corde |
46 | { |
47 | public: |
48 | |
49 | DEFINE_STANDARD_ALLOC |
50 | |
51 | |
52 | Standard_EXPORT BlendFunc_Corde(const Handle(Adaptor3d_HSurface)& S, const Handle(Adaptor3d_HCurve)& CGuide); |
53 | |
54 | Standard_EXPORT void SetParam (const Standard_Real Param); |
55 | |
56 | Standard_EXPORT void SetDist (const Standard_Real Dist); |
57 | |
58 | //! computes the values <F> of the Function for the |
59 | //! variable <X>. |
60 | //! Returns True if the computation was done successfully, |
61 | //! False otherwise. |
62 | Standard_EXPORT Standard_Boolean Value (const math_Vector& X, math_Vector& F); |
63 | |
64 | //! returns the values <D> of the derivatives for the |
65 | //! variable <X>. |
66 | //! Returns True if the computation was done successfully, |
67 | //! False otherwise. |
68 | Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D); |
69 | |
70 | Standard_EXPORT const gp_Pnt& PointOnS() const; |
71 | |
72 | //! returns the point of parameter <Param> on CGuide |
73 | Standard_EXPORT const gp_Pnt& PointOnGuide() const; |
74 | |
75 | //! returns the normal to CGuide at Ptgui. |
76 | Standard_EXPORT const gp_Vec& NPlan() const; |
77 | |
78 | //! Returns True when it is not possible to compute |
79 | //! the tangent vectors at PointOnS. |
80 | Standard_EXPORT Standard_Boolean IsTangencyPoint() const; |
81 | |
82 | //! Returns the tangent vector at PointOnS, in 3d space. |
83 | Standard_EXPORT const gp_Vec& TangentOnS() const; |
84 | |
85 | //! Returns the tangent vector at PointOnS, in the |
86 | //! parametric space of the first surface. |
87 | Standard_EXPORT const gp_Vec2d& Tangent2dOnS() const; |
88 | |
89 | //! Derived of the function compared to the parameter |
90 | //! of the guideline |
91 | Standard_EXPORT void DerFguide (const math_Vector& Sol, gp_Vec2d& DerF); |
92 | |
93 | //! Returns False if Sol is not solution else returns |
94 | //! True and updates the fields tgs and tg2d |
95 | Standard_EXPORT Standard_Boolean IsSolution (const math_Vector& Sol, const Standard_Real Tol); |
96 | |
97 | |
98 | |
99 | |
100 | protected: |
101 | |
102 | |
103 | |
104 | |
105 | |
106 | private: |
107 | |
108 | |
109 | |
110 | Handle(Adaptor3d_HSurface) surf; |
111 | Handle(Adaptor3d_HCurve) guide; |
112 | gp_Pnt pts; |
113 | gp_Pnt2d pt2d; |
114 | Standard_Real dis; |
115 | Standard_Real normtg; |
116 | Standard_Real theD; |
117 | gp_Pnt ptgui; |
118 | gp_Vec nplan; |
119 | gp_Vec d1gui; |
120 | gp_Vec d2gui; |
121 | gp_Vec tgs; |
122 | gp_Vec2d tg2d; |
123 | Standard_Boolean istangent; |
124 | |
125 | |
126 | }; |
127 | |
128 | |
129 | |
130 | |
131 | |
132 | |
133 | |
134 | #endif // _BlendFunc_Corde_HeaderFile |