From 2bd75ff9fbc3078bb9a8474a823e10fe12268257 Mon Sep 17 00:00:00 2001 From: Alexey Kondratyev Date: Mon, 11 Oct 2021 10:44:06 +0300 Subject: [PATCH] [bos #26444] [EDF] (2021) SHAPER: Improve treatment of parameters Update double-click function to change a parameter. --- src/ParametersPlugin/doc/managerFeature.rst | 2 ++ src/PartSet/PartSet_Module.cpp | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/ParametersPlugin/doc/managerFeature.rst b/src/ParametersPlugin/doc/managerFeature.rst index d0704d97b..8d4c5eb50 100644 --- a/src/ParametersPlugin/doc/managerFeature.rst +++ b/src/ParametersPlugin/doc/managerFeature.rst @@ -20,6 +20,8 @@ The following dialog box with parameter table appears: .. |param_up| image:: images/parameters_up.png .. |param_down| image:: images/parameters_down.png +To edit a parameter, double-click on parameter in object browser. + **Input fields**: - **Name** defines parameter name. Name follows the naming rules of the python language for variables; diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index a3095a374..c648cc072 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -83,6 +83,7 @@ #include #include #include +#include #include #include @@ -1739,6 +1740,25 @@ void PartSet_Module::onTreeViewDoubleClick(const QModelIndex& theIndex) if (aPartFeature.get() && (aPartFeature->getKind() == PartSetPlugin_Part::ID())) { aPart = std::dynamic_pointer_cast(aPartFeature->firstResult()); } + if (aObj.get()) + { + if (!aPart.get() && aObj->groupName() == ModelAPI_ResultParameter::group()) + { + QObjectPtrList aObjects = aWorkshop->objectBrowser()->selectedObjects(); + FeaturePtr aFeature; + ResultParameterPtr aParam; + foreach(ObjectPtr aObj, aObjects) { + aParam = std::dynamic_pointer_cast(aObj); + if (aParam.get()) + break; + } + if (aParam.get()) + aFeature = ModelAPI_Feature::feature(aParam); + + if (aFeature.get()) + editFeature(aFeature); + } + } } if (aPart.get()) { // if this is a part if (aPart->partDoc() == aMgr->activeDocument()) { -- 2.39.2