Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ExtrusionAlongPathDlg.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_ExtrusionAlongPathDlg.h
25 //  Author : Vadim SANDLER
26 //  Module : SMESH
27 //  $Header: 
28
29 #ifndef DIALOGBOX_EXTRUSION_PATH_H
30 #define DIALOGBOX_EXTRUSION_PATH_H
31
32 #include "SMESH_SMESHGUI.hxx"
33
34 #include "LightApp_SelectionMgr.h"
35 #include "SUIT_SelectionFilter.h"
36
37 // QT Includes
38 #include <qdialog.h>
39
40 class QButtonGroup;
41 class QRadioButton;
42 class QGroupBox;
43 class QLabel;
44 class QToolButton;
45 class QLineEdit;
46 class QCheckBox;
47 class QListBox;
48 class QPushButton;
49
50 class SMESHGUI;
51 class SMESH_Actor;
52 class SMESHGUI_SpinBox;
53 class SVTK_ViewWindow;
54 class SVTK_Selector;
55
56
57 // IDL Headers
58 #include <SALOMEconfig.h>
59 #include CORBA_SERVER_HEADER(SMESH_Mesh)
60
61 //=================================================================================
62 // class    : SMESHGUI_ExtrusionAlongPathDlg
63 // purpose  :
64 //=================================================================================
65 class SMESHGUI_EXPORT SMESHGUI_ExtrusionAlongPathDlg : public QDialog
66 {
67   Q_OBJECT
68
69   class SetBusy {
70     public:
71       SetBusy (SMESHGUI_ExtrusionAlongPathDlg* _dlg) { myDlg = _dlg; myDlg->myBusy = true; }
72       ~SetBusy() { myDlg->myBusy = false; }
73     private:
74       SMESHGUI_ExtrusionAlongPathDlg* myDlg;
75   };
76   friend class SetBusy;
77
78 public:
79   SMESHGUI_ExtrusionAlongPathDlg (SMESHGUI*,
80                                   bool modal = FALSE);
81   ~SMESHGUI_ExtrusionAlongPathDlg();
82
83   bool eventFilter (QObject* object, QEvent* event);
84
85 private:
86   void Init (bool ResetControls = true);
87   void enterEvent (QEvent*);                           /* mouse enter the QWidget */
88   void keyPressEvent(QKeyEvent*);
89   int  GetConstructorId();
90   void SetEditCurrentArgument (QToolButton* button);
91
92   SMESHGUI*                     mySMESHGUI;            /* Current SMESHGUI object */
93   LightApp_SelectionMgr*        mySelectionMgr;        /* User shape selection */
94   SVTK_Selector*                mySelector;
95
96   QWidget*                      myEditCurrentArgument; /* Current  argument */
97
98   bool                          myBusy;
99   SMESH::SMESH_Mesh_var         myMesh;
100   SMESH_Actor*                  myMeshActor;
101   SMESH::SMESH_IDSource_var     myIDSource;
102   SMESH::SMESH_Mesh_var         myPathMesh;
103   GEOM::GEOM_Object_var         myPathShape;
104   SUIT_SelectionFilter*         myElementsFilter;
105   SUIT_SelectionFilter*         myPathMeshFilter;
106   int                           myType;
107
108   // widgets
109   QButtonGroup*     GroupConstructors;
110   QRadioButton*     Elements1dRB;
111   QRadioButton*     Elements2dRB;
112
113   QGroupBox*        GroupArguments;
114   QLabel*           ElementsLab;
115   QToolButton*      SelectElementsButton;
116   QLineEdit*        ElementsLineEdit;
117   QCheckBox*        MeshCheck;
118   QGroupBox*        PathGrp;
119   QLabel*           PathMeshLab;
120   QToolButton*      SelectPathMeshButton;
121   QLineEdit*        PathMeshLineEdit;
122   QLabel*           PathShapeLab;
123   QToolButton*      SelectPathShapeButton;
124   QLineEdit*        PathShapeLineEdit;
125   QLabel*           StartPointLab;
126   QToolButton*      SelectStartPointButton;
127   QLineEdit*        StartPointLineEdit;
128   QCheckBox*        LinearAnglesCheck;
129   QCheckBox*        AnglesCheck;
130   QGroupBox*        AnglesGrp;
131   QListBox*         AnglesList;
132   QToolButton*      AddAngleButton;
133   QToolButton*      RemoveAngleButton;
134   SMESHGUI_SpinBox* AngleSpin;
135   QCheckBox*        BasePointCheck;
136   QGroupBox*        BasePointGrp;
137   QToolButton*      SelectBasePointButton;
138   QLabel*           XLab;
139   SMESHGUI_SpinBox* XSpin;
140   QLabel*           YLab;
141   SMESHGUI_SpinBox* YSpin;
142   QLabel*           ZLab;
143   SMESHGUI_SpinBox* ZSpin;
144   QCheckBox*        MakeGroupsCheck;
145
146   QGroupBox*        GroupButtons;
147   QPushButton*      OkButton;
148   QPushButton*      ApplyButton;
149   QPushButton*      CloseButton;
150   QPushButton*      HelpButton;
151
152   QString           myHelpFileName;
153
154 protected slots:
155   void reject();
156
157 private slots:
158   void ConstructorsClicked (int);
159   void ClickOnOk();
160   bool ClickOnApply();
161   void ClickOnHelp();
162   void SetEditCurrentArgument();
163   void SelectionIntoArgument();
164   void DeactivateActiveDialog();
165   void ActivateThisDialog();
166   void onTextChange (const QString&);
167   void onSelectMesh();
168   void onAnglesCheck();
169   void onBasePointCheck();
170   void OnAngleAdded();
171   void OnAngleRemoved();
172 };
173
174 #endif // DIALOGBOX_EXTRUSION_PATH_H