1 -- Created on: 1993-05-14
2 -- Created by: Bruno DUMORTIER
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
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
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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class Surface from GeomAdaptor inherits Surface from Adaptor3d
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.
22 -- Creation of the loaded surface the surface is C1 by piece
33 Array1OfReal from TColStd,
35 BezierSurface from Geom,
36 BSplineSurface from Geom,
37 SurfaceType from GeomAbs,
39 Curve from GeomAdaptor,
40 HCurve from Adaptor3d,
41 HSurface from Adaptor3d,
45 NoSuchObject from Standard,
46 OutOfRange from Standard,
47 ConstructionError from Standard,
48 DomainError from Standard
52 Create returns Surface from GeomAdaptor;
55 Create( S : Surface from Geom) returns Surface from GeomAdaptor;
58 Create( S : Surface from Geom; UFirst,ULast,VFirst,VLast : Real;
61 returns Surface from GeomAdaptor
62 raises ConstructionError from Standard;
63 ---Purpose: ConstructionError is raised if UFirst>ULast or VFirst>VLast
66 Load(me : in out; S : Surface from Geom);
69 Load(me : in out; S : Surface from Geom;
70 UFirst,ULast,VFirst,VLast : Real;
73 raises ConstructionError from Standard;
75 ---Purpose: ConstructionError is raised if UFirst>ULast or VFirst>VLast
77 Surface(me) returns Surface from Geom
84 -- Global methods - Apply to the whole surface.
87 FirstUParameter(me) returns Real
91 LastUParameter(me) returns Real
95 FirstVParameter(me) returns Real
99 LastVParameter(me) returns Real
103 UContinuity(me) returns Shape from GeomAbs
106 VContinuity(me) returns Shape from GeomAbs
109 NbUIntervals(me; S : Shape from GeomAbs) returns Integer
110 ---Purpose: Returns the number of U intervals for continuity
111 -- <S>. May be one if UContinuity(me) >= <S>
114 NbVIntervals(me; S : Shape from GeomAbs) returns Integer
115 ---Purpose: Returns the number of V intervals for continuity
116 -- <S>. May be one if VContinuity(me) >= <S>
119 UIntervals(me; T : in out Array1OfReal from TColStd;
120 S : Shape from GeomAbs )
121 ---Purpose: Returns the intervals with the requested continuity
122 -- in the U direction.
124 OutOfRange from Standard -- if the Length of the array does
125 -- have enought slots to accomodate
129 VIntervals(me; T : in out Array1OfReal from TColStd;
130 S : Shape from GeomAbs )
131 ---Purpose: Returns the intervals with the requested continuity
132 -- in the V direction.
134 OutOfRange from Standard -- if the Length of the array does
135 -- have enought slots to accomodate
139 UTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d
140 ---Purpose: Returns a surface trimmed in the U direction
141 -- equivalent of <me> between
142 -- parameters <First> and <Last>. <Tol> is used to
143 -- test for 3d points confusion.
145 OutOfRange from Standard
146 ---Purpose: If <First> >= <Last>
147 is redefined static ;
149 VTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d
150 ---Purpose: Returns a surface trimmed in the V direction between
151 -- parameters <First> and <Last>. <Tol> is used to
152 -- test for 3d points confusion.
154 OutOfRange from Standard
155 ---Purpose: If <First> >= <Last>
156 is redefined static ;
158 IsUClosed(me) returns Boolean
161 IsVClosed(me) returns Boolean
164 IsUPeriodic(me) returns Boolean
167 UPeriod(me) returns Real
169 DomainError from Standard -- if the curve is not periodic
172 IsVPeriodic(me) returns Boolean
175 VPeriod(me) returns Real
177 DomainError from Standard -- if the curve is not periodic
180 Value (me; U, V : Real) returns Pnt from gp
181 --- Purpose : Computes the point of parameters U,V on the surface.
186 --- Purpose : Computes the point of parameters U,V on the surface.
191 D1U, D1V : out Vec from gp)
192 --- Purpose : Computes the point and the first derivatives on
195 -- Warning : On the specific case of BSplineSurface:
196 -- if the surface is cut in interval of continuity at least C1,
197 -- the derivatives are computed on the current interval.
198 -- else the derivatives are computed on the basis surface.
203 D1U, D1V : out Vec from gp;
204 D2U, D2V : out Vec from gp;
205 D2UV : out Vec from gp)
206 --- Purpose : Computes the point, the first and second
207 -- derivatives on the surface.
209 -- Warning : On the specific case of BSplineSurface:
210 -- if the surface is cut in interval of continuity at least C2,
211 -- the derivatives are computed on the current interval.
212 -- else the derivatives are computed on the basis surface.
217 D1U, D1V : out Vec from gp;
218 D2U, D2V : out Vec from gp;
219 D2UV : out Vec from gp;
220 D3U, D3V : out Vec from gp;
221 D3UUV, D3UVV : out Vec from gp)
222 --- Purpose : Computes the point, the first, second and third
223 -- derivatives on the surface.
225 -- Warning : On the specific case of BSplineSurface:
226 -- if the surface is cut in interval of continuity at least C3,
227 -- the derivatives are computed on the current interval.
228 -- else the derivatives are computed on the basis surface.
231 DN (me; U, V : Real; Nu, Nv : Integer)
233 --- Purpose : Computes the derivative of order Nu in the
234 -- direction U and Nv in the direction V at the point P(U, V).
236 -- Warning : On the specific case of BSplineSurface:
237 -- if the surface is cut in interval of continuity CN,
238 -- the derivatives are computed on the current interval.
239 -- else the derivatives are computed on the basis surface.
241 OutOfRange from Standard
242 --- Purpose : Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
245 UResolution(me; R3d : Real ) returns Real
246 ---Purpose : Returns the parametric U resolution corresponding
247 -- to the real space resolution <R3d>.
250 VResolution(me; R3d : Real ) returns Real
251 ---Purpose : Returns the parametric V resolution corresponding
252 -- to the real space resolution <R3d>.
255 GetType(me) returns SurfaceType from GeomAbs
256 ---Purpose: Returns the type of the surface : Plane, Cylinder,
257 -- Cone, Sphere, Torus, BezierSurface,
258 -- BSplineSurface, SurfaceOfRevolution,
259 -- SurfaceOfExtrusion, OtherSurface
264 -- The following methods must be called when GetType returned
265 -- the corresponding type.
268 Plane(me) returns Pln from gp
269 raises NoSuchObject from Standard
272 Cylinder(me) returns Cylinder from gp
273 raises NoSuchObject from Standard
276 Cone(me) returns Cone from gp
277 raises NoSuchObject from Standard
280 Sphere(me) returns Sphere from gp
281 raises NoSuchObject from Standard
284 Torus(me) returns Torus from gp
285 raises NoSuchObject from Standard
288 UDegree(me) returns Integer
289 raises NoSuchObject from Standard
292 NbUPoles(me) returns Integer
293 raises NoSuchObject from Standard
296 VDegree(me) returns Integer
297 raises NoSuchObject from Standard
300 NbVPoles(me) returns Integer
301 raises NoSuchObject from Standard
304 NbUKnots(me) returns Integer
306 NoSuchObject from Standard
310 NbVKnots(me) returns Integer
312 NoSuchObject from Standard
316 IsURational(me) returns Boolean
318 NoSuchObject from Standard
321 IsVRational(me) returns Boolean
323 NoSuchObject from Standard
327 Bezier(me) returns BezierSurface from Geom
328 ---Purpose: This will NOT make a copy of the
329 -- Bezier Surface : If you want to modify
330 -- the Surface please make a copy yourself
331 -- Also it will NOT trim the surface to
334 NoSuchObject from Standard
337 BSpline(me) returns BSplineSurface from Geom
338 ---Purpose: This will NOT make a copy of the
339 -- BSpline Surface : If you want to modify
340 -- the Surface please make a copy yourself
341 -- Also it will NOT trim the surface to
344 NoSuchObject from Standard
347 AxeOfRevolution(me) returns Ax1 from gp
349 NoSuchObject from Standard -- only for SurfaceOfRevolution
352 Direction(me) returns Dir from gp
354 NoSuchObject from Standard -- only for SurfaceOfExtrusion
357 BasisCurve(me) returns HCurve from Adaptor3d
359 NoSuchObject from Standard -- only for SurfaceOfExtrusion
363 BasisSurface(me) returns HSurface from Adaptor3d
365 NoSuchObject from Standard -- only for Offset Surface
368 OffsetValue(me) returns Real from Standard
370 NoSuchObject from Standard -- only for Offset Surface
374 Span (me;Side :Integer; Ideb,Ifin:Integer;
375 OutIdeb,OutIfin:out Integer;
376 FKIndx, LKIndx : Integer )
379 IfUVBound (me;U,V :Real;Ideb,Ifin,IVdeb,IVfin :out Integer;
380 USide,VSide: Integer)
381 returns Boolean from Standard
384 load (me : in out; S : Surface from Geom;
385 UFirst,ULast,VFirst,VLast : Real;
390 RebuildCache(me; theU, theV : Real)
391 ---Purpose: Rebuilds B-spline cache
392 -- \param theU first parameter to identify the span for caching
393 -- \param theV second parameter to identify the span for caching
398 mySurface : Surface from Geom;
399 mySurfaceType : SurfaceType from GeomAbs;
400 myUFirst : Real from Standard;
401 myULast : Real from Standard;
402 myVFirst : Real from Standard;
403 myVLast : Real from Standard;
404 myTolU, myTolV : Real from Standard;
405 mySurfaceCache : Cache from BSplSLib;