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