Salome HOME
updated copyright message
[modules/gui.git] / src / SVTK / SVTK_SelectorDef.h
index 4fbc54d8cfbe2fb03656eec6c40911d754c1f3ad..0061db7bae7929184b9218545af31444354c5106 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -27,6 +27,8 @@
 #ifndef SVTK_SELECTORDEF_H
 #define SVTK_SELECTORDEF_H
 
+#include "SVTK_Selector.h"
+
 #include <set>
 #include <map>
 
@@ -36,8 +38,6 @@
 
 #include "SALOME_InteractiveObject.hxx"
 
-#include "SVTK_Selector.h"
-
 class SALOME_Actor;
 
 class SVTK_Viewer;
@@ -106,17 +106,17 @@ public:
   virtual
   void 
   GetIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-            TColStd_IndexedMapOfInteger& theIndex );
+            SVTK_TIndexedMapOfVtkId& theIndex );
         
   virtual
   bool 
   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                    const TColStd_IndexedMapOfInteger& theIndices, 
+                    const SVTK_TIndexedMapOfVtkId& theIndices, 
                     bool theIsModeShift);
   virtual
   bool 
   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                    const TColStd_MapOfInteger& theIndices, 
+                    const SVTK_TVtkIDsMap& theIndices, 
                     bool theIsModeShift);
   virtual
   bool
@@ -135,6 +135,42 @@ public:
   void 
   ClearIndex();
 
+  //----------------------------------------------------------------------------
+  /// ! Composite indexes 
+  virtual
+  bool 
+  HasCompositeIndex(const Handle(SALOME_InteractiveObject)& theIO ) const;
+
+  virtual
+  void 
+  GetCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
+                    SVTK_IndexedMapOfVtkIds& theIds );        
+  virtual
+  bool 
+  AddOrRemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
+                            const SVTK_IndexedMapOfVtkIds& theIds,
+                            bool theIsModeShift);
+
+  virtual
+  bool
+  AddOrRemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
+                            SVTK_ListOfVtk theIds,
+                            bool theIsModeShift);
+
+  virtual
+  void 
+  RemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
+                       SVTK_ListOfVtk theIds );
+
+  virtual
+  bool 
+  IsCompositeIndexSelected(const Handle(SALOME_InteractiveObject)& theIO, 
+                          SVTK_ListOfVtk theIds ) const;
+
+  virtual
+  void 
+  ClearCompositeIndex();
+
   //----------------------------------------------------------------------------
   virtual
   void 
@@ -184,10 +220,28 @@ public:
   bool
   GetDynamicPreSelection() const;
 
+  virtual
+  void
+  SetPreSelectionEnabled( bool theEnabled );
+
+  virtual
+  bool
+  IsPreSelectionEnabled() const;
+
+  virtual
+  void
+  SetSelectionEnabled( bool theEnabled );
+
+  virtual
+  bool
+  IsSelectionEnabled() const;
+
 private:
   int mySelectionMode;
 
   bool myDynamicPreselection;
+  bool myPreselectionEnabled;
+  bool mySelectionEnabled;
 
   struct TIOLessThan
   {
@@ -201,7 +255,7 @@ private:
 
   struct TIndexedMapOfInteger
   {
-    TColStd_IndexedMapOfInteger myMap;
+    SVTK_TIndexedMapOfVtkId myMap;
     TIndexedMapOfInteger()
     {}
     TIndexedMapOfInteger(const TIndexedMapOfInteger& theIndexedMapOfInteger)
@@ -225,6 +279,12 @@ private:
                    TIOLessThan> TMapIOSubIndex;
   TMapIOSubIndex myMapIOSubIndex;
 
+  typedef std::map<Handle(SALOME_InteractiveObject),
+                   SVTK_IndexedMapOfVtkIds,
+                   TIOLessThan> TMapIOSubCompositeIndex;
+  TMapIOSubCompositeIndex myMapIOSubCompositeIndex;
+
+
   typedef std::map<TFilterID,Handle(VTKViewer_Filter)> TFilters;
   TFilters myFilters;