From: nds Date: Mon, 19 Jan 2015 11:51:31 +0000 (+0300) Subject: Issue #355 Delete: elements of sketch and constraints X-Git-Tag: V_1.0.0~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fce49c1417df9ce5674cc935f6f7f606e007615a;p=modules%2Fshaper.git Issue #355 Delete: elements of sketch and constraints Delete action on multi-selection. --- diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index b3f9f28f7..6755bc6e5 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -213,7 +213,7 @@ bool PartSet_Module::canDisplayObject(const ObjectPtr& theObject) const void PartSet_Module::addViewerItems(QMenu* theMenu) const { - if (isSketchOperationActive()) { + if (isSketchOperationActive() || isSketchFeatureOperationActive()) { ModuleBase_ISelection* aSelection = myWorkshop->selection(); QObjectPtrList aObjects = aSelection->selectedPresentations(); if (aObjects.size() > 0) { @@ -331,7 +331,7 @@ void PartSet_Module::onEnterReleased() void PartSet_Module::onOperationActivatedByPreselection() { ModuleBase_Operation* aOperation = myWorkshop->currentOperation(); - if(aOperation && isSketchOperationActive()) { + if(aOperation && isSketchFeatureOperationActive()) { // Set final definitions if they are necessary //propertyPanelDefined(aOperation); @@ -342,7 +342,7 @@ void PartSet_Module::onOperationActivatedByPreselection() void PartSet_Module::onNoMoreWidgets() { - if (isSketchOperationActive()) { + if (isSketchFeatureOperationActive()) { ModuleBase_Operation* aOperation = myWorkshop->currentOperation(); if (aOperation) { if (myRestartingMode != RM_Forbided) @@ -418,6 +418,14 @@ QWidget* PartSet_Module::createWidgetByType(const std::string& theType, QWidget* } bool PartSet_Module::isSketchOperationActive() const +{ + ModuleBase_Operation* aOperation = myWorkshop->currentOperation(); + + bool isSketchOp = aOperation && aOperation->id().toStdString() == SketchPlugin_Sketch::ID(); + return isSketchOp; +} + +bool PartSet_Module::isSketchFeatureOperationActive() const { bool isCurrentSketchOp = false; ModuleBase_Operation* aOperation = myWorkshop->currentOperation(); @@ -464,7 +472,7 @@ void PartSet_Module::onAction(bool isChecked) void PartSet_Module::deleteObjects() { - if (!isSketchOperationActive()) + if (isSketchOperationActive() || isSketchFeatureOperationActive()) return; XGUI_ModuleConnector* aConnector = dynamic_cast(workshop()); diff --git a/src/PartSet/PartSet_Module.h b/src/PartSet/PartSet_Module.h index f58c4738b..5bd229629 100644 --- a/src/PartSet/PartSet_Module.h +++ b/src/PartSet/PartSet_Module.h @@ -131,10 +131,14 @@ protected slots: /// Breaks sequense of automatically resterted operations void breakOperationSequence(); - /// Check whether there is active opeation and it is the sketch one + /// Check whether the sketch operation is active /// \return boolean result bool isSketchOperationActive() const; + /// Check whether the sketch feature operation is active + /// \return boolean result + bool isSketchFeatureOperationActive() const; + /// Create all actions for context menus. It is called on creation of module /// Put the created actions into an internal map void createActions();