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