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 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 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 HSequenceOfReal 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 Load(me : in out; C : HCurve2d from Adaptor2d;
71 S : HSurface from Adaptor3d)
72 ---Purpose: Load both curve and surface.
75 GetCurve(me) returns HCurve2d from Adaptor2d
76 ---C++: return const &
79 GetSurface(me) returns HSurface from Adaptor3d
80 ---C++: return const &
83 ChangeCurve(me : in out) returns HCurve2d from Adaptor2d
87 ChangeSurface(me : in out) returns HSurface from Adaptor3d
92 -- Implementation of Curve from Adaptor3d methods
96 -- Global methods - Apply to the whole curve.
99 FirstParameter(me) returns Real
102 LastParameter(me) returns Real
105 Continuity(me) returns Shape from GeomAbs
108 NbIntervals(me; S : Shape from GeomAbs) returns Integer
109 ---Purpose: Returns the number of intervals for continuity
110 -- <S>. May be one if Continuity(me) >= <S>
113 Intervals(me; T : in out Array1OfReal from TColStd;
114 S : Shape from GeomAbs)
115 ---Purpose: Stores in <T> the parameters bounding the intervals
116 -- of continuity <S>.
118 -- The array must provide enough room to accomodate
119 -- for the parameters. i.e. T.Length() > NbIntervals()
121 OutOfRange from Standard
124 Trim(me; First, Last, Tol : Real) returns HCurve from Adaptor3d
125 ---Purpose: Returns a curve equivalent of <me> between
126 -- parameters <First> and <Last>. <Tol> is used to
127 -- test for 3d points confusion.
129 OutOfRange from Standard
130 ---Purpose: If <First> >= <Last>
133 IsClosed(me) returns Boolean
136 IsPeriodic(me) returns Boolean
139 Period(me) returns Real
141 DomainError from Standard -- if the curve is not periodic
144 Value(me; U : Real) returns Pnt from gp
145 --- Purpose : Computes the point of parameter U on the curve.
148 D0 (me; U : Real; P : out Pnt from gp)
149 --- Purpose : Computes the point of parameter U on the curve.
152 D1 (me; U : Real; P : out Pnt from gp ; V : out Vec from gp)
153 --- Purpose : Computes the point of parameter U on the curve with its
156 DomainError from Standard
157 --- Purpose : Raised if the continuity of the current interval
161 D2 (me; U : Real; P : out Pnt from gp; V1, V2 : out Vec from gp)
163 -- Returns the point P of parameter U, the first and second
164 -- derivatives V1 and V2.
166 DomainError from Standard
167 --- Purpose : Raised if the continuity of the current interval
171 D3 (me; U : Real; P : out Pnt from gp; V1, V2, V3 : out Vec from gp)
173 -- Returns the point P of parameter U, the first, the second
174 -- and the third derivative.
176 DomainError from Standard
177 --- Purpose : Raised if the continuity of the current interval
181 DN (me; U : Real; N : Integer) returns Vec from gp
183 -- The returned vector gives the value of the derivative for the
184 -- order of derivation N.
186 DomainError from Standard,
187 --- Purpose : Raised if the continuity of the current interval
189 OutOfRange from Standard
190 --- Purpose : Raised if N < 1.
193 Resolution(me; R3d : Real) returns Real
194 ---Purpose : Returns the parametric resolution corresponding
195 -- to the real space resolution <R3d>.
198 GetType(me) returns CurveType from GeomAbs
199 ---Purpose: Returns the type of the curve in the current
200 -- interval : Line, Circle, Ellipse, Hyperbola,
201 -- Parabola, BezierCurve, BSplineCurve, OtherCurve.
205 -- The following methods must be called when GetType returned
206 -- the corresponding type.
209 Line(me) returns Lin from gp
211 NoSuchObject from Standard
214 Circle(me) returns Circ from gp
216 NoSuchObject from Standard
219 Ellipse(me) returns Elips from gp
221 NoSuchObject from Standard
224 Hyperbola(me) returns Hypr from gp
226 NoSuchObject from Standard
229 Parabola(me) returns Parab from gp
231 NoSuchObject from Standard
234 Degree(me) returns Integer
236 NoSuchObject from Standard
240 IsRational(me) returns Boolean
242 NoSuchObject from Standard
245 NbPoles(me) returns Integer
247 NoSuchObject from Standard
251 NbKnots(me) returns Integer
253 NoSuchObject from Standard
255 ---Warning: will raize if this asked on a curve
256 -- that is not planar
258 Bezier(me) returns BezierCurve from Geom
260 NoSuchObject from Standard
263 BSpline(me) returns BSplineCurve from Geom
265 NoSuchObject from Standard
268 EvalKPart(me : in out)
271 EvalFirstLastSurf(me : in out)
272 ---Purpose: Evaluates myFirstSurf and myLastSurf
273 -- for trimming the curve on surface.
277 ---Purpose: Following methods output left-bottom and right-top points
278 -- of located part on surface
279 -- for trimming the curve on surface.
281 LocatePart(me; UV : Pnt2d from gp; DUV : Vec2d from gp;
282 S : HSurface from Adaptor3d;
283 LeftBot, RightTop : out Pnt2d from gp)
286 LocatePart_RevExt(me; UV : Pnt2d from gp; DUV : Vec2d from gp;
287 S : HSurface from Adaptor3d;
288 LeftBot, RightTop : out Pnt2d from gp)
292 LocatePart_Offset(me; UV : Pnt2d from gp; DUV : Vec2d from gp;
293 S : HSurface from Adaptor3d;
294 LeftBot, RightTop : out Pnt2d from gp)
298 FindBounds(me; Arr : Array1OfReal from TColStd;
299 XYComp : Real from Standard;
300 DUVComp : Real from Standard;
301 Bnd1 : out Integer from Standard;
302 Bnd2 : out Integer from Standard;
303 DerIsNull : out Boolean from Standard)
304 ---Purpose: Extracts the numbers of knots which equal
305 -- the point and checks derivative components
306 -- by zero equivalence.
313 mySurface : HSurface from Adaptor3d;
314 myCurve : HCurve2d from Adaptor2d;
316 myType : CurveType from GeomAbs;
317 myCirc : Circ from gp;
320 myFirstSurf : HSurface from Adaptor3d;
321 myLastSurf : HSurface from Adaptor3d;
323 myIntervals : HSequenceOfReal from TColStd;
324 myIntCont : Shape from GeomAbs;