From 33d191c57ab22ff6e84ea27e69537670d242d336 Mon Sep 17 00:00:00 2001 From: mpv Date: Thu, 25 Apr 2019 16:41:59 +0300 Subject: [PATCH] Update Filters data model using the previous filters implementation: filter arguments are standard attributes now. --- CMakeLists.txt | 1 + src/BuildPlugin/BuildPlugin_Shape.cpp | 7 +- src/BuildPlugin/BuildPlugin_Shape.h | 7 +- .../CollectionPlugin_Plugin.cpp | 3 +- src/CollectionPlugin/group_widget.xml | 1 + src/Config/Config_Keywords.h | 1 + src/Config/plugins.xml.in | 1 + src/FiltersPlugin/CMakeLists.txt | 62 +++ src/FiltersPlugin/FiltersPlugin.h | 37 ++ .../FiltersPlugin_HorizontalFace.cpp | 40 ++ .../FiltersPlugin_HorizontalFace.h | 51 ++ src/FiltersPlugin/FiltersPlugin_Plugin.cpp | 48 ++ src/FiltersPlugin/FiltersPlugin_Plugin.h | 41 ++ src/FiltersPlugin/FiltersPlugin_Selection.cpp | 75 +++ src/FiltersPlugin/FiltersPlugin_Selection.h | 81 +++ .../FiltersPlugin_VerticalFace.cpp | 40 ++ .../FiltersPlugin_VerticalFace.h | 51 ++ src/FiltersPlugin/plugin-Filters.xml | 11 + src/GeomValidators/GeomValidators_Plugin.cpp | 4 +- src/Model/CMakeLists.txt | 2 + src/Model/Model_Data.cpp | 79 ++- src/Model/Model_Data.h | 22 +- src/Model/Model_Filter.cpp | 98 ++++ src/Model/Model_Filter.h | 67 +++ src/Model/Model_Session.cpp | 7 + src/Model/Model_Session.h | 3 + src/ModelAPI/CMakeLists.txt | 1 + src/ModelAPI/ModelAPI_Data.h | 22 +- src/ModelAPI/ModelAPI_Filter.h | 144 ++++++ src/ModelAPI/ModelAPI_Session.h | 4 + src/ModuleBase/CMakeLists.txt | 3 + src/ModuleBase/ModuleBase_ChoiceCtrl.cpp | 2 +- src/ModuleBase/ModuleBase_WidgetFactory.cpp | 3 + .../ModuleBase_WidgetMultiSelector.cpp | 47 +- .../ModuleBase_WidgetMultiSelector.h | 2 + .../ModuleBase_WidgetSelectionFilter.cpp | 467 ++++++++++++++++++ .../ModuleBase_WidgetSelectionFilter.h | 148 ++++++ src/PartSet/PartSet_WidgetSketchCreator.cpp | 4 - src/XGUI/XGUI_ContextMenuMgr.cpp | 2 - src/XGUI/XGUI_DataModel.h | 1 - src/XGUI/XGUI_InspectionPanel.cpp | 3 - src/XGUI/XGUI_PropertyPanel.cpp | 18 +- src/XGUI/XGUI_PropertyPanel.h | 2 + src/XGUI/XGUI_Workshop.cpp | 6 + src/XGUI/XGUI_pictures.qrc | 5 + src/XGUI/pictures/accept.png | Bin 0 -> 1264 bytes src/XGUI/pictures/add.png | Bin 0 -> 3329 bytes src/XGUI/pictures/filter.png | Bin 0 -> 437 bytes src/XGUI/pictures/plus_minus.png | Bin 0 -> 505 bytes src/XGUI/pictures/stop.png | Bin 0 -> 1137 bytes 50 files changed, 1676 insertions(+), 48 deletions(-) create mode 100644 src/FiltersPlugin/CMakeLists.txt create mode 100644 src/FiltersPlugin/FiltersPlugin.h create mode 100644 src/FiltersPlugin/FiltersPlugin_HorizontalFace.cpp create mode 100644 src/FiltersPlugin/FiltersPlugin_HorizontalFace.h create mode 100644 src/FiltersPlugin/FiltersPlugin_Plugin.cpp create mode 100644 src/FiltersPlugin/FiltersPlugin_Plugin.h create mode 100644 src/FiltersPlugin/FiltersPlugin_Selection.cpp create mode 100644 src/FiltersPlugin/FiltersPlugin_Selection.h create mode 100644 src/FiltersPlugin/FiltersPlugin_VerticalFace.cpp create mode 100644 src/FiltersPlugin/FiltersPlugin_VerticalFace.h create mode 100644 src/FiltersPlugin/plugin-Filters.xml create mode 100644 src/Model/Model_Filter.cpp create mode 100644 src/Model/Model_Filter.h create mode 100644 src/ModelAPI/ModelAPI_Filter.h create mode 100644 src/ModuleBase/ModuleBase_WidgetSelectionFilter.cpp create mode 100644 src/ModuleBase/ModuleBase_WidgetSelectionFilter.h create mode 100644 src/XGUI/pictures/accept.png create mode 100644 src/XGUI/pictures/add.png create mode 100644 src/XGUI/pictures/filter.png create mode 100644 src/XGUI/pictures/plus_minus.png create mode 100644 src/XGUI/pictures/stop.png diff --git a/CMakeLists.txt b/CMakeLists.txt index 777a006d8..885152866 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -146,6 +146,7 @@ ADD_SUBDIRECTORY (src/PartSet) ADD_SUBDIRECTORY (src/XGUI) ADD_SUBDIRECTORY (src/ExchangePlugin) ADD_SUBDIRECTORY (src/GeomValidators) +ADD_SUBDIRECTORY (src/FiltersPlugin) ADD_SUBDIRECTORY (src/InitializationPlugin) ADD_SUBDIRECTORY (src/ParametersPlugin) ADD_SUBDIRECTORY (src/PythonAddons) diff --git a/src/BuildPlugin/BuildPlugin_Shape.cpp b/src/BuildPlugin/BuildPlugin_Shape.cpp index 60c273c59..e91ec9e80 100644 --- a/src/BuildPlugin/BuildPlugin_Shape.cpp +++ b/src/BuildPlugin/BuildPlugin_Shape.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2019 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 @@ -12,10 +12,9 @@ // // 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 +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "BuildPlugin_Shape.h" diff --git a/src/BuildPlugin/BuildPlugin_Shape.h b/src/BuildPlugin/BuildPlugin_Shape.h index e858ca142..693a9f2e4 100644 --- a/src/BuildPlugin/BuildPlugin_Shape.h +++ b/src/BuildPlugin/BuildPlugin_Shape.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2019 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 @@ -12,10 +12,9 @@ // // 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 +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef BuildPlugin_Shape_H_ diff --git a/src/CollectionPlugin/CollectionPlugin_Plugin.cpp b/src/CollectionPlugin/CollectionPlugin_Plugin.cpp index 172003088..7b0fc28e1 100644 --- a/src/CollectionPlugin/CollectionPlugin_Plugin.cpp +++ b/src/CollectionPlugin/CollectionPlugin_Plugin.cpp @@ -54,11 +54,10 @@ FeaturePtr CollectionPlugin_Plugin::createFeature(std::string theFeatureID) { if (theFeatureID == CollectionPlugin_Group::ID()) { return FeaturePtr(new CollectionPlugin_Group); - }else if (theFeatureID == CollectionPlugin_Field::ID()) { + } else if (theFeatureID == CollectionPlugin_Field::ID()) { return FeaturePtr(new CollectionPlugin_Field); } - // feature of such kind is not found return FeaturePtr(); } diff --git a/src/CollectionPlugin/group_widget.xml b/src/CollectionPlugin/group_widget.xml index 3a1f83feb..59bd93fb4 100644 --- a/src/CollectionPlugin/group_widget.xml +++ b/src/CollectionPlugin/group_widget.xml @@ -7,6 +7,7 @@ tooltip="Select a set of objects" type_choice="Vertices Edges Faces Solids" use_choice="true" + use_filters="FiltersSelection" clear_in_neutral_point="false" filter_points="false" same_topology="true"> diff --git a/src/Config/Config_Keywords.h b/src/Config/Config_Keywords.h index ca31903ec..ff7ee5c75 100644 --- a/src/Config/Config_Keywords.h +++ b/src/Config/Config_Keywords.h @@ -52,6 +52,7 @@ const static char* WDG_EXPR_EDITOR = "expr_editor"; const static char* WDG_PLACE_HOLDER = "placeholder"; const static char* WDG_ACTION = "action"; const static char* WDG_POINT_INPUT = "point_input"; +const static char* WDG_SELECTION_FILTERS = "selection_filters"; // Containers const static char* WDG_GROUP = "groupbox"; diff --git a/src/Config/plugins.xml.in b/src/Config/plugins.xml.in index 7734d59d8..87476727f 100644 --- a/src/Config/plugins.xml.in +++ b/src/Config/plugins.xml.in @@ -19,6 +19,7 @@ @ALL_SOLVERS@ --> +