Salome HOME
An additional minor fix based on the issue #2917 issue script: to update some kind...
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_ExtrusionBoolean.cpp
1 // Copyright (C) 2014-2019  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #include "FeaturesAPI_ExtrusionBoolean.h"
21
22 #include <ModelHighAPI_Double.h>
23 #include <ModelHighAPI_Dumper.h>
24 #include <ModelHighAPI_Reference.h>
25 #include <ModelHighAPI_Tools.h>
26
27 //==================================================================================================
28 FeaturesAPI_ExtrusionBoolean::FeaturesAPI_ExtrusionBoolean(
29   const std::shared_ptr<ModelAPI_Feature>& theFeature)
30 : ModelHighAPI_Interface(theFeature)
31 {
32 }
33
34 //==================================================================================================
35 FeaturesAPI_ExtrusionBoolean::~FeaturesAPI_ExtrusionBoolean()
36 {
37 }
38
39 //==================================================================================================
40 void FeaturesAPI_ExtrusionBoolean::setNestedSketch(const ModelHighAPI_Reference& theSketch)
41 {
42   mysketch->setValue(theSketch.feature());
43
44   // To make Sketch feature execute and subfeatures execute.
45   feature()->document()->setCurrentFeature(feature(), false);
46
47   // to inform that the history is updated due to the sketch moved under the composite feature
48   if (theSketch.feature().get()) {
49     theSketch.feature()->document()->updateHistory(ModelAPI_Feature::group());
50     if (theSketch.feature()->firstResult().get())
51       theSketch.feature()->firstResult()->setDisplayed(false);
52   }
53   mybaseObjects->clear();
54   mybaseObjects->append(theSketch.feature()->firstResult(), GeomShapePtr());
55
56   execIfBaseNotEmpty();
57 }
58
59 //==================================================================================================
60 void FeaturesAPI_ExtrusionBoolean::setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects)
61 {
62   mysketch->setValue(ObjectPtr());
63   mybaseObjects->clear();
64   fillAttribute(theBaseObjects, mybaseObjects);
65
66   execIfBaseNotEmpty();
67 }
68
69 //==================================================================================================
70 void FeaturesAPI_ExtrusionBoolean::setDirection(const ModelHighAPI_Selection& theDirection)
71 {
72   fillAttribute(theDirection, mydirection);
73
74   execIfBaseNotEmpty();
75 }
76
77 //==================================================================================================
78 void FeaturesAPI_ExtrusionBoolean::setSizes(const ModelHighAPI_Double& theToSize,
79                                             const ModelHighAPI_Double& theFromSize)
80 {
81   fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
82   fillAttribute(theToSize, mytoSize);
83   fillAttribute(theFromSize, myfromSize);
84
85   execIfBaseNotEmpty();
86 }
87
88 //==================================================================================================
89 void FeaturesAPI_ExtrusionBoolean::setSize(const ModelHighAPI_Double& theSize)
90 {
91   setSizes(theSize, ModelHighAPI_Double());
92 }
93
94 //==================================================================================================
95 void FeaturesAPI_ExtrusionBoolean::setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
96                                                        const ModelHighAPI_Double& theToOffset,
97                                                        const ModelHighAPI_Selection& theFromObject,
98                                                        const ModelHighAPI_Double& theFromOffset)
99 {
100   fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_PLANES(), mycreationMethod);
101   fillAttribute(theToObject, mytoObject);
102   fillAttribute(theToOffset, mytoOffset);
103   fillAttribute(theFromObject, myfromObject);
104   fillAttribute(theFromOffset, myfromOffset);
105
106   execIfBaseNotEmpty();
107 }
108
109 //==================================================================================================
110 void FeaturesAPI_ExtrusionBoolean::setBooleanObjects(
111   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
112 {
113   fillAttribute(theBooleanObjects, mybooleanObjects);
114
115   execIfBaseNotEmpty();
116 }
117
118 //==================================================================================================
119 void FeaturesAPI_ExtrusionBoolean::dump(ModelHighAPI_Dumper& theDumper) const
120 {
121   FeaturePtr aBase = feature();
122   const std::string& aDocName = theDumper.name(aBase->document());
123
124   AttributeReferencePtr anAttrSketch = aBase->reference(FeaturesPlugin_Extrusion::SKETCH_ID());
125   AttributeSelectionListPtr anAttrObjects =
126     aBase->selectionList(FeaturesPlugin_Extrusion::BASE_OBJECTS_ID());
127   AttributeSelectionPtr anAttrDirection =
128     aBase->selection(FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID());
129
130   theDumper << aBase << " = model.addExtrusion";
131   if(aBase->getKind() == FeaturesPlugin_ExtrusionCut::ID()) {
132     theDumper << "Cut";
133   } else if(aBase->getKind() == FeaturesPlugin_ExtrusionFuse::ID()) {
134     theDumper << "Fuse";
135   }
136   theDumper << "(" << aDocName << ", ";
137   anAttrSketch->isInitialized() ? theDumper << "[]" : theDumper << anAttrObjects;
138   theDumper << ", " << anAttrDirection;
139
140   std::string aCreationMethod =
141     aBase->string(FeaturesPlugin_Extrusion::CREATION_METHOD())->value();
142
143   if(aCreationMethod == FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES()) {
144     AttributeDoublePtr anAttrToSize = aBase->real(FeaturesPlugin_Extrusion::TO_SIZE_ID());
145     AttributeDoublePtr anAttrFromSize = aBase->real(FeaturesPlugin_Extrusion::FROM_SIZE_ID());
146
147     theDumper << ", " << anAttrToSize << ", " << anAttrFromSize;
148   } else if(aCreationMethod == FeaturesPlugin_Extrusion::CREATION_METHOD_BY_PLANES()) {
149     AttributeSelectionPtr anAttrToObject =
150       aBase->selection(FeaturesPlugin_Extrusion::TO_OBJECT_ID());
151     AttributeDoublePtr anAttrToOffset = aBase->real(FeaturesPlugin_Extrusion::TO_OFFSET_ID());
152     AttributeSelectionPtr anAttrFromObject =
153       aBase->selection(FeaturesPlugin_Extrusion::FROM_OBJECT_ID());
154     AttributeDoublePtr anAttrFromOffset = aBase->real(FeaturesPlugin_Extrusion::FROM_OFFSET_ID());
155
156     theDumper << ", " << anAttrToObject << ", " << anAttrToOffset <<
157       ", " << anAttrFromObject << ", " << anAttrFromOffset;
158   }
159
160   AttributeSelectionListPtr anAttrBoolObjects =
161     aBase->selectionList(FeaturesPlugin_CompositeBoolean::OBJECTS_ID());
162   theDumper << ", " << anAttrBoolObjects << ")" << std::endl;
163
164   if(anAttrSketch->isInitialized()) {
165     theDumper << aBase << ".setNestedSketch(" << anAttrSketch << ")" << std::endl;
166   }
167 }
168
169 //==================================================================================================
170 void FeaturesAPI_ExtrusionBoolean::execIfBaseNotEmpty()
171 {
172   if(mybaseObjects->size() > 0) {
173     execute();
174   }
175 }
176
177
178 //==================================================================================================
179 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
180   const std::shared_ptr<ModelAPI_Feature>& theFeature)
181 : FeaturesAPI_ExtrusionBoolean(theFeature)
182 {
183   initialize();
184 }
185
186 //==================================================================================================
187 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
188   const std::shared_ptr<ModelAPI_Feature>& theFeature,
189   const std::list<ModelHighAPI_Selection>& theBaseObjects,
190   const ModelHighAPI_Double& theSize,
191   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
192 : FeaturesAPI_ExtrusionBoolean(theFeature)
193 {
194   if(initialize()) {
195     fillAttribute(theBaseObjects, mybaseObjects);
196     setSize(theSize);
197     setBooleanObjects(theBooleanObjects);
198   }
199 }
200
201 //==================================================================================================
202 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
203   const std::shared_ptr<ModelAPI_Feature>& theFeature,
204   const std::list<ModelHighAPI_Selection>& theBaseObjects,
205   const ModelHighAPI_Selection& theDirection,
206   const ModelHighAPI_Double& theSize,
207   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
208 : FeaturesAPI_ExtrusionBoolean(theFeature)
209 {
210   if(initialize()) {
211     fillAttribute(theBaseObjects, mybaseObjects);
212     fillAttribute(theDirection, mydirection);
213     setSize(theSize);
214     setBooleanObjects(theBooleanObjects);
215   }
216 }
217
218 //==================================================================================================
219 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
220   const std::shared_ptr<ModelAPI_Feature>& theFeature,
221   const std::list<ModelHighAPI_Selection>& theBaseObjects,
222   const ModelHighAPI_Double& theToSize,
223   const ModelHighAPI_Double& theFromSize,
224   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
225 : FeaturesAPI_ExtrusionBoolean(theFeature)
226 {
227   if(initialize()) {
228     fillAttribute(theBaseObjects, mybaseObjects);
229     setSizes(theToSize, theFromSize);
230     setBooleanObjects(theBooleanObjects);
231   }
232 }
233
234 //==================================================================================================
235 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
236   const std::shared_ptr<ModelAPI_Feature>& theFeature,
237   const std::list<ModelHighAPI_Selection>& theBaseObjects,
238   const ModelHighAPI_Selection& theDirection,
239   const ModelHighAPI_Double& theToSize,
240   const ModelHighAPI_Double& theFromSize,
241   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
242 : FeaturesAPI_ExtrusionBoolean(theFeature)
243 {
244   if(initialize()) {
245     fillAttribute(theBaseObjects, mybaseObjects);
246     fillAttribute(theDirection, mydirection);
247     setSizes(theToSize, theFromSize);
248     setBooleanObjects(theBooleanObjects);
249   }
250 }
251
252 //==================================================================================================
253 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
254   const std::shared_ptr<ModelAPI_Feature>& theFeature,
255   const std::list<ModelHighAPI_Selection>& theBaseObjects,
256   const ModelHighAPI_Selection& theToObject,
257   const ModelHighAPI_Double& theToOffset,
258   const ModelHighAPI_Selection& theFromObject,
259   const ModelHighAPI_Double& theFromOffset,
260   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
261 : FeaturesAPI_ExtrusionBoolean(theFeature)
262 {
263   if(initialize()) {
264     fillAttribute(theBaseObjects, mybaseObjects);
265     setPlanesAndOffsets(theToObject, theToOffset, theFromObject, theFromOffset);
266     setBooleanObjects(theBooleanObjects);
267   }
268 }
269
270 //==================================================================================================
271 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
272   const std::shared_ptr<ModelAPI_Feature>& theFeature,
273   const std::list<ModelHighAPI_Selection>& theBaseObjects,
274   const ModelHighAPI_Selection& theDirection,
275   const ModelHighAPI_Selection& theToObject,
276   const ModelHighAPI_Double& theToOffset,
277   const ModelHighAPI_Selection& theFromObject,
278   const ModelHighAPI_Double& theFromOffset,
279   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
280 : FeaturesAPI_ExtrusionBoolean(theFeature)
281 {
282   if(initialize()) {
283     fillAttribute(theBaseObjects, mybaseObjects);
284     fillAttribute(theDirection, mydirection);
285     setPlanesAndOffsets(theToObject, theToOffset, theFromObject, theFromOffset);
286     setBooleanObjects(theBooleanObjects);
287   }
288 }
289
290 //==================================================================================================
291 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
292                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
293                                 const ModelHighAPI_Double& theSize,
294                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
295 {
296   std::shared_ptr<ModelAPI_Feature> aFeature =
297     thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
298   return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects,
299                                                       theSize, theBooleanObjects));
300 }
301
302 //==================================================================================================
303 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
304                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
305                                 const ModelHighAPI_Selection& theDirection,
306                                 const ModelHighAPI_Double& theSize,
307                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
308 {
309   std::shared_ptr<ModelAPI_Feature> aFeature =
310     thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
311   return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, theDirection,
312                                                       theSize, theBooleanObjects));
313 }
314
315 //==================================================================================================
316 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
317                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
318                                 const ModelHighAPI_Double& theToSize,
319                                 const ModelHighAPI_Double& theFromSize,
320                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
321 {
322   std::shared_ptr<ModelAPI_Feature> aFeature =
323     thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
324   return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects,
325                                                       theToSize, theFromSize, theBooleanObjects));
326 }
327
328 //==================================================================================================
329 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
330                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
331                                 const ModelHighAPI_Selection& theDirection,
332                                 const ModelHighAPI_Double& theToSize,
333                                 const ModelHighAPI_Double& theFromSize,
334                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
335 {
336   std::shared_ptr<ModelAPI_Feature> aFeature =
337     thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
338   return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature,
339                                                       theBaseObjects,
340                                                       theDirection,
341                                                       theToSize,
342                                                       theFromSize,
343                                                       theBooleanObjects));
344 }
345
346 //==================================================================================================
347 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
348                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
349                                 const ModelHighAPI_Selection& theToObject,
350                                 const ModelHighAPI_Double& theToOffset,
351                                 const ModelHighAPI_Selection& theFromObject,
352                                 const ModelHighAPI_Double& theFromOffset,
353                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
354 {
355   std::shared_ptr<ModelAPI_Feature> aFeature =
356     thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
357   return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature,
358                                                       theBaseObjects,
359                                                       theToObject,
360                                                       theToOffset,
361                                                       theFromObject,
362                                                       theFromOffset,
363                                                       theBooleanObjects));
364 }
365
366 //==================================================================================================
367 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
368                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
369                                 const ModelHighAPI_Selection& theDirection,
370                                 const ModelHighAPI_Selection& theToObject,
371                                 const ModelHighAPI_Double& theToOffset,
372                                 const ModelHighAPI_Selection& theFromObject,
373                                 const ModelHighAPI_Double& theFromOffset,
374                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
375 {
376   std::shared_ptr<ModelAPI_Feature> aFeature =
377     thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
378   return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature,
379                                                       theBaseObjects,
380                                                       theDirection,
381                                                       theToObject,
382                                                       theToOffset,
383                                                       theFromObject,
384                                                       theFromOffset,
385                                                       theBooleanObjects));
386 }
387
388
389 //==================================================================================================
390 FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
391   const std::shared_ptr<ModelAPI_Feature>& theFeature)
392 : FeaturesAPI_ExtrusionBoolean(theFeature)
393 {
394   initialize();
395 }
396
397 //==================================================================================================
398 FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
399   const std::shared_ptr<ModelAPI_Feature>& theFeature,
400   const std::list<ModelHighAPI_Selection>& theBaseObjects,
401   const ModelHighAPI_Double& theSize,
402   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
403 : FeaturesAPI_ExtrusionBoolean(theFeature)
404 {
405   if(initialize()) {
406     fillAttribute(theBaseObjects, mybaseObjects);
407     setSize(theSize);
408     setBooleanObjects(theBooleanObjects);
409   }
410 }
411
412 //==================================================================================================
413 FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
414   const std::shared_ptr<ModelAPI_Feature>& theFeature,
415   const std::list<ModelHighAPI_Selection>& theBaseObjects,
416   const ModelHighAPI_Selection& theDirection,
417   const ModelHighAPI_Double& theSize,
418   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
419 : FeaturesAPI_ExtrusionBoolean(theFeature)
420 {
421   if(initialize()) {
422     fillAttribute(theBaseObjects, mybaseObjects);
423     fillAttribute(theDirection, mydirection);
424     setSize(theSize);
425     setBooleanObjects(theBooleanObjects);
426   }
427 }
428
429 //==================================================================================================
430 FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
431   const std::shared_ptr<ModelAPI_Feature>& theFeature,
432   const std::list<ModelHighAPI_Selection>& theBaseObjects,
433   const ModelHighAPI_Double& theToSize,
434   const ModelHighAPI_Double& theFromSize,
435   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
436 : FeaturesAPI_ExtrusionBoolean(theFeature)
437 {
438   if(initialize()) {
439     fillAttribute(theBaseObjects, mybaseObjects);
440     setSizes(theToSize, theFromSize);
441     setBooleanObjects(theBooleanObjects);
442   }
443 }
444
445 //==================================================================================================
446 FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
447   const std::shared_ptr<ModelAPI_Feature>& theFeature,
448   const std::list<ModelHighAPI_Selection>& theBaseObjects,
449   const ModelHighAPI_Selection& theDirection,
450   const ModelHighAPI_Double& theToSize,
451   const ModelHighAPI_Double& theFromSize,
452   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
453 : FeaturesAPI_ExtrusionBoolean(theFeature)
454 {
455   if(initialize()) {
456     fillAttribute(theBaseObjects, mybaseObjects);
457     fillAttribute(theDirection, mydirection);
458     setSizes(theToSize, theFromSize);
459     setBooleanObjects(theBooleanObjects);
460   }
461 }
462
463 //==================================================================================================
464 FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
465   const std::shared_ptr<ModelAPI_Feature>& theFeature,
466   const std::list<ModelHighAPI_Selection>& theBaseObjects,
467   const ModelHighAPI_Selection& theToObject,
468   const ModelHighAPI_Double& theToOffset,
469   const ModelHighAPI_Selection& theFromObject,
470   const ModelHighAPI_Double& theFromOffset,
471   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
472 : FeaturesAPI_ExtrusionBoolean(theFeature)
473 {
474   if(initialize()) {
475     fillAttribute(theBaseObjects, mybaseObjects);
476     setPlanesAndOffsets(theToObject, theToOffset, theFromObject, theFromOffset);
477     setBooleanObjects(theBooleanObjects);
478   }
479 }
480
481 //==================================================================================================
482 FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
483   const std::shared_ptr<ModelAPI_Feature>& theFeature,
484   const std::list<ModelHighAPI_Selection>& theBaseObjects,
485   const ModelHighAPI_Selection& theDirection,
486   const ModelHighAPI_Selection& theToObject,
487   const ModelHighAPI_Double& theToOffset,
488   const ModelHighAPI_Selection& theFromObject,
489   const ModelHighAPI_Double& theFromOffset,
490   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
491 : FeaturesAPI_ExtrusionBoolean(theFeature)
492 {
493   if(initialize()) {
494     fillAttribute(theBaseObjects, mybaseObjects);
495     fillAttribute(theDirection, mydirection);
496     setPlanesAndOffsets(theToObject, theToOffset, theFromObject, theFromOffset);
497     setBooleanObjects(theBooleanObjects);
498   }
499 }
500
501 //==================================================================================================
502 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
503                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
504                                   const ModelHighAPI_Double& theSize,
505                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
506 {
507   std::shared_ptr<ModelAPI_Feature> aFeature =
508     thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
509   return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects,
510                                                         theSize, theBooleanObjects));
511 }
512
513 //==================================================================================================
514 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
515                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
516                                   const ModelHighAPI_Selection& theDirection,
517                                   const ModelHighAPI_Double& theSize,
518                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
519 {
520   std::shared_ptr<ModelAPI_Feature> aFeature =
521     thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
522   return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects,
523                                                         theDirection, theSize, theBooleanObjects));
524 }
525
526 //==================================================================================================
527 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
528                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
529                                   const ModelHighAPI_Double& theToSize,
530                                   const ModelHighAPI_Double& theFromSize,
531                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
532 {
533   std::shared_ptr<ModelAPI_Feature> aFeature =
534     thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
535   return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects,
536                                                         theToSize, theFromSize, theBooleanObjects));
537 }
538
539 //==================================================================================================
540 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
541                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
542                                   const ModelHighAPI_Selection& theDirection,
543                                   const ModelHighAPI_Double& theToSize,
544                                   const ModelHighAPI_Double& theFromSize,
545                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
546 {
547   std::shared_ptr<ModelAPI_Feature> aFeature =
548     thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
549   return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature,
550                                                         theBaseObjects,
551                                                         theDirection,
552                                                         theToSize,
553                                                         theFromSize,
554                                                         theBooleanObjects));
555 }
556
557 //==================================================================================================
558 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
559                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
560                                   const ModelHighAPI_Selection& theToObject,
561                                   const ModelHighAPI_Double& theToOffset,
562                                   const ModelHighAPI_Selection& theFromObject,
563                                   const ModelHighAPI_Double& theFromOffset,
564                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
565 {
566   std::shared_ptr<ModelAPI_Feature> aFeature =
567     thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
568   return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature,
569                                                         theBaseObjects,
570                                                         theToObject,
571                                                         theToOffset,
572                                                         theFromObject,
573                                                         theFromOffset,
574                                                         theBooleanObjects));
575 }
576
577 //==================================================================================================
578 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
579                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
580                                   const ModelHighAPI_Selection& theDirection,
581                                   const ModelHighAPI_Selection& theToObject,
582                                   const ModelHighAPI_Double& theToOffset,
583                                   const ModelHighAPI_Selection& theFromObject,
584                                   const ModelHighAPI_Double& theFromOffset,
585                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects)
586 {
587   std::shared_ptr<ModelAPI_Feature> aFeature =
588     thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
589   return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature,
590                                                         theBaseObjects,
591                                                         theDirection,
592                                                         theToObject,
593                                                         theToOffset,
594                                                         theFromObject,
595                                                         theFromOffset,
596                                                         theBooleanObjects));
597 }