1 // SALOME SALOMEGUI : implementation of desktop and GUI kernel
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SALOME_Selection.h
25 // Author : Nicolas REJNERI
29 #ifndef SALOME_SELECTION_H
30 #define SALOME_SELECTION_H
32 #include "SALOME_Filter.hxx"
33 #include "SALOME_ListIO.hxx"
34 #include "SALOME_ListOfFilter.hxx"
35 #include "SALOME_InteractiveObject.hxx"
36 #include "SALOME_DataMapOfIOMapOfInteger.hxx"
43 // Open CASCADE Include
44 #include <TColStd_MapOfInteger.hxx>
46 class SALOME_Selection : public QObject
51 SALOME_Selection(const QString& aName);
54 static bool CreateSelection(const QString& aName) ;
55 static SALOME_Selection* Selection (const QString& aName) ;
56 static bool RemoveSelection(const QString& aName) ;
57 static bool FindSelection (const QString& aName) ;
61 void ClearIObjects () ;
62 int AddIObject ( const Handle(SALOME_InteractiveObject)& anObject, bool update = true) ;
63 int RemoveIObject ( const Handle(SALOME_InteractiveObject)& anObject, bool update = true) ;
65 const SALOME_ListIO& StoredIObjects() ;
68 Handle(SALOME_InteractiveObject) firstIObject() ;
69 Handle(SALOME_InteractiveObject) lastIObject() ;
71 void AddFilter(const Handle(SALOME_Filter)& aFilter,
72 bool updateSelection = true ) ;
73 bool RemoveFilter(const Handle(SALOME_Filter)& aFilter) ;
75 const SALOME_ListOfFilter& StoredFilters();
76 bool FindFilter(const Handle(SALOME_Filter)& aFilter);
78 bool IsOk( const Handle(SALOME_InteractiveObject)& IObject ) ;
81 void SetSelectionMode(int mode, bool activeCompOnly = false);
83 bool IsSelectActiveCompOnly() const;
85 bool HasIndex( const Handle(SALOME_InteractiveObject)& IObject );
86 void GetIndex( const Handle(SALOME_InteractiveObject)& IObject,
87 TColStd_MapOfInteger& theIndex );
89 bool AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& IObject, int index, bool modeShift, bool update=true );
90 void RemoveIndex( const Handle(SALOME_InteractiveObject)& IObject, int index );
91 bool IsIndexSelected(const Handle(SALOME_InteractiveObject)& IObject, int index);
94 void currentSelectionChanged();
98 SALOME_ListOfFilter myFilters;
99 SALOME_ListIO myIObjects;
101 SALOME_DataMapOfIOMapOfInteger myMapIOSubIndex;
104 bool mySelActiveCompOnly;