1 -- Created on: 1995-07-17
2 -- Created by: Modelistation
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.
22 class CurveTool from HLRBRep
25 Array1OfReal from TColStd,
27 CurveType from GeomAbs,
35 BezierCurve from Geom2d,
36 BSplineCurve from Geom2d
39 OutOfRange from Standard,
40 NoSuchObject from Standard,
41 DomainError from Standard
45 -- Global methods - Apply to the whole curve.
48 FirstParameter(myclass; C: Address from Standard)
49 returns Real from Standard;
52 LastParameter(myclass; C: Address from Standard)
53 returns Real from Standard;
57 -- Services to break the curves to the expected continuity
59 -- If for example you need the curve to be C2 and the method
60 -- Continuity returns you something lower than C2 (say C1 for
63 -- First compute the number of intervals with the requested
64 -- continuity with the method NbIntervals(). Note that if the
65 -- continuity is higher than the one you need NbIntervals will
68 -- Then you get the parameters bounding the intervals with the
69 -- method Intervals, using an array of length at least
72 -- If you need to create a curve with a restricted span you can
73 -- use the method Trim().
76 Continuity(myclass; C: Address from Standard)
77 returns Shape from GeomAbs;
81 NbIntervals(myclass; C: Address from Standard)
82 returns Integer from Standard;
83 ---Purpose: Returns the number of intervals for continuity
84 -- <S>. May be one if Continuity(myclass) >= <S>
87 Intervals(myclass; C : Address from Standard;
88 T : in out Array1OfReal from TColStd)
89 ---Purpose: Stores in <T> the parameters bounding the intervals
92 -- The array must provide enough room to accomodate
93 -- for the parameters. i.e. T.Length() > NbIntervals()
95 OutOfRange from Standard;
98 GetInterval (myclass; C : Address from Standard
99 ; Index : Integer from Standard
100 ; Tab : Array1OfReal from TColStd
101 ; U1, U2 : out Real from Standard);
102 ---Purpose : output the bounds of interval of index <Index>
103 -- used if Type == Composite.
107 IsClosed(myclass; C: Address from Standard)
108 returns Boolean from Standard;
111 IsPeriodic(myclass; C: Address from Standard)
112 returns Boolean from Standard;
115 Period(myclass; C: Address from Standard)
116 returns Real from Standard
117 raises DomainError from Standard; -- if the curve is not periodic
120 Value(myclass; C: Address from Standard; U : Real)
121 returns Pnt2d from gp;
122 --- Purpose : Computes the point of parameter U on the curve.
125 D0 (myclass; C : Address from Standard;
126 U : Real from Standard;
127 P : out Pnt2d from gp);
128 --- Purpose : Computes the point of parameter U on the curve.
131 D1 (myclass; C : Address from Standard;
132 U : Real from Standard;
133 P : out Pnt2d from gp;
134 V : out Vec2d from gp)
135 --- Purpose : Computes the point of parameter U on the curve
136 -- with its first derivative.
137 raises DomainError from Standard;
138 --- Purpose : Raised if the continuity of the current interval
142 D2 (myclass; C : Address from Standard;
143 U : Real from Standard;
144 P : out Pnt2d from gp;
145 V1, V2 : out Vec2d from gp)
147 -- Returns the point P of parameter U, the first and second
148 -- derivatives V1 and V2.
149 raises DomainError from Standard;
150 --- Purpose : Raised if the continuity of the current interval
154 D3 (myclass; C : Address from Standard;
155 U : Real from Standard;
156 P : out Pnt2d from gp;
157 V1, V2, V3 : out Vec2d from gp)
159 -- Returns the point P of parameter U, the first, the second
160 -- and the third derivative.
161 raises DomainError from Standard;
162 --- Purpose : Raised if the continuity of the current interval
166 DN (myclass; C : Address from Standard;
167 U : Real from Standard;
168 N : Integer from Standard)
169 returns Vec2d from gp
171 -- The returned vector gives the value of the derivative for the
172 -- order of derivation N.
174 DomainError from Standard,
175 --- Purpose : Raised if the continuity of the current interval
177 OutOfRange from Standard;
178 --- Purpose : Raised if N < 1.
181 Resolution(myclass; C : Address from Standard;
182 R3d : Real from Standard)
183 returns Real from Standard;
184 ---Purpose : Returns the parametric resolution corresponding
185 -- to the real space resolution <R3d>.
188 GetType(myclass; C: Address from Standard)
189 returns CurveType from GeomAbs;
190 ---Purpose: Returns the type of the curve in the current
191 -- interval : Line, Circle, Ellipse, Hyperbola,
192 -- Parabola, BezierCurve, BSplineCurve, OtherCurve.
195 TheType(myclass; C: Address from Standard)
196 returns CurveType from GeomAbs;
197 ---Purpose: Returns the type of the curve in the current
198 -- interval : Line, Circle, Ellipse, Hyperbola,
199 -- Parabola, BezierCurve, BSplineCurve, OtherCurve.
203 -- The following methods must be called when GetType returned
204 -- the corresponding type.
207 Line(myclass; C: Address from Standard) returns Lin2d from gp
208 raises NoSuchObject from Standard;
211 Circle(myclass; C: Address from Standard) returns Circ2d from gp
212 raises NoSuchObject from Standard;
215 Ellipse(myclass; C: Address from Standard) returns Elips2d from gp
216 raises NoSuchObject from Standard;
219 Hyperbola(myclass; C: Address from Standard) returns Hypr2d from gp
220 raises NoSuchObject from Standard;
223 Parabola(myclass; C: Address from Standard) returns Parab2d from gp
224 raises NoSuchObject from Standard;
227 Bezier(myclass; C: Address from Standard)
228 returns BezierCurve from Geom2d
229 raises NoSuchObject from Standard;
232 BSpline(myclass; C: Address from Standard)
233 returns BSplineCurve from Geom2d
234 raises NoSuchObject from Standard;
237 EpsX(myclass; C:Address from Standard)
239 returns Real from Standard;
241 NbSamples(myclass; C : Address from Standard;
242 U0,U1: Real from Standard)
243 returns Integer from Standard;
245 NbSamples(myclass; C: Address from Standard)
246 returns Integer from Standard;