1 -- Created on: 1993-06-03
2 -- Created by: Bruno DUMORTIER
3 -- Copyright (c) 1993-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 Curve from Geom2dAdaptor inherits Curve2d from Adaptor2d
19 ---Purpose: An interface between the services provided by any
20 -- curve from the package Geom2d and those required
21 -- of the curve by algorithms which use it.
30 Array1OfReal from TColStd,
32 BezierCurve from Geom2d,
33 BSplineCurve from Geom2d,
34 CurveType from GeomAbs,
36 HCurve2d from Adaptor2d,
40 raises NoSuchObject from Standard,
41 ConstructionError from Standard,
42 OutOfRange from Standard,
43 DomainError from Standard
48 Create returns Curve from Geom2dAdaptor;
50 Create(C : Curve from Geom2d) returns Curve from Geom2dAdaptor;
52 Create(C : Curve from Geom2d; UFirst,ULast : Real)
53 returns Curve from Geom2dAdaptor
55 ConstructionError from Standard;
56 ---Purpose: ConstructionError is raised if Ufirst>Ulast
58 Load(me : in out; C : Curve from Geom2d);
61 Load(me : in out; C : Curve from Geom2d; UFirst,ULast : Real)
63 ConstructionError from Standard;
65 ---Purpose: ConstructionError is raised if Ufirst>Ulast
67 Curve(me) returns Curve from Geom2d
74 FirstParameter(me) returns Real
78 LastParameter(me) returns Real
82 Continuity(me) returns Shape from GeomAbs
85 NbIntervals(me; S : Shape from GeomAbs) returns Integer
86 ---Purpose: If necessary, breaks the curve in intervals of
87 -- continuity <S>. And returns the number of
91 Intervals(me; T : in out Array1OfReal from TColStd;
92 S : Shape from GeomAbs)
93 ---Purpose: Stores in <T> the parameters bounding the intervals
96 -- The array must provide enough room to accomodate
97 -- for the parameters. i.e. T.Length() > NbIntervals()
99 OutOfRange from Standard
102 Trim(me; First, Last, Tol : Real) returns HCurve2d from Adaptor2d
103 ---Purpose: Returns a curve equivalent of <me> between
104 -- parameters <First> and <Last>. <Tol> is used to
105 -- test for 3d points confusion.
107 OutOfRange from Standard
108 ---Purpose: If <First> >= <Last>
111 IsClosed(me) returns Boolean
114 IsPeriodic(me) returns Boolean
117 Period(me) returns Real
119 DomainError from Standard -- if the curve is not periodic
123 Value(me; U : Real) returns Pnt2d from gp
124 --- Purpose : Computes the point of parameter U on the curve
127 ValueBSpline(me; U: Real) returns Pnt2d from gp
128 --- Purpose : Computes the point of parameter U on the B-spline curve
131 ValueOffset(me; U: Real) returns Pnt2d from gp
132 --- Purpose : Computes the point of parameter U on the offset curve
135 D0 (me; U : Real; P : out Pnt2d from gp)
136 --- Purpose : Computes the point of parameter U.
139 D0BSpline(me; theU : Real; theP : out Pnt2d from gp)
140 --- Purpose : Computes the point of parameter U on the B-spline curve
143 D0Offset(me; theU : Real; theP : out Pnt2d from gp)
144 --- Purpose : Computes the point of parameter U on the offset curve
147 D1 (me; U : Real; P : out Pnt2d from gp ; V : out Vec2d from gp)
148 --- Purpose : Computes the point of parameter U on the curve with its
151 DomainError from Standard
152 --- Purpose : Raised if the continuity of the current interval
156 D1BSpline(me; theU : Real; theP : out Pnt2d from gp ; theV : out Vec2d from gp)
157 --- Purpose : Computes the point of parameter U on the B-spline curve
158 -- and its derivative
161 D1Offset(me; theU : Real; theP : out Pnt2d from gp ; theV : out Vec2d from gp)
162 --- Purpose : Computes the point of parameter U on the offset curve
163 -- and its derivative
166 D2 (me; U : Real; P : out Pnt2d from gp; V1, V2 : out Vec2d from gp)
168 -- Returns the point P of parameter U, the first and second
169 -- derivatives V1 and V2.
171 DomainError from Standard
172 --- Purpose : Raised if the continuity of the current interval
176 D2BSpline(me; theU : Real; theP : out Pnt2d from gp; theV1, theV2 : out Vec2d from gp)
177 --- Purpose : Computes the point of parameter U on the B-spline curve
178 -- and its first and second derivatives
181 D2Offset(me; theU : Real; theP : out Pnt2d from gp; theV1, theV2 : out Vec2d from gp)
182 --- Purpose : Computes the point of parameter U on the offset curve
183 -- and its first and second derivatives
186 D3 (me; U : Real; P : out Pnt2d from gp; V1, V2, V3 : out Vec2d from gp)
188 -- Returns the point P of parameter U, the first, the second
189 -- and the third derivative.
191 DomainError from Standard
192 --- Purpose : Raised if the continuity of the current interval
196 D3BSpline(me; theU : Real; theP : out Pnt2d from gp; theV1, theV2, theV3 : out Vec2d from gp)
197 --- Purpose : Computes the point of parameter U on the B-spline curve
198 -- and its first, second and third derivatives
201 D3Offset(me; theU : Real; theP : out Pnt2d from gp; theV1, theV2, theV3 : out Vec2d from gp)
202 --- Purpose : Computes the point of parameter U on the offset curve
203 -- and its first, second and third derivatives
206 DN (me; U : Real; N : Integer) returns Vec2d from gp
208 -- The returned vector gives the value of the derivative for the
209 -- order of derivation N.
211 DomainError from Standard,
212 --- Purpose : Raised if the continuity of the current interval
214 OutOfRange from Standard
215 --- Purpose : Raised if N < 1.
218 DNBSpline(me; theU : Real; N : Integer) returns Vec2d from gp
220 -- The returned vector gives the value of the derivative for the
221 -- order of derivation N.
224 DNOffset(me; theU : Real; N : Integer) returns Vec2d from gp
226 -- The returned vector gives the value of the derivative for the
227 -- order of derivation N.
231 Resolution(me; Ruv :Real) returns Real
232 ---Purpose : returns the parametric resolution
236 GetType(me) returns CurveType from GeomAbs
240 Line(me) returns Lin2d from gp
242 NoSuchObject from Standard
245 Circle(me) returns Circ2d from gp
247 NoSuchObject from Standard
250 Ellipse(me) returns Elips2d from gp
252 NoSuchObject from Standard
255 Hyperbola(me) returns Hypr2d from gp
257 NoSuchObject from Standard
260 Parabola(me) returns Parab2d from gp
262 NoSuchObject from Standard
266 Degree(me) returns Integer
268 NoSuchObject from Standard
271 IsRational(me) returns Boolean
273 NoSuchObject from Standard
276 NbPoles(me) returns Integer
278 NoSuchObject from Standard
282 NbKnots(me) returns Integer
284 NoSuchObject from Standard
287 NbSamples(me) returns Integer from Standard is redefined;
289 Bezier(me) returns BezierCurve from Geom2d
291 NoSuchObject from Standard
294 BSpline(me) returns BSplineCurve from Geom2d
296 NoSuchObject from Standard
299 LocalContinuity(me; U1, U2 : Real) returns Shape from GeomAbs
302 load(me : in out; C : Curve from Geom2d; UFirst,ULast : Real)
305 RebuildCache(me; theParameter : Real)
306 ---Purpose: Rebuilds B-spline cache
307 -- \param theParameter the value on the knot axis which identifies the caching span
312 myCurve : Curve from Geom2d ;
313 myTypeCurve : CurveType from GeomAbs ;
314 myFirst : Real from Standard ;
315 myLast : Real from Standard;
316 myCurveCache : Cache from BSplCLib;
317 myOffsetBaseCurveAdaptor : HCurve2d from Adaptor2d;