0024737: Coding - remove <br> tag from header files
[occt.git] / src / AdvApprox / AdvApprox_ApproxAFunction.cdl
1 -- Created on: 1995-05-29
2 -- Created by: Xavier BENVENISTE
3 -- Copyright (c) 1995-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
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.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 class ApproxAFunction from AdvApprox 
18
19 uses Array1OfInteger   from TColStd,
20      Vector            from math,
21      HArray1OfInteger  from TColStd,
22      Array1OfReal      from TColStd,
23      Array1OfPnt2d     from TColgp,
24      Array1OfPnt       from TColgp,
25      HArray1OfReal     from TColStd,
26      HArray1OfPnt2d    from TColgp,
27      HArray1OfPnt      from TColgp,
28      HArray2OfReal     from TColStd,
29      HArray2OfPnt2d    from TColgp,
30      HArray2OfPnt      from TColgp,
31      Pnt               from gp,
32      Pnt2d             from gp,
33      Shape             from GeomAbs,
34      EvaluatorFunction from AdvApprox,
35      Cutting           from AdvApprox
36      
37 raises 
38
39     OutOfRange        from Standard,
40     ConstructionError from Standard
41
42 is   
43     Create(Num1DSS    : Integer ;
44            Num2DSS    : Integer ;
45            Num3DSS    : Integer ;
46            OneDTol    : HArray1OfReal from TColStd ;
47            TwoDTol    : HArray1OfReal from TColStd ;
48            ThreeDTol  : HArray1OfReal from TColStd ;
49            First      : Real ;
50            Last       : Real ;
51            Continuity : Shape from GeomAbs ;
52            MaxDeg     : Integer ;
53            MaxSeg     : Integer ;
54            Func       : EvaluatorFunction from AdvApprox) 
55            
56     returns ApproxAFunction from AdvApprox 
57     raises ConstructionError; 
58    
59     ---Purpose: Constructs approximator tool.
60     --
61     --  Warning:
62     --     the Func should be valid reference to object of type 
63     --     inherited from class EvaluatorFunction from Approx 
64     --     with life time longer than that of the approximator tool;
65     --     
66     --    the result should be formatted in the following way :
67     -- <--Num1DSS--> <--2 * Num2DSS--> <--3 * Num3DSS-->
68     -- R[0] ....     R[Num1DSS].....                   R[Dimension-1] 
69     --
70     --  the order in which each Subspace appears should be consistent
71     --  with the tolerances given in the create function and the
72     --  results will be given in that order as well that is :
73     --  Curve2d(n)  will correspond to the nth entry
74     --  described by Num2DSS, Curve(n) will correspond to
75     --  the nth entry described by Num3DSS 
76     --  The same type of schema applies to the Poles1d, Poles2d and 
77     --  Poles.
78
79
80     Create(Num1DSS    : Integer ;
81            Num2DSS    : Integer ;
82            Num3DSS    : Integer ;
83            OneDTol    : HArray1OfReal from TColStd ;
84            TwoDTol    : HArray1OfReal from TColStd ;
85            ThreeDTol  : HArray1OfReal from TColStd ;
86            First      : Real ;
87            Last       : Real ;
88            Continuity : Shape from GeomAbs ;
89            MaxDeg     : Integer ;
90            MaxSeg     : Integer ;
91            Func       : EvaluatorFunction from AdvApprox;
92            CutTool    : Cutting from AdvApprox)
93            
94       ---Purpose: Approximation with user methode of cutting
95
96       returns ApproxAFunction from AdvApprox 
97       raises ConstructionError;
98
99     Perform(me:in out; 
100             Num1DSS    : Integer ;
101             Num2DSS    : Integer ;
102             Num3DSS    : Integer ;
103             CutTool    : Cutting from AdvApprox) 
104             is private;
105             
106     Approximation(myclass; 
107                   TotalDimension  : Integer; 
108                   TotalNumSS      : Integer;
109                   LocalDimension  : Array1OfInteger;
110                   First           : Real;
111                   Last            : Real;
112                   Evaluator       : in out EvaluatorFunction;
113                   CutTool         : Cutting from AdvApprox;
114                   ContinuityOrder : Integer; 
115                   NumMaxCoeffs    : Integer; 
116                   MaxSegments     : Integer;   
117                   TolerancesArray : Array1OfReal;
118                   code_precis     : Integer;
119                   NumCurves       : in out Integer;
120                   NumCoeffPerCurveArray : in out Array1OfInteger;
121                   LocalCoefficientArray : in out Array1OfReal;
122                   IntervalsArray        : in out Array1OfReal; 
123                   ErrorMaxArray         : in out Array1OfReal;
124                   AverageErrorArray     : in out Array1OfReal;
125                   ErrorCode             : in out Integer);
126     
127      
128     IsDone(me) returns Boolean 
129     ---C++: inline
130     ;
131     --  True if the approximation succeeded within the imposed
132     --  tolerances 
133     HasResult(me) returns Boolean 
134     ---C++: inline
135     ;
136     -- True if the approximation did come out with a result that
137     --  is not NECESSARELY within the required tolerance
138     --  
139     Poles1d (me) 
140     ---C++: inline 
141     ---Purpose: returns the poles from the algorithms as is 
142     returns HArray2OfReal from TColStd ;
143     
144     Poles2d (me) 
145     ---Purpose: returns the poles from the algorithms as is
146     ---C++: inline 
147     returns HArray2OfPnt2d from TColgp ;
148
149     Poles   (me) 
150     ---Purpose: -- returns the poles from the algorithms as is 
151     ---C++: inline 
152     returns  HArray2OfPnt from TColgp ;
153     
154     NbPoles(me) returns Integer 
155     ---Purpose:  as the name says
156     ;
157
158     Poles1d (me; Index : Integer ;
159                  P : in out Array1OfReal from TColStd) 
160     ---Purpose: returns the poles at Index from the 1d subspace
161     raises OutOfRange ;
162
163     
164     Poles2d (me; Index : Integer ;
165                  P : in out Array1OfPnt2d from TColgp) 
166     ---Purpose:  returns the poles at Index from the 2d subspace
167     raises OutOfRange ;
168     
169     Poles   (me; Index : Integer ;
170                  P : in out Array1OfPnt from TColgp) 
171  
172     ---Purpose:  returns the poles at Index from the 3d subspace
173     raises OutOfRange ;
174     
175     Degree(me)  returns Integer 
176     ---C++: inline
177     ;
178     
179     NbKnots(me) returns Integer 
180     ---C++: inline
181     ;
182     NumSubSpaces(me; Dimension : Integer) returns Integer 
183     ---C++: inline
184     ; 
185     Knots(me) 
186     ---C++: inline
187     returns HArray1OfReal    from TColStd ;
188     
189     Multiplicities(me) 
190     ---C++: inline
191     returns HArray1OfInteger from TColStd ;
192     
193     MaxError    (me; Dimension : Integer)
194     ---Purpose:  returns the error as is in the algorithms
195     returns HArray1OfReal from TColStd ;
196     
197     AverageError(me; Dimension : Integer)
198
199     ---Purpose: returns the error as is in the algorithms
200     returns HArray1OfReal from TColStd ;
201     
202     MaxError (me; Dimension : Integer ;
203                   Index : Integer)    returns Real 
204     ;
205     
206     AverageError(me; Dimension : Integer;
207                     Index : Integer) returns Real 
208     ;
209     
210         
211     Dump(me; o: in out OStream);
212     ---Purpose: diplay information on approximation.
213
214 fields
215     -- Input fields 
216     -- 
217     myNumSubSpaces : Integer[3] ;
218     -- Number of subspaces [0] = number of 1 dimensional subspaces
219     --                     [1] = number of 2 dimensional subspaces
220     --                     [2] = number of 3 dimensional subspaces
221     
222     my1DTolerances   : HArray1OfReal from TColStd ;
223     my2DTolerances   : HArray1OfReal from TColStd ;
224     my3DTolerances   : HArray1OfReal from TColStd ;
225
226     --     -- self explanatory : one tolerance per subspace 
227     myFirst          : Real ;
228     -- first parameter for the approximation
229     myLast           : Real ;
230     -- last parameter for the approximation 
231     myContinuity     : Shape from GeomAbs ;
232     
233     -- continuity requested for the approximation
234     ---Warning:
235     --   The evaluator of the function to approximate
236     --   must provide the derivatives up to the requested
237     --   order otherwise this will NOT WORK
238     myMaxDegree      : Integer ;
239     -- maximum degree for the approximation
240      ---Warning:
241     --   Because of the unstable evaluation after degree 14
242     --   this is limited to 14
243     myMaxSegments    : Integer ;
244     -- maximum of segment allowed 
245     -- Output fields 
246     -- 
247     myDone           : Boolean ;
248     -- tells if the approximation succeeded within the requested
249     -- tolerance
250     myHasResult      : Boolean ;
251     -- tells if the approximation returned a result although
252     -- it might not be within the requested tolerance. In
253     -- that case myDone will be false
254     -- 
255     my1DPoles        : HArray2OfReal     from TColStd ;
256     -- 1D poles if myNumSubSpaces[0] > 0
257     my2DPoles        : HArray2OfPnt2d    from TColgp  ;
258     -- 2D poles if myNumSubSpaces[1] > 0 
259     my3DPoles        : HArray2OfPnt      from TColgp ;
260     -- 3D poles if myNumSubSpaces[2] > 0
261     myKnots          : HArray1OfReal     from TColStd ;
262     myMults          : HArray1OfInteger  from TColStd ;
263     myDegree         : Integer ;
264     
265     myEvaluator      : Address from Standard;   
266     -- 
267     -- The Errors 
268     -- 
269     my1DMaxError     : HArray1OfReal     from TColStd ;
270     my1DAverageError : HArray1OfReal     from TColStd ;
271     my2DMaxError     : HArray1OfReal     from TColStd ;
272     my2DAverageError : HArray1OfReal     from TColStd ;
273     my3DMaxError     : HArray1OfReal     from TColStd ;
274     my3DAverageError : HArray1OfReal     from TColStd ;
275     
276 end ApproxAFunction ;