Salome HOME
Merge from V6_main (04/10/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*            myMeshOrSubMeshOrGroupFilter0D;
98   SUIT_SelectionFilter*            myMeshOrSubMeshOrGroupFilter1D;
99   SUIT_SelectionFilter*            myMeshOrSubMeshOrGroupFilter2D;
100
101   // widgets
102   QGroupBox*                       ConstructorsBox;
103   QButtonGroup*                    GroupConstructors;
104   QRadioButton*                    RadioButton0;
105   QRadioButton*                    RadioButton1;
106   QRadioButton*                    RadioButton2;
107   QRadioButton*                    RadioButton3;
108   QRadioButton*                    RadioButton4;
109
110   QGroupBox*                       GroupArguments;
111   QGroupBox*                       GroupDimensions;
112   QLabel*                          TextLabelElements;
113   QPushButton*                     SelectElementsButton;
114   QLineEdit*                       LineEditElements;
115   QCheckBox*                       CheckBoxMesh;
116   QLabel*                          TextLabelVector;
117   QLabel*                          TextLabelDistance;
118   QPushButton*                     SelectVectorButton;
119   QLabel*                          TextLabelDx;
120   SMESHGUI_SpinBox*                SpinBox_Dx;
121   QLabel*                          TextLabelDy;
122   SMESHGUI_SpinBox*                SpinBox_Dy;
123   QLabel*                          TextLabelDz;
124   SMESHGUI_SpinBox*                SpinBox_Dz;
125   QLabel*                          TextLabelVx;
126   SMESHGUI_SpinBox*                SpinBox_Vx;
127   QLabel*                          TextLabelVy;
128   SMESHGUI_SpinBox*                SpinBox_Vy;
129   QLabel*                          TextLabelVz;
130   SMESHGUI_SpinBox*                SpinBox_Vz;
131   QLabel*                          TextLabelDist;
132   SMESHGUI_SpinBox*                SpinBox_VDist;
133   QLabel*                          TextLabelNbSteps;
134   SalomeApp_IntSpinBox*            SpinBox_NbSteps;
135   QCheckBox*                       MakeGroupsCheck;
136
137   QGroupBox*                       GroupButtons;
138   QPushButton*                     buttonOk;
139   QPushButton*                     buttonCancel;
140   QPushButton*                     buttonApply;
141   QPushButton*                     buttonHelp;
142
143   QString                          myHelpFileName;
144   QString                          myIDs;
145
146   QPushButton*                     myFilterBtn;
147   SMESHGUI_FilterDlg*              myFilterDlg;
148
149 protected slots:
150   virtual void              onDisplaySimulation( bool );
151    
152 private slots:
153   void                            ConstructorsClicked( int );
154   void                            CheckIsEnable();
155   void                            ClickOnOk();
156   bool                            ClickOnApply();
157   void                            ClickOnCancel();
158   void                            ClickOnHelp();
159   void                            ClickOnRadio();
160   void                            SetEditCurrentArgument();
161   void                            SelectionIntoArgument();
162   void                            DeactivateActiveDialog();
163   void                            ActivateThisDialog();
164   void                            onTextChange( const QString& );
165   void                            onSelectMesh( bool );
166   void                            setFilters();
167 };
168
169 #endif // SMESHGUI_EXTRUSIONDLG_H