1 -- Created on: 1993-08-18
2 -- Created by: Christophe MARION
3 -- Copyright (c) 1993-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 LineTool from HLRBRep
19 ---Purpose: The LineTool class provides class methods to
20 -- access the methodes of the Line.
24 CurveType from GeomAbs,
32 BezierCurve from Geom,
33 BSplineCurve from Geom,
34 Array1OfPnt from TColgp,
35 Array1OfReal from TColStd,
36 HArray1OfReal from TColStd,
37 Array1OfInteger from TColStd
41 OutOfRange from Standard,
42 NoSuchObject from Standard,
43 DomainError from Standard
48 -- Global methods - Apply to the whole Line.
51 FirstParameter(myclass; C : Lin from gp) returns Real
55 LastParameter(myclass; C : Lin from gp) returns Real
59 Continuity(myclass; C : Lin from gp) returns Shape from GeomAbs
63 NbIntervals(myclass; C : Lin from gp; S : Shape from GeomAbs) returns Integer
64 ---Purpose: If necessary, breaks the line in intervals of
65 -- continuity <S>. And returns the number of
70 Intervals(myclass; C :Lin from gp; T: out Array1OfReal from TColStd; Sh : Shape from GeomAbs)
71 ---Purpose: Sets the current working interval.
73 OutOfRange from Standard -- if Index < 1 or Index > NbIntervals
78 -- Local methods - Apply to the current interval.
79 -- By default the current interval is the first.
82 IntervalFirst(myclass; C : Lin from gp) returns Real
83 ---Purpose: Returns the first parameter of the current
88 IntervalLast(myclass; C : Lin from gp) returns Real
89 ---Purpose: Returns the last parameter of the current
94 IntervalContinuity(myclass; C : Lin from gp) returns Shape from GeomAbs
98 IsClosed(myclass; C : Lin from gp) returns Boolean
102 IsPeriodic(myclass; C : Lin from gp) returns Boolean
106 Period(myclass; C : Lin from gp) returns Real
108 DomainError from Standard -- if the line is not periodic
112 Value(myclass; C : Lin from gp; U : Real) returns Pnt from gp
113 --- Purpose : Computes the point of parameter U on the line.
117 D0 (myclass; C : Lin from gp; U : Real; P : out Pnt from gp)
118 --- Purpose : Computes the point of parameter U on the line.
122 D1 (myclass; C : Lin from gp; U : Real; P : out Pnt from gp ; V : out Vec from gp)
123 --- Purpose : Computes the point of parameter U on the line with its
126 DomainError from Standard
127 --- Purpose : Raised if the continuity of the current interval
132 D2 (myclass; C : Lin from gp; U : Real; P : out Pnt from gp; V1, V2 : out Vec 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 : Lin from gp; U : Real; P : out Pnt from gp; V1, V2, V3 : out Vec 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 : Lin from gp; U : Real; N : Integer) returns Vec 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 : Lin from gp; R3d : Real) returns Real
168 ---Purpose : Returns the parametric resolution corresponding
169 -- to the real space resolution <R3d>.
173 GetType(myclass; C : Lin from gp) returns CurveType from GeomAbs
174 ---Purpose: Returns the type of the line 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 : Lin from gp) returns Lin from gp
187 NoSuchObject from Standard
191 Circle(myclass; C : Lin from gp) returns Circ from gp
193 NoSuchObject from Standard
197 Ellipse(myclass; C : Lin from gp) returns Elips from gp
199 NoSuchObject from Standard
203 Hyperbola(myclass; C : Lin from gp) returns Hypr from gp
205 NoSuchObject from Standard
209 Parabola(myclass; C : Lin from gp) returns Parab from gp
211 NoSuchObject from Standard
215 Bezier(myclass; C : Lin from gp) returns BezierCurve from Geom
217 NoSuchObject from Standard
221 BSpline(myclass; C : Lin from gp) returns BSplineCurve from Geom
223 NoSuchObject from Standard
227 Degree(myclass; C : Lin from gp) returns Integer
229 NoSuchObject from Standard
233 NbPoles(myclass; C : Lin from gp) returns Integer
235 NoSuchObject from Standard
239 Poles(myclass; C : Lin from gp; TP : in out Array1OfPnt from TColgp)
241 NoSuchObject from Standard,
242 OutOfRange from Standard -- if TP has not length NbPoles
246 IsRational(myclass; C : Lin from gp) returns Boolean
248 NoSuchObject from Standard
252 PolesAndWeights(myclass; C : Lin from gp; TP : in out Array1OfPnt from TColgp;
253 TW : in out Array1OfReal from TColStd)
255 NoSuchObject from Standard,
256 OutOfRange from Standard -- if TW has not length NbPoles
260 NbKnots(myclass; C : Lin from gp) returns Integer
262 NoSuchObject from Standard
266 KnotsAndMultiplicities(myclass; C : Lin from gp;TK : in out Array1OfReal from TColStd;
267 TM : in out Array1OfInteger from TColStd)
269 NoSuchObject from Standard,
270 OutOfRange from Standard -- if TK has not length NbKnots
275 NbSamples(myclass; C: Lin from gp; U0,U1: Real from Standard)
277 returns Integer from Standard;
279 --modified by NIZHNY-MKK Tue Nov 1 18:49:37 2005
280 SamplePars(myclass; C: Lin from gp; U0,U1: Real from Standard;
281 Defl: Real from Standard; NbMin: Integer from Standard;
282 Pars: in out HArray1OfReal from TColStd);