Salome HOME
3b2c360b26f6bcf5dcdb889a6cad339b47b321b9
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_AddQuadraticElementDlg.h
1 // Copyright (C) 2007-2012  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 #include "SMDSAbs_ElementType.hxx"
33
34 // Qt includes
35 #include <QDialog>
36
37 // IDL includes
38 #include <SALOMEconfig.h>
39 #include CORBA_SERVER_HEADER(SMESH_Mesh)
40
41 class QComboBox;
42 class QFrame;
43 class QGroupBox;
44 class QLabel;
45 class QLineEdit;
46 class QPushButton;
47 class QRadioButton;
48 class QCheckBox;
49 class QTableWidget;
50 class SMESHGUI;
51 class SMESH_Actor;
52 class SVTK_Selector;
53 class LightApp_SelectionMgr;
54
55 namespace SMESH
56 {
57   struct TElementSimulation;
58 }
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 SMDSAbs_EntityType );
70   ~SMESHGUI_AddQuadraticElementDlg();
71   
72 private:
73   typedef QList<SMESH::SMESH_GroupBase_var> GrpList;
74
75   void                        Init();
76   void                        closeEvent( QCloseEvent* );
77   void                        hideEvent( QHideEvent* );    /* ESC key */
78   void                        enterEvent( QEvent* );       /* mouse enter the QWidget */
79   void                        keyPressEvent( QKeyEvent* );
80   void                        displaySimulation();
81   void                        UpdateTable( bool = true );
82   bool                        IsValid();
83   void                        updateButtons();
84
85   bool                        isValid();
86   
87   SMESHGUI*                   mySMESHGUI;       /* Current SMESHGUI object */
88   LightApp_SelectionMgr*      mySelectionMgr;   /* User shape selection */
89   int                         myNbCorners;      /* The required number of corners */
90   int                         myNbMidFaceNodes;
91   int                         myNbCenterNodes;
92   bool                        myBusy;
93   SVTK_Selector*              mySelector;
94   
95   SMESH::SMESH_Mesh_var       myMesh;
96   SMESH_Actor*                myActor;
97   SMESH::TElementSimulation*  mySimulation;
98   QString                     myEntry;
99   GrpList                     myGroups;
100   
101   SMDSAbs_EntityType          myGeomType;
102   QLineEdit*                  myCurrentLineEdit;
103   
104   QGroupBox*                  GroupConstructors;
105   QRadioButton*               myRadioButton1;
106   
107   QGroupBox*                  GroupArguments;
108   QPushButton*                myCornerSelectButton;
109   QLineEdit*                  myCornerNodes;
110   QLabel*                     myMidFaceLabel;
111   QPushButton*                myMidFaceSelectButton;
112   QLineEdit*                  myMidFaceNodes;
113   QLabel*                     myCenterLabel;
114   QPushButton*                myCenterSelectButton;
115   QLineEdit*                  myCenterNode;
116   QTableWidget*               myTable;
117   QCheckBox*                  myReverseCB;
118   
119   QGroupBox*                  GroupGroups;
120   QLabel*                     TextLabel_GroupName;
121   QComboBox*                  ComboBox_GroupName;
122
123   QGroupBox*                  GroupButtons;
124   QPushButton*                buttonOk;
125   QPushButton*                buttonCancel;
126   QPushButton*                buttonApply;
127   QPushButton*                buttonHelp;
128   
129   QString                     myHelpFileName;
130   
131 private slots:
132   void                        onTextChange( const QString& );
133   void                        onCellTextChange( int, int );
134   void                        onReverse( int );
135   void                        onCellDoubleClicked( int, int );
136   
137   void                        ClickOnOk();
138   void                        ClickOnCancel();
139   void                        ClickOnApply();
140   void                        ClickOnHelp();
141   void                        SetCurrentSelection();
142   void                        SelectionIntoArgument();
143   void                        DeactivateActiveDialog();
144   void                        ActivateThisDialog();
145 };
146
147 #endif // SMESHGUI_ADDQUADRATICELEMENTDLG_H