Salome HOME
Key_Delete shortcut for both delete action - 1. workshop, 2. partset module.
[modules/shaper.git] / src / XGUI / XGUI_Selection.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        XGUI_Selection.h
4 // Created:     8 July 2014
5 // Author:      Vitaly SMETANNIKOV
6
7 #ifndef XGUI_Selection_H
8 #define XGUI_Selection_H
9
10 #include "XGUI.h"
11
12 #include <ModuleBase_ViewerPrs.h>
13 #include <ModuleBase_Definitions.h>
14 #include <ModuleBase_ISelection.h>
15
16 #include <QModelIndexList>
17 #include <AIS_ListOfInteractive.hxx>
18 #include <NCollection_List.hxx>
19 #include <TopoDS_Shape.hxx>
20
21 #include <SelectMgr_IndexedMapOfOwner.hxx>
22
23 class XGUI_Workshop;
24
25 /**
26 * \ingroup GUI
27 * Implementation of \ref ModuleBase_ISelection interface.
28 */
29 class XGUI_EXPORT XGUI_Selection : public ModuleBase_ISelection
30 {
31  public:
32    /// Constructor
33    /// \param theWorkshop reference to workshop instance
34   XGUI_Selection(XGUI_Workshop* theWorkshop);
35
36   /// Returns a list of viewer selected presentations
37   /// \param theShapeTypeToSkip the shapes with this type will be skipped during the result list build
38   /// \return list of presentations
39   virtual QList<ModuleBase_ViewerPrs> getSelected(int theShapeTypeToSkip = -1) const;
40
41   /// Returns a list of viewer highlited presentations
42   /// \param theShapeTypeToSkip the shapes with this type will be skipped during the result list build
43   /// \return list of presentations
44   virtual QList<ModuleBase_ViewerPrs> getHighlighted(int theShapeTypeToSkip = -1) const;
45
46   /**
47    * Returns list of currently selected objects in object browser
48    */
49   virtual QObjectPtrList selectedObjects() const;
50
51   /**
52    * Returns list of currently selected results
53    */
54   virtual QObjectPtrList selectedPresentations() const;
55
56   //! Returns list of currently selected QModelIndexes
57   virtual QModelIndexList selectedIndexes() const;
58
59   //! Returns list of currently selected AIS objects
60   virtual void selectedAISObjects(AIS_ListOfInteractive& theList) const;
61
62   //! Returns list of currently selected shapes
63   virtual void selectedShapes(NCollection_List<TopoDS_Shape>& theShapes, 
64     std::list<ObjectPtr>& theOwners) const;
65
66   //! Returns list of currently selected owners
67   /// \return list of owners
68   void selectedOwners(SelectMgr_IndexedMapOfOwner& theSelectedOwners) const;
69
70   //! Returns a list of selection entity owners of the interactive object
71   /// It depends on the modes, in which the object is activated in the context
72   /// \param theObject an object
73   /// \param theOwners a map of entity owners
74   void entityOwners(const Handle_AIS_InteractiveObject& theObject,
75                     SelectMgr_IndexedMapOfOwner& theOwners) const;
76
77  private:
78   XGUI_Workshop* myWorkshop;
79 };
80
81 #endif