]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/PartSet/PartSet_Module.cpp
Salome HOME
Issue #1412: Activate selection mode FACES for sketcher only in operations with selector:
[modules/shaper.git] / src / PartSet / PartSet_Module.cpp
index b8b46fb90555be4072ae17092e1e5d3c6fd0e798..29948541da0becfe38e48255609b863be276c0ee 100755 (executable)
@@ -526,6 +526,14 @@ void PartSet_Module::activeSelectionModes(QIntList& theModes)
     PartSet_SketcherMgr::sketchSelectionModes(theModes);
 }
 
+void PartSet_Module::customSubShapesSelectionModes(QIntList& theTypes)
+{
+  if (theTypes.contains(TopAbs_FACE))
+    theTypes.append(SketcherPrs_Tools::Sel_Sketch_Face);
+  if (theTypes.contains(TopAbs_WIRE))
+    theTypes.append(SketcherPrs_Tools::Sel_Sketch_Wire);
+}
+
 bool PartSet_Module::isMouseOverWindow()
 {
   return mySketchMgr->isMouseOverWindow();
@@ -1322,38 +1330,3 @@ void PartSet_Module::setDefaultConstraintShown()
   myHasConstraintShown[PartSet_Tools::Dimensional] = true;
   myHasConstraintShown[PartSet_Tools::Expressions] = false;
 }
-
-//******************************************************
-bool PartSet_Module::canActivateSelectionMode(const Handle(AIS_InteractiveObject)& theIO, int theMode) const
-{
-  /*if (theMode == TopAbs_FACE) {
-    Handle(PartSet_ResultSketchPrs) aSketchPrs = Handle(PartSet_ResultSketchPrs)::DownCast(theIO);
-    if (!aSketchPrs.IsNull()) {
-        ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
-        if (anOperation) {
-          ModuleBase_IPropertyPanel* aPropPanel = anOperation->propertyPanel();
-          if (aPropPanel) {
-            ModuleBase_ModelWidget* aModelWgt = aPropPanel->activeWidget();
-            ModuleBase_WidgetSelector* aWgtSelector = dynamic_cast<ModuleBase_WidgetSelector*>(aModelWgt);
-            if (aWgtSelector) {
-              return aWgtSelector->isFilterActivated();
-            } else
-              return true;
-          } else
-            return false;
-        } else
-          return false;
-    }
-  }*/
-  return true; 
-}
-
-//******************************************************
-bool PartSet_Module::needDeactivateSelectionMode(const Handle(AIS_InteractiveObject)& theIO, int theMode) const
-{
-  if (theMode == TopAbs_FACE) {
-   // Handle(PartSet_ResultSketchPrs) aSketchPrs = Handle(PartSet_ResultSketchPrs)::DownCast(theIO);
-   // return !aSketchPrs.IsNull();
-  }
-  return false;
-}