1 -- Created on: 1993-03-31
2 -- Created by: Bruno DUMORTIER
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
23 deferred class Curve from Adaptor3d
25 ---Purpose: Root class for 3D curves on which geometric
27 -- An adapted curve is an interface between the
28 -- services provided by a curve and those required of
29 -- the curve by algorithms which use it.
30 -- Two derived concrete classes are provided:
31 -- - GeomAdaptor_Curve for a curve from the Geom package
32 -- - Adaptor3d_CurveOnSurface for a curve lying on
33 -- a surface from the Geom package.
37 Array1OfReal from TColStd,
39 CurveType from GeomAbs,
47 BezierCurve from Geom,
48 BSplineCurve from Geom,
53 OutOfRange from Standard,
54 NoSuchObject from Standard,
55 DomainError from Standard
60 -- Global methods - Apply to the whole curve.
63 Delete(me:out) is virtual;
64 ---C++: alias "Standard_EXPORT virtual ~Adaptor3d_Curve(){Delete();}"
66 FirstParameter(me) returns Real
69 LastParameter(me) returns Real
73 -- Services to break the curves to the expected continuity
75 -- If for example you need the curve to be C2 and the method
76 -- Continuity returns you something lower than C2 (say C1 for
79 -- First compute the number of intervals with the requested
80 -- continuity with the method NbIntervals(). Note that if the
81 -- continuity is higher than the one you need NbIntervals will
84 -- Then you get the parameters bounding the intervals with the
85 -- method Intervals, using an array of length at least
88 -- If you need to create a curve with a restricted span you can
89 -- use the method Trim().
92 Continuity(me) returns Shape from GeomAbs
96 NbIntervals(me:in out; S : Shape from GeomAbs) returns Integer
97 ---Purpose: Returns the number of intervals for continuity
98 -- <S>. May be one if Continuity(me) >= <S>
101 Intervals(me:in out; T : in out Array1OfReal from TColStd;
102 S : Shape from GeomAbs)
103 ---Purpose: Stores in <T> the parameters bounding the intervals
104 -- of continuity <S>.
106 -- The array must provide enough room to accomodate
107 -- for the parameters. i.e. T.Length() > NbIntervals()
109 OutOfRange from Standard
112 Trim(me; First, Last, Tol : Real) returns HCurve from Adaptor3d
113 ---Purpose: Returns a curve equivalent of <me> between
114 -- parameters <First> and <Last>. <Tol> is used to
115 -- test for 3d points confusion.
117 OutOfRange from Standard
118 ---Purpose: If <First> >= <Last>
122 IsClosed(me) returns Boolean
125 IsPeriodic(me) returns Boolean
128 Period(me) returns Real
130 DomainError from Standard -- if the curve is not periodic
133 Value(me; U : Real) returns Pnt from gp
134 --- Purpose : Computes the point of parameter U on the curve.
137 D0 (me; U : Real; P : out Pnt from gp)
138 --- Purpose : Computes the point of parameter U on the curve.
141 D1 (me; U : Real; P : out Pnt from gp ; V : out Vec from gp)
142 --- Purpose : Computes the point of parameter U on the curve with its
145 DomainError from Standard
146 --- Purpose : Raised if the continuity of the current interval
150 D2 (me; U : Real; P : out Pnt from gp; V1, V2 : out Vec from gp)
152 -- Returns the point P of parameter U, the first and second
153 -- derivatives V1 and V2.
155 DomainError from Standard
156 --- Purpose : Raised if the continuity of the current interval
160 D3 (me; U : Real; P : out Pnt from gp; V1, V2, V3 : out Vec from gp)
162 -- Returns the point P of parameter U, the first, the second
163 -- and the third derivative.
165 DomainError from Standard
166 --- Purpose : Raised if the continuity of the current interval
170 DN (me; U : Real; N : Integer) returns Vec from gp
172 -- The returned vector gives the value of the derivative for the
173 -- order of derivation N.
175 DomainError from Standard,
176 --- Purpose : Raised if the continuity of the current interval
178 OutOfRange from Standard
179 --- Purpose : Raised if N < 1.
182 Resolution(me; R3d : Real) returns Real
183 ---Purpose : Returns the parametric resolution corresponding
184 -- to the real space resolution <R3d>.
187 GetType(me) returns CurveType from GeomAbs
188 ---Purpose: Returns the type of the curve in the current
189 -- interval : Line, Circle, Ellipse, Hyperbola,
190 -- Parabola, BezierCurve, BSplineCurve, OtherCurve.
194 -- The following methods must be called when GetType returned
195 -- the corresponding type.
198 Line(me) returns Lin from gp
200 NoSuchObject from Standard
203 Circle(me) returns Circ from gp
205 NoSuchObject from Standard
208 Ellipse(me) returns Elips from gp
210 NoSuchObject from Standard
213 Hyperbola(me) returns Hypr from gp
215 NoSuchObject from Standard
218 Parabola(me) returns Parab from gp
220 NoSuchObject from Standard
224 Degree(me) returns Integer
226 NoSuchObject from Standard
229 IsRational(me) returns Boolean
231 NoSuchObject from Standard
234 NbPoles(me) returns Integer
236 NoSuchObject from Standard
240 NbKnots(me) returns Integer
242 NoSuchObject from Standard
245 Bezier(me) returns BezierCurve from Geom
247 NoSuchObject from Standard
250 BSpline(me) returns BSplineCurve from Geom
252 NoSuchObject from Standard