1 -- Created on: 1994-09-02
2 -- Created by: Bruno DUMORTIER
3 -- Copyright (c) 1994-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 ProjectOnPlane from ProjLib inherits Curve from Adaptor3d
20 ---Purpose: Class used to project a 3d curve on a plane. The
21 -- result will be a 3d curve.
23 -- You can ask the projected curve to have the same
24 -- parametrization as the original curve.
26 -- The projection can be done along every direction not
27 -- parallel to the plane.
35 CurveType from GeomAbs,
46 HCurve from GeomAdaptor,
47 HCurve from Adaptor3d,
48 BezierCurve from Geom,
49 BSplineCurve from Geom,
50 Array1OfPnt from TColgp,
51 Array1OfReal from TColStd,
52 Array1OfInteger from TColStd
56 OutOfRange from Standard,
57 NoSuchObject from Standard,
58 DomainError from Standard,
59 ConstructionError from Standard,
60 NotImplemented from Standard
64 Create returns ProjectOnPlane from ProjLib;
65 ---Purpose: Empty constructor.
68 Create( Pl : Ax3 from gp)
69 ---Purpose: The projection will be normal to the Plane defined
71 returns ProjectOnPlane from ProjLib;
74 Create( Pl : Ax3 from gp;
76 returns ProjectOnPlane from ProjLib
77 ---Purpose: The projection will be along the direction <D> on
78 -- the plane defined by the Ax3 <Pl>.
80 ConstructionError from Standard;
81 ---Purpose: raises if the direction <D> is parallel to the
86 C : HCurve from Adaptor3d;
87 Tolerance : Real from Standard;
88 KeepParametrization : Boolean from Standard = Standard_True)
89 ---Purpose: Sets the Curve and perform the projection. if
90 -- <KeepParametrization> is true, the parametrization
91 -- of the Projected Curve <PC> will be the same as
92 -- the parametrization of the initial curve <C>. It
93 -- meens: proj(C(u)) = PC(u) for each u. Otherwize,
94 -- the parametrization may change.
98 GetPlane(me) returns Ax3 from gp
99 ---C++: return const &
102 GetDirection (me) returns Dir from gp
103 ---C++: return const &
106 GetCurve(me) returns HCurve from Adaptor3d
107 ---C++: return const &
111 -- Global methods - Apply to the whole curve.
114 FirstParameter(me) returns Real
117 LastParameter(me) returns Real
120 Continuity(me) returns Shape from GeomAbs
123 NbIntervals(me: in out; S : Shape from GeomAbs) returns Integer
124 ---Purpose: If necessary, breaks the curve in intervals of
125 -- continuity <S>. And returns the number of
129 Intervals(me: in out; T : in out Array1OfReal from TColStd;
130 S : Shape from GeomAbs)
131 ---Purpose: Stores in <T> the parameters bounding the intervals
132 -- of continuity <S>.
134 -- The array must provide enough room to accomodate
135 -- for the parameters. i.e. T.Length() > NbIntervals()
137 OutOfRange from Standard
140 Trim(me; First, Last, Tol : Real) returns HCurve from Adaptor3d
141 ---Purpose: Returns a curve equivalent of <me> between
142 -- parameters <First> and <Last>. <Tol> is used to
143 -- test for 3d points confusion.
145 OutOfRange from Standard
146 ---Purpose: If <First> >= <Last>
150 IsClosed(me) returns Boolean
153 IsPeriodic(me) returns Boolean
156 Period(me) returns Real
158 DomainError from Standard -- if the curve is not periodic
161 Value(me; U : Real) returns Pnt from gp
162 --- Purpose : Computes the point of parameter U on the curve.
165 D0 (me; U : Real; P : out Pnt from gp)
166 --- Purpose : Computes the point of parameter U on the curve.
169 D1 (me; U : Real; P : out Pnt from gp ; V : out Vec from gp)
170 --- Purpose : Computes the point of parameter U on the curve with its
173 DomainError from Standard
174 --- Purpose : Raised if the continuity of the current interval
178 D2 (me; U : Real; P : out Pnt from gp; V1, V2 : out Vec from gp)
180 -- Returns the point P of parameter U, the first and second
181 -- derivatives V1 and V2.
183 DomainError from Standard
184 --- Purpose : Raised if the continuity of the current interval
188 D3 (me; U : Real; P : out Pnt from gp; V1, V2, V3 : out Vec from gp)
190 -- Returns the point P of parameter U, the first, the second
191 -- and the third derivative.
193 DomainError from Standard
194 --- Purpose : Raised if the continuity of the current interval
198 DN (me; U : Real; N : Integer) returns Vec from gp
200 -- The returned vector gives the value of the derivative for the
201 -- order of derivation N.
203 DomainError from Standard,
204 --- Purpose : Raised if the continuity of the current interval
206 OutOfRange from Standard
207 --- Purpose : Raised if N < 1.
210 Resolution(me; R3d : Real) returns Real
211 ---Purpose : Returns the parametric resolution corresponding
212 -- to the real space resolution <R3d>.
215 GetType(me) returns CurveType from GeomAbs
216 ---Purpose: Returns the type of the curve in the current
217 -- interval : Line, Circle, Ellipse, Hyperbola,
218 -- Parabola, BezierCurve, BSplineCurve, OtherCurve.
222 -- The following methods must be called when GetType returned
223 -- the corresponding type.
226 Line(me) returns Lin from gp
228 NoSuchObject from Standard
231 Circle(me) returns Circ from gp
233 NoSuchObject from Standard
236 Ellipse(me) returns Elips from gp
238 NoSuchObject from Standard
241 Hyperbola(me) returns Hypr from gp
243 NoSuchObject from Standard
246 Parabola(me) returns Parab from gp
248 NoSuchObject from Standard
252 Degree(me) returns Integer
254 NoSuchObject from Standard
257 IsRational(me) returns Boolean
259 NoSuchObject from Standard
262 NbPoles(me) returns Integer
264 NoSuchObject from Standard
268 NbKnots(me) returns Integer
270 NoSuchObject from Standard
274 Bezier(me) returns BezierCurve from Geom
276 NoSuchObject from Standard
278 ---Purpose: Warning ! this will NOT make a copy of the
279 -- Bezier Curve : If you want to modify
280 -- the Curve please make a copy yourself
281 -- Also it will NOT trim the surface to
284 BSpline(me) returns BSplineCurve from Geom
286 NoSuchObject from Standard
288 ---Purpose: Warning ! this will NOT make a copy of the
289 -- BSpline Curve : If you want to modify
290 -- the Curve please make a copy yourself
291 -- Also it will NOT trim the surface to
297 myCurve : HCurve from Adaptor3d ;
298 myPlane : Ax3 from gp;
299 myDirection : Dir from gp;
300 myKeepParam : Boolean from Standard;
301 myFirstPar : Real from Standard;
302 myLastPar : Real from Standard;
303 myTolerance : Real from Standard;
304 -- the tolerance to make the approximation if
306 myType : CurveType from GeomAbs;
307 myResult : HCurve from GeomAdaptor ;
308 myIsApprox : Boolean from Standard;
310 -- the result of the approximation