Salome HOME
DCQ : Merge with Ecole_Ete_a6.
[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 <qdialog.h>
38
39 // IDL Headers
40 #include <SALOMEconfig.h>
41 #include CORBA_SERVER_HEADER(GEOM_Gen)
42 #include CORBA_SERVER_HEADER(GEOM_Shape)
43 #include CORBA_SERVER_HEADER(SMESH_Mesh)
44
45 #include <map>
46 #include <string>
47
48 class QGroupBox;
49 class QLabel;
50 class QLineEdit;
51 class QPushButton;
52 class QListBox;
53 class QListBoxItem;
54 class SMESHGUI;
55
56 typedef map<string, int> MapIOR;
57
58 //=================================================================================
59 // class    : SMESHGUI_EditHypothesesDlg
60 // purpose  :
61 //=================================================================================
62 class SMESHGUI_EditHypothesesDlg : public QDialog
63
64     Q_OBJECT
65
66 public:
67     SMESHGUI_EditHypothesesDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
68     ~SMESHGUI_EditHypothesesDlg();
69
70 protected:
71     virtual void closeEvent( QCloseEvent* e ); 
72     virtual void enterEvent ( QEvent* );
73
74 private:
75     void Init( SALOME_Selection* Sel ) ;
76
77     void InitHypDefinition();
78     void InitAlgoDefinition();
79     void InitHypAssignation();
80     void InitAlgoAssignation();
81
82     void InitGeom();
83
84     void UpdateControlState();
85
86     bool StoreMesh();
87     bool StoreSubMesh();
88
89 private:
90     SMESHGUI*                     mySMESHGUI ;
91     SALOME_Selection*             mySelection ;
92              
93     GEOM::GEOM_Shape_var          myGeomShape ;
94     QLineEdit*                    myEditCurrentArgument; 
95
96     SMESH::SMESH_Mesh_var         myMesh;
97     SMESH::SMESH_subMesh_var      mySubMesh;
98
99     Handle(SALOME_TypeFilter)     myGeomFilter;
100     Handle(SMESH_TypeFilter)      myMeshOrSubMeshFilter;
101
102     MapIOR                        myMapOldHypos, myMapOldAlgos;
103
104     bool                          myImportedMesh;
105  
106     QGroupBox*    GroupButtons;
107     QPushButton*  buttonOk;
108     QPushButton*  buttonApply;
109     QPushButton*  buttonCancel;
110
111     QGroupBox*    GroupC1;
112     QLabel*       TextLabelC1A1;
113     QPushButton*  SelectButtonC1A1;
114     QLineEdit*    LineEditC1A1;
115     QLabel*       TextLabelC1A2;
116     QPushButton*  SelectButtonC1A2;
117     QLineEdit*    LineEditC1A2;
118
119     QGroupBox*    GroupHypotheses;
120     QLabel*       TextHypDefinition;
121     QListBox*     ListHypDefinition;
122     QLabel*       TextHypAssignation;
123     QListBox*     ListHypAssignation;
124
125     QGroupBox*    GroupAlgorithms;
126     QLabel*       TextAlgoDefinition;
127     QListBox*     ListAlgoDefinition;
128     QLabel*       TextAlgoAssignation;
129     QListBox*     ListAlgoAssignation;
130
131 private slots:
132     void ClickOnOk();
133     bool ClickOnApply();
134     void ClickOnCancel();
135     void SetEditCurrentArgument() ;
136     void SelectionIntoArgument() ;
137     void DeactivateActiveDialog() ;
138     void ActivateThisDialog() ;
139
140     void removeItem(QListBoxItem*);
141     void addItem(QListBoxItem*);
142 };
143
144 #endif // DIALOGBOX_EDIT_HYPOTHESES_H