1 -- Created on: 1993-02-22
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
9 -- under the terms of the GNU Lesser General Public 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 CurveOnSurface from Adaptor3d inherits Curve from Adaptor3d
19 ---Purpose: An interface between the services provided by a curve
20 -- lying on a surface from the package Geom and those
21 -- required of the curve by algorithms which use it. The
22 -- curve is defined as a 2D curve from the Geom2d
23 -- package, in the parametric space of the surface.
27 Array1OfReal from TColStd,
35 CurveType from GeomAbs,
37 BezierCurve from Geom,
38 BSplineCurve from Geom,
39 BSplineSurface from Geom,
40 HCurve from Adaptor3d,
41 HCurve2d from Adaptor2d,
42 HSurface from Adaptor3d,
43 HArray1OfReal from TColStd,
47 raises NoSuchObject from Standard,
48 DomainError from Standard,
49 OutOfRange from Standard
53 Create returns CurveOnSurface;
55 Create(S : HSurface from Adaptor3d) returns CurveOnSurface;
57 Create (C : HCurve2d from Adaptor2d; S : HSurface from Adaptor3d)
58 returns CurveOnSurface;
59 ---Purpose: Creates a CurveOnSurface from the 2d curve <C> and
62 Load(me : in out;S : HSurface from Adaptor3d)
63 ---Purpose: Changes the surface.
66 Load(me : in out; C : HCurve2d from Adaptor2d)
67 ---Purpose: Changes the 2d curve.
70 GetCurve(me) returns HCurve2d from Adaptor2d
71 ---C++: return const &
74 GetSurface(me) returns HSurface from Adaptor3d
75 ---C++: return const &
78 ChangeCurve(me : in out) returns HCurve2d from Adaptor2d
82 ChangeSurface(me : in out) returns HSurface from Adaptor3d
87 -- Implementation of Curve from Adaptor3d methods
91 -- Global methods - Apply to the whole curve.
94 FirstParameter(me) returns Real
97 LastParameter(me) returns Real
100 Continuity(me) returns Shape from GeomAbs
103 NbIntervals(me: in out; S : Shape from GeomAbs) returns Integer
104 ---Purpose: Returns the number of intervals for continuity
105 -- <S>. May be one if Continuity(me) >= <S>
108 Intervals(me:in out; T : in out Array1OfReal from TColStd;
109 S : Shape from GeomAbs)
110 ---Purpose: Stores in <T> the parameters bounding the intervals
111 -- of continuity <S>.
113 -- The array must provide enough room to accomodate
114 -- for the parameters. i.e. T.Length() > NbIntervals()
116 OutOfRange from Standard
119 Trim(me; First, Last, Tol : Real) returns HCurve from Adaptor3d
120 ---Purpose: Returns a curve equivalent of <me> between
121 -- parameters <First> and <Last>. <Tol> is used to
122 -- test for 3d points confusion.
124 OutOfRange from Standard
125 ---Purpose: If <First> >= <Last>
128 IsClosed(me) returns Boolean
131 IsPeriodic(me) returns Boolean
134 Period(me) returns Real
136 DomainError from Standard -- if the curve is not periodic
139 Value(me; U : Real) returns Pnt from gp
140 --- Purpose : Computes the point of parameter U on the curve.
143 D0 (me; U : Real; P : out Pnt from gp)
144 --- Purpose : Computes the point of parameter U on the curve.
147 D1 (me; U : Real; P : out Pnt from gp ; V : out Vec from gp)
148 --- Purpose : Computes the point of parameter U on the curve with its
151 DomainError from Standard
152 --- Purpose : Raised if the continuity of the current interval
156 D2 (me; U : Real; P : out Pnt from gp; V1, V2 : out Vec from gp)
158 -- Returns the point P of parameter U, the first and second
159 -- derivatives V1 and V2.
161 DomainError from Standard
162 --- Purpose : Raised if the continuity of the current interval
166 D3 (me; U : Real; P : out Pnt from gp; V1, V2, V3 : out Vec from gp)
168 -- Returns the point P of parameter U, the first, the second
169 -- and the third derivative.
171 DomainError from Standard
172 --- Purpose : Raised if the continuity of the current interval
176 DN (me; U : Real; N : Integer) returns Vec from gp
178 -- The returned vector gives the value of the derivative for the
179 -- order of derivation N.
181 DomainError from Standard,
182 --- Purpose : Raised if the continuity of the current interval
184 OutOfRange from Standard
185 --- Purpose : Raised if N < 1.
188 Resolution(me; R3d : Real) returns Real
189 ---Purpose : Returns the parametric resolution corresponding
190 -- to the real space resolution <R3d>.
193 GetType(me) returns CurveType from GeomAbs
194 ---Purpose: Returns the type of the curve in the current
195 -- interval : Line, Circle, Ellipse, Hyperbola,
196 -- Parabola, BezierCurve, BSplineCurve, OtherCurve.
200 -- The following methods must be called when GetType returned
201 -- the corresponding type.
204 Line(me) returns Lin from gp
206 NoSuchObject from Standard
209 Circle(me) returns Circ from gp
211 NoSuchObject from Standard
214 Ellipse(me) returns Elips from gp
216 NoSuchObject from Standard
219 Hyperbola(me) returns Hypr from gp
221 NoSuchObject from Standard
224 Parabola(me) returns Parab from gp
226 NoSuchObject from Standard
229 Degree(me) returns Integer
231 NoSuchObject from Standard
235 IsRational(me) returns Boolean
237 NoSuchObject from Standard
240 NbPoles(me) returns Integer
242 NoSuchObject from Standard
246 NbKnots(me) returns Integer
248 NoSuchObject from Standard
250 ---Warning: will raize if this asked on a curve
251 -- that is not planar
253 Bezier(me) returns BezierCurve from Geom
255 NoSuchObject from Standard
258 BSpline(me) returns BSplineCurve from Geom
260 NoSuchObject from Standard
263 EvalKPart(me : in out)
266 EvalFirstLastSurf(me : in out)
267 ---Purpose: Evaluates myFirstSurf and myLastSurf
268 -- for trimming the curve on surface.
272 ---Purpose: Following methods output left-bottom and right-top points
273 -- of located part on surface
274 -- for trimming the curve on surface.
276 LocatePart(me; UV : Pnt2d from gp; DUV : Vec2d from gp;
277 S : HSurface from Adaptor3d;
278 LeftBot, RightTop : out Pnt2d from gp)
281 LocatePart_RevExt(me; UV : Pnt2d from gp; DUV : Vec2d from gp;
282 S : HSurface from Adaptor3d;
283 LeftBot, RightTop : out Pnt2d from gp)
287 LocatePart_Offset(me; UV : Pnt2d from gp; DUV : Vec2d from gp;
288 S : HSurface from Adaptor3d;
289 LeftBot, RightTop : out Pnt2d from gp)
293 FindBounds(me; Arr : Array1OfReal from TColStd;
294 XYComp : Real from Standard;
295 DUVComp : Real from Standard;
296 Bnd1 : out Integer from Standard;
297 Bnd2 : out Integer from Standard;
298 DerIsNull : out Boolean from Standard)
299 ---Purpose: Extracts the numbers of knots which equal
300 -- the point and checks derivative components
301 -- by zero equivalence.
308 mySurface : HSurface from Adaptor3d;
309 myCurve : HCurve2d from Adaptor2d;
311 myType : CurveType from GeomAbs;
312 myCirc : Circ from gp;
315 myFirstSurf : HSurface from Adaptor3d;
316 myLastSurf : HSurface from Adaptor3d;
318 myIntervals : HArray1OfReal from TColStd;
319 myIntCont : Shape from GeomAbs;