1 -- Created on: 1998-07-08
2 -- Created by: Stephanie HUMEAU
3 -- Copyright (c) 1998-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 LocationGuide from GeomFill
18 inherits LocationLaw from GeomFill
21 HCurve from Adaptor3d,
26 Array1OfReal from TColStd,
27 Array1OfVec2d from TColgp,
28 Array1OfPnt2d from TColgp,
29 HArray1OfPnt2d from TColgp,
30 HArray2OfPnt2d from TColgp,
31 HArray1OfReal from TColStd,
33 HSurface from Adaptor3d,
37 TrihedronWithGuide from GeomFill,
40 TrimmedCurve from Geom,
41 SectionLaw from GeomFill,
42 PipeError from GeomFill,
46 NotImplemented, ConstructionError, OutOfRange
49 Create(Triedre : TrihedronWithGuide from GeomFill)
50 returns LocationGuide from GeomFill;
53 Section : SectionLaw from GeomFill;
54 rotat : Boolean from Standard;
60 EraseRotation(me : mutable);
62 SetRotation(me : mutable;
67 SetCurve(me : mutable; C : HCurve from Adaptor3d)
71 returns HCurve from Adaptor3d
72 ---C++: return const &
75 SetTrsf(me : mutable; Transfo : Mat from gp)
79 returns LocationLaw from GeomFill
87 ---Purpose: compute Location
88 returns Boolean is redefined;
95 Poles2d : out Array1OfPnt2d from TColgp)
96 ---Purpose: compute Location and 2d points
97 returns Boolean is redefined;
104 DM : out Mat from gp;
105 DV : out Vec from gp;
106 Poles2d : out Array1OfPnt2d from TColgp;
107 DPoles2d : out Array1OfVec2d from TColgp)
108 ---Purpose: compute location 2d points and associated
109 -- first derivatives.
110 -- Warning : It used only for C1 or C2 aproximation
118 DM : out Mat from gp;
119 DV : out Vec from gp;
120 D2M : out Mat from gp;
121 D2V : out Vec from gp;
122 Poles2d : out Array1OfPnt2d from TColgp;
123 DPoles2d : out Array1OfVec2d from TColgp;
124 D2Poles2d : out Array1OfVec2d from TColgp)
125 ---Purpose: compute location 2d points and associated
126 -- first and seconde derivatives.
127 -- Warning : It used only for C2 aproximation
133 -- ================== General Information On The Function ==================
136 HasFirstRestriction(me)
137 ---Purpose: Say if the first restriction is defined in this class.
138 -- If it is true the first element of poles array in
139 -- D0,D1,D2... Correspond to this restriction.
140 -- Returns Standard_False (default implementation)
144 HasLastRestriction(me) -- A FAIRE !!
145 ---Purpose: Say if the last restriction is defined in this class.
146 -- If it is true the last element of poles array in
147 -- D0,D1,D2... Correspond to this restriction.
148 -- Returns Standard_False (default implementation)
153 ---Purpose: Give the number of trace (Curves 2d wich are not restriction)
154 -- Returns 1 (default implementation)
159 ---Purpose:Give a status to the Law
160 -- Returns PipeOk (default implementation)
161 returns PipeError from GeomFill
165 -- =================== Management of continuity ===================
167 NbIntervals(me; S : Shape from GeomAbs)
168 ---Purpose: Returns the number of intervals for continuity
170 -- May be one if Continuity(me) >= <S>
171 returns Integer is redefined;
173 Intervals(me; T : in out Array1OfReal from TColStd;
174 S : Shape from GeomAbs)
175 ---Purpose: Stores in <T> the parameters bounding the intervals
176 -- of continuity <S>.
178 -- The array must provide enough room to accomodate
179 -- for the parameters. i.e. T.Length() > NbIntervals()
181 OutOfRange from Standard
185 SetInterval(me: mutable; First, Last: Real from Standard)
186 ---Purpose: Sets the bounds of the parametric interval on
188 -- This determines the derivatives in these values if the
189 -- function is not Cn.
192 GetInterval(me; First, Last: out Real from Standard)
193 ---Purpose: Gets the bounds of the parametric interval on
197 GetDomain(me; First, Last: out Real from Standard)
198 ---Purpose: Gets the bounds of the function parametric domain.
199 -- Warning: This domain it is not modified by the
203 -- =================== To help computation of Tolerance ===============
205 -- Evaluation of error, in 2d space, or on composed function, is
206 -- difficult. The following methods can help the approximation to
207 -- make good evaluation and use good tolerances.
209 -- It is not necessary for the following informations to be very
210 -- precise. A fast evaluation is sufficient.
212 SetTolerance(me : mutable; Tol3d, Tol2d : Real)
213 ---Purpose: Is usefull, if (me) have to run numerical
214 -- algorithm to perform D0, D1 or D2
215 -- The default implementation make nothing.
219 Index : Integer from Standard;
220 Tol : Real from Standard;
221 TolU, TolV : out Real from Standard)
222 ---Purpose: Returns the resolutions in the sub-space 2d <Index>
223 -- This information is usfull to find an good tolerance in
225 -- Warning: Used only if Nb2dCurve > 0
229 GetMaximalNorm(me : mutable)
230 ---Purpose: Get the maximum Norm of the matrix-location part. It
231 -- is usful to find an good Tolerance to approx M(t).
235 GetAverageLaw(me : mutable;
238 ---Purpose: Get average value of M(t) and V(t) it is usfull to
239 -- make fast approximation of rational surfaces.
243 -- To find elementary sweep
245 IsTranslation(me; Error : out Real)
246 ---Purpose: Say if the Location Law, is an translation of Location
247 -- The default implementation is " returns False ".
251 IsRotation(me; Error : out Real )
252 ---Purpose: Say if the Location Law, is a rotation of Location
253 -- The default implementation is " returns False ".
257 Rotation(me; Center : out Pnt from gp)
262 returns Curve from Geom;
265 returns HCurve from Adaptor3d;
268 Param : Real from Standard)
271 SetOrigine(me : mutable;
276 ComputeAutomaticLaw(me; ParAndRad : out HArray1OfPnt2d from TColgp)
277 returns PipeError from GeomFill;
280 myLaw : TrihedronWithGuide from GeomFill; -- loi de triedre
281 mySec : SectionLaw from GeomFill; -- loi de section
282 myCurve : HCurve from Adaptor3d; -- trajectoire
283 myGuide : HCurve from Adaptor3d; -- guide
284 myTrimmed : HCurve from Adaptor3d; -- trajectoire trimme
286 myPoles2d : HArray2OfPnt2d from TColgp is protected;
288 myNbPts : Integer from Standard;
289 rotation : Boolean from Standard; -- contact ou non
290 OrigParam1 : Real from Standard; -- pour ACR
291 OrigParam2 : Real from Standard;
292 Uf, Ul : Real from Standard;
293 myFirstS : Real from Standard;
294 myLastS : Real from Standard;
295 ratio : Real from Standard;
297 WithTrans: Boolean from Standard;
299 TolRes : Vector from math;
300 Inf, Sup: Vector from math;
301 X, R : Vector from math;
303 myStatus : PipeError from GeomFill;