Salome HOME
PAL15429 Computation of the mesh, based on "014.brep" via Tetrahedron(NETGEN), is...
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_AddQuadraticElementDlg.h
1 //  Copyright (C) 2007-2008  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 #ifndef DIALOGBOX_ADD_QUADRATIC_ELEMENT_H
23 #define DIALOGBOX_ADD_QUADRATIC_ELEMENT_H
24
25 #include "LightApp_SelectionMgr.h"
26
27 // QT Includes
28 #include <qdialog.h>
29 #include <qtable.h>
30
31 class QButtonGroup;
32 class QGroupBox;
33 class QLineEdit;
34 class QPushButton;
35 class QRadioButton;
36 class QCheckBox;
37 class QTable;
38 class SMESHGUI;
39 class SMESH_Actor;
40 class SVTK_Selector;
41
42 namespace SMESH{
43   struct TElementSimulation;
44 }
45
46 // IDL Headers
47 #include <SALOMEconfig.h>
48 #include CORBA_SERVER_HEADER(SMESH_Mesh)
49
50 enum { QUAD_EDGE, QUAD_TRIANGLE, QUAD_QUADRANGLE, QUAD_TETRAHEDRON, QUAD_PYRAMID, QUAD_PENTAHEDRON, QUAD_HEXAHEDRON };
51
52 //=================================================================================
53 // class    : SMESHGUI_AddQuadraticElementDlg
54 // purpose  :
55 //=================================================================================
56 class SMESHGUI_AddQuadraticElementDlg : public QDialog
57
58     Q_OBJECT
59
60 public:
61     SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theModule,
62                                      const int theType,
63                                      const char* = 0, 
64                                      bool modal = FALSE, WFlags fl = 0 );
65     ~SMESHGUI_AddQuadraticElementDlg();
66
67 private:
68     void Init ();
69     void closeEvent (QCloseEvent*);
70     void hideEvent (QHideEvent*);                 /* ESC key */
71     void enterEvent (QEvent*);                    /* mouse enter the QWidget */
72     void keyPressEvent(QKeyEvent*);
73     void displaySimulation();
74     void UpdateTable( bool theConersValidity = true );
75     bool IsValid();
76     void updateButtons();
77
78     SMESHGUI*                   mySMESHGUI;       /* Current SMESHGUI object */
79     LightApp_SelectionMgr*      mySelectionMgr;   /* User shape selection */
80     int                         myNbCorners;      /* The required number of corners */
81     bool                        myBusy;
82     SVTK_Selector*              mySelector;
83
84     SMESH::SMESH_Mesh_var       myMesh;
85     SMESH_Actor*                myActor;
86     SMESH::TElementSimulation*  mySimulation;
87
88     int                         myType;
89     bool                        myIsEditCorners;
90     
91     QButtonGroup* GroupConstructors;
92     QRadioButton* myRadioButton1;
93
94     QGroupBox*    GroupArguments;
95     QLineEdit*    myCornerNodes;
96     QPushButton*  mySelectButton;
97     QTable*       myTable;
98     QCheckBox*    myReverseCB;
99
100     QGroupBox*    GroupButtons;
101     QPushButton*  buttonOk;
102     QPushButton*  buttonCancel;
103     QPushButton*  buttonApply;
104     QPushButton * buttonHelp;
105
106     QString       myHelpFileName;
107
108 private slots:
109   
110     void onTextChange(const QString&);
111     void onCellTextChange(int, int);
112     void onReverse( int );
113     void onCellDoubleClicked(int, int, int, const QPoint&);
114   
115     void ClickOnOk();
116     void ClickOnCancel();
117     void ClickOnApply();
118     void ClickOnHelp();
119     void SetEditCorners() ;
120     void SelectionIntoArgument() ;
121     void DeactivateActiveDialog() ;
122     void ActivateThisDialog() ;
123 };
124
125 #endif // DIALOGBOX_ADD_QUADRATIC_ELEMENT_H