Salome HOME
Some slight improvements and bugs fixing.
[modules/shaper.git] / src / XGUI / XGUI_SelectionMgr.h
1 #ifndef XGUI_SelectionMgr_H
2 #define XGUI_SelectionMgr_H
3
4 #include "XGUI.h"
5 #include <ModuleBase_Definitions.h>
6 #include <QObject>
7 #include <QModelIndexList>
8
9 #include <AIS_ListOfInteractive.hxx>
10 #include <NCollection_List.hxx>
11 #include <TopoDS_Shape.hxx>
12
13 class XGUI_Workshop;
14 class XGUI_ObjectsBrowser;
15
16 /**\class XGUI_SelectionMgr
17  * \ingroup GUI
18  * \brief Selection manager. Provides selection event on selection in 
19  * Object Browser and Viewer
20  */
21 class XGUI_EXPORT XGUI_SelectionMgr : public QObject
22 {
23   Q_OBJECT
24 public:
25   XGUI_SelectionMgr(XGUI_Workshop* theParent);
26   virtual ~XGUI_SelectionMgr();
27
28   //! Returns list of currently selected data objects
29   QFeatureList selectedFeatures() const; 
30   
31   //! Returns list of currently selected QModelIndexes
32   QModelIndexList selectedIndexes() const;
33
34   //! Returns list of currently selected AIS objects
35   void selectedAISObjects(AIS_ListOfInteractive& theList) const;
36
37   //! Returns list of currently selected shapes
38   void selectedShapes(NCollection_List<TopoDS_Shape>& theList) const;
39
40   //! Connects the manager to all viewers accessible by Workshop
41   void connectViewers();
42
43 signals:
44   //! Emited when selection in a one of viewers was changed
45   void selectionChanged();
46
47 private slots:
48   void onObjectBrowserSelection();
49   void onViewerSelection();
50
51 private:
52
53   XGUI_Workshop* myWorkshop;
54 };
55
56 #endif