Version: 6.3.1

src/LightApp/LightApp_SelectionMgr.h

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 #ifndef LIGHTAPP_SELECTIONMGR_H
00024 #define LIGHTAPP_SELECTIONMGR_H
00025 
00026 #include "LightApp.h"
00027 
00028 #include <SUIT_SelectionMgr.h>
00029 
00030 #ifndef DISABLE_SALOMEOBJECT
00031   #include <SALOME_InteractiveObject.hxx>
00032   #include <QMap>
00033   #include <NCollection_DataMap.hxx>
00034 
00035   class SALOME_ListIO;
00036   class TColStd_IndexedMapOfInteger;
00037   class TColStd_MapOfInteger;
00038   class TCollection_AsciiString;
00039 #else
00040 #include <QStringList>
00041 #endif
00042 
00043 class LightApp_Application;
00044 
00049 class LIGHTAPP_EXPORT LightApp_SelectionMgr : public SUIT_SelectionMgr
00050 {
00051   Q_OBJECT
00052 
00053 public:
00054   LightApp_SelectionMgr( LightApp_Application*, const bool = true );
00055   virtual ~LightApp_SelectionMgr();
00056 
00057   LightApp_Application* application() const;
00058 
00059 #ifndef DISABLE_SALOMEOBJECT
00060   typedef NCollection_DataMap< Handle(SALOME_InteractiveObject), TColStd_IndexedMapOfInteger > MapIOOfMapOfInteger;
00061   typedef NCollection_DataMap< TCollection_AsciiString, TColStd_IndexedMapOfInteger > MapEntryOfMapOfInteger;
00062 
00063   void                   selectedObjects( SALOME_ListIO&, const QString& = QString(), const bool = true ) const;
00064   void                   setSelectedObjects( const SALOME_ListIO&, const bool = false );
00065 
00066   void                   GetIndexes( const Handle(SALOME_InteractiveObject)& IObject, 
00067                                      TColStd_IndexedMapOfInteger& theIndex );
00068   void                   GetIndexes( const QString& theEntry, 
00069                                      TColStd_IndexedMapOfInteger& theIndex );
00070 
00071   //bool                   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& IObject, 
00072   void                   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& IObject, 
00073                                            const TColStd_MapOfInteger& theIndices, 
00074                                            bool modeShift );
00075 
00076   void                   selectObjects( const Handle(SALOME_InteractiveObject)& IObject, 
00077                                         TColStd_IndexedMapOfInteger theIndex, bool append );
00078   void                   selectObjects( MapIOOfMapOfInteger theMapIO, bool append );
00079 
00080   void                   selectedSubOwners( MapEntryOfMapOfInteger& theMap );
00081 #else
00082   void                   selectedObjects( QStringList&, const QString& = QString(), const bool = true ) const;
00083 #endif
00084 
00085 signals:
00086   void                   currentSelectionChanged();
00087 
00088 private:
00089   virtual void           selectionChanged( SUIT_Selector* );
00090 
00091 private:
00092   LightApp_Application* myApp;
00093 };
00094 
00095 #endif
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS