]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Sketch shape in plane selection filter should not be activated while PartSet_WidgetSh...
authornds <nds@opencascade.com>
Thu, 14 Dec 2017 07:26:21 +0000 (10:26 +0300)
committernds <nds@opencascade.com>
Thu, 14 Dec 2017 07:26:21 +0000 (10:26 +0300)
18 files changed:
src/ModuleBase/ModuleBase_IModule.h
src/ModuleBase/ModuleBase_ModelWidget.cpp
src/ModuleBase/ModuleBase_ModelWidget.h
src/ModuleBase/ModuleBase_WidgetValidated.cpp
src/ModuleBase/ModuleBase_WidgetValidated.h
src/ModuleBase/ModuleBase_WidgetValidator.cpp
src/ModuleBase/ModuleBase_WidgetValidator.h
src/PartSet/CMakeLists.txt
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_Module.h
src/PartSet/PartSet_SelectionFilterType.h [new file with mode: 0644]
src/PartSet/PartSet_SketcherMgr.cpp
src/PartSet/PartSet_SketcherMgr.h
src/PartSet/PartSet_WidgetShapeSelector.cpp
src/PartSet/PartSet_WidgetShapeSelector.h
src/PartSet/PartSet_WidgetSketchLabel.cpp
src/PartSet/PartSet_WidgetSketchLabel.h
src/XGUI/XGUI_SelectionActivate.cpp

index 66711b4c5707c0a73603986540cf930f9435cd4c..65d6088a1d2031d62401578bfbdaada97913359e 100755 (executable)
@@ -236,11 +236,15 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
   virtual void moduleSelectionModes(int theModesType, QIntList& theModes) = 0;
 
   /// Appends into container of filters module filters corresponded to the modes type
-  /// \param theModesType combination of available selection filters
+  /// \param theFilterTypes container of available selection filters
   /// \param theSelectionFilters [out] container to be extend by elements
-  virtual void moduleSelectionFilters(int theModesType,
+  virtual void moduleSelectionFilters(const QIntList& theFilterTypes,
                                       SelectMgr_ListOfFilter& theSelectionFilters) = 0;
 
+  /// Returns types of registered module selection filters
+  /// \param theSelectionFilters [out] container of type value
+  virtual QIntList selectionFilters() { return QIntList(); }
+
   /// Return true if the custom presentation is activated
   /// \param theFlag a flag of level of customization, which means that only part of sub-elements
   /// \return boolean value
index 097f5175d31c949ea1e2ff15f800066dd53179be..50c7734d280c69e7af1b38b516efb322c6be5353 100644 (file)
@@ -119,10 +119,9 @@ void ModuleBase_ModelWidget::selectionModes(int& theModuleSelectionModes, QIntLi
 }
 
 //**************************************************************
-void ModuleBase_ModelWidget::selectionFilters(int& theModuleSelectionFilters,
+void ModuleBase_ModelWidget::selectionFilters(QIntList& theModuleSelectionFilters,
                                               SelectMgr_ListOfFilter& theSelectionFilters)
 {
-  theModuleSelectionFilters = -1;
   if (myWidgetValidator)
     myWidgetValidator->selectionFilters(theModuleSelectionFilters, theSelectionFilters);
 }
index d4ecf3f89986a5b336e37672eb53d6510023ad02..0c0dddece67bee7c6eda485f2c4ea15a589013e7 100644 (file)
@@ -94,7 +94,7 @@ Q_OBJECT
   /// Appends into container of workshop selection filters
   /// \param [out] theModuleSelectionFilters module additional modes, -1 means all default modes
   /// \param [out] theSelectionFilters selection filters
-  virtual void selectionFilters(int& theModuleSelectionFilters,
+  virtual void selectionFilters(QIntList& theModuleSelectionFilters,
                                 SelectMgr_ListOfFilter& theSelectionFilters);
 
   /// Returns true, if default value of the widget should be computed
index d1bebe79f38aae627666e0ea974a0d0857434582..e60685b0cc5e2758cfd8b573ef25502d3aa1dc81 100644 (file)
@@ -19,6 +19,7 @@
 //
 
 #include <ModuleBase_WidgetValidated.h>
+#include <ModuleBase_IModule.h>
 #include <ModuleBase_IViewer.h>
 #include <ModuleBase_IWorkshop.h>
 #include <ModuleBase_ISelection.h>
@@ -123,7 +124,7 @@ bool ModuleBase_WidgetValidated::isValidInFilters(const ModuleBase_ViewerPrsPtr&
     // it is not yet activated, so we need to activate/deactivate it manually
     bool isActivated = isFilterActivated();
     if (!isActivated) {
-      int aModuleSelectionFilters = -1;
+      QIntList aModuleSelectionFilters = myWorkshop->module()->selectionFilters();
       SelectMgr_ListOfFilter aSelectionFilters;
       selectionFilters(aModuleSelectionFilters, aSelectionFilters);
       /// after validation, the selection filters should be restored
@@ -246,10 +247,9 @@ bool ModuleBase_WidgetValidated::isFilterActivated() const
 }
 
 //********************************************************************
-void ModuleBase_WidgetValidated::selectionFilters(int& theModuleSelectionFilters,
+void ModuleBase_WidgetValidated::selectionFilters(QIntList& theModuleSelectionFilters,
                                                   SelectMgr_ListOfFilter& theSelectionFilters)
 {
-  theModuleSelectionFilters = -1;
   theSelectionFilters.Append(myWorkshop->validatorFilter());
 }
 
index 502ae5dada4f57c4112dffe84b871b4339bf4ba3..afff4dc673c2ead7658c88abc83d9d6a461f50b6 100644 (file)
@@ -86,7 +86,7 @@ class MODULEBASE_EXPORT ModuleBase_WidgetValidated : public ModuleBase_ModelWidg
   /// Appends into container of workshop selection filters
   /// \param [out] theModuleSelectionFilters module additional modes, -1 means all default modes
   /// \param [out] selection filters
-  virtual void selectionFilters(int& theModuleSelectionFilters,
+  virtual void selectionFilters(QIntList& theModuleSelectionFilters,
                                 SelectMgr_ListOfFilter& theSelectionFilters);
 
   /// Block the model flush of update and intialization of attribute
index d0b2b5ce17e765aa102f4ee2fc969f4df9c8bed9..8953db0b58970d99368ee0445692551f2adc273f 100755 (executable)
@@ -40,10 +40,9 @@ ModuleBase_WidgetValidator::~ModuleBase_WidgetValidator()
 }
 
 //********************************************************************
-void ModuleBase_WidgetValidator::selectionFilters(int& theModuleSelectionFilters,
+void ModuleBase_WidgetValidator::selectionFilters(QIntList& theModuleSelectionFilters,
                                                   SelectMgr_ListOfFilter& theSelectionFilters)
 {
-  theModuleSelectionFilters = -1;
   theSelectionFilters.Append(myWorkshop->validatorFilter());
 }
 
index 3a84b0658c2655fe4ae3a69709e1ba14fc584647..8c7c927a9362e4ce3deaf512171bf929af8033be 100755 (executable)
@@ -59,7 +59,7 @@ class MODULEBASE_EXPORT ModuleBase_WidgetValidator
   /// Appends into container of workshop selection filters
   /// \param [out] theModuleSelectionFilters module additional modes, -1 means all default modes
   /// \param [out] selection filters
-  virtual void selectionFilters(int& theModuleSelectionFilters,
+  virtual void selectionFilters(QIntList& theModuleSelectionFilters,
                                 SelectMgr_ListOfFilter& theSelectionFilters);
 
   /// Returns true if the validation is activated
index 8bb95e123773e96885c16eb3ffa570cad42b2c95..36a107106353e992d9eff7a8b21446ae7d5d8aea 100644 (file)
@@ -43,6 +43,7 @@ SET(PROJECT_HEADERS
     PartSet_PreviewPlanes.h
     PartSet_PreviewSketchPlane.h
     PartSet_ResultSketchPrs.h
+    PartSet_SelectionFilterType.h
     PartSet_SketcherMgr.h
     PartSet_SketcherReentrantMgr.h
     PartSet_Tools.h
index fe9e50e37746d3f63d739939ca05862555a7f178..8951ac04b3e2f24f76ea6cd65da54ee37b90f90e 100755 (executable)
@@ -173,8 +173,8 @@ PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop)
   Events_Loop* aLoop = Events_Loop::loop();
   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_DOCUMENT_CHANGED));
 
-  mySelectionFilters.Append(new PartSet_GlobalFilter(myWorkshop));
-  mySelectionFilters.Append(new PartSet_FilterInfinite(myWorkshop));
+  registerSelectionFilter(SF_GlobalFilter, new PartSet_GlobalFilter(myWorkshop));
+  registerSelectionFilter(SF_FilterInfinite, new PartSet_FilterInfinite(myWorkshop));
 
   setDefaultConstraintShown();
 
@@ -203,9 +203,10 @@ PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop)
 //******************************************************
 PartSet_Module::~PartSet_Module()
 {
-  SelectMgr_ListIteratorOfListOfFilter aIt(mySelectionFilters);
-  for (; aIt.More(); aIt.Next()) {
-    Handle(SelectMgr_Filter) aFilter = aIt.Value();
+  std::map<PartSet_SelectionFilterType, Handle(SelectMgr_Filter)>::const_iterator aFiltersIt =
+    mySelectionFilters.begin();
+  for (; aFiltersIt != mySelectionFilters.end(); aFiltersIt++) {
+    Handle(SelectMgr_Filter) aFilter = aFiltersIt->second;
     if (!aFilter.IsNull())
       aFilter.Nullify();
   }
@@ -613,18 +614,56 @@ void PartSet_Module::moduleSelectionModes(int theModesType, QIntList& theModes)
 }
 
 //******************************************************
-void PartSet_Module::moduleSelectionFilters(int theModesType,
+void PartSet_Module::moduleSelectionFilters(const QIntList& theFilterTypes,
                                             SelectMgr_ListOfFilter& theSelectionFilters)
 {
-  //XGUI_Tools::workshop(myWorkshop)->selectionFilters(theSelectionFilters);
-  //selectionFilters(theSelectionFilters);
+  bool isSketchActive = mySketchMgr->activeSketch();
 
-  for (SelectMgr_ListOfFilter::Iterator aFiltersIt(mySelectionFilters); aFiltersIt.More();
-       aFiltersIt.Next())
-    theSelectionFilters.Append(aFiltersIt.Value());
+  std::map<PartSet_SelectionFilterType, Handle(SelectMgr_Filter)>::const_iterator aFiltersIt =
+    mySelectionFilters.begin();
+  for (; aFiltersIt != mySelectionFilters.end(); aFiltersIt++) {
+    int aFilterType = aFiltersIt->first;
+    // do not add not participating filters in given parameters
+    if (!theFilterTypes.contains(aFilterType))
+      continue;
 
-  if (mySketchMgr->activeSketch())
-    mySketchMgr->selectionFilters(theSelectionFilters);
+    // using sketch filters only if sketch operation is active
+    if (!isSketchActive &&
+        mySketchMgr->sketchSelectionFilter((PartSet_SelectionFilterType)aFilterType))
+      continue;
+
+    theSelectionFilters.Append(aFiltersIt->second);
+  }
+}
+
+//******************************************************
+QIntList PartSet_Module::selectionFilters()
+{
+  QIntList aTypes;
+
+  std::map<PartSet_SelectionFilterType, Handle(SelectMgr_Filter)>::const_iterator aFiltersIt =
+    mySelectionFilters.begin();
+  for (; aFiltersIt != mySelectionFilters.end(); aFiltersIt++)
+    aTypes.append(aFiltersIt->first);
+
+  return aTypes;
+}
+
+//******************************************************
+void PartSet_Module::registerSelectionFilter(const PartSet_SelectionFilterType theFilterType,
+                                             const Handle(SelectMgr_Filter)& theFilter)
+{
+  mySelectionFilters[theFilterType] = theFilter;
+}
+
+//******************************************************
+Handle(SelectMgr_Filter) PartSet_Module::selectionFilter(
+  const PartSet_SelectionFilterType theFilterType)
+{
+  if (mySelectionFilters.find(theFilterType) != mySelectionFilters.end())
+    return mySelectionFilters[theFilterType];
+  else
+    return Handle(SelectMgr_Filter)();
 }
 
 //******************************************************
index 8a74b58541b94dd30da2b1f18c2dba1896deb7d7..153c715c7a15543e58fe4d5da232e3631a75ddd9 100755 (executable)
@@ -24,6 +24,7 @@
 #include "PartSet.h"
 #include "PartSet_Tools.h"
 #include "PartSet_OverconstraintListener.h"
+#include "PartSet_SelectionFilterType.h"
 #include "PartSet_SketcherMgr.h"
 
 #include <ModuleBase_IModule.h>
 //#include <StdSelect_FaceFilter.hxx>
 #include <TopoDS_Shape.hxx>
 #include <SelectMgr_ListOfFilter.hxx>
+#include <SelectMgr_Filter.hxx>
 
 #include <QMap>
 #include <QMenu>
 #include <QObject>
 #include <QModelIndex>
 
-#include <string>
-
+#include <map>
 #include <memory>
+#include <string>
 
 class ModuleBase_Operation;
 class ModuleBase_IViewWindow;
@@ -223,11 +225,26 @@ public:
   virtual void moduleSelectionModes(int theModesType, QIntList& theModes);
 
   /// Appends into container of filters module filters corresponded to the modes type
-  /// \param theModesType combination of available selection filters
+  /// \param theFilterTypes container of available selection filters
   /// \param theSelectionFilters [out] container to be extend by elements
-  virtual void moduleSelectionFilters(int theModesType,
+  virtual void moduleSelectionFilters(const QIntList& theFilterTypes,
                                       SelectMgr_ListOfFilter& theSelectionFilters);
 
+  /// Returns types of registered module selection filters
+  /// \param theSelectionFilters [out] container of type value
+  virtual QIntList selectionFilters();
+
+  /// Append selection filter into the module and type of the filter in internal container
+  /// \param theFilterType selection filter type
+  /// \param theFilter added filter
+  void registerSelectionFilter(const PartSet_SelectionFilterType theFilterType,
+                               const Handle(SelectMgr_Filter)& theFilter);
+
+  /// Returns selection filter
+  /// \param theFilterType selection filter type
+  /// \param theFilter instance of filter
+  Handle(SelectMgr_Filter) selectionFilter(const PartSet_SelectionFilterType theFilterType);
+
   /// Returns whether the mouse enter the viewer's window
   /// \return true if items are added and there is no necessity to provide standard menu
   bool isMouseOverWindow();
@@ -456,7 +473,7 @@ protected:
 
 private:
   bool myIsOperationIsLaunched; /// state of application between launch and stop operation
-  SelectMgr_ListOfFilter mySelectionFilters;
+  std::map<PartSet_SelectionFilterType, Handle(SelectMgr_Filter)> mySelectionFilters;
 
   PartSet_SketcherMgr* mySketchMgr;
   PartSet_SketcherReentrantMgr* mySketchReentrantMgr;
diff --git a/src/PartSet/PartSet_SelectionFilterType.h b/src/PartSet/PartSet_SelectionFilterType.h
new file mode 100644 (file)
index 0000000..21ce8b1
--- /dev/null
@@ -0,0 +1,32 @@
+// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef PartSet_SelectionFilterType_H
+#define PartSet_SelectionFilterType_H
+
+/// Enumeration to specify module selection filters
+enum PartSet_SelectionFilterType {
+  SF_GlobalFilter, /// filter for different documents, group results
+  SF_FilterInfinite, /// filter for infinite construction results
+  SF_SketchCirclePointFilter, /// filter for selection circle points on current sketch
+  SF_SketchPlaneFilter /// filter for selection in the current sketch plane only
+};
+
+#endif
index f385a47dff87f958fd387d6778c3685162cc2324..68045ed3e414645c7963c5372bf6e57212ffd980 100755 (executable)
@@ -19,6 +19,8 @@
 //
 
 #include "PartSet_SketcherMgr.h"
+
+#include "PartSet_Filters.h"
 #include "PartSet_SketcherReentrantMgr.h"
 #include "PartSet_Module.h"
 #include "PartSet_MouseProcessor.h"
@@ -56,6 +58,7 @@
 #include <ModuleBase_ViewerPrs.h>
 #include <ModuleBase_Tools.h>
 #include <ModuleBase_ResultPrs.h>
+#include <ModuleBase_ViewerFilters.h>
 
 #include <GeomDataAPI_Point2D.h>
 
@@ -188,14 +191,12 @@ PartSet_SketcherMgr::PartSet_SketcherMgr(PartSet_Module* theModule)
 
   mySketchPlane = new PartSet_PreviewSketchPlane();
 
-  myCirclePointFilter = new PartSet_CirclePointFilter(anIWorkshop);
-  myPlaneFilter = new ModuleBase_ShapeInPlaneFilter();
+  registerSelectionFilter(SF_SketchCirclePointFilter, new PartSet_CirclePointFilter(anIWorkshop));
+  registerSelectionFilter(SF_SketchPlaneFilter, new ModuleBase_ShapeInPlaneFilter());
 }
 
 PartSet_SketcherMgr::~PartSet_SketcherMgr()
 {
-  myPlaneFilter.Nullify();
-  myCirclePointFilter.Nullify();
 }
 
 void PartSet_SketcherMgr::onEnterViewPort()
@@ -1023,7 +1024,9 @@ void PartSet_SketcherMgr::startSketch(ModuleBase_Operation* theOperation)
   bool aHasPlane = false;
   std::shared_ptr<GeomAPI_Pln> aPln;
   aPln = PartSet_Tools::sketchPlane(myCurrentSketch);
-  myPlaneFilter->setPlane(aPln);
+  Handle(SelectMgr_Filter) aFilter = myModule->selectionFilter(SF_SketchPlaneFilter);
+  if (!aFilter.IsNull())
+    Handle(ModuleBase_ShapeInPlaneFilter)::DownCast(aFilter)->setPlane(aPln);
 
   workshop()->selectionActivate()->updateSelectionFilters();
   workshop()->selectionActivate()->updateSelectionModes();
@@ -1158,10 +1161,16 @@ void PartSet_SketcherMgr::commitNestedSketch(ModuleBase_Operation* theOperation)
   }
 }
 
-void PartSet_SketcherMgr::selectionFilters(SelectMgr_ListOfFilter& theSelectionFilters) const
+bool PartSet_SketcherMgr::sketchSelectionFilter(const PartSet_SelectionFilterType theFilterType)
 {
-  theSelectionFilters.Append(myCirclePointFilter);
-  theSelectionFilters.Append(myPlaneFilter);
+  return mySelectionFilterTypes.find(theFilterType) != mySelectionFilterTypes.end();
+}
+
+void PartSet_SketcherMgr::registerSelectionFilter(const PartSet_SelectionFilterType theFilterType,
+                                                  const Handle(SelectMgr_Filter)& theFilter)
+{
+  mySelectionFilterTypes.insert(theFilterType);
+  myModule->registerSelectionFilter(theFilterType, theFilter);
 }
 
 bool PartSet_SketcherMgr::operationActivatedByPreselection()
@@ -1464,9 +1473,12 @@ bool PartSet_SketcherMgr::isObjectOfSketch(const ObjectPtr& theObject) const
   return isFoundObject;
 }
 
-void PartSet_SketcherMgr::onPlaneSelected(const std::shared_ptr<GeomAPI_Pln>& thePln)
+void PartSet_SketcherMgr::onPlaneSelected(const std::shared_ptr<GeomAPI_Pln>& thePlane)
 {
-  myPlaneFilter->setPlane(thePln);
+  Handle(SelectMgr_Filter) aFilter = myModule->selectionFilter(SF_SketchPlaneFilter);
+  if (!aFilter.IsNull())
+    Handle(ModuleBase_ShapeInPlaneFilter)::DownCast(aFilter)->setPlane(thePlane);
+
   workshop()->selectionActivate()->updateSelectionModes();
 }
 
index 07e44783a2985a8ef50189a2aa29f5cab54ecb18..578ada7b0dabc0d011a03cd5ee0ee54263836ea7 100644 (file)
 
 #include "PartSet.h"
 
-#include "PartSet_Filters.h"
-#include "PartSet_Tools.h"
 #include "PartSet_PreviewSketchPlane.h"
+#include "PartSet_SelectionFilterType.h"
+#include "PartSet_Tools.h"
 
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_Attribute.h>
 #include <ModelAPI_CompositeFeature.h>
 #include <ModelAPI_Result.h>
 
-#include <ModuleBase_ViewerFilters.h>
 #include <ModuleBase_Definitions.h>
 #include <ModuleBase_ModelWidget.h>
 
@@ -48,6 +47,8 @@
 #include <QList>
 #include <QMap>
 
+#include <set>
+
 class PartSet_Module;
 class ModuleBase_IViewWindow;
 class ModuleBase_ModelWidget;
@@ -197,9 +198,16 @@ public:
   /// \param theOperation a committed operation
   void commitNestedSketch(ModuleBase_Operation* theOperation);
 
-  /// Appends into container of workshop selection filters
-  /// \param [out] selection filters
-  virtual void selectionFilters(SelectMgr_ListOfFilter& theSelectionFilters) const;
+  /// Returns true if the filter is created by the sketch manager
+  /// \param theFilterType a checked type
+  /// \return boolean value
+  bool sketchSelectionFilter(const PartSet_SelectionFilterType theFilterType);
+
+  /// Append selection filter into the module and type of the filter in internal container
+  /// \param theFilterType selection filter type
+  /// \param theFilter added filter
+  void registerSelectionFilter(const PartSet_SelectionFilterType theFilterType,
+                               const Handle(SelectMgr_Filter)& theFilter);
 
   /// Commit the operation if it is possible. If the operation is dimention constraint,
   /// it gives widget editor to input dimention value
@@ -437,8 +445,8 @@ private:
 
   CompositeFeaturePtr myCurrentSketch;
 
-  Handle(PartSet_CirclePointFilter) myCirclePointFilter;
-  Handle(ModuleBase_ShapeInPlaneFilter) myPlaneFilter;
+  std::set<PartSet_SelectionFilterType> mySelectionFilterTypes;
+
   FeatureToSelectionMap myCurrentSelection;
   bool myPreviousUpdateViewerEnabled;
 
index 74136ce7a4ceab6317515dfbaffdd78bd44b7d7f..fb8a9df78fc57d065b234694a568541f4fa2a364 100755 (executable)
@@ -60,18 +60,14 @@ PartSet_WidgetShapeSelector::~PartSet_WidgetShapeSelector()
 }
 
 //********************************************************************
-void PartSet_WidgetShapeSelector::selectionFilters(int& theModuleSelectionFilters,
+void PartSet_WidgetShapeSelector::selectionFilters(QIntList& theModuleSelectionFilters,
                                                    SelectMgr_ListOfFilter& theSelectionFilters)
 {
   ModuleBase_WidgetShapeSelector::selectionFilters(theModuleSelectionFilters, theSelectionFilters);
 
   if (!myUseSketchPlane) {
-    theModuleSelectionFilters = -1; // TODO!!!
-
-    //XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myWorkshop);
-    //PartSet_Module* aModule = dynamic_cast<PartSet_Module*>(aWorkshop->module());
-    //bool isUsePlaneFilterOnly = !toActivate;
-    //aModule->sketchMgr()->activatePlaneFilter(isUsePlaneFilterOnly);
+    if (theModuleSelectionFilters.contains(SF_SketchPlaneFilter))
+      theModuleSelectionFilters.removeAll(SF_SketchPlaneFilter);
   }
 }
 
index c7728e73e6ef394ac822ac50609b36d69f44700d..8bf7505ff979b3fb712c70413811a47d8fac5864 100644 (file)
@@ -57,7 +57,7 @@ Q_OBJECT
   /// Appends into container of workshop selection filters
   /// \param [out] theModuleSelectionFilters module additional modes, -1 means all default modes
   /// \param [out] theSelectionFilters selection filters
-  virtual void selectionFilters(int& theModuleSelectionFilters,
+  virtual void selectionFilters(QIntList& theModuleSelectionFilters,
                                 SelectMgr_ListOfFilter& theSelectionFilters);
 
 protected:
index 5a82272f4619177adefbfcaf9163fb2314680537..7f383d6efb676cea33b9196089339cbb671cf9f7 100644 (file)
@@ -534,10 +534,9 @@ void PartSet_WidgetSketchLabel::selectionModes(int& theModuleSelectionModes, QIn
     theModes << TopAbs_FACE;
 }
 
-void PartSet_WidgetSketchLabel::selectionFilters(int& theModuleSelectionFilters,
+void PartSet_WidgetSketchLabel::selectionFilters(QIntList& theModuleSelectionFilters,
                                                  SelectMgr_ListOfFilter& theSelectionFilters)
 {
-  theModuleSelectionFilters = -1;
   std::shared_ptr<GeomAPI_Pln> aPlane = plane();
   if (aPlane.get())
     return;
index 16b2b92b8f8de2bbf1036ff7878cbfaae8fbaf81..a87a70acf58c310a68aeaac9c853c8d3e8d39665 100644 (file)
@@ -81,7 +81,7 @@ public:
   /// Using widget selection filter only if plane is not defined.
   /// \param [out] theModuleSelectionFilters module additional modes, -1 means all default modes
   /// \param [out] selection filters
-  virtual void selectionFilters(int& theModuleSelectionFilters,
+  virtual void selectionFilters(QIntList& theModuleSelectionFilters,
                                 SelectMgr_ListOfFilter& theSelectionFilters);
 
   /// Returns list of widget controls
index 045be8ef68623a52e054403a15e1a5939e173c28..09d1cef22c812f08f0bf5330594b9a0ee2481501 100644 (file)
@@ -103,11 +103,12 @@ void XGUI_SelectionActivate::updateSelectionFilters()
   SelectMgr_ListOfFilter aSelectionFilters;
   switch (activeSelectionPlace()) {
     case Workshop:
-      myWorkshop->module()->moduleSelectionFilters(-1/*all filters*/, aSelectionFilters);
+      myWorkshop->module()->moduleSelectionFilters(myWorkshop->module()->selectionFilters(),
+        aSelectionFilters);
     break;
     case PropertyPanel: {
       ModuleBase_ModelWidget* anActiveWidget = myWorkshop->module()->activeWidget();
-      int aModuleSelectionFilters = -1;
+      QIntList aModuleSelectionFilters = myWorkshop->module()->selectionFilters();
       if (anActiveWidget)
         anActiveWidget->selectionFilters(aModuleSelectionFilters, aSelectionFilters);
       myWorkshop->module()->moduleSelectionFilters(aModuleSelectionFilters, aSelectionFilters);