1 -- Created on: 1993-04-21
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.
23 class SurfaceOfRevolution from Adaptor3d inherits Surface from Adaptor3d
26 --- Purpose : This class defines a complete surface of revolution.
27 -- The surface is obtained by rotating a curve a complete revolution
28 -- about an axis. The curve and the axis must be in the same plane.
29 -- If the curve and the axis are not in the same plane it is always
30 -- possible to be in the previous case after a cylindrical projection
31 -- of the curve in a referenced plane.
32 -- For a complete surface of revolution the parametric range is
34 -- The parametric range for V is defined with the revolved curve.
35 -- The origin of the U parametrization is given by the position
36 -- of the revolved curve (reference). The direction of the revolution
37 -- axis defines the positive sense of rotation (trigonometric sense)
38 -- corresponding to the increasing of the parametric value U.
39 -- The derivatives are always defined for the u direction.
40 -- For the v direction the definition of the derivatives depends on
41 -- the degree of continuity of the referenced curve.
46 Array1OfReal from TColStd,
48 SurfaceType from GeomAbs,
59 BezierSurface from Geom,
60 BSplineSurface from Geom,
61 HSurface from Adaptor3d,
66 OutOfRange from Standard,
67 NoSuchObject from Standard,
68 DomainError from Standard
72 -- Methods specific of SurfaceOfRevolution.
75 Create returns SurfaceOfRevolution from Adaptor3d;
78 Create(C : HCurve from Adaptor3d) returns SurfaceOfRevolution from Adaptor3d;
79 ---Purpose: The Curve is loaded.
81 Create(C : HCurve from Adaptor3d; V : Ax1 from gp)
82 returns SurfaceOfRevolution from Adaptor3d;
83 ---Purpose: The Curve and the Direction are loaded.
86 Load( me : in out ; C : HCurve from Adaptor3d)
87 ---Purpose: Changes the Curve
90 Load( me : in out ; V : Ax1 from gp)
91 ---Purpose: Changes the Direction
95 AxeOfRevolution( me) returns Ax1 from gp
100 -- Implementation of Surface from Adaptor3d methods.
104 -- Global methods - Apply to the whole surface.
107 FirstUParameter(me) returns Real
110 LastUParameter(me) returns Real
113 FirstVParameter(me) returns Real
116 LastVParameter(me) returns Real
119 UContinuity(me) returns Shape from GeomAbs
122 VContinuity(me) returns Shape from GeomAbs
123 ---Purpose: Return CN.
126 NbUIntervals(me; S : Shape from GeomAbs) returns Integer
127 ---Purpose: Returns the number of U intervals for continuity
128 -- <S>. May be one if UContinuity(me) >= <S>
131 NbVIntervals(me; S : Shape from GeomAbs) returns Integer
132 ---Purpose: Returns the number of V intervals for continuity
133 -- <S>. May be one if VContinuity(me) >= <S>
136 UIntervals(me; T : in out Array1OfReal from TColStd;
137 S : Shape from GeomAbs )
138 ---Purpose: Returns the intervals with the requested continuity
139 -- in the U direction.
141 OutOfRange from Standard -- if the Length of the array does
142 -- have enought slots to accomodate
144 is redefined static ;
146 VIntervals(me; T : in out Array1OfReal from TColStd;
147 S : Shape from GeomAbs )
148 ---Purpose: Returns the intervals with the requested continuity
149 -- in the V direction.
151 OutOfRange from Standard -- if the Length of the array does
152 -- have enought slots to accomodate
154 is redefined static ;
156 UTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d
157 ---Purpose: Returns a surface trimmed in the U direction
158 -- equivalent of <me> between
159 -- parameters <First> and <Last>. <Tol> is used to
160 -- test for 3d points confusion.
162 OutOfRange from Standard
163 ---Purpose: If <First> >= <Last>
164 is redefined static ;
166 VTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d
167 ---Purpose: Returns a surface trimmed in the V direction between
168 -- parameters <First> and <Last>. <Tol> is used to
169 -- test for 3d points confusion.
171 OutOfRange from Standard
172 ---Purpose: If <First> >= <Last>
173 is redefined static ;
175 IsUClosed(me) returns Boolean
178 IsVClosed(me) returns Boolean
181 IsUPeriodic(me) returns Boolean
184 UPeriod(me) returns Real
186 DomainError from Standard -- if the curve is not periodic
189 IsVPeriodic(me) returns Boolean
192 VPeriod(me) returns Real
194 DomainError from Standard -- if the curve is not periodic
197 Value (me; U, V : Real) returns Pnt from gp
198 --- Purpose : Computes the point of parameters U,V on the surface.
201 D0 (me; U, V : Real; P : out Pnt from gp)
202 --- Purpose : Computes the point of parameters U,V on the surface.
205 D1 (me; U, V : Real; P : out Pnt from gp; D1U, D1V : out Vec from gp)
206 --- Purpose : Computes the point and the first derivatives on
208 raises DomainError from Standard
209 --- Purpose : Raised if the continuity of the current
210 -- intervals is not C1.
215 D1U, D1V, D2U, D2V, D2UV : out Vec from gp)
216 --- Purpose : Computes the point, the first and second
217 -- derivatives on the surface.
218 raises DomainError from Standard
219 --- Purpose : Raised if the continuity of the current
220 -- intervals is not C2.
225 D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV : out Vec from gp)
226 --- Purpose : Computes the point, the first, second and third
227 -- derivatives on the surface.
228 raises DomainError from Standard
229 --- Purpose : Raised if the continuity of the current
230 -- intervals is not C3.
233 DN (me; U, V : Real; Nu, Nv : Integer) returns Vec from gp
234 --- Purpose : Computes the derivative of order Nu
235 -- in the direction U and Nv in the direction V
236 -- at the point P(U, V).
237 raises DomainError from Standard,
238 --- Purpose : Raised if the current U interval is not not CNu
239 -- and the current V interval is not CNv.
240 OutOfRange from Standard
241 --- Purpose : Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
244 UResolution(me; R3d : Real ) returns Real
245 ---Purpose : Returns the parametric U resolution corresponding
246 -- to the real space resolution <R3d>.
249 VResolution(me; R3d : Real ) returns Real
250 ---Purpose : Returns the parametric V resolution corresponding
251 -- to the real space resolution <R3d>.
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
262 -- The following methods must be called when GetType returned
263 -- the corresponding type.
266 Plane(me) returns Pln from gp
267 raises NoSuchObject from Standard
270 Cylinder(me) returns Cylinder from gp
271 raises NoSuchObject from Standard
274 Cone(me) returns Cone from gp
275 raises NoSuchObject from Standard
276 ---Purpose : Apex of the Cone = Cone.Position().Location()
277 -- ==> ReferenceRadius = 0.
280 Sphere(me) returns Sphere from gp
281 raises NoSuchObject from Standard
284 Torus(me) returns Torus from gp
285 raises NoSuchObject from Standard
289 UDegree(me) returns Integer
290 raises NoSuchObject from Standard
293 NbUPoles(me) returns Integer
294 raises NoSuchObject from Standard
297 VDegree(me) returns Integer
298 raises NoSuchObject from Standard
301 NbVPoles(me) returns Integer
302 raises NoSuchObject from Standard
305 NbUKnots(me) returns Integer
307 NoSuchObject from Standard
311 NbVKnots(me) returns Integer
313 NoSuchObject from Standard
317 IsURational(me) returns Boolean
319 NoSuchObject from Standard
322 IsVRational(me) returns Boolean
324 NoSuchObject from Standard
328 Bezier(me) returns BezierSurface from Geom
330 NoSuchObject from Standard
333 BSpline(me) returns BSplineSurface from Geom
335 NoSuchObject from Standard
338 Axis(me) returns Ax3 from gp
340 NoSuchObject from Standard -- only for SurfaceOfRevolution
343 Direction(me) returns Dir from gp
345 NoSuchObject from Standard -- only for SurfaceOfExtrusion
348 BasisCurve(me) returns HCurve from Adaptor3d
350 NoSuchObject from Standard
351 -- Only for SurfaceOfExtrusion and SurfaceOfRevolution
355 myBasisCurve : HCurve from Adaptor3d;
356 myAxis : Ax1 from gp;
357 myHaveAxis : Boolean from Standard;
358 myAxeRev : Ax3 from gp;
361 end SurfaceOfRevolution;