Salome HOME
Merge changes from 'master' branch.
[modules/gui.git] / src / SVTK / SVTK_Selector.h
index 44c1d9690bdac408d5cdad304f59d2d73b75214c..7b33b3d36964c9b6579b1bb4fa7678ad57c6c57e 100644 (file)
@@ -1,45 +1,50 @@
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  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. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
+// 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, 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
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_Selection.h
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
 
 #ifndef SVTK_SELECTOR_H
 #define SVTK_SELECTOR_H
 
+#include "SVTK.h"
 #include "SVTK_Selection.h"
+#include "SVTK_Hash.h"
+
 #include "SALOME_ListIO.hxx"
-#include "VTKViewer_Filter.h"
-#include "SALOME_InteractiveObject.hxx"
+
+#include <VTKViewer_Filter.h>
 
 #include <TColStd_MapOfInteger.hxx>
 #include <TColStd_IndexedMapOfInteger.hxx>
 
 #include <vtkObject.h>
 
+class SALOME_InteractiveObject;
 class SALOME_Actor;
+class SVTK_SelectionEvent;
+class vtkActorCollection;
+class vtkRenderer;
 
 //! Define an abstract interface for selection in SVTK package
 /*!
@@ -49,7 +54,7 @@ class SALOME_Actor;
   \note
   Also, for each #SALOME_InteractiveObject it tries to keep corresponding refenrence to #SALOME_Actor
  */
-class SVTK_Selector: public vtkObject
+class SVTK_EXPORT SVTK_Selector: public vtkObject
 {
 public:
   static SVTK_Selector* New();
@@ -125,46 +130,88 @@ public:
   virtual
   void 
   GetIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-           TColStd_IndexedMapOfInteger& theIndex ) = 0;
-       
+            TColStd_IndexedMapOfInteger& theIndex ) = 0;
+        
   //! Change indices of subselection for given #SALOME_InteractiveObject
   virtual
   bool 
   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                   const TColStd_IndexedMapOfInteger& theIndices, 
-                   bool theIsModeShift) = 0;
+                    const TColStd_IndexedMapOfInteger& theIndices, 
+                    bool theIsModeShift) = 0;
 
   //! Change indexes of subslection for given #SALOME_InteractiveObject
   virtual
   bool 
   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                   const TColStd_MapOfInteger& theIndices, 
-                   bool theIsModeShift) = 0;
+                    const TColStd_MapOfInteger& theIndices, 
+                    bool theIsModeShift) = 0;
 
   //! Change index of subslection for given #SALOME_InteractiveObject
   virtual
   bool
   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                   int theIndex, 
-                   bool theIsModeShift) = 0;
+                    int theIndex, 
+                    bool theIsModeShift) = 0;
 
   //! Change index of subslection for given #SALOME_InteractiveObject
   virtual
   void 
   RemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-              int theIndex) = 0;
+               int theIndex) = 0;
 
   //! Check, if the given index is present in subselection 
   virtual
   bool 
   IsIndexSelected(const Handle(SALOME_InteractiveObject)& theIO, 
-                 int theIndex) const = 0;
+                  int theIndex) const = 0;
 
   //! Clear subselection
   virtual
   void 
   ClearIndex() = 0;
 
+  /// ! Composite indexes 
+  virtual
+  bool 
+  HasCompositeIndex(const Handle(SALOME_InteractiveObject)& theIO ) const = 0;
+
+  //! Get composite indexes of subslection for given #SALOME_InteractiveObject
+  virtual
+  void 
+  GetCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
+                    SVTK_IndexedMapOfIds& theIds ) = 0;
+        
+  //! Change composite indices of subselection for given #SALOME_InteractiveObject
+  virtual
+  bool 
+  AddOrRemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
+                            const SVTK_IndexedMapOfIds& theIds,
+                            bool theIsModeShift) = 0;
+
+  //! Change composite index of subslection for given #SALOME_InteractiveObject
+  virtual
+  bool
+  AddOrRemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
+                            SVTK_ListOfInteger ids, 
+                            bool theIsModeShift) = 0;
+
+  //! Change composite index of subslection for given #SALOME_InteractiveObject
+  virtual
+  void 
+  RemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
+                       SVTK_ListOfInteger ids ) = 0;
+
+  //! Check, if the given composite index is present in subselection 
+  virtual
+  bool 
+  IsCompositeIndexSelected(const Handle(SALOME_InteractiveObject)& theIO, 
+                          SVTK_ListOfInteger ids ) const = 0;
+
+  //! Clear composite indexes subselection
+  virtual
+  void 
+  ClearCompositeIndex() = 0;
+
   //----------------------------------------------------------------------------
   typedef int TFilterID;
 
@@ -192,8 +239,8 @@ public:
   virtual
   bool
   IsValid(SALOME_Actor* theActor,
-         const int theId,
-         const bool theIsNode = false) const = 0;
+          const int theId,
+          const bool theIsNode = false) const = 0;
   
   //----------------------------------------------------------------------------
   virtual
@@ -204,6 +251,39 @@ public:
   virtual
   void 
   EndPickCallback() = 0;
+
+  //----------------------------------------------------------------------------
+  virtual
+  vtkActorCollection*
+  Pick(const SVTK_SelectionEvent* theEvent, vtkRenderer* theRenderer) const = 0;
+
+  virtual
+  void
+  SetTolerance(const double& theTolerance) = 0;
+
+  virtual
+  void
+  SetDynamicPreSelection( bool theIsDynPreselect ) = 0;
+
+  virtual
+  bool
+  GetDynamicPreSelection() const = 0;
+
+  virtual
+  void
+  SetPreSelectionEnabled( bool theEnabled ) = 0;
+
+  virtual
+  bool
+  IsPreSelectionEnabled() const = 0;
+
+  virtual
+  void
+  SetSelectionEnabled( bool theEnabled ) = 0;
+
+  virtual
+  bool
+  IsSelectionEnabled() const = 0;
 };