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