1 -- Created on: 1995-07-17
2 -- Created by: Laurent BUCHARD
3 -- Copyright (c) 1995-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 HCurve2dTool from Contap
20 Array1OfReal from TColStd,
22 CurveType from GeomAbs,
30 BezierCurve from Geom2d,
31 BSplineCurve from Geom2d,
32 HCurve2d from Adaptor2d
36 OutOfRange from Standard,
37 NoSuchObject from Standard,
38 DomainError from Standard
43 -- Global methods - Apply to the whole curve.
46 FirstParameter(myclass; C: HCurve2d from Adaptor2d) returns Real
51 LastParameter(myclass; C: HCurve2d from Adaptor2d) returns Real
56 -- Services to break the curves to the expected continuity
58 -- If for example you need the curve to be C2 and the method
59 -- Continuity returns you something lower than C2 (say C1 for
62 -- First compute the number of intervals with the requested
63 -- continuity with the method NbIntervals(). Note that if the
64 -- continuity is higher than the one you need NbIntervals will
67 -- Then you get the parameters bounding the intervals with the
68 -- method Intervals, using an array of length at least
71 -- If you need to create a curve with a restricted span you can
72 -- use the method Trim().
75 Continuity(myclass; C: HCurve2d from Adaptor2d) returns Shape from GeomAbs
80 NbIntervals(myclass; C: HCurve2d from Adaptor2d; S : Shape from GeomAbs) returns Integer
81 ---Purpose: Returns the number of intervals for continuity
82 -- <S>. May be one if Continuity(myclass) >= <S>
86 Intervals(myclass; C: HCurve2d from Adaptor2d; T : in out Array1OfReal from TColStd;
87 S : Shape from GeomAbs)
88 ---Purpose: Stores in <T> the parameters bounding the intervals
91 -- The array must provide enough room to accomodate
92 -- for the parameters. i.e. T.Length() > NbIntervals()
94 OutOfRange from Standard
98 IsClosed(myclass; C: HCurve2d from Adaptor2d) returns Boolean
102 IsPeriodic(myclass; C: HCurve2d from Adaptor2d) returns Boolean
106 Period(myclass; C: HCurve2d from Adaptor2d) returns Real
108 DomainError from Standard -- if the curve is not periodic
112 Value(myclass; C: HCurve2d from Adaptor2d; U : Real) returns Pnt2d from gp
113 --- Purpose : Computes the point of parameter U on the curve.
117 D0 (myclass; C: HCurve2d from Adaptor2d; U : Real; P : out Pnt2d from gp)
118 --- Purpose : Computes the point of parameter U on the curve.
122 D1 (myclass; C: HCurve2d from Adaptor2d; U : Real; P : out Pnt2d from gp ; V : out Vec2d from gp)
123 --- Purpose : Computes the point of parameter U on the curve with its
126 DomainError from Standard
127 --- Purpose : Raised if the continuity of the current interval
132 D2 (myclass; C: HCurve2d from Adaptor2d; U : Real; P : out Pnt2d from gp; V1, V2 : out Vec2d from gp)
134 -- Returns the point P of parameter U, the first and second
135 -- derivatives V1 and V2.
137 DomainError from Standard
138 --- Purpose : Raised if the continuity of the current interval
143 D3 (myclass; C: HCurve2d from Adaptor2d; U : Real; P : out Pnt2d from gp; V1, V2, V3 : out Vec2d from gp)
145 -- Returns the point P of parameter U, the first, the second
146 -- and the third derivative.
148 DomainError from Standard
149 --- Purpose : Raised if the continuity of the current interval
154 DN (myclass; C: HCurve2d from Adaptor2d; U : Real; N : Integer) returns Vec2d from gp
156 -- The returned vector gives the value of the derivative for the
157 -- order of derivation N.
159 DomainError from Standard,
160 --- Purpose : Raised if the continuity of the current interval
162 OutOfRange from Standard
163 --- Purpose : Raised if N < 1.
167 Resolution(myclass; C: HCurve2d from Adaptor2d; R3d : Real) returns Real
168 ---Purpose : Returns the parametric resolution corresponding
169 -- to the real space resolution <R3d>.
173 GetType(myclass; C: HCurve2d from Adaptor2d) returns CurveType from GeomAbs
174 ---Purpose: Returns the type of the curve in the current
175 -- interval : Line, Circle, Ellipse, Hyperbola,
176 -- Parabola, BezierCurve, BSplineCurve, OtherCurve.
181 -- The following methods must be called when GetType returned
182 -- the corresponding type.
185 Line(myclass; C: HCurve2d from Adaptor2d) returns Lin2d from gp
187 NoSuchObject from Standard
191 Circle(myclass; C: HCurve2d from Adaptor2d) returns Circ2d from gp
193 NoSuchObject from Standard
197 Ellipse(myclass; C: HCurve2d from Adaptor2d) returns Elips2d from gp
199 NoSuchObject from Standard
203 Hyperbola(myclass; C: HCurve2d from Adaptor2d) returns Hypr2d from gp
205 NoSuchObject from Standard
209 Parabola(myclass; C: HCurve2d from Adaptor2d) returns Parab2d from gp
211 NoSuchObject from Standard
215 Bezier(myclass; C: HCurve2d from Adaptor2d) returns BezierCurve from Geom2d
217 NoSuchObject from Standard
221 BSpline(myclass; C: HCurve2d from Adaptor2d) returns BSplineCurve from Geom2d
223 NoSuchObject from Standard
231 NbSamples(myclass; C: HCurve2d from Adaptor2d; U0,U1: Real from Standard)
232 returns Integer from Standard;