Salome HOME
Edit Mesh/Sub-Mesh window has strange "half-active" view, if do Compute.
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_RevolutionDlg.h
1 //  SMESH SMESHGUI : GUI for SMESH component
2 //
3 //  Copyright (C) 2003  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 //
24 //  File   : SMESHGUI_RevolutionDlg.h
25 //  Author : Michael ZORIN
26 //  Module : SMESH
27 //  $Header: 
28
29 #ifndef DIALOGBOX_REVOLUTION_H
30 #define DIALOGBOX_REVOLUTION_H
31
32 #include "SMESH_SMESHGUI.hxx"
33
34 #include "LightApp_SelectionMgr.h"
35
36 #include "SMESH_LogicalFilter.hxx"
37
38 // QT Includes
39 #include <qdialog.h>
40
41 class QGridLayout; 
42 class QButtonGroup;
43 class QGroupBox;
44 class QLabel;
45 class QLineEdit;
46 class QPushButton;
47 class QRadioButton;
48 class QCheckBox;
49 class QSpinBox;
50 class SMESHGUI_SpinBox;
51 class SMESHGUI;
52 class SMESH_Actor;
53 class SMESHGUI_SpinBox;
54 class SVTK_ViewWindow;
55 class SVTK_Selector;
56 class SALOME_Actor;
57 class SMESHGUI_MeshEditPreview;
58
59 // IDL Headers
60 #include <SALOMEconfig.h>
61 #include CORBA_SERVER_HEADER(SMESH_Mesh)
62
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                             const char* name = 0,
75                             bool modal = FALSE,
76                             WFlags fl = 0);
77     ~SMESHGUI_RevolutionDlg();
78
79 private:
80     void Init (bool ResetControls = true);
81     void closeEvent (QCloseEvent*);
82     void enterEvent (QEvent*);                          /* mouse enter the QWidget */
83     void hideEvent (QHideEvent*);                       /* ESC key */
84     void keyPressEvent(QKeyEvent*);
85     int  GetConstructorId();
86     bool IsAxisOk();
87
88     SMESHGUI*                     mySMESHGUI;              /* Current SMESHGUI object */
89     LightApp_SelectionMgr*        mySelectionMgr;          /* User shape selection */
90     int                           myNbOkElements;          /* to check when elements are defined */
91     QString                       myElementsId;
92     QWidget*                      myEditCurrentArgument;   /* Current  argument */
93     SVTK_Selector*                mySelector;
94
95     bool                          myBusy;
96     SMESH::SMESH_Mesh_var         myMesh;
97     SMESH_Actor*                  myActor;
98     SMESH_LogicalFilter*          myMeshOrSubMeshOrGroupFilter;
99     SMESHGUI_MeshEditPreview*     mySimulation;
100     SALOME_Actor*                 myPreviewActor;
101
102     QButtonGroup* GroupConstructors;
103     QRadioButton* RadioButton1;
104     QRadioButton* RadioButton2;
105     QGroupBox* GroupButtons;
106     QPushButton* buttonOk;
107     QPushButton* buttonCancel;
108     QPushButton* buttonApply;
109     QPushButton* buttonHelp;
110     QGroupBox* GroupArguments;
111     QGroupBox* GroupAxis;
112     QLabel* TextLabelElements;
113     QPushButton* SelectElementsButton;
114     QLineEdit* LineEditElements;
115     QCheckBox* CheckBoxMesh;
116     QCheckBox* MakeGroupsCheck;
117     QButtonGroup* GroupAngle;
118     QRadioButton* RadioButton3;
119     QRadioButton* RadioButton4;
120     QCheckBox* CheckBoxPreview;
121
122     QLabel* TextLabelPoint;
123     QPushButton* SelectPointButton;
124     QLabel* TextLabelX;
125     SMESHGUI_SpinBox* SpinBox_X;
126     QLabel* TextLabelY;
127     SMESHGUI_SpinBox* SpinBox_Y;
128     QLabel* TextLabelZ;
129     SMESHGUI_SpinBox* SpinBox_Z;
130     QLabel* TextLabelVector;
131     QPushButton* SelectVectorButton;
132     QLabel* TextLabelDX;
133     SMESHGUI_SpinBox* SpinBox_DX;
134     QLabel* TextLabelDY;
135     SMESHGUI_SpinBox* SpinBox_DY;
136     QLabel* TextLabelDZ;
137     SMESHGUI_SpinBox* SpinBox_DZ;
138
139     QLabel* TextLabelAngle;
140     SMESHGUI_SpinBox* SpinBox_Angle;
141     QLabel* TextLabelNbSteps;
142     QSpinBox* SpinBox_NbSteps;
143     QLabel* TextLabelTolerance;
144     SMESHGUI_SpinBox* SpinBox_Tolerance;
145
146     QString myHelpFileName;
147
148 private slots:
149
150     void ConstructorsClicked (int constructorId);
151     void ClickOnOk();
152     void ClickOnCancel();
153     void ClickOnApply();
154     void ClickOnHelp();
155     void SetEditCurrentArgument();
156     void SelectionIntoArgument();
157     void DeactivateActiveDialog();
158     void ActivateThisDialog();
159     void onTextChange (const QString&);
160     void onSelectMesh (bool toSelectMesh);
161     void onVectorChanged();
162     void toDisplaySimulation();
163     void onDisplaySimulation(bool toDisplayPreview);
164
165 protected:
166     QGridLayout* SMESHGUI_RevolutionDlgLayout;
167     QGridLayout* GroupConstructorsLayout;
168     QGridLayout* GroupButtonsLayout;
169     QGridLayout* GroupArgumentsLayout;
170 };
171
172 #endif // DIALOGBOX_REVOLUTION_H