Salome HOME
7b1e34961a51c75faa4e6a43df18d2a1f9c15c1b
[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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
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   int  GetConstructorId();
89   void SetEditCurrentArgument (QToolButton* button);
90
91   SMESHGUI*                     mySMESHGUI;            /* Current SMESHGUI object */
92   LightApp_SelectionMgr*        mySelectionMgr;        /* User shape selection */
93   SVTK_Selector*                mySelector;
94
95   QWidget*                      myEditCurrentArgument; /* Current  argument */
96
97   bool                          myBusy;
98   SMESH::SMESH_Mesh_var         myMesh;
99   SMESH_Actor*                  myMeshActor;
100   SMESH::SMESH_IDSource_var     myIDSource;
101   SMESH::SMESH_Mesh_var         myPathMesh;
102   GEOM::GEOM_Object_var         myPathShape;
103   SUIT_SelectionFilter*         myElementsFilter;
104   SUIT_SelectionFilter*         myPathMeshFilter;
105   int                           myType;
106
107   // widgets
108   QButtonGroup*     GroupConstructors;
109   QRadioButton*     Elements1dRB;
110   QRadioButton*     Elements2dRB;
111
112   QGroupBox*        GroupArguments;
113   QLabel*           ElementsLab;
114   QToolButton*      SelectElementsButton;
115   QLineEdit*        ElementsLineEdit;
116   QCheckBox*        MeshCheck;
117   QGroupBox*        PathGrp;
118   QLabel*           PathMeshLab;
119   QToolButton*      SelectPathMeshButton;
120   QLineEdit*        PathMeshLineEdit;
121   QLabel*           PathShapeLab;
122   QToolButton*      SelectPathShapeButton;
123   QLineEdit*        PathShapeLineEdit;
124   QLabel*           StartPointLab;
125   QToolButton*      SelectStartPointButton;
126   QLineEdit*        StartPointLineEdit;
127   QCheckBox*        AnglesCheck;
128   QGroupBox*        AnglesGrp;
129   QListBox*         AnglesList;
130   QToolButton*      AddAngleButton;
131   QToolButton*      RemoveAngleButton;
132   SMESHGUI_SpinBox* AngleSpin;
133   QCheckBox*        BasePointCheck;
134   QGroupBox*        BasePointGrp;
135   QToolButton*      SelectBasePointButton;
136   QLabel*           XLab;
137   SMESHGUI_SpinBox* XSpin;
138   QLabel*           YLab;
139   SMESHGUI_SpinBox* YSpin;
140   QLabel*           ZLab;
141   SMESHGUI_SpinBox* ZSpin;
142
143   QGroupBox*        GroupButtons;
144   QPushButton*      OkButton;
145   QPushButton*      ApplyButton;
146   QPushButton*      CloseButton;
147
148 protected slots:
149   void reject();
150
151 private slots:
152   void ConstructorsClicked (int);
153   void ClickOnOk();
154   bool ClickOnApply();
155   void SetEditCurrentArgument();
156   void SelectionIntoArgument();
157   void DeactivateActiveDialog();
158   void ActivateThisDialog();
159   void onTextChange (const QString&);
160   void onSelectMesh();
161   void onAnglesCheck();
162   void onBasePointCheck();
163   void OnAngleAdded();
164   void OnAngleRemoved();
165 };
166
167 #endif // DIALOGBOX_EXTRUSION_PATH_H