Salome HOME
Join modifications from branch BR_DEBUG_3_2_0b1
[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 displaySimulation();
71     void UpdateTable( bool theConersValidity = true );
72     bool IsValid();
73
74     SMESHGUI*                   mySMESHGUI;       /* Current SMESHGUI object */
75     LightApp_SelectionMgr*      mySelectionMgr;   /* User shape selection */
76     int                         myNbCorners;      /* The required number of corners */
77     bool                        myBusy;
78     SVTK_Selector*              mySelector;
79
80     SMESH::SMESH_Mesh_var       myMesh;
81     SMESH_Actor*                myActor;
82     SMESH::TElementSimulation*  mySimulation;
83
84     int                         myType;
85     bool                        myIsEditCorners;
86     
87     QButtonGroup* GroupConstructors;
88     QRadioButton* myRadioButton1;
89
90     QGroupBox*    GroupArguments;
91     QLineEdit*    myCornerNodes;
92     QPushButton*  mySelectButton;
93     QTable*       myTable;
94     QCheckBox*    myReverseCB;
95
96     QGroupBox*    GroupButtons;
97     QPushButton*  buttonOk;
98     QPushButton*  buttonCancel;
99     QPushButton*  buttonApply;
100     QPushButton * buttonHelp;
101
102     QString       myHelpFileName;
103
104 private slots:
105   
106     void onTextChange(const QString&);
107     void onCellTextChange(int, int);
108     void onReverse( int );
109     void onCellDoubleClicked(int, int, int, const QPoint&);
110   
111     void ClickOnOk();
112     void ClickOnCancel();
113     void ClickOnApply();
114     void ClickOnHelp();
115     void SetEditCorners() ;
116     void SelectionIntoArgument() ;
117     void DeactivateActiveDialog() ;
118     void ActivateThisDialog() ;
119 };
120
121 class SMESHGUI_IdEditItem: public QTableItem
122 {
123 public:
124     SMESHGUI_IdEditItem(QTable* table, EditType et, const QString& text ):
125       QTableItem(table, et, text) {};
126     ~SMESHGUI_IdEditItem() {};
127
128     QWidget* createEditor() const;
129 };
130
131
132 #endif // DIALOGBOX_ADD_QUADRATIC_ELEMENT_H