From: vsv Date: Wed, 24 Jun 2020 17:46:05 +0000 (+0300) Subject: Issue #3236: Add buttons for shape type choice X-Git-Tag: V9_6_0a1~60^2~43 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7144e51cb8c2806269b1aff754d73e4e44e104b9;p=modules%2Fshaper.git Issue #3236: Add buttons for shape type choice --- diff --git a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp index 57b1ba874..6ae36c31a 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -57,6 +58,8 @@ void FeaturesPlugin_Extrusion::initAttributes() data()->addAttribute(DIRECTION_OBJECT_ID(), ModelAPI_AttributeSelection::typeId()); + data()->addAttribute(USE_SHAPES_ID(), ModelAPI_AttributeInteger::typeId()); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), TO_OBJECT_ID()); ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), FROM_OBJECT_ID()); ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), DIRECTION_OBJECT_ID()); diff --git a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.h b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.h index 1f657b30a..91a30f16d 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.h +++ b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.h @@ -123,6 +123,13 @@ public: return MY_FROM_OFFSET_ID; } + /// Attribute name of using shape types. + inline static const std::string& USE_SHAPES_ID() + { + static const std::string MY_USE_SHAPEST_ID("use_sapes"); + return MY_USE_SHAPEST_ID; + } + /// \return the kind of a feature. FEATURESPLUGIN_EXPORT virtual const std::string& getKind() { diff --git a/src/FeaturesPlugin/extrusion_widget.xml b/src/FeaturesPlugin/extrusion_widget.xml index 85ca64d71..7d833c095 100644 --- a/src/FeaturesPlugin/extrusion_widget.xml +++ b/src/FeaturesPlugin/extrusion_widget.xml @@ -8,6 +8,15 @@ shape_types="vertices edges wires faces shells solids compsolids compounds"> + + propertyPanel(); const QList& aWidgets = aPanel->modelWidgets(); foreach(ModuleBase_ModelWidget* aWidget, aWidgets) { + QString aType(aWidget->metaObject()->className()); + if (aType == "ModuleBase_WidgetChoice") + continue; if (theSelectionControl) { // hide other controls if (aWidget != this) aWidget->setVisible(false);