Salome HOME
f7bd8604b7ad249c636a6d917abdaeb8f2ef7190
[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 displaySimulation();
88
89     SMESHGUI*                   mySMESHGUI;              /* Current SMESHGUI object */
90     LightApp_SelectionMgr*      mySelectionMgr;          /* User shape selection */
91     int                         myNbOkNodes;               /* to check when arguments is defined */
92     bool                        myBusy;
93     SVTK_Selector*              mySelector;
94
95     QLineEdit*                  myEditCurrentArgument;   /* Current  LineEdit */
96
97     int                         myElementType;
98     int                         myNbNodes;
99     bool                        myIsPoly;
100
101     SMESH::SMESH_Mesh_var       myMesh;
102     SMESH_Actor*                myActor;
103     SMESH::TElementSimulation*  mySimulation;
104     
105     QButtonGroup* GroupConstructors;
106     QRadioButton* Constructor1;
107     QGroupBox   * GroupButtons;
108     QPushButton * buttonOk;
109     QPushButton * buttonCancel;
110     QPushButton * buttonApply;
111     QPushButton * buttonHelp;
112     QGroupBox   * GroupC1;
113     QLabel      * TextLabelC1A1;
114     QPushButton * SelectButtonC1A1;
115     QLineEdit   * LineEditC1A1;
116
117     QCheckBox   * Reverse;
118
119     QString       myHelpFileName;
120
121 private slots:
122
123     void ClickOnOk();
124     void ClickOnCancel();
125     void ClickOnApply();
126     void ClickOnHelp();
127     void SetEditCurrentArgument() ;
128     void SelectionIntoArgument() ;
129     void DeactivateActiveDialog() ;
130     void ActivateThisDialog() ;
131     void CheckBox( int );
132     void onTextChange(const QString&);
133
134 protected:
135     QGridLayout* SMESHGUI_AddMeshElementDlgLayout;
136     QGridLayout* GroupConstructorsLayout;
137     QGridLayout* GroupButtonsLayout;
138     QGridLayout* GroupC1Layout;
139 };
140
141 #endif // DIALOGBOX_ADD_FACE_H