1 -- Created on: 1995-01-04
2 -- Created by: Jacques GOUSSARD
3 -- Copyright (c) 1995-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 CSCircular from BlendFunc
19 inherits CSFunction from Blend
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 ParameterisationType from Convert,
41 HCurve from Adaptor3d,
42 HSurface from Adaptor3d,
47 Create(S: HSurface from Adaptor3d; C: HCurve from Adaptor3d; CGuide: HCurve from Adaptor3d;
50 ---Purpose: Creates a function for a circular blending between
51 -- a curve <C> and a surface <S>. The direction of
52 -- the planes are given by <CGuide>. The position of
53 -- the plane is determined on the curve <C>. <L>
54 -- defines the change of parameter between <C> and
55 -- <CGuide>. So, the planes are defined as described
57 -- t is the current parameter on the guide line.
58 -- Pguide = C(L(t)); Nguide = CGuide'(t)/||CGuide'(t)||
60 returns CSCircular from BlendFunc;
65 returns Integer from Standard
70 ---Purpose: returns the number of equations of the function (3).
71 returns Integer from Standard;
73 Value(me: in out; X: Vector; F: out Vector)
74 ---Purpose: computes the values <F> of the Functions for the
76 -- Returns True if the computation was done successfully,
79 returns Boolean from Standard;
82 Derivatives(me: in out; X: Vector; D: out Matrix)
83 ---Purpose: returns the values <D> of the derivatives for the
85 -- Returns True if the computation was done successfully,
88 returns Boolean from Standard;
91 Values(me: in out; X: Vector; F: out Vector; D: out Matrix)
92 ---Purpose: returns the values <F> of the functions and the derivatives
93 -- <D> for the variable <X>.
94 -- Returns True if the computation was done successfully,
97 returns Boolean from Standard;
100 Set(me: in out; Param: Real from Standard)
104 Set(me: in out; First, Last: Real from Standard)
108 GetTolerance(me; Tolerance: out Vector from math; Tol: Real from Standard)
113 GetBounds(me; InfBound,SupBound: out Vector from math)
117 IsSolution(me: in out; Sol: Vector from math; Tol: Real from Standard)
119 returns Boolean from Standard
126 ---C++: return const&
132 ---C++: return const&
138 ---Purpose: Returns U,V coordinates of the point on the surface.
140 returns Pnt2d from gp
141 ---C++: return const&
147 ---Purpose: Returns parameter of the point on the curve.
149 returns Real from Standard
155 returns Boolean from Standard
161 ---C++: return const&
166 returns Vec2d from gp
167 ---C++: return const&
173 ---C++: return const&
177 Tangent(me; U,V: Real from Standard;
178 TgS,NormS: out Vec from gp);
180 ---Purpose: Returns the tangent vector at the section,
181 -- at the beginning and the end of the section, and
182 -- returns the normal (of the surface) at
185 -- methodes hors template (en plus du create)
187 Set(me: in out; Radius : Real from Standard;
188 Choix: Integer from Standard)
193 Set(me: in out; TypeSection: SectionShape from BlendFunc)
194 ---Purpose: Sets the type of section generation for the
200 Section(me: in out; Param: Real from Standard;
201 U,V,W: Real from Standard;
202 Pdeb,Pfin: out Real from Standard;
207 Section(me: in out; P: Point from Blend;
208 Poles : out Array1OfPnt from TColgp;
209 DPoles : out Array1OfVec from TColgp;
210 D2Poles : out Array1OfVec from TColgp;
211 Poles2d : out Array1OfPnt2d from TColgp;
212 DPoles2d : out Array1OfVec2d from TColgp;
213 D2Poles2d : out Array1OfVec2d from TColgp;
214 Weigths : out Array1OfReal from TColStd;
215 DWeigths : out Array1OfReal from TColStd;
216 D2Weigths : out Array1OfReal from TColStd)
218 ---Purpose: Used for the first and last section
219 -- The method returns Standard_True if the derivatives
220 -- are computed, otherwise it returns Standard_False.
222 returns Boolean from Standard
227 GetSection(me: in out; Param: Real from Standard;
228 U,V,W: Real from Standard;
229 tabP : out Array1OfPnt from TColgp;
230 tabV : out Array1OfVec from TColgp)
232 returns Boolean from Standard
237 --- Pour les approximations
239 IsRational(me) returns Boolean
240 ---Purpose: Returns if the section is rationnal
243 GetSectionSize(me) returns Real
244 ---Purpose: Returns the length of the maximum section
247 GetMinimalWeight(me; Weigths : out Array1OfReal from TColStd)
248 ---Purpose: Compute the minimal value of weight for each poles
252 NbIntervals(me; S : Shape from GeomAbs) returns Integer
253 ---Purpose: Returns the number of intervals for continuity
254 -- <S>. May be one if Continuity(me) >= <S>
257 Intervals(me; T : in out Array1OfReal from TColStd;
258 S : Shape from GeomAbs)
259 ---Purpose: Stores in <T> the parameters bounding the intervals
260 -- of continuity <S>.
262 -- The array must provide enough room to accomodate
263 -- for the parameters. i.e. T.Length() > NbIntervals()
265 -- OutOfRange from Standard
269 NbPoles : out Integer from Standard;
270 NbKnots : out Integer from Standard;
271 Degree : out Integer from Standard;
272 NbPoles2d : out Integer from Standard)
277 BoundTol, SurfTol, AngleTol : Real;
280 ---Purpose: Returns the tolerance to reach in approximation
282 -- BoundTol error at the Boundary
283 -- AngleTol tangent error at the Boundary
284 -- SurfTol error inside the surface.
287 Knots(me: in out; TKnots: out Array1OfReal from TColStd)
292 Mults(me: in out; TMults: out Array1OfInteger from TColStd)
297 Section(me: in out ; P: Point from Blend;
298 Poles : out Array1OfPnt from TColgp;
299 DPoles : out Array1OfVec from TColgp;
300 Poles2d : out Array1OfPnt2d from TColgp;
301 DPoles2d : out Array1OfVec2d from TColgp;
302 Weigths : out Array1OfReal from TColStd;
303 DWeigths : out Array1OfReal from TColStd)
305 ---Purpose: Used for the first and last section
307 returns Boolean from Standard
312 Section(me: in out ; P: Point from Blend;
313 Poles : out Array1OfPnt from TColgp;
314 Poles2d : out Array1OfPnt2d from TColgp;
315 Weigths : out Array1OfReal from TColStd)
321 IC2d : Integer from Standard;
322 Tol : Real from Standard;
323 TolU, TolV : out Real from Standard);
326 surf : HSurface from Adaptor3d;
327 curv : HCurve from Adaptor3d;
328 guide : HCurve from Adaptor3d;
329 law : Function from Law;
333 pt2d : Pnt2d from gp;
334 prmc : Real from Standard;
335 dprmc : Real from Standard;
336 istangent: Boolean from Standard;
338 tg2d : Vec2d from gp;
341 ray : Real from Standard;
342 choix : Integer from Standard;
346 normtg : Real from Standard;
348 maxang : Real from Standard;
349 minang : Real from Standard;
350 mySShape : SectionShape from BlendFunc;
351 myTConv : ParameterisationType from Convert;