From 77c8246326d4d563531a055a0405a04dc5737416 Mon Sep 17 00:00:00 2001 From: mpv Date: Thu, 8 Dec 2016 14:49:55 +0300 Subject: [PATCH] Better fix for the issue #1750 --- src/BuildPlugin/BuildPlugin_Validators.cpp | 6 ++++-- src/Model/Model_ResultCompSolid.cpp | 4 ++++ src/XGUI/XGUI_WorkshopListener.cpp | 24 ---------------------- 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/src/BuildPlugin/BuildPlugin_Validators.cpp b/src/BuildPlugin/BuildPlugin_Validators.cpp index 613e34362..87e52020a 100644 --- a/src/BuildPlugin/BuildPlugin_Validators.cpp +++ b/src/BuildPlugin/BuildPlugin_Validators.cpp @@ -135,9 +135,11 @@ bool BuildPlugin_ValidatorBaseForWire::isValid(const std::shared_ptrvalue(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. diff --git a/src/Model/Model_ResultCompSolid.cpp b/src/Model/Model_ResultCompSolid.cpp index aa771929e..c613cd29f 100755 --- a/src/Model/Model_ResultCompSolid.cpp +++ b/src/Model/Model_ResultCompSolid.cpp @@ -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; } diff --git a/src/XGUI/XGUI_WorkshopListener.cpp b/src/XGUI/XGUI_WorkshopListener.cpp index b67966ac3..55bfec3d8 100755 --- a/src/XGUI/XGUI_WorkshopListener.cpp +++ b/src/XGUI/XGUI_WorkshopListener.cpp @@ -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 - (anOperationMgr->currentOperation()); - if (aFOperation && aFOperation->isEditOperation() && - aFOperation->id() == "Remove_SubShapes") { - ResultCompSolidPtr aCompsolidResult = - std::dynamic_pointer_cast(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); } -- 2.39.2