42cf5bc1 |
1 | // Created on: 1997-07-28 |
2 | // Created by: Jerome LEMONIER |
3 | // Copyright (c) 1997-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 _BRepBlend_SurfRstEvolRad_HeaderFile |
18 | #define _BRepBlend_SurfRstEvolRad_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Adaptor3d_CurveOnSurface.hxx> |
25 | #include <gp_Pnt.hxx> |
26 | #include <gp_Pnt2d.hxx> |
27 | #include <Standard_Real.hxx> |
28 | #include <Standard_Boolean.hxx> |
29 | #include <gp_Vec.hxx> |
30 | #include <gp_Vec2d.hxx> |
31 | #include <Standard_Integer.hxx> |
32 | #include <BlendFunc_SectionShape.hxx> |
33 | #include <Convert_ParameterisationType.hxx> |
34 | #include <Blend_SurfRstFunction.hxx> |
35 | #include <math_Vector.hxx> |
36 | #include <TColStd_Array1OfReal.hxx> |
37 | #include <GeomAbs_Shape.hxx> |
38 | #include <TColStd_Array1OfInteger.hxx> |
39 | #include <TColgp_Array1OfPnt.hxx> |
40 | #include <TColgp_Array1OfVec.hxx> |
41 | #include <TColgp_Array1OfPnt2d.hxx> |
42 | #include <TColgp_Array1OfVec2d.hxx> |
43 | class Adaptor3d_HSurface; |
44 | class Adaptor2d_HCurve2d; |
45 | class Adaptor3d_HCurve; |
46 | class Law_Function; |
47 | class math_Matrix; |
48 | class gp_Pnt; |
49 | class gp_Pnt2d; |
50 | class gp_Vec; |
51 | class gp_Vec2d; |
52 | class gp_Circ; |
53 | class Blend_Point; |
54 | |
55 | |
56 | //! Function to approximate by AppSurface for |
57 | //! Edge/Face and evolutif radius |
58 | class BRepBlend_SurfRstEvolRad : public Blend_SurfRstFunction |
59 | { |
60 | public: |
61 | |
62 | DEFINE_STANDARD_ALLOC |
63 | |
64 | |
65 | Standard_EXPORT BRepBlend_SurfRstEvolRad(const Handle(Adaptor3d_HSurface)& Surf, const Handle(Adaptor3d_HSurface)& SurfRst, const Handle(Adaptor2d_HCurve2d)& Rst, const Handle(Adaptor3d_HCurve)& CGuide, const Handle(Law_Function)& Evol); |
66 | |
67 | //! Returns 3. |
79104795 |
68 | Standard_EXPORT Standard_Integer NbVariables() const Standard_OVERRIDE; |
42cf5bc1 |
69 | |
70 | //! Returns 3. |
79104795 |
71 | Standard_EXPORT Standard_Integer NbEquations() const Standard_OVERRIDE; |
42cf5bc1 |
72 | |
73 | //! computes the values <F> of the Functions for the |
74 | //! variable <X>. |
75 | //! Returns True if the computation was done successfully, |
76 | //! False otherwise. |
79104795 |
77 | Standard_EXPORT Standard_Boolean Value (const math_Vector& X, math_Vector& F) Standard_OVERRIDE; |
42cf5bc1 |
78 | |
79 | //! returns the values <D> of the derivatives for the |
80 | //! variable <X>. |
81 | //! Returns True if the computation was done successfully, |
82 | //! False otherwise. |
79104795 |
83 | Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D) Standard_OVERRIDE; |
42cf5bc1 |
84 | |
85 | //! returns the values <F> of the functions and the derivatives |
86 | //! <D> for the variable <X>. |
87 | //! Returns True if the computation was done successfully, |
88 | //! False otherwise. |
79104795 |
89 | Standard_EXPORT Standard_Boolean Values (const math_Vector& X, math_Vector& F, math_Matrix& D) Standard_OVERRIDE; |
42cf5bc1 |
90 | |
91 | Standard_EXPORT void Set (const Handle(Adaptor3d_HSurface)& SurfRef, const Handle(Adaptor2d_HCurve2d)& RstRef); |
92 | |
79104795 |
93 | Standard_EXPORT void Set (const Standard_Real Param) Standard_OVERRIDE; |
42cf5bc1 |
94 | |
95 | //! Sets the bounds of the parametric interval on |
96 | //! the guide line. |
97 | //! This determines the derivatives in these values if the |
98 | //! function is not Cn. |
79104795 |
99 | Standard_EXPORT void Set (const Standard_Real First, const Standard_Real Last) Standard_OVERRIDE; |
42cf5bc1 |
100 | |
79104795 |
101 | Standard_EXPORT void GetTolerance (math_Vector& Tolerance, const Standard_Real Tol) const Standard_OVERRIDE; |
42cf5bc1 |
102 | |
79104795 |
103 | Standard_EXPORT void GetBounds (math_Vector& InfBound, math_Vector& SupBound) const Standard_OVERRIDE; |
42cf5bc1 |
104 | |
79104795 |
105 | Standard_EXPORT Standard_Boolean IsSolution (const math_Vector& Sol, const Standard_Real Tol) Standard_OVERRIDE; |
42cf5bc1 |
106 | |
107 | //! Returns the minimal Distance beetween two |
108 | //! extremitys of calculed sections. |
109 | Standard_EXPORT virtual Standard_Real GetMinimalDistance() const Standard_OVERRIDE; |
110 | |
79104795 |
111 | Standard_EXPORT const gp_Pnt& PointOnS() const Standard_OVERRIDE; |
42cf5bc1 |
112 | |
79104795 |
113 | Standard_EXPORT const gp_Pnt& PointOnRst() const Standard_OVERRIDE; |
42cf5bc1 |
114 | |
115 | //! Returns U,V coordinates of the point on the surface. |
79104795 |
116 | Standard_EXPORT const gp_Pnt2d& Pnt2dOnS() const Standard_OVERRIDE; |
42cf5bc1 |
117 | |
118 | //! Returns U,V coordinates of the point on the curve on |
119 | //! surface. |
79104795 |
120 | Standard_EXPORT const gp_Pnt2d& Pnt2dOnRst() const Standard_OVERRIDE; |
42cf5bc1 |
121 | |
122 | //! Returns parameter of the point on the curve. |
79104795 |
123 | Standard_EXPORT Standard_Real ParameterOnRst() const Standard_OVERRIDE; |
42cf5bc1 |
124 | |
79104795 |
125 | Standard_EXPORT Standard_Boolean IsTangencyPoint() const Standard_OVERRIDE; |
42cf5bc1 |
126 | |
79104795 |
127 | Standard_EXPORT const gp_Vec& TangentOnS() const Standard_OVERRIDE; |
42cf5bc1 |
128 | |
79104795 |
129 | Standard_EXPORT const gp_Vec2d& Tangent2dOnS() const Standard_OVERRIDE; |
42cf5bc1 |
130 | |
79104795 |
131 | Standard_EXPORT const gp_Vec& TangentOnRst() const Standard_OVERRIDE; |
42cf5bc1 |
132 | |
79104795 |
133 | Standard_EXPORT const gp_Vec2d& Tangent2dOnRst() const Standard_OVERRIDE; |
42cf5bc1 |
134 | |
135 | //! Permet d ' implementer un critere de decrochage |
136 | //! specifique a la fonction. |
79104795 |
137 | Standard_EXPORT Standard_Boolean Decroch (const math_Vector& Sol, gp_Vec& NS, gp_Vec& TgS) const Standard_OVERRIDE; |
42cf5bc1 |
138 | |
139 | Standard_EXPORT void Set (const Standard_Integer Choix); |
140 | |
141 | //! Sets the type of section generation for the |
142 | //! approximations. |
143 | Standard_EXPORT void Set (const BlendFunc_SectionShape TypeSection); |
144 | |
145 | Standard_EXPORT void Section (const Standard_Real Param, const Standard_Real U, const Standard_Real V, const Standard_Real W, Standard_Real& Pdeb, Standard_Real& Pfin, gp_Circ& C); |
146 | |
147 | //! Returns if the section is rationnal |
79104795 |
148 | Standard_EXPORT Standard_Boolean IsRational() const Standard_OVERRIDE; |
42cf5bc1 |
149 | |
150 | //! Returns the length of the maximum section |
79104795 |
151 | Standard_EXPORT Standard_Real GetSectionSize() const Standard_OVERRIDE; |
42cf5bc1 |
152 | |
153 | //! Compute the minimal value of weight for each poles |
154 | //! of all sections. |
79104795 |
155 | Standard_EXPORT void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const Standard_OVERRIDE; |
42cf5bc1 |
156 | |
157 | //! Returns the number of intervals for continuity |
158 | //! <S>. May be one if Continuity(me) >= <S> |
79104795 |
159 | Standard_EXPORT Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE; |
42cf5bc1 |
160 | |
161 | //! Stores in <T> the parameters bounding the intervals |
162 | //! of continuity <S>. |
163 | //! The array must provide enough room to accomodate |
164 | //! for the parameters. i.e. T.Length() > NbIntervals() |
79104795 |
165 | Standard_EXPORT void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE; |
42cf5bc1 |
166 | |
79104795 |
167 | Standard_EXPORT void GetShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree, Standard_Integer& NbPoles2d) Standard_OVERRIDE; |
42cf5bc1 |
168 | |
169 | //! Returns the tolerance to reach in approximation |
170 | //! to respecte |
171 | //! BoundTol error at the Boundary |
172 | //! AngleTol tangent error at the Boundary |
173 | //! SurfTol error inside the surface. |
79104795 |
174 | Standard_EXPORT void GetTolerance (const Standard_Real BoundTol, const Standard_Real SurfTol, const Standard_Real AngleTol, math_Vector& Tol3d, math_Vector& Tol1D) const Standard_OVERRIDE; |
42cf5bc1 |
175 | |
79104795 |
176 | Standard_EXPORT void Knots (TColStd_Array1OfReal& TKnots) Standard_OVERRIDE; |
42cf5bc1 |
177 | |
79104795 |
178 | Standard_EXPORT void Mults (TColStd_Array1OfInteger& TMults) Standard_OVERRIDE; |
42cf5bc1 |
179 | |
180 | //! Used for the first and last section |
79104795 |
181 | Standard_EXPORT Standard_Boolean Section (const Blend_Point& P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColgp_Array1OfPnt2d& Poles2d, TColgp_Array1OfVec2d& DPoles2d, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths) Standard_OVERRIDE; |
42cf5bc1 |
182 | |
183 | //! Used for the first and last section |
184 | //! The method returns Standard_True if the derivatives |
185 | //! are computed, otherwise it returns Standard_False. |
79104795 |
186 | Standard_EXPORT Standard_Boolean Section (const Blend_Point& P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColgp_Array1OfVec& D2Poles, TColgp_Array1OfPnt2d& Poles2d, TColgp_Array1OfVec2d& DPoles2d, TColgp_Array1OfVec2d& D2Poles2d, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths, TColStd_Array1OfReal& D2Weigths) Standard_OVERRIDE; |
42cf5bc1 |
187 | |
79104795 |
188 | Standard_EXPORT void Section (const Blend_Point& P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfPnt2d& Poles2d, TColStd_Array1OfReal& Weigths) Standard_OVERRIDE; |
42cf5bc1 |
189 | |
79104795 |
190 | Standard_EXPORT void Resolution (const Standard_Integer IC2d, const Standard_Real Tol, Standard_Real& TolU, Standard_Real& TolV) const Standard_OVERRIDE; |
42cf5bc1 |
191 | |
192 | |
193 | |
194 | |
195 | protected: |
196 | |
197 | |
198 | |
199 | |
200 | |
201 | private: |
202 | |
203 | |
204 | |
205 | Handle(Adaptor3d_HSurface) surf; |
206 | Handle(Adaptor3d_HSurface) surfrst; |
207 | Handle(Adaptor2d_HCurve2d) rst; |
208 | Adaptor3d_CurveOnSurface cons; |
209 | Handle(Adaptor3d_HCurve) guide; |
210 | Handle(Adaptor3d_HCurve) tguide; |
211 | gp_Pnt pts; |
212 | gp_Pnt ptrst; |
213 | gp_Pnt2d pt2ds; |
214 | gp_Pnt2d pt2drst; |
215 | Standard_Real prmrst; |
216 | Standard_Boolean istangent; |
217 | gp_Vec tgs; |
218 | gp_Vec2d tg2ds; |
219 | gp_Vec tgrst; |
220 | gp_Vec2d tg2drst; |
221 | Standard_Real ray; |
222 | Standard_Real dray; |
223 | Standard_Integer choix; |
224 | gp_Pnt ptgui; |
225 | gp_Vec d1gui; |
226 | gp_Vec d2gui; |
227 | gp_Vec nplan; |
228 | Standard_Real normtg; |
229 | Standard_Real theD; |
230 | Handle(Adaptor3d_HSurface) surfref; |
231 | Handle(Adaptor2d_HCurve2d) rstref; |
232 | Standard_Real maxang; |
233 | Standard_Real minang; |
234 | Standard_Real distmin; |
235 | BlendFunc_SectionShape mySShape; |
236 | Convert_ParameterisationType myTConv; |
237 | Handle(Law_Function) tevol; |
238 | Handle(Law_Function) fevol; |
239 | Standard_Real sg1; |
240 | |
241 | |
242 | }; |
243 | |
244 | |
245 | |
246 | |
247 | |
248 | |
249 | |
250 | #endif // _BRepBlend_SurfRstEvolRad_HeaderFile |