Salome HOME
Update version number: 3.1.0a2
[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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
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 "SalomeApp_SelectionMgr.h"
33
34 // QT Includes
35 #include <qdialog.h>
36
37 class QGridLayout; 
38 class QButtonGroup;
39 class QGroupBox;
40 class QLabel;
41 class QLineEdit;
42 class QPushButton;
43 class QRadioButton;
44 class QCheckBox;
45 class SMESHGUI;
46 class SMESH_Actor;
47 class SVTK_ViewWindow;
48 class SVTK_Selector;
49
50 // IDL Headers
51 #include <SALOMEconfig.h>
52 #include CORBA_SERVER_HEADER(SMESH_Mesh)
53
54
55 //=================================================================================
56 // class    : SMESHGUI_SewingDlg
57 // purpose  :
58 //=================================================================================
59 class SMESHGUI_SewingDlg : public QDialog
60
61     Q_OBJECT
62
63 public:
64     SMESHGUI_SewingDlg( SMESHGUI*,
65                         const char* name = 0,
66                         bool modal = FALSE,
67                         WFlags fl = 0);
68     ~SMESHGUI_SewingDlg();
69
70 private:
71     void Init() ;
72     void closeEvent( QCloseEvent* e ) ;
73     void enterEvent ( QEvent * );                          /* mouse enter the QWidget */
74     void hideEvent ( QHideEvent * );                       /* ESC key */
75     int  GetConstructorId();
76     bool IsValid();
77     
78     SMESHGUI*                     mySMESHGUI;              /* Current SMESHGUI object */
79     SalomeApp_SelectionMgr*       mySelectionMgr;          /* User shape selection */
80     int                           myOk1, myOk2, myOk3, myOk4, myOk5, myOk6;    
81     QLineEdit*                    myEditCurrentArgument;   /* Current  LineEdit */
82     SVTK_Selector*                mySelector;
83     
84     bool                          myBusy;
85     SMESH::SMESH_Mesh_var         myMesh;
86     SMESH_Actor*                  myActor;
87         
88     QButtonGroup* GroupConstructors;
89     QRadioButton* RadioButton1;
90     QRadioButton* RadioButton2;
91     QRadioButton* RadioButton3;
92     QRadioButton* RadioButton4;
93     QGroupBox* GroupButtons;
94     QPushButton* buttonOk;
95     QPushButton* buttonCancel;
96     QPushButton* buttonApply;
97     QGroupBox* GroupArguments;
98     QGroupBox* SubGroup1;
99     QGroupBox* SubGroup2;
100     QLabel* TextLabel1;
101     QLabel* TextLabel2;
102     QLabel* TextLabel3;
103     QLabel* TextLabel4;
104     QLabel* TextLabel5;
105     QLabel* TextLabel6;
106     QPushButton* SelectButton1;
107     QPushButton* SelectButton2;
108     QPushButton* SelectButton3;
109     QPushButton* SelectButton4;
110     QPushButton* SelectButton5;
111     QPushButton* SelectButton6;
112     QLineEdit* LineEdit1;
113     QLineEdit* LineEdit2;
114     QLineEdit* LineEdit3;
115     QLineEdit* LineEdit4;
116     QLineEdit* LineEdit5;
117     QLineEdit* LineEdit6;
118     QCheckBox* CheckBoxMerge;
119     QCheckBox* CheckBoxPolygons;
120     QCheckBox* CheckBoxPolyedrs;
121
122 private slots:
123
124     void ConstructorsClicked(int constructorId);
125     void ClickOnOk();
126     void ClickOnCancel();
127     bool ClickOnApply();
128     void SetEditCurrentArgument() ;
129     void SelectionIntoArgument(bool isSelectionChanged = true) ;
130     void DeactivateActiveDialog() ;
131     void ActivateThisDialog() ;
132     void onTextChange(const QString&);
133     
134 protected:
135     QGridLayout* SMESHGUI_SewingDlgLayout;
136     QGridLayout* GroupConstructorsLayout;
137     QGridLayout* GroupButtonsLayout;
138     QGridLayout* GroupArgumentsLayout;
139 };
140
141 #endif // DIALOGBOX_SEWING_H