1d54b807 |
1 | // Created by: Julia GERASIMOVA |
2 | // Copyright (c) 2015 OPEN CASCADE SAS |
3 | // |
4 | // This file is part of Open CASCADE Technology software library. |
5 | // |
6 | // This library is free software; you can redistribute it and/or modify it under |
7 | // the terms of the GNU Lesser General Public License version 2.1 as published |
8 | // by the Free Software Foundation, with special exception defined in the file |
9 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
10 | // distribution for complete text of the license and disclaimer of any warranty. |
11 | // |
12 | // Alternatively, this file may be used under the terms of Open CASCADE |
13 | // commercial license or contractual agreement. |
14 | |
15 | #ifndef _BlendFunc_ConstThroat_HeaderFile |
16 | #define _BlendFunc_ConstThroat_HeaderFile |
17 | |
18 | #include <Standard.hxx> |
19 | #include <Standard_DefineAlloc.hxx> |
20 | #include <Standard_Handle.hxx> |
21 | |
22 | #include <Standard_Integer.hxx> |
23 | #include <Standard_Real.hxx> |
24 | #include <BlendFunc_GenChamfer.hxx> |
25 | #include <Standard_Boolean.hxx> |
26 | #include <math_Vector.hxx> |
27 | #include <TColStd_Array1OfReal.hxx> |
28 | #include <GeomAbs_Shape.hxx> |
29 | #include <TColStd_Array1OfInteger.hxx> |
30 | #include <TColgp_Array1OfPnt.hxx> |
31 | #include <TColgp_Array1OfVec.hxx> |
32 | #include <TColgp_Array1OfPnt2d.hxx> |
33 | #include <TColgp_Array1OfVec2d.hxx> |
34 | class Adaptor3d_HSurface; |
35 | class Adaptor3d_HCurve; |
36 | class math_Matrix; |
37 | class gp_Pnt; |
38 | class gp_Vec; |
39 | class gp_Vec2d; |
40 | class gp_Lin; |
41 | class Blend_Point; |
42 | |
43 | |
44 | //! Class for a function used to compute a symmetric chamfer |
45 | //! with constant throat that is the height of isosceles triangle in section |
46 | class BlendFunc_ConstThroat : public BlendFunc_GenChamfer |
47 | { |
48 | public: |
49 | |
50 | DEFINE_STANDARD_ALLOC |
51 | |
52 | |
53 | Standard_EXPORT BlendFunc_ConstThroat(const Handle(Adaptor3d_HSurface)& S1, |
54 | const Handle(Adaptor3d_HSurface)& S2, |
55 | const Handle(Adaptor3d_HCurve)& C); |
56 | |
57 | |
58 | //! computes the values <F> of the Functions 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) Standard_OVERRIDE; |
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) Standard_OVERRIDE; |
69 | |
70 | Standard_EXPORT void Set (const Standard_Real Param) Standard_OVERRIDE; |
71 | |
72 | Standard_EXPORT Standard_Boolean IsSolution (const math_Vector& Sol, const Standard_Real Tol) Standard_OVERRIDE; |
73 | |
74 | Standard_EXPORT const gp_Pnt& PointOnS1() const Standard_OVERRIDE; |
75 | |
76 | Standard_EXPORT const gp_Pnt& PointOnS2() const Standard_OVERRIDE; |
77 | |
78 | Standard_EXPORT Standard_Boolean IsTangencyPoint() const Standard_OVERRIDE; |
79 | |
80 | Standard_EXPORT const gp_Vec& TangentOnS1() const Standard_OVERRIDE; |
81 | |
82 | Standard_EXPORT const gp_Vec2d& Tangent2dOnS1() const Standard_OVERRIDE; |
83 | |
84 | Standard_EXPORT const gp_Vec& TangentOnS2() const Standard_OVERRIDE; |
85 | |
86 | Standard_EXPORT const gp_Vec2d& Tangent2dOnS2() const Standard_OVERRIDE; |
87 | |
88 | //! Returns the tangent vector at the section, |
89 | //! at the beginning and the end of the section, and |
90 | //! returns the normal (of the surfaces) at |
91 | //! these points. |
92 | Standard_EXPORT void Tangent (const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2, gp_Vec& TgFirst, gp_Vec& TgLast, gp_Vec& NormFirst, gp_Vec& NormLast) const Standard_OVERRIDE; |
93 | |
94 | //! Sets the throat and the "quadrant". |
95 | Standard_EXPORT void Set (const Standard_Real aThroat, const Standard_Real, const Standard_Integer Choix) Standard_OVERRIDE; |
96 | |
97 | //! Returns the length of the maximum section |
98 | Standard_EXPORT Standard_Real GetSectionSize() const Standard_OVERRIDE; |
99 | |
100 | |
101 | |
102 | |
103 | |
104 | protected: |
105 | |
106 | gp_Pnt pts1; |
107 | gp_Pnt pts2; |
108 | gp_Vec d1u1; |
109 | gp_Vec d1v1; |
110 | gp_Vec d1u2; |
111 | gp_Vec d1v2; |
112 | Standard_Boolean istangent; |
113 | gp_Vec tg1; |
114 | gp_Vec2d tg12d; |
115 | gp_Vec tg2; |
116 | gp_Vec2d tg22d; |
117 | Standard_Real param; |
118 | Standard_Real Throat; |
119 | |
120 | gp_Pnt ptgui; |
121 | gp_Vec nplan; |
122 | Standard_Real normtg; |
123 | Standard_Real theD; |
124 | gp_Vec d1gui; |
125 | gp_Vec d2gui; |
126 | |
127 | private: |
128 | |
129 | |
130 | }; |
131 | |
132 | |
133 | |
134 | |
135 | |
136 | |
137 | |
138 | #endif // _BlendFunc_ConstThroat_HeaderFile |