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