Salome HOME
Fix compilation error (conflict of OK name between OCCT Plate_Plate.hxx and GEOM...
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IBooleanOperations.cxx
1 // Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #include <Standard_Stream.hxx>
24
25 #include <GEOMImpl_IBooleanOperations.hxx>
26
27 #include <GEOM_Function.hxx>
28 #include <GEOM_PythonDump.hxx>
29
30 #include <GEOMImpl_Types.hxx>
31
32 #include <GEOMImpl_BooleanDriver.hxx>
33 #include <GEOMImpl_IBoolean.hxx>
34
35 #include <GEOMImpl_PartitionDriver.hxx>
36 #include <GEOMImpl_IPartition.hxx>
37
38 #include <TDF_Tool.hxx>
39
40 #include "utilities.h"
41
42 #include <Standard_Failure.hxx>
43 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
44
45 //=============================================================================
46 /*!
47  *   constructor:
48  */
49 //=============================================================================
50 GEOMImpl_IBooleanOperations::GEOMImpl_IBooleanOperations (GEOM_Engine* theEngine)
51 : GEOM_IOperations(theEngine)
52 {
53   MESSAGE("GEOMImpl_IBooleanOperations::GEOMImpl_IBooleanOperations");
54 }
55
56 //=============================================================================
57 /*!
58  *  destructor
59  */
60 //=============================================================================
61 GEOMImpl_IBooleanOperations::~GEOMImpl_IBooleanOperations()
62 {
63   MESSAGE("GEOMImpl_IBooleanOperations::~GEOMImpl_IBooleanOperations");
64 }
65
66
67 //=============================================================================
68 /*!
69  *  MakeBoolean
70  */
71 //=============================================================================
72 Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeBoolean
73                                   (Handle(GEOM_Object)    theShape1,
74                                    Handle(GEOM_Object)    theShape2,
75                                    const Standard_Integer theOp,
76                                    const Standard_Boolean IsCheckSelfInte,
77                                    const Standard_Real    theFuzzyParam)
78 {
79   SetErrorCode(KO);
80
81   if (theShape1.IsNull() || theShape2.IsNull()) return NULL;
82
83   //Add a new Boolean object
84   Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN);
85
86   //Add a new Boolean function
87   Handle(GEOM_Function) aFunction;
88   if (theOp == 1) {
89     aFunction = aBool->AddFunction(GEOMImpl_BooleanDriver::GetID(), BOOLEAN_COMMON);
90   } else if (theOp == 2) {
91     aFunction = aBool->AddFunction(GEOMImpl_BooleanDriver::GetID(), BOOLEAN_CUT);
92   } else if (theOp == 3) {
93     aFunction = aBool->AddFunction(GEOMImpl_BooleanDriver::GetID(), BOOLEAN_FUSE);
94   } else if (theOp == 4) {
95     aFunction = aBool->AddFunction(GEOMImpl_BooleanDriver::GetID(), BOOLEAN_SECTION);
96   } else {
97   }
98   if (aFunction.IsNull()) return NULL;
99
100   //Check if the function is set correctly
101   if (aFunction->GetDriverGUID() != GEOMImpl_BooleanDriver::GetID()) return NULL;
102
103   GEOMImpl_IBoolean aCI (aFunction);
104
105   Handle(GEOM_Function) aRef1 = theShape1->GetLastFunction();
106   Handle(GEOM_Function) aRef2 = theShape2->GetLastFunction();
107
108   if (aRef1.IsNull() || aRef2.IsNull()) return NULL;
109
110   aCI.SetShape1(aRef1);
111   aCI.SetShape2(aRef2);
112   aCI.SetCheckSelfIntersection(IsCheckSelfInte);
113   aCI.SetFuzzyParameter(theFuzzyParam);
114
115   //Compute the Boolean value
116   try {
117     OCC_CATCH_SIGNALS;
118     if (!GetSolver()->ComputeFunction(aFunction)) {
119       SetErrorCode("Boolean driver failed");
120       return NULL;
121     }
122   }
123   catch (Standard_Failure& aFail) {
124     SetErrorCode(aFail.GetMessageString());
125     return NULL;
126   }
127
128   //Make a Python command
129   GEOM::TPythonDump pd (aFunction);
130   pd << aBool;
131   if      (theOp == 1) pd << " = geompy.MakeCommon(";
132   else if (theOp == 2) pd << " = geompy.MakeCut(";
133   else if (theOp == 3) pd << " = geompy.MakeFuse(";
134   else if (theOp == 4) pd << " = geompy.MakeSection(";
135   else {}
136   pd << theShape1 << ", " << theShape2;
137
138   if (IsCheckSelfInte) {
139     pd << ", True";
140   }
141
142   if (theFuzzyParam > 0) {
143     // Use named argument for the fuzzy parameter
144     pd << ", theFuzzyParam=" << theFuzzyParam;
145   }
146
147   pd << ")";
148
149   SetErrorCode(OK);
150   return aBool;
151 }
152
153 //=============================================================================
154 /*!
155  *  MakeFuse
156  */
157 //=============================================================================
158 Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeFuse
159                                   (Handle(GEOM_Object)    theShape1,
160                                    Handle(GEOM_Object)    theShape2,
161                                    const bool             IsCheckSelfInte,
162                                    const bool             IsRmExtraEdges,
163                                    const Standard_Real    theFuzzyParam)
164 {
165   SetErrorCode(KO);
166
167   if (theShape1.IsNull() || theShape2.IsNull()) return NULL;
168
169   //Add a new Boolean object
170   Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN);
171
172   //Add a new Boolean function
173   Handle(GEOM_Function) aFunction =
174     aBool->AddFunction(GEOMImpl_BooleanDriver::GetID(), BOOLEAN_FUSE);
175
176   if (aFunction.IsNull()) return NULL;
177
178   //Check if the function is set correctly
179   if (aFunction->GetDriverGUID() != GEOMImpl_BooleanDriver::GetID()) return NULL;
180
181   GEOMImpl_IBoolean aCI (aFunction);
182
183   Handle(GEOM_Function) aRef1 = theShape1->GetLastFunction();
184   Handle(GEOM_Function) aRef2 = theShape2->GetLastFunction();
185
186   if (aRef1.IsNull() || aRef2.IsNull()) return NULL;
187
188   aCI.SetShape1(aRef1);
189   aCI.SetShape2(aRef2);
190   aCI.SetCheckSelfIntersection(IsCheckSelfInte);
191   aCI.SetRmExtraEdges(IsRmExtraEdges);
192   aCI.SetFuzzyParameter(theFuzzyParam);
193
194   //Compute the Boolean value
195   try {
196     OCC_CATCH_SIGNALS;
197     if (!GetSolver()->ComputeFunction(aFunction)) {
198       SetErrorCode("Boolean driver failed");
199       return NULL;
200     }
201   }
202   catch (Standard_Failure& aFail) {
203     SetErrorCode(aFail.GetMessageString());
204     return NULL;
205   }
206
207   //Make a Python command
208   GEOM::TPythonDump pd (aFunction);
209
210   pd << aBool << " = geompy.MakeFuse(";
211   pd << theShape1 << ", " << theShape2 << ", "
212      << IsCheckSelfInte << ", " << IsRmExtraEdges;
213   if (theFuzzyParam > 0) {
214     // Use named argument for the fuzzy parameter
215     pd << ", theFuzzyParam=" << theFuzzyParam;
216   }
217   pd << ")";
218
219   SetErrorCode(OK);
220   return aBool;
221 }
222
223 //=============================================================================
224 /*!
225  *  MakeFuseList
226  */
227 //=============================================================================
228 Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeFuseList
229                   (const Handle(TColStd_HSequenceOfTransient)& theShapes,
230                    const bool                                  IsCheckSelfInte,
231                    const bool                                  IsRmExtraEdges,
232                    const Standard_Real                         theFuzzyParam)
233 {
234   SetErrorCode(KO);
235
236   if (theShapes.IsNull()) return NULL;
237
238   //Add a new Boolean object
239   Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN);
240
241   //Add a new Boolean function
242   Handle(GEOM_Function) aFunction =
243     aBool->AddFunction(GEOMImpl_BooleanDriver::GetID(), BOOLEAN_FUSE_LIST);
244
245   if (aFunction.IsNull()) return NULL;
246
247   //Check if the function is set correctly
248   if (aFunction->GetDriverGUID() != GEOMImpl_BooleanDriver::GetID()) return NULL;
249
250   GEOMImpl_IBoolean aCI (aFunction);
251
252   TCollection_AsciiString aDescription;
253   Handle(TColStd_HSequenceOfTransient) aShapesSeq =
254     getShapeFunctions(theShapes, aDescription);
255
256   if (aShapesSeq.IsNull()) return NULL;
257
258   aCI.SetShapes(aShapesSeq);
259   aCI.SetCheckSelfIntersection(IsCheckSelfInte);
260   aCI.SetRmExtraEdges(IsRmExtraEdges);
261   aCI.SetFuzzyParameter(theFuzzyParam);
262
263   //Compute the Boolean value
264   try {
265     OCC_CATCH_SIGNALS;
266     if (!GetSolver()->ComputeFunction(aFunction)) {
267       SetErrorCode("Boolean driver failed");
268       return NULL;
269     }
270   }
271   catch (Standard_Failure& aFail) {
272     SetErrorCode(aFail.GetMessageString());
273     return NULL;
274   }
275
276   //Make a Python command
277   GEOM::TPythonDump pd (aFunction);
278
279   pd << aBool << " = geompy.MakeFuseList([" << aDescription.ToCString() << "], "
280      << IsCheckSelfInte << ", " << IsRmExtraEdges;
281   if (theFuzzyParam > 0) {
282     // Use named argument for the fuzzy parameter
283     pd << ", theFuzzyParam=" << theFuzzyParam;
284   }
285   pd << ")";
286
287   SetErrorCode(OK);
288   return aBool;
289 }
290
291 //=============================================================================
292 /*!
293  *  MakeCommonList
294  */
295 //=============================================================================
296 Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeCommonList
297                   (const Handle(TColStd_HSequenceOfTransient)& theShapes,
298                    const Standard_Boolean IsCheckSelfInte,
299                    const Standard_Real    theFuzzyParam)
300 {
301   SetErrorCode(KO);
302
303   if (theShapes.IsNull()) return NULL;
304
305   //Add a new Boolean object
306   Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN);
307
308   //Add a new Boolean function
309   Handle(GEOM_Function) aFunction =
310     aBool->AddFunction(GEOMImpl_BooleanDriver::GetID(), BOOLEAN_COMMON_LIST);
311
312   if (aFunction.IsNull()) return NULL;
313
314   //Check if the function is set correctly
315   if (aFunction->GetDriverGUID() != GEOMImpl_BooleanDriver::GetID()) return NULL;
316
317   GEOMImpl_IBoolean aCI (aFunction);
318
319   TCollection_AsciiString aDescription;
320   Handle(TColStd_HSequenceOfTransient) aShapesSeq =
321     getShapeFunctions(theShapes, aDescription);
322
323   if (aShapesSeq.IsNull()) return NULL;
324
325   aCI.SetShapes(aShapesSeq);
326   aCI.SetCheckSelfIntersection(IsCheckSelfInte);
327   aCI.SetFuzzyParameter(theFuzzyParam);
328
329   //Compute the Boolean value
330   try {
331     OCC_CATCH_SIGNALS;
332     if (!GetSolver()->ComputeFunction(aFunction)) {
333       SetErrorCode("Boolean driver failed");
334       return NULL;
335     }
336   }
337   catch (Standard_Failure& aFail) {
338     SetErrorCode(aFail.GetMessageString());
339     return NULL;
340   }
341
342   //Make a Python command
343   GEOM::TPythonDump pd (aFunction);
344
345   pd << aBool <<
346     " = geompy.MakeCommonList([" << aDescription.ToCString() << "]";
347
348   if (IsCheckSelfInte) {
349     pd << ", True";
350   }
351   if (theFuzzyParam > 0) {
352     // Use named argument for the fuzzy parameter
353     pd << ", theFuzzyParam=" << theFuzzyParam;
354   }
355   pd << ")";
356
357   SetErrorCode(OK);
358   return aBool;
359 }
360
361 //=============================================================================
362 /*!
363  *  MakeCutList
364  */
365 //=============================================================================
366 Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeCutList
367                   (Handle(GEOM_Object) theMainShape,
368                    const Handle(TColStd_HSequenceOfTransient)& theShapes,
369                    const Standard_Boolean IsCheckSelfInte,
370                    const Standard_Real theFuzzyParam)
371 {
372   SetErrorCode(KO);
373
374   if (theShapes.IsNull()) return NULL;
375
376   //Add a new Boolean object
377   Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN);
378
379   //Add a new Boolean function
380   Handle(GEOM_Function) aFunction =
381     aBool->AddFunction(GEOMImpl_BooleanDriver::GetID(), BOOLEAN_CUT_LIST);
382
383   if (aFunction.IsNull()) return NULL;
384
385   //Check if the function is set correctly
386   if (aFunction->GetDriverGUID() != GEOMImpl_BooleanDriver::GetID()) return NULL;
387
388   GEOMImpl_IBoolean aCI (aFunction);
389   Handle(GEOM_Function) aMainRef = theMainShape->GetLastFunction();
390
391   if (aMainRef.IsNull()) return NULL;
392
393   TCollection_AsciiString aDescription;
394   Handle(TColStd_HSequenceOfTransient) aShapesSeq =
395     getShapeFunctions(theShapes, aDescription);
396
397   if (aShapesSeq.IsNull()) return NULL;
398
399   aCI.SetShape1(aMainRef);
400   aCI.SetShapes(aShapesSeq);
401   aCI.SetCheckSelfIntersection(IsCheckSelfInte);
402   aCI.SetFuzzyParameter(theFuzzyParam);
403
404   //Compute the Boolean value
405   try {
406     OCC_CATCH_SIGNALS;
407     if (!GetSolver()->ComputeFunction(aFunction)) {
408       SetErrorCode("Boolean driver failed");
409       return NULL;
410     }
411   }
412   catch (Standard_Failure& aFail) {
413     SetErrorCode(aFail.GetMessageString());
414     return NULL;
415   }
416
417   //Make a Python command
418   GEOM::TPythonDump pd (aFunction);
419
420   pd << aBool << " = geompy.MakeCutList("
421     << theMainShape << ", [" << aDescription.ToCString() << "]";
422
423   if (IsCheckSelfInte) {
424     pd << ", True";
425   }
426
427   if (theFuzzyParam > 0) {
428     // Use named argument for the fuzzy parameter
429     pd << ", theFuzzyParam=" << theFuzzyParam;
430   }
431
432   pd << ")";
433
434   SetErrorCode(OK);
435   return aBool;
436 }
437
438 //=============================================================================
439 /*!
440  *  MakePartition
441  */
442 //=============================================================================
443 Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakePartition
444                              (const Handle(TColStd_HSequenceOfTransient)& theShapes,
445                               const Handle(TColStd_HSequenceOfTransient)& theTools,
446                               const Handle(TColStd_HSequenceOfTransient)& theKeepIns,
447                               const Handle(TColStd_HSequenceOfTransient)& theRemoveIns,
448                               const Standard_Integer                      theLimit,
449                               const Standard_Boolean                      theRemoveWebs,
450                               const Handle(TColStd_HArray1OfInteger)&     theMaterials,
451                               const Standard_Integer theKeepNonlimitShapes,
452                               const Standard_Boolean thePerformSelfIntersections,
453                               const Standard_Boolean IsCheckSelfInte,
454                               const Standard_Real    theFuzzyParam)
455 {
456   SetErrorCode(KO);
457
458   //Add a new Partition object
459   Handle(GEOM_Object) aPartition = GetEngine()->AddObject(GEOM_PARTITION);
460
461   //Add a new Partition function
462   Handle(GEOM_Function) aFunction;
463   if (thePerformSelfIntersections)
464     aFunction = aPartition->AddFunction(GEOMImpl_PartitionDriver::GetID(), PARTITION_PARTITION);
465   else
466     aFunction = aPartition->AddFunction(GEOMImpl_PartitionDriver::GetID(), PARTITION_NO_SELF_INTERSECTIONS);
467   if (aFunction.IsNull()) return NULL;
468
469   //Check if the function is set correctly
470   if (aFunction->GetDriverGUID() != GEOMImpl_PartitionDriver::GetID()) return NULL;
471
472   GEOMImpl_IPartition aCI (aFunction);
473
474   Handle(TColStd_HSequenceOfTransient) aShapesSeq;
475   Handle(TColStd_HSequenceOfTransient) aToolsSeq;
476   Handle(TColStd_HSequenceOfTransient) aKeepInsSeq;
477   Handle(TColStd_HSequenceOfTransient) aRemInsSeq;
478   TCollection_AsciiString aShapesDescr, aToolsDescr, aKeepInsDescr, aRemoveInsDescr;
479
480   // Shapes
481   aShapesSeq = getShapeFunctions(theShapes, aShapesDescr);
482
483   if (aShapesSeq.IsNull()) {
484     SetErrorCode("NULL shape for Partition");
485     return NULL;
486   }
487
488   // Tools
489   aToolsSeq = getShapeFunctions(theTools, aToolsDescr);
490
491   if (aToolsSeq.IsNull()) {
492     SetErrorCode("NULL tool shape for Partition");
493     return NULL;
494   }
495
496   // Keep Inside
497   aKeepInsSeq = getShapeFunctions(theKeepIns, aKeepInsDescr);
498
499   if (aKeepInsSeq.IsNull()) {
500     SetErrorCode("NULL <keep inside> shape for Partition");
501     return NULL;
502   }
503
504   // Remove Inside
505   aRemInsSeq  = getShapeFunctions(theRemoveIns, aRemoveInsDescr);
506
507   if (aRemInsSeq.IsNull()) {
508     SetErrorCode("NULL <remove inside> shape for Partition");
509     return NULL;
510   }
511
512   aCI.SetShapes(aShapesSeq);
513   aCI.SetTools(aToolsSeq);
514   aCI.SetKeepIns(aKeepInsSeq);
515   aCI.SetRemoveIns(aRemInsSeq);
516
517   // Limit
518   aCI.SetLimit(theLimit);
519   aCI.SetKeepNonlimitShapes(theKeepNonlimitShapes);
520   aCI.SetCheckSelfIntersection(IsCheckSelfInte);
521
522   // Materials
523   if (theRemoveWebs) {
524     if (theMaterials.IsNull()) {
525       Handle(TColStd_HArray1OfInteger) aMaterials =
526         new TColStd_HArray1OfInteger (1, aShapesSeq->Length());
527       aMaterials->Init(0);
528       aCI.SetMaterials(aMaterials);
529     } else {
530       aCI.SetMaterials(theMaterials);
531     }
532   }
533
534   // Fuzzy parameter
535   aCI.SetFuzzyParameter(theFuzzyParam);
536
537   //Compute the Partition
538   try {
539     OCC_CATCH_SIGNALS;
540     if (!GetSolver()->ComputeFunction(aFunction)) {
541       SetErrorCode("Partition driver failed");
542       return NULL;
543     }
544   }
545   catch (Standard_Failure& aFail) {
546     SetErrorCode(aFail.GetMessageString());
547     return NULL;
548   }
549
550   //Make a Python command
551   GEOM::TPythonDump pd (aFunction);
552   if (thePerformSelfIntersections)
553     pd << aPartition << " = geompy.MakePartition([";
554   else
555     pd << aPartition << " = geompy.MakePartitionNonSelfIntersectedShape([";
556
557   // Shapes, Tools
558   pd << aShapesDescr.ToCString() << "], [" << aToolsDescr.ToCString() << "], [";
559   // Keep Ins, Remove Ins
560   pd << aKeepInsDescr.ToCString() << "], [" << aRemoveInsDescr.ToCString() << "], ";
561   // Limit, Remove Webs
562   pd << TopAbs_ShapeEnum(theLimit) << ", " << (int)theRemoveWebs << ", [";
563   // Materials
564   if (!theMaterials.IsNull() && theMaterials->Length() > 0) {
565     int i = theMaterials->Lower();
566     pd << theMaterials->Value(i);
567     i++;
568     for (; i <= theMaterials->Upper(); i++) {
569       pd << ", " << theMaterials->Value(i);
570     }
571   }
572   pd << "], " << theKeepNonlimitShapes;
573
574   if (IsCheckSelfInte && !thePerformSelfIntersections) {
575     pd << ", True";
576   }
577   
578   if (theFuzzyParam > 0) {
579     // Use named argument for the fuzzy parameter
580     pd << ", theFuzzyParam=" << theFuzzyParam;
581   }
582
583   pd << ")";
584
585   SetErrorCode(OK);
586   return aPartition;
587 }
588
589 //=============================================================================
590 /*!
591  *  MakeHalfPartition
592  */
593 //=============================================================================
594 Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeHalfPartition
595        (Handle(GEOM_Object) theShape,
596         Handle(GEOM_Object) thePlane,
597         const Standard_Real theFuzzyParam)
598 {
599   SetErrorCode(KO);
600
601   if (theShape.IsNull() || thePlane.IsNull()) return NULL;
602
603   //Add a new Boolean object
604   Handle(GEOM_Object) aPart = GetEngine()->AddObject(GEOM_PARTITION);
605
606   //Add a new Partition function
607   Handle(GEOM_Function) aFunction =
608     aPart->AddFunction(GEOMImpl_PartitionDriver::GetID(), PARTITION_HALF);
609   if (aFunction.IsNull()) return NULL;
610
611   //Check if the function is set correctly
612   if (aFunction->GetDriverGUID() != GEOMImpl_PartitionDriver::GetID()) return NULL;
613
614   GEOMImpl_IPartition aCI (aFunction);
615
616   Handle(GEOM_Function) aRef1 = theShape->GetLastFunction();
617   Handle(GEOM_Function) aRef2 = thePlane->GetLastFunction();
618
619   if (aRef1.IsNull() || aRef2.IsNull()) return NULL;
620
621   aCI.SetShape(aRef1);
622   aCI.SetPlane(aRef2);
623   aCI.SetFuzzyParameter(theFuzzyParam);
624
625   //Compute the Partition value
626   try {
627     OCC_CATCH_SIGNALS;
628     if (!GetSolver()->ComputeFunction(aFunction)) {
629       SetErrorCode("Partition driver failed");
630       return NULL;
631     }
632   }
633   catch (Standard_Failure& aFail) {
634     SetErrorCode(aFail.GetMessageString());
635     return NULL;
636   }
637
638   //Make a Python command
639   GEOM::TPythonDump pd (aFunction);
640   pd << aPart << " = geompy.MakeHalfPartition("
641      << theShape << ", " << thePlane;
642   if (theFuzzyParam > 0) {
643     // Use named argument for the fuzzy parameter
644     pd << ", theFuzzyParam=" << theFuzzyParam;
645   }
646   pd << ")";
647
648   SetErrorCode(OK);
649   return aPart;
650 }
651
652 //=============================================================================
653 /*!
654  *  getShapeFunctions
655  */
656 //=============================================================================
657 Handle(TColStd_HSequenceOfTransient)
658   GEOMImpl_IBooleanOperations::getShapeFunctions
659                   (const Handle(TColStd_HSequenceOfTransient)& theObjects,
660                          TCollection_AsciiString &theDescription)
661 {
662   Handle(TColStd_HSequenceOfTransient) aResult =
663     new TColStd_HSequenceOfTransient;
664   Standard_Integer aNbObjects = theObjects->Length();
665   Standard_Integer i;
666   TCollection_AsciiString anEntry;
667   Handle(GEOM_Object) anObj;
668   Handle(GEOM_Function) aRefObj;
669
670   // Shapes
671   for (i = 1; i <= aNbObjects; i++) {
672     anObj = Handle(GEOM_Object)::DownCast(theObjects->Value(i));
673     aRefObj = anObj->GetLastFunction();
674
675     if (aRefObj.IsNull()) {
676       aResult.Nullify();
677       break;
678     }
679
680     aResult->Append(aRefObj);
681
682     // For Python command
683     TDF_Tool::Entry(anObj->GetEntry(), anEntry);
684
685     if (i > 1) {
686       theDescription += ", ";
687     }
688
689     theDescription += anEntry;
690   }
691
692   return aResult;
693 }