From: nds Date: Fri, 13 Feb 2015 15:39:11 +0000 (+0300) Subject: Issue #394 Undo-ing a Sketch element X-Git-Tag: V_1.1.0~188^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e516fc2c90c48a5b2f717be0109b02e1eff3462c;p=modules%2Fshaper.git Issue #394 Undo-ing a Sketch element Display/erase constraint features. --- diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index a8be84bd8..60d6768cf 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -236,7 +236,7 @@ bool PartSet_Module::canRedo() const bool PartSet_Module::canDisplayObject(const ObjectPtr& theObject) const { bool aCanDisplay = false; - if (!mySketchMgr->canDisplayObject(theObject)) + if (!mySketchMgr->canDisplayObject()) return aCanDisplay; CompositeFeaturePtr aSketchFeature = mySketchMgr->activeSketch(); if (aSketchFeature.get() != NULL) { diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index cda45d1ba..6398ce252 100644 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -668,7 +668,7 @@ bool PartSet_SketcherMgr::canRedo() const return isNestedCreateOperation(); } -bool PartSet_SketcherMgr::canDisplayObject(const ObjectPtr& theObject) const +bool PartSet_SketcherMgr::canDisplayObject() const { bool aCanDisplay = true; if (!isNestedCreateOperation()) @@ -677,14 +677,6 @@ bool PartSet_SketcherMgr::canDisplayObject(const ObjectPtr& theObject) const // during a nested create operation, the feature is redisplayed only if the mouse over view // of there was a value modified in the property panel after the mouse left the view aCanDisplay = myIsPropertyPanelValueChanged || myIsMouseOverWindow; - /*if (!aCanDisplay) { - ModuleBase_IWorkshop* anIWorkshop = myModule->workshop(); - XGUI_ModuleConnector* aConnector = dynamic_cast(anIWorkshop); - XGUI_Workshop* aWorkshop = aConnector->workshop(); - AppElements_MainWindow* aMainWindow = aWorkshop->mainWindow(); - - //aCanDisplay = aMainWindow->isMouseOverWindow(); - }*/ return aCanDisplay; } @@ -846,11 +838,20 @@ void PartSet_SketcherMgr::updateVisibilityOfCreatedFeature() XGUI_ModuleConnector* aConnector = dynamic_cast(aWorkshop); XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer(); + bool aToDisplay = canDisplayObject(); + // 1. change visibility of the object itself, here the presentable object is processed, + // e.g. constraints features FeaturePtr aFeature = aOperation->feature(); std::list aResults = aFeature->results(); + if (aToDisplay) + aDisplayer->display(aFeature, false); + else + aDisplayer->erase(aFeature, false); + + // change visibility of the object results, e.g. non-constraint features std::list::const_iterator aIt; for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) { - if (canDisplayObject(aFeature)) { + if (aToDisplay) { aDisplayer->display(*aIt, false); } else { diff --git a/src/PartSet/PartSet_SketcherMgr.h b/src/PartSet/PartSet_SketcherMgr.h index c9b16a0a9..8a0967b5e 100644 --- a/src/PartSet/PartSet_SketcherMgr.h +++ b/src/PartSet/PartSet_SketcherMgr.h @@ -122,7 +122,7 @@ public: /// Display only current operation results for usual operation and ask the sketcher manager /// if it is a sketch operation /// \param theObject a model object - bool canDisplayObject(const ObjectPtr& theObject) const; + bool canDisplayObject() const; public slots: /// Process sketch plane selected event