Salome HOME
correct previous integration (Porting to Python 2.6)
[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 // SALOME GUI includes
33 #include <SALOME_InteractiveObject.hxx>
34
35 // Qt includes
36 #include <QDialog>
37 #include <QMap>
38
39 // IDL includes
40 #include <SALOMEconfig.h>
41 #include CORBA_SERVER_HEADER(SMESH_Mesh)
42
43 class QButtonGroup;
44 class QGroupBox;
45 class QLabel;
46 class QLineEdit;
47 class QPushButton;
48 class QRadioButton;
49 class QCheckBox;
50 class SalomeApp_IntSpinBox;
51 class SMESHGUI_IdValidator;
52 class SMESHGUI_SpinBox;
53 class SMESHGUI;
54 class SMESHGUI_FilterDlg;
55 class SMESH_Actor;
56 class SVTK_Selector;
57 class LightApp_SelectionMgr;
58 class SMESH_LogicalFilter;
59 class SALOME_Actor;
60 class SMESHGUI_MeshEditPreview;
61 class QMenu;
62 class QAction;
63
64 //=================================================================================
65 // class    : SMESHGUI_RevolutionDlg
66 // purpose  :
67 //=================================================================================
68 class SMESHGUI_EXPORT SMESHGUI_RevolutionDlg : public QDialog
69
70   Q_OBJECT
71
72 public:
73   SMESHGUI_RevolutionDlg( SMESHGUI* );
74   ~SMESHGUI_RevolutionDlg();
75
76   void                      reject();
77
78 private:
79   enum {NONE_SELECT, POINT_SELECT, FACE_SELECT};
80   
81   void                      Init( bool = true);
82   void                      closeEvent( QCloseEvent* );
83   void                      enterEvent( QEvent* );           /* mouse enter the QWidget */
84   void                      keyPressEvent( QKeyEvent* );
85   int                       GetConstructorId();
86   bool                      IsAxisOk();
87   
88   bool                      isValid();
89   
90   SMESHGUI*                 mySMESHGUI;              /* Current SMESHGUI object */
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   QCheckBox*                CheckBoxPreview;
129   
130   QLabel*                   TextLabelPoint;
131   QPushButton*              SelectPointButton;
132   QLabel*                   TextLabelX;
133   SMESHGUI_SpinBox*         SpinBox_X;
134   QLabel*                   TextLabelY;
135   SMESHGUI_SpinBox*         SpinBox_Y;
136   QLabel*                   TextLabelZ;
137   SMESHGUI_SpinBox*         SpinBox_Z;
138   QLabel*                   TextLabelVector;
139   QPushButton*              SelectVectorButton;
140   QLabel*                   TextLabelDX;
141   SMESHGUI_SpinBox*         SpinBox_DX;
142   QLabel*                   TextLabelDY;
143   SMESHGUI_SpinBox*         SpinBox_DY;
144   QLabel*                   TextLabelDZ;
145   SMESHGUI_SpinBox*         SpinBox_DZ;
146   
147   QLabel*                   TextLabelAngle;
148   SMESHGUI_SpinBox*         SpinBox_Angle;
149   QLabel*                   TextLabelNbSteps;
150   SalomeApp_IntSpinBox*     SpinBox_NbSteps;
151   QLabel*                   TextLabelTolerance;
152   SMESHGUI_SpinBox*         SpinBox_Tolerance;
153
154   QMenu*                    SelectVectorMenu;
155   QMap<QAction*,int>        myMenuActions;
156   int                       myVectorDefinition;
157
158   
159   QString                   myHelpFileName;
160   QString                   myIDs;
161   
162   QPushButton*              myFilterBtn;
163   SMESHGUI_FilterDlg*       myFilterDlg;
164    
165 private slots:
166   void                      ConstructorsClicked( int );
167   void                      ClickOnOk();
168   void                      ClickOnCancel();
169   bool                      ClickOnApply();
170   void                      ClickOnHelp();
171   void                      SetEditCurrentArgument();
172   void                      SelectionIntoArgument();
173   void                      DeactivateActiveDialog();
174   void                      ActivateThisDialog();
175   void                      onTextChange( const QString& );
176   void                      onAngleTextChange( const QString& );
177   void                      onSelectMesh( bool );
178   void                      onVectorChanged();
179   void                      toDisplaySimulation();
180   void                      onDisplaySimulation( bool );
181   void                      onSelectVectorMenu( QAction* );
182   void                      onSelectVectorButton();
183   void                      setFilters();
184 };
185
186 #endif // SMESHGUI_REVOLUTIONDLG_H