]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModuleBase/ModuleBase_WidgetMultiSelector.h
Salome HOME
27.10.2014. Naming data structure for Extrusion feature.
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetMultiSelector.h
1 /*
2  * ModuleBase_WidgetMultiSelector.h
3  *
4  *  Created on: Oct 8, 2014
5  *      Author: sbh
6  */
7
8 #ifndef MODULEBASE_WIDGETMULTISELECTOR_H_
9 #define MODULEBASE_WIDGETMULTISELECTOR_H_
10
11 #include <ModuleBase.h>
12 #include <ModuleBase_ModelWidget.h>
13
14 #include <NCollection_List.hxx>
15 #include <TopoDS_Shape.hxx>
16
17 #include <QList>
18 #include <QString>
19 #include <QStringList>
20
21 class QWidget;
22 class QTextEdit;
23 class QComboBox;
24 class ModuleBase_IWorkshop;
25
26 class MODULEBASE_EXPORT ModuleBase_WidgetMultiSelector : public ModuleBase_ModelWidget
27 {
28   Q_OBJECT
29  public:
30   ModuleBase_WidgetMultiSelector(QWidget* theParent,
31                                  ModuleBase_IWorkshop* theWorkshop,
32                                  const Config_WidgetAPI* theData,
33                                  const std::string& theParentId);
34   virtual ~ModuleBase_WidgetMultiSelector();
35
36   /// Saves the internal parameters to the given feature
37   /// \param theObject a model feature to be changed
38   virtual bool storeValue() const;
39
40   virtual bool restoreValue();
41
42   /// Returns the internal parent wiget control, that can be shown anywhere
43   /// \returns the widget
44   QWidget* getControl() const;
45
46   /// Returns list of widget controls
47   /// \return a control list
48   virtual QList<QWidget*> getControls() const;
49
50   virtual bool eventFilter(QObject* theObj, QEvent* theEvent);
51
52  public slots:
53   void activateSelection(bool toActivate);
54   void onSelectionTypeChanged();
55   void onSelectionChanged();
56
57  protected:
58   void filterShapes(const NCollection_List<TopoDS_Shape>& theShapesToFilter,
59                     NCollection_List<TopoDS_Shape>& theResult);
60
61  private:
62   QTextEdit* myListControl;
63   QComboBox* myTypeCombo;
64   QWidget* myMainWidget;
65
66   //TODO: Move into the base of selectors
67   ModuleBase_IWorkshop* myWorkshop;
68
69   /// If true then local selector has to be activated in context
70   QStringList myShapeTypes;
71   bool myUseSubShapes;
72   bool myIsActive;
73 };
74
75 #endif /* MODULEBASE_WIDGETFILESELECTOR_H_ */