Salome HOME
Merge from V6_5_BR 05/06/2012
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_RevolutionDlg.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_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 #include "SMESHGUI_PreviewDlg.h"
33
34 // SALOME GUI includes
35 #include <SALOME_InteractiveObject.hxx>
36
37 // Qt includes
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 SMESHGUI_PreviewDlg
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_IdValidator*     myIdValidator;
92   LightApp_SelectionMgr*    mySelectionMgr;          /* User shape selection */
93   int                       myNbOkElements;          /* to check when elements are defined */
94   QString                   myElementsId;
95   QWidget*                  myEditCurrentArgument;   /* Current  argument */
96   SVTK_Selector*            mySelector;
97   Handle(SALOME_InteractiveObject) myIO;
98   
99   SMESH::SMESH_IDSource_var mySelectedObject;
100
101   bool                      myBusy;
102   SMESH::SMESH_Mesh_var     myMesh;
103   SMESH_Actor*              myActor;
104   SMESH_LogicalFilter*      myMeshOrSubMeshOrGroupFilter;
105   SMESHGUI_MeshEditPreview* mySimulation;
106   SALOME_Actor*             myPreviewActor;
107
108   QGroupBox*                ConstructorsBox;
109   QButtonGroup*             GroupConstructors;
110   QRadioButton*             RadioButton1;
111   QRadioButton*             RadioButton2;
112   QGroupBox*                GroupButtons;
113   QPushButton*              buttonOk;
114   QPushButton*              buttonCancel;
115   QPushButton*              buttonApply;
116   QPushButton*              buttonHelp;
117   QGroupBox*                GroupArguments;
118   QGroupBox*                GroupAxis;
119   QLabel*                   TextLabelElements;
120   QPushButton*              SelectElementsButton;
121   QLineEdit*                LineEditElements;
122   QCheckBox*                CheckBoxMesh;
123   QCheckBox*                MakeGroupsCheck;
124   QGroupBox*                GroupAngleBox;
125   QButtonGroup*             GroupAngle;
126   QRadioButton*             RadioButton3;
127   QRadioButton*             RadioButton4;
128   
129   QLabel*                   TextLabelPoint;
130   QPushButton*              SelectPointButton;
131   QLabel*                   TextLabelX;
132   SMESHGUI_SpinBox*         SpinBox_X;
133   QLabel*                   TextLabelY;
134   SMESHGUI_SpinBox*         SpinBox_Y;
135   QLabel*                   TextLabelZ;
136   SMESHGUI_SpinBox*         SpinBox_Z;
137   QLabel*                   TextLabelVector;
138   QPushButton*              SelectVectorButton;
139   QLabel*                   TextLabelDX;
140   SMESHGUI_SpinBox*         SpinBox_DX;
141   QLabel*                   TextLabelDY;
142   SMESHGUI_SpinBox*         SpinBox_DY;
143   QLabel*                   TextLabelDZ;
144   SMESHGUI_SpinBox*         SpinBox_DZ;
145   
146   QLabel*                   TextLabelAngle;
147   SMESHGUI_SpinBox*         SpinBox_Angle;
148   QLabel*                   TextLabelNbSteps;
149   SalomeApp_IntSpinBox*     SpinBox_NbSteps;
150   QLabel*                   TextLabelTolerance;
151   SMESHGUI_SpinBox*         SpinBox_Tolerance;
152
153   QMenu*                    SelectVectorMenu;
154   QMap<QAction*,int>        myMenuActions;
155   int                       myVectorDefinition;
156
157   
158   QString                   myHelpFileName;
159   QString                   myIDs;
160   
161   QPushButton*              myFilterBtn;
162   SMESHGUI_FilterDlg*       myFilterDlg;
163
164 protected slots:
165   virtual void              onDisplaySimulation( bool );
166    
167 private slots:
168   void                      ConstructorsClicked( int );
169   void                      ClickOnOk();
170   void                      ClickOnCancel();
171   bool                      ClickOnApply();
172   void                      ClickOnHelp();
173   void                      SetEditCurrentArgument();
174   void                      SelectionIntoArgument();
175   void                      DeactivateActiveDialog();
176   void                      ActivateThisDialog();
177   void                      onTextChange( const QString& );
178   void                      onAngleTextChange( const QString& );
179   void                      onSelectMesh( bool );
180   void                      onVectorChanged();
181   void                      onSelectVectorMenu( QAction* );
182   void                      onSelectVectorButton();
183   void                      setFilters();
184 };
185
186 #endif // SMESHGUI_REVOLUTIONDLG_H