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