1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/
19 #ifndef LIGHTAPP_SELECTIONMGR_H
20 #define LIGHTAPP_SELECTIONMGR_H
24 #include <SUIT_SelectionMgr.h>
26 #ifndef DISABLE_SALOMEOBJECT
27 #include <SALOME_InteractiveObject.hxx>
31 class TColStd_IndexedMapOfInteger;
32 class TColStd_MapOfInteger;
34 #include <qstringlist.h>
37 class LightApp_Application;
40 Custom selection manager, allowing to work with object selection
41 (additionally to data owners) and to access to sub-selection of objects
43 class LIGHTAPP_EXPORT LightApp_SelectionMgr : public SUIT_SelectionMgr
48 LightApp_SelectionMgr( LightApp_Application*, const bool = true );
49 virtual ~LightApp_SelectionMgr();
51 LightApp_Application* application() const;
53 #ifndef DISABLE_SALOMEOBJECT
54 typedef QMap< Handle(SALOME_InteractiveObject), TColStd_IndexedMapOfInteger > MapIOOfMapOfInteger;
55 typedef QMap< QString, TColStd_IndexedMapOfInteger > MapEntryOfMapOfInteger;
57 void selectedObjects( SALOME_ListIO&, const QString& = QString::null, const bool = true ) const;
58 void setSelectedObjects( const SALOME_ListIO&, const bool = false );
60 void GetIndexes( const Handle(SALOME_InteractiveObject)& IObject,
61 TColStd_IndexedMapOfInteger& theIndex );
62 void GetIndexes( const QString& theEntry,
63 TColStd_IndexedMapOfInteger& theIndex );
65 bool AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& IObject,
66 const TColStd_MapOfInteger& theIndices,
69 void selectObjects( const Handle(SALOME_InteractiveObject)& IObject,
70 TColStd_IndexedMapOfInteger theIndex, bool append );
71 void selectObjects( MapIOOfMapOfInteger theMapIO, bool append );
73 void selectedSubOwners( MapEntryOfMapOfInteger& theMap );
75 void selectedObjects( QStringList&, const QString& = QString::null, const bool = true ) const;
79 void currentSelectionChanged();
82 virtual void selectionChanged( SUIT_Selector* );
85 LightApp_Application* myApp;