1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/
19 #include "SUIT_Selector.h"
21 #include "SUIT_SelectionMgr.h"
23 /*!\class SUIT_Selector
24 * Class provide selector for data owners.
30 SUIT_Selector::SUIT_Selector( SUIT_SelectionMgr* selMgr, QObject* parent ) :
38 selMgr->installSelector( this );
44 SUIT_Selector::~SUIT_Selector()
47 selectionMgr()->removeSelector( this );
51 Gets selection manager.
53 SUIT_SelectionMgr* SUIT_Selector::selectionMgr() const
59 Checks: Is selctor enabled?
61 bool SUIT_Selector::isEnabled() const
67 Sets selctor anbled to \a on.
69 void SUIT_Selector::setEnabled( const bool on )
75 Checks: Is selector auto block?
77 bool SUIT_Selector::autoBlock() const
83 Sets selctor autoblock to \a on.
85 void SUIT_Selector::setAutoBlock( const bool on )
91 Puts to \a lst selection list of data owners.
93 void SUIT_Selector::selected( SUIT_DataOwnerPtrList& lst ) const
100 Puts to selection list of data owners \a lst..
102 void SUIT_Selector::setSelected( const SUIT_DataOwnerPtrList& lst )
107 bool block = myBlock;
116 On selection changed.
118 void SUIT_Selector::selectionChanged()
120 if ( selectionMgr() && isEnabled() && ( !autoBlock() || !myBlock ) )
121 selectionMgr()->selectionChanged( this );
125 Checks: Is selection manager has selection mode \a mode?
127 bool SUIT_Selector::hasSelectionMode( const int mode ) const
129 if ( !selectionMgr() )
132 return selectionMgr()->hasSelectionMode( mode );
136 Puts to list \a lst selection modes from selection manager.
138 void SUIT_Selector::selectionModes( QValueList<int>& lst ) const
140 if ( selectionMgr() )
141 selectionMgr()->selectionModes( lst );