]> SALOME platform Git repositories - modules/gui.git/blob - src/SVTK/SVTK_SelectorDef.h
Salome HOME
ec7ae91aa6beaa6446731d8a595c22c210356320
[modules/gui.git] / src / SVTK / SVTK_SelectorDef.h
1 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
2 //
3 //  Copyright (C) 2003  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. 
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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : SALOME_Selection.h
25 //  Author : Nicolas REJNERI
26 //  Module : SALOME
27 //  $Header$
28
29 #ifndef SVTK_SELECTORDEF_H
30 #define SVTK_SELECTORDEF_H
31
32 #include <NCollection_DataMap.hxx>
33 #include <vtkSmartPointer.h>
34 #include <TColStd_MapOfInteger.hxx>
35
36 #include "SVTK_Selector.h"
37
38 class SALOME_Actor;
39
40 class SVTK_Viewer;
41 class SVTK_ViewWindow;
42
43 class SVTK_SelectorDef: public SVTK_Selector
44 {
45 public:
46   SVTK_SelectorDef();
47   virtual ~SVTK_SelectorDef();
48
49   virtual
50   void 
51   SetSelectionMode( Selection_Mode theMode );
52
53   virtual
54   Selection_Mode
55   SelectionMode() const { return mySelectionMode; }
56
57   virtual
58   void
59   ClearIObjects();
60
61   virtual
62   SALOME_Actor* 
63   GetActor(const Handle(SALOME_InteractiveObject)& theIO) const;
64
65   virtual
66   bool
67   IsSelected(const Handle(SALOME_InteractiveObject)& theIO) const;
68
69   virtual
70   bool
71   IsSelected(SALOME_Actor* theActor) const;
72
73   virtual
74   bool
75   AddIObject(const Handle(SALOME_InteractiveObject)& theIO);
76
77   virtual
78   bool
79   AddIObject(SALOME_Actor* theActor);
80
81   virtual
82   bool 
83   RemoveIObject(const Handle(SALOME_InteractiveObject)& theIO);
84
85   virtual
86   bool 
87   RemoveIObject(SALOME_Actor* theActor);
88
89   virtual
90   const SALOME_ListIO& 
91   StoredIObjects() const;
92
93   virtual
94   int 
95   IObjectCount() const;
96
97   virtual
98   bool 
99   HasIndex(const Handle(SALOME_InteractiveObject)& theIO ) const;
100
101   virtual
102   void 
103   GetIndex( const Handle(SALOME_InteractiveObject)& theIO, 
104             TColStd_IndexedMapOfInteger& theIndex );
105         
106   virtual
107   bool 
108   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
109                     const TColStd_IndexedMapOfInteger& theIndices, 
110                     bool theIsModeShift);
111   virtual
112   bool 
113   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
114                     const TColStd_MapOfInteger& theIndices, 
115                     bool theIsModeShift);
116   virtual
117   bool
118   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
119                     int theIndex, 
120                     bool theIsModeShift);
121   virtual
122   void 
123   RemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
124                int theIndex);
125   virtual
126   bool 
127   IsIndexSelected(const Handle(SALOME_InteractiveObject)& theIO, 
128                   int theIndex) const;
129   virtual
130   void 
131   ClearIndex();
132
133 private:
134   typedef NCollection_DataMap<Handle(SALOME_InteractiveObject),
135                               vtkSmartPointer<SALOME_Actor> > TIO2Actors;
136   TIO2Actors myIO2Actors;
137   Selection_Mode mySelectionMode;
138   SALOME_ListIO myIObjects;
139   SALOME_DataMapOfIOMapOfInteger myMapIOSubIndex;
140 };
141
142
143 #endif