From bbef0297c85f81513744d7fa64a953cc223c8f4b Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 14 Dec 2017 10:26:21 +0300 Subject: [PATCH] Sketch shape in plane selection filter should not be activated while PartSet_WidgetShapeSelector do not use sketch plane by XML. Implemetation. --- src/ModuleBase/ModuleBase_IModule.h | 8 ++- src/ModuleBase/ModuleBase_ModelWidget.cpp | 3 +- src/ModuleBase/ModuleBase_ModelWidget.h | 2 +- src/ModuleBase/ModuleBase_WidgetValidated.cpp | 6 +- src/ModuleBase/ModuleBase_WidgetValidated.h | 2 +- src/ModuleBase/ModuleBase_WidgetValidator.cpp | 3 +- src/ModuleBase/ModuleBase_WidgetValidator.h | 2 +- src/PartSet/CMakeLists.txt | 1 + src/PartSet/PartSet_Module.cpp | 65 +++++++++++++++---- src/PartSet/PartSet_Module.h | 27 ++++++-- src/PartSet/PartSet_SelectionFilterType.h | 32 +++++++++ src/PartSet/PartSet_SketcherMgr.cpp | 32 ++++++--- src/PartSet/PartSet_SketcherMgr.h | 24 ++++--- src/PartSet/PartSet_WidgetShapeSelector.cpp | 10 +-- src/PartSet/PartSet_WidgetShapeSelector.h | 2 +- src/PartSet/PartSet_WidgetSketchLabel.cpp | 3 +- src/PartSet/PartSet_WidgetSketchLabel.h | 2 +- src/XGUI/XGUI_SelectionActivate.cpp | 5 +- 18 files changed, 168 insertions(+), 61 deletions(-) create mode 100644 src/PartSet/PartSet_SelectionFilterType.h diff --git a/src/ModuleBase/ModuleBase_IModule.h b/src/ModuleBase/ModuleBase_IModule.h index 66711b4c5..65d6088a1 100755 --- a/src/ModuleBase/ModuleBase_IModule.h +++ b/src/ModuleBase/ModuleBase_IModule.h @@ -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 diff --git a/src/ModuleBase/ModuleBase_ModelWidget.cpp b/src/ModuleBase/ModuleBase_ModelWidget.cpp index 097f5175d..50c7734d2 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.cpp +++ b/src/ModuleBase/ModuleBase_ModelWidget.cpp @@ -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); } diff --git a/src/ModuleBase/ModuleBase_ModelWidget.h b/src/ModuleBase/ModuleBase_ModelWidget.h index d4ecf3f89..0c0dddece 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.h +++ b/src/ModuleBase/ModuleBase_ModelWidget.h @@ -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 diff --git a/src/ModuleBase/ModuleBase_WidgetValidated.cpp b/src/ModuleBase/ModuleBase_WidgetValidated.cpp index d1bebe79f..e60685b0c 100644 --- a/src/ModuleBase/ModuleBase_WidgetValidated.cpp +++ b/src/ModuleBase/ModuleBase_WidgetValidated.cpp @@ -19,6 +19,7 @@ // #include +#include #include #include #include @@ -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()); } diff --git a/src/ModuleBase/ModuleBase_WidgetValidated.h b/src/ModuleBase/ModuleBase_WidgetValidated.h index 502ae5dad..afff4dc67 100644 --- a/src/ModuleBase/ModuleBase_WidgetValidated.h +++ b/src/ModuleBase/ModuleBase_WidgetValidated.h @@ -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 diff --git a/src/ModuleBase/ModuleBase_WidgetValidator.cpp b/src/ModuleBase/ModuleBase_WidgetValidator.cpp index d0b2b5ce1..8953db0b5 100755 --- a/src/ModuleBase/ModuleBase_WidgetValidator.cpp +++ b/src/ModuleBase/ModuleBase_WidgetValidator.cpp @@ -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()); } diff --git a/src/ModuleBase/ModuleBase_WidgetValidator.h b/src/ModuleBase/ModuleBase_WidgetValidator.h index 3a84b0658..8c7c927a9 100755 --- a/src/ModuleBase/ModuleBase_WidgetValidator.h +++ b/src/ModuleBase/ModuleBase_WidgetValidator.h @@ -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 diff --git a/src/PartSet/CMakeLists.txt b/src/PartSet/CMakeLists.txt index 8bb95e123..36a107106 100644 --- a/src/PartSet/CMakeLists.txt +++ b/src/PartSet/CMakeLists.txt @@ -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 diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index fe9e50e37..8951ac04b 100755 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -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::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::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::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)(); } //****************************************************** diff --git a/src/PartSet/PartSet_Module.h b/src/PartSet/PartSet_Module.h index 8a74b5854..153c715c7 100755 --- a/src/PartSet/PartSet_Module.h +++ b/src/PartSet/PartSet_Module.h @@ -24,6 +24,7 @@ #include "PartSet.h" #include "PartSet_Tools.h" #include "PartSet_OverconstraintListener.h" +#include "PartSet_SelectionFilterType.h" #include "PartSet_SketcherMgr.h" #include @@ -37,15 +38,16 @@ //#include #include #include +#include #include #include #include #include -#include - +#include #include +#include 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 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 index 000000000..21ce8b131 --- /dev/null +++ b/src/PartSet/PartSet_SelectionFilterType.h @@ -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 +// + +#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 diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index f385a47df..68045ed3e 100755 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -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 #include #include +#include #include @@ -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 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& thePln) +void PartSet_SketcherMgr::onPlaneSelected(const std::shared_ptr& 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(); } diff --git a/src/PartSet/PartSet_SketcherMgr.h b/src/PartSet/PartSet_SketcherMgr.h index 07e44783a..578ada7b0 100644 --- a/src/PartSet/PartSet_SketcherMgr.h +++ b/src/PartSet/PartSet_SketcherMgr.h @@ -23,16 +23,15 @@ #include "PartSet.h" -#include "PartSet_Filters.h" -#include "PartSet_Tools.h" #include "PartSet_PreviewSketchPlane.h" +#include "PartSet_SelectionFilterType.h" +#include "PartSet_Tools.h" #include #include #include #include -#include #include #include @@ -48,6 +47,8 @@ #include #include +#include + 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 mySelectionFilterTypes; + FeatureToSelectionMap myCurrentSelection; bool myPreviousUpdateViewerEnabled; diff --git a/src/PartSet/PartSet_WidgetShapeSelector.cpp b/src/PartSet/PartSet_WidgetShapeSelector.cpp index 74136ce7a..fb8a9df78 100755 --- a/src/PartSet/PartSet_WidgetShapeSelector.cpp +++ b/src/PartSet/PartSet_WidgetShapeSelector.cpp @@ -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(aWorkshop->module()); - //bool isUsePlaneFilterOnly = !toActivate; - //aModule->sketchMgr()->activatePlaneFilter(isUsePlaneFilterOnly); + if (theModuleSelectionFilters.contains(SF_SketchPlaneFilter)) + theModuleSelectionFilters.removeAll(SF_SketchPlaneFilter); } } diff --git a/src/PartSet/PartSet_WidgetShapeSelector.h b/src/PartSet/PartSet_WidgetShapeSelector.h index c7728e73e..8bf7505ff 100644 --- a/src/PartSet/PartSet_WidgetShapeSelector.h +++ b/src/PartSet/PartSet_WidgetShapeSelector.h @@ -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: diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index 5a82272f4..7f383d6ef 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -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 aPlane = plane(); if (aPlane.get()) return; diff --git a/src/PartSet/PartSet_WidgetSketchLabel.h b/src/PartSet/PartSet_WidgetSketchLabel.h index 16b2b92b8..a87a70acf 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.h +++ b/src/PartSet/PartSet_WidgetSketchLabel.h @@ -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 diff --git a/src/XGUI/XGUI_SelectionActivate.cpp b/src/XGUI/XGUI_SelectionActivate.cpp index 045be8ef6..09d1cef22 100644 --- a/src/XGUI/XGUI_SelectionActivate.cpp +++ b/src/XGUI/XGUI_SelectionActivate.cpp @@ -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); -- 2.39.2