]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Better fix for the issue #1750
authormpv <mpv@opencascade.com>
Thu, 8 Dec 2016 11:49:55 +0000 (14:49 +0300)
committermpv <mpv@opencascade.com>
Thu, 8 Dec 2016 11:49:55 +0000 (14:49 +0300)
src/BuildPlugin/BuildPlugin_Validators.cpp
src/Model/Model_ResultCompSolid.cpp
src/XGUI/XGUI_WorkshopListener.cpp

index 613e343629388cc70f11c205ccccd512b75b4233..87e52020a07f4cdbf09e1a7ea8749a244c58304a 100644 (file)
@@ -135,9 +135,11 @@ bool BuildPlugin_ValidatorBaseForWire::isValid(const std::shared_ptr<ModelAPI_Fe
     AttributeSelectionPtr aSelection = aSelectionList->value(anIndex);
     GeomShapePtr aShape = aSelection->value();
     if(!aShape.get()) {
-      aShape = aSelection->context()->shape();
+      if (aSelection->context().get())
+        aShape = aSelection->context()->shape();
     }
-    aListOfShapes.push_back(aShape);
+    if (aShape.get())
+      aListOfShapes.push_back(aShape);
   }
 
   // Create wire.
index aa771929e56c3b4bab2fc043041ebca8a906c87d..c613cd29f3d88b13eb75a473781ff7e8dda03cd7 100755 (executable)
@@ -122,6 +122,10 @@ bool Model_ResultCompSolid::isConcealed()
         }
       }
     }
+    // update the display state of the subs: explicitly call Model_ResultBody::isConcealed
+    for(aSubIter = mySubs.cbegin(); aSubIter != mySubs.cend(); aSubIter++) {
+      (*aSubIter)->isConcealed();
+    }
   }
   return aResult;
 }
index b67966ac34300c2d6897890d04b94ca9062c5fb0..55bfec3d85754df63afe4cab8a32a06b266336b8 100755 (executable)
@@ -413,30 +413,6 @@ void XGUI_WorkshopListener::
         aDisplayed = displayObject(anObject);
         if (aDisplayed)
           aDoFitAll = aDoFitAll || neededFitAll(anObject, aNbOfShownObjects);
-
-        // workaround for #1750: sub results should be sent here to be displayed
-        FeaturePtr anObjectFeature = ModelAPI_Feature::feature(anObject);
-        if (anObjectFeature.get() && anObjectFeature->getKind() == "Partition") {
-          XGUI_OperationMgr* anOperationMgr = workshop()->operationMgr();
-          if (anOperationMgr->hasOperation()) {
-            ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
-                                                            (anOperationMgr->currentOperation());
-            if (aFOperation && aFOperation->isEditOperation() &&
-                aFOperation->id() == "Remove_SubShapes") {
-              ResultCompSolidPtr aCompsolidResult =
-                                   std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(anObject);
-              if (aCompsolidResult.get() != NULL) { // display all sub results
-                for(int i = 0; i < aCompsolidResult->numberOfSubs(); i++) {
-                  ObjectPtr aSubObject = aCompsolidResult->subResult(i);
-                  aSubObject->setDisplayed(true);
-                  aDisplayed = displayObject(aSubObject);
-                  if (aDisplayed)
-                    aDoFitAll = aDoFitAll || neededFitAll(aSubObject, aNbOfShownObjects);
-                }
-              }
-            }
-          }
-        }
       } else
         anObject->setDisplayed(false);
     }