Salome HOME
Join modifications from branch OCC_development_for_3_2_0a2
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_AddQuadraticElementDlg.h
1 #ifndef DIALOGBOX_ADD_QUADRATIC_ELEMENT_H
2 #define DIALOGBOX_ADD_QUADRATIC_ELEMENT_H
3
4 #include "LightApp_SelectionMgr.h"
5
6 // QT Includes
7 #include <qdialog.h>
8 #include <qtable.h>
9
10 class QButtonGroup;
11 class QGroupBox;
12 class QLineEdit;
13 class QPushButton;
14 class QRadioButton;
15 class QCheckBox;
16 class QTable;
17 class SMESHGUI;
18 class SMESH_Actor;
19 class SVTK_Selector;
20
21 namespace SMESH{
22   struct TElementSimulation;
23 }
24
25 // IDL Headers
26 #include <SALOMEconfig.h>
27 #include CORBA_SERVER_HEADER(SMESH_Mesh)
28
29 enum { QUAD_EDGE, QUAD_TRIANGLE, QUAD_QUADRANGLE, QUAD_TETRAHEDRON, QUAD_PYRAMID, QUAD_PENTAHEDRON, QUAD_HEXAHEDRON };
30
31 //=================================================================================
32 // class    : SMESHGUI_AddQuadraticElementDlg
33 // purpose  :
34 //=================================================================================
35 class SMESHGUI_AddQuadraticElementDlg : public QDialog
36
37     Q_OBJECT
38
39 public:
40     SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theModule,
41                                      const int theType,
42                                      const char* = 0, 
43                                      bool modal = FALSE, WFlags fl = 0 );
44     ~SMESHGUI_AddQuadraticElementDlg();
45
46 private:
47     void Init ();
48     void closeEvent (QCloseEvent*);
49     void hideEvent (QHideEvent*);                 /* ESC key */
50     void enterEvent (QEvent*);                    /* mouse enter the QWidget */
51     void displaySimulation();
52     void UpdateTable( bool theConersValidity = true );
53     bool IsValid();
54
55     SMESHGUI*                   mySMESHGUI;       /* Current SMESHGUI object */
56     LightApp_SelectionMgr*      mySelectionMgr;   /* User shape selection */
57     int                         myNbCorners;      /* The required number of corners */
58     bool                        myBusy;
59     SVTK_Selector*              mySelector;
60
61     SMESH::SMESH_Mesh_var       myMesh;
62     SMESH_Actor*                myActor;
63     SMESH::TElementSimulation*  mySimulation;
64
65     int                         myType;
66     bool                        myIsEditCorners;
67     
68     QButtonGroup* GroupConstructors;
69     QRadioButton* myRadioButton1;
70
71     QGroupBox*    GroupArguments;
72     QLineEdit*    myCornerNodes;
73     QPushButton*  mySelectButton;
74     QTable*       myTable;
75     QCheckBox*    myReverseCB;
76
77     QGroupBox*    GroupButtons;
78     QPushButton*  buttonOk;
79     QPushButton*  buttonCancel;
80     QPushButton*  buttonApply;
81    
82 private slots:
83   
84     void onTextChange(const QString&);
85     void onCellTextChange(int, int);
86     void onReverse( int );
87     void onCellDoubleClicked(int, int, int, const QPoint&);
88   
89     void ClickOnOk();
90     void ClickOnCancel();
91     void ClickOnApply();
92     void SetEditCorners() ;
93     void SelectionIntoArgument() ;
94     void DeactivateActiveDialog() ;
95     void ActivateThisDialog() ;
96 };
97
98 class SMESHGUI_IdEditItem: public QTableItem
99 {
100 public:
101     SMESHGUI_IdEditItem(QTable* table, EditType et, const QString& text ):
102       QTableItem(table, et, text) {};
103     ~SMESHGUI_IdEditItem() {};
104
105     QWidget* createEditor() const;
106 };
107
108
109 #endif // DIALOGBOX_ADD_QUADRATIC_ELEMENT_H