X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesAPI%2FFeaturesAPI_BooleanFuse.cpp;h=6d837663c87152033b91e77626d9f3ee00aa82c0;hb=6b48364b1da91a4958ce92d392e8bc49a3cbd7a2;hp=c1a043d6746f0eadb7dc34e3b82c2d98cb074352;hpb=50cef8966d30d658565b08428b4b313f3449d23c;p=modules%2Fshaper.git diff --git a/src/FeaturesAPI/FeaturesAPI_BooleanFuse.cpp b/src/FeaturesAPI/FeaturesAPI_BooleanFuse.cpp index c1a043d67..6d837663c 100644 --- a/src/FeaturesAPI/FeaturesAPI_BooleanFuse.cpp +++ b/src/FeaturesAPI/FeaturesAPI_BooleanFuse.cpp @@ -36,12 +36,31 @@ FeaturesAPI_BooleanFuse::FeaturesAPI_BooleanFuse( FeaturesAPI_BooleanFuse::FeaturesAPI_BooleanFuse( const std::shared_ptr& theFeature, const std::list& theMainObjects, - const std::list& theToolObjects) + const bool theRemoveEdges) + : ModelHighAPI_Interface(theFeature) +{ + if (initialize()) { + fillAttribute(FeaturesPlugin_BooleanFuse::CREATION_METHOD_SIMPLE(), mycreationMethod); + fillAttribute(theMainObjects, mymainObjects); + fillAttribute(theRemoveEdges, myremoveEdges); + + execute(false); + } +} + +//================================================================================================== +FeaturesAPI_BooleanFuse::FeaturesAPI_BooleanFuse( + const std::shared_ptr& theFeature, + const std::list& theMainObjects, + const std::list& theToolObjects, + const bool theRemoveEdges) : ModelHighAPI_Interface(theFeature) { if(initialize()) { + fillAttribute(FeaturesPlugin_BooleanFuse::CREATION_METHOD_ADVANCED(), mycreationMethod); fillAttribute(theMainObjects, mymainObjects); fillAttribute(theToolObjects, mytoolObjects); + fillAttribute(theRemoveEdges, myremoveEdges); execute(false); } @@ -66,11 +85,32 @@ void FeaturesAPI_BooleanFuse::setMainObjects( void FeaturesAPI_BooleanFuse::setToolObjects( const std::list& theToolObjects) { + fillAttribute(FeaturesPlugin_BooleanFuse::CREATION_METHOD_ADVANCED(), mycreationMethod); fillAttribute(theToolObjects, mytoolObjects); execute(); } +//================================================================================================== +void FeaturesAPI_BooleanFuse::setRemoveEdges(const bool theRemoveEdges) +{ + fillAttribute(theRemoveEdges, myremoveEdges); + + execute(); +} + +//================================================================================================== +void FeaturesAPI_BooleanFuse::setAdvancedMode(const bool theMode) +{ + if (theMode) { + fillAttribute(FeaturesPlugin_BooleanFuse::CREATION_METHOD_ADVANCED(), mycreationMethod); + } else { + fillAttribute(FeaturesPlugin_BooleanFuse::CREATION_METHOD_SIMPLE(), mycreationMethod); + } + + execute(); +} + //================================================================================================== void FeaturesAPI_BooleanFuse::dump(ModelHighAPI_Dumper& theDumper) const { @@ -79,32 +119,47 @@ void FeaturesAPI_BooleanFuse::dump(ModelHighAPI_Dumper& theDumper) const theDumper << aBase << " = model.addFuse"; const std::string& aDocName = theDumper.name(aBase->document()); + AttributeStringPtr aMode = aBase->string(FeaturesPlugin_BooleanFuse::CREATION_METHOD()); AttributeSelectionListPtr anObjects = aBase->selectionList(FeaturesPlugin_BooleanFuse::OBJECT_LIST_ID()); AttributeSelectionListPtr aTools = aBase->selectionList(FeaturesPlugin_BooleanFuse::TOOL_LIST_ID()); + AttributeBooleanPtr aRemoveEdges = + aBase->boolean(FeaturesPlugin_BooleanFuse::REMOVE_INTERSECTION_EDGES_ID()); + + theDumper << "(" << aDocName << ", " << anObjects; + + if (aMode->value() == FeaturesPlugin_BooleanFuse::CREATION_METHOD_ADVANCED()) { + theDumper << ", " << aTools; + } + + if (aRemoveEdges->value()) { + theDumper << ", " << true; + } - theDumper << "(" << aDocName << ", " << anObjects << ", " << aTools << ")" << std::endl; + theDumper << ")" << std::endl; } //================================================================================================== BooleanFusePtr addFuse(const std::shared_ptr& thePart, - const std::list& theObjects) + const std::list& theObjects, + const bool theRemoveEdges) { std::shared_ptr aFeature = thePart->addFeature(FeaturesAPI_BooleanFuse::ID()); - std::list aToolObjects; return BooleanFusePtr(new FeaturesAPI_BooleanFuse(aFeature, theObjects, - aToolObjects)); + theRemoveEdges)); } //================================================================================================== BooleanFusePtr addFuse(const std::shared_ptr& thePart, const std::list& theMainObjects, - const std::list& theToolObjects) + const std::list& theToolObjects, + const bool theRemoveEdges) { std::shared_ptr aFeature = thePart->addFeature(FeaturesAPI_BooleanFuse::ID()); return BooleanFusePtr(new FeaturesAPI_BooleanFuse(aFeature, theMainObjects, - theToolObjects)); + theToolObjects, + theRemoveEdges)); }