0024624: Lost word in license statement in source files
[occt.git] / src / FairCurve / FairCurve_Batten.cdl
CommitLineData
b311480e 1-- Created on: 1996-02-05
2-- Created by: Philippe MANGIN
3-- Copyright (c) 1996-1999 Matra Datavision
973c2be1 4-- Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5--
973c2be1 6-- This file is part of Open CASCADE Technology software library.
b311480e 7--
d5f74e42 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
973c2be1 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.
b311480e 13--
973c2be1 14-- Alternatively, this file may be used under the terms of Open CASCADE
15-- commercial license or contractual agreement.
7fd59977 16
17class Batten from FairCurve
18
19 ---Purpose: Constructs curves with a constant or linearly increasing
20 -- section to be used in the design of wooden or plastic
21 -- battens. These curves are two-dimensional, and
22 -- simulate physical splines or battens.
23
24uses Pnt2d from gp,
25 Vec2d from gp,
26 BSplineCurve from Geom2d,
27 HArray1OfPnt2d from TColgp,
28 HArray1OfReal from TColStd,
29 HArray1OfInteger from TColStd,
30 AnalysisCode from FairCurve
31
32raises NegativeValue, NullValue
33
34is
35 Create (P1,P2 : Pnt2d; Height : Real; Slope : Real = 0)
36
37 ---Purpose: Constructor with the two points and the geometrical
38 -- characteristics of the batten (elastic beam)
39 -- Height is the height of the deformation, and Slope is the
40 -- slope value, initialized at 0. The user can then supply the
41 -- desired slope value by the method, SetSlope.
42 -- Other parameters are initialized as follow :
43 -- - FreeSliding = False
44 -- - ConstraintOrder1 = 1
45 -- - ConstraintOrder2 = 1
46 -- - Angle1 = 0
47 -- - Angle2 = 0
48 -- - SlidingFactor = 1
49 -- Exceptions
50 -- NegativeValue if Height is less than or equal to 0.
51 -- NullValue if the distance between P1 and P2 is less
52 -- than or equal to the tolerance value for distance in
53 -- Precision::Confusion: P1.IsEqual(P2,
54 -- Precision::Confusion()). The function
55 -- gp_Pnt2d::IsEqual tests to see if this is the case.
56 returns Batten
57 raises NegativeValue,
58 NullValue;
59
60 Delete(me:out) is virtual;
61 ---C++: alias "Standard_EXPORT virtual ~FairCurve_Batten(){Delete();}"
62
63 SetFreeSliding (me : in out; FreeSliding : Boolean);
64 ---C++: inline
65 ---Purpose: Freesliding is initialized with the default setting false.
66 -- When Freesliding is set to true and, as a result, sliding
67 -- is free, the sliding factor is automatically computed to
68 -- satisfy the equilibrium of the batten.
69 --
70 SetConstraintOrder1 (me : in out; ConstraintOrder : Integer);
71 ---C++: inline
72 ---Purpose: Allows you to change the order of the constraint on the
73 -- first point. ConstraintOrder has the default setting of 1.
74 -- The following settings are available:
75 -- - 0-the curve must pass through a point
76 -- - 1-the curve must pass through a point and have a given tangent
77 -- - 2-the curve must pass through a point, have a given tangent and a given curvature.
78 -- The third setting is only valid for
79 -- FairCurve_MinimalVariation curves.
80 -- These constraints, though geometric, represent the
81 -- mechanical constraints due, for example, to the
82 -- resistance of the material the actual physical batten is made of.
83
84 SetConstraintOrder2 (me : in out; ConstraintOrder : Integer);
85 ---C++: inline
86 ---Purpose: Allows you to change the order of the constraint on the
87 -- second point. ConstraintOrder is initialized with the default setting of 1.
88 -- The following settings are available:
89 -- - 0-the curve must pass through a point
90 -- - 1-the curve must pass through a point and have a given tangent
91 -- - 2-the curve must pass through a point, have a given
92 -- tangent and a given curvature.
93 -- The third setting is only valid for
94 -- FairCurve_MinimalVariation curves.
95 -- These constraints, though geometric, represent the
96 -- mechanical constraints due, for example, to the
97 -- resistance of the material the actual physical batten is made of.
98
99 SetP1 (me : in out; P1: Pnt2d)
100 ---Purpose: Allows you to change the location of the point, P1, and in
101 -- doing so, modify the curve.
102 -- Warning
103 -- This method changes the angle as well as the point.
104 -- Exceptions
105 -- NullValue if the distance between P1 and P2 is less
106 -- than or equal to the tolerance value for distance in
107 -- Precision::Confusion: P1.IsEqual(P2,
108 -- Precision::Confusion()). The function
109 -- gp_Pnt2d::IsEqual tests to see if this is the case.
110 raises NullValue;
111
112 SetP2 (me : in out; P2: Pnt2d)
113 ---Purpose: Allows you to change the location of the point, P1, and in
114 -- doing so, modify the curve.
115 -- Warning
116 -- This method changes the angle as well as the point.
117 -- Exceptions
118 -- NullValue if the distance between P1 and P2 is less
119 -- than or equal to the tolerance value for distance in
120 -- Precision::Confusion: P1.IsEqual(P2,
121 -- Precision::Confusion()). The function
122 -- gp_Pnt2d::IsEqual tests to see if this is the case.
123 raises NullValue;
124
125 SetAngle1(me : in out; Angle1 : Real);
126 ---C++: inline
127 ---Purpose: Allows you to change the angle Angle1 at the first point,
128 -- P1. The default setting is 0.
129 --
130 SetAngle2 (me : in out; Angle2 : Real);
131 ---C++: inline
132 ---Purpose: Allows you to change the angle Angle2 at the second
133 -- point, P2. The default setting is 0.
134 --
135 SetHeight (me : in out; Height : Real)
136 ---C++: inline
137 ---Purpose: Allows you to change the height of the deformation.
138 -- Raises NegativeValue; -- if Height <= 0
139 raises NegativeValue; -- if Height <= 0
140
141 SetSlope (me : in out; Slope : Real);
142 ---C++: inline
143 ---Purpose: Allows you to set the slope value, Slope.
144
145 SetSlidingFactor(me : in out ; SlidingFactor : Real);
146 ---C++: inline
147 ---Purpose: Allows you to change the ratio SlidingFactor. This
148 -- compares the length of the batten and the reference
149 -- length, which is, in turn, a function of the constraints.
150 -- This modification has one of the following two effects:
151 -- - if you increase the value, it inflates the batten
152 -- - if you decrease the value, it flattens the batten.
153 -- When sliding is free, the sliding factor is automatically
154 -- computed to satisfy the equilibrium of the batten. When
155 -- sliding is imposed, a value is required for the sliding factor.
156 -- SlidingFactor is initialized with the default setting of 1.
157
158 Compute (me :in out;
159 Code : in out AnalysisCode;
160 NbIterations : Integer = 50;
161 Tolerance : Real = 1.0e-3 )
162 ---Purpose: Performs the algorithm, using the arguments Code,
163 -- NbIterations and Tolerance and computes the curve
164 -- with respect to the constraints.
165 -- Code will have one of the following values:
166 -- - OK
167 -- - NotConverged
168 -- - InfiniteSliding
169 -- - NullHeight
170 -- The parameters Tolerance and NbIterations control
171 -- how precise the computation is, and how long it will take.
172
173 returns Boolean
174 is virtual;
175
176 Compute (me :in out;
177 DeltaP1 : Vec2d;
178 DeltaP2 : Vec2d;
179 DeltaAngle1 : Real;
180 DeltaAngle2 : Real;
181 ACode : in out AnalysisCode;
182 NbIterations : Integer;
183 Tolerance: Real )
184 ---Purpose: compute the curve with respect of the delta-constraints.
185 returns Boolean is private;
186
187 SlidingOfReference(me) returns Real;
188 ---Purpose: Computes the real number value for length Sliding of
189 -- Reference for new constraints. If you want to give a
190 -- specific length to a batten curve, use the following
191 -- syntax: b.SetSlidingFactor(L /
192 -- b.SlidingOfReference()) where b is the
193 -- name of the batten curve object.
194
195 SlidingOfReference(me; D, A1, A2 : Real) returns Real is protected;
196 Compute(me; D, A1, A2 : Real) returns Real is protected;
197 Compute(me; D, A : Real) returns Real is protected;
198 --
199 -- Selector Methods ---------------------------------------
200 --
201 ---Purpose: Returns the effective geometrical constraints at the
202 -- last batten computation. This effectives values may
203 -- be not equal with the wanted values if
204 -- - if the value is "free"
205 -- - in the case of incomplete computation : collapse,
206 -- infinite sliding, height of batten will be negative at end points
207
208 GetFreeSliding (me)
209 ---C++: inline
210 ---Purpose: Returns the initial free sliding value, false by default.
211 -- Free sliding is generally more aesthetically pleasing
212 -- than constrained sliding. However, the computation can
213 -- fail with values such as angles greater than PI/2. This is
214 -- because the resulting batten length is theoretically infinite.
215 returns Boolean;
216
217 GetConstraintOrder1 (me)
218 ---C++: inline
219 ---Purpose: Returns the established first constraint order.
220 returns Integer;
221
222 GetConstraintOrder2 (me)
223 ---C++: inline
224 ---Purpose: Returns the established second constraint order.
225 returns Integer;
226
227 GetP1 (me)
228 ---C++: inline
229 ---C++: return const&
230 ---Purpose: Returns the established location of the point P1.
231 returns Pnt2d;
232
233 GetP2 (me)
234 ---C++: inline
235 ---C++: return const&
236 ---Purpose: Returns the established location of the point P2.
237 returns Pnt2d;
238
239 GetAngle1 (me)
240 ---C++: inline
241 ---Purpose: Returns the established first angle.
242 returns Real;
243
244 GetAngle2 (me)
245 ---C++: inline
246 ---Purpose: Returns the established second angle.
247 returns Real;
248
249 GetHeight (me)
250 ---C++: inline
251 ---Purpose: Returns the thickness of the lathe.
252 returns Real;
253
254 GetSlope (me)
255 ---C++: inline
256 ---Purpose: Returns the established slope value.
257 returns Real;
258
259 GetSlidingFactor(me)
260 ---C++: inline
261 ---Purpose: Returns the initial sliding factor.
262 returns Real;
263--
264-- result methods -------------------------------------------
265--
266 Curve(me)
267 ---Purpose: Returns the computed curve a 2d BSpline.
268 returns BSplineCurve;
269
270 Dump(me ; o : in out OStream) is virtual;
271 ---Purpose: Prints on the stream o information on the current state
272 -- of the object.
273---
274--- Private methodes --------------------------------------
275---
276
277 Angles(me : in out; P1, P2 : Pnt2d) is private;
278
279fields
280 myCode : AnalysisCode from FairCurve is protected;
281--- parameter of current Batten
282 OldP1, OldP2 : Pnt2d is protected;
283 OldAngle1, OldAngle2 : Real is protected;
284 OldHeight, OldSlope : Real is protected;
285 OldSlidingFactor : Real is protected;
286
287 OldFreeSliding : Boolean is protected;
288 OldConstraintOrder1, OldConstraintOrder2 : Integer is protected;
289
290 NewP1, NewP2 : Pnt2d is protected;
291 NewAngle1, NewAngle2 : Real is protected;
292 NewHeight, NewSlope : Real is protected;
293 NewSlidingFactor : Real is protected;
294
295--- parameter of next Batten
296 NewFreeSliding : Boolean is protected;
297 NewConstraintOrder1, NewConstraintOrder2 : Integer is protected;
298
299--- BSpline definition
300
301 Degree : Integer is protected;
302 Poles : HArray1OfPnt2d from TColgp is protected;
303 Flatknots : HArray1OfReal from TColStd is protected;
304 Knots : HArray1OfReal from TColStd is protected;
305 Mults : HArray1OfInteger from TColStd is protected;
306
307end Batten;