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