Salome HOME
Porting SMESH module to Qt 4
[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 // File   : SMESHGUI_ExtrusionAlongPathDlg.h
23 // Author : Vadim SANDLER, Open CASCADE S.A.S.
24 //
25
26 #ifndef SMESHGUI_EXTRUSIONALONGPATHDLG_H
27 #define SMESHGUI_EXTRUSIONALONGPATHDLG_H
28
29 // SMESH includes
30 #include "SMESH_SMESHGUI.hxx"
31
32 // Qt includes
33 #include <QDialog>
34
35 // IDL includes
36 #include <SALOMEconfig.h>
37 #include CORBA_SERVER_HEADER(SMESH_Mesh)
38
39 class QButtonGroup;
40 class QRadioButton;
41 class QGroupBox;
42 class QLabel;
43 class QToolButton;
44 class QLineEdit;
45 class QCheckBox;
46 class QListWidget;
47 class QPushButton;
48
49 class SMESHGUI;
50 class SMESH_Actor;
51 class SMESHGUI_SpinBox;
52 class SVTK_Selector;
53 class LightApp_SelectionMgr;
54 class SUIT_SelectionFilter;
55
56 //=================================================================================
57 // class    : SMESHGUI_ExtrusionAlongPathDlg
58 // purpose  :
59 //=================================================================================
60 class SMESHGUI_EXPORT SMESHGUI_ExtrusionAlongPathDlg : public QDialog
61 {
62   Q_OBJECT
63
64   class SetBusy;
65   friend class SetBusy;
66
67 public:
68   SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* );
69   ~SMESHGUI_ExtrusionAlongPathDlg();
70
71   bool                      eventFilter( QObject*, QEvent* );
72
73 private:
74   void                      Init( bool = true );
75   void                      enterEvent( QEvent* );                           /* mouse enter the QWidget */
76   void                      keyPressEvent( QKeyEvent* );
77   int                       GetConstructorId();
78   void                      SetEditCurrentArgument( QToolButton* );
79
80   SMESHGUI*                 mySMESHGUI;            /* Current SMESHGUI object */
81   LightApp_SelectionMgr*    mySelectionMgr;        /* User shape selection */
82   SVTK_Selector*            mySelector;
83
84   QWidget*                  myEditCurrentArgument; /* Current  argument */
85
86   bool                      myBusy;
87   SMESH::SMESH_Mesh_var     myMesh;
88   SMESH_Actor*              myMeshActor;
89   SMESH::SMESH_IDSource_var myIDSource;
90   SMESH::SMESH_Mesh_var     myPathMesh;
91   GEOM::GEOM_Object_var     myPathShape;
92   SUIT_SelectionFilter*     myElementsFilter;
93   SUIT_SelectionFilter*     myPathMeshFilter;
94   int                       myType;
95
96   // widgets
97   QGroupBox*                ConstructorsBox;
98   QButtonGroup*             GroupConstructors;
99   QRadioButton*             Elements1dRB;
100   QRadioButton*             Elements2dRB;
101
102   QGroupBox*                GroupArguments;
103   QLabel*                   ElementsLab;
104   QToolButton*              SelectElementsButton;
105   QLineEdit*                ElementsLineEdit;
106   QCheckBox*                MeshCheck;
107   QGroupBox*                PathGrp;
108   QToolButton*              SelectPathMeshButton;
109   QLineEdit*                PathMeshLineEdit;
110   QToolButton*              SelectPathShapeButton;
111   QLineEdit*                PathShapeLineEdit;
112   QToolButton*              SelectStartPointButton;
113   QLineEdit*                StartPointLineEdit;
114   QGroupBox*                AnglesGrp;
115   QListWidget*              AnglesList;
116   QToolButton*              AddAngleButton;
117   QToolButton*              RemoveAngleButton;
118   SMESHGUI_SpinBox*         AngleSpin;
119   QGroupBox*                BasePointGrp;
120   QToolButton*              SelectBasePointButton;
121   SMESHGUI_SpinBox*         XSpin;
122   SMESHGUI_SpinBox*         YSpin;
123   SMESHGUI_SpinBox*         ZSpin;
124   QCheckBox*                MakeGroupsCheck;
125
126   QGroupBox*                GroupButtons;
127   QPushButton*              OkButton;
128   QPushButton*              ApplyButton;
129   QPushButton*              CloseButton;
130   QPushButton*              HelpButton;
131
132   QString                   myHelpFileName;
133
134 protected slots:
135   void                      reject();
136
137 private slots:
138   void                      ConstructorsClicked( int );
139   void                      ClickOnOk();
140   bool                      ClickOnApply();
141   void                      ClickOnHelp();
142   void                      SetEditCurrentArgument();
143   void                      SelectionIntoArgument();
144   void                      DeactivateActiveDialog();
145   void                      ActivateThisDialog();
146   void                      onTextChange( const QString& );
147   void                      onSelectMesh();
148   void                      OnAngleAdded();
149   void                      OnAngleRemoved();
150 };
151
152 #endif // SMESHGUI_EXTRUSIONALONGPATHDLG_H