b311480e |
1 | -- Created on: 1993-05-14 |
2 | -- Created by: Bruno DUMORTIER |
3 | -- Copyright (c) 1993-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 Surface from GeomAdaptor inherits Surface from Adaptor3d |
18 | |
19 | ---Purpose: An interface between the services provided by any |
20 | -- surface from the package Geom and those required |
21 | -- of the surface by algorithms which use it. |
ff8178ef |
22 | -- Creation of the loaded surface the surface is C1 by piece |
7fd59977 |
23 | uses |
24 | Pnt from gp, |
25 | Vec from gp, |
26 | Dir from gp, |
27 | Pln from gp, |
28 | Cone from gp, |
29 | Cylinder from gp, |
30 | Sphere from gp, |
31 | Torus from gp, |
32 | Ax1 from gp, |
33 | Array1OfReal from TColStd, |
34 | Surface from Geom, |
35 | BezierSurface from Geom, |
36 | BSplineSurface from Geom, |
37 | SurfaceType from GeomAbs, |
38 | Shape from GeomAbs, |
39 | Curve from GeomAdaptor, |
40 | HCurve from Adaptor3d, |
41 | HSurface from Adaptor3d |
42 | |
43 | raises |
44 | NoSuchObject from Standard, |
45 | OutOfRange from Standard, |
46 | ConstructionError from Standard, |
47 | DomainError from Standard |
48 | |
49 | is |
50 | |
51 | Create returns Surface from GeomAdaptor; |
52 | ---C++: inline |
53 | |
54 | Create( S : Surface from Geom) returns Surface from GeomAdaptor; |
55 | ---C++: inline |
56 | |
57 | Create( S : Surface from Geom; UFirst,ULast,VFirst,VLast : Real; |
58 | TolU : Real = 0.0; |
59 | TolV : Real = 0.0) |
60 | returns Surface from GeomAdaptor |
61 | raises ConstructionError from Standard; |
62 | ---Purpose: ConstructionError is raised if UFirst>ULast or VFirst>VLast |
63 | ---C++: inline |
64 | |
65 | Load(me : in out; S : Surface from Geom); |
66 | ---C++: inline |
67 | |
68 | Load(me : in out; S : Surface from Geom; |
69 | UFirst,ULast,VFirst,VLast : Real; |
70 | TolU : Real = 0.0; |
71 | TolV : Real = 0.0) |
72 | raises ConstructionError from Standard; |
041bfce9 |
73 | ---C++: inline |
74 | ---Purpose: ConstructionError is raised if UFirst>ULast or VFirst>VLast |
7fd59977 |
75 | |
76 | Surface(me) returns Surface from Geom |
77 | ---C++: return const& |
78 | ---C++: inline |
79 | is static; |
80 | |
81 | |
82 | -- |
83 | -- Global methods - Apply to the whole surface. |
84 | -- |
85 | |
86 | FirstUParameter(me) returns Real |
87 | ---C++:inline |
88 | is redefined static; |
89 | |
90 | LastUParameter(me) returns Real |
91 | ---C++:inline |
92 | is redefined static; |
93 | |
94 | FirstVParameter(me) returns Real |
95 | ---C++:inline |
96 | is redefined static; |
97 | |
98 | LastVParameter(me) returns Real |
99 | ---C++:inline |
100 | is redefined static; |
101 | |
102 | UContinuity(me) returns Shape from GeomAbs |
103 | is redefined static; |
104 | |
105 | VContinuity(me) returns Shape from GeomAbs |
106 | is redefined static; |
107 | |
108 | NbUIntervals(me; S : Shape from GeomAbs) returns Integer |
109 | ---Purpose: Returns the number of U intervals for continuity |
110 | -- <S>. May be one if UContinuity(me) >= <S> |
111 | is redefined static; |
112 | |
113 | NbVIntervals(me; S : Shape from GeomAbs) returns Integer |
114 | ---Purpose: Returns the number of V intervals for continuity |
115 | -- <S>. May be one if VContinuity(me) >= <S> |
116 | is redefined static; |
117 | |
118 | UIntervals(me; T : in out Array1OfReal from TColStd; |
119 | S : Shape from GeomAbs ) |
120 | ---Purpose: Returns the intervals with the requested continuity |
121 | -- in the U direction. |
122 | raises |
123 | OutOfRange from Standard -- if the Length of the array does |
124 | -- have enought slots to accomodate |
125 | -- the result. |
126 | is redefined static; |
127 | |
128 | VIntervals(me; T : in out Array1OfReal from TColStd; |
129 | S : Shape from GeomAbs ) |
130 | ---Purpose: Returns the intervals with the requested continuity |
131 | -- in the V direction. |
132 | raises |
133 | OutOfRange from Standard -- if the Length of the array does |
134 | -- have enought slots to accomodate |
135 | -- the result. |
136 | is redefined static; |
137 | |
138 | UTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d |
139 | ---Purpose: Returns a surface trimmed in the U direction |
140 | -- equivalent of <me> between |
141 | -- parameters <First> and <Last>. <Tol> is used to |
142 | -- test for 3d points confusion. |
143 | raises |
144 | OutOfRange from Standard |
145 | ---Purpose: If <First> >= <Last> |
146 | is redefined static ; |
147 | |
148 | VTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d |
149 | ---Purpose: Returns a surface trimmed in the V direction between |
150 | -- parameters <First> and <Last>. <Tol> is used to |
151 | -- test for 3d points confusion. |
152 | raises |
153 | OutOfRange from Standard |
154 | ---Purpose: If <First> >= <Last> |
155 | is redefined static ; |
156 | |
157 | IsUClosed(me) returns Boolean |
158 | is redefined static; |
159 | |
160 | IsVClosed(me) returns Boolean |
161 | is redefined static; |
162 | |
163 | IsUPeriodic(me) returns Boolean |
164 | is redefined static; |
165 | |
166 | UPeriod(me) returns Real |
167 | raises |
168 | DomainError from Standard -- if the curve is not periodic |
169 | is redefined static; |
170 | |
171 | IsVPeriodic(me) returns Boolean |
172 | is redefined static; |
173 | |
174 | VPeriod(me) returns Real |
175 | raises |
176 | DomainError from Standard -- if the curve is not periodic |
177 | is redefined static; |
178 | |
179 | Value (me; U, V : Real) returns Pnt from gp |
180 | --- Purpose : Computes the point of parameters U,V on the surface. |
181 | is redefined static; |
182 | |
183 | D0 (me; U, V : Real; |
184 | P : out Pnt from gp) |
185 | --- Purpose : Computes the point of parameters U,V on the surface. |
186 | is redefined static; |
187 | |
188 | D1 (me; U, V : Real; |
189 | P : out Pnt from gp; |
190 | D1U, D1V : out Vec from gp) |
191 | --- Purpose : Computes the point and the first derivatives on |
192 | -- the surface. |
193 | -- |
194 | -- Warning : On the specific case of BSplineSurface: |
195 | -- if the surface is cut in interval of continuity at least C1, |
196 | -- the derivatives are computed on the current interval. |
197 | -- else the derivatives are computed on the basis surface. |
198 | is redefined static; |
199 | |
200 | D2 (me; U, V : Real; |
201 | P : out Pnt from gp; |
202 | D1U, D1V : out Vec from gp; |
203 | D2U, D2V : out Vec from gp; |
204 | D2UV : out Vec from gp) |
205 | --- Purpose : Computes the point, the first and second |
206 | -- derivatives on the surface. |
207 | -- |
208 | -- Warning : On the specific case of BSplineSurface: |
209 | -- if the surface is cut in interval of continuity at least C2, |
210 | -- the derivatives are computed on the current interval. |
211 | -- else the derivatives are computed on the basis surface. |
212 | is redefined static; |
213 | |
214 | D3 (me; U, V : Real; |
215 | P : out Pnt from gp; |
216 | D1U, D1V : out Vec from gp; |
217 | D2U, D2V : out Vec from gp; |
218 | D2UV : out Vec from gp; |
219 | D3U, D3V : out Vec from gp; |
220 | D3UUV, D3UVV : out Vec from gp) |
221 | --- Purpose : Computes the point, the first, second and third |
222 | -- derivatives on the surface. |
223 | -- |
224 | -- Warning : On the specific case of BSplineSurface: |
225 | -- if the surface is cut in interval of continuity at least C3, |
226 | -- the derivatives are computed on the current interval. |
227 | -- else the derivatives are computed on the basis surface. |
228 | is redefined static; |
229 | |
230 | DN (me; U, V : Real; Nu, Nv : Integer) |
231 | returns Vec from gp |
232 | --- Purpose : Computes the derivative of order Nu in the |
233 | -- direction U and Nv in the direction V at the point P(U, V). |
234 | -- |
235 | -- Warning : On the specific case of BSplineSurface: |
236 | -- if the surface is cut in interval of continuity CN, |
237 | -- the derivatives are computed on the current interval. |
238 | -- else the derivatives are computed on the basis surface. |
239 | raises |
240 | OutOfRange from Standard |
241 | --- Purpose : Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0. |
242 | is redefined static; |
243 | |
244 | UResolution(me; R3d : Real ) returns Real |
245 | ---Purpose : Returns the parametric U resolution corresponding |
246 | -- to the real space resolution <R3d>. |
247 | is redefined static; |
248 | |
249 | VResolution(me; R3d : Real ) returns Real |
250 | ---Purpose : Returns the parametric V resolution corresponding |
251 | -- to the real space resolution <R3d>. |
252 | is redefined static; |
253 | |
254 | GetType(me) returns SurfaceType from GeomAbs |
255 | ---Purpose: Returns the type of the surface : Plane, Cylinder, |
256 | -- Cone, Sphere, Torus, BezierSurface, |
257 | -- BSplineSurface, SurfaceOfRevolution, |
258 | -- SurfaceOfExtrusion, OtherSurface |
259 | ---C++:inline |
260 | is redefined static; |
261 | |
262 | -- |
263 | -- The following methods must be called when GetType returned |
264 | -- the corresponding type. |
265 | -- |
266 | |
267 | Plane(me) returns Pln from gp |
268 | raises NoSuchObject from Standard |
269 | is redefined static; |
270 | |
271 | Cylinder(me) returns Cylinder from gp |
272 | raises NoSuchObject from Standard |
273 | is redefined static; |
274 | |
275 | Cone(me) returns Cone from gp |
276 | raises NoSuchObject from Standard |
277 | is redefined static; |
278 | |
279 | Sphere(me) returns Sphere from gp |
280 | raises NoSuchObject from Standard |
281 | is redefined static; |
282 | |
283 | Torus(me) returns Torus from gp |
284 | raises NoSuchObject from Standard |
285 | is redefined static; |
286 | |
287 | UDegree(me) returns Integer |
288 | raises NoSuchObject from Standard |
289 | is redefined static; |
290 | |
291 | NbUPoles(me) returns Integer |
292 | raises NoSuchObject from Standard |
293 | is redefined static; |
294 | |
295 | VDegree(me) returns Integer |
296 | raises NoSuchObject from Standard |
297 | is redefined static; |
298 | |
299 | NbVPoles(me) returns Integer |
300 | raises NoSuchObject from Standard |
301 | is redefined static; |
302 | |
303 | NbUKnots(me) returns Integer |
304 | raises |
305 | NoSuchObject from Standard |
306 | is redefined static; |
307 | |
308 | |
309 | NbVKnots(me) returns Integer |
310 | raises |
311 | NoSuchObject from Standard |
312 | is redefined static; |
313 | |
314 | |
315 | IsURational(me) returns Boolean |
316 | raises |
317 | NoSuchObject from Standard |
318 | is redefined static; |
319 | |
320 | IsVRational(me) returns Boolean |
321 | raises |
322 | NoSuchObject from Standard |
323 | is redefined static; |
324 | |
325 | |
326 | Bezier(me) returns BezierSurface from Geom |
327 | ---Purpose: This will NOT make a copy of the |
328 | -- Bezier Surface : If you want to modify |
329 | -- the Surface please make a copy yourself |
330 | -- Also it will NOT trim the surface to |
331 | -- myU/VFirst/Last. |
332 | raises |
333 | NoSuchObject from Standard |
334 | is redefined static; |
335 | |
336 | BSpline(me) returns BSplineSurface from Geom |
337 | ---Purpose: This will NOT make a copy of the |
338 | -- BSpline Surface : If you want to modify |
339 | -- the Surface please make a copy yourself |
340 | -- Also it will NOT trim the surface to |
341 | -- myU/VFirst/Last. |
342 | raises |
343 | NoSuchObject from Standard |
344 | is redefined static; |
345 | |
346 | AxeOfRevolution(me) returns Ax1 from gp |
347 | raises |
348 | NoSuchObject from Standard -- only for SurfaceOfRevolution |
349 | is redefined static; |
350 | |
351 | Direction(me) returns Dir from gp |
352 | raises |
353 | NoSuchObject from Standard -- only for SurfaceOfExtrusion |
354 | is redefined static; |
355 | |
356 | BasisCurve(me) returns HCurve from Adaptor3d |
357 | raises |
358 | NoSuchObject from Standard -- only for SurfaceOfExtrusion |
359 | is redefined static; |
360 | |
361 | |
362 | BasisSurface(me) returns HSurface from Adaptor3d |
363 | raises |
364 | NoSuchObject from Standard -- only for Offset Surface |
365 | is redefined static; |
366 | |
367 | OffsetValue(me) returns Real from Standard |
368 | raises |
369 | NoSuchObject from Standard -- only for Offset Surface |
370 | is redefined static; |
371 | |
372 | |
041bfce9 |
373 | Span (me;Side :Integer; Ideb,Ifin:Integer; |
374 | OutIdeb,OutIfin:out Integer; |
470ebb43 |
375 | FKIndx, LKIndx : Integer ) |
041bfce9 |
376 | is private; |
7fd59977 |
377 | |
378 | IfUVBound (me;U,V :Real;Ideb,Ifin,IVdeb,IVfin :out Integer; |
379 | USide,VSide: Integer) |
380 | returns Boolean from Standard |
041bfce9 |
381 | is private; |
382 | |
383 | load (me : in out; S : Surface from Geom; |
384 | UFirst,ULast,VFirst,VLast : Real; |
385 | TolU : Real = 0.0; |
386 | TolV : Real = 0.0) |
387 | is private; |
388 | |
7fd59977 |
389 | fields |
390 | |
391 | mySurface : Surface from Geom; |
392 | mySurfaceType : SurfaceType from GeomAbs; |
393 | myUFirst : Real from Standard; |
394 | myULast : Real from Standard; |
395 | myVFirst : Real from Standard; |
396 | myVLast : Real from Standard; |
397 | myTolU, myTolV : Real from Standard; |
398 | |
399 | end Surface; |