From: dbv Date: Fri, 4 Sep 2015 06:52:27 +0000 (+0300) Subject: Added sketch attribute selection for composite features X-Git-Tag: V_1.4.0_beta4~128^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ec9b85c536b6f28dde7433128827a11f07d3e956;p=modules%2Fshaper.git Added sketch attribute selection for composite features --- diff --git a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp index 147efefd8..14a4c19d7 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include #include @@ -28,6 +30,9 @@ void FeaturesPlugin_CompositeBoolean::initAttributes() aSelection->setSelectionType("SOLID"); initMakeSolidsAttributes(); + + data()->addAttribute(SKETCH_SELECTION_ID(), ModelAPI_AttributeSelection::typeId()); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), SKETCH_SELECTION_ID()); } //================================================================================================= @@ -111,6 +116,7 @@ void FeaturesPlugin_CompositeBoolean::execute() if(!aConstruction.get()) { return; } + selection(SKETCH_SELECTION_ID())->setValue(aSketchRes, std::shared_ptr()); int aSketchFacesNum = aConstruction->facesNum(); if(aSketchFacesNum == 0) { return; diff --git a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.h b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.h index d5ce37c38..4150d3af6 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.h +++ b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.h @@ -26,6 +26,13 @@ class FeaturesPlugin_CompositeBoolean : public ModelAPI_CompositeFeature return MY_SKETCH_OBJECT_ID; } + /// Attribute name of sketch feature. + inline static const std::string& SKETCH_SELECTION_ID() + { + static const std::string MY_SKETCH_SELECTION_ID("sketch_selection"); + return MY_SKETCH_SELECTION_ID; + } + /// Attribute name of objects for boolean operation. inline static const std::string& BOOLEAN_OBJECTS_ID() {