Salome HOME
studyActivated() virtual method has been added
[modules/gui.git] / src / SUIT / SUIT_SelectionMgr.cxx
index 1089fb81a358cb78c824c79aaaafba9f5e162307..6384d2bd3e83dcdca77777d67b854d7282afca63 100755 (executable)
@@ -8,6 +8,7 @@ myIsSelChangeEnabled( true )
 
 SUIT_SelectionMgr::~SUIT_SelectionMgr()
 {
+  mySelectors.setAutoDelete( true );
 }
 
 void SUIT_SelectionMgr::installSelector( SUIT_Selector* sel )
@@ -47,13 +48,15 @@ void SUIT_SelectionMgr::setEnabled( const bool on, const QString& typ )
   }
 }
 
-void SUIT_SelectionMgr::selected( SUIT_DataOwnerPtrList& lst ) const
+void SUIT_SelectionMgr::selected( SUIT_DataOwnerPtrList& lst, const QString& type ) const
 {
   lst.clear();
 
   QMap<const SUIT_DataOwner*, int> map;
   for ( SelectorListIterator it( mySelectors ); it.current(); ++it )
   {
+    if ( !type.isEmpty() && it.current()->type() != type )
+      continue;
     SUIT_DataOwnerPtrList curList;
     it.current()->selected( curList );
     for ( SUIT_DataOwnerPtrList::const_iterator itr = curList.begin(); itr != curList.end(); ++itr )
@@ -106,8 +109,9 @@ void SUIT_SelectionMgr::selectionChanged( SUIT_Selector* sel )
   {
     for ( SUIT_Selector* aSel = mySelectors.first(); aSel; aSel = mySelectors.next() )
     {
-      if ( aSel != sel )
-           aSel->setSelected( newOwners );
+      // Temporary action(to avoid selection of the objects which don't pass the filters):
+      //if ( aSel != sel )
+       aSel->setSelected( newOwners );
     }
   }
   myIsSelChangeEnabled = true;