b311480e |
1 | -- Created on: 1993-02-22 |
2 | -- Created by: Remi LEQUETTE |
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 | |
7fd59977 |
21 | |
22 | |
23 | |
24 | class Surface from BRepAdaptor inherits Surface from Adaptor3d |
25 | |
26 | ---Purpose: The Surface from BRepAdaptor allows to use a Face |
27 | -- of the BRep topology look like a 3D surface. |
28 | -- |
29 | -- It has the methods of the class Surface from |
30 | -- Adaptor3d. |
31 | -- |
32 | -- It is created or initialized with a Face. It takes |
33 | -- into account the local coordinates system. |
34 | -- |
35 | -- The u,v parameter range is the minmax value for |
36 | -- the restriction, unless the flag restriction is |
37 | -- set to false. |
38 | |
39 | uses |
40 | Face from TopoDS, |
41 | SurfaceType from GeomAbs, |
42 | HSurface from Adaptor3d, |
43 | HCurve from Adaptor3d, |
44 | Surface from GeomAdaptor, |
45 | Shape from GeomAbs, |
46 | BezierSurface from Geom, |
47 | BSplineSurface from Geom, |
48 | Trsf from gp, |
49 | Pnt from gp, |
50 | Vec from gp, |
51 | Dir from gp, |
52 | Pln from gp, |
53 | Cylinder from gp, |
54 | Sphere from gp, |
55 | Torus from gp, |
56 | Cone from gp, |
57 | Ax1 from gp, |
58 | Array1OfReal from TColStd |
59 | |
60 | |
61 | raises |
62 | |
63 | OutOfRange from Standard, |
64 | DomainError from Standard, |
65 | NoSuchObject from Standard |
66 | |
67 | is |
68 | |
69 | Create returns Surface from BRepAdaptor; |
70 | ---Purpose: Creates an undefined surface with no face loaded. |
71 | |
72 | Create(F : Face from TopoDS; |
73 | R : Boolean = Standard_True) |
74 | returns Surface from BRepAdaptor; |
75 | ---Purpose: Creates a surface to access the geometry of <F>. |
76 | -- If <Restriction> is true the parameter range is |
77 | -- the parameter range in the UV space of the |
78 | -- restriction. |
79 | |
80 | Initialize(me : in out; F : Face from TopoDS; |
81 | Restriction : Boolean = Standard_True) |
82 | ---Purpose: Sets the surface to the geometry of <F>. |
83 | is static; |
84 | |
85 | Surface(me) returns Surface from GeomAdaptor |
86 | ---Purpose: Returns the surface. |
87 | -- |
88 | ---C++: return const & |
89 | is static; |
90 | |
91 | ChangeSurface(me : in out) returns Surface from GeomAdaptor |
92 | ---Purpose: Returns the surface. |
93 | -- |
94 | ---C++: return & |
95 | is static; |
96 | |
97 | Trsf(me) returns Trsf from gp |
98 | ---Purpose: Returns the surface coordinate system. |
99 | -- |
100 | ---C++: return const & |
101 | is static; |
102 | |
103 | Face(me) returns Face from TopoDS |
104 | ---Purpose: Returns the face. |
105 | -- |
106 | ---C++: return const & |
107 | is static; |
108 | |
109 | Tolerance(me) returns Real |
110 | ---Purpose: Returns the face tolerance. |
111 | -- |
112 | is static; |
113 | |
114 | -- |
115 | -- Methods of Surface from GeomAdaptor |
116 | -- |
117 | |
118 | FirstUParameter(me) returns Real |
119 | ---C++:inline |
120 | is redefined static; |
121 | |
122 | LastUParameter(me) returns Real |
123 | ---C++:inline |
124 | is redefined static; |
125 | |
126 | FirstVParameter(me) returns Real |
127 | ---C++:inline |
128 | is redefined static; |
129 | |
130 | LastVParameter(me) returns Real |
131 | ---C++:inline |
132 | is redefined static; |
133 | |
134 | UContinuity(me) returns Shape from GeomAbs |
135 | ---C++:inline |
136 | is redefined static; |
137 | |
138 | VContinuity(me) returns Shape from GeomAbs |
139 | ---C++:inline |
140 | is redefined static; |
141 | |
142 | NbUIntervals(me; S : Shape from GeomAbs) returns Integer |
143 | ---Purpose: If necessary, breaks the surface in U intervals of |
144 | -- continuity <S>. And returns the number of |
145 | -- intervals. |
146 | ---C++:inline |
147 | is redefined static; |
148 | |
149 | NbVIntervals(me; S : Shape from GeomAbs) returns Integer |
150 | ---Purpose: If necessary, breaks the surface in V intervals of |
151 | -- continuity <S>. And returns the number of |
152 | -- intervals. |
153 | ---C++:inline |
154 | is redefined static; |
155 | |
156 | UIntervals(me; T : in out Array1OfReal from TColStd; |
157 | S : Shape from GeomAbs ) |
158 | ---Purpose: Returns the intervals with the requested continuity |
159 | -- in the U direction. |
160 | raises |
161 | OutOfRange from Standard -- if the Length of the array does |
162 | -- have enought slots to accomodate |
163 | -- the result. |
164 | is redefined static; |
165 | |
166 | VIntervals(me; T : in out Array1OfReal from TColStd; |
167 | S : Shape from GeomAbs ) |
168 | ---Purpose: Returns the intervals with the requested continuity |
169 | -- in the V direction. |
170 | raises |
171 | OutOfRange from Standard -- if the Length of the array does |
172 | -- have enought slots to accomodate |
173 | -- the result. |
174 | is redefined static; |
175 | |
176 | UTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d |
177 | ---Purpose: Returns a surface trimmed in the U direction |
178 | -- equivalent of <me> between |
179 | -- parameters <First> and <Last>. <Tol> is used to |
180 | -- test for 3d points confusion. |
181 | raises |
182 | OutOfRange from Standard |
183 | ---Purpose: If <First> >= <Last> |
184 | is redefined static ; |
185 | |
186 | VTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d |
187 | ---Purpose: Returns a surface trimmed in the V direction between |
188 | -- parameters <First> and <Last>. <Tol> is used to |
189 | -- test for 3d points confusion. |
190 | raises |
191 | OutOfRange from Standard |
192 | ---Purpose: If <First> >= <Last> |
193 | is redefined static ; |
194 | |
195 | IsUClosed(me) returns Boolean |
196 | ---C++:inline |
197 | is redefined static; |
198 | |
199 | IsVClosed(me) returns Boolean |
200 | ---C++:inline |
201 | is redefined static; |
202 | |
203 | IsUPeriodic(me) returns Boolean |
204 | ---C++:inline |
205 | is redefined static; |
206 | |
207 | UPeriod(me) returns Real |
208 | raises |
209 | DomainError from Standard -- if the curve is not periodic |
210 | ---C++:inline |
211 | is redefined static; |
212 | |
213 | IsVPeriodic(me) returns Boolean |
214 | ---C++:inline |
215 | is redefined static; |
216 | |
217 | VPeriod(me) returns Real |
218 | ---C++:inline |
219 | raises |
220 | DomainError from Standard -- if the curve is not periodic |
221 | is redefined static; |
222 | |
223 | Value (me; U, V : Real) returns Pnt from gp |
224 | --- Purpose : Computes the point of parameters U,V on the surface. |
225 | is redefined static; |
226 | |
227 | D0 (me; U, V : Real; P : out Pnt from gp) |
228 | --- Purpose : Computes the point of parameters U,V on the surface. |
229 | is redefined static; |
230 | |
231 | D1 (me; U, V : Real; |
232 | P : out Pnt from gp; |
233 | D1U, D1V : out Vec from gp) |
234 | --- Purpose : Computes the point and the first derivatives on |
235 | -- the surface. |
236 | raises |
237 | DomainError from Standard |
238 | --- Purpose : Raised if the continuity of the current |
239 | -- intervals is not C1. |
240 | is redefined static; |
241 | |
242 | D2 (me; U, V : Real; |
243 | P : out Pnt from gp; |
244 | D1U, D1V, D2U, D2V, D2UV : out Vec from gp) |
245 | --- Purpose : Computes the point, the first and second |
246 | -- derivatives on the surface. |
247 | raises |
248 | DomainError from Standard |
249 | --- Purpose : Raised if the continuity of the current |
250 | -- intervals is not C2. |
251 | is redefined static; |
252 | |
253 | D3 (me; U, V : Real; P : out Pnt from gp; |
254 | D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV : out Vec from gp) |
255 | --- Purpose : Computes the point, the first, second and third |
256 | -- derivatives on the surface. |
257 | raises |
258 | DomainError from Standard |
259 | --- Purpose : Raised if the continuity of the current |
260 | -- intervals is not C3. |
261 | is redefined static; |
262 | |
263 | DN (me; U, V : Real; Nu, Nv : Integer) returns Vec from gp |
264 | --- Purpose : Computes the derivative of order Nu in the direction |
265 | -- U and Nv in the direction V at the point P(U, V). |
266 | raises |
267 | DomainError from Standard, |
268 | --- Purpose : Raised if the current U interval is not not CNu |
269 | -- and the current V interval is not CNv. |
270 | OutOfRange from Standard |
271 | --- Purpose : Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0. |
272 | is redefined static; |
273 | |
274 | UResolution(me; R3d : Real ) returns Real |
275 | ---Purpose : Returns the parametric U resolution corresponding |
276 | -- to the real space resolution <R3d>. |
277 | -- |
278 | ---C++:inline |
279 | is redefined static; |
280 | |
281 | VResolution(me; R3d : Real ) returns Real |
282 | ---Purpose : Returns the parametric V resolution corresponding |
283 | -- to the real space resolution <R3d>. |
284 | -- |
285 | ---C++:inline |
286 | is redefined static; |
287 | |
288 | GetType(me) returns SurfaceType from GeomAbs |
289 | ---Purpose: Returns the type of the surface : Plane, Cylinder, |
290 | -- Cone, Sphere, Torus, BezierSurface, |
291 | -- BSplineSurface, SurfaceOfRevolution, |
292 | -- SurfaceOfExtrusion, OtherSurface |
293 | ---C++:inline |
294 | is redefined static; |
295 | |
296 | Plane(me) returns Pln from gp |
297 | raises NoSuchObject from Standard |
298 | |
299 | is redefined static; |
300 | |
301 | Cylinder(me) returns Cylinder from gp |
302 | raises NoSuchObject from Standard |
303 | is redefined static; |
304 | |
305 | Cone(me) returns Cone from gp |
306 | raises NoSuchObject from Standard |
307 | is redefined static; |
308 | |
309 | Sphere(me) returns Sphere from gp |
310 | raises NoSuchObject from Standard |
311 | is redefined static; |
312 | |
313 | Torus(me) returns Torus from gp |
314 | raises NoSuchObject from Standard |
315 | is redefined static; |
316 | |
317 | |
318 | UDegree(me) returns Integer |
319 | raises NoSuchObject from Standard |
320 | ---C++:inline |
321 | is redefined static; |
322 | |
323 | NbUPoles(me) returns Integer |
324 | raises NoSuchObject from Standard |
325 | ---C++:inline |
326 | is redefined static; |
327 | |
328 | VDegree(me) returns Integer |
329 | raises NoSuchObject from Standard |
330 | ---C++:inline |
331 | is redefined static; |
332 | |
333 | NbVPoles(me) returns Integer |
334 | raises NoSuchObject from Standard |
335 | ---C++:inline |
336 | is redefined static; |
337 | |
338 | |
339 | NbUKnots(me) returns Integer |
340 | raises |
341 | NoSuchObject from Standard |
342 | ---C++:inline |
343 | is redefined static; |
344 | |
345 | |
346 | NbVKnots(me) returns Integer |
347 | raises |
348 | NoSuchObject from Standard |
349 | ---C++:inline |
350 | is redefined static; |
351 | |
352 | |
353 | IsURational(me) returns Boolean |
354 | raises |
355 | NoSuchObject from Standard |
356 | ---C++:inline |
357 | is redefined static; |
358 | |
359 | IsVRational(me) returns Boolean |
360 | raises |
361 | NoSuchObject from Standard |
362 | ---C++:inline |
363 | is redefined static; |
364 | |
365 | |
366 | Bezier(me) returns BezierSurface from Geom |
367 | ---Purpose: |
368 | --Warning : this will make a copy of the |
369 | -- Bezier Surface since it applies |
370 | -- to it the myTsrf transformation |
371 | -- Be Carefull when using this method |
372 | |
373 | raises |
374 | NoSuchObject from Standard |
375 | is redefined static; |
376 | |
377 | BSpline(me) returns BSplineSurface from Geom |
378 | ---Purpose: |
379 | -- Warning : this will make a copy of the |
380 | -- BSpline Surface since it applies |
381 | -- to it the myTsrf transformation |
382 | -- Be Carefull when using this method |
383 | |
384 | raises |
385 | NoSuchObject from Standard |
386 | is redefined static; |
387 | |
388 | AxeOfRevolution(me) returns Ax1 from gp |
389 | raises |
390 | NoSuchObject from Standard -- only for SurfaceOfRevolution |
391 | is redefined static; |
392 | |
393 | Direction(me) returns Dir from gp |
394 | raises |
395 | NoSuchObject from Standard -- only for SurfaceOfExtrusion |
396 | is redefined static; |
397 | |
398 | BasisCurve(me) returns HCurve from Adaptor3d |
399 | raises |
400 | NoSuchObject from Standard |
401 | ---Purpose: only for SurfaceOfExtrusion and SurfaceOfRevolution |
402 | -- Warning: this will make a copy of the underlying curve |
403 | -- since it applies to it the transformation |
404 | -- myTrsf. Be carefull when using this method. |
405 | is redefined static; |
406 | |
407 | BasisSurface(me) returns HSurface from Adaptor3d |
408 | raises |
409 | NoSuchObject from Standard -- only for Offset Surface |
410 | is redefined static; |
411 | |
412 | OffsetValue(me) returns Real from Standard |
413 | raises |
414 | NoSuchObject from Standard -- only for Offset Surface |
415 | is redefined static; |
416 | |
417 | fields |
418 | |
419 | mySurf : Surface from GeomAdaptor; |
420 | myTrsf : Trsf from gp; |
421 | myFace : Face from TopoDS; |
422 | |
423 | end Surface; |