b311480e |
1 | -- Created on: 1995-07-17 |
2 | -- Created by: Modelistation |
3 | -- Copyright (c) 1995-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class BCurveTool from HLRBRep |
18 | |
19 | uses |
20 | Array1OfReal from TColStd, |
21 | Array1OfPnt from TColgp, |
22 | Shape from GeomAbs, |
23 | CurveType from GeomAbs, |
24 | Vec from gp, |
25 | Pnt from gp, |
26 | Circ from gp, |
27 | Elips from gp, |
28 | Hypr from gp, |
29 | Parab from gp, |
30 | Lin from gp, |
31 | BezierCurve from Geom, |
32 | BSplineCurve from Geom, |
33 | Curve from BRepAdaptor |
34 | |
35 | raises |
36 | OutOfRange from Standard, |
37 | NoSuchObject from Standard, |
38 | DomainError from Standard |
39 | |
40 | is |
41 | -- |
42 | -- Global methods - Apply to the whole curve. |
43 | -- |
44 | |
45 | FirstParameter(myclass; C: Curve from BRepAdaptor) |
46 | returns Real from Standard; |
47 | ---C++: inline |
48 | |
49 | |
50 | LastParameter(myclass; C: Curve from BRepAdaptor) |
51 | returns Real from Standard; |
52 | ---C++: inline |
53 | |
54 | -- |
55 | -- Services to break the curves to the expected continuity |
56 | -- |
57 | -- If for example you need the curve to be C2 and the method |
58 | -- Continuity returns you something lower than C2 (say C1 for |
59 | -- example). |
60 | -- |
61 | -- First compute the number of intervals with the requested |
62 | -- continuity with the method NbIntervals(). Note that if the |
63 | -- continuity is higher than the one you need NbIntervals will |
64 | -- return 1. |
65 | -- |
66 | -- Then you get the parameters bounding the intervals with the |
67 | -- method Intervals, using an array of length at least |
68 | -- NbIntervals()+1. |
69 | -- |
70 | -- If you need to create a curve with a restricted span you can |
71 | -- use the method Trim(). |
72 | |
73 | |
74 | Continuity(myclass; C: Curve from BRepAdaptor) |
75 | returns Shape from GeomAbs; |
76 | ---Purpose: |
77 | ---C++: inline |
78 | |
79 | NbIntervals(myclass; C : in out Curve from BRepAdaptor; |
80 | S : Shape from GeomAbs) |
81 | returns Integer from Standard; |
82 | ---Purpose: Returns the number of intervals for continuity |
83 | -- <S>. May be one if Continuity(myclass) >= <S> |
84 | ---C++: inline |
85 | |
86 | Intervals(myclass; C : in out Curve from BRepAdaptor; |
87 | T : in out Array1OfReal from TColStd; |
88 | S : Shape from GeomAbs) |
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 OutOfRange from Standard; |
95 | ---C++: inline |
96 | |
97 | IsClosed(myclass; C: Curve from BRepAdaptor) |
98 | returns Boolean from Standard; |
99 | ---C++: inline |
100 | |
101 | IsPeriodic(myclass; C: Curve from BRepAdaptor) |
102 | returns Boolean from Standard; |
103 | ---C++: inline |
104 | |
105 | Period(myclass; C: Curve from BRepAdaptor) |
106 | returns Real from Standard |
107 | raises DomainError from Standard; |
108 | ---C++: inline |
109 | |
110 | Value(myclass; C : Curve from BRepAdaptor; |
111 | U : Real from Standard) |
112 | returns Pnt from gp; |
113 | --- Purpose : Computes the point of parameter U on the curve. |
114 | ---C++: inline |
115 | |
116 | D0 (myclass; C : Curve from BRepAdaptor; |
117 | U : Real from Standard; |
118 | P : out Pnt from gp); |
119 | --- Purpose : Computes the point of parameter U on the curve. |
120 | ---C++: inline |
121 | |
122 | D1 (myclass; C : Curve from BRepAdaptor; |
123 | U : Real from Standard; |
124 | P : out Pnt from gp ; |
125 | V : out Vec from gp) |
126 | --- Purpose : Computes the point of parameter U on the curve with its |
127 | -- first derivative. |
128 | raises DomainError from Standard; |
129 | --- Purpose : Raised if the continuity of the current interval |
130 | -- is not C1. |
131 | ---C++: inline |
132 | |
133 | D2 (myclass; C : Curve from BRepAdaptor; |
134 | U : Real from Standard; |
135 | P : out Pnt from gp; |
136 | V1, V2 : out Vec from gp) |
137 | --- Purpose : |
138 | -- Returns the point P of parameter U, the first and second |
139 | -- derivatives V1 and V2. |
140 | raises DomainError from Standard; |
141 | --- Purpose : Raised if the continuity of the current interval |
142 | -- is not C2. |
143 | ---C++: inline |
144 | |
145 | D3 (myclass; C : Curve from BRepAdaptor; |
146 | U : Real from Standard; |
147 | P : out Pnt from gp; |
148 | V1, V2, V3 : out Vec from gp) |
149 | --- Purpose : |
150 | -- Returns the point P of parameter U, the first, the second |
151 | -- and the third derivative. |
152 | raises DomainError from Standard; |
153 | --- Purpose : Raised if the continuity of the current interval |
154 | -- is not C3. |
155 | ---C++: inline |
156 | |
157 | DN (myclass; C : Curve from BRepAdaptor; |
158 | U : Real from Standard; |
159 | N : Integer from Standard) |
160 | returns Vec from gp |
161 | --- Purpose : |
162 | -- The returned vector gives the value of the derivative for the |
163 | -- order of derivation N. |
164 | raises |
165 | DomainError from Standard, |
166 | --- Purpose : Raised if the continuity of the current interval |
167 | -- is not CN. |
168 | OutOfRange from Standard; |
169 | --- Purpose : Raised if N < 1. |
170 | ---C++: inline |
171 | |
172 | Resolution(myclass; C : Curve from BRepAdaptor; |
173 | R3d : Real from Standard) |
174 | returns Real from Standard; |
175 | ---Purpose : Returns the parametric resolution corresponding |
176 | -- to the real space resolution <R3d>. |
177 | ---C++: inline |
178 | |
179 | GetType(myclass; C: Curve from BRepAdaptor) |
180 | returns CurveType from GeomAbs; |
181 | ---Purpose: Returns the type of the curve in the current |
182 | -- interval : Line, Circle, Ellipse, Hyperbola, |
183 | -- Parabola, BezierCurve, BSplineCurve, OtherCurve. |
184 | ---C++: inline |
185 | |
186 | -- |
187 | -- The following methods must be called when GetType returned |
188 | -- the corresponding type. |
189 | -- |
190 | |
191 | Line(myclass; C: Curve from BRepAdaptor) |
192 | returns Lin from gp |
193 | raises NoSuchObject from Standard; |
194 | ---C++: inline |
195 | |
196 | Circle(myclass; C: Curve from BRepAdaptor) |
197 | returns Circ from gp |
198 | raises NoSuchObject from Standard; |
199 | ---C++: inline |
200 | |
201 | Ellipse(myclass; C: Curve from BRepAdaptor) |
202 | returns Elips from gp |
203 | raises NoSuchObject from Standard; |
204 | ---C++: inline |
205 | |
206 | Hyperbola(myclass; C: Curve from BRepAdaptor) |
207 | returns Hypr from gp |
208 | raises NoSuchObject from Standard; |
209 | ---C++: inline |
210 | |
211 | Parabola(myclass; C: Curve from BRepAdaptor) |
212 | returns Parab from gp |
213 | raises NoSuchObject from Standard; |
214 | ---C++: inline |
215 | |
216 | Bezier(myclass; C: Curve from BRepAdaptor) |
217 | returns BezierCurve from Geom |
218 | raises NoSuchObject from Standard; |
219 | |
220 | BSpline(myclass; C: Curve from BRepAdaptor) |
221 | returns BSplineCurve from Geom |
222 | raises NoSuchObject from Standard; |
223 | |
224 | Degree(myclass; C: Curve from BRepAdaptor) |
225 | returns Integer from Standard; |
226 | ---C++: inline |
227 | |
228 | IsRational(myclass; C: Curve from BRepAdaptor) |
229 | returns Boolean from Standard; |
230 | ---C++: inline |
231 | |
232 | NbPoles(myclass; C: Curve from BRepAdaptor) |
233 | returns Integer from Standard; |
234 | ---C++: inline |
235 | |
236 | NbKnots(myclass; C: Curve from BRepAdaptor) |
237 | returns Integer from Standard; |
238 | ---C++: inline |
239 | |
240 | Poles(myclass; C : Curve from BRepAdaptor; |
241 | T : in out Array1OfPnt from TColgp); |
242 | |
243 | PolesAndWeights(myclass; C : Curve from BRepAdaptor; |
244 | T : in out Array1OfPnt from TColgp; |
245 | W : in out Array1OfReal from TColStd); |
246 | |
247 | NbSamples(myclass; C : Curve from BRepAdaptor; |
248 | U0,U1 : Real from Standard) |
249 | returns Integer from Standard; |
250 | |
251 | end BCurveTool; |