Salome HOME
Fix of issue 0020614: EDF 1133 SMESH : Put new added elements and nodes to group
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_AddQuadraticElementDlg.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_AddMeshElementDlg.h
24 // Author : Nicolas REJNERI, Open CASCADE S.A.S.
25 //
26 #ifndef SMESHGUI_ADDQUADRATICELEMENTDLG_H
27 #define SMESHGUI_ADDQUADRATICELEMENTDLG_H
28
29 // SMESH includes
30 #include "SMESH_SMESHGUI.hxx"
31
32 // Qt includes
33 #include <QDialog>
34
35 // IDL includes
36 #include <SALOMEconfig.h>
37 #include CORBA_SERVER_HEADER(SMESH_Mesh)
38
39 class QComboBox;
40 class QGroupBox;
41 class QLabel;
42 class QLineEdit;
43 class QPushButton;
44 class QRadioButton;
45 class QCheckBox;
46 class QTableWidget;
47 class SMESHGUI;
48 class SMESH_Actor;
49 class SVTK_Selector;
50 class LightApp_SelectionMgr;
51
52 namespace SMESH
53 {
54   struct TElementSimulation;
55 }
56
57 enum { QUAD_EDGE, QUAD_TRIANGLE, QUAD_QUADRANGLE, QUAD_TETRAHEDRON, 
58        QUAD_PYRAMID, QUAD_PENTAHEDRON, QUAD_HEXAHEDRON };
59
60 //=================================================================================
61 // class    : SMESHGUI_AddQuadraticElementDlg
62 // purpose  :
63 //=================================================================================
64 class SMESHGUI_EXPORT SMESHGUI_AddQuadraticElementDlg : public QDialog
65
66   Q_OBJECT
67
68 public:
69   SMESHGUI_AddQuadraticElementDlg( SMESHGUI*, const int );
70   ~SMESHGUI_AddQuadraticElementDlg();
71   
72 private:
73   void                        Init();
74   void                        closeEvent( QCloseEvent* );
75   void                        hideEvent( QHideEvent* );    /* ESC key */
76   void                        enterEvent( QEvent* );       /* mouse enter the QWidget */
77   void                        keyPressEvent( QKeyEvent* );
78   void                        displaySimulation();
79   void                        UpdateTable( bool = true );
80   bool                        IsValid();
81   void                        updateButtons();
82
83   bool                        isValid();
84   
85   SMESHGUI*                   mySMESHGUI;       /* Current SMESHGUI object */
86   LightApp_SelectionMgr*      mySelectionMgr;   /* User shape selection */
87   int                         myNbCorners;      /* The required number of corners */
88   bool                        myBusy;
89   SVTK_Selector*              mySelector;
90   
91   SMESH::SMESH_Mesh_var       myMesh;
92   SMESH_Actor*                myActor;
93   SMESH::TElementSimulation*  mySimulation;
94   QString                     myEntry;
95   
96   int                         myType;
97   bool                        myIsEditCorners;
98   
99   QGroupBox*                  GroupConstructors;
100   QRadioButton*               myRadioButton1;
101   
102   QGroupBox*                  GroupArguments;
103   QLineEdit*                  myCornerNodes;
104   QPushButton*                mySelectButton;
105   QTableWidget*               myTable;
106   QCheckBox*                  myReverseCB;
107   
108   QGroupBox*                  GroupGroups;
109   QLabel*                     TextLabel_GroupName;
110   QComboBox*                  ComboBox_GroupName;
111
112   QGroupBox*                  GroupButtons;
113   QPushButton*                buttonOk;
114   QPushButton*                buttonCancel;
115   QPushButton*                buttonApply;
116   QPushButton*                buttonHelp;
117   
118   QString                     myHelpFileName;
119   
120 private slots:
121   void                        onTextChange( const QString& );
122   void                        onCellTextChange( int, int );
123   void                        onReverse( int );
124   void                        onCellDoubleClicked( int, int );
125   
126   void                        ClickOnOk();
127   void                        ClickOnCancel();
128   void                        ClickOnApply();
129   void                        ClickOnHelp();
130   void                        SetEditCorners();
131   void                        SelectionIntoArgument();
132   void                        DeactivateActiveDialog();
133   void                        ActivateThisDialog();
134 };
135
136 #endif // SMESHGUI_ADDQUADRATICELEMENTDLG_H