1 -- Created on: 1991-12-02
2 -- Created by: Laurent PAINNOT
3 -- Copyright (c) 1991-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
9 -- under the terms of the GNU Lesser General Public 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 MultiCurve from AppParCurves
19 ---Purpose: This class describes a MultiCurve approximating a Multiline.
20 -- As a Multiline is a set of n lines, a MultiCurve is a set
21 -- of n curves. These curves are Bezier curves.
22 -- A MultiCurve is composed of m MultiPoint.
23 -- The approximating degree of these n curves is the same for
27 -- Example of a MultiCurve composed of MultiPoints:
29 -- P1______P2_____P3______P4________........_____PNbMPoints
31 -- Q1______Q2_____Q3______Q4________........_____QNbMPoints
35 -- R1______R2_____R3______R4________........_____RNbMPoints
38 -- Pi, Qi, ..., Ri are points of dimension 2 or 3.
40 -- (Pi, Qi, ...Ri), i= 1,...NbPoles are MultiPoints.
41 -- each MultiPoint has got NbPol Poles.
44 uses MultiPoint from AppParCurves,
45 HArray1OfMultiPoint from AppParCurves,
46 Array1OfMultiPoint from AppParCurves,
47 Array1OfPnt from TColgp,
48 Array1OfPnt2d from TColgp,
56 raises OutOfRange from Standard,
57 DimensionError from Standard,
58 ConstructionError from Standard
62 Create returns MultiCurve;
63 ---Purpose: returns an indefinite MultiCurve.
66 Create(NbPol: Integer)
67 ---Purpose: creates a MultiCurve, describing Bezier curves all
68 -- containing the same number of MultiPoint.
69 -- An exception is raised if Degree < 0.
72 returns MultiCurve from AppParCurves
73 raises OutOfRange from Standard;
76 Create(tabMU: Array1OfMultiPoint)
77 ---Purpose: creates a MultiCurve, describing Bezier curves all
78 -- containing the same number of MultiPoint.
79 -- Each MultiPoint must have NbCurves Poles.
81 returns MultiCurve from AppParCurves
82 raises ConstructionError from Standard;
85 Delete(me:out) is virtual;
86 ---C++: alias "Standard_EXPORT virtual ~AppParCurves_MultiCurve(){Delete();}"
88 SetNbPoles(me: in out; nbPoles: Integer)
89 ---Purpose: The number of poles of the MultiCurve
90 -- will be set to <nbPoles>.
96 SetValue(me: in out; Index: Integer;
97 MPoint: MultiPoint from AppParCurves)
98 ---Purpose: sets the MultiPoint of range Index to the value
100 -- An exception is raised if Index <0 or Index >NbMPoint.
102 raises OutOfRange from Standard,
103 DimensionError from Standard
109 ---Purpose: Returns the number of curves resulting from the
110 -- approximation of a MultiLine.
117 ---Purpose: Returns the number of poles on curves resulting from the approximation of a MultiLine.
124 ---Purpose: returns the degree of the curves.
130 Dimension(me; CuIndex: Integer)
131 ---Purpose: returns the dimension of the CuIndex curve.
132 -- An exception is raised if CuIndex<0 or CuIndex>NbCurves.
134 raises OutOfRange from Standard
138 Curve(me; CuIndex: Integer; TabPnt: in out Array1OfPnt)
139 ---Purpose: returns the Pole array of the curve of range CuIndex.
140 -- An exception is raised if the dimension of the curve
143 raises OutOfRange from Standard,
144 DimensionError from Standard
148 Curve(me; CuIndex: Integer; TabPnt: in out Array1OfPnt2d)
149 ---Purpose: returns the Pole array of the curve of range CuIndex.
150 -- An exception is raised if the dimension of the curve
153 raises OutOfRange from Standard,
154 DimensionError from Standard
158 Value(me; Index: Integer)
159 ---Purpose: returns the Index MultiPoint.
160 -- An exception is raised if Index <0 or Index >Degree+1.
161 ---C++: return const&
163 returns MultiPoint from AppParCurves
164 raises OutOfRange from Standard
168 Pole(me; CuIndex, Nieme: Integer)
169 ---Purpose: returns the Nieme pole of the CuIndex curve.
170 -- the curve must be a 3D curve.
171 ---C++: return const&
174 raises OutOfRange from Standard
178 Pole2d(me; CuIndex, Nieme: Integer)
179 ---Purpose: returns the Nieme pole of the CuIndex curve.
180 -- the curve must be a 2D curve.
181 ---C++: return const&
183 returns Pnt2d from gp
184 raises OutOfRange from Standard
188 Transform(me: in out; CuIndex: Integer; x, dx, y, dy, z, dz: Real)
189 ---Purpose: Applies a transformation to the curve of range
191 -- newx = x + dx*oldx
192 -- newy = y + dy*oldy for all points of the curve.
193 -- newz = z + dz*oldz
195 raises OutOfRange from Standard
199 Transform2d(me: in out; CuIndex: Integer; x, dx, y, dy: Real)
200 ---Purpose: Applies a transformation to the Curve of range
202 -- newx = x + dx*oldx
203 -- newy = y + dy*oldy for all points of the curve.
205 raises OutOfRange from Standard
209 Value(me; CuIndex: Integer; U: Real; Pt: out Pnt)
210 ---Purpose: returns the value of the point with a parameter U
211 -- on the Bezier curve number CuIndex.
212 -- An exception is raised if CuIndex <0 or > NbCurves.
213 -- An exception is raised if the curve dimension is 2d.
215 raises OutOfRange from Standard,
216 DimensionError from Standard
220 Value(me; CuIndex: Integer; U: Real; Pt: out Pnt2d)
221 ---Purpose: returns the value of the point with a parameter U
222 -- on the Bezier curve number CuIndex.
223 -- An exception is raised if CuIndex <0 or > NbCurves.
224 -- An exception is raised if the curve dimension is 3d.
226 raises OutOfRange from Standard,
227 DimensionError from Standard
231 D1(me; CuIndex: Integer; U: Real; Pt: out Pnt; V1: out Vec)
232 ---Purpose: returns the value of the point with a parameter U
233 -- on the Bezier curve number CuIndex.
234 -- An exception is raised if CuIndex <0 or > NbCurves.
235 -- An exception is raised if the curve dimension is 3d.
237 raises OutOfRange from Standard,
238 DimensionError from Standard
242 D1(me; CuIndex: Integer; U: Real; Pt: out Pnt2d; V1: out Vec2d)
243 ---Purpose: returns the value of the point with a parameter U
244 -- on the Bezier curve number CuIndex.
245 -- An exception is raised if CuIndex <0 or > NbCurves.
246 -- An exception is raised if the curve dimension is 2d.
248 raises OutOfRange from Standard,
249 DimensionError from Standard
252 D2(me; CuIndex: Integer; U: Real; Pt: out Pnt; V1: out Vec; V2: out Vec)
253 ---Purpose: returns the value of the point with a parameter U
254 -- on the Bezier curve number CuIndex.
255 -- An exception is raised if CuIndex <0 or > NbCurves.
256 -- An exception is raised if the curve dimension is 3d.
258 raises OutOfRange from Standard,
259 DimensionError from Standard
263 D2(me; CuIndex: Integer; U: Real; Pt: out Pnt2d;
264 V1: out Vec2d; V2: out Vec2d)
265 ---Purpose: returns the value of the point with a parameter U
266 -- on the Bezier curve number CuIndex.
267 -- An exception is raised if CuIndex <0 or > NbCurves.
268 -- An exception is raised if the curve dimension is 2d.
270 raises OutOfRange from Standard,
271 DimensionError from Standard
275 Dump(me; o: in out OStream)
276 ---Purpose: Prints on the stream o information on the current
277 -- state of the object.
278 -- Is used to redefine the operator <<.
285 tabPoint: HArray1OfMultiPoint from AppParCurves is protected;