Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_SewingDlg.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_SewingDlg.h
25 //  Author : Michael ZORIN
26 //  Module : SMESH
27 //  $Header: 
28
29 #ifndef DIALOGBOX_SEWING_H
30 #define DIALOGBOX_SEWING_H
31
32 #include "SMESH_SMESHGUI.hxx"
33
34 #include "LightApp_SelectionMgr.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 SMESHGUI;
48 class SMESH_Actor;
49 class SVTK_ViewWindow;
50 class SVTK_Selector;
51
52 // IDL Headers
53 #include <SALOMEconfig.h>
54 #include CORBA_SERVER_HEADER(SMESH_Mesh)
55
56
57 //=================================================================================
58 // class    : SMESHGUI_SewingDlg
59 // purpose  :
60 //=================================================================================
61 class SMESHGUI_EXPORT SMESHGUI_SewingDlg : public QDialog
62
63     Q_OBJECT
64
65 public:
66     SMESHGUI_SewingDlg( SMESHGUI*,
67                         const char* name = 0,
68                         bool modal = FALSE,
69                         WFlags fl = 0);
70     ~SMESHGUI_SewingDlg();
71
72 private:
73     void Init() ;
74     void closeEvent( QCloseEvent* e ) ;
75     void enterEvent ( QEvent * );                          /* mouse enter the QWidget */
76     void hideEvent ( QHideEvent * );                       /* ESC key */
77     void keyPressEvent(QKeyEvent*);
78     int  GetConstructorId();
79     bool IsValid();
80     
81     SMESHGUI*                     mySMESHGUI;              /* Current SMESHGUI object */
82     LightApp_SelectionMgr*        mySelectionMgr;          /* User shape selection */
83     int                           myOk1, myOk2, myOk3, myOk4, myOk5, myOk6;    
84     QLineEdit*                    myEditCurrentArgument;   /* Current  LineEdit */
85     SVTK_Selector*                mySelector;
86     
87     bool                          myBusy;
88     SMESH::SMESH_Mesh_var         myMesh;
89     SMESH_Actor*                  myActor;
90         
91     QButtonGroup* GroupConstructors;
92     QRadioButton* RadioButton1;
93     QRadioButton* RadioButton2;
94     QRadioButton* RadioButton3;
95     QRadioButton* RadioButton4;
96     QGroupBox* GroupButtons;
97     QPushButton* buttonOk;
98     QPushButton* buttonCancel;
99     QPushButton* buttonApply;
100     QPushButton* buttonHelp;
101     QGroupBox* GroupArguments;
102     QGroupBox* SubGroup1;
103     QGroupBox* SubGroup2;
104     QLabel* TextLabel1;
105     QLabel* TextLabel2;
106     QLabel* TextLabel3;
107     QLabel* TextLabel4;
108     QLabel* TextLabel5;
109     QLabel* TextLabel6;
110     QPushButton* SelectButton1;
111     QPushButton* SelectButton2;
112     QPushButton* SelectButton3;
113     QPushButton* SelectButton4;
114     QPushButton* SelectButton5;
115     QPushButton* SelectButton6;
116     QLineEdit* LineEdit1;
117     QLineEdit* LineEdit2;
118     QLineEdit* LineEdit3;
119     QLineEdit* LineEdit4;
120     QLineEdit* LineEdit5;
121     QLineEdit* LineEdit6;
122     QCheckBox* CheckBoxMerge;
123     QCheckBox* CheckBoxPolygons;
124     QCheckBox* CheckBoxPolyedrs;
125
126     QString myHelpFileName;
127
128 private slots:
129
130     void ConstructorsClicked(int constructorId);
131     void ClickOnOk();
132     void ClickOnCancel();
133     bool ClickOnApply();
134     void ClickOnHelp();
135     void SetEditCurrentArgument() ;
136     void SelectionIntoArgument(bool isSelectionChanged = true) ;
137     void DeactivateActiveDialog() ;
138     void ActivateThisDialog() ;
139     void onTextChange(const QString&);
140     
141 protected:
142     QGridLayout* SMESHGUI_SewingDlgLayout;
143     QGridLayout* GroupConstructorsLayout;
144     QGridLayout* GroupButtonsLayout;
145     QGridLayout* GroupArgumentsLayout;
146 };
147
148 #endif // DIALOGBOX_SEWING_H