1 -- Created on: 1993-04-15
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 OffsetCurve from Adaptor3d inherits Curve2d from Adaptor2d
19 ---Purpose: Defines an Offset curve.
23 Array1OfReal from TColStd,
25 CurveType from GeomAbs,
33 BezierCurve from Geom2d,
34 BSplineCurve from Geom2d,
35 HCurve2d from Adaptor2d
39 NoSuchObject from Standard,
40 DomainError from Standard,
41 OutOfRange from Standard,
42 TypeMismatch from Standard
47 -- Methods specific of OffsetCurve
50 Create returns OffsetCurve from Adaptor3d;
51 ---Purpose: The Offset is set to 0.
53 Create(C : HCurve2d from Adaptor2d) returns OffsetCurve from Adaptor3d;
54 ---Purpose: The curve is loaded. The Offset is set to 0.
56 Create(C : HCurve2d from Adaptor2d; Offset : Real)
57 returns OffsetCurve from Adaptor3d;
58 ---Purpose: Creates an OffsetCurve curve.
59 -- The Offset is set to Offset.
62 Create(C : HCurve2d from Adaptor2d; Offset : Real; WFirst,WLast : Real)
63 returns OffsetCurve from Adaptor3d;
64 ---Purpose: Create an Offset curve.
65 -- WFirst,WLast define the bounds of the Offset curve.
68 Load( me:in out ;S : HCurve2d from Adaptor2d)
69 ---Purpose: Changes the curve. The Offset is reset to 0.
72 Load (me : in out ; Offset : Real)
73 ---Purpose: Changes the Offset on the current Curve.
76 Load (me : in out ; Offset : Real; WFirst,WLast : Real)
77 ---Purpose: Changes the Offset Curve on the current Curve.
80 Curve(me) returns HCurve2d from Adaptor2d
82 ---C++: return const &
85 Offset(me) returns Real
91 -- Implementation of Curve2d from Adaptor2d methods
95 -- Global methods - Apply to the whole curve.
98 FirstParameter(me) returns Real
102 LastParameter(me) returns Real
106 Continuity(me) returns Shape from GeomAbs
109 NbIntervals(me; S : Shape from GeomAbs) returns Integer
110 ---Purpose: If necessary, breaks the curve in intervals of
111 -- continuity <S>. And returns the number of
115 Intervals(me; T : in out Array1OfReal from TColStd;
116 S : Shape from GeomAbs)
117 ---Purpose: Stores in <T> the parameters bounding the intervals
118 -- of continuity <S>.
120 -- The array must provide enough room to accomodate
121 -- for the parameters. i.e. T.Length() > NbIntervals()
123 OutOfRange from Standard
126 Trim(me; First, Last, Tol : Real) returns HCurve2d from Adaptor2d
127 ---Purpose: Returns a curve equivalent of <me> between
128 -- parameters <First> and <Last>. <Tol> is used to
129 -- test for 3d points confusion.
131 OutOfRange from Standard
132 ---Purpose: If <First> >= <Last>
135 IsClosed(me) returns Boolean
138 IsPeriodic(me) returns Boolean
141 Period(me) returns Real
143 DomainError from Standard -- if the curve is not periodic
146 Value(me; U : Real) returns Pnt2d from gp
147 --- Purpose : Computes the point of parameter U on the curve.
150 D0 (me; U : Real; P : out Pnt2d from gp)
151 --- Purpose : Computes the point of parameter U on the curve.
154 D1 (me; U : Real; P : out Pnt2d from gp ; V : out Vec2d from gp)
155 --- Purpose : Computes the point of parameter U on the curve with its
158 DomainError from Standard
159 --- Purpose : Raised if the continuity of the current interval
163 D2 (me; U : Real; P : out Pnt2d from gp; V1, V2 : out Vec2d from gp)
165 -- Returns the point P of parameter U, the first and second
166 -- derivatives V1 and V2.
168 DomainError from Standard
169 --- Purpose : Raised if the continuity of the current interval
173 D3 (me; U : Real; P : out Pnt2d from gp; V1, V2, V3 : out Vec2d from gp)
175 -- Returns the point P of parameter U, the first, the second
176 -- and the third derivative.
178 DomainError from Standard
179 --- Purpose : Raised if the continuity of the current interval
183 DN (me; U : Real; N : Integer) returns Vec2d from gp
185 -- The returned vector gives the value of the derivative for the
186 -- order of derivation N.
188 DomainError from Standard,
189 --- Purpose : Raised if the continuity of the current interval
191 OutOfRange from Standard
192 --- Purpose : Raised if N < 1.
195 Resolution(me; R3d : Real) returns Real
196 ---Purpose : Returns the parametric resolution corresponding
197 -- to the real space resolution <R3d>.
200 GetType(me) returns CurveType from GeomAbs
201 ---Purpose: Returns the type of the curve in the current
202 -- interval : Line, Circle, Ellipse, Hyperbola,
203 -- Parabola, BezierCurve, BSplineCurve, OtherCurve.
207 -- The following methods must be called when GetType returned
208 -- the corresponding type.
211 Line(me) returns Lin2d from gp
213 NoSuchObject from Standard
216 Circle(me) returns Circ2d from gp
218 NoSuchObject from Standard
221 Ellipse(me) returns Elips2d from gp
223 NoSuchObject from Standard
226 Hyperbola(me) returns Hypr2d from gp
228 NoSuchObject from Standard
231 Parabola(me) returns Parab2d from gp
233 NoSuchObject from Standard
237 Degree(me) returns Integer
239 NoSuchObject from Standard
242 IsRational(me) returns Boolean
244 NoSuchObject from Standard
247 NbPoles(me) returns Integer
249 NoSuchObject from Standard
253 NbKnots(me) returns Integer
255 NoSuchObject from Standard
259 Bezier(me) returns BezierCurve from Geom2d
261 NoSuchObject from Standard
264 BSpline(me) returns BSplineCurve from Geom2d
266 NoSuchObject from Standard
271 myCurve : HCurve2d from Adaptor2d;