Salome HOME
NPAL16716. Compound: To create the groups of initial meshes.
[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_MeshEditor)
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::SMESH_IDSource_var     mySubMeshOrGroup;
95     SMESH_Actor*                  myActor;
96     //Handle(SMESH_TypeFilter)      myMeshOrSubMeshFilter;
97     SUIT_SelectionFilter*         myMeshOrSubMeshOrGroupFilter;
98
99     QButtonGroup*     GroupConstructors;
100     QRadioButton*     RadioButton1;
101     QGroupBox*        GroupButtons;
102     QPushButton*      buttonOk;
103     QPushButton*      buttonCancel;
104     QPushButton*      buttonApply;
105     QPushButton*      buttonHelp;
106     QGroupBox*        GroupMesh;
107     QGroupBox*        GroupCoincident;
108     QGroupBox*        GroupEdit;
109     QLabel*           TextLabelName;
110     QLabel*           TextLabelTolerance;
111     QLineEdit*        LineEditMesh;
112     QPushButton*      SelectMeshButton;
113     QPushButton*      DetectButton;
114     QPushButton*      AddButton;
115     QPushButton*      RemoveButton;
116     QCheckBox*        SelectAllCB;
117     QListView*        ListCoincident;
118     QListBox*         ListEdit;
119     SMESHGUI_SpinBox* SpinBoxTolerance;
120
121     QString           myHelpFileName;
122    
123 private slots:
124
125     void ClickOnOk();
126     void ClickOnCancel();
127     bool ClickOnApply();
128     void ClickOnHelp();
129     void updateControls();
130     void onDetect();
131     void onSelectNodesGroup();
132     void onSelectAll(bool isToggled);
133     void onSelectNodesFromGroup();
134     void onAdd();
135     void onRemove();
136     void SetEditCurrentArgument();
137     void SelectionIntoArgument() ;
138     void DeactivateActiveDialog() ;
139     void ActivateThisDialog() ;
140     
141 protected:
142     QGridLayout* SMESHGUI_MergeNodesDlgLayout;
143     QGridLayout* GroupConstructorsLayout;
144     QGridLayout* GroupButtonsLayout;
145     QGridLayout* GroupMeshLayout;
146     QGridLayout* GroupCoincidentLayout;
147     QGridLayout* GroupEditLayout;
148 };
149
150 #endif // DIALOGBOX_MERGENODES_H