Salome HOME
Update copyright information
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_EditHypothesesDlg.h
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  SMESH SMESHGUI : GUI for SMESH component
23 //  File   : SMESHGUI_EditHypothesesDlg.h
24 //  Author : Nicolas REJNERI
25 //  Module : SMESH
26 //  $Header$
27 //
28 #ifndef DIALOGBOX_EDIT_HYPOTHESES_H
29 #define DIALOGBOX_EDIT_HYPOTHESES_H
30
31 #include "SMESH_SMESHGUI.hxx"
32
33 //#include "SMESH_TypeFilter.hxx"
34 #include "SUIT_SelectionFilter.h"
35 #include "LightApp_SelectionMgr.h"
36
37 // QT Includes
38 #include <qdialog.h>
39
40 // IDL Headers
41 #include <SALOMEconfig.h>
42 #include CORBA_SERVER_HEADER(GEOM_Gen)
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 std::map<std::string, int> MapIOR;
57
58 //=================================================================================
59 // class    : SMESHGUI_EditHypothesesDlg
60 // purpose  :
61 //=================================================================================
62 class SMESHGUI_EXPORT SMESHGUI_EditHypothesesDlg : public QDialog
63 {
64     Q_OBJECT
65
66 public:
67     SMESHGUI_EditHypothesesDlg (SMESHGUI*,
68                                 const char* name = 0,
69                                 bool modal = FALSE,
70                                 WFlags fl = 0);
71     ~SMESHGUI_EditHypothesesDlg();
72
73 protected:
74     virtual void closeEvent (QCloseEvent*);
75     virtual void enterEvent (QEvent*);
76
77 private:
78     void Init();
79
80     void InitHypDefinition();
81     void InitAlgoDefinition();
82     void InitHypAssignation();
83     void InitAlgoAssignation();
84
85     void InitGeom();
86
87     void UpdateControlState();
88
89     bool StoreMesh();
90     bool StoreSubMesh();
91
92     bool IsOld(QListBoxItem* hypItem);
93
94 private:
95     SMESHGUI*                     mySMESHGUI;
96     LightApp_SelectionMgr*        mySelectionMgr;
97
98     GEOM::GEOM_Object_var         myGeomShape;
99     QLineEdit*                    myEditCurrentArgument; 
100
101     SMESH::SMESH_Mesh_var         myMesh;
102     SMESH::SMESH_subMesh_var      mySubMesh;
103
104     //Handle(SALOME_TypeFilter)     myGeomFilter;
105     //Handle(SMESH_TypeFilter)      myMeshOrSubMeshFilter;
106     SUIT_SelectionFilter*         myGeomFilter;
107     SUIT_SelectionFilter*         myMeshOrSubMeshFilter;
108
109     MapIOR                        myMapOldHypos, myMapOldAlgos;
110     int                           myNbModification;
111
112     bool                          myImportedMesh;
113
114     QGroupBox*    GroupButtons;
115     QPushButton*  buttonOk;
116     QPushButton*  buttonApply;
117     QPushButton*  buttonCancel;
118
119     QGroupBox*    GroupC1;
120     QLabel*       TextLabelC1A1;
121     QPushButton*  SelectButtonC1A1;
122     QLineEdit*    LineEditC1A1;
123     QLabel*       TextLabelC1A2;
124     QPushButton*  SelectButtonC1A2;
125     QLineEdit*    LineEditC1A2;
126
127     QGroupBox*    GroupHypotheses;
128     QLabel*       TextHypDefinition;
129     QListBox*     ListHypDefinition;
130     QLabel*       TextHypAssignation;
131     QListBox*     ListHypAssignation;
132
133     QGroupBox*    GroupAlgorithms;
134     QLabel*       TextAlgoDefinition;
135     QListBox*     ListAlgoDefinition;
136     QLabel*       TextAlgoAssignation;
137     QListBox*     ListAlgoAssignation;
138
139 private slots:
140     void ClickOnOk();
141     bool ClickOnApply();
142     void ClickOnCancel();
143     void SetEditCurrentArgument();
144     void SelectionIntoArgument();
145     void DeactivateActiveDialog();
146     void ActivateThisDialog();
147
148     void removeItem(QListBoxItem*);
149     void addItem(QListBoxItem*);
150 };
151
152 #endif // DIALOGBOX_EDIT_HYPOTHESES_H