]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #339: Set document filter before any other filters
authorvsv <vitaly.smetannikov@opencascade.com>
Fri, 17 Apr 2015 13:56:08 +0000 (16:56 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Fri, 17 Apr 2015 13:56:08 +0000 (16:56 +0300)
src/ModuleBase/ModuleBase_IModule.h
src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_Module.h

index 1d68372056ca961735560524bc0ada42b8c2c029..7ba5cfe1e09693d931618d6f73c189f268fdc02e 100644 (file)
@@ -141,7 +141,7 @@ protected slots:
  protected:\r
   /// Sends the operation for launching\r
   /// \param theOperation the operation\r
-  void sendOperation(ModuleBase_Operation* theOperation);\r
+  virtual void sendOperation(ModuleBase_Operation* theOperation);\r
 \r
   /// Creates a new operation\r
   /// \param theCmdId the operation name\r
index 1f5d011ea30eb0e16e7dbba808ceb87ef0c6e862..73035992a958d7bf425c8140479a8a13873f685b 100644 (file)
@@ -136,7 +136,7 @@ bool ModuleBase_WidgetShapeSelector::setObject(ObjectPtr theSelectedObject,
     } else {
       AttributeSelectionPtr aSelectAttr = aData->selection(attributeID());
       ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theSelectedObject);
-      if (aSelectAttr) {
+      if (aSelectAttr.get() != NULL) {
         aSelectAttr->setValue(aResult, theShape);
         isChanged = true;
       }
index 09b8ef5d58c71373cb2e8b60fdbcd7e0b8e8c851..110ac6e7447f8b9dad71ec58dc90a5a67a4d0173 100644 (file)
@@ -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)
index b7ec5ba99197062897239e68c596d9e46044cdfd..3120798c6c598a82c67686bb6d17e1085477da01 100644 (file)
@@ -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();