/// \param theSelectionFilters [out] container of type value
virtual QIntList selectionFilters() { return QIntList(); }
+ /// Returns selection filter
+ /// \param theType selection filter type
+ /// \param theFilter instance of filter
+ virtual Handle(SelectMgr_Filter) selectionFilter(const int theType) = 0;
+
/// 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
PartSet_PreviewPlanes.h
PartSet_PreviewSketchPlane.h
PartSet_ResultSketchPrs.h
- PartSet_SelectionFilterType.h
PartSet_SketcherMgr.h
PartSet_SketcherReentrantMgr.h
PartSet_Tools.h
//******************************************************
PartSet_Module::~PartSet_Module()
{
- std::map<PartSet_SelectionFilterType, Handle(SelectMgr_Filter)>::const_iterator aFiltersIt =
+ std::map<XGUI_SelectionFilterType, Handle(SelectMgr_Filter)>::const_iterator aFiltersIt =
mySelectionFilters.begin();
for (; aFiltersIt != mySelectionFilters.end(); aFiltersIt++) {
Handle(SelectMgr_Filter) aFilter = aFiltersIt->second;
SelectMgr_ListOfFilter& theSelectionFilters)
{
bool isSketchActive = mySketchMgr->activeSketch();
- XGUI_ActiveControlSelector* anActiveSelector =
- getWorkshop()->activeControlMgr()->activeSelector();
- bool isHideFacesActive = anActiveSelector &&
- anActiveSelector->getType() == XGUI_FacesPanelSelector::Type();
- std::map<PartSet_SelectionFilterType, Handle(SelectMgr_Filter)>::const_iterator aFiltersIt =
+ std::map<XGUI_SelectionFilterType, Handle(SelectMgr_Filter)>::const_iterator aFiltersIt =
mySelectionFilters.begin();
for (; aFiltersIt != mySelectionFilters.end(); aFiltersIt++) {
int aFilterType = aFiltersIt->first;
// using sketch filters only if sketch operation is active
if (!isSketchActive &&
- mySketchMgr->sketchSelectionFilter((PartSet_SelectionFilterType)aFilterType))
+ mySketchMgr->sketchSelectionFilter((XGUI_SelectionFilterType)aFilterType))
continue;
- // using filtering of construction results only when faces panel is active
- if (aFilterType == SF_ResultGroupNameFilter && !isHideFacesActive)
+ // using filtering of construction results only from faces panel
+ if (aFilterType == SF_ResultGroupNameFilter)
continue;
theSelectionFilters.Append(aFiltersIt->second);
{
QIntList aTypes;
- std::map<PartSet_SelectionFilterType, Handle(SelectMgr_Filter)>::const_iterator aFiltersIt =
+ std::map<XGUI_SelectionFilterType, Handle(SelectMgr_Filter)>::const_iterator aFiltersIt =
mySelectionFilters.begin();
for (; aFiltersIt != mySelectionFilters.end(); aFiltersIt++)
aTypes.append(aFiltersIt->first);
}
//******************************************************
-void PartSet_Module::registerSelectionFilter(const PartSet_SelectionFilterType theFilterType,
+void PartSet_Module::registerSelectionFilter(const XGUI_SelectionFilterType theFilterType,
const Handle(SelectMgr_Filter)& theFilter)
{
mySelectionFilters[theFilterType] = theFilter;
}
//******************************************************
-Handle(SelectMgr_Filter) PartSet_Module::selectionFilter(
- const PartSet_SelectionFilterType theFilterType)
+Handle(SelectMgr_Filter) PartSet_Module::selectionFilter(const int theType)
{
- if (mySelectionFilters.find(theFilterType) != mySelectionFilters.end())
- return mySelectionFilters[theFilterType];
+ XGUI_SelectionFilterType aType = (XGUI_SelectionFilterType)theType;
+
+ if (mySelectionFilters.find(aType) != mySelectionFilters.end())
+ return mySelectionFilters[aType];
else
return Handle(SelectMgr_Filter)();
}
#include "PartSet.h"
#include "PartSet_Tools.h"
#include "PartSet_OverconstraintListener.h"
-#include "PartSet_SelectionFilterType.h"
+#include "XGUI_SelectionFilterType.h"
#include "PartSet_SketcherMgr.h"
#include <ModuleBase_IModule.h>
/// 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,
+ void registerSelectionFilter(const XGUI_SelectionFilterType theFilterType,
const Handle(SelectMgr_Filter)& theFilter);
/// Returns selection filter
- /// \param theFilterType selection filter type
+ /// \param theType selection filter type
/// \param theFilter instance of filter
- Handle(SelectMgr_Filter) selectionFilter(const PartSet_SelectionFilterType theFilterType);
+ virtual Handle(SelectMgr_Filter) selectionFilter(const int theType);
/// Returns whether the mouse enter the viewer's window
/// \return true if items are added and there is no necessity to provide standard menu
private:
bool myIsOperationIsLaunched; /// state of application between launch and stop operation
- std::map<PartSet_SelectionFilterType, Handle(SelectMgr_Filter)> mySelectionFilters;
+ std::map<XGUI_SelectionFilterType, Handle(SelectMgr_Filter)> mySelectionFilters;
PartSet_SketcherMgr* mySketchMgr;
PartSet_SketcherReentrantMgr* mySketchReentrantMgr;
+++ /dev/null
-// 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_ResultGroupNameFilter, /// filter for selection some kind of results
- SF_SketchCirclePointFilter, /// filter for selection circle points on current sketch
- SF_SketchPlaneFilter /// filter for selection in the current sketch plane only
-};
-
-#endif
}
}
-bool PartSet_SketcherMgr::sketchSelectionFilter(const PartSet_SelectionFilterType theFilterType)
+bool PartSet_SketcherMgr::sketchSelectionFilter(const XGUI_SelectionFilterType theFilterType)
{
return mySelectionFilterTypes.find(theFilterType) != mySelectionFilterTypes.end();
}
-void PartSet_SketcherMgr::registerSelectionFilter(const PartSet_SelectionFilterType theFilterType,
+void PartSet_SketcherMgr::registerSelectionFilter(const XGUI_SelectionFilterType theFilterType,
const Handle(SelectMgr_Filter)& theFilter)
{
mySelectionFilterTypes.insert(theFilterType);
#include "PartSet.h"
#include "PartSet_PreviewSketchPlane.h"
-#include "PartSet_SelectionFilterType.h"
+#include "XGUI_SelectionFilterType.h"
#include "PartSet_Tools.h"
#include <ModelAPI_Feature.h>
/// 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);
+ bool sketchSelectionFilter(const XGUI_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,
+ void registerSelectionFilter(const XGUI_SelectionFilterType theFilterType,
const Handle(SelectMgr_Filter)& theFilter);
/// Commit the operation if it is possible. If the operation is dimention constraint,
CompositeFeaturePtr myCurrentSketch;
- std::set<PartSet_SelectionFilterType> mySelectionFilterTypes;
+ std::set<XGUI_SelectionFilterType> mySelectionFilterTypes;
FeatureToSelectionMap myCurrentSelection;
bool myPreviousUpdateViewerEnabled;
XGUI_SalomeConnector.h
XGUI_Selection.h
XGUI_SelectionActivate.h
+ XGUI_SelectionFilterType.h
XGUI_SelectionMgr.h
XGUI_Tools.h
XGUI_TransparencyWidget.h
#include "XGUI_ActiveControlMgr.h"
#include "XGUI_ActiveControlSelector.h"
#include "XGUI_SelectionActivate.h"
+#include "XGUI_SelectionMgr.h"
#include "XGUI_Tools.h"
#include "XGUI_Workshop.h"
#include <ModelAPI_Events.h>
+#include <ModuleBase_IModule.h>
#include <ModuleBase_ISelection.h>
#include "ModuleBase_IWorkshop.h"
#include "ModuleBase_ListView.h"
#include "ModuleBase_Tools.h"
#include "ModuleBase_ViewerPrs.h"
+#include "XGUI_SelectionMgr.h"
+#include "XGUI_SelectionFilterType.h"
#include "XGUI_Tools.h"
#include "XGUI_Workshop.h"
theModes.append(TopAbs_FACE);
}
+//********************************************************************
+void XGUI_FacesPanel::selectionFilters(SelectMgr_ListOfFilter& theSelectionFilters)
+{
+ ModuleBase_IModule* aModule = myWorkshop->module();
+ QIntList aModuleSelectionFilters = myWorkshop->module()->selectionFilters();
+
+ theSelectionFilters.Append(aModule->selectionFilter(SF_GlobalFilter));
+ theSelectionFilters.Append(aModule->selectionFilter(SF_FilterInfinite));
+ theSelectionFilters.Append(aModule->selectionFilter(SF_ResultGroupNameFilter));
+}
+
//********************************************************************
bool XGUI_FacesPanel::eventFilter(QObject* theObject, QEvent *theEvent)
{
ModuleBase_Tools::setShadowEffect(myListView->getControl(), theIsActive);
myIsActive = theIsActive;
- if (myIsActive)
+ if (myIsActive) {
+ // the selection is cleared by activating selection control
+ XGUI_Tools::workshop(myWorkshop)->selector()->clearSelection();
emit activated();
+ }
else
emit deactivated();
}
/// Appends into container of workshop selection filters
/// \param [out] selection filters
- void selectionFilters(SelectMgr_ListOfFilter& theSelectionFilters) {}
+ void selectionFilters(SelectMgr_ListOfFilter& theSelectionFilters);
/// Returns whether the panel is active or not
bool isActivePanel() const { return myIsActive; }
void XGUI_SelectionActivate::updateSelectionFilters()
{
SelectMgr_ListOfFilter aSelectionFilters;
- QIntList aModuleSelectionFilters = myWorkshop->module()->selectionFilters();
switch (activeSelectionPlace()) {
- case Workshop:
+ case Workshop: {
+ QIntList aModuleSelectionFilters = myWorkshop->module()->selectionFilters();
myWorkshop->module()->moduleSelectionFilters(aModuleSelectionFilters, aSelectionFilters);
-
+ }
break;
case PropertyPanel: {
+ QIntList aModuleSelectionFilters = myWorkshop->module()->selectionFilters();
+
ModuleBase_ModelWidget* anActiveWidget = myWorkshop->module()->activeWidget();
if (anActiveWidget)
anActiveWidget->selectionFilters(aModuleSelectionFilters, aSelectionFilters);
break;
case FacesPanel: {
XGUI_Tools::workshop(myWorkshop)->facesPanel()->selectionFilters(aSelectionFilters);
- myWorkshop->module()->moduleSelectionFilters(aModuleSelectionFilters, aSelectionFilters);
+ //QIntList aModuleSelectionFilters = myWorkshop->module()->selectionFilters();
+ //myWorkshop->module()->moduleSelectionFilters(aModuleSelectionFilters, aSelectionFilters);
}
break;
default: break;
--- /dev/null
+// 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 XGUI_SelectionFilterType_H
+#define XGUI_SelectionFilterType_H
+
+#include "XGUI.h"
+
+/// Enumeration to specify module selection filters
+enum XGUI_EXPORT XGUI_SelectionFilterType {
+ SF_GlobalFilter, /// filter for different documents, group results
+ SF_FilterInfinite, /// filter for infinite construction results
+ SF_ResultGroupNameFilter, /// filter for selection some kind of results
+ SF_SketchCirclePointFilter, /// filter for selection circle points on current sketch
+ SF_SketchPlaneFilter /// filter for selection in the current sketch plane only
+};
+
+#endif