Salome HOME
Merging with WPdev
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MergeNodesDlg.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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //
23 //
24 //  File   : SMESHGUI_MergeNodesDlg.h
25 //  Author : Michael ZORIN
26 //  Module : SMESH
27 //  $Header: 
28
29 #ifndef DIALOGBOX_MERGENODES_H
30 #define DIALOGBOX_MERGENODES_H
31
32 #include "SMESH_SMESHGUI.hxx"
33
34 #include "LightApp_SelectionMgr.h"
35 //#include "SMESH_TypeFilter.hxx"
36 #include "SUIT_SelectionFilter.h"
37
38 // QT Includes
39 #include <qdialog.h>
40
41 class QGridLayout; 
42 class QButtonGroup;
43 class QGroupBox;
44 class QLabel;
45 class QLineEdit;
46 class QPushButton;
47 class QRadioButton;
48 class QCheckBox;
49 class QListView;
50 class QListViewItem;
51 class QListBox;
52 class SMESHGUI;
53 class SMESHGUI_SpinBox;
54 class SMESH_Actor;
55 class SVTK_ViewWindow;
56 class SVTK_Selector;
57
58
59 // IDL Headers
60 #include <SALOMEconfig.h>
61 #include CORBA_SERVER_HEADER(SMESH_Mesh)
62
63
64 //=================================================================================
65 // class    : SMESHGUI_MergeNodesDlg
66 // purpose  :
67 //=================================================================================
68 class SMESHGUI_EXPORT SMESHGUI_MergeNodesDlg : public QDialog
69
70     Q_OBJECT
71
72 public:
73     SMESHGUI_MergeNodesDlg( SMESHGUI*,
74                             const char* name = 0,
75                             bool modal = FALSE,
76                             WFlags fl = 0);
77     ~SMESHGUI_MergeNodesDlg();
78
79 private:
80     void Init();
81     void closeEvent( QCloseEvent* e );
82     void enterEvent ( QEvent * );                           /* mouse enter the QWidget */
83     void hideEvent ( QHideEvent * );                        /* ESC key */
84     void keyPressEvent( QKeyEvent* e );
85     void onEditNodesGroup();
86
87     SMESHGUI*                     mySMESHGUI;               /* Current SMESHGUI object */
88     LightApp_SelectionMgr*        mySelectionMgr;           /* User shape selection */
89     SVTK_Selector*                mySelector;
90
91     QWidget*                      myEditCurrentArgument;
92
93     SMESH::SMESH_Mesh_var         myMesh;
94     SMESH_Actor*                  myActor;
95     //Handle(SMESH_TypeFilter)      myMeshOrSubMeshFilter;
96     SUIT_SelectionFilter*         myMeshOrSubMeshFilter;
97
98     QButtonGroup*     GroupConstructors;
99     QRadioButton*     RadioButton1;
100     QGroupBox*        GroupButtons;
101     QPushButton*      buttonOk;
102     QPushButton*      buttonCancel;
103     QPushButton*      buttonApply;
104     QPushButton*      buttonHelp;
105     QGroupBox*        GroupMesh;
106     QGroupBox*        GroupCoincident;
107     QGroupBox*        GroupEdit;
108     QLabel*           TextLabelName;
109     QLabel*           TextLabelTolerance;
110     QLineEdit*        LineEditMesh;
111     QPushButton*      SelectMeshButton;
112     QPushButton*      DetectButton;
113     QPushButton*      AddButton;
114     QPushButton*      RemoveButton;
115     QCheckBox*        SelectAllCB;
116     QListView*        ListCoincident;
117     QListBox*         ListEdit;
118     SMESHGUI_SpinBox* SpinBoxTolerance;
119
120     QString           myHelpFileName;
121    
122 private slots:
123
124     void ClickOnOk();
125     void ClickOnCancel();
126     bool ClickOnApply();
127     void ClickOnHelp();
128     void updateControls();
129     void onDetect();
130     void onSelectNodesGroup();
131     void onSelectAll(bool isToggled);
132     void onSelectNodesFromGroup();
133     void onAdd();
134     void onRemove();
135     void SetEditCurrentArgument();
136     void SelectionIntoArgument() ;
137     void DeactivateActiveDialog() ;
138     void ActivateThisDialog() ;
139     
140 protected:
141     QGridLayout* SMESHGUI_MergeNodesDlgLayout;
142     QGridLayout* GroupConstructorsLayout;
143     QGridLayout* GroupButtonsLayout;
144     QGridLayout* GroupMeshLayout;
145     QGridLayout* GroupCoincidentLayout;
146     QGridLayout* GroupEditLayout;
147 };
148
149 #endif // DIALOGBOX_MERGENODES_H