]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/PartSet/PartSet_Module.cpp
Salome HOME
Merge branch 'Dev_0.6' of newgeom:newgeom into Dev_0.6
[modules/shaper.git] / src / PartSet / PartSet_Module.cpp
index 39830ef5576aaf32c67ddb31707b383bdaeab0b5..ca49036a681acb908ee57bfb1882608634bbc0c9 100644 (file)
@@ -110,6 +110,10 @@ PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop)
 
 PartSet_Module::~PartSet_Module()
 {
+  if (!myDocumentShapeFilter.IsNull())
+    myDocumentShapeFilter.Nullify();
+  if (!myPlaneFilter.IsNull())
+    myPlaneFilter.Nullify();
 }
 
 void PartSet_Module::registerValidators()
@@ -191,6 +195,9 @@ void PartSet_Module::onOperationStarted(ModuleBase_Operation* theOperation)
       myPlaneFilter->setPlane(aPln->impl<gp_Pln>());
     }
   }
+  if (myDocumentShapeFilter.IsNull())
+    myDocumentShapeFilter = new ModuleBase_ShapeDocumentFilter(myWorkshop);
+  myWorkshop->viewer()->addSelectionFilter(myDocumentShapeFilter);
 }
 
 void PartSet_Module::onOperationStopped(ModuleBase_Operation* theOperation)
@@ -225,6 +232,7 @@ void PartSet_Module::onOperationStopped(ModuleBase_Operation* theOperation)
     myCurrentSketch = CompositeFeaturePtr();
     myWorkshop->viewer()->removeSelectionFilter(myPlaneFilter);
   }
+  myWorkshop->viewer()->removeSelectionFilter(myDocumentShapeFilter);
 }
 
 void PartSet_Module::onPlaneSelected(const std::shared_ptr<GeomAPI_Pln>& thePln)