Salome HOME
Update copyrights 2014.
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_RevolutionDlg.h
1 // Copyright (C) 2007-2014  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, or (at your option) any later version.
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 private:
78   enum {NONE_SELECT, POINT_SELECT, FACE_SELECT};
79   
80   void                      Init( bool = true);
81   void                      enterEvent( QEvent* );           /* mouse enter the QWidget */
82   void                      keyPressEvent( QKeyEvent* );
83   int                       GetConstructorId();
84   bool                      IsAxisOk();
85   
86   bool                      isValid();
87   
88   SMESHGUI_IdValidator*     myIdValidator;
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   Handle(SALOME_InteractiveObject) myIO;
95   
96   SMESH::SMESH_IDSource_var mySelectedObject;
97
98   bool                      myBusy;
99   SMESH::SMESH_Mesh_var     myMesh;
100   SMESH_Actor*              myActor;
101   SMESH_LogicalFilter*      myMeshOrSubMeshOrGroupFilter;
102   SMESHGUI_MeshEditPreview* mySimulation;
103   SALOME_Actor*             myPreviewActor;
104
105   QGroupBox*                ConstructorsBox;
106   QButtonGroup*             GroupConstructors;
107   QRadioButton*             RadioButton1;
108   QRadioButton*             RadioButton2;
109   QGroupBox*                GroupButtons;
110   QPushButton*              buttonOk;
111   QPushButton*              buttonCancel;
112   QPushButton*              buttonApply;
113   QPushButton*              buttonHelp;
114   QGroupBox*                GroupArguments;
115   QGroupBox*                GroupAxis;
116   QLabel*                   TextLabelElements;
117   QPushButton*              SelectElementsButton;
118   QLineEdit*                LineEditElements;
119   QCheckBox*                CheckBoxMesh;
120   QCheckBox*                MakeGroupsCheck;
121   QGroupBox*                GroupAngleBox;
122   QButtonGroup*             GroupAngle;
123   QRadioButton*             RadioButton3;
124   QRadioButton*             RadioButton4;
125   
126   QLabel*                   TextLabelPoint;
127   QPushButton*              SelectPointButton;
128   QLabel*                   TextLabelX;
129   SMESHGUI_SpinBox*         SpinBox_X;
130   QLabel*                   TextLabelY;
131   SMESHGUI_SpinBox*         SpinBox_Y;
132   QLabel*                   TextLabelZ;
133   SMESHGUI_SpinBox*         SpinBox_Z;
134   QLabel*                   TextLabelVector;
135   QPushButton*              SelectVectorButton;
136   QLabel*                   TextLabelDX;
137   SMESHGUI_SpinBox*         SpinBox_DX;
138   QLabel*                   TextLabelDY;
139   SMESHGUI_SpinBox*         SpinBox_DY;
140   QLabel*                   TextLabelDZ;
141   SMESHGUI_SpinBox*         SpinBox_DZ;
142   
143   QLabel*                   TextLabelAngle;
144   SMESHGUI_SpinBox*         SpinBox_Angle;
145   QLabel*                   TextLabelNbSteps;
146   SalomeApp_IntSpinBox*     SpinBox_NbSteps;
147   QLabel*                   TextLabelTolerance;
148   SMESHGUI_SpinBox*         SpinBox_Tolerance;
149
150   QMenu*                    SelectVectorMenu;
151   QMap<QAction*,int>        myMenuActions;
152   int                       myVectorDefinition;
153
154   
155   QString                   myHelpFileName;
156   QString                   myIDs;
157   
158   QPushButton*              myFilterBtn;
159   SMESHGUI_FilterDlg*       myFilterDlg;
160
161 protected slots:
162   virtual void              onDisplaySimulation( bool );
163   virtual void                      reject();
164    
165 private slots:
166   void                      ConstructorsClicked( int );
167   void                      ClickOnOk();
168   bool                      ClickOnApply();
169   void                      ClickOnHelp();
170   void                      SetEditCurrentArgument();
171   void                      SelectionIntoArgument();
172   void                      DeactivateActiveDialog();
173   void                      ActivateThisDialog();
174   void                      onTextChange( const QString& );
175   void                      onAngleTextChange( const QString& );
176   void                      onSelectMesh( bool );
177   void                      onVectorChanged();
178   void                      onSelectVectorMenu( QAction* );
179   void                      onSelectVectorButton();
180   void                      setFilters();
181 };
182
183 #endif // SMESHGUI_REVOLUTIONDLG_H