From: vsv Date: Thu, 10 Sep 2015 09:49:47 +0000 (+0300) Subject: Issue #894: Toggle constraint before transaction open X-Git-Tag: V_1.4.0_beta4~42 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b4b1c61f2d76113afffe6df9aa822a1fee407594;p=modules%2Fshaper.git Issue #894: Toggle constraint before transaction open --- diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 1439438c3..e0b7c9774 100755 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -734,6 +734,16 @@ void PartSet_Module::onFeatureTriggered() ModuleBase_IModule::onFeatureTriggered(); } +void PartSet_Module::launchOperation(const QString& theCmdId) +{ + if (PartSet_SketcherMgr::constraintsIdList().contains(theCmdId)) { + // Show constraints if a constraint was anOperation + mySketchMgr->onShowConstraintsToggle(true); + } + ModuleBase_IModule::launchOperation(theCmdId); +} + + void PartSet_Module::onObjectDisplayed(ObjectPtr theObject, AISObjectPtr theAIS) { Handle(AIS_InteractiveObject) anAIS = theAIS->impl(); diff --git a/src/PartSet/PartSet_Module.h b/src/PartSet/PartSet_Module.h index 2828de29f..87572db15 100644 --- a/src/PartSet/PartSet_Module.h +++ b/src/PartSet/PartSet_Module.h @@ -69,6 +69,10 @@ public: /// Call back forlast tuning of property panel before operation performance virtual void propertyPanelDefined(ModuleBase_Operation* theOperation); + /// Creates an operation and send it to loop + /// \param theCmdId the operation name + virtual void launchOperation(const QString& theCmdId); + /// Realizes some functionality by an operation start /// Displays all sketcher sub-Objects, hides sketcher result, appends selection filters /// Activate the operation presentation diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index b4cf246ea..ae2181836 100644 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -877,10 +877,6 @@ void PartSet_SketcherMgr::stopSketch(ModuleBase_Operation* /* theOperation*/) void PartSet_SketcherMgr::startNestedSketch(ModuleBase_Operation* theOperation) { - if (constraintsIdList().contains(theOperation->id())) { - // Show constraints if a constraint was created - onShowConstraintsToggle(true); - } connectToPropertyPanel(true); } diff --git a/src/PartSet/PartSet_SketcherMgr.h b/src/PartSet/PartSet_SketcherMgr.h index 477fdcb30..08a152236 100644 --- a/src/PartSet/PartSet_SketcherMgr.h +++ b/src/PartSet/PartSet_SketcherMgr.h @@ -188,6 +188,9 @@ public slots: /// Process sketch plane selected event void onPlaneSelected(const std::shared_ptr& thePln); + /// Toggle show constraints + void onShowConstraintsToggle(bool); + private slots: /// Process the enter mouse to the view port. If the current operation is a create of /// a nested sketch feature, it updates internal flags to display the feature on mouse move @@ -212,8 +215,6 @@ private slots: void onBeforeContextMenu(); void onAfterContextMenu(); - void onShowConstraintsToggle(bool); - private: /// Launches the operation from current highlighting void launchEditing();