1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
22 // File : SMESHGUI_SelectionOp.h
23 // Author : Alexander SOLOVYOV
27 #ifndef SMESHGUI_SelectionOp_H
28 #define SMESHGUI_SelectionOp_H
30 #include <SMESHGUI_Operation.h>
33 Class : SMESHGUI_SelectionOp
34 Description : Base operation for all operations using object selection in viewer or objectbrowser
35 through common widgets created by SalomeApp_Dialog::createObject
38 class SUIT_SelectionFilter;
40 class SMESHGUI_SelectionOp : public SMESHGUI_Operation
45 SMESHGUI_SelectionOp( const Selection_Mode = ActorSelection );
46 virtual ~SMESHGUI_SelectionOp();
49 virtual void startOperation();
50 virtual void commitOperation();
51 virtual void abortOperation();
53 virtual void selectionDone();
55 //! sets the dialog widgets to state just after operation start
56 virtual void initDialog();
58 /*! Creates filter being used when certain object selection widget is active
59 * If no filter must be used, then function must return 0
60 * if id is negative, then function must return filter for common using independently of active widget
62 virtual SUIT_SelectionFilter* createFilter( const int ) const;
64 //! Remove only filters set by this operation (they are in map myFilters )
65 void removeCustomFilters() const;
68 //! Installs filter corresponding to certain object selection widget
69 virtual void onActivateObject( int );
71 //! Removes filter corresponding to certain object selection widget
72 virtual void onDeactivateObject( int );
75 * Empty default implementation. In successors it may be used for more advanced selection checking.
76 * This slot is connected to signal when the selection changed in some object selection widget
78 virtual void onSelectionChanged( int );
81 typedef QMap<int, SUIT_SelectionFilter*> Filters;
85 Selection_Mode myDefSelectionMode, myOldSelectionMode;