1 -- Created on: 1994-09-02
2 -- Created by: Bruno DUMORTIER
3 -- Copyright (c) 1994-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.
22 class ProjectOnPlane from ProjLib inherits Curve from Adaptor3d
25 ---Purpose: Class used to project a 3d curve on a plane. The
26 -- result will be a 3d curve.
28 -- You can ask the projected curve to have the same
29 -- parametrization as the original curve.
31 -- The projection can be done along every direction not
32 -- parallel to the plane.
40 CurveType from GeomAbs,
51 HCurve from GeomAdaptor,
52 HCurve from Adaptor3d,
53 BezierCurve from Geom,
54 BSplineCurve from Geom,
55 Array1OfPnt from TColgp,
56 Array1OfReal from TColStd,
57 Array1OfInteger from TColStd
61 OutOfRange from Standard,
62 NoSuchObject from Standard,
63 DomainError from Standard,
64 ConstructionError from Standard,
65 NotImplemented from Standard
69 Create returns ProjectOnPlane from ProjLib;
70 ---Purpose: Empty constructor.
73 Create( Pl : Ax3 from gp)
74 ---Purpose: The projection will be normal to the Plane defined
76 returns ProjectOnPlane from ProjLib;
79 Create( Pl : Ax3 from gp;
81 returns ProjectOnPlane from ProjLib
82 ---Purpose: The projection will be along the direction <D> on
83 -- the plane defined by the Ax3 <Pl>.
85 ConstructionError from Standard;
86 ---Purpose: raises if the direction <D> is parallel to the
91 C : HCurve from Adaptor3d;
92 Tolerance : Real from Standard;
93 KeepParametrization : Boolean from Standard = Standard_True)
94 ---Purpose: Sets the Curve and perform the projection. if
95 -- <KeepParametrization> is true, the parametrization
96 -- of the Projected Curve <PC> will be the same as
97 -- the parametrization of the initial curve <C>. It
98 -- meens: proj(C(u)) = PC(u) for each u. Otherwize,
99 -- the parametrization may change.
103 GetPlane(me) returns Ax3 from gp
104 ---C++: return const &
107 GetDirection (me) returns Dir from gp
108 ---C++: return const &
111 GetCurve(me) returns HCurve from Adaptor3d
112 ---C++: return const &
116 -- Global methods - Apply to the whole curve.
119 FirstParameter(me) returns Real
122 LastParameter(me) returns Real
125 Continuity(me) returns Shape from GeomAbs
128 NbIntervals(me: in out; S : Shape from GeomAbs) returns Integer
129 ---Purpose: If necessary, breaks the curve in intervals of
130 -- continuity <S>. And returns the number of
134 Intervals(me: in out; T : in out Array1OfReal from TColStd;
135 S : Shape from GeomAbs)
136 ---Purpose: Stores in <T> the parameters bounding the intervals
137 -- of continuity <S>.
139 -- The array must provide enough room to accomodate
140 -- for the parameters. i.e. T.Length() > NbIntervals()
142 OutOfRange from Standard
145 Trim(me; First, Last, Tol : Real) returns HCurve from Adaptor3d
146 ---Purpose: Returns a curve equivalent of <me> between
147 -- parameters <First> and <Last>. <Tol> is used to
148 -- test for 3d points confusion.
150 OutOfRange from Standard
151 ---Purpose: If <First> >= <Last>
155 IsClosed(me) returns Boolean
158 IsPeriodic(me) returns Boolean
161 Period(me) returns Real
163 DomainError from Standard -- if the curve is not periodic
166 Value(me; U : Real) returns Pnt from gp
167 --- Purpose : Computes the point of parameter U on the curve.
170 D0 (me; U : Real; P : out Pnt from gp)
171 --- Purpose : Computes the point of parameter U on the curve.
174 D1 (me; U : Real; P : out Pnt from gp ; V : out Vec from gp)
175 --- Purpose : Computes the point of parameter U on the curve with its
178 DomainError from Standard
179 --- Purpose : Raised if the continuity of the current interval
183 D2 (me; U : Real; P : out Pnt from gp; V1, V2 : out Vec from gp)
185 -- Returns the point P of parameter U, the first and second
186 -- derivatives V1 and V2.
188 DomainError from Standard
189 --- Purpose : Raised if the continuity of the current interval
193 D3 (me; U : Real; P : out Pnt from gp; V1, V2, V3 : out Vec from gp)
195 -- Returns the point P of parameter U, the first, the second
196 -- and the third derivative.
198 DomainError from Standard
199 --- Purpose : Raised if the continuity of the current interval
203 DN (me; U : Real; N : Integer) returns Vec from gp
205 -- The returned vector gives the value of the derivative for the
206 -- order of derivation N.
208 DomainError from Standard,
209 --- Purpose : Raised if the continuity of the current interval
211 OutOfRange from Standard
212 --- Purpose : Raised if N < 1.
215 Resolution(me; R3d : Real) returns Real
216 ---Purpose : Returns the parametric resolution corresponding
217 -- to the real space resolution <R3d>.
220 GetType(me) returns CurveType from GeomAbs
221 ---Purpose: Returns the type of the curve in the current
222 -- interval : Line, Circle, Ellipse, Hyperbola,
223 -- Parabola, BezierCurve, BSplineCurve, OtherCurve.
227 -- The following methods must be called when GetType returned
228 -- the corresponding type.
231 Line(me) returns Lin from gp
233 NoSuchObject from Standard
236 Circle(me) returns Circ from gp
238 NoSuchObject from Standard
241 Ellipse(me) returns Elips from gp
243 NoSuchObject from Standard
246 Hyperbola(me) returns Hypr from gp
248 NoSuchObject from Standard
251 Parabola(me) returns Parab from gp
253 NoSuchObject from Standard
257 Degree(me) returns Integer
259 NoSuchObject from Standard
262 IsRational(me) returns Boolean
264 NoSuchObject from Standard
267 NbPoles(me) returns Integer
269 NoSuchObject from Standard
273 NbKnots(me) returns Integer
275 NoSuchObject from Standard
279 Bezier(me) returns BezierCurve from Geom
281 NoSuchObject from Standard
283 ---Purpose: Warning ! this will NOT make a copy of the
284 -- Bezier Curve : If you want to modify
285 -- the Curve please make a copy yourself
286 -- Also it will NOT trim the surface to
289 BSpline(me) returns BSplineCurve from Geom
291 NoSuchObject from Standard
293 ---Purpose: Warning ! this will NOT make a copy of the
294 -- BSpline Curve : If you want to modify
295 -- the Curve please make a copy yourself
296 -- Also it will NOT trim the surface to
302 myCurve : HCurve from Adaptor3d ;
303 myPlane : Ax3 from gp;
304 myDirection : Dir from gp;
305 myKeepParam : Boolean from Standard;
306 myFirstPar : Real from Standard;
307 myLastPar : Real from Standard;
308 myTolerance : Real from Standard;
309 -- the tolerance to make the approximation if
311 myType : CurveType from GeomAbs;
312 myResult : HCurve from GeomAdaptor ;
313 myIsApprox : Boolean from Standard;
315 -- the result of the approximation