1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: XGUI_Selection.h
4 // Created: 8 July 2014
5 // Author: Vitaly SMETANNIKOV
7 #ifndef XGUI_Selection_H
8 #define XGUI_Selection_H
12 #include <ModuleBase_ViewerPrs.h>
13 #include <ModuleBase_Definitions.h>
14 #include <ModuleBase_ISelection.h>
16 #include <QModelIndexList>
17 #include <AIS_ListOfInteractive.hxx>
18 #include <NCollection_List.hxx>
19 #include <TopoDS_Shape.hxx>
21 #include <SelectMgr_IndexedMapOfOwner.hxx>
25 class XGUI_EXPORT XGUI_Selection : public ModuleBase_ISelection
28 XGUI_Selection(XGUI_Workshop* theWorkshop);
30 /// Returns a list of viewer selected presentations
31 /// \param theShapeTypeToSkip the shapes with this type will be skipped during the result list build
32 /// \return list of presentations
33 virtual QList<ModuleBase_ViewerPrs> getSelected(int theShapeTypeToSkip = -1) const;
35 /// Returns a list of viewer highlited presentations
36 /// \param theShapeTypeToSkip the shapes with this type will be skipped during the result list build
37 /// \return list of presentations
38 virtual QList<ModuleBase_ViewerPrs> getHighlighted(int theShapeTypeToSkip = -1) const;
41 * Returns list of currently selected objects in object browser
43 virtual QObjectPtrList selectedObjects() const;
46 * Returns list of currently selected results
48 virtual QObjectPtrList selectedPresentations() const;
50 //! Returns list of currently selected QModelIndexes
51 virtual QModelIndexList selectedIndexes() const;
53 //! Returns list of currently selected AIS objects
54 virtual void selectedAISObjects(AIS_ListOfInteractive& theList) const;
56 //! Returns list of currently selected shapes
57 virtual void selectedShapes(NCollection_List<TopoDS_Shape>& theShapes,
58 std::list<ObjectPtr>& theOwners) const;
60 //! Returns list of currently selected owners
61 /// \return list of owners
62 void selectedOwners(SelectMgr_IndexedMapOfOwner& theSelectedOwners) const;
64 //! Returns a list of selection entity owners of the interactive object
65 /// It depends on the modes, in which the object is activated in the context
66 /// \param theObject an object
67 /// \param theOwners a map of entity owners
68 void entityOwners(const Handle_AIS_InteractiveObject& theObject,
69 SelectMgr_IndexedMapOfOwner& theOwners) const;
72 XGUI_Workshop* myWorkshop;