0023024: Update headers of OCCT files
[occt.git] / src / Approx / Approx_ComputeCLine.cdl
CommitLineData
b311480e 1-- Created on: 1993-05-14
2-- Created by: Laurent PAINNOT
3-- Copyright (c) 1993-1999 Matra Datavision
4-- Copyright (c) 1999-2012 OPEN CASCADE SAS
5--
6-- The content of this file is subject to the Open CASCADE Technology Public
7-- License Version 6.5 (the "License"). You may not use the content of this file
8-- except in compliance with the License. Please obtain a copy of the License
9-- at http://www.opencascade.org and read it completely before using this file.
10--
11-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13--
14-- The Original Code and all software distributed under the License is
15-- distributed on an "AS IS" basis, without warranty of any kind, and the
16-- Initial Developer hereby disclaims all such warranties, including without
17-- limitation, any warranties of merchantability, fitness for a particular
18-- purpose or non-infringement. Please see the License for the specific terms
19-- and conditions governing the rights and limitations under the License.
20
7fd59977 21
22
23
24generic class ComputeCLine from Approx
25 (MultiLine as any;
26 LineTool as any) --as TheLineTool from AppCont(MultiLine)
27
28
29uses ParametrizationType from Approx,
30 SequenceOfReal from TColStd,
31 HArray1OfReal from TColStd,
32 SequenceOfMultiCurve from AppParCurves,
33 MultiCurve from AppParCurves,
34 Constraint from AppParCurves,
35 Vector from math
36
37
38
39private class MyLeastSquare instantiates LeastSquare from AppCont
40 (MultiLine,
41 LineTool);
42
43is
44
45
46 Create(Line: MultiLine;
47 degreemin: Integer = 3;
48 degreemax: Integer = 8;
49 Tolerance3d: Real = 1.0e-5;
50 Tolerance2d: Real = 1.0e-5;
51 cutting: Boolean = Standard_False;
52 FirstC: Constraint = AppParCurves_TangencyPoint;
53 LastC: Constraint = AppParCurves_TangencyPoint)
54
55 ---Purpose: The MultiLine <Line> will be approximated until tolerances
56 -- will be reached.
57 -- The approximation will be done from degreemin to degreemax
58 -- with a cutting if the corresponding boolean is True.
59
60 returns ComputeCLine;
61
62
63
64
65 Create(degreemin: Integer = 3;
66 degreemax: Integer = 8;
67 Tolerance3d: Real = 1.0e-05;
68 Tolerance2d: Real = 1.0e-05;
69 cutting: Boolean = Standard_False;
70 FirstC: Constraint = AppParCurves_TangencyPoint;
71 LastC: Constraint = AppParCurves_TangencyPoint)
72
73 ---Purpose: Initializes the fields of the algorithm.
74
75 returns ComputeCLine;
76
77
78 Perform(me: in out; Line: MultiLine)
79 ---Purpose: runs the algorithm after having initialized the fields.
80
81 is static;
82
83
84 Compute(me: in out; Line: MultiLine; Ufirst, Ulast: Real;
85 TheTol3d, TheTol2d: in out Real)
86 ---Purpose: is internally used by the algorithms.
87
88 returns Boolean
89 is static private;
90
91
92 SetDegrees(me: in out; degreemin, degreemax: Integer)
93 ---Purpose: changes the degrees of the approximation.
94
95 is static;
96
97
98 SetTolerances(me: in out; Tolerance3d, Tolerance2d: Real)
99 ---Purpose: Changes the tolerances of the approximation.
100
101 is static;
102
103
104 SetConstraints(me: in out; FirstC, LastC: Constraint)
105 ---Purpose: Changes the constraints of the approximation.
106
107 is static;
108
109
110 IsAllApproximated(me)
111 ---Purpose: returns False if at a moment of the approximation,
112 -- the status NoApproximation has been sent by the user
113 -- when more points were needed.
114
115 returns Boolean
116 is static;
117
118 IsToleranceReached(me)
119 ---Purpose: returns False if the status NoPointsAdded has been sent.
120
121 returns Boolean
122 is static;
123
124
125 Error(me; Index: Integer; tol3d: in out Real; tol2d: in out Real)
126 ---Purpose: returns the tolerances 2d and 3d of the <Index> MultiCurve.
127
128 is static;
129
130
131 NbMultiCurves(me)
132 ---Purpose: Returns the number of MultiCurve doing the approximation
133 -- of the MultiLine.
134 returns Integer
135 is static;
136
137
138 Value(me; Index: Integer = 1)
139 ---Purpose: returns the approximation MultiCurve of range <Index>.
140
141 returns MultiCurve from AppParCurves;
142
143
144 Parameters(me; Index: Integer; firstp, lastp: in out Real)
145 ---purpose: returns the first and last parameters of the
146 -- <Index> MultiCurve.
147 is static;
148
149
150fields
151
152
153myMultiCurves: SequenceOfMultiCurve from AppParCurves;
154myfirstparam: SequenceOfReal from TColStd;
155mylastparam: SequenceOfReal from TColStd;
156TheMultiCurve: MultiCurve from AppParCurves;
157alldone: Boolean;
158tolreached: Boolean;
159Tolers3d: SequenceOfReal from TColStd;
160Tolers2d: SequenceOfReal from TColStd;
161mydegremin: Integer;
162mydegremax: Integer;
163mytol3d: Real;
164mytol2d: Real;
165currenttol3d: Real;
166currenttol2d: Real;
167mycut: Boolean;
168myfirstC: Constraint;
169mylastC: Constraint;
170
171
172end ComputeCLine;