From: vsv Date: Fri, 17 Apr 2015 13:56:08 +0000 (+0300) Subject: Issue #339: Set document filter before any other filters X-Git-Tag: V_1.1.0~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=687f0b60623e1ef3006415af90cc80ad642a2dbf;p=modules%2Fshaper.git Issue #339: Set document filter before any other filters --- diff --git a/src/ModuleBase/ModuleBase_IModule.h b/src/ModuleBase/ModuleBase_IModule.h index 1d6837205..7ba5cfe1e 100644 --- a/src/ModuleBase/ModuleBase_IModule.h +++ b/src/ModuleBase/ModuleBase_IModule.h @@ -141,7 +141,7 @@ protected slots: protected: /// Sends the operation for launching /// \param theOperation the operation - void sendOperation(ModuleBase_Operation* theOperation); + virtual void sendOperation(ModuleBase_Operation* theOperation); /// Creates a new operation /// \param theCmdId the operation name diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp index 1f5d011ea..73035992a 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp @@ -136,7 +136,7 @@ bool ModuleBase_WidgetShapeSelector::setObject(ObjectPtr theSelectedObject, } else { AttributeSelectionPtr aSelectAttr = aData->selection(attributeID()); ResultPtr aResult = std::dynamic_pointer_cast(theSelectedObject); - if (aSelectAttr) { + if (aSelectAttr.get() != NULL) { aSelectAttr->setValue(aResult, theShape); isChanged = true; } diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 09b8ef5d5..110ac6e74 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -209,6 +209,16 @@ void PartSet_Module::operationAborted(ModuleBase_Operation* theOperation) breakOperationSequence(); } +void PartSet_Module::sendOperation(ModuleBase_Operation* theOperation) +{ + // Install the document filter before any other filter + if (myDocumentShapeFilter.IsNull()) + myDocumentShapeFilter = new PartSet_GlobalFilter(myWorkshop); + myWorkshop->viewer()->addSelectionFilter(myDocumentShapeFilter); + + ModuleBase_IModule::sendOperation(theOperation); +} + void PartSet_Module::operationStarted(ModuleBase_Operation* theOperation) { if (PartSet_SketcherMgr::isSketchOperation(theOperation)) { @@ -219,10 +229,6 @@ void PartSet_Module::operationStarted(ModuleBase_Operation* theOperation) else if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation)) { mySketchMgr->startNestedSketch(theOperation); } - - if (myDocumentShapeFilter.IsNull()) - myDocumentShapeFilter = new PartSet_GlobalFilter(myWorkshop); - myWorkshop->viewer()->addSelectionFilter(myDocumentShapeFilter); } void PartSet_Module::operationStopped(ModuleBase_Operation* theOperation) diff --git a/src/PartSet/PartSet_Module.h b/src/PartSet/PartSet_Module.h index b7ec5ba99..3120798c6 100644 --- a/src/PartSet/PartSet_Module.h +++ b/src/PartSet/PartSet_Module.h @@ -146,6 +146,10 @@ protected slots: /// Register properties of this module virtual void registerProperties(); + /// Sends the operation for launching + /// \param theOperation the operation + virtual void sendOperation(ModuleBase_Operation* theOperation); + private slots: /// Processing of vertex selected void onVertexSelected();