1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #include "FeaturesAPI_ExtrusionBoolean.h"
23 #include <ModelHighAPI_Double.h>
24 #include <ModelHighAPI_Dumper.h>
25 #include <ModelHighAPI_Reference.h>
26 #include <ModelHighAPI_Tools.h>
28 //==================================================================================================
29 FeaturesAPI_ExtrusionBoolean::FeaturesAPI_ExtrusionBoolean(
30 const std::shared_ptr<ModelAPI_Feature>& theFeature)
31 : ModelHighAPI_Interface(theFeature)
35 //==================================================================================================
36 FeaturesAPI_ExtrusionBoolean::~FeaturesAPI_ExtrusionBoolean()
40 //==================================================================================================
41 void FeaturesAPI_ExtrusionBoolean::setNestedSketch(const ModelHighAPI_Reference& theSketch)
43 mysketch->setValue(theSketch.feature());
45 // To make Sketch feature execute and subfeatures execute.
46 feature()->document()->setCurrentFeature(feature(), false);
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);
54 mybaseObjects->clear();
55 mybaseObjects->append(theSketch.feature()->firstResult(), GeomShapePtr());
60 //==================================================================================================
61 void FeaturesAPI_ExtrusionBoolean::setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects)
63 mysketch->setValue(ObjectPtr());
64 mybaseObjects->clear();
65 fillAttribute(theBaseObjects, mybaseObjects);
70 //==================================================================================================
71 void FeaturesAPI_ExtrusionBoolean::setDirection(const ModelHighAPI_Selection& theDirection)
73 fillAttribute(theDirection, mydirection);
78 //==================================================================================================
79 void FeaturesAPI_ExtrusionBoolean::setSizes(const ModelHighAPI_Double& theToSize,
80 const ModelHighAPI_Double& theFromSize)
82 fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
83 fillAttribute(theToSize, mytoSize);
84 fillAttribute(theFromSize, myfromSize);
89 //==================================================================================================
90 void FeaturesAPI_ExtrusionBoolean::setSize(const ModelHighAPI_Double& theSize)
92 fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
93 fillAttribute(theSize, mytoSize);
94 fillAttribute(ModelHighAPI_Double(), myfromSize);
99 //==================================================================================================
100 void FeaturesAPI_ExtrusionBoolean::setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
101 const ModelHighAPI_Double& theToOffset,
102 const ModelHighAPI_Selection& theFromObject,
103 const ModelHighAPI_Double& theFromOffset)
105 fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_PLANES(), mycreationMethod);
106 fillAttribute(theToObject, mytoObject);
107 fillAttribute(theToOffset, mytoOffset);
108 fillAttribute(theFromObject, myfromObject);
109 fillAttribute(theFromOffset, myfromOffset);
111 execIfBaseNotEmpty();
114 //==================================================================================================
115 void FeaturesAPI_ExtrusionBoolean::setBooleanObjects(
116 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
118 fillAttribute(theBooleanObjects, mybooleanObjects);
120 execIfBaseNotEmpty();
123 //==================================================================================================
124 void FeaturesAPI_ExtrusionBoolean::dump(ModelHighAPI_Dumper& theDumper) const
126 FeaturePtr aBase = feature();
127 const std::string& aDocName = theDumper.name(aBase->document());
129 AttributeReferencePtr anAttrSketch = aBase->reference(FeaturesPlugin_Extrusion::SKETCH_ID());
130 AttributeSelectionListPtr anAttrObjects =
131 aBase->selectionList(FeaturesPlugin_Extrusion::BASE_OBJECTS_ID());
132 AttributeSelectionPtr anAttrDirection =
133 aBase->selection(FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID());
135 theDumper << aBase << " = model.addExtrusion";
136 if(aBase->getKind() == FeaturesPlugin_ExtrusionCut::ID()) {
138 } else if(aBase->getKind() == FeaturesPlugin_ExtrusionFuse::ID()) {
141 theDumper << "(" << aDocName << ", ";
142 anAttrSketch->isInitialized() ? theDumper << "[]" : theDumper << anAttrObjects;
143 theDumper << ", " << anAttrDirection;
145 std::string aCreationMethod =
146 aBase->string(FeaturesPlugin_Extrusion::CREATION_METHOD())->value();
148 if(aCreationMethod == FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES()) {
149 AttributeDoublePtr anAttrToSize = aBase->real(FeaturesPlugin_Extrusion::TO_SIZE_ID());
150 AttributeDoublePtr anAttrFromSize = aBase->real(FeaturesPlugin_Extrusion::FROM_SIZE_ID());
152 theDumper << ", " << anAttrToSize << ", " << anAttrFromSize;
153 } else if(aCreationMethod == FeaturesPlugin_Extrusion::CREATION_METHOD_BY_PLANES()) {
154 AttributeSelectionPtr anAttrToObject =
155 aBase->selection(FeaturesPlugin_Extrusion::TO_OBJECT_ID());
156 AttributeDoublePtr anAttrToOffset = aBase->real(FeaturesPlugin_Extrusion::TO_OFFSET_ID());
157 AttributeSelectionPtr anAttrFromObject =
158 aBase->selection(FeaturesPlugin_Extrusion::FROM_OBJECT_ID());
159 AttributeDoublePtr anAttrFromOffset = aBase->real(FeaturesPlugin_Extrusion::FROM_OFFSET_ID());
161 theDumper << ", " << anAttrToObject << ", " << anAttrToOffset <<
162 ", " << anAttrFromObject << ", " << anAttrFromOffset;
165 AttributeSelectionListPtr anAttrBoolObjects =
166 aBase->selectionList(FeaturesPlugin_CompositeBoolean::OBJECTS_ID());
167 theDumper << ", " << anAttrBoolObjects << ")" << std::endl;
169 if(anAttrSketch->isInitialized()) {
170 theDumper << aBase << ".setNestedSketch(" << anAttrSketch << ")" << std::endl;
174 //==================================================================================================
175 void FeaturesAPI_ExtrusionBoolean::execIfBaseNotEmpty()
177 if(mybaseObjects->size() > 0) {
183 //==================================================================================================
184 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
185 const std::shared_ptr<ModelAPI_Feature>& theFeature)
186 : FeaturesAPI_ExtrusionBoolean(theFeature)
191 //==================================================================================================
192 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
193 const std::shared_ptr<ModelAPI_Feature>& theFeature,
194 const std::list<ModelHighAPI_Selection>& theBaseObjects,
195 const ModelHighAPI_Double& theSize,
196 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
197 : FeaturesAPI_ExtrusionBoolean(theFeature)
200 fillAttribute(theBaseObjects, mybaseObjects);
201 fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
202 fillAttribute(theSize, mytoSize);
203 fillAttribute(ModelHighAPI_Double(), myfromSize);
204 setBooleanObjects(theBooleanObjects);
208 //==================================================================================================
209 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
210 const std::shared_ptr<ModelAPI_Feature>& theFeature,
211 const std::list<ModelHighAPI_Selection>& theBaseObjects,
212 const ModelHighAPI_Selection& theDirection,
213 const ModelHighAPI_Double& theSize,
214 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
215 : FeaturesAPI_ExtrusionBoolean(theFeature)
218 fillAttribute(theBaseObjects, mybaseObjects);
219 fillAttribute(theDirection, mydirection);
220 fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
221 fillAttribute(theSize, mytoSize);
222 fillAttribute(ModelHighAPI_Double(), myfromSize);
223 setBooleanObjects(theBooleanObjects);
227 //==================================================================================================
228 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
229 const std::shared_ptr<ModelAPI_Feature>& theFeature,
230 const std::list<ModelHighAPI_Selection>& theBaseObjects,
231 const ModelHighAPI_Double& theToSize,
232 const ModelHighAPI_Double& theFromSize,
233 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
234 : FeaturesAPI_ExtrusionBoolean(theFeature)
237 fillAttribute(theBaseObjects, mybaseObjects);
238 fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
239 fillAttribute(theToSize, mytoSize);
240 fillAttribute(theFromSize, myfromSize);
241 setBooleanObjects(theBooleanObjects);
245 //==================================================================================================
246 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
247 const std::shared_ptr<ModelAPI_Feature>& theFeature,
248 const std::list<ModelHighAPI_Selection>& theBaseObjects,
249 const ModelHighAPI_Selection& theDirection,
250 const ModelHighAPI_Double& theToSize,
251 const ModelHighAPI_Double& theFromSize,
252 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
253 : FeaturesAPI_ExtrusionBoolean(theFeature)
256 fillAttribute(theBaseObjects, mybaseObjects);
257 fillAttribute(theDirection, mydirection);
258 fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
259 fillAttribute(theToSize, mytoSize);
260 fillAttribute(theFromSize, myfromSize);
261 setBooleanObjects(theBooleanObjects);
265 //==================================================================================================
266 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
267 const std::shared_ptr<ModelAPI_Feature>& theFeature,
268 const std::list<ModelHighAPI_Selection>& theBaseObjects,
269 const ModelHighAPI_Selection& theToObject,
270 const ModelHighAPI_Double& theToOffset,
271 const ModelHighAPI_Selection& theFromObject,
272 const ModelHighAPI_Double& theFromOffset,
273 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
274 : FeaturesAPI_ExtrusionBoolean(theFeature)
277 fillAttribute(theBaseObjects, mybaseObjects);
278 fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_PLANES(), mycreationMethod);
279 fillAttribute(theToObject, mytoObject);
280 fillAttribute(theToOffset, mytoOffset);
281 fillAttribute(theFromObject, myfromObject);
282 fillAttribute(theFromOffset, myfromOffset);
283 setBooleanObjects(theBooleanObjects);
287 //==================================================================================================
288 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
289 const std::shared_ptr<ModelAPI_Feature>& theFeature,
290 const std::list<ModelHighAPI_Selection>& theBaseObjects,
291 const ModelHighAPI_Selection& theDirection,
292 const ModelHighAPI_Selection& theToObject,
293 const ModelHighAPI_Double& theToOffset,
294 const ModelHighAPI_Selection& theFromObject,
295 const ModelHighAPI_Double& theFromOffset,
296 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
297 : FeaturesAPI_ExtrusionBoolean(theFeature)
300 fillAttribute(theBaseObjects, mybaseObjects);
301 fillAttribute(theDirection, mydirection);
302 fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_PLANES(), mycreationMethod);
303 fillAttribute(theToObject, mytoObject);
304 fillAttribute(theToOffset, mytoOffset);
305 fillAttribute(theFromObject, myfromObject);
306 fillAttribute(theFromOffset, myfromOffset);
307 setBooleanObjects(theBooleanObjects);
311 //==================================================================================================
312 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
313 const std::list<ModelHighAPI_Selection>& theBaseObjects,
314 const ModelHighAPI_Double& theSize,
315 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
317 std::shared_ptr<ModelAPI_Feature> aFeature =
318 thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
319 return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects,
320 theSize, theBooleanObjects));
323 //==================================================================================================
324 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
325 const std::list<ModelHighAPI_Selection>& theBaseObjects,
326 const ModelHighAPI_Selection& theDirection,
327 const ModelHighAPI_Double& theSize,
328 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
330 std::shared_ptr<ModelAPI_Feature> aFeature =
331 thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
332 return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, theDirection,
333 theSize, theBooleanObjects));
336 //==================================================================================================
337 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
338 const std::list<ModelHighAPI_Selection>& theBaseObjects,
339 const ModelHighAPI_Double& theToSize,
340 const ModelHighAPI_Double& theFromSize,
341 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
343 std::shared_ptr<ModelAPI_Feature> aFeature =
344 thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
345 return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects,
346 theToSize, theFromSize, theBooleanObjects));
349 //==================================================================================================
350 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
351 const std::list<ModelHighAPI_Selection>& theBaseObjects,
352 const ModelHighAPI_Selection& theDirection,
353 const ModelHighAPI_Double& theToSize,
354 const ModelHighAPI_Double& theFromSize,
355 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
357 std::shared_ptr<ModelAPI_Feature> aFeature =
358 thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
359 return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature,
367 //==================================================================================================
368 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
369 const std::list<ModelHighAPI_Selection>& theBaseObjects,
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)
376 std::shared_ptr<ModelAPI_Feature> aFeature =
377 thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
378 return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature,
387 //==================================================================================================
388 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
389 const std::list<ModelHighAPI_Selection>& theBaseObjects,
390 const ModelHighAPI_Selection& theDirection,
391 const ModelHighAPI_Selection& theToObject,
392 const ModelHighAPI_Double& theToOffset,
393 const ModelHighAPI_Selection& theFromObject,
394 const ModelHighAPI_Double& theFromOffset,
395 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
397 std::shared_ptr<ModelAPI_Feature> aFeature =
398 thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
399 return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature,
410 //==================================================================================================
411 FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
412 const std::shared_ptr<ModelAPI_Feature>& theFeature)
413 : FeaturesAPI_ExtrusionBoolean(theFeature)
418 //==================================================================================================
419 FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
420 const std::shared_ptr<ModelAPI_Feature>& theFeature,
421 const std::list<ModelHighAPI_Selection>& theBaseObjects,
422 const ModelHighAPI_Double& theSize,
423 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
424 : FeaturesAPI_ExtrusionBoolean(theFeature)
427 fillAttribute(theBaseObjects, mybaseObjects);
428 fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
429 fillAttribute(theSize, mytoSize);
430 fillAttribute(ModelHighAPI_Double(), myfromSize);
431 setBooleanObjects(theBooleanObjects);
435 //==================================================================================================
436 FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
437 const std::shared_ptr<ModelAPI_Feature>& theFeature,
438 const std::list<ModelHighAPI_Selection>& theBaseObjects,
439 const ModelHighAPI_Selection& theDirection,
440 const ModelHighAPI_Double& theSize,
441 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
442 : FeaturesAPI_ExtrusionBoolean(theFeature)
445 fillAttribute(theBaseObjects, mybaseObjects);
446 fillAttribute(theDirection, mydirection);
447 fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
448 fillAttribute(theSize, mytoSize);
449 fillAttribute(ModelHighAPI_Double(), myfromSize);
450 setBooleanObjects(theBooleanObjects);
454 //==================================================================================================
455 FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
456 const std::shared_ptr<ModelAPI_Feature>& theFeature,
457 const std::list<ModelHighAPI_Selection>& theBaseObjects,
458 const ModelHighAPI_Double& theToSize,
459 const ModelHighAPI_Double& theFromSize,
460 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
461 : FeaturesAPI_ExtrusionBoolean(theFeature)
464 fillAttribute(theBaseObjects, mybaseObjects);
465 fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
466 fillAttribute(theToSize, mytoSize);
467 fillAttribute(theFromSize, myfromSize);
468 setBooleanObjects(theBooleanObjects);
472 //==================================================================================================
473 FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
474 const std::shared_ptr<ModelAPI_Feature>& theFeature,
475 const std::list<ModelHighAPI_Selection>& theBaseObjects,
476 const ModelHighAPI_Selection& theDirection,
477 const ModelHighAPI_Double& theToSize,
478 const ModelHighAPI_Double& theFromSize,
479 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
480 : FeaturesAPI_ExtrusionBoolean(theFeature)
483 fillAttribute(theBaseObjects, mybaseObjects);
484 fillAttribute(theDirection, mydirection);
485 fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
486 fillAttribute(theToSize, mytoSize);
487 fillAttribute(theFromSize, myfromSize);
488 setBooleanObjects(theBooleanObjects);
492 //==================================================================================================
493 FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
494 const std::shared_ptr<ModelAPI_Feature>& theFeature,
495 const std::list<ModelHighAPI_Selection>& theBaseObjects,
496 const ModelHighAPI_Selection& theToObject,
497 const ModelHighAPI_Double& theToOffset,
498 const ModelHighAPI_Selection& theFromObject,
499 const ModelHighAPI_Double& theFromOffset,
500 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
501 : FeaturesAPI_ExtrusionBoolean(theFeature)
504 fillAttribute(theBaseObjects, mybaseObjects);
505 fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_PLANES(), mycreationMethod);
506 fillAttribute(theToObject, mytoObject);
507 fillAttribute(theToOffset, mytoOffset);
508 fillAttribute(theFromObject, myfromObject);
509 fillAttribute(theFromOffset, myfromOffset);
510 setBooleanObjects(theBooleanObjects);
514 //==================================================================================================
515 FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
516 const std::shared_ptr<ModelAPI_Feature>& theFeature,
517 const std::list<ModelHighAPI_Selection>& theBaseObjects,
518 const ModelHighAPI_Selection& theDirection,
519 const ModelHighAPI_Selection& theToObject,
520 const ModelHighAPI_Double& theToOffset,
521 const ModelHighAPI_Selection& theFromObject,
522 const ModelHighAPI_Double& theFromOffset,
523 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
524 : FeaturesAPI_ExtrusionBoolean(theFeature)
527 fillAttribute(theBaseObjects, mybaseObjects);
528 fillAttribute(theDirection, mydirection);
529 fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_PLANES(), mycreationMethod);
530 fillAttribute(theToObject, mytoObject);
531 fillAttribute(theToOffset, mytoOffset);
532 fillAttribute(theFromObject, myfromObject);
533 fillAttribute(theFromOffset, myfromOffset);
534 setBooleanObjects(theBooleanObjects);
538 //==================================================================================================
539 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
540 const std::list<ModelHighAPI_Selection>& theBaseObjects,
541 const ModelHighAPI_Double& theSize,
542 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
544 std::shared_ptr<ModelAPI_Feature> aFeature =
545 thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
546 return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects,
547 theSize, theBooleanObjects));
550 //==================================================================================================
551 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
552 const std::list<ModelHighAPI_Selection>& theBaseObjects,
553 const ModelHighAPI_Selection& theDirection,
554 const ModelHighAPI_Double& theSize,
555 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
557 std::shared_ptr<ModelAPI_Feature> aFeature =
558 thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
559 return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects,
560 theDirection, theSize, theBooleanObjects));
563 //==================================================================================================
564 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
565 const std::list<ModelHighAPI_Selection>& theBaseObjects,
566 const ModelHighAPI_Double& theToSize,
567 const ModelHighAPI_Double& theFromSize,
568 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
570 std::shared_ptr<ModelAPI_Feature> aFeature =
571 thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
572 return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects,
573 theToSize, theFromSize, theBooleanObjects));
576 //==================================================================================================
577 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
578 const std::list<ModelHighAPI_Selection>& theBaseObjects,
579 const ModelHighAPI_Selection& theDirection,
580 const ModelHighAPI_Double& theToSize,
581 const ModelHighAPI_Double& theFromSize,
582 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
584 std::shared_ptr<ModelAPI_Feature> aFeature =
585 thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
586 return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature,
594 //==================================================================================================
595 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
596 const std::list<ModelHighAPI_Selection>& theBaseObjects,
597 const ModelHighAPI_Selection& theToObject,
598 const ModelHighAPI_Double& theToOffset,
599 const ModelHighAPI_Selection& theFromObject,
600 const ModelHighAPI_Double& theFromOffset,
601 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
603 std::shared_ptr<ModelAPI_Feature> aFeature =
604 thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
605 return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature,
614 //==================================================================================================
615 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
616 const std::list<ModelHighAPI_Selection>& theBaseObjects,
617 const ModelHighAPI_Selection& theDirection,
618 const ModelHighAPI_Selection& theToObject,
619 const ModelHighAPI_Double& theToOffset,
620 const ModelHighAPI_Selection& theFromObject,
621 const ModelHighAPI_Double& theFromOffset,
622 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
624 std::shared_ptr<ModelAPI_Feature> aFeature =
625 thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
626 return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature,