1 // File : SALOME_Selection.h
2 // Created : Wed Feb 20 17:24:59 2002
3 // Author : Nicolas REJNERI
6 // Copyright : Open CASCADE 2002
9 #ifndef SALOME_SELECTION_H
10 #define SALOME_SELECTION_H
12 #include "SALOME_Filter.hxx"
13 #include "SALOME_ListIO.hxx"
14 #include "SALOME_ListOfFilter.hxx"
15 #include "SALOME_InteractiveObject.hxx"
16 #include "SALOME_DataMapOfIOMapOfInteger.hxx"
23 // Open CASCADE Include
24 #include <TColStd_MapOfInteger.hxx>
26 class SALOME_Selection : public QObject
31 SALOME_Selection(const QString& aName);
34 static bool CreateSelection(const QString& aName) ;
35 static SALOME_Selection* Selection (const QString& aName) ;
36 static bool RemoveSelection(const QString& aName) ;
37 static bool FindSelection (const QString& aName) ;
41 void ClearIObjects () ;
42 int AddIObject ( const Handle(SALOME_InteractiveObject)& anObject, bool update = true) ;
43 int RemoveIObject ( const Handle(SALOME_InteractiveObject)& anObject, bool update = true) ;
45 const SALOME_ListIO& StoredIObjects() ;
48 Handle(SALOME_InteractiveObject) firstIObject() ;
49 Handle(SALOME_InteractiveObject) lastIObject() ;
51 void AddFilter(const Handle(SALOME_Filter)& aFilter,
52 bool updateSelection = true ) ;
53 bool RemoveFilter(const Handle(SALOME_Filter)& aFilter) ;
55 const SALOME_ListOfFilter& StoredFilters();
56 bool FindFilter(const Handle(SALOME_Filter)& aFilter);
58 bool IsOk( const Handle(SALOME_InteractiveObject)& IObject ) ;
61 void SetSelectionMode(int mode, bool activeCompOnly = false);
63 bool IsSelectActiveCompOnly() const;
65 bool HasIndex( const Handle(SALOME_InteractiveObject)& IObject );
66 void GetIndex( const Handle(SALOME_InteractiveObject)& IObject,
67 TColStd_MapOfInteger& theIndex );
69 bool AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& IObject, int index, bool modeShift, bool update=true );
70 void RemoveIndex( const Handle(SALOME_InteractiveObject)& IObject, int index );
71 bool IsIndexSelected(const Handle(SALOME_InteractiveObject)& IObject, int index);
74 void currentSelectionChanged();
78 SALOME_ListOfFilter myFilters;
79 SALOME_ListIO myIObjects;
81 SALOME_DataMapOfIOMapOfInteger myMapIOSubIndex;
84 bool mySelActiveCompOnly;