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>
18 #include <ModelAPI_AttributeSelectionList.h>
20 #include <NCollection_List.hxx>
21 #include <TopoDS_Shape.hxx>
25 #include <QStringList>
31 class ModuleBase_IWorkshop;
33 class MODULEBASE_EXPORT ModuleBase_WidgetMultiSelector : public ModuleBase_ModelWidget
37 ModuleBase_WidgetMultiSelector(QWidget* theParent,
38 ModuleBase_IWorkshop* theWorkshop,
39 const Config_WidgetAPI* theData,
40 const std::string& theParentId);
41 virtual ~ModuleBase_WidgetMultiSelector();
43 /// Saves the internal parameters to the given feature
44 /// \param theObject a model feature to be changed
45 virtual bool storeValue() const;
47 virtual bool restoreValue();
49 /// Returns the internal parent wiget control, that can be shown anywhere
50 /// \returns the widget
51 QWidget* getControl() const;
53 /// Returns list of widget controls
54 /// \return a control list
55 virtual QList<QWidget*> getControls() const;
57 virtual bool eventFilter(QObject* theObj, QEvent* theEvent);
60 void activateSelection(bool toActivate);
61 void onSelectionTypeChanged();
62 void onSelectionChanged();
65 void filterShapes(const NCollection_List<TopoDS_Shape>& theShapesToFilter,
66 NCollection_List<TopoDS_Shape>& theResult);
67 void setCurrentShapeType(const TopAbs_ShapeEnum theShapeType);
68 void activateShapeSelection();
71 void updateSelectionList(AttributeSelectionListPtr);
73 QListWidget* myListControl;
74 QComboBox* myTypeCombo;
75 QWidget* myMainWidget;
77 //TODO: Move into the base of selectors
78 ModuleBase_IWorkshop* myWorkshop;
80 /// If true then local selector has to be activated in context
84 typedef QPair<ResultPtr, GeomShapePtr> GeomSelection;
85 QList<GeomSelection> mySelection;
88 #endif /* MODULEBASE_WIDGETFILESELECTOR_H_ */