From 44340ff3cc86b39ba1f1833f166e6be77bd368c4 Mon Sep 17 00:00:00 2001 From: mpv Date: Fri, 19 Sep 2014 18:09:32 +0400 Subject: [PATCH] Do not show concealed results --- src/Model/Model_Document.h | 6 ++++++ src/ModelAPI/ModelAPI_Document.h | 5 ++++- src/XGUI/XGUI_Workshop.cpp | 5 +++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Model/Model_Document.h b/src/Model/Model_Document.h index 443d00c10..38625983c 100644 --- a/src/Model/Model_Document.h +++ b/src/Model/Model_Document.h @@ -129,6 +129,12 @@ class Model_Document : public ModelAPI_Document ///! On abort, undo or redo it is not necessary: results in document are updated automatically bool executeFeatures() {return myExecuteFeatures;} + ///! Reutrns true is result was conecaled because of usage it by other object + virtual bool isConcealed(const boost::shared_ptr& theResult) { + return myConcealedResults.find(boost::dynamic_pointer_cast(theResult)) + != myConcealedResults.end(); + } + protected: //! Returns (creates if needed) the features label diff --git a/src/ModelAPI/ModelAPI_Document.h b/src/ModelAPI/ModelAPI_Document.h index 7f224da3e..6e432ae02 100644 --- a/src/ModelAPI/ModelAPI_Document.h +++ b/src/ModelAPI/ModelAPI_Document.h @@ -80,7 +80,10 @@ public: virtual boost::shared_ptr feature( const boost::shared_ptr& theResult) = 0; - protected: + ///! Reutrns true is result was conecaled because of usage it by other object + virtual bool isConcealed(const boost::shared_ptr& theResult) = 0; + +protected: /// Only for SWIG wrapping it is here MODELAPI_EXPORT ModelAPI_Document() { diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index b5fb72d02..8d3568d7a 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -385,7 +385,7 @@ void XGUI_Workshop::onFeatureRedisplayMsg(const boost::shared_ptr::const_iterator aIt; for (aIt = aObjects.begin(); aIt != aObjects.end(); ++aIt) { ObjectPtr aObj = (*aIt); - if (!aObj->data() || !aObj->data()->isValid()) + if (!aObj->data() || !aObj->data()->isValid() || aObj->document()->isConcealed(aObj)) myDisplayer->erase(aObj, false); else { if (myDisplayer->isVisible(aObj)) // TODO VSV: Correction sketch drawing @@ -419,7 +419,8 @@ void XGUI_Workshop::onFeatureCreatedMsg(const boost::shared_ptrhasOperation()) { ModuleBase_Operation* aOperation = myOperationMgr->currentOperation(); - if (aOperation->hasObject(*aIt)) { // Display only current operation results + if (!(*aIt)->document()->isConcealed(*aIt) && + aOperation->hasObject(*aIt)) { // Display only current operation results myDisplayer->display(*aIt, false); isDisplayed = true; } -- 2.39.2