918d4fbac7a6e6e8f5a63f95646eefa9c0bd5034
[occt.git] / src / HLRBRep / HLRBRep_CurveTool.cdl
1 -- Created on: 1995-07-17
2 -- Created by: Modelistation
3 -- Copyright (c) 1995-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 class CurveTool from HLRBRep
23
24 uses 
25     Array1OfReal from TColStd,
26     Shape        from GeomAbs,
27     CurveType    from GeomAbs,
28     Vec2d        from gp,
29     Pnt2d        from gp,
30     Circ2d       from gp,
31     Elips2d      from gp,
32     Hypr2d       from gp,
33     Parab2d      from gp,
34     Lin2d        from gp,
35     BezierCurve  from Geom2d,
36     BSplineCurve from Geom2d
37      
38 raises
39     OutOfRange   from Standard,
40     NoSuchObject from Standard,
41     DomainError  from Standard
42  
43 is
44     --
45     --     Global methods - Apply to the whole curve.
46     --     
47     
48     FirstParameter(myclass; C: Address from Standard)
49     returns Real from Standard;
50         ---C++: inline
51
52     LastParameter(myclass; C: Address from Standard)
53     returns Real from Standard;
54         ---C++: inline    
55
56     --
57     -- Services to break the curves to the expected continuity
58     -- 
59     --  If  for example you  need the  curve to  be C2  and the method
60     --  Continuity   returns you something lower than   C2 (say C1 for
61     --  example).
62     --  
63     --  First  compute the   number  of intervals  with  the requested
64     --  continuity with the method  NbIntervals().   Note that if  the
65     --  continuity  is higher than the one   you need NbIntervals will
66     --  return 1.
67     --  
68     --  Then you get the parameters  bounding  the intervals with  the
69     --  method  Intervals,   using   an array    of  length  at  least
70     --  NbIntervals()+1.
71     -- 
72     -- If you need  to create a curve  with a restricted span you  can
73     -- use the method Trim().
74
75     
76     Continuity(myclass; C: Address from Standard)
77     returns Shape from GeomAbs;
78         ---Purpose: 
79         ---C++: inline
80     
81     NbIntervals(myclass; C: Address from Standard)
82     returns Integer from Standard;
83         ---Purpose: Returns  the number  of  intervals for  continuity
84         --          <S>. May be one if Continuity(myclass) >= <S>
85         ---C++: inline
86     
87     Intervals(myclass; C :        Address      from Standard;
88                        T : in out Array1OfReal from TColStd) 
89         ---Purpose: Stores in <T> the  parameters bounding the intervals
90         --          of continuity <S>.
91         --          
92         --          The array must provide  enough room to  accomodate
93         --          for the parameters. i.e. T.Length() > NbIntervals()
94     raises
95         OutOfRange from Standard;
96     ---C++: inline
97
98     GetInterval (myclass; C      :     Address      from Standard
99                         ; Index  :     Integer      from Standard
100                         ; Tab    :     Array1OfReal from TColStd
101                         ; U1, U2 : out Real         from Standard);
102         ---Purpose : output the bounds of interval of index <Index>
103         --           used if Type == Composite.
104         ---C++: inline
105         
106
107     IsClosed(myclass; C: Address from Standard)
108     returns Boolean from Standard;
109     ---C++: inline    
110      
111     IsPeriodic(myclass; C: Address from Standard)
112     returns Boolean from Standard;
113     ---C++: inline
114     
115     Period(myclass; C: Address from Standard)
116     returns Real from Standard
117     raises DomainError from Standard; -- if the curve is not periodic
118     ---C++: inline      
119      
120     Value(myclass; C: Address from Standard; U : Real)
121     returns Pnt2d from gp;
122          --- Purpose : Computes the point of parameter U on the curve.
123     ---C++: inline
124     
125     D0 (myclass; C :     Address from Standard;
126                  U :     Real    from Standard;
127                  P : out Pnt2d   from gp);
128          --- Purpose : Computes the point of parameter U on the curve.
129     ---C++: inline
130     
131     D1 (myclass; C :     Address from Standard;
132                  U :     Real    from Standard;
133                  P : out Pnt2d   from gp;
134                  V : out Vec2d   from gp)
135          --- Purpose : Computes the point  of parameter U on the curve
136          --  with its first derivative.
137      raises DomainError from Standard;
138         --- Purpose : Raised if the continuity of the current interval
139         --  is not C1.
140     ---C++: inline
141     
142     D2 (myclass; C      :     Address from Standard;
143                  U      :     Real    from Standard;
144                  P      : out Pnt2d   from gp;
145                  V1, V2 : out Vec2d   from gp)
146         --- Purpose :
147         --  Returns the point P of parameter U, the first and second
148         --  derivatives V1 and V2.
149      raises DomainError from Standard;
150         --- Purpose : Raised if the continuity of the current interval
151         --  is not C2.
152     ---C++: inline
153
154     D3 (myclass; C          : Address   from Standard;
155                  U          : Real      from Standard;
156                  P          : out Pnt2d from gp;
157                  V1, V2, V3 : out Vec2d from gp)
158         --- Purpose :
159         --  Returns the point P of parameter U, the first, the second 
160         --  and the third derivative.
161      raises DomainError from Standard;
162         --- Purpose : Raised if the continuity of the current interval
163         --  is not C3.
164     ---C++: inline
165         
166     DN (myclass; C : Address from Standard;
167                  U : Real    from Standard;
168                  N : Integer from Standard)
169     returns Vec2d from gp
170         --- Purpose :
171         --  The returned vector gives the value of the derivative for the 
172         --  order of derivation N.
173      raises  
174         DomainError from Standard,
175         --- Purpose : Raised if the continuity of the current interval
176         --  is not CN.
177         OutOfRange from Standard;
178         --- Purpose : Raised if N < 1.            
179     ---C++: inline
180
181     Resolution(myclass; C   : Address from Standard;
182                         R3d : Real    from Standard)
183     returns Real from Standard;
184          ---Purpose :  Returns the parametric  resolution corresponding
185          --         to the real space resolution <R3d>.
186     ---C++: inline
187         
188     GetType(myclass; C: Address from Standard)
189     returns CurveType from GeomAbs;
190         ---Purpose: Returns  the  type of the   curve  in the  current
191         --          interval :   Line,   Circle,   Ellipse, Hyperbola,
192         --          Parabola, BezierCurve, BSplineCurve, OtherCurve.
193     ---C++: inline
194
195     TheType(myclass; C: Address from Standard)
196     returns CurveType from GeomAbs;
197         ---Purpose: Returns  the  type of the   curve  in the  current
198         --          interval :   Line,   Circle,   Ellipse, Hyperbola,
199         --          Parabola, BezierCurve, BSplineCurve, OtherCurve.
200     ---C++: inline
201
202     --
203     --     The following methods must  be called when GetType returned
204     --     the corresponding type.
205     --     
206
207     Line(myclass; C: Address from Standard) returns Lin2d from gp
208     raises NoSuchObject from Standard;
209     ---C++: inline
210      
211     Circle(myclass; C: Address from Standard) returns Circ2d from gp
212     raises NoSuchObject from Standard;
213     ---C++: inline
214      
215     Ellipse(myclass; C: Address from Standard) returns Elips2d from gp
216     raises NoSuchObject from Standard;
217     ---C++: inline
218      
219     Hyperbola(myclass; C: Address from Standard) returns  Hypr2d from gp
220     raises NoSuchObject from Standard;
221     ---C++: inline
222      
223     Parabola(myclass; C: Address from Standard) returns Parab2d from gp
224     raises NoSuchObject from Standard;
225     ---C++: inline
226      
227     Bezier(myclass; C: Address from Standard)
228     returns BezierCurve from Geom2d
229     raises NoSuchObject from Standard;
230     ---C++: inline
231     
232     BSpline(myclass; C: Address from Standard)
233     returns BSplineCurve from Geom2d
234     raises NoSuchObject from Standard;
235     ---C++: inline
236
237     EpsX(myclass; C:Address from Standard) 
238     ---C++: inline
239     returns Real from Standard;
240
241     NbSamples(myclass; C    : Address from Standard;
242                        U0,U1: Real    from Standard) 
243     returns Integer from Standard;
244
245     NbSamples(myclass; C: Address from Standard)
246     returns Integer from Standard;
247
248 end CurveTool;