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