Salome HOME
Issue #326 Distance constraint on 2 preselected segments problem
[modules/shaper.git] / src / XGUI / XGUI_SelectionMgr.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 #ifndef XGUI_SelectionMgr_H
4 #define XGUI_SelectionMgr_H
5
6 #include "XGUI.h"
7 #include <ModuleBase_Definitions.h>
8 #include <QObject>
9 #include <QModelIndexList>
10
11 #include <AIS_ListOfInteractive.hxx>
12 #include <NCollection_List.hxx>
13 #include <TopoDS_Shape.hxx>
14 #include <SelectMgr_IndexedMapOfOwner.hxx>
15
16 class XGUI_Workshop;
17 class XGUI_ObjectsBrowser;
18 class XGUI_Selection;
19
20 /**\class XGUI_SelectionMgr
21  * \ingroup GUI
22  * \brief Selection manager. Provides selection event on selection in 
23  * Object Browser and Viewer
24  */
25 class XGUI_EXPORT XGUI_SelectionMgr : public QObject
26 {
27 Q_OBJECT
28  public:
29   XGUI_SelectionMgr(XGUI_Workshop* theParent);
30   virtual ~XGUI_SelectionMgr();
31
32   XGUI_Selection* selection() const
33   {
34     return mySelection;
35   }
36
37   //! Connects the manager to all viewers accessible by Workshop
38   void connectViewers();
39
40   //! Selects the owners in the context.
41   //! \param theSelectedOwners a container of owners
42   /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
43   void setSelectedOwners(const SelectMgr_IndexedMapOfOwner& theSelectedOwners,
44                          bool isUpdateViewer);
45
46   //! Check that the selected owners are valid for the current filters
47   /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
48   void updateSelectedOwners(bool isUpdateViewer);
49
50 signals:
51   //! Emited when selection in a one of viewers was changed
52   void selectionChanged();
53
54  private slots:
55   void onObjectBrowserSelection();
56   void onViewerSelection();
57
58  private:
59   XGUI_Workshop* myWorkshop;
60   XGUI_Selection* mySelection;
61 };
62
63 #endif