1 -- Created on: 1997-02-06
2 -- Created by: Laurent BOURESCHE
3 -- Copyright (c) 1997-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 class RstRstEvolRad from BRepBlend
18 inherits RstRstFunction from Blend
20 ---Purpose: Function to approximate by AppSurface for
21 -- Edge/Edge and evolutif radius
23 uses Vector from math,
31 Array1OfPnt from TColgp,
32 Array1OfVec from TColgp,
33 Array1OfPnt2d from TColgp,
34 Array1OfVec2d from TColgp,
35 Array1OfReal from TColStd,
36 Array1OfInteger from TColStd,
39 SectionShape from BlendFunc,
40 HSurface from Adaptor3d,
41 HCurve from Adaptor3d,
42 HCurve2d from Adaptor2d,
43 CurveOnSurface from Adaptor3d,
44 ParameterisationType from Convert,
45 DecrochStatus from Blend,
50 Create(Surf1 : HSurface from Adaptor3d;
51 Rst1 : HCurve2d from Adaptor2d;
52 Surf2 : HSurface from Adaptor3d;
53 Rst2 : HCurve2d from Adaptor2d;
54 CGuide : HCurve from Adaptor3d;
55 Evol : Function from Law)
56 returns RstRstEvolRad from BRepBlend;
59 ---Purpose: Returns 2.
60 returns Integer from Standard;
63 ---Purpose: Returns 2.
64 returns Integer from Standard;
66 Value(me: in out; X: Vector; F: out Vector)
67 ---Purpose: computes the values <F> of the Functions for the
69 -- Returns True if the computation was done successfully,
71 returns Boolean from Standard;
73 Derivatives(me: in out; X: Vector; D: out Matrix)
74 ---Purpose: returns the values <D> of the derivatives for the
76 -- Returns True if the computation was done successfully,
78 returns Boolean from Standard;
80 Values(me: in out; X: Vector; F: out Vector; D: out Matrix)
81 ---Purpose: returns the values <F> of the functions and the derivatives
82 -- <D> for the variable <X>.
83 -- Returns True if the computation was done successfully,
85 returns Boolean from Standard;
88 SurfRef1 : HSurface from Adaptor3d;
89 RstRef1 : HCurve2d from Adaptor2d;
90 SurfRef2 : HSurface from Adaptor3d;
91 RstRef2 : HCurve2d from Adaptor2d);
93 Set(me: in out; Param: Real from Standard);
95 Set(me: in out; First, Last: Real from Standard);
96 ---Purpose: Sets the bounds of the parametric interval on
98 -- This determines the derivatives in these values if the
99 -- function is not Cn.
101 GetTolerance(me; Tolerance: out Vector from math; Tol: Real from Standard);
103 GetBounds(me; InfBound,SupBound: out Vector from math);
105 IsSolution(me: in out; Sol: Vector from math; Tol: Real from Standard)
106 returns Boolean from Standard;
108 GetMinimalDistance(me)
109 ---Purpose: Returns the minimal Distance beetween two
110 -- extremitys of calculed sections.
111 returns Real from Standard
114 --- TheFollowing methods are called only when
115 -- IsSolution returns Standard_True.
118 ---C++: return const&
122 ---C++: return const&
126 ---Purpose: Returns U,V coordinates of the point on the surface.
127 ---C++: return const&
128 returns Pnt2d from gp;
131 ---Purpose: Returns U,V coordinates of the point on the curve on
133 ---C++: return const&
134 returns Pnt2d from gp;
137 ---Purpose: Returns parameter of the point on the curve.
138 returns Real from Standard;
141 ---Purpose: Returns parameter of the point on the curve.
142 returns Real from Standard;
145 returns Boolean from Standard;
148 ---C++: return const&
152 ---C++: return const&
153 returns Vec2d from gp;
156 ---C++: return const&
160 ---C++: return const&
161 returns Vec2d from gp;
164 Sol : Vector from math;
165 NRst1, TgRst1 : out Vec from gp;
166 NRst2, TgRst2 : out Vec from gp)
168 ---Purpose: Enables implementation of a criterion of decrochage
169 -- specific to the function.
170 ---Warning: Can be called without previous call of issolution
171 -- but the calculated values risquent de ne pas avoir
173 returns DecrochStatus from Blend
176 -- methodes hors template (en plus du create)
179 Choix : Integer from Standard)
182 Set(me: in out; TypeSection: SectionShape from BlendFunc)
183 ---Purpose: Sets the type of section generation for the
187 CenterCircleRst1Rst2(me;
188 PtRst1 : Pnt from gp;
189 PtRst2 : Pnt from gp;
191 Center : out Pnt from gp;
192 VdMed : out Vec from gp)
193 ---Purpose: Gives the center of circle defined by PtRst1, PtRst2 and
195 returns Boolean from Standard
199 Param : Real from Standard;
200 U,V : Real from Standard;
201 Pdeb,Pfin : out Real from Standard;
202 C : out Circ from gp)
205 -- Methods for the approximation
207 IsRational(me) returns Boolean
208 ---Purpose: Returns if the section is rationnal
211 GetSectionSize(me) returns Real
212 ---Purpose: Returns the length of the maximum section
215 GetMinimalWeight(me; Weigths : out Array1OfReal from TColStd)
216 ---Purpose: Compute the minimal value of weight for each poles
220 NbIntervals(me; S : Shape from GeomAbs) returns Integer
221 ---Purpose: Returns the number of intervals for continuity
222 -- <S>. May be one if Continuity(me) >= <S>
225 Intervals(me; T : in out Array1OfReal from TColStd;
226 S : Shape from GeomAbs)
227 ---Purpose: Stores in <T> the parameters bounding the intervals
228 -- of continuity <S>.
229 -- The array must provide enough room to accomodate
230 -- for the parameters. i.e. T.Length() > NbIntervals()
233 GetShape(me : in out;
234 NbPoles : out Integer from Standard;
235 NbKnots : out Integer from Standard;
236 Degree : out Integer from Standard;
237 NbPoles2d : out Integer from Standard)
241 BoundTol, SurfTol, AngleTol : Real;
244 ---Purpose: Returns the tolerance to reach in approximation
246 -- BoundTol error at the Boundary
247 -- AngleTol tangent error at the Boundary
248 -- SurfTol error inside the surface.
251 Knots(me: in out; TKnots: out Array1OfReal from TColStd)
254 Mults(me: in out; TMults: out Array1OfInteger from TColStd)
257 Section(me : in out ;
258 P : Point from Blend;
259 Poles : out Array1OfPnt from TColgp;
260 DPoles : out Array1OfVec from TColgp;
261 Poles2d : out Array1OfPnt2d from TColgp;
262 DPoles2d : out Array1OfVec2d from TColgp;
263 Weigths : out Array1OfReal from TColStd;
264 DWeigths : out Array1OfReal from TColStd)
265 ---Purpose: Used for the first and last section
266 returns Boolean from Standard
269 Section(me : in out ;
270 P : Point from Blend;
271 Poles : out Array1OfPnt from TColgp;
272 Poles2d : out Array1OfPnt2d from TColgp;
273 Weigths : out Array1OfReal from TColStd)
277 Section(me: in out; P: Point from Blend;
278 Poles : out Array1OfPnt from TColgp;
279 DPoles : out Array1OfVec from TColgp;
280 D2Poles : out Array1OfVec from TColgp;
281 Poles2d : out Array1OfPnt2d from TColgp;
282 DPoles2d : out Array1OfVec2d from TColgp;
283 D2Poles2d : out Array1OfVec2d from TColgp;
284 Weigths : out Array1OfReal from TColStd;
285 DWeigths : out Array1OfReal from TColStd;
286 D2Weigths : out Array1OfReal from TColStd)
287 ---Purpose: Used for the first and last section
288 -- The method returns Standard_True if the derivatives
289 -- are computed, otherwise it returns Standard_False.
290 returns Boolean from Standard
294 IC2d : Integer from Standard;
295 Tol : Real from Standard;
296 TolU, TolV : out Real from Standard);
300 surf1 : HSurface from Adaptor3d;
301 surf2 : HSurface from Adaptor3d;
302 rst1 : HCurve2d from Adaptor2d;
303 rst2 : HCurve2d from Adaptor2d;
304 cons1 : CurveOnSurface from Adaptor3d;
305 cons2 : CurveOnSurface from Adaptor3d;
306 guide : HCurve from Adaptor3d;
307 tguide : HCurve from Adaptor3d;
308 ptrst1 : Pnt from gp;
309 ptrst2 : Pnt from gp;
310 pt2drst1 : Pnt2d from gp;
311 pt2drst2 : Pnt2d from gp;
312 prmrst1 : Real from Standard;
313 prmrst2 : Real from Standard;
314 istangent: Boolean from Standard;
315 tgrst1 : Vec from gp;
316 tg2drst1 : Vec2d from gp;
317 tgrst2 : Vec from gp;
318 tg2drst2 : Vec2d from gp;
320 ray : Real from Standard;
321 dray : Real from Standard;
322 choix : Integer from Standard;
327 normtg : Real from Standard;
328 theD : Real from Standard;
330 surfref1 : HSurface from Adaptor3d;
331 rstref1 : HCurve2d from Adaptor2d;
332 surfref2 : HSurface from Adaptor3d;
333 rstref2 : HCurve2d from Adaptor2d;
334 maxang : Real from Standard;
335 minang : Real from Standard;
336 distmin : Real from Standard;
337 mySShape : SectionShape from BlendFunc;
338 myTConv : ParameterisationType from Convert;
339 tevol : Function from Law ;
340 fevol : Function from Law ;