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 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 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;
84 ---C++: alias " Standard_EXPORT virtual ~AppParCurves_MultiCurve();"
86 SetNbPoles(me: in out; nbPoles: Integer)
87 ---Purpose: The number of poles of the MultiCurve
88 -- will be set to <nbPoles>.
94 SetValue(me: in out; Index: Integer;
95 MPoint: MultiPoint from AppParCurves)
96 ---Purpose: sets the MultiPoint of range Index to the value
98 -- An exception is raised if Index <0 or Index >NbMPoint.
100 raises OutOfRange from Standard,
101 DimensionError from Standard
107 ---Purpose: Returns the number of curves resulting from the
108 -- approximation of a MultiLine.
115 ---Purpose: Returns the number of poles on curves resulting from the approximation of a MultiLine.
122 ---Purpose: returns the degree of the curves.
128 Dimension(me; CuIndex: Integer)
129 ---Purpose: returns the dimension of the CuIndex curve.
130 -- An exception is raised if CuIndex<0 or CuIndex>NbCurves.
132 raises OutOfRange from Standard
136 Curve(me; CuIndex: Integer; TabPnt: in out Array1OfPnt)
137 ---Purpose: returns the Pole array of the curve of range CuIndex.
138 -- An exception is raised if the dimension of the curve
141 raises OutOfRange from Standard,
142 DimensionError from Standard
146 Curve(me; CuIndex: Integer; TabPnt: in out Array1OfPnt2d)
147 ---Purpose: returns the Pole array of the curve of range CuIndex.
148 -- An exception is raised if the dimension of the curve
151 raises OutOfRange from Standard,
152 DimensionError from Standard
156 Value(me; Index: Integer)
157 ---Purpose: returns the Index MultiPoint.
158 -- An exception is raised if Index <0 or Index >Degree+1.
159 ---C++: return const&
161 returns MultiPoint from AppParCurves
162 raises OutOfRange from Standard
166 Pole(me; CuIndex, Nieme: Integer)
167 ---Purpose: returns the Nieme pole of the CuIndex curve.
168 -- the curve must be a 3D curve.
169 ---C++: return const&
172 raises OutOfRange from Standard
176 Pole2d(me; CuIndex, Nieme: Integer)
177 ---Purpose: returns the Nieme pole of the CuIndex curve.
178 -- the curve must be a 2D curve.
179 ---C++: return const&
181 returns Pnt2d from gp
182 raises OutOfRange from Standard
186 Transform(me: in out; CuIndex: Integer; x, dx, y, dy, z, dz: Real)
187 ---Purpose: Applies a transformation to the curve of range
189 -- newx = x + dx*oldx
190 -- newy = y + dy*oldy for all points of the curve.
191 -- newz = z + dz*oldz
193 raises OutOfRange from Standard
197 Transform2d(me: in out; CuIndex: Integer; x, dx, y, dy: Real)
198 ---Purpose: Applies a transformation to the Curve of range
200 -- newx = x + dx*oldx
201 -- newy = y + dy*oldy for all points of the curve.
203 raises OutOfRange from Standard
207 Value(me; CuIndex: Integer; U: Real; Pt: out Pnt)
208 ---Purpose: returns the value of the point with a parameter U
209 -- on the Bezier curve number CuIndex.
210 -- An exception is raised if CuIndex <0 or > NbCurves.
211 -- An exception is raised if the curve dimension is 2d.
213 raises OutOfRange from Standard,
214 DimensionError from Standard
218 Value(me; CuIndex: Integer; U: Real; Pt: out Pnt2d)
219 ---Purpose: returns the value of the point with a parameter U
220 -- on the Bezier curve number CuIndex.
221 -- An exception is raised if CuIndex <0 or > NbCurves.
222 -- An exception is raised if the curve dimension is 3d.
224 raises OutOfRange from Standard,
225 DimensionError from Standard
229 D1(me; CuIndex: Integer; U: Real; Pt: out Pnt; V1: out Vec)
230 ---Purpose: returns the value of the point with a parameter U
231 -- on the Bezier curve number CuIndex.
232 -- An exception is raised if CuIndex <0 or > NbCurves.
233 -- An exception is raised if the curve dimension is 3d.
235 raises OutOfRange from Standard,
236 DimensionError from Standard
240 D1(me; CuIndex: Integer; U: Real; Pt: out Pnt2d; V1: out Vec2d)
241 ---Purpose: returns the value of the point with a parameter U
242 -- on the Bezier curve number CuIndex.
243 -- An exception is raised if CuIndex <0 or > NbCurves.
244 -- An exception is raised if the curve dimension is 2d.
246 raises OutOfRange from Standard,
247 DimensionError from Standard
250 D2(me; CuIndex: Integer; U: Real; Pt: out Pnt; V1: out Vec; V2: out Vec)
251 ---Purpose: returns the value of the point with a parameter U
252 -- on the Bezier curve number CuIndex.
253 -- An exception is raised if CuIndex <0 or > NbCurves.
254 -- An exception is raised if the curve dimension is 3d.
256 raises OutOfRange from Standard,
257 DimensionError from Standard
261 D2(me; CuIndex: Integer; U: Real; Pt: out Pnt2d;
262 V1: out Vec2d; V2: out Vec2d)
263 ---Purpose: returns the value of the point with a parameter U
264 -- on the Bezier curve number CuIndex.
265 -- An exception is raised if CuIndex <0 or > NbCurves.
266 -- An exception is raised if the curve dimension is 2d.
268 raises OutOfRange from Standard,
269 DimensionError from Standard
273 Dump(me; o: in out OStream)
274 ---Purpose: Prints on the stream o information on the current
275 -- state of the object.
276 -- Is used to redefine the operator <<.
283 tabPoint: HArray1OfMultiPoint from AppParCurves is protected;