Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SVTK_Selector.h
Go to the documentation of this file.
1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 
23 // SALOME SALOMEGUI : implementation of desktop and GUI kernel
24 // File : SALOME_Selection.h
25 // Author : Nicolas REJNERI
26 
27 #ifndef SVTK_SELECTOR_H
28 #define SVTK_SELECTOR_H
29 
30 #include "SVTK.h"
31 #include "SVTK_Selection.h"
32 #include "SALOME_ListIO.hxx"
33 
34 #include <VTKViewer_Filter.h>
35 
36 #include <TColStd_MapOfInteger.hxx>
37 #include <TColStd_IndexedMapOfInteger.hxx>
38 
39 #include <vtkObject.h>
40 
42 class SALOME_Actor;
44 class vtkActorCollection;
45 class vtkRenderer;
46 
48 
56 {
57 public:
58  static SVTK_Selector* New();
59 
60  vtkTypeMacro(SVTK_Selector,vtkObject);
61 
63  virtual
64  void
65  SetSelectionMode(Selection_Mode theMode) = 0;
66 
68  virtual
70  SelectionMode() const = 0;
71 
73  virtual
74  void
75  ClearIObjects() = 0;
76 
78  virtual
79  SALOME_Actor*
80  GetActor(const Handle(SALOME_InteractiveObject)& theIO) const = 0;
81 
83  virtual
84  bool
85  IsSelected(const Handle(SALOME_InteractiveObject)& theIO) const = 0;
86 
88  virtual
89  bool
90  IsSelected(SALOME_Actor* theActor) const = 0;
91 
93  virtual
94  bool
95  AddIObject(const Handle(SALOME_InteractiveObject)& theIO) = 0;
96 
98  virtual
99  bool
100  AddIObject(SALOME_Actor* theActor) = 0;
101 
103  virtual
104  bool
105  RemoveIObject(const Handle(SALOME_InteractiveObject)& theIO) = 0;
106 
108  virtual
109  bool
110  RemoveIObject(SALOME_Actor* theActor) = 0;
111 
113  virtual
114  const SALOME_ListIO&
115  StoredIObjects() const = 0;
116 
118  virtual
119  int
120  IObjectCount() const = 0;
121 
123  virtual
124  bool
125  HasIndex(const Handle(SALOME_InteractiveObject)& theIO ) const = 0;
126 
128  virtual
129  void
130  GetIndex( const Handle(SALOME_InteractiveObject)& theIO,
131  TColStd_IndexedMapOfInteger& theIndex ) = 0;
132 
134  virtual
135  bool
136  AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
137  const TColStd_IndexedMapOfInteger& theIndices,
138  bool theIsModeShift) = 0;
139 
141  virtual
142  bool
143  AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
144  const TColStd_MapOfInteger& theIndices,
145  bool theIsModeShift) = 0;
146 
148  virtual
149  bool
150  AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
151  int theIndex,
152  bool theIsModeShift) = 0;
153 
155  virtual
156  void
157  RemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
158  int theIndex) = 0;
159 
161  virtual
162  bool
163  IsIndexSelected(const Handle(SALOME_InteractiveObject)& theIO,
164  int theIndex) const = 0;
165 
167  virtual
168  void
169  ClearIndex() = 0;
170 
171  //----------------------------------------------------------------------------
172  typedef int TFilterID;
173 
175  virtual
176  void
177  SetFilter(const Handle(VTKViewer_Filter)& theFilter) = 0;
178 
180  virtual
182  GetFilter(const TFilterID theId) const = 0;
183 
185  virtual
186  bool
187  IsFilterPresent(const TFilterID theId) const = 0;
188 
190  virtual
191  void
192  RemoveFilter(const TFilterID theId) = 0;
193 
195  virtual
196  bool
197  IsValid(SALOME_Actor* theActor,
198  const int theId,
199  const bool theIsNode = false) const = 0;
200 
201  //----------------------------------------------------------------------------
202  virtual
203  void
204  StartPickCallback() = 0;
205 
207  virtual
208  void
209  EndPickCallback() = 0;
210 
211  //----------------------------------------------------------------------------
212  virtual
213  vtkActorCollection*
214  Pick(const SVTK_SelectionEvent* theEvent, vtkRenderer* theRenderer) const = 0;
215 
216  virtual
217  void
218  SetTolerance(const double& theTolerance) = 0;
219 
220  virtual
221  void
222  SetDynamicPreSelection( bool theIsDynPreselect ) = 0;
223 
224  virtual
225  bool
226  GetDynamicPreSelection() const = 0;
227 
228  virtual
229  void
230  SetPreSelectionEnabled( bool theEnabled ) = 0;
231 
232  virtual
233  bool
234  IsPreSelectionEnabled() const = 0;
235 
236  virtual
237  void
238  SetSelectionEnabled( bool theEnabled ) = 0;
239 
240  virtual
241  bool
242  IsSelectionEnabled() const = 0;
243 };
244 
245 
246 #endif