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