]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/XGUI_Selection.h
Salome HOME
9d6848ccd659fdcff401fe75b01efc5fd64d4708
[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 class Handle_SelectMgr_EntityOwner;
25
26 /**
27 * \ingroup GUI
28 * Implementation of \ref ModuleBase_ISelection interface.
29 */
30 class XGUI_EXPORT XGUI_Selection : public ModuleBase_ISelection
31 {
32  public:
33    /// Constructor
34    /// \param theWorkshop reference to workshop instance
35   XGUI_Selection(XGUI_Workshop* theWorkshop);
36
37   /// Returns a list of viewer selected presentations
38   /// \return list of presentations
39   virtual QList<ModuleBase_ViewerPrs> getSelected() const;
40
41   /// Fills the viewer presentation parameters by the parameters from the owner
42   /// \param thePrs a container for selection
43   /// \param theOwner a selection owner
44   void fillPresentation(ModuleBase_ViewerPrs& thePrs, const Handle_SelectMgr_EntityOwner& theOwner) const;
45
46   /// Returns a list of viewer highlited presentations
47   /// \return list of presentations
48   virtual QList<ModuleBase_ViewerPrs> getHighlighted() const;
49
50   /**
51    * Returns list of currently selected objects in object browser
52    */
53   virtual QObjectPtrList selectedObjects() const;
54
55   /**
56    * Returns list of currently selected results
57    */
58   virtual QObjectPtrList selectedPresentations() const;
59
60   //! Returns list of currently selected QModelIndexes
61   virtual QModelIndexList selectedIndexes() const;
62
63   //! Returns list of currently selected AIS objects
64   virtual void selectedAISObjects(AIS_ListOfInteractive& theList) const;
65
66   //! Returns list of currently selected shapes
67   virtual void selectedShapes(NCollection_List<TopoDS_Shape>& theShapes, 
68     std::list<ObjectPtr>& theOwners) const;
69
70   //! Returns list of currently selected owners
71   /// \return list of owners
72   void selectedOwners(SelectMgr_IndexedMapOfOwner& theSelectedOwners) const;
73
74   //! Returns a list of selection entity owners of the interactive object
75   /// It depends on the modes, in which the object is activated in the context
76   /// \param theObject an object
77   /// \param theOwners a map of entity owners
78   void entityOwners(const Handle_AIS_InteractiveObject& theObject,
79                     SelectMgr_IndexedMapOfOwner& theOwners) const;
80
81  private:
82   XGUI_Workshop* myWorkshop;
83 };
84
85 #endif