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