Salome HOME
Issue 0019938 - fix problem with wrong filter selection (ptv)
[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 SalomeApp_IntSpinBox;
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   bool                      isValid();
85   
86   SMESHGUI*                 mySMESHGUI;              /* Current SMESHGUI object */
87   SMESHGUI_IdValidator*     myIdValidator;
88   LightApp_SelectionMgr*    mySelectionMgr;          /* User shape selection */
89   int                       myNbOkElements;          /* to check when elements are defined */
90   QString                   myElementsId;
91   QWidget*                  myEditCurrentArgument;   /* Current  argument */
92   SVTK_Selector*            mySelector;
93   
94   SMESH::SMESH_IDSource_var mySelectedObject;
95
96   bool                      myBusy;
97   SMESH::SMESH_Mesh_var     myMesh;
98   SMESH_Actor*              myActor;
99   SMESH_LogicalFilter*      myMeshOrSubMeshOrGroupFilter;
100   SMESHGUI_MeshEditPreview* mySimulation;
101   SALOME_Actor*             myPreviewActor;
102
103   QGroupBox*                ConstructorsBox;
104   QButtonGroup*             GroupConstructors;
105   QRadioButton*             RadioButton1;
106   QRadioButton*             RadioButton2;
107   QGroupBox*                GroupButtons;
108   QPushButton*              buttonOk;
109   QPushButton*              buttonCancel;
110   QPushButton*              buttonApply;
111   QPushButton*              buttonHelp;
112   QGroupBox*                GroupArguments;
113   QGroupBox*                GroupAxis;
114   QLabel*                   TextLabelElements;
115   QPushButton*              SelectElementsButton;
116   QLineEdit*                LineEditElements;
117   QCheckBox*                CheckBoxMesh;
118   QCheckBox*                MakeGroupsCheck;
119   QGroupBox*                GroupAngleBox;
120   QButtonGroup*             GroupAngle;
121   QRadioButton*             RadioButton3;
122   QRadioButton*             RadioButton4;
123   QCheckBox*                CheckBoxPreview;
124   
125   QLabel*                   TextLabelPoint;
126   QPushButton*              SelectPointButton;
127   QLabel*                   TextLabelX;
128   SMESHGUI_SpinBox*         SpinBox_X;
129   QLabel*                   TextLabelY;
130   SMESHGUI_SpinBox*         SpinBox_Y;
131   QLabel*                   TextLabelZ;
132   SMESHGUI_SpinBox*         SpinBox_Z;
133   QLabel*                   TextLabelVector;
134   QPushButton*              SelectVectorButton;
135   QLabel*                   TextLabelDX;
136   SMESHGUI_SpinBox*         SpinBox_DX;
137   QLabel*                   TextLabelDY;
138   SMESHGUI_SpinBox*         SpinBox_DY;
139   QLabel*                   TextLabelDZ;
140   SMESHGUI_SpinBox*         SpinBox_DZ;
141   
142   QLabel*                   TextLabelAngle;
143   SMESHGUI_SpinBox*         SpinBox_Angle;
144   QLabel*                   TextLabelNbSteps;
145   SalomeApp_IntSpinBox*     SpinBox_NbSteps;
146   QLabel*                   TextLabelTolerance;
147   SMESHGUI_SpinBox*         SpinBox_Tolerance;
148
149   QMenu*                    SelectVectorMenu;
150   QMap<QAction*,int>        myMenuActions;
151   int                       myVectorDefinition;
152
153   
154   QString                   myHelpFileName;
155   
156   QPushButton*              myFilterBtn;
157   SMESHGUI_FilterDlg*       myFilterDlg;
158    
159 private slots:
160   void                      ConstructorsClicked( int );
161   void                      ClickOnOk();
162   void                      ClickOnCancel();
163   bool                      ClickOnApply();
164   void                      ClickOnHelp();
165   void                      SetEditCurrentArgument();
166   void                      SelectionIntoArgument();
167   void                      DeactivateActiveDialog();
168   void                      ActivateThisDialog();
169   void                      onTextChange( const QString& );
170   void                      onAngleTextChange( const QString& );
171   void                      onSelectMesh( bool );
172   void                      onVectorChanged();
173   void                      toDisplaySimulation();
174   void                      onDisplaySimulation( bool );
175   void                      onSelectVectorMenu( QAction* );
176   void                      onSelectVectorButton();
177   void                      setFilters();
178 };
179
180 #endif // SMESHGUI_REVOLUTIONDLG_H