1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 #ifndef XGUI_SelectionMgr_H
4 #define XGUI_SelectionMgr_H
7 #include <ModuleBase_Definitions.h>
8 #include <ModuleBase_ISelection.h>
10 #include <QModelIndexList>
12 #include <AIS_ListOfInteractive.hxx>
13 #include <NCollection_List.hxx>
14 #include <TopoDS_Shape.hxx>
15 #include <SelectMgr_IndexedMapOfOwner.hxx>
18 class XGUI_ObjectsBrowser;
21 /**\class XGUI_SelectionMgr
23 * \brief Selection manager. Provides selection event on selection in
24 * Object Browser and Viewer
26 class XGUI_EXPORT XGUI_SelectionMgr : public QObject
31 /// \param theParent a parent workshop
32 XGUI_SelectionMgr(XGUI_Workshop* theParent);
33 virtual ~XGUI_SelectionMgr();
35 /// Returns current selection
36 XGUI_Selection* selection() const
41 //! Connects the manager to all viewers accessible by Workshop
42 void connectViewers();
44 //! Selects the owners in the context.
45 //! \param theSelectedOwners a container of owners
46 /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
47 void setSelectedOwners(const SelectMgr_IndexedMapOfOwner& theSelectedOwners,
50 //! Clears selection in Viewer and object Browser
51 void clearSelection();
53 /// Updates selection, which are depend on the selection in the given place
54 /// \param thePlace a widget where selection has happened.
55 void updateSelectionBy(const ModuleBase_ISelection::SelectionPlace& thePlace);
58 //! Emited when selection in a one of viewers was changed
59 void selectionChanged();
62 /// Reaction on selectio0n in Object browser
63 void onObjectBrowserSelection();
65 /// Reaction on selectio0n in Viewer
66 void onViewerSelection();
69 /// Reference to workshop
70 XGUI_Workshop* myWorkshop;
72 /// Current selection object
73 XGUI_Selection* mySelection;