Salome HOME
Merge from V5_1_4_BR 07/05/2010
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_RevolutionDlg.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_RevolutionDlg.h
25 // Author : Michael ZORIN, Open CASCADE S.A.S.
26 //
27 #ifndef SMESHGUI_REVOLUTIONDLG_H
28 #define SMESHGUI_REVOLUTIONDLG_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 #include <QMap>
39
40 // IDL includes
41 #include <SALOMEconfig.h>
42 #include CORBA_SERVER_HEADER(SMESH_Mesh)
43
44 class QButtonGroup;
45 class QGroupBox;
46 class QLabel;
47 class QLineEdit;
48 class QPushButton;
49 class QRadioButton;
50 class QCheckBox;
51 class SalomeApp_IntSpinBox;
52 class SMESHGUI_IdValidator;
53 class SMESHGUI_SpinBox;
54 class SMESHGUI;
55 class SMESHGUI_FilterDlg;
56 class SMESH_Actor;
57 class SVTK_Selector;
58 class LightApp_SelectionMgr;
59 class SMESH_LogicalFilter;
60 class SALOME_Actor;
61 class SMESHGUI_MeshEditPreview;
62 class QMenu;
63 class QAction;
64
65 //=================================================================================
66 // class    : SMESHGUI_RevolutionDlg
67 // purpose  :
68 //=================================================================================
69 class SMESHGUI_EXPORT SMESHGUI_RevolutionDlg : public QDialog
70
71   Q_OBJECT
72
73 public:
74   SMESHGUI_RevolutionDlg( SMESHGUI* );
75   ~SMESHGUI_RevolutionDlg();
76
77   void                      reject();
78
79 private:
80   enum {NONE_SELECT, POINT_SELECT, FACE_SELECT};
81   
82   void                      Init( bool = true);
83   void                      closeEvent( QCloseEvent* );
84   void                      enterEvent( QEvent* );           /* mouse enter the QWidget */
85   void                      keyPressEvent( QKeyEvent* );
86   int                       GetConstructorId();
87   bool                      IsAxisOk();
88   
89   bool                      isValid();
90   
91   SMESHGUI*                 mySMESHGUI;              /* Current SMESHGUI object */
92   SMESHGUI_IdValidator*     myIdValidator;
93   LightApp_SelectionMgr*    mySelectionMgr;          /* User shape selection */
94   int                       myNbOkElements;          /* to check when elements are defined */
95   QString                   myElementsId;
96   QWidget*                  myEditCurrentArgument;   /* Current  argument */
97   SVTK_Selector*            mySelector;
98   Handle(SALOME_InteractiveObject) myIO;
99   
100   SMESH::SMESH_IDSource_var mySelectedObject;
101
102   bool                      myBusy;
103   SMESH::SMESH_Mesh_var     myMesh;
104   SMESH_Actor*              myActor;
105   SMESH_LogicalFilter*      myMeshOrSubMeshOrGroupFilter;
106   SMESHGUI_MeshEditPreview* mySimulation;
107   SALOME_Actor*             myPreviewActor;
108
109   QGroupBox*                ConstructorsBox;
110   QButtonGroup*             GroupConstructors;
111   QRadioButton*             RadioButton1;
112   QRadioButton*             RadioButton2;
113   QGroupBox*                GroupButtons;
114   QPushButton*              buttonOk;
115   QPushButton*              buttonCancel;
116   QPushButton*              buttonApply;
117   QPushButton*              buttonHelp;
118   QGroupBox*                GroupArguments;
119   QGroupBox*                GroupAxis;
120   QLabel*                   TextLabelElements;
121   QPushButton*              SelectElementsButton;
122   QLineEdit*                LineEditElements;
123   QCheckBox*                CheckBoxMesh;
124   QCheckBox*                MakeGroupsCheck;
125   QGroupBox*                GroupAngleBox;
126   QButtonGroup*             GroupAngle;
127   QRadioButton*             RadioButton3;
128   QRadioButton*             RadioButton4;
129   QCheckBox*                CheckBoxPreview;
130   
131   QLabel*                   TextLabelPoint;
132   QPushButton*              SelectPointButton;
133   QLabel*                   TextLabelX;
134   SMESHGUI_SpinBox*         SpinBox_X;
135   QLabel*                   TextLabelY;
136   SMESHGUI_SpinBox*         SpinBox_Y;
137   QLabel*                   TextLabelZ;
138   SMESHGUI_SpinBox*         SpinBox_Z;
139   QLabel*                   TextLabelVector;
140   QPushButton*              SelectVectorButton;
141   QLabel*                   TextLabelDX;
142   SMESHGUI_SpinBox*         SpinBox_DX;
143   QLabel*                   TextLabelDY;
144   SMESHGUI_SpinBox*         SpinBox_DY;
145   QLabel*                   TextLabelDZ;
146   SMESHGUI_SpinBox*         SpinBox_DZ;
147   
148   QLabel*                   TextLabelAngle;
149   SMESHGUI_SpinBox*         SpinBox_Angle;
150   QLabel*                   TextLabelNbSteps;
151   SalomeApp_IntSpinBox*     SpinBox_NbSteps;
152   QLabel*                   TextLabelTolerance;
153   SMESHGUI_SpinBox*         SpinBox_Tolerance;
154
155   QMenu*                    SelectVectorMenu;
156   QMap<QAction*,int>        myMenuActions;
157   int                       myVectorDefinition;
158
159   
160   QString                   myHelpFileName;
161   QString                   myIDs;
162   
163   QPushButton*              myFilterBtn;
164   SMESHGUI_FilterDlg*       myFilterDlg;
165    
166 private slots:
167   void                      ConstructorsClicked( int );
168   void                      ClickOnOk();
169   void                      ClickOnCancel();
170   bool                      ClickOnApply();
171   void                      ClickOnHelp();
172   void                      SetEditCurrentArgument();
173   void                      SelectionIntoArgument();
174   void                      DeactivateActiveDialog();
175   void                      ActivateThisDialog();
176   void                      onTextChange( const QString& );
177   void                      onAngleTextChange( const QString& );
178   void                      onSelectMesh( bool );
179   void                      onVectorChanged();
180   void                      toDisplaySimulation();
181   void                      onDisplaySimulation( bool );
182   void                      onSelectVectorMenu( QAction* );
183   void                      onSelectVectorButton();
184   void                      setFilters();
185 };
186
187 #endif // SMESHGUI_REVOLUTIONDLG_H