1 -- Created on: 1995-07-17
2 -- Created by: Modelistation
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 BCurveTool from HLRBRep
20 Array1OfReal from TColStd,
21 Array1OfPnt from TColgp,
23 CurveType from GeomAbs,
31 BezierCurve from Geom,
32 BSplineCurve from Geom,
33 Curve from BRepAdaptor
36 OutOfRange from Standard,
37 NoSuchObject from Standard,
38 DomainError from Standard
42 -- Global methods - Apply to the whole curve.
45 FirstParameter(myclass; C: Curve from BRepAdaptor)
46 returns Real from Standard;
50 LastParameter(myclass; C: Curve from BRepAdaptor)
51 returns Real from Standard;
55 -- Services to break the curves to the expected continuity
57 -- If for example you need the curve to be C2 and the method
58 -- Continuity returns you something lower than C2 (say C1 for
61 -- First compute the number of intervals with the requested
62 -- continuity with the method NbIntervals(). Note that if the
63 -- continuity is higher than the one you need NbIntervals will
66 -- Then you get the parameters bounding the intervals with the
67 -- method Intervals, using an array of length at least
70 -- If you need to create a curve with a restricted span you can
71 -- use the method Trim().
74 Continuity(myclass; C: Curve from BRepAdaptor)
75 returns Shape from GeomAbs;
79 NbIntervals(myclass; C : Curve from BRepAdaptor;
80 S : Shape from GeomAbs)
81 returns Integer from Standard;
82 ---Purpose: Returns the number of intervals for continuity
83 -- <S>. May be one if Continuity(myclass) >= <S>
86 Intervals(myclass; C : Curve from BRepAdaptor;
87 T : in out Array1OfReal from TColStd;
88 S : Shape from GeomAbs)
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()
94 raises OutOfRange from Standard;
97 IsClosed(myclass; C: Curve from BRepAdaptor)
98 returns Boolean from Standard;
101 IsPeriodic(myclass; C: Curve from BRepAdaptor)
102 returns Boolean from Standard;
105 Period(myclass; C: Curve from BRepAdaptor)
106 returns Real from Standard
107 raises DomainError from Standard;
110 Value(myclass; C : Curve from BRepAdaptor;
111 U : Real from Standard)
113 --- Purpose : Computes the point of parameter U on the curve.
116 D0 (myclass; C : Curve from BRepAdaptor;
117 U : Real from Standard;
118 P : out Pnt from gp);
119 --- Purpose : Computes the point of parameter U on the curve.
122 D1 (myclass; C : Curve from BRepAdaptor;
123 U : Real from Standard;
124 P : out Pnt from gp ;
126 --- Purpose : Computes the point of parameter U on the curve with its
128 raises DomainError from Standard;
129 --- Purpose : Raised if the continuity of the current interval
133 D2 (myclass; C : Curve from BRepAdaptor;
134 U : Real from Standard;
136 V1, V2 : out Vec from gp)
138 -- Returns the point P of parameter U, the first and second
139 -- derivatives V1 and V2.
140 raises DomainError from Standard;
141 --- Purpose : Raised if the continuity of the current interval
145 D3 (myclass; C : Curve from BRepAdaptor;
146 U : Real from Standard;
148 V1, V2, V3 : out Vec from gp)
150 -- Returns the point P of parameter U, the first, the second
151 -- and the third derivative.
152 raises DomainError from Standard;
153 --- Purpose : Raised if the continuity of the current interval
157 DN (myclass; C : Curve from BRepAdaptor;
158 U : Real from Standard;
159 N : Integer from Standard)
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.
172 Resolution(myclass; C : Curve from BRepAdaptor;
173 R3d : Real from Standard)
174 returns Real from Standard;
175 ---Purpose : Returns the parametric resolution corresponding
176 -- to the real space resolution <R3d>.
179 GetType(myclass; C: Curve from BRepAdaptor)
180 returns CurveType from GeomAbs;
181 ---Purpose: Returns the type of the curve in the current
182 -- interval : Line, Circle, Ellipse, Hyperbola,
183 -- Parabola, BezierCurve, BSplineCurve, OtherCurve.
187 -- The following methods must be called when GetType returned
188 -- the corresponding type.
191 Line(myclass; C: Curve from BRepAdaptor)
193 raises NoSuchObject from Standard;
196 Circle(myclass; C: Curve from BRepAdaptor)
198 raises NoSuchObject from Standard;
201 Ellipse(myclass; C: Curve from BRepAdaptor)
202 returns Elips from gp
203 raises NoSuchObject from Standard;
206 Hyperbola(myclass; C: Curve from BRepAdaptor)
208 raises NoSuchObject from Standard;
211 Parabola(myclass; C: Curve from BRepAdaptor)
212 returns Parab from gp
213 raises NoSuchObject from Standard;
216 Bezier(myclass; C: Curve from BRepAdaptor)
217 returns BezierCurve from Geom
218 raises NoSuchObject from Standard;
220 BSpline(myclass; C: Curve from BRepAdaptor)
221 returns BSplineCurve from Geom
222 raises NoSuchObject from Standard;
224 Degree(myclass; C: Curve from BRepAdaptor)
225 returns Integer from Standard;
228 IsRational(myclass; C: Curve from BRepAdaptor)
229 returns Boolean from Standard;
232 NbPoles(myclass; C: Curve from BRepAdaptor)
233 returns Integer from Standard;
236 NbKnots(myclass; C: Curve from BRepAdaptor)
237 returns Integer from Standard;
240 Poles(myclass; C : Curve from BRepAdaptor;
241 T : in out Array1OfPnt from TColgp);
243 PolesAndWeights(myclass; C : Curve from BRepAdaptor;
244 T : in out Array1OfPnt from TColgp;
245 W : in out Array1OfReal from TColStd);
247 NbSamples(myclass; C : Curve from BRepAdaptor;
248 U0,U1 : Real from Standard)
249 returns Integer from Standard;