Salome HOME
Merge from V5_1_4_BR 07/05/2010
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ExtrusionDlg.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_ExtrusionDlg.h
25 // Author : Michael ZORIN, Open CASCADE S.A.S.
26 //
27 #ifndef SMESHGUI_EXTRUSIONDLG_H
28 #define SMESHGUI_EXTRUSIONDLG_H
29
30 // SMESH includes
31 #include "SMESH_SMESHGUI.hxx"
32
33 // SALOME GUI includes
34 #include <SALOME_InteractiveObject.hxx>
35
36 // Qt includes
37 #include <QDialog>
38
39 // IDL includes
40 #include <SALOMEconfig.h>
41 #include CORBA_SERVER_HEADER(SMESH_Mesh)
42
43 class QButtonGroup;
44 class QRadioButton;
45 class QGroupBox;
46 class QLabel;
47 class QLineEdit;
48 class QCheckBox;
49 class QPushButton;
50
51 class SMESHGUI;
52 class SMESH_Actor;
53 class SMESHGUI_IdValidator;
54 class SMESHGUI_SpinBox;
55 class SMESHGUI_FilterDlg;
56 class SVTK_Selector;
57 class LightApp_SelectionMgr;
58 class SUIT_SelectionFilter;
59 class SalomeApp_IntSpinBox;
60
61 //=================================================================================
62 // class    : SMESHGUI_ExtrusionDlg
63 // purpose  :
64 //=================================================================================
65 class SMESHGUI_EXPORT SMESHGUI_ExtrusionDlg : public QDialog
66 {
67   Q_OBJECT
68
69 public:
70   SMESHGUI_ExtrusionDlg( SMESHGUI* );
71   ~SMESHGUI_ExtrusionDlg();
72
73   void                             reject();
74
75 private:
76   void                             Init( bool = true );
77   void                             enterEvent( QEvent* );       /* mouse enter the QWidget */
78   void                             closeEvent( QCloseEvent* );
79   void                             keyPressEvent( QKeyEvent* );
80   int                              GetConstructorId();
81
82   bool                             isValid();
83   
84   SMESHGUI*                        mySMESHGUI;            /* Current SMESHGUI object */
85   SMESHGUI_IdValidator*            myIdValidator;
86   LightApp_SelectionMgr*           mySelectionMgr;        /* User shape selection */
87   QWidget*                         myEditCurrentArgument; /* Current  argument editor */
88   int                              myNbOkElements;        /* to check when elements are defined */
89   SVTK_Selector*                   mySelector;
90
91   SMESH::SMESH_IDSource_var        mySelectedObject;
92
93   bool                             myBusy;
94   SMESH::SMESH_Mesh_var            myMesh;
95   SMESH::long_array_var            myElementsId;
96   SMESH_Actor*                     myActor;
97   Handle(SALOME_InteractiveObject) myIO;
98   SUIT_SelectionFilter*            myMeshOrSubMeshOrGroupFilter;
99
100   // widgets
101   QGroupBox*                       ConstructorsBox;
102   QButtonGroup*                    GroupConstructors;
103   QRadioButton*                    RadioButton1;
104   QRadioButton*                    RadioButton2;
105   QRadioButton*                    RadioButton3;
106   QRadioButton*                    RadioButton4;
107
108   QGroupBox*                       GroupArguments;
109   QGroupBox*                       GroupDimensions;
110   QLabel*                          TextLabelElements;
111   QPushButton*                     SelectElementsButton;
112   QLineEdit*                       LineEditElements;
113   QCheckBox*                       CheckBoxMesh;
114   QLabel*                          TextLabelVector;
115   QLabel*                          TextLabelDistance;
116   QPushButton*                     SelectVectorButton;
117   QLabel*                          TextLabelDx;
118   SMESHGUI_SpinBox*                SpinBox_Dx;
119   QLabel*                          TextLabelDy;
120   SMESHGUI_SpinBox*                SpinBox_Dy;
121   QLabel*                          TextLabelDz;
122   SMESHGUI_SpinBox*                SpinBox_Dz;
123   QLabel*                          TextLabelVx;
124   SMESHGUI_SpinBox*                SpinBox_Vx;
125   QLabel*                          TextLabelVy;
126   SMESHGUI_SpinBox*                SpinBox_Vy;
127   QLabel*                          TextLabelVz;
128   SMESHGUI_SpinBox*                SpinBox_Vz;
129   QLabel*                          TextLabelDist;
130   SMESHGUI_SpinBox*                SpinBox_VDist;
131   QLabel*                          TextLabelNbSteps;
132   SalomeApp_IntSpinBox*            SpinBox_NbSteps;
133   QCheckBox*                       MakeGroupsCheck;
134
135   QGroupBox*                       GroupButtons;
136   QPushButton*                     buttonOk;
137   QPushButton*                     buttonCancel;
138   QPushButton*                     buttonApply;
139   QPushButton*                     buttonHelp;
140
141   QString                          myHelpFileName;
142   QString                          myIDs;
143
144   QPushButton*                     myFilterBtn;
145   SMESHGUI_FilterDlg*              myFilterDlg;
146    
147 private slots:
148   void                            ConstructorsClicked( int );
149   void                            CheckIsEnable();
150   void                            ClickOnOk();
151   bool                            ClickOnApply();
152   void                            ClickOnCancel();
153   void                            ClickOnHelp();
154   void                            ClickOnRadio();
155   void                            SetEditCurrentArgument();
156   void                            SelectionIntoArgument();
157   void                            DeactivateActiveDialog();
158   void                            ActivateThisDialog();
159   void                            onTextChange( const QString& );
160   void                            onSelectMesh( bool );
161   void                            setFilters();
162 };
163
164 #endif // SMESHGUI_EXTRUSIONDLG_H