Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom into Dev_1.1.0
[modules/shaper.git] / src / ModuleBase / ModuleBase_ISelection.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModuleBase_ISelection.h
4 // Created:     2 June 2014
5 // Author:      Vitaly Smetannikov
6
7 #ifndef ModuleBase_ISelection_H
8 #define ModuleBase_ISelection_H
9
10 #include "ModuleBase.h"
11 #include "ModuleBase_Definitions.h"
12 #include "ModuleBase_ViewerPrs.h"
13
14 #include <QModelIndexList>
15 #include <AIS_ListOfInteractive.hxx>
16 #include <NCollection_List.hxx>
17 #include <TopoDS_Shape.hxx>
18
19 #include <QList>
20
21 class Handle_SelectMgr_EntityOwner;
22
23 /**
24 * \ingroup GUI
25 * A class which provides access to selection.
26 * A selection can be obtained as from a viewer as from Object browser in various forms
27 */
28 class ModuleBase_ISelection
29 {
30  public:
31
32   /// Returns a list of viewer selected presentations
33   /// \return list of presentations
34   virtual QList<ModuleBase_ViewerPrs> getSelected() const = 0;
35
36   /// Returns a list of viewer highlited presentations
37   /// \return list of presentations
38   virtual QList<ModuleBase_ViewerPrs> getHighlighted() const = 0;
39
40   /// Fills the viewer presentation parameters by the parameters from the owner
41   /// \param thePrs a container for selection
42   /// \param theOwner a selection owner
43   virtual void fillPresentation(ModuleBase_ViewerPrs& thePrs,
44                                 const Handle_SelectMgr_EntityOwner& theOwner) const = 0;
45
46   /**
47    * Returns list of features currently selected in object browser
48    */
49   virtual QObjectPtrList selectedObjects() const = 0;
50
51   /**
52    * Returns list of currently selected results
53    */
54   virtual QObjectPtrList selectedPresentations() const = 0;
55
56   //! Returns list of currently selected QModelIndexes
57   virtual QModelIndexList selectedIndexes() const = 0;
58
59   //! Returns list of currently selected AIS objects
60   //! \param theList returning list of selected AIS objects
61   virtual void selectedAISObjects(AIS_ListOfInteractive& theList) const = 0;
62
63   //! Returns list of currently selected QModelIndexes
64   virtual ObjectPtr getSelectableObject(const Handle_SelectMgr_EntityOwner& theOwner) const = 0;
65
66   //! Returns list of currently selected shapes and their owners (objects).
67   //! Both lists are synchronized
68   //! \param theList returning list of selected AIS objects
69   //! \param theOwners list of objects
70   virtual void selectedShapes(NCollection_List<TopoDS_Shape>& theList, 
71     std::list<ObjectPtr>& theOwners) const = 0;
72
73 };
74
75 #endif