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