Salome HOME
The selections of elements corrected.
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_RemoveElementsDlg.h
1 //  SMESH SMESHGUI : GUI for SMESH component
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   : SMESHGUI_RemoveElementsDlg.h
25 //  Author : Nicolas REJNERI
26 //  Module : SMESH
27 //  $Header$
28
29 #ifndef DIALOGBOX_REMOVE_ELEMENTS_H
30 #define DIALOGBOX_REMOVE_ELEMENTS_H
31
32 #include "SalomeApp_SelectionMgr.h"
33
34 // QT Includes
35 #include <qvariant.h>
36 #include <qdialog.h>
37
38 class QVBoxLayout; 
39 class QHBoxLayout; 
40 class QGridLayout; 
41 class QButtonGroup;
42 class QGroupBox;
43 class QLabel;
44 class QLineEdit;
45 class QPushButton;
46 class QRadioButton;
47
48 class SMESHGUI;
49 class SMESH_Actor;
50 class SVTK_Selector;
51 class SVTK_ViewWindow;
52
53 // IDL Headers
54 #include <SALOMEconfig.h>
55 #include CORBA_SERVER_HEADER(SMESH_Mesh)
56
57 //=================================================================================
58 // class    : SMESHGUI_RemoveElementsDlg
59 // purpose  :
60 //=================================================================================
61 class SMESHGUI_RemoveElementsDlg : public QDialog
62
63     Q_OBJECT
64
65 public:
66     SMESHGUI_RemoveElementsDlg(SMESHGUI* theModule,
67                                const char* name = 0,
68                                bool modal = FALSE,
69                                WFlags fl = 0);
70     ~SMESHGUI_RemoveElementsDlg();
71
72 private:
73
74     void Init() ;
75     void closeEvent( QCloseEvent* e ) ;
76     void enterEvent ( QEvent * ) ;                          /* mouse enter the QWidget */
77     void hideEvent ( QHideEvent * );                        /* ESC key */
78
79     SalomeApp_SelectionMgr*       mySelectionMgr;
80     SVTK_ViewWindow*              myViewWindow;
81     SVTK_Selector*                mySelector;
82     SMESHGUI*                     mySMESHGUI;
83
84     int                           myNbOkElements;           /* to check when arguments is defined */
85     int                           myConstructorId;          /* Current constructor id = radio button id */
86     QLineEdit*                    myEditCurrentArgument;    /* Current  LineEdit */
87
88     bool                          myBusy;
89     SMESH::SMESH_Mesh_var         myMesh;
90     SMESH_Actor*                  myActor;
91     
92     QButtonGroup* GroupConstructors;
93     QRadioButton* Constructor1;
94     QGroupBox* GroupButtons;
95     QPushButton* buttonOk;
96     QPushButton* buttonCancel;
97     QPushButton* buttonApply;
98     QGroupBox* GroupC1;
99     QLabel* TextLabelC1A1;
100     QPushButton* SelectButtonC1A1;
101     QLineEdit* LineEditC1A1;
102
103 private slots:
104
105     void ConstructorsClicked(int constructorId);
106     void ClickOnOk();
107     void ClickOnCancel();
108     void ClickOnApply();
109     void SetEditCurrentArgument() ;
110     void SelectionIntoArgument() ;
111     void DeactivateActiveDialog() ;
112     void ActivateThisDialog() ;
113     void onTextChange(const QString&);
114
115 protected:
116     QGridLayout* SMESHGUI_RemoveElementsDlgLayout;
117     QGridLayout* GroupConstructorsLayout;
118     QGridLayout* GroupButtonsLayout;
119     QGridLayout* GroupC1Layout;
120 };
121
122 #endif // DIALOGBOX_REMOVE_ELEMENTS_H