Salome HOME
NRI : First integration.
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_EditHypothesesDlg.h
1 //  File      : SMESHGUI_EditHypothesesDlg.h
2 //  Created   : Fri Aug 02 09:15:40 2002
3 //  Author    : Nicolas REJNERI
4
5 //  Project   : SALOME
6 //  Module    : SALOMEDS
7 //  Copyright : Open CASCADE 2002
8 //  $Header$
9
10 #ifndef DIALOGBOX_EDIT_HYPOTHESES_H
11 #define DIALOGBOX_EDIT_HYPOTHESES_H
12
13 #include "SALOME_Selection.h"
14 #include "SALOME_TypeFilter.hxx"
15 #include "SMESH_TypeFilter.hxx"
16
17 // QT Includes
18 #include <qvariant.h>
19 #include <qdialog.h>
20
21 // IDL Headers
22 #include <SALOMEconfig.h>
23 #include CORBA_SERVER_HEADER(GEOM_Gen)
24 #include CORBA_SERVER_HEADER(GEOM_Shape)
25 #include CORBA_SERVER_HEADER(SMESH_Mesh)
26
27 #include <map>
28 #include <string>
29
30 using namespace std;
31
32 class QVBoxLayout; 
33 class QHBoxLayout; 
34 class QGridLayout; 
35 class QButtonGroup;
36 class QGroupBox;
37 class QLabel;
38 class QLineEdit;
39 class QPushButton;
40 class QRadioButton;
41 class QListBox;
42 class QListBoxItem;
43 class SMESHGUI;
44
45
46 //=================================================================================
47 // class    : SMESHGUI_EditHypothesesDlg
48 // purpose  :
49 //=================================================================================
50 class SMESHGUI_EditHypothesesDlg : public QDialog
51
52     Q_OBJECT
53
54 public:
55     SMESHGUI_EditHypothesesDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
56     ~SMESHGUI_EditHypothesesDlg();
57
58 private:
59
60     void Init( SALOME_Selection* Sel ) ;
61     void closeEvent( QCloseEvent* e ) ;
62     void enterEvent ( QEvent * ) ;
63
64     void InitHypDefinition();
65     void InitAlgoDefinition();
66     void InitHypAssignation();
67     void InitAlgoAssignation();
68
69     void InitGeom();
70
71     SMESHGUI*                     mySMESHGUI ;
72     SALOME_Selection*             mySelection ;
73              
74     GEOM::GEOM_Shape_var          myGeomShape ;
75     int                           myConstructorId ; 
76     QLineEdit*                    myEditCurrentArgument; 
77
78     SMESH::SMESH_Mesh_var         myMesh;
79     SMESH::SMESH_subMesh_var      mySubMesh;
80
81     Handle(SALOME_TypeFilter)     myGeomFilter;
82     Handle(SMESH_TypeFilter)      myMeshOrSubMeshFilter;
83
84     map<string,string>            mapNameIOR;
85
86     SALOME_ListIO                 HypoList;
87     SALOME_ListIO                 AlgoList;
88
89     bool                          myOkHypothesis;
90     bool                          myOkAlgorithm;
91
92     SMESH::SMESH_Hypothesis_var   myHypothesis;
93     SMESH::SMESH_Hypothesis_var   myAlgorithm;
94
95     SMESH::ListOfHypothesis_var   myLHypothesis;
96     SMESH::ListOfHypothesis_var   myLAlgorithm;
97  
98     QButtonGroup* GroupConstructors;
99     QRadioButton* Constructor1;
100     QGroupBox*    GroupButtons;
101     QPushButton*  buttonOk;
102     QPushButton*  buttonCancel;
103     QPushButton*  buttonApply;
104     QGroupBox*    GroupC1;
105
106     QLabel*       TextLabelC1A1;
107     QPushButton*  SelectButtonC1A1;
108     QLineEdit*    LineEditC1A1;
109
110     QLabel*       TextLabelC1A2;
111     QPushButton*  SelectButtonC1A2;
112     QLineEdit*    LineEditC1A2;
113
114     QGroupBox* GroupHypotheses;
115     QLabel* TextHypDefinition;
116     QListBox* ListHypDefinition;
117     QLabel* TextHypAssignation;
118     QListBox* ListHypAssignation;
119
120     QGroupBox* GroupAlgorithms;
121     QLabel* TextAlgoDefinition;
122     QListBox* ListAlgoDefinition;
123     QLabel* TextAlgoAssignation;
124     QListBox* ListAlgoAssignation;
125
126 private slots:
127
128     void ConstructorsClicked(int constructorId);
129     void ClickOnCancel();
130     void SetEditCurrentArgument() ;
131     void SelectionIntoArgument() ;
132     void DeactivateActiveDialog() ;
133     void ActivateThisDialog() ;
134     void TextChangedInLineEdit(const QString& newText) ;
135
136     void removeItem(QListBoxItem*);
137     void addItem(QListBoxItem*);
138
139 protected:
140     QGridLayout* SMESHGUI_EditHypothesesDlgLayout;
141     QGridLayout* GroupConstructorsLayout;
142     QGridLayout* GroupButtonsLayout;
143     QGridLayout* GroupC1Layout;
144
145     QGridLayout* grid_3;
146     QGridLayout* grid_4;
147
148     QHBoxLayout* hbox_2;
149     QHBoxLayout* hbox_3;
150
151     QVBoxLayout* vbox;
152     QVBoxLayout* vbox_2;
153     QVBoxLayout* vbox_3;
154     QVBoxLayout* vbox_4;
155
156 };
157
158 #endif // DIALOGBOX_EDIT_HYPOTHESES_H