b311480e |
1 | -- Created on: 1993-03-31 |
2 | -- Created by: Bruno DUMORTIER |
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 | deferred class Surface from Adaptor3d |
25 | |
26 | ---Purpose: Root class for surfaces on which geometric algorithms work. |
27 | -- An adapted surface is an interface between the |
28 | -- services provided by a surface and those required of |
29 | -- the surface by algorithms which use it. |
30 | -- A derived concrete class is provided: |
31 | -- GeomAdaptor_Surface for a surface from the Geom package. |
32 | -- The Surface class describes the standard behaviour |
33 | -- of a surface for generic algorithms. |
34 | -- |
35 | -- The Surface can be decomposed in intervals of any |
36 | -- continuity in U and V using the method |
37 | -- NbIntervals. A current interval can be set. Most |
38 | -- of the methods apply to the current interval. |
39 | -- Warning: All the methods are virtual and implemented with a |
40 | -- raise to allow to redefined only the methods realy |
41 | -- used. |
42 | uses |
43 | Array1OfReal from TColStd, |
44 | Shape from GeomAbs, |
45 | SurfaceType from GeomAbs, |
46 | Vec from gp, |
47 | Dir from gp, |
48 | Pnt from gp, |
49 | Pln from gp, |
50 | Cone from gp, |
51 | Cylinder from gp, |
52 | Sphere from gp, |
53 | Torus from gp, |
54 | Ax1 from gp, |
55 | BezierSurface from Geom, |
56 | BSplineSurface from Geom, |
57 | HSurface from Adaptor3d, |
58 | HCurve from Adaptor3d |
59 | |
60 | raises |
61 | |
62 | OutOfRange from Standard, |
63 | NoSuchObject from Standard, |
64 | DomainError from Standard |
65 | |
66 | is |
67 | |
68 | -- |
69 | -- Global methods - Apply to the whole surface. |
70 | -- |
71 | |
72 | Delete(me:out) is virtual; |
73 | ---C++: alias "Standard_EXPORT virtual ~Adaptor3d_Surface(){Delete();}" |
74 | |
75 | FirstUParameter(me) returns Real |
76 | is virtual; |
77 | |
78 | LastUParameter(me) returns Real |
79 | is virtual; |
80 | |
81 | FirstVParameter(me) returns Real |
82 | is virtual; |
83 | |
84 | LastVParameter(me) returns Real |
85 | is virtual; |
86 | |
87 | UContinuity(me) returns Shape from GeomAbs |
88 | is virtual; |
89 | |
90 | VContinuity(me) returns Shape from GeomAbs |
91 | is virtual; |
92 | |
93 | NbUIntervals(me; S : Shape from GeomAbs) returns Integer |
94 | ---Purpose: Returns the number of U intervals for continuity |
95 | -- <S>. May be one if UContinuity(me) >= <S> |
96 | is virtual; |
97 | |
98 | NbVIntervals(me; S : Shape from GeomAbs) returns Integer |
99 | ---Purpose: Returns the number of V intervals for continuity |
100 | -- <S>. May be one if VContinuity(me) >= <S> |
101 | is virtual; |
102 | |
103 | UIntervals(me; T : in out Array1OfReal from TColStd; |
104 | S : Shape from GeomAbs ) |
105 | ---Purpose: Returns the intervals with the requested continuity |
106 | -- in the U direction. |
107 | raises |
108 | OutOfRange from Standard -- if the Length of the array does |
109 | -- have enought slots to accomodate |
110 | -- the result. |
111 | is virtual; |
112 | |
113 | VIntervals(me; T : in out Array1OfReal from TColStd; |
114 | S : Shape from GeomAbs ) |
115 | ---Purpose: Returns the intervals with the requested continuity |
116 | -- in the V direction. |
117 | raises |
118 | OutOfRange from Standard -- if the Length of the array does |
119 | -- have enought slots to accomodate |
120 | -- the result. |
121 | is virtual; |
122 | |
123 | UTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d |
124 | ---Purpose: Returns a surface trimmed in the U direction |
125 | -- equivalent of <me> between |
126 | -- parameters <First> and <Last>. <Tol> is used to |
127 | -- test for 3d points confusion. |
128 | raises |
129 | OutOfRange from Standard |
130 | ---Purpose: If <First> >= <Last> |
131 | is virtual ; |
132 | |
133 | VTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d |
134 | ---Purpose: Returns a surface trimmed in the V direction between |
135 | -- parameters <First> and <Last>. <Tol> is used to |
136 | -- test for 3d points confusion. |
137 | raises |
138 | OutOfRange from Standard |
139 | ---Purpose: If <First> >= <Last> |
140 | is virtual ; |
141 | |
142 | IsUClosed(me) returns Boolean |
143 | is virtual; |
144 | |
145 | IsVClosed(me) returns Boolean |
146 | is virtual; |
147 | |
148 | IsUPeriodic(me) returns Boolean |
149 | is virtual; |
150 | |
151 | UPeriod(me) returns Real |
152 | raises |
153 | DomainError from Standard -- if the curve is not periodic |
154 | is virtual; |
155 | |
156 | IsVPeriodic(me) returns Boolean |
157 | is virtual; |
158 | |
159 | VPeriod(me) returns Real |
160 | raises |
161 | DomainError from Standard -- if the curve is not periodic |
162 | is virtual; |
163 | |
164 | Value (me; U, V : Real) returns Pnt from gp |
165 | --- Purpose : Computes the point of parameters U,V on the surface. |
166 | is virtual; |
167 | |
168 | D0 (me; U, V : Real; P : out Pnt from gp) |
169 | --- Purpose : Computes the point of parameters U,V on the surface. |
170 | is virtual; |
171 | |
172 | D1 (me; U, V : Real; P : out Pnt from gp; D1U, D1V : out Vec from gp) |
173 | --- Purpose : Computes the point and the first derivatives on |
174 | -- the surface. |
175 | raises DomainError from Standard |
176 | --- Purpose : Raised if the continuity of the current |
177 | -- intervals is not C1. |
178 | is virtual; |
179 | |
180 | D2 (me; U, V : Real; P : out Pnt from gp; D1U, D1V, D2U, D2V, D2UV : out Vec from gp) |
181 | --- Purpose : Computes the point, the first and second |
182 | -- derivatives on the surface. |
183 | raises DomainError from Standard |
184 | --- Purpose : Raised if the continuity of the current |
185 | -- intervals is not C2. |
186 | is virtual; |
187 | |
188 | D3 (me; U, V : Real; P : out Pnt from gp; |
189 | D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV : out Vec from gp) |
190 | --- Purpose : Computes the point, the first, second and third |
191 | -- derivatives on the surface. |
192 | raises DomainError from Standard |
193 | --- Purpose : Raised if the continuity of the current |
194 | -- intervals is not C3. |
195 | is virtual; |
196 | |
197 | DN (me; U, V : Real; Nu, Nv : Integer) returns Vec from gp |
198 | --- Purpose : Computes the derivative of order Nu in the direction U and Nv |
199 | -- in the direction V at the point P(U, V). |
200 | raises DomainError from Standard, |
201 | --- Purpose : Raised if the current U interval is not not CNu |
202 | -- and the current V interval is not CNv. |
203 | OutOfRange from Standard |
204 | --- Purpose : Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0. |
205 | is virtual; |
206 | |
207 | UResolution(me; R3d : Real ) returns Real |
208 | ---Purpose : Returns the parametric U resolution corresponding |
209 | -- to the real space resolution <R3d>. |
210 | is virtual; |
211 | |
212 | VResolution(me; R3d : Real ) returns Real |
213 | ---Purpose : Returns the parametric V resolution corresponding |
214 | -- to the real space resolution <R3d>. |
215 | is virtual; |
216 | |
217 | GetType(me) returns SurfaceType from GeomAbs |
218 | ---Purpose: Returns the type of the surface : Plane, Cylinder, |
219 | -- Cone, Sphere, Torus, BezierSurface, |
220 | -- BSplineSurface, SurfaceOfRevolution, |
221 | -- SurfaceOfExtrusion, OtherSurface |
222 | is virtual; |
223 | |
224 | -- |
225 | -- The following methods must be called when GetType returned |
226 | -- the corresponding type. |
227 | -- |
228 | |
229 | Plane(me) returns Pln from gp |
230 | raises NoSuchObject from Standard |
231 | is virtual; |
232 | |
233 | Cylinder(me) returns Cylinder from gp |
234 | raises NoSuchObject from Standard |
235 | is virtual; |
236 | |
237 | Cone(me) returns Cone from gp |
238 | raises NoSuchObject from Standard |
239 | is virtual; |
240 | |
241 | Sphere(me) returns Sphere from gp |
242 | raises NoSuchObject from Standard |
243 | is virtual; |
244 | |
245 | Torus(me) returns Torus from gp |
246 | raises NoSuchObject from Standard |
247 | is virtual; |
248 | |
249 | |
250 | UDegree(me) returns Integer |
251 | raises NoSuchObject from Standard |
252 | is virtual; |
253 | |
254 | NbUPoles(me) returns Integer |
255 | raises NoSuchObject from Standard |
256 | is virtual; |
257 | |
258 | VDegree(me) returns Integer |
259 | raises NoSuchObject from Standard |
260 | is virtual; |
261 | |
262 | NbVPoles(me) returns Integer |
263 | raises NoSuchObject from Standard |
264 | is virtual; |
265 | |
266 | |
267 | NbUKnots(me) returns Integer |
268 | raises |
269 | NoSuchObject from Standard |
270 | is virtual; |
271 | |
272 | |
273 | NbVKnots(me) returns Integer |
274 | raises |
275 | NoSuchObject from Standard |
276 | is virtual; |
277 | |
278 | |
279 | IsURational(me) returns Boolean |
280 | raises |
281 | NoSuchObject from Standard |
282 | is virtual; |
283 | |
284 | IsVRational(me) returns Boolean |
285 | raises |
286 | NoSuchObject from Standard |
287 | is virtual; |
288 | |
289 | |
290 | |
291 | Bezier(me) returns BezierSurface from Geom |
292 | raises |
293 | NoSuchObject from Standard |
294 | is virtual; |
295 | |
296 | BSpline(me) returns BSplineSurface from Geom |
297 | raises |
298 | NoSuchObject from Standard |
299 | is virtual; |
300 | |
301 | AxeOfRevolution(me) returns Ax1 from gp |
302 | raises |
303 | NoSuchObject from Standard -- only for SurfaceOfRevolution |
304 | is virtual; |
305 | |
306 | Direction(me) returns Dir from gp |
307 | raises |
308 | NoSuchObject from Standard -- only for SurfaceOfExtrusion |
309 | is virtual; |
310 | |
311 | BasisCurve(me) returns HCurve from Adaptor3d |
312 | raises |
313 | NoSuchObject from Standard -- only for SurfaceOfExtrusion |
314 | is virtual; |
315 | |
316 | BasisSurface(me) returns HSurface from Adaptor3d |
317 | raises |
318 | NoSuchObject from Standard -- only for Offset Surface |
319 | is virtual; |
320 | |
321 | OffsetValue(me) returns Real from Standard |
322 | raises |
323 | NoSuchObject from Standard -- only for Offset Surface |
324 | is virtual; |
325 | |
326 | end Surface; |
327 | |
328 | |
329 | |
330 | |
331 | |
332 | |
333 | |
334 | |