1 -- File: Contap_HCurve2dToolGen.cdl
2 -- Created: Mon Jul 17 16:25:23 1995
3 -- Author: Laurent BUCHARD
5 ---Copyright: Matra Datavision 1995
8 generic class HCurve2dToolGen from Contap (
12 Array1OfReal from TColStd,
14 CurveType from GeomAbs,
22 BezierCurve from Geom2d,
23 BSplineCurve from Geom2d
27 OutOfRange from Standard,
28 NoSuchObject from Standard,
29 DomainError from Standard
34 -- Global methods - Apply to the whole curve.
37 FirstParameter(myclass; C: CurveGen) returns Real
42 LastParameter(myclass; C: CurveGen) returns Real
47 -- Services to break the curves to the expected continuity
49 -- If for example you need the curve to be C2 and the method
50 -- Continuity returns you something lower than C2 (say C1 for
53 -- First compute the number of intervals with the requested
54 -- continuity with the method NbIntervals(). Note that if the
55 -- continuity is higher than the one you need NbIntervals will
58 -- Then you get the parameters bounding the intervals with the
59 -- method Intervals, using an array of length at least
62 -- If you need to create a curve with a restricted span you can
63 -- use the method Trim().
66 Continuity(myclass; C: CurveGen) returns Shape from GeomAbs
71 NbIntervals(myclass; C: CurveGen; S : Shape from GeomAbs) returns Integer
72 ---Purpose: Returns the number of intervals for continuity
73 -- <S>. May be one if Continuity(myclass) >= <S>
77 Intervals(myclass; C: CurveGen; T : in out Array1OfReal from TColStd;
78 S : Shape from GeomAbs)
79 ---Purpose: Stores in <T> the parameters bounding the intervals
82 -- The array must provide enough room to accomodate
83 -- for the parameters. i.e. T.Length() > NbIntervals()
85 OutOfRange from Standard
89 IsClosed(myclass; C: CurveGen) returns Boolean
93 IsPeriodic(myclass; C: CurveGen) returns Boolean
97 Period(myclass; C: CurveGen) returns Real
99 DomainError from Standard -- if the curve is not periodic
103 Value(myclass; C: CurveGen; U : Real) returns Pnt2d from gp
104 --- Purpose : Computes the point of parameter U on the curve.
108 D0 (myclass; C: CurveGen; U : Real; P : out Pnt2d from gp)
109 --- Purpose : Computes the point of parameter U on the curve.
113 D1 (myclass; C: CurveGen; U : Real; P : out Pnt2d from gp ; V : out Vec2d from gp)
114 --- Purpose : Computes the point of parameter U on the curve with its
117 DomainError from Standard
118 --- Purpose : Raised if the continuity of the current interval
123 D2 (myclass; C: CurveGen; U : Real; P : out Pnt2d from gp; V1, V2 : out Vec2d from gp)
125 -- Returns the point P of parameter U, the first and second
126 -- derivatives V1 and V2.
128 DomainError from Standard
129 --- Purpose : Raised if the continuity of the current interval
134 D3 (myclass; C: CurveGen; U : Real; P : out Pnt2d from gp; V1, V2, V3 : out Vec2d from gp)
136 -- Returns the point P of parameter U, the first, the second
137 -- and the third derivative.
139 DomainError from Standard
140 --- Purpose : Raised if the continuity of the current interval
145 DN (myclass; C: CurveGen; U : Real; N : Integer) returns Vec2d from gp
147 -- The returned vector gives the value of the derivative for the
148 -- order of derivation N.
150 DomainError from Standard,
151 --- Purpose : Raised if the continuity of the current interval
153 OutOfRange from Standard
154 --- Purpose : Raised if N < 1.
158 Resolution(myclass; C: CurveGen; R3d : Real) returns Real
159 ---Purpose : Returns the parametric resolution corresponding
160 -- to the real space resolution <R3d>.
164 GetType(myclass; C: CurveGen) returns CurveType from GeomAbs
165 ---Purpose: Returns the type of the curve in the current
166 -- interval : Line, Circle, Ellipse, Hyperbola,
167 -- Parabola, BezierCurve, BSplineCurve, OtherCurve.
172 -- The following methods must be called when GetType returned
173 -- the corresponding type.
176 Line(myclass; C: CurveGen) returns Lin2d from gp
178 NoSuchObject from Standard
182 Circle(myclass; C: CurveGen) returns Circ2d from gp
184 NoSuchObject from Standard
188 Ellipse(myclass; C: CurveGen) returns Elips2d from gp
190 NoSuchObject from Standard
194 Hyperbola(myclass; C: CurveGen) returns Hypr2d from gp
196 NoSuchObject from Standard
200 Parabola(myclass; C: CurveGen) returns Parab2d from gp
202 NoSuchObject from Standard
206 Bezier(myclass; C: CurveGen) returns BezierCurve from Geom2d
208 NoSuchObject from Standard
212 BSpline(myclass; C: CurveGen) returns BSplineCurve from Geom2d
214 NoSuchObject from Standard
222 NbSamples(myclass; C: CurveGen; U0,U1: Real from Standard)
223 returns Integer from Standard;