0023782: Intersection algorithm produces wrong section curves for the attached faces
[occt.git] / src / Adaptor3d / Adaptor3d_Curve.cdl
1 -- Created on: 1993-03-31
2 -- Created by: Bruno DUMORTIER
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
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.
10 --
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.
13 --
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.
20
21
22
23 deferred class Curve from Adaptor3d
24
25         ---Purpose: Root class for 3D curves on which geometric
26         -- algorithms work.
27         -- An adapted curve is an interface between the
28         -- services provided by a curve and those required of
29         -- the curve by algorithms which use it.
30         -- Two derived concrete classes are provided:
31         -- - GeomAdaptor_Curve for a curve from the Geom package
32         -- - Adaptor3d_CurveOnSurface for a curve lying on
33         --   a surface from the Geom package.
34     
35     
36 uses 
37      Array1OfReal    from TColStd,
38      Shape           from GeomAbs,
39      CurveType       from GeomAbs,
40      Vec             from gp,
41      Pnt             from gp,
42      Circ            from gp,
43      Elips           from gp,
44      Hypr            from gp,
45      Parab           from gp,
46      Lin             from gp,
47      BezierCurve     from Geom,
48      BSplineCurve    from Geom,
49      HCurve          from Adaptor3d
50      
51 raises
52     
53     OutOfRange          from Standard,
54     NoSuchObject        from Standard,
55     DomainError         from Standard
56  
57 is
58
59     --
60     --     Global methods - Apply to the whole curve.
61     --     
62     
63     Delete(me:out) is virtual;
64     ---C++: alias "Standard_EXPORT virtual ~Adaptor3d_Curve(){Delete();}"
65     
66     FirstParameter(me) returns Real
67     is virtual;
68
69     LastParameter(me) returns Real
70     is virtual;
71
72     --
73     -- Services to break the curves to the expected continuity
74     -- 
75     --  If  for example you  need the  curve to  be C2  and the method
76     --  Continuity   returns you something lower than   C2 (say C1 for
77     --  example).
78     --  
79     --  First  compute the   number  of intervals  with  the requested
80     --  continuity with the method  NbIntervals().   Note that if  the
81     --  continuity  is higher than the one   you need NbIntervals will
82     --  return 1.
83     --  
84     --  Then you get the parameters  bounding  the intervals with  the
85     --  method  Intervals,   using   an array    of  length  at  least
86     --  NbIntervals()+1.
87     -- 
88     -- If you need  to create a curve  with a restricted span you  can
89     -- use the method Trim().
90
91     
92     Continuity(me) returns Shape from GeomAbs
93         ---Purpose: 
94     is virtual;
95     
96     NbIntervals(me:in out; S : Shape from GeomAbs) returns Integer
97         ---Purpose: Returns  the number  of  intervals for  continuity
98         --          <S>. May be one if Continuity(me) >= <S>
99     is virtual;
100     
101     Intervals(me:in out; T : in out Array1OfReal from TColStd; 
102                   S : Shape from GeomAbs)
103         ---Purpose: Stores in <T> the  parameters bounding the intervals
104         --          of continuity <S>.
105         --          
106         --          The array must provide  enough room to  accomodate
107         --          for the parameters. i.e. T.Length() > NbIntervals()
108     raises
109         OutOfRange from Standard 
110     is virtual;
111     
112     Trim(me; First, Last, Tol : Real) returns HCurve from Adaptor3d
113         ---Purpose: Returns    a  curve equivalent   of  <me>  between
114         --          parameters <First>  and <Last>. <Tol>  is used  to
115         --          test for 3d points confusion.
116     raises
117         OutOfRange from Standard
118         ---Purpose: If <First> >= <Last> 
119     is virtual;
120     
121
122     IsClosed(me) returns Boolean
123     is virtual;
124      
125     IsPeriodic(me) returns Boolean
126     is virtual;
127     
128     Period(me) returns Real
129     raises
130         DomainError from Standard -- if the curve is not periodic
131     is virtual;
132      
133     Value(me; U : Real) returns Pnt from gp
134          --- Purpose : Computes the point of parameter U on the curve.
135     is virtual;
136     
137     D0 (me; U : Real; P : out Pnt from gp)
138          --- Purpose : Computes the point of parameter U on the curve.
139     is virtual;
140     
141     D1 (me; U : Real; P : out Pnt from gp ; V : out Vec from gp)
142          --- Purpose : Computes the point of parameter U on the curve with its
143          --  first derivative.
144      raises 
145         DomainError from Standard
146         --- Purpose : Raised if the continuity of the current interval
147         --  is not C1.
148     is virtual;
149     
150     D2 (me; U : Real; P : out Pnt from gp; V1, V2 : out Vec from gp)
151         --- Purpose :
152         --  Returns the point P of parameter U, the first and second
153         --  derivatives V1 and V2.
154      raises 
155         DomainError from Standard
156         --- Purpose : Raised if the continuity of the current interval
157         --  is not C2.
158      is virtual;
159
160     D3 (me; U : Real; P : out Pnt from gp; V1, V2, V3 : out Vec from gp)
161         --- Purpose :
162         --  Returns the point P of parameter U, the first, the second 
163         --  and the third derivative.
164      raises 
165         DomainError from Standard
166         --- Purpose : Raised if the continuity of the current interval
167         --  is not C3.
168      is virtual;
169         
170     DN (me; U : Real; N : Integer)   returns Vec from gp
171         --- Purpose :
172         --  The returned vector gives the value of the derivative for the 
173         --  order of derivation N.
174      raises  
175         DomainError from Standard,
176         --- Purpose : Raised if the continuity of the current interval
177         --  is not CN.
178         OutOfRange from Standard
179         --- Purpose : Raised if N < 1.            
180      is virtual;
181
182     Resolution(me; R3d : Real) returns Real
183          ---Purpose :  Returns the parametric  resolution corresponding
184          --         to the real space resolution <R3d>.
185     is virtual;   
186         
187     GetType(me) returns CurveType from GeomAbs
188         ---Purpose: Returns  the  type of the   curve  in the  current
189         --          interval :   Line,   Circle,   Ellipse, Hyperbola,
190         --          Parabola, BezierCurve, BSplineCurve, OtherCurve.
191     is virtual;
192
193     --
194     --     The following methods must  be called when GetType returned
195     --     the corresponding type.
196     --     
197
198      Line(me) returns Lin from gp
199      raises 
200         NoSuchObject from Standard
201      is virtual;
202      
203      Circle(me) returns Circ from gp
204      raises 
205         NoSuchObject from Standard
206      is virtual;
207      
208      Ellipse(me) returns Elips from gp
209      raises 
210         NoSuchObject from Standard
211      is virtual;
212      
213      Hyperbola(me) returns  Hypr from gp
214      raises 
215         NoSuchObject from Standard
216      is virtual;
217      
218      Parabola(me) returns Parab from gp
219      raises 
220         NoSuchObject from Standard
221      is virtual;
222
223      
224      Degree(me) returns Integer
225      raises 
226         NoSuchObject from Standard
227      is virtual;
228      
229      IsRational(me) returns Boolean
230      raises 
231         NoSuchObject from Standard
232      is virtual;
233      
234      NbPoles(me) returns Integer
235      raises 
236         NoSuchObject from Standard
237      is virtual;
238
239   
240      NbKnots(me) returns Integer
241      raises 
242         NoSuchObject from Standard
243      is virtual;     
244           
245      Bezier(me) returns BezierCurve from Geom
246      raises 
247         NoSuchObject from Standard
248      is virtual;
249     
250      BSpline(me) returns BSplineCurve from Geom
251      raises 
252         NoSuchObject from Standard
253      is virtual;
254     
255 end Curve;
256
257