From 15d7658e3aa5709c017ecd05905af27e09725830 Mon Sep 17 00:00:00 2001 From: vsv Date: Tue, 26 May 2015 13:02:45 +0300 Subject: [PATCH] setDisplayed has to be called in order to synchronize internal state of the object --- src/PartSet/PartSet_SketcherMgr.cpp | 5 +++-- src/XGUI/XGUI_Workshop.cpp | 23 ++++++++++++----------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index aa42a16f9..015257489 100644 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -843,7 +843,9 @@ bool PartSet_SketcherMgr::canDisplayObject(const ObjectPtr& theObject) const } } } - + if (!isObjectFound) + return aCanDisplay; + // 4. For created nested feature operation do not display the created feature if // the mouse curstor leaves the OCC window. // The correction cases, which ignores this condition: @@ -865,7 +867,6 @@ bool PartSet_SketcherMgr::canDisplayObject(const ObjectPtr& theObject) const } } #endif - theObject->setDisplayed(aCanDisplay); // If it be set into True - set to False return aCanDisplay; } diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index b7f68ebaa..dfa21b5da 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -515,16 +515,17 @@ void XGUI_Workshop::onFeatureCreatedMsg(const std::shared_ptrdata() || !anObject->data()->isValid() || anObject->isDisabled()) - continue; - //ResultPartPtr aPart = std::dynamic_pointer_cast(*aIt); - //if (aPart) { - //aHasPart = true; - // If a feature is created from the aplication's python console - // it doesn't stored in the operation mgr and doesn't displayed - //} else { - isDisplayed = displayObject(*aIt); - //} + bool aHide = !anObject->data() || !anObject->data()->isValid() || + anObject->isDisabled() || (!anObject->isDisplayed()); + if (!aHide) { + // setDisplayed has to be called in order to synchronize internal state of the object + // with list of displayed objects + if (myModule->canDisplayObject(anObject)) { + anObject->setDisplayed(true); + isDisplayed = displayObject(*aIt); + } else + anObject->setDisplayed(false); + } } //if (myObjectBrowser) // myObjectBrowser->processEvent(theMsg); @@ -847,7 +848,7 @@ void XGUI_Workshop::onOpen() aSession->closeAll(); aSession->load(myCurrentDir.toLatin1().constData()); myObjectBrowser->rebuildDataTree(); - displayAllResults(); + //displayAllResults(); updateCommandStatus(); myIsLoadingData = false; QApplication::restoreOverrideCursor(); -- 2.39.2