Salome HOME
5c3eb4a41309299f28ba1b538dc54e750b50385f
[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 * Implementation of \ref ModuleBase_ISelection interface.
27 */
28 class XGUI_EXPORT XGUI_Selection : public ModuleBase_ISelection
29 {
30  public:
31    /// Constructor
32    /// \param theWorkshop reference to workshop instance
33   XGUI_Selection(XGUI_Workshop* theWorkshop);
34
35   /// Returns a list of viewer selected 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> getSelected(int theShapeTypeToSkip = -1) const;
39
40   /// Returns a list of viewer highlited presentations
41   /// \param theShapeTypeToSkip the shapes with this type will be skipped during the result list build
42   /// \return list of presentations
43   virtual QList<ModuleBase_ViewerPrs> getHighlighted(int theShapeTypeToSkip = -1) const;
44
45   /**
46    * Returns list of currently selected objects in object browser
47    */
48   virtual QObjectPtrList selectedObjects() const;
49
50   /**
51    * Returns list of currently selected results
52    */
53   virtual QObjectPtrList selectedPresentations() const;
54
55   //! Returns list of currently selected QModelIndexes
56   virtual QModelIndexList selectedIndexes() const;
57
58   //! Returns list of currently selected AIS objects
59   virtual void selectedAISObjects(AIS_ListOfInteractive& theList) const;
60
61   //! Returns list of currently selected shapes
62   virtual void selectedShapes(NCollection_List<TopoDS_Shape>& theShapes, 
63     std::list<ObjectPtr>& theOwners) const;
64
65   //! Returns list of currently selected owners
66   /// \return list of owners
67   void selectedOwners(SelectMgr_IndexedMapOfOwner& theSelectedOwners) const;
68
69   //! Returns a list of selection entity owners of the interactive object
70   /// It depends on the modes, in which the object is activated in the context
71   /// \param theObject an object
72   /// \param theOwners a map of entity owners
73   void entityOwners(const Handle_AIS_InteractiveObject& theObject,
74                     SelectMgr_IndexedMapOfOwner& theOwners) const;
75
76  private:
77   XGUI_Workshop* myWorkshop;
78 };
79
80 #endif