1 -- Created on: 1993-08-25
2 -- Created by: Bruno DUMORTIER
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 ProjectedCurve from ProjLib inherits Curve2d from Adaptor2d
18 ---Purpose: Compute the 2d-curve. Try to solve the particular
19 -- case if possible. Otherwize, an approximation is
24 Projector from ProjLib,
26 CurveType from GeomAbs,
34 HCurve from Adaptor3d,
35 HCurve2d from Adaptor2d,
36 HSurface from Adaptor3d,
37 BezierCurve from Geom2d,
38 BSplineCurve from Geom2d,
39 Array1OfReal from TColStd
44 OutOfRange from Standard,
45 NoSuchObject from Standard,
46 DomainError from Standard,
47 NotImplemented from Standard
52 Create returns ProjectedCurve;
54 Create(S : HSurface from Adaptor3d)
55 returns ProjectedCurve;
57 Create(S : HSurface from Adaptor3d;
58 C : HCurve from Adaptor3d)
59 returns ProjectedCurve;
61 Create(S : HSurface from Adaptor3d;
62 C : HCurve from Adaptor3d;
63 Tol : Real from Standard)
64 returns ProjectedCurve;
67 Load(me : in out ; Tolerance : Real)
68 ---Purpose: Changes the tolerance used to project
69 -- the curve on the surface
72 Load(me : in out; S : HSurface from Adaptor3d)
73 ---Purpose: Changes the Surface.
76 Load(me : in out; C : HCurve from Adaptor3d)
77 ---Purpose: Changes the Curve.
80 GetSurface(me) returns HSurface from Adaptor3d
81 ---C++: return const &
84 GetCurve(me) returns HCurve from Adaptor3d
85 ---C++: return const &
88 GetTolerance(me) returns Real from Standard
89 ---Purpose: returns the tolerance reached if an approximation
94 -- Global methods - Apply to the whole curve.
97 FirstParameter(me) returns Real
100 LastParameter(me) returns Real
103 Continuity(me) returns Shape from GeomAbs
106 NbIntervals(me ; S : Shape from GeomAbs) returns Integer
107 ---Purpose: If necessary, breaks the curve in intervals of
108 -- continuity <S>. And returns the number of
112 Intervals(me; T : in out Array1OfReal from TColStd;
113 S : Shape from GeomAbs)
114 ---Purpose: Stores in <T> the parameters bounding the intervals
115 -- of continuity <S>.
117 -- The array must provide enough room to accomodate
118 -- for the parameters. i.e. T.Length() > NbIntervals()
120 OutOfRange from Standard
123 Trim(me; First, Last, Tol : Real) returns HCurve2d from Adaptor2d
124 ---Purpose: Returns a curve equivalent of <me> between
125 -- parameters <First> and <Last>. <Tol> is used to
126 -- test for 3d points confusion.
128 OutOfRange from Standard
129 ---Purpose: If <First> >= <Last>
132 IsClosed(me) returns Boolean
135 IsPeriodic(me) returns Boolean
138 Period(me) returns Real
140 DomainError from Standard -- if the curve is not periodic
143 Value(me; U : Real) returns Pnt2d from gp
144 --- Purpose : Computes the point of parameter U on the curve.
147 D0 (me; U : Real; P : out Pnt2d from gp)
148 --- Purpose : Computes the point of parameter U on the curve.
151 D1 (me; U : Real; P : out Pnt2d from gp ; V : out Vec2d from gp)
152 --- Purpose : Computes the point of parameter U on the curve with its
155 DomainError from Standard
156 --- Purpose : Raised if the continuity of the current interval
160 D2 (me; U : Real; P : out Pnt2d from gp; V1, V2 : out Vec2d from gp)
162 -- Returns the point P of parameter U, the first and second
163 -- derivatives V1 and V2.
165 DomainError from Standard
166 --- Purpose : Raised if the continuity of the current interval
170 D3 (me; U : Real; P : out Pnt2d from gp; V1, V2, V3 : out Vec2d from gp)
172 -- Returns the point P of parameter U, the first, the second
173 -- and the third derivative.
175 DomainError from Standard
176 --- Purpose : Raised if the continuity of the current interval
180 DN (me; U : Real; N : Integer) returns Vec2d from gp
182 -- The returned vector gives the value of the derivative for the
183 -- order of derivation N.
185 DomainError from Standard,
186 --- Purpose : Raised if the continuity of the current interval
188 OutOfRange from Standard
189 --- Purpose : Raised if N < 1.
192 Resolution(me; R3d : Real) returns Real
193 ---Purpose : Returns the parametric resolution corresponding
194 -- to the real space resolution <R3d>.
197 GetType(me) returns CurveType from GeomAbs
198 ---Purpose: Returns the type of the curve in the current
199 -- interval : Line, Circle, Ellipse, Hyperbola,
200 -- Parabola, BezierCurve, BSplineCurve, OtherCurve.
204 -- The following methods must be called when GetType returned
205 -- the corresponding type.
208 Line(me) returns Lin2d from gp
210 NoSuchObject from Standard
213 Circle(me) returns Circ2d from gp
215 NoSuchObject from Standard
218 Ellipse(me) returns Elips2d from gp
220 NoSuchObject from Standard
223 Hyperbola(me) returns Hypr2d from gp
225 NoSuchObject from Standard
228 Parabola(me) returns Parab2d from gp
230 NoSuchObject from Standard
233 Degree(me) returns Integer
235 NoSuchObject from Standard
238 IsRational(me) returns Boolean
240 NoSuchObject from Standard
243 NbPoles(me) returns Integer
245 NoSuchObject from Standard
249 NbKnots(me) returns Integer
251 NoSuchObject from Standard
257 Bezier(me) returns BezierCurve from Geom2d
259 NoSuchObject from Standard
261 ---Purpose: Warning ! This will NOT make a copy of the -- Bezier Curve -
262 -- If you want to modify -- the Curve please make a copy
263 -- yourself -- Also it will NOT trim the surface to --
266 BSpline(me) returns BSplineCurve from Geom2d
268 NoSuchObject from Standard
270 ---Purpose: Warning ! This will NOT make a copy of the BSpline Curve - If
271 -- you want to modify the Curve please make a copy
272 -- yourself Also it will NOT trim the surface to
279 mySurface : HSurface from Adaptor3d ;
280 myCurve : HCurve from Adaptor3d ;
281 myResult : Projector from ProjLib ;