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
9 -- under the terms of the GNU Lesser General Public 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 RstRstConstRad from BRepBlend
18 inherits RstRstFunction from Blend
22 uses Vector from math,
30 Array1OfPnt from TColgp,
31 Array1OfVec from TColgp,
32 Array1OfPnt2d from TColgp,
33 Array1OfVec2d from TColgp,
34 Array1OfReal from TColStd,
35 Array1OfInteger from TColStd,
38 SectionShape from BlendFunc,
39 HSurface from Adaptor3d,
40 HCurve from Adaptor3d,
41 HCurve2d from Adaptor2d,
42 CurveOnSurface from Adaptor3d,
43 ParameterisationType from Convert,
44 DecrochStatus from Blend
48 Create(Surf1 : HSurface from Adaptor3d;
49 Rst1 : HCurve2d from Adaptor2d;
50 Surf2 : HSurface from Adaptor3d;
51 Rst2 : HCurve2d from Adaptor2d;
52 CGuide : HCurve from Adaptor3d)
53 returns RstRstConstRad from BRepBlend;
56 ---Purpose: Returns 2.
57 returns Integer from Standard;
60 ---Purpose: Returns 2.
61 returns Integer from Standard;
63 Value(me: in out; X: Vector; F: out Vector)
64 ---Purpose: computes the values <F> of the Functions for the
66 -- Returns True if the computation was done successfully,
68 returns Boolean from Standard;
70 Derivatives(me: in out; X: Vector; D: out Matrix)
71 ---Purpose: returns the values <D> of the derivatives for the
73 -- Returns True if the computation was done successfully,
75 returns Boolean from Standard;
77 Values(me: in out; X: Vector; F: out Vector; D: out Matrix)
78 ---Purpose: returns the values <F> of the functions and the derivatives
79 -- <D> for the variable <X>.
80 -- Returns True if the computation was done successfully,
82 returns Boolean from Standard;
85 SurfRef1 : HSurface from Adaptor3d;
86 RstRef1 : HCurve2d from Adaptor2d;
87 SurfRef2 : HSurface from Adaptor3d;
88 RstRef2 : HCurve2d from Adaptor2d);
90 Set(me: in out; Param: Real from Standard);
92 Set(me: in out; First, Last: Real from Standard);
93 ---Purpose: Sets the bounds of the parametric interval on
95 -- This determines the derivatives in these values if the
96 -- function is not Cn.
98 GetTolerance(me; Tolerance: out Vector from math; Tol: Real from Standard);
100 GetBounds(me; InfBound,SupBound: out Vector from math);
102 IsSolution(me: in out; Sol: Vector from math; Tol: Real from Standard)
103 returns Boolean from Standard;
105 GetMinimalDistance(me)
106 ---Purpose: Returns the minimal Distance beetween two
107 -- extremitys of calculed sections.
108 returns Real from Standard
111 --- TheFollowing methods are called only when
112 -- IsSolution returns Standard_True.
115 ---C++: return const&
119 ---C++: return const&
123 ---Purpose: Returns U,V coordinates of the point on the surface.
124 ---C++: return const&
125 returns Pnt2d from gp;
128 ---Purpose: Returns U,V coordinates of the point on the curve on
130 ---C++: return const&
131 returns Pnt2d from gp;
134 ---Purpose: Returns parameter of the point on the curve.
135 returns Real from Standard;
138 ---Purpose: Returns parameter of the point on the curve.
139 returns Real from Standard;
142 returns Boolean from Standard;
145 ---C++: return const&
149 ---C++: return const&
150 returns Vec2d from gp;
153 ---C++: return const&
157 ---C++: return const&
158 returns Vec2d from gp;
161 Sol : Vector from math;
162 NRst1, TgRst1 : out Vec from gp;
163 NRst2, TgRst2 : out Vec from gp)
164 ---Warning: Peut etre appele sans appel prealable a issolution
165 -- mais les valeurs calculees risquent de ne pas avoir
167 ---Purpose: Permet d ' implementer un critere de decrochage
168 -- specifique a la fonction.
169 returns DecrochStatus from Blend
172 -- methodes hors template (en plus du create)
175 Radius : Real from Standard;
176 Choix : Integer from Standard)
179 Set(me: in out; TypeSection: SectionShape from BlendFunc)
180 ---Purpose: Sets the type of section generation for the
184 CenterCircleRst1Rst2(me;
185 PtRst1 : Pnt from gp;
186 PtRst2 : Pnt from gp;
188 Center : out Pnt from gp;
189 VdMed : out Vec from gp)
190 ---Purpose: Give the center of circle define by PtRst1, PtRst2 and
192 returns Boolean from Standard
196 Param : Real from Standard;
197 U,V : Real from Standard;
198 Pdeb,Pfin : out Real from Standard;
199 C : out Circ from gp)
202 -- Methods for the approximation
204 IsRational(me) returns Boolean
205 ---Purpose: Returns if the section is rationnal
208 GetSectionSize(me) returns Real
209 ---Purpose: Returns the length of the maximum section
212 GetMinimalWeight(me; Weigths : out Array1OfReal from TColStd)
213 ---Purpose: Compute the minimal value of weight for each poles
217 NbIntervals(me; S : Shape from GeomAbs) returns Integer
218 ---Purpose: Returns the number of intervals for continuity
219 -- <S>. May be one if Continuity(me) >= <S>
222 Intervals(me; T : in out Array1OfReal from TColStd;
223 S : Shape from GeomAbs)
224 ---Purpose: Stores in <T> the parameters bounding the intervals
225 -- of continuity <S>.
226 -- The array must provide enough room to accomodate
227 -- for the parameters. i.e. T.Length() > NbIntervals()
230 GetShape(me : in out;
231 NbPoles : out Integer from Standard;
232 NbKnots : out Integer from Standard;
233 Degree : out Integer from Standard;
234 NbPoles2d : out Integer from Standard)
238 BoundTol, SurfTol, AngleTol : Real;
241 ---Purpose: Returns the tolerance to reach in approximation
243 -- BoundTol error at the Boundary
244 -- AngleTol tangent error at the Boundary
245 -- SurfTol error inside the surface.
248 Knots(me: in out; TKnots: out Array1OfReal from TColStd)
251 Mults(me: in out; TMults: out Array1OfInteger from TColStd)
254 Section(me : in out ;
255 P : Point from Blend;
256 Poles : out Array1OfPnt from TColgp;
257 DPoles : out Array1OfVec from TColgp;
258 Poles2d : out Array1OfPnt2d from TColgp;
259 DPoles2d : out Array1OfVec2d from TColgp;
260 Weigths : out Array1OfReal from TColStd;
261 DWeigths : out Array1OfReal from TColStd)
262 ---Purpose: Used for the first and last section
263 returns Boolean from Standard
266 Section(me : in out ;
267 P : Point from Blend;
268 Poles : out Array1OfPnt from TColgp;
269 Poles2d : out Array1OfPnt2d from TColgp;
270 Weigths : out Array1OfReal from TColStd)
274 Section(me: in out; P: Point from Blend;
275 Poles : out Array1OfPnt from TColgp;
276 DPoles : out Array1OfVec from TColgp;
277 D2Poles : out Array1OfVec from TColgp;
278 Poles2d : out Array1OfPnt2d from TColgp;
279 DPoles2d : out Array1OfVec2d from TColgp;
280 D2Poles2d : out Array1OfVec2d from TColgp;
281 Weigths : out Array1OfReal from TColStd;
282 DWeigths : out Array1OfReal from TColStd;
283 D2Weigths : out Array1OfReal from TColStd)
284 ---Purpose: Used for the first and last section
285 -- The method returns Standard_True if the derivatives
286 -- are computed, otherwise it returns Standard_False.
287 returns Boolean from Standard
291 IC2d : Integer from Standard;
292 Tol : Real from Standard;
293 TolU, TolV : out Real from Standard);
297 surf1 : HSurface from Adaptor3d;
298 surf2 : HSurface from Adaptor3d;
299 rst1 : HCurve2d from Adaptor2d;
300 rst2 : HCurve2d from Adaptor2d;
301 cons1 : CurveOnSurface from Adaptor3d;
302 cons2 : CurveOnSurface from Adaptor3d;
303 guide : HCurve from Adaptor3d;
304 tguide : HCurve from Adaptor3d;
305 ptrst1 : Pnt from gp;
306 ptrst2 : Pnt from gp;
307 pt2drst1 : Pnt2d from gp;
308 pt2drst2 : Pnt2d from gp;
309 prmrst1 : Real from Standard;
310 prmrst2 : Real from Standard;
311 istangent: Boolean from Standard;
312 tgrst1 : Vec from gp;
313 tg2drst1 : Vec2d from gp;
314 tgrst2 : Vec from gp;
315 tg2drst2 : Vec2d from gp;
317 ray : Real from Standard;
318 choix : Integer from Standard;
323 normtg : Real from Standard;
324 theD : Real from Standard;
326 surfref1 : HSurface from Adaptor3d;
327 rstref1 : HCurve2d from Adaptor2d;
328 surfref2 : HSurface from Adaptor3d;
329 rstref2 : HCurve2d from Adaptor2d;
330 maxang : Real from Standard;
331 minang : Real from Standard;
332 distmin : Real from Standard;
333 mySShape : SectionShape from BlendFunc;
334 myTConv : ParameterisationType from Convert;