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