1 -- Created on: 1995-07-17
2 -- Created by: Laurent BUCHARD
3 -- Copyright (c) 1995-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
23 generic class HCurve2dToolGen from Contap (
27 Array1OfReal from TColStd,
29 CurveType from GeomAbs,
37 BezierCurve from Geom2d,
38 BSplineCurve from Geom2d
42 OutOfRange from Standard,
43 NoSuchObject from Standard,
44 DomainError from Standard
49 -- Global methods - Apply to the whole curve.
52 FirstParameter(myclass; C: CurveGen) returns Real
57 LastParameter(myclass; C: CurveGen) returns Real
62 -- Services to break the curves to the expected continuity
64 -- If for example you need the curve to be C2 and the method
65 -- Continuity returns you something lower than C2 (say C1 for
68 -- First compute the number of intervals with the requested
69 -- continuity with the method NbIntervals(). Note that if the
70 -- continuity is higher than the one you need NbIntervals will
73 -- Then you get the parameters bounding the intervals with the
74 -- method Intervals, using an array of length at least
77 -- If you need to create a curve with a restricted span you can
78 -- use the method Trim().
81 Continuity(myclass; C: CurveGen) returns Shape from GeomAbs
86 NbIntervals(myclass; C: CurveGen; S : Shape from GeomAbs) returns Integer
87 ---Purpose: Returns the number of intervals for continuity
88 -- <S>. May be one if Continuity(myclass) >= <S>
92 Intervals(myclass; C: CurveGen; T : in out Array1OfReal from TColStd;
93 S : Shape from GeomAbs)
94 ---Purpose: Stores in <T> the parameters bounding the intervals
97 -- The array must provide enough room to accomodate
98 -- for the parameters. i.e. T.Length() > NbIntervals()
100 OutOfRange from Standard
104 IsClosed(myclass; C: CurveGen) returns Boolean
108 IsPeriodic(myclass; C: CurveGen) returns Boolean
112 Period(myclass; C: CurveGen) returns Real
114 DomainError from Standard -- if the curve is not periodic
118 Value(myclass; C: CurveGen; U : Real) returns Pnt2d from gp
119 --- Purpose : Computes the point of parameter U on the curve.
123 D0 (myclass; C: CurveGen; U : Real; P : out Pnt2d from gp)
124 --- Purpose : Computes the point of parameter U on the curve.
128 D1 (myclass; C: CurveGen; U : Real; P : out Pnt2d from gp ; V : out Vec2d from gp)
129 --- Purpose : Computes the point of parameter U on the curve with its
132 DomainError from Standard
133 --- Purpose : Raised if the continuity of the current interval
138 D2 (myclass; C: CurveGen; U : Real; P : out Pnt2d from gp; V1, V2 : out Vec2d from gp)
140 -- Returns the point P of parameter U, the first and second
141 -- derivatives V1 and V2.
143 DomainError from Standard
144 --- Purpose : Raised if the continuity of the current interval
149 D3 (myclass; C: CurveGen; U : Real; P : out Pnt2d from gp; V1, V2, V3 : out Vec2d from gp)
151 -- Returns the point P of parameter U, the first, the second
152 -- and the third derivative.
154 DomainError from Standard
155 --- Purpose : Raised if the continuity of the current interval
160 DN (myclass; C: CurveGen; U : Real; N : Integer) returns Vec2d from gp
162 -- The returned vector gives the value of the derivative for the
163 -- order of derivation N.
165 DomainError from Standard,
166 --- Purpose : Raised if the continuity of the current interval
168 OutOfRange from Standard
169 --- Purpose : Raised if N < 1.
173 Resolution(myclass; C: CurveGen; R3d : Real) returns Real
174 ---Purpose : Returns the parametric resolution corresponding
175 -- to the real space resolution <R3d>.
179 GetType(myclass; C: CurveGen) returns CurveType from GeomAbs
180 ---Purpose: Returns the type of the curve in the current
181 -- interval : Line, Circle, Ellipse, Hyperbola,
182 -- Parabola, BezierCurve, BSplineCurve, OtherCurve.
187 -- The following methods must be called when GetType returned
188 -- the corresponding type.
191 Line(myclass; C: CurveGen) returns Lin2d from gp
193 NoSuchObject from Standard
197 Circle(myclass; C: CurveGen) returns Circ2d from gp
199 NoSuchObject from Standard
203 Ellipse(myclass; C: CurveGen) returns Elips2d from gp
205 NoSuchObject from Standard
209 Hyperbola(myclass; C: CurveGen) returns Hypr2d from gp
211 NoSuchObject from Standard
215 Parabola(myclass; C: CurveGen) returns Parab2d from gp
217 NoSuchObject from Standard
221 Bezier(myclass; C: CurveGen) returns BezierCurve from Geom2d
223 NoSuchObject from Standard
227 BSpline(myclass; C: CurveGen) returns BSplineCurve from Geom2d
229 NoSuchObject from Standard
237 NbSamples(myclass; C: CurveGen; U0,U1: Real from Standard)
238 returns Integer from Standard;