2 * ModuleBase_WidgetMultiSelector.h
4 * Created on: Oct 8, 2014
8 #ifndef MODULEBASE_WIDGETMULTISELECTOR_H_
9 #define MODULEBASE_WIDGETMULTISELECTOR_H_
11 #include <ModuleBase.h>
12 #include <ModuleBase_ModelWidget.h>
14 #include <GeomAPI_Shape.h>
15 #include <ModelAPI_Result.h>
17 #include <NCollection_List.hxx>
18 #include <TopoDS_Shape.hxx>
22 #include <QStringList>
28 class ModuleBase_IWorkshop;
30 class MODULEBASE_EXPORT ModuleBase_WidgetMultiSelector : public ModuleBase_ModelWidget
34 ModuleBase_WidgetMultiSelector(QWidget* theParent,
35 ModuleBase_IWorkshop* theWorkshop,
36 const Config_WidgetAPI* theData,
37 const std::string& theParentId);
38 virtual ~ModuleBase_WidgetMultiSelector();
40 /// Saves the internal parameters to the given feature
41 /// \param theObject a model feature to be changed
42 virtual bool storeValue() const;
44 virtual bool restoreValue();
46 /// Returns the internal parent wiget control, that can be shown anywhere
47 /// \returns the widget
48 QWidget* getControl() const;
50 /// Returns list of widget controls
51 /// \return a control list
52 virtual QList<QWidget*> getControls() const;
54 virtual bool eventFilter(QObject* theObj, QEvent* theEvent);
57 void activateSelection(bool toActivate);
58 void onSelectionTypeChanged();
59 void onSelectionChanged();
62 void filterShapes(const NCollection_List<TopoDS_Shape>& theShapesToFilter,
63 NCollection_List<TopoDS_Shape>& theResult);
66 void updateSelectionList();
68 QListWidget* myListControl;
69 QComboBox* myTypeCombo;
70 QWidget* myMainWidget;
72 //TODO: Move into the base of selectors
73 ModuleBase_IWorkshop* myWorkshop;
75 /// If true then local selector has to be activated in context
76 QStringList myShapeTypes;
80 typedef QPair<ResultPtr, GeomShapePtr> GeomSelection;
81 QList<GeomSelection> mySelection;
84 #endif /* MODULEBASE_WIDGETFILESELECTOR_H_ */