1 -- Created on: 1997-06-25
2 -- Created by: Philippe MANGIN
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 deferred class SweepFunction from Approx inherits TShared from MMgt
19 ---Purpose: defined the function used by SweepApproximation to
20 -- perform sweeping application.
26 Array1OfPnt from TColgp,
27 Array1OfPnt2d from TColgp,
28 Array1OfVec from TColgp,
29 Array1OfVec2d from TColgp,
30 Array1OfInteger from TColStd,
31 Array1OfReal from TColStd
33 raises NotImplemented ,
34 OutOfRange from Standard
39 --========== To compute Sections and derivatives Sections
44 Poles : out Array1OfPnt from TColgp;
45 Poles2d : out Array1OfPnt2d from TColgp;
46 Weigths : out Array1OfReal from TColStd)
47 ---Purpose: compute the section for v = param
48 returns Boolean is deferred;
53 Poles : out Array1OfPnt from TColgp;
54 DPoles : out Array1OfVec from TColgp;
55 Poles2d : out Array1OfPnt2d from TColgp;
56 DPoles2d : out Array1OfVec2d from TColgp;
57 Weigths : out Array1OfReal from TColStd;
58 DWeigths : out Array1OfReal from TColStd)
59 ---Purpose: compute the first derivative in v direction of the
60 -- section for v = param
61 -- Warning : It used only for C1 or C2 aproximation
69 Poles : out Array1OfPnt from TColgp;
70 DPoles : out Array1OfVec from TColgp;
71 D2Poles : out Array1OfVec from TColgp;
72 Poles2d : out Array1OfPnt2d from TColgp;
73 DPoles2d : out Array1OfVec2d from TColgp;
74 D2Poles2d : out Array1OfVec2d from TColgp;
75 Weigths : out Array1OfReal from TColStd;
76 DWeigths : out Array1OfReal from TColStd;
77 D2Weigths : out Array1OfReal from TColStd)
78 ---Purpose: compute the second derivative in v direction of the
79 -- section for v = param
80 -- Warning : It used only for C2 aproximation
86 -- =================== General Information On The Function ===================
89 ---Purpose: get the number of 2d curves to approximate.
90 returns Integer is deferred;
92 SectionShape(me; NbPoles : out Integer from Standard;
93 NbKnots : out Integer from Standard;
94 Degree : out Integer from Standard)
95 ---Purpose: get the format of an section
98 Knots(me; TKnots: out Array1OfReal from TColStd)
99 ---Purpose: get the Knots of the section
102 Mults(me; TMults: out Array1OfInteger from TColStd)
103 ---Purpose: get the Multplicities of the section
107 ---Purpose: Returns if the sections are rationnal or not
108 returns Boolean is deferred;
112 -- =================== Management of continuity ===================
114 NbIntervals(me; S : Shape from GeomAbs)
115 ---Purpose: Returns the number of intervals for continuity
117 -- May be one if Continuity(me) >= <S>
118 returns Integer is deferred;
120 Intervals(me; T : in out Array1OfReal from TColStd;
121 S : Shape from GeomAbs)
122 ---Purpose: Stores in <T> the parameters bounding the intervals
123 -- of continuity <S>.
125 -- The array must provide enough room to accomodate
126 -- for the parameters. i.e. T.Length() > NbIntervals()
128 OutOfRange from Standard
132 SetInterval(me: mutable; First, Last: Real from Standard)
133 ---Purpose: Sets the bounds of the parametric interval on
135 -- This determines the derivatives in these values if the
136 -- function is not Cn.
140 -- ===================== To help computation of Tolerance ======
141 -- Evaluation of error, in 2d space, or on rational function, is
142 -- difficult. The following methods can help the approximation to
143 -- make good evaluation and use good tolerances.
145 -- It is not necessary for the following informations to be very
146 -- precise. A fast evaluation is sufficient.
149 Index : Integer from Standard;
150 Tol : Real from Standard;
151 TolU, TolV : out Real from Standard)
152 ---Purpose: Returns the resolutions in the sub-space 2d <Index>
153 -- This information is usfull to find an good tolerance in
155 ---Warning: Used only if Nb2dCurve > 0
156 raises NotImplemented
161 BoundTol, SurfTol, AngleTol : Real;
162 Tol3d : out Array1OfReal)
163 ---Purpose: Returns the tolerance to reach in approximation
165 -- BoundTol error at the Boundary
166 -- AngleTol tangent error at the Boundary (in radian)
167 -- SurfTol error inside the surface.
171 SetTolerance(me : mutable; Tol3d, Tol2d : Real)
172 ---Purpose: Is usefull, if (me) have to run numerical
173 -- algorithm to perform D0, D1 or D2
177 ---Purpose: Get the barycentre of Surface.
178 -- An very poor estimation is sufficent.
179 -- This information is usefull to perform well
180 -- conditioned rational approximation.
181 -- Warning: Used only if <me> IsRational
183 raises NotImplemented
187 MaximalSection(me) returns Real
188 ---Purpose: Returns the length of the greater section. This
189 -- information is usefull to G1's control.
190 -- Warning: With an little value, approximation can be slower.
191 raises NotImplemented
194 GetMinimalWeight(me; Weigths : out Array1OfReal from TColStd)
195 ---Purpose: Compute the minimal value of weight for each poles
197 -- This information is usefull to control error
198 -- in rational approximation.
199 -- Warning: Used only if <me> IsRational
200 raises NotImplemented