1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
4 * ModuleBase_WidgetMultiSelector.h
6 * Created on: Oct 8, 2014
10 #ifndef MODULEBASE_WIDGETMULTISELECTOR_H_
11 #define MODULEBASE_WIDGETMULTISELECTOR_H_
13 #include <ModuleBase.h>
14 #include <ModuleBase_ModelWidget.h>
16 #include <GeomAPI_Shape.h>
17 #include <ModelAPI_Result.h>
19 #include <NCollection_List.hxx>
20 #include <TopoDS_Shape.hxx>
24 #include <QStringList>
30 class ModuleBase_IWorkshop;
32 class MODULEBASE_EXPORT ModuleBase_WidgetMultiSelector : public ModuleBase_ModelWidget
36 ModuleBase_WidgetMultiSelector(QWidget* theParent,
37 ModuleBase_IWorkshop* theWorkshop,
38 const Config_WidgetAPI* theData,
39 const std::string& theParentId);
40 virtual ~ModuleBase_WidgetMultiSelector();
42 /// Saves the internal parameters to the given feature
43 /// \param theObject a model feature to be changed
44 virtual bool storeValue() const;
46 virtual bool restoreValue();
48 /// Returns the internal parent wiget control, that can be shown anywhere
49 /// \returns the widget
50 QWidget* getControl() const;
52 /// Returns list of widget controls
53 /// \return a control list
54 virtual QList<QWidget*> getControls() const;
56 virtual bool eventFilter(QObject* theObj, QEvent* theEvent);
59 void activateSelection(bool toActivate);
60 void onSelectionTypeChanged();
61 void onSelectionChanged();
64 void filterShapes(const NCollection_List<TopoDS_Shape>& theShapesToFilter,
65 NCollection_List<TopoDS_Shape>& theResult);
66 void setCurrentShapeType(const TopAbs_ShapeEnum theShapeType);
67 void activateShapeSelection();
70 void updateSelectionList();
72 QListWidget* myListControl;
73 QComboBox* myTypeCombo;
74 QWidget* myMainWidget;
76 //TODO: Move into the base of selectors
77 ModuleBase_IWorkshop* myWorkshop;
79 /// If true then local selector has to be activated in context
83 typedef QPair<ResultPtr, GeomShapePtr> GeomSelection;
84 QList<GeomSelection> mySelection;
87 #endif /* MODULEBASE_WIDGETFILESELECTOR_H_ */