1 -- Created on: 1993-04-01
2 -- Created by: Modelistation
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 Curve from HLRBRep
19 ---Purpose: Defines a 2d curve by projection of a 3D curve on
20 -- a plane with an optional perspective
24 Integer from Standard,
25 Boolean from Standard,
26 ShortReal from Standard,
28 Address from Standard,
40 CurveType from GeomAbs,
41 Array1OfPnt2d from TColgp,
42 Array1OfReal from TColStd,
43 Array1OfInteger from TColStd,
45 Curve from BRepAdaptor,
46 BSplineCurve from Geom
49 NoSuchObject from Standard,
50 DomainError from Standard,
51 OutOfRange from Standard,
52 UndefinedDerivative from StdFail
56 Create returns Curve from HLRBRep;
57 ---Purpose: Creates an undefined Curve.
59 Projector(me : in out; Proj : Address from Standard)
63 Curve(me : in out) returns Curve from BRepAdaptor
64 ---Purpose: Returns the 3D curve.
69 Curve(me : in out; E : Edge from TopoDS)
70 ---Purpose: Sets the 3D curve to be projected.
73 GetCurve(me) returns Curve from BRepAdaptor
74 ---Purpose: Returns the 3D curve.
75 ---C++: return const &
79 Parameter2d(me; P3d : Real from Standard) returns Real from Standard
80 ---Purpose: Returns the parameter on the 2d curve from the
81 -- parameter on the 3d curve.
84 Parameter3d(me; P2d : Real from Standard) returns Real from Standard
85 ---Purpose: Returns the parameter on the 3d curve from the
86 -- parameter on the 2d curve.
89 Update(me : in out; TotMin : Address from Standard;
90 TotMax : Address from Standard)
91 returns Real from Standard
92 ---Purpose: Update the minmax and the internal data
95 UpdateMinMax(me : in out; TotMin : Address from Standard;
96 TotMax : Address from Standard)
97 returns Real from Standard
98 ---Purpose: Update the minmax returns tol for enlarge;
101 Z(me; U : Real from Standard) returns Real from Standard
102 --- Purpose : Computes the Z coordinate of the point of
103 -- parameter U on the curve in the viewing coordinate system
106 Value3D(me; U : Real from Standard) returns Pnt from gp
107 --- Purpose : Computes the 3D point of parameter U on the
113 D0 (me; U : Real from Standard;
115 --- Purpose : Computes the 3D point of parameter U on the
121 D1(me; U : Real from Standard;
122 P : out Pnt from gp ;
124 --- Purpose : Computes the point of parameter U on the curve
125 -- with its first derivative.
130 Tangent(me; AtStart : Boolean from Standard;
131 P : out Pnt2d from gp;
132 D : out Dir2d from gp)
133 --- Purpose : Depending on <AtStart> computes the 2D point and
134 -- tangent on the curve at sart (or at end). If the first
135 -- derivative is null look after at start (or before at end)
136 -- with the second derivative.
139 UndefinedDerivative from StdFail
143 -- Global methods - Apply to the whole curve.
146 FirstParameter(me) returns Real from Standard
150 LastParameter(me) returns Real from Standard
154 Continuity(me) returns Shape from GeomAbs
158 NbIntervals(me; S : Shape from GeomAbs)
159 returns Integer from Standard
160 ---Purpose: If necessary, breaks the curve in intervals of
161 -- continuity <S>. And returns the number of
166 Intervals(me; T : in out Array1OfReal from TColStd;
167 S : Shape from GeomAbs)
168 ---Purpose: Stores in <T> the parameters bounding the intervals
169 -- of continuity <S>.
171 -- The array must provide enough room to accomodate
172 -- for the parameters. i.e. T.Length() > NbIntervals()
174 OutOfRange from Standard
178 IsClosed(me) returns Boolean from Standard
182 IsPeriodic(me) returns Boolean from Standard
186 Period(me) returns Real
188 DomainError from Standard -- if the curve is not periodic
192 Value(me; U : Real from Standard) returns Pnt2d from gp
193 --- Purpose : Computes the point of parameter U on the curve.
198 D0 (me; U : Real from Standard;
199 P : out Pnt2d from gp)
200 --- Purpose : Computes the point of parameter U on the curve.
203 D1 (me; U : Real from Standard;
204 P : out Pnt2d from gp;
205 V : out Vec2d from gp)
206 --- Purpose : Computes the point of parameter U on the curve
207 -- with its first derivative.
209 DomainError from Standard
210 --- Purpose : Raised if the continuity of the current interval
214 D2 (me; U : Real from Standard;
215 P : out Pnt2d from gp ;
216 V1,V2 : out Vec2d from gp)
218 DomainError from Standard
219 --- Purpose : Raised if the continuity of the current interval
223 D3 (me; U : Real from Standard;
224 P : out Pnt2d from gp;
225 V1, V2, V3 : out Vec2d from gp)
227 -- Returns the point P of parameter U, the first, the second
228 -- and the third derivative.
230 DomainError from Standard
231 --- Purpose : Raised if the continuity of the current interval
235 DN (me; U : Real from Standard;
236 N : Integer from Standard) returns Vec2d from gp
238 -- The returned vector gives the value of the derivative for the
239 -- order of derivation N.
241 DomainError from Standard,
242 --- Purpose : Raised if the continuity of the current interval
244 OutOfRange from Standard
245 --- Purpose : Raised if N < 1.
248 Resolution(me; R3d : Real) returns Real
249 ---Purpose : Returns the parametric resolution corresponding
250 -- to the real space resolution <R3d>.
254 GetType(me) returns CurveType from GeomAbs
255 ---Purpose: Returns the type of the curve in the current
256 -- interval : Line, Circle, Ellipse, Hyperbola,
257 -- Parabola, BezierCurve, BSplineCurve, OtherCurve.
262 -- The following methods must be called when GetType returned
263 -- the corresponding type.
266 Line(me) returns Lin2d from gp
268 NoSuchObject from Standard
271 Circle(me) returns Circ2d from gp
273 NoSuchObject from Standard
276 Ellipse(me) returns Elips2d from gp
278 NoSuchObject from Standard
281 Hyperbola(me) returns Hypr2d from gp
283 NoSuchObject from Standard
286 Parabola(me) returns Parab2d from gp
288 NoSuchObject from Standard
292 IsRational(me) returns Boolean from Standard
296 Degree(me) returns Integer from Standard
300 NbPoles(me) returns Integer from Standard
304 Poles(me; TP : in out Array1OfPnt2d from TColgp)
306 NoSuchObject from Standard, -- if rational
307 OutOfRange from Standard -- if TP has not length NbPoles
310 Poles(me; aCurve : BSplineCurve from Geom;
311 TP : in out Array1OfPnt2d from TColgp)
313 NoSuchObject from Standard, -- if rational
314 OutOfRange from Standard -- if TP has not length NbPoles
317 PolesAndWeights(me; TP : in out Array1OfPnt2d from TColgp;
318 TW : in out Array1OfReal from TColStd)
320 NoSuchObject from Standard, -- if not rational
321 OutOfRange from Standard -- if TW has not length NbPoles
324 PolesAndWeights(me; aCurve : BSplineCurve from Geom;
325 TP : in out Array1OfPnt2d from TColgp;
326 TW : in out Array1OfReal from TColStd)
328 NoSuchObject from Standard, -- if not rational
329 OutOfRange from Standard -- if TW has not length NbPoles
332 NbKnots(me) returns Integer from Standard
334 NoSuchObject from Standard
338 Knots(me; kn: out Array1OfReal from TColStd)
341 Multiplicities(me; mu: out Array1OfInteger from TColStd)
346 myCurve : Curve from BRepAdaptor;
347 myType : CurveType from GeomAbs;
348 myProj : Address from Standard;
350 -- description of the line in the plane containing the line and the eye
352 myOX : Real from Standard;
353 myOZ : Real from Standard;
354 myVX : Real from Standard;
355 myVZ : Real from Standard;
356 myOF : Real from Standard;