Salome HOME
PAL15429 Computation of the mesh, based on "014.brep" via Tetrahedron(NETGEN), is...
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MergeNodesDlg.h
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  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 //  SMESH SMESHGUI : GUI for SMESH component
23 //  File   : SMESHGUI_MergeNodesDlg.h
24 //  Author : Michael ZORIN
25 //  Module : SMESH
26 //  $Header: 
27 //
28 #ifndef DIALOGBOX_MERGENODES_H
29 #define DIALOGBOX_MERGENODES_H
30
31 #include "SMESH_SMESHGUI.hxx"
32
33 #include "LightApp_SelectionMgr.h"
34 //#include "SMESH_TypeFilter.hxx"
35 #include "SUIT_SelectionFilter.h"
36
37 // QT Includes
38 #include <qdialog.h>
39
40 class QGridLayout; 
41 class QButtonGroup;
42 class QGroupBox;
43 class QLabel;
44 class QLineEdit;
45 class QPushButton;
46 class QRadioButton;
47 class QCheckBox;
48 class QListView;
49 class QListViewItem;
50 class QListBox;
51 class SMESHGUI;
52 class SMESHGUI_SpinBox;
53 class SMESH_Actor;
54 class SVTK_ViewWindow;
55 class SVTK_Selector;
56
57
58 // IDL Headers
59 #include <SALOMEconfig.h>
60 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
61
62
63 //=================================================================================
64 // class    : SMESHGUI_MergeNodesDlg
65 // purpose  :
66 //=================================================================================
67 class SMESHGUI_EXPORT SMESHGUI_MergeNodesDlg : public QDialog
68
69     Q_OBJECT
70
71 public:
72     SMESHGUI_MergeNodesDlg( SMESHGUI*,
73                             const char* name = 0,
74                             bool modal = FALSE,
75                             WFlags fl = 0);
76     ~SMESHGUI_MergeNodesDlg();
77
78 private:
79     void Init();
80     void closeEvent( QCloseEvent* e );
81     void enterEvent ( QEvent * );                           /* mouse enter the QWidget */
82     void hideEvent ( QHideEvent * );                        /* ESC key */
83     void keyPressEvent( QKeyEvent* e );
84     void onEditNodesGroup();
85
86     SMESHGUI*                     mySMESHGUI;               /* Current SMESHGUI object */
87     LightApp_SelectionMgr*        mySelectionMgr;           /* User shape selection */
88     SVTK_Selector*                mySelector;
89
90     QWidget*                      myEditCurrentArgument;
91
92     SMESH::SMESH_Mesh_var         myMesh;
93     SMESH::SMESH_IDSource_var     mySubMeshOrGroup;
94     SMESH_Actor*                  myActor;
95     //Handle(SMESH_TypeFilter)      myMeshOrSubMeshFilter;
96     SUIT_SelectionFilter*         myMeshOrSubMeshOrGroupFilter;
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