]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
[bos #26444] [EDF] (2021) SHAPER: Improve treatment of parameters
authorAlexey Kondratyev <alexey.kondratyev@opencascade.com>
Mon, 11 Oct 2021 07:44:06 +0000 (10:44 +0300)
committerAlexey Kondratyev <alexey.kondratyev@opencascade.com>
Fri, 29 Oct 2021 06:46:00 +0000 (09:46 +0300)
Update double-click function to change a parameter.

src/ParametersPlugin/doc/managerFeature.rst
src/PartSet/PartSet_Module.cpp

index d0704d97bbbacf6c8be31e4e59e716e934ef2cad..8d4c5eb501c5d6e3669ca8fd8e91b6d56a0a52aa 100644 (file)
@@ -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;
index a3095a374c5735baed2d52c0136cd790d74e6518..c648cc072f2dc444cb8f3bc612a6d35ef0bc995f 100644 (file)
@@ -83,6 +83,7 @@
 #include <ModelAPI_ResultConstruction.h>
 #include <ModelAPI_AttributeIntArray.h>
 #include <ModelAPI_ResultGroup.h>
+#include <ModelAPI_ResultParameter.h>
 
 #include <GeomDataAPI_Point2D.h>
 #include <GeomDataAPI_Point.h>
@@ -1739,6 +1740,25 @@ void PartSet_Module::onTreeViewDoubleClick(const QModelIndex& theIndex)
     if (aPartFeature.get() && (aPartFeature->getKind() == PartSetPlugin_Part::ID())) {
       aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(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<ModelAPI_ResultParameter>(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()) {