Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_AddMeshElementDlg.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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //
23 //
24 //  File   : SMESHGUI_AddMeshElementDlg.h
25 //  Author : Nicolas REJNERI
26 //  Module : SMESH
27 //  $Header$
28
29 #ifndef DIALOGBOX_ADD_FACE_H
30 #define DIALOGBOX_ADD_FACE_H
31
32 #include "SMESH_SMESHGUI.hxx"
33
34 #include "LightApp_SelectionMgr.h"
35
36 #include "SMDSAbs_ElementType.hxx"
37
38
39 // QT Includes
40 #include <qvariant.h>
41 #include <qdialog.h>
42
43 class QVBoxLayout; 
44 class QHBoxLayout; 
45 class QGridLayout; 
46 class QButtonGroup;
47 class QGroupBox;
48 class QLabel;
49 class QLineEdit;
50 class QPushButton;
51 class QRadioButton;
52 class QCheckBox;
53 class SMESHGUI;
54 class SMESH_Actor;
55 class SMDS_Mesh;
56 class SVTK_ViewWindow;
57 class SVTK_Selector;
58
59 namespace SMESH{
60   struct TElementSimulation;
61 }
62
63 // IDL Headers
64 #include <SALOMEconfig.h>
65 #include CORBA_SERVER_HEADER(SMESH_Mesh)
66
67 //=================================================================================
68 // class    : SMESHGUI_AddMeshElementDlg
69 // purpose  :
70 //=================================================================================
71 class SMESHGUI_EXPORT SMESHGUI_AddMeshElementDlg : public QDialog
72
73     Q_OBJECT
74
75 public:
76     SMESHGUI_AddMeshElementDlg( SMESHGUI*,
77                                 const char* = 0, 
78                                 SMDSAbs_ElementType ElementType = SMDSAbs_Edge,
79                                 int nbNodes = 2, bool modal = FALSE, WFlags fl = 0 );
80     ~SMESHGUI_AddMeshElementDlg();
81
82 private:
83     void Init ();
84     void closeEvent (QCloseEvent*);
85     void hideEvent (QHideEvent*);                 /* ESC key */
86     void enterEvent (QEvent*);                    /* mouse enter the QWidget */
87     void keyPressEvent(QKeyEvent*);
88     void displaySimulation();
89
90     SMESHGUI*                   mySMESHGUI;              /* Current SMESHGUI object */
91     LightApp_SelectionMgr*      mySelectionMgr;          /* User shape selection */
92     int                         myNbOkNodes;               /* to check when arguments is defined */
93     bool                        myBusy;
94     SVTK_Selector*              mySelector;
95
96     QLineEdit*                  myEditCurrentArgument;   /* Current  LineEdit */
97
98     int                         myElementType;
99     int                         myNbNodes;
100     bool                        myIsPoly;
101
102     SMESH::SMESH_Mesh_var       myMesh;
103     SMESH_Actor*                myActor;
104     SMESH::TElementSimulation*  mySimulation;
105     
106     QButtonGroup* GroupConstructors;
107     QRadioButton* Constructor1;
108     QGroupBox   * GroupButtons;
109     QPushButton * buttonOk;
110     QPushButton * buttonCancel;
111     QPushButton * buttonApply;
112     QPushButton * buttonHelp;
113     QGroupBox   * GroupC1;
114     QLabel      * TextLabelC1A1;
115     QPushButton * SelectButtonC1A1;
116     QLineEdit   * LineEditC1A1;
117
118     QCheckBox   * Reverse;
119
120     QString       myHelpFileName;
121
122 private slots:
123
124     void ClickOnOk();
125     void ClickOnCancel();
126     void ClickOnApply();
127     void ClickOnHelp();
128     void SetEditCurrentArgument() ;
129     void SelectionIntoArgument() ;
130     void DeactivateActiveDialog() ;
131     void ActivateThisDialog() ;
132     void CheckBox( int );
133     void onTextChange(const QString&);
134
135 protected:
136     QGridLayout* SMESHGUI_AddMeshElementDlgLayout;
137     QGridLayout* GroupConstructorsLayout;
138     QGridLayout* GroupButtonsLayout;
139     QGridLayout* GroupC1Layout;
140 };
141
142 #endif // DIALOGBOX_ADD_FACE_H