Salome HOME
0019970: create groups automatically
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_AddQuadraticElementDlg.h
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 //
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
8 //
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 #ifndef DIALOGBOX_ADD_QUADRATIC_ELEMENT_H
21 #define DIALOGBOX_ADD_QUADRATIC_ELEMENT_H
22
23 #include "LightApp_SelectionMgr.h"
24
25 // QT Includes
26 #include <qdialog.h>
27 #include <qtable.h>
28
29 class QButtonGroup;
30 class QGroupBox;
31 class QLineEdit;
32 class QPushButton;
33 class QRadioButton;
34 class QCheckBox;
35 class QTable;
36 class SMESHGUI;
37 class SMESH_Actor;
38 class SVTK_Selector;
39
40 namespace SMESH{
41   struct TElementSimulation;
42 }
43
44 // IDL Headers
45 #include <SALOMEconfig.h>
46 #include CORBA_SERVER_HEADER(SMESH_Mesh)
47
48 enum { QUAD_EDGE, QUAD_TRIANGLE, QUAD_QUADRANGLE, QUAD_TETRAHEDRON, QUAD_PYRAMID, QUAD_PENTAHEDRON, QUAD_HEXAHEDRON };
49
50 //=================================================================================
51 // class    : SMESHGUI_AddQuadraticElementDlg
52 // purpose  :
53 //=================================================================================
54 class SMESHGUI_AddQuadraticElementDlg : public QDialog
55
56     Q_OBJECT
57
58 public:
59     SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theModule,
60                                      const int theType,
61                                      const char* = 0, 
62                                      bool modal = FALSE, WFlags fl = 0 );
63     ~SMESHGUI_AddQuadraticElementDlg();
64
65 private:
66     void Init ();
67     void closeEvent (QCloseEvent*);
68     void hideEvent (QHideEvent*);                 /* ESC key */
69     void enterEvent (QEvent*);                    /* mouse enter the QWidget */
70     void keyPressEvent(QKeyEvent*);
71     void displaySimulation();
72     void UpdateTable( bool theConersValidity = true );
73     bool IsValid();
74     void updateButtons();
75
76     SMESHGUI*                   mySMESHGUI;       /* Current SMESHGUI object */
77     LightApp_SelectionMgr*      mySelectionMgr;   /* User shape selection */
78     int                         myNbCorners;      /* The required number of corners */
79     bool                        myBusy;
80     SVTK_Selector*              mySelector;
81
82     SMESH::SMESH_Mesh_var       myMesh;
83     SMESH_Actor*                myActor;
84     SMESH::TElementSimulation*  mySimulation;
85
86     int                         myType;
87     bool                        myIsEditCorners;
88     
89     QButtonGroup* GroupConstructors;
90     QRadioButton* myRadioButton1;
91
92     QGroupBox*    GroupArguments;
93     QLineEdit*    myCornerNodes;
94     QPushButton*  mySelectButton;
95     QTable*       myTable;
96     QCheckBox*    myReverseCB;
97
98     QGroupBox*    GroupButtons;
99     QPushButton*  buttonOk;
100     QPushButton*  buttonCancel;
101     QPushButton*  buttonApply;
102     QPushButton * buttonHelp;
103
104     QString       myHelpFileName;
105
106 private slots:
107   
108     void onTextChange(const QString&);
109     void onCellTextChange(int, int);
110     void onReverse( int );
111     void onCellDoubleClicked(int, int, int, const QPoint&);
112   
113     void ClickOnOk();
114     void ClickOnCancel();
115     void ClickOnApply();
116     void ClickOnHelp();
117     void SetEditCorners() ;
118     void SelectionIntoArgument() ;
119     void DeactivateActiveDialog() ;
120     void ActivateThisDialog() ;
121 };
122
123 #endif // DIALOGBOX_ADD_QUADRATIC_ELEMENT_H