1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #ifndef LIGHTAPP_SELECTIONMGR_H
23 #define LIGHTAPP_SELECTIONMGR_H
27 #include <SUIT_SelectionMgr.h>
29 #ifndef DISABLE_SALOMEOBJECT
30 #include <SALOME_InteractiveObject.hxx>
32 #include <NCollection_DataMap.hxx>
35 class TColStd_IndexedMapOfInteger;
36 class TColStd_MapOfInteger;
37 class TCollection_AsciiString;
39 #include <QStringList>
42 class LightApp_Application;
45 Custom selection manager, allowing to work with object selection
46 (additionally to data owners) and to access to sub-selection of objects
48 class LIGHTAPP_EXPORT LightApp_SelectionMgr : public SUIT_SelectionMgr
53 LightApp_SelectionMgr( LightApp_Application*, const bool = true );
54 virtual ~LightApp_SelectionMgr();
56 LightApp_Application* application() const;
58 #ifndef DISABLE_SALOMEOBJECT
59 typedef NCollection_DataMap< Handle(SALOME_InteractiveObject), TColStd_IndexedMapOfInteger > MapIOOfMapOfInteger;
60 typedef NCollection_DataMap< TCollection_AsciiString, TColStd_IndexedMapOfInteger > MapEntryOfMapOfInteger;
62 void selectedObjects( SALOME_ListIO&, const QString& = QString(), const bool = true ) const;
63 void setSelectedObjects( const SALOME_ListIO&, const bool = false );
65 void GetIndexes( const Handle(SALOME_InteractiveObject)& IObject,
66 TColStd_IndexedMapOfInteger& theIndex );
67 void GetIndexes( const QString& theEntry,
68 TColStd_IndexedMapOfInteger& theIndex );
70 //bool AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& IObject,
71 void AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& IObject,
72 const TColStd_MapOfInteger& theIndices,
75 void selectObjects( const Handle(SALOME_InteractiveObject)& IObject,
76 TColStd_IndexedMapOfInteger theIndex, bool append );
77 void selectObjects( MapIOOfMapOfInteger theMapIO, bool append );
79 void selectedSubOwners( MapEntryOfMapOfInteger& theMap );
81 void selectedObjects( QStringList&, const QString& = QString(), const bool = true ) const;
85 void currentSelectionChanged();
88 virtual void selectionChanged( SUIT_Selector* );
91 LightApp_Application* myApp;