Salome HOME
Update copyright notes (for 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   void                        Init();
75   void                        closeEvent( QCloseEvent* );
76   void                        hideEvent( QHideEvent* );    /* ESC key */
77   void                        enterEvent( QEvent* );       /* mouse enter the QWidget */
78   void                        keyPressEvent( QKeyEvent* );
79   void                        displaySimulation();
80   void                        UpdateTable( bool = true );
81   bool                        IsValid();
82   void                        updateButtons();
83
84   bool                        isValid();
85   
86   SMESHGUI*                   mySMESHGUI;       /* Current SMESHGUI object */
87   LightApp_SelectionMgr*      mySelectionMgr;   /* User shape selection */
88   int                         myNbCorners;      /* The required number of corners */
89   bool                        myBusy;
90   SVTK_Selector*              mySelector;
91   
92   SMESH::SMESH_Mesh_var       myMesh;
93   SMESH_Actor*                myActor;
94   SMESH::TElementSimulation*  mySimulation;
95   QString                     myEntry;
96   
97   int                         myType;
98   bool                        myIsEditCorners;
99   
100   QGroupBox*                  GroupConstructors;
101   QRadioButton*               myRadioButton1;
102   
103   QGroupBox*                  GroupArguments;
104   QLineEdit*                  myCornerNodes;
105   QPushButton*                mySelectButton;
106   QTableWidget*               myTable;
107   QCheckBox*                  myReverseCB;
108   
109   QGroupBox*                  GroupGroups;
110   QLabel*                     TextLabel_GroupName;
111   QComboBox*                  ComboBox_GroupName;
112
113   QGroupBox*                  GroupButtons;
114   QPushButton*                buttonOk;
115   QPushButton*                buttonCancel;
116   QPushButton*                buttonApply;
117   QPushButton*                buttonHelp;
118   
119   QString                     myHelpFileName;
120   
121 private slots:
122   void                        onTextChange( const QString& );
123   void                        onCellTextChange( int, int );
124   void                        onReverse( int );
125   void                        onCellDoubleClicked( int, int );
126   
127   void                        ClickOnOk();
128   void                        ClickOnCancel();
129   void                        ClickOnApply();
130   void                        ClickOnHelp();
131   void                        SetEditCorners();
132   void                        SelectionIntoArgument();
133   void                        DeactivateActiveDialog();
134   void                        ActivateThisDialog();
135 };
136
137 #endif // SMESHGUI_ADDQUADRATICELEMENTDLG_H