1 -- Created on: 1993-05-14
2 -- Created by: Bruno DUMORTIER
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
22 class Surface from GeomAdaptor inherits Surface from Adaptor3d
24 ---Purpose: An interface between the services provided by any
25 -- surface from the package Geom and those required
26 -- of the surface by algorithms which use it.
38 Array1OfReal from TColStd,
40 BezierSurface from Geom,
41 BSplineSurface from Geom,
42 SurfaceType from GeomAbs,
44 Curve from GeomAdaptor,
45 HCurve from Adaptor3d,
46 HSurface from Adaptor3d
49 NoSuchObject from Standard,
50 OutOfRange from Standard,
51 ConstructionError from Standard,
52 DomainError from Standard
56 Create returns Surface from GeomAdaptor;
59 Create( S : Surface from Geom) returns Surface from GeomAdaptor;
62 Create( S : Surface from Geom; UFirst,ULast,VFirst,VLast : Real;
65 returns Surface from GeomAdaptor
66 raises ConstructionError from Standard;
67 ---Purpose: ConstructionError is raised if UFirst>ULast or VFirst>VLast
70 Load(me : in out; S : Surface from Geom);
73 Load(me : in out; S : Surface from Geom;
74 UFirst,ULast,VFirst,VLast : Real;
77 raises ConstructionError from Standard;
79 ---Purpose: ConstructionError is raised if UFirst>ULast or VFirst>VLast
81 Surface(me) returns Surface from Geom
88 -- Global methods - Apply to the whole surface.
91 FirstUParameter(me) returns Real
95 LastUParameter(me) returns Real
99 FirstVParameter(me) returns Real
103 LastVParameter(me) returns Real
107 UContinuity(me) returns Shape from GeomAbs
110 VContinuity(me) returns Shape from GeomAbs
113 NbUIntervals(me; S : Shape from GeomAbs) returns Integer
114 ---Purpose: Returns the number of U intervals for continuity
115 -- <S>. May be one if UContinuity(me) >= <S>
118 NbVIntervals(me; S : Shape from GeomAbs) returns Integer
119 ---Purpose: Returns the number of V intervals for continuity
120 -- <S>. May be one if VContinuity(me) >= <S>
123 UIntervals(me; T : in out Array1OfReal from TColStd;
124 S : Shape from GeomAbs )
125 ---Purpose: Returns the intervals with the requested continuity
126 -- in the U direction.
128 OutOfRange from Standard -- if the Length of the array does
129 -- have enought slots to accomodate
133 VIntervals(me; T : in out Array1OfReal from TColStd;
134 S : Shape from GeomAbs )
135 ---Purpose: Returns the intervals with the requested continuity
136 -- in the V direction.
138 OutOfRange from Standard -- if the Length of the array does
139 -- have enought slots to accomodate
143 UTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d
144 ---Purpose: Returns a surface trimmed in the U direction
145 -- equivalent of <me> between
146 -- parameters <First> and <Last>. <Tol> is used to
147 -- test for 3d points confusion.
149 OutOfRange from Standard
150 ---Purpose: If <First> >= <Last>
151 is redefined static ;
153 VTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d
154 ---Purpose: Returns a surface trimmed in the V direction between
155 -- parameters <First> and <Last>. <Tol> is used to
156 -- test for 3d points confusion.
158 OutOfRange from Standard
159 ---Purpose: If <First> >= <Last>
160 is redefined static ;
162 IsUClosed(me) returns Boolean
165 IsVClosed(me) returns Boolean
168 IsUPeriodic(me) returns Boolean
171 UPeriod(me) returns Real
173 DomainError from Standard -- if the curve is not periodic
176 IsVPeriodic(me) returns Boolean
179 VPeriod(me) returns Real
181 DomainError from Standard -- if the curve is not periodic
184 Value (me; U, V : Real) returns Pnt from gp
185 --- Purpose : Computes the point of parameters U,V on the surface.
190 --- Purpose : Computes the point of parameters U,V on the surface.
195 D1U, D1V : out Vec from gp)
196 --- Purpose : Computes the point and the first derivatives on
199 -- Warning : On the specific case of BSplineSurface:
200 -- if the surface is cut in interval of continuity at least C1,
201 -- the derivatives are computed on the current interval.
202 -- else the derivatives are computed on the basis surface.
207 D1U, D1V : out Vec from gp;
208 D2U, D2V : out Vec from gp;
209 D2UV : out Vec from gp)
210 --- Purpose : Computes the point, the first and second
211 -- derivatives on the surface.
213 -- Warning : On the specific case of BSplineSurface:
214 -- if the surface is cut in interval of continuity at least C2,
215 -- the derivatives are computed on the current interval.
216 -- else the derivatives are computed on the basis surface.
221 D1U, D1V : out Vec from gp;
222 D2U, D2V : out Vec from gp;
223 D2UV : out Vec from gp;
224 D3U, D3V : out Vec from gp;
225 D3UUV, D3UVV : out Vec from gp)
226 --- Purpose : Computes the point, the first, second and third
227 -- derivatives on the surface.
229 -- Warning : On the specific case of BSplineSurface:
230 -- if the surface is cut in interval of continuity at least C3,
231 -- the derivatives are computed on the current interval.
232 -- else the derivatives are computed on the basis surface.
235 DN (me; U, V : Real; Nu, Nv : Integer)
237 --- Purpose : Computes the derivative of order Nu in the
238 -- direction U and Nv in the direction V at the point P(U, V).
240 -- Warning : On the specific case of BSplineSurface:
241 -- if the surface is cut in interval of continuity CN,
242 -- the derivatives are computed on the current interval.
243 -- else the derivatives are computed on the basis surface.
245 OutOfRange from Standard
246 --- Purpose : Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
249 UResolution(me; R3d : Real ) returns Real
250 ---Purpose : Returns the parametric U resolution corresponding
251 -- to the real space resolution <R3d>.
254 VResolution(me; R3d : Real ) returns Real
255 ---Purpose : Returns the parametric V resolution corresponding
256 -- to the real space resolution <R3d>.
259 GetType(me) returns SurfaceType from GeomAbs
260 ---Purpose: Returns the type of the surface : Plane, Cylinder,
261 -- Cone, Sphere, Torus, BezierSurface,
262 -- BSplineSurface, SurfaceOfRevolution,
263 -- SurfaceOfExtrusion, OtherSurface
268 -- The following methods must be called when GetType returned
269 -- the corresponding type.
272 Plane(me) returns Pln from gp
273 raises NoSuchObject from Standard
276 Cylinder(me) returns Cylinder from gp
277 raises NoSuchObject from Standard
280 Cone(me) returns Cone from gp
281 raises NoSuchObject from Standard
284 Sphere(me) returns Sphere from gp
285 raises NoSuchObject from Standard
288 Torus(me) returns Torus from gp
289 raises NoSuchObject from Standard
292 UDegree(me) returns Integer
293 raises NoSuchObject from Standard
296 NbUPoles(me) returns Integer
297 raises NoSuchObject from Standard
300 VDegree(me) returns Integer
301 raises NoSuchObject from Standard
304 NbVPoles(me) returns Integer
305 raises NoSuchObject from Standard
308 NbUKnots(me) returns Integer
310 NoSuchObject from Standard
314 NbVKnots(me) returns Integer
316 NoSuchObject from Standard
320 IsURational(me) returns Boolean
322 NoSuchObject from Standard
325 IsVRational(me) returns Boolean
327 NoSuchObject from Standard
331 Bezier(me) returns BezierSurface from Geom
332 ---Purpose: This will NOT make a copy of the
333 -- Bezier Surface : If you want to modify
334 -- the Surface please make a copy yourself
335 -- Also it will NOT trim the surface to
338 NoSuchObject from Standard
341 BSpline(me) returns BSplineSurface from Geom
342 ---Purpose: This will NOT make a copy of the
343 -- BSpline Surface : If you want to modify
344 -- the Surface please make a copy yourself
345 -- Also it will NOT trim the surface to
348 NoSuchObject from Standard
351 AxeOfRevolution(me) returns Ax1 from gp
353 NoSuchObject from Standard -- only for SurfaceOfRevolution
356 Direction(me) returns Dir from gp
358 NoSuchObject from Standard -- only for SurfaceOfExtrusion
361 BasisCurve(me) returns HCurve from Adaptor3d
363 NoSuchObject from Standard -- only for SurfaceOfExtrusion
367 BasisSurface(me) returns HSurface from Adaptor3d
369 NoSuchObject from Standard -- only for Offset Surface
372 OffsetValue(me) returns Real from Standard
374 NoSuchObject from Standard -- only for Offset Surface
378 Span (me;Side :Integer; Ideb,Ifin:Integer;
379 OutIdeb,OutIfin:out Integer;
383 IfUVBound (me;U,V :Real;Ideb,Ifin,IVdeb,IVfin :out Integer;
384 USide,VSide: Integer)
385 returns Boolean from Standard
388 load (me : in out; S : Surface from Geom;
389 UFirst,ULast,VFirst,VLast : Real;
396 mySurface : Surface from Geom;
397 mySurfaceType : SurfaceType from GeomAbs;
398 myUFirst : Real from Standard;
399 myULast : Real from Standard;
400 myVFirst : Real from Standard;
401 myVLast : Real from Standard;
402 myTolU, myTolV : Real from Standard;