1 // SALOME SALOMEGUI : implementation of desktop and GUI kernel
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SALOME_Selection.h
25 // Author : Nicolas REJNERI
29 #ifndef SVTK_SELECTORDEF_H
30 #define SVTK_SELECTORDEF_H
35 #include <TColStd_IndexedMapOfInteger.hxx>
36 #include <TColStd_MapOfInteger.hxx>
37 #include <vtkSmartPointer.h>
39 #include "SVTK_Selector.h"
44 class SVTK_ViewWindow;
46 class SVTK_SelectorDef: public SVTK_Selector
50 virtual ~SVTK_SelectorDef();
54 SetSelectionMode( Selection_Mode theMode );
58 SelectionMode() const { return mySelectionMode; }
66 GetActor(const Handle(SALOME_InteractiveObject)& theIO) const;
70 IsSelected(const Handle(SALOME_InteractiveObject)& theIO) const;
74 IsSelected(SALOME_Actor* theActor) const;
78 AddIObject(const Handle(SALOME_InteractiveObject)& theIO);
82 AddIObject(SALOME_Actor* theActor);
86 RemoveIObject(const Handle(SALOME_InteractiveObject)& theIO);
90 RemoveIObject(SALOME_Actor* theActor);
94 StoredIObjects() const;
102 HasIndex(const Handle(SALOME_InteractiveObject)& theIO ) const;
106 GetIndex( const Handle(SALOME_InteractiveObject)& theIO,
107 TColStd_IndexedMapOfInteger& theIndex );
111 AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
112 const TColStd_IndexedMapOfInteger& theIndices,
113 bool theIsModeShift);
116 AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
117 const TColStd_MapOfInteger& theIndices,
118 bool theIsModeShift);
121 AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
123 bool theIsModeShift);
126 RemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
130 IsIndexSelected(const Handle(SALOME_InteractiveObject)& theIO,
137 Selection_Mode mySelectionMode;
142 operator()(const Handle(SALOME_InteractiveObject)& theRightIO,
143 const Handle(SALOME_InteractiveObject)& theLeftIO) const
145 return strcmp(theRightIO->getEntry(),theLeftIO->getEntry()) < 0;
149 struct TIndexedMapOfInteger{
150 TColStd_IndexedMapOfInteger myMap;
151 TIndexedMapOfInteger()
153 TIndexedMapOfInteger(const TIndexedMapOfInteger& theIndexedMapOfInteger)
155 myMap = theIndexedMapOfInteger.myMap;
159 mutable SALOME_ListIO myIObjectList;
160 typedef std::set<Handle(SALOME_InteractiveObject),
161 TIOLessThan> TIObjects;
162 TIObjects myIObjects;
164 typedef std::map<Handle(SALOME_InteractiveObject),
165 vtkSmartPointer<SALOME_Actor>,
166 TIOLessThan> TIO2Actors;
167 TIO2Actors myIO2Actors;
169 typedef std::map<Handle(SALOME_InteractiveObject),
170 TIndexedMapOfInteger,
171 TIOLessThan> TMapIOSubIndex;
172 TMapIOSubIndex myMapIOSubIndex;