From: vsv Date: Tue, 26 May 2015 10:02:45 +0000 (+0300) Subject: setDisplayed has to be called in order to synchronize internal state of the object X-Git-Tag: V_1.2.0~79 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=15d7658e3aa5709c017ecd05905af27e09725830;p=modules%2Fshaper.git setDisplayed has to be called in order to synchronize internal state of the object --- 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();