1 -- Created on: 1993-08-25
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 class ProjectedCurve from ProjLib inherits Curve2d from Adaptor2d
29 Projector from ProjLib,
31 CurveType from GeomAbs,
39 HCurve from Adaptor3d,
40 HCurve2d from Adaptor2d,
41 HSurface from Adaptor3d,
42 BezierCurve from Geom2d,
43 BSplineCurve from Geom2d,
44 Array1OfReal from TColStd
49 OutOfRange from Standard,
50 NoSuchObject from Standard,
51 DomainError from Standard,
52 NotImplemented from Standard
57 Create returns ProjectedCurve;
59 Create(S : HSurface from Adaptor3d)
60 returns ProjectedCurve;
62 Create(S : HSurface from Adaptor3d;
63 C : HCurve from Adaptor3d)
64 returns ProjectedCurve;
66 Create(S : HSurface from Adaptor3d;
67 C : HCurve from Adaptor3d;
68 Tol : Real from Standard)
69 returns ProjectedCurve;
72 Load(me : in out ; Tolerance : Real)
73 ---Purpose: Changes the tolerance used to project
74 -- the curve on the surface
77 Load(me : in out; S : HSurface from Adaptor3d)
78 ---Purpose: Changes the Surface.
81 Load(me : in out; C : HCurve from Adaptor3d)
82 ---Purpose: Changes the Curve.
85 GetSurface(me) returns HSurface from Adaptor3d
86 ---C++: return const &
89 GetCurve(me) returns HCurve from Adaptor3d
90 ---C++: return const &
93 GetTolerance(me) returns Real from Standard
94 ---Purpose: returns the tolerance reached if an approximation
99 -- Global methods - Apply to the whole curve.
102 FirstParameter(me) returns Real
105 LastParameter(me) returns Real
108 Continuity(me) returns Shape from GeomAbs
111 NbIntervals(me ; S : Shape from GeomAbs) returns Integer
112 ---Purpose: If necessary, breaks the curve in intervals of
113 -- continuity <S>. And returns the number of
117 Intervals(me; T : in out Array1OfReal from TColStd;
118 S : Shape from GeomAbs)
119 ---Purpose: Stores in <T> the parameters bounding the intervals
120 -- of continuity <S>.
122 -- The array must provide enough room to accomodate
123 -- for the parameters. i.e. T.Length() > NbIntervals()
125 OutOfRange from Standard
128 Trim(me; First, Last, Tol : Real) returns HCurve2d from Adaptor2d
129 ---Purpose: Returns a curve equivalent of <me> between
130 -- parameters <First> and <Last>. <Tol> is used to
131 -- test for 3d points confusion.
133 OutOfRange from Standard
134 ---Purpose: If <First> >= <Last>
137 IsClosed(me) returns Boolean
140 IsPeriodic(me) returns Boolean
143 Period(me) returns Real
145 DomainError from Standard -- if the curve is not periodic
148 Value(me; U : Real) returns Pnt2d from gp
149 --- Purpose : Computes the point of parameter U on the curve.
152 D0 (me; U : Real; P : out Pnt2d from gp)
153 --- Purpose : Computes the point of parameter U on the curve.
156 D1 (me; U : Real; P : out Pnt2d from gp ; V : out Vec2d from gp)
157 --- Purpose : Computes the point of parameter U on the curve with its
160 DomainError from Standard
161 --- Purpose : Raised if the continuity of the current interval
165 D2 (me; U : Real; P : out Pnt2d from gp; V1, V2 : out Vec2d from gp)
167 -- Returns the point P of parameter U, the first and second
168 -- derivatives V1 and V2.
170 DomainError from Standard
171 --- Purpose : Raised if the continuity of the current interval
175 D3 (me; U : Real; P : out Pnt2d from gp; V1, V2, V3 : out Vec2d from gp)
177 -- Returns the point P of parameter U, the first, the second
178 -- and the third derivative.
180 DomainError from Standard
181 --- Purpose : Raised if the continuity of the current interval
185 DN (me; U : Real; N : Integer) returns Vec2d from gp
187 -- The returned vector gives the value of the derivative for the
188 -- order of derivation N.
190 DomainError from Standard,
191 --- Purpose : Raised if the continuity of the current interval
193 OutOfRange from Standard
194 --- Purpose : Raised if N < 1.
197 Resolution(me; R3d : Real) returns Real
198 ---Purpose : Returns the parametric resolution corresponding
199 -- to the real space resolution <R3d>.
202 GetType(me) returns CurveType from GeomAbs
203 ---Purpose: Returns the type of the curve in the current
204 -- interval : Line, Circle, Ellipse, Hyperbola,
205 -- Parabola, BezierCurve, BSplineCurve, OtherCurve.
209 -- The following methods must be called when GetType returned
210 -- the corresponding type.
213 Line(me) returns Lin2d from gp
215 NoSuchObject from Standard
218 Circle(me) returns Circ2d from gp
220 NoSuchObject from Standard
223 Ellipse(me) returns Elips2d from gp
225 NoSuchObject from Standard
228 Hyperbola(me) returns Hypr2d from gp
230 NoSuchObject from Standard
233 Parabola(me) returns Parab2d from gp
235 NoSuchObject from Standard
238 Degree(me) returns Integer
240 NoSuchObject from Standard
243 IsRational(me) returns Boolean
245 NoSuchObject from Standard
248 NbPoles(me) returns Integer
250 NoSuchObject from Standard
254 NbKnots(me) returns Integer
256 NoSuchObject from Standard
262 Bezier(me) returns BezierCurve from Geom2d
264 NoSuchObject from Standard
266 ---Purpose: Warning ! This will NOT make a copy of the -- Bezier Curve -
267 -- If you want to modify -- the Curve please make a copy
268 -- yourself -- Also it will NOT trim the surface to --
271 BSpline(me) returns BSplineCurve from Geom2d
273 NoSuchObject from Standard
275 ---Purpose: Warning ! This will NOT make a copy of the BSpline Curve - If
276 -- you want to modify the Curve please make a copy
277 -- yourself Also it will NOT trim the surface to
284 mySurface : HSurface from Adaptor3d ;
285 myCurve : HCurve from Adaptor3d ;
286 myResult : Projector from ProjLib ;