1 // Copyright (C) 2014-2019 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 email : webmaster.salome@opencascade.com
20 #include "FeaturesAPI_ExtrusionBoolean.h"
22 #include <ModelHighAPI_Double.h>
23 #include <ModelHighAPI_Dumper.h>
24 #include <ModelHighAPI_Reference.h>
25 #include <ModelHighAPI_Tools.h>
27 //==================================================================================================
28 FeaturesAPI_ExtrusionBoolean::FeaturesAPI_ExtrusionBoolean(
29 const std::shared_ptr<ModelAPI_Feature>& theFeature)
30 : ModelHighAPI_Interface(theFeature)
34 //==================================================================================================
35 FeaturesAPI_ExtrusionBoolean::~FeaturesAPI_ExtrusionBoolean()
39 //==================================================================================================
40 void FeaturesAPI_ExtrusionBoolean::setNestedSketch(const ModelHighAPI_Reference& theSketch)
42 mysketch->setValue(theSketch.feature());
44 // To make Sketch feature execute and subfeatures execute.
45 feature()->document()->setCurrentFeature(feature(), false);
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);
53 mybaseObjects->clear();
54 mybaseObjects->append(theSketch.feature()->firstResult(), GeomShapePtr());
59 //==================================================================================================
60 void FeaturesAPI_ExtrusionBoolean::setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects)
62 mysketch->setValue(ObjectPtr());
63 mybaseObjects->clear();
64 fillAttribute(theBaseObjects, mybaseObjects);
69 //==================================================================================================
70 void FeaturesAPI_ExtrusionBoolean::setDirection(const ModelHighAPI_Selection& theDirection)
72 fillAttribute(theDirection, mydirection);
77 //==================================================================================================
78 void FeaturesAPI_ExtrusionBoolean::setSizes(const ModelHighAPI_Double& theToSize,
79 const ModelHighAPI_Double& theFromSize)
81 fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
82 fillAttribute(theToSize, mytoSize);
83 fillAttribute(theFromSize, myfromSize);
88 //==================================================================================================
89 void FeaturesAPI_ExtrusionBoolean::setSize(const ModelHighAPI_Double& theSize)
91 setSizes(theSize, ModelHighAPI_Double());
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)
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);
106 execIfBaseNotEmpty();
109 //==================================================================================================
110 void FeaturesAPI_ExtrusionBoolean::setBooleanObjects(
111 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
113 fillAttribute(theBooleanObjects, mybooleanObjects);
115 execIfBaseNotEmpty();
118 //==================================================================================================
119 void FeaturesAPI_ExtrusionBoolean::dump(ModelHighAPI_Dumper& theDumper) const
121 FeaturePtr aBase = feature();
122 const std::string& aDocName = theDumper.name(aBase->document());
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());
130 theDumper << aBase << " = model.addExtrusion";
131 if(aBase->getKind() == FeaturesPlugin_ExtrusionCut::ID()) {
133 } else if(aBase->getKind() == FeaturesPlugin_ExtrusionFuse::ID()) {
136 theDumper << "(" << aDocName << ", ";
137 anAttrSketch->isInitialized() ? theDumper << "[]" : theDumper << anAttrObjects;
138 theDumper << ", " << anAttrDirection;
140 std::string aCreationMethod =
141 aBase->string(FeaturesPlugin_Extrusion::CREATION_METHOD())->value();
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());
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());
156 theDumper << ", " << anAttrToObject << ", " << anAttrToOffset <<
157 ", " << anAttrFromObject << ", " << anAttrFromOffset;
162 AttributeSelectionListPtr anAttrBoolObjects =
163 aBase->selectionList(FeaturesPlugin_CompositeBoolean::OBJECTS_ID());
164 theDumper << ", " << anAttrBoolObjects << ")" << std::endl;
166 if(anAttrSketch->isInitialized()) {
167 theDumper << aBase << ".setNestedSketch(" << anAttrSketch << ")" << std::endl;
171 //==================================================================================================
172 void FeaturesAPI_ExtrusionBoolean::execIfBaseNotEmpty()
174 if(mybaseObjects->size() > 0) {
180 //==================================================================================================
181 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
182 const std::shared_ptr<ModelAPI_Feature>& theFeature)
183 : FeaturesAPI_ExtrusionBoolean(theFeature)
188 //==================================================================================================
189 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
190 const std::shared_ptr<ModelAPI_Feature>& theFeature,
191 const std::list<ModelHighAPI_Selection>& theBaseObjects,
192 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
193 : FeaturesAPI_ExtrusionBoolean(theFeature)
196 fillAttribute(theBaseObjects, mybaseObjects);
197 fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_THROUGH_ALL(), mycreationMethod);
198 setBooleanObjects(theBooleanObjects);
202 //==================================================================================================
203 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
204 const std::shared_ptr<ModelAPI_Feature>& theFeature,
205 const std::list<ModelHighAPI_Selection>& theBaseObjects,
206 const ModelHighAPI_Double& theSize,
207 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
208 : FeaturesAPI_ExtrusionBoolean(theFeature)
211 fillAttribute(theBaseObjects, mybaseObjects);
213 setBooleanObjects(theBooleanObjects);
217 //==================================================================================================
218 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
219 const std::shared_ptr<ModelAPI_Feature>& theFeature,
220 const std::list<ModelHighAPI_Selection>& theBaseObjects,
221 const ModelHighAPI_Selection& theDirection,
222 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
223 : FeaturesAPI_ExtrusionBoolean(theFeature)
226 fillAttribute(theBaseObjects, mybaseObjects);
227 fillAttribute(theDirection, mydirection);
228 fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_THROUGH_ALL(), mycreationMethod);
229 setBooleanObjects(theBooleanObjects);
233 //==================================================================================================
234 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
235 const std::shared_ptr<ModelAPI_Feature>& theFeature,
236 const std::list<ModelHighAPI_Selection>& theBaseObjects,
237 const ModelHighAPI_Selection& theDirection,
238 const ModelHighAPI_Double& theSize,
239 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
240 : FeaturesAPI_ExtrusionBoolean(theFeature)
243 fillAttribute(theBaseObjects, mybaseObjects);
244 fillAttribute(theDirection, mydirection);
246 setBooleanObjects(theBooleanObjects);
250 //==================================================================================================
251 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
252 const std::shared_ptr<ModelAPI_Feature>& theFeature,
253 const std::list<ModelHighAPI_Selection>& theBaseObjects,
254 const ModelHighAPI_Double& theToSize,
255 const ModelHighAPI_Double& theFromSize,
256 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
257 : FeaturesAPI_ExtrusionBoolean(theFeature)
260 fillAttribute(theBaseObjects, mybaseObjects);
261 setSizes(theToSize, theFromSize);
262 setBooleanObjects(theBooleanObjects);
266 //==================================================================================================
267 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
268 const std::shared_ptr<ModelAPI_Feature>& theFeature,
269 const std::list<ModelHighAPI_Selection>& theBaseObjects,
270 const ModelHighAPI_Selection& theDirection,
271 const ModelHighAPI_Double& theToSize,
272 const ModelHighAPI_Double& theFromSize,
273 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
274 : FeaturesAPI_ExtrusionBoolean(theFeature)
277 fillAttribute(theBaseObjects, mybaseObjects);
278 fillAttribute(theDirection, mydirection);
279 setSizes(theToSize, theFromSize);
280 setBooleanObjects(theBooleanObjects);
284 //==================================================================================================
285 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
286 const std::shared_ptr<ModelAPI_Feature>& theFeature,
287 const std::list<ModelHighAPI_Selection>& theBaseObjects,
288 const ModelHighAPI_Selection& theToObject,
289 const ModelHighAPI_Double& theToOffset,
290 const ModelHighAPI_Selection& theFromObject,
291 const ModelHighAPI_Double& theFromOffset,
292 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
293 : FeaturesAPI_ExtrusionBoolean(theFeature)
296 fillAttribute(theBaseObjects, mybaseObjects);
297 setPlanesAndOffsets(theToObject, theToOffset, theFromObject, theFromOffset);
298 setBooleanObjects(theBooleanObjects);
302 //==================================================================================================
303 FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
304 const std::shared_ptr<ModelAPI_Feature>& theFeature,
305 const std::list<ModelHighAPI_Selection>& theBaseObjects,
306 const ModelHighAPI_Selection& theDirection,
307 const ModelHighAPI_Selection& theToObject,
308 const ModelHighAPI_Double& theToOffset,
309 const ModelHighAPI_Selection& theFromObject,
310 const ModelHighAPI_Double& theFromOffset,
311 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
312 : FeaturesAPI_ExtrusionBoolean(theFeature)
315 fillAttribute(theBaseObjects, mybaseObjects);
316 fillAttribute(theDirection, mydirection);
317 setPlanesAndOffsets(theToObject, theToOffset, theFromObject, theFromOffset);
318 setBooleanObjects(theBooleanObjects);
322 //==================================================================================================
323 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
324 const std::list<ModelHighAPI_Selection>& theBaseObjects,
325 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
327 std::shared_ptr<ModelAPI_Feature> aFeature =
328 thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
329 return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects,
333 //==================================================================================================
334 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
335 const std::list<ModelHighAPI_Selection>& theBaseObjects,
336 const ModelHighAPI_Double& theSize,
337 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
339 std::shared_ptr<ModelAPI_Feature> aFeature =
340 thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
341 return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects,
342 theSize, theBooleanObjects));
345 //==================================================================================================
346 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
347 const std::list<ModelHighAPI_Selection>& theBaseObjects,
348 const ModelHighAPI_Selection& theDirection,
349 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
351 std::shared_ptr<ModelAPI_Feature> aFeature =
352 thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
353 return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, theDirection,
357 //==================================================================================================
358 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
359 const std::list<ModelHighAPI_Selection>& theBaseObjects,
360 const ModelHighAPI_Selection& theDirection,
361 const ModelHighAPI_Double& theSize,
362 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
364 std::shared_ptr<ModelAPI_Feature> aFeature =
365 thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
366 return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, theDirection,
367 theSize, theBooleanObjects));
370 //==================================================================================================
371 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
372 const std::list<ModelHighAPI_Selection>& theBaseObjects,
373 const ModelHighAPI_Double& theToSize,
374 const ModelHighAPI_Double& theFromSize,
375 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
377 std::shared_ptr<ModelAPI_Feature> aFeature =
378 thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
379 return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects,
380 theToSize, theFromSize, theBooleanObjects));
383 //==================================================================================================
384 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
385 const std::list<ModelHighAPI_Selection>& theBaseObjects,
386 const ModelHighAPI_Selection& theDirection,
387 const ModelHighAPI_Double& theToSize,
388 const ModelHighAPI_Double& theFromSize,
389 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
391 std::shared_ptr<ModelAPI_Feature> aFeature =
392 thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
393 return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature,
401 //==================================================================================================
402 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
403 const std::list<ModelHighAPI_Selection>& theBaseObjects,
404 const ModelHighAPI_Selection& theToObject,
405 const ModelHighAPI_Double& theToOffset,
406 const ModelHighAPI_Selection& theFromObject,
407 const ModelHighAPI_Double& theFromOffset,
408 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
410 std::shared_ptr<ModelAPI_Feature> aFeature =
411 thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
412 return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature,
421 //==================================================================================================
422 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
423 const std::list<ModelHighAPI_Selection>& theBaseObjects,
424 const ModelHighAPI_Selection& theDirection,
425 const ModelHighAPI_Selection& theToObject,
426 const ModelHighAPI_Double& theToOffset,
427 const ModelHighAPI_Selection& theFromObject,
428 const ModelHighAPI_Double& theFromOffset,
429 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
431 std::shared_ptr<ModelAPI_Feature> aFeature =
432 thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
433 return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature,
444 //==================================================================================================
445 FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
446 const std::shared_ptr<ModelAPI_Feature>& theFeature)
447 : FeaturesAPI_ExtrusionBoolean(theFeature)
452 //==================================================================================================
453 FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
454 const std::shared_ptr<ModelAPI_Feature>& theFeature,
455 const std::list<ModelHighAPI_Selection>& theBaseObjects,
456 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
457 : FeaturesAPI_ExtrusionBoolean(theFeature)
460 fillAttribute(theBaseObjects, mybaseObjects);
461 fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_THROUGH_ALL(), mycreationMethod);
462 setBooleanObjects(theBooleanObjects);
466 //==================================================================================================
467 FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
468 const std::shared_ptr<ModelAPI_Feature>& theFeature,
469 const std::list<ModelHighAPI_Selection>& theBaseObjects,
470 const ModelHighAPI_Double& theSize,
471 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
472 : FeaturesAPI_ExtrusionBoolean(theFeature)
475 fillAttribute(theBaseObjects, mybaseObjects);
477 setBooleanObjects(theBooleanObjects);
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 std::list<ModelHighAPI_Selection>& theBooleanObjects)
487 : FeaturesAPI_ExtrusionBoolean(theFeature)
490 fillAttribute(theBaseObjects, mybaseObjects);
491 fillAttribute(theDirection, mydirection);
492 fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_THROUGH_ALL(), mycreationMethod);
493 setBooleanObjects(theBooleanObjects);
497 //==================================================================================================
498 FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
499 const std::shared_ptr<ModelAPI_Feature>& theFeature,
500 const std::list<ModelHighAPI_Selection>& theBaseObjects,
501 const ModelHighAPI_Selection& theDirection,
502 const ModelHighAPI_Double& theSize,
503 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
504 : FeaturesAPI_ExtrusionBoolean(theFeature)
507 fillAttribute(theBaseObjects, mybaseObjects);
508 fillAttribute(theDirection, mydirection);
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_Double& theToSize,
519 const ModelHighAPI_Double& theFromSize,
520 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
521 : FeaturesAPI_ExtrusionBoolean(theFeature)
524 fillAttribute(theBaseObjects, mybaseObjects);
525 setSizes(theToSize, theFromSize);
526 setBooleanObjects(theBooleanObjects);
530 //==================================================================================================
531 FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
532 const std::shared_ptr<ModelAPI_Feature>& theFeature,
533 const std::list<ModelHighAPI_Selection>& theBaseObjects,
534 const ModelHighAPI_Selection& theDirection,
535 const ModelHighAPI_Double& theToSize,
536 const ModelHighAPI_Double& theFromSize,
537 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
538 : FeaturesAPI_ExtrusionBoolean(theFeature)
541 fillAttribute(theBaseObjects, mybaseObjects);
542 fillAttribute(theDirection, mydirection);
543 setSizes(theToSize, theFromSize);
544 setBooleanObjects(theBooleanObjects);
548 //==================================================================================================
549 FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
550 const std::shared_ptr<ModelAPI_Feature>& theFeature,
551 const std::list<ModelHighAPI_Selection>& theBaseObjects,
552 const ModelHighAPI_Selection& theToObject,
553 const ModelHighAPI_Double& theToOffset,
554 const ModelHighAPI_Selection& theFromObject,
555 const ModelHighAPI_Double& theFromOffset,
556 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
557 : FeaturesAPI_ExtrusionBoolean(theFeature)
560 fillAttribute(theBaseObjects, mybaseObjects);
561 setPlanesAndOffsets(theToObject, theToOffset, theFromObject, theFromOffset);
562 setBooleanObjects(theBooleanObjects);
566 //==================================================================================================
567 FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
568 const std::shared_ptr<ModelAPI_Feature>& theFeature,
569 const std::list<ModelHighAPI_Selection>& theBaseObjects,
570 const ModelHighAPI_Selection& theDirection,
571 const ModelHighAPI_Selection& theToObject,
572 const ModelHighAPI_Double& theToOffset,
573 const ModelHighAPI_Selection& theFromObject,
574 const ModelHighAPI_Double& theFromOffset,
575 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
576 : FeaturesAPI_ExtrusionBoolean(theFeature)
579 fillAttribute(theBaseObjects, mybaseObjects);
580 fillAttribute(theDirection, mydirection);
581 setPlanesAndOffsets(theToObject, theToOffset, theFromObject, theFromOffset);
582 setBooleanObjects(theBooleanObjects);
586 //==================================================================================================
587 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
588 const std::list<ModelHighAPI_Selection>& theBaseObjects,
589 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
591 std::shared_ptr<ModelAPI_Feature> aFeature =
592 thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
593 return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects,
597 //==================================================================================================
598 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
599 const std::list<ModelHighAPI_Selection>& theBaseObjects,
600 const ModelHighAPI_Double& theSize,
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, theBaseObjects,
606 theSize, theBooleanObjects));
609 //==================================================================================================
610 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
611 const std::list<ModelHighAPI_Selection>& theBaseObjects,
612 const ModelHighAPI_Selection& theDirection,
613 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
615 std::shared_ptr<ModelAPI_Feature> aFeature =
616 thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
617 return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects,
618 theDirection, theBooleanObjects));
621 //==================================================================================================
622 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
623 const std::list<ModelHighAPI_Selection>& theBaseObjects,
624 const ModelHighAPI_Selection& theDirection,
625 const ModelHighAPI_Double& theSize,
626 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
628 std::shared_ptr<ModelAPI_Feature> aFeature =
629 thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
630 return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects,
631 theDirection, theSize, theBooleanObjects));
634 //==================================================================================================
635 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
636 const std::list<ModelHighAPI_Selection>& theBaseObjects,
637 const ModelHighAPI_Double& theToSize,
638 const ModelHighAPI_Double& theFromSize,
639 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
641 std::shared_ptr<ModelAPI_Feature> aFeature =
642 thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
643 return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects,
644 theToSize, theFromSize, theBooleanObjects));
647 //==================================================================================================
648 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
649 const std::list<ModelHighAPI_Selection>& theBaseObjects,
650 const ModelHighAPI_Selection& theDirection,
651 const ModelHighAPI_Double& theToSize,
652 const ModelHighAPI_Double& theFromSize,
653 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
655 std::shared_ptr<ModelAPI_Feature> aFeature =
656 thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
657 return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature,
665 //==================================================================================================
666 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
667 const std::list<ModelHighAPI_Selection>& theBaseObjects,
668 const ModelHighAPI_Selection& theToObject,
669 const ModelHighAPI_Double& theToOffset,
670 const ModelHighAPI_Selection& theFromObject,
671 const ModelHighAPI_Double& theFromOffset,
672 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
674 std::shared_ptr<ModelAPI_Feature> aFeature =
675 thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
676 return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature,
685 //==================================================================================================
686 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
687 const std::list<ModelHighAPI_Selection>& theBaseObjects,
688 const ModelHighAPI_Selection& theDirection,
689 const ModelHighAPI_Selection& theToObject,
690 const ModelHighAPI_Double& theToOffset,
691 const ModelHighAPI_Selection& theFromObject,
692 const ModelHighAPI_Double& theFromOffset,
693 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
695 std::shared_ptr<ModelAPI_Feature> aFeature =
696 thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
697 return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature,