1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModuleBase_ISelection.h
4 // Created: 2 June 2014
5 // Author: Vitaly Smetannikov
7 #ifndef ModuleBase_ISelection_H
8 #define ModuleBase_ISelection_H
10 #include "ModuleBase.h"
11 #include "ModuleBase_Definitions.h"
12 #include "ModuleBase_ViewerPrs.h"
14 #include <QModelIndexList>
15 #include <AIS_ListOfInteractive.hxx>
16 #include <NCollection_List.hxx>
17 #include <TopoDS_Shape.hxx>
23 * A class which provides access to selection.
24 * A selection can be obtained as from a viewer as from Object browser in various forms
26 class ModuleBase_ISelection
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 = 0;
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 = 0;
41 * Returns list of features currently selected in object browser
43 virtual QObjectPtrList selectedObjects() const = 0;
46 * Returns list of currently selected results
48 virtual QObjectPtrList selectedPresentations() const = 0;
50 //! Returns list of currently selected QModelIndexes
51 virtual QModelIndexList selectedIndexes() const = 0;
53 //! Returns list of currently selected AIS objects
54 //! \param theList returning list of selected AIS objects
55 virtual void selectedAISObjects(AIS_ListOfInteractive& theList) const = 0;
57 //! Returns list of currently selected shapes and their owners (objects).
58 //! Both lists are synchronized
59 //! \param theList returning list of selected AIS objects
60 //! \param theOwners list of objects
61 virtual void selectedShapes(NCollection_List<TopoDS_Shape>& theList,
62 std::list<ObjectPtr>& theOwners) const = 0;