Salome HOME
Add some comments
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_AddHypothesisDlg.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_AddHypothesisDlg.h
25 //  Author : Nicolas REJNERI
26 //  Module : SMESH
27 //  $Header$
28
29 #ifndef DIALOGBOX_ADD_HYPOTHESIS_H
30 #define DIALOGBOX_ADD_HYPOTHESIS_H
31
32 #include "SALOME_Selection.h"
33 #include "SALOME_TypeFilter.hxx"
34 #include "SMESH_TypeFilter.hxx"
35 #include "SALOME_ListIO.hxx"
36
37 // IDL Headers
38 #include <SALOMEconfig.h>
39 #include CORBA_SERVER_HEADER(SMESH_Gen)
40
41 // QT Includes
42 #include <qvariant.h>
43 #include <qdialog.h>
44
45 class QVBoxLayout; 
46 class QHBoxLayout; 
47 class QGridLayout; 
48 class QButtonGroup;
49 class QFrame;
50 class QGroupBox;
51 class QLabel;
52 class QLineEdit;
53 class QPushButton;
54 class QRadioButton;
55 class SMESHGUI;
56
57
58 //=================================================================================
59 // class    : SMESHGUI_AddHypothesisDlg
60 // purpose  :
61 //=================================================================================
62 class SMESHGUI_AddHypothesisDlg : public QDialog
63
64     Q_OBJECT
65
66 public:
67     SMESHGUI_AddHypothesisDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
68     ~SMESHGUI_AddHypothesisDlg();
69
70 private:
71
72     void Init( SALOME_Selection* Sel ) ;
73     void closeEvent( QCloseEvent* e ) ;
74     void enterEvent ( QEvent * ) ;                /* mouse enter the QWidget */
75
76     SMESH::SMESH_Gen_var  myCompMesh ;                
77     SMESHGUI*             mySMESHGUI ;            
78     SALOME_Selection*     mySelection ;          
79
80     SMESH::SMESH_Mesh_var       myMesh;
81     SMESH::SMESH_subMesh_var    mySubMesh;
82
83     SMESH::SMESH_Hypothesis_var myHypothesis;
84
85     Handle(SMESH_TypeFilter)  myHypothesisFilter;
86     Handle(SMESH_TypeFilter)  myMeshOrSubMeshFilter;
87
88     bool                      myOkMesh ;
89     bool                      myOkSubMesh ;
90     bool                      myOkHypothesis;
91
92     int                   myConstructorId ;       /* Current constructor id = radio button id */
93     QLineEdit*            myEditCurrentArgument;  /* Current LineEdit */    
94
95     SALOME_ListIO HypoList;
96
97     QButtonGroup* GroupConstructors;
98     QRadioButton* Constructor1;
99
100     QGroupBox* GroupConstructor1;
101     QLineEdit* LineEditC1A1Hyp;
102     QLineEdit* LineEditC1A2Mesh;
103     QPushButton* SelectButtonC1A1Hyp;
104     QPushButton* SelectButtonC1A2Mesh;
105     QLabel* TextLabelC1A2Mesh;
106     QLabel* TextLabelC1A1Hyp;
107
108     QGroupBox* GroupButtons;
109     QPushButton* buttonApply;
110     QPushButton* buttonOk;
111     QPushButton* buttonCancel;
112
113 private slots:
114
115     void ConstructorsClicked(int constructorId);
116     void ClickOnOk();
117     void ClickOnCancel();
118     void ClickOnApply();
119     void SetEditCurrentArgument() ;
120     void SelectionIntoArgument() ;
121     void LineEditReturnPressed() ;
122     void DeactivateActiveDialog() ;
123     void ActivateThisDialog() ;
124
125 protected:
126     QGridLayout* SMESHGUI_AddHypothesisDlgLayout;
127     QGridLayout* GroupConstructorsLayout;
128     QGridLayout* GroupButtonsLayout;
129     QGridLayout* GroupConstructor1Layout;
130 };
131
132 #endif // DIALOGBOX_ADD_HYPOTHESIS_H