0025095: Wrong result obtained by projection algorithm
[occt.git] / src / ProjLib / ProjLib_ProjectedCurve.cdl
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
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
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.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
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
20     --          done.
21
22 uses
23
24      Projector       from ProjLib,
25      Shape           from GeomAbs,
26      CurveType       from GeomAbs,
27      Vec2d           from gp,
28      Pnt2d           from gp,
29      Circ2d          from gp,
30      Elips2d         from gp,
31      Hypr2d          from gp,
32      Parab2d         from gp,
33      Lin2d           from gp,
34      HCurve          from Adaptor3d,
35      HCurve2d        from Adaptor2d,
36      HSurface        from Adaptor3d,
37      BezierCurve     from Geom2d,
38      BSplineCurve    from Geom2d,
39      Array1OfReal    from TColStd
40      
41      
42 raises
43     
44     OutOfRange          from Standard,
45     NoSuchObject        from Standard,
46     DomainError         from Standard,
47     NotImplemented      from Standard
48     
49  
50 is
51
52     Create returns ProjectedCurve;
53     
54     Create(S : HSurface from Adaptor3d) 
55     returns ProjectedCurve;
56     
57     Create(S : HSurface from Adaptor3d; 
58            C : HCurve   from Adaptor3d) 
59     returns ProjectedCurve; 
60       
61     Create(S   : HSurface from Adaptor3d; 
62            C   : HCurve   from Adaptor3d;
63            Tol : Real     from Standard) 
64     returns ProjectedCurve; 
65       
66     
67     Load(me : in out ; Tolerance : Real) 
68     ---Purpose: Changes the tolerance used to project
69     --          the curve on the surface
70     is static;
71     
72     Load(me : in out; S : HSurface from Adaptor3d)
73         ---Purpose: Changes the Surface.
74     is static;
75     
76     Load(me : in out; C : HCurve from Adaptor3d)
77         ---Purpose: Changes the Curve.
78     is static;
79     
80     GetSurface(me) returns HSurface from Adaptor3d
81         ---C++: return const &
82     is static;
83
84     GetCurve(me) returns  HCurve from Adaptor3d 
85         ---C++: return const &
86     is static;
87     
88     GetTolerance(me) returns Real from Standard
89         ---Purpose: returns the tolerance reached if an approximation
90         --          is Done.
91     is static;
92
93     --
94     --     Global methods - Apply to the whole curve.
95     --     
96     
97     FirstParameter(me) returns Real
98     is redefined static;
99
100     LastParameter(me) returns Real
101     is redefined static;
102     
103     Continuity(me) returns Shape from GeomAbs
104     is redefined static;
105     
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
109         --          intervals.
110     is redefined static;
111     
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>.
116         --          
117         --          The array must provide  enough room to  accomodate
118         --          for the parameters. i.e. T.Length() > NbIntervals()
119     raises
120         OutOfRange from Standard 
121     is redefined static;
122     
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.
127     raises
128         OutOfRange from Standard
129         ---Purpose: If <First> >= <Last> 
130     is redefined static;
131     
132     IsClosed(me) returns Boolean
133     is redefined static;
134      
135     IsPeriodic(me) returns Boolean
136     is redefined static;
137     
138     Period(me) returns Real
139     raises
140         DomainError from Standard -- if the curve is not periodic
141     is redefined static;
142      
143     Value(me; U : Real) returns Pnt2d from gp
144          --- Purpose : Computes the point of parameter U on the curve.
145     is redefined static;
146     
147     D0 (me; U : Real; P : out Pnt2d from gp)
148          --- Purpose : Computes the point of parameter U on the curve.
149     is redefined static;
150     
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
153          --  first derivative.
154      raises 
155         DomainError from Standard
156         --- Purpose : Raised if the continuity of the current interval
157         --  is not C1.
158     is redefined static;
159     
160     D2 (me; U : Real; P : out Pnt2d from gp; V1, V2 : out Vec2d from gp)
161         --- Purpose :
162         --  Returns the point P of parameter U, the first and second
163         --  derivatives V1 and V2.
164      raises 
165         DomainError from Standard
166         --- Purpose : Raised if the continuity of the current interval
167         --  is not C2.
168      is redefined static;
169
170     D3 (me; U : Real; P : out Pnt2d from gp; V1, V2, V3 : out Vec2d from gp)
171         --- Purpose :
172         --  Returns the point P of parameter U, the first, the second 
173         --  and the third derivative.
174      raises 
175         DomainError from Standard
176         --- Purpose : Raised if the continuity of the current interval
177         --  is not C3.
178      is redefined static;
179         
180     DN (me; U : Real; N : Integer)   returns Vec2d from gp
181         --- Purpose :
182         --  The returned vector gives the value of the derivative for the 
183         --  order of derivation N.
184      raises  
185         DomainError from Standard,
186         --- Purpose : Raised if the continuity of the current interval
187         --  is not CN.
188         OutOfRange from Standard
189         --- Purpose : Raised if N < 1.            
190      is redefined static;
191
192     Resolution(me; R3d : Real) returns Real
193          ---Purpose :  Returns the parametric  resolution corresponding
194          --         to the real space resolution <R3d>.
195     is redefined static;   
196         
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.
201     is redefined static;
202
203     --
204     --     The following methods must  be called when GetType returned
205     --     the corresponding type.
206     --     
207
208      Line(me) returns Lin2d from gp
209      raises 
210         NoSuchObject from Standard
211      is redefined static;
212      
213      Circle(me) returns Circ2d from gp
214      raises 
215         NoSuchObject from Standard
216      is redefined static;
217      
218      Ellipse(me) returns Elips2d from gp
219      raises 
220         NoSuchObject from Standard
221      is redefined static;
222      
223      Hyperbola(me) returns  Hypr2d from gp
224      raises 
225         NoSuchObject from Standard
226      is redefined static;
227      
228      Parabola(me) returns Parab2d from gp
229      raises 
230         NoSuchObject from Standard
231      is redefined static;
232      
233      Degree(me) returns Integer
234      raises 
235         NoSuchObject from Standard
236      is redefined static;
237      
238      IsRational(me) returns Boolean
239      raises 
240         NoSuchObject from Standard
241      is redefined static;
242      
243      NbPoles(me) returns Integer
244      raises 
245         NoSuchObject from Standard
246      is redefined static;
247      
248     
249      NbKnots(me) returns Integer
250      raises 
251         NoSuchObject from Standard
252      is redefined static;
253      
254      
255
256
257      Bezier(me) returns BezierCurve from Geom2d
258      raises 
259         NoSuchObject from Standard
260      is redefined static;
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 --
264      --         myFirst/Last.
265     
266      BSpline(me) returns BSplineCurve from Geom2d
267      raises 
268         NoSuchObject from Standard
269      is redefined static;
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
273       --         myFirst/Last.
274      
275     
276 fields
277
278      myTolerance : Real ;
279      mySurface   : HSurface   from Adaptor3d ;
280      myCurve     : HCurve     from Adaptor3d ;
281      myResult    : Projector  from ProjLib ;
282      
283 end ProjectedCurve;