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
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 SurfRstEvolRad from BRepBlend
18 inherits SurfRstFunction from Blend
20 ---Purpose: Function to approximate by AppSurface for
21 -- Edge/Face 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,
49 Create(Surf : HSurface from Adaptor3d;
50 SurfRst : HSurface from Adaptor3d;
51 Rst : HCurve2d from Adaptor2d;
52 CGuide : HCurve from Adaptor3d;
53 Evol : Function from Law)
54 returns SurfRstEvolRad from BRepBlend;
57 ---Purpose: Returns 3.
58 returns Integer from Standard;
61 ---Purpose: Returns 3.
62 returns Integer from Standard;
64 Value(me: in out; X: Vector; F: out Vector)
65 ---Purpose: computes the values <F> of the Functions for the
67 -- Returns True if the computation was done successfully,
69 returns Boolean from Standard;
71 Derivatives(me: in out; X: Vector; D: out Matrix)
72 ---Purpose: returns the values <D> of the derivatives for the
74 -- Returns True if the computation was done successfully,
76 returns Boolean from Standard;
78 Values(me: in out; X: Vector; F: out Vector; D: out Matrix)
79 ---Purpose: returns the values <F> of the functions and the derivatives
80 -- <D> for the variable <X>.
81 -- Returns True if the computation was done successfully,
83 returns Boolean from Standard;
86 SurfRef : HSurface from Adaptor3d;
87 RstRef : HCurve2d from Adaptor2d);
89 Set(me: in out; Param: Real from Standard);
91 Set(me: in out; First, Last: Real from Standard);
92 ---Purpose: Sets the bounds of the parametric interval on
94 -- This determines the derivatives in these values if the
95 -- function is not Cn.
97 GetTolerance(me; Tolerance: out Vector from math; Tol: Real from Standard);
99 GetBounds(me; InfBound,SupBound: out Vector from math);
101 IsSolution(me: in out; Sol: Vector from math; Tol: Real from Standard)
102 returns Boolean from Standard;
104 GetMinimalDistance(me)
105 ---Purpose: Returns the minimal Distance beetween two
106 -- extremitys of calculed sections.
107 returns Real from Standard
110 --- TheFollowing methods are called only when
111 -- IsSolution returns Standard_True.
114 ---C++: return const&
118 ---C++: return const&
122 ---Purpose: Returns U,V coordinates of the point on the surface.
123 ---C++: return const&
124 returns Pnt2d from gp;
127 ---Purpose: Returns U,V coordinates of the point on the curve on
129 ---C++: return const&
130 returns Pnt2d from gp;
133 ---Purpose: Returns parameter of the point on the curve.
134 returns Real from Standard;
137 returns Boolean from Standard;
140 ---C++: return const&
144 ---C++: return const&
145 returns Vec2d from gp;
148 ---C++: return const&
152 ---C++: return const&
153 returns Vec2d from gp;
156 Sol : Vector from math;
157 NS,TgS : out Vec from gp)
158 ---Warning: Peut etre appele sans appel prealable a issolution
159 -- mais les valeurs calculees risquent de ne pas avoir
161 ---Purpose: Permet d ' implementer un critere de decrochage
162 -- specifique a la fonction.
163 returns Boolean from Standard
166 -- methodes hors template (en plus du create)
169 Choix : Integer from Standard)
172 Set(me: in out; TypeSection: SectionShape from BlendFunc)
173 ---Purpose: Sets the type of section generation for the
178 Param : Real from Standard;
179 U,V,W : Real from Standard;
180 Pdeb,Pfin : out Real from Standard;
181 C : out Circ from gp)
184 -- Methods for the approximation
186 IsRational(me) returns Boolean
187 ---Purpose: Returns if the section is rationnal
190 GetSectionSize(me) returns Real
191 ---Purpose: Returns the length of the maximum section
194 GetMinimalWeight(me; Weigths : out Array1OfReal from TColStd)
195 ---Purpose: Compute the minimal value of weight for each poles
199 NbIntervals(me; S : Shape from GeomAbs) returns Integer
200 ---Purpose: Returns the number of intervals for continuity
201 -- <S>. May be one if Continuity(me) >= <S>
204 Intervals(me; T : in out Array1OfReal from TColStd;
205 S : Shape from GeomAbs)
206 ---Purpose: Stores in <T> the parameters bounding the intervals
207 -- of continuity <S>.
208 -- The array must provide enough room to accomodate
209 -- for the parameters. i.e. T.Length() > NbIntervals()
212 GetShape(me : in out;
213 NbPoles : out Integer from Standard;
214 NbKnots : out Integer from Standard;
215 Degree : out Integer from Standard;
216 NbPoles2d : out Integer from Standard)
220 BoundTol, SurfTol, AngleTol : Real;
223 ---Purpose: Returns the tolerance to reach in approximation
225 -- BoundTol error at the Boundary
226 -- AngleTol tangent error at the Boundary
227 -- SurfTol error inside the surface.
230 Knots(me: in out; TKnots: out Array1OfReal from TColStd)
233 Mults(me: in out; TMults: out Array1OfInteger from TColStd)
236 Section(me : in out ;
237 P : Point from Blend;
238 Poles : out Array1OfPnt from TColgp;
239 DPoles : out Array1OfVec from TColgp;
240 Poles2d : out Array1OfPnt2d from TColgp;
241 DPoles2d : out Array1OfVec2d from TColgp;
242 Weigths : out Array1OfReal from TColStd;
243 DWeigths : out Array1OfReal from TColStd)
244 ---Purpose: Used for the first and last section
245 returns Boolean from Standard
248 Section(me: in out; P: Point from Blend;
249 Poles : out Array1OfPnt from TColgp;
250 DPoles : out Array1OfVec from TColgp;
251 D2Poles : out Array1OfVec from TColgp;
252 Poles2d : out Array1OfPnt2d from TColgp;
253 DPoles2d : out Array1OfVec2d from TColgp;
254 D2Poles2d : out Array1OfVec2d from TColgp;
255 Weigths : out Array1OfReal from TColStd;
256 DWeigths : out Array1OfReal from TColStd;
257 D2Weigths : out Array1OfReal from TColStd)
258 ---Purpose: Used for the first and last section
259 -- The method returns Standard_True if the derivatives
260 -- are computed, otherwise it returns Standard_False.
261 returns Boolean from Standard
264 Section(me : in out ;
265 P : Point from Blend;
266 Poles : out Array1OfPnt from TColgp;
267 Poles2d : out Array1OfPnt2d from TColgp;
268 Weigths : out Array1OfReal from TColStd)
272 IC2d : Integer from Standard;
273 Tol : Real from Standard;
274 TolU, TolV : out Real from Standard);
278 surf : HSurface from Adaptor3d;
279 surfrst : HSurface from Adaptor3d;
280 rst : HCurve2d from Adaptor2d;
281 cons : CurveOnSurface from Adaptor3d;
282 guide : HCurve from Adaptor3d;
283 tguide : HCurve from Adaptor3d;
286 pt2ds : Pnt2d from gp;
287 pt2drst : Pnt2d from gp;
288 prmrst : Real from Standard;
289 istangent: Boolean from Standard;
291 tg2ds : Vec2d from gp;
293 tg2drst : Vec2d from gp;
295 ray : Real from Standard;
296 dray : Real from Standard;
297 choix : Integer from Standard;
302 normtg : Real from Standard;
303 theD : Real from Standard;
305 surfref : HSurface from Adaptor3d;
306 rstref : HCurve2d from Adaptor2d;
308 maxang : Real from Standard;
309 minang : Real from Standard;
310 distmin : Real from Standard;
311 mySShape : SectionShape from BlendFunc;
312 myTConv : ParameterisationType from Convert;
313 tevol : Function from Law ;
314 fevol : Function from Law ;
315 sg1 : Real from Standard;