Salome HOME
IPAL21120 SIGSEGV on Meshing attached Compound with Automatic Hexadralization
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ExtrusionAlongPathDlg.h
1 //  Copyright (C) 2007-2008  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.
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 //  SMESH SMESHGUI : GUI for SMESH component
23 //  File   : SMESHGUI_ExtrusionAlongPathDlg.h
24 //  Author : Vadim SANDLER
25 //  Module : SMESH
26 //  $Header: 
27 //
28 #ifndef DIALOGBOX_EXTRUSION_PATH_H
29 #define DIALOGBOX_EXTRUSION_PATH_H
30
31 #include "SMESH_SMESHGUI.hxx"
32
33 #include "LightApp_SelectionMgr.h"
34 #include "SUIT_SelectionFilter.h"
35
36 // QT Includes
37 #include <qdialog.h>
38
39 class QButtonGroup;
40 class QRadioButton;
41 class QGroupBox;
42 class QLabel;
43 class QToolButton;
44 class QLineEdit;
45 class QCheckBox;
46 class QListBox;
47 class QPushButton;
48
49 class SMESHGUI;
50 class SMESH_Actor;
51 class SMESHGUI_SpinBox;
52 class SVTK_ViewWindow;
53 class SVTK_Selector;
54
55
56 // IDL Headers
57 #include <SALOMEconfig.h>
58 #include CORBA_SERVER_HEADER(SMESH_Mesh)
59
60 //=================================================================================
61 // class    : SMESHGUI_ExtrusionAlongPathDlg
62 // purpose  :
63 //=================================================================================
64 class SMESHGUI_EXPORT SMESHGUI_ExtrusionAlongPathDlg : public QDialog
65 {
66   Q_OBJECT
67
68   class SetBusy {
69     public:
70       SetBusy (SMESHGUI_ExtrusionAlongPathDlg* _dlg) { myDlg = _dlg; myDlg->myBusy = true; }
71       ~SetBusy() { myDlg->myBusy = false; }
72     private:
73       SMESHGUI_ExtrusionAlongPathDlg* myDlg;
74   };
75   friend class SetBusy;
76
77 public:
78   SMESHGUI_ExtrusionAlongPathDlg (SMESHGUI*,
79                                   bool modal = FALSE);
80   ~SMESHGUI_ExtrusionAlongPathDlg();
81
82   bool eventFilter (QObject* object, QEvent* event);
83
84 private:
85   void Init (bool ResetControls = true);
86   void enterEvent (QEvent*);                           /* mouse enter the QWidget */
87   void keyPressEvent(QKeyEvent*);
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*        LinearAnglesCheck;
128   QCheckBox*        AnglesCheck;
129   QGroupBox*        AnglesGrp;
130   QListBox*         AnglesList;
131   QToolButton*      AddAngleButton;
132   QToolButton*      RemoveAngleButton;
133   SMESHGUI_SpinBox* AngleSpin;
134   QCheckBox*        BasePointCheck;
135   QGroupBox*        BasePointGrp;
136   QToolButton*      SelectBasePointButton;
137   QLabel*           XLab;
138   SMESHGUI_SpinBox* XSpin;
139   QLabel*           YLab;
140   SMESHGUI_SpinBox* YSpin;
141   QLabel*           ZLab;
142   SMESHGUI_SpinBox* ZSpin;
143   QCheckBox*        MakeGroupsCheck;
144
145   QGroupBox*        GroupButtons;
146   QPushButton*      OkButton;
147   QPushButton*      ApplyButton;
148   QPushButton*      CloseButton;
149   QPushButton*      HelpButton;
150
151   QString           myHelpFileName;
152
153 protected slots:
154   void reject();
155
156 private slots:
157   void ConstructorsClicked (int);
158   void ClickOnOk();
159   bool ClickOnApply();
160   void ClickOnHelp();
161   void SetEditCurrentArgument();
162   void SelectionIntoArgument();
163   void DeactivateActiveDialog();
164   void ActivateThisDialog();
165   void onTextChange (const QString&);
166   void onSelectMesh();
167   void onAnglesCheck();
168   void onBasePointCheck();
169   void OnAngleAdded();
170   void OnAngleRemoved();
171 };
172
173 #endif // DIALOGBOX_EXTRUSION_PATH_H