Salome HOME
Merge from V6_5_BR 05/06/2012
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ExtrusionDlg.h
1 // Copyright (C) 2007-2012  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 #include "SMESHGUI_PreviewDlg.h"
33
34 // SALOME GUI includes
35 #include <SALOME_InteractiveObject.hxx>
36
37 // IDL includes
38 #include <SALOMEconfig.h>
39 #include CORBA_SERVER_HEADER(SMESH_Mesh)
40
41 class QButtonGroup;
42 class QRadioButton;
43 class QGroupBox;
44 class QLabel;
45 class QLineEdit;
46 class QCheckBox;
47 class QPushButton;
48
49 class SMESHGUI;
50 class SMESH_Actor;
51 class SMESHGUI_IdValidator;
52 class SMESHGUI_SpinBox;
53 class SMESHGUI_FilterDlg;
54 class SVTK_Selector;
55 class LightApp_SelectionMgr;
56 class SUIT_SelectionFilter;
57 class SalomeApp_IntSpinBox;
58
59 //=================================================================================
60 // class    : SMESHGUI_ExtrusionDlg
61 // purpose  :
62 //=================================================================================
63 class SMESHGUI_EXPORT SMESHGUI_ExtrusionDlg : public SMESHGUI_PreviewDlg
64 {
65   Q_OBJECT
66
67 public:
68   SMESHGUI_ExtrusionDlg( SMESHGUI* );
69   ~SMESHGUI_ExtrusionDlg();
70
71   void                             reject();
72
73 private:
74   void                             Init( bool = true );
75   void                             enterEvent( QEvent* );       /* mouse enter the QWidget */
76   void                             closeEvent( QCloseEvent* );
77   void                             keyPressEvent( QKeyEvent* );
78   int                              GetConstructorId();
79   void                             getExtrusionVector(SMESH::DirStruct& aVector);
80   
81   bool                             isValid();
82   bool                             isValuesValid();
83   
84   SMESHGUI_IdValidator*            myIdValidator;
85   LightApp_SelectionMgr*           mySelectionMgr;        /* User shape selection */
86   QWidget*                         myEditCurrentArgument; /* Current  argument editor */
87   int                              myNbOkElements;        /* to check when elements are defined */
88   SVTK_Selector*                   mySelector;
89
90   SMESH::SMESH_IDSource_var        mySelectedObject;
91
92   bool                             myBusy;
93   SMESH::SMESH_Mesh_var            myMesh;
94   SMESH::long_array_var            myElementsId;
95   SMESH_Actor*                     myActor;
96   Handle(SALOME_InteractiveObject) myIO;
97   SUIT_SelectionFilter*            myMeshOrSubMeshOrGroupFilter;
98
99   // widgets
100   QGroupBox*                       ConstructorsBox;
101   QButtonGroup*                    GroupConstructors;
102   QRadioButton*                    RadioButton0;
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 protected slots:
148   virtual void              onDisplaySimulation( bool );
149    
150 private slots:
151   void                            ConstructorsClicked( int );
152   void                            CheckIsEnable();
153   void                            ClickOnOk();
154   bool                            ClickOnApply();
155   void                            ClickOnCancel();
156   void                            ClickOnHelp();
157   void                            ClickOnRadio();
158   void                            SetEditCurrentArgument();
159   void                            SelectionIntoArgument();
160   void                            DeactivateActiveDialog();
161   void                            ActivateThisDialog();
162   void                            onTextChange( const QString& );
163   void                            onSelectMesh( bool );
164   void                            setFilters();
165 };
166
167 #endif // SMESHGUI_EXTRUSIONDLG_H