1 -- Created on: 1992-09-01
2 -- Created by: Modelistation
3 -- Copyright (c) 1992-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 GeomAdaptor inherits Curve from Adaptor3d
19 ---Purpose: This class provides an interface between the services provided by any
20 -- curve from the package Geom and those required of the curve by algorithms which use it.
21 -- Creation of the loaded curve the curve is C1 by piece.
30 Array1OfReal from TColStd,
32 BezierCurve from Geom,
33 BSplineCurve from Geom,
34 CurveType from GeomAbs,
36 HCurve from Adaptor3d,
39 raises NoSuchObject from Standard,
40 ConstructionError from Standard,
41 OutOfRange from Standard,
42 DomainError from Standard
48 returns Curve from GeomAdaptor;
51 Create(C : Curve from Geom)
52 returns Curve from GeomAdaptor;
55 Create(C : Curve from Geom; UFirst,ULast : Real)
56 returns Curve from GeomAdaptor
58 ConstructionError from Standard;
59 ---Purpose: ConstructionError is raised if Ufirst>Ulast
62 Load(me : in out; C : Curve from Geom);
65 Load(me : in out; C : Curve from Geom; UFirst,ULast : Real)
67 ConstructionError from Standard;
69 ---Purpose: ConstructionError is raised if Ufirst>Ulast
71 Curve(me) returns Curve from Geom
73 -- Provides a curve inherited from Hcurve from Adaptor.
74 -- This is inherited to provide easy to use constructors.
81 FirstParameter(me) returns Real
85 LastParameter(me) returns Real
89 Continuity(me) returns Shape from GeomAbs
92 NbIntervals(me; S : Shape from GeomAbs) returns Integer
93 ---Purpose: Returns the number of intervals for continuity
94 -- <S>. May be one if Continuity(me) >= <S>
97 Intervals(me; T : in out Array1OfReal from TColStd;
98 S : Shape from GeomAbs)
99 ---Purpose: Stores in <T> the parameters bounding the intervals
100 -- of continuity <S>.
102 -- The array must provide enough room to accomodate
103 -- for the parameters. i.e. T.Length() > NbIntervals()
105 OutOfRange from Standard
108 Trim(me; First, Last, Tol : Real) returns HCurve from Adaptor3d
109 ---Purpose: Returns a curve equivalent of <me> between
110 -- parameters <First> and <Last>. <Tol> is used to
111 -- test for 3d points confusion.
113 OutOfRange from Standard
114 ---Purpose: If <First> >= <Last>
117 IsClosed(me) returns Boolean
120 IsPeriodic(me) returns Boolean
123 Period(me) returns Real
125 DomainError from Standard -- if the curve is not periodic
129 Value(me; U : Real) returns Pnt from gp
130 --- Purpose : Computes the point of parameter U on the curve
133 ValueBSpline(me; U: Real) returns Pnt from gp
134 --- Purpose : Computes the point of parameter U on the B-spline curve
137 ValueOffset(me; U: Real) returns Pnt from gp
138 --- Purpose : Computes the point of parameter U on the offset curve
141 D0 (me; U : Real; P : out Pnt from gp)
142 --- Purpose : Computes the point of parameter U.
145 D0BSpline(me; theU : Real; theP : out Pnt from gp)
146 --- Purpose : Computes the point of parameter U on the B-spline curve
149 D0Offset(me; theU : Real; theP : out Pnt from gp)
150 --- Purpose : Computes the point of parameter U on the offset curve
153 D1 (me; U : Real; P : out Pnt from gp ; V : out Vec from gp)
154 --- Purpose : Computes the point of parameter U on the curve
155 -- with its first derivative.
157 -- Warning : On the specific case of BSplineCurve:
158 -- if the curve is cut in interval of continuity at least C1, the
159 -- derivatives are computed on the current interval.
160 -- else the derivatives are computed on the basis curve.
163 D1BSpline(me; theU : Real; theP : out Pnt from gp ; theV : out Vec from gp)
164 --- Purpose : Computes the point of parameter U on the B-spline curve
165 -- and its derivative
168 D1Offset(me; theU : Real; theP : out Pnt from gp ; theV : out Vec from gp)
169 --- Purpose : Computes the point of parameter U on the offset curve
170 -- and its derivative
173 D2 (me; U : Real; P : out Pnt from gp; V1, V2 : out Vec from gp)
175 -- Returns the point P of parameter U, the first and second
176 -- derivatives V1 and V2.
178 -- Warning : On the specific case of BSplineCurve:
179 -- if the curve is cut in interval of continuity at least C2, the
180 -- derivatives are computed on the current interval.
181 -- else the derivatives are computed on the basis curve.
184 D2BSpline(me; theU : Real; theP : out Pnt from gp; theV1, theV2 : out Vec from gp)
185 --- Purpose : Computes the point of parameter U on the B-spline curve
186 -- and its first and second derivatives
189 D2Offset(me; theU : Real; theP : out Pnt from gp; theV1, theV2 : out Vec from gp)
190 --- Purpose : Computes the point of parameter U on the offset curve
191 -- and its first and second derivatives
194 D3 (me; U : Real; P : out Pnt from gp; V1, V2, V3 : out Vec from gp)
196 -- Returns the point P of parameter U, the first, the second
197 -- and the third derivative.
199 -- Warning : On the specific case of BSplineCurve:
200 -- if the curve is cut in interval of continuity at least C3, the
201 -- derivatives are computed on the current interval.
202 -- else the derivatives are computed on the basis curve.
205 D3BSpline(me; theU : Real; theP : out Pnt from gp; theV1, theV2, theV3 : out Vec from gp)
206 --- Purpose : Computes the point of parameter U on the B-spline curve
207 -- and its first, second and third derivatives
210 D3Offset(me; theU : Real; theP : out Pnt from gp; theV1, theV2, theV3 : out Vec from gp)
211 --- Purpose : Computes the point of parameter U on the offset curve
212 -- and its first, second and third derivatives
215 DN (me; U : Real; N : Integer) returns Vec from gp
217 -- The returned vector gives the value of the derivative for the
218 -- order of derivation N.
219 -- Warning : On the specific case of BSplineCurve:
220 -- if the curve is cut in interval of continuity CN, the
221 -- derivatives are computed on the current interval.
222 -- else the derivatives are computed on the basis curve.
224 OutOfRange from Standard
225 --- Purpose : Raised if N < 1.
229 DNBSpline(me; theU : Real; N : Integer) returns Vec from gp
231 -- The returned vector gives the value of the derivative for the
232 -- order of derivation N.
235 DNOffset(me; theU : Real; N : Integer) returns Vec from gp
237 -- The returned vector gives the value of the derivative for the
238 -- order of derivation N.
242 Resolution(me; R3d :Real) returns Real
243 ---Purpose : returns the parametric resolution
247 GetType(me) returns CurveType from GeomAbs
251 Line(me) returns Lin from gp
253 NoSuchObject from Standard
256 Circle(me) returns Circ from gp
258 NoSuchObject from Standard
261 Ellipse(me) returns Elips from gp
263 NoSuchObject from Standard
266 Hyperbola(me) returns Hypr from gp
268 NoSuchObject from Standard
271 Parabola(me) returns Parab from gp
273 NoSuchObject from Standard
277 Degree(me) returns Integer
279 NoSuchObject from Standard
282 -- this should NEVER make a copy
283 -- of the underlying curve to read
284 -- the relevant information
286 IsRational(me) returns Boolean
288 NoSuchObject from Standard
292 -- this should NEVER make a copy
293 -- of the underlying curve to read
294 -- the relevant information
296 NbPoles(me) returns Integer
298 NoSuchObject from Standard
302 -- this should NEVER make a copy
303 -- of the underlying curve to read
304 -- the relevant information
306 NbKnots(me) returns Integer
308 NoSuchObject from Standard
311 -- this should NEVER make a copy
312 -- of the underlying curve to read
313 -- the relevant information
316 Bezier(me) returns BezierCurve from Geom
318 NoSuchObject from Standard
320 ---Purpose : this will NOT make a copy of the
321 -- Bezier Curve : If you want to modify
322 -- the Curve please make a copy yourself
323 -- Also it will NOT trim the surface to
326 BSpline(me) returns BSplineCurve from Geom
328 NoSuchObject from Standard
330 ---Purpose : this will NOT make a copy of the
331 -- BSpline Curve : If you want to modify
332 -- the Curve please make a copy yourself
333 -- Also it will NOT trim the surface to
337 LocalContinuity(me; U1, U2 : Real) returns Shape from GeomAbs
340 load(me : in out; C : Curve from Geom; UFirst,ULast : Real)
343 RebuildCache(me; theParameter : Real)
344 ---Purpose: Rebuilds B-spline cache
345 -- \param theParameter the value on the knot axis which identifies the caching span
350 myCurve : Curve from Geom ;
351 myTypeCurve : CurveType from GeomAbs ;
352 myFirst : Real from Standard ;
353 myLast : Real from Standard;
354 myCurveCache : Cache from BSplCLib;
355 myOffsetBaseCurveAdaptor : HCurve from Adaptor3d;
358 class Surface from GeomAdaptor