]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #3152: Consider only results in selection for modification of Isos
authorvsv <vsv@opencascade.com>
Wed, 26 Feb 2020 09:19:21 +0000 (12:19 +0300)
committervsv <vsv@opencascade.com>
Wed, 26 Feb 2020 09:19:21 +0000 (12:19 +0300)
src/XGUI/XGUI_Workshop.cpp

index c2d44a802fdb9c12bcda36c9bebccae28005effb..63a1c232707a218114a9aeb65143445d3aff8e91 100644 (file)
@@ -3194,10 +3194,18 @@ void XGUI_Workshop::changeIsoLines(const QObjectPtrList& theObjects)
   if (theObjects.isEmpty())
     return;
 
+  QList<ResultPtr> aResultList;
+  ResultPtr aRes;
+  foreach(ObjectPtr aObj, theObjects) {
+    aRes = std::dynamic_pointer_cast<ModelAPI_Result>(aObj);
+    if (aRes.get())
+      aResultList.append(aRes);
+  }
+
   std::vector<int> aValues;
   bool isVisible;
-  if (theObjects.size() == 1) {
-    ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(theObjects.first());
+  if (aResultList.size() == 1) {
+    ResultPtr aRes = aResultList.first();
     if (aRes.get())
       ModelAPI_Tools::getIsoLines(aRes, isVisible, aValues);
     else
@@ -3236,12 +3244,8 @@ void XGUI_Workshop::changeIsoLines(const QObjectPtrList& theObjects)
 
     aValues[0] = aUNb->value();
     aValues[1] = aVNb->value();
-    ResultPtr aRes;
-    foreach(ObjectPtr aObj, theObjects) {
-      aRes = std::dynamic_pointer_cast<ModelAPI_Result>(aObj);
-      if (aRes.get()) {
-        ModelAPI_Tools::setIsoLines(aRes, aValues);
-      }
+    foreach(ResultPtr aRes, aResultList) {
+      ModelAPI_Tools::setIsoLines(aRes, aValues);
     }
     mySelector->clearSelection();
     Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));