Salome HOME
Moved some functionality to VTKViewer_Utilities.h
[modules/kernel.git] / src / SALOMEGUI / SALOME_Selection.h
index 6c0eca8a65ece1dc62978323bb5d93fb7c1c6e01..a2e413262be456ce4d3d462b348985c4074b89cc 100644 (file)
 // Open CASCADE Include
 #include <TColStd_MapOfInteger.hxx>
 
+#include <set>
+
+enum Selection_Mode { 
+ NodeSelection, 
+ CellSelection,
+ EdgeOfCellSelection,
+ EdgeSelection, 
+ FaceSelection, 
+ VolumeSelection, 
+ ActorSelection };
+
 class SALOME_Selection : public QObject
 {
   Q_OBJECT
     
 public:
+
        SALOME_Selection(const QString& aName);
        ~SALOME_Selection();
 
@@ -78,17 +90,25 @@ public:
        bool                       IsOk( const Handle(SALOME_InteractiveObject)& IObject ) ;
 
 
-       void                       SetSelectionMode(int mode, bool activeCompOnly = false);
-       int                        SelectionMode();
+       void                       SetSelectionMode(Selection_Mode mode, bool activeCompOnly = false);
+       Selection_Mode             SelectionMode();
         bool                       IsSelectActiveCompOnly() const;
        
        bool                        HasIndex( const Handle(SALOME_InteractiveObject)& IObject );
        void                       GetIndex( const Handle(SALOME_InteractiveObject)& IObject, 
-                                            TColStd_MapOfInteger& theIndex );
+                                            TColStd_IndexedMapOfInteger& theIndex );
        
+       typedef std::set<int> TContainerOfId;
+
        bool                        AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& IObject, int index, bool modeShift, bool update=true );
+       bool                        AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& IObject, const TColStd_MapOfInteger& theIndices, bool modeShift, bool update=true );
+       bool                        AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& IObject, const TContainerOfId& theIndices, bool modeShift, bool update=true );
        void                        RemoveIndex( const Handle(SALOME_InteractiveObject)& IObject, int index );
        bool                        IsIndexSelected(const Handle(SALOME_InteractiveObject)& IObject, int index);
+       void                        ClearIndex();
+
+       void                        BlockSignals( const bool );
+       void                        SelectionChanged();
 
 signals:
        void                        currentSelectionChanged();
@@ -100,7 +120,7 @@ private:
 
        SALOME_DataMapOfIOMapOfInteger myMapIOSubIndex;
 
-       int                   mySelectionMode;
+       Selection_Mode        mySelectionMode;
         bool                  mySelActiveCompOnly;
 };