1 -- File: GeomAdaptor_Surface.cdl
2 -- Created: Fri May 14 15:08:27 1993
3 -- Author: Bruno DUMORTIER
4 ---Copyright: Matra Datavision 1993
6 class Surface from GeomAdaptor inherits Surface from Adaptor3d
8 ---Purpose: An interface between the services provided by any
9 -- surface from the package Geom and those required
10 -- of the surface by algorithms which use it.
22 Array1OfReal from TColStd,
24 BezierSurface from Geom,
25 BSplineSurface from Geom,
26 SurfaceType from GeomAbs,
28 Curve from GeomAdaptor,
29 HCurve from Adaptor3d,
30 HSurface from Adaptor3d
33 NoSuchObject from Standard,
34 OutOfRange from Standard,
35 ConstructionError from Standard,
36 DomainError from Standard
40 Create returns Surface from GeomAdaptor;
43 Create( S : Surface from Geom) returns Surface from GeomAdaptor;
46 Create( S : Surface from Geom; UFirst,ULast,VFirst,VLast : Real;
49 returns Surface from GeomAdaptor
50 raises ConstructionError from Standard;
51 ---Purpose: ConstructionError is raised if UFirst>ULast or VFirst>VLast
54 Load(me : in out; S : Surface from Geom);
57 Load(me : in out; S : Surface from Geom;
58 UFirst,ULast,VFirst,VLast : Real;
61 raises ConstructionError from Standard;
63 ---Purpose: ConstructionError is raised if UFirst>ULast or VFirst>VLast
65 Surface(me) returns Surface from Geom
72 -- Global methods - Apply to the whole surface.
75 FirstUParameter(me) returns Real
79 LastUParameter(me) returns Real
83 FirstVParameter(me) returns Real
87 LastVParameter(me) returns Real
91 UContinuity(me) returns Shape from GeomAbs
94 VContinuity(me) returns Shape from GeomAbs
97 NbUIntervals(me; S : Shape from GeomAbs) returns Integer
98 ---Purpose: Returns the number of U intervals for continuity
99 -- <S>. May be one if UContinuity(me) >= <S>
102 NbVIntervals(me; S : Shape from GeomAbs) returns Integer
103 ---Purpose: Returns the number of V intervals for continuity
104 -- <S>. May be one if VContinuity(me) >= <S>
107 UIntervals(me; T : in out Array1OfReal from TColStd;
108 S : Shape from GeomAbs )
109 ---Purpose: Returns the intervals with the requested continuity
110 -- in the U direction.
112 OutOfRange from Standard -- if the Length of the array does
113 -- have enought slots to accomodate
117 VIntervals(me; T : in out Array1OfReal from TColStd;
118 S : Shape from GeomAbs )
119 ---Purpose: Returns the intervals with the requested continuity
120 -- in the V direction.
122 OutOfRange from Standard -- if the Length of the array does
123 -- have enought slots to accomodate
127 UTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d
128 ---Purpose: Returns a surface trimmed in the U direction
129 -- equivalent of <me> between
130 -- parameters <First> and <Last>. <Tol> is used to
131 -- test for 3d points confusion.
133 OutOfRange from Standard
134 ---Purpose: If <First> >= <Last>
135 is redefined static ;
137 VTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d
138 ---Purpose: Returns a surface trimmed in the V direction between
139 -- parameters <First> and <Last>. <Tol> is used to
140 -- test for 3d points confusion.
142 OutOfRange from Standard
143 ---Purpose: If <First> >= <Last>
144 is redefined static ;
146 IsUClosed(me) returns Boolean
149 IsVClosed(me) returns Boolean
152 IsUPeriodic(me) returns Boolean
155 UPeriod(me) returns Real
157 DomainError from Standard -- if the curve is not periodic
160 IsVPeriodic(me) returns Boolean
163 VPeriod(me) returns Real
165 DomainError from Standard -- if the curve is not periodic
168 Value (me; U, V : Real) returns Pnt from gp
169 --- Purpose : Computes the point of parameters U,V on the surface.
174 --- Purpose : Computes the point of parameters U,V on the surface.
179 D1U, D1V : out Vec from gp)
180 --- Purpose : Computes the point and the first derivatives on
183 -- Warning : On the specific case of BSplineSurface:
184 -- if the surface is cut in interval of continuity at least C1,
185 -- the derivatives are computed on the current interval.
186 -- else the derivatives are computed on the basis surface.
191 D1U, D1V : out Vec from gp;
192 D2U, D2V : out Vec from gp;
193 D2UV : out Vec from gp)
194 --- Purpose : Computes the point, the first and second
195 -- derivatives on the surface.
197 -- Warning : On the specific case of BSplineSurface:
198 -- if the surface is cut in interval of continuity at least C2,
199 -- the derivatives are computed on the current interval.
200 -- else the derivatives are computed on the basis surface.
205 D1U, D1V : out Vec from gp;
206 D2U, D2V : out Vec from gp;
207 D2UV : out Vec from gp;
208 D3U, D3V : out Vec from gp;
209 D3UUV, D3UVV : out Vec from gp)
210 --- Purpose : Computes the point, the first, second and third
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 C3,
215 -- the derivatives are computed on the current interval.
216 -- else the derivatives are computed on the basis surface.
219 DN (me; U, V : Real; Nu, Nv : Integer)
221 --- Purpose : Computes the derivative of order Nu in the
222 -- direction U and Nv in the direction V at the point P(U, V).
224 -- Warning : On the specific case of BSplineSurface:
225 -- if the surface is cut in interval of continuity CN,
226 -- the derivatives are computed on the current interval.
227 -- else the derivatives are computed on the basis surface.
229 OutOfRange from Standard
230 --- Purpose : Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
233 UResolution(me; R3d : Real ) returns Real
234 ---Purpose : Returns the parametric U resolution corresponding
235 -- to the real space resolution <R3d>.
238 VResolution(me; R3d : Real ) returns Real
239 ---Purpose : Returns the parametric V resolution corresponding
240 -- to the real space resolution <R3d>.
243 GetType(me) returns SurfaceType from GeomAbs
244 ---Purpose: Returns the type of the surface : Plane, Cylinder,
245 -- Cone, Sphere, Torus, BezierSurface,
246 -- BSplineSurface, SurfaceOfRevolution,
247 -- SurfaceOfExtrusion, OtherSurface
252 -- The following methods must be called when GetType returned
253 -- the corresponding type.
256 Plane(me) returns Pln from gp
257 raises NoSuchObject from Standard
260 Cylinder(me) returns Cylinder from gp
261 raises NoSuchObject from Standard
264 Cone(me) returns Cone from gp
265 raises NoSuchObject from Standard
268 Sphere(me) returns Sphere from gp
269 raises NoSuchObject from Standard
272 Torus(me) returns Torus from gp
273 raises NoSuchObject from Standard
276 UDegree(me) returns Integer
277 raises NoSuchObject from Standard
280 NbUPoles(me) returns Integer
281 raises NoSuchObject from Standard
284 VDegree(me) returns Integer
285 raises NoSuchObject from Standard
288 NbVPoles(me) returns Integer
289 raises NoSuchObject from Standard
292 NbUKnots(me) returns Integer
294 NoSuchObject from Standard
298 NbVKnots(me) returns Integer
300 NoSuchObject from Standard
304 IsURational(me) returns Boolean
306 NoSuchObject from Standard
309 IsVRational(me) returns Boolean
311 NoSuchObject from Standard
315 Bezier(me) returns BezierSurface from Geom
316 ---Purpose: This will NOT make a copy of the
317 -- Bezier Surface : If you want to modify
318 -- the Surface please make a copy yourself
319 -- Also it will NOT trim the surface to
322 NoSuchObject from Standard
325 BSpline(me) returns BSplineSurface from Geom
326 ---Purpose: This will NOT make a copy of the
327 -- BSpline Surface : If you want to modify
328 -- the Surface please make a copy yourself
329 -- Also it will NOT trim the surface to
332 NoSuchObject from Standard
335 AxeOfRevolution(me) returns Ax1 from gp
337 NoSuchObject from Standard -- only for SurfaceOfRevolution
340 Direction(me) returns Dir from gp
342 NoSuchObject from Standard -- only for SurfaceOfExtrusion
345 BasisCurve(me) returns HCurve from Adaptor3d
347 NoSuchObject from Standard -- only for SurfaceOfExtrusion
351 BasisSurface(me) returns HSurface from Adaptor3d
353 NoSuchObject from Standard -- only for Offset Surface
356 OffsetValue(me) returns Real from Standard
358 NoSuchObject from Standard -- only for Offset Surface
362 Span (me;Side :Integer; Ideb,Ifin:Integer;
363 OutIdeb,OutIfin:out Integer;
367 IfUVBound (me;U,V :Real;Ideb,Ifin,IVdeb,IVfin :out Integer;
368 USide,VSide: Integer)
369 returns Boolean from Standard
372 load (me : in out; S : Surface from Geom;
373 UFirst,ULast,VFirst,VLast : Real;
380 mySurface : Surface from Geom;
381 mySurfaceType : SurfaceType from GeomAbs;
382 myUFirst : Real from Standard;
383 myULast : Real from Standard;
384 myVFirst : Real from Standard;
385 myVLast : Real from Standard;
386 myTolU, myTolV : Real from Standard;