Commit | Line | Data |
---|---|---|
b311480e | 1 | // Created on: 1993-07-23 |
2 | // Created by: Remi LEQUETTE | |
3 | // Copyright (c) 1993-1999 Matra Datavision | |
973c2be1 | 4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e | 5 | // |
973c2be1 | 6 | // This file is part of Open CASCADE Technology software library. |
b311480e | 7 | // |
d5f74e42 | 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 | |
973c2be1 | 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. | |
b311480e | 13 | // |
973c2be1 | 14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. | |
7fd59977 | 16 | |
17 | #include <BRepBuilderAPI_MakeFace.ixx> | |
18 | ||
19 | ||
20 | //======================================================================= | |
21 | //function : BRepBuilderAPI_MakeFace | |
22 | //purpose : | |
23 | //======================================================================= | |
24 | ||
25 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace() | |
26 | { | |
27 | } | |
28 | ||
29 | ||
30 | //======================================================================= | |
31 | //function : BRepBuilderAPI_MakeFace | |
32 | //purpose : | |
33 | //======================================================================= | |
34 | ||
35 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const TopoDS_Face& F) | |
36 | : myMakeFace(F) | |
37 | { | |
38 | if ( myMakeFace.IsDone()) { | |
39 | Done(); | |
40 | myShape = myMakeFace.Shape(); | |
41 | } | |
42 | } | |
43 | ||
44 | ||
45 | //======================================================================= | |
46 | //function : BRepBuilderAPI_MakeFace | |
47 | //purpose : | |
48 | //======================================================================= | |
49 | ||
50 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Pln& P) | |
51 | : myMakeFace(P) | |
52 | { | |
53 | if ( myMakeFace.IsDone()) { | |
54 | Done(); | |
55 | myShape = myMakeFace.Shape(); | |
56 | } | |
57 | } | |
58 | ||
59 | ||
60 | //======================================================================= | |
61 | //function : BRepBuilderAPI_MakeFace | |
62 | //purpose : | |
63 | //======================================================================= | |
64 | ||
65 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Cylinder& C) | |
66 | : myMakeFace(C) | |
67 | { | |
68 | if ( myMakeFace.IsDone()) { | |
69 | Done(); | |
70 | myShape = myMakeFace.Shape(); | |
71 | } | |
72 | } | |
73 | ||
74 | ||
75 | //======================================================================= | |
76 | //function : BRepBuilderAPI_MakeFace | |
77 | //purpose : | |
78 | //======================================================================= | |
79 | ||
80 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Cone& C) | |
81 | : myMakeFace(C) | |
82 | { | |
83 | if ( myMakeFace.IsDone()) { | |
84 | Done(); | |
85 | myShape = myMakeFace.Shape(); | |
86 | } | |
87 | } | |
88 | ||
89 | ||
90 | //======================================================================= | |
91 | //function : BRepBuilderAPI_MakeFace | |
92 | //purpose : | |
93 | //======================================================================= | |
94 | ||
95 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Sphere& S) | |
96 | : myMakeFace(S) | |
97 | { | |
98 | if ( myMakeFace.IsDone()) { | |
99 | Done(); | |
100 | myShape = myMakeFace.Shape(); | |
101 | } | |
102 | } | |
103 | ||
104 | ||
105 | //======================================================================= | |
106 | //function : BRepBuilderAPI_MakeFace | |
107 | //purpose : | |
108 | //======================================================================= | |
109 | ||
110 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Torus& T) | |
111 | : myMakeFace(T) | |
112 | { | |
113 | if ( myMakeFace.IsDone()) { | |
114 | Done(); | |
115 | myShape = myMakeFace.Shape(); | |
116 | } | |
117 | } | |
118 | ||
119 | ||
120 | //======================================================================= | |
121 | //function : BRepBuilderAPI_MakeFace | |
122 | //purpose : | |
123 | //======================================================================= | |
124 | ||
1c72dff6 S |
125 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const Handle(Geom_Surface)& S, |
126 | const Standard_Real TolDegen) | |
127 | : myMakeFace(S, TolDegen) | |
7fd59977 | 128 | { |
129 | if ( myMakeFace.IsDone()) { | |
130 | Done(); | |
131 | myShape = myMakeFace.Shape(); | |
132 | } | |
133 | } | |
134 | ||
135 | ||
136 | //======================================================================= | |
137 | //function : BRepBuilderAPI_MakeFace | |
138 | //purpose : | |
139 | //======================================================================= | |
140 | ||
141 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Pln& P, | |
142 | const Standard_Real UMin, | |
143 | const Standard_Real UMax, | |
144 | const Standard_Real VMin, | |
145 | const Standard_Real VMax) | |
146 | : myMakeFace(P,UMin,UMax,VMin,VMax) | |
147 | { | |
148 | if ( myMakeFace.IsDone()) { | |
149 | Done(); | |
150 | myShape = myMakeFace.Shape(); | |
151 | } | |
152 | } | |
153 | ||
154 | ||
155 | //======================================================================= | |
156 | //function : BRepBuilderAPI_MakeFace | |
157 | //purpose : | |
158 | //======================================================================= | |
159 | ||
160 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Cylinder& C, | |
161 | const Standard_Real UMin, | |
162 | const Standard_Real UMax, | |
163 | const Standard_Real VMin, | |
164 | const Standard_Real VMax) | |
165 | : myMakeFace(C,UMin,UMax,VMin,VMax) | |
166 | { | |
167 | if ( myMakeFace.IsDone()) { | |
168 | Done(); | |
169 | myShape = myMakeFace.Shape(); | |
170 | } | |
171 | } | |
172 | ||
173 | ||
174 | //======================================================================= | |
175 | //function : BRepBuilderAPI_MakeFace | |
176 | //purpose : | |
177 | //======================================================================= | |
178 | ||
179 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Cone& C, | |
180 | const Standard_Real UMin, | |
181 | const Standard_Real UMax, | |
182 | const Standard_Real VMin, | |
183 | const Standard_Real VMax) | |
184 | : myMakeFace(C,UMin,UMax,VMin,VMax) | |
185 | { | |
186 | if ( myMakeFace.IsDone()) { | |
187 | Done(); | |
188 | myShape = myMakeFace.Shape(); | |
189 | } | |
190 | } | |
191 | ||
192 | ||
193 | //======================================================================= | |
194 | //function : BRepBuilderAPI_MakeFace | |
195 | //purpose : | |
196 | //======================================================================= | |
197 | ||
198 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Sphere& S, | |
199 | const Standard_Real UMin, | |
200 | const Standard_Real UMax, | |
201 | const Standard_Real VMin, | |
202 | const Standard_Real VMax) | |
203 | : myMakeFace(S,UMin,UMax,VMin,VMax) | |
204 | { | |
205 | if ( myMakeFace.IsDone()) { | |
206 | Done(); | |
207 | myShape = myMakeFace.Shape(); | |
208 | } | |
209 | } | |
210 | ||
211 | ||
212 | //======================================================================= | |
213 | //function : BRepBuilderAPI_MakeFace | |
214 | //purpose : | |
215 | //======================================================================= | |
216 | ||
217 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Torus& T, | |
218 | const Standard_Real UMin, | |
219 | const Standard_Real UMax, | |
220 | const Standard_Real VMin, | |
221 | const Standard_Real VMax) | |
222 | : myMakeFace(T,UMin,UMax,VMin,VMax) | |
223 | { | |
224 | if ( myMakeFace.IsDone()) { | |
225 | Done(); | |
226 | myShape = myMakeFace.Shape(); | |
227 | } | |
228 | } | |
229 | ||
230 | ||
231 | //======================================================================= | |
232 | //function : BRepBuilderAPI_MakeFace | |
233 | //purpose : | |
234 | //======================================================================= | |
235 | ||
1c72dff6 S |
236 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace (const Handle(Geom_Surface)& S, |
237 | const Standard_Real UMin, | |
238 | const Standard_Real UMax, | |
239 | const Standard_Real VMin, | |
240 | const Standard_Real VMax, | |
241 | const Standard_Real TolDegen) | |
242 | : myMakeFace (S, UMin, UMax, VMin, VMax, TolDegen) | |
7fd59977 | 243 | { |
244 | if ( myMakeFace.IsDone()) { | |
245 | Done(); | |
246 | myShape = myMakeFace.Shape(); | |
247 | } | |
248 | } | |
249 | ||
250 | ||
251 | //======================================================================= | |
252 | //function : BRepBuilderAPI_MakeFace | |
253 | //purpose : | |
254 | //======================================================================= | |
255 | ||
256 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const TopoDS_Wire& W, | |
257 | const Standard_Boolean OnlyPlane) | |
258 | : myMakeFace(W,OnlyPlane) | |
259 | { | |
260 | if ( myMakeFace.IsDone()) { | |
261 | Done(); | |
262 | myShape = myMakeFace.Shape(); | |
263 | } | |
264 | } | |
265 | ||
266 | ||
267 | //======================================================================= | |
268 | //function : BRepBuilderAPI_MakeFace | |
269 | //purpose : | |
270 | //======================================================================= | |
271 | ||
272 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Pln& P, | |
273 | const TopoDS_Wire& W, | |
274 | const Standard_Boolean Inside) | |
275 | : myMakeFace(P,W,Inside) | |
276 | { | |
277 | if ( myMakeFace.IsDone()) { | |
278 | Done(); | |
279 | myShape = myMakeFace.Shape(); | |
280 | } | |
281 | } | |
282 | ||
283 | ||
284 | //======================================================================= | |
285 | //function : BRepBuilderAPI_MakeFace | |
286 | //purpose : | |
287 | //======================================================================= | |
288 | ||
289 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Cylinder& C, | |
290 | const TopoDS_Wire& W, | |
291 | const Standard_Boolean Inside) | |
292 | : myMakeFace(C,W,Inside) | |
293 | { | |
294 | if ( myMakeFace.IsDone()) { | |
295 | Done(); | |
296 | myShape = myMakeFace.Shape(); | |
297 | } | |
298 | } | |
299 | ||
300 | ||
301 | //======================================================================= | |
302 | //function : BRepBuilderAPI_MakeFace | |
303 | //purpose : | |
304 | //======================================================================= | |
305 | ||
306 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Cone& C, | |
307 | const TopoDS_Wire& W, | |
308 | const Standard_Boolean Inside) | |
309 | : myMakeFace(C,W,Inside) | |
310 | { | |
311 | if ( myMakeFace.IsDone()) { | |
312 | Done(); | |
313 | myShape = myMakeFace.Shape(); | |
314 | } | |
315 | } | |
316 | ||
317 | ||
318 | //======================================================================= | |
319 | //function : BRepBuilderAPI_MakeFace | |
320 | //purpose : | |
321 | //======================================================================= | |
322 | ||
323 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Sphere& S, | |
324 | const TopoDS_Wire& W, | |
325 | const Standard_Boolean Inside) | |
326 | : myMakeFace(S,W,Inside) | |
327 | { | |
328 | if ( myMakeFace.IsDone()) { | |
329 | Done(); | |
330 | myShape = myMakeFace.Shape(); | |
331 | } | |
332 | } | |
333 | ||
334 | ||
335 | //======================================================================= | |
336 | //function : BRepBuilderAPI_MakeFace | |
337 | //purpose : | |
338 | //======================================================================= | |
339 | ||
340 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const gp_Torus& T, | |
341 | const TopoDS_Wire& W, | |
342 | const Standard_Boolean Inside) | |
343 | : myMakeFace(T,W,Inside) | |
344 | { | |
345 | if ( myMakeFace.IsDone()) { | |
346 | Done(); | |
347 | myShape = myMakeFace.Shape(); | |
348 | } | |
349 | } | |
350 | ||
351 | ||
352 | //======================================================================= | |
353 | //function : BRepBuilderAPI_MakeFace | |
354 | //purpose : | |
355 | //======================================================================= | |
356 | ||
357 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const Handle(Geom_Surface)& S, | |
358 | const TopoDS_Wire& W, | |
359 | const Standard_Boolean Inside) | |
360 | : myMakeFace(S,W,Inside) | |
361 | { | |
362 | if ( myMakeFace.IsDone()) { | |
363 | Done(); | |
364 | myShape = myMakeFace.Shape(); | |
365 | } | |
366 | } | |
367 | ||
368 | ||
369 | //======================================================================= | |
370 | //function : BRepBuilderAPI_MakeFace | |
371 | //purpose : | |
372 | //======================================================================= | |
373 | ||
374 | BRepBuilderAPI_MakeFace::BRepBuilderAPI_MakeFace(const TopoDS_Face& F, | |
375 | const TopoDS_Wire& W) | |
376 | : myMakeFace(F,W) | |
377 | { | |
378 | if ( myMakeFace.IsDone()) { | |
379 | Done(); | |
380 | myShape = myMakeFace.Shape(); | |
381 | } | |
382 | } | |
383 | ||
384 | //======================================================================= | |
385 | //function : Init | |
386 | //purpose : | |
387 | //======================================================================= | |
388 | ||
389 | void BRepBuilderAPI_MakeFace::Init(const TopoDS_Face& F) | |
390 | { | |
391 | myMakeFace.Init(F); | |
392 | if ( myMakeFace.IsDone()) { | |
393 | Done(); | |
394 | myShape = myMakeFace.Shape(); | |
395 | } | |
396 | } | |
397 | ||
398 | //======================================================================= | |
399 | //function : Init | |
400 | //purpose : | |
401 | //======================================================================= | |
402 | ||
403 | void BRepBuilderAPI_MakeFace::Init(const Handle(Geom_Surface)& S, | |
1c72dff6 S |
404 | const Standard_Boolean Bound, |
405 | const Standard_Real TolDegen) | |
7fd59977 | 406 | { |
1c72dff6 | 407 | myMakeFace.Init(S, Bound, TolDegen); |
7fd59977 | 408 | if ( myMakeFace.IsDone()) { |
409 | Done(); | |
410 | myShape = myMakeFace.Shape(); | |
411 | } | |
412 | } | |
413 | ||
414 | ||
415 | //======================================================================= | |
416 | //function : Init | |
417 | //purpose : | |
418 | //======================================================================= | |
419 | ||
1c72dff6 S |
420 | void BRepBuilderAPI_MakeFace::Init (const Handle(Geom_Surface)& SS, |
421 | const Standard_Real Um, | |
422 | const Standard_Real UM, | |
423 | const Standard_Real Vm, | |
424 | const Standard_Real VM, | |
425 | const Standard_Real TolDegen) | |
7fd59977 | 426 | { |
1c72dff6 | 427 | myMakeFace.Init (SS, Um, UM, Vm, VM, TolDegen); |
7fd59977 | 428 | if ( myMakeFace.IsDone()) { |
429 | Done(); | |
430 | myShape = myMakeFace.Shape(); | |
431 | } | |
432 | } | |
433 | ||
434 | ||
435 | //======================================================================= | |
436 | //function : Add | |
437 | //purpose : | |
438 | //======================================================================= | |
439 | ||
440 | void BRepBuilderAPI_MakeFace::Add(const TopoDS_Wire& W) | |
441 | { | |
442 | myMakeFace.Add(W); | |
443 | if ( myMakeFace.IsDone()) { | |
444 | Done(); | |
445 | myShape = myMakeFace.Shape(); | |
446 | } | |
447 | } | |
448 | ||
449 | ||
450 | //======================================================================= | |
451 | //function : Face | |
452 | //purpose : | |
453 | //======================================================================= | |
454 | ||
455 | const TopoDS_Face& BRepBuilderAPI_MakeFace::Face()const | |
456 | { | |
457 | return myMakeFace.Face(); | |
458 | } | |
459 | ||
460 | ||
461 | ||
462 | //======================================================================= | |
463 | //function : operator | |
464 | //purpose : | |
465 | //======================================================================= | |
466 | ||
467 | BRepBuilderAPI_MakeFace::operator TopoDS_Face() const | |
468 | { | |
469 | return Face(); | |
470 | } | |
471 | ||
472 | //======================================================================= | |
473 | //function : IsDone | |
474 | //purpose : | |
475 | //======================================================================= | |
476 | ||
477 | Standard_Boolean BRepBuilderAPI_MakeFace::IsDone() const | |
478 | { | |
479 | return myMakeFace.IsDone(); | |
480 | } | |
481 | ||
482 | ||
483 | //======================================================================= | |
484 | //function : Error | |
485 | //purpose : | |
486 | //======================================================================= | |
487 | ||
488 | BRepBuilderAPI_FaceError BRepBuilderAPI_MakeFace::Error() const | |
489 | { | |
490 | switch ( myMakeFace.Error()) { | |
491 | ||
492 | case BRepLib_FaceDone: | |
493 | return BRepBuilderAPI_FaceDone; | |
494 | ||
495 | case BRepLib_NoFace: | |
496 | return BRepBuilderAPI_NoFace; | |
497 | ||
498 | case BRepLib_NotPlanar: | |
499 | return BRepBuilderAPI_NotPlanar; | |
500 | ||
501 | case BRepLib_CurveProjectionFailed: | |
502 | return BRepBuilderAPI_CurveProjectionFailed; | |
503 | ||
504 | case BRepLib_ParametersOutOfRange: | |
505 | return BRepBuilderAPI_ParametersOutOfRange; | |
506 | ||
507 | } | |
508 | ||
509 | // Portage WNT | |
510 | return BRepBuilderAPI_FaceDone; | |
511 | } |