Back to index

salome-gui  6.5.0
SVTK_Selector.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  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 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
00024 //  File   : SALOME_Selection.h
00025 //  Author : Nicolas REJNERI
00026 
00027 #ifndef SVTK_SELECTOR_H
00028 #define SVTK_SELECTOR_H
00029 
00030 #include "SVTK.h"
00031 #include "SVTK_Selection.h"
00032 #include "SALOME_ListIO.hxx"
00033 
00034 #include <TColStd_MapOfInteger.hxx>
00035 #include <TColStd_IndexedMapOfInteger.hxx>
00036 
00037 #include <vtkObject.h>
00038 
00039 class Handle(VTKViewer_Filter);
00040 
00041 class SALOME_Actor;
00042 class SVTK_SelectionEvent;
00043 class vtkActorCollection;
00044 class vtkRenderer;
00045 class Handle(SALOME_InteractiveObject);
00046 
00048 
00055 class SVTK_EXPORT SVTK_Selector: public vtkObject
00056 {
00057 public:
00058   static SVTK_Selector* New();
00059   
00060   vtkTypeMacro(SVTK_Selector,vtkObject);
00061 
00063   virtual
00064   void 
00065   SetSelectionMode(Selection_Mode theMode) = 0;
00066 
00068   virtual
00069   Selection_Mode
00070   SelectionMode() const = 0;
00071 
00073   virtual
00074   void
00075   ClearIObjects() = 0;
00076 
00078   virtual
00079   SALOME_Actor* 
00080   GetActor(const Handle(SALOME_InteractiveObject)& theIO) const = 0;
00081 
00083   virtual
00084   bool
00085   IsSelected(const Handle(SALOME_InteractiveObject)& theIO) const = 0;
00086 
00088   virtual
00089   bool
00090   IsSelected(SALOME_Actor* theActor) const = 0;
00091 
00093   virtual
00094   bool
00095   AddIObject(const Handle(SALOME_InteractiveObject)& theIO) = 0;
00096 
00098   virtual
00099   bool
00100   AddIObject(SALOME_Actor* theActor) = 0;
00101 
00103   virtual
00104   bool 
00105   RemoveIObject(const Handle(SALOME_InteractiveObject)& theIO) = 0;
00106 
00108   virtual
00109   bool 
00110   RemoveIObject(SALOME_Actor* theActor) = 0;
00111 
00113   virtual
00114   const SALOME_ListIO& 
00115   StoredIObjects() const = 0;
00116 
00118   virtual
00119   int 
00120   IObjectCount() const = 0;
00121 
00123   virtual
00124   bool 
00125   HasIndex(const Handle(SALOME_InteractiveObject)& theIO ) const = 0;
00126 
00128   virtual
00129   void 
00130   GetIndex( const Handle(SALOME_InteractiveObject)& theIO, 
00131             TColStd_IndexedMapOfInteger& theIndex ) = 0;
00132         
00134   virtual
00135   bool 
00136   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
00137                     const TColStd_IndexedMapOfInteger& theIndices, 
00138                     bool theIsModeShift) = 0;
00139 
00141   virtual
00142   bool 
00143   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
00144                     const TColStd_MapOfInteger& theIndices, 
00145                     bool theIsModeShift) = 0;
00146 
00148   virtual
00149   bool
00150   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
00151                     int theIndex, 
00152                     bool theIsModeShift) = 0;
00153 
00155   virtual
00156   void 
00157   RemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
00158                int theIndex) = 0;
00159 
00161   virtual
00162   bool 
00163   IsIndexSelected(const Handle(SALOME_InteractiveObject)& theIO, 
00164                   int theIndex) const = 0;
00165 
00167   virtual
00168   void 
00169   ClearIndex() = 0;
00170 
00171   //----------------------------------------------------------------------------
00172   typedef int TFilterID;
00173 
00175   virtual
00176   void 
00177   SetFilter(const Handle(VTKViewer_Filter)& theFilter) = 0;
00178 
00180   virtual
00181   Handle(VTKViewer_Filter) 
00182   GetFilter(const TFilterID theId) const = 0;
00183 
00185   virtual
00186   bool
00187   IsFilterPresent(const TFilterID theId) const = 0;
00188 
00190   virtual
00191   void
00192   RemoveFilter(const TFilterID theId) = 0;
00193 
00195   virtual
00196   bool
00197   IsValid(SALOME_Actor* theActor,
00198           const int theId,
00199           const bool theIsNode = false) const = 0;
00200   
00201   //----------------------------------------------------------------------------
00202   virtual
00203   void 
00204   StartPickCallback() = 0;
00205 
00207   virtual
00208   void 
00209   EndPickCallback() = 0;
00210 
00211   //----------------------------------------------------------------------------
00212   virtual
00213   vtkActorCollection*
00214   Pick(const SVTK_SelectionEvent* theEvent, vtkRenderer* theRenderer) const = 0;
00215 
00216   virtual
00217   void
00218   SetTolerance(const double& theTolerance) = 0;
00219 
00220   virtual
00221   void
00222   SetDynamicPreSelection( bool theIsDynPreselect ) = 0;
00223 
00224   virtual
00225   bool
00226   GetDynamicPreSelection() const = 0;
00227 };
00228 
00229 
00230 #endif