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 //! Check that the selected owners are valid for the current filters
51 /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
52 void updateSelectedOwners(bool isUpdateViewer);
54 //! Clears selection in Viewer and object Browser
55 void clearSelection();
57 /// Updates selection, which are depend on the selection in the given place
58 /// \thePlace a widget where selection has happened.
59 void updateSelectionBy(const ModuleBase_ISelection::SelectionPlace& thePlace);
62 //! Emited when selection in a one of viewers was changed
63 void selectionChanged();
66 /// Reaction on selectio0n in Object browser
67 void onObjectBrowserSelection();
69 /// Reaction on selectio0n in Viewer
70 void onViewerSelection();
73 /// Reference to workshop
74 XGUI_Workshop* myWorkshop;
76 /// Current selection object
77 XGUI_Selection* mySelection;